diff -Nru clutter-0.8.4/aclocal.m4 clutter-0.9.0/aclocal.m4 --- clutter-0.8.4/aclocal.m4 2008-11-28 18:22:38.000000000 +0000 +++ clutter-0.9.0/aclocal.m4 2009-01-28 16:48:47.000000000 +0000 @@ -7878,6 +7878,40 @@ rm -f confinc confmf ]) +# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_PROG_CC_C_O +# -------------- +# Like AC_PROG_CC_C_O, but changed for automake. +AC_DEFUN([AM_PROG_CC_C_O], +[AC_REQUIRE([AC_PROG_CC_C_O])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +dnl Make sure AC_PROG_CC is never called again, or it will override our +dnl setting of CC. +m4_define([AC_PROG_CC], + [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) +]) + # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/ChangeLog /tmp/VXszleoOf1/clutter-0.9.0/ChangeLog --- clutter-0.8.4/ChangeLog 2008-12-01 11:36:17.000000000 +0000 +++ clutter-0.9.0/ChangeLog 2009-01-30 12:41:05.000000000 +0000 @@ -1,14598 +1,5004 @@ -======== Release 0.8.4 ======================================================== +# Generated by configure. Do no edit. -2008-12-01 Emmanuele Bassi +2009-01-30 Emmanuele Bassi - * NEWS: - * README: Release 0.8.4 - -2008-11-28 Emmanuele Bassi - - Bug 1291 - file name not given when invalid external json structure - loaded - - * clutter/json/json-parser.c: Add the name of the file to the - error messages, when using load_from_file(). - -2008-11-26 Emmanuele Bassi - - Merge from trunk: - - * clutter/clutter-group.c: - (clutter_group_real_raise), (clutter_group_real_lower): Repaint - the Group on raise and lower. - -2008-11-26 Neil Roberts - - * clutter/cogl/gl/cogl-texture.c (cogl_texture_rectangle): Fixed - the test for whether to use hardware tiling. Previously it assumed - that texture coordinates are in increasing order but this is not - the case since bug 1057 was fixed. The texture coordinates are now - sorted later. It also allowed negative coordinates which doesn't - make sense if the texture has waste. + * README: - Merged from trunk + Update README -2008-11-25 Emmanuele Bassi +2009-01-29 Robert Bragg - Merge from trunk: + * README: - * configure.ac: Remove stray dependency on gdk-pixbuf-xlib; we - don't use the xlib specific API anymore. (thanks to Matthias - Clasen) + Some updates for the 1.0 release notes regarding Cogl -2008-11-25 Neil Roberts +2009-01-29 Emmanuele Bassi - Bug 1299 - clutter_score_remove will segmentation fault if - timelines are more than 52 and continue to remove them + * Makefile.am: - Merge from trunk: + [build] Fix distcheck of ChangeLog - * clutter/clutter-score.c (traverse_children): Don't destroy the - entry in the handler for REMOVE_BY_ID. It will be removed again - anyway in the call to g_node_traverse. This was causing a - crash. Thanks to zhangwei for spotting. +2009-01-29 Emmanuele Bassi -2008-11-21 Neil Roberts + * clutter/cogl/common/Makefile.am: - Bug 1280 - clutter_score_append_at_marker lead to segmentation - fault in trunk and incorrect appearance in clutter-0.8 + Add cogl-material-private.h to the source files - Merge from trunk: +2009-01-29 Emmanuele Bassi - * clutter/clutter-score.c (start_children_entries): Check whether - the child timeline is actually attached at a marker before - comparing whether the marker's name matches the marker - reached. This fixes a crash that happens when a marker is reached - on a timeline that also has child timelines attached at the - end. Thanks to zhangwei for spotting. + * .gitignore: -2008-11-14 Emmanuele Bassi + [gitignore] Update ignore file - Merge from trunk: +2009-01-29 Emmanuele Bassi - Bug 1265 - ClutterScore doesn't emit 'started' signal (Bastian - Winkler) + * Makefile.am: + * build/gen-changelog.pl: - * clutter/clutter-score.c: Emit the ::started signal. + [build] Add automatic ChangeLog generation on dist - * tests/test-score.c: Check the emission of the Score signals +2009-01-29 Emmanuele Bassi -2008-11-13 Emmanuele Bassi + * clutter/cogl/common/cogl-primitives.c: - Merge from trunk: + Fix a variable masking warning - * clutter/clutter-media.c: Improve documentation of the - ClutterMedia interface. +2009-01-28 Emmanuele Bassi -2008-11-13 Emmanuele Bassi + * ChangeLog: + * ChangeLog.SVN: + * Makefile.am: - Merge from trunk: + Move the old ChangeLog into its own file - * clutter/clutter-behaviour-ellipse.c: - (clutter_behaviour_ellipse_applied): Do not reset the depth - of the actors to which the Ellipse behaviour has been applied - to, unless the behaviour is going to update it because it has - a tilt on the X or Y axis. +2009-01-29 Neil Roberts -2008-11-13 Neil Roberts + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl.c: - * clutter/cogl/gles/cogl-gles2-wrapper.h: - * clutter/cogl/gles/cogl-gles2-wrapper.c: - Initialise the 'tex' sampler uniform to 0. The GLSL spec - specifically says that you must initialize sampler uniforms. This - fixes texturing for GLES 2 when using the PowerVR simulator via - software Mesa. + [cogl] Add an NULL terminator to the call to + material_flush_gl_state - Merged from trunk. +2009-01-28 Robert Bragg -2008-11-13 Neil Roberts + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl-context.c: + * clutter/cogl/gles/cogl-texture.c: + * clutter/cogl/gles/cogl.c: - * clutter/clutter-actor.c (clutter_actor_get_paint_visibility): - Fix logic so that it won't return TRUE for a hidden stage. + Another Cogl gl vs gles normalizaion pass - Merged from trunk. +2009-01-27 Robert Bragg -2008-11-13 Neil Roberts + * clutter/cogl/cogl-color.h: + * clutter/cogl/common/cogl-color.c: - * clutter/clutter-actor.c (clutter_actor_get_reactive) - (clutter_actor_get_paint_visibility): Be sure to return exactly - TRUE or FALSE instead of zero or some non-zero value in these - functions that return a gboolean. Thanks to Kai Wei for spotting. + Removes cogl_color_set_from_4d as it may mislead people. - Merged from trunk. +2009-01-28 Robert Bragg -2008-11-12 Neil Roberts + * clutter/clutter-rectangle.c: + * clutter/clutter-text.c: + * clutter/cogl/cogl-path.h: + * clutter/cogl/common/cogl-primitives.c: + * clutter/cogl/gl/cogl-primitives.c: + * clutter/cogl/gles/cogl-primitives.c: + * clutter/cogl/gles/cogl.c: + * clutter/pango/cogl-pango-render.c: + * tests/conform/test-backface-culling.c: + * tests/conform/test-binding-pool.c: + * tests/interactive/test-binding-pool.c: + * tests/interactive/test-cogl-offscreen.c: + * tests/interactive/test-paint-wrapper.c: - Bug 1057 - cogl_texture_rectangle doesn't support backward - coordinates + Changes cogl_rectangle to take x1, y1, x2, y2 args not x1, y1, + width, height - Merge from trunk: +2009-01-28 Robert Bragg - * clutter/cogl/gl/cogl-texture.c: Instead of sorting the vertex - and texture coordinates passed to cogl_texture_rectangle, just - swap both sets whenever the texture coordinates are backward. + * clutter/cogl/gl/cogl-texture.c: -2008-11-07 Matthew Allum + Adds some debug code to _cogl_journal_flush_quad_batch - Bug 1238 - [PATCH] Pack bitfields in ClutterTexturePrivate +2009-01-28 Emmanuele Bassi - Merge from Trunk: + * doc/reference/clutter/clutter-animation-tutorial.xml: - * clutter/clutter-texture.c: + [clutter-docs] Update the animation tutorial - Using 'guint my_field : 1' for booleans to save space only - makes sense if you group all such fields together. Fix - grouping for ClutterTexturePrivate. Thanks to Owen Taylor for - patch. +2009-01-28 Emmanuele Bassi -2008-11-07 Matthew Allum + * doc/reference/cogl/cogl-docs.sgml: - Bug 1237 - clutter_texture_set_filter_quality calls - clutter_texture_[un]realize + [cogl-docs] Add the Materials section - Merge from Trunk: +2009-01-28 Emmanuele Bassi - * clutter/clutter-texture.c: (clutter_texture_set_filter_quality): - Call clutter_actor_[un]realize and keep visibility state. + * configure.ac: -2008-11-07 Matthew Allum + Update the pkg-config requires list - Merge from Trunk: +2009-01-28 Neil Roberts - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - * clutter/clutter-clone-texture.c: - * clutter/clutter-private.h: - * clutter/clutter-texture.c: - * clutter/x11/clutter-x11-texture-pixmap.c: + * clutter/clutter-deprecated.h: - Attempt to lower overhead of updating TFP's (particularly mipmaped). - Compresses mipmap updates only for visible TFPs. - Avoiding updates for non visible TFP's whilst keeping visible - clones working ok. + Undeprecate clutter_actor_set_scale_with_gravity -2008-11-06 Neil Roberts +2009-01-28 Neil Roberts - Bug 1230 - Pick fails on low precision color buffers - Merge from trunk: + Merge branch 'scale-center' - * clutter/clutter-main.c (_clutter_id_to_color): When using fuzzy - picking to pick a color for an actor, it would previously set the - fuzzy bit and then all but the most significant of the remaining - unused bits. This meant that for 16-bit displays it would end up - with a strange pattern for the unused bits like 1011 which could - cause it to round up. Now it just sets all but the most - significant of all of the unused bits giving a pattern like - 0111. Thanks to Guy Zadickario for the patch. +2009-01-28 Neil Roberts -2008-11-05 Emmanuele Bassi + * clutter/clutter-actor.c: - * clutter/clutter-texture.c: Remove unused function. + [clutter-actor] Use G_STMT_START/END instead of do { } while (0) -2008-11-04 Thomas Wood +2009-01-28 Emmanuele Bassi - Merge from trunk: + * NEWS: - * clutter/clutter-color.c (param_color_set_default): Set the no copy - flag when setting the default param spec value to prevent invalid - frees. + Update NEWS file - * clutter/clutter-color.[ch]: Add GParamSpec and GValue integration - for ClutterColor. With ClutterParamSpecColor it is possible to define - color properties; with the GValue integration it's possible to - automatically transform strings into colors and vice versa. +2009-01-28 Emmanuele Bassi - (clutter_color_free): Allow NULL parameter to match other boxed - types destructors. + * README: - (clutter_color_new): Add a constructor for the ClutterColor boxed - type, mostly for bindings. + Update the release notes for 1.0 +2009-01-28 Neil Roberts -2008-11-04 Emmanuele Bassi + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gles/cogl-texture.c: - Merge from trunk: + [cogl-texture] Fix order of tex coords when compensating for + waste - * clutter/clutter-script.c: Document the "is-default" member of - a ClutterStage definition. +2009-01-28 Neil Roberts -2008-11-04 Neil Roberts + * tests/conform/test-backface-culling.c: - Bug 1181 - In Score, timelines, appended at markers, are also - called on complete + [text-backface-culling] Fix width/height parameters to + cogl_rectangle - Merge from trunk: +2009-01-28 Neil Roberts - * clutter/clutter-score.c (start_children_entries): Use the name - of the marker to start as the data parameter and only start child - timelines that have the same marker name. Previously the - ClutterScore would just start all child entries when a marker was - reached or the timeline completed regardless of whether they were - added with a marker or not. Thanks to Mihail Naydenov for - reporting the bug. + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gles/cogl-texture.c: -2008-11-03 Neil Roberts + [cogl-texture] Reset size of vertex log after drawing a polygon - Bug 1207 - Timelines sometime miss markers +2009-01-28 Neil Roberts - Merge from trunk: + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gles/cogl-texture.c: - * clutter/clutter-timeline.c (timeline_timeout_func): Move the - code for firing the new-frame and marker-reached signals into a - separate static function so that it can also be called when the - last frame is reached. Also fix an issue where the frame numbers - were changed in the wrong direction when detecting missed markers - in a reversed timeline. Based on a patch by Michael Boccara. + Fix rectangles_with_multitexture_coords for sliced without tex + coords - * tests/test-timeline.c: Now tries to automatically verify whether - the test worked by keeping track of all the signal emissions. The - timelines are run a second time with an extra timeout that causes - delays to simulate skipped frames. +2009-01-28 Neil Roberts -2008-11-03 Emmanuele Bassi + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gles/cogl-texture.c: - Merge from trunk: + Fix _cogl_texture_unsliced_quad when no texture coordinates are + given - Bug 1200 - Crash with invalid DISPLAY +2009-01-28 Emmanuele Bassi - * clutter/clutter-main.c: Use the ClutterBackend wrapper API - instead of directly checking the class structure. + * clutter/cogl/gl/cogl-texture.c: - * clutter/glx/clutter-backend-glx.c: Return the correct value - in case of failure. + Reuse the layers list - * clutter/x11/clutter-backend-x11.c: Bail out if XOpenDisplay() - failed. +2009-01-28 Emmanuele Bassi -2008-10-31 Matthew Allum + * clutter/cogl/common/cogl-material.c: - Merge from trunk: + Remove gtk-doc annotation - * clutter/clutter-texture.c: (clutter_texture_set_filter_quality), - (clutter_texture_get_filter_quality): - Fix up some logic, typos. +2009-01-27 Emmanuele Bassi - * clutter/glx/clutter-glx-texture-pixmap.c: - Improve support for mipmaped TFP textures. + * clutter/clutter-clone.c: -2008-10-29 Neil Roberts + Fix typo in the :clone getter method - Bug 1074 - FBOs on GLES +2009-01-27 Emmanuele Bassi - Merge from trunk: + * README: - * clutter/cogl/gles/cogl-fbo.c: Copy the code from gl/cogl-fbo but - use the API calls directly instead of loading an extension because - it is part of the core in GLES 2. + Update the release notes for 1.0 - * clutter/cogl/gles/cogl.c (_cogl_features_init): Report - COGL_FEATURE_OFFSCREEN. +2009-01-28 Neil Roberts - * clutter/cogl/gles/cogl-fbo.h (CoglFbo): Add gl_stencil_handle. + * clutter/cogl/gles/cogl-texture.c: - * clutter/cogl/gles/cogl-context.h (CoglContext): Add - viewport_store + Fix building GLES after _cogl_texture_handle_from_pointer got + removed - * tests/test-fbo.c (make_shader): Conditionally use the GLES 2 - names of the shader variables +2009-01-27 Neil Roberts -2008-10-29 Neil Roberts + * clutter/clutter-main.c: + * clutter/clutter-private.h: - Bug 1206 - Picking disabled dithering + Directly set backend font options in clutter_set_font_flags - Merged from trunk: +2009-01-27 Neil Roberts - * clutter/clutter-main.c (_clutter_do_pick): After picking is - finished, restore the state of glEnable (GL_DITHER). Otherwise it - will cause the scene to look different after the first pick on low - depth displays. (Thanks to Michael Boccara for the patch) + * clutter/clutter-text.c: -2008-10-27 Neil Roberts + Listen for the font-changed signal on the backend in ClutterText - Bug 1196 - Texture border drawing problems +2009-01-27 Emmanuele Bassi - Merge from trunk: + * clutter/cogl/common/cogl-matrix.c: + * doc/reference/cogl/cogl-sections.txt: - * clutter/cogl/gl/cogl-texture.c (_cogl_texture_upload_subregion_to_gl) - (_cogl_texture_upload_to_gl): + [docs] Documentation fixes - * clutter/cogl/gles/cogl-texture.c (_cogl_texture_upload_to_gl) - (_cogl_texture_upload_subregion_to_gl): - - When uploading data to a sliced texture, fill the waste pixels - with copies of the edge of the real texture data. Otherwise the - value of the waste pixels are undefined so it will show artifacts - when the texture is scaled with GL_LINEAR and the pixels are - blended in. +2009-01-27 Emmanuele Bassi -2008-10-24 Emmanuele Bassi + * doc/reference/clutter/clutter-sections.txt: + * doc/reference/clutter/clutter.types: - Merge from trunk: + [docs] Update Clutter API reference symbols - Bug 1201 - test-depth.c:14: error: ‘raise’ redeclared as - different kind of symbol (Owen Taylor) +2009-01-27 Emmanuele Bassi - * tests/test-depth.c (raise_top), (main): Fix a shadowing - with raise() from signal.h. + * clutter/clutter-texture.h: -2008-10-21 Emmanuele Bassi + Removed unused conditional - Merge from trunk: +2009-01-27 Emmanuele Bassi - Bug 1197 - Missing const for clutter_init_with_args * - * clutter/clutter-main.[ch] (clutter_init_with_args): Constify - the string parameters. (Owen Taylor) + Merge branch 'generic-actor-clone' -2008-10-20 Emmanuele Bassi +2009-01-27 Emmanuele Bassi - Merge from trunk: + * clutter/clutter-clone-texture.c: + * clutter/cogl/common/cogl-handle.h: + * clutter/cogl/common/cogl-material.c: + * clutter/cogl/gl/cogl-context.c: + * clutter/cogl/gl/cogl-texture.c: + * tests/interactive/test-cogl-multitexture.c: - * configure.ac: Use gmodule-no-export-2.0, not gmodule-2.0, - to avoid breaking the symbol hiding. (thanks to Ross Burton - and Laurent Bigonville) + Fallout from cogl-material merge -2008-10-20 Neil Roberts +2009-01-27 Robert Bragg - Bug 1043 - COGL calls glTexSubImage2D() with out-of-bounds - values (SIGSEGV) + * clutter/cogl/cogl-types.h: - * clutter/cogl/gl/cogl-texture.c - (_cogl_texture_upload_subregion_to_gl): When iterating over the - slices, discard ones that don't intersect immediatly otherwise it - will call glTexSubImage2D with a negative width/height and then - move the source position incorrectly. Thanks to Gwenole - Beauchesne. (Backported from trunk) + Adds padding to CoglColor to future proof it a bit -2008-10-20 Neil Roberts +2009-01-26 Robert Bragg - Bug 1195 - ClutterBehaviourBspline only works for very short paths + * README: + * clutter/clutter-actor.c: + * clutter/cogl/cogl.h.in: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl.c: - * clutter/clutter-behaviour-bspline.c: Changed the CBZ_T_POW3 and - CBZ_T_MUL functions so that they preserve more of the least - significant bits. This fixes some of the jaggy behaviour with - longer paths. (Backported from trunk) + Support scaling on the z axis with cogl_scale -2008-09-25 Emmanuele Bassi +2009-01-27 Robert Bragg - * configure.ac: Post release bump to 0.8.3 -======== Release 0.8.2 ======================================================== + Merge branch 'cogl-material' -2008-09-25 Emmanuele Bassi +2009-01-27 Emmanuele Bassi - * configure.ac: - * README: - * NEWS: Release 0.8.2 + * clutter/Makefile.am: + * clutter/clutter-clone-texture.c: + * clutter/clutter-clone-texture.h: + * clutter/clutter-clone.c: + * clutter/clutter.h: + * doc/reference/clutter/clutter-docs.xml: + * doc/reference/clutter/clutter-sections.txt: + * tests/interactive/test-actors.c: + * tests/interactive/test-depth.c: + * tests/interactive/test-fbo.c: + * tests/interactive/test-layout.c: + * tests/interactive/test-paint-wrapper.c: -2008-09-25 Emmanuele Bassi + Remove CloneTexture from the API - * clutter/clutter-event.h: Fix missing documentation. +2009-01-27 Robert Bragg -2008-09-24 Emmanuele Bassi + * tests/interactive/Makefile.am: - Bug 1130 - CLUTTER_MOTION is not emitted when time goes backwards. + Removes test-simple from tests/interactive/Makefile.am - * clutter/clutter-main.c (clutter_do_event): Check for time - rollbacks inside the motion event throttling. (Pierce Liu) +2009-01-27 Neil Roberts -2008-09-23 Emmanuele Bassi + * clutter/clutter-deprecated.h: + * clutter/clutter-main.c: + * clutter/clutter-main.h: + * clutter/clutter-private.h: + * clutter/clutter-types.h: + * doc/reference/clutter/clutter-sections.txt: - * clutter/clutter-timeout-pool.c: Reword previous commit. + Replace clutter_set_use_mipmapped_text with + clutter_set_font_flags -2008-09-23 Emmanuele Bassi +2009-01-27 Emmanuele Bassi - * clutter/clutter-timeout-pool.c: - (clutter_timeout_pool_new): Fix previous commit: g_source_unref() - is not needed. (Thanks to Neil Roberts) + * tests/interactive/test-actor-clone.c: -2008-09-23 Emmanuele Bassi + [tests] Clean up the Clone interactive test - Bug 1154 - clutter_timeout_pool_new() documentation doesn't say - how to free +2009-01-26 Robert Bragg - * clutter/clutter-timeout-pool.c: Update the documentation to - note that you must use g_source_unref() to free the timeout - pool. (Murray Cumming) + * clutter/clutter-clone-texture.c: + * clutter/clutter-texture.c: -2008-09-23 Emmanuele Bassi + clutter-{clone-,}texture weren't updating their material opacity. - Bug 1124 - Clutter causes an additional size request in each - allocation +2009-01-26 Robert Bragg - * clutter/clutter-actor.c: - (clutter_actor_store_old_geometry): Store the allocation instead - of causing a new size-request cycle. (Johan Bilien) + * clutter/cogl/common/cogl-material.c: + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gles/cogl-context.c: + * clutter/cogl/gles/cogl-context.h: + * clutter/cogl/gles/cogl-gles2-wrapper.h: + * clutter/cogl/gles/cogl-internal.h: + * clutter/cogl/gles/cogl-primitives.c: + * clutter/cogl/gles/cogl-texture-private.h: + * clutter/cogl/gles/cogl-texture.c: + * clutter/cogl/gles/cogl.c: -2008-09-23 Emmanuele Bassi + Updates GLES1 support for CoglMaterial - Bug 1125 - Save an extra pango_layout_get_size in many cases +2009-01-24 Robert Bragg - * clutter/clutter-label.c: - (clutter_label_create_layout_no_cache): Add a simple check - before calling pango_layout_get_size(). (Johan Bilien) + * clutter/cogl/gl/cogl-primitives.c: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl-context.c: + * clutter/cogl/gles/cogl-fbo.c: + * clutter/cogl/gles/cogl-primitives.c: + * clutter/cogl/gles/cogl-texture.c: + * clutter/cogl/gles/cogl.c: -2008-09-23 Emmanuele Bassi + Normalizes gl vs gles code in preperation for synching material + changes - * clutter/clutter-alpha.c: - (clutter_alpha_get_alpha): Do not return the cached value but - just compute the current alpha value. The use case is pretty - much straightforward: stop a timeline, advance it, and retrieve - the alpha value before starting the timeline to adjust an - animation dependent on the alpha. Caching the alpha value is - not needed because the behaviours will always pass the alpha - value inside the ::alpha-notify virtual function anyway, so - there is no need for them to call clutter_alpha_get_alpha(). +2009-01-24 Robert Bragg - This change makes it also possible to reliably unit-test - ClutterAlpha. + * README: + * clutter/cogl/cogl.h.in: + * clutter/cogl/common/cogl-material.c: + * clutter/cogl/gl/cogl-context.c: + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl.c: - (timeline_new_frame_cb): Call clutter_alpha_get_alpha(). + Removes cogl_blend_func and cogl_alpha_func -2008-09-23 Tomas Frydrych +2009-01-23 Robert Bragg + * README: + * clutter/clutter-clone-texture.c: * clutter/clutter-main.c: - * clutter/clutter-main.h: - * clutter/clutter-private.h: - * clutter/x11/clutter-backend-x11.c: - (clutter_get_option_group_without_init): - Function to obtain clutter option group without opening display - (for use with foreign display and gtk_clutter_init). Bug 1033. - - Stripped trailing whitespace. - -2008-09-22 Neil Roberts + * clutter/clutter-texture.c: + * clutter/cogl/cogl-material.h: + * clutter/cogl/cogl-path.h: + * clutter/cogl/cogl-texture.h: + * clutter/cogl/cogl.h.in: + * clutter/cogl/common/cogl-material-private.h: + * clutter/cogl/common/cogl-material.c: + * clutter/cogl/common/cogl-primitives.c: + * clutter/cogl/common/cogl-vertex-buffer.c: + * clutter/cogl/gl/cogl-context.c: + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gl/cogl-internal.h: + * clutter/cogl/gl/cogl-primitives.c: + * clutter/cogl/gl/cogl-texture-private.h: + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gl/cogl.c: + * clutter/pango/cogl-pango-render.c: + * tests/conform/test-backface-culling.c: + * tests/interactive/Makefile.am: + * tests/interactive/test-clip.c: + * tests/interactive/test-cogl-material.c: + * tests/interactive/test-cogl-multitexture.c: + * tests/interactive/test-cogl-offscreen.c: + * tests/interactive/test-cogl-tex-convert.c: + * tests/interactive/test-cogl-tex-foreign.c: + * tests/interactive/test-cogl-tex-getset.c: + * tests/interactive/test-cogl-tex-polygon.c: + * tests/interactive/test-cogl-tex-tile.c: - Bug 856 - Teardown sequence is borked + Fully integrates CoglMaterial throughout the rest of Cogl - * clutter/clutter-main.c: Don't free the ClutterMainContext so - that the main loop can be restarted. +2009-01-26 Emmanuele Bassi - * clutter/eglx/clutter-backend-egl.c: - * clutter/eglnative/clutter-backend-egl.c: Register an atexit - handler which disposes the backend object so that we are still - guaranteed to call eglTerminate on GLES. + * clutter/clutter-clone.c: + * clutter/clutter-clone.h: + * tests/interactive/test-actor-clone.c: -2008-09-22 Neil Roberts + Rename ActorClone to Clone/2 - * tests/test-unproject.c (on_event): - * tests/test-project.c (on_event): Use a return value for the - 'event' signal handler, otherwise it might accidentally return - TRUE for unhandled events and you won't be able to close the - window. +2009-01-27 Emmanuele Bassi -2008-09-19 Emmanuele Bassi + * tests/conform/test-timeline.c: - Bug 1033 - Manually parsing command line options prevents - initializing clutter + [tests] Remove an unused variable - * clutter/clutter-main.c: - (post_parse_hook), (clutter_init_with_args), - (clutter_parse_args), (clutter_init): Move the initialization - of Clutter at the end of the post-parse hook of Clutter's - GOptionGroup. Clutter must be initialized at the end of the - argument parsing. +2009-01-27 Emmanuele Bassi -2008-09-19 Emmanuele Bassi + * clutter/clutter-timeline.c: - * clutter/clutter-main.c: Properly document the - clutter_get_option_group() function and the invariant that - after parsing Clutter's option group the library will be - initialized. (Thanks to Tomas Frydrych for pointing this - out) + Bug 1388 - Clarify signal emission for advance_to_marker() -2008-09-19 Emmanuele Bassi +2009-01-27 Emmanuele Bassi - * clutter/x11/clutter-backend-x11.c: Properly document the - usage of clutter_x11_set_display(). + * clutter/clutter-timeline.c: - * clutter/x11/clutter-x11.h: clutter_x11_set_display() is - public API and should be declared in the header we install. + Bug 1387 - Clarify new-frame signal emission with advance() -2008-09-18 Neil Roberts +2009-01-27 Emmanuele Bassi - Bug 1048 - SIGFPE in cogl_texture_set_region() with nvidia + * clutter/clutter-timeline.c: - * clutter/cogl/gl/cogl-texture.c (cogl_texture_set_region): - * clutter/cogl/gles/cogl-texture.c (cogl_texture_set_region): - Don't attempt to upload any data if the width or height of the - subregion is zero. Thanks to Gwenole Beauchesne. + [timeline] Check the fps property range in the ctor -2008-09-18 Neil Roberts +2009-01-27 Emmanuele Bassi - Bug 1044 - cogl_get_viewport error + * clutter/clutter-timeline.c: - * clutter/cogl/gles/cogl.c (cogl_get_viewport): Use glGetIntegerv - instead of glGetFixedv to read the viewport because the latter - converts incorrectly on some hardware. + [timeline] Move a complex condition into its own function -2008-09-18 Neil Roberts +2009-01-27 Emmanuele Bassi - Bug 1080 - clutter_stage_read_pixels has upside-down y coordinate + * clutter/clutter-timeline.c: - * clutter/clutter-stage.c (clutter_stage_read_pixels): Use - OpenGL's coordinate system for the arguments to glReadPixels (so - that y zero is the bottom of the window). Use clutter_redraw - instead of clutter_stage_paint to ensure the right GL context is - selected. Set some of the glPixelStore parameters that might have - been changed by Cogl. + [timeline] Intern signal names - * tests/test-stage-read-pixels.c: Replace with a different test - that gets a sub-region of the stage around the cursor. +2009-01-27 Emmanuele Bassi -2008-09-17 Neil Roberts + * clutter/clutter-timeline.c: - Bug 1145 - Flicker on resize the window + [timeline] Whitespace fixes - * clutter/glx/clutter-stage-glx.c (clutter_stage_glx_realize): - Don't set a backing pixel on the X window. Otherwise when the - window resizes it will flicker when X paints the background - immediatly before Clutter repaints the whole stage. +2009-01-27 Emmanuele Bassi -2008-09-17 Neil Roberts + * clutter/clutter-timeline.c: - * clutter/clutter-types.h: Swap left and right in the - documentation for ClutterGravity. + [timeline] Documentation and comment fixes -2008-09-17 Neil Roberts +2009-01-23 Emmanuele Bassi - Bug 1121 - Setting anchor point doesn't work if set too early + * tests/conform/test-timeline.c: - * clutter/clutter-actor.c - (clutter_actor_set_anchor_point_from_gravity) - (clutter_actor_move_anchor_point_from_gravity): Add documentation - to make it clear that the anchor point won't move when the actor - is resized. + [tests] Assert as soon as possible -2008-09-16 Neil Roberts +2009-01-23 Emmanuele Bassi - Bug 1100 - WM_SIZE not handled correctly, user_resize and - window_style correction. + * clutter/clutter-timeline.c: - * clutter/win32/clutter-stage-win32.c (get_window_style): Remove - the WS_MAXIMIZEBOX style if the stage isn't resizable. - (clutter_stage_win32_set_user_resize): Queue a redraw of the - window frame when the user_resize property is changed. - - * clutter/win32/clutter-event-win32.c (message_translate): Don't - update the size of the stage when handling WM_SIZE messages that - result from the stage being minimized. Thanks to Roman Yazmin. + [timeline] Create markers hash tables on demand -2008-09-16 Tomas Frydrych +2009-01-23 Emmanuele Bassi - * clutter/glx/clutter-glx-texture-pixmap.c: - * clutter/x11/clutter-x11-texture-pixmap.c: - TFP resyncing on MapNotify/ConfigureNotify (bug 1020; patch by - Andy Wingo ). - -2008-09-15 Øyvind Kolås + * clutter/clutter-timeline.c: - * clutter/clutter-main.c: amended typo in gtk-doc. + [timeline] Limit timelines to 1000 frames per second -2008-09-12 Neil Roberts +2009-01-26 Havoc Pennington - Bug 1034 - Picking doesn't work on Eee PC + * clutter/clutter-texture.c: - * clutter/clutter-main.c (_clutter_id_to_color): When choosing a - pick color, set all but the most significant of the unused - bits. This should make make it more likely that the GL - implementation will round down to the right value. - - * tests/test-pick.c: Test case for picking. It creates 192 actors - at known positions and stores their gids. It then calls - clutter_stage_get_actor_at_pos with each position to check that - the right gid is returned. + Bug 1414 - avoid relayout of ClutterTexture if not syncing size - * tests/Makefile.am (noinst_PROGRAMS): Add test-pick +2009-01-26 Havoc Pennington -2008-09-12 Neil Roberts + * clutter/clutter-actor.c: - Bug 1010 - ClutterLabel does not update the layout (again) + Bug 1415 - short-circuit setting same clip again - * clutter/clutter-label.c: Bring back layout caching. This time it - will cache up to three different layouts. The width for which each - layout was generated is stored so that if the same width is - requested again it can use the cached version. If no cached - version is available it will try to replace the oldest - layout. 'Age' is determined by a counter which is incremented - every time a layout is created. The cache is cleared after any - property changes that might affect the layout. - (struct _ClutterLabelPrivate): Removed extents_width, - extents_height and context because they weren't used anywhere. - - * tests/test-label-cache.c: Add a test which checks whether the - label is using a different layout when properties are - changed. Also compares the extents of the label's layout with an - independent layout and fails if they aren't the same. +2009-01-21 Neil Roberts - * tests/Makefile.am (noinst_PROGRAMS): Add test-label-cache + * clutter/clutter-stage.c: -2008-09-10 Neil Roberts + Set the SYNC_MATRICES flag when a stage is first realized - Bug 1137 - Setting the anchor point does not trigger a re-paint +2009-01-26 Emmanuele Bassi - * clutter/clutter-actor.c (clutter_actor_set_property): When - changing the anchor point properties, use set_anchor_pointu - instead of changing the value directly so that a redraw will be - queued. - (clutter_actor_set_anchor_pointu): Queue a redraw when the anchor - point is changed. Thanks to Johan Bilien. + * clutter/Makefile.am: + * clutter/clutter-actor-clone.c: + * clutter/clutter-actor-clone.h: + * clutter/clutter-clone.c: + * clutter/clutter-clone.h: + * clutter/clutter.h: -2008-08-27 Emmanuele Bassi + Rename ActorClone to Clone/1 - Bug 1082 - Texture bitmap is destroyed in wrong way +2009-01-23 Emmanuele Bassi - * clutter/cogl/common/cogl-bitmap-pixbuf.c: - (_cogl_bitmap_from_file): Make a copy of the pixbuf data in - the internal image loader so that we can keep working under - the assumption that we are using the GLib memory allocation - and deallocation functions. + * clutter/clutter-behaviour-ellipse.c: -2008-08-27 Emmanuele Bassi + Whitespace fixes for BehaviourEllipse - Bug 1099 - No ClutterScript API to get a list of IDs in a given file +2009-01-23 Emmanuele Bassi - * clutter/clutter-script.[ch]: Add clutter_script_list_objects(), - a function for retrieving all the objects built by a ClutterScript - instance. (Based on a patch by Noah Gibbs) + * clutter/clutter-behaviour.c: -2008-08-26 Emmanuele Bassi + Bug 1395 - apply and get_nth_actor are inconsistent - Bug 1090 - Label somtimes returns natural_width < min_width +2009-01-24 Neil Roberts - * clutter/clutter-label.c: - (clutter_label_get_preferred_width): Check that the width of the - layout is always greater than 0. (Johan Bilien) + * clutter/cogl/common/cogl-primitives.h: + * clutter/cogl/gles/cogl-primitives.c: -2008-08-19 Neil Roberts + Fix the Cogl primitives for the GLES backend - Bug 1103 - Two typos in clutter documentation +2009-01-23 Neil Roberts - * doc/reference/clutter/subclassing-ClutterActor.xml: Update the - custom actor example since the Cogl API was changed to namespace - all of the path related functions in cogl_path_*. Thanks to Nati - Berkover. - - * clutter/clutter-score.c: Add missing parameter in example of - calling clutter_score_start(). + * tests/interactive/test-cogl-primitives.c: -2008-08-18 Neil Roberts + Simplify test-cogl-primitives - Bug 1085 - Cursor is in wrong position on ClutterEntry if set - x-align property +2009-01-23 Neil Roberts - * clutter/clutter-entry.c (clutter_entry_paint): When calculating - the position to draw the cursor at, take into account the - alignment of the text. Queue a redraw when the x-align property is - changed. + * tests/interactive/test-cogl-primitives.c: -2008-08-07 Neil Roberts + [test-cogl-primitives] Remove trailing whitespace - Bug 1091 - WM_MOUSEWHEEL (scroll-event) not handled correctlly +2009-01-23 Neil Roberts - * clutter/win32/clutter-event-win32.c (message_translate): The - coordinates in a WM_MOUSEWEEL message are given relative to the - screen so they need to be converted to client coordinates before - use. Thanks to Roman Yazmin. + * clutter/clutter-timeline.c: -2008-08-06 Emmanuele Bassi + [clutter-timeline] Remove the code for backwards timelines in + get_progress - * clutter/clutter-child-meta.c: - (clutter_child_meta_set_property), - (clutter_child_meta_class_init): Make the :container and - :actor properties of ChildMeta construct-only, to allow - bindings to actually use ChildMeta without abusing the API. - - * clutter/clutter-container.c (create_child_meta): Instead of - setting the members of the ChildMeta structure, use the - constructor properties. +2009-01-23 Neil Roberts -2008-08-04 Emmanuele Bassi + * clutter/clutter-actor.c: + * doc/reference/clutter/clutter-sections.txt: - * clutter/clutter-keysyms.h: Resync with keysymdef.h inside Xorg. + Fix gtk-doc reference since the anchor point changes -2008-08-04 Emmanuele Bassi +2009-01-23 Neil Roberts - * clutter/clutter-script.c: - (clutter_script_default_connect): Improve wording and debug - messages in the default autoconnection for signal handlers. + * tests/conform/test-anchors.c: -2008-08-04 Emmanuele Bassi + [test-anchors] Add tests for the rotation centers - * clutter/clutter-script-parser.c: - * clutter/clutter-script-private.h: Clean up the code; add a - conversion function for reading a ClutterColor out of a - JSON object or array definition. +2009-01-23 Neil Roberts - * clutter/clutter-script.c: Clean up the code; document properly - how we translate from type name to type function. + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + * clutter/clutter-behaviour-rotate.c: -2008-08-04 Emmanuele Bassi + Convert the rotation centers to be AnchorCoords - * clutter/clutter-main.c: Rework and improve the documentation - of the thread-safe timeout and idle source installer functions. +2009-01-23 Neil Roberts -2008-08-01 Neil Roberts + * tests/conform/test-anchors.c: - Bug 945 - Clipping+fbo cloning bugs + [test-anchors] Add tests for the scale center - * clutter/cogl/gl/cogl.c: - * clutter/cogl/gles/cogl.c: - * clutter/cogl/cogl.h.in: Add cogl_clip_stack_save, - cogl_clip_stack_restore, cogl_viewport and cogl_frustum. - - * clutter/cogl/gl/cogl-fbo.h: - * clutter/cogl/gl/cogl-fbo.c: Try to attach a stencil buffer when - creating an FBO. - - * clutter/cogl/common/cogl-clip-stack.c: Add functions to save and - restore the whole state of the stack. - - * clutter/clutter-texture.c (clutter_texture_paint): When - rendering the FBO source, setup a temporary asymmetric perspective - projection matrix to render it as it would appear on screen. - - * clutter/clutter-private.h: - * clutter/clutter-actor.c - (_clutter_actor_apply_modelview_transform_recursive): No longer - static and exported in clutter-private.h +2009-01-23 Neil Roberts -2008-08-01 Neil Roberts + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + * clutter/clutter-behaviour-scale.c: - Bug 1071 - clutter_timeline_get_duration doesn't always work + Add a scale center property to ClutterActor - * clutter/clutter-timeline.c: Calculate the 'duration' property - on-demand instead of storing it as a member variable. Notify - duration property changes whenever the fps or num_frames changes. +2009-01-22 Neil Roberts -2008-08-01 Neil Roberts + * tests/conform/Makefile.am: + * tests/conform/test-anchors.c: + * tests/conform/test-conform-main.c: - Bug 1069 - Warnings with ClutterScore + Add a conformance test for the anchor point - * clutter/clutter-score.c (clutter_score_is_playing): Check - whether priv->running_timelines is NULL before checking its - length. - (foreach_running_timeline): Remove the completed signal handler - when stopping the score. Otherwise the completed callback will get - called multiple times if the timeline is started later. +2009-01-22 Neil Roberts -2008-07-31 Neil Roberts + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: - Bug 1075 - Difficult to bind clutter_stage_new + Store when the anchor point is set from a gravity - * clutter/clutter-stage.c (clutter_stage_dispose): Unrealize the - stage before removing the update idle handler. Otherwise - unrealizing causes another redraw to be queued and if the stage - object remains alive it will cause an assert and abort. +2009-01-23 Neil Roberts -2008-07-30 Neil Roberts + * tests/micro-bench/test-text.c: - * clutter/clutter-stage.c (clutter_stage_class_init): Added the - 'perspective' property. All of the machinery was there to - implement the property but somehow the call that actually installs - it was missing. + [test-text] Use g_setenv instead of setenv -2008-07-30 Emmanuele Bassi +2009-01-23 Robert Bragg - * clutter/clutter-fixed.h: - * clutter/clutter-units.h: Fix the upper and lower boundaries of - ClutterFixed and ClutterUnit types; G_MAXINT16 and G_MININT16 - were not enough to describe those values. -2008-07-30 Ross Burton + Merge commit 'origin/master' into cogl-material - * clutter/clutter-main.c: - Destroy the debugging timer when the context is freed. +2009-01-23 Emmanuele Bassi + * clutter/clutter-deprecated.h: * clutter/clutter-stage.c: - Free the stage title when the stage is finalized. + * clutter/clutter-stage.h: + * doc/reference/clutter/clutter-sections.txt: -2008-07-30 Neil Roberts + Bug 1361 - Unused ClutterStage::get_resolution() methods - * clutter/clutter-model.c (clutter_model_set_sorting_column): This - function is supposed to accept -1 to disable sorting. However it - checks for whether the column is >= the number of columns, but - clutter_model_get_n_columns() returns an unsigned int so the - column number also gets promoted to unsigned for the - comparison. Therefore -1 is always greater than the number of - columns so it wouldn't let you set it. +2009-01-23 Emmanuele Bassi -2008-07-26 Neil Roberts + * tests/conform/Makefile.am: - * clutter/clutter-timeline.c (clutter_timeline_list_markers): When - requesting the list of markers it was returning the marker data as - a string instead of the name so it was copying garbage. + Clean up the test reports -2008-07-25 Neil Roberts +2009-01-23 Emmanuele Bassi - * clutter/clutter-actor.c (clutter_actor_remove_clip) - (clutter_actor_set_clipu): Queue a redraw when the clip is - changed. + * clutter/Makefile.am: + * clutter/cogl/common/Makefile.am: + * clutter/cogl/gl/Makefile.am: + * clutter/cogl/gles/Makefile.am: + * clutter/pango/Makefile.am: + * configure.ac: + * tests/conform/Makefile.am: + * tests/interactive/Makefile.am: + * tests/micro-bench/Makefile.am: -2008-07-24 Neil Roberts + Split maintainer-flags from the compiler flags - * clutter/clutter-script.c: The example in the documentation - showed a color being specified as '0xff0000ff' but it should be - '#ff0000ff' +2009-01-23 Emmanuele Bassi -2008-07-23 Emmanuele Bassi + * clutter/clutter-behaviour-depth.c: + * clutter/cogl/common/cogl-primitives.c: + * clutter/cogl/gl/cogl-texture.c: + * tests/interactive/test-cogl-primitives.c: + * tests/interactive/test-cogl-tex-tile.c: - Bug 1062 - clutter_actor_query_coords() replacement in 0.8 + Fix compiler warnings - * clutter/clutter-deprecated.h: Fix the deprecation warning - for clutter_actor_query_coords(). (Gwenole Beauchesne) +2009-01-23 Emmanuele Bassi -2008-07-17 Emmanuele Bassi - Bug 1047 - API documentation from release tarball is not - installed by "make install" + Merge branch 'float-alpha-value' - * configure.ac: - * Makefile.am: Make the recursion into the documentation - directory depend on on whether we explicitly enable it or - if we are not inside an SVN checkout. +2009-01-23 Emmanuele Bassi -2008-07-17 Neil Roberts + * clutter/clutter-actor.c: - * clutter/clutter-texture.c: - * clutter/clutter-rectangle.c: - * clutter/clutter-group.c: - * clutter/clutter-entry.c: - * clutter/clutter-clone-texture.c: Remove unnecessary calls to - cogl_{push,pop}_matrix. The matrix is preserved in - clutter_actor_paint whenever the actor's transformation is applied - so there should be no need to push the matrix in actor paint - implementations unless it does some additional transformations - itself. + [actor] Add the ::pick signal to the Actor class -2008-07-16 Emmanuele Bassi +2009-01-22 Neil Roberts - * clutter.pc.in: Add a variable containing the COGL backend - inside the pkg-config file, for configure-time checks. + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gles/cogl-texture.c: -2008-07-14 Neil Roberts + Fix some failures from the fixed-to-float script in cogl-texture - * clutter/cogl/common/cogl-primitives.c (cogl_path_rel_curve_to): - Fixed a typo in the second parameter which meant the curve was - drawn incorrectly. +2009-01-22 Emmanuele Bassi -2008-07-14 Emmanuele Bassi + * .gitignore: - * clutter/clutter.h: Include missing installed files. + [gitignore] Update ignore file with the new tests -2008-07-14 Tomas Frydrych +2009-01-22 Emmanuele Bassi - * clutter/clutter-stage.c: - (clutter_stage_hide_cursor): - Fixed C&P bug that made it impossible to show cursor once hidden. + * tests/conform/test-backface-culling.c: - Stripped trailing whitespace. + [tests] Use the right value in cogl_texture_new* -2008-07-13 Matthew Allum +2009-01-22 Emmanuele Bassi - * clutter/x11/clutter-x11-texture-pixmap.c: - Call XSync in unredirect X error trap (Thanks to Andy Wingo) + * clutter/cogl/common/cogl-fixed.c: -2008-07-13 Neil Roberts + Improve accuracy of clutter_sinx() - * build/mingw/mingw-cross-compile.sh: Avoid using the --strip - option to tar because it isn't supported in the version shipped - with MSYS. +2009-01-22 Emmanuele Bassi -2008-07-11 Tomas Frydrych + * clutter/clutter-actor.c: - * clutter/clutter-fixed.c: - Move G_IMPLEMENT_INLINES before all other #include statements (bug - #1038). + Use the allocation to get the pick area -2008-07-11 Tomas Frydrych +2009-01-22 Emmanuele Bassi - * clutter/clutter-fixed.c: - Changed #define G_IMPLEMENTS_INLINES to G_IMPLEMENT_INLINES (bug - #1038). + * clutter/cogl/gles/cogl.c: -2008-07-10 Emmanuele Bassi + [gles] Fix computation of camera distance - * configure.ac: Post release bump to 0.3.1. +2009-01-22 Owen W. Taylor -======== Release 0.8.0 ======================================================== + * clutter/cogl/gl/cogl.c: -2008-07-10 Emmanuele Bassi + Fix computation of camera distance - * configure.ac: - * NEWS: Release 0.8.0. +2009-01-22 Emmanuele Bassi -2008-07-10 Matthew Allum + * clutter/clutter-actor.c: - * clutter/cogl/gles/cogl-fbo.c: - * clutter/cogl/gles/cogl-texture.c: - Fix warnings with eglnative build + Avoid needlessly queue redraws for invisible actors -2008-07-10 Matthew Allum +2009-01-22 Jason Tackaberry - * README: - Sync up/improve ready for 0.8 release. + * clutter/clutter-stage.c: - * AUTHORS: - Sync up to date - hope I havn't missed anyone.. + Bug 1409 - Use G_SIGNAL_RUN_LAST with ::queue-redraw signal -2008-07-10 Matthew Allum +2009-01-22 Emmanuele Bassi - * clutter/glx/clutter-glx-texture-pixmap.c: - Assume TFP npots sized textures are always supported if TFP ext is! - (Based on patch from James Ketrenos) + * clutter/clutter-texture.c: -2008-07-08 Matthew Allum + Fix typo in the flags update - Bug 1011 - Fix TFP fallback mechanism (take 2) +2009-01-22 Emmanuele Bassi - * clutter/glx/clutter-glx-texture-pixmap.c: - * tests/test-pixmap.c: - Slightly modified patch from Gwenole Beauchesne applied - to better handle both falling back to non accelerated tfp - and improvements to the test case. + * clutter/clutter-units.c: -2008-07-07 Matthew Allum + [units] Fix Units in GValue and ClutterParamSpecUnit - Bug 1016 - Changing window-redirect-automatic property after - creating ClutterX11TexturePixmap doesn't work. +2009-01-22 Emmanuele Bassi - * clutter/x11/clutter-x11-texture-pixmap.c: - (clutter_x11_texture_pixmap_set_window): - Sync up redirection prop correctly (Jason Tackaberry) + * clutter/clutter-behaviour-ellipse.c: -2008-07-07 Matthew Allum + Fix the format for a floating point value - Bug 1019 - clutter-frame-source.h not included by clutter.h +2009-01-22 Emmanuele Bassi - * clutter/clutter.h: - Add missing header include. + * clutter/clutter-backend.c: + * clutter/clutter-private.h: + * clutter/clutter-units.c: -2008-07-05 Neil Roberts + Store the units-per-em inside the Backend - * clutter/clutter-actor.h: Remove redundant duplicate declaration - of clutter_actor_allocate_preferred_size +2009-01-21 Emmanuele Bassi -2008-07-05 Emmanuele Bassi + * clutter/clutter-event.h: - Bug 1033 - Manually parsing command line options prevents - initializing clutter (Armin Burgmeier) + [docs] Specify the coordinate space of ButtonEvent - * clutter/clutter-main.c: - (post_parse_hook), (clutter_init_real): Set the is_initialized - flag inside the real initialization function. +2009-01-21 Emmanuele Bassi -2008-07-04 Emmanuele Bassi + * clutter/clutter-units.c: + * clutter/clutter-units.h: + * doc/reference/clutter/clutter-sections.txt: - * clutter/clutter-label.c: Properly document the behaviour - of the :alignment property. + Add units-from-em conversion -2008-07-04 Neil Roberts +2009-01-21 Emmanuele Bassi - * build/mingw/mingw-cross-compile.sh: Default to the win32 flavour - instead of the SDL flavour + * clutter/clutter-actor.c: + * clutter/clutter-units.c: + * clutter/clutter-units.h: + * doc/reference/clutter/clutter-sections.txt: -2008-07-04 Neil Roberts + Remove the single-stage units converters - Bug 1015 - Cloning unparented actors with FBOs doesn't work with - new layout code +2009-01-21 Emmanuele Bassi - * clutter/clutter-texture.c (clutter_texture_new_from_actor): Now - parents the source actor if it doesn't already have a parent so - that it will get an allocation during layout. + * clutter/cogl/cogl-texture.h: + * clutter/cogl/cogl-vertex-buffer.h: + * doc/reference/clutter/clutter-sections.txt: + * doc/reference/cogl/cogl-docs.sgml: + * doc/reference/cogl/cogl-sections.txt: - * tests/test-fbo.c: One of the tests tries to ensure that the - ClutterTexture clone keeps the source actor alive by derefing - it. However as actors have a floating reference then test-fbo - doesn't have its own reference once the source is parented so - unrefing just steals the parent's reference and causes - badness. The test now claims the floating reference before cloning - the source so that it can safely be unref'd later. + [docs] Remove sources of warnings in API references -2008-07-03 Emmanuele Bassi +2009-01-21 Emmanuele Bassi - * clutter/x11/Makefile.am: Fix distchecking by adding the - generated enum types files to DISTCLEANFILES. + * doc/reference/cogl/cogl-sections.txt: -2008-07-03 Tomas Frydrych + [docs] Add CoglTextureFlags to the API reference - * clutter/clutter-fixed.h: - * clutter/clutter-fixed.c - Fixed inlining of clutter_qmulx() and clutter_qdivx() (bug 1022). +2009-01-21 Emmanuele Bassi -2008-07-03 Neil Roberts + * doc/reference/Makefile.am: - * clutter/clutter-shader.c (bind_glsl_shader): Fix a cut-and-paste - error which broke vertex shaders + [docs] Build COGL API reference first -2008-07-03 Øyvind Kolås +2009-01-18 Emmanuele Bassi - * clutter/cogl/common/cogl-bitmap-pixbuf.c: - (_cogl_bitmap_from_file): removed debug g_printf that announces each - successful image load done by the internal image backend. + * tests/interactive/test-clip.c: + * tests/interactive/test-cogl-offscreen.c: + * tests/interactive/test-cogl-tex-convert.c: + * tests/interactive/test-cogl-tex-getset.c: + * tests/interactive/test-cogl-tex-polygon.c: + * tests/interactive/test-cogl-tex-tile.c: -2008-07-02 Neil Roberts + [tests] Update the tests calling cogl_texture_new_* - * clutter/clutter-actor.c - (clutter_actor_get_abs_allocation_vertices): The initialization of - the local stage pointer got moved away in revision 3081 so it was - crashing if the function is called before the layout is run. +2009-01-18 Emmanuele Bassi -2008-07-02 Emmanuele Bassi + * clutter/clutter-texture.c: + * clutter/cogl/cogl-texture.h: + * clutter/cogl/cogl-types.h: + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gles/cogl-texture.c: + * clutter/pango/cogl-pango-glyph-cache.c: - * clutter/clutter-label.c: - (clutter_label_create_layout_no_cache), - (clutter_label_create_layout): Split the layout creation in two - functions: one creating the layout, the other creating the layout - and hitting the glyphs cache. The first one is for the offscren - operations - like requesting the preferred size; the second one - is for paint and allocation. + Change the COGL texture constructor to use flags - (clutter_label_allocate): Try to aggressively cache the PangoLayout - between allocations - to avoid recreating it even when the label - just moved because of an animation. See bug #1010. +2009-01-16 Emmanuele Bassi -2008-07-02 Øyvind Kolås + * doc/reference/clutter/clutter-sections.txt: - * clutter/fruity/clutter-fruity.c: made the multi touch code more - robust. There are situations though where the device seems to stop - generating any touch events until all fingers have been lifted and - a new interaction session is started. + [docs] Update ClutterMedia section -2008-07-02 Neil Roberts +2009-01-16 Emmanuele Bassi - * clutter/eglx/clutter-stage-egl.c (clutter_stage_egl_realize): - Use clutter_x11_has_event_retrieval() instead of - !backend_x11->no_xevent_retrieval to reflect the changes to the - GLX backend in revision 3078 + * clutter/clutter-media.c: + * clutter/clutter-media.h: -2008-07-02 Emmanuele Bassi + Bug 1404 - ClutterMedia issues - Bug 1010 - ClutterLabel does not update the layout (Lee Jusung) +2009-01-20 Robert Bragg - * clutter/clutter-actor.c: - (clutter_actor_queue_relayout): Remove some pointer dereferencing. + * clutter/cogl/cogl-mesh.h: + * clutter/cogl/cogl-vertex-buffer.h: + * clutter/cogl/cogl.h.in: + * clutter/cogl/common/Makefile.am: + * clutter/cogl/common/cogl-mesh-private.h: + * clutter/cogl/common/cogl-mesh.c: + * clutter/cogl/common/cogl-vertex-buffer-private.h: + * clutter/cogl/common/cogl-vertex-buffer.c: + * clutter/cogl/gl/Makefile.am: + * clutter/cogl/gl/cogl-context.c: + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gles/Makefile.am: + * clutter/cogl/gles/cogl-context.c: + * clutter/cogl/gles/cogl-context.h: + * doc/reference/cogl/cogl-docs.sgml: + * doc/reference/cogl/cogl-sections.txt: + * tests/conform/Makefile.am: + * tests/conform/test-conform-main.c: + * tests/conform/test-mesh-contiguous.c: + * tests/conform/test-mesh-interleved.c: + * tests/conform/test-mesh-mutability.c: + * tests/conform/test-vertex-buffer-contiguous.c: + * tests/conform/test-vertex-buffer-interleved.c: + * tests/conform/test-vertex-buffer-mutability.c: + + Renames the mesh api to the "vertex buffer api". + +2009-01-20 Robert Bragg + + * fixed-to-float-patches/clutter-actor.c.0.patch: + * fixed-to-float-patches/clutter-alpha.c.0.patch: + * fixed-to-float-patches/clutter-alpha.h.0.patch: + * fixed-to-float-patches/clutter-behaviour-ellipse.c.0.patch: + * fixed-to-float-patches/clutter-bezier.c.0.patch: + * fixed-to-float-patches/clutter-fixed.c.0.patch: + * fixed-to-float-patches/clutter-fixed.h.0.patch: + * fixed-to-float-patches/clutter-path.c.0.patch: + * fixed-to-float-patches/clutter-texture.c.0.patch: + * fixed-to-float-patches/clutter-units.h.0.patch: + * fixed-to-float-patches/cogl-fixed.c.0.patch: + * fixed-to-float-patches/cogl-fixed.h.0.patch: + * fixed-to-float-patches/cogl-pango-render.c.0.patch: + * fixed-to-float-patches/cogl-primitives.c.0.patch: + * fixed-to-float-patches/cogl.h.in.0.patch: + * fixed-to-float-patches/gl-cogl-primitives.c.0.patch: + * fixed-to-float-patches/gl-cogl-texture.c.0.patch: + * fixed-to-float-patches/gl-cogl.c.0.patch: + * fixed-to-float-patches/gles-cogl-gles2-wrapper.c.0.patch: + * fixed-to-float-patches/gles-cogl-gles2-wrapper.h.0.patch: + * fixed-to-float-patches/gles-cogl-primitives.c.0.patch: + * fixed-to-float-patches/gles-cogl-texture.c.0.patch: + * fixed-to-float-patches/gles-cogl.c.0.patch: + * fixed-to-float-patches/remove_cogl_apis_taking_fixed_params.0.patch: + * fixed-to-float-patches/test-cogl-tex-tile.c.0.patch: + * fixed-to-float.sh: - * clutter/clutter-label.c: - (clutter_label_allocate): Revert the change of r2883 and remove the - layout width cache and force a recreation of the layout every time - we receive an allocation. - -2008-07-01 Neil Roberts - - * clutter/clutter-actor.c (clutter_actor_get_transformed_sizeu): - This is now do-what-I-mean like clutter_actor_get_size so that if - the allocation box is available it will use that, otherwise it - will use the preferred size. clutter_actor_transform_vertices has - been converted to clutter_actor_transform_and_project_box so that - it can be used by both functions. Based on a patch by Emmanuele - Bassi. - (clutter_actor_get_abs_allocation_vertices) - (clutter_actor_get_allocation_vertices): These two functions now - force a relayout if the allocation box is not available. + Removes the fixed-to-float scripts and patches - * tests/test-fbo.c: Fixed the shader to use texture2D instead of - texture2DRect now that GL_EXT_texture_rectangle is no longer used. +2009-01-20 Robert Bragg -2008-07-01 Chris Lord - * clutter/clutter-stage.c: - Add a note to the clutter_stage_read_pixels doc that the alpha channel - isn't guaranteed to contain sensible data + Merge branch 'cogl-float' - * tests/test-stage-read-pixels.c: (update_snapshot): - Overwrite the alpha data when using clutter_stage_read_pixels; fixes - this test on non-nvidia drivers +2009-01-20 Emmanuele Bassi -2008-07-01 Matthew Allum + * clutter/clutter-script.c: + * tests/interactive/test-script.c: - * clutter/glx/clutter-stage-glx.c: - * clutter/x11/clutter-backend-x11.c: - * clutter/x11/clutter-backend-x11.h: - * clutter/x11/clutter-event-x11.c: - * clutter/x11/clutter-x11.h: - * tests/test-devices.c: - Disable use of XInput and add an explicit clutter_x11_enable_xinput - to enable it. - Also fix up the x11 pre-init calls to not need g_type_init. - -2008-07-01 Øyvind Kolås - - Bug 1013 - Per device grabs are not obeyed in pointer device - propagation. - - * clutter/clutter-event.c: (clutter_event_get_device_id): swap - arguments of g_return_val_if_fail around. - * clutter/clutter-event.h: added *device field to crossing events as - well. - * clutter/clutter-main.c: (emit_pointer_event): added a device - argument and check for per device grabs if this device is passed. - (clutter_do_event): pass the device if present for all pointer event - emissions. - (generate_enter_leave_events): copy the device from the motion events - when generating enter/leave events. + [script] Parse easing modes by name -2008-07-01 Chris Lord +2009-01-20 Emmanuele Bassi - * clutter/clutter-texture.c: - Correct documentation about accepted pixel formats + * clutter/clutter-alpha.c: + * doc/reference/clutter/Makefile.am: + * doc/reference/clutter/alpha-func.png: + * doc/reference/clutter/clutter-sections.txt: + * doc/reference/clutter/easing-modes.png: + * doc/reference/clutter/easing-modes.svg: - * tests/test-stage-read-pixels.c: (main): - Don't try to free a ClutterTexture after main, fixes segfault on quit + [docs] Update the easing modes documentation -2008-07-01 Emmanuele Bassi +2009-01-20 Emmanuele Bassi - * clutter/clutter-behaviour-bspline.h: - * clutter/clutter-behaviour.h: - * clutter/clutter-event.h: - * clutter/clutter-texture.h: Add missing documentation and - change the copyright and licensing notice to use the FSF - website instead of its address. (#512) + * clutter/clutter-alpha.c: + * clutter/clutter-types.h: + * tests/interactive/test-animation.c: + * tests/interactive/test-easing.c: -2008-06-30 Matthew Allum + [animation] Implement new easing functions - Bug 1008 - tfp still a bit borked +2009-01-20 Emmanuele Bassi - * clutter/x11/clutter-x11-texture-pixmap.c: - Fix from Andy Wingo for sync_window borkage + * clutter/clutter-alpha.c: + * clutter/clutter-alpha.h: + * clutter/clutter-animation.c: + * clutter/clutter-behaviour-depth.c: + * clutter/clutter-behaviour-ellipse.c: + * clutter/clutter-behaviour-opacity.c: + * clutter/clutter-behaviour-path.c: + * clutter/clutter-behaviour-rotate.c: + * clutter/clutter-behaviour-scale.c: + * clutter/clutter-behaviour.c: + * clutter/clutter-behaviour.h: + * clutter/clutter-interval.c: + * clutter/clutter-marshal.list: + * clutter/clutter-script.c: + * tests/interactive/test-actors.c: + * tests/interactive/test-layout.c: + * tests/interactive/test-paint-wrapper.c: + * tests/interactive/test-scale.c: -2008-06-30 Neil Roberts + [animation] Move the alpha value to floating point - Bug 985 - MSC math.h / M_PI issue +2009-01-20 Robert Bragg - * clutter/cogl/gl/cogl.c (set_clip_plane): - * clutter/clutter-alpha.c (sinc_func): Use G_PI instead of M_PI - because M_PI isn't defined in MSVC without a special - #define. Thanks to Haakon Sporsheim + * clutter/clutter-fixed.h: + * clutter/clutter-units.h: -2008-06-30 Neil Roberts + [Automatic fixed-to-float.sh change] Hand coded changes for + clutter-{fixed,units} - * clutter/win32/clutter-backend-win32.c (check_vblank_env): Use - g_ascii_strcasecmp instead of strcasecmp because strcasecmp isn't - available in MSVC. +2009-01-20 Robert Bragg -2008-06-30 Matthew Allum + * clutter/clutter-actor.c: + * clutter/clutter-alpha.c: + * clutter/clutter-alpha.h: + * clutter/clutter-behaviour-ellipse.c: + * clutter/clutter-bezier.c: + * clutter/clutter-fixed.c: + * clutter/clutter-path.c: + * clutter/clutter-texture.c: + * clutter/cogl/cogl-color.h: + * clutter/cogl/cogl-fixed.h: + * clutter/cogl/cogl-path.h: + * clutter/cogl/cogl.h.in: + * clutter/cogl/common/cogl-color.c: + * clutter/cogl/common/cogl-fixed.c: + * clutter/cogl/common/cogl-primitives.c: + * clutter/cogl/gl/cogl-primitives.c: + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl-gles2-wrapper.c: + * clutter/cogl/gles/cogl-gles2-wrapper.h: + * clutter/cogl/gles/cogl-primitives.c: + * clutter/cogl/gles/cogl-texture.c: + * clutter/cogl/gles/cogl.c: + * clutter/pango/cogl-pango-render.c: + * doc/reference/cogl/cogl-sections.txt: + * tests/conform/test-backface-culling.c: + * tests/interactive/test-cogl-tex-tile.c: - Bug 1007 - Fix TFP fallback mechanism + [Automatic fixed-to-float.sh change] Applies a number fixed to + float patches - * clutter/glx/clutter-glx-texture-pixmap.c: - * clutter/x11/clutter-x11-texture-pixmap.c: - Add some extra safety to glx pixmap creations and tidy up some notes. - Patch from Gwenole Beauchesne. +2009-01-20 Robert Bragg -2008-06-30 Neil Roberts + * clutter/clutter-actor.c: + * clutter/clutter-alpha.c: + * clutter/clutter-backend.c: + * clutter/clutter-behaviour-depth.c: + * clutter/clutter-behaviour-ellipse.c: + * clutter/clutter-behaviour-rotate.c: + * clutter/clutter-behaviour-scale.c: + * clutter/clutter-clone-texture.c: + * clutter/clutter-color.c: + * clutter/clutter-fixed.c: + * clutter/clutter-fixed.h: + * clutter/clutter-interval.c: + * clutter/clutter-stage.c: + * clutter/clutter-texture.c: + * clutter/clutter-timeline.c: + * clutter/clutter-units.h: + * clutter/cogl/cogl-color.h: + * clutter/cogl/cogl-path.h: + * clutter/cogl/cogl-texture.h: + * clutter/cogl/cogl-types.h: + * clutter/cogl/cogl.h.in: + * clutter/cogl/common/cogl-clip-stack.c: + * clutter/cogl/common/cogl-color.c: + * clutter/cogl/common/cogl-primitives.c: + * clutter/cogl/common/cogl-primitives.h: + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gl/cogl-primitives.c: + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl-context.c: + * clutter/cogl/gles/cogl-context.h: + * clutter/cogl/gles/cogl-fbo.c: + * clutter/cogl/gles/cogl-gles2-wrapper.c: + * clutter/cogl/gles/cogl-gles2-wrapper.h: + * clutter/cogl/gles/cogl-primitives.c: + * clutter/cogl/gles/cogl-texture.c: + * clutter/cogl/gles/cogl.c: + * clutter/pango/cogl-pango-glyph-cache.c: + * clutter/pango/cogl-pango-glyph-cache.h: + * clutter/pango/cogl-pango-render.c: + * tests/conform/test-backface-culling.c: + * tests/interactive/test-cogl-tex-tile.c: + * tests/interactive/test-text-field.c: - * clutter/x11/clutter-event-x11.c: - * clutter/win32/clutter-event-win32.c: Use the HAVE_CONFIG_H guard - around #include "config.h" + [Automatic fixed-to-float.sh change] Applies all scripted changes -2008-06-30 Emmanuele Bassi +2009-01-20 Robert Bragg - * clutter/Makefile.am: - * clutter/eglx/Makefile.am: - * clutter/glx/Makefile.am: Build the X11 base backend before - the backends that depend on it. + * fixed-to-float.sh: -2008-06-30 Emmanuele Bassi + Improves the git commit messages used by fixed-to-float.sh - Bug 1000 - clutter-x11 should define gtypes for its enumerations +2009-01-19 Robert Bragg - * clutter/x11/Makefile.am: - * clutter/x11/clutter-event-x11.c: - * clutter/x11/clutter-x11-enum-types.c.in: - * clutter/x11/clutter-x11-enum-types.h.in: - * clutter/x11/clutter-x11.h: Add the GTypes for the X11-specific - enumerations, so that they can be used by the bindings. (Andy - Wingo) + * clutter/clutter-actor-clone.c: + * tests/interactive/Makefile.am: + * tests/interactive/test-actor-clone.c: + * tests/interactive/test-actors2.c: -2008-06-30 Chris Lord + Improves the unit test to verify more awkward scaling and some + corresponding fixes - * tests/test-shader.c: - Fix edge-detect shader on ATI, thanks Gwenole Beauchesne +2009-01-17 Robert Bragg -2008-06-30 Matthew Allum + * clutter/Makefile.am: + * clutter/clutter-actor-clone.c: + * clutter/clutter-actor-clone.h: + * clutter/clutter-actor.c: + * clutter/clutter-private.h: + * clutter/clutter.h: + * tests/interactive/Makefile.am: + * tests/interactive/test-actors2.c: - Bug 997 - automatic updates not working for named TFP pixmaps, - at least in x11 + Implements a generic ClutterActorClone that doesn't need fbos. - * clutter/glx/clutter-glx-texture-pixmap.c: - * clutter/glx/clutter-glx-texture-pixmap.h: - * clutter/x11/clutter-backend-x11.c: - * clutter/x11/clutter-x11-texture-pixmap.c: - * clutter/x11/clutter-x11-texture-pixmap.h: - * clutter/x11/clutter-x11.h: - * configure.ac: - * tests/test-pixmap.c: - Rework Andy Wingos patch a little adding more safety for now also - handling redirect Windows (as well as pixmaps) +2009-01-11 Owen W. Taylor -2008-06-30 Emmanuele Bassi + * clutter/clutter-texture.c: - Bug 980 - cogl-bitmap-fallback.c compiler error/warning due to - cast issue (Haakon Sporsheim) + Change default tile-waste from 64 to 63 - * clutter/cogl/common/cogl-bitmap-fallback.c: - (_cogl_unpremult_alpha_last), - (_cogl_unpremult_alpha_first): Cast to avoid a compiler warning - with MSC. +2009-01-16 Owen W. Taylor -2008-06-30 Chris Lord + * clutter/x11/clutter-x11-texture-pixmap.c: - * tests/test-shader.c: (main): - Add a new shader to test-shaders (Sobel operator edge-detect) + Fix properties that have X11 types to be 'long' -2008-06-30 Øyvind Kolås +2009-01-16 Emmanuele Bassi - Disable XInput handling for keyboard events, re-enabling key press and - release events when pointer is outside window as well as re-enabling - keyrepeat. + * clutter/eglnative/clutter-stage-egl.c: - * clutter/glx/clutter-stage-glx.c: (clutter_stage_glx_realize): select - for KeyPressMask and KeyReleaseMask even with XInput enabled. - * clutter/x11/clutter-backend-x11.c: (_clutter_x11_register_xinput): - Disabled the XInput keyboard code paths (comments and #if 0's) - * clutter/x11/clutter-event-x11.c: (event_translate): always handle - keyboard events without regard to XInput. + [eglnative] Set the SYNC_MATRICES on stage realization -2008-06-29 Matthew Allum +2009-01-16 Neil Roberts - * clutter/x11/clutter-event-x11.c: - ifdef convert_xdevicekey_to_xkey () with XINPUT check. - (fix via Andy Wingo) + * fixed-to-float-patches/remove_cogl_apis_taking_fixed_params.0.patch: + * fixed-to-float-patches/test-cogl-tex-tile.c.0.patch: + * fixed-to-float.sh: -2008-06-29 Tommi Komulainen + [fixed-to-float.sh] Apply the automatic changes to the tests as + well - * clutter/osx/clutter-osx.h (_clutter_event_osx_put) - * clutter/osx/clutter-event-osx.c (clutter_event_osx_translate, - NSEvent:clutterStage:) - * clutter/osx/clutter-stage-osx.c (EVENT_HANDLER): Since events are - delivered to ClutterGLView, pass the associated ClutterStage directly - to event translation. Avoids relying on being embedded in - ClutterGLWindow, which makes it easier to implement clutter-gtk. - -2008-06-29 Tommi Komulainen - - * clutter/osx/clutter-event.osx.c (NSEvent:clutterKeyVal:): Add - comment, on OSX backend the Shift modifier is included in 'keyval' - making it identical to 'unicode_value' Instead of a or - 3 you'd get A and # +2009-01-16 Neil Roberts -2008-06-27 Matthew Allum + * fixed-to-float.sh: - * clutter/cogl/gl/cogl.c: - Temp workaround for 10.4 ATI card OSX folks, see #929 - (Tommi Komulainen) + [fixed-to-float.sh] Group some of the sed expressions into one + command - Bug 998 - clutter always captures X input events +2009-01-16 Neil Roberts - * clutter/eglx/clutter-stage-egl.c: - * clutter/glx/clutter-stage-glx.c: - When we disable X event retrival, dont still select for window - events. + * fixed-to-float-patches/remove_cogl_apis_taking_fixed_params.0.patch: -2008-06-27 Emmanuele Bassi + [fixed-to-float-patches] Replace the cogl_color_*x functions with + *f - * clutter/clutter-event.h: - * clutter/clutter-main.c: - * clutter/x11/clutter-backend-x11.c: Add further documentation, - and increase the coverage to 94%. +2009-01-16 Emmanuele Bassi -2008-06-27 Emmanuele Bassi + * clutter/clutter-alpha.c: - * configure.ac: Post release bump to 0.7.7. + [docs] Clarify what API registers a global alpha function -======== Release 0.7.6 ======================================================== +2009-01-16 Neil Roberts -2008-06-27 Emmanuele Bassi + * fixed-to-float-patches/remove_cogl_apis_taking_fixed_params.0.patch: + * fixed-to-float-patches/remove_cogl_apis_taking_fixed_params.1.patch: + * fixed-to-float.sh: - * configure.ac: - * NEWS: Release 0.7.6. + [fixed-to-float-patches] Merge the two patches to remove cogl + fixed params -2008-06-27 Neil Roberts +2009-01-16 Emmanuele Bassi - Bug 993 - Underline colors are sometimes wrong + * clutter/clutter-animation.c: - * clutter/pango/pangoclutter-render.c: Fixed so that instead - of trying to set the color in prepare_run it uses draw_glyphs - to draw groups of glyphs and requests the color for each part - from Pango. + [doc] Clarify the animation mode meaning -2008-06-26 Emmanuele Bassi +2009-01-16 Emmanuele Bassi - * clutter/clutter-actor.c: - (clutter_actor_set_min_width), - (clutter_actor_set_min_height), - (clutter_actor_set_natural_width), - (clutter_actor_set_natural_height): Ignore any override of the - minimum and natural size of the stage on backends that only - support static stages. + * clutter/clutter-animation.c: + * clutter/clutter-animation.h: - * clutter/clutter-stage.c (clutter_stage_allocate): Use the - preferred size of the ClutterStage implementation instead of - the display size. + Remove AnimationMode from the Animation API - * clutter/clutter-backend.[ch]: Remove get_display_size() and - clutter_backend_get_display_size(). +2009-01-16 Emmanuele Bassi - * clutter/eglnative/clutter-backend-egl.c: - * clutter/fruity/clutter-backend-fruity.c: - * clutter/osx/clutter-backend-osx.c: - * clutter/sdl/clutter-backend-sdl.c: - * clutter/win32/clutter-backend-win32.c: - * clutter/x11/clutter-backend-x11.c: Remove get_display_size() - implementations. - -2008-06-26 Emmanuele Bassi - - * clutter/clutter-shader.c (bind_glsl_shader): Verify that the - vertex shader has been successfully compiled, like we do with - the fragment shader. - -2008-06-26 Emmanuele Bassi - - * clutter/osx/clutter-backend-osx.c: - (clutter_backend_osx_get_display_size): Fix the allocation pool - macro name. + * clutter/clutter-alpha.c: + * clutter/clutter-alpha.h: + * clutter/clutter-types.h: + * doc/reference/clutter/clutter-sections.txt: + * tests/interactive/test-actors.c: + * tests/interactive/test-behave.c: + * tests/interactive/test-depth.c: + * tests/interactive/test-layout.c: + * tests/interactive/test-multistage.c: + * tests/interactive/test-paint-wrapper.c: + * tests/interactive/test-rotate.c: + * tests/interactive/test-scale.c: + * tests/interactive/test-texture-quality.c: + * tests/interactive/test-threads.c: + * tests/interactive/test-viewport.c: + + [alpha] Allow registering alpha functions + +2009-01-16 Neil Roberts + + * fixed-to-float-patches/gles-cogl-gles2-wrapper.c.0.patch: + * fixed-to-float-patches/gles-cogl-gles2-wrapper.h.0.patch: + * fixed-to-float-patches/gles-cogl.c.0.patch: + * fixed-to-float-patches/remove_cogl_apis_taking_fixed_params.0.patch: + * fixed-to-float.sh: -2008-06-26 Matthew Allum + [fixed-to-float.sh] Use float names for the GLES2 wrappers - * clutter/glx/clutter-glx-texture-pixmap.c: - Move the gl extension probe into the regular object init() rather than - class_init. Should be a little safer. +2009-01-16 Neil Roberts -2008-06-26 Matthew Allum + * clutter/cogl/gles/cogl-gles2-wrapper.h: + * fixed-to-float-patches/gles-cogl-gles2-wrapper.h.0.patch: - * tests/test-pixmap.c: (main): - Use strtol on arg as to take hex values. Tweak from James Ketrenos + [fixed-to-float-patches] Move the changes to gles2-wrapper.h into + the patch -2008-06-25 Emmanuele Bassi +2009-01-15 Neil Roberts - * configure.ac: Post release bump to 0.7.5. + * fixed-to-float-patches/gles-cogl-gles2-wrapper.c.0.patch: + * fixed-to-float-patches/gles-cogl-gles2-wrapper.h.0.patch: + * fixed-to-float-patches/gles-cogl.c.0.patch: -======== Release 0.7.4 ======================================================== + [fixed-to-float-patches] Fix use of glClearColor and glColor + under GLES 2 -2008-06-25 Emmanuele Bassi +2009-01-15 Neil Roberts - * configure.ac: - * NEWS: Release 0.7.4. -2008-06-25 Neil Roberts + Merge branch 'master' into cogl-float - * clutter/win32/clutter-backend-win32.c - (clutter_backend_win32_get_display_size): Implement - get_display_size on the Win32 backend. +2009-01-15 Neil Roberts -2008-06-25 Emmanuele Bassi + * clutter/cogl/gles/cogl-texture.c: - * clutter/clutter-main.h: Make the priority constants public. + Fix GLES backends after merging the async-textures branch - * clutter/clutter-stage.c: Use CLUTTER_PRIORITY_REDRAW. +2009-01-15 Neil Roberts - * clutter/clutter-timeline.c: Use CLUTTER_PRIORITY_TIMELINE. + * fixed-to-float.sh: -2008-06-25 Emmanuele Bassi + [fixed-to-float.sh] Remove the mtx_transform patch from the + script - * clutter/osx/clutter-backend-osx.c: - (clutter_backend_osx_get_display_size), - (clutter_backend_osx_class_init): Implement the get_display_size - function. +2009-01-15 Neil Roberts -2008-06-25 Emmanuele Bassi + * fixed-to-float-patches/gl-cogl.c.0.patch: + * fixed-to-float-patches/gles-cogl-gles2-wrapper.c.0.patch: + * fixed-to-float-patches/gles-cogl-gles2-wrapper.h.0.patch: + * fixed-to-float-patches/gles-cogl.c.0.patch: + * fixed-to-float.sh: - * clutter/clutter-actor.c: - (clutter_actor_set_min_width), - (clutter_actor_set_min_height), - (clutter_actor_set_natural_width), - (clutter_actor_set_natural_height): Add a comment explaining - the override in place for backends providing a fixed size - on a stage. + [fixed-to-float-patches] Fix some of the matrix getters and + setters -2008-06-25 Emmanuele Bassi +2009-01-15 Robert Bragg - * clutter/clutter-actor.c: - (clutter_actor_set_min_width), - (clutter_actor_set_min_height), - (clutter_actor_set_natural_width), - (clutter_actor_set_natural_height): If setting the minimum - and natural width and height on a top-level actor, and on - a backend that provides only static stages, then override - the value and use the size of the display as returned by - the backend. + * tests/micro-bench/test-text.c: - * clutter/eglnative/clutter-stage-egl.c: - (clutter_stage_egl_realize): Remove the setting of the - minimum and natural width and height. + [test-text] queue redraws instead of calling clutter_actor_paint + directly -2008-06-25 Emmanuele Bassi +2009-01-14 Emmanuele Bassi - * clutter/clutter-stage.c: - (clutter_stage_allocate): Minor optimization. + * clutter/clutter-actor.h: - (clutter_stage_init): Do not set the minimum size of the - stage wrapper, and require that the backends set the size - themselves. + Bug 1380 - Return booleans from CLUTTER_ACTOR_IS_* macros -2008-06-25 Emmanuele Bassi +2009-01-07 Emmanuele Bassi - * clutter/eglnative/clutter-stage-egl.c: - (clutter_stage_egl_realize): Try to force the minimum and - natural size on realization. + * clutter/Makefile.am: + * clutter/clutter-effect.c: + * clutter/clutter-effect.h: + * clutter/clutter.h: + * doc/reference/clutter/clutter-sections.txt: + * tests/interactive/Makefile.am: + * tests/interactive/test-effects.c: -2008-06-25 Emmanuele Bassi + Remove the Effects API - * clutter/clutter-backend.c: - (clutter_backend_get_display_size): Provide a fallback for - backends not implementing get_display_size(). +2009-01-14 Emmanuele Bassi - * clutter/clutter-stage.c: - (clutter_stage_allocate): Add debug messages. + * clutter/clutter-texture.c: - * clutter/sdl/clutter-backend-sdl.c: - (clutter_backend_sdl_get_display_size), - (clutter_backend_sdl_class_init): Implement get_display_size() - on the SDL backend. + Emit ::load-finished for every texture load -2008-06-25 Chris Lord +2009-01-14 Robert Bragg - * clutter/clutter-fixed.c: (clutter_sinx): - Fix clutter_sinx for angles > CFX_2PI - CFX_ONE. Also add note to - documentation about being able to use modulus with ClutterFixed + * tests/interactive/test-depth.c: -2008-06-25 Emmanuele Bassi + [test-depth] cast width to gint when calculating -width/2 - * clutter/clutter-backend.h: - * clutter/clutter-backend.c: - (clutter_backend_get_display_size): Add a function for getting the - display size out of the backend. +2009-01-08 Robert Bragg - * clutter/clutter-stage.c: - (clutter_stage_allocate): When allocating on a backend with a - static stage, we simply ignore the passed box and override it with - the size of the display. + * tests/interactive/Makefile.am: + * tests/interactive/test-clutter-cairo-flowers.c: - * clutter/eglnative/clutter-backend-egl.c: - (clutter_backend_egl_get_display_size), - (clutter_backend_egl_class_init): Implement get_display_size() by - returning the size of the EGL surface. - - * clutter/fruity/clutter-backend-fruity.c: - (clutter_backend_egl_get_display_size), - (clutter_backend_egl_class_init): Ditto as above. + [tests] Adds a flowery clutter_cairo_texture unit test - * clutter/x11/clutter-backend-x11.c: - (clutter_backend_x11_get_display_size), - (clutter_backend_x11_class_init): Implement get_display_size() by - returning the DisplayWidth and DisplayHeight of the current - screen. +2009-01-14 Emmanuele Bassi -2008-06-25 Neil Roberts - * clutter/win32/clutter-stage-win32.c - (clutter_stage_win32_realize): Use a more direct method to choose - the best pixel format instead of ChoosePixelFormat because - otherwise if the display's depth is 16 then it will prefer the - non-accelerated software implementation when the requested depth - is 24. + Merge branch 'async-textures' -2008-06-25 Emmanuele Bassi +2009-01-14 Neil Roberts - * clutter/clutter-stage.c (clutter_stage_allocate): Fix condition; - should always test before committing. + * clutter/x11/clutter-event-x11.c: + * clutter/x11/clutter-stage-x11.c: + * clutter/x11/clutter-stage-x11.h: -2008-06-25 Matthew Allum + [ClutterStageX11] Remove the handling_configure flag - * clutter/x11/clutter-backend-x11.c: (_clutter_x11_register_xinput) - Add extra safety and fallback if no useable pointing devices are - found. +2009-01-14 Emmanuele Bassi -2008-06-25 Emmanuele Bassi + * doc/reference/clutter/clutter-sections.txt: - * clutter/clutter-stage.c: - (clutter_stage_allocate): Check if the stage provided by the - backend is static (i.e. a framebuffer that cannot be resized) - and interrupt the allocation chain there. + Add unused symbols - * clutter/eglnative/clutter-stage-egl.c: - (clutter_stage_egl_class_init): Remove the ::allocate empty - stub. +2009-01-14 Emmanuele Bassi -2008-06-25 Matthew Allum + * clutter/glx/clutter-glx-texture-pixmap.c: - * clutter/eglnative/clutter-stage-egl.c: - * clutter/eglx/clutter-stage-egl.c: - Disable passing of attribs to eglCreateContext() on GLES 1.1 h/w + Fix compile warning for a possible uninitialized variable -2008-06-25 Neil Roberts +2009-01-14 Emmanuele Bassi - * clutter/clutter-actor.c (clutter_actor_paint): Guard against the - actor clip being enabled or disabled in an actor paint - method. Otherwise the clip stack can be become unbalanced. This - was happening in ClutterEntry until it was fixed in revision 2983. + * clutter/clutter-binding-pool.h: -2008-06-24 Neil Roberts + Add declaration of clutter_binding_pool_get_type() - Bug 979 - Wrong call convension for SwapIntervalProc in win32 backend +2009-01-14 Emmanuele Bassi - * clutter/win32/clutter-backend-win32.c: Use the correct calling - convention for SwapInterval. Thanks to Haakon Sporsheim. -2008-06-24 Emmanuele Bassi + Merge branch 'animation-improvements' - Bug 989 - Add a search path for clutter script assets +2009-01-14 Emmanuele Bassi - * clutter/clutter-script.h: - * clutter/clutter-script.c: - (clutter_script_finalize), - (clutter_script_add_search_paths), - (clutter_script_lookup_filename): Add the ability to define multiple - search paths inside ClutterScript and to look up a specific filename - inside those search paths. This is useful to define a set of - directories where the assets for a UI definition are and still - reference those assets by their name instead of the full path. (989, - based on a patch by Matthew Allum) + * tests/interactive/test-depth.c: - * clutter/clutter-texture.c: - (clutter_texture_set_custom_property): Use the newly added - clutter_script_lookup_filename() function. + Fix compilation warning -2008-06-24 Neil Roberts +2009-01-14 Neil Roberts - * clutter/cogl/gles/cogl-gles2-wrapper.h: - * clutter/cogl/gles/cogl-gles2-wrapper.c: All of the settings and - uniforms are now proxied into COGL variables instead of setting - the GL uniforms directly. Just before glDrawArrays is executed a - shader is generated using the given settings to avoid using 'if' - statements. The shaders are cached. + * clutter/clutter-text.c: - * clutter/cogl/gles/cogl-fixed-vertex-shader.glsl: - * clutter/cogl/gles/cogl-fixed-fragment-shader.glsl: The shaders - are now split into parts using comments instead of 'if' statements - so that the simplest shader can be generated on the fly. + [clutter-text] Fix x-position of cursor when moving up or down - * clutter/cogl/gles/stringify.sh: Now splits up the shader sources - into separate C strings where deliminated by special comments. +2009-01-13 Neil Roberts - * clutter/cogl/gles/cogl-program.h: - * clutter/cogl/gles/cogl-program.c: A custom shader can no longer - be directly linked with the fixed-functionality replacement - because the replacement changes depending on the settings. Instead - the bound shader is linked with the appropriate replacement shader - just before glDrawArrays is executed. The custom uniform variables - must also be proxied through COGL variables because their location - can change when relinked. + * clutter/clutter-text.c: -2008-06-24 Øyvind Kolås + [clutter-text] Fix offset_to_bytes to work when pos == 0 - * clutter/fruity/clutter-fruity.c: removed dead code and unused - variables. +2009-01-13 Neil Roberts -2008-06-24 Øyvind Kolås + * clutter/clutter-text.c: - * configure.ac: better alignment of list of enabled experimental - features. + [clutter-text] Don't allow control characters to be inserted -2008-06-24 Emmanuele Bassi +2008-11-27 Neil Roberts - * doc/clutter-actor-invariants.txt: Fix grammar and spelling, - document the ::parent-set signal emission. + * clutter/cogl/gles/cogl-context.h: + * clutter/cogl/gles/cogl-gles2-wrapper.c: + * clutter/cogl/gles/cogl-gles2-wrapper.h: + * clutter/cogl/gles/cogl-texture.c: -2008-06-24 Emmanuele Bassi + Fix GLES 2 after the multiple-texture-rectangle branch merge - * clutter/clutter-entry.c: - (clutter_entry_ensure_layout): Convert the invisible char - to UTF-8 to avoid Pango barfing on us. +2009-01-12 Neil Roberts -2008-06-24 Matthew Allum + * clutter/cogl/cogl-texture.h: - * clutter/eglnative/clutter-stage-egl.c: - Add an extra debug note. - * configure.ac: - Generate version.xml for COGL API docs + Update gtk-doc 'Since' field for cogl_texture_multiple_rectangles -2008-06-24 Chris Lord +2009-01-13 Emmanuele Bassi - Bug 988 - cursor position wrong with multibyte invisible char + * .gitignore: - * clutter/clutter-entry.c: (clutter_entry_ensure_cursor_position): - Fix cursor position calculation when using invisible text + [gitignore] Update the ignore file -2008-06-23 Emmanuele Bassi +2009-01-13 Robert Bragg - * clutter/x11/clutter-event-x11.c (event_translate): Set the - event type explicitly in the union members as well for the - key events, like we do for all the other events. -2008-06-23 Neil Roberts + Merge commit 'origin/master' into cogl-material - * clutter/clutter-entry.c (clutter_entry_paint): Set the clip - using COGL directly instead of setting the actor clip. Otherwise - the clip stack will be unbalanced after the first draw. This also - frees up the actor clip to be set by an application. +2009-01-13 Emmanuele Bassi -2008-06-23 Matthew Allum + * clutter/clutter-binding-pool.c: - * NEWS: - Add a quick note on fruity multiple deivce support. - * README: - Add multiple device support details and some tweaks on - Clutter requirements (i.e GdkPixbuf). + Add ClutterBindingPool:name -2008-06-23 Matthew Allum +2009-01-13 Robert Bragg - Bug 987 - clutter-event.c c99 variable declaration + * fixed-to-float-patches/remove_cogl_apis_taking_fixed_params.0.patch: + * fixed-to-float-patches/remove_cogl_apis_taking_fixed_params.1.patch: + * fixed-to-float.sh: - * clutter/clutter-event.c: - Remove c99ism. + Remove cogl_blahx Cogl interfaces that used to take CoglFixed + parameters. -2008-06-23 Emmanuele Bassi +2009-01-13 Emmanuele Bassi - * configure.ac: Post release bump to 0.7.3. + * clutter/clutter-binding-pool.c: + * clutter/clutter-binding-pool.h: -======== Release 0.7.2 ======================================================== + Turn ClutterBindingPool a GObject -2008-06-23 Emmanuele Bassi +2009-01-12 Robert Bragg - * configure.ac: - * NEWS: Release 0.7.2. + * fixed-to-float-patches/gl-cogl.c: + * fixed-to-float-patches/gl-cogl.c.0.patch: -2008-06-23 Emmanuele Bassi + [gl/cogl.c] Updates the cogl_rotatex prototype to take float + x,y,z params - * clutter/clutter-texture.c: - (clutter_texture_get_preferred_width), - (clutter_texture_get_preferred_height), - (clutter_texture_set_property), - (clutter_texture_get_property), - (clutter_texture_class_init), - (clutter_texture_init): Add the new :keep-aspect-ratio property - to ClutterTexture; when set to TRUE the texture will return a - preferred width maintaining the aspect ratio with the given height - and a preferred height maintaining the aspect ratio with the - given width. This allows to set the width or the height and have - the texture automatically request the height or the width respectively - while maintaining the aspect ratio of the original image. +2009-01-12 Robert Bragg - * tests/test-script.json: Update to test the new :keep-aspect-ratio - property. + * fixed-to-float-patches/cogl.h.in.0.patch: + * fixed-to-float.sh: -2008-06-23 Neil Roberts + [cogl.h.in.0.patch] Fixes the cogl_rotatex prototype to take + float x,y,z params - Bug 918 - Group doesn't clip if it's children are clipped +2009-01-08 Robert Bragg - * clutter/cogl/common/cogl-clip-stack.h: - * clutter/cogl/common/cogl-clip-stack.c: Added functions to - maintain a stack of clipping rectangles. + * clutter/cogl/gles/cogl-gles2-wrapper.h: + * fixed-to-float-patches/gles-cogl-gles2-wrapper.h.0.patch: + * fixed-to-float-patches/gles-cogl-primitives.c.0.patch: + * fixed-to-float-patches/gles-cogl-texture.c.0.patch: + * fixed-to-float-patches/gles-cogl.c.0.patch: + * fixed-to-float.sh: - * clutter/cogl/gles/cogl.c: - * clutter/cogl/gl/cogl.c: The cogl_clip_set and unset functions - have moved into cogl-clip-stack.c which calls back to cogl.c to - set the actual rectangles. Multiple clip rectangles are combined - by merging the stencil buffers. + [cogl/gles] Fixes for building for GLES 1 using floats - * clutter/cogl/gles/cogl-primitives.c (_cogl_path_fill_nodes): - * clutter/cogl/gl/cogl-primitives.c (_cogl_path_fill_nodes): Merge - the stencil buffer with the contents of the clipping stack after - drawing the path. +2009-01-08 Robert Bragg - * clutter/cogl/gles/cogl-context.h (CoglContext): - * clutter/cogl/gl/cogl-context.h (CoglContext): Store the number - of available stencil bits. + * fixed-to-float.sh: - * clutter/cogl/common/Makefile.am - (libclutter_cogl_common_la_SOURCES): Added cogl-clip-stack.c + [fixed-to-float.sh] Replace uses of COGL_FIXED_FROM_INT not + followed by a space -2008-06-23 Robert Bragg +2009-01-08 Robert Bragg - * clutter/eglx/clutter-stage-egl.c: Makes sure the eglx backend - passes the EGL_OPENGL_ES2_BIT surface attrib when using - GLES2.0 under cogl + * fixed-to-float-patches/clutter-fixed.h.0.patch: -2008-06-23 Chris Lord + converts clutter_{sin,cos,tan,atan}x angles to radians before + calling math.h func - * clutter/x11/clutter-event-x11.c: (convert_xdevicekey_to_xkey), - (translate_key_event), (event_translate): - Change the xinput event handling to use translate_key (fixes modifier - handling with xinput key events) +2009-01-08 Robert Bragg -2008-06-23 Emmanuele Bassi + * fixed-to-float-patches/clutter-actor.c.0.patch: + * fixed-to-float-patches/clutter-alpha.c.0.patch: + * fixed-to-float-patches/clutter-path.c.0.patch: + * fixed-to-float-patches/clutter-texture.c.0.patch: + * fixed-to-float-patches/cogl-pango-render.c.0.patch: + * fixed-to-float-patches/mtx_transform.0.patch: - Bug 982 - __COGL_GET_CONTEXT MS compiler issue (Haakon Sporsheim) + [fixed-to-float-patches] Updates the patches in line with the + last merge - * clutter/cogl/common/cogl-handle.h: - * clutter/cogl/common/cogl-primitives.c: Remove C99-isms. +2009-01-12 Emmanuele Bassi - * clutter/cogl/gl/cogl-fbo.c: - * clutter/cogl/gl/cogl-primitives.c: - * clutter/cogl/gl/cogl-texture.c: - * clutter/cogl/gl/cogl.c: Ditto as above. + * clutter/clutter-texture.c: - * clutter/cogl/gles/cogl-fbo.c: - * clutter/cogl/gles/cogl-primitives.c: - * clutter/cogl/gles/cogl-texture.c: Ditto as above. + Whitespace fixes in ClutterTexture -2008-06-23 Emmanuele Bassi +2009-01-12 Emmanuele Bassi - Bug 984 - pango_clutter_render_layout() declared void, but - returns (Haakon Sporsheim) + * clutter/clutter-texture.c: - * clutter/pango/pangoclutter-render.c: - (pango_clutter_render_layout): Do not use a return statement. + [async-loading] Do not force the texture size on async load -2008-06-23 Emmanuele Bassi +2009-01-12 Emmanuele Bassi - Bug 905 - Paint cursor directly (Xan López) + * clutter/clutter-texture.c: - * clutter/clutter-entry.c: - (clutter_entry_paint_cursor), - (clutter_entry_init), - (clutter_entry_set_color): Directly paint the cursor on the - entry instead of using an actor. + [async-loading] Update asynchronous image loading -2008-06-23 Emmanuele Bassi +2009-01-12 Emmanuele Bassi - Bug 981 - clutter_stage_read_pixels temprow fix (Haakon Sporsheim) + * clutter/cogl/cogl-texture.h: + * clutter/cogl/common/cogl-bitmap-pixbuf.c: + * clutter/cogl/common/cogl-bitmap.c: + * clutter/cogl/common/cogl-bitmap.h: - * clutter/clutter-stage.c (clutter_stage_read_pixels): Allocate - the temporary row data used to flip the buffer from glReadPixels() - in order to fix compilation under MSVC. Also validate the input - parameters to avoid random segfaults. + Add API for extracting image size from a file -2008-06-23 Matthew Allum +2009-01-12 Emmanuele Bassi - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - * clutter/clutter-event.c: - * clutter/clutter-event.h: - * clutter/clutter-main.c: - * clutter/clutter-main.h: - * clutter/clutter-private.h: - * clutter/eglx/clutter-stage-egl.c: - * clutter/fruity/clutter-backend-fruity.c: - * clutter/fruity/clutter-backend-fruity.h: - * clutter/fruity/clutter-fruity.c: - * clutter/glx/clutter-stage-glx.c: - * clutter/x11/clutter-backend-x11.c: - * clutter/x11/clutter-backend-x11.h: - * clutter/x11/clutter-event-x11.c: - * clutter/x11/clutter-stage-x11.h: - * clutter/x11/clutter-x11.h: - * configure.ac: - * tests/Makefile.am: - * tests/test-devices.c: - Merge of 'xinput' branch giving initial basic support of - multiple input devices. -2008-06-23 Matthew Allum + Merge branch 'master' into async-textures - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - * clutter/clutter-group.c: - Remove uneeded (at least for now) paint_area method (#970) +2009-01-12 Havoc Pennington -2008-06-19 Emmanuele Bassi + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: - * clutter/clutter-script.c: Be more explicit about the fact that - the script id is not the name of an actor, and that it is retrieved - by using clutter_get_script_id(). + Bug 1087 - virtualize stage_queue_redraw -2008-06-17 Emmanuele Bassi +2009-01-12 Robert Bragg - * clutter/clutter-actor.h: - * clutter/clutter-actor.c: - (clutter_actor_allocate_preferred_size): Add more documentation - and notes on where it's appropriate to call this function. + * clutter/glx/clutter-glx-texture-pixmap.c: + + [ClutterGLXTexturePixmap] Use an RGB texture (not ARGB) for 24bpp + pixmaps -2008-06-17 Chris Lord +2009-01-12 Emmanuele Bassi - * clutter/clutter-texture.c: (clutter_texture_get_preferred_width), - (clutter_texture_get_preferred_height): - Maintain aspect ratio with natural width/height when for_width/height - are specified + * clutter/cogl/common/Makefile.am: + * clutter/cogl/gl/Makefile.am: + * clutter/cogl/gles/Makefile.am: -2008-06-17 Matthew Allum + Declare G_LOG_DOMAIN for COGL - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - Clean up of parenting code (see #972) - Doc updates to section intro. - Add clutter_actor_allocate_preferred_size () utility call +2009-01-12 Emmanuele Bassi - * clutter/clutter-group.c: (clutter_fixed_layout_allocate): - Use clutter_actor_allocate_preferred_size () + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: - * doc/clutter-actor-invariants.txt: - Add some more notes + Allow ensuring that a stage viewport is updated -2008-06-17 Emmanuele Bassi +2009-01-12 Emmanuele Bassi - * clutter/clutter-actor.c: - (clutter_actor_set_parent): Do not emit ::parent-set when - reparenting. + * clutter/clutter-backend.c: + * clutter/clutter-main.c: + * clutter/clutter-private.h: + * clutter/x11/clutter-event-x11.c: + * clutter/x11/clutter-stage-x11.c: - (clutter_actor_unparent): Ditto, as above. + [x11] Proper fix for the ClutterStage resize race - (clutter_actor_reparent): Emit ::parent-set with the old - parent and set the IN_REPARENT flag unconditionally. +2009-01-09 Emmanuele Bassi -2008-06-17 Emmanuele Bassi + * clutter/clutter-cairo-texture.h: + * clutter/cogl/cogl-types.h: + * clutter/cogl/common/cogl-mesh.c: + * doc/reference/clutter/clutter-docs.xml: + * doc/reference/clutter/clutter-sections.txt: - * doc/clutter-actor-invariants.txt: Document the flags, the - invariants, the state changes and the minimum requirements for - actor implementations. Needs to be tweaked and fleshed out - before 0.8.0, and we obviously need to enforce the invariants. + [docs] Documentation warnings -2008-06-17 Emmanuele Bassi +2009-01-09 Emmanuele Bassi - * clutter/clutter-actor.c: - (clutter_actor_set_parent): Document and maintain the invariant - that after setting a realized parent on an actor, the actor is - also going to be realized. + * clutter/clutter-main.c: + * clutter/clutter-private.h: + * clutter/x11/clutter-event-x11.c: + * clutter/x11/clutter-stage-x11.c: - (clutter_actor_unparent): Change the invariant that an unparented - actor is also unrealized: the paint is fast enough to avoid - unrealizing, since it also causes more problems that what it's - worth. + [x11] Fix a race condition when resizing a stage - * tests/test-invariants.c (test_show_on_set_parent): Update the - invariants test because we changed the invariants. +2009-01-08 Emmanuele Bassi -2008-06-17 Jussi Kukkonen + * clutter/clutter-text.c: - * clutter/clutter-score.c (clutter_score_append): - initialize "marker" string and "complete_id" signal id when creating a - ClutterScoreEntry. + [text] Fix GObject properties in ClutterText -2008-06-16 Tomas Frydrych +2009-01-08 Emmanuele Bassi * clutter/clutter-actor.c: - (clutter_actor_move_anchor_point_from_gravity): - Fixed incorrect sign of position adjustment (revert of earlier - change). + * clutter/clutter-units.h: + * tests/interactive/test-project.c: -2008-06-16 Emmanuele Bassi + Fix last improper usage of ClutterUnits - * clutter/clutter-actor.c (clutter_actor_unparent): Reset the - :show-on-set-parent property to TRUE when unparenting. +2009-01-08 Emmanuele Bassi - * tests/Makefile.am: Add test-invariant to the build. - * tests/test-invariants.c: Test the invariants that we are going - to honour (and document, at some point). + Merge branch 'animatable-iface' into animation-improvements -2008-06-16 Emmanuele Bassi +2009-01-08 Emmanuele Bassi - * clutter/eglnative/clutter-stage-egl.c: Ignore any size allocation - we receive from the user. + * doc/reference/clutter/clutter-docs.xml: + * doc/reference/clutter/clutter-sections.txt: + * doc/reference/clutter/clutter.types: - * clutter/fruity/clutter-stage-fruity.c: Ditto as above. + [docs] Add ClutterAnimatable to the API reference -2008-06-16 Tomas Frydrych +2009-01-08 Emmanuele Bassi - * clutter/clutter-actor.c: - (clutter_actor_move_anchor_point): - (clutter_actor_move_anchor_pointu): - (clutter_actor_move_anchor_point_from_gravity): - Fixed incorrect sign of position adjustment. - Fixed replace call to _move_by with move_byu in - _move_anchor_pointu. + * clutter/clutter-animatable.c: + * clutter/clutter-animatable.h: - Stripped trailing whitespace. + Add license notice to ClutterAnimation files -2008-06-15 Emmanuele Bassi +2009-01-08 Emmanuele Bassi - Bug #967 - Mismatch of Timeline::marker-reached signal signature + * doc/reference/clutter/clutter-sections.txt: - * clutter/clutter-marshal.list: - * clutter/clutter-timeline.c: - (clutter_timeline_class_init): Fix the type of the frame_num - argument in the ::marker-reached signal creation to match the - signal class handler. (Armin Burgmeier) + [docs] Update the ClutterAnimation section -2008-06-14 Emmanuele Bassi +2009-01-08 Emmanuele Bassi - * README: We depend on PangoCairo, now; also add all the missing - release notes entries and the missing backends configuration notes. + * clutter/clutter-animation.c: + * clutter/clutter-animation.h: -2008-06-14 Matthew Allum + [animation] Extend ClutterAnimation support to all objects - * README: - Make needed GL version 1.4, note GLES2 support, add some notes - for COGL. +2009-01-08 Emmanuele Bassi -2008-06-13 Emmanuele Bassi + * clutter/clutter-animation.c: - * configure.ac: Post release bump to 0.7.1. + [animation] Use ClutterAnimatable inside Animation -======== Release 0.7.0 ======================================================== +2009-01-08 Emmanuele Bassi -2008-06-13 Emmanuele Bassi + * clutter/Makefile.am: + * clutter/clutter-animatable.c: + * clutter/clutter-animatable.h: + * clutter/clutter.h: - * README: - * NEWS: - * configure.ac: Release 0.7.0, "Booska". + [animation] Add ClutterAnimatable -2008-06-13 Emmanuele Bassi +2009-01-08 Robert Bragg - * tests/test-cogl-offscreen.c: - * tests/test-cogl-primitives.c: - * tests/test-cogl-tex-convert.c: - * tests/test-cogl-tex-foreign.c: - * tests/test-cogl-tex-getset.c: - * tests/test-cogl-tex-tile.c: - * tests/test-layout.c: - * tests/test-pixmap.c: - * tests/test-texture-quality.c: Miscellaneous fixes for distcheck - to pass. -2008-06-13 Emmanuele Bassi + Merge branch 'master' into cogl-float - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - * tests/test-cogl-primitives.c: - * tests/test-events.c: - * tests/test-multistage.c: - * tests/test-textures.c: - * tests/test-timeline.c: Miscellaneous fixes for distcheck to - pass. +2009-01-07 Robert Bragg -2008-06-13 Emmanuele Bassi + * fixed-to-float-patches/clutter-behaviour-ellipse.c.0.patch: - * clutter/clutter-texture.c: - (clutter_texture_unrealize), (clutter_texture_dispose): Add a - guard against reading back memory during the unrealization on - dispose. + fixes for clutter-behaviour-ellipse.c.0.patch -2008-06-13 Emmanuele Bassi +2009-01-07 Robert Bragg - Bug #953 - Actors are not hidden before unrealized or - disposed (Tommi Komulainen) + * fixed-to-float-patches/clutter-alpha.c.0.patch: - * clutter/clutter-actor.c: - (clutter_actor_unrealize): Hide a visible actor when unrealizing - it. + [clutter-alpha.c.0.patch] replace ClutterAngle with float - (clutter_actor_dispose): Make sure to unrealize an actor when - disposing it. +2009-01-07 Robert Bragg -2008-06-13 Emmanuele Bassi + * fixed-to-float.sh: - * clutter/clutter-actor.c: - (clutter_actor_dispose), (clutter_actor_destroy), - (clutter_actor_unparent): Clean up the actor's destruction - sequence, making sure that every operation is performed - under the CLUTTER_ACTOR_IN_DESTRUCTION internal flag. (thanks - to Tomas Frydrych, Neil Roberts and Matthew Allum) + Replaces uses of CoglAngle with floats (Though the CoglAngle type + remains) -2008-06-13 Emmanuele Bassi +2009-01-07 Robert Bragg - Bug #960 - PangoContext creation code should not be duplicated + * tests/interactive/test-clip.c: - * clutter/clutter-private.h: - * clutter/clutter-main.c: - (_clutter_context_create_pango_context): Abstract the creation - of the PangoContext inside its own function, to avoid code and - bugs duplication. (Tommi Komulainen) + [test-clip] Use gint for hand_{width,height} when calulating + -hand_* /2 - * clutter/clutter-entry.c (clutter_entry_init): Use the newly - added PangoContext creation function. +2009-01-08 Emmanuele Bassi - * clutter/clutter-label.c (clutter_label_init): Ditto as above. + * clutter/clutter-interval.c: + * clutter/clutter-interval.h: -2008-06-12 Emmanuele Bassi + [animation] Allow registering custom progress function - Bug #964 - "unrealized" signal of ClutterActor wrongly named +2009-01-07 Robert Bragg - * clutter/clutter-actor.c (clutter_actor_class_init): Fix typo - in the ::unrealize signal name. (Armin Burgmeier) + * tests/interactive/test-depth.c: -2008-06-12 Emmanuele Bassi + [test-depth] Use a gint for width, not guint, when calculating + -width/2 - * doc/reference/cogl/Makefile.am: Ignore cogl/gl and cogl/gles - when building the documentation. +2009-01-07 Emmanuele Bassi - * clutter/cogl/cogl.h.in: Add sections in the header file. + * clutter/clutter-animation.c: + * clutter/clutter-interval.c: + * clutter/clutter-interval.h: -2008-06-12 Emmanuele Bassi + [animation] Interval::compute_value should return a boolean - * clutter/clutter-actor.c: Add more clarifications on the - size and position accessors and the distinction between - transformed and untransformed actor box inside the actor's - description. +2009-01-07 Chris Lord -2008-06-12 Emmanuele Bassi + * clutter/clutter-texture.c: + * clutter/clutter-texture.h: + * clutter/cogl/cogl-texture.h: + * clutter/cogl/cogl-types.h: + * clutter/cogl/common/cogl-bitmap.c: + * clutter/cogl/common/cogl-bitmap.h: + * clutter/cogl/gl/cogl-texture.c: - * clutter/clutter-actor.c: Clarify the documentation of the - accessors of the width and height. + Update/clean and apply the async-texture patch from bug #1144 -2008-06-12 Neil Roberts +2009-01-07 Emmanuele Bassi - * clutter/win32/clutter-stage-win32.c: Updated to the new layout - API. All code to do with positioning the stage has been removed so - the window is left where Windows wants to put it and it can not be - moved with clutter_actor_set_position. + * clutter/clutter-text.c: - * clutter/win32/clutter-stage-win32.h (ClutterStageWin32): Remove - win_xpos and win_ypos. + Rename a variable masking index() - * clutter/win32/clutter-event-win32.c (message_translate): Remove - the handler for WM_MOVE because the stage no longer cares where it - is positioned. +2009-01-07 Neil Roberts -2008-06-12 Emmanuele Bassi - * clutter/clutter-actor.[ch]: Documentation fixes. + Merge branch multiple-texture-rectangle into master - * clutter/clutter-backend.c: Documentation fixes. +2009-01-07 Emmanuele Bassi - * clutter/clutter-container.h: Documentation fixes. + * tests/interactive/test-text.c: - * clutter/clutter-fixed.c (clutter_qdivx): Fix the return - value to be after the description. + [tests] Update the ClutterText interactive test - * clutter/clutter-texture.[ch]: Documentation fixes. +2009-01-07 Emmanuele Bassi - * clutter/clutter-timeline.c: Documentation fixes. + * clutter/clutter-binding-pool.c: + * doc/reference/clutter/clutter-sections.txt: -2008-06-11 Emmanuele Bassi + [docs] Documentation fixes - * tests/test-layout.c: Take into account the origin of the - parent, if it has changed, and queue a relayout if we are - using the transformed box when computing the layout. +2009-01-07 Emmanuele Bassi -2008-06-11 Emmanuele Bassi + * clutter/clutter-text.c: - * clutter/eglnative/clutter-stage-egl.c: Remove a duplicate - get_preferred_width() implementation. (thanks to Iain Holmes) + [text] Do not use markup on an editable Text -2008-06-11 Neil Roberts +2009-01-07 Emmanuele Bassi - * clutter/clutter-actor.c (clutter_actor_allocate): Fixed the - logic when detecting whether the actor has moved. + * clutter/clutter-text.c: -2008-06-11 Iain Holmes + [text] Do not ensure the cursor if not needed - * configure.ac: Detect the GL headers in flavour=fruity +2009-01-07 Emmanuele Bassi - * clutter/fruity/clutter-stage-fruity.c: Update the Fruity backend to - use the new size negotiation API. + * tests/interactive/test-scale.c: -2008-06-11 Emmanuele Bassi + [tests] Make test-scale use ClutterText - * clutter/clutter-label.c (clutter_label_allocate): Keep the - layout if the size of the allocation is the same as the last - allocation received by the label. +2009-01-07 Emmanuele Bassi -2008-06-11 Emmanuele Bassi + * tests/interactive/Makefile.am: + * tests/interactive/test-opacity.c: - * clutter/clutter-actor.c: Notify :x, :y, :width and :height - properties using ClutterUnits, not pixels. + [tests] Remove test-opacity interactive test -2008-06-11 Emmanuele Bassi +2009-01-07 Emmanuele Bassi - * clutter/eglnative/clutter-stage-egl.c: Update the EGL native - backend to use the new size negotiation API. -2008-06-11 Emmanuele Bassi + Merge the ClutterText actor - * clutter/sdl/clutter-stage-sdl.c: Update the SDL backend to - use the new size negotiation API. +2009-01-07 Emmanuele Bassi -2008-06-11 Emmanuele Bassi + * clutter/clutter-text.h: - Bug #961 - Fails to build on OSX + Re-align ClutterText header file - * clutter/osx/clutter-stage-osx.c: Update the OSX backend to - use the new size negotiation API. +2009-01-07 Emmanuele Bassi -2008-06-11 Emmanuele Bassi + * clutter/clutter-text.c: - * autogen.sh: Force overwriting when glib-gettextize is - invoked by autogen.sh. + [text] Fix cursor sizing -2008-06-10 Neil Roberts +2009-01-07 Emmanuele Bassi - * clutter/clutter-main.c: Include for setlocale() + * clutter/clutter-text.c: + * po/clutter-0.8.pot: -2008-06-10 Emmanuele Bassi + Comments and whitespace fixes to ClutterText - * clutter/clutter-child-meta.c: Fix section name +2009-01-07 Emmanuele Bassi - * clutter/clutter-container.c: - (clutter_container_child_set_property), - (clutter_container_child_get_property): Fix gtk-doc parameter - name. + * doc/reference/clutter/clutter-sections.txt: - * clutter/clutter-container.h: Fix documentation of the - interface vfuncs. + [docs] Add newly added :single-line-mode accessors - * clutter/clutter-event.h: Fix documentation. +2009-01-07 Emmanuele Bassi - * clutter/clutter-feature.h: Fix documentation. + * .gitignore: - * clutter/clutter-types.h: Add ClutterRequestMode. + Update the ignore file - * clutter/x11/clutter-event-x11.c: Fix documentation. +2009-01-07 Emmanuele Bassi - * tests/test-fullscreen.c: Verify that the stage size has been - changed by clutter_stage_fullscreen(). + * tests/interactive/Makefile.am: + * tests/interactive/test-text-field.c: -2008-06-10 Emmanuele Bassi + [tests] Add text field interactive test - Bug #815 - Split up request, allocation, and paint box +2009-01-07 Emmanuele Bassi - * clutter/clutter-actor.[ch]: Rework the size allocation, - request and paint area. Now ::request_coords() is called - ::allocate(), and ::query_coords() has been split into - ::get_preferred_width() and ::get_preferred_height(). See - the documentation and the layout test on how to implement - a container and layout manager with the new API. (#915, - based on a patch by Havoc Pennington, Lucas Rocha and Johan - Bilien) + * clutter/clutter-text.c: + * clutter/clutter-text.h: - * clutter/clutter-clone-texture.c: Port CloneTexture to - the new size negotiation API; it just means forwarding - the requests to the parent texture. + [text] Add single-line-mode to ClutterText - * clutter/clutter-deprecated.h: Add deprecated and replaced - API. +2009-01-06 Emmanuele Bassi - * clutter/clutter-entry.c: Port Entry to the new size - negotiation API. + * clutter/clutter-text.c: - * clutter/clutter-group.c: Port Group to the new size - negotiation API; the semantics of the Group actor do not - change. + [text] Fix the deletion actions - * clutter/clutter-label.c: Port Label to the new size - negotiation API, and vastly simplify the code. +2009-01-06 Emmanuele Bassi - * clutter/clutter-main.[ch]: Add API for executing a - relayout when needed. + * clutter/clutter-text.c: - * clutter/clutter-private.h: Add new Stage private API. + [text] Use cached length when possible - * clutter/clutter-rectangle.c: Update the get_abs_opacity() - call to get_paint_opacity(). +2009-01-06 Robert Bragg - * clutter/clutter-stage.c: - (clutter_stage_get_preferred_width), - (clutter_stage_get_preferred_height), - (clutter_stage_allocate), - (clutter_stage_class_init): Port Stage to the new size - negotiation API. + * fixed-to-float.sh: - * clutter/clutter-texture.c: Port Texture to the new size - negotiation API. + [fixed-to-float.sh] COGL_FIXED_FROM_INT wasn't casting to a float - * clutter/clutter-types.h: Add ClutterRequestMode enumeration. +2009-01-06 Robert Bragg - * clutter/x11/clutter-stage-x11.c: Port the X11 stage - implementation to the new size negotiation API. + * fixed-to-float-patches/clutter-alpha.c.0.patch: - * tests/Makefile.am: Add the layout manager test case. + [clutter-alpha.c.0.patch] Normalizes sine values [0,1] before + calculating alpha - * tests/test-opacity.c: Update. +2009-01-06 Neil Roberts - * tests/test-project.c: Update. + * clutter/cogl/gl/cogl-texture.c: - * tests/test-layout.c: Test case for a layout manager implemented - using the new size negotiation API; the layout manager handles - both transformed and untransformed children. + [cogl-material] Restore the GL_TEXTURE_ENV_MODE after + material_rectangle -2008-06-10 Emmanuele Bassi +2009-01-06 Neil Roberts - * Makefile.am: Add the po/ directory to the build. + * clutter/cogl/cogl-texture.h: + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gles/cogl-texture.c: -2008-06-10 Emmanuele Bassi + [cogl-material] Make the user_tex_coords parameter of _rectangle + const - * autogen.sh: Check for, and run glib-gettextize. +2009-01-06 Neil Roberts - * configure.ac: Set up the localization support. + * tests/interactive/test-cogl-material.c: - * clutter/clutter-main.c: Do not define the GETTEXT_PACKAGE, - but use the one from the configure script. + [test-cogl-material] Remove return value from + material_rectangle_paint - * po/POTFILES.in: Template for the translatable files. +2009-01-06 Neil Roberts -2008-06-10 Chris Lord + * clutter/cogl/gl/Makefile.am: + * clutter/cogl/gles/Makefile.am: - * clutter/clutter-main.c: (pre_parse_hook): - Call setlocale on init + Add cogl-material.h and cogl-matrix.h to + libclutterinclude_HEADERS - * clutter/x11/clutter-event-x11.c: (translate_key_event): - Fix typo and use the same buffer size as xev +2009-01-06 Emmanuele Bassi -2008-06-10 Øyvind Kolås + * tests/conform/test-clutter-text.c: + * tests/conform/test-conform-main.c: - * clutter/clutter-texture.c: improved documentation for - clutter_texture_set_filter_quality. + [tests] Add unit for the ClutterText:password-char property -2008-06-10 Chris Lord +2009-01-06 Emmanuele Bassi - Bug #916 - ClutterKeyEvent:unicode_value is ignored - Bug #950 - AltGr not handled + * doc/reference/clutter/clutter-sections.txt: - * clutter/osx/clutter-event-osx.c: (clutter_event_osx_translate): - * clutter/x11/clutter-event-x11.c: (translate_key_event): - * tests/test-events.c: (fill_keybuf), (input_cb): - Apply patch from Tommi Komulainen, fill the unicode_value attribute of - the ClutterKeyEvent struct. Also use XKeycodeToKeysym, as suggested in - bug #950, comment #2 + [docs] Update the Text section -2008-06-10 Matthew Allum +2009-01-06 Emmanuele Bassi - * clutter/clutter-texture.c: - Minor reformatting cleanups. Emit filter-quality prop on change. - * clutter/glx/clutter-glx-texture-pixmap.c: - Support mipmaps via filter quality prop. + * clutter/clutter-text.c: + * clutter/clutter-text.h: -2008-06-10 Chris Lord + [text] Coalesce text visibility and password character - * tests/Makefile.am: - * tests/test-entry-auto.c: - Add automatic test for ClutterEntry, by Tommi Komulainen +2009-01-06 Emmanuele Bassi -2008-06-10 Chris Lord + * clutter/clutter-interval.c: + * tests/interactive/test-animation.c: - * clutter/cogl/common/cogl-primitives.c: (_cogl_path_arc): - Draw as expected when end angle is lower than start angle (i.e. do not - swap the angles). This aligns with cairo behaviour. + Animate ClutterColor properties -2008-06-10 Tommi Komulainen +2009-01-06 Emmanuele Bassi - Bug#959 - Multiple minor improvements + * clutter/clutter-main.c: - * configure.ac: pick up GDKPIXBUF_PREFIX from gdk-pixbuf-2.0 - module, not pango + Allow localizations to change the text direction - * clutter/clutter-keysyms-table.h: cosmetic fix for ifdef guard - name in the comment (leftover from earlier commit) +2009-01-06 Neil Roberts - * tests/test-textures.c: don't depend on GdkPixbuf as we're not - using any actual features from it, just plain pixel buffer - manipulation + * clutter/clutter-stage.c: - * clutter/clutter-timeline.c - * clutter/clutter-timeline.h (clutter_timeline_list_markers): Use - gsize* to return number of items, not guint* - * tests/test-paint-wrapper.c: use correct type (guint*) in call - to clutter_actor_get_size() + Fix off-by-one error in clutter_stage_read_pixels - * tests/test-depth.c (janus_group): properly take height2 into - account when calculating needed height for the rectangle +2009-01-06 Takao Fujiwara - * tests/test-cogl-tex-getset.c: use rowstride, not width*4, when - calculating pixel offsets + * clutter/clutter-main.c: + * clutter/glx/clutter-backend-glx.c: + * clutter/x11/clutter-backend-x11.c: + * configure.ac: + * po/POTFILES.in: - * tests/test-cogl-tex-getset.c: Don't assume/force RGBA format, - also support ARGB format (needed with quartz imageloader.) + Bug 1397 - Allow localizing the command line help -2008-06-09 Tommi Komulainen +2009-01-05 Neil Roberts - * clutter/osx/clutter-backend-osx.c (clutter_backend_osx_post_parse): - Print GL_VENDOR, GL_RENDERER, GL_VERSION and GL_EXTENSIONS to aid - debugging. + * tests/tools/Makefile.am: + * tests/tools/disable-npots.c: -2008-06-09 Tommi Komulainen + Make libdisable-npots a bit more portable - Bug #930 - add support for quartz imagebackend +2009-01-05 Emmanuele Bassi - * clutter/cogl/common/cogl-bitmap-pixbuf.c - (_cogl_bitmap_from_file): When USE_QUARTZ is defined implement - using Core Graphics. - * configure.ac: support --with-imagebackend=quartz and print - which imagebackend is selected. Make quartz default on OSX + * clutter/clutter-main.c: -2008-06-09 Øyvind Kolås + Clean up the update_pango_context() function - * clutter/cogl/common/cogl-primitives.c: (cogl_path_rel_curve_to): - fixed naming of implementation of cogl_path_rel_curve_to (it was - called just cogl_rel_curve_to). +2009-01-05 Emmanuele Bassi -2008-06-09 Emmanuele Bassi + * clutter/clutter-main.c: - * configure.ac: Clean up a bit the X11 and X extensions - checks with PKG_CHECK_EXISTS(). Since we are filling up the - X11_CFLAGS and X11_LIBS variables ourselves there is no - point in polluting the Makefiles with unused variables. + Pass the PangoContext, not the MainContext - * clutter/Makefile.am: Remove the pkg-config variable - evaluation and use the values retrieved from the configure - script. +2009-01-05 Emmanuele Bassi -2008-06-09 Chris Lord + * clutter/clutter-main.c: - Bug #914 - ClutterEntry is confused about characters vs. bytes + Revert the logic of the PangoContext check - * clutter/clutter-entry.c: (clutter_entry_ensure_layout), - (clutter_entry_handle_key_event_internal), - (clutter_entry_set_text): - Fix mix-up of character and byte counts, handle unicode correctly. - Use clutter_key_event_unicode() instead of - clutter_keysym_to_unicode(). +2009-01-05 Emmanuele Bassi - * clutter/clutter-event.c: (clutter_key_event_unicode): - Don't ignore ClutterKeyEvent.unicode_value + * clutter/clutter-binding-pool.c: - * clutter/clutter-keysyms-table.h: - Rename header define so as not to conflict with clutter-keysyms.h + Remove the binding pool entry from the list - Patch originally by Emmanuele Bassi, with input from Tommi Komulainen. +2009-01-05 Emmanuele Bassi -2008-06-07 Øyvind Kolås + * clutter/clutter-binding-pool.c: + * clutter/clutter-binding-pool.h: + * doc/reference/clutter/clutter-sections.txt: - * clutter/clutter-texture.c: made the filter-quality proeprty also - control the use of mipmapping. - * clutter/clutter-texture.h: added ClutterTextureQuality enum. - * tests/test-texture-quality.c: new test. - * tests/Makefile.am: added test-texture-quality + Remove BindingPool::list_actions() -2008-06-06 Emmanuele Bassi +2009-01-05 Emmanuele Bassi - * clutter/clutter-texture.c: - (clutter_texture_class_init): Do not unrealize on hide(), and - do not realize() on show. By default, clutter_actor_show() will - realize ourselves, and we don't want to unrealize when hidden - to avoid paying the penalty of reading back the texture data - from the video memory. + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: - * tests/test-actors.c: Show all textures again when pressing - the 'r' key. + Add ClutterActor::create_pango_context() -2008-06-06 Neil Roberts +2009-01-05 Emmanuele Bassi - * tests/test-shader.c: Use the special wrapper vars when building - for GLES 2 and automatically cycle the shaders because it's - difficult to right-click. + * clutter/clutter-main.c: + * clutter/clutter-private.h: -2008-06-06 Neil Roberts + Rename the PangoContext creation functions - * tests/test-shader.c: Fixed to use sampler2D instead of - sampler2DRect now that GL_TEXTURE_RECTANGLE support is disabled in - revision 2834. The ClutterTexture actor now has the - 'disable-slicing' property set. The distance in texture - coordinates between pixels is passed in as a uniform so that the - box-blur shader can still work. +2009-01-05 Emmanuele Bassi -2008-06-06 Emmanuele Bassi + * clutter/clutter-text.c: - Bug #952 - Fix test-textures in trunk + Whitespace fixes - * tests/test-textures.c: Use USE_GDKPIXBUF instead of - USE_PIXBUF. (#952, Gwenole Beauchesne) +2009-01-05 Neil Roberts -2008-06-06 Emmanuele Bassi + * clutter/clutter-animation.c: - Bug #951 - Fix clutter_entry_init() in trunk + Fix some animation_set_* functions so they cope if the value is + the same - * clutter/clutter-entry.c (clutter_entry_init): Remove a - variable shadowing another one. (#951, Tommi Komulainen) +2009-01-05 Neil Roberts -2008-06-06 Emmanuele Bassi + * clutter/clutter-actor.c: + * clutter/clutter-alpha.c: + * clutter/clutter-behaviour.c: + * clutter/clutter-clone-texture.c: - Bug #955 - ClutterLabel is missing fallback resolution handling + Fix some *_set functions so they work if the object is the same + value - * clutter/clutter-label.c (clutter_label_init): Handle - clutter_backend_get_resolution() return value -1 similar to - ClutterEntry (falling back to 96.0). (#955, Tommi Komulainen) +2009-01-05 Neil Roberts -2008-06-06 Neil Roberts + * clutter/clutter-animation.c: - * clutter/eglnative/clutter-stage-egl.c - (clutter_stage_egl_realize): Use ES 2 renderable type when - building for GLES 2. + Fix setting the mode on a ClutterAlpha created with + animation_set_alpha(NULL) - * clutter/eglnative/clutter-event-egl.c (get_backend_time): Added - a NULL for the microseconds parameter of g_timer_elapsed. +2009-01-05 Emmanuele Bassi - * clutter/eglnative/clutter-stage-egl.h: - * clutter/eglnative/clutter-egl.h: - * clutter/eglnative/clutter-backend-egl.h: Include - clutter-egl-headers.h instead of including the GL headers directly - so it can include gl2.h when building for GLES 2. + * doc/reference/clutter/clutter-sections.txt: - * clutter/eglnative/clutter-egl-headers.h: - * clutter/eglnative/Makefile.am (libclutter_eglnative_la_SOURCES): - Added clutter-egl-headers.h + [docs] Add the new API to the BindingPool section - * clutter/cogl/gles/cogl-fixed-fragment-shader.glsl: GLES 2 - doesn't provide a default precision for floats in the fragment - shader and it will reject the shader if there isn't one. +2009-01-05 Emmanuele Bassi -2008-06-06 Matthew Allum + * clutter/clutter-binding-pool.c: + * clutter/clutter-binding-pool.h: - Bug #948 - Remove texture rectangle support + Allow overriding actions inside a BindingPool - * clutter/clutter-feature.c: - * clutter/clutter-feature.h: - * clutter/clutter-texture.c: - * clutter/cogl/gl/cogl.c: - * clutter/glx/clutter-glx-texture-pixmap.c: - Remove support for GL_TEXTURE_RECTANGLE_ARB (now using just regular - 2D textures, with optional npots extension). Simplifys code, + makes - mipmap & shader support much more sane. +2009-01-05 Neil Roberts -2008-06-06 Øyvind Kolås + * clutter/clutter-alpha.c: - Bug #931 - suspicious size allocation for pixel data. + In clutter_alpha_set_mode, set priv->mode after setting the func - * clutter/cogl/common/cogl-bitmap-pixbuf.c: - (_cogl_bitmap_from_file): allocate height×rowstride and not duplicate - gdkpixbuf's strange optimization saving some bytes at the end of the - pixbuf. +2009-01-05 Emmanuele Bassi -2008-06-05 Tommi Komulainen + * clutter/clutter-text.c: - Bug 913 - cogl fails to build on OSX + [text] Add select-all binding - * clutter/cogl/gl/cogl-fbo.c: define GL_READ_FRAMEBUFFER_EXT and - GL_DRAW_FRAMEBUFFER_EXT if not defined in the build system. The - #ifdef can fail if they're not #defines but variables or enums. - As the values are supposed to be industry standard even then - it shouldn't have ill effects. +2008-12-16 Emmanuele Bassi -2008-06-05 Tommi Komulainen + * doc/reference/clutter/clutter-sections.txt: - Bug #911 - OSX: add multistage support + [docs] Add clutter_text_activate() - * clutter/osx/clutter-backend-osx.{c,h} - (clutter_backend_osx_init_stage, clutter_backend_osx_get_stage, - clutter_backend_osx_redraw, clutter_backend_osx_create_stage, - clutter_backend_osx_ensure_context, clutter_backend_osx_class_init, - clutter_backend_osx_dispose, ClutterGLView:drawRect:): - * clutter/osx/clutter-stage-osx.{c,h} (clutter_stage_osx_realize, - ClutterGLWindow:setFrameSize:): - Adapt to new multistage backend API. Don't keep a pointer to - default stage. Derive from ClutterActor instead of ClutterStage. - Implement ClutterStageWindow interface. Paint, resize and - otherwise manipulate the wrapper rather than self when necessary. +2008-12-16 Emmanuele Bassi - (clutter_backend_post_parse): Create our singleton GL context - here. We could probably create the context when the default - stage is created, but I think this is more clean. + * doc/reference/clutter/clutter-sections.txt: - * clutter/osx/clutter-event-osx.c (clutter_event_osx_translate) - * clutter/osx/clutter-stage-osx.c (clutter_stage_osx_state_update, - ClutterGLWindow:windowShouldClose:): - * clutter/osx/clutter-stage-osx.h: Export ClutterGLWindow interface - for clutter-event-osx.c to easily get the stage for NSWindow. - Fill in ClutterEventAny::stage on our events. + [docs] Remove ClutterLabel and ClutterEntry sections -2008-06-05 Tommi Komulainen +2009-01-05 Emmanuele Bassi - Bug #910 - OSX: missing memory pool - * clutter/osx/clutter-backend-osx.c (clutter_backend_osx_redraw): - Add missing memory pool wrapup. + Merge branch 'units-rework' -2008-06-05 Tommi Komulainen +2008-12-23 Robert Bragg - Bug #909 - OSX: missing NULL pointer handling + * clutter/clutter-clone-texture.c: + * clutter/clutter-texture.c: + * clutter/cogl/cogl-texture.h: + * clutter/cogl/common/cogl-material-private.h: + * clutter/cogl/gl/cogl-texture.c: + * tests/interactive/test-cogl-material.c: - * clutter/osx/clutter-stage-osx.c (ClutterGLWindow, - clutter_stage_osx_set_title): NSString:stringWithUTF8String: - does not accept NULL values, use empty string ("") instead. - Avoids potential crash. + [cogl-material] improvements for cogl_material_rectangle -2008-06-05 Emmanuele Bassi +2008-12-23 Robert Bragg - * tests/Makefile.am: - * tests/test-paint-wrapper.c: Add a test case (merely, a copy - of test-actors.c) that verifies that handlers to the ::paint - signal are called in the right order. + * clutter/cogl/cogl-material.h: + * clutter/cogl/common/cogl-material.c: -2008-06-05 Emmanuele Bassi + [cogl-material] Adds a cogl_material_set_color function - Bug #840 - Implement prepare-paint and finish-paint signals. +2008-12-23 Robert Bragg - * clutter/clutter-actor.c: - (clutter_actor_class_init): Add the ::paint, ::realize and - ::unrealize signals to ClutterActor. It is possible to - override the paint, realization and unrealization of an - actor without subclassing it. The ::paint signal handlers - have the same limitations of a ClutterActor::paint implementation - inside a subclass. + * clutter/cogl/cogl-material.h: + * clutter/cogl/common/cogl-material.c: + * clutter/cogl/gl/cogl-context.c: + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gl/cogl-texture.c: - (clutter_actor_realize), - (clutter_actor_unrealize), - (clutter_actor_paint): Emit the signals instead of calling - the functions from the class vtable. + [cogl-material] Some improvements for how we sync CoglMaterial + state with OpenGL -2008-06-05 Emmanuele Bassi +2008-12-23 Robert Bragg - * ChangeLog-ivan: Remove the ChangeLog of the clutter-ivan - branch; the branch already contains it. + * clutter/clutter-clone-texture.c: + * clutter/clutter-texture.c: + * clutter/clutter-texture.h: -2008-06-05 Matthew Allum + [cogl-material] Converts clutter-texture/clutter-clone-texture to + the material API - * clutter/glx/clutter-glx-texture-pixmap.h: - Actually export clutter_glx_texture_pixmap_using_extension () +2008-12-24 Robert Bragg -2008-06-05 Chris Lord - * clutter/clutter-entry.c: - Correct the documentation for clutter_entry_set_max_length, fixes bug - #915. + Merge branch 'master' into cogl-material -2008-06-04 Robert Bragg +2008-12-23 Robert Bragg - * tests/test-clip.c: - Removes a spurious #include which may not - be found if using --with-imagebackend=internal + * clutter/clutter-clone-texture.c: + * clutter/clutter-texture.c: + * clutter/clutter-texture.h: + * clutter/cogl/cogl-texture.h: + * clutter/cogl/gl/cogl-context.c: + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gl/cogl-texture.c: -2008-06-04 Robert Bragg + White space clean up across a number of files (only removing + trailing spaces) - * configure.ac: - Checks that for pangocairo >= 1.18, since - pangocairo-font.c uses pango_cairo_font_get_scaled_font which isn't - otherwise available. - -2008-06-03 Neil Roberts - - Applied patch from bug #947 - - * clutter/clutter-stage.c (clutter_stage_get_default): Don't grab - the floating reference when creating the default stage. The stage - manager will take a reference to it so it will behave as any other - stage. - (clutter_stage_new): Don't take the floating reference to the new - stage but let the stage manager keep it instead. - - * clutter/clutter-stage-manager.c - (_clutter_stage_manager_add_stage): Take a reference to the stage - when it is added to the list. - (_clutter_stage_manager_remove_stage): Unref the stage when it is - removed from the list. - (clutter_stage_manager_dispose): Keep track of the 'next' pointer - as a separate variable so we can cope when the stage being - destroyed removes itself from the list as the list is being - iterated. - - * clutter/clutter-actor.c (clutter_actor_destroy): Take a - reference at the beginning of the function even if there is no - parent container so that overall the reference count is not - changed when the actor is unref'd again at the bottom of the - function. Previously it would have a net effect of leaving the - reference count alone unless it is a top level actor in which case - it would unref it. +2008-12-23 Emmanuele Bassi -2008-06-03 Matthew Allum + * tests/conform/test-binding-pool.c: - * clutter/glx/clutter-glx-texture-pixmap.c: - Dont always fallback to x11 (slow) updates for a single - failed pixmap. - Minor cleanups. - * clutter/x11/clutter-x11-texture-pixmap.c: - Move shm allocation to only area updates. + Remove a masking with index() -2008-06-03 Øyvind Kolås +2008-12-23 Emmanuele Bassi - * clutter/clutter-container.c: (container_get_child_property): - s/g_object_set_property/g_object_get_property/ + * clutter/clutter-behaviour-rotate.c: -2008-06-02 Neil Roberts + Fix an empty block - * clutter/pango/pangoclutter-glyph-cache.c - (pango_clutter_glyph_cache_set): When creating a new band, make - sure the texture is wide enough for the glyph, not just tall - enough. +2008-12-23 Emmanuele Bassi -2008-06-02 Neil Roberts + * configure.ac: - Applied 'final patch' from bug #874 + Add more maintainer CFLAGS - * clutter/cogl/gles/cogl.c: - * clutter/cogl/gl/cogl.c: The clip planes are now set using the - inverse projection matrix as the modelview matrix so that they can - be specified in screen coordinates. +2008-12-23 Emmanuele Bassi - * clutter/cogl/gles/cogl-context.h (CoglContext): - * clutter/cogl/gl/cogl-context.h (CoglContext): Added a member to - cache the inverse projection matrix + * clutter/clutter-actor.c: + * clutter/clutter-backend.c: + * doc/reference/clutter/clutter-sections.txt: - * clutter/clutter-fixed.h: Added a constant for converting from - radians to degrees. + [docs] Document the newly added functions - * clutter/clutter-fixed.c (clutter_atani, clutter_atan2i): Added - fixed-point versions of atan and atan2. +2008-12-23 Emmanuele Bassi - * tests/test-clip.c: Added a test for clipping with various - rotations and depths. + * clutter/clutter-main.c: - * tests/Makefile.am (noinst_PROGRAMS): Added test-clip + Add the ability to set the text direction -2008-06-02 Neil Roberts +2008-12-23 Emmanuele Bassi - * clutter/cogl/gles/cogl-gles2-wrapper.h: The uniform numbers are - now stored in a separate struct so they can be stored for - application program objects as well. + * clutter/clutter-backend.c: - * clutter/cogl/gles/cogl.c: Moved stub shader functions into - separate files. - (_cogl_features_init): Report support for the shaders feature on - GLES 2 + Return the default font name if no font name is set - * clutter/cogl/gles/cogl-shader.h: - * clutter/cogl/gles/cogl-shader.c: - * clutter/cogl/gles/cogl-program.h: - * clutter/cogl/gles/cogl-program.c: Separate files to handle - shaders on programs on GLES. If version 1.1 is being used then the - stub functions which all fail are still used. - - * clutter/cogl/gles/cogl-gles2-wrapper.c - (cogl_gles2_wrapper_init, cogl_gles2_wrapper_bind_attributes), - (cogl_gles2_wrapper_get_uniforms): Move the uniforms and attribute - bindings into a separate function so they can be used to bind on - application shaders as well. - (cogl_gles2_wrapper_update_matrix): Now takes a parameter and is - no longer static so that it can be used to update all of the - matrices when a new shader is bound. - - * clutter/cogl/gles/cogl-defines.h.in: Use GL_COMPILE_STATUS for - CGL_OBJECT_COMPILE_STATUS if the latter isn't available (for - example on GLES 2). - - * clutter/cogl/gles/cogl-context.h (CoglContext): Added handle - arrays for programs and shaders. - - * clutter/cogl/gles/cogl-context.c (cogl_create_context) - (cogl_destroy_context): Initialize and destroy program and shader - handle array. - - * clutter/cogl/gles/Makefile.am (libclutter_cogl_la_SOURCES): Add - cogl-{shader,program}.{c,h} +2008-12-23 Emmanuele Bassi -2008-06-02 Neil Roberts + * clutter/clutter-text.c: - * clutter/cogl/gl/cogl-context.c (cogl_destroy_context): Fix - cut-and-paste error where the wrong arrays were being freed. + Use the default font from the Backend -2008-06-01 Emmanuele Bassi +2008-12-23 Emmanuele Bassi - Merge from clutter-0-6: + * clutter/clutter-backend.c: + * clutter/clutter-backend.h: - * clutter/clutter-model.c: - (clutter_model_iter_set_internal_valist): Add an internal function - wrapping ClutterModelIter::set_value that does not emit the - ::row-changed signal. Emitting this signal before the ::row-added - one is wrong: a row cannot change before being inserted. + Store the default font name inside ClutterBackend - (clutter_model_append), (clutter_model_prepend), - (clutter_model_insert): Use the non-signal emitting variant of - clutter_model_iter_set_valist(). +2008-12-23 Emmanuele Bassi - (clutter_model_iter_set_valist): Use the internal version and emit - the ::row-changed signal at the end. + * clutter/clutter-main.c: -2008-05-31 Emmanuele Bassi + Update the PangoContext on backend changes - Bug #943 - Signals are only emitted within a certain area of - the stage +2008-12-23 Emmanuele Bassi - * clutter/clutter-main.c (clutter_do_event): Use the proper - API and not the macros for the default stage, in case we are - using a backend supporting multiple stages. (Julian Aron Prenner) + * clutter/clutter-actor.c: + * clutter/clutter-main.c: + * clutter/clutter-private.h: -2008-05-30 Emmanuele Bassi + Store the PangoContext inside the main context - * clutter/pango/pangoclutter-fontmap.c: - * clutter/pango/pangoclutter-renderer.c: - * clutter/pango/pangoclutter.h - * clutter/pango/pangoclutter-private.h: Add a function retrieving - the font mipmapping setting. - -2008-05-29 Neil Roberts - - * clutter/cogl/gles/cogl-gles2-wrapper.h (CoglGles2Wrapper): Added - uniforms for alpha testing. - - * clutter/cogl/gles/cogl-gles2-wrapper.c - (cogl_gles2_wrapper_init): Get the uniforms for alpha testing - settings. - (cogl_wrap_glEnable, cogl_wrap_glDisable): Enable/disable alpha - testing. - (cogl_wrap_glAlphaFunc): Filled in the wrapper. +2008-12-23 Emmanuele Bassi - * clutter/cogl/gles/cogl-fixed-fragment-shader.glsl: Added alpha - testing. + * clutter/clutter-actor.c: - * clutter/cogl/gles/cogl-gles2-wrapper.h: - * clutter/cogl/gles/cogl-gles2-wrapper.c - (cogl_wrap_glGetIntegerv): Added a wrapper for glGetIntegerv so - that it can report zero clip planes. + Do not leak the PangoContext - * clutter/cogl/gles/cogl.c: - * clutter/cogl/gles/cogl-texture.c: Use the wrapped version of - glGetIntegerv +2008-12-23 Emmanuele Bassi - * clutter/cogl/gles/cogl-primitives.c (_cogl_path_fill_nodes): Use - _cogl_features_available to check for the stencil buffer instead - of an #ifdef. The stencil buffer is available in the default - profile for the GLES 2 simulator. + * clutter/clutter-text.c: -2008-05-29 Emmanuele Bassi + Create the PangoContext of the Text actor - * configure.ac: Check the --with switches as soon as we have them, - to avoid further checks that will fail anyway. +2008-12-23 Emmanuele Bassi -2008-05-29 Emmanuele Bassi + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: - * README: Update the configure arguments list. + Add a per-actor PangoContext -2008-05-28 Neil Roberts +2008-12-23 Emmanuele Bassi - * clutter/cogl/gles/cogl-gles2-wrapper.c - (cogl_gles2_wrapper_init): Get uniforms for fog parameters and - initialise them. - (cogl_wrap_glDrawArrays): Store the modelview matrix in a uniform - as well so that it can be used for fogging calculations. - (cogl_wrap_glEnable, cogl_wrap_glDisable): Enable/disable fogging. - (cogl_wrap_glFogx, cogl_wrap_glFogxv): Fill in wrapper to set - fogging parameters. + * clutter/clutter-backend.c: + * clutter/clutter-backend.h: - * clutter/cogl/gles/cogl-fixed-vertex-shader.glsl: Calculate the - fog amount if fogging is enabled. + Add signals for Backend options - * clutter/cogl/gles/cogl-fixed-fragment-shader.glsl: Mix with fog - color. +2008-12-19 Robert Bragg - * clutter/cogl/gles/cogl-gles2-wrapper.h (CoglGles2Wrapper): Add - uniforms for fogging. + * fixed-to-float-patches/clutter-actor.c.0.patch: + * fixed-to-float-patches/clutter-alpha.c.0.patch: + * fixed-to-float-patches/clutter-alpha.h.0.patch: + * fixed-to-float-patches/clutter-behaviour-ellipse.c.0.patch: + * fixed-to-float-patches/clutter-bezier.c.0.patch: + * fixed-to-float-patches/clutter-fixed.c.0.patch: + * fixed-to-float-patches/clutter-fixed.h.0.patch: + * fixed-to-float-patches/clutter-path.c.0.patch: + * fixed-to-float-patches/clutter-texture.c.0.patch: + * fixed-to-float-patches/clutter-units.h.0.patch: + * fixed-to-float-patches/cogl-fixed.c.0.patch: + * fixed-to-float-patches/cogl-fixed.h.0.patch: + * fixed-to-float-patches/cogl-pango-render.c.0.patch: + * fixed-to-float-patches/cogl-primitives.c.0.patch: + * fixed-to-float-patches/gl-cogl-primitives.c.0.patch: + * fixed-to-float-patches/gl-cogl-texture.c.0.patch: + * fixed-to-float-patches/gl-cogl.c: + * fixed-to-float-patches/mtx_transform.0.patch: + * fixed-to-float-patches/test-cogl-tex-tile.c.0.patch: + * fixed-to-float.sh: + + First cut at a fixed point to floating point conversion script + + patches + +2008-12-22 Robert Bragg + + * clutter/cogl/cogl-material.h: + * clutter/cogl/common/cogl-material.c: + * doc/reference/cogl/cogl-docs.sgml: + * doc/reference/cogl/cogl-sections.txt: + + [doc] Hooks up cogl-material reference documentation + +2008-12-18 Robert Bragg + + * clutter/cogl/cogl-material.h: + * clutter/cogl/gles/cogl-context.c: + * clutter/cogl/gles/cogl-context.h: + * clutter/cogl/gles/cogl-texture.c: -2008-05-28 Emmanuele Bassi + Updates previous GLES multi-texturing code to use CoglMaterial - * clutter/pango/pangoclutter-font.c: Remove unneeded file. +2008-12-11 Robert Bragg - * tests/Makefile.am: - * tests/test-random-text.c: Add a test for checking the - glyph cache. + * clutter/cogl/cogl-material.h: + * clutter/cogl/cogl.h.in: + * clutter/cogl/common/Makefile.am: + * clutter/cogl/common/cogl-material-private.h: + * clutter/cogl/common/cogl-material.c: + * clutter/cogl/common/cogl-matrix.h: + * clutter/cogl/gl/cogl-context.c: + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gl/cogl-texture-private.h: + * clutter/cogl/gl/cogl-texture.c: + * tests/data/Makefile.am: + * tests/data/light0.png: + * tests/data/light1.png: + * tests/interactive/Makefile.am: + * tests/interactive/test-cogl-material.c: + * tests/interactive/test-cogl-multi-texture.c: -2008-05-28 Emmanuele Bassi + Adds a CoglMaterial abstraction, which includes support for + multi-texturing - Bug #919 - Replacement pango renderer (Neil Roberts) +2008-12-22 Robert Bragg - * clutter/clutter-backend.h: - * clutter/clutter-backend.c: - (clutter_backend_set_font_options), - (clutter_backend_get_font_options): Add the ability to set - the cairo_font_options_t* for the backend at construction - time, so that backend implementations can have their own - options. + * clutter/cogl/cogl-matrix.h: + * doc/reference/cogl/cogl-docs.sgml: + * doc/reference/cogl/cogl-sections.txt: - * clutter/clutter-color.c: Include pango/pango-attributes.h - for the pango_color_parse() function. + [doc] Hooks up cogl-matrix reference documentation - * clutter/clutter-label.c: - (clutter_label_ensure_layout), - (clutter_label_init), (clutter_label_set_text), - (clutter_label_set_font_name), (clutter_label_set_ellipsize), - (clutter_label_set_use_markup): Ensure that the cache is - always primed when the Label changes; this makes sure that - the cache is rebuilt outside the paint run, which should - make the painting perform better especially on embedded - devices. +2008-12-11 Robert Bragg - * clutter/clutter-entry.c: - (clutter_entry_ensure_layout), - (clutter_entry_init), (clutter_entry_set_text), - (clutter_entry_set_font_name): Ditto as above. + * clutter/cogl/cogl-matrix.h: + * clutter/cogl/common/Makefile.am: + * clutter/cogl/common/cogl-matrix.c: + * clutter/cogl/common/cogl-matrix.h: - * clutter/clutter-private.h: - * clutter/clutter-main.[ch]: Create the font-map inside the - main context; add two new functions: + Adds CoglMatrix utility code - clutter_clear_glyph_cache() - clutter_set_use_mipmapped_text() +2008-12-11 Robert Bragg - that control the glyphs cache. + * tests/data/Makefile.am: + * tests/data/light0.png: + * tests/data/light1.png: + * tests/data/redhand_alpha.png: + * tests/interactive/Makefile.am: + * tests/interactive/test-cogl-multi-texture.c: - * clutter/pango/Makefile.am: - * clutter/pango/pangoclutter-fontmap.c: - * clutter/pango/pangoclutter-private.h: - * clutter/pango/pangoclutter-render.c: - * clutter/pango/pangoclutter.h: Rewrite the Pango renderer - using a PangoCairo context and saving the glyphs inside a - more efficient cache. + [tests] Adds an interactive unit test for multi-texturing - * configure.ac: Depend on pangocairo instead of pangoft2. +2008-12-11 Robert Bragg -2008-05-28 Emmanuele Bassi + * clutter/cogl/cogl-texture.h: + * clutter/cogl/common/cogl-handle.h: + * clutter/cogl/gl/cogl-context.c: + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gl/cogl-defines.h.in: + * clutter/cogl/gl/cogl-texture-private.h: + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gles/cogl-context.c: + * clutter/cogl/gles/cogl-context.h: + * clutter/cogl/gles/cogl-defines.h.in: + * clutter/cogl/gles/cogl-fixed-fragment-shader.glsl: + * clutter/cogl/gles/cogl-fixed-vertex-shader.glsl: + * clutter/cogl/gles/cogl-gles2-wrapper.c: + * clutter/cogl/gles/cogl-gles2-wrapper.h: + * clutter/cogl/gles/cogl-texture-private.h: + * clutter/cogl/gles/cogl-texture.c: - Bug 882 - Allow child properties for containers implementing the - ClutterContainer interface (Øyvind Kolås) + [multi-texturing] This adds a new cogl_multi_texture API for + GL,GLES1 + GLES2 - * clutter/clutter-child-meta.[ch]: Base class for the metadata - of a ClutterActor inside a ClutterContainer; the ChildMeta - object implements a wrapper for storing data that is attached - to a ClutterActor only when it's part of a ClutterContainer. - The ChildMeta object is used to store the child properties - accessible through the ClutterContainer API. +2008-12-22 Emmanuele Bassi - * clutter/clutter-container.[ch]: Creates the ChildMeta for - each actor, in case the Container specifies the ChildMeta - type to use. + * clutter/clutter-text.c: + * tests/conform/test-clutter-text.c: - * clutter/Makefile.am: Add clutter-child-meta.[ch] to the build. + Use "" as the default value for the :text property - * clutter/clutter-marshal.list: Add the marshaller for the - ClutterContainer::child-notify signal. +2008-12-22 Emmanuele Bassi - * clutter/clutter-types.h: Declare ClutterContainer and - ClutterChildMeta to avoid recursive inclusion. + * clutter/clutter-private.h: + * clutter/clutter-text.c: -2008-05-28 Neil Roberts + Do not include cogl-pango.h multiple times - * clutter/cogl/gles/Makefile.am: Use old-style Makefile rules for - the stringify script so that automake won't complain. +2008-12-22 Owen Taylor -2008-05-28 Emmanuele Bassi + * clutter/x11/clutter-event-x11.c: - * tests/test-script.c: - * tests/test-script.json: Test merging the same actor from two - different sources. + Return something reasonable from clutter_x11_handle_event() -2008-05-28 Emmanuele Bassi +2008-12-21 Robert Bragg - Fix merging of objects with the same id. + * .gitignore: - * clutter/clutter-script.c: - (json_object_end): If there already is an ObjectInfo under the - parsed id, merge the construction with the currently stored - state. + [gitignore] Adds *.swn + *.swo (Vim files) & *.orig + *.reg + (patch conflicts) - (parse_children), (parse_signals), - (parse_behaviours): Append the newly parsed children, signals - and behaviours, in case the ObjectInfo already has unresolved - items. +2008-12-21 Robert Bragg - (clutter_script_construct_object): Fix a typo in the type check. + * clutter/clutter-cairo-texture.h: + * clutter/clutter-path.h: - (clutter_script_init): Do not copy the key inside the hash - table holding the objects - we are already holding it inside - the value. + [build] Replaces use of #include with #include + -2008-05-28 Neil Roberts +2008-12-19 Robert Bragg - * clutter/cogl/gles/cogl-gles2-wrapper.c (cogl_wrap_glGetFixedv): - Filled in the wrapper for glGetFixedv + * tests/interactive/Makefile.am: -2008-05-28 Neil Roberts + [tests] Ensures that test-viewport.c is built - * clutter/cogl/gles/cogl-texture.c: Use the wrapper for - glTexParameteri. Call glGenerateMipmap after every change to the - texture image data. +2008-12-19 Robert Bragg - * clutter/cogl/gles/cogl-gles2-wrapper.h: - * clutter/cogl/gles/cogl-gles2-wrapper.c: Added a wrapper for - glTexParameteri so that it can ignore requests to set - GL_GENERATE_MIPMAP. Added a wrapper for glGenerateMipmap that does - nothing on GLES 1 + * tests/conform/Makefile.am: + * tests/conform/test-launcher.sh: -2008-05-28 Emmanuele Bassi + [tests] Ensure that test-launcher.sh is found for out of tree + builds - * clutter/clutter-script.c: - (clutter_script_construct_object): Mark top-level objects, - that is objects that don't have their ownership transferred - when building up a ClutterScript. - - (object_info_free): Merge a fix from the stable branch, but - do not check the type - check whether the object is a top - level (we still need the ClutterActor type check in order to - call clutter_actor_destroy()). +2008-12-19 Emmanuele Bassi -2008-05-28 Emmanuele Bassi + * clutter/clutter-path.c: + * clutter/clutter-path.h: - * clutter/clutter-rectangle.c: - (clutter_rectangle_paint): Remove commented out call to - cogl_enable(); the call is not needed and the comment is - in C99. - -2008-05-27 Neil Roberts - - * clutter/eglx/clutter-stage-egl.h: - * clutter/eglx/clutter-egl-headers.h: - * clutter/eglx/clutter-backend-egl.h: - * clutter/eglx/Makefile.am: Include the GLES and EGL headers via - clutter-egl-headers.h so that the right version can be used - depending on whether the GLES 2 wrapper is being used. - - * configure.ac: Added an automake conditional for whether the GLES - 2 wrapper should be used. - - * clutter/eglx/clutter-stage-egl.c (clutter_stage_egl_realize): - Remove the call to glGetIntegerv to get the max texture size. It - was being called before the GL context was bound so it didn't work - anyway and it was causing trouble for the GLES 2 simulator. + Avoid masking math.h exported variables - * clutter/cogl/gles/stringify.sh: Shell script to convert the - shaders into a C string. +2008-12-19 Emmanuele Bassi - * clutter/cogl/gles/cogl-gles2-wrapper.h: - * clutter/cogl/gles/cogl-gles2-wrapper.c: Wrappers for most of the - missing GL functions in GLES 2. + * doc/reference/clutter/clutter-sections.txt: - * clutter/cogl/gles/cogl-fixed-fragment-shader.glsl: - * clutter/cogl/gles/cogl-fixed-vertex-shader.glsl: New shaders for - GLES 2 + [docs] Remove a duplicate definition - * clutter/cogl/gles/cogl-defines.h.in: Use the @CLUTTER_GL_HEADER@ - macro instead of always using the GLES 1 header. +2008-12-19 Emmanuele Bassi - * clutter/cogl/gles/cogl-context.h (CoglContext): Include a field - for the state of the GLES 2 wrapper. + * clutter/clutter-cairo-texture.c: - * clutter/cogl/gles/cogl-texture.c: - * clutter/cogl/gles/cogl-primitives.c: - * clutter/cogl/gles/cogl.c: Use wrapped versions of the GL - functions where neccessary. + [docs] Documentation fixes for CairoTexture - * clutter/cogl/gles/Makefile.am: Add sources for the GLES 2 - wrapper and an extra build step to put the GLSL files into a C - string whenever the files change. +2008-12-19 Emmanuele Bassi -2008-05-26 Matthew Allum + * clutter/clutter-path.c: - * clutter/x11/clutter-stage-x11.c: (clutter_stage_x11_request_coords): - Dont allow the window to be resize to 0 dimentions. (fixes #933) + Whitespace fixes -2008-05-23 Emmanuele Bassi +2008-12-19 Emmanuele Bassi - Bug #912 - Invalid use of int* as parameter for glGetIntegerv + * clutter/clutter-path.c: + * clutter/clutter-path.h: - * clutter/cogl/gl/cogl.c (_cogl_features_init): Use GLint - instead of int. (#912, Tommi Komulainen) + [docs] Parameter naming fixes -2008-05-23 Emmanuele Bassi +2008-12-19 Emmanuele Bassi - Bug #928 - Reparenting a child that itself is a container - doesn't work + * doc/reference/clutter/clutter-sections.txt: - * clutter/clutter-actor.c (clutter_actor_set_parent): Realize - an actor when setting its parent, if the parent is realized. + [docs] Add last few missing symbols to the sections file - * clutter/clutter-group.c: - (clutter_group_realize), (clutter_group_class_init): Add the - missing implementation of the ::realize() virtual function; this - makes sure that the children of a Group are realized if the Group - is realized. (#928) - -2008-05-21 Neil Roberts - - * clutter/cogl/gl/cogl.c (error_string): - * clutter/cogl/gles/cogl.c (error_string): Rename to - _cogl_error_string and remove the static scoping so that it can be - called in cogl-texture etc. - - * clutter/cogl/gl/cogl-texture.c (cogl_texture_new_from_foreign): - * clutter/cogl/gles/cogl-texture.c (cogl_texture_new_from_foreign): - GE(*) can't be used to wrap around calls that use the return - value. - - * clutter/cogl/gl/cogl-texture.c (_cogl_texture_quad_sw) - (_cogl_texture_quad_hw, cogl_texture_polygon): Remove GE(*) - wrapper around calls in the middle of a glBegin/glEnd pair which - otherwise always generate an error because glGetError can only be - called outside of the pair. +2008-12-19 Emmanuele Bassi - * clutter/cogl/gl/cogl-internal.h: Include stdio.h when definig - COGL_DEBUG and declare a prototype for _cogl_error_string. + * doc/reference/clutter/clutter-sections.txt: - * clutter/cogl/gles/cogl-internal.h: Match GE(*) macro to GL - version. + [docs] Add shader symbols to their sections -2008-05-21 Ivan Leben +2008-12-19 Emmanuele Bassi - * clutter/cogl/gles/cogl-texture.c: - (_cogl_texture_download_from_gl:) Only comment out the broken - check for framebuffer alpha bits, not the check for alpha in - texture format. - -2008-05-20 Øyvind Kolås - - Decouple actor opacity from fill opacity in ClutterRectangle (fixes - race when both are set from clutter script also makes it more - consistent with the behavior of other actors.) - - * clutter/clutter-rectangle.c: (clutter_rectangle_set_color): stop - setting the opacity of the actor from the specified color. - (clutter_rectangle_paint): combine the absolute opacity of the actor - with the alpha of the color when painting. + * doc/reference/clutter/clutter-sections.txt: -2008-05-20 Ivan Leben + [docs] Add ClutterPath unused symbols - * clutter/cogl/gles/cogl-texture.c: - (cogl_texture_download_from_gl:) Implemented a workaround - for missing alpha framebuffer channel. There are still - some issues with detecting whether alpha is present in the - framebuffer. See comments in code. Test-cogl-tex-getset now - successfully retrieves a RGBA texture image data. +2008-12-19 Emmanuele Bassi -2008-05-19 Ivan Leben + * doc/reference/clutter/clutter-sections.txt: - * clutter/cogl/gles/cogl-texture.c: - (cogl_texture_download_from_gl:) Store old blending factors - and restore them when done. The lack of ability to retrieve - the alpha channel now more noticable in test-cogl-tex-getset - since the edges of the hand are not antialiased. - - * clutter/cogl/gl(es)/cogl-internal.h: Declare - cogl_blend_func to avoid "implicit implementation" compile - warning. - -2008-05-19 Ivan Leben - - * clutter/cogl/gl(es)/cogl.c: New internal function - cogl_blend_func caches blending setup much like cogl_enable - does with the enable flags. This separates blending factors - setup from the enable/disable operation in preparation of - the texture image retrieval fix for alpha channel on GLES. - (cogl_enable:) Does not modify blending factors anymore. + [docs] Fix a typo in the binding pool section - * clutter/cogl/gl(es)/cogl-context.h: CoglContext holds two - new variables to cache blending src and dst factors. +2008-12-19 Emmanuele Bassi - * clutter/cogl/gl(es)/cogl-context.c: - (cogl_create_context:) Initialize blending factors. - * clutter/cogl/gles/cogl-texture.c: - (cogl_texture_download_from_gl:) Set blending factors to - CGL_ONE, CGL_ZERO which fixes the slighlty improper behavior - where source colour was actually multiplied with its alpha - value in the result (not noticable on current tests). + Merge branch 'cairo-texture' -2008-05-19 Emmanuele Bassi +2008-12-19 Neil Roberts - * clutter/eglx/Makefile.am: Fix the INCLUDE directives to - properly include the X11 backend headers. + * clutter/clutter-cairo-texture.c: - * clutter/glx/Makefile.am: Add the libclutter-x11.la static - library to the LDADD directives. + [cairo-texture] Remove the construct only restriction on surface + size -2008-05-19 Tomas Frydrych +2008-12-19 Emmanuele Bassi - * clutter/x11/clutter-x11.h: - * clutter/glx/clutter-glx.h: - Include texture pixmap headers. + * clutter/clutter-texture.c: -2008-05-16 Neil Roberts + [texture] Do not mix fixed point and units values - * clutter/eglx/clutter-stage-egl.c (clutter_stage_egl_realize): - Fix name of parent class variable which otherwise breaks the - build. +2008-12-19 Emmanuele Bassi -2008-05-16 Neil Roberts + * tests/interactive/test-unproject.c: - Use the Mesa headers instead of depending on GLee for Win32 - builds. + [tests] Fix the actor detection - * configure.ac: No longer check for GLee +2008-12-19 Emmanuele Bassi - * clutter/cogl/gl/cogl-defines.h.in: Don't bother including GLee.h + * clutter/clutter-actor.c: - * build/mingw/mingw-cross-compile.sh: No longer downloads libGLee - but downloads the Mesa library instead and installs the headers - from that. Fixed the libpng version. + [units] Do not use fixed point and units interchangeably -2008-05-16 Tomas Frydrych +2008-12-18 Emmanuele Bassi - * clutter/glx/Makefile.am: - * clutter/x11/Makefile.am: - Install glx and x11 specific includes into clutter/glx and - clutter/x11 so that header files that include glx/*.h or x11/*.h - when installed. + * CODING_STYLE: -2008-05-16 Neil Roberts + [docs] Fix a copy-and-paste typo in the coding style - * clutter/win32/clutter-event-win32.c (message_translate): Fix - signedness of old_xpos and old_ypos to get rid of compiler - warnings. +2008-12-18 Emmanuele Bassi - * clutter/win32/clutter-backend-win32.c - (clutter_backend_win32_get_features): Cast the result of - glGetString to a signed char pointer to avoid compiler warnings. + * CODING_STYLE: + * HACKING: + * Makefile.am: -2008-05-15 Neil Roberts + [docs] Add coding style document - * clutter/win32/clutter-stage-win32.c: - * clutter/win32/clutter-backend-win32.c: Reflect changes to the - GLX/X11 backend in revisions 2708-2709 and 2713-2715 which - simplify the backend a little. +2008-12-18 Robert Bragg -2008-05-15 Emmanuele Bassi + * clutter/glx/clutter-glx-texture-pixmap.c: - * clutter/x11/clutter-backend-x11.c: - * clutter/clutter-event.h: - * clutter/clutter-feature.h: - * clutter/clutter-fixed.c: - * clutter/clutter-model.h: Fix documentation. + Improves tfp performance on Nvidia - * clutter/eglnative/clutter-backend-egl.[ch]: - * clutter/eglnative/clutter-event-egl.c: Add the same solution - used for the SDL backend in order to get the time of an event. - This should fix the motion event throttling and the click count - on button press. (#906) +2008-12-18 Neil Roberts - * tests/test-pixmap.c (create_pixmap), (main): Fix preprocessor - directives. + * tests/interactive/test-scale.c: -2008-05-14 Emmanuele Bassi + [test-scale] Add a label showing the gravity - * tests/test-threads.c: Add a "progress bar" actor and - make the test take less amount of time to complete. +2008-12-18 Neil Roberts -2008-05-14 Emmanuele Bassi + * clutter/clutter-alpha.c: - * tests/test-events.c: Clean up a bit, and print out more - messages when pressing one of the rectangles. + Fix calculation in clutter_cubic_bezier - * tests/test-threads.c: Be more verbose in the console, and - apply another behaviour on the rectangle, to show that we - are not blocking. +2008-12-17 Neil Roberts -2008-05-14 Øyvind Kolås + * clutter/clutter-interval.c: - * clutter/cogl/gles/cogl.c: (_cogl_features_init): do not set - COGL_FEATURE_TEXTURE_READ_PIXELS, since it is not available. + [clutter-interval] Fix calculation of interval for unsigned types -2008-05-14 Matthew Allum +2008-12-17 Emmanuele Bassi - * clutter/clutter-actor.c: - * clutter/clutter-main.c: - * clutter/clutter-private.h: - Rejid Øyvind's previous commit a little moving more into - clutter-main.c and using ClutterContext. - Also Refactor clutter_init & clutter_init_with_args to share - same core init code. - -2008-05-13 Øyvind Kolås - - Made it possible to do picking when the colors stored in the - framebuffer are only approximately the correct value. - - * clutter/clutter-actor.c: - (init_bits): initialize constants about how many bits are - available/will be used for r,g,b components. - (_clutter_pix_to_id): now own function, compute an id from a - pixel into its own function (used from _clutter_do_pick). - (_clutter_id_to_col): now own function, computes the color to use for - a given id. - (clutter_actor_paint): use clutter_id_to_col. - * clutter/clutter-main.c: - (_clutter_do_pick): use _clutter_pix_to_id - (clutter_main): re-enable invocation of fruity app shell. + * clutter/clutter-cairo-texture.c: -2008-05-13 Emmanuele Bassi + [cairo-texture] Silently discard 0x0 surfaces - * clutter/fruity/clutter-stage-fruity.c: - (clutter_stage_egl_show), (clutter_stage_egl_hide): Don't chain - up and set flags, as it is not needed anymore. +2008-12-17 Neil Roberts - (clutter_stage_egl_realize): Set the REALIZED flag. + * clutter/clutter-actor.c: - * clutter/eglnative/clutter-stage-egl.c: - (clutter_stage_egl_show), (clutter_stage_egl_hide): Don't chain - up and set flags, as it is not needed anymore. + Minor fix to documentation for clutter_actor_get_anchor_point -2008-05-13 Emmanuele Bassi +2008-12-17 Emmanuele Bassi - * clutter/glx/clutter-stage-glx.c: - (clutter_stage_glx_unrealize): Move the shaders release from here... + * .gitignore: + * tests/conform/Makefile.am: + * tests/conform/test-launcher.sh: + * tests/conform/wrapper.sh: - * clutter/glx/clutter-backend-glx.c: - (clutter_backend_glx_dispose): ... to here. Shaders should be - released when the GL context is being destroyed, and that only - happens when the backend is being disposed, now that we support - multiple stages. + [tests] Create a real file for each test unit -2008-05-13 Emmanuele Bassi +2008-12-16 Emmanuele Bassi - * clutter/clutter-backend.c: - (_clutter_backend_create_stage): Call _clutter_stage_set_window() - ourselves, thus removing yet another action that backends must - implement and might get wrong; also cuts a backend-agnostic piece - of code duplication. + * clutter/clutter-text.c: - * clutter/eglnative/clutter-backend-egl.c: - (clutter_backend_egl_create_stage): Update the EGL native backend. + Fix the selection behaviour around the 0th glyph - * clutter/eglx/clutter-backend-egl.c: - (clutter_backend_egl_create_stage): Update the EGLX backend. +2008-12-16 Neil Roberts - * clutter/fruity/clutter-backend-fruity.c: - (clutter_backend_egl_create_stage): Update the fruity backend + * clutter/clutter-behaviour-path.c: + * clutter/clutter-path.c: + * clutter/clutter-path.h: + * tests/conform/test-path.c: - * clutter/glx/clutter-backend-glx.c: - (clutter_backend_glx_create_stage): Update the GLX backend. + Convert clutter_path_get_position to take a gdouble instead of an + alpha value - * clutter/sdl/clutter-backend-sdl.c: - (clutter_backend_sdl_create_stage): Update the SDL backend. +2008-12-16 Emmanuele Bassi - * HACKING.backends: Update the ::create_stage() description. + * tests/conform/test-text-cache.c: -2008-05-13 Emmanuele Bassi + [tests] Make the layout cache fail at the right place - * clutter/x11/clutter-event-x11.c (event_translate): Remove the - cheap Expose event compression, as it seems to play games when a - composite manager is running. It's also not really needed, as - the redraw queue will avoid redraws too close to each other - anyway. +2008-12-16 Emmanuele Bassi - * clutter/x11/clutter-stage-x11.c: - (clutter_stage_x11_show), (clutter_stage_x11_hide): Do not chain - up just to set the flags. This fixes a critical warning coming - from ClutterActor::hide() default implementation. + * doc/reference/clutter/clutter-sections.txt: -2008-05-13 Ivan Leben + [docs] Add clutter_text_set_selection to gtk-doc - * clutter/cogl/gl/cogl-defines.h.in: - Fix GL function prototypes on OS X by #definining APIENTRY and - APIENTRYP if missing. +2008-12-16 Emmanuele Bassi -2008-05-12 Ivan Leben + * clutter/clutter-text.c: + * clutter/clutter-text.h: - * clutter/cogl/gl/cogl-defines.h.in: - Defined GL extension functions used by Cogl inside the COGL_ - namespace. + Add ClutterText::set_selection() - * clutter/cogl/gl/cogl-context.h: - * clutter/cogl/gl/cogl.c: - Use COGL_ extension function prototypes instead of relying - on glext.h to define them. Should fix the mac compilability - bug, but haven't tested it yet. +2008-12-16 Emmanuele Bassi -2008-05-12 Matthew Allum + * clutter/clutter-text.c: - * clutter/x11/clutter-x11-texture-pixmap.c: - * configure.ac: - * tests/Makefile.am: - Remove the XComposite dep from Clutter itself, just use - in test-pixmap (if available) + Fix ClutterText::get_selection() -2008-05-12 Emmanuele Bassi +2008-12-16 Emmanuele Bassi - Rework the stage wrapper/implementation relation: remove - duplicated code and all the bookkeeping from the backends into - ClutterStage whenever possible, to reduce the amount of work a - backend must do (and possibly get wrong). Thanks to Tommi - Komulainen. + * clutter/clutter-text.c: - * clutter/clutter-main.c: - (clutter_init_with_args), (clutter_init): Realize the default - stage after creation. The default stage is special, because we - use it in the initialization sequence. This removes the burden - from the backends and reduces the things a backend can get - wrong. + [docs] Add more gtk-doc annotations - * clutter/clutter-stage.c: - (clutter_stage_show): Make sure to realize the implementation if - it hasn't been realized yet. +2008-12-16 Emmanuele Bassi - (clutter_stage_realize): Set the REALIZED flag and call - clutter_stage_ensure_current() if the implementation was - successfully realized. + * clutter/clutter-text.c: - (clutter_stage_unrealized): Call clutter_stage_ensure_current() - on unrealize. + Use clutter_text_activate() - * clutter/glx/clutter-backend-glx.c: - (clutter_backend_glx_create_stage): Do not realize the stage anymore - when creating it, and let the normal realization sequence take - place. +2008-12-16 Emmanuele Bassi - (clutter_backend_glx_ensure_context): Trap for X11 errors. + * clutter/clutter-text.c: + * clutter/clutter-text.h: - * clutter/glx/clutter-stage-glx.c: - (clutter_stage_glx_realize): Chain up to the X11 implementation - so that we can set up the window state (title, cursor visibility) - when we actually have a X window. Also, do not call - clutter_stage_ensure_current(), and rely on the wrapper to do - it for us. This means we can drop setting the REALIZED flag on - the wrapper. - - (clutter_stage_glx_unrealize): Do not call - clutter_stage_ensure_current() ourselves, and rely on the wrapper - to do it for us. + Add ClutterText::activate() - * clutter/x11/clutter-stage-x11.c: - (set_wm_title), (set_cursor_visible): Move the WM title and - cursor visibility code inside their own functions. +2008-12-16 Emmanuele Bassi - (clutter_stage_x11_realize): Set the window title and whether the - cursor is visible or not after realizing the stage. + * clutter/clutter-text.c: - (clutter_stage_x11_set_cursor_visible), - (clutter_stage_x11_set_title): Call set_wm_title() and - set_cursor_visible(). + [docs] Add more gtk-doc annotations for ClutterText - (clutter_stage_x11_finalize): Free the title string. +2008-12-16 Emmanuele Bassi - * clutter/x11/clutter-stage-x11.h: Save more of the stage state, - so that we can set it even when the stage hasn't been realized - yet. + * clutter/clutter-text.c: - * clutter/eglnative/clutter-backend-egl.c: - (clutter_backend_egl_create_stage): - * clutter/eglnative/clutter-stage-egl.c: - (clutter_stage_egl_unrealize), - (clutter_stage_egl_realize): Update the eglnative backend. + [docs] Annotate properties and fix signals docs - * clutter/eglx/clutter-backend-egl.c: - (clutter_backend_egl_ensure_context), - (clutter_backend_egl_create_stage): - * clutter/eglx/clutter-stage-egl.c: - (clutter_stage_egl_unrealize), - (clutter_stage_egl_realize): Update the eglx backend. - - * clutter/sdl/clutter-backend-sdl.c: - (clutter_backend_sdl_create_stage): - * clutter/sdl/clutter-stage-sdl.c: - (clutter_stage_sdl_realize): Update the sdl backend. - - * clutter/fruity/clutter-backend-fruity.c: - (clutter_backend_fruity_create_stage): - * clutter/sdl/clutter-stage-fruity.c: - (clutter_stage_fruity_realize): Update the fruity backend. +2008-12-16 Emmanuele Bassi - * tests/test-multistage.c (on_button_press): Bail out if - clutter_stage_new() returns NULL. + * doc/reference/clutter/clutter-sections.txt: - * HACKING.backends: Update backend writing documentation. + [docs] Add :cursor-size property accessors -2008-05-12 Robert Bragg +2008-12-16 Emmanuele Bassi - * clutter/clutter-timeline.c: - Adds clutter-timeline documentation RE: r2337, explaining - the current timeline semantics. + * clutter/clutter-text.c: -2008-05-12 Emmanuele Bassi + Allow selecting with line-start and line-end bindings - * HACKING.backends: Update documentation. +2008-12-16 Emmanuele Bassi - * clutter/glx/clutter-stage-glx.c: - (clutter_stage_glx_realize): Avoid setting more flags than - necessary. + * clutter/clutter-text.c: + * clutter/clutter-text.h: -2008-05-09 Neil Roberts + Add :cursor-size property to ClutterText - * clutter/clutter-frame-source.c (clutter_frame_source_add) - (clutter_frame_source_add_full): Add gtk-doc and rename the - 'function' parameter to 'func'. +2008-12-16 Emmanuele Bassi - * clutter/clutter-frame-source.h: Rename the 'function' parameters - to 'func'. + * clutter/clutter-text.c: - * clutter/Makefile.am (source_h): Make clutter-frame-source.h a - public header. + Remove unused page up/down key bindings - * clutter/clutter-main.c (clutter_threads_add_frame_source_full): - Improve gtk-doc +2008-12-16 Emmanuele Bassi -2008-05-09 Emmanuele Bassi + * clutter/clutter-text.c: - * clutter/clutter-script-private.h: Add a flag for the - default stage. + Fix line start and line end key binding behaviour - * clutter/clutter-script.c: - (json_object_end): If the "type" member is "ClutterStage" - and we have a "is-default" member set to true then this - is the default stage. +2008-12-15 Emmanuele Bassi - (clutter_script_construct_object): Special case the default - stage instead of each ClutterStage. + * clutter/clutter-text.c: - (object_info_free): Ditto as above. + Fix up/down key navigation - * tests/test-script.json: Test the creation of a non-default - stage and the ::destroy handler to quit. +2008-12-15 Emmanuele Bassi -2008-05-09 Emmanuele Bassi + * clutter/clutter-text.c: - Bug #908 - Support transform from G_TYPE_INT to ClutterUnit + Use units in position_to_coords() - * clutter/clutter-units.c: - (clutter_value_transform_int_unit), - (clutter_unit_get_type): Add GValue transformation function from - integer values to ClutterUnit. (#908) +2008-12-15 Emmanuele Bassi - (param_unit_validate): Fix validation for ClutterParamSpecUnit; - this allows writable ClutterUnit properties. + * clutter/clutter-text.h: - * clutter/clutter-fixed.c: - (clutter_value_transform_int_fixed), - (clutter_value_transform_double_fixed), - (clutter_value_transform_float_fixed): Add GValue transformation - functions from native types (int, double, float) to ClutterFixed. + Constify the cursor geometry in ::cursor-event - (clutter_fixed_get_type): Register the new transformation functions. +2008-12-15 Neil Roberts - (param_fixed_validate): Fix validation for ClutterParamSpecUnit; - this allows writable ClutterFixed properties. + * tests/interactive/test-paint-wrapper.c: -2008-05-07 Ivan Leben + [test-paint-wrapper] Use a separate paint guard for each actor - * clutter/cogl/cogl.h.in: - * clutter/cogl/gl(es)/cogl-texture.h: - * clutter/cogl/gl(es)/cogl-texture.c: - cogl_texture_new_* functions take a gboolean auto_mipmap argument. - If TRUE automatic mipmap generation is enabled during the process - of slice texture object creation. - (cogl_texture_new_from_foreign:) now allows mipmap min filter - flags. +2008-12-15 Emmanuele Bassi - * clutter/clutter-texture.c: - * clutter/glx/clutter-glx-texture-pixmap.c: - * tests/test-cogl-offscreen.c: - * tests/test-cogl-tex-tile.c: - * tests/test-cogl-tex-convert.c: - * tests/test-cogl-tex-polygon.c: - * tests/test-cogl-tex-getset.c: - Pass FALSE for auto_mipmap to cogl_texture_new_*. + * clutter/clutter-text.h: - * clutter/pango/pangoclutter-render.c: - (tc_get:) Pass TRUE to cogl_texture_new_with_size and use mipmap - min filter for nicer glyphs at small scales. As a result test-text - has gone all beautiful now. + [docs] Add annotations for ClutterText structures -2008-05-07 Neil Roberts +2008-12-15 Emmanuele Bassi - * clutter/clutter-frame-source.h: Added the missing G_BEGIN_DECLS - and G_END_DECLS + * clutter/clutter-entry.c: + * clutter/clutter-entry.h: + * clutter/clutter-label.c: + * clutter/clutter-label.h: -2008-05-07 Emmanuele Bassi + Remove ClutterLabel and ClutterEntry - * clutter/sdl/clutter-backend-sdl.c: - (clutter_backend_sdl_dispose): Destroy the timer that we created... - (clutter_backend_sdl_init): ... here. +2008-12-15 Emmanuele Bassi - * clutter/sdl/clutter-backend-sdl.h: Add a GTimer for time-based - operations, like the event time. + * clutter/clutter-path.h: - * clutter/sdl/clutter-event-sdl.c: - (get_backend_time): Get the elapsed milliseconds for the SDL - backend. + Re-indent ClutterPath header - (_clutter_events_init): Start the timer provided by the backend... - (_clutter_events_uninit): ... and the stop it. +2008-12-15 Emmanuele Bassi - (key_event_translate), (event_translate): Use the backend time - to fill out the time field of the event structures. This fixes - the motion notification throttling on the SDL backend. + * clutter/clutter-fixed.c: -2008-05-06 Matthew Allum + Fix a typo in the ClutterParamSpecFixed declaration - * clutter/glx/clutter-glx-texture-pixmap.c: - * clutter/x11/clutter-x11-texture-pixmap.c: - More cleanups, safety additions. +2008-12-13 Emmanuele Bassi -2008-05-05 Øyvind Kolås + * clutter/clutter-behaviour-ellipse.c: - * clutter/cogl/gl/cogl-primitives.c: - * clutter/cogl/gles/cogl-primitives.c: - * clutter/cogl/common/cogl-primitives.c: moved declaration of - gegl_rectangle and gegl_rectanglex here to satisfy linking - requirements when building the fruity backend. - -2008-05-05 Øyvind Kolås - - * clutter/cogl/cogl.h.in: api review touch ups. - * clutter/cogl/common/cogl-primitives.c: api review touch ups. - * clutter/cogl/gl/cogl-primitives.c: (cogl_path_fill), - (cogl_path_stroke): indentation. - * clutter/cogl/gles/cogl-primitives.c: - (_cogl_path_fill_nodes): free allocated resources. + Remove a double semi-colon typo + +2008-12-12 Neil Roberts - * tests/test-cogl-primitives.c: updated to new API, added rotation to - test to show that cogl renders paths correct under perspective - distortion. + * clutter/clutter-actor.c: -2008-05-02 Emmanuele Bassi + Fix the gtk-doc for some properties in ClutterActor - Bug #900 - clutter_actor_lower() and friends do not queue redraw +2008-12-12 Neil Roberts * clutter/clutter-actor.c: - (clutter_actor_raise), - (clutter_actor_lower): Queue a redraw after raising and lowering - and actor in the paint order stack. (#900) -2008-05-01 Richard Purdie + Fix the definition of clutter_actor_set_scale to match the + declaration - * configure.ac: - Set CLUTTER_COGL for fruity. +2008-12-05 Neil Roberts -2008-05-01 Emmanuele Bassi + * tests/conform/test-path.c: - Build fixes for the SDL flavour. + Add a test case for the new cairo path functions - * clutter/sdl/clutter-backend-sdl.c: Remove an unused function. +2008-12-05 Neil Roberts - * clutter/sdl/clutter-event-sdl.c: - (clutter_event_dispatch): Properly cast the stage pointer. + * clutter/clutter-path.c: + * clutter/clutter-path.h: + * doc/reference/clutter/clutter-sections.txt: - * clutter/sdl/clutter-stage-sdl.c: - (clutter_stage_window_iface_init): Remove the draw_to_pixbuf() - stub and assignment. + Add clutter_path_to_cairo_path and clutter_path_add_cairo_path -2008-05-01 Richard Purdie +2008-12-12 Emmanuele Bassi - * configure.ac: - Fix up fruity flavour configure option. + * clutter/clutter-cairo-texture.c: -2008-05-01 Øyvind Kolås + Warn instead of returning in the IN_PAINT check - * clutter/cogl/gles/cogl-primitives.c: (_cogl_path_fill_nodes): draw - the rasterized scanlines as an array of triangles. +2008-12-11 Emmanuele Bassi -2008-05-01 Emmanuele Bassi + * clutter/clutter-cairo-texture.c: - * clutter/clutter-behaviour.c: - (clutter_behaviour_remove_all): Disconnect the ::destroy - handler when removing all actors, to match the behaviour - of clutter_behaviour_remove(). + Small documentation fixes -2008-05-01 Matthew Allum +2008-12-11 Emmanuele Bassi - * clutter/glx/clutter-glx-texture-pixmap.c: - * tests/test-pixmap.c: - Fix up texture-pixmap, now works. - Thanks to Neil for spotting we were actually using - wrong texture type in fbconfig (COGL change). + * clutter/clutter-cairo-texture.c: -2008-04-30 Øyvind Kolås + Print a warning when creating a cairo_t while painting - * clutter/cogl/gles/cogl-primitives.c: (_cogl_path_fill_nodes): - keep track of direction we are drawing in and make sure we leave - two intersection points when we have changed direction. +2008-12-11 Emmanuele Bassi -2008-04-30 Øyvind Kolås + * clutter/clutter-stage.c: - * clutter/cogl/gles/cogl-primitives.c: (_cogl_path_fill_nodes): - scanline rasterizer fallback for GLES without working stencil - buffer (would benefit from optimization/smarter choice of - datastructures). + Do not set the IN_PAINT flag inside the Stage paint -2008-04-30 Emmanuele Bassi +2008-12-11 Emmanuele Bassi - * clutter/clutter-effect.c: - (clutter_effect_closure_destroy): Do not remove the actor - from the behaviour; the behaviour is an internal detail of the - effect, and it will remove the actors anyway when finalized - when g_object_unref() is called. This should guard against - actors being destroyed while an effect is running. + * clutter/clutter-actor.c: -2008-04-30 Øyvind Kolås + Set the IN_PAINT private flag - * clutter/cogl/common/Makefile.am: - * clutter/cogl/common/cogl-primitives.c: - * clutter/cogl/common/cogl-primitives.h: - * clutter/cogl/gl/Makefile.am: - * clutter/cogl/gl/cogl-primitives.c: - * clutter/cogl/gl/cogl-primitives.h: - * clutter/cogl/gles/Makefile.am: - * clutter/cogl/gles/cogl-primitives.c: - * clutter/cogl/gles/cogl-primitives.h: moved duplicated code to the - common directory. +2008-12-11 Emmanuele Bassi -2008-04-30 Robert Bragg + * doc/reference/clutter/clutter-docs.xml: + * doc/reference/clutter/clutter-sections.txt: + * doc/reference/clutter/clutter.types: - * clutter/clutter/x11/clutter-x11-texture-pixmap.c: - In _update_area_real with depth=16 we weren't setting up the alpha - channel. + [docs] Add ClutterCairoTexture to the API reference -2008-04-29 Matthew Allum +2008-12-11 Emmanuele Bassi - * clutter/glx/Makefile.am: - * clutter/x11/Makefile.am: - Revert header install locations (Mistake in previous commit, - fixes #898) + * clutter/Makefile.am: + * clutter/clutter-cairo-texture.c: + * clutter/clutter-cairo-texture.h: + * clutter/clutter.h: -2008-04-29 Neil Roberts + Add ClutterCairoTexture - * clutter/clutter-actor.c (clutter_actor_move_anchor_point): The - actor position was being moved in the wrong direction. Perhaps - this was a cut-and-paste bug from move_anchor_point_from_gravity - because in that function ax and ay represent the old anchor - position, but in this function they represent the new. +2008-12-11 Emmanuele Bassi -2008-04-29 Matthew Allum + * configure.ac: - * clutter/glx/Makefile.am: - * clutter/glx/clutter-glx-texture-pixmap.c: - * clutter/glx/clutter-glx-texture-pixmap.h: - * clutter/x11/Makefile.am: - * clutter/x11/clutter-x11-texture-pixmap.c: - * tests/test-pixmap.c: - Commit newer x11 texture pixmap stuff (optionally using SHM). - Also seemingly still broken overhauled glx-texture-pixmap - (code by Robert and myself) + Require Cairo as a Clutter dependency - * configure.ac: - Minor formatting change. +2008-12-11 Emmanuele Bassi -2008-04-29 Neil Roberts + * doc/reference/clutter/Makefile.am: + * doc/reference/clutter/clutter-docs.xml: + * doc/reference/clutter/clutter-sections.txt: + * doc/reference/clutter/clutter.types: - Removed COGLhandle and changed shader and program functions to be - wrapped in reference-counted CoglHandles instead. + [docs] Update the API reference - * clutter/cogl/gl/cogl-shader.c: - * clutter/cogl/gl/cogl-shader.h: - * clutter/cogl/gl/cogl-program.c: - * clutter/cogl/gl/cogl-program.h: - New files to hold the shader and program functions. +2008-12-11 Emmanuele Bassi - * clutter/cogl/gl/cogl.c: Removed shader and program functions. + * clutter/clutter-text.c: + * clutter/clutter-text.h: - * clutter/cogl/common/cogl-handle.h: New header to define - COGL_HANDLE_DEFINE which helps build functions to create - reference-counted handles. This reduces the amount of duplicated - code. + Fix documentation issues - * clutter/cogl/gl/cogl-texture.c: - * clutter/cogl/gles/cogl-texture.c: - * clutter/cogl/gl/cogl-fbo.c: Converted to use COGL_HANDLE_DEFINE - from cogl-handle.h to avoid duplicating some of the common code. +2008-12-11 Emmanuele Bassi - * clutter/cogl/gles/cogl-defines.h.in: - * clutter/cogl/gl/cogl-defines.h.in: Removed COGLhandle + * clutter/clutter-text.c: - * clutter/cogl/gl/cogl-context.h: Added handle arrays for programs - and shaders. + Lazily create the PangoContext on Text::init - * clutter/cogl/gl/cogl-context.c (cogl_create_context): Added - initialisers for shader_handles and program_handles. - (cogl_destroy_context): Added calls to g_array_free for all handle - arrays. +2008-12-11 Emmanuele Bassi - * clutter/cogl/gl/Makefile.am (libclutter_cogl_la_SOURCES): Added - cogl-{program,shader}.{c,h} + * clutter/Makefile.am: + * clutter/clutter.h: - * clutter/cogl/common/Makefile.am - (libclutter_cogl_common_la_SOURCES): Added cogl-handle.h + Remove ClutterEntry and ClutterLabel from the build - * clutter/cogl/gles/cogl.c: - * clutter/cogl/cogl.h.in: Programs and shaders are now wrapped in - CoglHandles instead of COGLhandles. cogl_program_destroy and - cogl_shader_destroy is now replaced with cogl_program_unref and - cogl_shader_unref. cogl_program_ref and cogl_shader_ref are also - added. +2008-12-11 Emmanuele Bassi - * clutter/clutter-shader.c: Converted to use CoglHandles for the - programs and shaders instead of COGLhandles. + * tests/micro-bench/test-text.c: -2008-04-29 Øyvind Kolås + Update the micro-bench tests to ClutterText - * clutter/cogl/cogl.h.in: renaming of API's in cogl to make the - primitives and path API a bit smaller and more resembling cairo. - * clutter/cogl/gl/cogl-primitives.c: - * clutter/cogl/gles/cogl-primitives.c: - * clutter/cogl/gles/cogl.c: +2008-12-11 Emmanuele Bassi - * clutter/clutter-actor.c: - * clutter/clutter-rectangle.c: - * tests/test-cogl-offscreen.c: - * tests/test-cogl-primitives.c: - * tests/test-cogl-tex-convert.c: - * tests/test-cogl-tex-foreign.c: - * tests/test-cogl-tex-getset.c: - * tests/test-cogl-tex-tile.c: updated according to changes in cogl. + * tests/interactive/test-clip.c: + * tests/interactive/test-cogl-tex-polygon.c: + * tests/interactive/test-depth.c: + * tests/interactive/test-easing.c: + * tests/interactive/test-fbo.c: + * tests/interactive/test-layout.c: + * tests/interactive/test-multistage.c: + * tests/interactive/test-project.c: + * tests/interactive/test-random-text.c: + * tests/interactive/test-rotate.c: + * tests/interactive/test-shader.c: + * tests/interactive/test-stage-read-pixels.c: + * tests/interactive/test-unproject.c: -2008-04-29 Robert Bragg + Update the interactive tests to ClutterText - * clutter/x11/clutter-x11-texture-pixmap.c: - In clutter_x11_texture_pixmap_set_pixmap, dont assume that the actor - size should be changed to match the size of the pixmap. +2008-12-11 Emmanuele Bassi -2008-04-29 Robert Bragg + * tests/interactive/Makefile.am: - * clutter/cogl/gles/cogl-texture.c: - Replaces an malloc call with g_malloc. + Do not compile the opacity and entry interactive tests -2008-04-29 Robert Bragg +2008-12-11 Emmanuele Bassi - * clutter/configure.ac: - When looking for a GLES 1 library, also try the name "GLESv1_CM". + * .gitignore: - This also reduces the xfixes version requirement to v3, since we dont - need support for Show/HideCursor. + Update ignore file -2008-04-28 Neil Roberts +2008-12-11 Emmanuele Bassi - Fixed 'make dist' + * tests/conform/test-paint-opacity.c: - * clutter/cogl/Makefile.am (EXTRA_DIST): Distribute cogl.h.in - instead of cogl.h - (DIST_SUBDIRS): Added common folder + Update the paint opacity unit test - * clutter/cogl/gl/Makefile.am (libclutter_cogl_la_SOURCES): Remove - cogl-defines.h and use the right location for cogl-defines.gl.h - (EXTRA_DIST): Distribute cogl-defines.h.in +2008-12-11 Emmanuele Bassi - * clutter/cogl/gles/Makefile.am (libclutter_cogl_la_SOURCES): - Remove cogl-defines.h and use the right location for - cogl-defines.gles.h - (EXTRA_DIST): Distribute cogl-defines.h.in + * clutter/clutter-text.c: - * clutter/Makefile.am (DIST_SUBDIRS): Add fruity + Allow only synthetic events with keyval 0 -2008-04-28 Neil Roberts +2008-12-11 Emmanuele Bassi - * clutter/cogl/cogl.h.in (COGL_A_BIT): Added the missing comma - after COGL_PIXEL_FORMAT_G_8 + * clutter/clutter-text.c: -2008-04-28 Emmanuele Bassi + Do not use contractions when not needed - * autogen.sh: Do not just touch the gtk-doc.make file, if we - could not find gtkdocize, but echo an empty EXTRA_DIST into it - so that the automake won't complain later on. +2008-12-11 Emmanuele Bassi -2008-04-28 Øyvind Kolås + * clutter/clutter-text.c: - * clutter/cogl/cogl.h.in: reindented. + Use the paint opacity when painting a ClutterText -2008-04-28 Emmanuele Bassi +2008-12-11 Emmanuele Bassi - * clutter/clutter-actor.c: - (parse_rotation_array), - (clutter_actor_set_custom_property): Use the internal, unit based - rotation setter when parsing the rotation from a ClutterScript - file. + * clutter/clutter-text.c: - (clutter_geometry_copy), - (clutter_vertex_copy), - (clutter_actor_box_copy): Use the more efficient g_slice_dup(). + Add documentation annotations - (clutter_actor_get_stage): Add documentation. +2008-12-11 Emmanuele Bassi - * clutter/clutter-group.c: Documentation fix. + * clutter/clutter-text.c: -2008-04-28 Øyvind Kolås + Code style fixes - * clutter/cogl/cogl.h.in: moved the documentation of the cogl - primitives to the main public header. - * clutter/cogl/gl/cogl-primitives.c: from here .. - * clutter/cogl/gles/cogl-primitives.c: .. _and_ here. +2008-12-11 Emmanuele Bassi -2008-04-28 Øyvind Kolås + * clutter/clutter-text.c: - * clutter/cogl/cogl.h.in: added documentation. + Remove unused types -2008-04-28 Emmanuele Bassi +2008-12-11 Emmanuele Bassi - * clutter/clutter-units.c (param_unit_init): Use the right - macros to set the default minimum and maximum values. + * tests/conform/Makefile.am: + * tests/conform/test-clutter-entry.c: + * tests/conform/test-conform-main.c: + * tests/conform/test-label-cache.c: + * tests/conform/test-text-cache.c: - * clutter/clutter-fixed.c (param_fixed_init): Ditto as above. + Remove units for Entry and Label -2008-04-28 Matthew Allum +2008-12-11 Emmanuele Bassi - * autogen.sh: - Dont display 'make' if configure fails. - * configure.ac: - Add new --with-gles version option for eventual GLES2 support - Also minor tidyups. + * clutter/clutter-text.c: -2008-04-28 Neil Roberts + Truncate selections on text insertion - * tests/test-cogl-tex-polygon.c: Added buttons to toggle whether - slicing and linear filtering is enabled. By default slicing is - disabled to help test on GL ES. +2008-12-11 Emmanuele Bassi -2008-04-28 Neil Roberts + * clutter/clutter-text.c: - * tests/Makefile.am (INCLUDES): Added $(top_srcdir)/clutter to the - include path. Otherwise the tests will fail to build trying to - include "json/json-types.h" when building out-of-tree. + Change the binding propagation when truncating a selection -2008-04-28 Emmanuele Bassi +2008-12-11 Emmanuele Bassi - * clutter/eglnative/clutter-backend-egl.c: - (clutter_backend_egl_redraw): Whitespace fixes. + * tests/interactive/test-text.c: - * clutter/eglnative/clutter-stage-egl.c: - (clutter_stage_egl_hide): Indentation fixes. + Comment out the mapping API - (clutter_stage_egl_realize): Use g_critical() to report failure, - unset the flags and bail out instead of continuing the realization - of the stage. +2008-12-11 Emmanuele Bassi -2008-04-25 Neil Roberts + * clutter/clutter-text.c: + * clutter/clutter-text.h: - Merged in the clutter-ivan branch which contained the new public - COGL API. + Use ClutterBindPool inside ClutterText -2008-04-25 Emmanuele Bassi +2008-12-11 Emmanuele Bassi - * clutter/sdl/clutter-stage-sdl.[ch]: Port the SDL stage to - the new stage implementation API. + * clutter/clutter-text.c: + * tests/conform/test-clutter-text.c: + * tests/conform/test-conform-main.c: - * clutter/sdl/clutter-backend-sdl.[ch]: Port the SDL backend - to the new backend API. + Add Text::get_chars() implementation and tests - * clutter/sdl/clutter-event-sdl.c: - (clutter_event_dispatch): Assign the default stage as the - origin of the event. +2008-12-11 Emmanuele Bassi -2008-04-24 Emmanuele Bassi + * clutter/clutter-text.c: - * configure.ac: Add the --with-json configure switch to - allow building Clutter with the external dependency on - the system JSON-GLib; the default is to use the internal - copy unless explicitly asked to check. + Do not namespace internal data structures -2008-04-24 Emmanuele Bassi +2008-12-11 Emmanuele Bassi - * Makefile.am: Add HACKING.backends to the EXTRA_DIST. + * tests/conform/test-clutter-text.c: -2008-04-24 Emmanuele Bassi + Add comments in the test suite - * HACKING.backends: Add documentation on how to write a - backend for Clutter. +2008-12-11 Emmanuele Bassi -2008-04-24 Emmanuele Bassi + * clutter/clutter-text.c: - * clutter/eglnative/clutter-backend-egl.c: - (clutter_backend_egl_create_stage): Fix checks using a - non assigned member of the ClutterBackendEGL structure. + Move internal data structures on top -2008-04-23 Emmanuele Bassi +2008-12-11 Emmanuele Bassi - * clutter/eglnative/clutter-backend-egl.[ch]: - * clutter/eglnative/clutter-stage-egl.[ch]: - * clutter/eglnative/clutter-event-egl.c: Port to the new stage - and backend APIs. *WARNING* untested and not compiled. + * clutter/clutter-text.c: - * clutter/eglx/clutter-backend-egl.c: - (clutter_backend_egl_init): Set some defaults. + Coding style consistency -2008-04-23 Emmanuele Bassi +2008-12-11 Emmanuele Bassi - * tests/test-script.json: Remove the explicit "visible" - member to test that the visibility of actors is TRUE - by default. + * clutter/clutter-text.c: -2008-04-23 Emmanuele Bassi + Implement Text:max-length - * configure.ac: - * clutter/Makefile.am: Do not build the internal JSON-GLib - copy if there is a system installed one. +2008-12-11 Emmanuele Bassi - * clutter/clutter-json.h: Remove. + * tests/conform/test-clutter-text.c: - * clutter/clutter-json.h.in: Template for the clutter-json.h - header file, used to opaquely include the JSON-GLib types. + Update the ClutterText test unit -2008-04-23 Emmanuele Bassi +2008-12-11 Emmanuele Bassi - * clutter/clutter-actor.c: Document :show-on-set-parent and - the fact that calling clutter_actor_show() and hide() on an - unparented actor will change that property as well as a side - effect. + * clutter/clutter-text.c: -2008-04-23 Emmanuele Bassi + Use the stored contents length in ::delete_chars() - * clutter/clutter-actor.c (clutter_actor_set_property): Use the - internal setter for the rotation center. +2008-12-11 Emmanuele Bassi -2008-04-23 Emmanuele Bassi + * clutter/clutter-text.c: - * clutter/clutter-actor.[ch]: Add units based variant of the - rotation accessors. + Improve the safety checks inside the text setters -2008-04-23 Emmanuele Bassi +2008-12-11 Emmanuele Bassi - Bug 892 - Incorrect results using rotation-[center|angle] properties + * clutter/clutter-text.c: - * clutter/clutter-actor.c: - (clutter_actor_set_rotation_internal): Inline function for setting - the rotation using fixed point for the angle and units for the - center of rotation. + Add :cursor-color-set property declaration - (clutter_actor_set_property), - (clutter_actor_set_rotationx): Use the internal setter to avoid - loss of precision and too many conversions to and from units. +2008-12-11 Emmanuele Bassi -2008-04-23 Emmanuele Bassi + * clutter/clutter-text.c: - Bug 891 - assertion failed when test-behave exits + General whitespace fixes in ClutterText - * clutter/clutter-behaviour.c: - (remove_actor_on_destroy), - (clutter_behaviour_apply), - (clutter_behaviour_remove): Remove the actor if it gets - destroyed before the behaviour. +2008-12-11 Emmanuele Bassi -2008-04-18 Emmanuele Bassi + * clutter/clutter-text.c: - Bug #884 - Add clutter_alpha_set_closure + Replace offset_to_bytes() implementation - * clutter/clutter-alpha.[ch]: Add clutter_alpha_set_closure(), - a GClosure variant of clutter_alpha_set_func(), and reimplement - the latter as a special case of the former. (#884, Xan López) +2008-12-11 Emmanuele Bassi -2008-04-18 Neil Roberts + * tests/conform/Makefile.am: + * tests/conform/test-clutter-entry.c: + * tests/conform/test-clutter-text.c: + * tests/conform/test-conform-main.c: - * clutter/clutter-timeline.c (clutter_timeline_get_progressx): - Changed to use clutter_qdiv instead of CLUTTER_FIXED_DIV otherwise - it can't cope with timelines with more than 255 frames. + Add a separate test unit for ClutterText -2008-04-17 Emmanuele Bassi +2008-12-11 Emmanuele Bassi - * clutter/clutter-frame-source.c: Small coding style fixes. + * clutter/clutter-text.c: -2008-04-17 Neil Roberts + Add text editing methods - Applied patch from bug #881 +2008-12-11 Emmanuele Bassi - * clutter/clutter-frame-source.h: - * clutter/clutter-frame-source.c: - New files that contain a replacement for g_timeout that try to - cope with system delays. + * clutter/clutter-text.c: + * clutter/clutter-text.h: - * clutter/Makefile.am: Added clutter-frame-source.{c,h} + Add missing basic constructor - * clutter/clutter-timeline.c (timeout_add): Use a frame source - instead of a g_timeout. +2008-12-11 Emmanuele Bassi - * clutter/clutter-main.c (clutter_threads_add_frame_source_full) - (clutter_threads_add_frame_source): New public functions to wrap a - frame source and grab the Clutter mutex. + * clutter/clutter-text.c: - * clutter/clutter-timeout-pool.c: Now calculates the timeout - expiration times in the same way as a frame source does so that it - counts time in frame intervals instead of setting the next - expiration time as an offset from the current time. + Initialize the cursor position -2008-04-17 Emmanuele Bassi +2008-12-11 Emmanuele Bassi - * clutter/clutter-fixed.c: - (clutter_value_transform_fixed_int), - (clutter_value_transform_fixed_double), - (clutter_value_transform_fixed_float), - (clutter_fixed_get_type): Add GValue transformation functions - for ClutterFixed; copying a CLUTTER_TYPE_FIXED GValue into - a G_TYPE_FLOAT/G_TYPE_DOUBLE one will automatically transform - the fixed point representation into a floating point one. Also - add the G_TYPE_INT transformation function to do a plain - fixed->int copy. + * clutter/clutter-text.c: + * clutter/clutter-text.h: - * clutter/clutter-units.c: - (clutter_value_transform_unit_int), - (clutter_unit_get_type): Add a unit->int transformation function. + Add text-visibility accessors for ClutterText -2008-04-17 Emmanuele Bassi +2008-12-11 Emmanuele Bassi - * clutter/clutter-fixed.c (clutter_value_get_fixed): Fix typo - in the function name. + * tests/interactive/test-threads.c: -2008-04-17 Emmanuele Bassi + Move test-threads to ClutterText - * clutter/clutter-units.c (clutter_value_get_unit): Fix typo - in the function name. +2008-12-11 Emmanuele Bassi -2008-04-17 Emmanuele Bassi + * clutter/clutter-text.c: - * HACKING: Amend coding style and tenets, as it is now possible - to install and use unit based properties in a safe way. + Correctly initialize the initial state of ClutterText -2008-04-17 Emmanuele Bassi +2008-12-11 Emmanuele Bassi - * clutter/clutter-units.h: - * clutter/clutter-fixed.h: Add boundaries for fixed point - and units values. + * clutter/clutter-text.c: - * doc/reference/clutter-sections.txt: Update the documentation. + Merge the ClutterLabel properties into ClutterText -2008-04-17 Emmanuele Bassi +2008-12-11 Emmanuele Bassi - * autogen.sh: Try to continue even if we don't have gtk-doc - installed; this will obviously won't work if you don't pass - --disable-docs --disable-gtk-doc to autogen.sh as well. + * clutter/clutter-text.h: -2008-04-17 Emmanuele Bassi + Add Text::get_chars() method declaration - * clutter/clutter-fixed.[ch]: Add a ClutterFixed fundamental - type, and wrappers for storing it into GValues; also add a - GParamSpec subclass for defining parameters holding - ClutterFixed values. This allows creating GObject properties - using fixed point values. +2008-12-11 Emmanuele Bassi - * doc/reference/clutter-sections.txt: Document the newly - added API. + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: -2008-04-17 Emmanuele Bassi + Add Actor::grab_key_focus() method - * clutter/Makefile.am: Add clutter-units.c +2008-12-11 Emmanuele Bassi - * clutter/clutter-units.[ch]: Add a ClutterUnit fundamental - type, and wrappers for storing it into GValues; also add a - GParamSpec subclass for defining parameters holding ClutterUnit - values. This allows creating GObject properties using units. + * clutter/clutter-text.h: - * doc/reference/clutter-sections.txt: Document the newly - added API. + Merge Label and Entry API into ClutterText -2008-04-15 Matthew Allum +2008-12-11 Emmanuele Bassi - Work related to #873; + * clutter/clutter-text.c: + * clutter/clutter-text.h: - * clutter/glx/clutter-backend-glx.c: - * clutter/glx/clutter-backend-glx.h: - * clutter/x11/clutter-x11-texture-pixmap.c: - * clutter/x11/clutter-x11-texture-pixmap.h: - General cleanup of texture pixmap code, adding; - - Pixmap dimentions and depth now auto probed, read only props. - - More X safety traps - - Add support for optionally tracking damage and automatically - updating texture. + Expose the Text accessors as public API - * clutter/glx/clutter-glx-texture-pixmap.c: - * clutter/glx/clutter-glx-texture-pixmap.h: - General cleanup and some safety additions. Needs more work so - 'proper' subclass - dependent on new COGL. +2008-12-11 Emmanuele Bassi - * clutter/x11/clutter-backend-x11.c: (clutter_x11_remove_filter): - Invert g_return_if check. + * tests/interactive/test-text.c: - * configure.ac: - Pull in XComposite and XDamage (at least for now) + Update the ClutterText interactive test - * tests/Makefile.am: - * tests/test-pixmap.c: - Add a modified test from Johan for above. +2008-12-11 Emmanuele Bassi -2008-04-15 Neil Roberts + * clutter/clutter-text.c: - Added support for foreign windows to the Win32 backend. + Coalesce ClutterLabel API usage - * clutter/win32/clutter-stage-win32.c - (clutter_stage_win32_request_coords): Don't resize foreign - windows. - (clutter_stage_win32_unrealize): Don't destroy foreign windows. - (clutter_stage_win32_init): Added initialiser for is_foreign_win. - (clutter_win32_get_stage_from_window): Resort to looking in the - stage list if the window isn't the right window class so that it - can still find stages with foreign windows. - (clutter_win32_set_stage_foreign): New public function to set a - foreign window for a stage. +2008-12-11 Emmanuele Bassi - * clutter/win32/clutter-event-win32.c - (clutter_win32_disable_event_retrieval): New public function to - disable event retrieval. - (message_translate): Don't handle WM_SIZE or WM_MOVE for foreign - windows. + * clutter/clutter-text.c: - * clutter/win32/clutter-backend-win32.h (struct - _ClutterBackendWin32): Added a flag to disable event retrieval + Group all the integer private fields - * clutter/win32/clutter-backend-win32.c - (clutter_backend_win32_ensure_context): Update debug note to - include whether the stage is foreign or not. +2008-12-11 Emmanuele Bassi -2008-04-15 Øyvind Kolås + * clutter/clutter-text.c: - * clutter/clutter-actor.c: (clutter_actor_set_shader_param): queue a - redraw when a shader_param is set. Normalized some gtk-doc syntax in - some of the api documentation. + Use internal headers -2008-04-15 Øyvind Kolås +2008-12-11 Emmanuele Bassi - * clutter/clutter-group.c: fixed typo in docs. + * clutter/Makefile.am: + * clutter/clutter-text.c: + * clutter/clutter-text.h: + * clutter/clutter.h: + * tests/interactive/Makefile.am: + * tests/interactive/test-text.c: -2008-04-14 Matthew Allum + Initial import of the Text actor from Tidy - * clutter/eglx/clutter-stage-egl.c: - Actually set wm protocols on eglx stage windows. Fixes issues with - cloising stages and cleanup. +2008-12-11 Emmanuele Bassi -2008-04-14 Matthew Allum + * clutter/clutter.h: - * clutter/cogl/gles/cogl.c: (cogl_color): - Disable use of color4ub, issues with latest MBX SDL (#857) + Resort the main Clutter include file - * clutter/eglx/clutter-backend-egl.c: - * clutter/eglx/clutter-stage-egl.c: - * configure.ac: - Fixup for the eglx backend to work with new backend/multistage code. - Some issues remain in destroying stages. - -2008-04-14 Neil Roberts +2008-12-10 Emmanuele Bassi - Bug #853 + * .gitignore: - * clutter/clutter-timeline.c (clutter_timeline_get_progressx): Fix - arithmetic for calculating the reverse progress when the timeline - is backward. (Should subtract from one instead of taking the - reciprocal). - -2008-04-13 Neil Roberts - - Upgraded the Win32 backend to work with the multi-stage - subclassing code. - - * clutter/win32/clutter-stage-win32.h: - * clutter/win32/clutter-stage-win32.c: Now inherits from - ClutterGroup and implements ClutterStageWindow instead of - inheriting directly from ClutterStage. - - * clutter/win32/clutter-event-win32.c (message_translate): Now - takes an extra parameter to return whether DefWindowProc should be - called. This is needed to prevent the default WM_CLOSE handler - from destroying the window. - - * clutter/win32/clutter-backend-win32.c - (clutter_backend_win32_dispose): Destroy all of the stages using - g_slist_foreach as per bug #871. Now also destroys the GL context. - (clutter_backend_win32_get_features): Added assertions to ensure - there is a valid GL context. - (clutter_backend_win32_ensure_context): Accepts NULL stage. Gets - implementation pointer from the stage. + Update ignore file -2008-04-11 Emmanuele Bassi +2008-12-10 Emmanuele Bassi - * clutter/clutter-container.c: - (clutter_container_get_type): Relax the precondition on the - implementations of ClutterContainer from ClutterActor to - GObject. + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: -2008-04-11 Emmanuele Bassi + Do not modify parameters in place - * README: Add a note about the Shader API changes. +2008-12-10 Neil Roberts - * clutter/clutter-deprecated.h: Add deprecation symbols. - * clutter/clutter-shader.[ch]: Rename the :bound read-only - property to :compiled. Also rename clutter_shader_bind() - and clutter_shader_is_bound() to clutter_shader_compil() and - clutter_shader_is_compiled(), respectively. + Merge commit 'git-svn' into multiple-texture-rectangle - * clutter/glx/clutter-stage-glx.c: - (clutter_stage_glx_unrealize): Update after - clutter_shader_release_all() rename. +2008-12-10 Neil Roberts - * tests/test-shader.c (button_release_cb), (main): Update. + * ChangeLog: + * clutter/cogl/common/cogl-mesh.c: + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gl/cogl-defines.h.in: + * clutter/cogl/gl/cogl.c: -2008-04-10 Emmanuele Bassi + * clutter/cogl/gl/cogl.c: - * clutter/eglx/clutter-backend-egl.c: - (clutter_backend_egl_ensure_context): Sync up with the GLX - backend. +2008-12-10 Neil Roberts - (clutter_backend_egl_create_stage): Dumb compilation fix. + * ChangeLog: + * clutter/clutter-behaviour-ellipse.c: - * clutter/glx/clutter-backend-glx.c: - (clutter_backend_glx_create_stage): Unref the stage if we are - erroring out. + Bug 1323 - ClutterBehaviorDepth conflicts with other behaviors -2008-04-10 Emmanuele Bassi +2008-12-09 Neil Roberts - * clutter/eglx/clutter-stage-egl.c: - (clutter_stage_egl_realize): Sync up with the GLX backend. + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gles/cogl-texture.c: -2008-04-09 Emmanuele Bassi + Use a single index array - * clutter/Makefile.am: Update the regular expression to match - all the namespaces we actually use. Thanks to Neil Roberts for - spotting this. A make distclean is needed. +2008-12-09 Neil Roberts - * clutter/cogl/gl/Makefile.am: - * clutter/cogl/gles/Makefile.am: - * clutter/json/Makefile.am: - * clutter/pango/Makefile.am: Revert previous commit. -2008-04-09 Emmanuele Bassi + Merge commit 'git-svn' into multiple-texture-rectangle - * clutter/cogl/Makefile.am: - * clutter/cogl/gl/Makefile.am: - * clutter/cogl/gles/Makefile.am: - * clutter/json/Makefile.am: - * clutter/pango/Makefile.am: Fix the visibility of all the - symbols, for the main library and the statically linked ones. +2008-12-09 Neil Roberts -2008-04-09 Emmanuele Bassi + * clutter/cogl/gles/cogl-context.c: + * clutter/cogl/gles/cogl-context.h: + * clutter/cogl/gles/cogl-texture.c: - * autogen.sh: Clean up a bit + Support cogl_texture_multiple_rectangles in GL ES backend - * clutter/clutter-fixed.[ch]: - (clutter_double_to_fixed), - (clutter_double_to_int), - (clutter_double_to_uint): Make these functions public, as they - are expanded by their respective macros. This fixes the errors - from the linker trying to resolve their name. +2008-12-09 Neil Roberts -2008-04-09 Neil Roberts + * clutter/cogl/gl/cogl-texture.c: - Applied patch from bug #871 + Minor fix to indentation in gl/cogl-texture.c - * clutter/x11/clutter-backend-x11.c (clutter_backend_x11_dispose): - Call g_slist_foreach instead of iterating over the stage_manager - list manually when deleting stages. Otherwise the 'next' pointer - of the list node can get corrupted when the actor removes itself - from the list. +2008-12-09 Neil Roberts - * clutter/clutter-stage.c (clutter_stage_dispose): Call - clutter_actor_unrealize in the dispose handler. This fixes - problems where the dispose handler for the ClutterStageWrapper - can't deselect the GL context until the stage is unrealized. + * clutter/cogl/cogl-texture.h: + * doc/reference/cogl/cogl-sections.txt: -2008-04-04 Emmanuele Bassi + Add gtk-doc for cogl_texture_multiple_rectangles - * clutter/clutter-backend.c: Add more debug messages +2008-12-09 Neil Roberts - * clutter/clutter-stage.h: - * clutter/clutter-stage.c: - (clutter_stage_is_default): Add a function to check if the - stage is the default one. + * clutter/cogl/gl/cogl-context.c: + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gl/cogl-texture.c: - * clutter/glx/clutter-backend-glx.c: - * clutter/glx/clutter-stage-glx.c: - * clutter/x11/clutter-stage-x11.c: Keep the stage wrapper - and implementation flags in sync, to ensure that the GL - context is always set. + Use glDrawRangeElements to share vertices -2008-04-04 Neil Roberts +2008-12-08 Emmanuele Bassi - * README: Fixed typo + * ChangeLog: + * clutter/clutter-binding-pool.h: -2008-04-04 Matthew Allum + 2008-12-08 Emmanuele Bassi - * README: - Add a note on new show-on-set-parent prop and stage subclassing. +2008-12-08 Emmanuele Bassi -2008-04-04 Emmanuele Bassi + * doc/reference/ChangeLog: + * doc/reference/clutter/clutter-docs.xml: + * doc/reference/clutter/clutter-sections.txt: - Bug #864 - Allow instantiating and subclassing of ClutterStage + 2008-12-08 Emmanuele Bassi - * clutter/Makefile.am: Add clutter-stage-window.[ch] +2008-12-08 Emmanuele Bassi - * clutter/clutter-stage-manager.c: - (_clutter_stage_manager_remove_stage): Do not warn if removing - a stage we don't manage, as we might be invoked multiple times - during a ClutterState dispose sequence. + * ChangeLog: + * clutter/Makefile.am: + * clutter/clutter-binding-pool.c: + * clutter/clutter-binding-pool.h: + * clutter/clutter-event.c: + * clutter/clutter-event.h: + * clutter/clutter-marshal.list: + * clutter/clutter.h: + * tests/conform/Makefile.am: + * tests/conform/test-binding-pool.c: + * tests/conform/test-conform-main.c: + * tests/interactive/Makefile.am: + * tests/interactive/test-binding-pool.c: - * clutter/clutter-actor.c: - * clutter/clutter-backend.[ch]: - * clutter/clutter-main.c: - * clutter/clutter-private.h: - * clutter/clutter-stage.[ch]: Make ClutterStage a proxy actor, - with a private actor implementing the ClutterStageWindow - interface for handling the per-backend realization, painting - and unrealization, plus all the windowing system abstraction. + 2008-12-08 Emmanuele Bassi - * clutter/x11/clutter-event-x11.c: - * clutter/x11/clutter-stage-x11.[ch]: Port the X11 backend - to the new backend and stage API and semantics. +2008-12-08 Neil Roberts - * clutter/glx/clutter-backend-glx.c: - * clutter/glx/clutter-stage-glx.c: Port the GLX backend to - the new backend and stage API and semantics. + * ChangeLog: + * clutter/clutter-main.c: - * clutter/eglx/clutter-backend-egl.[ch]: - * clutter/eglx/clutter-stage-egl.[ch]: Port the EGLX backend - to the new backend and stage API and semantics (untested). + * clutter/clutter-main.c (_clutter_do_pick): Restore the + GL_DITHER - * tests/test-multistage.c (on_button_press): Rename - clutter_stage_create_new() to clutter_stage_new(). +2008-12-05 Emmanuele Bassi -2008-04-04 Neil Roberts + * ChangeLog: + * clutter/clutter-timeline.c: - Applied patch from bug #810. + 2008-12-05 Emmanuele Bassi - * clutter/x11/clutter-event-x11.c (event_translate): Set a flag - when resizing the stage from a ConfigureNotify event. +2008-12-05 Neil Roberts - * clutter/x11/clutter-stage-x11.c - (clutter_stage_x11_request_coords): Don't try to resize the window - again if the flag is set. - (clutter_stage_x11_init): Added initialiser for the flag. + * ChangeLog: + * clutter/clutter-entry.c: - * clutter/x11/clutter-stage-x11.h (struct _ClutterStageX11): Added - the flag. + * clutter/clutter-entry.c: Fix the 'Since' annotation in the -2008-04-04 Matthew Allum +2008-12-05 Neil Roberts + * ChangeLog: * clutter/clutter-actor.c: - Remove uneeded stage private member. - Add show-on-set-parent prop and make so by default Actors are - now automatically shown when reparented (#791) - - * clutter/eglx/clutter-backend-egl.c: - * clutter/cogl/gles/cogl.c: - A couple of minor comments. - - * clutter/eglnative/Makefile.am: - Add missing clutter-egl.h header (back port from trunk) + * clutter/clutter-behaviour-path.c: + * clutter/clutter-label.c: + * clutter/clutter-stage.c: + * clutter/clutter-texture.c: + * clutter/clutter-timeline.c: - * tests/test-actors.c: - Modify to take advantage of new show-on-set-parent functionality. + * clutter/clutter-timeline.c: -2008-04-03 Emmanuele Bassi +2008-12-05 Neil Roberts - * clutter/Makefile.am: Only export symbols matching "^clutter.*", - to avoid exposing the library-private symbols starting with - an underscore. + * .gitignore: + * ChangeLog: + * clutter/Makefile.am: + * clutter/clutter-behaviour-bspline.c: + * clutter/clutter-behaviour-bspline.h: + * clutter/clutter-behaviour-path.c: + * clutter/clutter-behaviour-path.h: + * clutter/clutter-bezier.c: + * clutter/clutter-bezier.h: + * clutter/clutter-effect.c: + * clutter/clutter-marshal.list: + * clutter/clutter-path.c: + * clutter/clutter-path.h: + * clutter/clutter.h: + * doc/reference/clutter/clutter-animation-tutorial.xml: + * doc/reference/clutter/clutter-docs.xml: + * doc/reference/clutter/clutter-sections.txt: + * doc/reference/clutter/clutter.types: + * tests/conform/Makefile.am: + * tests/conform/test-conform-main.c: + * tests/conform/test-path.c: + * tests/interactive/test-behave.c: + * tests/interactive/test-script.c: + * tests/interactive/test-threads.c: -2008-04-03 Emmanuele Bassi + Bug 1252 - Merge ClutterBehaviourPath and ClutterBehaviourBspline - * clutter/clutter-alpha.c: ClutterAlpha is an InitiallyUnowned - subclass. This should fix a lot of leakage. (#860, Neil Roberts) +2008-12-04 Neil Roberts -2008-04-03 Emmanuele Bassi - * clutter/glx/clutter-backend-glx.c: - (clutter_backend_glx_get_features): Assert if we don't have a - GL context here or if it's not matched to a drawable. Asserting - might seem too drastic, but if we don't have a valid GL context - here then Clutter will segfault anyway, and I'll take an assert() - over a hard to read, deep in GLX guts backtrace any day (and - twice on a monday). + Merge commit 'git-svn' into multiple-texture-rectangle - * clutter/x11/clutter-backend-x11.c: - (clutter_backend_x11_get_features): No need for a variable here. +2008-12-04 Neil Roberts -2008-04-01 Matthew Allum + * clutter/cogl/gl/cogl-texture.c: - * clutter/clutter-backend.c: - * clutter/glx/clutter-backend-glx.c: - * clutter/glx/clutter-stage-glx.c: - Allow NULL to be passed to _clutter_backend_ensure_context - which essentially clears GL context. This is hooked into stage - unrealisation. Isn't yet quite bulletproof. - Fixes issues with gtk-embed crasher (thanks to Neil). + Use the correct length in _cogl_texture_flush_vertices -2008-04-1 Robert Bragg +2008-12-04 Neil Roberts + * ChangeLog: + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gl/cogl.c: * clutter/glx/clutter-glx-texture-pixmap.c: - In clutter_glx_texture_pixmap_dispose; trap X errors around - glXDestroyGLXPixmap so we can't die due to BadDrawable errors. -2008-03-31 Matthew Allum + Bug 1297 - Bring back support for GL_ARB_texture_rectangle - * README: - Add notes on new multistage feature. +2008-12-04 Neil Roberts - * clutter/clutter-stage-manager.c: - Dont ref contained stages. + * ChangeLog: + * clutter/cogl/cogl-path.h: + * clutter/cogl/cogl.h.in: + * clutter/cogl/common/cogl-clip-stack.c: + * clutter/cogl/common/cogl-clip-stack.h: + * clutter/cogl/common/cogl-primitives.c: + * clutter/cogl/common/cogl-primitives.h: + * clutter/cogl/gl/cogl-context.c: + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gl/cogl-primitives.c: + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl-context.c: + * clutter/cogl/gles/cogl-context.h: + * clutter/cogl/gles/cogl-primitives.c: + * clutter/cogl/gles/cogl-texture.c: + * clutter/cogl/gles/cogl.c: + * doc/reference/cogl/cogl-sections.txt: + * tests/interactive/test-clip.c: + * tests/interactive/test-cogl-primitives.c: - * clutter/clutter-stage.c: - Automatically remove stage from stage manager on finalisation. - Cleans up warnings when a stage is destroyed. + Bug 1172 - Disjoint paths and clip to path - * clutter/clutter-backend.h: - * clutter/glx/clutter-backend-glx.c: - Minor formatting cleanups. +2008-12-03 Robert Bragg - * clutter/glx/clutter-stage-glx.c: - * configure.ac: - * clutter/clutter-version.h.in: - Add a general CLUTTER_STAGE_TYPE define, should be useful for - evntual stage subclassing and creating with g_object_new() - -2008-03-30 Neil Roberts - - * clutter/win32/clutter-backend-win32.c - (clutter_backend_win32_init): Added a call to - timeBeginPeriod. Without this the frame rates are terrible because - the glib timeouts are not accurate enough. However this requires - Glib >= 2.16.0 to take any effect because of a change in the way - g_poll is implemented. See revision 6597 of glib. - (clutter_backend_win32_finalize): Added a call to timeEndPeriod. + * ChangeLog: + * clutter/glx/clutter-glx-texture-pixmap.c: - * configure.ac: Added -lwinmm to the library dependencies for the - Win32 backend. + Bug 1303 - clutter_glx_texture_pixmap_using_extension doesn't + check if -2008-03-30 Neil Roberts +2008-12-01 Neil Roberts - * clutter/win32/clutter-win32.h: - * clutter/win32/clutter-stage-win32.h: - * clutter/win32/clutter-stage-win32.c: - * clutter/win32/clutter-event-win32.c: - * clutter/win32/clutter-backend-win32.h: - * clutter/win32/clutter-backend-win32.c: - Upgraded for multi-stage support. - - * clutter/win32/clutter-stage-win32.c - (clutter_stage_win32_request_coords): Fixed so that it doesn't set - the position or size if it hasn't changed. This was causing - problems when the window was resized using the top left corner. In - that case the window receives resize and move messages separately - which caused the window to flash at a different size or position - while one message was handled before the other. - (clutter_stage_win32_realize): Added PFD_GENERIC_ACCELERATED to - the list of pixel format flags to force it to use hardware - acceleration. + * ChangeLog: + * clutter/cogl/gl/cogl-texture.c: -2008-03-28 Matthew Allum + Bug 1305 - NPOT textures unaligned to a pixel sometimes have - * clutter/Makefile.am: - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - * clutter/clutter-backend.c: - * clutter/clutter-backend.h: - * clutter/clutter-debug.h: - * clutter/clutter-event.c: - * clutter/clutter-event.h: - * clutter/clutter-feature.h: - * clutter/clutter-group.h: - * clutter/clutter-main.c: - * clutter/clutter-main.h: - * clutter/clutter-private.h: - * clutter/clutter-stage.c: - * clutter/clutter-stage.h: - * clutter/clutter-stage-manager.c - * clutter/clutter-stage-manager.h - * clutter/clutter-types.h: - * clutter/glx/clutter-backend-glx.c: - * clutter/glx/clutter-backend-glx.h: - * clutter/glx/clutter-stage-glx.c: - * clutter/glx/clutter-stage-glx.h: - * clutter/x11/clutter-backend-x11.c: - * clutter/x11/clutter-backend-x11.h: - * clutter/x11/clutter-event-x11.c: - * clutter/x11/clutter-stage-x11.c: - * clutter/x11/clutter-x11.h: - * tests/Makefile.am: - * tests/test-multistage.c: - Initial commit of multi stage support (mostly a merge from the - clutter-multistage branch). - Note, this commit will break all backends except glx. +2008-11-28 Neil Roberts -2008-03-26 Neil Roberts + * ChangeLog: + * tests/conform/test-backface-culling.c: - * clutter/win32/clutter-win32.h: Added gtk-doc documentation for - the Win32 backend section. + * tests/conform/test-backface-culling.c (TEXTURE_SIZE): Don't set - * clutter/win32/clutter-stage-win32.c - (clutter_win32_get_stage_window): Fixed punctuation in the - documentation. +2008-11-28 Neil Roberts - * README: Added notes about the Win32 backend. + * ChangeLog: + * tests/conform/Makefile.am: + * tests/conform/test-backface-culling.c: + * tests/conform/test-conform-main.c: -2008-03-26 Neil Roberts + * tests/conform/test-backface-culling.c: New test for backface - * clutter/win32/clutter-event-win32.c (clutter_event_check): - Removed the pointless parameter in the call to check_msg_pending. - (check_msg_pending): Fixed to use PeekMessageW instead of - PeekMessage. +2008-11-28 Neil Roberts -2008-03-25 Neil Roberts + * ChangeLog: + * tests/conform/test-mesh-contiguous.c: + * tests/conform/test-mesh-interleved.c: + * tests/conform/test-mesh-mutability.c: - Added a native Win32 WGL backend. + * tests/conform/test-mesh-mutability.c: - * configure.ac: Added the 'win32' flavour. +2008-11-28 Neil Roberts - * clutter/cogl/gl/cogl.c (cogl_get_proc_address): Added an ifdef - to use wglGetProcAddress with the Win32 backend. + * clutter/cogl/gl/cogl-texture.c: - * clutter/Makefile.am (DIST_SUBDIRS): Added the win32 directory. + Use GL_TRIANGLES for the texture vertex array - * clutter/win32/clutter-win32.pc.in: - * clutter/win32/clutter-win32.h: - * clutter/win32/clutter-stage-win32.h: - * clutter/win32/clutter-stage-win32.c: - * clutter/win32/clutter-event-win32.c: - * clutter/win32/clutter-backend-win32.h: - * clutter/win32/Makefile.am: - * clutter/win32/clutter-backend-win32.c: New files. +2008-11-28 Neil Roberts -2008-03-19 Emmanuele Bassi + * clutter/pango/cogl-pango-render.c: - * clutter/clutter-model.[ch]: Add a ::copy() virtual function - for copying iterators. + Use cogl_texture_multiple_rectangles in CoglPangoRenderer - * clutter/clutter-list-model.c: - (clutter_list_model_iter_copy), - (clutter_list_model_iter_class_init): Implement the ::copy() - function inside the ListModel iterator subclass. +2008-11-28 Neil Roberts -2008-03-19 Emmanuele Bassi + * clutter/cogl/cogl-texture.h: + * clutter/cogl/gl/cogl-texture.c: - * clutter/clutter-group.c: - * clutter/clutter-texture.c: Use CLUTTER_ACTOR_IS_VISIBLE() - and not CLUTTER_ACTOR_IS_MAPPED(). + Add cogl_texture_multiple_rectangles -2008-03-19 Emmanuele Bassi +2008-11-28 Neil Roberts - * clutter/clutter-score.[ch]: Small clean ups and refactoring. - Use gulong instead of guint, so we have a bigger id space for - the timelines inside a Score. + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gl/cogl-texture.c: -2008-03-19 Chris Lord + Make cogl_texture_rectangle use the vertex array - * clutter/clutter-actor.c: - (_clutter_actor_apply_modelview_transform), (clutter_actor_paint): - Apply clip inside paint function instead of transform function +2008-11-27 Neil Roberts -2008-03-18 Emmanuele Bassi + * clutter/cogl/gl/cogl-context.c: + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gl/cogl-texture.c: - * clutter/clutter-score.c: Update documentation. + Use a GArray for the texture vertices in cogl_texture_polygon -2008-03-18 Emmanuele Bassi +2008-11-26 Emmanuele Bassi - * clutter/clutter-score.[ch]: Remove all the API changes, and - just add a clutter_score_append_at_marker(); the implementation - remains the same, but the marker must be explicitly created by - the developer. The ids are no longer used to create implicit - markers, so they can return to be unsigned integers. (#450) + * ChangeLog: + * clutter/clutter-group.c: - * clutter/clutter-timeline.[ch]: - (clutter_timeline_has_marker): Add a function to query a timeline - for a marker being set. + 2008-11-26 Emmanuele Bassi - * tests/test-score.c (main): Update with the API changes. +2008-11-26 Neil Roberts - * clutter.symbols: Update exported symbols. + * ChangeLog: + * clutter/cogl/gl/cogl-texture.c: -2008-03-18 Emmanuele Bassi + * clutter/cogl/gl/cogl-texture.c (cogl_texture_rectangle): Fixed - * clutter/clutter-texture.c: Small clean ups in the coding style. +2008-11-25 Emmanuele Bassi -2008-03-18 Emmanuele Bassi + * ChangeLog: + * configure.ac: - * clutter.symbols: Add new symbols + 2008-11-25 Emmanuele Bassi - * clutter/clutter-score.[ch]: Use the newly added marker API - on the timelines to implement attaching timelines at specific - points, using either milliseconds or frames. +2008-11-25 Neil Roberts - * tests/test-score.c (main): Test the new API. + * ChangeLog: + * clutter/clutter-score.c: -2008-03-18 Emmanuele Bassi + Bug 1299 - clutter_score_remove will segmentation fault if - * clutter/clutter-marshal.list: Add signature for the - ::marker-reached signal marshaller. +2008-11-24 Neil Roberts - * clutter/clutter-timeline.[ch]: Add timeline marker API; - using markers it is possible to add a unique identifier to - a particular frame of the timeline, and receive a signal - notification when reaching that particular marker while - playing the timeline. (#641) + * .gitignore: + * ChangeLog: + * configure.ac: + * tests/conform/Makefile.am: + * tests/tools/Makefile.am: + * tests/tools/disable-npots.c: + * tests/tools/disable-npots.sh.in: - * tests/test-timeline.c: Update the test case to check for - the marker-reached signal emission. + Add a wrapper library to help testing without NPOTs. - * clutter.symbols: Add new symbols. +2008-11-24 Neil Roberts -2008-03-10 Øyvind Kolås + * ChangeLog: + * clutter/cogl/gl/cogl-texture.c: - * tests/test-shader.c: improved readability of fragment shader - examples by factoring out common bits into FRAGMENT_SHADER_BEGIN and - FRAGMENT_SHADER_END macros. + * clutter/cogl/gl/cogl-texture.c (cogl_texture_polygon): Fix the -2008-03-09 Matthew Allum +2008-11-21 Neil Roberts - * clutter/clutter-id-pool.c: (clutter_id_pool_free): - Use g_slice_free not g_free. - * clutter/clutter-main.c: (_clutter_do_pick): - Dont 'over read' the framebuffer when picking (#839, Neil Roberts) + * ChangeLog: + * build/mingw/mingw-cross-compile.sh: -2008-03-07 Øyvind Kolås + Bug 1270 - Update to mingw-cross-compile.sh - Refactored the integer id->ClutterActor mapping code to be a self - contained data structure. +2008-11-21 Neil Roberts - * clutter/clutter-id-pool.[ch]: new files. - * clutter/Makefile.am: added clutter-id-pool.[ch] - * clutter/clutter-private.h: use a ClutterIDPool instead of GArray and - GSList to keep track of the reusable ids. - * clutter/clutter-actor.c: moved id pool logic away. - * clutter/clutter-main.c: simplified id pool creation/finalization. + * ChangeLog: + * clutter/cogl/common/cogl-mesh.c: + * clutter/cogl/gl/cogl-context.c: + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gl/cogl-defines.h.in: + * clutter/cogl/gl/cogl.c: -2008-03-07 Robert Bragg + Bug 1271 - mingw compiling failed: undefined reference to - * clutter/clutter-timeline.c: - Timeline changes to fix the issues identified in bugzilla #439 +2008-11-21 Neil Roberts - Notably, this includes some tweaks to timeline semantics. - So e.g. for a + * ChangeLog: + * tests/conform/Makefile.am: + * tests/interactive/Makefile.am: - 10 frame timeline here are some points about the new timeline code: + * tests/interactive/Makefile.am: - - When you create a timeline it starts with current_frame_num == 0 +2008-11-21 Neil Roberts - - After starting a timeline, the first timeout is for - current_frame_num == 1 (Notably it isn't 0 since there is a delay - before the first timeout signals so re-asserting the starting point - would give a longer than average first frame.) + * ChangeLog: + * clutter/clutter-media.c: - - For a non looping timeline the last timeout would be for - current_frame_num == 10 + Bug 1269 - mingw32 building failed at clutter-media.c - - For a looping timeline the timeout for current_frame_num == - 10 would be followed by a timeout for current_frame_num == 1 - and frame 0 is considered == frame 10. +2008-11-21 Neil Roberts - - Asking for a timeline of N frames might better be described - as asking for a timeline of _length_ N. + * ChangeLog: + * clutter/pango/cogl-pango.h: - Warning: Although I tried to test things, I guess it's quite - likely that this breaks somthing depending on a specific quirk - of the previous timeline code. + * clutter/pango/cogl-pango.h: Include pango/pango.h to get -2008-03-06 Emmanuele Bassi +2008-11-21 Neil Roberts - * clutter/clutter-actor.c: - (clutter_actor_set_anchor_point_from_gravity): Fix a stupid - conversion from pixels to units that should I not have made. + * ChangeLog: + * clutter/clutter-score.c: -2008-03-06 Emmanuele Bassi + Bug 1280 - clutter_score_append_at_marker lead to segmentation - * README: Update the release notes. +2008-11-20 Emmanuele Bassi -2008-03-06 Gwenole Beauchesne + * ChangeLog: + * clutter/clutter-actor.c: + * tests/interactive/test-animation.c: - Signed off by: Emmanuele Bassi + 2008-11-20 Emmanuele Bassi - * clutter/clutter-group.c (clutter_group_real_lower): Fix to - actually lower the actor under the 'above' actor. (#822) +2008-11-18 Neil Roberts -2008-03-06 Emmanuele Bassi + * ChangeLog: + * clutter/clutter-script.c: + * tests/interactive/test-animation.c: + * tests/interactive/test-easing.c: + * tests/interactive/test-pixmap.c: - * clutter/clutter-entry.h: - * clutter/clutter-entry.c: - (clutter_entry_handle_key_event_internal), - (clutter_entry_key_press), (clutter_entry_class_init), - (clutter_entry_handle_key_event): Provide a default class handler - for the key-press-event, so that giving key focus to an entry will - automatically make it work. This deprecates the - clutter_entry_handle_key_event() function. (#824) + Fixed some trivial compiler warnings - * tests/test-entry.c (main): Remove the handle_key_event() - machinery, and just give focus to the entry. +2008-11-18 Neil Roberts -2008-03-06 Chris Lord + * ChangeLog: + * tests/conform/test-timeline.c: - * clutter/clutter-model.c: (clutter_model_set_sorting_column): - Don't disable sorting on column 0 + * tests/conform/test-timeline.c (test_timeline): Remove the delay -2008-03-06 Emmanuele Bassi +2008-11-18 Robert Bragg - Add support for the anchor point inside ClutterScript (#834, - David Stanczak) + * ChangeLog: + * clutter/cogl/common/cogl-mesh.c: - * clutter/clutter-actor.c: - (clutter_actor_set_property), - (clutter_actor_get_property), - (clutter_actor_class_init): Add the :anchor-x and :anchor-y - properties to the ClutterActor class. + * clutter/cogl/common/cogl-mesh.c: - (clutter_actor_set_anchor_point), - (clutter_actor_set_anchor_pointu), - (clutter_actor_set_anchor_point_from_gravity): Reimplement - the pixel based and gravity based API using the units based - one. Emit the ::notify signal for the :anchor-x and :anchor-y - properties. +2008-11-18 Robert Bragg - (parse_units), - (clutter_actor_parse_custom_node): Parse the :anchor-x and - :anchor-y properties using the custom units format (mm, px, - pt and %). + * ChangeLog: + * clutter/cogl/gl/cogl-context.c: + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gl/cogl-internal.h: + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl-context.h: + * clutter/cogl/gles/cogl-texture-private.h: + * clutter/cogl/gles/cogl-texture.c: - * tests/test-script.json: Test the newly added properties. + A comparison of gl/cogl-texture.c and gles/cogl-texture.c, to + reduce -2008-03-05 Emmanuele Bassi +2008-11-18 Robert Bragg - * configure.ac: Add "osx" the the AC_HELP_STRING of the flavour - selection. (#831, Peter Enzerink) + * ChangeLog: + * clutter/cogl/gl/cogl-internal.h: + * clutter/cogl/gles/cogl-internal.h: -2008-03-04 Emmanuele Bassi + * clutter/cogl/gl/cogl-internal.h - * clutter/clutter-main.c (clutter_do_event): Do not throttle the - motion events if the per-actor delivery has been disabled. +2008-11-18 Emmanuele Bassi -2008-03-04 Øyvind Kolås + * ChangeLog: + * clutter/clutter.h: - * clutter/pango/pangoclutter-render.c: (draw_glyph): use g_slice_new0 - instead of g_slice_new when allocating the glyph_info, avoiding a - branch based on uninitialized memory. + 2008-11-18 Emmanuele Bassi -2008-03-03 Emmanuele Bassi +2008-11-18 Emmanuele Bassi - * Makefile.am: Do not recurse into doc if we did not explicitly - enabled the documentation build; we just recurse into doc if we - are doing a dist or a distcheck. + * ChangeLog: + * clutter/cogl/cogl-shader.h: + * clutter/cogl/gl/cogl-program.c: + * clutter/cogl/gles/cogl-program.c: -2008-02-29 Øyvind Kolås + 2008-11-18 Emmanuele Bassi - Reuse the numeric id's used for picking actors to avoid the potential - of overflowing the id numbers when continusly creating and destroying - actors on long running applications for 16bpp. +2008-11-18 Emmanuele Bassi - * clutter/clutter-private.h: replaced hashtable with GArray and a - GSList for available slots in the array. - * clutter/clutter-actor.c: (create_actor_id): function to create an - actor->id mapping, (release_actor_id): function to mark an existing id - as available for reuse. - * clutter/clutter-main.c: (clutter_context_free): added utility - function for cleaning up the context, - (clutter_get_actor_by_gid): use the GArray for looking up actors. + * ChangeLog: + * README: + * clutter/Makefile.am: + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + * clutter/clutter-shader-types.c: + * clutter/clutter-shader-types.h: + * clutter/clutter-shader.c: + * clutter/clutter-shader.h: + * clutter/cogl/cogl-shader.h: + * clutter/cogl/gl/cogl-context.c: + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gl/cogl-defines.h.in: + * clutter/cogl/gl/cogl-program.c: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl-gles2-wrapper.c: + * clutter/cogl/gles/cogl-gles2-wrapper.h: + * clutter/cogl/gles/cogl-internal.h: + * clutter/cogl/gles/cogl-program.c: + * doc/reference/clutter/clutter-sections.txt: + * doc/reference/cogl/cogl-sections.txt: + * tests/interactive/test-fbo.c: + * tests/interactive/test-shader.c: -2008-02-26 Emmanuele Bassi + 2008-11-18 Emmanuele Bassi - * clutter/clutter-alpha.c: - (clutter_exp_inc_func), (clutter_exp_dec_func): Clamp the value - of the alpha function between [0, MAX_ALPHA]. (#800) +2008-11-18 Emmanuele Bassi -2008-02-25 Emmanuele Bassi + * ChangeLog: + * clutter/clutter-texture.c: - * clutter/clutter-main.c (emit_event): Fix the last commit - which inverted a condition. + 2008-11-18 Emmanuele Bassi -2008-02-25 Emmanuele Bassi +2008-11-18 Emmanuele Bassi - * clutter/clutter-actor.c: Remove the usage of g_return_if_fail() - from static functions: either assert or use g_warning() to check - internal state, as g_return_if_fail() can be compiled out. + * ChangeLog: + * tests/conform/test-conform-main.c: - * clutter/clutter-main.c: Ditto as above. + 2008-11-18 Emmanuele Bassi -2008-02-25 Tomas Frydrych +2008-11-18 Emmanuele Bassi - * clutter/clutter-texture.c: - (texture_update_data): - Set alignment based on actual data rowstride, not the texture - width. + * ChangeLog: + * tests/conform/test-mesh-contiguous.c: + * tests/conform/test-mesh-interleved.c: + * tests/conform/test-mesh-mutability.c: -2008-02-21 Tomas Frydrych + 2008-11-18 Emmanuele Bassi - * clutter/x11/clutter-backend-x11.h: - * clutter/x11/clutter-event-x11.c: - * clutter/x11/clutter-x11.h: - (clutter_x11_handle_event): - (clutter_x11_disable_event_retrieval): - Functions to allow to hook into external XEvent retrieval (for - example when using clutter with gtk); NB: this API is tentative. +2008-11-18 Emmanuele Bassi -2008-02-21 Emmanuele Bassi + * ChangeLog: + * clutter/clutter-alpha.c: + * clutter/clutter-alpha.h: + * clutter/clutter-script.c: + * clutter/clutter-types.h: + * tests/interactive/test-easing.c: - * clutter/x11/clutter-event-x11.c (event_translate): Ignore - PropertyNotify events if they don't match our window. + 2008-11-18 Emmanuele Bassi - * clutter/x11/clutter-stage-x11.c: - (clutter_stage_x11_request_coords): Chain up to the parent's - request coords. +2008-11-18 Neil Roberts -2008-02-21 Emmanuele Bassi + * ChangeLog: + * tests/conform/test-pick.c: - * clutter/x11/clutter-event-x11.c (event_translate): Ignore - ConfigureNotify events if we are painting on a foreign window. + * tests/conform/test-pick.c (test_pick): The final result message - * clutter/x11/clutter-stage-x11.c: - (clutter_stage_x11_request_coords): Reliquish control of the - window size, if we are painting on a foreign window. This fixes - the GtkClutterEmbed widget. +2008-11-18 Neil Roberts -2008-02-20 Emmanuele Bassi + * ChangeLog: + * tests/conform/test-conform-main.c: - * clutter/clutter-timeline.c (clutter_timeline_set_delay): Relax - the condition to allow 0 msecs of delay (meaning: no delay). + * tests/conform/test-conform-main.c (main): Fixed a typo in the -2008-02-20 Tomas Frydrych +2008-11-18 Emmanuele Bassi + * .gitignore: + * ChangeLog: * clutter/Makefile.am: - Added libclutter_ ... _la_DEPENDENCIES to fix dependency tracking. + * clutter/clutter-alpha.c: + * clutter/clutter-alpha.h: + * clutter/clutter-animation.c: + * clutter/clutter-animation.h: + * clutter/clutter-debug.h: + * clutter/clutter-deprecated.h: + * clutter/clutter-interval.c: + * clutter/clutter-interval.h: + * clutter/clutter-main.c: + * clutter/clutter-script.c: + * clutter/clutter-types.h: + * clutter/clutter.h: + * doc/reference/clutter/Makefile.am: + * doc/reference/clutter/clutter-animation-tutorial.xml: + * doc/reference/clutter/clutter-animation.xml: + * doc/reference/clutter/clutter-docs.sgml: + * doc/reference/clutter/clutter-docs.xml: + * doc/reference/clutter/clutter-sections.txt: + * tests/Makefile.am: + * tests/interactive/Makefile.am: + * tests/interactive/test-actors.c: + * tests/interactive/test-animation.c: + * tests/interactive/test-behave.c: + * tests/interactive/test-depth.c: + * tests/interactive/test-easing.c: + * tests/interactive/test-effects.c: + * tests/interactive/test-layout.c: + * tests/interactive/test-multistage.c: + * tests/interactive/test-paint-wrapper.c: + * tests/interactive/test-rotate.c: + * tests/interactive/test-scale.c: + * tests/interactive/test-texture-quality.c: + * tests/interactive/test-threads.c: + * tests/interactive/test-viewport.c: -2008-02-20 Tomas Frydrych + 2008-11-17 Emmanuele Bassi - * clutter/x11/clutter-x11.h: - * clutter/x11/clutter-backend-x11.c: - (clutter_x11_set_display): - Function to set X display connection prior to calling - clutter_init(); stripped loads of trailing space. +2008-11-17 Emmanuele Bassi -2008-02-20 Tomas Frydrych + * ChangeLog: + * clutter/clutter-entry.c: + * clutter/clutter-label.c: + * clutter/clutter-rectangle.c: + * clutter/clutter-script.c: + * clutter/clutter-stage.c: - * clutter/clutter-marshal.list: - * clutter/glx/Makefile.am: - * clutter/glx/clutter-backend-glx.c: - * clutter/glx/clutter-backend-glx.h: - * clutter/glx/clutter-glx.h: - * clutter/x11/Makefile.am: - ClutterX11TexturePixmap and ClutterGLXTexturePixmap actors (#713; - patch by Johan Bilien). + 2008-11-17 Emmanuele Bassi -2008-02-20 Emmanuele Bassi +2008-11-15 Robert Bragg - * clutter/clutter-actor.h: - * clutter/clutter-actor.c: - (clutter_actor_get_abs_opacity): Add function that does what - get_opacity() does now... + * ChangeLog: + * tests/interactive/Makefile.am: + * tests/interactive/test-pixmap.c: - (clutter_actor_get_opacity): ... and make get_opacity() do what - it's supposed to be doing. The original get_opacity() returned - a composited value, and there's no way to actually extract the - real opacity value set with set_opacity(). + * tests/interactive/Makefile.am - * clutter/clutter-clone-texture.c: - * clutter/clutter-rectangle.c: - * clutter/clutter-texture.c: Update to use get_abs_opacity(). +2008-11-14 Emmanuele Bassi - * clutter/clutter-entry.c: - * clutter/clutter-label.c: Ditto. Also, never change the stored - alpha value. (#804) + * ChangeLog: + * clutter/clutter-score.c: + * tests/interactive/test-score.c: - * tests/Makefile.am: - * tests/test-opacity.c: Test suite for the get_opacity() and - get_abs_opacity() API, and correct opacity handling. + 2008-11-14 Emmanuele Bassi - * README: Add note about the change in get_opacity(). +2008-11-13 Neil Roberts -2008-02-19 Chris Lord + * ChangeLog: + * clutter/cogl/gles/cogl-gles2-wrapper.c: + * clutter/cogl/gles/cogl-gles2-wrapper.h: - * clutter/clutter-model.c: (clutter_model_resort): - Don't return when there's no sort function set, leave that to the - model sub-class + * clutter/cogl/gles/cogl-gles2-wrapper.h: -2008-02-18 Emmanuele Bassi +2008-11-13 Robert Bragg - * configure.ac: - * README: Post stable release bump to 0.7.1 + * ChangeLog: + * clutter/cogl/common/cogl-mesh.c: + * clutter/cogl/gles/cogl-gles2-wrapper.c: + * clutter/cogl/gles/cogl-gles2-wrapper.h: + * tests/conform/Makefile.am: + * tests/conform/test-mesh-contiguous.c: + * tests/conform/test-mesh-mutability.c: + * tests/conform/wrapper.sh: -2008-02-18 Emmanuele Bassi + Gets the mesh API working with GLES2 - * README: - * NEWS: Release 0.6.0 +2008-11-13 Neil Roberts + + * ChangeLog: + * clutter/clutter-actor.c: -2008-02-18 Emmanuele Bassi + * clutter/clutter-actor.c (clutter_actor_get_paint_visibility): - * clutter/clutter-list-model.c: - (clutter_list_model_iter_set_value): Fix a typo in the conversion - code. +2008-11-13 Emmanuele Bassi -2008-02-18 Chris Lord + * ChangeLog: + * clutter/clutter-behaviour-ellipse.c: - * README: - Fix spelling mistake and a typo + 2008-11-13 Emmanuele Bassi -2008-02-18 Emmanuele Bassi +2008-11-13 Neil Roberts + * ChangeLog: * clutter/clutter-actor.c: - (clutter_actor_get_box_from_vertices): Avoid a masking warning - caused by math.h utter braindamage. -2008-02-18 Emmanuele Bassi + * clutter/clutter-actor.c (clutter_actor_get_reactive) + +2008-11-12 Emmanuele Bassi + + * ChangeLog: + * tests/conform/Makefile.am: + * tests/conform/test-conform-main.c: + * tests/conform/test-paint-opacity.c: - * clutter/clutter-actor.c: Document the fact that ancestor can - be NULL in the relative transformation API, and what are the - effects. + 2008-11-12 Emmanuele Bassi -2008-02-15 Matthew Allum +2008-11-12 Emmanuele Bassi - * clutter/pango/pangoclutter-render.c: (draw_glyph): - More safety checks (#796, Tero Saarni) + * doc/reference/ChangeLog: + * doc/reference/clutter/clutter-sections.txt: -2008-02-15 Chris Lord + 2008-11-12 Emmanuele Bassi +2008-11-12 Emmanuele Bassi + + * ChangeLog: + * clutter/clutter-actor.c: + * clutter/clutter-clone-texture.c: * clutter/clutter-entry.c: - * clutter/clutter-group.c: * clutter/clutter-label.c: * clutter/clutter-rectangle.c: * clutter/clutter-texture.c: - More documentation fixes + * clutter/cogl/cogl-color.h: + * clutter/cogl/cogl-deprecated.h: + * clutter/cogl/cogl-path.h: + * clutter/cogl/cogl-types.h: + * clutter/cogl/cogl.h.in: + * clutter/cogl/common/cogl-color.c: + * clutter/cogl/gl/Makefile.am: + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/Makefile.am: + * clutter/cogl/gles/cogl-texture.c: + * clutter/cogl/gles/cogl.c: + * clutter/pango/cogl-pango-render.c: + * doc/reference/clutter/subclassing-ClutterActor.xml: + * doc/reference/cogl/cogl-sections.txt: + * tests/interactive/test-cogl-offscreen.c: + * tests/interactive/test-cogl-primitives.c: + * tests/interactive/test-cogl-tex-convert.c: + * tests/interactive/test-cogl-tex-foreign.c: + * tests/interactive/test-cogl-tex-getset.c: + * tests/interactive/test-cogl-tex-polygon.c: + * tests/interactive/test-cogl-tex-tile.c: + * tests/interactive/test-paint-wrapper.c: -2008-02-15 Chris Lord + 2008-11-12 Emmanuele Bassi - * clutter/clutter-entry.c: (clutter_entry_class_init): - More documentation fixes +2008-11-12 Neil Roberts -2008-02-15 Chris Lord + * ChangeLog: + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gles/cogl-texture.c: - * clutter/clutter-label.c: (clutter_label_class_init): - More documentation fixes + Bug 1057 - cogl_texture_rectangle doesn't support backward -2008-02-15 Chris Lord +2008-11-12 Neil Roberts - * clutter/clutter-clone-texture.c: - * clutter/clutter-texture.c: (clutter_texture_class_init): - More documentation fixes + * ChangeLog: + * clutter/clutter-rectangle.c: -2008-02-15 Chris Lord + * clutter/clutter-rectangle.c (clutter_rectangle_paint): Fixed so - * clutter/clutter-actor.c: - * clutter/clutter-container.c: - * clutter/clutter-media.c: - * clutter/clutter-rectangle.c: - * clutter/clutter-stage.c: (clutter_stage_class_init): - * clutter/clutter-stage.h: - * clutter/clutter-texture.c: - * doc/reference/clutter-docs.sgml: - Fix more documentation +2008-11-12 Neil Roberts -2008-02-15 Emmanuele Bassi + * ChangeLog: + * clutter/cogl/common/Makefile.am: + * clutter/cogl/gl/Makefile.am: + * clutter/cogl/gles/Makefile.am: - * clutter/clutter-actor.[ch]: - * clutter/clutter-types.h: - * doc/reference/clutter-docs.sgml: Fix a lot of documentation. + * clutter/cogl/gles/Makefile.am (libclutterinclude_HEADERS): -2008-02-15 Matthew Allum +2008-11-12 Neil Roberts - * clutter/cogl/gles/cogl.c: (cogl_paint_init): - Remove depth test getting turned on by default (unlike GL backend) + * ChangeLog: + * clutter/cogl/cogl-mesh.h: + * clutter/cogl/common/cogl-mesh.c: + * tests/conform/test-mesh-contiguous.c: + * tests/conform/test-mesh-interleved.c: + * tests/conform/test-mesh-mutability.c: -2008-02-15 Tomas Frydrych + Fix warnings in mesh tests - * configure.ac: - * clutter/clutter-version.h.in: - * build/msvc_2k5/clutter-version.h: - Removed unused --without-fpu configure option and CLUTTER_NO_FPU - macro +2008-11-10 Robert Bragg -2008-02-15 Tomas Frydrych + * ChangeLog: + * clutter/cogl/cogl-mesh.h: + * clutter/cogl/cogl-types.h: + * clutter/cogl/cogl.h.in: + * clutter/cogl/common/Makefile.am: + * clutter/cogl/common/cogl-mesh-private.h: + * clutter/cogl/common/cogl-mesh.c: + * clutter/cogl/gl/cogl-context.c: + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gl/cogl-defines.h.in: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl-context.c: + * clutter/cogl/gles/cogl-context.h: + * doc/reference/cogl/cogl-docs.sgml: + * doc/reference/cogl/cogl-sections.txt: + * tests/conform/Makefile.am: + * tests/conform/test-conform-main.c: + * tests/conform/test-mesh-contiguous.c: + * tests/conform/test-mesh-interleved.c: + * tests/conform/test-mesh-mutability.c: - * build/mingw/README: - * build/mingw/mingw-cross-compile.sh: - Script that automates cross compilation with mingw by Neil Roberts - + Bug 1164 - Implements the proposed Mesh API -2008-02-15 Emmanuele Bassi +2008-11-10 Robert Bragg - * clutter/clutter-actor.[ch]: Rename - clutter_actor_get_box_from_vertices() to - clutter_actor_box_get_from_vertices(). + * ChangeLog: + * tests/conform/ADDING_NEW_TESTS: + * tests/conform/test-conform-common.c: + * tests/conform/test-pick.c: + * tests/conform/wrapper.sh: - * clutter/clutter-group.c (clutter_group_query_coords): Fix the - query_coords() implementation. + * tests/conform/ADDING_NEW_TESTS -2008-02-15 Tomas Frydrych +2008-11-10 Neil Roberts - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - (clutter_group_query_coords): - Added function to translate vertex array to a bounding box. + * ChangeLog: + * tests/interactive/test-main.c: - (clutter_actor_is_scaled): - (clutter_actor_is_rotated): - Fixed documentation. + * tests/interactive/test-main.c (main): Allow more than two -2008-02-15 Tomas Frydrych +2008-11-10 Emmanuele Bassi - * clutter/clutter-group.c: (clutter_group_query_coords): - Disabled new code taking into account actor scale and rotation. + * ChangeLog: + * clutter/clutter-texture.c: -2008-02-14 Tomas Frydrych + 2008-11-10 Emmanuele Bassi - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - (clutter_actor_is_scaled): - (clutter_actor_is_rotated): - Convenience functions to test whether actor is scaled or rotated. +2008-11-10 Emmanuele Bassi - (clutter_actor_apply_relative_transform_to_point): - Removed unused variable. + * ChangeLog: + * tests/conform/test-label-cache.c: + * tests/conform/test-pick.c: + * tests/conform/test-timeline.c: + * tests/interactive/test-main.c: - * clutter/clutter-group.c: - (clutter_group_query_coords): - Use clutter_actor_get_relative_vertices() to calculate bounding - boxes of children that are scaled or rotated. + 2008-11-10 Emmanuele Bassi -2008-02-14 Tomas Frydrych +2008-11-10 Robert Bragg - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - (clutter_actor_get_relative_vertices): - (clutter_actor_apply_relative_transform_to_point): - Functions to calculate actor vertices in the plane of a given - ancestor. + * ChangeLog: + * tests/conform/ADDING_NEW_TESTS: + * tests/conform/Makefile.am: + * tests/conform/test-conform-main.c: + * tests/conform/test-pick.c: + * tests/conform/test-timeline.c: + * tests/conform/wrapper.sh: + * tests/interactive/test-main.c: -2008-02-12 Chris Lord + * tests/conform/Makefile.am: - * clutter/clutter-texture.c: (texture_get_tile_pixbuf), - (clutter_texture_get_pixbuf): - Fix copying textures to pixbufs for tiled textures and correct #ifndef - typo +2008-11-08 Emmanuele Bassi - * clutter/clutter-util.c: - Amend documentation + * ChangeLog: + * tests/conform/Makefile.am: + * tests/conform/test-actor-invariants.c: + * tests/conform/test-conform-main.c: + * tests/interactive/Makefile.am: + * tests/interactive/test-entry-auto.c: + * tests/interactive/test-invariants.c: -2008-02-12 Matthew Allum + 2008-11-08 Emmanuele Bassi - * clutter/clutter-texture.c: (texture_get_tile_pixbuf): - ifdef out 'leaked' GL only API call. +2008-11-07 Robert Bragg -2008-02-12 Tomas Frydrych + * ChangeLog: + * Makefile.am: + * configure.ac: + * tests/Makefile.am: + * tests/README: + * tests/conform/ADDING_NEW_TESTS: + * tests/conform/Makefile.am: + * tests/conform/test-clutter-entry.c: + * tests/conform/test-clutter-fixed.c: + * tests/conform/test-clutter-rectangle.c: + * tests/conform/test-conform-common.c: + * tests/conform/test-conform-common.h: + * tests/conform/test-conform-main.c: + * tests/conform/test-label-cache.c: + * tests/conform/test-pick.c: + * tests/conform/test-timeline-dup-frames.c: + * tests/conform/test-timeline-interpolate.c: + * tests/conform/test-timeline-rewind.c: + * tests/conform/test-timeline-smoothness.c: + * tests/conform/test-timeline.c: + * tests/conform/wrapper.sh: + * tests/data/Makefile.am: + * tests/data/redhand.png: + * tests/data/test-script.json: + * tests/interactive/Makefile.am: + * tests/interactive/test-actors.c: + * tests/interactive/test-behave.c: + * tests/interactive/test-clip.c: + * tests/interactive/test-cogl-offscreen.c: + * tests/interactive/test-cogl-primitives.c: + * tests/interactive/test-cogl-tex-convert.c: + * tests/interactive/test-cogl-tex-foreign.c: + * tests/interactive/test-cogl-tex-getset.c: + * tests/interactive/test-cogl-tex-polygon.c: + * tests/interactive/test-cogl-tex-tile.c: + * tests/interactive/test-depth.c: + * tests/interactive/test-devices.c: + * tests/interactive/test-effects.c: + * tests/interactive/test-entry-auto.c: + * tests/interactive/test-entry.c: + * tests/interactive/test-events.c: + * tests/interactive/test-fbo.c: + * tests/interactive/test-fullscreen.c: + * tests/interactive/test-grab.c: + * tests/interactive/test-invariants.c: + * tests/interactive/test-layout.c: + * tests/interactive/test-main.c: + * tests/interactive/test-model.c: + * tests/interactive/test-multistage.c: + * tests/interactive/test-offscreen.c: + * tests/interactive/test-opacity.c: + * tests/interactive/test-paint-wrapper.c: + * tests/interactive/test-perspective.c: + * tests/interactive/test-pixmap.c: + * tests/interactive/test-project.c: + * tests/interactive/test-random-text.c: + * tests/interactive/test-rotate.c: + * tests/interactive/test-scale.c: + * tests/interactive/test-score.c: + * tests/interactive/test-script.c: + * tests/interactive/test-shader.c: + * tests/interactive/test-stage-read-pixels.c: + * tests/interactive/test-texture-quality.c: + * tests/interactive/test-textures.c: + * tests/interactive/test-threads.c: + * tests/interactive/test-unproject.c: + * tests/interactive/test-viewport.c: + * tests/interactive/wrapper.sh: + * tests/micro-bench/Makefile.am: + * tests/micro-bench/test-text.c: + * tests/redhand.png: + * tests/test-actors.c: + * tests/test-behave.c: + * tests/test-clip.c: + * tests/test-cogl-offscreen.c: + * tests/test-cogl-primitives.c: + * tests/test-cogl-tex-convert.c: + * tests/test-cogl-tex-foreign.c: + * tests/test-cogl-tex-getset.c: + * tests/test-cogl-tex-polygon.c: + * tests/test-cogl-tex-tile.c: + * tests/test-depth.c: + * tests/test-devices.c: + * tests/test-effects.c: + * tests/test-entry-auto.c: + * tests/test-entry.c: + * tests/test-events.c: + * tests/test-fbo.c: + * tests/test-fullscreen.c: + * tests/test-grab.c: + * tests/test-invariants.c: + * tests/test-label-cache.c: + * tests/test-layout.c: + * tests/test-model.c: + * tests/test-multistage.c: + * tests/test-offscreen.c: + * tests/test-opacity.c: + * tests/test-paint-wrapper.c: + * tests/test-perspective.c: + * tests/test-pick.c: + * tests/test-pixmap.c: + * tests/test-project.c: + * tests/test-random-text.c: + * tests/test-rotate.c: + * tests/test-scale.c: + * tests/test-score.c: + * tests/test-script.c: + * tests/test-script.json: + * tests/test-shader.c: + * tests/test-stage-read-pixels.c: + * tests/test-text.c: + * tests/test-texture-quality.c: + * tests/test-textures.c: + * tests/test-threads.c: + * tests/test-timeline-dup-frames.c: + * tests/test-timeline-interpolate.c: + * tests/test-timeline-rewind.c: + * tests/test-timeline-smoothness.c: + * tests/test-timeline.c: + * tests/test-unproject.c: + * tests/test-viewport.c: + * tests/tools/Makefile.am: + * tests/tools/README: - * clutter/clutter-texture.c (texture_update_data): - Fixed incorrect calculation of offset into texture data (needs to - use width of the texture, not of the updated area). + Bug 1162 - Re-works the tests/ to use the glib-2.16 unit testing -2008-02-12 Tomas Frydrych +2008-11-07 Emmanuele Bassi - * clutter/clutter-texture.c (texture_update_data): - Fixed incorrect aligment of texture data. + * ChangeLog: + * clutter/clutter-media.c: -2008-02-12 Tomas Frydrych + 2008-11-07 Emmanuele Bassi - * clutter/x11/clutter-event-x11.c (event_translate): - Ignore events not directed at the stage window once they have been - passed to the filter functions. +2008-11-07 Matthew Allum -2008-02-11 Matthew Allum + * ChangeLog: + * clutter/clutter-texture.c: - * clutter/clutter-actor.c: - Minor documentation tweak to class description. + 2008-11-07 Matthew Allum - * clutter/clutter-behaviour-scale.c: - 'Force' start + end vals of scale behaviour - (#779, Havoc Pennington) +2008-11-07 Matthew Allum -2008-02-11 Emmanuele Bassi + * ChangeLog: + * clutter/clutter-texture.c: - * README: - * NEWS: Release 0.5.6 + 2008-11-07 Matthew Allum - * configure.ac: Post release bump to 0.5.7. +2008-11-07 Matthew Allum - * clutter/clutter-behaviour-scale.c: - * tests/test-fbo.c: Fix compilation warnings. + * ChangeLog: + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + * clutter/clutter-clone-texture.c: + * clutter/clutter-private.h: + * clutter/clutter-texture.c: + * clutter/glx/clutter-glx-texture-pixmap.c: + * clutter/x11/clutter-x11-texture-pixmap.c: -2008-02-11 Tomas Frydrych + 2008-11-07 Matthew Allum - * clutter/clutter-actor.c (clutter_actor_transform_stage_point): - Moved part of the calculation to floating point to avoid overflow - of ClutterFixed range for large actors (bug 613). +2008-11-06 Neil Roberts -2008-02-10 Matthew Allum + * ChangeLog: + * clutter/clutter-main.c: - * clutter/osx/clutter-stage-osx.c - Fix up a couple of typos breaking build. + Bug 1230 - Pick fails on low precision color buffers -2008-02-08 Emmanuele Bassi +2008-11-06 Neil Roberts - * clutter/clutter-actor.c: Add actor box diagram and notes. + * ChangeLog: + * clutter/cogl/common/cogl-fixed.c: + * clutter/cogl/gles/cogl.c: -2008-02-08 Emmanuele Bassi + * clutter/cogl/gles/cogl.c (cogl_perspective): - * clutter/clutter-behaviour-path.c: Move the nice graph and - description from the Path behaviour... +2008-11-06 Emmanuele Bassi - * clutter/clutter-behaviour.c: ... to the main Behaviour class. + * ChangeLog: + * clutter/clutter-alpha.c: -2008-02-08 Emmanuele Bassi + 2008-11-06 Emmanuele Bassi - * clutter/clutter-behaviour-path.c: Add a paragraph describing - the effects of different alpha functions on the path behaviour. +2008-11-05 Neil Roberts -2008-02-08 Emmanuele Bassi + * ChangeLog: + * clutter/clutter-color.c: - * clutter/clutter-actor.c: Reference the newly added event-flow.png + * clutter/clutter-color.c (clutter_color_new): Remove CLAMP + macros - * clutter/clutter-alpha.c: Ditto, with alpha-func.png +2008-11-04 Thomas Wood - * clutter/clutter-texture.c: Fix the XML. + * ChangeLog: + * clutter/clutter-color.c: -2008-02-08 Emmanuele Bassi + 2008-11-04 Thomas Wood - * clutter/clutter-behaviour-path.c: Reference the newly - added image showing the effects of different alpha functions - on the same path behaviour. +2008-11-04 Emmanuele Bassi - * configure.ac: Find out the prefix of some of the libraries - we depend upon, so that gtk-doc can fix the references for us. + * ChangeLog: + * clutter/clutter-script.c: -2008-02-08 Matthew Allum + 2008-11-04 Emmanuele Bassi - * clutter/clutter-texture.c: - Tidy up offscreen code, adding into realize/unrealize. - Add more safety code. - Improve documentation. +2008-11-04 Neil Roberts -2008-02-08 Emmanuele Bassi + * ChangeLog: + * clutter/cogl/gl/cogl.c: - * clutter/clutter-script.c: - (resolve_alpha_func): Use a whitelist containing the alpha function - provided by Clutter, as a fallback in case g_module_open() does not - work. + * clutter/cogl/gl/cogl.c (cogl_perspective): Use the accurate - (clutter_script_parse_alpha): Add an explicit warning in case we - cannot find the alpha function used inside a UI definition. +2008-11-04 Neil Roberts -2008-02-07 Tomas Frydrych + * ChangeLog: + * clutter/clutter-score.c: - * clutter/clutter-group.c (clutter_group_query_coords): - Take into account the anchor point when calculating the box size. + Bug 1181 - In Score, timelines, appended at markers, are also -2008-02-07 Emmanuele Bassi +2008-11-03 Emmanuele Bassi - * clutter/clutter-actor.c: Add a note on clutter_actor_set_size() - reguarding groups. + * ChangeLog: + * clutter/cogl/gl/Makefile.am: + * clutter/cogl/gles/Makefile.am: - * clutter/clutter-group.c: Clarify group sizing. + 2008-11-03 Emmanuele Bassi -2008-02-07 Øyvind Kolås +2008-11-03 Emmanuele Bassi - * tests/test-shader.c: (button_release_cb): added simplified - implementation of a box-blur shader from Gwenole Beauchesne that - should work on GLSL implementing low-end IGPs not implementing - dynamic branching. The original code used crashed some of these - due to bugs in drivers or similar. Resolves bug #710. + * ChangeLog: + * clutter/cogl/gles/cogl-context.h: -2008-02-07 Tomas Frydrych + 2008-11-03 Emmanuele Bassi - * tests/test-actors.c: - Reverted previous change. +2008-11-03 Neil Roberts -2008-02-07 Tomas Frydrych + * ChangeLog: + * clutter/clutter-timeline.c: + * tests/test-timeline.c: - * clutter/clutter-actor.c: - (clutter_actor_set_property): - Fixed handling of PROP_ROTATE_CENTER_Y, ROTATE_CENTER_Z + Bug 1207 - Timelines sometime miss markers - * tests/test-actors.c: - Adjusted to use anchor point for both group and hands. +2008-11-01 Emmanuele Bassi -2008-02-07 Neil J. Patel + * TODO: - * tests/test-actors.c: (frame_cb), (main): - Changed set_anchor to move_anchor. - Changed clutter_actor_rotate x & y values to 0,0. - Switched on scaling because it seems to work without drifting. + Update TODO -2008-02-07 Emmanuele Bassi +2008-11-01 Emmanuele Bassi - * clutter/clutter-script-parser.c: - (clutter_script_get_type_from_symbol), - (clutter_script_get_type_from_class): Use BIND_LAZY flag - when looking at the symbols, so we don't load them all up. + * README: - * clutter/clutter-script.c (resolve_alpha_func): Ditto as above. + Fix typo -2008-02-07 Øyvind Kolås +2008-10-31 Emmanuele Bassi - * clutter/clutter-actor.c: - (_clutter_actor_apply_modelview_transform): perform translation as - well as anchor point adjustment based on self not being stage (and - not by self not being an orphan). + * ChangeLog: + * clutter/pango/cogl-pango-fontmap.c: + * clutter/pango/cogl-pango-render.c: -2008-02-07 Matthew Allum + 2008-10-31 Emmanuele Bassi - * clutter/clutter-stage.c: - * clutter/clutter-stage.h: - * clutter/eglnative/clutter-stage-egl.c: - * clutter/eglx/clutter-stage-egl.c: - * clutter/osx/clutter-stage-osx.c: - * clutter/sdl/clutter-stage-sdl.c: - * clutter/x11/clutter-stage-x11.c: - Add at least somne basic offscreen handling into all backends. - Remove unused clutter_stage_set_offscreen vfunc. (#549) +2008-10-31 Matthew Allum + * ChangeLog: * clutter/clutter-texture.c: - Minor API doc tweak, noting rowstride source in set_area + * clutter/glx/clutter-glx-texture-pixmap.c: -2008-02-07 Emmanuele Bassi + 2008-10-31 Matthew Allum - * clutter/clutter-score.c (traverse_children): Actually implement - clutter_score_list_timelines(). +2008-10-31 Emmanuele Bassi - * tests/test-score.c (main): Test clutter_score_list_timelines(). + * ChangeLog: + * clutter/clutter-main.c: + * clutter/glx/clutter-backend-glx.c: + * clutter/x11/clutter-backend-x11.c: -2008-02-07 Matthew Allum + 2008-10-31 Emmanuele Bassi - * clutter/pango/pangoclutter-render.c: - Warn if requested glyph is too big for underlying texture cache. - (see #666) +2008-10-31 Emmanuele Bassi -2008-02-07 Matthew Allum + * clutter/clutter-fixed.h: - * clutter/clutter-texture.c: (texture_upload_data): - Remove random appearing 'priv->filter_quality =1' (#643) + Fix a typo -2008-02-06 Matthew Allum +2008-10-30 Emmanuele Bassi - * clutter/clutter-texture.c: - Minor clean up from last commit. + * ChangeLog: + * clutter/cogl/cogl-color.h: + * clutter/cogl/cogl-fixed.h: + * clutter/cogl/cogl-offscreen.h: + * clutter/cogl/cogl-path.h: + * clutter/cogl/cogl-shader.h: + * clutter/cogl/cogl-texture.h: + * clutter/cogl/cogl-types.h: + + 2008-10-30 Emmanuele Bassi + +2008-10-30 Emmanuele Bassi + + * ChangeLog: + * clutter/cogl/cogl-color.h: + * clutter/cogl/cogl-fixed.h: + * clutter/cogl/cogl-offscreen.h: + * clutter/cogl/cogl-path.h: + * clutter/cogl/cogl-shader.h: + * clutter/cogl/cogl-texture.h: + * clutter/cogl/cogl-types.h: + * clutter/cogl/cogl.h.in: + * clutter/cogl/common/cogl-color.c: + * clutter/cogl/gl/Makefile.am: + * clutter/cogl/gl/cogl-fbo.c: + * clutter/cogl/gl/cogl-program.c: + * clutter/cogl/gl/cogl-shader-private.h: + * clutter/cogl/gl/cogl-shader.c: + * clutter/cogl/gl/cogl-shader.h: + * clutter/cogl/gl/cogl-texture-private.h: + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gl/cogl-texture.h: + * clutter/cogl/gles/Makefile.am: + * clutter/cogl/gles/cogl-fbo.c: + * clutter/cogl/gles/cogl-gles2-wrapper.c: + * clutter/cogl/gles/cogl-program.c: + * clutter/cogl/gles/cogl-shader-private.h: + * clutter/cogl/gles/cogl-shader.c: + * clutter/cogl/gles/cogl-shader.h: + * clutter/cogl/gles/cogl-texture-private.h: + * clutter/cogl/gles/cogl-texture.c: + * clutter/cogl/gles/cogl-texture.h: + * doc/reference/cogl/Makefile.am: - * tests/test-fbo.c: - Small tweak (rotate offscreen, rather than resize) + 2008-10-30 Emmanuele Bassi -2008-02-06 Matthew Allum +2008-10-30 Emmanuele Bassi - * clutter/clutter-texture.c: - Initial attempt at handling resizing/tranformed source textures. + * ChangeLog: + * README: + * clutter/Makefile.am: + * clutter/clutter-backend.c: + * clutter/clutter-entry.c: + * clutter/clutter-label.c: + * clutter/clutter-main.c: + * clutter/clutter-main.h: + * clutter/clutter-private.h: + * clutter/pango/Makefile.am: + * clutter/pango/cogl-pango-fontmap.c: + * clutter/pango/cogl-pango-glyph-cache.c: + * clutter/pango/cogl-pango-glyph-cache.h: + * clutter/pango/cogl-pango-private.h: + * clutter/pango/cogl-pango-render.c: + * clutter/pango/cogl-pango.h: + * clutter/pango/pangoclutter-fontmap.c: + * clutter/pango/pangoclutter-glyph-cache.c: + * clutter/pango/pangoclutter-glyph-cache.h: + * clutter/pango/pangoclutter-private.h: + * clutter/pango/pangoclutter-render.c: + * clutter/pango/pangoclutter.h: - * clutter/pango/pangoclutter-render.c: (draw_glyph): - Guards against freetype returning NULL bitmaps and - thus causing device by zeros on NVIDIA drivers. (see ml) + 2008-10-30 Emmanuele Bassi -2008-02-05 Matthew Allum +2008-10-30 Emmanuele Bassi - * clutter/clutter-actor.c: (clutter_actor_get_vertices): - Make sure GL related Matrices are initialised. Fixes #756 + * ChangeLog: + * README: + * clutter/clutter-actor.h: + * clutter/clutter-alpha.h: + * clutter/clutter-backend.h: + * clutter/clutter-behaviour-bspline.h: + * clutter/clutter-behaviour-depth.h: + * clutter/clutter-behaviour-ellipse.h: + * clutter/clutter-behaviour-opacity.h: + * clutter/clutter-behaviour-path.h: + * clutter/clutter-behaviour-rotate.h: + * clutter/clutter-behaviour-scale.h: + * clutter/clutter-behaviour.h: + * clutter/clutter-child-meta.h: + * clutter/clutter-clone-texture.h: + * clutter/clutter-color.h: + * clutter/clutter-container.h: + * clutter/clutter-effect.h: + * clutter/clutter-entry.h: + * clutter/clutter-event.h: + * clutter/clutter-feature.h: + * clutter/clutter-fixed.h: + * clutter/clutter-frame-source.h: + * clutter/clutter-group.h: + * clutter/clutter-id-pool.h: + * clutter/clutter-label.h: + * clutter/clutter-list-model.h: + * clutter/clutter-main.h: + * clutter/clutter-media.h: + * clutter/clutter-model.h: + * clutter/clutter-rectangle.h: + * clutter/clutter-score.h: + * clutter/clutter-script.c: + * clutter/clutter-script.h: + * clutter/clutter-scriptable.h: + * clutter/clutter-shader.h: + * clutter/clutter-stage-manager.h: + * clutter/clutter-stage-window.h: + * clutter/clutter-stage.h: + * clutter/clutter-texture.h: + * clutter/clutter-timeline.h: + * clutter/clutter-timeout-pool.h: + * clutter/clutter-types.h: + * clutter/clutter-units.h: + * clutter/clutter-util.h: + * clutter/clutter.h: + * clutter/cogl/cogl-color.h: + * clutter/cogl/cogl-fixed.h: + * clutter/cogl/cogl.h.in: + * clutter/cogl/common/Makefile.am: + * clutter/cogl/gl/Makefile.am: + * clutter/cogl/gles/Makefile.am: + * clutter/eglnative/Makefile.am: + * clutter/eglx/Makefile.am: + * clutter/fruity/Makefile.am: + * clutter/glx/Makefile.am: + * clutter/glx/clutter-glx.h: + * clutter/osx/Makefile.am: + * clutter/pango/Makefile.am: + * clutter/sdl/Makefile.am: + * clutter/win32/Makefile.am: + * clutter/x11/Makefile.am: + * clutter/x11/clutter-x11-texture-pixmap.h: + * clutter/x11/clutter-x11.h: + * tests/test-pixmap.c: - * clutter/clutter-texture.c: - Fix up code from Norways answer to Jean-Michel Basquiat. - (warning on tile_get_pixbuf) + 2008-10-30 Emmanuele Bassi -2008-02-05 Øyvind Kolås +2008-10-30 Emmanuele Bassi - * clutter/clutter-texture.c: removed spurious left over debug printf. + * ChangeLog: + * clutter/cogl/cogl.h.in: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl.c: -2008-02-05 Øyvind Kolås + 2008-10-30 Emmanuele Bassi - * clutter/clutter-texture.c: applied modified patch from Gwenole - Beuchesne adressing bug #635. Adressing a buffer overflow in - clutter_texture_get_pixbuf() when tiling is forced. +2008-10-30 Emmanuele Bassi -2008-02-04 Emmanuele Bassi + * ChangeLog: + * README: + * clutter/clutter-actor.c: + * clutter/clutter-clone-texture.c: + * clutter/clutter-entry.c: + * clutter/clutter-main.c: + * clutter/clutter-rectangle.c: + * clutter/clutter-stage.c: + * clutter/clutter-texture.c: + * clutter/cogl/cogl-color.h: + * clutter/cogl/cogl.h.in: + * clutter/cogl/common/Makefile.am: + * clutter/cogl/common/cogl-color.c: + * clutter/cogl/gl/Makefile.am: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/Makefile.am: + * clutter/cogl/gles/cogl-texture.c: + * clutter/cogl/gles/cogl.c: + * clutter/pango/pangoclutter-render.c: + * doc/reference/cogl/cogl-docs.sgml: + * doc/reference/cogl/cogl-sections.txt: + * tests/test-cogl-offscreen.c: + * tests/test-cogl-primitives.c: + * tests/test-cogl-tex-convert.c: + * tests/test-cogl-tex-foreign.c: + * tests/test-cogl-tex-getset.c: + * tests/test-cogl-tex-polygon.c: + * tests/test-cogl-tex-tile.c: + * tests/test-paint-wrapper.c: - * clutter/clutter-shader.c (clutter_shader_constructor): Keep the - constructor line under the 80 columns using a variable. + 2008-10-30 Emmanuele Bassi -2008-02-04 Emmanuele Bassi +2008-10-30 Emmanuele Bassi + * ChangeLog: + * README: * clutter/clutter-actor.c: - * clutter/clutter-shader.c: Small documentation and style fixes + * clutter/clutter-alpha.c: + * clutter/clutter-backend.c: + * clutter/clutter-behaviour-depth.c: + * clutter/clutter-behaviour-ellipse.c: + * clutter/clutter-behaviour-path.c: + * clutter/clutter-behaviour-rotate.c: + * clutter/clutter-behaviour-scale.c: + * clutter/clutter-clone-texture.c: + * clutter/clutter-color.c: + * clutter/clutter-entry.c: + * clutter/clutter-fixed.c: + * clutter/clutter-fixed.h: + * clutter/clutter-stage.c: + * clutter/clutter-texture.c: + * clutter/clutter-timeline.c: + * clutter/clutter-units.h: + * clutter/cogl/cogl-fixed.h: + * clutter/cogl/cogl.h.in: + * clutter/cogl/common/Makefile.am: + * clutter/cogl/common/cogl-clip-stack.c: + * clutter/cogl/common/cogl-fixed.c: + * clutter/cogl/common/cogl-primitives.c: + * clutter/cogl/common/cogl-primitives.h: + * clutter/cogl/gl/Makefile.am: + * clutter/cogl/gl/cogl-primitives.c: + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/Makefile.am: + * clutter/cogl/gles/cogl-fbo.c: + * clutter/cogl/gles/cogl-gles2-wrapper.c: + * clutter/cogl/gles/cogl-primitives.c: + * clutter/cogl/gles/cogl-texture.c: + * clutter/cogl/gles/cogl.c: + * clutter/pango/pangoclutter-glyph-cache.c: + * clutter/pango/pangoclutter-glyph-cache.h: + * doc/reference/clutter/clutter-sections.txt: + * doc/reference/cogl/cogl-docs.sgml: + * doc/reference/cogl/cogl-sections.txt: + * tests/test-cogl-tex-tile.c: + * tests/test-project.c: - * tests/test-scale.c: Constify the gravities array. + 2008-10-30 Emmanuele Bassi -2008-02-04 Chris Lord +2008-10-29 Neil Roberts - * clutter/clutter-actor.c: (clutter_actor_transform_stage_point): - Check that x_out and y_out != NULL before setting their contents + * ChangeLog: + * clutter/cogl/gles/cogl-context.h: + * clutter/cogl/gles/cogl-fbo.c: + * clutter/cogl/gles/cogl-fbo.h: + * clutter/cogl/gles/cogl.c: + * tests/test-fbo.c: -2008-02-04 Øyvind Kolås + Bug 1074 - FBOs on GLES - * clutter/clutter-timeline.c: (clutter_timeline_rewind): updated - documentation to take direction into account. +2008-10-29 Neil Roberts -2008-02-04 Øyvind Kolås + * ChangeLog: + * clutter/clutter-main.c: - * tests/test-fbo.c: (make_shader): - * tests/test-shader.c: (main): multiply the resulting gl_FragColor - with gl_Color before being done to take opacity into account in the - GLSL fragments. + Bug 1206 - Picking disabled dithering -2008-02-04 Øyvind Kolås +2008-10-28 Robert Bragg - * clutter/clutter-actor.[ch]: added clutter_actor_get_shader and - renamed clutter_actor_apply_shader to be clutter_actor_set_shader. - Reindented/aligned header. - * clutter/clutter-texture.c: (clutter_texture_paint): temporarily - disable the shader on top of the clutter context's shader stack while - rendering into the FBO. - * tests/test-fbo.c: (main): s/apply_shader/set_shader/ - * tests/test-shader.c: (button_release_cb), (main): - s/apply_shader/set_shader/ + * clutter/pango/pangoclutter-render.c: -2008-02-03 Matthew Allum + 2008-10-28 Robert Bragg - * clutter/clutter-actor.c: (clutter_actor_set_rotationx): - Add notify signal for set_rotate +2008-10-28 Emmanuele Bassi - * clutter/clutter-texture.c: - Add basic cleanup code for fbo's + * .gitignore: - * tests/test-fbo.c: (main): - Minor notes. + Update git ignore file - * clutter/osx/clutter-stage-osx.c: (clutter_stage_osx_realize): - Turn on vblanking. +2008-10-28 Thomas Wood -2008-02-03 Matthew Allum + * ChangeLog: + * clutter/clutter-color.c: - * clutter/clutter-shader.c: - Minor formatting cleanups to fit in 80 cols. + * clutter/clutter-color.c (param_color_set_default): Set the no + copy - * clutter/clutter-texture.c: - More safety checks, clean ups in clutter_texture_new_from_actor() +2008-10-27 Neil Roberts + * ChangeLog: + * clutter/cogl/cogl.h.in: + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gl/cogl-internal.h: + * clutter/cogl/gl/cogl-texture.c: * clutter/cogl/gl/cogl.c: - Always clear the FBO initially when rendering - - * tests/test-fbo.c: - Overhall the test as to be more useful (and show current issues) + * clutter/cogl/gles/cogl-context.h: + * clutter/cogl/gles/cogl-internal.h: + * clutter/cogl/gles/cogl-texture.c: + * clutter/cogl/gles/cogl.c: + * doc/reference/cogl/cogl-sections.txt: -2008-02-02 Matthew Allum + Bug 1189 - Backface culling - * clutter/clutter-timeline.c: - Document frame number limits in new-frame signal. +2008-10-27 Neil Roberts - * clutter/x11/clutter-event-x11.c: - Remove uneeded error trap (#751) + * ChangeLog: + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gles/cogl-texture.c: -2008-02-01 Matthew Allum + Bug 1196 - Texture border drawing problems - * clutter/cogl/cogl.h: - * clutter/cogl/gl/cogl.c: (cogl_paint_init), (cogl_enable): - * clutter/cogl/gles/cogl.c: (cogl_enable): +2008-10-22 Thomas Wood - Disable the depth test and buffer as has some strange side - effects, mainly on x/y axis rotation with multiple layers at - same depth (eg rotating text on a bg has very strange - effect). Seems no clean 100% effective way to fix without other - odd issues.. So for now move to application to handle and add - cogl_enable_depth_test() as for custom actors (i.e groups) to - enable if need be. + * ChangeLog: + * tests/test-actors.c: + 2008-10-22 Thomas Wood -2008-02-01 Matthew Allum +2008-10-21 Emmanuele Bassi - * clutter/clutter-texture.c: (clutter_texture_new_from_actor): - Fix typo breaking FBO rendering on anything other than a cloned - texture. - -2008-02-01 Matthew Allum + * ChangeLog: + * clutter/clutter-color.c: + * clutter/clutter-color.h: - * clutter/clutter-feature.h: - * clutter/clutter-texture.c: - * clutter/clutter-texture.h: - * clutter/cogl/cogl.h: - * clutter/cogl/gl/cogl.c: - * clutter/cogl/gles/cogl.c: - * tests/Makefile.am: - * tests/test.fbo.c: - Add initial support for FBO's in Clutter (OpenGL only so far). - See new clutter_texture_new_from_actor() - Initial implementation, needs work. + 2008-10-21 Emmanuele Bassi - * clutter/x11/clutter-stage-x11.c: - (clutter_stage_x11_set_cursor_visible): - Fall back to again not relying on xfixes to hide cursor. *sigh* +2008-10-21 Emmanuele Bassi - * clutter/clutter-deprecated.h: - Add clutter_group_find_child_by_id + * ChangeLog: + * clutter/clutter-main.c: + * clutter/clutter-main.h: -2008-02-01 Øyvind Kolås + 2008-10-21 Emmanuele Bassi - * clutter/cogl/gles/cogl.c: (cogl_rectangle_internal): increase size - of GLfixed[] array to make contents fit. +2008-10-20 Emmanuele Bassi -2008-02-01 Emmanuele Bassi + * ChangeLog: + * configure.ac: - * clutter/clutter-actor.h: Clean up a bit the flag-related macros. + 2008-10-20 Emmanuele Bassi -2008-02-01 Emmanuele Bassi +2008-10-20 Neil Roberts - * clutter/clutter-actor.c: - (clutter_actor_get_property): Use clutter_actor_get_reactive() - instead of the IS_REACTIVE() macro. + * ChangeLog: + * clutter/cogl/gl/cogl-texture.c: - (clutter_actor_set_reactive): Emit the notify signal for the - reactive property. + Bug 1043 - COGL calls glTexSubImage2D() with out-of-bounds - * clutter/clutter-timeline.c: - (timeline_timeout_func), - (clutter_timeline_get_delta): Coding style fixes. +2008-10-20 Emmanuele Bassi -2008-01-31 Rob Bradford + * ChangeLog: + * clutter/clutter-color.h: - * clutter/glx/clutter-stage-glx.c: - * clutter/glx/clutter-backend-glx.c: - * clutter/glx/clutter-backend-glx.h: - Fix formatting. + Declare clutter_color_new() -2008-01-31 Emmanuele Bassi +2008-10-20 Neil Roberts - * clutter/clutter-timeline.c (clutter_timeline_skip): Don't - add the frames outside the direction check. (thanks to benoar - on clutter-list for spotting it) + * ChangeLog: + * clutter/clutter-behaviour-bspline.c: -2007-01-31 Tomas Frydrych + Bug 1195 - ClutterBehaviourBspline only works for very short + paths - * clutter/clutter-actor.c: - (clutter_actor_transform_vertices): - Call clutter_actor_query_coords() instead of accessing the actor - box, so that actors that calculate their bounding box on the fly - (like ClutterGroup) work. +2008-10-17 Emmanuele Bassi - * (_clutter_actor_apply_modelview_transform_recursive): - Made to work for parentless actors. + * ChangeLog: + * clutter/clutter-color.c: + * clutter/clutter-color.h: + * doc/reference/ChangeLog: + * doc/reference/clutter/clutter-sections.txt: -2008-01-31 Øyvind Kolås + 2008-10-17 Thomas Wood - * tests/test-depth.c: added a box of cloned hands to further expand - the scope of depth testing scenarios exercised by test-depth. +2008-10-17 Emmanuele Bassi -2008-01-31 Øyvind Kolås + * ChangeLog: + * clutter/clutter-color.c: - * tests/test-depth.c: (timeline_completed): make use of - clutter_timeline_set_direction instead of static state. - (raise_top): made rectangle remain at fixed depth and raise - above each other. - (janus_group): added a rectangle with two faces, one red and - one green, that spins around. + 2008-10-17 Emmanuele Bassi -2008-01-31 Emmanuele Bassi +2008-10-16 Emmanuele Bassi - * clutter/clutter-entry.h: - * clutter/clutter-entry.c: - (clutter_entry_set_cursor_position), - (clutter_entry_get_cursor_position): Rename [gs]et_position() - to [gs]set_cursor_position(), and avoid method name collisions - with bindings for high-level languages. + * ChangeLog: + * clutter/clutter-container.c: + * clutter/clutter-container.h: - * clutter/clutter-deprecated.h: Add replacement warnings for the - renamed methods. + 2008-10-16 Emmanuele Bassi -2008-01-31 Emmanuele Bassi +2008-10-08 Emmanuele Bassi - * clutter/clutter-actor.c (clutter_actor_init): Explicitly - memset() to 0 the clip container, so if you get the clip without - having set it, you won't get garbage. + * ChangeLog: + * tests/test-depth.c: -2008-01-31 Rob Bradford + 2008-10-08 Emmanuele Bassi - * clutter/x11/clutter-backend-x11-private.h: - Add missing start to comment +2008-10-01 Øyvind Kolås - * clutter/x11/clutter-backend-x11.c: - * clutter/x11/clutter-event-x11.c: - * clutter/x11/clutter-stage-x11.c: - * clutter/x11/clutter-x11.h: - Remove tabs. + * ChangeLog: + * clutter/clutter-event.c: + * clutter/clutter-main.c: -2008-01-30 Emmanuele Bassi + Bug 1108 - Enter/Leave events logics wrt. skipped motion events - * README: Add the osx flavour, and mark it experimental, - along with the sdl backend. EGL-based backends should not be - considered experimental anymore, even though they might require - tweaking. +2008-09-29 Emmanuele Bassi -2008-01-30 Emmanuele Bassi + * ChangeLog: + * configure.ac: - * HACKING: Expand the "document API" point, and the release - process. + 2008-09-29 Emmanuele Bassi - * README: Update the release notes regarding the scale behaviour, - now that the gravity has been removed. +2008-09-25 Emmanuele Bassi -2007-01-30 Tomas Frydrych + * ChangeLog: + * NEWS: + * README: + * configure.ac: - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - Added new clutter_actor_move_anchor_point_ API. + Release 0.8.2 - * clutter/clutter-behaviour-scale.c: - * clutter/clutter-behaviour-scale.h: - * clutter/clutter-effect.c: - * clutter/clutter-effect.h: - * tests/test-actors.c: - * tests/test-effects.c: - * tests/test-scale.c: - Removed gravity from ClutterBehaviourScale. +2008-09-25 Emmanuele Bassi -2008-01-27 Emmanuele Bassi + * doc/reference/ChangeLog: + * doc/reference/clutter/clutter-sections.txt: - * tests/test-depth.c (main): Use a group instead of pushing - the actors on the stage. + 2008-09-25 Emmanuele Bassi -2008-01-25 Emmanuele Bassi +2008-09-25 Emmanuele Bassi - * clutter/clutter-group.c (sort_z_order): Invert condition to - return to the same as in revision 1976. + * ChangeLog: + * clutter/clutter-event.h: -2008-01-25 Emmanuele Bassi + 2008-09-25 Emmanuele Bassi - * clutter/clutter-label.c (clutter_label_query_coords): Check - if the layout logical rectangle size is bigger than the bounding - box; this usually means that the bounding box changed in one - point and the label private allocation needs to be - updated. (#724) +2008-09-24 Emmanuele Bassi -2008-01-25 Emmanuele Bassi + * ChangeLog: + * clutter/clutter-main.c: - * clutter/x11/Makefile.am: Add the generated clutter-x11 pkg-config - file to CLEANFILES, to pass distcheck. + 2008-09-24 Emmanuele Bassi - * Makefile.am: - * clutter/Makefile.am: Tweak up the Makefiles. +2008-09-23 Emmanuele Bassi - * README: - * NEWS: Release 0.5.4 + * ChangeLog: + * clutter/clutter-timeout-pool.c: - * configure.ac: Post-release bump to 0.5.5 + 2008-09-23 Emmanuele Bassi -2008-01-25 Emmanuele Bassi +2008-09-23 Emmanuele Bassi - * clutter/clutter-group.c: Use a shorter Z order sorting function, - avoiding the checks. + * ChangeLog: + * clutter/clutter-timeout-pool.c: -2008-01-25 Øyvind Kolås + 2008-09-23 Emmanuele Bassi - * clutter/clutter-shader.c: added documentation strings for - ClutterShader. +2008-09-23 Emmanuele Bassi -2008-01-23 Emmanuele Bassi + * ChangeLog: + * clutter/clutter-timeout-pool.c: - * Makefile.am: Use variables, instead of substitutions. + 2008-09-23 Emmanuele Bassi - * clutter/clutter-private.h: - * clutter/clutter-main.h: Make clutter_do_event() public again, - as we need it in clutter-gtk. +2008-09-23 Emmanuele Bassi - * configure.ac: - * clutter/x11/Makefile.am: - * clutter/x11/clutter-x11.pc.in: Add a clutter-x11 pkg-config - file for clutter-gtk, as it depends on the X11 backend API, as - implemented by the GLX and EGLX backends. + * ChangeLog: + * clutter/clutter-actor.c: - * clutter/x11/clutter-event-x11.c (event_translate): Do not - propagate DestroyNotify events if the stage doesn't own the - window. + 2008-09-23 Emmanuele Bassi - * tests/test-scale.c (main): Set values different from the default. +2008-09-23 Emmanuele Bassi -2008-01-21 Emmanuele Bassi + * ChangeLog: + * clutter/clutter-label.c: - * clutter/clutter-behaviour-scale.c: - (clutter_behaviour_scale_set_property), - (clutter_behaviour_scale_class_init): Fix stupid typo in the - y-scale-end property declaration. (#720) + 2008-09-23 Emmanuele Bassi -2008-01-21 Emmanuele Bassi +2008-09-23 Emmanuele Bassi - * clutter/clutter-behaviour-depth.h: - * clutter/clutter-behaviour-depth.c: - (clutter_behaviour_depth_set_bounds), - (clutter_behaviour_depth_get_bounds): Add the depth-start and - depth-end accessors. + * ChangeLog: + * clutter/clutter-alpha.c: - * tests/test-depth.c (timeline_completed): Use set_bounds() - instead of g_object_set(). + 2008-09-23 Emmanuele Bassi - * clutter.symbols: Add clutter_behaviour_depth_set_bounds() - and clutter_behaviour_opacity_get_bounds() to the list of - public symbols. +2008-09-23 Tomas Frydrych -2008-01-21 Emmanuele Bassi + * ChangeLog: + * clutter/clutter-main.c: + * clutter/clutter-main.h: + * clutter/clutter-private.h: + * clutter/x11/clutter-backend-x11.c: - * clutter/clutter-behaviour-scale.c: Use separate variables for - storing the scale boundaries; apparently, using arrays broke - the python bindings. (#720) + 2008-09-23 Tomas Frydrych -2008-01-21 Matthew Allum +2008-09-22 Neil Roberts - * clutter/clutter-group.c: - Make sure unrealizing a group also unrealizes children. + * ChangeLog: + * clutter/clutter-main.c: + * clutter/eglnative/clutter-backend-egl.c: + * clutter/eglx/clutter-backend-egl.c: - * clutter/glx/clutter-stage-glx.c: - Chain up to group unrealize to make sure textures get unrealized - when changing context (see #718) + Bug 856 - Teardown sequence is borked - * clutter/clutter-texture.c: - Formatting cleanups +2008-09-22 Neil Roberts -2008-01-21 Øyvind Kolås + * ChangeLog: + * tests/test-project.c: + * tests/test-unproject.c: - * tests/test-shader.c: fix incompatible types in shader programs + * tests/test-unproject.c (on_event): - Apparently floats can't be multiplied or divided with ints without - explicit type casts. Use 2.0 or float(var) where appropriate. Patch - from Tommi Komulainen (#715). +2008-09-19 Emmanuele Bassi -2008-01-19 Emmanuele Bassi + * ChangeLog: + * clutter/clutter-main.c: - * clutter/clutter-main.c (generate_enter_leave_events): Do not - take the explicit reference, and let clutter_event_copy() do it - for us. (#714, Neil Roberts) + 2008-09-19 Emmanuele Bassi -2008-01-19 Emmanuele Bassi +2008-09-19 Emmanuele Bassi - * clutter/clutter-event.c (clutter_event_copy): Take an extra - reference on the related actor in ClutterEventCrossing that we - explicitly unref in clutter_event_free(). (#714, Neil Roberts) + * ChangeLog: + * clutter/clutter-main.c: -2008-01-18 Emmanuele Bassi + 2008-09-19 Emmanuele Bassi - * tests/test-actors.c (input_cb): Fix the callback signature; - hide the clicked actor only if it's a hand. +2008-09-19 Emmanuele Bassi -2008-01-18 Emmanuele Bassi + * ChangeLog: + * clutter/x11/clutter-backend-x11.c: + * clutter/x11/clutter-x11.h: - * clutter/clutter-main.c (clutter_do_event): Check the - return value of the ::event signal for the CLUTTER_DELETE - event type. + 2008-09-19 Emmanuele Bassi - * clutter/clutter-stage.c (clutter_stage_event): Emit the - ::event signal when receiving the CLUTTER_DELETE event; this - allows to intercept the user's closing of the stage window. +2008-09-18 Neil Roberts -2007-01-18 Tomas Frydrych + * ChangeLog: + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gles/cogl-texture.c: - * clutter/clutter-fixed.h: - Added missing proto for clutter_fixed_qdivx(). + Bug 1048 - SIGFPE in cogl_texture_set_region() with nvidia -2007-01-18 Tomas Frydrych +2008-09-18 Neil Roberts - * clutter/clutter-fixed.h: - * clutter/clutter-fixed.c: - Added CLUTTER_QDIV() for 64-bit division (bug 564, patch by - Gwenole Beauchesne). + * ChangeLog: + * clutter/cogl/gles/cogl.c: -2008-01-18 Emmanuele Bassi + Bug 1044 - cogl_get_viewport error - * clutter/clutter-event.h: Add a gunichar field for the Unicode - representation of the key. (#555) +2008-09-18 Neil Roberts -2008-01-18 Emmanuele Bassi + * ChangeLog: - * clutter/clutter-actor.h: - * clutter/clutter-script.h: - * clutter/clutter-stage.h: - * clutter/clutter-units.h: Documentation fixes and additions. + Forgot to add ChangeLog entry in the last commit. -2008-01-18 Emmanuele Bassi +2008-09-18 Neil Roberts - * clutter.symbols: Add ClutterBehaviourOpacity accessors. + * clutter/clutter-stage.c: + * tests/test-stage-read-pixels.c: - * clutter/clutter-behaviour-opacity.h: - * clutter/clutter-behaviour-opacity.c: - (clutter_behaviour_opacity_set_bounds), - (clutter_behaviour_opacity_get_bounds): Add accessors for the - opacity-start and opacity-end properties. + Bug 1080 - clutter_stage_read_pixels has upside-down y coordinate - * clutter/clutter-behaviour-scale.h: Fix the argument name to - avoid complaints by gtk-doc. +2008-09-17 Neil Roberts -2008-01-17 Emmanuele Bassi + * ChangeLog: + * clutter/glx/clutter-stage-glx.c: - * clutter/clutter-behaviour-scale.c: - (clutter_behaviour_scale_set_gravity): Notify on the right property - name. + Bug 1145 - Flicker on resize the window -2008-01-17 Emmanuele Bassi +2008-09-17 Neil Roberts - * clutter.symbols: Add new ClutterBehaviourScale setters. + * ChangeLog: + * clutter/clutter-types.h: - * clutter/clutter-behaviour-scale.[ch]: Split the scaling factors - on both axis. Add setters for all the behaviour properties. + * clutter/clutter-types.h: Swap left and right in the - * clutter/clutter-effect.h: - * clutter/clutter-effect.c (clutter_effect_scale): Split the - final scale factor to match the ClutterBehaviourScale changes. (#709) +2008-09-17 Neil Roberts - * tests/test-actors.c: - * tests/test-effects.c: - * tests/test-rotate.c: - * tests/test-scale.c: Update after API change. + * ChangeLog: + * clutter/clutter-actor.c: -2008-01-16 Emmanuele Bassi + Bug 1121 - Setting anchor point doesn't work if set too early - * clutter/cogl/cogl.h: Rename COGLhandleARB to COGLhandle. +2008-09-16 Neil Roberts - * clutter/cogl/gl/cogl-defines.h.in: - * clutter/cogl/gl/cogl.c: Update GL implementation of COGL. + * ChangeLog: + * clutter/win32/clutter-event-win32.c: + * clutter/win32/clutter-stage-win32.c: - * clutter/cogl/gles/cogl-defines.h: - * clutter/cogl/gles/cogl.c: Update GLES implementation of COGL. + Bug 1100 - WM_SIZE not handled correctly, user_resize and - * clutter/clutter-shader.c: Fix ClutterShader to use the new - COGLhandle type instead of COGLhandlerARB. +2008-09-16 Tomas Frydrych -2008-01-16 Emmanuele Bassi + * ChangeLog: + * clutter/glx/clutter-glx-texture-pixmap.c: + * clutter/x11/clutter-x11-texture-pixmap.c: - Define COGLhandleARB. (patch by Johan Bilien) + 2008-09-16 Tomas Frydrych - * clutter/cogl/gles/cogl-defines.h: Define COGLhandleARB on - GLES as well (using GLuint) +2008-09-15 Øyvind Kolås - * clutter/cogl/gles/cogl.c: Use COGLhandleARB. + * ChangeLog: + * clutter/clutter-main.c: -2008-01-14 Tommi Komulainen + * clutter/clutter-main.c: amended typo in gtk-doc. - reviewed by: Emmanuele Bassi +2008-09-12 Neil Roberts - * clutter/osx/clutter-event-osx.c (_clutter_event_osx_put): - Initialize ClutterEvent structure with zeroes (#672) + * ChangeLog: + * clutter/clutter-main.c: + * tests/Makefile.am: + * tests/test-pick.c: - The 'source' member was uninitialized and being referenced in - clutter_do_event leading to crash. + Bug 1034 - Picking doesn't work on Eee PC -2008-01-14 Emmanuele Bassi +2008-09-12 Neil Roberts - * tests/test-scale.c: Improve test case for scaling (#684, - Jaap A. Haitsma) + * ChangeLog: + * clutter/clutter-label.c: + * tests/Makefile.am: + * tests/test-label-cache.c: -2008-01-14 Emmanuele Bassi + Bug 1010 - ClutterLabel does not update the layout (again) - * clutter/clutter-timeline.c (timeline_timeout_func): Fix - check if the last frame was reached by skipping a frame (#654, - Johan Bilien) +2008-09-10 Neil Roberts -2008-01-14 Emmanuele Bassi + * ChangeLog: + * clutter/clutter-actor.c: - * clutter/clutter-shader.c: Use correct format string for - gssize. (#695, Tommi Komulainen) + Bug 1137 - Setting the anchor point does not trigger a re-paint -2008-01-14 Emmanuele Bassi +2008-08-27 Emmanuele Bassi - * clutter/cogl/gl/cogl.c (cogl_get_proc_address): Implement non-GLX - version using GModule and looking up the symbol from the running - process. It should work when linked to library providing the - requested function. (#696, Tommi Komulainen) + * ChangeLog: + * clutter/cogl/common/cogl-bitmap-pixbuf.c: -2008-01-14 Emmanuele Bassi + 2008-08-27 Emmanuele Bassi - * configure.ac: Post-release bump to 0.5.3 +2008-08-27 Emmanuele Bassi - * README: - * NEWS: Release 0.5.2 + * ChangeLog: + * clutter/clutter-script.c: + * clutter/clutter-script.h: + * doc/reference/ChangeLog: + * doc/reference/clutter/clutter-sections.txt: -2008-01-14 Emmanuele Bassi + 2008-08-27 Emmanuele Bassi - * clutter.symbols: Add clutter_model_insertv() +2008-08-26 Emmanuele Bassi - * clutter/clutter-model.[ch] (clutter_model_insertv): Add a vector - based insertion API, for language bindings + * ChangeLog: + * clutter/clutter-label.c: -2008-01-12 Emmanuele Bassi + 2008-08-26 Emmanuele Bassi - * clutter/clutter-effect.c (clutter_effect_rotate): Make the - rotate effect work on the passed axis, instead of hardcoding - the X axis. (#700, Neil Roberts) +2008-08-19 Neil Roberts -2008-01-10 Øyvind Kolås + * ChangeLog: + * clutter/clutter-score.c: + * doc/reference/clutter/subclassing-ClutterActor.xml: - Added COGLhandleARB since the underlying type on OSX is void*, - patch from Tommi Komulainen , (#694) + Bug 1103 - Two typos in clutter documentation - * clutter/cogl/gl/cogl-defines.h.in: Added COGLhandleARB typedef. - * clutter/cogl/cogl.h: - * clutter/cogl/gl/cogl.c: - * clutter/clutter-shader.c: Use COGLhandleARB instead of COGLint when - referring to program or shader handles. +2008-08-18 Neil Roberts -2008-01-09 Emmanuele Bassi + * ChangeLog: + * clutter/clutter-entry.c: - * clutter/Makefile.am: - * clutter/clutter.h: - * clutter/clutter-list-model.[ch]: Complete the ClutterModelDefault - to ClutterListModel rename by renaming the source files + Bug 1085 - Cursor is in wrong position on ClutterEntry if set -2008-01-09 Emmanuele Bassi +2008-08-07 Neil Roberts - * clutter/clutter-model-default.[ch]: Rename ClutterModelDefault - into ClutterListModel, to make it clear that the default - ClutterModel implementation is list-based + * ChangeLog: + * clutter/win32/clutter-event-win32.c: - * tests/test-model.c: Update call + Bug 1091 - WM_MOUSEWHEEL (scroll-event) not handled correctlly -2008-01-09 Emmanuele Bassi +2008-08-06 Emmanuele Bassi - * clutter/clutter-model-default.c: - (clutter_model_default_new), - (clutter_model_default_newv): Move the constructors in the - right file + * ChangeLog: + * clutter/clutter-child-meta.c: + * clutter/clutter-container.c: - * clutter/clutter-model-private.h: Add a private header for - the ClutterModel implementations + 2008-08-06 Emmanuele Bassi - * clutter/clutter-model.c: - (clutter_model_check_type), - (clutter_model_set_n_columns), - (clutter_model_set_column_type): Mark as private to Clutter, - not static to ClutterModel +2008-08-05 Emmanuele Bassi - * clutter/Makefile.am: Add clutter-model-private.h + * ChangeLog: + * clutter/clutter-keysyms.h: -2008-01-09 Emmanuele Bassi + 2008-08-04 Emmanuele Bassi - * clutter/clutter-label.c: - (clutter_label_ensure_layout): Fix the ClutterUnits to Pango - scale conversion. +2008-08-04 Emmanuele Bassi -2008-01-08 Emmanuele Bassi + * ChangeLog: + * clutter/clutter-script.c: - * clutter/clutter-model.c: - (clutter_model_appendv), - (clutter_model_prependv): Fix the columns length pre-condition + 2008-08-04 Emmanuele Bassi -2008-01-07 Emmanuele Bassi +2008-08-04 Emmanuele Bassi - * clutter/clutter-model-default.[ch]: Remove the ClutterModelDefault - iterator symbols from the public API; the iterator implementation - is a detail of the default ClutterModel class + * ChangeLog: + * clutter/clutter-keysyms.h: + * clutter/clutter-script-parser.c: + * clutter/clutter-script-private.h: + * clutter/clutter-script.c: - * clutter.symbols: Update + 2008-08-04 Emmanuele Bassi -2008-01-07 Emmanuele Bassi +2008-08-04 Emmanuele Bassi - * clutter/clutter-model.h: - * clutter/clutter-model.c: - (clutter_model_appendv), - (clutter_model_prependv): Add vector based API for bindings. + * ChangeLog: + * clutter/clutter-main.c: - (clutter_model_get_column_name), - (clutter_model_get_column_type), - (clutter_model_set_sorting_column): Fix the check in the condition - on the column index. + 2008-08-04 Emmanuele Bassi - * tests/test-scale.c (on_timeline_completed), (main): Fix spelling +2008-08-01 Neil Roberts - * clutter.symbols: Update public symbols + * .gitignore: -2008-01-04 Emmanuele Bassi + The *-sections.txt files in the doc/reference folders should not + be - * clutter.symbols: Add clutter_actor_move_byu() +2008-08-01 Neil Roberts - * clutter/clutter-actor.h: + * ChangeLog: * clutter/clutter-actor.c: - (clutter_actor_move_by), - (clutter_actor_move_byu): Add a units-based variant of the - clutter_actor_move_by() function - -2008-01-02 Johan Bilien - - reviewed by: Emmanuele Bassi + * clutter/clutter-private.h: + * clutter/clutter-texture.c: + * clutter/cogl/cogl.h.in: + * clutter/cogl/common/cogl-clip-stack.c: + * clutter/cogl/common/cogl-clip-stack.h: + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gl/cogl-fbo.c: + * clutter/cogl/gl/cogl-fbo.h: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl-gles2-wrapper.c: + * clutter/cogl/gles/cogl-gles2-wrapper.h: + * clutter/cogl/gles/cogl.c: + * doc/reference/cogl/cogl-sections.txt: - * configure.ac: Use AC_DEFINE_UNQUOTED to expand the - variable. Fixes EGL backend build + Bug 945 - Clipping+fbo cloning bugs -2008-01-02 Emmanuele Bassi +2008-08-01 Neil Roberts - * configure.ac: Post release bump to 0.5.1 + * ChangeLog: + * clutter/clutter-timeline.c: -2008-01-02 Emmanuele Bassi + Bug 1071 - clutter_timeline_get_duration doesn't always work - * README: - * NEWS: Release 0.5.0 +2008-08-01 Neil Roberts -2008-01-02 Emmanuele Bassi + * ChangeLog: + * clutter/clutter-score.c: - * clutter/clutter-model-default.c: - (clutter_model_default_get_iter_at_row), - (clutter_model_default_insert_row): Fix off-by-one errors + Bug 1069 - Warnings with ClutterScore - (clutter_model_default_class_init): - (clutter_model_default_remove_row): Move the actual removal of the - row to... +2008-07-31 Neil Roberts - (clutter_model_default_row_removed): ... the signal class handler - of ::row-removed; this way, signal handlers connected to - ::row-removed will get a valid iterator, while signal handlers - connected to ::row-removed with the AFTER flag will get an updated - model + * ChangeLog: + * clutter/clutter-stage.c: -2007-12-31 Tomas Frydrych + Bug 1075 - Difficult to bind clutter_stage_new - * configure.ac: - * clutter/Makefile.am: - Added -no-undefined to libtool LDFLAGS for mingw/SDL backend, to - allow building of shared libraries for win32. +2008-07-30 Neil Roberts -2007-12-31 Tomas Frydrych + * ChangeLog: + * clutter/clutter-stage.c: - * configure.ac: - * clutter.pc.in: - Added CLUTTER_REQUIRES automake var to allow deps in clutter.pc to - be backend-specific. + * clutter/clutter-stage.c (clutter_stage_class_init): Added the -2007-12-28 Emmanuele Bassi +2008-07-30 Emmanuele Bassi - * clutter/clutter-texture.c: - (clutter_texture_unrealize): Do not read the pixels back if the - texture is being destroyed + * ChangeLog: + * clutter/clutter-fixed.h: + * clutter/clutter-units.h: -2007-12-28 Emmanuele Bassi + 2008-07-30 Emmanuele Bassi - * clutter/clutter-model.c: - (clutter_model_real_get_n_rows), (clutter_model_class_init), - (clutter_model_get_n_rows): Provide a default implementation of - the get_n_rows() method, so that subclasses do not strictly need - to override it +2008-07-30 Ross Burton -2007-12-25 Emmanuele Bassi + * ChangeLog: + * clutter/clutter-main.c: + * clutter/clutter-stage.c: - * clutter/clutter-actor.c: - (parse_rotation_array): Inline, and get the JsonArray as a parameter + 2008-07-30 Ross Burton - (parse_rotation): Update +2008-07-30 Neil Roberts - * clutter/clutter-script.c: - (warn_missing_attribute): Fix for emacs-style warnings + * ChangeLog: + * clutter/clutter-model.c: - (clutter_script_parse_node): Remove an ifdeffed out section + * clutter/clutter-model.c (clutter_model_set_sorting_column): + This - (clutter_script_construct_parameters), - (clutter_script_construct_object): Rename get_parameters, so - it's obvious what it does +2008-07-30 Ross Burton -2007-12-25 Emmanuele Bassi + * doc/reference/ChangeLog: + * doc/reference/clutter/version.xml.in: + * doc/reference/cogl/version.xml.in: - * tests/test-script.json: Fix the JSON syntax + 2008-07-30 Ross Burton -2007-12-25 Emmanuele Bassi +2008-07-26 Neil Roberts - * clutter/clutter-enum-types.c.in: Fix the template + * ChangeLog: + * clutter/clutter-timeline.c: -2007-12-24 Emmanuele Bassi + * clutter/clutter-timeline.c (clutter_timeline_list_markers): + When - * clutter/clutter-stage.c: - * clutter/clutter-stage.h: - * clutter/clutter-texture.c: Remove some of the remaining FIXMEs - in the API documentation +2008-07-25 Neil Roberts -2007-12-24 Emmanuele Bassi + * ChangeLog: + * clutter/clutter-actor.c: - * clutter/clutter-color.c: - * clutter/clutter-event.c: - * clutter/clutter-stage.c: Intern more strings using the I_() macro + * clutter/clutter-actor.c (clutter_actor_remove_clip) - * clutter/clutter-enum-types.c.in: Call g_intern_static_string() - in the enum types template +2008-07-24 Neil Roberts -2007-12-24 Emmanuele Bassi + * ChangeLog: + * clutter/clutter-script.c: - * clutter.symbols: Add clutter_actor_set_clipu() and - clutter_actor_get_clipu() + * clutter/clutter-script.c: The example in the documentation - * clutter/clutter-actor.h: - * clutter/clutter-actor.c: - (clutter_actor_set_clipu), (clutter_actor_get_clipu): Add the - new units-based versions of the clip accessors +2008-07-23 Emmanuele Bassi - (clutter_actor_set_clip), (clutter_actor_get_clip): Reimplement - the pixels-based clip accessors as proxies for the units-based - ones + * ChangeLog: + * clutter/clutter-deprecated.h: -2007-12-24 Emmanuele Bassi + 2008-07-23 Emmanuele Bassi - * clutter/cogl/cogl.h: Update cogl_clip_set() to accept the - clip components as ClutterFixed values +2008-07-17 Emmanuele Bassi - * clutter/cogl/gl/cogl.c (cogl_clip_set): Update the GL implementation - of cogl_clip_set() + * ChangeLog: + * Makefile.am: + * configure.ac: - * clutter/cogl/gles/cogl.c: - (cogl_rectangle_internal): Provide an internal, inlined rectangle - drawing function using fixed point values, to be shared by - cogl_clip_set() and cogl_rectangle() + 2008-07-17 Emmanuele Bassi - (cogl_clip_set), (cogl_rectangle): Update the GLES implementation - of cogl_clip_set() and cogl_rectangle() to use the new internal - rectangle drawing function +2008-07-17 Emmanuele Bassi - * clutter/clutter-actor.c: Make the clip an array of ClutterUnit - values instead of pixel-based; this allows higher precision and - device independence + * clutter.doap: - (_clutter_actor_apply_modelview_transform): Pass the clip - components converting from units to fixed point values, using - the new cogl_clip_set() signature + Put back Project as the top-level element - (clutter_actor_get_property), (clutter_actor_set_clip), - (clutter_actor_get_clip): Update the accessors of the clip - property +2008-07-17 Emmanuele Bassi -2007-12-21 Emmanuele Bassi + * clutter/eglx/Makefile.am: - * clutter/clutter-actor.h: Remove the unused ::set_depth() and - ::get_depth() virtual functions. (#674, Murray Cumming) + Fix the dependencies in the Makefile template -2007-12-21 Emmanuele Bassi +2008-07-17 Emmanuele Bassi - * clutter/clutter-group.c: - * clutter/clutter-group.h: Add the clutter_group_add() convenience - function; it's now "undeprecated" and implemented as a macro + * clutter.doap: - * clutter/clutter-stage.h: Add clutter_stage_add() as a convenience - macro + Update DOAP file - * clutter/cogl/cogl.h: Include just the needed headers instead - of the whole clutter.h; this avoids rebuild cogl when not needed +2008-07-17 Emmanuele Bassi -2007-12-21 Emmanuele Bassi + * doc/reference/ChangeLog: + * doc/reference/clutter/subclassing-ClutterActor.xml: - * Makefile.am: Move tests build before docs, to cut down the - distcheck failure discovery + 2008-07-17 Emmanuele Bassi - * clutter.symbols: Add clutter_texture_set_area_from_rgb_data() +2008-07-17 Neil Roberts - * clutter/clutter-actor.c: - * clutter/clutter-script.c: + * ChangeLog: + * clutter/clutter-clone-texture.c: + * clutter/clutter-entry.c: + * clutter/clutter-group.c: + * clutter/clutter-rectangle.c: * clutter/clutter-texture.c: - * clutter/json/json-generator.c: - * clutter/json/json-parser.c: Compilation fixes for passing distcheck - * tests/test-grab.c: - * tests/test-score.c: - * tests/test-script.c: - * tests/test-shader.c: - * tests/test-unproject.c: Ditto as above + * clutter/clutter-texture.c: -2007-12-21 Emmanuele Bassi +2008-07-16 Emmanuele Bassi - * clutter/clutter-label.c: - (clutter_label_ensure_layout): Avoid rounding errors in the layout - computing when switching between Clutter units and Pango units. + * ChangeLog: + * clutter.pc.in: -2007-12-19 Øyvind Kolås + 2008-07-16 Emmanuele Bassi - * clutter/clutter-texture.[ch]: (bug #675) added - clutter_texture_set_area_from_rgb_data, sharing some of the - initialization infrastructure with clutter_texture_set_from_rgb_data. +2008-07-14 Neil Roberts -2007-12-20 Emmanuele Bassi + * ChangeLog: + * clutter/cogl/common/cogl-primitives.c: - * clutter/clutter-container.c: - (clutter_container_lower_child): Fix interface method call - to actually call ClutterContainer::lower. (#670, Gwenole - Beauchesne) + * clutter/cogl/common/cogl-primitives.c (cogl_path_rel_curve_to): -2007-12-20 Emmanuele Bassi +2008-07-14 Emmanuele Bassi - * clutter/clutter-label.c: - (clutter_label_query_coords): Return the bounding box set inside - request_coords(), if any; otherwise, return the natural allocation - of the label. (#678, reported by Gwenole Beauchesne) + * ChangeLog: + * clutter/clutter.h: - * tests/test-rotate.c: Align the label + 2008-07-14 Emmanuele Bassi -2007-12-19 Tomas Frydrych +2008-07-14 Tomas Frydrych - * clutter/Makefile.am: - * clutter/cogl/gl/cogl-defines.h.in: - * clutter/pango/pangoclutter-render.c: - * configure.ac: - Fixes to allow cross-compilation with mingw (patch by Neil - Roberts). - Removed trailing whitespace. - -2007-12-18 Øyvind Kolås - - * clutter/clutter-main.c: (generate_enter_leave_events): synthesize - enter event (without related) and corresponding leave event when the - actor the cursor is over has been destroyed. - * clutter/clutter-event.c: (clutter_event_free): only unref the - related_actor when it actually is set. + * ChangeLog: + * clutter/clutter-stage.c: -2007-12-18 Emmanuele Bassi + 2008-07-14 Tomas Frydrych - * clutter/clutter-main.c: - (unset_motion_last_actor), - (generate_enter_leave_events): Attach a callback to the destroy - signal on the last motion actor, so if it goes away while the - pointer is in the middle of it we can unset the pointer. +2008-07-13 Matthew Allum - * clutter/clutter-private.h: Store the last motion actor inside - the global context. + * ChangeLog: + * clutter/x11/clutter-x11-texture-pixmap.c: -2007-12-17 Emmanuele Bassi + 2008-07-13 Matthew Allum - * clutter/clutter-actor.c: - (clutter_actor_should_pick_paint), - (clutter_actor_apply_transform_to_point): Fix the whitespace. +2008-07-13 Neil Roberts - (clutter_actor_set_rotation): Clarify that the coordinates of - the centre of rotation are relative to the anchor point or, - if not set, to the upper left corner of the bounding box. + * ChangeLog: + * build/mingw/mingw-cross-compile.sh: -2007-12-17 Tomas Frydrych + * build/mingw/mingw-cross-compile.sh: Avoid using the --strip - * clutter/clutter-behaviour-ellipse.c: - * clutter/clutter-behaviour-rotate.c: - Clamping of start and end angles to <0, 360). - -2007-12-17 Emmanuele Bassi - - * clutter/clutter-behaviour-path.c: Clarify the equivalence - between the upper and lower bounds of the ClutterAlpha and - the position in the path. (#634) - -2007-12-17 Emmanuele Bassi - - * clutter/clutter-texture.c: Mention the fact that a ClutterTexture - will scale its contents to fit inside the requested bounding - box. (#661) - -2007-12-17 Emmanuele Bassi - - * clutter/clutter-actor.c: Fix documentation for - the ::captured-event signal. (#673) - -2007-12-17 Emmanuele Bassi - - * clutter/clutter-actor.c: Clarify the set_clip() method - documentation, pointing out that the clip area origin is - always the top-left corner of an actor. - -2007-12-15 Emmanuele Bassi - - * clutter/clutter-actor.c: - * clutter/clutter-alpha.h: - * clutter/clutter-event.h: - * clutter/clutter-fixed.[ch]: - * clutter/clutter-model.h: - * clutter/clutter-shader.[ch]: - * clutter/clutter-stage.c: Documentation fixes. - -2007-12-15 Emmanuele Bassi - - * clutter/clutter-model-default.c: - (clutter_model_default_iter_next), - (clutter_model_default_iter_prev): Do not instantiate a new - iterator, and update the passed one instead, as we say we do - in the documentation. This avoid leaking tons of iterators. - - * clutter/clutter-model.[ch]: Update the documentation. - - * tests/test-model.c: Prettify some output. - -2007-12-14 Emmanuele Bassi - - * clutter/clutter-behaviour.c: - (clutter_knot_get_type): Use the I_() macro. - - * clutter/clutter-model.[ch]: Make ClutterModel and ClutterModelIter - abstract classes; also, provide more virtual functions inside the - ClutterModel vtable, to allow subclasses and language bindings to - override the entire ClutterModel using other/native data types - to store the rows. - - * clutter/clutter-model-default.[ch]: ClutterModelDefault is a - default implementation of ClutterModel and ClutterModelIter using - GSequence. - - * clutter/Makefile.am: - * clutter/clutter.h: Build glue for ClutterModelDefault. - - * tests/test-model.c: Update for constructor changes. - - * tests/test-shader.c: Fix a typo. - -2007-12-14 Matthew Allum - - * clutter/cogl/gl/cogl-defines.h.in: - * clutter/cogl/gles/cogl-defines.h: - Add CLUTTER_COGL_HAS_GL/GLES defines - -2007-12-11 Øyvind Kolås - - Refined the ClutterShader API based on a patch from Emmanuele Bassi. - - * clutter/clutter-actor.c: (clutter_actor_paint), - (clutter_actor_apply_shader): queue a redraw of actor when shader is - set. - * clutter/clutter-actor.h: indentation. - * clutter/clutter-shader.[ch]: made the fragment and vertex shader - sources properties. Report error through GError when binding shaders. - * tests/test-shader.c: modified to use newer API. - -2007-12-10 Emmanuele Bassi - - * clutter/clutter-model.c: - (clutter_model_get_sorting_column): Fix wrong type check. - -2007-12-10 Emmanuele Bassi - - * clutter/clutter-model.[ch]: Allow unsorting the model (passing - -1 as the sorting column) - - (clutter_model_iter_get_valist): Do not initialise twice che - return value. - -2007-12-10 Emmanuele Bassi - - * clutter/clutter-model.c (clutter_model_iter_get_value): Initialise - the passed GValue like the other getters do. - -2007-12-10 Emmanuele Bassi - - * clutter/clutter-model.h: - * clutter/clutter-model.c: - (clutter_model_append_value), - (clutter_model_prepend_value), - (clutter_model_insert_value): Add a _value() variant for the - insertion methods, for use of the language bindings. - - (clutter_model_append), - (clutter_model_prepend), - (clutter_model_insert): Do not return a boolean: insertion should - never fail unless for a programming error, in which case we have - plenty of warnings. - -2007-12-10 Emmanuele Bassi - - * clutter/clutter-behaviour-ellipse.c: - (clutter_behaviour_ellipse_get_angle_tilt), - (clutter_behaviour_ellipse_get_angle_tiltx), - (clutter_behaviour_ellipse_set_tilt): Fix a double conversion - that was messing up the returned results. (#665) - -2007-12-10 Emmanuele Bassi - - * clutter/clutter-actor.c: - (clutter_actor_set_property), - (clutter_actor_get_property), - (clutter_actor_class_init): Add the rotation-* properties, - controlling the rotation angle and center on each axis. (#614) - - (parse_rotation_array), (parse_rotation), - (clutter_actor_parse_custom_node), - (clutter_actor_set_custom_property), - (clutter_scriptable_iface_init): Add a new "rotation" custom - property for expressing the rotation along each axis in a - compact way: - - "rotation" : [ - { "x-axis" : [ , [ , ] ] }, - { "y-axis" : [ , [ , ] ] }, - { "z-axis" : [ , [ , ] ] } - ] - - (clutter_geometry_get_type),(clutter_vertex_get_type), - (clutter_actor_box_get_type): Use the I_() macro instead of - directly calling g_intern_static_string(). - - * clutter/clutter-entry.c (clutter_entry_request_coords): - * clutter/clutter-label.c (clutter_label_ensure_layout), - (clutter_label_request_coords): Use CLUTTER_UNITS_FROM_DEVICE() - instead of CLUTTER_UNITS_FROM_INT(), as "device" means "pixels". - - * clutter/clutter-private.h: Add the I_() macro for intern - static strings. - - * tests/test-script.json: Test the newly added "rotation" - custom property. - -2007-12-10 Tomas Frydrych - - * tests/Makefile.am: - Fixed a typo. - -2007-12-10 Tomas Frydrych - - * tests/test-viewport.c: - * tests/Makefile.am: - Added a simple viewport test. - -2007-12-10 Tomas Frydrych - - * clutter/clutter-actor.c: - (_clutter_actor_apply_modelview_transform): - Moved offset translation after rotation so that rotation coords - are also relative to the offset point. - - -2007-12-09 Emmanuele Bassi - - * tests/test-events.c (input_cb): - * tests/test-text.c (main): Fix compiler errors. (#592, - Gwenole Beauchesne) - -2007-12-09 Emmanuele Bassi - - * clutter/clutter-actor.c: Document the values for full - transparency and full opacity in the set_opacity() - method. (#662) - - * clutter/clutter-behaviour-ellipse.c: Improve consistency - in the apidoc. - -2007-12-08 Emmanuele Bassi - - * configure.ac: Make libtool respect the -s switch of make - and be quiet. - -2007-12-07 Emmanuele Bassi - - * clutter/clutter-actor.h: - * clutter/clutter-actor.c: - (clutter_actor_get_sizeu), - (clutter_actor_get_positionu): Add unit-based accessors to - the size and position. - -2007-12-07 Tomas Frydrych - - * clutter/clutter-behaviour-ellipse.c: - (clutter_behaviour_ellipse_set_angle_start): - (clutter_behaviour_ellipse_set_angle_end): - (clutter_behaviour_ellipse_set_angle_tilt): - (clutter_behaviour_ellipse_set_tilt): - Removed strayed degree -> ClutterAngle conversions left over from - API changes. - - (clutter_behaviour_ellipse_set_angle_tiltx): - Removed stray printf. - -2007-12-07 Tomas Frydrych - - * clutter/clutter-behaviour-ellipse.c: - Fixed tilt setters and getters. - -2007-12-06 Tomas Frydrych +2008-07-11 Tomas Frydrych + * ChangeLog: * clutter/clutter-fixed.c: - * clutter/clutter-fixed.h: - (clutter_sqrti): - Added extra iteration to the Newton-Rapson algorithm for arguments - lesser than 342 to improve precission. - -2007-12-06 Emmanuele Bassi - - * clutter/clutter-main.c: - (clutter_set_motion_events_frequency): Never allow the motion - events devlivery frequency to exceed the default frame rate. - -2007-12-06 Emmanuele Bassi - - * clutter/json/json-parser.[ch]: Use gssize, size we allow -1 - as a length (meaning "use the whole string"). - - (json_parser_load_from_data): Use the passed length instead of - using strlen() all the time. - - * clutter/clutter-script.[ch]: Ditto as above. - -2007-12-06 Emmanuele Bassi - - * clutter/pango/pangoclutter-render.c: Hush a compiler warning - by removing a unused variable. - -2007-12-06 Emmanuele Bassi - - * clutter/clutter-label.c (clutter_label_ensure_layout): If the - label has a requested size, force it when ensuring the layout. - -2007-12-06 Emmanuele Bassi - - * tests/test-unproject.c: Fix type comparison. - - * tests/test-score.c: Save the returned ids. - -2007-12-05 Matthew Allum - - reviewed by: - - * clutter/pango/pangoclutter-render.c: (tc_get), (free_glyph_info), - (draw_glyph), (draw_trapezoid), (pango_clutter_render_layout), - (pango_clutter_render_layout_line), - (pango_clutter_render_clear_caches), (prepare_run), (draw_begin): - -2007-12-05 Emmanuele Bassi - - * clutter/clutter-score.h: Rearrange declarations. - - * clutter/clutter-score.c: More documentation in the long - description of the ClutterScore section. - - * clutter/clutter-debug.h: - * clutter/clutter-main.c: Add the CLUTTER_DEBUG_SHADER flag, - for debugging the shader calls. - - * clutter/clutter-feature.h: Fix the documentation of the - feature flags. - - * clutter/Makefile.am: Remove trailing whitespace. - -2007-12-05 Tomas Frydrych - - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - * tests/Makefile.am: - * tests/test-unproject: - (clutter_actor_transform_stage_point): - Added new function for translating stage coordinates into local - actor coordinates. - -2007-12-04 Emmanuele Bassi - - * clutter/clutter-score.c: Better document ClutterScore - and its API. - -2007-12-04 Emmanuele Bassi - - * clutter/clutter-score.[ch]: Reimplement ClutterScore using - a N-ary tree to store the timelines. Remove clutter_score_add(): - the same functionality can be achieved by passing a NULL - parent to clutter_score_append(). - - * tests/test-score.c: Update ClutterScore test unit, and add - debug printouts. - -2007-12-04 Øyvind Kolås - - * clutter/clutter-shader.c: (bind_glsl_shader): use gchar instead of - GLcharARB. - -2007-12-03 Øyvind Kolås - - * clutter/clutter-shader.[ch]: do not include GL.h. - -2007-12-03 Øyvind Kolås - - Support for shaders in clutter. At the moment limited to drivers - providing GLSL support. - - * clutter/cogl/cogl.h: added rather direct binding of needed for glsl - shaders. - * clutter/cogl/gl/cogl-defines.h.in: - * clutter/cogl/gl/cogl.c: - * clutter/cogl/gles/cogl-defines.h: added stubs. - * clutter/cogl/gles/cogl.c: added stubs. - - * clutter/glx/clutter-stage-glx.c: - (clutter_stage_glx_realize): unrelated memory management sanity fix. - (clutter_stage_glx_unrealize): unbind all shaders on stage unrealize. - * clutter/Makefile.am: added clutter-shader.[ch] - * clutter/clutter-actor.[ch]: adding shader capability to - actors. - * clutter/clutter-feature.h: added CLUTTER_FEATURE_SHADERS_GLSL - * clutter/clutter-private.h: added stack of shaders to context. - * clutter/clutter-shader.[ch]: new. - - * tests/Makefile.am: added shader test. - * tests/test-shader.c: (frame_cb), (main): simple shader test, - cycle through the inline shader with right/left mouse buttons. - -2007-12-03 Øyvind Kolås - - * clutter/glx/clutter-stage-glx.c: for extra sanity, set - stage_x11->xvisinfo = NULL after XFree. Makes using the root window - as foreign window possible. - -2007-11-30 Øyvind Kolås - - * clutter/clutter-timeline.c: (clutter_timeline_get_delta): return the - number of milliseconds passed between new-frame events instead of - since new-frame events, thus making sure that the sum of _get_delta's - returned for all new-frame events is equal to total time elapsed. - -2007-11-30 Emmanuele Bassi - - * clutter/clutter-actor.c (parse_units), - (clutter_actor_parse_custom_node): Do not allow using percentages - of the stage on the stage itself, as it makes little to no - sense. + 2008-07-11 Tomas Frydrych - * clutter/clutter-script.c: - (clutter_script_construct_object): Rearrange code. - - * tests/test-script.json: Do not set the size of the stage, to - test for the stage size percentage. - -2007-11-30 Emmanuele Bassi - - * clutter/clutter-model.h: Complete the documentation of - the ClutterModelClass structure members. - -2007-11-30 Emmanuele Bassi - - * clutter/clutter-timeline.h: - * clutter/clutter-timeline.c - (timeline_timeout_func), - (clutter_timeline_get_delta): Add a function for retrieving - the number of frames and the time (in milliseconds) elapsed - since the last timeline ::new-frame signal. This can be useful - for implementing a physics engine or just for knowing how if - and how many frames have been skipped. - -2007-11-30 Emmanuele Bassi - - * clutter/clutter-actor.c (parse_units), - (clutter_actor_parse_custom_node), - (clutter_scriptable_iface_init): Override the parsing code - for the x, y, width and height properties of ClutterActor, - to allow strings with modifiers when defining the position - and/or the dimensions of an actor. Bare integers are assumed - as pixels; floating point values in the [0, 1] interval are - assumed as percentages; strings can have these modifiers: - - - px - pixels - - mm - millimeters - - pt - points (at the current resolution) - - % - percentage of the stage - - * clutter/clutter-units.h: Fix the conversion macros - - * tests/test-script.json: Test the new values. - -2007-11-29 Emmanuele Bassi - - * clutter/clutter-model.[ch]: Slight API change in the constructor - functions for ClutterModel: clutter_model_new() now takes a list - of GType/string pairs for both the column type and the column name. - - (clutter_model_set_n_columns), - (clutter_model_set_names), - (clutter_model_set_types): Subclasses of ClutterModel will be able - to call clutter_model_set_types() and clutter_model_set_names() in - any order, provided that they don't call each function more than - once. - - * tests/test-model.c: Update the test case. - -2007-11-29 Tomas Frydrych - - * clutter/clutter-actor.h: - * clutter/clutter-actor.c: - Converted depth and rotation offsets to ClutterUnit. - - (clutter_actor_set_depthu): - (clutter_actor_get_depthu): - Additional ClutterUnit API. - - (_clutter_actor_apply_modelview_transform): - Use cogl_translatex() in place of cogl_translate(). - -2007-11-29 Emmanuele Bassi - - * *: Add svn:ignore property to every directory, so that - svn status starts being useful. - -2007-11-29 Matthew Allum - - * clutter/clutter-main.c: (generate_enter_leave_events): - Minor formatting tweak. - * configure.ac: - Typo fix from Damien Lespiau (via mailing list) - -2007-11-28 Emmanuele Bassi - - Add more introspection capabilities to the base model class - - * clutter/clutter-model.h: - * clutter/clutter-model.c: - (clutter_model_finalize): Do no leak the column types array. - - (clutter_model_get_n_columns): Function for getting the number - of columns inside a model. - - (clutter_model_set_names): Add API for setting the names of the - columns. - - (clutter_model_get_column_name), - (_model_get_column_type): Add API for getting each column's name, - and the default implementation for ClutterModel. - - (clutter_model_get_column_type), - (_model_get_iter_at_row): Add API for getting each column's type, - and the default implementation for ClutterModel. - - * clutter.symbols: Add ClutterModel and ClutterModelIter symbols, - and keep the symbols file sorted. - -2007-11-28 Tomas Frydrych - - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - (clutter_actor_set_positionu): - (clutter_actor_set_sizeu): - (clutter_actor_get_widthu): - (clutter_actor_get_heightu): - (clutter_actor_set_widthu): - (clutter_actor_set_heightu): - (clutter_actor_get_xu): - (clutter_actor_get_yu): - (clutter_actor_set_xu): - (clutter_actor_set_yu): - Expanded ClutterActor API with new ClutterUnit-base functions. - - * clutter/clutter-stage.c: - * clutter/clutter-stage.h: - (clutter_stage_get_resolution): - (clutter_stage_get_resolutionx): - New function to query stage resolution (floating and fixed point - versions). - - * clutter/clutter-units.h: - (CLUTTER_UNITS_FROM_STAGE_WIDTH_PERCENTAGE): - (CLUTTER_UNITS_FROM_STAGE_HEIGHT_PERCENTAGE): - (CLUTTER_UNITS_FROM_PARENT_WIDTH_PERCENTAGE): - (CLUTTER_UNITS_FROM_PARENT_HEIGHT_PERCENTAGE): - (CLUTTER_UNITS_FROM_MM): - (CLUTTER_UNITS_FROM_MMX): - (CLUTTER_UNITS_FROM_POINTS): - (CLUTTER_UNITS_FROM_POINTSX): - New macros for conversions to ClutterUnits. - - * clutter.symbols: - Added: - ClutterActor anchor_point functions, - clutter_stage_get_resolution functions. - - Removed: - clutter_actor_scale_with_gravity functions. - -2007-11-28 Emmanuele Bassi - - * clutter/clutter-actor.[ch]: Documentation fixes. - -2007-11-28 Emmanuele Bassi - - Remove the layout containers: they will be moved to a - high-level library. - - * clutter/clutter.h: - * clutter/Makefile.am: Remove layout and boxes from the - build. - - * clutter/clutter-layout.[ch]: Remove the ClutterLayout - interface. - - * clutter/clutter-box.[ch]: - * clutter/clutter-hbox.[ch]: - * clutter/clutter-vbox.[ch]: Remove ClutterBox and its - subclasses. - - * clutter/clutter-label.c: Remove ClutterLayout implementation - - * clutter/clutter-script-private.h: - * clutter/clutter-script-parser.c: - * clutter/clutter-script.c: - (clutter_script_parse_node): Remove special parsing for - ClutterMargin and ClutterPadding. - - * clutter/clutter-types.h: Remove ClutterPadding and ClutterMargin. - - * tests/Makefile.am: - * tests/test-boxes.c: Remove the boxes test case. - -2007-11-28 Tomas Frydrych - - * clutter/NEWS: - Started 0.6.0 section with comment on actor anchor point. - - * clutter/clutter/clutter-actor.c: - * clutter/clutter/clutter-actor.h: - * clutter/clutter/clutter-behaviour-scale.c: - * clutter/clutter/clutter-deprecated.h: - (clutter_actor_set_anchor_point): - (clutter_actor_set_anchor_pointu): - (clutter_actor_get_anchor_point): - (clutter_actor_get_anchor_pointu): - (clutter_actor_set_anchor_point_from_gravity): - New anchor point API deprecating old gravity scaling, added - comments on modelview matrix construction to ClutterActor - documentation. - - (clutter_actor_set_scale_with_gravity): - (clutter_actor_set_scale_with_gravityx): - Deprecated; use clutter_actor_set_anchor_point_from_gravity() instead. - -2007-11-28 Emmanuele Bassi - - * clutter/clutter-effect.[ch]: Add clutter_effect_template_construct() - function, for language bindings that need to set the alpha function - but cannot call the clutter_effect_template_new() ctor themselves. - -2007-11-27 Tomas Frydrych - - * clutter/clutter-behaviour-ellipse.c: - * clutter/clutter-behaviour-ellipse.h: - (clutter_behaviour_ellipse_get_angle_startx): - (clutter_behaviour_ellipse_set_angle_startx): - (clutter_behaviour_ellipse_get_angle_endx): - (clutter_behaviour_ellipse_set_angle_endx): - (clutter_behaviour_ellipse_get_angle_tiltx): - (clutter_behaviour_ellipse_set_angle_tiltx): - Changed to take and return angles in degrees represented as - ClutterFixed. - -2007-11-27 Emmanuele Bassi - - * clutter/clutter-actor.c (clutter_actor_destroy): Remove the - reference we hold on the actor, as it was preventing the finalization - of every child on the stage. - -2007-11-26 Emmanuele Bassi - - * clutter/x11/clutter-stage-x11.c: - (clutter_stage_x11_set_cursor_visible): Restore the XFixes usage, - as it now seems to be have been fixed. - -2007-11-26 Emmanuele Bassi - - * clutter/clutter-actor.c: - (clutter_actor_real_show), - (clutter_actor_real_hide): Do not set the MAPPED flag on the actor - if it is a top-level one (like ClutterStage); the backends are - responsible for setting that flag, as it might be the result of an - asynchronous operation (e.g. on X11). - - * clutter/eglnative/clutter-stage-egl.c: - (clutter_stage_egl_show), - (clutter_stage_egl_hide): Set/unset the CLUTTER_ACTOR_MAPPED flag - on show and hide respectively. - - * clutter/osx/clutter-stage-osx.c: - (clutter_stage_osx_show), - (clutter_stage_osx_hide): Ditto as above. - - * clutter/sdl/clutter-stage-sdl.c: - (clutter_stage_sdl_show), - (clutter_stage_sdl_hide): Ditto as above, plus chain up to the - parent class show/hide virtual functions. - - * clutter/x11/clutter-event-x11.c (event_translate): Use the MapNotify - and UnmapNotify events to call the X11 stage map/unmap functions. - - * clutter/x11/clutter-stage-x11.[ch]: - (clutter_stage_x11_set_fullscreen): Set the fullscreen_on_map flag - with the fullscreen value. - - (clutter_stage_x11_map), (clutter_stage_x11_unmap): Set the MAPPED - flag on the stage actor and redraw; also, if the fullscreen_on_map - flag was set, call clutter_stage_fullscreen() as well. (#648) - - * tests/Makefile.am: - * tests/test-fullscreen.c: Add a fullscreen test case for checking - whether fullscreen works on every backend/platform. - -2007-11-23 Emmanuele Bassi - - * clutter/clutter-actor.c: - (clutter_actor_real_request_coords), - (clutter_actor_request_coords), - (clutter_actor_class_init): Provide a default ::request_coords() - implementation in ClutterActor and use it to store the bounding - box passed to clutter_actor_request_coords(). This makes the code - more reliable and clean, and avoids a call to the subclass - request_coords() method if the bounding box did not change. Now, - every class overriding ClutterActor::request_coords() *must* chain - up to the parent class method or the bounding box will not be - saved inside the ClutterActor structure. - - * clutter/clutter-entry.c: - * clutter/clutter-group.c: - * clutter/clutter-hbox.c: - * clutter/clutter-label.c: - * clutter/clutter-texture.c: - * clutter/clutter-vbox.c: Chain up to the parent class - request_coords() method. - -2007-11-23 Emmanuele Bassi - - * clutter/clutter-event.h: Add more documentation. - -2007-11-23 Emmanuele Bassi - - * tests/test-event.c: Back out an accidental commit. - -2007-11-23 Emmanuele Bassi - - * clutter/clutter-actor.c: - * clutter/clutter-alpha.c: - * clutter/clutter-effect.c: - * clutter/clutter-event.c: - * clutter/clutter-event.h: - * clutter/clutter-group.h: - * clutter/clutter-model.c:, - * clutter/clutter-script.c: - * clutter/clutter-scriptable.h: - * clutter/clutter-stage.c: Documentation fixes. - - * clutter/clutter-score.c: Fix implementation. - -2007-11-23 Emmanuele Bassi - - * clutter/x11/clutter-stage-x11.c: Chain up the hide and show - to the parent's implementation. - -2007-11-23 Emmanuele Bassi - - * clutter/clutter-effect.[ch]: Update the effects API to remove - the start value for most of them. - - (clutter_effect_move): Make it a simple "move from current - position to new coordinates" effect. - - (clutter_effect_path): Rename from clutter_effect_move(). - - (clutter_effect_rotate): Sync up with the new actor rotation API. - - * tests/test-effects.c: Regression test for the effects. - - * tests/Makefile.am: Build glue for test-effects - - * tests/test-behave.c: Emulate a full ramp by using a looping - timeline changing its direction when reaching the last frame. - -2007-11-23 Emmanuele Bassi - - * clutter/clutter-actor.c (clutter_actor_destroy): Bail out - if clutter_actor_destroy() was called on the stage: the stage - is not for the user to destroy. - - * clutter/x11/clutter-backend-x11.c: - * clutter/eglnative/clutter-backend-egl.c: - * clutter/sdl/clutter-backend-sdl.c: - * clutter/osx/clutter-backend-osx.c: Unset the top-level private - flag on the stage when disposing it, so the backends can safely - call clutter_actor_destroy(). - - * clutter/clutter-private.h: Tweak the private flags accessors, - to avoid the typecheck. - -2007-11-22 Emmanuele Bassi - - * clutter/clutter-label.c (clutter_label_new_full): Set the - terminating NULL which was removed when applying patch for - fixing #606. (#645, Gwenole Beauchesne) - -2007-11-22 Øyvind Kolås - - * clutter/clutter-actor.c: mended a couple of typos in documentation. - -2007-11-21 Matthew Allum - - * clutter/cogl/gles/cogl.c: (cogl_fog_set): - Minor fixes for fog on GLES. - -2007-11-21 Emmanuele Bassi - - * clutter/cogl/cogl.h: Add cogl_fog_set() abstracting the - glFog() functions and enabling the GL_FOG flag. - - * clutter/cogl/gl/cogl.c: Add GL implementation of cogl_fog_set(). - - * clutter/cogl/gles/cogl.c: Add GL/ES implementation of - cogl_fog_set(). - - * clutter.symbols: Add new symbols. - - * clutter/clutter-stage.h: Add API to enable depth cueing on - the stage using a linear GL fog, and to set the parameters - for it (#637). - - * clutter/clutter-stage.c (clutter_stage_paint): Enable the - GL fog if the ClutterStage:use-fog property is true. - - * tests/test-depth.c: Test the new stage API. - -2007-11-20 Øyvind Kolås - - * clutter/clutter-main.c: (event_click_count_generate): generalized - click_count generation code. - * tests/test-events.c: (input_cb): extended test to report click_count - for release and scroll events as well as press events. +2008-07-11 Tomas Frydrych -2007-11-20 Øyvind Kolås + * ChangeLog: + * clutter/clutter-fixed.c: - * clutter/clutter-main.c: (clutter_do_event): avoid computing source - of events if it is already set (for synthetic events.) - * clutter/clutter-event.c: Add more information to the documentation - of clutter_event_put. + 2008-07-11 Tomas Frydrych -2007-11-20 Emmanuele Bassi - - * README: Add diff example command lines for submitting patches. - -2007-11-20 Emmanuele Bassi - - * clutter/clutter-actor.c:: - * clutter/clutter-behaviour-opacity.c: - * clutter/clutter-clone-texture.c: - * clutter/clutter-effect.c: - * clutter/clutter-label.c: Remove the usage of G_PARAM_CONSTRUCT - without an override for the ::construct virtual function; using - G_PARAM_CONSTRUCT to set the default value of a property is not - the recommended approach; default values are set inside the - instance init function. - -2007-11-20 Emmanuele Bassi - - * clutter/clutter-texture.c (clutter_texture_init): Set filter-quality - value to 1, to fix the regression caused when applying the patch for - buf #616. - -2007-11-19 Emmanuele Bassi - - * clutter/clutter-label.[ch]: Fix ClutterLabel size allocation when - no bounding box has been provided, and store the box set by the - user so that it can be reused when recomputing the layout. (#600) - - (clutter_label_class_init), - (clutter_label_init): Set the :wrap property default to FALSE. - - * clutter/clutter-units.h: Add ClutterUnit-to-PangoUnit conversion - macro. - - * tests/test-rotate.c: Fix string. - -2007-11-19 Emmanuele Bassi - - * clutter/clutter-behaviour-bspline.c: - * clutter/clutter-behaviour-depth.c: - * clutter/clutter-behaviour-ellipse.c: - * clutter/clutter-behaviour-opacity.c: - * clutter/clutter-behaviour-path.c: - * clutter/clutter-behaviour-rotate.c: - * clutter/clutter-behaviour-scale.c: Fix gtk-doc short description. - -2007-11-19 Emmanuele Bassi - - * clutter.symbols: Update - - * clutter/clutter-actor.h: Rename the angle argument for - set_rotationx() to avoid gtk-doc complaining - - * clutter/clutter-main.h: - * clutter/clutter-main.c: - (clutter_set_motion_events_enabled): Rename for consistency - - (clutter_get_motion_events_frequency), - (clutter_set_motion_events_frequency): Add accessors for the default - motion events deliver frequency. - - (clutter_do_event): Throttle down motion events delivery using the - motion events frequency setting, to avoid excessive redraws. (#608) - - (clutter_context_get_default): Enable per-actor motion events, at - least for now. - - * tests/test-events.c (red_button_cb): - * tests/test-grab.c (green_press_cb): Update. - -2007-11-19 Emmanuele Bassi - - * clutter/clutter-timeline.c (timeline_timeout_func): Do not emit the - ::new-frame signal twice for the last frame. (#531) - -2007-11-19 Øyvind Kolås - - * clutter/clutter-actor.[ch]: (clutter_actor_set_rotationx), - (clutter_actor_set_rotation): swapped axis and angle around, - the new argument order is: (axis, angle, x, y, z). Also removed - deprecated rotation functions from header. - - Updated use of clutter_actor_set_rotation? in the following files: - - * clutter/clutter-behaviour-rotate.c: - * clutter/clutter-effect.c: - * tests/test-actors.c: - * tests/test-project.c: - -2007-11-19 Emmanuele Bassi - - * clutter/clutter-label.[ch]: Constify the color argument - for the ClutterLabel ctor. (#604) - -2007-11-18 Matthew Allum - - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - * clutter/clutter-group.c: - * clutter/clutter-main.c: - * clutter/clutter-stage.c: - * tests/test-events.c: - Parent Actors no longer need to be set reactive for reactive - children to get events. Also makes groups now pickable. - (#597, #423) - - * clutter/clutter-texture.c: - Handle case when 1x1 tiled texture is created, - falling 'back' to being non tiled. (#596) - - * clutter/eglx/clutter-backend-egl.c: - Call EglTerminate on backend shutdown. - -2007-11-18 Emmanuele Bassi - - * clutter.pc.in: Bump up glib-2.0 dependency. - -2007-11-18 Emmanuele Bassi - - * clutter/clutter-model.c: Add gtk-doc section for - ClutterModelIter - - * clutter/clutter-script.h: Fix argument name. - - * clutter/x11/clutter-x11.h: - * clutter/x11/clutter-event-x11.c: - * clutter/x11/clutter-backend-x11.c: Document functions and - types. - -2007-11-18 Emmanuele Bassi - - * clutter.symbols: Update exported symbols. - - * clutter/clutter-actor.[ch]: Remove clutter_actor_rotate_* - and clutter_actor_get_rx* and provide a simpler rotation API: - clutter_actor_set_rotation() and clutter_actor_get_rotation(). - - * clutter/clutter-deprecated.h: Deprecate the old rotation API. - - * clutter/clutter-behaviour-bspline.c: - * clutter/clutter-behaviour-rotate.c: - * clutter/clutter-effect.c: Update internal usage of the - rotation API. - - * tests/test-project.c: Ditto as above. - -2007-11-17 Emmanuele Bassi - - Optimise Atoms usage in the X11 and X11-based backends. - - * clutter/x11/clutter-backend-x11.c: - (clutter_backend_x11_post_parse): Call XInternAtoms() here and - get all the atoms from X in one call. - - * clutter/x11/clutter-backend-x11.h: Store all the atoms inside - the ClutterBackendX11 structure. - - * clutter/x11/clutter-event-x11.c: - (xembed_send_message), (xembed_set_info), - (_clutter_backend_x11_events_init), - (set_user_time), (handle_wm_protocols_event), - (handle_xembed_event), (event_translate): Do not cache atoms - or call XInternAtom() directly, and use the atoms off the X11 - backend structure instead. - - * clutter/x11/clutter-stage-x11.c: - (send_wmspec_change_state), (clutter_stage_x11_set_wm_protocols), - (clutter_stage_x11_set_fullscreen), - (clutter_stage_x11_set_title): Ditto as above. - - * clutter/x11/clutter-stage-x11.h: Update the set_wm_protocols() - method to take the X11 stage implementation. - - * clutter/glx/clutter-stage-glx.c: - (clutter_stage_glx_realize): Update for the set_wm_protocols() - change. - - * tests/test-project.c: (main): Test clutter_stage_set_title(). - -2007-11-17 Emmanuele Bassi - - * configure.ac: Depend on GLib >= 2.14 because of ClutterModel - usage of GSequence. - -2007-11-16 Øyvind Kolås - - * clutter/clutter-main.c: (emit_event): renamed from deliver_event, - (emit_pointer_event): utility function to emit pointer event signals - (which takes pointer grab into account). - (emit_keyboard_event): utility function to emit keyboard event signals - (which takes keyboard grab into account). - (clutter_do_event): use the above utility functions, also reindented - the source. - -2007-11-16 Øyvind Kolås - - * tests/test-grab.c: (main): fix use of clutter_actor_set_reactive - -2007-11-15 Øyvind Kolås - - * clutter/clutter-main.[ch]: added clutter_grab_keyboard, - clutter_ungrab_keyboard and clutter_get_keyboard_grab, in - clutter_do_event deliver keyboard related events only to the - actor with the keyboard grab if a grab exists. - * clutter/clutter-private.h: added keyboard_grab_actor to context. - * tests/test-grab.c: added testing for testing the keyboard grab. - -2007-11-15 Emmanuele Bassi - - * clutter/clutter-texture.c: - (clutter_texture_request_coords), (clutter_texture_class_init), - (clutter_texture_init): Unset :sync-size if explicitly setting - the texture size. (#616) - -2007-11-15 Emmanuele Bassi - - * clutter/clutter-actor.[ch]: Massive API clean-ups. Initial - fixes for bugs #614 and #628. - - * clutter/clutter-main.c: - * clutter/clutter-stage.c: Update internal usage of the actor - API. - - * tests/test-events.c: Update test suite. - -2007-11-15 Øyvind Kolås - - * clutter/clutter-main.c: (generate_enter_leave_events), - (clutter_do_event): moved the generation of enter/leave events - to a utility function. - -2007-11-15 Neil J. Patel - - * clutter/clutter-model.c: - Added some more examples to the documentation, plus explained how the - iters work internally. - -2007-11-15 Øyvind Kolås - - * clutter/clutter-main.[ch]: added clutter_grab_pointer, - clutter_ungrab_pointer and clutter_get_pointer_grab, in - clutter_do_event deliver pointer related events only to the - actor with the pointer grab if a grab exists. - * clutter/clutter-private.h: added pointer_grab_actor to context. - * tests/Makefile.am: - * tests/test-grab.c: added test for testing the pointer grab. - -2007-11-15 Emmanuele Bassi - - * clutter/clutter-timeline.[ch]: Add ClutterTimeline:direction - property, defining the direction (forward or backward) of the - timeline. - - * tests/test-timeline.c: Test the direction property. - - * clutter.symbols: Update exported symbols - -2007-11-15 Emmanuele Bassi - - * clutter/clutter-effect.h: - * clutter/clutter-effect.c: - (clutter_effect_template_new_for_duration): Add a simple constructor - for implicitly creating a ClutterTimeline with a given duration. - -2007-11-15 Emmanuele Bassi - - * clutter.symbols: Update with the new public symbols - - * clutter/clutter-script.h: - * clutter/clutter-script-private.h: - * clutter/clutter-script.c: - (parse_signals), (json_object_end), - (signal_info_free), (object_info_free): Parse the "signals" - member for GObjects. - - (clutter_script_connect_signals), - (clutter_script_connect_signals_full): Add new API for autoconnecting - signal handlers using the UI definition files. - - * tests/test-script.c: - * tests/test-script.json: Test signal autoconnection. - -2007-11-15 Matthew Allum - - * clutter/Makefile.am: - * clutter/eglx/Makefile.am: - * clutter/eglx/clutter-backend-egl.c: - * clutter/eglx/clutter-backend-egl.h: - * clutter/eglx/clutter-eglx.h: - * clutter/eglx/clutter-event-egl.c: - * clutter/eglx/clutter-stage-egl.c: - * clutter/eglx/clutter-stage-egl.h: - * clutter/glx/Makefile.am: - * clutter/glx/clutter-backend-glx.c: - * clutter/glx/clutter-backend-glx.h: - * clutter/glx/clutter-event-glx.c: - * clutter/glx/clutter-glx.h: - * clutter/glx/clutter-stage-glx.c: - * clutter/glx/clutter-stage-glx.h: - * clutter/x11/Makefile.am: - * clutter/x11/clutter-backend-x11-private.h: - * clutter/x11/clutter-backend-x11.c: - * clutter/x11/clutter-backend-x11.h: - * clutter/x11/clutter-event-x11.c: - * clutter/x11/clutter-stage-x11.c: - * clutter/x11/clutter-stage-x11.h: - * clutter/x11/clutter-x11.h: - Create a new X11 backend class of which EGL and GLX 'real' backends - then subclass. Effectively shares all X11 code between both backends - avoids code duplication and brings many missing features to EGL X - backend. Requires some cleanup and testing. (#518) - - * clutter/cogl/gles/cogl.c: (cogl_color): - Add define to use color4ub only if configure finds it. - If not fall back to old code. - - * configure.ac: - Drop support for vincent checks. - Drop sdles backend. - Specifically check for color4ub call. - -2007-11-15 Neil J. Patel - - * clutter/Makefile.am: - * clutter/clutter-model.c: - * clutter/clutter-model.h: - * clutter/clutter.h: - * tests/Makefile.am: - * tests/test-model.c: - Merged ClutterModel, which closes #443. - -2007-11-14 Emmanuele Bassi - - * clutter/clutter-clone-texture.c (set_parent_texture): Hide the - clone texture only if it was visible, and show it again if we - are adding a visible texture. - - * tests/test-script.json: Test the CloneTexture actor. - -2007-11-14 Emmanuele Bassi - - * clutter/clutter-actor.[ch]: Rename clutter_actor_get_id() to - clutter_actor_get_gid(). - - (clutter_actor_set_parent): Use GUINT_TO_POINTER(). - - * clutter/clutter-deprecated.h: Add a replacement warning for - clutter_actor_get_id(). - - * clutter/clutter-texture.c (texture_upload_data): Use - clutter_actor_get_gid(), and don't leak the filename string. - -2007-11-14 Emmanuele Bassi - - * clutter/clutter-scriptable.[ch]: Rename ::set_name and ::get_name - to ::set_id and ::get_id, to avoid potential confusion with the - ClutterActor:name property. - - * clutter/clutter-script.h: - * clutter/clutter-script.c (clutter_script_construct_object): Use - clutter_scriptable_set_id(). - - (clutter_get_script_id): Add a public function to retrieve the ID - used in the UI definition files from an object. - - * clutter/clutter-actor.c: Do not set the name of the actor with - the ID set in the UI definition files. - - * tests/test-script.c: Test clutter_get_script_id(). - - * clutter.symbols: Update with the new symbols. - -2007-11-14 Emmanuele Bassi - - * clutter/cutter-deprecated.h: Don't let everyone know from where - we have stolen^Wtaken inspiration for the deprecation warnings. - -2007-11-13 Øyvind Kolås - - * clutter/clutter-behaviour-bspline.[ch]: - Replaced clutter_behaviour_bspline_append with - clutter_behaviour_bspline_append_knots. Fixes bug #582. - * clutter/clutter-deprecated.h: added deprecation macro reflecting the - API change. - -2007-11-13 Øyvind Kolås - - * clutter/Makefile.am: - * clutter/clutter.h: include clutter-deprecated.h - * clutter/clutter-deprecated.h: added file containing macros that - provides more meaningful errors when compiling clutter using code that - uses deprecated functions. - -2007-11-13 Øyvind Kolås - - Renamed all properties of behaviours (and related - functions/variables/parameters) - to match the pattern something-start, something-end. Fixes bug #577. - - * clutter/clutter-behaviour-depth.c: - * clutter/clutter-behaviour-depth.h: - * clutter/clutter-behaviour-ellipse.c: - * clutter/clutter-behaviour-ellipse.h: - * clutter/clutter-behaviour-path.c: - * clutter/clutter-behaviour-rotate.c: - * clutter/clutter-behaviour-rotate.h: - * clutter/clutter-behaviour-scale.c: - * clutter/clutter-behaviour-scale.h: - * clutter/clutter-effect.c: - * clutter/clutter-effect.h: - * clutter/clutter-script.c: - * tests/test-depth.c: - * tests/test-script.c: - -2007-11-06 Øyvind Kolås - - * clutter/clutter-event.h: made ClutterEventAny have a source field, - rearanged other structs to have source in the same position. - * clutter/clutter-event.c: (clutter_event_get_source): modified to use - the any event. - (clutter_event_free): removed unused variable. - * clutter/clutter-main.c: (deliver_event), (clutter_do_event): reduced - amount of code. As well as deliver button-release events to the stage. - -2007-11-08 Rob Bradford - - * clutter/glx/clutter-glx.h: - Include needed for the definition of XVisualInfo. - -2007-11-08 Rob Bradford - - * clutter/cogl/gles/cogl.c: (cogl_color): - Switch over to using glColor4ub in the GLES backend. It's available in - the header file but missing in the reference manual. - -2007-11-07 Emmanuele Bassi - - * clutter/clutter-actor.[ch]: Fix the declaration of the - class handlers for the ::captured-event, ::enter-event and - ::leave-event signals; the function signatures were missing - the return value the signals marshallers were expecting, and - their names weren't respecting the convention for event-related - signals. - -2007-11-06 Tomas Frydrych - - * clutter/clutter-fixed.h: - Added CLUTTER_SQRTI_ARG_MAX, CLUTTER_SQRTI_5_PERCENT, - CLUTTER_SQRTI_10_PERCENT expressing clutter_sqrti limits. - Stripped trailing whitespace. - - * clutter/clutter-fixed.c: - (clutter_sqrti): - Updated documentation, stripped trailing whitespace. - - * clutter/clutter-behaviour-path.c: - (node_distance): - Use clib sqrt if clutter_sqrti() precission would be worse than - 10%. - Stripped trailing whitespace. - -2007-11-06 Emmanuele Bassi - - * clutter/clutter-layout.h: Add commodity macros to test for - a specific layout flag in one line. - -2007-11-06 Emmanuele Bassi - - * clutter/clutter-box.c (clutter_box_dispose): Call unparent() - on the children, instead of destroy(), to avoid a double free - and a crash when destroying a ClutterBox. - -2007-11-06 Emmanuele Bassi - - * clutter/clutter-label.c: Break the references in ::dispose, - and free the resources in ::finalize. - -2007-11-05 Øyvind Kolås - - * clutter/clutter-container.[ch]: removed find_child_by_id method - from interface (and all implementations of it) since this - functionality is now implemented using a global hash. - * clutter/clutter-box.c: - * clutter/clutter-group.c: - -2007-11-01 Emmanuele Bassi - - * clutter/clutter-script.c: Do not keep ownership of the - pixbufs we load. - -2007-10-31 Øyvind Kolås - - * clutter/clutter-main.c: (_clutter_do_pick): disable dithering - when painting in pick mode. - -2007-10-31 Matthew Allum - - * clutter/clutter-score.c: - Various minor improvements to ClutterScore. - -2007-10-30 Emmanuele Bassi - - * clutter/clutter-layout.c: Fix documentation, with regards to - the containers handling of the children implementing the - ClutterLayout interface. - -2007-10-29 Emmanuele Bassi - - * configure.ac: - * clutter/cogl/gl/cogl-defines.h.in: The OS X backend has a funny - OpenGL header location, so it basically did break every application - including clutter/cogl.h because the GL header inclusion depended - on symbols defined into Clutter's config.h. Now, we define the - GL header into the configure template and use it to create the - cogl-defines.h file cogl.h includes. - -2007-10-29 Emmanuele Bassi - - * clutter/json/json-parser.c: Enable parsing of negative numbers; - GScanner splits negative numbers into two tokens, so we need to - special case them. - -2007-10-29 Emmanuele Bassi - - * clutter/clutter-script.c: Add the :filename and :filename-set - properties, to retrieve the path of the currently parsed file (if - :filename-set is TRUE) from the ClutterScriptable implementations. - -2007-10-28 Matthew Allum - - * clutter/clutter-effect.c: - Small doc fix (#584) - -2007-10-27 Emmanuele Bassi - - * clutter/json/json-parser.c: - (json_scanner_msg_handler): Set the GError to be returned by - the parsing functions into the GScanner error message handler. - - (json_parser_object): Return the symbol token in case we have - a parse error after the member name. - - (json_parser_load_from_data): Propagate the error set in the - message handler, if any. - - * clutter/json/json-node.c (json_node_free): Unref the objects - only if are set, to avoid a couple of needless criticals we - get on error. - - * tests/test-script.json: More properties. - -2007-10-27 Emmanuele Bassi - - * clutter/clutter-script.[ch]: Slight API change in the - clutter_script_get_objects() function: now it takes - object name/object return location pairs and returns the - number of objects found and returned. - - * tests/test-script.c: Exercise the clutter_script_get_objects() - function. - -2007-10-27 Emmanuele Bassi - - * clutter/clutter-rectangle.c (clutter_rectangle_paint): Use - CGL_ENABLE_BLEND flag instead of CGL_BLEND value. (#580, - Gwenole Beauchesne) - -2007-10-27 Emmanuele Bassi - - * clutter/clutter-color.c (clutter_color_to_string): Update the - documentation for the format of the returned string, and remove - the note: now clutter_color_parse() can parse the string this - function returns. - -2007-10-27 Emmanuele Bassi - - * clutter/pango/pangoclutter-render.c: Last usage of guint - replaced with COGLuint. (Tommi Komulainen) - -2007-10-26 Matthew Allum - - * clutter/clutter-texture.c: - * clutter/cogl/cogl.h: - * clutter/cogl/gl/cogl-defines.h: - * clutter/cogl/gles/cogl-defines.h: - * clutter/cogl/gl/cogl.c: - * clutter/cogl/gles/cogl.c: - Switch from use of guint to COGLuint. Avoids problems when - guint != GLuint on some platforms, i.e OSX. - (Tommi Komulainen, #525, #523) - - * clutter/Makefile.am: - * clutter/osx/Makefile.am: - * clutter/osx/clutter-backend-osx.c: - * clutter/osx/clutter-backend-osx.h: - * clutter/osx/clutter-event-osx.c: - * clutter/osx/clutter-osx.h: - * clutter/osx/clutter-stage-osx.c: - * clutter/osx/clutter-stage-osx.h: - * configure.ac: - Add initial Cocoa/OSX Backend (by Tommi Komulainen, see #526) - -2007-10-26 Emmanuele Bassi - - * clutter/clutter-entry.c: Add a :x-align property for aligning - the text in the entry, in case the actor is wider than the - text it shows. - -2007-10-26 Emmanuele Bassi - - * clutter/clutter-main.c: Add a --clutter-default-fps run-time - switch and CLUTTER_DEFAULT_FPS environment variable support for - setting the default frame-rate at run-time. - -2007-10-26 Emmanuele Bassi - - * clutter/clutter-script.h: - * clutter/clutter-script.c: Add a ::get_type_from_name() virtual - function for bindings to override. The current implementation - calls g_type_from_name() and our lazy class resolver. - - * clutter.symbols: Update. - - * doc/reference/clutter-sections.txt: Update. - -2007-10-25 Emmanuele Bassi - - * clutter/clutter-behaviour-path.c: Reverse the list of - parsed knots, to preserve the real ordering after prepending - them (thanks to Øyvind for spotting this). - - * clutter/clutter-behaviour-bspline.c: Ditto as above. - -2007-10-25 Emmanuele Bassi - - * clutter/clutter-script-parser.c: Unset the GValue when - getting a ClutterUnit from a JSON node. - -2007-10-25 Emmanuele Bassi - - * clutter/clutter-behaviour-bspline.c: Implement the - ClutterScriptableIface to parse the custom "knots" property. - -2007-10-25 Emmanuele Bassi - - * tests/test-script.c: - * tests/test-script.json: Rejig the test case and add a - path behaviour to test the knot parsing code. - -2007-10-25 Emmanuele Bassi - - * clutter/cogl/cogl.h: Do not include . - -2007-10-25 Emmanuele Bassi - - * clutter/clutter-behaviour-path.c: Implement the - ClutterScriptableIface to parse the custom "knots" property. - -2007-10-25 Emmanuele Bassi - - * clutter/clutter-texture.c (clutter_texture_set_property): Do - not try to set NULL pixbufs. - -2007-10-25 Emmanuele Bassi - - * clutter/clutter-actor.c: Implement part of the ClutterScriptable - interface, using the ClutterActor API to set and get the name - of an actor. - - (clutter_geometry_copy), (clutter_geometry_free): Use - the slice allocator to avoid fragmentation when setting - properties and emitting signals (that is: when packing - boxed types into GValues). - - (clutter_actor_box_copy), (clutter_actor_box_free), - (clutter_vertex_copy), (clutter_vertex_free): Ditto. - - * clutter/clutter-actor.h: - * clutter/clutter-actor.c: - (clutter_actor_push_transform_child), - (clutter_actor_pop_transfomr_child): Simple wrappers around - COGL API, which avoid including clutter/cogl.h when writing - container actors outside Clutter. - -2007-10-25 Emmanuele Bassi - - * clutter/Makefile.am: - * clutter/clutter.h: - * clutter/clutter-scriptable.[ch]: Add the ClutterScriptable - interface; by implementing this interface, a class can - override the UI definition parsing and transform complex data - types into GObject properties, or allow custom properties. - - * clutter/clutter-script.c: - * clutter/clutter-script-parser.c: - * clutter/clutter-script-private.h: Rearrange the code and - use the ClutterScriptable interface to parse and build the - custom properties. This cleans up the code and also it makes - it more reliable (the complex type parsing is now done using - the target type and not just the name of the property). - -2007-10-25 Emmanuele Bassi - - * clutter/clutter-json.h: Header for including the JSON - parsing and data types. - - * clutter/json/json-types.h: Add JSON_NODE_VALUE_TYPE() macro. - - * clutter/json/Makefile.am: Install the JSON headers into a - private location. This might change in the future, and might - also cause collisions if you're using JSON-GLib and Clutter - at the same time, so be warned. - -2007-10-22 Emmanuele Bassi - - * clutter/clutter-label.c (clutter_label_request_coords): If - we get a size requisition, and we have ellipsization active, - check if we are getting less space than what the layout needs - and recompute the width. - -2007-10-22 Emmanuele Bassi - - * clutter/clutter-color.c (clutter_color_to_string): Change - the print format to "%02x%02x%02x%02x" because we use guint8 - for each component, not guint16. - -2007-10-19 Emmanuele Bassi - - * clutter/clutter-entry.c (clutter_entry_paint): Fixed off by - one error. (#566, Gwenole Beauchesne) - -2007-10-18 Øyvind Kolås - - * clutter/clutter-timeline.c: (clutter_timeline_set_duration): - rearranged arithemetic to allow specifying duration with sub second - precision (also enables durations smaller than one second). - -2007-10-18 Emmanuele Bassi - - * clutter/clutter-script-private.h: - * clutter/clutter-script.h: - * clutter/clutter-script.c: Allow id-less objects: as long - as they have a "type" member, a unique id will be provided. - - (json_object_end): Add merge id to the object information - structure. - - (apply_behaviours), (add_children): Keep the unresolved - objects around. - - (construct_stage), (clutter_script_construct_object): If an - object has unresolved children or behaviours try resolving - them when we ask for it. - - (json_parse_end), (clutter_script_ensure_objects): Ensure - that the objects are fully constructed as best as we can when - finished parsing. - - (object_info_free), (remove_by_merge_id): - (clutter_script_unmerge_objects): Remove objects under the - same merge id returned by the loading functions. (Fixes - bug #558) - - * test/test-script.c: - * test/test-script.json: Test unresolved merging and unmerging - in ClutterScript. - -2007-10-18 Matthew Allum - - * clutter/clutter-score.c: - * clutter/clutter-score.h: - * tests/test-score.c: - Implement more ClutterScore functionality. - -2007-10-17 Emmanuele Bassi - - * clutter/clutter-actor.c: - (clutter_actor_set_property), (clutter_actor_get_property), - (clutter_actor_class_init): Add the :reactive property, to - control reactiveness using the UI definition files. - - (clutter_actor_reparent): Do not assume the parent is a - ClutterContainer, and call the container API only if needed. - - (clutter_actor_destroy): Remove from the parent if needed, - just like the documentation says. - -2007-10-16 Øyvind Kolås - - * clutter/pango/pangoclutter-render.c: (tc_get): Provide for blank - rows/columns of pixels between adjecant glyphs in the texture cache to - avoid bilinear interpolation spillage at edges of glyphs. - -2007-10-16 Øyvind Kolås - - * clutter/clutter-main.c: (clutter_do_event): allow motion events - only delivered to stage to be caught in the capture phase as well - as the bubbling phase. - -2007-10-16 Emmanuele Bassi - - * clutter/json/json-object.c: Automatically transform every - delimiter into an underscore. - - * clutter/clutter-script.c: Implement the "parent_texture" - property translation for ClutterCloneTextures, using the - passed id of the parent texture. - -2007-10-16 Emmanuele Bassi - - * clutter/clutter-timeline.[ch]: Added ClutterTimeline:duration, - a property for setting the duration of a timeline in milliseconds. - The property comes with accessors and a new constructor. The - frame rate used is the default value. - - * clutter/clutter-private.h: - * clutter/clutter-main.[ch]: Add clutter_get_default_frame_rate() - and clutter_set_default_frame_rate(); these two functions control - the default frame rate to be used when creating timelines. Currently - is set to 60 frames-per-second. - -2007-10-16 Tomas Frydrych - - * build/msvc_2k5: - Added MSVC project files. - -2007-10-16 Emmanuele bassi - - * clutter/clutter-color.c: Copy the alpha when shading. - -2007-10-16 Tomas Frydrych - - * clutter.symbols: - Added a bunch of missing symbols. - - * clutter/clutter-script.c: - * json/json-node.c: - Use g_slice_new0 instead of g_slice_new to avoid passing - garbage to functions. - - * tests/test-threads.c: - Replaced non-portable sleep() with g_usleep(). - -2007-10-15 Tomas Frydrych - - * clutter/cogl/gl/cogl-defines.h: - * clutter/cogl/gl/cogl.c: - Fixup GL include for windows. - -2007-10-15 Matthew Allum - - * clutter/clutter-actor.c: - More events documentation. - - * clutter/clutter-event.c: - * clutter/clutter-event.h: - Add synthetic flag and make put_event use it - (via modded patch from pippin) - - * clutter/clutter-main.c: (clutter_do_event): - dont use put event anymore when pushing enter/leave events. - -2007-10-15 Emmanuele Bassi - - * clutter/pango/Makefile.am: Compile with the debug flags, if - set. - -2007-10-12 Emmanuele Bassi - - * clutter.symbols: Remove non-public symbols. - -2007-10-12 Tomas Frydrych - - * clutter.symbols: - A list of public symbols, one per line; semi-autogenerated, so - might not be complete -- PLEASE when adding new public APIs, add - the function name to this file. - -2007-10-12 Emmanuele Bassi - - * clutter/clutter-actor.c: Add a :depth property, so we can - set the initial depth of an actor inside the UI definition - files. - -2007-10-12 Tomas Frydrych - - * tests/test-actors.c: - When using MSVC, define _USE_MATH_DEFINES before including - math.h, otherwise constants like M_PI will not be defined. - -2007-10-12 Emmanuele Bassi - - * clutter/clutter-script.c (construct_timline), - (parse_member_to_property): Transfer ownership of the - implicit timelines to the behaviour, so that they get - unreferenced when the behaviour is destroyed. - - (parse_member_to_property): Reverse the list of children - and behaviours. - -2007-10-12 Tomas Frydrych - - Portability fixes: - - * clutter/clutter-private.h: - Bracket #include "unistd.h" with #ifdef HAVE_UNISTD_H - - * clutter/clutter-fixed.c: - Use "", not <> for inclusion of local files. - - (clutter_sqrtx): forward declare local variables. - - * clutter/clutter-debug.h: - Added non-gcc (c99) implementation of variadic debug macros for - when not compiling with gcc. - - * clutter/pango/pangoclutter-render.c: - Fixed some strange uses of CLUTTER_NOTE() + stripped trailing - whitespace. - -2007-10-12 Tomas Frydrych - - * clutter/clutter-actor.c: - * clutter/clutter-backend.c: - * clutter/clutter-behaviour-depth.c: - * clutter/clutter-box.c: - * clutter/clutter-clone-texture.c: - * clutter/clutter-container.c: - * clutter/clutter-entry.c: - * clutter/clutter-feature.c: - * clutter/clutter-fixed.c: - * clutter/clutter-group.c: - * clutter/clutter-hbox.c: - * clutter/clutter-label.c: - * clutter/clutter-layout.c: - * clutter/clutter-media.c: - * clutter/clutter-rectangle.c: - * clutter/clutter-score.c: - * clutter/clutter-script.c: - * clutter/clutter-stage.c: - * clutter/clutter-texture.c: - * clutter/clutter-timeline.c: - * clutter/clutter-timeout-pool.c: - * clutter/clutter-vbox.c: - * clutter/cogl/gl/cogl.c: - * clutter/cogl/gles/cogl.c: - * clutter/eglnative/clutter-backend-egl.c: - * clutter/eglnative/clutter-event-egl.c: - * clutter/eglnative/clutter-stage-egl.c: - * clutter/eglx/clutter-backend-egl.c: - * clutter/eglx/clutter-event-egl.c: - * clutter/eglx/clutter-stage-egl.c: - * clutter/glx/clutter-event-glx.c: - * clutter/json/json-array.c: - * clutter/json/json-generator.c: - * clutter/json/json-node.c: - * clutter/json/json-object.c: - * clutter/json/json-parser.c: - * clutter/sdl/clutter-backend-sdl.c: - * clutter/sdl/clutter-event-sdl.c: - * clutter/sdl/clutter-stage-sdl.c: - - Fixedup config.h inclusion (must always be bracketed with #ifdef - HAVE_CONFIG_H). - -2007-10-11 Tomas Frydrych - - * clutter/clutter-entry.c: - Avoid using C++ reserverd words to name variables. - -2007-10-11 Øyvind Kolås - - Improve the quality of text when the scale it is shown at screen is - smaller than the original, seems to work well down to about a scale - of 50%. - - * clutter/pango/pangoclutter-fontmap.c: - (pango_clutter_font_map_default_substitute): turn off hinting. - * clutter/pango/pangoclutter-render.c: request linear filtering - instead of nearest neighbour when scaling down. - * tests/test-text.c: replaced test with a a test that renders a sample - grid with various pixel sizes and scales for visual inspection of - text rendering quality. - -2007-10-10 Emmanuele Bassi - - * clutter/glx/clutter-backend-glx.c: Fix documentation of the - filter function API. - - * clutter/clutter-score.c: - * clutter/clutter-effect.c: - * clutter/clutter-actor.c: Documentation fixes. - - * clutter/clutter-actor.h: Automatically typecast to ClutterActor - when setting/checking flags. - -2007-10-10 Emmanuele Bassi - - * clutter/clutter-actor.c: Beautify the ClutterActor documentation. - -2007-10-10 Emmanuele Bassi - - * clutter/clutter-actor.c: Remove the ::event-after signal: - three event layers to connect to seems a bit overkill. - - (clutter_actor_event): Return FALSE, not TRUE by default, - as g_signal_emit() will change the return value if no - handlers are connected - - * clutter/clutter-stage.c: Emit ::notify when we change - the fullscreen property. - - * clutter/clutter-script.c: Add more documentation for the - definition format and keywords. - - (translate_property): Collapse the G_TYPE_ENUM and G_TYPE_FLAGS - cases into one, to simplify the code. - - * tests/test-script.c: Test enumeration conversion by using - a value different from the default. - -2007-10-10 Matthew Allum - - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - * clutter/clutter-event.c: - * clutter/clutter-main.c: - * tests/test-events.c: - Add basic W3 DOM event 'capture' like functionality. - -2007-10-10 Emmanuele Bassi - - * clutter/clutter-script-private.h: - * clutter/clutter-script.c: Parse flags like we parse enums. - -2007-10-10 Emmanuele Bassi - - * clutter/json/json-types.h: - * clutter/json/json-array.c: - * clutter/json/json-object.c: Resync with the upstream copy - of JSON-GLib; add json_object_remove_member() and - json_array_remove_element() and fix the g_hash_table_get_keys() - replacement for GLib 2.12. - - * clutter/clutter-script.c: Clean up the complex properties - parsing code. - -2007-10-10 Emmanuele Bassi - - * clutter/clutter-script.c (json_object_end): Add "type_func" - to the list of attributes we skip. - -2007-10-10 Emmanuele Bassi - - * clutter/json/json-parser.c: Use the commodity JsonNode API - and accept bare values as root nodes. - - * clutter/clutter-script-private.h: - * clutter/clutter-script.c: Unreference the created objects - only if they are top-levels, like ClutterBehaviour and - ClutterTimelines. Actors have floating references, so we - just transfer ownership to their containers, and the stage - is owned by the backend. Add the "type_func" key to the - object definition, so the user can supply its own GType - function if the class name doesn't follow the GObject rules. - Document the ClutterScript public API. - -2007-10-10 Matthew Allum - - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - Add missing enter/leave event signals - - * clutter/clutter-main.c: (clutter_do_event): - Set time in crossing events. - Protect against do_pick() failing. - -2007-10-09 Emmanuele Bassi - - * clutter/clutter-script.c (resolve_alpha_func): Fix the - ClutterAlphaFunc resolution function. - -2007-10-09 Emmanuele Bassi - - * tests/Makefile.am: - * tests/test-script.c: - * tests/test-script.json: Move part of the UI definition into - its own file and exercise clutter_script_load_from_file(). - -2007-10-09 Emmanuele Bassi - - * clutter/clutter-script.c (clutter_script_get_object): Construct - the requested object if it hasn't been already. This allows - referencing objects within the same snippet. - - * tests/test-script.c: Declare a timeline and use it inside - multiple behaviours; apply multiple behaviours to various - actors, then retrieve the timeline to start it when the test - runs. - -2007-10-09 Emmanuele Bassi - - * clutter/clutter-script-private.h: - * clutter/clutter-script.c: Allow applying behaviours directly - inside the UI definition data. - - * tests/test-script.c: Test the "behaviours" member. - -2007-10-09 Rob Bradford - - * clutter/eglnative/clutter-backend-egl.c: - (clutter_backend_egl_dispose): - Call eglTerminate() on the display when the backend is disposed of. - - * clutter/eglnative/clutter-stage-egl.c: - (clutter_stage_egl_realize): - Don't use the createNativeWindow() call, it's not generic EGL. - -2007-10-09 Emmanuele Bassi - - * clutter/clutter-script-private.h: - * clutter/clutter-script.h: - * clutter/clutter-script.c: Add licensing information to - the newly added files. - - * clutter/clutter-script.c: Support creating behaviours with - ClutterScript. ClutterAlpha objects are implicit, but - timelines can be both explicit objects using their id or - implicit objects. Make the property resolution and translation - more robust. Support the pixbuf property. - - * tests/test-script.c: Test the newly added features. - - * docs/reference/clutter-docs.sgml: - * docs/reference/clutter-sections.txt: Add ClutterScript. - -2007-10-09 Emmanuele Bassi - - * clutter/clutter-fixed.h: Add deprecation guards around - CLUTTER_FIXED_INT(). - -2007-10-08 Emmanuele Bassi - - * clutter/clutter-script.c: Parse ClutterMargin and ClutterPadding - properties from arrays or integers (assume pixels). - -2007-10-08 Emmanuele Bassi - - * clutter/clutter-script-private.h: - * clutter/clutter-script.c: Allow defining childrens for every - container actor inside the UI definition files. - -2007-10-08 Matthew Allum - - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - * clutter/clutter-private.h: - * clutter/clutter-main.c: - Add a hash to global clutter context mapping all parented actor - id's to actors. - Add clutter_get_actor_by_id() call. - Convert picking machinery to use above. - (performance/simpler composite actor creation) - - * clutter/clutter-stage.c: (clutter_stage_fullscreen), - (clutter_stage_unfullscreen), (clutter_stage_event): - Only set the fullscreen property on stage state fullscreen event(#545) - Experimental as could be painful to implement on non X backends. - -2007-10-08 Emmanuele Bassi - - * clutter/clutter-script.c (json_parse_end): - * clutter/json/json-object.c (json_object_get_members): Replace - the GLib 2.14 API with the equivalent code for GLib < 2.14. - - * configure.ac: Revert the dependency bump. - -2007-10-08 Emmanuele Bassi - - Initial implementation of the UI definition files. (#424) - - * clutter/json/Makefile.am: - * clutter/json/*.[ch]: In-tree copy of JSON-GLib, a GLib-based - JSON parser/generator library. We use it in-tree because we might - need to change the API. Ideally, we'd depend on it. - - * clutter/clutter.h: - * clutter/clutter-script-private.h: - * clutter/clutter-script.[ch]: ClutterScript, the scenegraph - generator class. It parses JSON streams in form of buffers and - files and builds the scene. - - * clutter/clutter-debug.h: - * clutter/clutter-main.c: Add a "script" debug flag - - * clutter/Makefile.am: Build glue. - - * tests/Makefile.am: - * tests/test-script.c: Add a test case for the ClutterScript. - - * configure.ac: Depend on GLib 2.14, so we can use the - g_hash_table_get_key() and g_hash_table_get_values() functions - for the time being; we can probably reimplement those, but we - are going to need 2.14 anyway if we are going to implement a - list model using GSequence. - -2007-10-08 Emmanuele Bassi - - * tests/test-behave.c: Use the right return type for the - event callbacks. - -2007-10-03 Matthew Allum - - * clutter/clutter-actor.c: - * clutter/clutter-event.c: - * clutter/clutter-event.h: - * clutter/clutter-main.c: - * clutter/clutter-private.h: - * clutter/eglnative/clutter-event-egl.c: - * clutter/eglx/clutter-event-egl.c: - * clutter/glx/clutter-event-glx.c: - * clutter/sdl/clutter-event-sdl.c: - Remove seperate double/triple click events and replace with - a click_count member. - Move calculating click counts from backend to do_event() - Initial implementation of ENTER/LEAVE events. - - * tests/test-events.c: - Add code to test above. - - * tests/test-behave.c: - Sync with newer API. - - * clutter/clutter-score.c: - Silence a warning. - -2007-10-01 Emmanuele Bassi - - * clutter/clutter-fixed.h: Add CLUTTER_FIXED_TO_INT() and - deprecate CLUTTER_FIXED_INT(), for symmetry with - CLUTTER_FIXED_FROM_INT(). - - * clutter/clutter-alpha.c: - * clutter/clutter-behaviour-depth.c: - * clutter/clutter-behaviour-ellipse.c: - * clutter/clutter-behaviour-path.c: - * clutter/clutter-fixed.h: Use CLUTTER_FIXED_TO_INT(). - -2007-10-01 Emmanuele Bassi - - * clutter/clutter-actor.c (clutter_actor_get_size): Implement - get_size() as a wrapper around clutter_actor_query_coords() - instead of calling g_object_get() twice. - - (clutter_actor_init): Initialise the box in one call. - -2007-10-01 Emmanuele Bassi - - * clutter/clutter-actor.[ch]: Remove the ::event-after signal - class handler, as it's not meant to be overridden by sub-classes. - - (clutter_actor_class_init): - Make every event-related signal return a boolean: return TRUE - in a signal handler to block the emission. The value is accumulated - automatically by the signal API. - - (clutter_actor_event): If ::event returns TRUE, skip to emitting - ::event-after. Return the value accumulated by the signal emission - chain. - - * clutter/clutter-private.h: Rename _clutter_boolean_accumlator(). - - * clutter/clutter-main.c (clutter_do_event): If clutter_actor_event() - returns TRUE then stop the event emission chain from child to parent. - - * clutter/clutter-stage.c (clutter_stage_event): Behave like - clutter_actor_event(). - - (clutter_stage_get_key_focus), - (clutter_stage_set_key_focus): Avoid a nasty circular reference - issue: if the actor passed to set_key_focus is NULL then the stage - has the key focus. - - * tests/test-events.c: Update the events test with the API - changes. - -2007-10-01 Tomas Frydrych - - * clutter/clutter-actor.c: - (clutter_actor_set_scale_with_gravityx): - Use CLUTTER_QMUL for better precission (#532, patch by Gwenole - Beauchesne). - - * clutter/clutter-color.c: - (clutter_color_to_hlsx): - Added missing CLUTTER_INT_TO_FIXED conversion (#544, patch by Neil - Roberts). - -2007-10-01 Neil J. Patel - - Patch by: Tommi Komulainen - - * clutter/clutter-entry.c: (clutter_entry_delete_text): - Fix characters vs. bytes inconsistency (#520). - -2007-09-30 Matthew Allum - - * clutter/clutter-event.h: - Removed unused POINTER_ENTER and POINTER_LEAVE states. (#546) - * clutter/clutter-stage.c: (clutter_stage_fullscreen), - (clutter_stage_unfullscreen): - Only Change fullscreen prop if the backend implements fullscreen - methods. (#545) - -2007-09-28 Øyvind Kolås - - * clutter/clutter-container.[ch]: added - clutter_container_find_child_by_name. - -2007-09-28 Øyvind Kolås - - * clutter/glx/clutter-stage-glx.c: (clutter_stage_glx_realize): - removed unused variable perspective. - * tests/test-events.c: (main): added CLUTTER_STAGE() cast. - * tests/test-threads.c: include unistd.h for sleep(). - -2007-09-28 Øyvind Kolås - - * clutter/clutter-label.c: (clutter_label_ensure_layout): avoid - calling pango_layout_set_text|markup before we've got any text. - -2007-09-27 Matthew Allum - - * tests/test-scale.c: - Fix out of about array addressing (#522, Tommi Komulainen) - -2007-09-27 Matthew Allum - - * clutter/clutter-clone-texture.c: - * clutter/clutter-rectangle.c: - Include "config.h" in all c files (#524, Tommi Komulainen) - -2007-09-27 Matthew Allum - - Merge from stable. - - * clutter/clutter-behaviour-path.c: (path_alpha_to_position) - Fix uninitialized variable (#480, Gwenole Beauchesne) - -2007-09-27 Matthew Allum - - * clutter/clutter-event.c: - * clutter/clutter-event.h: - * clutter/clutter-main.c: - Further event tweaks; - - Ref the event actor source - - Protect against off stage events (button releases) (#511) - - Move more into ClutterEventAny - - Add a click count to button event (as yet unused) - - Minor cleanups - - * clutter/clutter-actor.c: - Make scale x/y a property. - - * clutter/clutter-private.h: - Remove _clutter_actor_apply_modelview* - - * clutter/eglx/clutter-backend-egl.c: - Warning cleanup - - * clutter/eglx/clutter-stage-egl.c: - * clutter/glx/clutter-stage-glx.c: - * clutter/sdl/clutter-stage-sdl.c: - Avoid setting viewport directly, but set sync flag. - - * clutter/pango/pangoclutter-render.c: (draw_glyph): - Minor cleanups. - - * clutter/Makefile.am: - * tests/Makefile.am: - * tests/test-score.c - * clutter/clutter.h: - * clutter/clutter-score.h: - * clutter/clutter-score.c: - Add very initial (broken) ClutterScore implementation. - -2007-09-25 Ross Burton - - Merge from stable. - - * clutter/clutter-group.c: - Optimise sort_z_order. - -2007-09-17 Emmanuele Bassi - - Merge from stable - - * clutter/eglnative/clutter-event-egl.c: - Flag every device click after the first as motion events - instead of button presses. (#505, Shreyas Srinivasan) - -2007-09-10 Matthew Allum - - Port from stable branch. - - * clutter/eglnative/clutter-event-egl.c: (clutter_event_dispatch): - Only declare tsevent if we have tslib (#498, Robert Bragg) - -2007-09-06 Emmanuele Bassi - - * clutter/clutter-stage.c: Remove stray include - in ClutterStage: the code requesting it was moved in the backends. - -2007-08-31 Emmanuele Bassi - - * clutter/clutter-rectangle.c: Fix the border drawing: do not - overdraw the rectangle on the border and fix the check for - different border colour. (#488, Neil Roberts) - -2007-08-29 Matthew Allum - - * clutter/clutter-effect.c: (clutter_effect_template_set_property): - Add missing break statement. Whoops. - -2007-08-29 Matthew Allum - - * clutter/clutter-main.c: (_clutter_do_pick): - Call glFinish before reading pixels - * clutter/eglx/clutter-stage-egl.c: (clutter_stage_egl_realize): - Add missing read surface in making context current. - Above fixes via Kate Alhola. - - * clutter/glx/clutter-glx.h: - Add missing filter funcs so there actually exported - -2007-08-24 Matthew Allum - - * clutter/clutter-actor.c: - * clutter/clutter-event.h: - * clutter/clutter-main.c: - * clutter/clutter-stage.c: - * clutter/clutter-stage.h: - * clutter/glx/clutter-backend-glx.c: - * clutter/glx/clutter-backend-glx.h: - * clutter/glx/clutter-event-glx.c: - * clutter/glx/clutter-stage-glx.c: - * clutter/glx/clutter-stage-glx.h: - Add initial support for stage state events. - Fix fullscreening for an already mapped stage. - - * tests/test-events.c: - Print out info from the above. Blue button now toggles - fullscreen. - - * clutter/clutter-effect.c: - * clutter/clutter-effect.h: - Add a setting for templates to ref or clone underlying - timelines. (As to improve sync issues like those in foofone) - - * tests/test-timeline.c: - Also add completed signals. - - * clutter/cogl/gles/cogl.c: (cogl_texture_image_2d): - * configure.ac: - Forward port from stable branch. RGB Image fixes gles - and check for lower case libgles_cm. - - -2007-08-24 Tomas Frydrych - - * clutter/clutter-actor.c: - (_clutter_actor_apply_modelview_transform): - - Fixed rotation around x axis (bug 486). - -2007-08-23 Emmanuele Bassi - - * clutter/clutter-private.h: - * clutter/clutter-event.c: Revert the event queue ordering - commit. - - * clutter/eglx/clutter-event-egl.c: - * clutter/glx/clutter-event-glx.c: - * clutter/sdl/clutter-event-sdl.c: Update backends. - -2007-08-22 Tomas Frydrych - - * clutter/clutter-behaviour-rotate.c: - * clutter/clutter-behaviour-ellipse.c: - - Fixed CCW rotation in rotate behaviour (bug 483); fixed overall - path length calculation for angles > 360 in rotate and ellipse. - -2007-08-22 Emmanuele Bassi - - * clutter/clutter-main.c (clutter_threads_dispatch_free): Remove - the main threads locking calls: the main loop might remove the - source while dispatching it, so whether or not we are already - holding the lock is unpredictable for the library. Leave a comment - with the relevant bug number in GNOME's Bugzilla and wait for a - fix in GLib. - -2007-08-21 Emmanuele Bassi - - * clutter/clutter-event.c: Correctly initialise the state - variables used to detect multiple clicks. - - (clutter_event_get_coords): Return the coordinates for - CLUTTER_3BUTTON_PRESS events. - - (clutter_events_pending): Check from the tail of the queue backward, - like we do in clutter_event_get() and clutter_event_peek(). - -2007-08-21 Emmanuele Bassi - - Preserve the ordering of the events in the queue when sythesising - new events in the event translation sequence. (#481) - - * clutter/clutter-event.c: - * clutter/clutter-private.h: Allow flagging new events on the - events queue without breaking ClutterEvent using a masked type. - - (clutter_event_get), (clutter_event_put), - (clutter_event_pending): Ignore events with the CLUTTER_EVENT_PENDING - flag set when walking the events queue. - - * clutter/eglx/clutter-event-egl.c: - * clutter/glx/clutter-event-glx.c: - * clutter/sdl/clutter-event-sdl.c: Push the new events straight - on the queue, with the CLUTTER_EVENT_PENDING flag set; remove the - flag if the event translation was succesful, or remove the event - altogether. - -2007-08-21 Emmanuele Bassi - - * clutter/clutter-stage.c: Add missing documentation for the - ClutterStage properties. - -2007-08-21 Tomas Frydrych - - * clutter/clutter-fixed.c: - (clutter_sqrti): - - Fixes for 64-bit platforms; use of SSE builtin when available - (bugs 478, 479, patches by Gwenole Beauchesne). - -2007-08-20 Emmanuele Bassi - - * clutter/Makefile.am: - * clutter/clutter-enum-types.h.in: - * clutter/clutter-enum-types.c.in: Use template files for - glib-mkenums; this makes the Makefile template a bit more - clean and the enum types generation more customisable (e.g. - when GLib 2.14 has been released, we can use g_once_init_enter() - and g_once_init_leave() to have thread-safe GType functions - for the enum types as well). - -2007-08-20 Emmanuele Bassi - - * clutter/clutter-version.h.in: Fix CLUTTER_CHECK_VERSION() - macro to accept micro versions. (#477, Neil Roberts) - -2007-08-19 Emmanuele Bassi - - Various timeline related changes. - - * clutter/clutter-timeout-pool.c: Use g_list_insert_sorted() to - fix a timeout pool reversal happening with our homegrown - sorted insertion function. (see #470) - - * tests/Makefile.am: - * tests/test-timeline.c: Add a ClutterTimeline test suite, for - finding regressions in the behaviour of the timelines. (#470, - Rob Bradford) - - * clutter/clutter-main.c (clutter_do_event): Use an EVENT note, - not a SCHEDULER one; SCHEDULER is for timelines and idle sources - only. - - * clutter/clutter-version.h.in: Protect the bare numbers of - the version components. - - * clutter/clutter-effect.c: Do not unref the ClutterAlpha, as - the ownership is already of the behaviour used by the effect - closure. - - * clutter/clutter-timeline.c: Emit the ::new-frame signal only - if the timeline is still active - - Always advance at least of one frame. (#471, Rob Bradford) - - Do not rewind the timeline if the user paused it in the ::new-frame - signal handler: either the user has already done it with - clutter_timeline_stop() or it's not what he's expecting if he - called clutter_timeline_pause(). (#372, Johan Bilien) - - If we skipped the last frame before emitting the ::complete - signal, emit ::new-frame with the last frame. - - Do not call clutter_timeline_stop() at the end of a non-looping - timeline, as it emits the ::pause signal as well. Also, rewind the - timeline *after* emitting ::complete, so that calling - clutter_timeline_get_current_frame() in a signal handler still - works. - -2007-08-19 Matthew Allum - - * clutter/eglx/clutter-event-egl.c: (clutter_event_dispatch): - Fix clutter_thread typo (Kate Alhola) - -2007-08-18 Emmanuele Bassi - - * clutter/clutter-effect.c: - * clutter/clutter-main.c: Update the Since: tag for the - backported API. - - * clutter/clutter-behaviour-rotate.c: Fix a typo in the get_center() - method. (#468, Neil Roberts) - - Freeze and thaw the notification queue when changing multiple - properties in the same method. Fix some coding style issues. - -2007-08-15 Emmanuele Bassi - - * clutter/clutter-actor.c: Add checks for the "reactive" flag - accessors. - -2007-08-15 Emmanuele Bassi - - * clutter/clutter-effect.[ch]: Add clutter_effect_depth(), a - simple wrapper around ClutterBehaviourDepth. (#464, Ali Sabil) - -2007-08-15 Emmanuele Bassi - - * clutter/clutter-alpha.c (clutter_smoothstep_inc): Use the - correct type for parameters, to avoid overflow (Ali Sabil). - - * clutter/clutter-behaviour-opacity.c: Use the right format - when printing the unsigned alpha value and opacity to the - debug output. - -2007-08-14 Emmanuele Bassi - - * clutter/clutter-container.[ch]: - * clutter/clutter-actor.c: - * clutter/clutter-group.c: Rename clutter_container_raise() to - clutter_container_raise_child(), and clutter_container_lower() - to clutter_container_lower_child() to avoid clashing with - ClutterActor raise() and lower() respectively. - -2007-08-13 Matthew Allum - - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - * clutter/clutter-event.c: - * clutter/clutter-event.h: - * clutter/clutter-main.c: - * clutter/clutter-main.h: - * clutter/clutter-private.h: - * clutter/clutter-stage.c: - * clutter/clutter-stage.h: - * clutter/clutter-types.h: - Initial implementation of actors emmitting event signals (423); - - Actors set_reactive() to receive mouse events. - (call clutter_enable_motion_events() for per action motion events) - - clutter_stage_set_key_focus () to direct key events. - - Events bubble up to parents (ending at stage) - (original source identified by clutter_event_get_source()) - TODO: - - enter/leave notifys for actors. - - stage specific events - fullscreen - - grabs - - * tests/test-events.c: - Extend a little to use new API - - * clutter/cogl/gl/cogl.c: - * clutter/glx/clutter-backend-glx.c: - Move get_proc_address into cogl and out of backend. - (shaders will need it) - - * clutter/clutter-group.c: (clutter_group_real_lower): - Fix a minor compile warning. - - * TODO: - Sync up. - -2007-08-13 Emmanuele Bassi - - * clutter/clutter-container.[ch]: Add find_child_by_id(), - raise(), lower() and sort_depth_order() virtual functions to - ClutterContainer. - - * clutter/clutter-group.[ch]: Deprecate the redundant calls - from ClutterGroup, and make ClutterGroup implement them as part - of the ClutterContainer interface implementation. - - * clutter/clutter-box.c: Implement the newly added ClutterContainer - methods; now clutter_stage_get_actor_at_pos() works with boxes - as well as groups. - - * clutter/clutter-stage.c: - * clutter/clutter-actor.c: Replace calls to ClutterGroup functions - with ClutterContainer ones. - -2007-08-12 Emmanuele Bassi - - * clutter/clutter-timeout-pool.c: Fix removing and adding timeouts - to the timeout pool during a dispatch of a timeout source already - inside the pool. (#456, based on a patch by Neil Roberts) - - (clutter_timeout_dispatch), (clutter_timeout_pool_dispatch): Hold - the main Clutter lock in the pool dispatch function, instead of - the per-timeout dispatch; this guarantees that the ref+unref of - the single timeouts are done under the main lock. - -2007-08-12 Matthew Allum - - * clutter/clutter-texture.c: (texture_upload_data): - Align texture data correctly for edge tiles. - (#422 - Neil Roberts) - -2007-08-11 Matthew Allum - - * clutter/clutter-texture.c: - Fix typo in clutter_texture_get_pixbuf (#458, Neil Roberts). - Use take_object when getting pixbuf prop to avoid ref leak. (Neil - Roberts) - -2007-08-09 Emmanuele Bassi - - * clutter/clutter-box.c: Rename a variable to fix a compiler - warning. - -2007-08-08 Emmanuele Bassi - - * clutter/clutter-behaviour-ellipse: - (clutter_behaviour_ellipse_get_tiltx): Remove useless - "Return" in the API documentation. - -2007-08-08 Emmanuele Bassi - - * clutter/clutter-timeout-pool.c: Fix sorting of the pool - when inserting and removing timeout sources. (#449, Neil - Roberts) - -2007-08-08 Emmanuele Bassi - - * clutter/clutter-main.c (clutter_get_timestamp): Remove - the microseconds remainder, which is mostly useless. (#447) - -2007-08-08 Emmanuele Bassi - - * clutter/clutter-main.c (clutter_get_timestamp): Return the - correct number of microseconds (#447, Neil Roberts) - -2007-08-08 Emmanuele Bassi - - Merge the clutter.git/threading branch. - - * clutter/clutter-main.c: - * clutter/clutter-main.h: - * clutter/clutter-private.h: Add threading locking and unlocking - functions, to mark a critical section and access the Clutter API - from differen threads. Add an initialisation function and a function - to override the default lock aquisition and release functions, for - bindings and application-specific locking handling. Add MT-safe - versions of g_idle_add() and g_timeout_add() which will call the - functions under the main Clutter lock and without races. The - Clutter thread-safe implementation is basically the same used by - GDK, so the same caveats apply. - - * clutter/clutter-actor.c: - * clutter/clutter-timeline.c: - * clutter/clutter-timeout-pool.c: Use the new threading API when - invoking idle and timeouts. - - * clutter/eglnative/clutter-event-egl.c: - * clutter/eglx/clutter-event-egl.c: - * clutter/glx/clutter-event-glx.c: - * clutter/sdl/clutter-event-sdl.c: Acquire and release the main - Clutter lock when preparing, checking and dispatching the events - on the queue in every backend. - - * tests/Makefile.am: - * tests/test-threads.c: Add a test case, showing how to use the - threading API and write thread-safe Clutter applications. - -2007-08-08 Emmanuele Bassi - - * configure.ac: Bump up to 0.5.0 and start the new development - branch. - -2007-08-07 Emmanuele Bassi - - * configure.ac: Bump up to 0.4.0. - -2007-08-07 Emmanuele Bassi - - * clutter/clutter-entry.c: - * clutter/clutter-fixed.c: - * clutter/pango/pangoclutter.h: Small fixes for passing the - distcheck phase with extra-strict compiler flags. - -2007-08-07 Emmanuele Bassi - - * clutter/clutter-actor.h: - * clutter/clutter-alpha.h: - * clutter/clutter-behaviour-ellipse.[ch]: - * clutter/clutter-behaviour-path.h: - * clutter/clutter-behaviour-rotate.c: - * clutter/clutter-behaviour.h: - * clutter/clutter-box.h: - * clutter/clutter-color.h: - * clutter/clutter-container.h: - * clutter/clutter-effect.h: - * clutter/clutter-entry.h: - * clutter/clutter-fixed.h: - * clutter/clutter-layout.h: - * clutter/clutter-main.h: - * clutter/clutter-stage.h: - * clutter/clutter-texture.h: - * clutter/clutter-units.h: - * clutter/clutter-version.h.in: - * clutter/glx/clutter-glx.h: Documentation additions and - various fixes. - -2007-08-07 Matthew Allum - - * clutter/clutter-behaviour-ellipse.c: - Add a documentation note regarding ellipse setting - the applied actors position. - -2007-08-07 Matthew Allum - - * NEWS: - * README: - More updates ready for 0.4.0 - -2007-08-07 Matthew Allum - - * clutter/clutter-fixed.c: - * clutter/clutter-fixed.h: - Add documentation. - - * clutter/cogl/gl/cogl.c: (cogl_perspective): - Remove CFX_* shortened macros - -2007-08-06 Emmanuele Bassi - - * clutter/clutter-main.[ch]: Remove clutter_threads_enter() - and clutter_threads_leave(); both are no-ops and they just - confuse things. The thread-awareness in Clutter is planned - for 0.4.1/0.5.0. - - * README: - * NEWS: Update. - -2007-08-06 Emmanuele Bassi - - * clutter/clutter-box.[ch]: Implement margin, color and default - padding for ClutterBox. Provide API to pack a child by specifying - every packing detail or just pack with the defaults. ClutterBox - works like the HTML boxing model, API-wise: a box with margins - and padding around each child. Needs work, still. - - * clutter/clutter-hbox.c: - * clutter/clutter-vbox.c: Update with the new API and new attributes. - - * clutter/clutter-types.h: Add ClutterMargin and ClutterPadding. - - * test/test-boxes.c: Exercise the new API. - -2007-08-06 Matthew Allum - - * clutter/clutter-texture.c: - Correct set pixbuf property as GDK_TYPE_PIXBUF - (fix via Neil Roberts) - -2007-08-06 Matthew Allum - - * clutter/clutter-behaviour-depth.c: - Modify to work like all other behvaiours in not forcing - increasing order in behaviour 'limits'. (#436) - Rename limit min/max props to start/end. - - * tests/test-depth.c: - Simplify test-case to work with above change and - without multiple ramps - - * clutter/clutter-behaviour-rotate.c: - Handle CW rotation when end > start and similar for CCW just - like ellipse behaviour. - -2007-08-05 Matthew Allum - - * README: - * clutter/clutter-actor.c: - Document show/hide_all behaviour correctly. - -2007-08-05 Emmanuele Bassi - - * clutter/clutter-behaviour-depth.c: Fix typo in the description. - -2007-08-04 Emmanuele Bassi - - * clutter/clutter-behaviour-depth.c: Clarify the depth behaviour - even more in the description used by the API reference. - -2007-08-04 Emmanuele Bassi - - * clutter/clutter-behaviour-depth.[ch]: Clarify that what drives - the movement along the Z axis is the ClutterAlpha object (we - don't have the luxury of a rollover like the opacity does); - so, if you want to go from 0 to -100 you have to use a - decreasing function, just as well if you want to go from 100 - to 0. Using a min-depth of 100 and a max-depth of 0 and an - increasing function is undefined behaviour. - - * tests/Makefile.am: - * tests/test-depth.c: Add a test case for the depth behaviour. - -2007-08-04 Emmanuele Bassi - - * clutter/clutter-actor.c (clutter_actor_set_opacity): Queue - a redraw when setting the opacity of an actor. - -2007-08-03 Emmanuele Bassi - - * clutter/clutter-behaviour-ellipse.c: - (clutter_behaviour_ellipse_get_angle_tilt): Avoid recursion - by fixing a typo. - - (clutter_behaviour_ellipse_get_angle_begin), - (clutter_behaviour_ellipse_get_angle_end): Correct the angles - here too. - -2007-08-03 Emmanuele Bassi - - * clutter/clutter-behaviour-ellipse.c: - (clutter_behaviour_ellipse_get_property): Do not forget to - correct the angles when returning them. - -2007-08-03 Tomas Frydrych - - * clutter/clutter-behaviour-ellipse.c: - * clutter/clutter-behaviour-ellipse.h: - (clutter_behaviour_ellipse_new): - (clutter_behaviour_ellipse_newx): - - Added direction parameter; made behaviour to respect direction - parameter; unclumped angle_begin and angle_end values. - -2007-08-02 Matthew Allum - - * NEWS: - * README: - Initial updating ready for release. - -2007-08-02 Emmanuele Bassi - - * clutter/eglnative/clutter-backend-egl.c: - * clutter/eglx/clutter-backend-egl.c: - * clutter/sdl/clutter-backend-sdl.c: Set the default resolution - as 96.0 dpi for every backend (we already were under this - assumption anyway, and this makes it easier to change this - setting per-backend). - - * clutter/pango/pangoclutter-fontmap.c: - * clutter/pango/pangoclutter.h: Allow setting the resolution - for the PangoClutterFontMap object and provide the implementation - for the PangoFcFontMap::get_resolution() virtual function. This - allows to set the resolution of the PangoContext when retrieving - it. - - * clutter/clutter-label.c (clutter_label_init): Set the - resolution of the font map with the one the backend gives us. - - * clutter/clutter-entry.c (clutter_entry_init): Ditto. - -2007-08-02 Emmanuele Bassi - - * clutter/clutter-color.c (clutter_color_subtract): Invert the - operands and match what the function says it does. (#435) - -2007-08-01 Matthew Allum - - * clutter/clutter-color.c: (clutter_color_from_pixel): - Fix typo in alpha channel extraction (#434) - -2007-08-01 Emmanuele Bassi - - * clutter/clutter-actor.[ch]: Add floating-point variant of the - clutter_actor_get_r[xyz]angx() functions. - -2007-07-31 Emmanuele Bassi - - * clutter/clutter-stage.[ch]: Fix clutter_stage_set_user_resizable() - name, and add a getter for the property. - - * clutter/glx/clutter-stage-glx.c: Use the accessor, not - g_object_get() to retrieve the value of the resizable property. - -2007-07-31 Emmanuele Bassi - - * clutter/clutter-backend.[ch]: Add clutter_backend_set_resolution() - and clutter_backend_get_resolution(); backends should use the former - to set the resolution of the display when initialising, while actors - should use the latter when sizing themselves depending on the - resolution or the font size. - - * clutter/glx/clutter-backend-glx.c: Set the resolution as 96 dpi - as a default and query the X server when opening the display. - - * clutter/clutter-entry.c: Drop the hardcoded dpi value and use - clutter_backend_get_resolution() to compute the default size. - -2007-07-31 Emmanuele Bassi - - * clutter/clutter-entry.c (clutter_entry_init): Set the default - size of the entry based on the size of the default font. (#414). - -2007-07-31 Emmanuele Bassi - - * clutter/sdl/clutter-backend-sdl.c: Fix a typo in - clutter_backend_sdl_get_features() (#426, Pan Bohui) - -2007-07-30 Matthew Allum - - * AUTHORS: - * HACKING: - * README: - Various updates and improvements. - - * configure.ac: - Remove --disable-fast-fp-conversions - -2007-07-30 Tomas Frydrych - - * clutter/clutter-behaviour-ellipse: - (clutter_behaviour_ellipse_advance): - - Fixed invalid assumption about z cooordiance in calculation of - tilt in y axis. - -2007-07-30 Tomas Frydrych - - * clutter/clutter-actor.c: - - Fixed incorrect order of modelview matrix stack in calculating - actor vertices. - -2007-07-30 Matthew Allum - - * clutter/clutter-backend.h: - Remove #if 0's old backend_api - (generating uneeded documentation) - -2007-07-30 Matthew Allum - - * clutter/clutter-texture.c: - Fix re-relisation for large tiled textures. - * tests/test-textures.c: (main): - Add a show/hide to trigger above (see #442) - -2007-07-29 Emmanuele Bassi - - * clutter/clutter-types.h: Document ClutterGravity enumeration - and remove the only incomplete symbol of the api reference. Now - we are up to 79% documented symbols. - -2007-07-29 Emmanuele Bassi - - * clutter/clutter-media.c: Document ClutterMedia signals; - replace the implementation of clutter_media_set_filename() with - something a wee bit more robust (and portable) than a sprintf(). - -2007-07-29 Emmanuele Bassi - - * clutter/clutter-behaviour-ellipse.c: Documentation - fixes; kill some indirections; freeze the notification - queue when (potentially) emitting multiple notify - signals. - - * clutter/clutter-alpha.h: Remove the unused macro - CLUTTER_TYPE_SMOOTHSTEP. - -2007-07-28 Emmanuele Bassi - - * clutter/clutter-actor.[ch]: Use GInitiallyUnowned - as the parent structure in the ClutterActor structure - definition; somehow, this has escaped everyone attention - in one year and a half. Luckily, GInitiallyUnowned is - as big as GObject. - - (clutter_actor_get_abs_position_units), - (clutter_actor_get_abs_position): Check parameters. - - * clutter/clutter-texture.h: Unmangle the flags enum - type declaration, so that dumb parsers like h2defs.py - are not fooled. - - * clutter/clutter-behaviour-ellipse.[ch]: - * clutter/clutter-effect.c: Fix some documentation - issues and make gtk-doc happy. - -2007-07-27 Tomas Frydrych - - * clutter/clutter-behaviour-ellipse.h: - * clutter/clutter-behaviour-ellipse.c: - * tests/test-behave.c: - (clutter_behaviour_ellipse_get_angle_tilt): - (clutter_behaviour_ellipse_set_angle_tilt): - - Pruned ClutterBehaviourEllipse api. - -2007-07-27 Tomas Frydrych - - * clutter/clutter-behaviour-ellipse.h: - * clutter/clutter-behaviour-ellipse.c: - (clutter_behaviour_ellipse_set_angle_tilt_x): - (clutter_behaviour_ellipse_set_angle_tilt_xx): - (clutter_behaviour_ellipse_get_angle_tilt_x): - (clutter_behaviour_ellipse_get_angle_tilt_xx): - (clutter_behaviour_ellipse_set_angle_tilt_y): - (clutter_behaviour_ellipse_set_angle_tilt_yx): - (clutter_behaviour_ellipse_get_angle_tilt_y): - (clutter_behaviour_ellipse_get_angle_tilt_yx): - (clutter_behaviour_ellipse_set_angle_tilt_z): - (clutter_behaviour_ellipse_set_angle_tilt_zx): - (clutter_behaviour_ellipse_get_angle_tilt_z): - (clutter_behaviour_ellipse_get_angle_tilt_zx): - (clutter_behaviour_ellipse_set_tilt): - (clutter_behaviour_ellipse_set_tiltx): - (clutter_behaviour_ellipse_get_tilt): - (clutter_behaviour_ellipse_get_tiltx): - - * tests/test-behave.c: - - Allow tilting ClutterBehaviourEllipse in all three axis; affects - any code using the previous tilt api. - - -2007-07-26 Matthew Allum - - * clutter/clutter-feature.h: - Add new stage feature flags and document. - - * clutter/eglnative/clutter-backend-egl.c: - * clutter/eglx/clutter-backend-egl.c: - * clutter/sdl/clutter-backend-sdl.c: - Set new feature flags. - - * clutter/glx/clutter-backend-glx.c: - * clutter/glx/clutter-stage-glx.c: - * clutter/clutter-stage.c: - * clutter/clutter-stage.h: - Add a 'user_resizeable' setting to the backend and implement - for glx backend. - -2007-07-26 Emmanuele Bassi - - * clutter/clutter-behaviour-ellipse.c: - * clutter/clutter-behaviour.h: - * clutter/clutter-event.c: - * clutter/clutter-texture.h: - * clutter/clutter-types.h: Add missing documentation and fix - parameters names to make gtk-doc happy. - -2007-07-26 Tomas Frydrych - - * clutter/clutter-behaviour-ellipse.h: - * clutter/clutter-behaviour-ellipse.c: - * tests/test-behave.c: - - Removed tilt paramter from ClutterBehaviourEllipse constructors; - Made angles to be relative to 12 o'clock; - Added direction property; - -2007-07-26 Emmanuele Bassi - - * clutter/clutter-types.h: - * clutter/Makefile.am: Add a header for common types, to avoid - inclusion hell. - - * clutter/clutter-actor.h: - * clutter/clutter-behaviour.h: - * clutter/clutter-behaviour-rotate.h: - * clutter/clutter-behaviour-scale.h: Move some boxed types and som - enums to clutter-types.h. - -2007-07-26 Neil J. Patel - - * clutter/clutter-entry.c: (offset_to_bytes), - (clutter_entry_ensure_cursor_position), - (clutter_entry_new_with_text), (clutter_entry_new), - (clutter_entry_insert_unichar), (clutter_entry_delete_chars): - - Fixed utf8 support so it actually works now, for both - inserting and deleting chars. Fixed positioning of cursor for - utf8 chars. Both GString and Pnago need bytes (not - documented!) for string manipulation, so making sure all - values were bytes and not char positions fixed the issue. Set - a default size of 50x50 for the entry, otherwise no chars can - be seen if the size is not set after creation (which confuses - the developer). - -2007-07-26 Emmanuele Bassi - - * clutter/clutter-timeline.c: - Do not accept zero as a value for the num-frames and fps properties - in both the constructor and the setter functions. - -2007-07-26 Emmanuele Bassi - - * clutter/clutter-actor.[ch]: - * clutter/clutter-behaviour-bspline.c: - * clutter/clutter-behaviour.c: - * clutter/clutter-box.[ch]: - * clutter/clutter-clone-texture.c: - * clutter/clutter-entry.c: - * clutter/clutter-group.[ch]: - * clutter/clutter-texture.c: - * clutter/pango/pangoclutter-render.c: - * tests/test-actors.c: - * tests/test-behave.c: - * tests/test-entry.c: - * tests/test-events.c: - * tests/test-project.c: - * tests/test-rotate.c: - * tests/test-scale.c: - * tests/test-text.c: - * tests/test-textures.c: Miscellaneous compiler warning fixes. - -2007-07-26 Emmanuele Bassi - - * configure.ac: - * Makefile.am: Add a configure switch to enable strict - compiler flags, and turn it on when we are doing a distcheck. - -2007-07-25 Matthew Allum - - * Makefile.am: - * HACKING: - Add with initial notes on coding bits and bobs. - - * clutter/clutter-behaviour-scale.c: - Doc fixes. - - * clutter/clutter-event.c: (clutter_event_put): - Doc fixes. - - * clutter/glx/clutter-stage-glx.c: - Disable wm user resizing of stage (At least for now) - Doc fixes. - -2007-07-25 Tomas Frydrych - - * clutter/clutter-fixed.c: - - Fixed endianness issue in fast fp conversions. - -2007-07-25 Tomas Frydrych - - * configure.ac: - * clutter/clutter-fixed.c: - - Added --disable-fast-fp-conversion option. - -2007-07-25 Emmanuele Bassi - - * clutter/clutter-label.[ch]: Ouch, clutter_label_get_alignment() - returns a PangoAlignment, not a boolean. - -2007-07-25 Emmanuele Bassi - - * clutter/clutter-behaviour.h: - * clutter/clutter-behaviour.c: Rename clutter_behaviour_clear() - to clutter_behaviour_remove_all() to avoid method clashes in - bindings. - -2007-07-25 Tomas Frydrych - - * tests/test-rotate.c: - * tests/Makefile.am: - - Added test-rotate. - -2007-07-25 Emmanuele Bassi - - * clutter/clutter-behaviour-bspline.c: Kill off some deep pointer - indirections; use CLUTTER_NOTE() instead of ifdeffed out g_debug(); - add checks in every public entry point; move some initialisations - of private data structures out of the constructor and into the - init function, where they belong. - -2007-07-25 Matthew Allum - - * clutter/clutter-behaviour-rotate.c: - * clutter/clutter-behaviour-rotate.h: - Split 'center' prop into 3 seperate props for each axis. - Use clutter_behaviour_actors_foreach() rather than - clutter_behaviour_get_actors() to avoid copying list. - Call fixed point rotation funcs internally. - - * clutter/clutter-effect.c: - * clutter/clutter-effect.h: - Add new simple rotation based effect funcs. - -2007-07-25 Emmanuele Bassi - - * clutter/clutter.h: Include clutter-behaviour-depth.h - -2007-07-24 Emmanuele Bassi - - * clutter/clutter-behaviour-rotate.[ch]: Add a center property - for the center or rotation; implement the set_bounds() methods. - -2007-07-24 Emmanuele Bassi - - * clutter/eglx/clutter-backend-egl.c: - * clutter/eglnative/clutter-backend-egl.c: - * clutter/sdl/clutter-backend-sdl.c: Destroy the stage in every - backend. - -2007-07-24 Emmanuele Bassi - - * clutter/glx/clutter-backend-glx.c: Destroy the stage, don't - just unref it. - -2007-07-24 Emmanuele Bassi - - * clutter/clutter-main.c: Add debug markers. - -2007-07-24 Emmanuele Bassi - - * clutter/clutter-texture.[ch]: Add a ClutterTextureError - to be returned by the loader functions; use the GObject API - to allocate the private data structure instead of managing it - ourselves; add documentation. - -2007-07-24 Emmanuele Bassi - - * clutter/clutter-actor.c: - * clutter/clutter-box.h: - * clutter/clutter-stage.c: Documentation fixes. - -2007-07-24 Matthew Allum - - * clutter/cogl/gl/cogl-defines.h: - Add CGL_UNSIGNED_INT_8_8_8_8_REV (for big endian machines) - -2007-07-24 Matthew Allum - - * clutter/cogl/gl/cogl-defines.h: - Another GL_TEXTURE_RECTANGLE_ARB related fix (#404) - -2007-07-24 Matthew Allum - - * clutter/clutter-backend.c: - Minor build fixes (#413) - -2007-07-24 Emmanuele Bassi - - * clutter/clutter-effect.h: - * clutter/clutter-effect.c: Add a secondary constructor for - ClutterEffectTemplate, for use of the bindings. - -2007-07-24 Matthew Allum - - * clutter/cogl/gles/cogl.c: (cogl_get_bitmasks): - Fix typo calling glGetIntegerv rather than glGetInteger - -2007-07-24 Matthew Allum - - * clutter/cogl/gl/cogl.c: (cogl_get_features): - learn to use cpp properly. - -2007-07-24 Matthew Allum - - * clutter/clutter-media.c: (clutter_media_base_init): - Remove #if 0! signal - assume causing issues with binding generation. - (#407) - - * clutter/cogl/gl/cogl.c: - Check GL_TEXTURE_RECTANGLE_ARB and GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB - are defined in gl.h (#404) - -2007-07-24 Matthew Allum - - * clutter/glx/clutter-stage-glx.c: (clutter_stage_glx_realize): - Create stage window with correct depth/visual. Via patch from - Robert Bragg (#409). - -2007-07-23 Matthew Allum - - * clutter/clutter-texture.c: (texture_render_to_gl_quad), - (clutter_texture_paint): - Dont be over aggressive in throwing criticals for unrealized - textures. Doesn't make sense for sub classes. (#403) - -2007-07-22 Emmanuele Bassi - - Two small fixes for correctly debugging the deinitialisation - phase of the backend: - - * clutter/glx/clutter-backend-glx.c: Remove the event source - after we unref the main stage. - - * clutter/glx/clutter-stage-glx.c: Add a mark at the end of the - unrealize call (the perl bindings seem to crash before we reach - this point). - -2007-07-22 Emmanuele Bassi - - * clutter/clutter-behaviour-ellipse.c: Remove pointer indirections; - add sanity checks on the public entry points; make all the public - properties floating point (where needed) andconvert them to fixed - point internally. (Partial fix for #389) - -2007-07-22 Emmanuele Bassi - - * clutter/clutter-behaviour.[ch]: Rename ClutterBehaviour::apply - and ClutterBehaviour::remove to ClutterBehaviour::applied and - ClutterBehaviour::removed respectively, and emit them when the - behaviour has been applied (or does no longer apply) to an actor. - - (clutter_behaviour_dispose), (clutter_behaviour_finalize), - (clutter_behaviour_class_init): Move the actor removal to the - ::dispose virtual function, and remove the ::finalize one; - document the missing properties and signals. - - (clutter_behaviour_clear): Add function to clear a behaviour: - every actor will be unreffed and the ClutterBehaviour::removed - signal will be emitted. - -2007-07-21 Matthew Allum - - * clutter/clutter-event.c: - Correct clutter_event_get_state () return type. Fixes #398 - - * clutter/glx/clutter-stage-glx.c: - Disable use XFixes cursor visibility funcs. Appears to have issues - on feisty X Server at least. Fallback should work generally better. - - Fix non offscreen clutter_stage_snapshot to also rotate read pixel - data to correct orientation. - -2007-07-12 Matthew Allum - - * clutter/eglnative/clutter-event-egl.c: (clutter_event_dispatch): - Avoid sending too many events which are just pressure changes. - -2007-07-12 Matthew Allum - - * clutter/clutter-actor.c: (clutter_actor_paint): - * clutter/clutter-stage.c: (clutter_stage_get_actor_at_pos): - * clutter/cogl/cogl.h: - * clutter/cogl/gl/cogl.c: (cogl_get_viewport): - * clutter/cogl/gles/cogl.c: (cogl_get_viewport): - Hopefully fix clutter_actor_at_pos on !32bpp displays. - Based on patch from Pan Bohui, See; - http://bugzilla.openedhand.com/show_bug.cgi?id=390 - - * TODO: - More misc updates. - -2007-07-11 Emmanuele Bassi - - * clutter/clutter-behaviour-opacity.c: - Don't check direction in opacity. - -2007-07-11 Tomas Frydrych - - * clutter/clutter-fixed.h: - Fixed CLUTTER_ANGLE_ macros. - - * clutter/clutter-behaviour-ellipse.h: - * clutter/clutter-behaviour-ellipse.c: - Implemented "apply" signal closer to position actor on the start - of the elliptic path. - - (clutter_behaviour_ellipse_get_angle_begin): - (clutter_behaviour_ellipse_set_angle_begin): - (clutter_behaviour_ellipse_get_angle_end): - (clutter_behaviour_ellipse_set_angle_end): - (clutter_behaviour_ellipse_get_angle_tilt): - (clutter_behaviour_ellipse_set_angle_tilt): - Renamed with an x suffix; added versions for angles in degrees. - -2007-07-09 Matthew Allum - - * TODO: - Updates. - * clutter/clutter-stage.c: - * clutter/glx/clutter-stage-glx.c: - Fix cursor visibility property. - Force a repaint before mapping to attempt to avoid flicker. - -2007-07-09 Richard Purdie - - * clutter/eglnative/clutter-event-egl.c: - * configure.ac: - Add tslib support to eglnative backend. - -2007-07-09 Richard Purdie - - * clutter/eglnative/clutter-backend-egl.c: - Tweaks to the eglnative backend. - -2007-07-09 Richard Purdie - - * clutter/clutter-backend.c: - Make the backend add_option function optional. - -2007-07-09 Emmanuele Bassi - - * clutter/clutter-behaviour-depth.h: - * clutter/clutter-behaviour-depth.c: - * clutter/Makefile.am: Add ClutterBehaviourDepth, a simple - behaviour controlling the depth of a set of actors. - - * clutter/clutter-behaviour-opacity.c: Always make sure that - the opacity applied to the actors is a positive integer, even - in case where the start and end opacity are reversed; use the - correct cast macros for passing the opacity as a pointer. - -2007-07-06 ====================== 0.3.1 Release ======================== - -2007-07-06 Matthew Allum - - * NEWS: - * configure.ac: - Update for 0.3.1 - -2007-07-06 Matthew Allum - - * clutter/eglx/Makefile.am: - * clutter/eglx/clutter-egl.h: - * clutter/eglx/clutter-event-egl.c: - * clutter/eglx/clutter-stage-egl.c: - Rename clutter-egl.h -> clutter-eglx.h - - * NEWS: - * README: - Add info re EGL split. - -2007-07-06 Matthew Allum - - * clutter/Makefile.am: - * clutter/eglnative/Makefile.am: - * clutter/eglnative/clutter-backend-egl.c: - * clutter/eglnative/clutter-backend-egl.h: - * clutter/eglnative/clutter-egl.h: - * clutter/eglnative/clutter-event-egl.c: - * clutter/eglnative/clutter-stage-egl.c: - * clutter/eglnative/clutter-stage-egl.h: - * clutter/eglx/Makefile.am: - * clutter/eglx/clutter-backend-egl.c: - * clutter/eglx/clutter-egl.h: - * clutter/eglx/clutter-event-egl.c: - * clutter/eglx/clutter-stage-egl.c: - * configure.ac: - Add a new 'native' EGL backend for non X based EGL's - (i.e on framebuffer). - Rename old backend to 'eglx' and namespace public funcs with this. - - * clutter/pango/pangoclutter-private.h: - Add extra checks for expected defines. - -2007-07-06 Matthew Allum - - * NEWS: - * README: - Updates for upcoming 0.3.1 release. - * clutter/egl/Makefile.am: - * clutter/egl/clutter-backend-egl.c: - * clutter/egl/clutter-backend-egl.h: - * clutter/egl/clutter-egl.h: - * clutter/egl/clutter-event-egl.c: - * clutter/egl/clutter-stage-egl.c: - * clutter/egl/clutter-stage-egl.h: - * configure.ac: - Move egl -> eglx - -2007-07-06 Matthew Allum - - * clutter/clutter-box.c: (clutter_box_pick): - Call clutter_box_paint rather than actor paint method avoiding - infinte loop (Fixes test-boxes crasher). - - * clutter/glx/clutter-stage-glx.c: (clutter_stage_glx_unrealize): - Trap the X calls to avoid potential X errors. - -2007-07-06 Ross Burton - - * tests/Makefile.am: - Dist redhand.png. - -2007-07-05 Tomas Frydrych - - * cluter/clutter-group.c: - (clutter_group_query_coords:) - Reset box size to zero width and height to report correct size if - the contents of the group shrink. - -2007-07-05 Emmanuele Bassi - - * clutter/clutter-rectangle.c: Fix off-by-border-width bug - in the border creation of a ClutterRectangle. - -2007-07-05 Tomas Frydrych - - * clutter/clutter-fixed.h: - * clutter/clutter-fixed.c: - Added CLUTTER_FLOAT_TO_UINT macro; - (clutter_pow2x): - Fixed sign issue. - -2007-07-04 Emmanuele Bassi - - * clutter/*: Loads of fixes for the API reference. - -2007-07-04 Emmanuele Bassi - - Merge from clutter/work - - * clutter/clutter-alpha.[ch]: Fix the argument names for - the smoothstep alpha functions, for gtk-doc. - - * clutter/clutter-group.c (clutter_group_remove_all): Fix - the iteration on the children list. - -2007-07-04 Emmanuele Bassi - - * clutter/clutter-main.c (clutter_redraw): Move the stage - paint init call from the main redraw function... - - * clutter/clutter-stage.c (clutter_stage_paint): ... to the - ClutterActor::paint() overridden method in ClutterStage. - -2007-07-04 Emmanuele Bassi - - * clutter/clutter.h: - * clutter/Makefile.am: ClutterBackend is marked as public API, - so install the clutter-backend.h header and include it when - including clutter.h. - -2007-07-04 Emmanuele Bassi - - * clutter/clutter-entry.[ch]: Various fixes to ClutterEntry: - fix code style issues; add documentation for the various - properties; add ClutterEntry:entry-padding property, for controlling - the text padding (until we have style properties separated from - the object properties); notify property changes; free resources - in the ::finalize method; rename clutter_entry_add() to - clutter_entry_insert_unichar(), and clutter_entry_remove() to - clutter_entry_delete_chars() - for bindings and for matching the - insert_text() and delete_text() existing methods; add a getter - method for the max-length property. - -2007-07-04 Emmanuele Bassi - - * clutter/clutter-actor.[ch]: Use the right get_type() function - name for ClutterVertex, and add the CLUTTER_TYPE_VERTEX macro. - -2007-07-03 Ross Burton - - * configure.ac: - Check for XFixes 4 and above. - -2007-07-02 Tomas Frydrych - - * clutter/clutter-actor.h: - * clutter/clutter-actor.c: - * tests/test-project.c: - (clutter_actor_apply_transform_to_point): - Use ClutterVertex for input and output parameters. - -2007-07-01 Emmanuele Bassi - - Merge from clutter.git/work branch - - * clutter/clutter-effect.[ch]: Clean up ClutterEffect; use a - pointer to access the private data structure, instead of doing - a type check every time. Add description for the API reference. - - * docs/reference/clutter-sections.txt: - * clutter/*.[ch]: Add various documentation fixes. - - * clutter/clutter-entry.c: Remove a stray g_print() call. - -2007-06-29 Neil J. Patel - - * clutter/clutter-entry.c: (clutter_entry_handle_key_event), - (clutter_entry_add), (clutter_entry_remove): - Check if unichar == 0, and if so, return, as it will cause a delete in - the GString. - -2007-06-20 ============== 0.3 Release ==================================== - -2007-06-29 Matthew Allum - - * clutter/clutter-texture.c: (texture_upload_data): - Fix a SEGV for GL ES textures. - - * clutter/cogl/gles/cogl.c: (cogl_setup_viewport): - Tweak default z_camera for 60 degrees like GL. - - * clutter/egl/clutter-backend-egl.c:: - * clutter/egl/clutter-stage-egl.c: - Fix edpy usage (thanks to Kaj Gronholm). - -2007-06-29 Tomas Frydrych - - * clutter/clutter-group.c: - (clutter_group_query_coords): - Fixed box calculation. - -2007-06-28 Tomas Frydrych - - * clutter/clutter-group.c: - (clutter_group_raise): - (clutter_group_lower): - Fixed SIGSEGV when attempting to raise / lower an only child. - -2007-06-28 Matthew Allum - - * clutter/cogl/gl/cogl.c: (cogl_setup_viewport): - Improve fixed z_camera value for defualt perspective. - Appears pixel perfect on ATI and Intel at least - -2007-06-28 Tomas Frydrych - - * tests/test-perspective.c: - Moved red dots to be positioned 1px off each corner. - -2007-06-28 Matthew Allum - - * tests/Makefile.am: - * tests/test-perspective.c: - Add simple perspective test - -2007-06-27 Tomas Frydrych - - * clutter/clutter-actor.h: - * clutter/clutter-actor.c: - * tests/test-project.c: - Renamed clutter_actor_project_point() to - clutter_actor_apply_trasform_to_point() and - clutter_actor_project_vertices() to clutter_actor_get_vertices(). - -2007-06-27 Tomas Frydrych - - * clutter/clutter-actor.h: - * clutter/clutter-actor.c: - * tests/test-project.c: - (clutter_actor_project_point): - Separated input from output parameters. - -2007-06-27 Matthew Allum - - * Makefile.am: - Dont remove README on make clean - -2007-06-27 Tomas Frydrych - - * clutter/clutter-actor.c: - (_clutter_actor_apply_modelview_transform): - Fixed incorrect order of scaling an rotation that was causing - objects that were both rotated and scaled to change position. - -2007-06-27 Tomas Frydrych - - * clutter/clutter-actor.c: - (clutter_actor_scale_with_gravityx): - Made to work after changes to the behavivour of - clutter_actor_get_absolute_size() for rotated actors. - -2007-06-26 Tomas Frydrych - - * clutter/cogl/gl/cogl.c: - * clutter/cogl/gles/cogl.c: - (cogl_setup_viewport): - For default perspective angle of 60 degrees, use a hardcoded - z_camera constant that provides minimal artefacts when rendering - text; for other angles we calculate. - -2007-06-26 Tomas Frydrych - - * clutter/clutter-actor.h: - * clutter/clutter-actor.c: - Added fixed point version of clutter_actor_rotate_*() functions - and accessors for rotation angles. - -2007-06-25 Matthew Allum - - * README: - Update a little more. - * clutter/clutter-effect.c: - Add missing func documentation - * clutter/clutter-rectangle.c: - Fix border drawing. - -2007-06-25 Tomas Frydrych - - * clutter/clutter-fixed.h: - Fixed definition of clutter_cosx() macro. - - * clutter/clutter-stage.c: - * clutter/cogl/cogl.h: - * clutter/cogl/gl/cogl.c: - * clutter/cogl/gles/cogl.c: - Changed ClutterPerspective.fovy from ClutterAngle to degrees to - improve precission in Z-camera calculations. - -2007-06-22 Matthew Allum - - * README: - * README.in: - * autogen.sh: - * configure.ac: - Move back to regular README naming at least for now. - -2007-06-22 Matthew Allum - - * NEWS: - * README.in: - * TODO: - Update for 0.3 release. - - * clutter/clutter-actor.c: - Minor doc fixups - - * clutter/clutter-texture.c: - Various minor additions for handling non RGBA data. - Fix a typo breaking clutter_texture_get_pixbuf() on tiled textures. - - * tests/test-actors.c: - Disable scaling to avoid drifting (temporary till API is fixed) - -2007-06-21 Emmanuele Bassi - - * clutter/clutter-timeline.c: Allow disabling the timeline pool - by using the CLUTTER_TIMELINE environment variable set to - "no-pool". - -2007-06-19 Emmanuele Bassi - - * README.in: Update release notes. - -2007-06-19 Matthew Allum - - * clutter/clutter-main.c: (clutter_init_with_args), (clutter_init): - Safer checks for setting progname if NULL is passed in init. - -2007-06-19 Emmanuele Bassi - - * autogen.sh: autoreconf needs a README. - -2007-06-19 Matthew Allum - - * TODO: - Sync up a little. - * clutter/clutter-main.c: - Set a default window title based on g_prgname(). - - * clutter/clutter-stage.c: - * clutter/clutter-stage.h: - * clutter/egl/clutter-stage-egl.c: - * clutter/glx/clutter-stage-glx.c: - * clutter/sdl/clutter-stage-sdl.c: - Alter draw_to_pixbuf to return a pixbuf - - * configure.ac: - Only full in gdk-pixbuf-xlib as a GLX backend dep. - - * tests/test-entry.c: - Fix a couple of warnings. - -2007-06-19 Emmanuele Bassi - - * Makefile.am: Add README.in to the EXTRA_DIST. - -2007-06-19 Emmanuele Bassi - - * configure.ac: - * README.in: Use a template for the README file, so that - it gets the right version number. - -2007-06-19 Matthew Allum - - * clutter/clutter-stage.c: - * clutter/clutter-stage.h: - * clutter/glx/clutter-stage-glx.c: - * clutter/sdl/clutter-stage-sdl.c: - Add window title setting/getting functionality. - - * clutter/clutter-event.c: (clutter_key_event_unicode): - Remove uneeded convert case call. - - * clutter/cogl/gl/cogl.c: (cogl_rectangle) - Use parameters correctly for underlying GL rect call. - - * tests/test-entry.c: - Add a window title. - -2007-06-18 Matthew Allum - - * clutter/sdl/clutter-event-sdl.c: - Seemingly fix SDL Event source. - Add some very basic SDL keysym translation. - (Thanks to Thomas Van Machelen for initial translation code) - - * tests/test-events.c: - Dump some info on keysyms pressed. - -2007-06-16 Emmanuele Bassi - - * clutter/clutter-actor.h: - * clutter/clutter-stage.h: Add 32 padding slots; when we - reach 1.0 it'll be a long road until the following ABI - break. - - * tests/test-behave.c: Don't forget to include headers. - -2007-06-16 Emmanuele Bassi - - * clutter/clutter-container.h: - * clutter/clutter-layout.h: Interfaces are not checked - at compile-time, so there's not need to add padding to - avoid ABI breaks. - -2007-06-16 Emmanuele Bassi - - * configure.ac: Partially revert last commit, and fail - with AC_MSG_ERROR() instead of disabling the manual build - if no jw and xmlto were found. - -2007-06-16 Emmanuele Bassi - - * configure.ac: If the programs required to build the manual - are not found and --enable-manual was passed, then just print - a warning and disable the manual build instead of aborting the - configure. - - * doc/manual/Makefile.am: Use the full path gathered by the - configure script when invoking jw and xmlto. - -2007-06-16 Matthew Allum - - * clutter/clutter-actor.c: - Fix typo in x rotation transform (Thanks to Johan Billen #138) - - * configure.ac: - * doc/manual/Makefile.am: - Fix manual build and required program check. - - * tests/Makefile.am: - Another typo fix. - -2007-06-15 Tomas Frydrych - - * clutter/clutter-actor.c: - Added some comments; renamed MTX_GL_SCALE to MTX_GL_SCALE_X for - consistency; removed some debug output. - -2007-06-14 Tomas Frydrych - - * clutter/clutter-vbox.c: - * clutter/clutter-hbox.c: - (clutter_vbox_pack_child): - (clutter_hbox_pack_child): - Fixed child coords. - -2007-06-14 Emmanuele Bassi - - * clutter/clutter-box.[ch]: Base class for layout containers. - - * clutter/clutter-hbox.[ch]: Horizontal box actor. - - * clutter/clutter-vbox.[ch]: Vertical box actor. - - * clutter/clutter.h: - * clutter/Makefile.am: Build glue - - * tests/Makefile.am: - * tests/test-boxes.c: Test suite for ClutterBox API and - implementations. - -2007-06-14 Matthew Allum - - * clutter/cogl/gl/cogl.c: (cogl_check_extension): - Actually populate this func and remove the static alternate - named one. Means GLX actually checks for available extensions. - Other minor tidy ups. - - * clutter/glx/clutter-backend-glx.c: - * clutter/glx/clutter-backend-glx.h: - Add support for GLX_SGI_swap_control to do vblanking prefering - over glXGetVideoSyncSGI. Should fix issues on Intel chips with - very slow frame rates due to vblank problems. - Thanks to Michel Danzer for tips, see; - http://bugs.freedesktop.org/show_bug.cgi?id=10542 - - * test/test-actors.c: - Change FPS to 60. - -2007-06-14 Emmanuele Bassi - - * clutter/clutter-timeout-pool.c: Make ClutterTimeoutPool - more thread-safe, using a static lock. - - (clutter_timeout_pool_dispatch), (clutter_timeout_pool_remove): Fix - a race condition-turned-in-memory corruption bug, triggered by - removing a timeout from the pool while still spinning the pool - source. - -2007-06-14 Emmanuele Bassi - - * configure.ac: - * doc/manual/Makefile.am: Find xmlto and jw in the path and - use the symbolic names when building the manual. - -2007-06-14 Tomas Frydrych - - * clutter/clutter-actor.c: - (clutter_actor_get_abs_position): - (clutter_actor_get_abs_size): - Reimplement using clutter_actor_project_point() and - clutter_actor_project_vertices(). - - * tests/test-project.c: - Rename clutter_actor_allocate_coords -> clutter_actor_query_coords - -2007-06-14 Matthew Allum - - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - * clutter/clutter-group.c: - * clutter/clutter-label.c: - * clutter/egl/clutter-stage-egl.c: - * clutter/glx/clutter-stage-glx.c: - * clutter/sdl/clutter-stage-sdl.c: - Rename clutter_actor_allocate_coords -> clutter_actor_query_coords - - Change repaints to G_PRIORITY_DEFAULT + 10. - (timelines are G_PRIORITY_DEFAULT + 30, events G_PRIORITY_DEFAULT) - - * clutter/glx/clutter-event-glx.c: - Handle shift modifier in keycode -> keysym translation. - - * tests/test-actors.c: - Remove (broken) screen saver code. - Add scaling behaviour, clean code a little. - -2007-06-13 Tomas Frydrych - - * clutter/clutter-actor.c: - (clutter_actor_project_vertices): - (clutter_actor_project_proint): - Fixed translation of Y coords to match the windowing system. - - * clutter/egl/clutter-stage-egl.c: - * clutter/glx/clutter-stage-glx.c: - * clutter/sdl/clutter-stage-sdl.c: - (clutter_stage_*_request_size): - Initialize viewport when setting/resetting stage side. - - * tests/Makefile.am - * tests/test-project.c: - An interactive test of the projection stuff. - -2007-06-12 Tomas Frydrych - - * clutter/clutter-main.c: - (clutter_redraw): - Clear CLUTTER_ACTOR_SYNC_MATRICES flag after setting up viewport. - -2007-06-12 Matthew Allum - - * doc/manual/Makefile.am: - Fix typo in Makefile so PDF's actually get built. - - * doc/manual/clutter-manual.xml.in: - Add an FAQ section with initial entry. - -2007-06-12 Tomas Frydrych - - * clutter/clutter-fixed.h: - Added shorthand CFX_QMUL macro. - - * clutter/clutter-private.h: - * clutter/clutter-actor.h: - * clutter/clutter-actor.c: - Replaced ClutterVertices with ClutterVertex; - - (clutter_actor_get_transformed_vertices): - (clutter_actor_get_transformed_point): - Replaced with clutter_actor_projected_vertices and - clutter_actor_projected_point. - - (_clutter_actor_apply_modelview_transform): - (_clutter_actor_apply_modelview_transform_recursive): - Private functions to push actor modelview transforms on OpenGL - stack. - - * clutter/cogl/cogl.h: - * clutter/cogl/gl/cogl.c: - * clutter/cogl/gles/cogl.c: - (cogl_get_viewport): - (cogl_get_modelview_matrix): - (cogl_get_projection_matrix): - Functions to access OpenGL transforms. - -2007-06-12 Matthew Allum - - * clutter/clutter-alpha.c: - Remove stray g_debug. - - * clutter/clutter-behaviour-rotate.c: - Register private class member. - - * clutter/clutter-behaviour.c: - * clutter/clutter-behaviour.h: - Add applied and removed signals. - - * Makefile.am: - * configure.ac: - * examples/Makefile.am: - * examples/README: - * examples/behave.c: - * examples/slider.c: - * examples/super-oh.c: - * examples/test-entry.c: - * examples/test-text.c: - * examples/test.c: - * tests/Makefile.am: - Remove examples, moving applicable code into tests. - -2007-06-11 Tomas Frydrych - - * clutter/clutter-alpha.c: - (clutter_alpha_sine_inc): - (clutter_alpha_sine_dec): - (clutter_alpha_sine_half): - Fixed unsigned overflow. - -2007-06-11 Emmanuele Bassi - - * clutter/clutter-event.h: Add full modifier masks enums. - - * clutter/glx/clutter-event-glx.c: Copy the modifier masks from - the native X event structure. - - * clutter/clutter-event.c: Convert to upper case if the - shift or the lock masks are applied. - -2007-06-09 Emmanuele Bassi - - * clutter/clutter.h: - * clutter/clutter-timeout-pool.[ch]: Add a timeout pool source; - every timeout added to this pool will use a single slice of the - main loop. - - * clutter/clutter-timelince.c: Use a per-class timeout pool for - every timeline. - -2007-06-08 Matthew Allum - - * clutter/clutter-texture.c: (clutter_texture_get_pixbuf): - Remove stray printf. - -2007-06-08 Matthew Allum - - * clutter/clutter-actor.c: - * clutter/clutter-debug.h: - * clutter/clutter-main.c: - * clutter/clutter-main.h: - * clutter/clutter-private.h: - * clutter/clutter-timeline.c: - Add 'schedule' debug flag and new CLUTTER_TIMESTAMP macro. - - * clutter/clutter-texture.c: - * clutter/clutter-texture.h: - * clutter/cogl/cogl.h: - * clutter/cogl/gl/cogl-defines.h: - * clutter/cogl/gles/cogl-defines.h: - * clutter/cogl/gl/cogl.c: - * clutter/cogl/gles/cogl.c: - Add initial experiemental YUV texture support. - Move texture rect size checks into cogl. - Better handle moving texture data from video -> system memory - (if support available). - -2007-06-07 Neil J. Patel - - * clutter/clutter-entry.c: (clutter_entry_class_init), - (clutter_entry_handle_key_event): - * clutter/clutter-entry.h: - Added an 'activated' signal, which is emitted when the 'Enter' key is - pressed. - - * examples/test-entry.c: (on_entry_activated), (main): - Added a test handler for the activated signal. - -2007-06-07 Emmanuele Bassi - - * clutter/*: Move documentation from the templates into the - source code. - -2007-06-07 Emmanuele Bassi - - * clutter/clutter-container.[ch]: Add a generic actor container - interface, for actors to implement without subclassing ClutterGroup. - - * clutter/clutter-group.[ch]: Make ClutterGroup implement the - ClutterContainer interface, and deprecate the colliding methods. - - * clutter/clutter-layout.[ch]: Add extended layout interface. - Actors and containers requiring or honouring complex layout - management should implement this interface and provide at least - one of the available layout types: width for height, height for - width, natural size, iterative size request. - - * clutter/clutter-label.c: A ClutterLabel requires height for - width layout management, so it implements the ClutterLayout - interface. - - * clutter/Makefile.am: Add new files to the build. - - * tests/*.c: - * examples/*.c: Update tests and examples code to use the - new ClutterContainer API instead of ClutterGroup. - -2007-06-07 Emmanuele Bassi - - * clutter/clutter-timeline.[ch]: Add a "delay" property, which - delays the real start of the timeline by a number of milliseconds. - - (clutter_timeline_clone): Rename clutter_timeline_copy() to - clutter_timeline_clone(), for consistency. - -2007-06-01 Neil J. Patel - - * clutter/clutter-entry.c: (clutter_entry_set_property), - (clutter_entry_get_property), (clutter_entry_class_init), - (clutter_entry_init), (clutter_entry_set_text), - (clutter_entry_set_max_length): - * clutter/clutter-entry.h: - * examples/test-entry.c: (main): - Added a max-length property whihc limits the length of the text in the - entry. - -2007-06-01 Neil J. Patel - - * clutter/clutter-entry.c: (clutter_entry_ensure_cursor_position), - (clutter_entry_paint), (clutter_entry_init), - (clutter_entry_handle_key_event): - Clipping within the entry class to stop it over-slipping its - boundries. - Text will move within the clip region to keep the cursor always - visible. - Added some padding to the left and right to make sure cursor is - always show. - -2007-06-01 Tomas Frydrych - - * clutter/clutter-actor.c: - * clutter/clutter-stage.c: - * clutter/clutter-private.h: - Removed perspective matrix caching from ClutterStage. - -2007-06-01 Neil J. Patel - - * clutter/clutter-entry.c: (clutter_entry_set_property), - (clutter_entry_get_property), (clutter_entry_ensure_layout), - (clutter_entry_class_init), (clutter_entry_init), - (clutter_entry_set_visibility), (clutter_entry_get_visibility), - (clutter_entry_set_invisible_char), - (clutter_entry_get_invisible_char): - * clutter/clutter-entry.h: - Added text-visibility, which will allow you to show all entered text - as a nominated charaecter ('*' is default). - - * examples/test-entry.c: (main): - -2007-06-01 Neil J. Patel - - * clutter/clutter-entry.c: (clutter_entry_ensure_cursor_position), - (clutter_entry_clear_cursor_position), - (clutter_entry_paint_cursor), (clutter_entry_paint), - (clutter_entry_class_init), (clutter_entry_set_text), - (clutter_entry_set_position): - * clutter/clutter-entry.h: - Added a signla to track cursor movements. - Moved the sursor painting function so it can be subclassed. - -2007-06-01 Tomas Frydrych - - * clutter/clutter-actor.c: - (clutter_actor_get_transformed_point): - Make input again relative to the actor; feed depth into transform. - -2007-06-01 Neil J. Patel - - * clutter/clutter-entry.c: (clutter_entry_class_init), - (clutter_entry_set_text): - * clutter/clutter-entry.h: - * examples/test-entry.c: (on_entry_text_changed), (main): - Added a text-changed signal to the entry. - -2007-06-01 Neil J. Patel - - * clutter/clutter-effect.h: - Removed extra G_END_DECLS outside the #endif - - * clutter/clutter-entry.c: (clutter_entry_handle_key_event), - (clutter_entry_add): - * clutter/clutter-entry.h: - * examples/test-entry.c: (on_key_release_cb): - Added a function to deal with ClutterKeyEvents. Handles the majority - of entry-related keyboard keys. However modifiers still need to be - implemented. - -2007-06-01 Tomas Frydrych - - * clutter/clutter-actor.c: - (mtx_create): - Apply perspective transform before all other transforms. - -2007-06-01 Tomas Frydrych - - * clutter/clutter-stage.c: - (clutter_stage_init): - Call _clutter_stage_refresh_perspective_matrix to initialize the - matrix for default values. - -2007-06-01 Tomas Frydrych - - * clutter/clutter-fixed.h: - * clutter/clutter-behaviour-ellipse.h: - * clutter/clutter-behaviour-ellipse.c: - * clutter/clutter-behaviour-bspline.h: - * clutter/clutter-behaviour-bspline.c: - Documentation fixes. - -2007-05-31 Tomas Frydrych - - * clutter/clutter-stage.c: - * clutter/clutter-private.h: - (_clutter_stage_get_perspective_matrix): - New function. - - * clutter/clutter-actor.c: - (clutter_actor_get_tranformed_vertices): - (clutter_actor_get_tranformed_point): - Apply perspective matrix on the top of actor transform matrix. - -2007-05-31 Neil J Patel - - * clutter/Makefile.am: - * clutter/clutter-entry.c: (clutter_entry_set_property), - (clutter_entry_get_property), (clutter_entry_ensure_layout), - (clutter_entry_clear_layout), - (clutter_entry_ensure_cursor_position), (clutter_entry_paint), - (clutter_entry_request_coords), (clutter_entry_dispose), - (clutter_entry_finalize), (clutter_entry_class_init), - (clutter_entry_init), (clutter_entry_new_with_text), - (clutter_entry_new_full), (clutter_entry_new), - (clutter_entry_get_text), (clutter_entry_set_text), - (clutter_entry_get_font_name), (clutter_entry_set_font_name), - (clutter_entry_set_color), (clutter_entry_get_color), - (clutter_entry_get_layout), (clutter_entry_set_alignment), - (clutter_entry_get_alignment), (clutter_entry_set_position), - (clutter_entry_get_position), (clutter_entry_add), - (clutter_entry_remove), (clutter_entry_insert_text), - (clutter_entry_delete_text), (clutter_entry_set_visible_cursor), - (clutter_entry_get_visible_cursor): - * clutter/clutter-entry.h: - * clutter/clutter.h: - * examples/Makefile.am: - Initial import of ClutterEntry actor. - - * examples/test-entry.c: (on_key_release_cb), (main): - A basic test for ClutterEntry - -2007-05-31 Tomas Frydrych - - * clutter/clutter-actor.c: - (clutter_actor_get_transformed_point): - Fixed coordinance translation. - -2007-05-31 Matthew Allum - - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - Add clutter_actor_get_transformed_point() - - * clutter/clutter-main.c: - Plug in perspective setup to redraw - - * clutter/clutter-stage.c: - * clutter/clutter-stage.h: - Remove audience code for now. - -2007-05-31 Matthew Allum - - * clutter/egl/clutter-backend-egl.c: - * clutter/egl/clutter-backend-egl.h: - * clutter/egl/clutter-event-egl.c: - * clutter/egl/clutter-stage-egl.c: - * clutter/egl/clutter-stage-egl.h: - Rename Egl -> EGL - -2007-05-31 Matthew Allum - - * clutter/glx/clutter-backend-glx.c: - * clutter/glx/clutter-backend-glx.h: - * clutter/glx/clutter-event-glx.c: - * clutter/glx/clutter-glx.h: - * clutter/glx/clutter-stage-glx.c: - * clutter/glx/clutter-stage-glx.h: - Change type nameing from Glx -> GLX. - Add basic event filtering functionality - -2007-05-31 Tomas Frydrych - - * clutter/clutter-behaviour-ellipse.c: - Changed behaviour so that a beginning angle of 0 would correspond - to 12 o'clock. - -2007-05-31 Tomas Frydrych - - * clutter/clutter-fixed.h: - * clutter/clutter-fixed.c: - (_clutter_double_to_int): - Fixed return value to gint; added missing cast that broke negative - number conversions. - - (CLUTTER_ANGLE_FROM_DEGX): - Swapped division and multiplication around to avoid overflows. - - * clutter/clutter-behaviour-ellipse.c: - Fixed incorrectly set lower bounds for angle properties. - - * clutter/clutter-actor.h: - * clutter/clutter-actor.c: - Added ClutterVertices type. - (clutter_actor_get_transformed_vertices): - New function. - -2007-05-31 Matthew Allum - * TODO: - Sync up for whats left for 0.4 release (and 0.6 ideas) - -2007-05-31 Matthew Allum - - * clutter/clutter-behaviour-ellipse.c: - Remove uneeded knot signal - - * clutter/clutter-behaviour-path.c: - Fix so knot signal is emitted only when a knot is reached. - - * clutter/clutter-effect.c: - * clutter/clutter-effect.h: - Add a scale effect. - - * configure.ac: - * doc/manual/Makefile.am: - * doc/manual/clutter-manual.xml.in: - * doc/manual/manual.xsl: - * doc/manual/style.css: - Add various bits for application developers manual. - -2007-05-30 Tomas Frydrych - - * clutter/clutter-alpha.h: - * clutter/clutter-alpha.c: - Removed ClutterSmoothstep struct - (clutter_smoothstep_inc_func): - Renamed to clutter_smoothstep_func. - (clutter_smoothstep_added_func): - Added. - -2007-05-29 Tomas Frydrych - - * clutter/clutter-fixed.h: - (clutter_cosx): - (clutter_cosi): - Fixed wrong sign in cos -> sin tranformation. - - * clutter/clutter-behaviour-ellipse.c: - (clutter_behaviour_ellipse_advance): - Replaced coordinace calculation for tilted ellipse with a sane - algorithm. - - * examples/behave.c: - Added tilt parameter to the example ellptic path. - -2007-05-29 Tomas Frydrych - - * clutter/cogl/gles/cogl.c: - (cogl_setup_viewport): - Fixed z_camera calculation. - -2007-05-28 Matthew Allum - - * clutter/clutter-texture.c: (clutter_texture_unrealize): - Dont even try to move texture pixels from video -> system - ram on unrealisation for GL/ES - -2007-05-28 Matthew Allum - - * clutter/clutter-stage.c: (clutter_stage_get_actor_at_pos): - Fix for GL/ES. Barring texture reads this means all clutter - functionality now works on GL/ES! (no doubt with a few yet to - be discovered bugs) - -2007-05-28 Matthew Allum - - * clutter/clutter-backend.c: - * clutter/clutter-backend.h: - * clutter/glx/clutter-stage-glx.c: - * clutter/glx/clutter-backend-glx.c: - Fix up rendering pipeline removing clutter_backend_XXX_stage_paint - and adding clutter_backend_XXX_redraw instead. Duplicates less - code in backends, avoids clutter_actor_paint() getting called - before stage is set up (viewport wise) and unbreaks things like - picking. - - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - * clutter/clutter-main.c: - * clutter/clutter-private.h: - * clutter/clutter-stage.c: (clutter_stage_get_actor_at_pos): - Redo picking functionality a different way (via color indexing) - as to provide more flexibility, possibly speed and more likely - work with GL/ES (doesn't currently however - not sure why). - - * clutter/clutter-group.c: - Add groups own 'pick' method. - - * clutter/cogl/cogl.h: - * clutter/cogl/gl/cogl.c: - * clutter/cogl/gles/cogl.c: - Move clipping funtionality into cogl. - - * clutter/cogl/gles/cogl-defines.h: - Hack around missing BGR format in GL/ES. - - * clutter/egl/clutter-backend-egl.c: - * clutter/egl/clutter-backend-egl.h: - * clutter/egl/clutter-stage-egl.c: - * clutter/sdl/clutter-backend-sdl.c: - * clutter/sdl/clutter-backend-sdl.h: - * clutter/sdl/clutter-event-sdl.c: - * clutter/sdl/clutter-stage-sdl.c: - Update backends to newer API. - Add basic mouse event translation to SDL. - -2007-05-25 Matthew Allum - - * clutter/clutter-color.c: (clutter_color_parse): - Handle #rrggbbaa color setting strings (i.e with alpha). - Set alpha to 0xff if it is not specified. - - * clutter/clutter-stage.c: (clutter_stage_get_actor_at_pos) - Increase select buffer. - - * examples/super-oh.c: - Fix up use of clutter_group_show_all() - -2007-05-25 Tomas Frydrych - - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - Renamed clutter_actor_scalex() to clutter_actor_set_scale_with_gravityx - Added floating point version clutter_actor_set_scale_with_gravity. - - * clutter/clutter-units.h: - * clutter/clutter-actor.h: - typedef ClutterUnit - - * clutter/clutter-fixed.h: - * clutter/clutter-stage.c: - CLUTTER_ANGLE_FROM_DEG(), CLUTTER_ANGLE_FROM_DEGX() - renamed CLUTTER_DEGF_TO_CLUTTER_ANGLE to CLUTTER_ANGLE_FROM_DEGF - - * clutter/clutter-behaviour-ellipse.h: - * clutter/clutter-behaviour-ellipse.c: - * examples/behave.c: - (clutter_behaviour_ellipse_new): - Changed signature to take angles in degrees, and x,y offsets. - (clutter_behaviour_ellipse_newx): - Fixed version clutter_behaviour_ellipse_new. - (clutter_behaviour_ellipse_set_center): - (clutter_behaviour_ellipse_get_center): - Changed signature to take x,y coords instead of ClutterKnot. - - clutter/cogl/gl/cogl.c: - clutter/cogl/gles/cogl.c: - (cogl_setup_viewport): - Added z_camera calculation. - -2007-05-25 Matthew Allum - - * Makefile.am: - Install a default flavour .pc file. - - * clutter/clutter-actor.c: - Translate units correctly for translate() - - * clutter/clutter-feature.h: - Add new texture features. - - * clutter/clutter-fixed.h: - Add clutter angle conversion defines. - - * clutter/clutter-group.c: - Use cogl not GL. Dont recurse on show all. - - * clutter/clutter-private.h: - Remove sync_viewport. - - * clutter/clutter-rectangle.c: - Fix cogl typo. - - * clutter/clutter-stage.c: - * clutter/clutter-stage.h: - Add perspective settings. Remove viewport_sync. - Add audience stubs. Fix up actor_at_pos a little (still broken) - - * clutter/clutter-texture.h: - * clutter/clutter-texture.c: - Redo pixel uploading. Add initial (disabled) YUV support. - - * clutter/clutter-timeline.c: - Fire 'completed' signal when looping. - - * clutter/cogl/gl/cogl.c: - Move some backend checks here. - - * clutter/glx/clutter-backend-glx.c: - Actually check target display has GLX ext. - - * clutter/glx/clutter-stage-glx.c: - Handle offscreen failing more gracefully. - - * examples/Makefile.am: - Use AM_LDFLAGS. - - * clutter/clutter-main.c: - * clutter/clutter-feature.c: - * clutter/clutter-backend.c: - * clutter/clutter-alpha.c: - Fix a compile warnings. - - * tests/Makefile.am: - * tests/test-offscreen.c: - * tests/test-scale.c: - More tests. - -2007-05-23 Tomas Frydrych - - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - (clutter_actor_get_abs_size_units): - (clutter_actor_get_abs_position_units): - removed from public api - -2007-05-22 Tomas Frydrych - - * configure.ac: - * Makefile.am: - * clutter.pc.in: - * clutter/Makefile.am: - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - * clutter/clutter-group.c: - * clutter/clutter-label.c: - * clutter/clutter-real.h: - * clutter/clutter-units.h: - * clutter/clutter.h: - * clutter/egl/clutter-stage-egl.c: - * clutter/glx/clutter-stage-glx.c: - * clutter/sdl/clutter-stage-sdl.c: - * examples/Makefile.am: - * tests/Makefile.am: - Removed ClutterReal; added clutter-units. - -2007-05-18 Tomas Frydrych - - * configure.ac: - * Makefile.am: - * clutter.pc.in: - * clutter/Makefile.am: - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - * clutter/clutter-behaviour-scale.c: - * clutter/clutter-behaviour-scale.h: - * clutter/clutter-group.c: - * clutter/clutter-label.c: - * clutter/clutter-real.h: - * clutter/egl/clutter-stage-egl.c: - * clutter/glx/clutter-stage-glx.c: - * examples/Makefile.am: - * tests/Makefile.am: - ClutterReal type. - -2007-05-17 Emmanuele Bassi - - * clutter/clutter-main.c: Use clutter_base_init() inside the - initialisation process, instead of calling g_type_init() directly. - - * clutter/clutter-alpha.c: - * clutter/clutter-behaviour-bspline.c: - * clutter/clutter-behaviour-ellipse.c: Fix API documentation. - -2007-05-17 Matthew Allum - - * configure.ac: - Fix CLUTTER_NO_FPU typo. - -2007-05-17 Tomas Frydrych - - * clutter/clutter-alpha.h: - * clutter/clutter-alpha.c: - * doc/reference/clutter-sections.txt: - Added clutter_exp_inc_func() and clutter_exp_dec_func(). - -2007-05-16 Emmanuele Bassi - - * clutter/clutter-main.[ch]: Add clutter_base_init(), semi-private - function to initialise just the base Clutter functionalities; it's - only used by gtk-doc to introspect the classes. - - * clutter/clutter-feature.c: Do not access the private features - data structure unless it has been initialised. - -2007-05-16 Tomas Frydrych - - * clutter/clutter-alpha.h: - * clutter/clutter-alpha.c: - * doc/reference/clutter-sections.txt: - Added clutter_sine_half(). - -2007-05-16 Tomas Frydrych - - * clutter/clutter-alpha.h: - * clutter/clutter-alpha.c: - * doc/reference/clutter-sections.txt: - Fixed clutter_sine_inc(), added clutter_sine_dec(). - -2007-05-16 Tomas Frydrych - - * clutter/clutter-alpha.h: - * clutter/clutter-alpha.c: - * doc/reference/clutter-sections.txt: - * doc/rererence/clutter.types: - * doc/reference/tmpl/clutter-alpha.sgml: - clutter_smoothstep_func alpha function, - ClutterSmoothstep struct for smoothstep function data. - -2007-05-16 Matthew Allum - - * clutter/clutter-backend.c: - * clutter/clutter-backend.h: - * clutter/clutter-feature.c: - * clutter/clutter-feature.h: - * clutter/clutter-main.c: - * clutter/clutter-main.h: - * clutter/clutter-private.h: - * clutter/clutter-stage.c: - * clutter/cogl/cogl.h: - * clutter/cogl/gl/cogl.c: - * clutter/cogl/gles/cogl.c: - * clutter/glx/clutter-backend-glx.c: - * clutter/glx/clutter-backend-glx.h: - * clutter/glx/clutter-glx.h: - * clutter/glx/clutter-stage-glx.c: - * clutter/glx/clutter-stage-glx.h: - Rejig the features() foo, moving mostly into backends/cogl. - -2007-05-15 Tomas Frydrych - - * clutter/clutter-actor.c: - (clutter_actor_get_abs_position): - Removed unnecessary CFX_MUL(). - -2007-05-15 Tomas Frydrych - - * clutter/clutter-behaviour-ellipse.h: - * clutter/clutter-behaviour-ellipse.c: - (clutter_behaviour_ellipse_new): - Added a tilt parameter. - -2007-05-14 Matthew Allum - - * clutter/clutter-behaviour-path.c: - Fix bug where last knot position wouldn't get reached. - - * clutter/clutter-group.c: - Add some docs - - * clutter/clutter-timeline.h: - * clutter/clutter-timeline.c: - Add clutter_timeline_copy (needed for ClutterEffect) - - * clutter/clutter-version.h.in: - Export windowing system / GL backend etc defines. - - * clutter/Makefile.am: - * clutter/clutter-effect.c: - * clutter/clutter-effect.h: - * clutter/clutter.h: - - * clutter/glx/clutter-backend-glx.c: - Minor clean ups. - - * clutter/clutter-alpha.h: - Add a fixme. - - * configure.ac: - Add FPU define. - - * examples/Makefile.am: - * examples/slider.c: - Add Robs slider game. - -2007-05-10 Matthew Allum - - * clutter/egl/clutter-backend-egl.c: - * clutter/egl/clutter-event-egl.c: - * clutter/sdl/clutter-backend-sdl.c: - * clutter/sdl/clutter-event-sdl.c: - Fix SDL & EGL backends to work with newer backend code. - -2007-05-10 Tomas Frydrych - - * clutter/clutter-color.h: - * clutter/clutter-color.c: - Added clutter_color_to/from_hlsx() - (clutter_color_to/from_hls): - Clobber hue to 0 .. 250 - -2007-05-10 Matthew Allum - - * clutter/clutter-backend.c: - * clutter/clutter-backend.h: - * clutter/clutter-event.c: - * clutter/clutter-main.c: - * clutter/clutter-private.h: - * clutter/glx/clutter-backend-glx.c: - * clutter/glx/clutter-backend-glx.h: - * clutter/glx/clutter-event-glx.c: - Rejig backend event code as to simplify a little. - NOTE: This breaks non glx backends. - - * tests/Makefile.am: - * tests/test-events.c: - Add a very simple event test. - - * tests/test-textures.c: (main): - Add some more sizes to the test. - -2007-05-05 Matthew Allum - - * clutter/clutter-texture.c: - Fix typos with new cogl using texture code. Fixes tiled textures. - Add a check for max npots size. - - * configure.ac: - * Makefile.am: - * tests/Makefile.am: - * tests/test-textures.c: - Add a simple texture test. - -2007-05-02 Matthew Allum - - * clutter/Makefile.am: - * clutter/clutter-stage.c: - * clutter/sdl/Makefile.am: - * clutter/sdl/clutter-backend-sdl.c: - * clutter/sdl/clutter-backend-sdl.h: - * clutter/sdl/clutter-event-sdl.c: - * clutter/sdl/clutter-sdl.h: - * clutter/sdl/clutter-stage-sdl.c: - * clutter/sdl/clutter-stage-sdl.h: - * configure.ac: - Add a basic SDL based backend. Lacks real input event handling - (translation) as yet. - Also allows for clutter to be built against dgles. - -2007-05-02 Matthew Allum - - * clutter/clutter-actor.c: - * clutter/cogl/gles/cogl.c: - Fix rotation + other fixed point cleanups. - - * clutter/clutter-texture.h: - Sketch out an updated API. - -2007-05-01 Matthew Allum - - * clutter/clutter-rectangle.c: - Comment out color match check for now as appears to be causing - borders to always get pained. - - * clutter/clutter-texture.h: - Add some format defines (unused as yet) - - * clutter/cogl/gles/cogl.c: - * clutter/egl/clutter-stage-egl.c: - * configure.ac: - Various OpenGL ES backend related fixes and tweaks. - -2007-04-30 Tomas Frydrych - - * clutter/clutter-fixed.c (clutter_sini): - Fixed bug in reducing angle to 0-2pi. - - * clutter/clutter-behaviour-ellipse.h: - * clutter/clutter-behaviour-ellipse.c: - * clutter/clutter.h: - * clutter/Makefile.am: - * doc/clutter.types: - * doc/clutter-docs.sgml: - Added ClutterBehaviourEllipse for movement along - elliptic paths. - - * examples/bspline.c: - * examples/behave.c: - * examples/Makefile.am: - Added --path commandline option to behave to choose different - path types (poly, ellipse, bspline) and dropped bspline example. - -2007-04-28 Matthew Allum - - * clutter/Makefile.am: - * clutter/clutter-debug.h: - * clutter/clutter-fixed.h: - * clutter/clutter-main.c: - * clutter/cogl/gles/Makefile.am: - * clutter/cogl/gles/cogl-defines.h: - * clutter/cogl/gles/cogl.c: - * clutter/egl/clutter-backend-egl.c: - * clutter/egl/clutter-backend-egl.h: - * clutter/egl/clutter-stage-egl.c: - * configure.ac: - Populate most stubs for cogl GL/ES implementation. - (against vincent - see http://svn.o-hand.com/repos/misc/ogles) - Add various fixups to EGL backend. - Code builds and runs (on 16bpp) but yet displays much (is close!) - - * clutter/pango/pangoclutter-render.c: - comment out some rouge glBegin/end calls. - -2007-04-27 Matthew Allum - - * clutter/Makefile.am: - * clutter/clutter-actor.c: - * clutter/clutter-clone-texture.c: - * clutter/clutter-rectangle.c: - * clutter/clutter-stage.c: - * clutter/clutter-texture.c: - * clutter/cogl/cogl.h: - * clutter/cogl/gl/Makefile.am: - * clutter/cogl/gl/cogl-defines.h: - * clutter/cogl/gl/cogl.c: - * clutter/cogl/gles/Makefile.am: - * clutter/cogl/gles/cogl-defines.h: - * clutter/cogl/gles/cogl.c: - * clutter/glx/Makefile.am: - * clutter/glx/clutter-stage-glx.c: - * clutter/pango/Makefile.am: - * clutter/pango/pangoclutter-render.c: - * configure.ac: - Add initial 'cogl' implementation. 'cogl' is a simple abstration - layer over GL and GL/ES used by clutter internally. It should - eventually allow clutter applications to be run on both GL and GL/ES - with just a recompile as well as provide more debugging and potentially - profiling information for GL and GL/ES usage. - - This commit contains the initial GL implementation. - -2007-04-26 Emmanuele Bassi - - Merge from clutter-0-2 - - * clutter/clutter-label.c: Unbreak the "use-markup" property - by actually passing the markup to pango_layout_set_markup(). - -2007-04-25 Emmanuele Bassi - - Merge from clutter.git/master - - * clutter/glx/clutter-event-glx.c: - * clutter/glx/clutter-stage-glx.c: Implement the _NET_WM_PING - protocol handling on the main stage window. - - * clutter/clutter-stage.h: - * clutter/clutter-stage.c: - * clutter/clutter-main.c: Handle CLUTTER_DELETE events internally, - by calling clutter_main_quit(), and remove the ::delete-event - signal from ClutterStage; clean up the signal emission sequence - for the events: emit the ::event signal before emitting any signal - and the ::event-after signal after the signal has been emitted; move - the signal emission calls inside ClutterStage so we can call - g_signal_emit() instead of g_signal_emit_by_name(), thus sparing us - a lookup for each event. - - * examples/test.c: Remove ::delete-event signal handling. - -2007-04-19 Emmanuele Bassi - - Merge from clutter.git/master - - * clutter/clutter-backend.h: - * clutter/clutter-backend.c: Add API for getting screen/display - properties from the backend. - - * clutter/glx/clutter-backend-glx.c: - * clutter/glx/clutter-backend-egl.c: Retrieve screen/display - properties inside the backends init function. - - * clutter/glx/clutter-event-glx.c: Handle the WM_PROTOCOLS - ClientMessage events. - - * clutter/glx/clutter-stage-glx.c: Use XSetWMProtocols to enable - the WM_PROTOCOLS ClientMessage events on the stage window. - - * clutter/glx/clutter-glx.h: Return the Screen pointer and not - the screen number in clutter_glx_get_default_screen(). The screen - number is returned by clutter_backend_get_screen_number(), or - by calling XScreenNumberOfScreen on the returned pointer. - - * clutter/clutter-event.h: Add CLUTTER_DELETE to the event types. - - * clutter/clutter-main.c: Emit the ClutterStage::delete-event - when receiving a CLUTTER_DELETE event; if the signal handlers - return FALSE, call clutter_main_quit(). - - * clutter/clutter-marshal.list: - * clutter/clutter-stage.c: Use the right marshaller function - for the delete-event closure. - - * examples/test.c: Test the "delete-event" signal handler. - -2007-04-16 Emmanuele Bassi - - Merge from clutter.git/merge-from-stable - - * clutter/clutter-event.h: - * clutter/glx/clutter-event-glx.c: Add the XEMBED protocol support - in the GLX backend, for embedding the stage window into another - X window. This allows cross-toolkit inclusion and makes clutter-gtk - possible. - - * clutter/clutter-behaviour-scale.c: Implement every ClutterGravity - value inside the scale behaviour and make the actors anchor to a - gravity when scaling up and down. - - * clutter/clutter-texture.c: Revert to copying GdkPixbuf areas to - correctly implement the texture tiling. This fixes segmentation - faults occurring with cards with a small texture memory area. - - * clutter/clutter-actor.c: Call g_object_freeze_notify() (and take - a reference on the actor) inside clutter_actor_request_size() so - that the notifications get unqueued at the end of the size request. - -2007-04-16 Emmanuele Bassi - - Merge from clutter.git/work - - * clutter/clutter-behaviour-bspline.[ch]: Return a ClutterBehaviour - when splicing the b-spline; fix the header and the API documentation; - hush the compiler warnings; kill of some pointer indirections. - - * clutter/clutter-behaviour-rotate.[ch]: Add a rotate behaviour, - with user defined axis, direction and sweep angle. - - * clutter/clutter-behaviour.c (clutter_behaviour_is_applied): Add - a parameter ISA check and return FALSE if it fails. - -2007-04-12 Tomas Frydrych - - * clutter/clutter-behaviour.h: - * clutter/clutter-behaviour.c: - * clutter/clutter-behaviour-path.h: - * clutter/clutter-behaviour-path.c: - Moved declaration of ClutterKnot from clutter-behaviour path - into clutter-behaviour. - - * clutter/clutter-fixed.h - * clutter/clutter-fixed.c - Added myself as an author. - - * clutter/Makefile.am: - * clutter/clutter.h: - * clutter/clutter-behaviour-bspline.h: - * clutter/clutter-behaviour-bspline.c: - Added new bezier spline behaviour. - - * examples/bspline.c: - * examples/Makefile.am: - An example of using bspline path. - -2007-04-07 Matthew Allum - - * clutter/glx/clutter-backend-glx.c: - Fix version check. - -2007-03-29 Tomas Frydrych - - * clutter/clutter-stage.c: - (perspective): fixed degree -> rad conversion for fovy angle - (perspectivex): fixed degree -> rad conversion for fovy angle, - added code for gle glMultMatrixx(). - -2007-03-29 Tomas Frydrych - - * configure.ac: fixed typo - - * clutter/clutter-fixed.c: - * clutter/clutter-fixed.h: - (clutter_tani): fast implementation of tan() - (clutter_qmulx): improved-precission fixed point multiply - - * clutter/clutter-stage.c: - (perspectivex): fixed point implementaiton of perspective() - (_clutter_stage_sync_viewport): - (clutter_stage_get_actor_at_pos): - use perspectivex() instead of perspective() - -2007-03-27 Matthew Allum - - * clutter/cogl/Makefile.am: - * clutter/cogl/cogl.h: - * clutter/cogl/gles/Makefile.am: - * clutter/cogl/gles/cogl.c: - Begin poplulating cogl GLES code. - - * configure.ac: - * clutter/egl/clutter-event-egl.c: - * clutter/egl/clutter-stage-egl.c: - * clutter/egl/clutter-stage-egl.h: - * clutter/egl/clutter-backend-egl.c: - * clutter/egl/clutter-backend-egl.h: - * clutter/egl/clutter-egl.h: - Add initial EGL/X backend work mostly ported from backend branch. - Builds but untested as yet. - - * clutter/glx/clutter-stage-glx.c: - Only include XFixes Header if we have have it. - - * clutter/clutter-behaviour.c: (clutter_behaviour_apply): - * clutter/clutter-behaviour.h: - Add clutter_behaviour_is_applied() - -2007-03-27 Emmanuele Bassi - - * clutter/clutter-stage.h: Remove unused clutter_stage_flush() - declaration. - -2007-03-27 Emmanuele Bassi - - * clutter/glx/clutter-glx.h: - * clutter/glx/clutter-stage-glx.c: (Re-)Implement the foreign - window setting function for the stage in the GLX backend. - -2007-03-27 Emmanuele Bassi - - * clutter/clutter-stage.h: Declare the clutter_perspective_get_type() - function in the header. - -2007-03-27 Emmanuele Bassi - - * clutter/cogl/cogl.h: Add header and compiler guards. - -2007-03-27 Emmanuele Bassi - - * clutter/glx/clutter-stage-glx.c: Remove the check in the - paint chain up: we know for sure that the parent's paint - vfunc is present. - -2007-03-27 Matthew Allum - - * clutter/clutter-feature.c: - Rejig ifdef's a little. Make drm vblanking Linux only. - - * clutter/clutter-stage.c: - * clutter/clutter-stage.h: - Add a perspective boxed type. - - * clutter/glx/clutter-stage-glx.c: - Add some FIXMEs - - * clutter/Makefile.am: - * clutter/cogl/Makefile.am: - * clutter/cogl/cogl.h: - * clutter/cogl/gl/Makefile.am: - * clutter/cogl/gl/cogl.c: - * configure.ac: - Very initial work on 'cogl' GL/GLES abstraction/utility code. - -2007-03-26 Emmanuele Bassi - - * clutter/clutter-behaviour-scale.[ch]: Add API for getting - the scale bounds and the gravity from a scale behaviour instance. - -2007-03-26 Emmanuele Bassi - - * clutter/clutter-timeline.c: Fix last commit. - -2007-03-25 Emmanuele Bassi - - * clutter/clutter-timeline.c: Slightly lower the proiority - of the ClutterTimeline tick, so that events get a higher - priority in the main loop. - -2007-03-25 Emmanuele Bassi - - * clutter/clutter-event.[ch]: Remove the flags member from - the ClutterEvent structure; remove the ClutterEventFlags - enum. - -2007-03-25 Emmanuele Bassi - - * clutter/clutter-stage.h: Remove the ::get_actor_at_pos() - and ::flush() vfuncs. - - * clutter/glx/clutter-stage-glx.c: Remove the implementations - of those vfuncs from the backend specific code, as they are - pure GL calls. - - * clutter/clutter-stage.c: Add back the actor hit detection - code in the base stage class, along with the viewport - synchronisation function. - - * clutter/clutter-private.h: Declare the private function - _clutter_stage_sync_viewport(). - -2007-03-23 Emmanuele Bassi - - * clutter/clutter-backend.c: Clear the event queue when - disposing the backend object; remove the initialisation - of the backend structure members... - - * clutter/glx/clutter-backend-glx.c: ... and keep it here - in the backends where it belongs. - -2007-03-23 Emmanuele Bassi - - * clutter/clutter-private.h: - * clutter/clutter-backend.h: Move the backend functions - into the private header. - - * clutter/glx/clutter-stage-glx.c: - * clutter/glx/clutter-event-glx.c: - * clutter/clutter-main.c: - * clutter/clutter-stage.c: Update the calls to the private - backend functions. - - * clutter/clutter-backend.[ch]: Add an ::init_features - vfunc to ClutterBackend. - -2007-03-23 Emmanuele Bassi - - * clutter/glx/clutter-stage-glx.c: - Make sure the top-left corner of the box is our origin, - when returning the allocation. - - * clutter/clutter-stage.c: - * clutter/clutter-group.c: Add tracing for the paint - method. - -2007-03-23 Matthew Allum - - * clutter/glx/clutter-stage-glx.c: - (clutter_stage_glx_allocate_coords): - Make new stage return correct width & height. - -2007-03-23 Emmanuele Bassi - - Assorted build fixes to pass distcheck. - - * clutter/glx/Makefile.am: Install the clutter-glx.h header. - - * clutter/Makefile.am: Actually apply linker flags. - - * configure.ac: Use a more readable CLUTTER_API_VERSION instead - of CLUTTER_MAJORMINOR; require gobject-2.0 with glib-2.0 >= 2.10, - as we are using GObject and the slice allocator from glib 2.10. - - * clutter.pc.in: Add the apiversion variable. - -2007-03-23 Emmanuele Bassi - - * clutter/clutter-event.c: Pop and peek the event queue - from the tail - it's a queue, not a stack. - - * clutter/clutter-private.h: - * clutter/clutter-main.c: Add a boolean signal accumulator. - - * clutter/clutter-stage.[ch]: Add an event argument to - the 'delete-event' signal; rename the 'input-event' signal - to 'event'; add the static scope flag to all the stage - events. - - * examples/*.c: Update. - -2007-03-22 Emmanuele Bassi - - * clutter.pc.in: Require gobject-2.0 too. - - * ChangeLog: Fix the previous commit log. - -2007-03-22 Emmanuele Bassi - - * clutter/clutter-private.h: Remove inclusion of backend-specific - headers; update the main context object; add the declarations for - the event queue functions. - - * clutter/clutter-backend.[ch]: Add the abstract ClutterBackend - object, which holds backend-specific settings, the main stage, - and the event queue. Every backend must implement a subclass of - ClutterBackend and ClutterStage. - - * clutter/clutter-feature.c: Protect the GLX specific calls - behing #ifdef HAVE_CLUTTER_GLX. - - * clutter/clutter-actor.c: - * clutter/clutter-group.c: - * clutter/clutter-clone-texture.c: Include GL/gl.h - - * clutter/clutter-event.[ch]: Update public API and implement the - event queue private API; hold a reference on the event objects; - move out the keysym-to-unicode table; add the new event types. - - * clutter/clutter-color.h: Include clutter-fixed.h - - * clutter/clutter-main.c: Update API; get the main stage - from the backend object; process the event received from the - queue; lock/unlock the main mutex if we have one; move the - initialisation process sooner in the init sequence, in order to - have the backend object when we check for options; call the - backed vfuncs in the pre/post parse hooks. - - * clutter/clutter-stage.c: Make ClutterStage and abstract class, - implemented by the backends. - - * clutter/clutter/glx/clutter-glx.h: - * clutter/clutter/glx/clutter-backend-glx.[ch]: - * clutter/clutter/glx/clutter-event-glx.c: - * clutter/clutter/glx/clutter-stage-glx.[ch]: - * clutter/clutter/glx/Makefile.am: Add the GLX backend. - - * clutter/clutter/egl/clutter-backend-egl.[ch]: - * clutter/clutter/egl/clutter-event-egl.c: - * clutter/clutter/egl/clutter-stage-egl.[ch]: - * clutter/clutter/egl/Makefile.am: Add the stub for a EGL backend. - - * examples/*.c: Update for the new API. - - * configure.ac: Check for the XFixes X extension; add a configure - switch for choosing the backend; show the backend we are building - in the summary. - - * clutter.pc.in: Add the backend to the exported variables. - - * clutter/Makefile.am: Install the headers in the - clutter-$api_version/clutter directory, as usual; call the shared - object libclutter-$backend-$api_version; build glue for the - backend static library. - -2007-03-19 Matthew Allum - - * clutter/clutter-label.c: - Simple doc fix. - * clutter/clutter-texture.c: (clutter_texture_get_pixbuf): - Backport of fix to get_pixbuf on non alpha textures from 0_2 branch. - -2007-03-19 Emmanuele Bassi - - * clutter/clutter-texture.c: Clean up code; add checks - in public API. - -2007-02-18 Matthew Allum - - * clutter/clutter-actor.c: (clutter_actor_reparent): - Add a FIXME re calling clutter_group here. - * clutter/clutter-group.c: - Fix clutter_group_remove_all - -2007-02-15 Matthew Allum - - * clutter/clutter-group.h: - Add missing clutter_group_remove_all declaration. - -2007-02-14 Matthew Allum - - * clutter/Makefile.am: - * clutter/clutter-main.c: - * clutter/clutter-stage.c: - * clutter/clutter-version.h.in: - * configure.ac: - * examples/super-oh.c: - Add CLUTTER_FLAVOUR define. - -2007-02-13 Matthew Allum - - * examples/super-oh.c: (screensaver_setup): - Fix example to build with new glx api - -2007-02-07 Emmanuele Bassi - - * clutter/clutter-debug.h: Define the CLUTTER_MARK() - macro even when CLUTTER_ENABLE_DEBUG is not - defined. (#215) - -2007-01-30 Tomas Frydrych - - * clutter/clutter-alpha.c: - (sincx1024_func): - (clutter_sine_func): - (clutter_sine_inc_func): - fixed the fixed point math. - -2007-01-30 Emmanuele Bassi - - * clutter/clutter-alpha.h: - * clutter/clutter-alpha.c: Add the square waveform - function clutter_square_func() to the precooked - alpha functions. - -2007-01-23 Matthew Allum - - * Makefile.am: - * clutter.pc.in: - * clutter/Makefile.am: - * clutter/clutter-backend-glx.c: - * clutter/clutter-backend-glx.h: - * clutter/clutter-event.c: - * clutter/clutter-feature.c: - * clutter/clutter-group.c: - * clutter/clutter-main.c: - * clutter/clutter-main.h: - * clutter/clutter-private.h: - * clutter/clutter-stage-glx.c: - * clutter/clutter-stage-glx.h: - * clutter/clutter-stage.c: - * clutter/clutter-stage.h: - * clutter/clutter-util.c: - * clutter/clutter-util.h: - * clutter/pango/pangoclutter-render.c: - * configure.ac: - * examples/Makefile.am: - Initial work in supporting different GL backends (ie. GLX/EGL/DirectFB etc). - Currently just GLX supported and now mostly self contained. - - * TODO: - Add a note about caching glenables - -2007-01-23 Tomas Frydrych - - * clutter/clutter-fixed.c: - (_clutter_double_to_fixed): - (_clutter_double_to_int): - Fixed to avoid problems with punned pointers and gcc - optimatisation. - - * clutter/pango/pangoclutter-private.h: - Simplified PANGO_PIXELS_26_6 macro. - - * clutter/pango/pangoclutter-font.c: - (_pango_clutter_font_new): - Replace floating with fixed point math. - -2007-01-19 Tomas Frydrych - - * clutter/clutter-fixed.c: (clutter_sqrti): - Use union instead of casting int <-> float to get rid of - punned-pointer warning and avoid gcc optimatisation breaking - the function on arm. - -2007-01-19 Emmanuele Bassi - - Allow the ClutterGroup subclasses to override the add and - remove operations. - - * clutter/clutter-group.c: Move the add and remove code from - clutter_group_add() and clutter_group_remove() to the signal - class closures; make the "add" and "remove" signals as - RUN_FIRST. - -2007-01-19 Tomas Frydrych - - * clutter/clutter-fixed.h.: - * clutter/clutter-fixed.c: - Added fast double to int and double to fixed point conversion - routines; changed CLUTTER_FLOAT_TO_FIXED to use it. - Replaced clutter_sqrti with fixed point implementation of the QIII - algorithm. - - - * clutter/clutter-behavior-path.c: use clutter_sqrti always - - * clutter/clutter-alpha.c: - (sinc_func): replaced double -> int cast with CLUTTER_FLOAT_TO_INT - - -2007-01-18 Emmanuele Bassi - - * configure.ac: Post release bump to 0.3.0. - -2007-01-18 =============== 0.2 Release ================================ - -2007-01-18 Matthew Allum - - * clutter.doap: - Update for 0.2 release - -2007-01-18 Emmanuele Bassi - - * clutter/clutter-group.h: Add public functions - clutter_group_get_n_children() and clutter_group_get_nth_child(). - - * clutter/clutter-behaviour.h: - * clutter/clutter-behaviour.c: Fix header alignment; fix argument - name for apidoc. - -2007-01-18 Emmanuele Bassi - - * clutter/Makefile.am: Use the build dir when linking to the - internal pango clutter renderer. - -2007-01-18 Tomas Frydrych - - * clutter/clutter-fixed.h: fixed a typo in comment - -2007-01-18 Emmanuele Bassi - - * clutter/clutter-fixed.h: Remove some inline documentation to - make the header more readable. - - * clutter/clutter-behaviour.c: The actors are store inside a - GSList and not in a GList, so change the list operations to - use the right API. - -2007-01-18 Tomas Frydrych - - * clutter/clutter-color.c: - (clutter_color_darken): - (clutter_color_lighten): - Changed calls to clutter_color_shade calls to clutter_color_shadex - -2007-01-17 Matthew Allum - - * configure.ac: - Bump up version to 0.2.0 - -2007-01-17 Tomas Frydrych - * configure.ac: - * clutter/clutter-behavior-path.c: - Added --without-fpu option. - - * doc/refrence/tmpl/clutter-fixed.sgml: - * clutter/clutter-fixed.c: - * clutter/clutter-fixed.h: - Documentation for fixed point API. - - * AUTHORS: added self. - -2007-01-17 Emmanuele Bassi - - * clutter/clutter-feature.h: - * clutter/clutter-feature.c: Move the GL headers from the - header file to the body. - - * clutter/clutter-fixed.h: - * clutter/clutter-fixed.c: Fix apidoc. - - * clutter/clutter-color.h: - * clutter/clutter-color.c: Ditto. - -2007-01-17 Tomas Frydrych - - * clutter/clutter-fixed.h: - * clutter/clutter-fixed.c: - * clutter/clutter-alpha.c: - Renamed clutter_fixed_sin() to clutter_sinx() and - clutter_angle_sin() to clutter_sini(); added clutter_sqrtx() - and clutter_sqrti(); added missing copyright. - - * clutter/clutter-behavior.c: - replaced call to sqrt() with clutter_sqrti() - - * clutter/clutter-behavior-scale.c: - (clutter_behaviour_scale_alpha_notify): - Replaced floating point math with fixed point. - -2007-01-16 Emmanuele Bassi - - * clutter/clutter-feature.c: Use clutter_vblank_method() to - get the VBlank method name from the environment variable OR - the command line switch. - - (clutter_feature_do_init): Move the check on the features - state here, to avoid an expensive function call, and inline - the function. - - * clutter/clutter-fixed.c: Fix gtk-doc. - - * clutter/clutter-main.c: Add a --clutter-vblank command line - switch controlling the VBlank method to be used: it overrides - the CLUTTER_VBLANK environment variable. - - (pre_parse_hook), (clutter_init), - (clutter_init_with_args): Move thread initialisation before - type init, to avoid the warning that comes with newer GLib - versions. - - * clutter/clutter-group.h: - * clutter/clutter-group.c: Mark clutter_group_show_all() and - clutter_group_hide_all() as deprecated. - -2007-01-16 Matthew Allum - - * NEWS: - Minor tweaks - - * TODO: - Sync up, mainly with 0.3 todo items - - * clutter/clutter-behaviour.c: - * clutter/clutter-behaviour.h: - clutter_behaviour_get_n_actors() / clutter_behaviour_get_nth_actor() - Additions. - - * clutter/clutter-stage.c: (clutter_stage_realize): - Experimental (disabled) visual setting code. - - * clutter/clutter-feature.c: - Check for GL_EXT_texture_rectangle (#198 - Frederick Riss) - - * clutter/clutter-group.c: (clutter_group_allocate_coords): - Fix for group size allocation (#199 - Frederick Riss) - - * clutter/clutter-texture.c: (texture_upload_data): - Fix texture unpacking row length (#197 Frederick Riss) - - * examples/Makefile.am: - Fix LDADD in build (#196 - Frederick Riss) - -2007-01-16 Tomas Frydrych - - * clutter/clutter-fixed.h: - Added integer ClutterAngle type, protype of clutter_angle_sin, - convenience macros clutter_fixed_cos and clutter_angle_cos, plus - other convenience macros for commonly used constants and ops. - * clutter/clutter-fixed.c: - (clutter_fixed_sin): - Fixed to work for negative angles. - (clutter_angle_sin): - Fast fixed point sin function for ClutterAngle angles. - * clutter/clutter-alpha.c: - (clutter_sin_func, clutter_sin_inc_func): - Changed to use clutter_angle_sin function. - * clutter-behavior-path.c: - replaced floating point with fixed point operations - * clutter/clutter-color.c: - * clutter/clutter-color.h: - Added (clutter_color_shadex), replaced floating point operations - with fixed point - -2007-01-15 Tomas Frydrych - - * clutter/clutter-fixed.h: (CLUTTER_FIXED_TO_DOUBLE/FLOAT): - Fixed macro so it works for negative values. - * clutter/clutter-fixed.c: (clutter_fixed_sin): - Implemented fixed point sin function. - * clutter/clutter-alpha.c: (clutter_sin_func, clutter_sin_inc_func): - Pluged in fixed point sin function. - -2007-01-07 Matthew Allum - - * clutter/clutter-actor.c: (clutter_actor_allocate_coords): - Fix an amazingly not noticed until now typo. - Minor doc tweaks. - - * clutter/clutter-behaviour-opacity.c: - (clutter_behaviour_alpha_notify): - Take into account initial opacity value when calculating from alpha. - - * clutter/clutter-group.c: - Add new get_nth_child() and get_n_children() api calls. - -2007-01-04 Matthew Allum - - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - Add new set_width/height API calls. - Tweak scaling by reseting matrix. - Make set_opactiy() take parent opacity into account. - Fix clipping. - - * clutter/clutter-alpha.c: - Add more sine functionality. - - * clutter/clutter-behaviour-opacity.c: - Dont make a copy of all applied actors but use a foreach() - - * clutter/clutter-behaviour-scale.c: - Give correct limits to propertys. - Tweak gravity a little more. - Update docs. -: - * clutter/clutter-behaviour.c: (clutter_behaviour_remove): - Minor warning text change. - - * clutter/clutter-feature.c: (clutter_feature_wait_for_vblank): - Minor dri ioctl tweak. - - * clutter/clutter-label.c: - * clutter/clutter-label.h: - Add new label_full api call. - -2006-12-27 Emmanuele Bassi - - * clutter/clutter-stage.[ch]: - * clutter/clutter-event.[ch]: Revert changes; this is what - happens when you keep old tree around. - -2006-12-27 Emmanuele Bassi - - * clutter/clutter-color.h: - * clutter/clutter-color.c: Add clutter_color_to_string(), - which creates a hex-encoded color string from a ClutterColor. - -2006-12-20 Matthew Allum - - * NEWS: - Add some missing improvements. - -2006-12-17 Emmanuele Bassi - - * clutter/clutter-label.c: Remove some gtk-isms; always take - a reference before calling g_object_notify(), as the object - might get disposed while calling the closures inside the - notify queue; notify the changes of the ellipsize property. - -2006-12-14 Emmanuele Bassi - - * clutter/clutter-color.h: - * clutter/clutter-color.c: Expose clutter_color_copy() - and clutter_color_free() for the python bindings, so that - they can manager the conversion automatically; use the - slice allocator when copying/freeing a ClutterColor. - -2006-12-13 Emmanuele Bassi - - * clutter/clutter-color.h: - * clutter/clutter-color.c: Add clutter_color_equal(), - a function for comparing two colors. - - * clutter/clutter-rectangle.c: - (clutter_rectangle_set_color), - (clutter_rectangle_set_border_color): Unset the border if - the color of the rectangle and the color of the border are - the same. - -2006-12-13 Emmanuele Bassi - - * clutter/clutter-actor.c: - * clutter/clutter-clone-texture.c: - * clutter/clutter-event.h: - * clutter/clutter-stage.c: - * clutter/clutter-texture.c: - * clutter/clutter-timeline.c: Update the inline apidoc. - -2006-12-13 Matthew Allum - - * clutter/clutter-actor.c: (clutter_actor_class_init): - Allow actor x,y props to be negative. - -2006-12-12 Emmanuele Bassi - - Rework part of the show/hide machinery. Allow groups sub-classes - and composite actors to override show_all/hide_all in order to - decide which children they wish to show/hide. This means that - if an actor overrides the default show/hide virtual methods, it'll - have to chain up to the parent class show/hide. While we're at it, - provide the fully recursive clutter_actor_show_all() and - clutter_actor_hide_all() methods. - - * clutter/clutter-behaviour-path.c: Add apidoc for the ClutterKnot - functions; add pathological equality case for clutter_knot_equal(). - - * clutter/clutter-event.h: - * clutter/clutter-feature.h: - * clutter/clutter-behaviour.c: - * clutter/clutter-behaviour-scale.c:Fix parameters name so that - gtk-doc doesn't complain. - - * clutter/clutter-actor.c: - * clutter/clutter-event.c: Add apidoc - - * clutter/clutter-actor.h: - * clutter/clutter-actor.c: Add a clutter_actor_show_all() and a - clutter_actor_hide_all() functions; provide a mechanism for - groups and composited actors to programmatically select what to - show/hide when clutter_actor_show_all() and clutter_actor_hide_all() - are called. If you are overriding the ClutterActor::show or - the ClutterActor::hide virtual methods you should chain up with - the parent class. - - * clutter/clutter-group.c: Override show_all and hide_all and - recursively show/hide every child inside the group; - clutter_group_show_all() and clutter_group_hide_all() remain as non - recursive versions of clutter_actor_show_all() and - clutter_actor_hide_all() (maybe we should rename them in order - to avoid name clashes with the bindings). - - * clutter/clutter-stage.c: - * clutter/clutter-texture.c: Chain up with parent class show - and hide vfuncs. - - * clutter/clutter-clone-texture.h: - * clutter/clutter-clone-texture.c: Provide API for changing the - parent texture of a clone texture actor. - - * examples/behave.c: - * examples/super-oh.c: - * examples/test.c: Use clutter_actor_show_all() instead of - clutter_group_show_all(). - -2006-12-08 Matthew Allum - - * clutter.doap: - Put release date in correct format. - -2006-12-08 Emmanuele Bassi - - * clutter/clutter-behaviour.h: Add a function prototype - for the foreach function: we need something more specific - than GFunc; add clutter_behaviour_get_actors(), used to - get a list of the actors. - - * clutter/clutter-behaviour.c: Add debugging notes; add - a warning for behaviour implementations missing the - alpha_notify vfunc; add api documentation - - * clutter/clutter-behaviour-opacity.c: - * clutter/clutter-behaviour-path.c: - * clutter/clutter-behaviour-scale.c: Reimplement the - alpha_notify functions using the new foreach function - and, where possible, by directly iterating on the - actors: this shaves off the number of recalculations - of the property/alpha values, and the number of - functions. - -2006-12-05 Emmanuele Bassi - - * clutter/clutter-rectangle.c: Forgot to set the - pencil color. - -2006-12-05 Emmanuele Bassi - - * behave.c: Add test for clutter_color_parse(). - -2006-12-05 Emmanuele Bassi - - * clutter/clutter-event.c: Move the apidoc out. - -2006-12-05 Emmanuele Bassi - - * clutter/clutter-color.h: - * clutter/clutter-color.c: Add clutter_color_parse(), - which parses a string containing a color definition as - understood by XParseColor() (or pango_color_parse()). - -2006-12-04 Emmanuele Bassi - - Avoid clutter segfaulting when used without invoking - clutter_init(). This is needed when using api documentation - tools and every other tool relying on the GObject - introspection API (esp. on a headless box). see the - note in clutter/clutter-feature.c:clutter_feature_init - for a full explanation. - - * clutter/clutter-feature.c: Call clutter_feature_init() - when needed by one of the accessors of the features - structure. - - * clutter/clutter-main.c: - * clutter/clutter-private.h: Remove clutter_feature_init() - public declaration: the features support check is done the - first time a feature is needed. - - * clutter/clutter-main.c: Do not ever access the clutter - main context pointer directly; instead, obtain a pointer - to it via clutter_context_get_default(), which will always - return something valid. - -2006-12-04 Emmanuele Bassi - - * clutter/clutter-private.h: Add our own READABLE, - WRITABLE and READWRITE paramspec flags, declaring the - string components of the properties GParamSpec as static; - this should shave off some bytes in the memory footprint - and avoid relocations. - - * clutter/clutter-actor.c: - * clutter/clutter-behaviour.c: - * clutter/clutter-behaviour-opacity.c: - * clutter/clutter-behaviour-path.c: - * clutter/clutter-behavuour-scale.c: - * clutter/clutter-clone-texture.c: - * clutter/clutter-label.c: - * clutter/clutter-rectangle.c: - * clutter/clutter-stage.c: - * clutter/clutter-texture.c: - * clutter/clutter-timeline.c: Use the CLUTTER_PARAM_* - macros we just added. - - * clutter/clutter-behaviour-scale.c: Add properties for - the scale begin, scale end and gravity parameters. - - * clutter/clutter-behaviour-path.h: Mark the ClutterKnot - memory management functions as public (for the bindings), - since we use the slice allocator for copying knots around; - add a clutter_knot_equal() function. - - * clutter/clutter-behaviour-path.c: - (node_distance): Use clutter_knot_equal() as a fast path - to avoid the sqrt() in case the nodes we are using are - at the same position. - (path_total_length): Additional check on the existence - of the next node. - - * examples/behave.c: Do not leak the ClutterBehaviour - objects around. - -2006-12-03 Emmanuele Bassi - - * clutter/clutter-texture.h: Clean up. - - * clutter/clutter-texture.c: Typo fix in the name - of ClutterTextureTileDimension. - - * clutter/clutter-behaviour.c: Allow passing NULL - to clutter_behaviour_set_alpha() (as we pass NULL - in the finalize process). - -2006-12-02 Emmanuele Bassi - - * clutter/clutter-version.h.in: Fix a stupid logic - error in the CHECK_VERSION macro. - -2006-11-30 Matthew Allum - - * clutter.doap: - Updates - -2006-11-30 Emmanuele Bassi - - * clutter/clutter-stage.h: - * clutter/clutter-stage.c: - (clutter_stage_swap_buffers): Remove, as the same is done - via clutter_redraw() and clutter_actor_queue_redraw(). - - (clutter_stage_unrealize), (clutter_stage_init), - (clutter_stage_set_xwindow_foreign): Do not call - XDestroyWindow() on the stage Window if we are using a - foreign Window, as we don't control its lifetime. - -2006-11-30 Emmanuele Bassi - - * Makefile.am: Remove the gtk directory from the SUBDIRS. - - * clutter/clutter-stage.h: - * clutter/clutter-stage.c: Add clutter_stage_swap_buffers(), - which swaps the GL buffers. This fixes the redraw in the - GTK widget. - -2006-11-29 Emmanuele Bassi - - * clutter/clutter-stage.c: - (clutter_stage_set_xwindow_foreign): Add checks; - remove an indirection to the private data. - -2006-11-29 Emmanuele Bassi - - * gtk/* - * configure.ac: - * Makfile.am: Remove the GTK+ widget from the - main tree; now Clutter depends just on GLib, - XLibs, GdkPixbuf and OpenGL. - -2006-11-29 Matthew Allum - - * clutter/clutter-stage.c: (clutter_stage_realize): - Set colormap on stage window - should fix issues - with indirect rendering. - -2006-11-23 Matthew Allum - - * clutter/clutter-debug.h: - Fix small macro typo. - -2006-11-22 Matthew Allum - - * clutter/clutter-actor.c: - * clutter/clutter-alpha.c: - * clutter/clutter-behaviour-opacity.c: - * clutter/clutter-behaviour-scale.c: - * clutter/clutter-clone-texture.c: - * clutter/clutter-feature.c: - * clutter/clutter-label.c: - * clutter/clutter-main.c: - * clutter/clutter-stage.c: - * clutter/clutter-texture.c - * clutter/clutter-timeline.c: - * clutter/clutter-debug.h: - Make CLUTTER_NOTE() just take a string rather than a func. - Add more default context to output. - - * configure.ac: - Fix flag and add more help docs for --ebable-debug option. - -2006-11-21 Emmanuele Bassi - - * clutter/clutter-main.c: Add a --g-fatal-warnings switch - for abort()-ing on warnings and criticals. - -2006-11-21 Emmanuele Bassi - - * configure.ac: Enable debug messages also when - --enable-debug is set to "minimum". - - * clutter/Makefile.am: - * clutter/clutter-debug.h: Move all debugging macros inside - this private header; make all debug macros depend on the - CLUTTER_ENABLE_DEBUG compile time define, controlled by - the --enable-debug configure switch; add G_LOG_DOMAIN define. - - * clutter/clutter-main.c: Clean up the debug stuff; add - command line argument parsing using GOption; the debug - messages now are triggered like this: - - CLUTTER_DEBUG=section:section:... clutter-app - - or like this: - - clutter-app --clutter-debug=section:section:... - - where "section" is one of the sections listed in clutter-main.c, - or "all", for all sections; each section is bound to a flag, - which can be used to define a domain when adding a debug note - using the CLUTTER_NOTE() macro; the old CLUTTER_DBG() macro is - just a wrapper around that, under the CLUTTER_DEBUG_MISC domain; - CLUTTER_NOTE() is used like this: - - CLUTTER_NOTE (DOMAIN, log-function); - - where log function is g_printerr(), g_message(), g_warning(), - g_critical() or directly g_log() - for instance: - - CLUTTER_NOTE (PANGO, g_warning ("Cache miss: %d", glyph)); - - will print the warning only if the "pango" flag has been - set to the CLUTTER_DEBUG envvar or passed to the --clutter-debug - command line argument. - - similar to CLUTTER_SHOW_FPS, there's also the --clutter-show-fps - command line switch; also, the --display and --screen command - line switches have been added: the first overrides the DISPLAY - envvar and the second controls the X screen used by Clutter to - get the root window on the display. - - * clutter/clutter-main.h: - * clutter/clutter-main.c: Add extended support for GOption - in Clutter; use clutter_init_with_args() to let Clutter - parse your own command line arguments; use instead - clutter_get_option_group() to get the GOptionGroup used by - Clutter if you want to do the parsing yourself with - g_option_context_parse(). The init sequence has been verified, - updated and moved into common functions where possible. - - * clutter/pango/pangoclutter-render.c: - * clutter/*.c: Include "clutter-debug.h" where needed; use - CLUTTER_NOTE() instead of CLUTTER_DBG(). - - * examples/super-oh.c: Use the new clutter_init_with_args() - function, and add a --num-hands command line switch to - the SuperOH example code controlling the number of hands at - runtime. - -2006-11-21 Emmanuele Bassi - - * configure.ac: Rename G_ENABLE_DEBUG to CLUTTER_ENABLE_DEBUG. - -2006-11-20 Emmanuele Bassi - - * clutter/clutter-rectangle.h: - * clutter/clutter-rectangle.c: Add border to the ClutterRectangle - actor; add "border-width", "border-color" and "has-border" - properties, plus their accessors. The border generation code is - pretty lame, at the moment. - - * examples/behave.c: Add code to test the new rectangle properties. - -2006-11-20 Matthew Allum - - * clutter.doap: - Add an initial DOAP file to project - -2006-11-20 Emmanuele Bassi - - * clutter/Makefile.am: - * clutter/clutter.h: - * clutter/clutter-version.h.in: Auto-generated versioning macros. - - * clutter/clutter-actor.h: - * clutter/clutter-actor.c: Add a ClutterActor::parent-set signal, - for notificating changes of an actor's parent; add api-doc for - the actor's properties; add the ClutterActor "name" property; clean - up a bit some functions; emit the "parent-set" signal when setting - te parent and when unparenting; better warnings when lowering - and raising an actor. - - * configure.ac: - * clutter/Makefile.am: Add a --enable-debug configure option, - with three levels of debugging: no, minimum and yes; default - for development releases (odd minor version) is "yes"; update - the version m4 defines; update the libtool macros: now just - changed the clutter_interface_age when releasing will update - everything else. - -2006-11-17 Emmanuele Bassi - - * clutter/clutter-behaviour-path.h: - * clutter/clutter-behaviour-path.c: Add "since" strings; add - a "knot" property which can be used to append a knot to the path; - fix apidoc. - - * clutter/clutter-alpha.c: Add "since" strings. - - * clutter/clutter-feature.c: Add apidoc. - - * clutter/clutter-behaviour-opacity.c: Add the "opacity-start" - and "opacity-end" properties; rewrite constructor to use them. - -2006-11-17 Emmanuele Bassi - - * clutter/clutter-behaviour-path.h: - * clutter/clutter-behaviour-path.c: Add a "knot-reached" signal, - which is emitted when the path reaches a node in the nodes list; - flesh out the documentation a bit; sync the parameters names - so that gtk-doc doesn't complain about missing stuff. - - * clutter/clutter-behaviour.h: - * clutter/clutter-behaviour.c: Add the alpha value to the - ClutterBehaviour::alpha_notify vfunc, so you don't have to - get the value from the alpha inside the behaviour implementations; - add more documentation. - - * clutter/clutter-alpha.c: Flesh out the description. - - * clutter/clutter-actor.h: Update the header. - - * clutter/clutter-behaviour-opacity.c: - * clutter/clutter-behaviour-scale.c: Update docs. - -2006-11-17 Matthew Allum - - * clutter/clutter-alpha.c: - * clutter/clutter-behaviour-opacity.c: - More docs. - - * clutter/clutter-behaviour-path.h: - * clutter/clutter-behaviour-path.c: - More docs, add clutter_behaviour_path_insert_knot(), - clutter_behaviour_path_remove_knot() - - * clutter/clutter-behaviour-scale.h: - * clutter/clutter-behaviour-scale.c: - More docs, add clutter_behaviour_scale_newx() taking fixed values. - - * clutter/Makefile.am: - * clutter/pango/Makefile.am: - Fix linking warning. - -2006-11-15 Matthew Allum - - * clutter/clutter-actor.h: - * clutter/clutter-actor.c: - Add new API clutter_actor_move_by(), clutter_actor_get_size() - - * clutter/clutter-alpha.c: - * clutter/clutter-alpha.h: - Add clutter alpha sine func - - * clutter/clutter-behaviours.h: - * clutter/clutter-behaviours.c: - Add a basic scale behaviour (needs work) - - * examples/behave.c: (main): - More playing with new behaviour functionality - - * clutter/clutter-feature.c: - * clutter/clutter-feature.h: - * clutter/clutter-main.c: - Add new experimental sync to vblank code - Set env CLUTTER_VBLANK=none to disable. - -2006-11-16 Emmanuele Bassi - - * clutter/clutter-private.h: - * clutter/clutter-actor.c: Implement the defined - clutter_actor_reparent() method; call unrealize - when unparenting an actor. - -2006-11-15 Emmanuele Bassi - - * clutter/clutter-alpha.h: - * clutter/clutter-alpha.c: Add a data parameter to - the ClutterAlphaFunc; add a data+destroy parameter - to clutter_alpha_set_func() and to clutter_alpha_new(), - and turned the latter into clutter_alpha_new_full(); - add a simple, empty constructor clutter_alpha_new(). - - These changes makes writing bindings a tad more easy, - as bindings require passing their own functions in - order to call the real alpha function. - - * clutter/clutter-behaviour.h: Clean up the header. - - * clutter/clutter-behaviours.[ch]: - * clutter/clutter-behaviour-opacity.[ch]: - * clutter/clutter-behaviour-path.[ch]: - * clutter/clutter-behaviour-scale.[ch]: Split the - ClutterBehaviourPath, ClutterBehaviourOpacity and - ClutterBehaviourScale into their own files as they - have been growing a bit. Fix ClutterBehaviourPath - API. - - * clutter/clutter-media.h: Remove the commented - "metadata_available" signal: gtk-doc chokes up on that. - - * clutter/clutter-timeline.h: - * clutter/clutter-timeline.c: Remove the useless - ClutterTimelineAlphaFunc signature; add missing accessor - methods for the properties; clean up a bit. - - * clutter/clutter-util.h: - * clutter/clutter-util.c: Remove unneeded function - clutter_util_can_create_texture(). - - * clutter/clutter-feature.h: Sync the name of - clutter_feature_get_all() with the name declared - in clutter-feature.h. - - * clutter/Makefile.am: - * clutter/clutter.h: Update. - - * examples/behave.c: Update to the new ClutterAlpha - constructor. - - * examples/super-oh.c: Use the right pointer and avoid - the compiler making a fuss about it. - -2006-11-15 Matthew Allum - - * clutter/clutter-actor.h: - * clutter/clutter-actor.c: - Add new API clutter_actor_move_by(), clutter_actor_get_size() - - * clutter/clutter-alpha.c: - * clutter/clutter-alpha.h: - Add clutter alpha sine func - - * clutter/clutter-behaviours.h: - * clutter/clutter-behaviours.c: - Add a basic scale behaviour (needs work) - - * examples/behave.c: (main): - More playing with new behaviour functionality - - * clutter/clutter-feature.c: - * clutter/clutter-feature.h: - * clutter/clutter-main.c: - Add new experimental sync to vblank code - Set env CLUTTER_VBLANK=none to disable. - -2006-11-15 Emmanuele Bassi - - * clutter/clutter-alpha.h: - * clutter/clutter-alpha.c: ClutterAlpha is an initially - floating object, as it makes sense only when bound to - a ClutterBehaviour; add checks for public API. - - * clutter/clutter-behaviour.h: - * clutter/clutter-behaviour.c: Remove the ClutterBehaviour - constructor: ClutterBehaviour is an abstract class which - must be implemented by subclassing; add checks for public - API; unref the actors on finalize; sink the ClutterAlpha - object. - - * clutter/clutter-behaviours.h: ClutterKnot is a boxed - type: add the _get_type() function declaration and the - type macro. - -2006-10-23 Matthew Allum - - * clutter/clutter-alpha.h: - * clutter/clutter-behaviour.c: - * clutter/clutter-behaviour.h: - * clutter/clutter-behaviours.c: - * clutter/clutter-behaviours.h: - * examples/behave.c: - Behaviours now only 'driven' by ClutterAlpha, not any object/prop. - Add simple Clutter path behaviour. - -2006-10-03 Matthew Allum - - * configure.ac: - * clutter/Makefile.am: - * clutter/clutter-actor.c: - * clutter/clutter-label.c: - * clutter/clutter-label.h: - * clutter/pango/Makefile.am: - * clutter/pango/pangoclutter-font.c: - * clutter/pango/pangoclutter-fontmap.c: - * clutter/pango/pangoclutter-private.h: - * clutter/pango/pangoclutter-render.c: - * clutter/pango/pangoclutter.h: - Add initial rough new pango renderer and clutter-label. - - * examples/super-oh.c: - * examples/test.c: - Minor fixups - -2006-09-20 Matthew Allum - - * clutter/clutter-actor.c: (clutter_actor_paint): - * clutter/clutter-clone-texture.c: (clutter_clone_texture_paint): - * clutter/clutter-group.c: (clutter_group_paint): - * clutter/clutter-rectangle.c: (clutter_rectangle_paint): - * clutter/clutter-texture.c: (clutter_texture_paint): - Fix for #156. - clutter_actor_paint() now translates to actor position as - to not fix scaled groups positioning. Sub classes now paint - at 0,0. - -2006-09-19 Matthew Allum - - * clutter/clutter-actor.c: (redraw_update_idle), - (clutter_actor_queue_redraw): - * clutter/clutter-main.c: (clutter_redraw): - Remove now uneeded locks - ( new gst and texture code makes redundant ) - - * clutter/clutter-texture.c: - * clutter/clutter-texture.h: - Redo clutter texture as to not keep a reference - to underlying texture. - -2006-09-15 Matthew Allum - - More fixes from Bastien Nocera (#155): - - * clutter/clutter-main.c: (clutter_init): - * clutter/clutter-main.h: - Add an enum for clutter init to return an error code. - * configure.ac: - Dont check for XInitThreads, there is no need, its part of xlib. - -2006-09-14 Matthew Allum - - Various fixes from Bastien Nocera: - - * clutter/clutter-event.h: - * clutter/clutter-stage.c: (clutter_stage_unrealize), - (clutter_stage_realize), (clutter_stage_request_coords), - (clutter_stage_dispose), (clutter_stage_init): - * clutter/clutter-stage.h: - * gtk/gtk-clutter-test.c: (input_cb), (frame_cb), (main): - * gtk/gtk-clutter.c: (realize): - Misc fixes (#152) - - * clutter/clutter-group.c: (clutter_group_remove): - Remove uneeded ref count (#143) - - * examples/super-oh.c: (input_cb): - Handle key release rather than presses (#154) - - * configure.ac: - Add old style X libs check when x11.pc unavailable (#101) - -2006-09-01 Matthew Allum - - * clutter/Makefile.am: - * clutter/clutter-media.c: - * clutter/clutter-media.h: - * clutter/clutter.h: - Re-add clutter media. - -2006-08-31 Matthew Allum - - * clutter/clutter-actor.c: - * clutter/clutter-group.c: (clutter_group_paint), - (clutter_group_request_coords), (clutter_group_allocate_coords), - (clutter_group_add): - Fix some group sizing/positioning issues. - -2006-08-30 Jorn Baayen - - * clutter.pc.in: - - Remove gstreamer deps. - -2006-08-30 Jorn Baayen - - * README: - * clutter/Makefile.am: - * clutter/clutter-audio.c: - * clutter/clutter-audio.h: - * clutter/clutter-main.c: (clutter_init): - * clutter/clutter-media.c: - * clutter/clutter-media.h: - * clutter/clutter-video-texture.c: - * clutter/clutter-video-texture.h: - * clutter/clutter.h: - * configure.ac: - * examples/Makefile.am: - * examples/README: - * examples/video-cube.c: - * examples/video-player.c: - * gst/Makefile.am: - * gst/clutterimagesink.: - * gst/clutterimagesink.c: - * gst/clutterimagesink.h: - * gtk/Makefile.am: - - Remove gstreamer bits. There live in clutter-gst now. - -2006-08-30 Jorn Baayen - - * clutter/Makefile.am: - * clutter/clutter-audio.c: - * clutter/clutter-audio.h: - * clutter/clutter.h: - - Added ClutterAudio audio playback object. - -2006-08-29 Matthew Allum - - * clutter/clutter-fixed.h: - Add basic fixed point utility defines and type. - - * clutter/Makefile.am: - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - * clutter/clutter-group.c: - * clutter/clutter-stage.c: - * examples/super-oh.c: (main): - Add scale API and functionality. - Rework group sizing. Now group size requests have no effect - but can be scaled. - -2006-08-29 Jorn Baayen - - * clutter/clutter-behaviour.c: (_clutter_behaviour_finalize), - (_clutter_behaviour_set_property), - (_clutter_behaviour_get_property), (clutter_behaviour_class_init), - (clutter_behaviour_init), (clutter_behaviour_apply), - (clutter_behaviour_remove), (clutter_behaviour_remove_all), - (clutter_behaviour_actors_foreach): - * clutter/clutter-behaviour.h: - * clutter/clutter-behaviours.c: - (clutter_behaviour_property_change), - (clutter_behaviour_opacity_dispose), - (clutter_behaviour_opacity_finalize), - (clutter_behaviour_opacity_class_init), - (clutter_behaviour_opacity_init): - * clutter/clutter-behaviours.h: - * clutter/clutter-marshal.list: - * examples/behave.c: (main): - - Behaviours track generic GObject properties. - - * clutter/clutter-video-texture.h: - - Remove signal prototypes - they are already specified in - clutter-media.h. - -2006-08-28 Jorn Baayen - - * clutter/Makefile.am: - * clutter/clutter-alpha.c: - * clutter/clutter-alpha.h: - * clutter/clutter-behaviours.c: - (clutter_behaviour_opacity_dispose), - (clutter_behaviour_opacity_init), - (clutter_behaviour_opacity_frame_foreach), - (clutter_behaviour_opacity_frame): - * clutter/clutter-behaviours.h: - * clutter/clutter-timeline.c: (clutter_timeline_class_init): - * clutter/clutter-timeline.h: - * clutter/clutter.h: - * examples/behave.c: (main): - - Separate alpha calculation into its own class. - - * clutter/clutter-behaviour.c: (clutter_behaviour_set_timelime): - - Correct NULL check. - -2006-08-15 Matthew Allum - - * clutter/clutter-behaviour.h: - Behaviours shouldn't subclass timelines. - -2006-08-15 Matthew Allum - - * clutter/clutter-behaviour.c: - * clutter/clutter-behaviour.h: - * clutter/clutter-behaviours.c: - * clutter/clutter-timeline.c: - * clutter/clutter-timeline.h: - * clutter/clutter.h: - Make basic behaviour infrastructure actually work. - - * examples/Makefile.am: - * examples/behave.c: - Add a simple behaviour demo/test - - * clutter/clutter-media.c: (clutter_media_set_volume): - Actuall set volume rather than position.. (Fixes #141) - -2006-08-14 Matthew Allum - - * clutter/Makefile.am: - * clutter/clutter-behaviour.c: - * clutter/clutter-behaviour.h: - * clutter/clutter-behaviours.c: - * clutter/clutter-behaviours.h: - * clutter/clutter-timeline.c: - * clutter/clutter-timeline.h: - Add very initial new behaviour functionality. - - * clutter/clutter-stage.c: - * clutter/clutter-main.c: - * clutter/clutter-actor.c: - Improve clipping using stencil test rather than scissor check. - ( Should now handle rotated clips etc ). - - * clutter/clutter-group.c: (clutter_group_paint): - Fix typo on position check. - -2006-08-07 Matthew Allum - - * clutter/clutter-video-texture.c: (lay_pipeline): - Set quality of service prop on fakesink to TRUE. - -2006-08-07 Matthew Allum - - * clutter/clutter-actor.c: (clutter_actor_paint): - Remove relic from old stage behaviour - dont unref - it during a clip. - -2006-07-27 Emmanuele Bassi - - * clutter/clutter-feature.c: No need to call clutter_feature_init() - each time: it's private and should never be seen from the outside; - add a warning, just in case something screws up and calls it more - than once. - -2006-07-27 Emmanuele Bassi - - * clutter/clutter-private.h: Move clutter_feature_init() - declaration here: you shouldn't even need to initialise - features yourself. - - * clutter/clutter-feature.c: call clutter_feature_init() - each time you try to access the feature list; add a static - lock around the feature flags container; add api documentation. - - * clutter/clutter-feature.h: Add a type for the feature flags - to make bindings happy. - -2006-07-24 Matthew Allum - - * clutter/Makefile.am: - * clutter/clutter-feature.c: - * clutter/clutter-feature.h: - - Add new funcs for checking for available runtime GL - extensions. - - * clutter/clutter-clone-texture.c: - * clutter/clutter-texture.c: - - Add support for non power of two textures - if GL_TEXTURE_RECTANGLE_ARB extension available ( at runtime ). - Should lower texture memory needs a little. - -2006-07-17 Emmanuele Bassi - - * clutter/clutter-stage.c (clutter_stage_get_default): Fix - api documentation. - -2006-07-15 Emmanuele Bassi - - * clutter/clutter-main.c: - - (clutter_main): Destroy the main stage, instead of unreffing it. - - (clutter_init): Ref and sink the main stage, as it is a top - level actor. - - * clutter/clutter-stage.c (clutter_stage_unrealize): Access - the Window private member directly, instead of calling the - get_xwindow method. - - * examples/test.c (main): Quit on button press. - -2006-07-09 Emmanuele Bassi - - * clutter/clutter-event.h: Change the name of the - ClutterEvent union members to something a little shorter. - -2006-07-06 Emmanuele Bassi - - * configure.ac: Remove the python stuff, now that the bindings - are out of tree. - -2006-07-06 Emmanuele Bassi - - * configure.ac: Mark this as 0.1.1, and change the version info - of the library. - - * clutter/clutter-actor.c: - * clutter/clutter-group.c: Fix documentation. - -2006-07-06 Emmanuele Bassi - - * clutter/clutter-actor.h: - * clutter/clutter-actor.c: - - (clutter_actor_class_init), (clutter_actor_set_property), - (clutter_actor_get_property): Add the "clip" and "has-clip" - properties. - - (clutter_actor_set_clip), (clutter_actor_remove_clip): Emit - the notification for the changed properties. - - (clutter_actor_has_clip): Simple accessor to the "has-clip" - property. - -2006-07-06 Emmanuele Bassi - - Big rework of the actor management semantics: now ClutterActor - objects behave like GtkObjects - that is they have an initial - "floating" reference that gets "sunk" when they are added to - a ClutterGroup. This makes a group responsible of de-allocating - each actor inside it, so you just have to destroy the group to - get every child actor destroyed. Also, now you can do: - - clutter_group_add (group, clutter_video_texture_new ()); - - without having to care about reference counting and explicit - unreffing. - - * clutter/clutter-private.h: Add private flags setter and - getter macros. - - * clutter/clutter-actor.h: - * clutter/clutter-actor.c: Clean up; inherit from GInitiallyUnowned; - add a "visible" property; add the "destroy", "show" and "hide" - signals to ClutterActorClass. - - (clutter_actor_show), (clutter_actor_hide): Refactor a bit; emit - the "show" and "hide" signals. - - (clutter_actor_set_property), (clutter_actor_get_property), - (clutter_actor_class_init): Implement the "visible" property; add - signals. - - (clutter_actor_finalize): Do not leak the actor's name, if it is - set. - - (clutter_actor_dispose): Emit the "destroy" signal here. - - (clutter_actor_init): Sink the initial floating flag if needed. - - (clutter_actor_destroy): Add a function to explicitely destroy - a ClutterActor. - - (clutter_actor_set_parent), (clutter_actor_get_parent), - (clutter_actor_unparent): Make set_parent require a valid parent; - add unparent; check on get_parent; ref_sink the actor when - setting its parent and unref it when unsetting it. Probably we'll - need a function that does reparenting as unparent+set_parent in - a single shot. - - * clutter/clutter-group.h: - * clutter/clutter-group.c (clutter_group_dispose), - (clutter_group_finalize), (clutter_group_add), - (clutter_group_remove): Make the group destroy its children when - disposing it; clean up, and use the newly-available - clutter_actor_unparent(). - - * clutter/clutter-stage.h: - * clutter/clutter-stage.c (clutter_stage_init): ClutterStage is - a top-level actor; clean up. - - * clutter/clutter-video-texture.h: - * clutter/clutter-video-texture.c: Clean up. - - * examples/super-oh.c: - * examples/test.c: - * examples/video-player.c: - * examples/test-text.c: - * examples/video-cube.c: Remove the g_object_unref() call, as the - ClutterStage object is destroyed on clutter_main_quit(). - -2006-06-23 Matthew Allum - - * examples/super-oh.c: - Remove random stage unref fixing trails. Fixes #98 - -2006-06-23 Matthew Allum - - * examples/video-player.c: (size_change): - cast stage height to gint avoiding wierdness for when - video height greater than half display height. Fixed #99 - -2006-06-23 Matthew Allum - - * clutter/clutter-video-texture.c: (clutter_video_texture_new): - Small fix for video playback on Big Endian. See #97 - -2006-06-23 Iain Holmes - - * clutter/clutter-texture.h: Add space :) Sorry. - -2006-06-23 Iain Holmes - - * clutter/clutter-label.h: - * clutter/clutter-group.h: - * clutter/clutter-rectangle.h: - * clutter/clutter-video-texture.h: - * clutter/clutter-event.h: - * clutter/clutter-texture.h: Fix the header layout so that C# parser - can understand everything. - -2006-06-23 Ross Burton - - * configure.ac: - * Makefile.am: - Remove references to bindings/, it's moved. - -2006-06-23 Emmanuele Bassi - - * clutter/clutter-group.c - (clutter_group_get_children): Mention that you must free - the returned list otherwise you'll leak stuff all around. - -2006-06-23 Ross Burton - - * examples/super-oh.c: - Fix build with trails enabled. Still crashes. - -2006-06-23 Ross Burton - - * configure.ac: - Disable static libraries. - -2006-06-22 Matthew Allum - - * web/index.html: - Make OpeneHand link - -2006-06-22 Matthew Allum - - * web/index.html: - Add Pango ref, authors info. - -========== 2006-06-22 0.1 Release ===================== - -2006-06-22 Matthew Allum - - * configure.ac: - * web/index.html: - Correct Bugzilla link. Add debs link - Bump up version to 0.1 ! - -2006-06-22 Matthew Allum - - * NEWS: - Add an entry for 0.1 release - * web/index.html: - * web/style.css: - Add basic website. - -2006-06-22 Iain Holmes - - * clutter/clutter-main.c: Guess what...more docs - -2006-06-22 Iain Holmes - - * clutter/clutter-event.c: Add docs - -2006-06-22 Iain Holmes - - * clutter/clutter-media.c: Add docs - -2006-06-22 Iain Holmes - - * clutter/clutter-texture.c: Fix typos. - - * clutter/clutter-timeline.c: Fix typos. - -2006-06-22 Iain Holmes - - * clutter/clutter-video-texture.c: Docs. - -2006-06-22 Iain Holmes - - * clutter/clutter-group.c: More typo fixes - - * clutter/clutter-event.c: Documentation - -2006-06-22 Emmanuele Bassi - - * clutter/clutter-timeline.h: - * clutter/clutter-timeline.c: Add a "started" and a "paused" - signals; add more sanity checks on the public functions. - - (clutter_timeline_get_loop): Add a getter function for the - loop property. - - * clutter/clutter-marshal.list: Add marshallers. - - * clutter/clutter-timeline.h: - * clutter/clutter-actor.h: Add padding for future expansion - without breaking ABI. - -2006-06-22 Iain Holmes - - * clutter/clutter-actor.c: Fix some typos in the docs. - -2006-06-22 Iain Holmes - - * clutter/clutter-util.c: And more - -2006-06-22 Ross Burton - - * clutter/clutter-label.c: - * clutter/clutter-video-texture.c: - * clutter/clutter-texture.c: - * clutter/clutter-timeline.c: - * clutter/clutter-group.c: - Fix gtk-doc problems. - -2006-06-22 Iain Holmes - - * clutter/clutter-main.c: More documentation - -2006-06-22 Matthew Allum - - * clutter/clutter-main.h: - Remove bogus xvisual call. - -2006-06-22 Matthew Allum - - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - Remove mirroring related calls ( unimplemented ) - * gtk/gtk-clutter-test.c: 0 -> NULL - -2006-06-22 Iain Holmes - - * clutter/clutter-actor.c: - * clutter/clutter-stage.c: - * gtk/gtk-clutter.c: More docs - -2006-06-22 Iain Holmes - - * clutter/clutter-actor.c: Added some more docs. - -2006-06-22 Matthew Allum - - * clutter/clutter-actor.c: - * clutter/clutter-clone-texture.c: - * clutter/clutter-color.c: - * clutter/clutter-event.c: - * clutter/clutter-group.c: - * clutter/clutter-label.c: - * clutter/clutter-main.c: - * clutter/clutter-media.c: - * clutter/clutter-rectangle.c: - * clutter/clutter-stage.c: - * clutter/clutter-texture.c: - * clutter/clutter-timeline.c: - * clutter/clutter-util.c: - * clutter/clutter-video-texture.c: - * configure.ac: - Documentation updates - add section headers. - -2006-06-22 Iain Holmes - - * gtk/gtk-clutter-test.c (main): Don't show the stage. - -2006-06-22 Iain Holmes - - * gtk/gtk-clutter.[ch]: Rewrite to use - clutter_stage_set_xwindow_foreign rather than GtkSocket. - - * gtk/gtk-clutter-test.c: Add fading!1!!!!11! OMGWTFBBQ!!! - -2006-06-21 Emmanuele Bassi - - * examples/video-cube.c (main): Quit on key press. - -2006-06-21 Emmanuele Bassi - - * clutter/Makefile.am: Re-fix distcheck after last commit. - -2006-06-21 Matthew Allum - - * clutter/Makefile.am: - Make sure clutter.h included. - * clutter/clutter-stage.c: (clutter_stage_realize), - (clutter_stage_get_actor_at_pos): - Select for motion events on X window. - Return highest rather than lowest found actor for actor_at_pos. - * examples/Makefile.am: - Remove test-text, remane test video. - * examples/README: - Add info about the included examples. - * examples/test-video.c: - * examples/video-player.c: - Redo test-video a little nicer and rename. - * examples/video-cube.c: - Fix so it at least 'works' again. - * examples/test.c: - Clean up a little. - -2006-06-21 Ross Burton - - * Makefile.am: - * gtk/Makefile.am: - Add gtk widget to distcheck and fix. - -2006-06-21 Emmanuele Bassi - - * clutter/Makefile.am: - * bindings/python/Makefile.am: - * Makefile.am: Fix distcheck - -2006-06-21 Ross Burton - - * clutter/Makefile.am: - * examples/Makefile.am: - Fix dist. - -2006-06-20 Matthew Allum - - * TODO: - Update. - * clutter/clutter-group.c: - Attempt better group sizing code. - * clutter/clutter-label.c: - Minor tweaks. - * clutter/clutter-texture.c: - More debug info, make sure texture is realised for base_size() - * clutter/clutter-video-texture.c: - Seeking fixes - * examples/test.c: (main): - Populate with more randomness. - -2006-06-15 Matthew Allum - - * clutter/clutter-stage.c: - * clutter/clutter-stage.h: - Add clutter_stage_set_xwindow_foreign() call - * clutter/clutter-util.c: - * clutter/clutter-util.h: - Add some X error traps - * examples/super-oh.c: - Toy with us of new clutter_stage_set_xwindow_foreign() for - optional screensaver functionality. - -2006-06-14 Matthew Allum - - * configure.ac: - Add checks for GL/gl.h and GL/glx.h - -2006-06-14 Matthew Allum - - * AUTHORS: - * README: - * TODO: - Update all. - -2006-06-13 Matthew Allum - - * clutter/clutter-video-texture.c: - Add missing license. - -2006-06-13 Matthew Allum - - * clutter/Makefile.am: - * clutter/clutter-actor.c: - * clutter/clutter-actor.h: - * clutter/clutter-clone-texture.c: - * clutter/clutter-clone-texture.h: - * clutter/clutter-element.c: - * clutter/clutter-element.h: - * clutter/clutter-group.c: - * clutter/clutter-group.h: - * clutter/clutter-label.c: - * clutter/clutter-label.h: - * clutter/clutter-main.c: - * clutter/clutter-main.h: - * clutter/clutter-rectangle.c: - * clutter/clutter-rectangle.h: - * clutter/clutter-stage.c: - * clutter/clutter-stage.h: - * clutter/clutter-texture.c: - * clutter/clutter-texture.h: - * clutter/clutter-video-texture.c: - * clutter/clutter-video-texture.h: - * clutter/clutter.h: - * examples/super-oh.c: - * examples/test-text.c: - * examples/test-video.c: - * examples/test.c: - * examples/video-cube.c: - * gtk/gtk-clutter-test.c: - * gtk/gtk-clutter.c: - * gtk/gtk-clutter.h: - Element to Actor Renaming. - -2006-06-12 Matthew Allum - - * clutter/Makefile.am: - * clutter/clutter-media.c: - * clutter/clutter-media.h: - * clutter/clutter-video-texture.c: - * clutter/clutter-video-texture.h: - * clutter/clutter.h: - * examples/test-video.c: (main): - * examples/video-cube.c: (main): - Add new 'media' interface. - Drop Totem based video playback code replace with newly - rewritten supper Jorn based code. Clutter is now fully LGPL. - - * clutter/clutter-texture.c: (tile_dimension): - Remove uneeded overlap code. - -2006-06-08 Iain Holmes - - * clutter/clutter-texture.c: - Opps, undo change I didn't mean to commit - -2006-06-08 Iain Holmes - - * configure.ac: - Add gdk-pixbuf-xlib cflags/libs to clutter libs - Build the gtk-clutter.pc file. - - * clutter.pc.in: - Add the gdk-pixbuf-xlib depends. - - * gtk/gtk-clutter.pc.in: - pkg-config stuff for gtk-clutter - - * gtk/Makefile.am: - Install gtk-clutter.pc - -2006-06-08 Matthew Allum - - * clutter/clutter-main.c: - * clutter/clutter-private.h: - * clutter/clutter-stage.c: - Rework and fix offscreen rendering, also rejig GLX - context handling, moving mostly into stage. - Require at least OpenGL 1.2 ( CLAMP_TO_EDGE ) - - * clutter/clutter-texture.c: - Explicity set props on _init() as to avoid nasty can_create - bug failing miserably in certain situations. - Switch to CLAMP_TO_EDGE for textures to avoid tile seams. - Add some more GL error checks. - - * clutter/clutter-label.c: - Extra debug info - - * configure.ac: - Require gdk-pixbuf-xlib-2.0 - -2006-06-06 Matthew Allum - - * configure.ac: - Use pkg-config to check for X. Really Check for GL libs. - Make gtk binding optional. Cleanup a little. - - * Makefile.am: - * gtk/Makefile.am: - Make gtk binding optional - - * clutter/clutter-element.c: - Cleanup a little, notify on size change. - - * clutter/clutter-texture.c: - Lots of cleanups. Add waste prop. Add filter quality prop. - - * clutter/clutter-clone-texture.c: - Make object construction simpler to work better with bindings. - - * clutter/clutter-stage.c: - * clutter/clutter-timeline.c: - Minor reformating, cleanups. - - * examples/test-text.c: (main): - Random experimentation - -2006-06-06 Iain Holmes - - * gtk/gtk-clutter.c (size_request): Take the size of the widget from - the ClutterStage. - (gtk_clutter_class_init): Hook up size-request - -2006-06-06 Iain Holmes - - * gtk/: Add a gtk widget for clutter. - - * configure.ac: Add GTK checks - - * Makefile.am: Go into gtk/ - -2006-06-05 Matthew Allum - - * clutter/clutter-group.c: (clutter_group_remove): - Fix parent check. - -2006-06-05 Matthew Allum - - * clutter/clutter-event.h: - Remove send_event field. Clutter shouldn't need it. - - * clutter/clutter-main.c: (clutter_dispatch_x_event): - Dont malloc a new clutter event for each xevent. - - * clutter/clutter-stage.h: - * clutter/clutter-stage.c: (clutter_stage_class_init), - (clutter_stage_get_default): - Dont ref stage from clutter_stage_get_default. - - * examples/super-oh.c: (main): - Remove some now uneeded debug g_prints - -2006-06-05 Emmanuele Bassi - - * clutter-color.h: - * clutter-color.c: Reimplement ClutterColor as a boxed type; - add convenience API for color handling, like: add, subtract, - shade, HSL color-space conversion, packing and unpacking. - - * clutter-private.h: Update ClutterMainContext, and export the - main context pointer here. - - * clutter-rectangle.h: - * clutter-rectangle.c: Update the color-related code; make - clutter_rectangle_new() and empty constructor and provide - clutter_rectangle_new_with_color(); provide color setter - and getter API. - - * clutter-label.h: - * clutter-label.c: Rename the "font" property to "font-name"; - update the color-related code to the new ClutterColor object; - rename clutter_label_new() to clutter_label_new_with_text(), - and add setters and getters for the properties. - - * clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers - generators. - - * clutter-stage.h: - * clutter-stage.c: Rework the API: provide a default constructor - for a singleton object, named clutter_stage_get_default(), which - supercedes the clutter_stage() function in clutter-main; provide - new events: button-press-event, button-release-event, - key-press-event and key-release-event; update the color-related - code; - - (clutter_stage_snapshot): Allow negative width and height when - taking a snapshot (meaning: use full width/height). - - (clutter_stage_get_element_at_pos): Rename clutter_stage_pick(). - - * clutter-element.c (clutter_element_paint): Clean up the - stage and color related code. - - * clutter-event.h: - * clutter-event.c: Add generic ClutterAnyEvent type; add - clutter_event_new(), clutter_event_copy() and clutter_event_free(); - make ClutterEvent a boxed type. - - * clutter-main.h: - * clutter-main.c: Remove clutter_stage(); add clutter_main_quit(), - for cleanly quitting from clutter_main(); add multiple mainloops - support; allocate the ClutterCntx instead of adding it to the - stack; re-work the ClutterEvent dispatching. - - * clutter-group.c (clutter_group_add), (clutter_group_remove): Keep - a reference on the element when added to a ClutterGroup. - - * examples/rects.py - * examples/test.c: - * examples/test-text.c: - * examples/video-cube.c: - * examples/super-oh.c: - * examples/test-video.c: Update. - -2006-06-04 Matthew Allum - - * clutter/clutter-element.c: - * clutter/clutter-group.c: - * clutter/clutter-group.h: - Work more on depth ( Z ) setting with sorting. - - * clutter/clutter-main.c: (clutter_redraw): - Experiment with glXWaitVideoSyncSGI. Currently disabled. - -2006-06-02 Matthew Allum - - * clutter/clutter-element.h: - Add missing _depth() declarations - - * clutter/clutter-main.c: - * clutter/clutter-main.h: - * clutter/clutter-private.h: - * clutter/clutter-stage.c: - * clutter/clutter-stage.h: - Rejig GL setup as for stage to support an offscreen property. - Offscreen support is however a little borked. - -2006-06-01 Matthew Allum - - * clutter/clutter-element.c: - Fix a snafu in clutter_element_raise () - - * clutter/clutter-timeline.c: - * clutter/clutter-timeline.h: - Add new clutter_timeline_is_playing() method - -2006-05-29 Matthew Allum - - * clutter/clutter-color.c: (clutter_color_set): - Fix bit shifts in clutter color setters. - -2006-05-29 Matthew Allum - - * clutter/clutter-element.c: - * clutter/clutter-element.h: - Add initial new element depth() getter and setter. - - * clutter/clutter-group.c: - * clutter/clutter-group.h: - Add 2 new methods for listing a groups children externally. - -2006-05-27 Emmanuele Bassi - - * clutter/clutter-clone-texture.c (set_parent_texture), - (clutter_clone_texture_set_property), - (clutter_clone_texture_get_property), - (clutter_clone_texture_class_init), - (clutter_clone_texture_new): Add a "parent-texture" - constructor-only property to simplify the constructor code. - - * clutter/clutter-rectangle.c (clutter_rectangle_new): - * clutter/clutter-timeline.c (clutter_timeline_new): Simplify - the constructor code. - - * examples/rect.py: Use the new method names for clutter.main() - and clutter.stage(). - -2006-05-26 Emmanuele Bassi - - * clutter/clutter-element.c: Fix gtk-doc annotations for public - functions; add sanity checks for public API; factor out some - pointer dereferences. - -2006-05-26 Emmanuele Bassi - - Big entry, small changes. - - * clutter/clutter-rectangle.c: - * clutter/clutter-clone-texture.c: - * clutter/clutter-group.c: - * clutter/clutter-element.c: - * clutter/clutter-label.c: Use the GObject built-in definition - of a private data structure; it removes the need for managing - the allocation/de-allocation of a private structure ourselves. - - * clutter/clutter-group.h: - * clutter/clutter-label.h: Add padding, for adding signals and - other class-wide definitions without breaking ABI. - - * clutter/clutter-element.h: - * clutter/clutter-element.c (clutter_element_box_get_type), - (clutter_element_box_copy): Make ClutterElementBox a GBoxed - type; clean up declarations of the enums and flags. - - * clutter/clutter-group.h: - * clutter/clutter-group.c (clutter_group_add_many_valist), - (clutter_group_add_many): Add a _valist version of - clutter_group_add_many() function, and re-implement the latter - as a proxy for the former; language bindings do not cope - well with variable argument functions. - - * clutter/clutter-video-texture.h: - * clutter/clutter-video-texture.c: Use the right prefix for - the error and for the ratio enumerations. - - * clutter/*.c: - * clutter/*.h: - * clutter/Makefile.am: Use the include path - for parallel installations. - - * clutter/Makefile.am: - * clutter/clutter-enum-types.h: - * clutter/clutter-enum-types.c: Register the enumeration types - inside the GObject type system in order to use them as properties - and bindings automagically pick them up. - - * bindings/python/ChangeLog: Add a changelog for the bindings... - - * doc/reference/ChangeLog: ... and a changelog for the reference. - - * examples/test.c: - * examples/video-cube.c: - * examples/test-video.c: Use the header. - -2006-05-25 Matthew Allum - - * clutter/clutter-clone-texture.c: - (clone_texture_render_to_gl_quad): - Remove uneeded bogus warning. Fix a typo causing large - texture to get incorrectly rendered. - * clutter/clutter-texture.c: (init_tiles), - (texture_render_to_gl_quad), (clutter_texture_sync_pixbuf), - (clutter_texture_realize): - Add some new debug info. - * clutter/clutter-video-texture.c: (fakesink_handoff_cb): - Set the pixbuf from GST_BUFFER_DATA() a little safer. - -2006-05-25 Matthew Allum - - * clutter.pc.in: - Fix prefix snafu via Ross. - -2006-05-24 Matthew Allum - - * clutter/clutter-element.c: (clutter_element_paint), - (clutter_element_class_init): - * clutter/clutter-label.c: (clutter_label_make_pixbuf): - * clutter/clutter-main.c: (clutter_main): - * clutter/clutter-stage.c: (sync_fullscreen), (sync_gl_viewport): - * clutter/clutter-stage.h: - Various minor tweaks / fixes needed by o.p.t - * clutter/clutter-texture.c: (texture_render_to_gl_quad), - (clutter_texture_sync_pixbuf), (clutter_texture_set_property), - (clutter_texture_get_property), (clutter_texture_class_init): - Experiment adding currently borked repreating textures, - * clutter/clutter-timeline.c: (timeline_timeout_func), - (clutter_timeline_skip): - Fix timeline callback frame counting. - * examples/test-video.c: (main): - Experiment with repeated textures. - -2006-05-23 Matthew Allum - - * clutter/clutter-clone-texture.h: - Fix Include. - * clutter/clutter-element.c: (clutter_element_set_parent): - Only unref if parent non NULL - * clutter/clutter-label.c: (clutter_label_class_init), - (clutter_label_set_text), (clutter_label_set_font): - * clutter/clutter-stage.h: - Add some utility defines - * clutter/clutter-texture.c: (init_tiles): - * clutter/clutter-timeline.c: (clutter_timeline_class_init), - (timeline_timeout_func), (clutter_timeline_get_current_frame): - * clutter/clutter-timeline.h: - Add a 'completed' signal - Dont free priv when g_type_class_private used. - * clutter/clutter.h: - Add missing clutter-rectangle.h - * examples/Makefile.am: - * examples/super-oh.c: (main): - * examples/test.c: - * examples/video-cube.c: - Fix includes - -2006-05-22 Matthew Allum - - * clutter/clutter-element.c: - * clutter/clutter-element.h: - * clutter/clutter-event.c: - * clutter/clutter-group.c: (clutter_group_remove_all): - * clutter/clutter-group.h: - * clutter/clutter-main.c: (translate_button_event), - (translate_motion_event): - Improve mouse event handling. - Add code to map arbituary ( i.e cursor ) position to - a clutter element using OpenGL 'picking'. - * clutter/clutter-texture.c: - * clutter/clutter-clone-texture.c: - re-realize parent texture if it gets hidden. - * clutter/clutter-stage.c: - * clutter/clutter-stage.h: - Make sure stage sets gl viewport up even if just default size. - (clutter_texture_hide), (clutter_texture_paint): - * doc/reference/Makefile.am: - * examples/super-oh.c: (input_cb), (frame_cb), (main): - Add test for mouse events, click to remove. - -2006-05-21 Matthew Allum - - * clutter/clutter-element.c: - * clutter/clutter-element.h: - Add new core sizing methods and more documentation. - * clutter/clutter-group.c: - * clutter/clutter-group.h: - Use the sizing bits and documentation. - * clutter/clutter-main.c: - * clutter/clutter-event.h: - Add FPS display when CLUTTER_SHOW_FPS env var set. - Add initial support for mouse events. - * clutter/clutter-stage.c: - Add 'snapshot' method. - * clutter/clutter-texture.c: (clutter_texture_new_from_pixbuf): - * clutter/clutter-texture.h: - Documentation. - * clutter/clutter-timeline.c: - Add support for changing FPS setting on the fly. Document. - * examples/super-oh.c: (frame_cb), (main): - Add an optional motion trails effect. - -2006-05-17 Matthew Allum - - * README: - Add a tiny bit of info - * TODO: - Sync up a little - * clutter/clutter-clone-texture.c: - (clone_texture_render_to_gl_quad): - * clutter/clutter-element.c: (clutter_element_show), - (clutter_element_realize), (clutter_element_unrealize), - (clutter_element_paint), (clutter_element_set_id), - (clutter_element_get_id): - * clutter/clutter-element.h: - Rename REALISE() to REALIZE() - - * clutter/clutter-texture.c: (texture_render_to_gl_quad), - (clutter_texture_sync_pixbuf), (clutter_texture_set_pixbuf): - * clutter/clutter-video-texture.c: (query_timeout), - (got_video_size), (caps_set), (parse_stream_info), - (handle_element_message), (bus_message_cb), - (poll_for_state_change_full), (clutter_video_texture_get_property), - (clutter_video_texture_class_init), (clutter_video_texture_init), - (clutter_video_texture_open), (clutter_video_texture_seek_time), - (stop_play_pipeline): - * clutter/clutter-video-texture.h: - Move over using fakesink and handoff instead of custom element - Support 3 channel pixbufs as textures and thus increase efficiency - of video texture ( also avoids byte swapping. ) - Clean up video texture code somemore. - Add some metadata support. - - * Makefile.am: - * configure.ac: - Disable old custom clutter gst element from build. - - * examples/test-video.c: (foo), (size_change), (tick), (main): - * examples/video-cube.c: (clutter_video_texture_cube_paint): - Sink with new API. Pause on key press. - -2006-05-13 Matthew Allum - - * clutter/clutter-element.c: (redraw_update_idle), - (clutter_element_show), (clutter_element_hide), - (clutter_element_realize), (clutter_element_unrealize), - (clutter_element_class_init), (clutter_element_init), - (clutter_element_queue_redraw), (clutter_element_set_geometry), - (clutter_element_get_geometry), (clutter_element_get_coords), - (clutter_element_set_position), (clutter_element_set_size), - (clutter_element_get_abs_position), (clutter_element_get_width), - (clutter_element_get_height), (clutter_element_get_x), - (clutter_element_get_y), (clutter_element_set_opacity): - * clutter/clutter-texture.c: (clutter_texture_get_base_size), - (clutter_texture_bind_tile), (clutter_texture_get_n_tiles), - (clutter_texture_get_x_tile_detail), - (clutter_texture_get_y_tile_detail): - * doc/reference/Makefile.am: - * doc/reference/clutter.types: - Documentation updates. - -2006-05-13 Matthew Allum - - * clutter.pc.in: - Add @MAJORMINOR@ to installed dirs. - * clutter/clutter-main.c: (clutter_xscreen), (clutter_init): - * clutter/clutter-main.h: - * clutter/clutter-private.h: - Quick fix for debug statements so now only appear - if CLUTTER_DBBUG env var set. - -2006-05-12 Matthew Allum - - * configure.ac: - * Makefile.am: - * clutter/Makefile.am: - * bindings/python/Makefile.am: - * examples/Makefile.am: - * gst/Makefile.am: - Clean up autofoo a bit fixing versioning. - * bootstrap-autotools.sh: - * clutter-1.0.pc.in: - Rename. - -2006-05-12 Matthew Allum - - * bindings/python/Makefile.am: - * bindings/python/clutter.override: - * clutter/Makefile.am: - * clutter/clutter-bin.c: - * clutter/clutter-bin.h: - * clutter/clutter-element.c: (clutter_element_dispose), - (clutter_element_raise), (clutter_element_lower): - * clutter/clutter-group.c: - * clutter/clutter-group.h: - * clutter/clutter-main.c: (clutter_threads_leave): - * clutter/clutter-main.h: - * clutter/clutter-stage.c: (clutter_stage_class_init): - * clutter/clutter-stage.h: - * clutter/clutter.h: - * examples/super-oh.c: (frame_cb), (main): - * examples/test-text.c: (main): - * examples/test-video.c: (main): - * examples/test.c: (main): - * examples/video-cube.c: (main): - Rename clutter-bin to clutter-group - -2006-05-11 Matthew Allum - - * clutter/clutter-clone-texture.c: - (clone_texture_render_to_gl_quad), (clutter_clone_texture_paint), - (clutter_clone_texture_class_init), (clutter_clone_texture_new): - Fix cloning. - * clutter/clutter-element.c: (clutter_element_rotate_z), - (clutter_element_rotate_x), (clutter_element_rotate_y): - Minor tweaks - * examples/Makefile.am: - * examples/super-oh.c: - Add a new demo - unsing rotations and clones. - -2006-05-11 Matthew Allum - - * bindings/python/Makefile.am: - * bindings/python/clutter-base-types.defs: - * bindings/python/clutter-base.defs: - * bindings/python/clutter.override: - Python goodiness from ebassi. - - Element geometry handled nicely. - - get_coords(), get_abs_position() added. - - * clutter/clutter-element.c: (clutter_element_rotate_x), - (clutter_element_rotate_y), (clutter_element_mirror), - * clutter/clutter-element.h: - Add initial rotation API. Make Geometry boxed ( ebassi ) - - * clutter/clutter-stage.c: (sync_gl_viewport): - Set depth in main world transform. - - * clutter/clutter-timeline.h: - Add missing new() api call. - - * examples/test.c: (timeout_text_cb), (frame_cb), (main): - Tou with some rotation - -2006-05-11 Matthew Allum - - reviewed by: - - * bindings/python/Makefile.am: - * bindings/python/clutter-base-types.defs: - * bindings/python/clutter-base.defs: - * bindings/python/clutter.override: - * clutter/clutter-bin.c: (clutter_bin_paint): - * clutter/clutter-element.c: (clutter_element_paint), - (clutter_element_get_height), (clutter_element_get_x), - (clutter_element_get_y), (clutter_element_set_opacity), - (clutter_element_get_opacity), (clutter_element_set_id), - (clutter_element_get_id), (clutter_element_rotate_x), - (clutter_element_rotate_y), (clutter_element_mirror), - (clutter_element_set_clip), (clutter_element_remove_clip), - (clutter_element_set_parent), (clutter_element_get_parent), - (clutter_element_raise), (clutter_element_lower), - (clutter_element_raise_top), (clutter_element_lower_bottom): - * clutter/clutter-element.h: - * clutter/clutter-main.c: (clutter_redraw): - * clutter/clutter-stage.c: (sync_gl_viewport): - * clutter/clutter-timeline.h: - * examples/test.c: (timeout_text_cb), (frame_cb), (main): - -2006-05-09 Matthew Allum - - * COPYING: - * clutter/clutter-bin.c: - * clutter/clutter-bin.h: - * clutter/clutter-clone-texture.c: - * clutter/clutter-clone-texture.h: - * clutter/clutter-color.c: - * clutter/clutter-color.h: - * clutter/clutter-element.c: - * clutter/clutter-element.h: - * clutter/clutter-event.c: - * clutter/clutter-event.h: - * clutter/clutter-keysyms.h: - * clutter/clutter-label.c: - * clutter/clutter-label.h: - * clutter/clutter-main.c: - * clutter/clutter-main.h: - * clutter/clutter-private.h: - * clutter/clutter-rectangle.c: - * clutter/clutter-rectangle.h: - * clutter/clutter-stage.c: - * clutter/clutter-stage.h: - * clutter/clutter-texture.c: - * clutter/clutter-texture.h: - * clutter/clutter-timeline.c: - * clutter/clutter-timeline.h: - * clutter/clutter-util.c: - * clutter/clutter-util.h: - Add license info. - -2006-05-08 Matthew Allum - - * clutter/Makefile.am: - * clutter/clutter-event.c: - * clutter/clutter-event.h: - * clutter/clutter-keysyms.h: - * clutter/clutter-main.c: (clutter_dispatch_x_event): - * clutter/clutter-stage.c: (clutter_stage_class_init): - * clutter/clutter-stage.h: - * clutter/clutter.h: - * bindings/python/Makefile.am: - * bindings/python/clutter.override: - Add basic input event handling. Keys only atm. - -2006-05-08 Matthew Allum - - * TODO: - Sync a little. - * bindings/python/Makefile.am: - * bindings/python/clutter.override: - Fix up so pixbufs now work ( thanks ebassi! ) - Add some missing newer headers. - * clutter/clutter-main.h: - Remove unused clutter_queue_redraw(); - -2006-05-07 Matthew Allum - - * clutter/clutter-element.c: (clutter_element_class_init), - (clutter_element_init), (clutter_element_queue_redraw), - (clutter_element_set_geometry), (clutter_element_get_geometry), - (clutter_element_get_coords), (clutter_element_set_position), - (clutter_element_set_size), (clutter_element_get_abs_position), - (clutter_element_get_width), (clutter_element_get_height), - (clutter_element_get_x), (clutter_element_get_y), - (clutter_element_set_opacity): - * clutter/clutter-main.c: (clutter_dispatch_x_event): - * clutter/clutter-main.h: - * clutter/clutter-private.h: - * clutter/clutter-stage.c: (clutter_stage_set_color): - * clutter/clutter-texture.c: (clutter_texture_set_pixbuf): - Rename clutter_queue_redraw -> clutter_element_queue_redraw - - * clutter/clutter-label.c: (clutter_label_make_pixbuf), - (clutter_label_set_property), (clutter_label_set_text_extents): - * clutter/clutter-label.h: - Fixes to extents - - * examples/Makefile.am: - * examples/test-text.c: - Add sime test text example. - -2006-05-07 Matthew Allum - - * clutter/clutter-label.c: (clutter_label_make_pixbuf), - (clutter_label_get_property), (clutter_label_dispose), - (clutter_label_class_init), (clutter_label_init), - (clutter_label_new_with_text), (clutter_label_new), - (clutter_label_set_text), (clutter_label_set_font), - (clutter_label_set_text_extents), (clutter_label_set_fg_color): - * examples/test.c: (main): - Slight efficiency improvements. Add initial extents API. - -2006-05-07 Matthew Allum - - * TODO: - resync. - * clutter/Makefile.am: - * clutter/clutter-clone-texture.c: - * clutter/clutter-clone-texture.h: - Add new texture clone element. - * clutter/clutter-color.c: - * clutter/clutter-color.h: - Add simple color API. - * clutter/clutter-util.c: - * clutter/clutter-util.h: - Move shared texture funcs into shared util code. - * clutter/clutter-texture.c: (can_create), (tile_dimension), - (init_tiles), (texture_render_to_gl_quad), - (clutter_texture_unrealize), (clutter_texture_sync_pixbuf), - (clutter_texture_realize), (clutter_texture_show), - (clutter_texture_hide), (clutter_texture_paint), - (clutter_texture_finalize), (clutter_texture_set_property), - (clutter_texture_get_property), (clutter_texture_class_init), - (clutter_texture_init), (clutter_texture_set_pixbuf), - (clutter_texture_new_from_pixbuf), (clutter_texture_get_base_size), - (clutter_texture_bind_tile): - Changes for clones to work. - * clutter/clutter-element.c: (clutter_element_paint), - (clutter_element_set_property), (clutter_element_get_property), - (clutter_element_set_position), (clutter_element_set_size), - (clutter_element_get_abs_position), (clutter_element_get_width), - (clutter_element_get_height), (clutter_element_get_x), - (clutter_element_get_y), (clutter_element_set_opacity), - (clutter_element_get_opacity), (clutter_element_set_id), - (clutter_element_get_id), (clutter_element_set_clip): - * clutter/clutter-element.h: - Add clipping and other tweaks. - * clutter/clutter-stage.c: (sync_gl_viewport), - (clutter_stage_paint), (clutter_stage_init): - Add psuedo 3D desktop like GL setup. - * clutter/clutter-label.c: (clutter_label_make_pixbuf): - * clutter/clutter-label.h: - * clutter/clutter-main.c: (clutter_redraw): - * clutter/clutter-main.h: - * clutter/clutter-private.h: - * clutter/clutter-rectangle.c: (clutter_rectangle_paint): - * clutter/clutter-stage.h: - * clutter/clutter-texture.h: - * clutter/clutter-timeline.c: (clutter_timeline_class_init): - * clutter/clutter-video-texture.c: - * clutter/clutter.h: - * examples/test-video.c: (foo), (size_change), (tick), (main): - * examples/test.c: (main): - * examples/video-cube.c: (clutter_video_texture_cube_paint), - (clutter_video_texture_cube_class_init), - (clutter_video_texture_cube_init): - Various minor tweaks for API changes, new features etc. - -2006-05-03 Matthew Allum - - * clutter/clutter-bin.c: (clutter_bin_paint): - * clutter/clutter-bin.h: - * clutter/clutter-element.c: (clutter_element_unrealize), - (clutter_element_paint), (clutter_element_set_property), - (clutter_element_get_property), (clutter_element_dispose), - (clutter_element_finalize), (clutter_element_class_init), - (clutter_element_init), (clutter_element_queue_redraw), - (clutter_element_set_geometry), (clutter_element_get_geometry), - (clutter_element_get_coords), (clutter_element_set_position), - (clutter_element_set_size), (clutter_element_get_abs_position), - (clutter_element_set_opacity), (clutter_element_get_opacity), - (clutter_element_set_clip), (clutter_element_remove_clip), - (clutter_element_set_parent), (clutter_element_get_parent), - (clutter_element_raise), (clutter_element_lower), - (clutter_element_raise_top), (clutter_element_lower_bottom): - * clutter/clutter-element.h: - * clutter/clutter-label.c: (clutter_label_set_fg_color): - * clutter/clutter-rectangle.c: (clutter_rectangle_paint), - (clutter_rectangle_set_property), (clutter_rectangle_init): - * clutter/clutter-stage.c: (sync_xwindow_size): - * clutter/clutter-texture.c: (clutter_texture_paint), - (clutter_texture_set_pixbuf): - Clean up ClutterElement, removing globals, improving sizing - and initial clipping code. - - * clutter/clutter.h: - * clutter/clutter-timeline.c: (clutter_timeline_class_init), - (timeline_timeout_func), (clutter_timeline_start), - (clutter_timeline_pause), (clutter_timeline_rewind), - (clutter_timeline_skip), (clutter_timeline_advance), - (clutter_timeline_get_current_frame), (clutter_timeline_new): - * clutter/clutter-timeline.h: - Various fixes to timelines. Implement frame skipping. - - * examples/test.c: (timeout_text_cb), (main): - Update to use timeline. - -2006-05-02 Matthew Allum - - * TODO: - Update - * clutter/clutter-element.h: - * clutter/clutter-rectangle.h: - Minor formatting cleanups - -2006-05-02 Matthew Allum - - * clutter/Makefile.am: - * clutter/clutter-timeline.c: - * clutter/clutter-timeline.h: - Add initial timeline implementation - -2006-05-02 Matthew Allum - - * bindings/python/Makefile.am: - * bindings/python/cluttermodule.c: (initclutter): - Fix python build with new -1.0 naming. Use of GdkPixbufs - still causing crashes. - -2006-04-30 Matthew Allum - - * clutter/clutter-main.c: (events_init), (redraw_update_idle), - (clutter_queue_redraw), (clutter_redraw): - Fix repaint queueing, using idle handler now. - Clean up some minor compiler warnings. - * clutter/clutter-main.h: - * clutter/clutter-texture.c: (clutter_texture_unrealize), - (clutter_texture_set_pixbuf): - Rename gl_lock/unlock to threads_enter/leaver - -2006-04-30 Matthew Allum - - * Makefile.am: - * clutter-1.0.pc.in: - * clutter/Makefile.am: - * clutter/clutter-bin.h: - * clutter/clutter-label.h: - * clutter/clutter-rectangle.h: - * clutter/clutter-stage.h: - * clutter/clutter-texture.h: - * clutter/clutter-video-texture.h: - * clutter/clutter.h: - * configure.ac: - * examples/Makefile.am: - Add .pc file, tag -1.0 onto lib, includes dir naming. - -2006-04-29 Matthew Allum - - * clutter/clutter-main.c: (clutter_dispatch_x_event), - (clutter_queue_redraw), (clutter_redraw): - Simplify paint event queueing. Does not actually queue - anymore (broken), needs wrong to reduce high number of - uneeded paints. - - * clutter/clutter-texture.c: (clutter_texture_set_pixbuf): - Remove visible check which broke paints of resized texture pixmaps. - -2006-04-19 Matthew Allum - - * clutter/clutter-bin.c: (clutter_bin_paint), (clutter_bin_add): - * clutter/clutter-element.c: (clutter_element_paint): - * clutter/clutter-element.h: - * clutter/clutter-label.c: (clutter_label_set_property), - (clutter_label_get_property), (clutter_label_class_init): - * clutter/clutter-marshal.list: - * clutter/clutter-rectangle.c: (clutter_rectangle_set_property), - (clutter_rectangle_get_property), (clutter_rectangle_class_init): - * clutter/clutter-stage.c: (clutter_stage_dispose), - (clutter_stage_get_property), (clutter_stage_class_init): - * clutter/clutter-texture.c: (clutter_texture_realize), - (clutter_texture_class_init), (clutter_texture_set_pixbuf): - * clutter/clutter-texture.h: - More object cleanups. Add signal to texture size changes. - Fix color props. Adjust element realise flags workings ( broken ). - * examples/test-video.c: (main): - Broken due to realize flag changes. - -2006-04-18 Matthew Allum - - * clutter/clutter-bin.c: (clutter_bin_get_property), - (clutter_bin_finalize), (clutter_bin_class_init), - (clutter_bin_new), (clutter_bin_show_all), (clutter_bin_hide_all), - (clutter_bin_add): - * clutter/clutter-bin.h: - * clutter/clutter-element.c: (clutter_element_get_property), - (clutter_element_finalize), (clutter_element_class_init), - (clutter_element_set_parent), (clutter_element_get_parent), - (clutter_element_raise), (clutter_element_lower): - * clutter/clutter-element.h: - * clutter/clutter-label.c: (clutter_label_make_pixbuf), - (clutter_label_get_property), (clutter_label_dispose), - (clutter_label_finalize), (clutter_label_class_init), - (clutter_label_init), (clutter_label_new_with_text), - (clutter_label_new), (clutter_label_set_text), - (clutter_label_set_font), (clutter_label_set_fg_color): - * clutter/clutter-label.h: - * clutter/clutter-rectangle.c: (clutter_rectangle_paint), - (clutter_rectangle_set_property), (clutter_rectangle_get_property), - (clutter_rectangle_finalize), (clutter_rectangle_dispose), - (clutter_rectangle_class_init), (clutter_rectangle_init), - (clutter_rectangle_new): - * clutter/clutter-texture.c: (clutter_texture_paint), - (clutter_texture_dispose), (clutter_texture_finalize), - (clutter_texture_set_property), (clutter_texture_get_property), - (clutter_texture_class_init), (clutter_texture_init), - (clutter_texture_set_pixbuf), (clutter_texture_new_from_pixbuf): - Various GObject usages cleanups, adding properties and - finalize/dispose functions properly. - -2006-04-18 Matthew Allum - - * bindings/python/Makefile.am: - * bindings/python/clutter.override: - * bindings/python/cluttermodule.c: (initclutter): - * clutter/clutter-label.h: - * clutter/clutter-rectangle.h: - * clutter/clutter-video-texture.h: - More fixups to now less broken python bindings - * examples/rects.py: - A simple python script using bindings - -2006-04-18 Matthew Allum - - * clutter/clutter-marshal.list: - Add missing. - -2006-04-17 Matthew Allum - - * Makefile.am: - * bindings/Makefile.am: - * bindings/python/Makefile.am: - * bindings/python/clutter.override: - * bindings/python/cluttermodule.c: - * configure.ac: - First shot at some python bindings ( broken atm ) - * clutter/clutter-bin.h: - * clutter/clutter-element.h: - * clutter/clutter-stage.h: - * clutter/clutter-texture.h: - * clutter/clutter.h: - Rejig headers a little so h2def.py happier - -2006-04-17 Matthew Allum - - * TODO: - * doc/clutter.types: - * doc/reference/Makefile.am: - Move gtk-doc gubbins to doc/reference - -2006-04-16 Matthew Allum - - * TODO: - More updates - - * clutter/clutter-bin.c: (clutter_bin_paint): - Add translate call - - * clutter/clutter-texture.c: (clutter_texture_dispose), - (clutter_texture_class_init), (clutter_texture_set_pixbuf): - Fixup object finalization a little. - - * bootstrap-autotools.sh: - * configure.ac: - * doc/Makefile.am: - * doc/clutter.types: - Add gtk-doc infrastructure - -2006-04-15 Matthew Allum - - * TODO: - More ideas. - - * clutter/Makefile.am: - * clutter/clutter-rectangle.c: (clutter_rectangle_new): - Sync passed color alpha chan to element opacity, - - * clutter/clutter-video-texture.c: - (clutter_video_texture_error_quark), (signal_eos_delayed), - (query_timeout), (got_video_size), (caps_set), (parse_stream_info), - (handle_element_message) - * clutter/clutter-video-texture.h: - Port more of bacon video widget API. - - * examples/test-video.c: (foo), (tick), (main): - Add a simple overlay displaying playback time. - -2006-04-15 Matthew Allum - - * clutter/clutter-element.c: - * clutter/clutter-label.c: (clutter_label_init), - (clutter_label_new_with_text): - * clutter/clutter-label.h: - * clutter/clutter-main.c: (clutter_redraw), (clutter_gl_unlock): - * clutter/clutter-main.h: - * clutter/clutter-rectangle.c: (clutter_rectangle_init), - (clutter_rectangle_new): - * clutter/clutter-rectangle.h: - * clutter/clutter-texture.c: (clutter_texture_class_init), - (clutter_texture_set_pixbuf), (clutter_texture_new_from_pixbuf): - * clutter/clutter-texture.h: - * clutter/clutter-video-texture.c: (clutter_video_texture_init): - * clutter/clutter-video-texture.h: - * examples/test-video.c: (main): - * examples/test.c: (main): - * examples/video-cube.c: (clutter_video_texture_cube_init), (main): - Make xxx_new() return there type as ClutterElement* - -2006-04-15 Matthew Allum - - * TODO: - Update - * clutter/clutter-main.c: - * clutter/clutter-stage.c: - * clutter/clutter-texture.c: - * clutter/clutter-texture.h: - * gst/clutterimagesink.c: (gst_clutterimagesink_clutterimage_put), - (gst_clutterimagesink_context_get): - Various experiments with textures and 3D views. - - * clutter/clutter-video-texture.c: - (clutter_video_texture_class_init), (clutter_video_texture_init): - * examples/Makefile.am: - * examples/test-video.c: (main): - * examples/video-cube.c: - Add video-cube example - -2006-04-13 Matthew Allum - - * TODO: - Update - - * clutter/clutter-bin.c: - * clutter/clutter-bin.h: - New container element - - * clutter/clutter-stage.c: - * clutter/clutter-stage.h: - Make stage a proper element - - * clutter/Makefile.am: - * clutter/clutter.h: - * clutter/clutter-element.c: (clutter_element_show), - (clutter_element_set_opacity): - * clutter/clutter-element.h: - * clutter/clutter-label.c: (clutter_label_make_pixbuf), - (clutter_label_set_text), (clutter_label_set_font): - * clutter/clutter-private.h: - Various tweaks new api calls. - - * clutter/clutter-main.c: (events_init): - * clutter/clutter-main.h: - Make ClutterContex Private to main - - * clutter/clutter-texture.c: - * clutter/clutter-texture.h: - * clutter/clutter-video-texture.c: - (clutter_video_texture_finalize): - Fix video crash - - * examples/test-video.c: (main): - * examples/test.c: (main): - Fix for API changes. - -2006-04-11 Matthew Allum - - * TODO: - Add - * clutter/clutter-video-texture.c: - (clutter_video_texture_finalize): - * clutter/clutter-video-texture.h: - Remove bogus pixbuf attribute - -2006-04-10 Matthew Allum - - * clutter/clutter-main.c: (clutter_dispatch_x_event), - (clutter_queue_redraw), (clutter_main), (clutter_set_stage_params), - (clutter_init): - * clutter/clutter-main.h: - * clutter/clutter-private.h: - Make Stage non fullscreen ( for now ). Change event loop to - work better with video. - - * clutter/Makefile.am: - * clutter/clutter-label.c: (clutter_label_make_pixbuf), - (clutter_label_class_init), (clutter_label_new_with_text), - (clutter_label_set_text), (clutter_label_set_font): - * clutter/clutter-texture.c: (texture_render_to_gl_quad), - (clutter_texture_unrealize), (clutter_texture_sync_pixbuf), - (clutter_texture_realize), (clutter_texture_show), - (clutter_texture_hide), (clutter_texture_paint), - (clutter_texture_finalize), (clutter_texture_set_property), - (clutter_texture_get_property), (clutter_texture_class_init), - (clutter_texture_init), (clutter_texture_get_pixbuf), - (clutter_texture_set_pixbuf), (clutter_texture_new_from_pixbuf): - * clutter/clutter-texture.h: - * clutter/clutter.h: - Fix leakage. Improve performance. Add support for non tiled - textures. - - * examples/Makefile.am: - * examples/test.c: (timeout_text_cb), (main): - Experiments - - * examples/test-video.c: - * configure.ac: - * gst/Makefile.am: - * gst/clutterimagesink.c: - * gst/clutterimagesink.h: - * clutter/clutter-video-texture.c: - * clutter/clutter-video-texture.h: - Add initial support for video textures with gst-0.10 - - * gst/cltrimagesink.c: - * gst/cltrimagesink.h: - Remove old gst-0.8 sink - - -2006-04-05 Matthew Allum - - * clutter/Makefile.am: - * clutter/clutter-element.c: (clutter_element_show), - (clutter_element_hide), (clutter_element_realize), - (clutter_element_unrealize), (clutter_element_paint), - (clutter_element_finalize), (clutter_element_class_init), - (clutter_element_init), (clutter_element_new): - * clutter/clutter-element.h: - * clutter/clutter.h: - * clutter/clutter-main.c: (clutter_dispatch_x_event), - (events_init), (clutter_redraw), (clutter_main), (clutter_init), - (clutter_show_stage): - * clutter/clutter-main.h: - Various minor tweaks. - - * clutter/clutter-private.h: - * clutter/clutter-texture.c: (can_create), (init_tiles), - (clutter_texture_unrealize), (clutter_texture_realize), - (clutter_texture_finalize), (clutter_texture_class_init), - (clutter_texture_init): - * clutter/clutter-texture.h: - Much improve texture class. - - * clutter/clutter-label.c: - * clutter/clutter-label.h: - Add new text rendering class - - * clutter/clutter-rectangle.c: - * clutter/clutter-rectangle.h: - Add basic rectangle drawing class - - * examples/test.c: - Add text rendering and animation to test. - -2006-04-04 Matthew Allum - - * clutter/Makefile.am: - * clutter/clutter-element.c: (clutter_element_realize): - * clutter/clutter-element.h: - * clutter/clutter-image.c: - * clutter/clutter-image.h: - * clutter/clutter-main.c: (clutter_dispatch_x_event), - (clutter_main), (clutter_set_stage_params), (clutter_init): - * clutter/clutter-texture.c: (next_p2), (can_create), - (tile_dimension), (init_tiles), (texture_render_to_gl_quad), - (clutter_texture_unrealize), (clutter_texture_realize), - (clutter_texture_get_pixbuf), (clutter_texture_paint), - (clutter_texture_finalize), (clutter_texture_class_init): - * clutter/clutter-texture.h: - * clutter/clutter.h: - * configure.ac: - * examples/test.c: - Implement basic tiled texture painting. - -2006-04-03 Matthew Allum - - reviewed by: - - * clutter/Makefile.am: - * clutter/clutter-element.c: - * clutter/clutter-element.h: - * clutter/clutter-image.c: - * clutter/clutter-image.h: - * clutter/clutter-main.c: (events_init), (stage_realize), - (clutter_queue_redraw), (clutter_redraw), (clutter_add_to_stage), - (clutter_remove_from_stage), (clutter_main), - (clutter_set_stage_params), (clutter_init): - * clutter/clutter-main.h: - * clutter/clutter-private.h: - * clutter/clutter.h: - * examples/test.c: - -2006-04-02 Matthew Allum - - * clutter/Makefile.am: - * clutter/cltr-animator.c: - * clutter/cltr-animator.h: - * clutter/cltr-button.c: - * clutter/cltr-button.h: - * clutter/cltr-core.c: - * clutter/cltr-core.h: - * clutter/cltr-events.c: - * clutter/cltr-events.h: - * clutter/cltr-glu.c: - * clutter/cltr-glu.h: - * clutter/cltr-label.c: - * clutter/cltr-label.h: - * clutter/cltr-list.c: - * clutter/cltr-list.h: - * clutter/cltr-overlay.c: - * clutter/cltr-overlay.h: - * clutter/cltr-photo-grid.c: - * clutter/cltr-photo-grid.h: - * clutter/cltr-private.h: - * clutter/cltr-scratch.c: - * clutter/cltr-scratch.h: - * clutter/cltr-texture.c: - * clutter/cltr-texture.h: - * clutter/cltr-video.c: - * clutter/cltr-video.h: - * clutter/cltr-widget.c: - * clutter/cltr-widget.h: - * clutter/cltr-window.c: - * clutter/cltr-window.h: - * clutter/cltr.h: - * clutter/clutter-main.c: - * clutter/clutter-main.h: - * clutter/clutter-private.h: - * clutter/clutter.h: - * clutter/fonts.c: - * clutter/fonts.h: - * clutter/pixbuf.c: - * clutter/pixbuf.h: - * clutter/util.c: - * clutter/util.h: - * configure.ac: - * examples/Makefile.am: - * examples/photos.c: - * examples/player.c: - * examples/scratch.c: - * examples/select.c: - * examples/test.c: - Remove old cltr files replacing with beginnings of - rejigged 'clutter' ones. - -2005-05-27 mallum,,, - - * clutter/cltr-animator.c: (cltr_animator_zoom_new), - (cltr_animator_move_new), (cltr_animator_fullzoom_new), - (cltr_animator_new), (cltr_animator_set_args), - (cltr_animator_wrapped_zoom_paint), (cltr_animator_reset), - (cltr_animator_timeout_cb), (cltr_animator_run): - * clutter/cltr-animator.h: - * clutter/cltr-button.c: (cltr_button_set_label), - (cltr_button_paint): - * clutter/cltr-label.c: (cltr_label_new), (cltr_label_set_text), - (cltr_label_get_text), (cltr_label_show), - (cltr_label_handle_xevent), (cltr_label_paint): - * clutter/cltr-label.h: - * clutter/cltr-list.c: (cltr_list_paint): - * clutter/cltr-widget.c: - * examples/select.c: (usage), (video_ctrl_hide), - (video_ctrl_stop_cb), (video_ctrl_play_cb), - (video_ctrl_seek_begin_cb), (init_video_ctrl), (show_video_ctrl), - (populate), (cell_to_item), (zoom_video_out), (init_show_controls), - (handle_xevent), (zoom_out_complete), (zoom_in_complete): - More select hacking ... - -2005-05-23 mallum,,, - - * clutter/cltr-button.c: (cltr_button_new_with_label), - (cltr_button_handle_xevent), (cltr_button_paint): - * clutter/cltr-button.h: - * clutter/cltr-events.c: (cltr_main_loop): - * clutter/cltr-list.c: (cltr_list_cell_new), - (cltr_list_append_cell), (cltr_list_update_layout), - (cltr_list_paint): - * clutter/cltr-list.h: - * clutter/cltr-overlay.c: (cltr_overlay_paint): - * clutter/cltr-private.h: - * clutter/cltr-widget.c: (cltr_widget_show), - (cltr_widget_show_all), (cltr_widget_add_child): - * clutter/cltr-widget.h: - * clutter/cltr-window.c: (cltr_window_show), (cltr_window_paint), - (cltr_window_handle_xevent), (cltr_window_post_paint), - (cltr_window_set_paint_funcs), (cltr_window_xwin), - (cltr_window_hide_cursor), (cltr_window_set_fullscreen): - * clutter/cltr-window.h: - * examples/select.c: (usage), (init_video_ctrl), (show_video_ctrl), - (populate), (cell_to_item), (handle_xevent), (zoom_out_complete), - (zoom_in_complete), (cell_activated), (main): - Much Select hacking - -2005-05-17 mallum,,, - - * clutter/cltr-video.c: (cltr_video_get_pixbuf): - * gst/cltrimagesink.c: (gst_cltrimagesink_change_state), - (gst_cltrimagesink_chain): - Fix thread related segv's on grabbing video image. - Also pop any unplayed data from sink on stop - -2005-05-16 mallum,,, - - * clutter/cltr-animator.c: (cltr_animator_zoom_new), - (cltr_animator_fullzoom_new), (cltr_animator_new), - (cltr_animator_set_args), (cltr_animator_wrapped_paint): - * clutter/cltr-animator.h: - * clutter/cltr-list.c: (cltr_list_cell_new), - (cltr_list_get_active_cell_co_ords), (cltr_list_show), - (cltr_list_on_activate_cell), (cltr_list_update_layout), - (cltr_list_paint): - * clutter/cltr-list.h: - * clutter/cltr-texture.c: (cltr_texture_realize), - (cltr_texture_unref), (cltr_texture_sync_pixbuf), - (cltr_texture_force_rgb_data): - * clutter/cltr-video.c: (got_stream_length), (got_time_tick), - (got_state_change), (parse_stream_info), (cb_iterate), - (cltr_video_play), (cltr_video_set_volume), - (cltr_video_get_volume), (cltr_video_get_pixbuf), - (cltr_video_idler), (cltr_video_set_source), - (cltr_video_handle_xevent), (cltr_video_paint): - * clutter/cltr-video.h: - * clutter/cltr-widget.c: - * clutter/pixbuf.c: (pixbuf_write_png), (load_png_file), - (pixbuf_copy), (pixbuf_fill_rect), (pixbuf_scale_down), - (pixbuf_clone): - * examples/select.c: (usage), (populate), (cell_to_item), - (handle_xevent), (zoom_out_complete), (zoom_in_complete), - (cell_activated), (main): - * gst/cltrimagesink.c: (gst_cltrimagesink_getcaps), - (gst_cltrimagesink_chain): - Far too much hacking. Fix many endian image issues. - Greatly improve select demo - -2005-05-16 mallum,,, - - * clutter/Makefile.am: - * clutter/cltr-animator.c: - * clutter/cltr-animator.h: - * clutter/cltr-list.c: (distfunc), (cltr_list_new), - (cltr_list_get_active_cell_co_ords), (cltr_list_show), - (cltr_list_on_activate_cell), (cltr_list_handle_xevent), - (cltr_list_animate), (cltr_list_timeout_cb), - (cltr_list_update_layout), (cltr_list_paint): - * clutter/cltr-list.h: - * clutter/cltr-private.h: - * clutter/cltr.h: - * clutter/pixbuf.c: (load_png_file): - * examples/player.c: - * examples/select.c: (usage), (populate), (cell_activated), (main): - Work on animator zooming. Also build up select.c much - -2005-05-14 mallum,,, - - * clutter/cltr-animator.c: - Add initial outline - * clutter/cltr-button.c: (cltr_button_new_with_pixbuf), - (cltr_button_handle_xkeyevent), (cltr_button_handle_xevent), - (cltr_button_paint): - various tweaks/experimentation - * clutter/cltr-core.c: (cltr_init), (cltr_display_height): - * clutter/cltr-glu.c: (cltr_glu_set_color): - * clutter/cltr-glu.h: - Add unfilled rect call. - * clutter/cltr-label.c: (cltr_label_new), (cltr_label_paint): - * clutter/cltr-list.c: (distfunc), (cltr_list_cell_new), - (cltr_list_show), (cltr_list_animate), (cltr_list_paint): - update list a little. - * clutter/cltr-overlay.c: (cltr_overlay_handle_xevent), - (cltr_overlay_paint): - * clutter/cltr-private.h: - * clutter/cltr-texture.c: (cltr_texture_realize): - * clutter/cltr-video.c: (cltr_video_paint): - * clutter/cltr.h: - * clutter/fonts.c: (draw_layout_on_pixbuf): - Fix font alpha blending - * examples/Makefile.am: - * examples/player.c: (main): - * examples/scratch.c: (main): - tweaks. - * examples/select.c: - new example - -2005-05-11 mallum,,, - - * clutter/cltr-video.c: (got_buffering), (cltr_video_new), - (cltr_video_play), (cltr_video_idler): - * examples/photos.c: (main): - * examples/player.c: (handle_xevent), (main): - * gst/cltrimagesink.c: (gst_cltrimagesink_chain): - Fix Gl thread related crash on video playback - Make examples less bound to my laptop ;) - -2005-05-06 mallum,,, - - * clutter/cltr-button.c: (cltr_button_new_with_label): - * clutter/cltr-overlay.c: - * clutter/cltr-photo-grid.c: (cltr_photo_grid_cell_new), - (cltr_photo_grid_paint), (cltr_photo_grid_new): - * clutter/cltr-video.c: (cltr_video_print_tag), (got_buffering), - (got_error), (caps_set), (parse_stream_info), (cb_iterate), - (cltr_video_new), (cltr_video_play), (cltr_video_seek), - (cltr_video_seek_time), (cltr_video_stop), (cltr_video_close), - (cltr_video_pause), (cltr_video_can_set_volume), - (cltr_video_set_volume), (cltr_video_get_volume), - (cltr_video_idler), (cltr_video_set_source), (cltr_video_show), - (cltr_video_hide), (cltr_video_handle_xevent), (cltr_video_paint): - * clutter/cltr-video.h: - * clutter/cltr-widget.h: - * clutter/cltr-window.c: (cltr_window_show), (cltr_window_paint), - (cltr_window_handle_xevent), (cltr_window_set_fullscreen), - (cltr_window_focus_widget): - * clutter/cltr-window.h: - * clutter/cltr.h: - * clutter/fonts.c: (get_layout_bitmap), (font_draw), - (font_get_pixel_size): - * configure.ac: - * examples/photos.c: (photo_grid_populate): - * examples/player.c: (handle_xevent), (main): - * examples/scratch.c: (main): - Lots more tweaks, mainly updating video widget. - -2005-04-29 mallum,,, - - * clutter/cltr-button.c: (cltr_button_new), - (cltr_button_on_activate), (cltr_button_new_with_label), - (cltr_button_show): - * clutter/cltr-button.h: - * clutter/cltr-label.c: (cltr_label_new), (cltr_label_paint): - * clutter/cltr-private.h: - * clutter/cltr-video.c: (cltr_video_play): - * clutter/cltr-widget.c: (cltr_widget_new), (cltr_widget_abs_x), - (cltr_widget_abs_y), (cltr_widget_abs_x2), (cltr_widget_abs_y2), - (cltr_widget_width), (cltr_widget_height), (cltr_widget_show), - (cltr_widget_focus), (cltr_widget_unfocus), - (cltr_widget_set_focus_next), (cltr_widget_get_focus_next), - (cltr_widget_show_all): - * clutter/cltr-widget.h: - * clutter/cltr-window.c: (cltr_window_new), - (cltr_window_focus_widget): - * clutter/cltr.h: - * clutter/fonts.c: (draw_layout_on_pixbuf), (font_get_pixel_size): - * examples/scratch.c: (main): - Hack buttons some more - - -2005-04-27 mallum,,, - - * clutter/Makefile.am: - * clutter/cltr-button.c: (cltr_button_new): - * clutter/cltr-label.c: - * clutter/cltr-label.h: - * clutter/cltr-photo-grid.c: (cltr_photo_grid_paint): - * clutter/cltr-texture.c: (cltr_texture_realize), - (cltr_texture_new), (cltr_texture_unref), - (cltr_texture_no_tile_new): - * clutter/cltr-texture.h: - * clutter/cltr-video.c: (cltr_video_got_time_tick), (caps_set), - (cltr_video_new), (cltr_video_idler), (cltr_video_set_source), - (cltr_video_play), (cltr_video_pause), (cltr_video_show), - (cltr_video_hide), (cltr_video_handle_xevent), (cltr_video_paint): - * clutter/cltr.h: - * clutter/fonts.c: (font_new), (draw_layout_on_pixbuf), - (font_draw): - * clutter/fonts.h: - * clutter/pixbuf.c: (pixbuf_set_pixel), (pixbuf_get_pixel): - * examples/photos.c: (photo_grid_populate), (main): - * examples/player.c: (main): - Improve video widget, use playbin rather than gst_play - Lots of misc tweaks. - -2005-04-26 mallum,,, - - * clutter/Makefile.am: - * clutter/cltr-core.c: (cltr_init): - * clutter/cltr-events.c: (cltr_events_init), (cltr_main_loop): - * clutter/cltr-photo-grid.c: - * clutter/cltr-private.h: - * clutter/cltr-scratch.c: (cltr_scratch_handle_xevent), - (cltr_scratch_paint): - * clutter/cltr-texture.c: (cltr_texture_render_to_gl_quad), - (init_tiles), (cltr_texture_unrealize), (cltr_texture_realize), - (cltr_texture_new), (cltr_texture_no_tile_new), - (cltr_texture_get_pixbuf): - * clutter/cltr-texture.h: - * clutter/cltr-video.c: - * clutter/cltr-video.h: - * clutter/cltr-widget.c: (cltr_widget_queue_paint): - * clutter/cltr.h: - * examples/Makefile.am: - * examples/player.c: - * gst/cltrimagesink.c: (gst_cltrimagesink_fixate), - (gst_cltrimagesink_getcaps), (gst_cltrimagesink_sink_link), - (gst_cltrimagesink_change_state), (gst_cltrimagesink_chain), - (gst_cltrimagesink_set_property), (gst_cltrimagesink_get_property), - (gst_cltrimagesink_finalize), (gst_cltrimagesink_class_init): - * gst/cltrimagesink.h: - Initial go at very hacky gst video widget - -2005-04-22 mallum,,, - - * clutter/Makefile.am: - * clutter/cltr-button.c: - * clutter/cltr-button.h: - * clutter/cltr-core.c: (cltr_init): - * clutter/cltr-overlay.c: - * clutter/cltr-overlay.h: - * clutter/cltr-photo-grid.c: (cltr_photo_grid_handle_xevent), - (cltr_photo_grid_cell_new), (ctrl_photo_grid_get_zoomed_coords), - (cell_is_offscreen), (cltr_photo_grid_idle_cb), - (cltr_photo_grid_navigate), (cltr_photo_grid_activate_cell), - (cltr_photo_grid_populate), (cltr_photo_grid_update_visual_state), - (cltr_photo_grid_paint), (cltr_photo_grid_show), - (cltr_photo_grid_set_fps), (cltr_photo_grid_get_fps), - (cltr_photo_grid_set_anim_steps), (cltr_photo_grid_get_anim_steps), - (cltr_photo_grid_new): - Fix up grid so external prog can load images. - * clutter/cltr-photo-grid.h: - * clutter/cltr-texture.c: (cltr_texture_realize), - (cltr_texture_new): - * clutter/cltr-texture.h: - * clutter/cltr-window.c: (cltr_window_set_fullscreen): - * clutter/cltr.h: - * clutter/pixbuf.c: (pixbuf_scale_down), (ConvolveImage), - (GaussianBlurImage): - * clutter/pixbuf.h: - New experimental Methods - * configure.ac: - * examples/Makefile.am: - * examples/photos.c: - * examples/player.c: - Add new examples - * gst/Makefile.am: - * gst/cltrimagesink.c: - * gst/cltrimagesink.h: - Add initial crusty ( broken ) gst stuff - -2005-04-13 mallum,,, - - * bootstrap-autotools.sh: - * clutter/Makefile.am: - * clutter/cltr.c: - * configure.ac: - * examples/Makefile.am: - * examples/scratch.c: - Initial autotooling of everything. - -2005-04-07 mallum,,, - - * Makefile: - * cltr-events.c: (cltr_main_loop): - * cltr-list.c: - * cltr-list.h: - Add list widget - * cltr-photo-grid.c: (cltr_photo_grid_cell_new), - (cltr_photo_grid_append_cell), (ctrl_photo_grid_cell_to_coords), - (ctrl_photo_grid_get_zoomed_coords), (cltr_photo_grid_idle_cb), - (cltr_photo_grid_navigate), (cltr_photo_grid_activate_cell), - (cltr_photo_grid_update_visual_state), (cltr_photo_grid_paint), - (cltr_photo_grid_show), (cltr_photo_grid_new): - * cltr-texture.c: - * cltr-widget.c: - * cltr-window.c: (cltr_window_new), (cltr_window_show), - (cltr_window_handle_xevent): - * cltr-window.h: - * cltr.c: (main): - * cltr.h: - * pixbuf.c: (pixbuf_copy): - * pixbuf.h: - Cleanups - -2005-04-03 mallum,,, - - * Makefile: - * cltr-core.c: - * cltr-core.h: - * cltr-events.c: - * cltr-events.h: - * cltr-photo-grid.c: (cltr_photo_grid_handle_xkeyevent), - (cltr_photo_grid_handle_xevent), (cltr_photo_grid_cell_new), - (cltr_photo_grid_append_cell), (ctrl_photo_grid_cell_to_coords), - (ctrl_photo_grid_get_zoomed_coords), (cell_is_offscreen), - (cltr_photo_grid_idle_cb), (cltr_photo_grid_navigate), - (cltr_photo_grid_activate_cell), (cltr_photo_grid_populate), - (cltr_photo_grid_paint), (cltr_photo_grid_show), - (cltr_photo_grid_new): - * cltr-photo-grid.h: - * cltr-private.h: - * cltr-texture.c: - * cltr-texture.h: - * cltr-widget.c: - * cltr-widget.h: - * cltr-window.c: - * cltr-window.h: - * cltr.c: - * cltr.h: - Add very basic initial toolkit infrastructure - -2005-03-31 mallum,,, - - * cltr-photo-grid.c: (cltr_photo_grid_append_cell), - (ctrl_photo_grid_cell_to_coords), - (ctrl_photo_grid_get_zoomed_coords), (cell_is_offscreen), - (cltr_photo_grid_idle_cb), (cltr_photo_grid_navigate), - (cltr_photo_grid_activate_cell), (cltr_photo_grid_populate), - (cltr_photo_grid_redraw), (cltr_photo_grid_new): - * cltr-photo-grid.h: - * cltr-texture.c: (cltr_texture_render_to_gl_quad), (init_tiles), - (cltr_texture_realize): - * cltr-texture.h: - * cltr.c: (main): - Implemented scrolling. Very rough around the edges, needs tidying. - -2005-03-30 mallum,,, - - * Makefile: - * cltr-photo-grid.c: (cltr_photo_grid_redraw), - (cltr_photo_grid_new): - * cltr-tex.c: - * cltr-tex.h: - * cltr-texture.c: (cltr_texture_new): - More renaming - -2005-03-30 mallum,,, - - * cltr-photo-grid.c: (cltr_photo_grid_populate), - (cltr_photo_grid_redraw), (cltr_photo_grid_new): - * cltr-photo-grid.h: - * cltr-tex.c: (next_p2), (cltr_texture_render_to_gl_quad), - (tile_dimension), (init_tiles), (cltr_texture_new): - * cltr-tex.h: - * cltr.h: - Rename CltrImage -> CltrTexture - -2005-03-30 mallum,,, - - * Makefile: - * cltr-photo-grid.c: (cltr_photo_grid_populate), - (cltr_photo_grid_redraw): - * cltr-photo-grid.h: - * cltr-tex.c: - * cltr-tex.h: - * cltr.c: (main): - * cltr.h: - * pixbuf.c: (pixbuf_unref), (pixbuf_copy): - * pixbuf.h: - Add intial new texture tiling code. - -2005-03-27 mallum,,, - - * Makefile: - * cltr-photo-grid.c: (cltr_photo_grid_cell_new), - (ctrl_photo_grid_get_zoomed_coords), (cltr_photo_grid_navigate), - (cltr_photo_grid_activate_cell), (cltr_photo_grid_populate), - (cltr_photo_grid_redraw), (cltr_photo_grid_new): - * cltr-photo-grid.h: - * cltr.c: (cltr_dispatch_x_event), (cltr_init), (test_idle_cb), - (main): - * cltr.h: - Add a very hacky threaded image loader. - Make event handling a little more efficient, though still hacky - * pixbuf.c: (pixel_set_vals), pixbuf.h: - Add copy func ( unused as yet ) - -2005-03-25 mallum,,, - - * cltr-photo-grid.c: (cltr_photo_grid_cell_new), - (ctrl_photo_grid_get_zoomed_coords), (cltr_photo_grid_redraw), - (cltr_photo_grid_new): - * cltr-photo-grid.h: - * cltr.c: (cltr_window_new), (idle_cb), (main): - Use GL matrices in a saner way. - Add random rotation to picts - Random minor tweaks - -2005-03-24 mallum,,, - - * Makefile: - * cltr-photo-grid.c: - * cltr-photo-grid.h: - * cltr.c: (cltr_window_new), (cltr_main_loop): - * cltr.h: - Split up cltr.c a bit. start refactoring a bit. - -2005-03-23 mallum,,, - - * cltr.c: (cltr_photo_grid_populate), (cltr_photo_grid_redraw), - (cltr_photo_grid_new), (main): - * cltr.h: - Various minor tweaks - * pixbuf.c: (pixbuf_set_pixel), (pixbuf_get_pixel): - Fix RGBA ordering in set/get pixel - -2005-03-23 mallum,,, - - * cltr.c: (ctrl_photo_grid_get_trans_coords), - Fix grid co-ords -> translation vals converter - (cltr_photo_grid_navigate), (cltr_photo_grid_redraw), - (cltr_photo_grid_new), (idle_cb): - Fix moving between pictures when zoomed - - -2005-03-23 mallum,,, - - * cltr.c: (cltr_dispatch_x_event), (cltr_window_new), - (cltr_main_loop), (cltr_photo_grid_navigate), - (cltr_photo_grid_activate_cell), (cltr_photo_grid_populate), - (cltr_photo_grid_redraw), (cltr_photo_grid_new), (idle_cb), (main): - * cltr.h: - Lots, make the grid roughly work. - - * fonts.c: (get_layout_bitmap), (font_draw): - remove debug printfs - -2005-03-22 mallum,,, - - * cltr.c: (x_event_prepare), (x_event_check), (x_event_dispatch), - (cltr_dispatch_x_event), (cltr_init), (cltr_window_new), - (cltr_photo_grid_append_cell), (cltr_photo_grid_populate), - (cltr_photo_grid_redraw), (cltr_photo_grid_new), - (idle_cb), (main): - * cltr.h: - Add glib event loop diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/ChangeLog.SVN /tmp/VXszleoOf1/clutter-0.9.0/ChangeLog.SVN --- clutter-0.8.4/ChangeLog.SVN 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/ChangeLog.SVN 2009-01-29 13:31:51.000000000 +0000 @@ -0,0 +1,15737 @@ +2008-12-10 Neil Roberts + + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gl/cogl-defines.h.in: + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/common/cogl-mesh.c: Rename the glBufferDataSub + function to glBufferSubData. When calling glXGetProcAddress with + the former Mesa returns a stub dispatch function which will + segfault if you try to use it. With NVIDIA it returns NULL so + _cogl_features_init decides the card doesn't have VBO support. + +2008-12-10 Neil Roberts + + Bug 1323 - ClutterBehaviorDepth conflicts with other behaviors + + * clutter/clutter-behaviour-ellipse.c (actor_apply_knot_foreach): + Don't set the depth if there is no x or y tilt. That way it can + still be used in conjunction with ClutterBehaviourDepth. Thanks to + Tonny Tzeng. + +2008-12-08 Emmanuele Bassi + + * clutter/clutter-binding-pool.h: Fix the ActivateFunc + documentation by adding a "return value" annotation. + +2008-12-08 Emmanuele Bassi + + * clutter/Makefile.am: + * clutter/clutter.h: Add ClutterBindingPool to the build. + + * clutter/clutter-binding-pool.c: + * clutter/clutter-binding-pool.h: Add ClutterBindingPool, a data + structure meant to hold (key symbol, modifiers) pairs and associate + them to a closure. The ClutterBindingPool can be used to install + key bindings for actors and then execute closures inside the + key-press-event signal handlers, removing the need for big + switch() or if() blocks for each key. + + * clutter/clutter-event.c: Consistently use "key symbol" instead + of "key value". + + * clutter/clutter-event.h: Add more modifier masks. + + * clutter/clutter-marshal.list: + + * tests/conform/Makefile.am: + * tests/conform/test-binding-pool.c: + * tests/conform/test-conform-main.c: Add ClutterBindingPool + conformance test. + + * tests/interactive/Makefile.am: + * tests/interactive/test-binding-pool.c: Add interactive test (and + example code) for the ClutterBindingPool usage. + +2008-12-08 Neil Roberts + + * clutter/clutter-main.c (_clutter_do_pick): Restore the GL_DITHER + state after reading the pixel value instead of before. Suggested + in bug 1328 thanks to Guy Zadickario. + +2008-12-05 Emmanuele Bassi + + Bug 1309 - clutter_timeline_new and clutter_timeline_set_speed + have two standard of the fps limitation + + * clutter/clutter-timeline.c: + (clutter_timeline_class_init): Set the maximum value of the + :fps property to be G_MAXUINT. (Zhang Wei) + +2008-12-05 Neil Roberts + + * clutter/clutter-entry.c: Fix the 'Since' annotation in the + gtk-doc. + +2008-12-05 Neil Roberts + + * clutter/clutter-timeline.c: + * clutter/clutter-texture.c: + * clutter/clutter-stage.c: + * clutter/clutter-label.c: + * clutter/clutter-behaviour-path.c: + * clutter/clutter-actor.c: Fix the 'Since' annotation in the + gtk-doc. + +2008-12-05 Neil Roberts + + 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-04 Neil Roberts + + Bug 1297 - Bring back support for GL_ARB_texture_rectangle + + * clutter/cogl/gl/cogl-texture.c (cogl_texture_new_from_foreign, + (_cogl_texture_quad_hw, cogl_texture_polygon), + (_cogl_texture_quad_sw): Support GL_ARB_texture_rectangle textures + + * clutter/glx/clutter-glx-texture-pixmap.c: Use rectangle textures + when NPOTs are not available or it is forced by the + CLUTTER_PIXMAP_TEXTURE_RECTANGLE environment variable. + + * clutter/cogl/gl/cogl.c (cogl_enable): Allow enabling + GL_TEXTURE_RECTANGLE_ARB. + +2008-12-04 Neil Roberts + + Bug 1172 - Disjoint paths and clip to path + + * clutter/cogl/cogl-path.h: + * clutter/cogl/common/cogl-primitives.c: + * clutter/cogl/common/cogl-primitives.h: + * clutter/cogl/gl/cogl-primitives.c: + * clutter/cogl/gles/cogl-primitives.c: Changed the semantics of + cogl_path_move_to. Previously this always started a new path but + now it instead starts a new disjoint sub path. The path isn't + cleared until you call either cogl_path_stroke, cogl_path_fill or + cogl_path_new. There are also cogl_path_stroke_preserve and + cogl_path_fill_preserve functions. + + * clutter/cogl/gl/cogl-context.c: + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gles/cogl-context.c: + * clutter/cogl/gles/cogl-context.h: Convert the path nodes array + to a GArray. + + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gles/cogl-texture.c: Call cogl_clip_ensure + + * clutter/cogl/common/cogl-clip-stack.c: + * clutter/cogl/common/cogl-clip-stack.h: Simplified the clip + stack code quite a bit to make it more maintainable. Previously + whenever you added a new clip it would go through a separate route + to immediately intersect with the current clip and when you + removed it again it would immediately rebuild the entire clip. Now + when you add or remove a clip it doesn't do anything immediately + but just sets a dirty flag instead. + + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl.c: Taken away the code to intersect + stencil clips when there is exactly one stencil bit. It won't work + with path clips and I don't know of any platform that doesn't have + eight or zero stencil bits. It needs at least three bits to + intersect a path with an existing clip. cogl_features_init now + just decides you don't have a stencil buffer at all if you have + less than three bits. + + * clutter/cogl/cogl.h.in: New functions and documentation. + + * tests/interactive/test-clip.c: Replaced with a different test + that lets you add and remove clips. The three different mouse + buttons add clips in different shapes. This makes it easier to + test multiple levels of clipping. + + * tests/interactive/test-cogl-primitives.c: Use + cogl_path_stroke_preserve when using the same path again. + + * doc/reference/cogl/cogl-sections.txt: Document the new + functions. + +2008-12-03 Robert Bragg + + Bug 1303 - clutter_glx_texture_pixmap_using_extension doesn't check if + fallbacks are being used + + * glx/clutter-glx-texture-pixmap.c: + clutter_glx_texture_pixmap_using_extension now checks to see if + priv->use_fallback is TRUE not just that the tfp extension is + available. + +2008-12-01 Neil Roberts + + Bug 1305 - NPOT textures unaligned to a pixel sometimes have + border artifacts + + * clutter/cogl/gl/cogl-texture.c: Set the wrap mode of a texture + on demand + + Instead of setting the wrap mode once per texture at creation, it + is now changed whenever the texture is drawn. The previous value + is cached so that it isn't changed if the value is the same. + + This is used in _cogl_texture_quad_hw to only enable GL_REPEAT + mode when the coordinates are not in the range [0,1]. Otherwise it + can pull in pixels from the other edge when the texture is + rendered off-pixel. + +2008-11-28 Neil Roberts + + * tests/conform/test-backface-culling.c (TEXTURE_SIZE): Don't set + to a funny size on GLES because it will break cogl_texture_polygon + +2008-11-28 Neil Roberts + + * tests/conform/test-backface-culling.c: New test for backface + culling + + * tests/conform/test-conform-main.c (main): Add + /texture/test_backface_culing + + * tests/conform/Makefile.am (test_conformance_SOURCES): Add + test-backface-culling.c + +2008-11-28 Neil Roberts + + * tests/conform/test-mesh-mutability.c: + * tests/conform/test-mesh-interleved.c: + * tests/conform/test-mesh-contiguous.c: Remove the idle source + after the test is complete so that it won't interfere with other + tests. + +2008-11-26 Emmanuele Bassi + + * clutter/clutter-group.c: + (clutter_group_real_raise), (clutter_group_real_lower): Repaint + the Group on raise and lower. + +2008-11-26 Neil Roberts + + * clutter/cogl/gl/cogl-texture.c (cogl_texture_rectangle): Fixed + the test for whether to use hardware tiling. Previously it assumed + that texture coordinates are in increasing order but this is not + the case since bug 1057 was fixed. The texture coordinates are now + sorted later. It also allowed negative coordinates which doesn't + make sense if the texture has waste. + +2008-11-25 Emmanuele Bassi + + * configure.ac: Remove stray dependency on gdk-pixbuf-xlib; we + don't use the xlib specific API anymore. (thanks to Matthias + Clasen) + +2008-11-25 Neil Roberts + + Bug 1299 - clutter_score_remove will segmentation fault if + timelines are more than 52 and continue to remove them + + * clutter/clutter-score.c (traverse_children): Don't destroy the + entry in the handler for REMOVE_BY_ID. It will be removed again + anyway in the call to g_node_traverse. This was causing a + crash. Thanks to zhangwei for spotting. + +2008-11-24 Neil Roberts + + Add a wrapper library to help testing without NPOTs. + + * tests/tools/Makefile.am: Optionally build the + libdisable-npots.la library depending on whether libdl was + detected in the configure script. A helper script is also + generated to setup the LD_PRELOAD. + + * tests/conform/Makefile.am: There are now two versions of the + test-report and full-report rules. test-report-normal is the same + as before and test-report-disable-npots runs the tests with the + disable-npots wrapper script. The full-report rule runs both of + them and displays two separate HTML files. The test-report rule + just runs the normal version as before. + + * configure.ac: Add a test for libdl + + * tests/tools/disable-npots.sh.in: New file. Template for the + helper script + + * tests/tools/disable-npots.c: New file + +2008-11-24 Neil Roberts + + * clutter/cogl/gl/cogl-texture.c (cogl_texture_polygon): Fix the + equation for calculating texture coordinates when using sliced + textures. This became broken in revision 3520. + +2008-11-21 Neil Roberts + + Bug 1270 - Update to mingw-cross-compile.sh + + * build/mingw/mingw-cross-compile.sh: Update to download latest + binaries. Patch thanks to David Kedves. + +2008-11-21 Neil Roberts + + Bug 1271 - mingw compiling failed: undefined reference to + `_glDrawRangeElements@24' + + Resolve glDrawRangeElements with cogl_get_proc_address instead of + calling it directly because functions defined in GL > 1.1 are not + directly exported under Windows. + + * clutter/cogl/common/cogl-mesh.c: Use the function pointer from + the context + + * clutter/cogl/gl/cogl-context.c (cogl_create_context): Initialise + function pointer. + + * clutter/cogl/gl/cogl-context.h (CoglContext): Add a function + pointer + + * clutter/cogl/gl/cogl-defines.h.in: Add a typedef for the + function pointer. + + * clutter/cogl/gl/cogl.c (_cogl_features_init): Resolve + glDrawRangeElements + +2008-11-21 Neil Roberts + + * tests/interactive/Makefile.am: + * tests/conform/Makefile.am: Use $(EXEEXT) when specifying a + dependency on an executable otherwise there won't be a rule to + build it on Windows. + +2008-11-21 Neil Roberts + + Bug 1269 - mingw32 building failed at clutter-media.c + + * clutter/clutter-media.c: Rename the 'ERROR' signal enum to + 'ERROR_SIGNAL' otherwise it clashes with windgi.h. Thanks to David + Kedves + +2008-11-21 Neil Roberts + + * clutter/pango/cogl-pango.h: Include pango/pango.h to get + pango-renderer.h. In versions prior to 1.18.4 pangocairo.h does + not include pango-renderer.h + +2008-11-21 Neil Roberts + + Bug 1280 - clutter_score_append_at_marker lead to segmentation + fault in trunk and incorrect appearance in clutter-0.8 + + * clutter/clutter-score.c (start_children_entries): Check whether + the child timeline is actually attached at a marker before + comparing whether the marker's name matches the marker + reached. This fixes a crash that happens when a marker is reached + on a timeline that also has child timelines attached at the + end. Thanks to zhangwei for spotting. + +2008-11-20 Emmanuele Bassi + + * clutter/clutter-actor.c: + (clutter_actor_set_property): Add sanity checks for NULL + boxed values when setting the rotation center. + + * tests/interactive/test-animation.c: + (on_button_press): Add an example on how to use the rotation + properties to animate an actor. + +2008-11-18 Neil Roberts + + Fixed some trivial compiler warnings + + * tests/interactive/test-pixmap.c (create_pixmap): Use a format + string instead of passing the error message directly to g_error. + + * tests/interactive/test-easing.c (test_easing_main) + (on_button_press): + * tests/interactive/test-animation.c (on_button_press): Use + unsigned variables for the results from clutter_actor_get_size + otherwise it complains about the pointer signedness being + different. + + * clutter/clutter-script.c (clutter_script_add_search_paths): Use + G_GSIZE_FORMAT instead of %d for a gsize parameter otherwise it + gets upset on 64-bit. + +2008-11-18 Neil Roberts + + * tests/conform/test-timeline.c (test_timeline): Remove the delay + idle handler after the test is finished, otherwise it will + continue running during subsequent tests. This was breaking + test_timeline_interpolate. + +2008-11-18 Robert Bragg + + * clutter/cogl/common/cogl-mesh.c: + Re-works validate_custom_attribute_name() so it doesn't access an + un-initialised variable. + +2008-11-18 Robert Bragg + + A comparison of gl/cogl-texture.c and gles/cogl-texture.c, to reduce + differences and improve maintainability. + + * clutter/cogl/gl/cogl-context.h: + Adds a CoglTextureGLVertex typedef + texture_vertices and + texture_vertices_size members to CoglContext for using vertex arrays + like GLES does + + * clutter/cogl/gl/cogl-context.c: + Initializes texture_vertices + texture_vertices_size members + + * clutter/cogl/gl/cogl-internal.h: + Adds COGL_ENABLE_COLOR_ARRAY + + * clutter/cogl/gl/cogl.c: + Add COGL_ENABLE_COLOR_ARRAY support to cogl_enable + + * clutter/cogl/gles/cogl-context.h: + Change the CoglTextureGLVertex to use GLfloat for the position + and texture coord attributes and GLubyte for the color. + + * clutter/cogl/gles/cogl-texture-private.h: + Adds a wrap_mode member like GL has. + + * clutter/cogl/gl/cogl-texture.c + * clutter/cogl/gles/cogl-texture.c: + Improves the comparability of the files, such that the remaining + differences, better reflect the fundamental differences needed + between GL and GLES. Notably GL no longer uses glBegin/glEnd for + submitting vertices, it uses vertex arrays like GLES and this gives + a small but measurable fps improvement for test-text. + +2008-11-18 Robert Bragg + + * clutter/cogl/gl/cogl-internal.h + * clutter/cogl/gles/cogl-internal.h: + Removes semicolon after the GE() macro since that breaks using it as a + single statement. + +2008-11-18 Emmanuele Bassi + + * clutter/clutter.h: Add clutter-shader.h and + clutter-shader-types.h to the global include. + +2008-11-18 Emmanuele Bassi + + * clutter/cogl/cogl-shader.h: Add a function for setting an + integer uniform, similar to cogl_program_uniform_1f(). + + * clutter/cogl/gl/cogl-program.c: Implement the GL version + of cogl_program_uniform_1i(). + + * clutter/cogl/gles/cogl-program.c: Implement the GLES version + of cogl_program_uniform_1i(). + +2008-11-18 Emmanuele Bassi + + Bug 1049 - Clutter doesn't support most GLSL uniforms (patch + by Chris Lord and Neil Roberts) + + * README: Update release notes. + + * clutter/Makefile.am: + * clutter/clutter-shader-types.[ch]: Add GValue types for + shader values. + + * clutter/clutter-actor.[ch]: Update the shader API to use + the newly added GValue support for GLSL shader uniform + setters. + + * clutter/clutter-shader.[ch]: Add float and integer convenience + API for single value GLSL uniform setters. + + * clutter/cogl/cogl-shader.h: Add new uniform setters. + + * clutter/cogl/gl/cogl-context.c: + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gl/cogl-defines.h.in: + * clutter/cogl/gl/cogl-program.c: + * clutter/cogl/gl/cogl.c: Update the GL implementation of COGL + to handle the GLSL uniform setters. + + * clutter/cogl/gles/cogl-gles2-wrapper.c: + * clutter/cogl/gles/cogl-gles2-wrapper.h: + * clutter/cogl/gles/cogl-internal.h: + * clutter/cogl/gles/cogl-program.c: Update the GLES 2.0 implementation + of COGL to handle the GLSL uniform setters. + + * doc/reference/clutter/clutter-sections.txt: + * doc/reference/cogl/cogl-sections.txt: Update the documentation. + + * tests/interactive/test-fbo.c: + * tests/interactive/test-shader.c: Update the shader tests. + +2008-11-18 Emmanuele Bassi + + * clutter/clutter-texture.c: + (clutter_texture_get_preferred_width): Fix the usage of the + fixed point division macro. + +2008-11-18 Emmanuele Bassi + + * tests/conform/test-conform-main.c (main): Do not run the + conformance test suite if we are on X11 but we do not have + a DISPLAY available. Some of the tests require a DISPLAY, + and everything passes through a clutter_init() call which will + fail anyway. If we are running make distcheck on an headless + box we might as well just skip the conformance test suite + without a meaningless error. + +2008-11-18 Emmanuele Bassi + + * tests/conform/test-mesh-contiguous.c: + * tests/conform/test-mesh-interleved.c: + * tests/conform/test-mesh-mutability.c: Remove the last bare + g_print() from the conformance test suite. + +2008-11-18 Emmanuele Bassi + + * clutter/clutter-alpha.h: + * clutter/clutter-alpha.c: + (clutter_alpha_set_mode): Use a lookup table to find the alpha + function given the animation mode. + + (clutter_exp_in_func), + (clutter_exp_out_func), + (clutter_exp_in_out_func): Add new exponential functions. + + * clutter/clutter-script.c: Update the lookup table with the + new animation modes; match "linear" to the ramp-inc alpha + function. + + * clutter/clutter-types.h: Add new AnimationMode values. + + * tests/interactive/test-easing.c: Update the easing functions + test. + +2008-11-18 Neil Roberts + + * tests/conform/test-pick.c (test_pick): The final result message + when --verbose is used was the wrong way around + +2008-11-18 Neil Roberts + + * tests/conform/test-conform-main.c (main): Fixed a typo in the + name of the path for test_realized. + +2008-11-17 Emmanuele Bassi + + Bug 1014 - Clutter Animation API Improvements + + * clutter/Makefile.am: + * clutter/clutter.h: Update the build + + * clutter/clutter-types.h: Add AnimationMode, an enumeration + for easing functions. + + * clutter/clutter-alpha.[ch]: Add the :mode property to + control the function bound to an Alpha instance using an + enumeration value. Also add six new alpha functions: + + - ease-in, ease-out, ease-in-out + - sine-in, sine-out, sine-in-out + + * clutter/clutter-deprecated.h: Deprecate the #defines for + the alpha functions. They will be replaced by entries in the + ClutterAnimationMode. + + * clutter/clutter-interval.[ch]: Add ClutterInterval, an + object for defining, validating and computing an interval + between two values. + + * clutter/clutter-animation.[ch]: Add ClutterAnimation, an + object responsible for animation the properties of a single + actor along an interval of values. ClutterAnimation memory + management is automatic. A simple wrapper method for + ClutterActor is provided: + + clutter_actor_animate() + + which will create, or update, an animation for the passed + actor. + + * clutter/clutter-debug.h: + * clutter/clutter-main.c: Add a new 'animation' debug note. + + * clutter/clutter-script.c: Clean up the alpha functions + whitelist, and add the new functions. + + * doc/reference/clutter/Makefile.am: + * doc/reference/clutter/clutter-sections.txt: Update the + API reference. + + * doc/reference/clutter/clutter-animation.xml: Renamed to + doc/reference/clutter/clutter-animation-tutorial.xml to + avoid clashes with the ClutterAnimation section. + + * doc/reference/clutter/clutter-docs.sgml: Renamed to + doc/reference/clutter/clutter-docs.xml, as it was an XML + file and not a SGML file. + + * tests/Makefile.am: + * tests/interactive/Makefile.am: + * tests/interactive/test-animation.c: + * tests/interactive/test-easing.c: Add two tests for the + new simple animation API and the easing functions. + + * tests/interactive/test-actors.c: + * tests/interactive/test-behave.c: + * tests/interactive/test-depth.c: + * tests/interactive/test-effects.c: + * tests/interactive/test-layout.c: + * tests/interactive/test-multistage.c: + * tests/interactive/test-paint-wrapper.c: + * tests/interactive/test-rotate.c: + * tests/interactive/test-scale.c: + * tests/interactive/test-texture-quality.c: + * tests/interactive/test-threads.c: + * tests/interactive/test-viewport.c: Update interactive tests + to the deprecations and new alpha API. + +2008-11-17 Emmanuele Bassi + + * clutter/clutter-entry.c: + * clutter/clutter-label.c: + * clutter/clutter-rectangle.c: + * clutter/clutter-script.c: + * clutter/clutter-stage.c: Use the ParamSpecColor and GValue + API for ClutterColor-based properties. + +2008-11-14 Robert Bragg + + * tests/interactive/Makefile.am + * tests/interactive/test-pixmap.c: + test-pixmap + test-devices accidentally got dropped from the makefiles + when changing the unit test layout; this puts them back. + +2008-11-14 Emmanuele Bassi + + Bug 1265 - ClutterScore doesn't emit 'started' signal (Bastian + Winkler) + + * clutter/clutter-score.c: Emit the ::started signal. + + * tests/interactive/test-score.c: Check the emission of the + Score signals. + +2008-11-13 Neil Roberts + + * clutter/cogl/gles/cogl-gles2-wrapper.h: + * clutter/cogl/gles/cogl-gles2-wrapper.c: + Initialise the 'tex' sampler uniform to 0. The GLSL spec + specifically says that you must initialize sampler uniforms. This + fixes texturing for GLES 2 when using the PowerVR simulator via + software Mesa. + +2008-11-13 Robert Bragg + + Gets the mesh API working with GLES2 + + * clutter/cogl/common/cogl-mesh.c: + Make sure we use the appropriate cogl_wrap_gl* funcs as appropriate + + * clutter/cogl/gles/cogl-gles2-wrapper.c + * clutter/cogl/gles/cogl-gles2-wrapper.h: + In our glColorPointer wrapper we needed to mark our color attribute + as normalized. + + * tests/conform/Makefile.am: + When creating unit test symlinks we use the -l gtester option to + list tests, but when using the PVR SDK the test binary also spews + out some extra info that caused lots of random symlinks to be + created. We now grep for lines starting with a '/' + + * tests/conform/test-mesh-contiguous.c + * tests/conform/test-mesh-mutability.c: + Use cogl_set_source_color instead of directly calling glColor4ub + +2008-11-13 Neil Roberts + + * clutter/clutter-actor.c (clutter_actor_get_paint_visibility): + Fix logic so that it won't return TRUE for a hidden stage. + +2008-11-13 Emmanuele Bassi + + * clutter/clutter-behaviour-ellipse.c: + (clutter_behaviour_ellipse_applied): Do not reset the depth + of the actors to which the Ellipse behaviour has been applied + to, unless the behaviour is going to update it because it has + a tilt on the X or Y axis. + +2008-11-13 Neil Roberts + + * clutter/clutter-actor.c (clutter_actor_get_reactive) + (clutter_actor_get_paint_visibility): Be sure to return exactly + TRUE or FALSE instead of zero or some non-zero value in these + functions that return a gboolean. Thanks to Kai Wei for spotting. + +2008-11-12 Emmanuele Bassi + + * tests/conform/Makefile.am: + * tests/conform/test-conform-main.c: + * tests/conform/test-paint-opacity.c: Add test unit for label, + rectangle and paint opacity. + +2008-11-12 Emmanuele Bassi + + * clutter/cogl/cogl-color.h: + * clutter/cogl/cogl-path.h: + * clutter/cogl/cogl-types.h: + * clutter/cogl/common/cogl-color.c: Deprecated cogl_color() + in favour of cogl_set_source_color() and friends; store the + CoglColor components as unsigned bytes instead of fixed point + normalized values; add functions for allocating, copying and + freeing CoglColor, for use of language bindings. + + * clutter/cogl/cogl.h.in: + * clutter/cogl/cogl-deprecated.h: Added cogl-deprecated.h, + an header file containing the deprecation symbols similar + to clutter-deprecated.h. + + * clutter/cogl/gl/Makefile.am: + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/Makefile.am: + * clutter/cogl/gles/cogl-texture.c: + * clutter/cogl/gles/cogl.c: Update the GL and GLES implementations + of COGL after the CoglColor changes. + + * clutter/clutter-actor.c: + * clutter/clutter-clone-texture.c: + * clutter/clutter-entry.c: + * clutter/clutter-label.c: + * clutter/clutter-rectangle.c: + * clutter/clutter-texture.c: Do not use CoglColor whenever it + is possible, and use cogl_set_source_color4ub() instead. + + * clutter/pango/cogl-pango-render.c: Ditto as above. + + * doc/reference/clutter/subclassing-ClutterActor.xml: + * doc/reference/cogl/cogl-sections.txt: Update the documentation. + + * tests/interactive/test-cogl-offscreen.c: + * tests/interactive/test-cogl-primitives.c: + * tests/interactive/test-cogl-tex-convert.c: + * tests/interactive/test-cogl-tex-foreign.c: + * tests/interactive/test-cogl-tex-getset.c: + * tests/interactive/test-cogl-tex-polygon.c: + * tests/interactive/test-cogl-tex-tile.c: + * tests/interactive/test-paint-wrapper.c: Drop the usage of + CoglColor whenever it is possible. + +2008-11-12 Neil Roberts + + Bug 1057 - cogl_texture_rectangle doesn't support backward + coordinates + + * clutter/cogl/gl/cogl-texture.c: Instead of sorting the vertex + and texture coordinates passed to cogl_texture_rectangle, just + swap both sets whenever the texture coordinates are backward. + +2008-11-12 Neil Roberts + + * clutter/clutter-rectangle.c (clutter_rectangle_paint): Fixed so + that it doesn't use the alpha value from the border colour to draw + the rectangle + +2008-11-12 Neil Roberts + + * clutter/cogl/gles/Makefile.am (libclutterinclude_HEADERS): + * clutter/cogl/gl/Makefile.am (libclutterinclude_HEADERS): + * clutter/cogl/common/Makefile.am + (libclutter_cogl_common_la_SOURCES): Move cogl-mesh.h into the + headers for libclutter so that it will get installed. + +2008-11-12 Neil Roberts + + Fix warnings in mesh tests + + * tests/conform/test-mesh-mutability.c (on_paint): + * tests/conform/test-mesh-interleved.c (on_paint): + * tests/conform/test-mesh-contiguous.c (on_paint): Use g_usleep + instead of sleep + + * tests/conform/test-mesh-mutability.c (queue_redraw): + * tests/conform/test-mesh-interleved.c (queue_redraw): + * tests/conform/test-mesh-contiguous.c (queue_redraw): Added + missing return statement + + * clutter/cogl/cogl-mesh.h: Add a declaration for + cogl_mesh_submit + + * clutter/cogl/common/cogl-mesh.c (cogl_mesh_submit): Move the + documentation to cogl-mesh.h to match the rest of the functions + +2008-11-10 Robert Bragg + + Bug 1164 - Implements the proposed Mesh API + + * clutter/cogl/cogl-mesh.h + * clutter/cogl/cogl-types.h + * clutter/cogl/cogl.h.in + * clutter/cogl/common/Makefile.am + * clutter/cogl/common/cogl-mesh-private.h + * clutter/cogl/common/cogl-mesh.c + * clutter/cogl/gl/cogl-context.c + * clutter/cogl/gl/cogl-context.h + * clutter/cogl/gl/cogl-defines.h.in + * clutter/cogl/gl/cogl.c + * clutter/cogl/gles/cogl-context.c + * clutter/cogl/gles/cogl-context.h: + The Mesh API provides a means for submitting an extensible number of + per vertex attributes to OpenGL in a way that doesn't require format + conversions and so that the data can be mapped into the GPU (in vertex + buffer objects) for - hopefully - fast re-use. + + There are a number of things we can potentially use this API for, but + right now this just provides a foundation to build on. Please read + the extensive list of TODO items in cogl-mesh.c for examples. + + Please refer to the cogl-mesh section in the reference manual for + documentation of the API. + + * tests/conform/Makefile.am + * tests/conform/test-conform-main.c + * tests/conform/test-mesh-contiguous.c + * tests/conform/test-mesh-interleved.c + * tests/conform/test-mesh-mutability.c: + Privides basic coverage testing for the mesh API. + +2008-11-10 Robert Bragg + + Bug 1164 - Implements the proposed Mesh API + + * clutter/cogl/cogl-mesh.h + * clutter/cogl/cogl-types.h + * clutter/cogl/cogl.h.in + * clutter/cogl/common/Makefile.am + * clutter/cogl/common/cogl-mesh-private.h + * clutter/cogl/common/cogl-mesh.c + * clutter/cogl/gl/cogl-context.c + * clutter/cogl/gl/cogl-context.h + * clutter/cogl/gl/cogl-defines.h.in + * clutter/cogl/gl/cogl.c + * clutter/cogl/gles/cogl-context.c + * clutter/cogl/gles/cogl-context.h: + The Mesh API provides a means for submitting an extensible number of + per vertex attributes to OpenGL in a way that doesn't require format + conversions and so that the data can be mapped into the GPU (in vertex + buffer objects) for - hopefully - fast re-use. + + There are a number of things we can potentially use this API for, but + right now this just provides a foundation to build on. Please read + the extensive list of TODO items in cogl-mesh.c for examples. + + Please refer to the cogl-mesh section in the reference manual for + documentation of the API. + + * tests/conform/Makefile.am + * tests/conform/test-conform-main.c + * tests/conform/test-mesh-contiguous.c + * tests/conform/test-mesh-interleved.c + * tests/conform/test-mesh-mutability.c: + Privides basic coverage testing for the mesh API. + +2008-11-10 Robert Bragg + + * tests/conform/ADDING_NEW_TESTS + * tests/conform/test-conform-common.c + * tests/conform/test-pick.c: + Instead of using clutter_stage_new /clutter_actor_destroy as a way to + avoid cascading side effects between unit tests, due to left over + actors, we now destroy all children of the default stage between + tests instead. + + * tests/conform/wrapper.sh: + Adds a convenience note about how to run valgrind for an individual + unit test + +2008-11-10 Neil Roberts + + * tests/interactive/test-main.c (main): Allow more than two + arguments so that the remaining arguments can be passed to the + test. This is needed for test-behave for example which can take a + --path argument. + +2008-11-10 Emmanuele Bassi + + * clutter/clutter-texture.c: Remove an unused function. + +2008-11-10 Emmanuele Bassi + + * tests/conform/test-label-cache.c: + * tests/conform/test-pick.c: + * tests/conform/test-timeline.c: Show all the output messages only + if the test was done with the verbose flag turned on. + + * tests/interactive/test-main.c: Do not use the (gpointer*) cast, + but use a temporary gpointer instead. + +2008-11-10 Robert Bragg + + * tests/conform/Makefile.am: + * tests/conform/wrapper.sh: + * tests/conform/test-conform-main.c: + * tests/conform/test-timeline.c: + Adds Neil's updates to test-timeline.c so it now works with the new + unit testing infrastructure. + + Also some fixes to ensure wrappers get setup correctly for the + timeline tests. + + * tests/interactive/test-main.c: + cast the symbol return pointer as (gpointer *) to avoid warning + + * tests/conform/test-pick.c: + g_assert that the test passes, instead of using exit() + + * test/conform/ADDING_NEW_TESTS: + Fixes a silly typo + +2008-11-08 Emmanuele Bassi + + * tests/conform/Makefile.am: + * tests/conform/test-actor-invariants.c: + * tests/conform/test-conform-main.c: Move the actor invariants + unit to the conform section of the test suite. + + * tests/interactive/Makefile.am: + * tests/interactive/test-entry-auto.c: + * tests/interactive/test-invariants.c: Remove the entry-auto + and invariants test, since those two belong to the conform + section. + +2008-11-07 Robert Bragg + + Bug 1162 - Re-works the tests/ to use the glib-2.16 unit testing + framework + + * configure.ac: + * tests/*: + The tests have been reorganised into different categories: conformance, + interactive and micro benchmarks. + - conformance tests can be run as part of automated tests + - interactive tests are basically all the existing tests + - micro benchmarks focus on a single performance metric + + I converted the timeline tests to conformance tests and also added some + tests from Neil Roberts and Ebassi. + + Note: currently only the conformance tests use the glib test APIs, + though the micro benchmarks should too. + + The other change is to make the unit tests link into monolithic binaries + which makes the build time for unit tests considerably faster. To deal + with the extra complexity this adds to debugging individual tests I + have added some sugar to the makefiles so all the tests can be run + directly via a symlink and when an individual test is run this way, + then a note is printed to the terminal explaining exactly how that test + may be debugged using GDB. + + There is a convenience make rule: 'make test-report', that will run all + the conformance tests and hopefully even open the results in your web + browser. It skips some of the slower timeline tests, but you can run + those using 'make full-report' + +2008-11-07 Emmanuele Bassi + + * clutter/clutter-media.c: Improve documentation of the + ClutterMedia interface. + +2008-11-07 Matthew Allum + + Bug 1238 - [PATCH] Pack bitfields in ClutterTexturePrivate + + * clutter/clutter-texture.c: + + Using 'guint my_field : 1' for booleans to save space only + makes sense if you group all such fields together. Fix + grouping for ClutterTexturePrivate. Thanks to Owen Taylor for + patch. + +2008-11-07 Matthew Allum + + Bug 1237 - clutter_texture_set_filter_quality calls + clutter_texture_[un]realize + + * clutter/clutter-texture.c: (clutter_texture_set_filter_quality): + Call clutter_actor_[un]realize and keep visibility state + +2008-11-07 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + * clutter/clutter-clone-texture.c: + * clutter/clutter-private.h: + * clutter/clutter-texture.c: + * clutter/x11/clutter-x11-texture-pixmap.c: + + Attempt to lower overhead of updating TFP's (particularly mipmaped). + Compresses mipmap updates only for visible TFPs. + Avoiding updates for non visible TFP's whilst keeping visible + clones working ok. + +2008-11-06 Neil Roberts + + Bug 1230 - Pick fails on low precision color buffers + + * clutter/clutter-main.c (_clutter_id_to_color): When using fuzzy + picking to pick a color for an actor, it would previously set the + fuzzy bit and then all but the most significant of the remaining + unused bits. This meant that for 16-bit displays it would end up + with a strange pattern for the unused bits like 1011 which could + cause it to round up. Now it just sets all but the most + significant of all of the unused bits giving a pattern like + 0111. Thanks to Guy Zadickario for the patch. + +2008-11-06 Neil Roberts + + * clutter/cogl/gles/cogl.c (cogl_perspective): + * clutter/cogl/common/cogl-fixed.c (cogl_fixed_sin) + (cogl_angle_sin, cogl_angle_tan, cogl_fixed_sqrt): Replaced uses + of 1 + ~x with just -x which is equivalent and easier to + understand. + +2008-11-06 Emmanuele Bassi + + Bug 1233 - CLUTTER_ALPHA_SINE_INC is broken in trunk + + * clutter/clutter-alpha.c: Fix a rollover in the sine functions. + +2008-11-05 Neil Roberts + + * clutter/clutter-color.c (clutter_color_new): Remove CLAMP macros + around the component parameters because they are guint8 anyway so + the CLAMP is redundant and it causes a warning. + +2008-11-04 Thomas Wood + + * clutter/clutter-color.c: Update ClutterColor documentation as + changes have been backported to 0.8.4. + +2008-11-04 Emmanuele Bassi + + * clutter/clutter-script.c: Document the "is-default" member of + a ClutterStage definition. + +2008-11-04 Neil Roberts + + * clutter/cogl/gl/cogl.c (cogl_perspective): Use the accurate + 64-bit multiplication macro instead of COGL_FIXED_FAST_DIV for + calculating xmax as was done previously. This fixes + test-perspective and other tests that had a gone a bit skewiff. + +2008-11-04 Neil Roberts + + Bug 1181 - In Score, timelines, appended at markers, are also + called on complete + + * clutter/clutter-score.c (start_children_entries): Use the name + of the marker to start as the data parameter and only start child + timelines that have the same marker name. Previously the + ClutterScore would just start all child entries when a marker was + reached or the timeline completed regardless of whether they were + added with a marker or not. Thanks to Mihail Naydenov for + reporting the bug. + +2008-11-03 Emmanuele Bassi + + * clutter/cogl/gl/Makefile.am: Whitespace fixes. + + * clutter/cogl/gles/Makefile.am: Put back a missing backslash + that broke the GLES build. + +2008-11-03 Emmanuele Bassi + + Bug 1231 - Build fails in gles flavour in revision 3442 + + * clutter/cogl/gles/cogl-context.h: Fix remaining use of + ClutterFixed over CoglFixed. (Michael Boccara) + +2008-11-03 Neil Roberts + + Bug 1207 - Timelines sometime miss markers + + * clutter/clutter-timeline.c (timeline_timeout_func): Move the + code for firing the new-frame and marker-reached signals into a + separate static function so that it can also be called when the + last frame is reached. Also fix an issue where the frame numbers + were changed in the wrong direction when detecting missed markers + in a reversed timeline. Based on a patch by Michael Boccara. + + * tests/test-timeline.c: Now tries to automatically verify whether + the test worked by keeping track of all the signal emissions. The + timelines are run a second time with an extra timeout that causes + delays to simulate skipped frames. + +2008-10-31 Emmanuele Bassi + + * clutter/pango/cogl-pango-fontmap.c: + * clutter/pango/cogl-pango-render.c: Whitespace fixes and code + duplication removal. Plus, start documenting the CoglPango API. + +2008-10-31 Matthew Allum + + * clutter/clutter-texture.c: (clutter_texture_set_filter_quality), + (clutter_texture_get_filter_quality): + Fix up some logic, typos. + + * clutter/glx/clutter-glx-texture-pixmap.c: + Improve support for mipmaped TFP textures. + +2008-10-31 Emmanuele Bassi + + Bug 1200 - Crash with invalid DISPLAY + + * clutter/clutter-main.c: Use the ClutterBackend wrapper API + instead of directly checking the class structure. + + * clutter/glx/clutter-backend-glx.c: Return the correct value + in case of failure. + + * clutter/x11/clutter-backend-x11.c: Bail out if XOpenDisplay() + failed. + +2008-10-30 Emmanuele Bassi + + * clutter/cogl/cogl-color.h: + * clutter/cogl/cogl-fixed.h: + * clutter/cogl/cogl-offscreen.h: + * clutter/cogl/cogl-path.h: + * clutter/cogl/cogl-shader.h: + * clutter/cogl/cogl-texture.h: + * clutter/cogl/cogl-types.h: Add copyright and licensing + notice to the newly added files. + +2008-10-30 Emmanuele Bassi + + Bug 1219 - Clean up cogl.h + + * clutter/cogl/cogl.h.in: + * clutter/cogl/cogl-offscreen.h: + * clutter/cogl/cogl-path.h: + * clutter/cogl/cogl-shader.h: + * clutter/cogl/cogl-texture.h: + * clutter/cogl/cogl-types.h: Split up the massive cogl.h file + into sub-header for each section of the API. + + * clutter/cogl/gl/*: + * clutter/cogl/gles/*: Update the GL and GLES implementations + of COGL to cope with the new header structure. + + * doc/reference/cogl/Makefile.am: Fix symbol retrieval. + +2008-10-30 Emmanuele Bassi + + Bug 1215 - Move the Pango renderer to the public API + + * clutter/pango/*: Rename PangoClutter -> CoglPango. + + * clutter/Makefile.am: + * clutter/clutter-backend.c: + * clutter/clutter-entry.c: + * clutter/clutter-label.c: + * clutter/clutter-main.[ch]: + * clutter/clutter-private.h: Update the users of the Pango + renderer API. + + * README: Update release notes. + +2008-10-30 Emmanuele Bassi + + Bug 1212 - Allow only a single include file for Clutter + + * clutter/*.h: Only allow including clutter.h in third + party code. + + * clutter/cogl/cogl-color.h: + * clutter/cogl/cogl-fixed.h: + * clutter/cogl/cogl.h.in: Only allow including cogl.h in + third party code. + + * clutter/cogl/common/Makefile.am: + * clutter/cogl/gl/Makefile.am: + * clutter/cogl/gles/Makefile.am: + * clutter/eglnative/Makefile.am: + * clutter/eglx/Makefile.am: + * clutter/fruity/Makefile.am: + * clutter/glx/Makefile.am: + * clutter/glx/clutter-glx.h: + * clutter/osx/Makefile.am: + * clutter/pango/Makefile.am: + * clutter/sdl/Makefile.am: + * clutter/win32/Makefile.am: + * clutter/x11/Makefile.am: Fix build environment. + + * clutter/x11/clutter-x11-texture-pixmap.h: + * clutter/x11/clutter-x11.h: Fix inclusion rules. + + * tests/test-pixmap.c: Fix inclusion of GdkPixbuf header. + + * README: Update release notes. + +2008-10-30 Emmanuele Bassi + + Bug 1211 - Drop ClutterFeatureFlags usage from COGL + + * clutter/cogl/cogl.h.in: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl.c: Do not use ClutterFeatureFlags + when CoglFeatureFlags will do. This removes the last usage + of Clutter API inside COGL. + +2008-10-30 Emmanuele Bassi + + Bug 1210 - Add CoglColor API + + * clutter/cogl/cogl-color.h: + * clutter/cogl/cogl.h.in: + * clutter/cogl/common/Makefile.am: + * clutter/cogl/common/cogl-color.c: + * clutter/cogl/gl/Makefile.am: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/Makefile.am: + * clutter/cogl/gles/cogl-texture.c: + * clutter/cogl/gles/cogl.c: Add a new color-type, to be used by + COGL. CoglColor is optimized to allow the minimum amount of + conversions possible for both GL and GLES implementations. + + * clutter/clutter-actor.c: + * clutter/clutter-clone-texture.c: + * clutter/clutter-entry.c: + * clutter/clutter-main.c: + * clutter/clutter-rectangle.c: + * clutter/clutter-stage.c: + * clutter/clutter-texture.c: Use CoglColor when needed. + + * clutter/pango/pangoclutter-render.c: Use CoglColor when needed. + + * doc/reference/cogl/cogl-docs.sgml: + * doc/reference/cogl/cogl-sections.txt: Update the documentation. + + * tests/test-cogl-offscreen.c: + * tests/test-cogl-primitives.c: + * tests/test-cogl-tex-convert.c: + * tests/test-cogl-tex-foreign.c: + * tests/test-cogl-tex-getset.c: + * tests/test-cogl-tex-polygon.c: + * tests/test-cogl-tex-tile.c: + * tests/test-paint-wrapper.c: Update the tests. + + * README: Update release notes. + +2008-10-30 Emmanuele Bassi + + Bug 1209 - Move fixed point API in COGL + + * clutter/cogl/cogl-fixed.h: + * clutter/cogl/cogl.h.in: + * clutter/cogl/common/Makefile.am: + * clutter/cogl/common/cogl-fixed.c: Add fixed point API, modelled + after the ClutterFixed. The CoglFixed API supercedes the ClutterFixed + one and avoids the dependency of COGL on Clutter's own API. + + * clutter/cogl/common/cogl-clip-stack.c: + * clutter/cogl/common/cogl-primitives.c: + * clutter/cogl/common/cogl-primitives.h: Update internal usage of + ClutterFixed to CoglFixed. + + * clutter/cogl/gl/Makefile.am: + * clutter/cogl/gl/cogl-primitives.c: + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gl/cogl.c: Ditto, in the GL implementation of the + COGL API. + + * clutter/cogl/gles/Makefile.am: + * clutter/cogl/gles/cogl-fbo.c: + * clutter/cogl/gles/cogl-gles2-wrapper.c: + * clutter/cogl/gles/cogl-primitives.c: + * clutter/cogl/gles/cogl-texture.c: + * clutter/cogl/gles/cogl.c: Ditto, in the GLES implementation of + the COGL API. + + * clutter/pango/pangoclutter-glyph-cache.c: + * clutter/pango/pangoclutter-glyph-cache.h: Ditto, in the Pango + renderer glyphs cache. + + * clutter/clutter-fixed.c: + * clutter/clutter-fixed.h: ClutterFixed and related API becomes + a simple transition API for bindings and public Clutter API. + + * clutter/clutter-actor.c: + * clutter/clutter-alpha.c: + * clutter/clutter-backend.c: + * clutter/clutter-behaviour-depth.c: + * clutter/clutter-behaviour-ellipse.c: + * clutter/clutter-behaviour-path.c: + * clutter/clutter-behaviour-rotate.c: + * clutter/clutter-behaviour-scale.c: + * clutter/clutter-clone-texture.c: + * clutter/clutter-color.c: + * clutter/clutter-entry.c: + * clutter/clutter-stage.c: + * clutter/clutter-texture.c: + * clutter/clutter-timeline.c: + * clutter/clutter-units.h: Move from the internal usage of + ClutterFixed to CoglFixed. + + * doc/reference/clutter/clutter-sections.txt: + * doc/reference/cogl/cogl-docs.sgml: + * doc/reference/cogl/cogl-sections.txt: Update the documentation. + + * tests/test-cogl-tex-tile.c: + * tests/test-project.c: Fix tests after the API change + + * README: Add release notes. + +2008-10-29 Neil Roberts + + Bug 1074 - FBOs on GLES + + * clutter/cogl/gles/cogl-fbo.c: Copy the code from gl/cogl-fbo but + use the API calls directly instead of loading an extension because + it is part of the core in GLES 2. + + * clutter/cogl/gles/cogl.c (_cogl_features_init): Report + COGL_FEATURE_OFFSCREEN. + + * clutter/cogl/gles/cogl-fbo.h (CoglFbo): Add gl_stencil_handle. + + * clutter/cogl/gles/cogl-context.h (CoglContext): Add + viewport_store + + * tests/test-fbo.c (make_shader): Conditionally use the GLES 2 + names of the shader variables + +2008-10-29 Neil Roberts + + Bug 1206 - Picking disabled dithering + + * clutter/clutter-main.c (_clutter_do_pick): After picking is + finished, restore the state of glEnable (GL_DITHER). Otherwise it + will cause the scene to look different after the first pick on low + depth displays. (Thanks to Michael Boccara for the patch) + +2008-10-28 Thomas Wood + + * clutter/clutter-color.c (param_color_set_default): Set the no copy + flag when setting the default param spec value to prevent invalid + frees. + +2008-10-27 Neil Roberts + + Bug 1189 - Backface culling + + * clutter/cogl/gl/cogl-texture.c (cogl_texture_polygon) + (_cogl_texture_quad_sw, _cogl_texture_quad_hw): + * clutter/cogl/gles/cogl-texture.c (cogl_texture_polygon) + (_cogl_texture_quad_sw, _cogl_texture_quad_hw): Enable backface + culling in GL if it is requested. + + * clutter/cogl/gles/cogl-texture.c (_cogl_texture_quad_sw) + (_cogl_texture_quad_hw): + * clutter/cogl/gl/cogl-texture.c (_cogl_texture_quad_sw) + (_cogl_texture_quad_hw): Reorder the + vertices so that they are counter-clockwise. + + * clutter/cogl/gles/cogl-context.h (CoglContext): + * clutter/cogl/gl/cogl-context.h (CoglContext): Added a flag to + store whether backface culling is currently enabled. + + * clutter/cogl/gles/cogl.c (cogl_enable_backface_culling): + * clutter/cogl/gl/cogl.c (cogl_enable_backface_culling): New + function + + * doc/reference/cogl/cogl-sections.txt: Add + cogl_enable_backface_culling + +2008-10-27 Neil Roberts + + Bug 1196 - Texture border drawing problems + + * clutter/cogl/gl/cogl-texture.c (_cogl_texture_upload_subregion_to_gl) + (_cogl_texture_upload_to_gl): + + * clutter/cogl/gles/cogl-texture.c (_cogl_texture_upload_to_gl) + (_cogl_texture_upload_subregion_to_gl): + + When uploading data to a sliced texture, fill the waste pixels + with copies of the edge of the real texture data. Otherwise the + value of the waste pixels are undefined so it will show artifacts + when the texture is scaled with GL_LINEAR and the pixels are + blended in. + +2008-10-22 Thomas Wood + + * tests/test-actors.c: Don't adjust the radius based on the number of + actors + +2008-10-21 Emmanuele Bassi + + * clutter/clutter-color.[ch] (clutter_value_set_color): Constify + colors and values where needed. + +2008-10-21 Emmanuele Bassi + + Bug 1197 - Missing const for clutter_init_with_args * + + * clutter/clutter-main.[ch] (clutter_init_with_args): Constify + the string parameters. (Owen Taylor) + +2008-10-20 Emmanuele Bassi + + * configure.ac: Use gmodule-no-export-2.0, not gmodule-2.0, + to avoid breaking the symbol hiding. (thanks to Ross Burton + and Laurent Bigonville) + +2008-10-20 Neil Roberts + + Bug 1043 - COGL calls glTexSubImage2D() with out-of-bounds + values (SIGSEGV) + + * clutter/cogl/gl/cogl-texture.c + (_cogl_texture_upload_subregion_to_gl): When iterating over the + slices, discard ones that don't intersect immediatly otherwise it + will call glTexSubImage2D with a negative width/height and then + move the source position incorrectly. Thanks to Gwenole + Beauchesne. + +2008-10-20 Emmanuele Bassi + + * clutter/clutter-color.h: Declare clutter_color_new() in the + installed header. + +2008-10-20 Neil Roberts + + Bug 1195 - ClutterBehaviourBspline only works for very short paths + + * clutter/clutter-behaviour-bspline.c: Changed the CBZ_T_POW3 and + CBZ_T_MUL functions so that they preserve more of the least + significant bits. This fixes some of the jaggy behaviour with + longer paths. + +2008-10-17 Thomas Wood + + reviewed by: Emmanuele Bassi + + * clutter/clutter-color.[ch]: Add GParamSpec and GValue integration + for ClutterColor. With ClutterParamSpecColor it is possible to define + color properties; with the GValue integration it's possible to + automatically transform strings into colors and vice versa. + + (clutter_color_free): Allow NULL parameter to match other boxed + types destructors. + + (clutter_color_new): Add a constructor for the ClutterColor boxed + type, mostly for bindings. + +2008-10-17 Emmanuele Bassi + + * clutter/clutter-color.c (clutter_color_parse): Add checks + for the arguments, to avoid trying to parse NULL strings. + +2008-10-16 Emmanuele Bassi + + * clutter/clutter-container.[ch]: Add checks to the Container + interface invocation methods, to avoid crashing or corrupting + the stack when an actor does not implement every virtual + function of the Container interface vtable. GObject allows this + to happen so we must handle the case gracefully. This also means + that we can classify some virtual function as mandatory (as is + the case for ::add, ::remove and ::foreach) and some other + optional. + +2008-10-08 Emmanuele Bassi + + * tests/test-depth.c (raise_top), (main): Fix a shadowing + with raise() from signal.h. + +2008-10-01 Øyvind Kolås + + Bug 1108 - Enter/Leave events logics wrt. skipped motion events + + Handle dropped motion events when computing crossing events, + based on a patch from Gwenole Beauchesne. + + * clutter/clutter-main.c: (clutter_event_get_device): internal static + utility function. + (clutter_do_event): generate enter/leave events for all pointer + events. + (generate_enter_leave_events): modified enter/leave events generator + to work for all pointer event types. Enter/leave events are now + delivered before the motion/button event that caused the crossing to + happen. + * clutter/clutter-event.c: (clutter_event_copy), (clutter_event_free): + removed reference counting logic that is not needed when the crossing + events are directly delivered. + +2008-09-29 Emmanuele Bassi + + * configure.ac: Post branch bump to 0.9.0 + +2008-09-25 Emmanuele Bassi + + * configure.ac: Post release bump to 0.8.3 + +======== Release 0.8.2 ======================================================== + +2008-09-25 Emmanuele Bassi + + * configure.ac: + * README: + * NEWS: Release 0.8.2 + +2008-09-25 Emmanuele Bassi + + * clutter/clutter-event.h: Fix missing documentation. + +2008-09-24 Emmanuele Bassi + + Bug 1130 - CLUTTER_MOTION is not emitted when time goes backwards. + + * clutter/clutter-main.c (clutter_do_event): Check for time + rollbacks inside the motion event throttling. (Pierce Liu) + +2008-09-23 Emmanuele Bassi + + * clutter/clutter-timeout-pool.c: Reword previous commit. + +2008-09-23 Emmanuele Bassi + + * clutter/clutter-timeout-pool.c: + (clutter_timeout_pool_new): Fix previous commit: g_source_unref() + is not needed. (Thanks to Neil Roberts) + +2008-09-23 Emmanuele Bassi + + Bug 1154 - clutter_timeout_pool_new() documentation doesn't say + how to free + + * clutter/clutter-timeout-pool.c: Update the documentation to + note that you must use g_source_unref() to free the timeout + pool. (Murray Cumming) + +2008-09-23 Emmanuele Bassi + + Bug 1124 - Clutter causes an additional size request in each + allocation + + * clutter/clutter-actor.c: + (clutter_actor_store_old_geometry): Store the allocation instead + of causing a new size-request cycle. (Johan Bilien) + +2008-09-23 Emmanuele Bassi + + Bug 1125 - Save an extra pango_layout_get_size in many cases + + * clutter/clutter-label.c: + (clutter_label_create_layout_no_cache): Add a simple check + before calling pango_layout_get_size(). (Johan Bilien) + +2008-09-23 Emmanuele Bassi + + * clutter/clutter-alpha.c: + (clutter_alpha_get_alpha): Do not return the cached value but + just compute the current alpha value. The use case is pretty + much straightforward: stop a timeline, advance it, and retrieve + the alpha value before starting the timeline to adjust an + animation dependent on the alpha. Caching the alpha value is + not needed because the behaviours will always pass the alpha + value inside the ::alpha-notify virtual function anyway, so + there is no need for them to call clutter_alpha_get_alpha(). + + This change makes it also possible to reliably unit-test + ClutterAlpha. + + (timeline_new_frame_cb): Call clutter_alpha_get_alpha(). + +2008-09-23 Tomas Frydrych + + * clutter/clutter-main.c: + * clutter/clutter-main.h: + * clutter/clutter-private.h: + * clutter/x11/clutter-backend-x11.c: + (clutter_get_option_group_without_init): + Function to obtain clutter option group without opening display + (for use with foreign display and gtk_clutter_init). Bug 1033. + + Stripped trailing whitespace. + +2008-09-22 Neil Roberts + + Bug 856 - Teardown sequence is borked + + * clutter/clutter-main.c: Don't free the ClutterMainContext so + that the main loop can be restarted. + + * clutter/eglx/clutter-backend-egl.c: + * clutter/eglnative/clutter-backend-egl.c: Register an atexit + handler which disposes the backend object so that we are still + guaranteed to call eglTerminate on GLES. + +2008-09-22 Neil Roberts + + * tests/test-unproject.c (on_event): + * tests/test-project.c (on_event): Use a return value for the + 'event' signal handler, otherwise it might accidentally return + TRUE for unhandled events and you won't be able to close the + window. + +2008-09-19 Emmanuele Bassi + + Bug 1033 - Manually parsing command line options prevents + initializing clutter + + * clutter/clutter-main.c: + (post_parse_hook), (clutter_init_with_args), + (clutter_parse_args), (clutter_init): Move the initialization + of Clutter at the end of the post-parse hook of Clutter's + GOptionGroup. Clutter must be initialized at the end of the + argument parsing. + +2008-09-19 Emmanuele Bassi + + * clutter/clutter-main.c: Properly document the + clutter_get_option_group() function and the invariant that + after parsing Clutter's option group the library will be + initialized. (Thanks to Tomas Frydrych for pointing this + out) + +2008-09-19 Emmanuele Bassi + + * clutter/x11/clutter-backend-x11.c: Properly document the + usage of clutter_x11_set_display(). + + * clutter/x11/clutter-x11.h: clutter_x11_set_display() is + public API and should be declared in the header we install. + +2008-09-18 Neil Roberts + + Bug 1048 - SIGFPE in cogl_texture_set_region() with nvidia + + * clutter/cogl/gl/cogl-texture.c (cogl_texture_set_region): + * clutter/cogl/gles/cogl-texture.c (cogl_texture_set_region): + Don't attempt to upload any data if the width or height of the + subregion is zero. Thanks to Gwenole Beauchesne. + +2008-09-18 Neil Roberts + + Bug 1044 - cogl_get_viewport error + + * clutter/cogl/gles/cogl.c (cogl_get_viewport): Use glGetIntegerv + instead of glGetFixedv to read the viewport because the latter + converts incorrectly on some hardware. + +2008-09-18 Neil Roberts + + Bug 1080 - clutter_stage_read_pixels has upside-down y coordinate + + * clutter/clutter-stage.c (clutter_stage_read_pixels): Use + OpenGL's coordinate system for the arguments to glReadPixels (so + that y zero is the bottom of the window). Use clutter_redraw + instead of clutter_stage_paint to ensure the right GL context is + selected. Set some of the glPixelStore parameters that might have + been changed by Cogl. + + * tests/test-stage-read-pixels.c: Replace with a different test + that gets a sub-region of the stage around the cursor. + +2008-09-17 Neil Roberts + + Bug 1145 - Flicker on resize the window + + * clutter/glx/clutter-stage-glx.c (clutter_stage_glx_realize): + Don't set a backing pixel on the X window. Otherwise when the + window resizes it will flicker when X paints the background + immediatly before Clutter repaints the whole stage. + +2008-09-17 Neil Roberts + + * clutter/clutter-types.h: Swap left and right in the + documentation for ClutterGravity. + +2008-09-17 Neil Roberts + + Bug 1121 - Setting anchor point doesn't work if set too early + + * clutter/clutter-actor.c + (clutter_actor_set_anchor_point_from_gravity) + (clutter_actor_move_anchor_point_from_gravity): Add documentation + to make it clear that the anchor point won't move when the actor + is resized. + +2008-09-16 Neil Roberts + + Bug 1100 - WM_SIZE not handled correctly, user_resize and + window_style correction. + + * clutter/win32/clutter-stage-win32.c (get_window_style): Remove + the WS_MAXIMIZEBOX style if the stage isn't resizable. + (clutter_stage_win32_set_user_resize): Queue a redraw of the + window frame when the user_resize property is changed. + + * clutter/win32/clutter-event-win32.c (message_translate): Don't + update the size of the stage when handling WM_SIZE messages that + result from the stage being minimized. Thanks to Roman Yazmin. + +2008-09-16 Tomas Frydrych + + * clutter/glx/clutter-glx-texture-pixmap.c: + * clutter/x11/clutter-x11-texture-pixmap.c: + TFP resyncing on MapNotify/ConfigureNotify (bug 1020; patch by + Andy Wingo ). + +2008-09-15 Øyvind Kolås + + * clutter/clutter-main.c: amended typo in gtk-doc. + +2008-09-12 Neil Roberts + + Bug 1034 - Picking doesn't work on Eee PC + + * clutter/clutter-main.c (_clutter_id_to_color): When choosing a + pick color, set all but the most significant of the unused + bits. This should make make it more likely that the GL + implementation will round down to the right value. + + * tests/test-pick.c: Test case for picking. It creates 192 actors + at known positions and stores their gids. It then calls + clutter_stage_get_actor_at_pos with each position to check that + the right gid is returned. + + * tests/Makefile.am (noinst_PROGRAMS): Add test-pick + +2008-09-12 Neil Roberts + + Bug 1010 - ClutterLabel does not update the layout (again) + + * clutter/clutter-label.c: Bring back layout caching. This time it + will cache up to three different layouts. The width for which each + layout was generated is stored so that if the same width is + requested again it can use the cached version. If no cached + version is available it will try to replace the oldest + layout. 'Age' is determined by a counter which is incremented + every time a layout is created. The cache is cleared after any + property changes that might affect the layout. + (struct _ClutterLabelPrivate): Removed extents_width, + extents_height and context because they weren't used anywhere. + + * tests/test-label-cache.c: Add a test which checks whether the + label is using a different layout when properties are + changed. Also compares the extents of the label's layout with an + independent layout and fails if they aren't the same. + + * tests/Makefile.am (noinst_PROGRAMS): Add test-label-cache + +2008-09-10 Neil Roberts + + Bug 1137 - Setting the anchor point does not trigger a re-paint + + * clutter/clutter-actor.c (clutter_actor_set_property): When + changing the anchor point properties, use set_anchor_pointu + instead of changing the value directly so that a redraw will be + queued. + (clutter_actor_set_anchor_pointu): Queue a redraw when the anchor + point is changed. Thanks to Johan Bilien. + +2008-08-27 Emmanuele Bassi + + Bug 1082 - Texture bitmap is destroyed in wrong way + + * clutter/cogl/common/cogl-bitmap-pixbuf.c: + (_cogl_bitmap_from_file): Make a copy of the pixbuf data in + the internal image loader so that we can keep working under + the assumption that we are using the GLib memory allocation + and deallocation functions. + +2008-08-27 Emmanuele Bassi + + Bug 1099 - No ClutterScript API to get a list of IDs in a given file + + * clutter/clutter-script.[ch]: Add clutter_script_list_objects(), + a function for retrieving all the objects built by a ClutterScript + instance. (Based on a patch by Noah Gibbs) + +2008-08-26 Emmanuele Bassi + + Bug 1090 - Label somtimes returns natural_width < min_width + + * clutter/clutter-label.c: + (clutter_label_get_preferred_width): Check that the width of the + layout is always greater than 0. (Johan Bilien) + +2008-08-19 Neil Roberts + + Bug 1103 - Two typos in clutter documentation + + * doc/reference/clutter/subclassing-ClutterActor.xml: Update the + custom actor example since the Cogl API was changed to namespace + all of the path related functions in cogl_path_*. Thanks to Nati + Berkover. + + * clutter/clutter-score.c: Add missing parameter in example of + calling clutter_score_start(). + +2008-08-18 Neil Roberts + + Bug 1085 - Cursor is in wrong position on ClutterEntry if set + x-align property + + * clutter/clutter-entry.c (clutter_entry_paint): When calculating + the position to draw the cursor at, take into account the + alignment of the text. Queue a redraw when the x-align property is + changed. + +2008-08-07 Neil Roberts + + Bug 1091 - WM_MOUSEWHEEL (scroll-event) not handled correctlly + + * clutter/win32/clutter-event-win32.c (message_translate): The + coordinates in a WM_MOUSEWEEL message are given relative to the + screen so they need to be converted to client coordinates before + use. Thanks to Roman Yazmin. + +2008-08-06 Emmanuele Bassi + + * clutter/clutter-child-meta.c: + (clutter_child_meta_set_property), + (clutter_child_meta_class_init): Make the :container and + :actor properties of ChildMeta construct-only, to allow + bindings to actually use ChildMeta without abusing the API. + + * clutter/clutter-container.c (create_child_meta): Instead of + setting the members of the ChildMeta structure, use the + constructor properties. + +2008-08-04 Emmanuele Bassi + + * clutter/clutter-keysyms.h: Resync with keysymdef.h inside Xorg. + +2008-08-04 Emmanuele Bassi + + * clutter/clutter-script.c: + (clutter_script_default_connect): Improve wording and debug + messages in the default autoconnection for signal handlers. + +2008-08-04 Emmanuele Bassi + + * clutter/clutter-script-parser.c: + * clutter/clutter-script-private.h: Clean up the code; add a + conversion function for reading a ClutterColor out of a + JSON object or array definition. + + * clutter/clutter-script.c: Clean up the code; document properly + how we translate from type name to type function. + +2008-08-04 Emmanuele Bassi + + * clutter/clutter-main.c: Rework and improve the documentation + of the thread-safe timeout and idle source installer functions. + +2008-08-01 Neil Roberts + + Bug 945 - Clipping+fbo cloning bugs + + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl.c: + * clutter/cogl/cogl.h.in: Add cogl_clip_stack_save, + cogl_clip_stack_restore, cogl_viewport and cogl_frustum. + + * clutter/cogl/gl/cogl-fbo.h: + * clutter/cogl/gl/cogl-fbo.c: Try to attach a stencil buffer when + creating an FBO. + + * clutter/cogl/common/cogl-clip-stack.c: Add functions to save and + restore the whole state of the stack. + + * clutter/clutter-texture.c (clutter_texture_paint): When + rendering the FBO source, setup a temporary asymmetric perspective + projection matrix to render it as it would appear on screen. + + * clutter/clutter-private.h: + * clutter/clutter-actor.c + (_clutter_actor_apply_modelview_transform_recursive): No longer + static and exported in clutter-private.h + +2008-08-01 Neil Roberts + + Bug 1071 - clutter_timeline_get_duration doesn't always work + + * clutter/clutter-timeline.c: Calculate the 'duration' property + on-demand instead of storing it as a member variable. Notify + duration property changes whenever the fps or num_frames changes. + +2008-08-01 Neil Roberts + + Bug 1069 - Warnings with ClutterScore + + * clutter/clutter-score.c (clutter_score_is_playing): Check + whether priv->running_timelines is NULL before checking its + length. + (foreach_running_timeline): Remove the completed signal handler + when stopping the score. Otherwise the completed callback will get + called multiple times if the timeline is started later. + +2008-07-31 Neil Roberts + + Bug 1075 - Difficult to bind clutter_stage_new + + * clutter/clutter-stage.c (clutter_stage_dispose): Unrealize the + stage before removing the update idle handler. Otherwise + unrealizing causes another redraw to be queued and if the stage + object remains alive it will cause an assert and abort. + +2008-07-30 Neil Roberts + + * clutter/clutter-stage.c (clutter_stage_class_init): Added the + 'perspective' property. All of the machinery was there to + implement the property but somehow the call that actually installs + it was missing. + +2008-07-30 Emmanuele Bassi + + * clutter/clutter-fixed.h: + * clutter/clutter-units.h: Fix the upper and lower boundaries of + ClutterFixed and ClutterUnit types; G_MAXINT16 and G_MININT16 + were not enough to describe those values. + +2008-07-30 Ross Burton + + * clutter/clutter-main.c: + Destroy the debugging timer when the context is freed. + + * clutter/clutter-stage.c: + Free the stage title when the stage is finalized. + +2008-07-30 Neil Roberts + + * clutter/clutter-model.c (clutter_model_set_sorting_column): This + function is supposed to accept -1 to disable sorting. However it + checks for whether the column is >= the number of columns, but + clutter_model_get_n_columns() returns an unsigned int so the + column number also gets promoted to unsigned for the + comparison. Therefore -1 is always greater than the number of + columns so it wouldn't let you set it. + +2008-07-26 Neil Roberts + + * clutter/clutter-timeline.c (clutter_timeline_list_markers): When + requesting the list of markers it was returning the marker data as + a string instead of the name so it was copying garbage. + +2008-07-25 Neil Roberts + + * clutter/clutter-actor.c (clutter_actor_remove_clip) + (clutter_actor_set_clipu): Queue a redraw when the clip is + changed. + +2008-07-24 Neil Roberts + + * clutter/clutter-script.c: The example in the documentation + showed a color being specified as '0xff0000ff' but it should be + '#ff0000ff' + +2008-07-23 Emmanuele Bassi + + Bug 1062 - clutter_actor_query_coords() replacement in 0.8 + + * clutter/clutter-deprecated.h: Fix the deprecation warning + for clutter_actor_query_coords(). (Gwenole Beauchesne) + +2008-07-17 Emmanuele Bassi + + Bug 1047 - API documentation from release tarball is not + installed by "make install" + + * configure.ac: + * Makefile.am: Make the recursion into the documentation + directory depend on on whether we explicitly enable it or + if we are not inside an SVN checkout. + +2008-07-17 Neil Roberts + + * clutter/clutter-texture.c: + * clutter/clutter-rectangle.c: + * clutter/clutter-group.c: + * clutter/clutter-entry.c: + * clutter/clutter-clone-texture.c: Remove unnecessary calls to + cogl_{push,pop}_matrix. The matrix is preserved in + clutter_actor_paint whenever the actor's transformation is applied + so there should be no need to push the matrix in actor paint + implementations unless it does some additional transformations + itself. + +2008-07-16 Emmanuele Bassi + + * clutter.pc.in: Add a variable containing the COGL backend + inside the pkg-config file, for configure-time checks. + +2008-07-14 Neil Roberts + + * clutter/cogl/common/cogl-primitives.c (cogl_path_rel_curve_to): + Fixed a typo in the second parameter which meant the curve was + drawn incorrectly. + +2008-07-14 Emmanuele Bassi + + * clutter/clutter.h: Include missing installed files. + +2008-07-14 Tomas Frydrych + + * clutter/clutter-stage.c: + (clutter_stage_hide_cursor): + Fixed C&P bug that made it impossible to show cursor once hidden. + + Stripped trailing whitespace. + +2008-07-13 Matthew Allum + + * clutter/x11/clutter-x11-texture-pixmap.c: + Call XSync in unredirect X error trap (Thanks to Andy Wingo) + +2008-07-13 Neil Roberts + + * build/mingw/mingw-cross-compile.sh: Avoid using the --strip + option to tar because it isn't supported in the version shipped + with MSYS. + +2008-07-11 Tomas Frydrych + + * clutter/clutter-fixed.c: + Move G_IMPLEMENT_INLINES before all other #include statements (bug + #1038). + +2008-07-11 Tomas Frydrych + + * clutter/clutter-fixed.c: + Changed #define G_IMPLEMENTS_INLINES to G_IMPLEMENT_INLINES (bug + #1038). + +2008-07-10 Emmanuele Bassi + + * configure.ac: Post release bump to 0.3.1. + +======== Release 0.8.0 ======================================================== + +2008-07-10 Emmanuele Bassi + + * configure.ac: + * NEWS: Release 0.8.0. + +2008-07-10 Matthew Allum + + * clutter/cogl/gles/cogl-fbo.c: + * clutter/cogl/gles/cogl-texture.c: + Fix warnings with eglnative build + +2008-07-10 Matthew Allum + + * README: + Sync up/improve ready for 0.8 release. + + * AUTHORS: + Sync up to date - hope I havn't missed anyone.. + +2008-07-10 Matthew Allum + + * clutter/glx/clutter-glx-texture-pixmap.c: + Assume TFP npots sized textures are always supported if TFP ext is! + (Based on patch from James Ketrenos) + +2008-07-08 Matthew Allum + + Bug 1011 - Fix TFP fallback mechanism (take 2) + + * clutter/glx/clutter-glx-texture-pixmap.c: + * tests/test-pixmap.c: + Slightly modified patch from Gwenole Beauchesne applied + to better handle both falling back to non accelerated tfp + and improvements to the test case. + +2008-07-07 Matthew Allum + + Bug 1016 - Changing window-redirect-automatic property after + creating ClutterX11TexturePixmap doesn't work. + + * clutter/x11/clutter-x11-texture-pixmap.c: + (clutter_x11_texture_pixmap_set_window): + Sync up redirection prop correctly (Jason Tackaberry) + +2008-07-07 Matthew Allum + + Bug 1019 - clutter-frame-source.h not included by clutter.h + + * clutter/clutter.h: + Add missing header include. + +2008-07-05 Neil Roberts + + * clutter/clutter-actor.h: Remove redundant duplicate declaration + of clutter_actor_allocate_preferred_size + +2008-07-05 Emmanuele Bassi + + Bug 1033 - Manually parsing command line options prevents + initializing clutter (Armin Burgmeier) + + * clutter/clutter-main.c: + (post_parse_hook), (clutter_init_real): Set the is_initialized + flag inside the real initialization function. + +2008-07-04 Emmanuele Bassi + + * clutter/clutter-label.c: Properly document the behaviour + of the :alignment property. + +2008-07-04 Neil Roberts + + * build/mingw/mingw-cross-compile.sh: Default to the win32 flavour + instead of the SDL flavour + +2008-07-04 Neil Roberts + + Bug 1015 - Cloning unparented actors with FBOs doesn't work with + new layout code + + * clutter/clutter-texture.c (clutter_texture_new_from_actor): Now + parents the source actor if it doesn't already have a parent so + that it will get an allocation during layout. + + * tests/test-fbo.c: One of the tests tries to ensure that the + ClutterTexture clone keeps the source actor alive by derefing + it. However as actors have a floating reference then test-fbo + doesn't have its own reference once the source is parented so + unrefing just steals the parent's reference and causes + badness. The test now claims the floating reference before cloning + the source so that it can safely be unref'd later. + +2008-07-03 Emmanuele Bassi + + * clutter/x11/Makefile.am: Fix distchecking by adding the + generated enum types files to DISTCLEANFILES. + +2008-07-03 Tomas Frydrych + + * clutter/clutter-fixed.h: + * clutter/clutter-fixed.c + Fixed inlining of clutter_qmulx() and clutter_qdivx() (bug 1022). + +2008-07-03 Neil Roberts + + * clutter/clutter-shader.c (bind_glsl_shader): Fix a cut-and-paste + error which broke vertex shaders + +2008-07-03 Øyvind Kolås + + * clutter/cogl/common/cogl-bitmap-pixbuf.c: + (_cogl_bitmap_from_file): removed debug g_printf that announces each + successful image load done by the internal image backend. + +2008-07-02 Neil Roberts + + * clutter/clutter-actor.c + (clutter_actor_get_abs_allocation_vertices): The initialization of + the local stage pointer got moved away in revision 3081 so it was + crashing if the function is called before the layout is run. + +2008-07-02 Emmanuele Bassi + + * clutter/clutter-label.c: + (clutter_label_create_layout_no_cache), + (clutter_label_create_layout): Split the layout creation in two + functions: one creating the layout, the other creating the layout + and hitting the glyphs cache. The first one is for the offscren + operations - like requesting the preferred size; the second one + is for paint and allocation. + + (clutter_label_allocate): Try to aggressively cache the PangoLayout + between allocations - to avoid recreating it even when the label + just moved because of an animation. See bug #1010. + +2008-07-02 Øyvind Kolås + + * clutter/fruity/clutter-fruity.c: made the multi touch code more + robust. There are situations though where the device seems to stop + generating any touch events until all fingers have been lifted and + a new interaction session is started. + +2008-07-02 Neil Roberts + + * clutter/eglx/clutter-stage-egl.c (clutter_stage_egl_realize): + Use clutter_x11_has_event_retrieval() instead of + !backend_x11->no_xevent_retrieval to reflect the changes to the + GLX backend in revision 3078 + +2008-07-02 Emmanuele Bassi + + Bug 1010 - ClutterLabel does not update the layout (Lee Jusung) + + * clutter/clutter-actor.c: + (clutter_actor_queue_relayout): Remove some pointer dereferencing. + + * clutter/clutter-label.c: + (clutter_label_allocate): Revert the change of r2883 and remove the + layout width cache and force a recreation of the layout every time + we receive an allocation. + +2008-07-01 Neil Roberts + + * clutter/clutter-actor.c (clutter_actor_get_transformed_sizeu): + This is now do-what-I-mean like clutter_actor_get_size so that if + the allocation box is available it will use that, otherwise it + will use the preferred size. clutter_actor_transform_vertices has + been converted to clutter_actor_transform_and_project_box so that + it can be used by both functions. Based on a patch by Emmanuele + Bassi. + (clutter_actor_get_abs_allocation_vertices) + (clutter_actor_get_allocation_vertices): These two functions now + force a relayout if the allocation box is not available. + + * tests/test-fbo.c: Fixed the shader to use texture2D instead of + texture2DRect now that GL_EXT_texture_rectangle is no longer used. + +2008-07-01 Chris Lord + + * clutter/clutter-stage.c: + Add a note to the clutter_stage_read_pixels doc that the alpha channel + isn't guaranteed to contain sensible data + + * tests/test-stage-read-pixels.c: (update_snapshot): + Overwrite the alpha data when using clutter_stage_read_pixels; fixes + this test on non-nvidia drivers + +2008-07-01 Matthew Allum + + * clutter/glx/clutter-stage-glx.c: + * clutter/x11/clutter-backend-x11.c: + * clutter/x11/clutter-backend-x11.h: + * clutter/x11/clutter-event-x11.c: + * clutter/x11/clutter-x11.h: + * tests/test-devices.c: + Disable use of XInput and add an explicit clutter_x11_enable_xinput + to enable it. + Also fix up the x11 pre-init calls to not need g_type_init. + +2008-07-01 Øyvind Kolås + + Bug 1013 - Per device grabs are not obeyed in pointer device + propagation. + + * clutter/clutter-event.c: (clutter_event_get_device_id): swap + arguments of g_return_val_if_fail around. + * clutter/clutter-event.h: added *device field to crossing events as + well. + * clutter/clutter-main.c: (emit_pointer_event): added a device + argument and check for per device grabs if this device is passed. + (clutter_do_event): pass the device if present for all pointer event + emissions. + (generate_enter_leave_events): copy the device from the motion events + when generating enter/leave events. + +2008-07-01 Chris Lord + + * clutter/clutter-texture.c: + Correct documentation about accepted pixel formats + + * tests/test-stage-read-pixels.c: (main): + Don't try to free a ClutterTexture after main, fixes segfault on quit + +2008-07-01 Emmanuele Bassi + + * clutter/clutter-behaviour-bspline.h: + * clutter/clutter-behaviour.h: + * clutter/clutter-event.h: + * clutter/clutter-texture.h: Add missing documentation and + change the copyright and licensing notice to use the FSF + website instead of its address. (#512) + +2008-06-30 Matthew Allum + + Bug 1008 - tfp still a bit borked + + * clutter/x11/clutter-x11-texture-pixmap.c: + Fix from Andy Wingo for sync_window borkage + +2008-06-30 Neil Roberts + + Bug 985 - MSC math.h / M_PI issue + + * clutter/cogl/gl/cogl.c (set_clip_plane): + * clutter/clutter-alpha.c (sinc_func): Use G_PI instead of M_PI + because M_PI isn't defined in MSVC without a special + #define. Thanks to Haakon Sporsheim + +2008-06-30 Neil Roberts + + * clutter/win32/clutter-backend-win32.c (check_vblank_env): Use + g_ascii_strcasecmp instead of strcasecmp because strcasecmp isn't + available in MSVC. + +2008-06-30 Matthew Allum + + Bug 1007 - Fix TFP fallback mechanism + + * clutter/glx/clutter-glx-texture-pixmap.c: + * clutter/x11/clutter-x11-texture-pixmap.c: + Add some extra safety to glx pixmap creations and tidy up some notes. + Patch from Gwenole Beauchesne. + +2008-06-30 Neil Roberts + + * clutter/x11/clutter-event-x11.c: + * clutter/win32/clutter-event-win32.c: Use the HAVE_CONFIG_H guard + around #include "config.h" + +2008-06-30 Emmanuele Bassi + + * clutter/Makefile.am: + * clutter/eglx/Makefile.am: + * clutter/glx/Makefile.am: Build the X11 base backend before + the backends that depend on it. + +2008-06-30 Emmanuele Bassi + + Bug 1000 - clutter-x11 should define gtypes for its enumerations + + * clutter/x11/Makefile.am: + * clutter/x11/clutter-event-x11.c: + * clutter/x11/clutter-x11-enum-types.c.in: + * clutter/x11/clutter-x11-enum-types.h.in: + * clutter/x11/clutter-x11.h: Add the GTypes for the X11-specific + enumerations, so that they can be used by the bindings. (Andy + Wingo) + +2008-06-30 Chris Lord + + * tests/test-shader.c: + Fix edge-detect shader on ATI, thanks Gwenole Beauchesne + +2008-06-30 Matthew Allum + + Bug 997 - automatic updates not working for named TFP pixmaps, + at least in x11 + + * clutter/glx/clutter-glx-texture-pixmap.c: + * clutter/glx/clutter-glx-texture-pixmap.h: + * clutter/x11/clutter-backend-x11.c: + * clutter/x11/clutter-x11-texture-pixmap.c: + * clutter/x11/clutter-x11-texture-pixmap.h: + * clutter/x11/clutter-x11.h: + * configure.ac: + * tests/test-pixmap.c: + Rework Andy Wingos patch a little adding more safety for now also + handling redirect Windows (as well as pixmaps) + +2008-06-30 Emmanuele Bassi + + Bug 980 - cogl-bitmap-fallback.c compiler error/warning due to + cast issue (Haakon Sporsheim) + + * clutter/cogl/common/cogl-bitmap-fallback.c: + (_cogl_unpremult_alpha_last), + (_cogl_unpremult_alpha_first): Cast to avoid a compiler warning + with MSC. + +2008-06-30 Chris Lord + + * tests/test-shader.c: (main): + Add a new shader to test-shaders (Sobel operator edge-detect) + +2008-06-30 Øyvind Kolås + + Disable XInput handling for keyboard events, re-enabling key press and + release events when pointer is outside window as well as re-enabling + keyrepeat. + + * clutter/glx/clutter-stage-glx.c: (clutter_stage_glx_realize): select + for KeyPressMask and KeyReleaseMask even with XInput enabled. + * clutter/x11/clutter-backend-x11.c: (_clutter_x11_register_xinput): + Disabled the XInput keyboard code paths (comments and #if 0's) + * clutter/x11/clutter-event-x11.c: (event_translate): always handle + keyboard events without regard to XInput. + +2008-06-29 Matthew Allum + + * clutter/x11/clutter-event-x11.c: + ifdef convert_xdevicekey_to_xkey () with XINPUT check. + (fix via Andy Wingo) + +2008-06-29 Tommi Komulainen + + * clutter/osx/clutter-osx.h (_clutter_event_osx_put) + * clutter/osx/clutter-event-osx.c (clutter_event_osx_translate, + NSEvent:clutterStage:) + * clutter/osx/clutter-stage-osx.c (EVENT_HANDLER): Since events are + delivered to ClutterGLView, pass the associated ClutterStage directly + to event translation. Avoids relying on being embedded in + ClutterGLWindow, which makes it easier to implement clutter-gtk. + +2008-06-29 Tommi Komulainen + + * clutter/osx/clutter-event.osx.c (NSEvent:clutterKeyVal:): Add + comment, on OSX backend the Shift modifier is included in 'keyval' + making it identical to 'unicode_value' Instead of a or + 3 you'd get A and # + +2008-06-27 Matthew Allum + + * clutter/cogl/gl/cogl.c: + Temp workaround for 10.4 ATI card OSX folks, see #929 + (Tommi Komulainen) + + Bug 998 - clutter always captures X input events + + * clutter/eglx/clutter-stage-egl.c: + * clutter/glx/clutter-stage-glx.c: + When we disable X event retrival, dont still select for window + events. + +2008-06-27 Emmanuele Bassi + + * clutter/clutter-event.h: + * clutter/clutter-main.c: + * clutter/x11/clutter-backend-x11.c: Add further documentation, + and increase the coverage to 94%. + +2008-06-27 Emmanuele Bassi + + * configure.ac: Post release bump to 0.7.7. + +======== Release 0.7.6 ======================================================== + +2008-06-27 Emmanuele Bassi + + * configure.ac: + * NEWS: Release 0.7.6. + +2008-06-27 Neil Roberts + + Bug 993 - Underline colors are sometimes wrong + + * clutter/pango/pangoclutter-render.c: Fixed so that instead + of trying to set the color in prepare_run it uses draw_glyphs + to draw groups of glyphs and requests the color for each part + from Pango. + +2008-06-26 Emmanuele Bassi + + * clutter/clutter-actor.c: + (clutter_actor_set_min_width), + (clutter_actor_set_min_height), + (clutter_actor_set_natural_width), + (clutter_actor_set_natural_height): Ignore any override of the + minimum and natural size of the stage on backends that only + support static stages. + + * clutter/clutter-stage.c (clutter_stage_allocate): Use the + preferred size of the ClutterStage implementation instead of + the display size. + + * clutter/clutter-backend.[ch]: Remove get_display_size() and + clutter_backend_get_display_size(). + + * clutter/eglnative/clutter-backend-egl.c: + * clutter/fruity/clutter-backend-fruity.c: + * clutter/osx/clutter-backend-osx.c: + * clutter/sdl/clutter-backend-sdl.c: + * clutter/win32/clutter-backend-win32.c: + * clutter/x11/clutter-backend-x11.c: Remove get_display_size() + implementations. + +2008-06-26 Emmanuele Bassi + + * clutter/clutter-shader.c (bind_glsl_shader): Verify that the + vertex shader has been successfully compiled, like we do with + the fragment shader. + +2008-06-26 Emmanuele Bassi + + * clutter/osx/clutter-backend-osx.c: + (clutter_backend_osx_get_display_size): Fix the allocation pool + macro name. + +2008-06-26 Matthew Allum + + * clutter/glx/clutter-glx-texture-pixmap.c: + Move the gl extension probe into the regular object init() rather than + class_init. Should be a little safer. + +2008-06-26 Matthew Allum + + * tests/test-pixmap.c: (main): + Use strtol on arg as to take hex values. Tweak from James Ketrenos + +2008-06-25 Emmanuele Bassi + + * configure.ac: Post release bump to 0.7.5. + +======== Release 0.7.4 ======================================================== + +2008-06-25 Emmanuele Bassi + + * configure.ac: + * NEWS: Release 0.7.4. + +2008-06-25 Neil Roberts + + * clutter/win32/clutter-backend-win32.c + (clutter_backend_win32_get_display_size): Implement + get_display_size on the Win32 backend. + +2008-06-25 Emmanuele Bassi + + * clutter/clutter-main.h: Make the priority constants public. + + * clutter/clutter-stage.c: Use CLUTTER_PRIORITY_REDRAW. + + * clutter/clutter-timeline.c: Use CLUTTER_PRIORITY_TIMELINE. + +2008-06-25 Emmanuele Bassi + + * clutter/osx/clutter-backend-osx.c: + (clutter_backend_osx_get_display_size), + (clutter_backend_osx_class_init): Implement the get_display_size + function. + +2008-06-25 Emmanuele Bassi + + * clutter/clutter-actor.c: + (clutter_actor_set_min_width), + (clutter_actor_set_min_height), + (clutter_actor_set_natural_width), + (clutter_actor_set_natural_height): Add a comment explaining + the override in place for backends providing a fixed size + on a stage. + +2008-06-25 Emmanuele Bassi + + * clutter/clutter-actor.c: + (clutter_actor_set_min_width), + (clutter_actor_set_min_height), + (clutter_actor_set_natural_width), + (clutter_actor_set_natural_height): If setting the minimum + and natural width and height on a top-level actor, and on + a backend that provides only static stages, then override + the value and use the size of the display as returned by + the backend. + + * clutter/eglnative/clutter-stage-egl.c: + (clutter_stage_egl_realize): Remove the setting of the + minimum and natural width and height. + +2008-06-25 Emmanuele Bassi + + * clutter/clutter-stage.c: + (clutter_stage_allocate): Minor optimization. + + (clutter_stage_init): Do not set the minimum size of the + stage wrapper, and require that the backends set the size + themselves. + +2008-06-25 Emmanuele Bassi + + * clutter/eglnative/clutter-stage-egl.c: + (clutter_stage_egl_realize): Try to force the minimum and + natural size on realization. + +2008-06-25 Emmanuele Bassi + + * clutter/clutter-backend.c: + (clutter_backend_get_display_size): Provide a fallback for + backends not implementing get_display_size(). + + * clutter/clutter-stage.c: + (clutter_stage_allocate): Add debug messages. + + * clutter/sdl/clutter-backend-sdl.c: + (clutter_backend_sdl_get_display_size), + (clutter_backend_sdl_class_init): Implement get_display_size() + on the SDL backend. + +2008-06-25 Chris Lord + + * clutter/clutter-fixed.c: (clutter_sinx): + Fix clutter_sinx for angles > CFX_2PI - CFX_ONE. Also add note to + documentation about being able to use modulus with ClutterFixed + +2008-06-25 Emmanuele Bassi + + * clutter/clutter-backend.h: + * clutter/clutter-backend.c: + (clutter_backend_get_display_size): Add a function for getting the + display size out of the backend. + + * clutter/clutter-stage.c: + (clutter_stage_allocate): When allocating on a backend with a + static stage, we simply ignore the passed box and override it with + the size of the display. + + * clutter/eglnative/clutter-backend-egl.c: + (clutter_backend_egl_get_display_size), + (clutter_backend_egl_class_init): Implement get_display_size() by + returning the size of the EGL surface. + + * clutter/fruity/clutter-backend-fruity.c: + (clutter_backend_egl_get_display_size), + (clutter_backend_egl_class_init): Ditto as above. + + * clutter/x11/clutter-backend-x11.c: + (clutter_backend_x11_get_display_size), + (clutter_backend_x11_class_init): Implement get_display_size() by + returning the DisplayWidth and DisplayHeight of the current + screen. + +2008-06-25 Neil Roberts + + * clutter/win32/clutter-stage-win32.c + (clutter_stage_win32_realize): Use a more direct method to choose + the best pixel format instead of ChoosePixelFormat because + otherwise if the display's depth is 16 then it will prefer the + non-accelerated software implementation when the requested depth + is 24. + +2008-06-25 Emmanuele Bassi + + * clutter/clutter-stage.c (clutter_stage_allocate): Fix condition; + should always test before committing. + +2008-06-25 Matthew Allum + + * clutter/x11/clutter-backend-x11.c: (_clutter_x11_register_xinput) + Add extra safety and fallback if no useable pointing devices are + found. + +2008-06-25 Emmanuele Bassi + + * clutter/clutter-stage.c: + (clutter_stage_allocate): Check if the stage provided by the + backend is static (i.e. a framebuffer that cannot be resized) + and interrupt the allocation chain there. + + * clutter/eglnative/clutter-stage-egl.c: + (clutter_stage_egl_class_init): Remove the ::allocate empty + stub. + +2008-06-25 Matthew Allum + + * clutter/eglnative/clutter-stage-egl.c: + * clutter/eglx/clutter-stage-egl.c: + Disable passing of attribs to eglCreateContext() on GLES 1.1 h/w + +2008-06-25 Neil Roberts + + * clutter/clutter-actor.c (clutter_actor_paint): Guard against the + actor clip being enabled or disabled in an actor paint + method. Otherwise the clip stack can be become unbalanced. This + was happening in ClutterEntry until it was fixed in revision 2983. + +2008-06-24 Neil Roberts + + Bug 979 - Wrong call convension for SwapIntervalProc in win32 backend + + * clutter/win32/clutter-backend-win32.c: Use the correct calling + convention for SwapInterval. Thanks to Haakon Sporsheim. + +2008-06-24 Emmanuele Bassi + + Bug 989 - Add a search path for clutter script assets + + * clutter/clutter-script.h: + * clutter/clutter-script.c: + (clutter_script_finalize), + (clutter_script_add_search_paths), + (clutter_script_lookup_filename): Add the ability to define multiple + search paths inside ClutterScript and to look up a specific filename + inside those search paths. This is useful to define a set of + directories where the assets for a UI definition are and still + reference those assets by their name instead of the full path. (989, + based on a patch by Matthew Allum) + + * clutter/clutter-texture.c: + (clutter_texture_set_custom_property): Use the newly added + clutter_script_lookup_filename() function. + +2008-06-24 Neil Roberts + + * clutter/cogl/gles/cogl-gles2-wrapper.h: + * clutter/cogl/gles/cogl-gles2-wrapper.c: All of the settings and + uniforms are now proxied into COGL variables instead of setting + the GL uniforms directly. Just before glDrawArrays is executed a + shader is generated using the given settings to avoid using 'if' + statements. The shaders are cached. + + * clutter/cogl/gles/cogl-fixed-vertex-shader.glsl: + * clutter/cogl/gles/cogl-fixed-fragment-shader.glsl: The shaders + are now split into parts using comments instead of 'if' statements + so that the simplest shader can be generated on the fly. + + * clutter/cogl/gles/stringify.sh: Now splits up the shader sources + into separate C strings where deliminated by special comments. + + * clutter/cogl/gles/cogl-program.h: + * clutter/cogl/gles/cogl-program.c: A custom shader can no longer + be directly linked with the fixed-functionality replacement + because the replacement changes depending on the settings. Instead + the bound shader is linked with the appropriate replacement shader + just before glDrawArrays is executed. The custom uniform variables + must also be proxied through COGL variables because their location + can change when relinked. + +2008-06-24 Øyvind Kolås + + * clutter/fruity/clutter-fruity.c: removed dead code and unused + variables. + +2008-06-24 Øyvind Kolås + + * configure.ac: better alignment of list of enabled experimental + features. + +2008-06-24 Emmanuele Bassi + + * doc/clutter-actor-invariants.txt: Fix grammar and spelling, + document the ::parent-set signal emission. + +2008-06-24 Emmanuele Bassi + + * clutter/clutter-entry.c: + (clutter_entry_ensure_layout): Convert the invisible char + to UTF-8 to avoid Pango barfing on us. + +2008-06-24 Matthew Allum + + * clutter/eglnative/clutter-stage-egl.c: + Add an extra debug note. + * configure.ac: + Generate version.xml for COGL API docs + +2008-06-24 Chris Lord + + Bug 988 - cursor position wrong with multibyte invisible char + + * clutter/clutter-entry.c: (clutter_entry_ensure_cursor_position): + Fix cursor position calculation when using invisible text + +2008-06-23 Emmanuele Bassi + + * clutter/x11/clutter-event-x11.c (event_translate): Set the + event type explicitly in the union members as well for the + key events, like we do for all the other events. + +2008-06-23 Neil Roberts + + * clutter/clutter-entry.c (clutter_entry_paint): Set the clip + using COGL directly instead of setting the actor clip. Otherwise + the clip stack will be unbalanced after the first draw. This also + frees up the actor clip to be set by an application. + +2008-06-23 Matthew Allum + + * NEWS: + Add a quick note on fruity multiple deivce support. + * README: + Add multiple device support details and some tweaks on + Clutter requirements (i.e GdkPixbuf). + +2008-06-23 Matthew Allum + + Bug 987 - clutter-event.c c99 variable declaration + + * clutter/clutter-event.c: + Remove c99ism. + +2008-06-23 Emmanuele Bassi + + * configure.ac: Post release bump to 0.7.3. + +======== Release 0.7.2 ======================================================== + +2008-06-23 Emmanuele Bassi + + * configure.ac: + * NEWS: Release 0.7.2. + +2008-06-23 Emmanuele Bassi + + * clutter/clutter-texture.c: + (clutter_texture_get_preferred_width), + (clutter_texture_get_preferred_height), + (clutter_texture_set_property), + (clutter_texture_get_property), + (clutter_texture_class_init), + (clutter_texture_init): Add the new :keep-aspect-ratio property + to ClutterTexture; when set to TRUE the texture will return a + preferred width maintaining the aspect ratio with the given height + and a preferred height maintaining the aspect ratio with the + given width. This allows to set the width or the height and have + the texture automatically request the height or the width respectively + while maintaining the aspect ratio of the original image. + + * tests/test-script.json: Update to test the new :keep-aspect-ratio + property. + +2008-06-23 Neil Roberts + + Bug 918 - Group doesn't clip if it's children are clipped + + * clutter/cogl/common/cogl-clip-stack.h: + * clutter/cogl/common/cogl-clip-stack.c: Added functions to + maintain a stack of clipping rectangles. + + * clutter/cogl/gles/cogl.c: + * clutter/cogl/gl/cogl.c: The cogl_clip_set and unset functions + have moved into cogl-clip-stack.c which calls back to cogl.c to + set the actual rectangles. Multiple clip rectangles are combined + by merging the stencil buffers. + + * clutter/cogl/gles/cogl-primitives.c (_cogl_path_fill_nodes): + * clutter/cogl/gl/cogl-primitives.c (_cogl_path_fill_nodes): Merge + the stencil buffer with the contents of the clipping stack after + drawing the path. + + * clutter/cogl/gles/cogl-context.h (CoglContext): + * clutter/cogl/gl/cogl-context.h (CoglContext): Store the number + of available stencil bits. + + * clutter/cogl/common/Makefile.am + (libclutter_cogl_common_la_SOURCES): Added cogl-clip-stack.c + +2008-06-23 Robert Bragg + + * clutter/eglx/clutter-stage-egl.c: Makes sure the eglx backend + passes the EGL_OPENGL_ES2_BIT surface attrib when using + GLES2.0 under cogl + +2008-06-23 Chris Lord + + * clutter/x11/clutter-event-x11.c: (convert_xdevicekey_to_xkey), + (translate_key_event), (event_translate): + Change the xinput event handling to use translate_key (fixes modifier + handling with xinput key events) + +2008-06-23 Emmanuele Bassi + + Bug 982 - __COGL_GET_CONTEXT MS compiler issue (Haakon Sporsheim) + + * clutter/cogl/common/cogl-handle.h: + * clutter/cogl/common/cogl-primitives.c: Remove C99-isms. + + * clutter/cogl/gl/cogl-fbo.c: + * clutter/cogl/gl/cogl-primitives.c: + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gl/cogl.c: Ditto as above. + + * clutter/cogl/gles/cogl-fbo.c: + * clutter/cogl/gles/cogl-primitives.c: + * clutter/cogl/gles/cogl-texture.c: Ditto as above. + +2008-06-23 Emmanuele Bassi + + Bug 984 - pango_clutter_render_layout() declared void, but + returns (Haakon Sporsheim) + + * clutter/pango/pangoclutter-render.c: + (pango_clutter_render_layout): Do not use a return statement. + +2008-06-23 Emmanuele Bassi + + Bug 905 - Paint cursor directly (Xan López) + + * clutter/clutter-entry.c: + (clutter_entry_paint_cursor), + (clutter_entry_init), + (clutter_entry_set_color): Directly paint the cursor on the + entry instead of using an actor. + +2008-06-23 Emmanuele Bassi + + Bug 981 - clutter_stage_read_pixels temprow fix (Haakon Sporsheim) + + * clutter/clutter-stage.c (clutter_stage_read_pixels): Allocate + the temporary row data used to flip the buffer from glReadPixels() + in order to fix compilation under MSVC. Also validate the input + parameters to avoid random segfaults. + +2008-06-23 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + * clutter/clutter-event.c: + * clutter/clutter-event.h: + * clutter/clutter-main.c: + * clutter/clutter-main.h: + * clutter/clutter-private.h: + * clutter/eglx/clutter-stage-egl.c: + * clutter/fruity/clutter-backend-fruity.c: + * clutter/fruity/clutter-backend-fruity.h: + * clutter/fruity/clutter-fruity.c: + * clutter/glx/clutter-stage-glx.c: + * clutter/x11/clutter-backend-x11.c: + * clutter/x11/clutter-backend-x11.h: + * clutter/x11/clutter-event-x11.c: + * clutter/x11/clutter-stage-x11.h: + * clutter/x11/clutter-x11.h: + * configure.ac: + * tests/Makefile.am: + * tests/test-devices.c: + Merge of 'xinput' branch giving initial basic support of + multiple input devices. + +2008-06-23 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + * clutter/clutter-group.c: + Remove uneeded (at least for now) paint_area method (#970) + +2008-06-19 Emmanuele Bassi + + * clutter/clutter-script.c: Be more explicit about the fact that + the script id is not the name of an actor, and that it is retrieved + by using clutter_get_script_id(). + +2008-06-17 Emmanuele Bassi + + * clutter/clutter-actor.h: + * clutter/clutter-actor.c: + (clutter_actor_allocate_preferred_size): Add more documentation + and notes on where it's appropriate to call this function. + +2008-06-17 Chris Lord + + * clutter/clutter-texture.c: (clutter_texture_get_preferred_width), + (clutter_texture_get_preferred_height): + Maintain aspect ratio with natural width/height when for_width/height + are specified + +2008-06-17 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + Clean up of parenting code (see #972) + Doc updates to section intro. + Add clutter_actor_allocate_preferred_size () utility call + + * clutter/clutter-group.c: (clutter_fixed_layout_allocate): + Use clutter_actor_allocate_preferred_size () + + * doc/clutter-actor-invariants.txt: + Add some more notes + +2008-06-17 Emmanuele Bassi + + * clutter/clutter-actor.c: + (clutter_actor_set_parent): Do not emit ::parent-set when + reparenting. + + (clutter_actor_unparent): Ditto, as above. + + (clutter_actor_reparent): Emit ::parent-set with the old + parent and set the IN_REPARENT flag unconditionally. + +2008-06-17 Emmanuele Bassi + + * doc/clutter-actor-invariants.txt: Document the flags, the + invariants, the state changes and the minimum requirements for + actor implementations. Needs to be tweaked and fleshed out + before 0.8.0, and we obviously need to enforce the invariants. + +2008-06-17 Emmanuele Bassi + + * clutter/clutter-actor.c: + (clutter_actor_set_parent): Document and maintain the invariant + that after setting a realized parent on an actor, the actor is + also going to be realized. + + (clutter_actor_unparent): Change the invariant that an unparented + actor is also unrealized: the paint is fast enough to avoid + unrealizing, since it also causes more problems that what it's + worth. + + * tests/test-invariants.c (test_show_on_set_parent): Update the + invariants test because we changed the invariants. + +2008-06-17 Jussi Kukkonen + + * clutter/clutter-score.c (clutter_score_append): + initialize "marker" string and "complete_id" signal id when creating a + ClutterScoreEntry. + +2008-06-16 Tomas Frydrych + + * clutter/clutter-actor.c: + (clutter_actor_move_anchor_point_from_gravity): + Fixed incorrect sign of position adjustment (revert of earlier + change). + +2008-06-16 Emmanuele Bassi + + * clutter/clutter-actor.c (clutter_actor_unparent): Reset the + :show-on-set-parent property to TRUE when unparenting. + + * tests/Makefile.am: Add test-invariant to the build. + + * tests/test-invariants.c: Test the invariants that we are going + to honour (and document, at some point). + +2008-06-16 Emmanuele Bassi + + * clutter/eglnative/clutter-stage-egl.c: Ignore any size allocation + we receive from the user. + + * clutter/fruity/clutter-stage-fruity.c: Ditto as above. + +2008-06-16 Tomas Frydrych + + * clutter/clutter-actor.c: + (clutter_actor_move_anchor_point): + (clutter_actor_move_anchor_pointu): + (clutter_actor_move_anchor_point_from_gravity): + Fixed incorrect sign of position adjustment. + Fixed replace call to _move_by with move_byu in + _move_anchor_pointu. + + Stripped trailing whitespace. + +2008-06-15 Emmanuele Bassi + + Bug #967 - Mismatch of Timeline::marker-reached signal signature + + * clutter/clutter-marshal.list: + * clutter/clutter-timeline.c: + (clutter_timeline_class_init): Fix the type of the frame_num + argument in the ::marker-reached signal creation to match the + signal class handler. (Armin Burgmeier) + +2008-06-14 Emmanuele Bassi + + * README: We depend on PangoCairo, now; also add all the missing + release notes entries and the missing backends configuration notes. + +2008-06-14 Matthew Allum + + * README: + Make needed GL version 1.4, note GLES2 support, add some notes + for COGL. + +2008-06-13 Emmanuele Bassi + + * configure.ac: Post release bump to 0.7.1. + +======== Release 0.7.0 ======================================================== + +2008-06-13 Emmanuele Bassi + + * README: + * NEWS: + * configure.ac: Release 0.7.0, "Booska". + +2008-06-13 Emmanuele Bassi + + * tests/test-cogl-offscreen.c: + * tests/test-cogl-primitives.c: + * tests/test-cogl-tex-convert.c: + * tests/test-cogl-tex-foreign.c: + * tests/test-cogl-tex-getset.c: + * tests/test-cogl-tex-tile.c: + * tests/test-layout.c: + * tests/test-pixmap.c: + * tests/test-texture-quality.c: Miscellaneous fixes for distcheck + to pass. + +2008-06-13 Emmanuele Bassi + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + * tests/test-cogl-primitives.c: + * tests/test-events.c: + * tests/test-multistage.c: + * tests/test-textures.c: + * tests/test-timeline.c: Miscellaneous fixes for distcheck to + pass. + +2008-06-13 Emmanuele Bassi + + * clutter/clutter-texture.c: + (clutter_texture_unrealize), (clutter_texture_dispose): Add a + guard against reading back memory during the unrealization on + dispose. + +2008-06-13 Emmanuele Bassi + + Bug #953 - Actors are not hidden before unrealized or + disposed (Tommi Komulainen) + + * clutter/clutter-actor.c: + (clutter_actor_unrealize): Hide a visible actor when unrealizing + it. + + (clutter_actor_dispose): Make sure to unrealize an actor when + disposing it. + +2008-06-13 Emmanuele Bassi + + * clutter/clutter-actor.c: + (clutter_actor_dispose), (clutter_actor_destroy), + (clutter_actor_unparent): Clean up the actor's destruction + sequence, making sure that every operation is performed + under the CLUTTER_ACTOR_IN_DESTRUCTION internal flag. (thanks + to Tomas Frydrych, Neil Roberts and Matthew Allum) + +2008-06-13 Emmanuele Bassi + + Bug #960 - PangoContext creation code should not be duplicated + + * clutter/clutter-private.h: + * clutter/clutter-main.c: + (_clutter_context_create_pango_context): Abstract the creation + of the PangoContext inside its own function, to avoid code and + bugs duplication. (Tommi Komulainen) + + * clutter/clutter-entry.c (clutter_entry_init): Use the newly + added PangoContext creation function. + + * clutter/clutter-label.c (clutter_label_init): Ditto as above. + +2008-06-12 Emmanuele Bassi + + Bug #964 - "unrealized" signal of ClutterActor wrongly named + + * clutter/clutter-actor.c (clutter_actor_class_init): Fix typo + in the ::unrealize signal name. (Armin Burgmeier) + +2008-06-12 Emmanuele Bassi + + * doc/reference/cogl/Makefile.am: Ignore cogl/gl and cogl/gles + when building the documentation. + + * clutter/cogl/cogl.h.in: Add sections in the header file. + +2008-06-12 Emmanuele Bassi + + * clutter/clutter-actor.c: Add more clarifications on the + size and position accessors and the distinction between + transformed and untransformed actor box inside the actor's + description. + +2008-06-12 Emmanuele Bassi + + * clutter/clutter-actor.c: Clarify the documentation of the + accessors of the width and height. + +2008-06-12 Neil Roberts + + * clutter/win32/clutter-stage-win32.c: Updated to the new layout + API. All code to do with positioning the stage has been removed so + the window is left where Windows wants to put it and it can not be + moved with clutter_actor_set_position. + + * clutter/win32/clutter-stage-win32.h (ClutterStageWin32): Remove + win_xpos and win_ypos. + + * clutter/win32/clutter-event-win32.c (message_translate): Remove + the handler for WM_MOVE because the stage no longer cares where it + is positioned. + +2008-06-12 Emmanuele Bassi + + * clutter/clutter-actor.[ch]: Documentation fixes. + + * clutter/clutter-backend.c: Documentation fixes. + + * clutter/clutter-container.h: Documentation fixes. + + * clutter/clutter-fixed.c (clutter_qdivx): Fix the return + value to be after the description. + + * clutter/clutter-texture.[ch]: Documentation fixes. + + * clutter/clutter-timeline.c: Documentation fixes. + +2008-06-11 Emmanuele Bassi + + * tests/test-layout.c: Take into account the origin of the + parent, if it has changed, and queue a relayout if we are + using the transformed box when computing the layout. + +2008-06-11 Emmanuele Bassi + + * clutter/eglnative/clutter-stage-egl.c: Remove a duplicate + get_preferred_width() implementation. (thanks to Iain Holmes) + +2008-06-11 Neil Roberts + + * clutter/clutter-actor.c (clutter_actor_allocate): Fixed the + logic when detecting whether the actor has moved. + +2008-06-11 Iain Holmes + + * configure.ac: Detect the GL headers in flavour=fruity + + * clutter/fruity/clutter-stage-fruity.c: Update the Fruity backend to + use the new size negotiation API. + +2008-06-11 Emmanuele Bassi + + * clutter/clutter-label.c (clutter_label_allocate): Keep the + layout if the size of the allocation is the same as the last + allocation received by the label. + +2008-06-11 Emmanuele Bassi + + * clutter/clutter-actor.c: Notify :x, :y, :width and :height + properties using ClutterUnits, not pixels. + +2008-06-11 Emmanuele Bassi + + * clutter/eglnative/clutter-stage-egl.c: Update the EGL native + backend to use the new size negotiation API. + +2008-06-11 Emmanuele Bassi + + * clutter/sdl/clutter-stage-sdl.c: Update the SDL backend to + use the new size negotiation API. + +2008-06-11 Emmanuele Bassi + + Bug #961 - Fails to build on OSX + + * clutter/osx/clutter-stage-osx.c: Update the OSX backend to + use the new size negotiation API. + +2008-06-11 Emmanuele Bassi + + * autogen.sh: Force overwriting when glib-gettextize is + invoked by autogen.sh. + +2008-06-10 Neil Roberts + + * clutter/clutter-main.c: Include for setlocale() + +2008-06-10 Emmanuele Bassi + + * clutter/clutter-child-meta.c: Fix section name + + * clutter/clutter-container.c: + (clutter_container_child_set_property), + (clutter_container_child_get_property): Fix gtk-doc parameter + name. + + * clutter/clutter-container.h: Fix documentation of the + interface vfuncs. + + * clutter/clutter-event.h: Fix documentation. + + * clutter/clutter-feature.h: Fix documentation. + + * clutter/clutter-types.h: Add ClutterRequestMode. + + * clutter/x11/clutter-event-x11.c: Fix documentation. + + * tests/test-fullscreen.c: Verify that the stage size has been + changed by clutter_stage_fullscreen(). + +2008-06-10 Emmanuele Bassi + + Bug #815 - Split up request, allocation, and paint box + + * clutter/clutter-actor.[ch]: Rework the size allocation, + request and paint area. Now ::request_coords() is called + ::allocate(), and ::query_coords() has been split into + ::get_preferred_width() and ::get_preferred_height(). See + the documentation and the layout test on how to implement + a container and layout manager with the new API. (#915, + based on a patch by Havoc Pennington, Lucas Rocha and Johan + Bilien) + + * clutter/clutter-clone-texture.c: Port CloneTexture to + the new size negotiation API; it just means forwarding + the requests to the parent texture. + + * clutter/clutter-deprecated.h: Add deprecated and replaced + API. + + * clutter/clutter-entry.c: Port Entry to the new size + negotiation API. + + * clutter/clutter-group.c: Port Group to the new size + negotiation API; the semantics of the Group actor do not + change. + + * clutter/clutter-label.c: Port Label to the new size + negotiation API, and vastly simplify the code. + + * clutter/clutter-main.[ch]: Add API for executing a + relayout when needed. + + * clutter/clutter-private.h: Add new Stage private API. + + * clutter/clutter-rectangle.c: Update the get_abs_opacity() + call to get_paint_opacity(). + + * clutter/clutter-stage.c: + (clutter_stage_get_preferred_width), + (clutter_stage_get_preferred_height), + (clutter_stage_allocate), + (clutter_stage_class_init): Port Stage to the new size + negotiation API. + + * clutter/clutter-texture.c: Port Texture to the new size + negotiation API. + + * clutter/clutter-types.h: Add ClutterRequestMode enumeration. + + * clutter/x11/clutter-stage-x11.c: Port the X11 stage + implementation to the new size negotiation API. + + * tests/Makefile.am: Add the layout manager test case. + + * tests/test-opacity.c: Update. + + * tests/test-project.c: Update. + + * tests/test-layout.c: Test case for a layout manager implemented + using the new size negotiation API; the layout manager handles + both transformed and untransformed children. + +2008-06-10 Emmanuele Bassi + + * Makefile.am: Add the po/ directory to the build. + +2008-06-10 Emmanuele Bassi + + * autogen.sh: Check for, and run glib-gettextize. + + * configure.ac: Set up the localization support. + + * clutter/clutter-main.c: Do not define the GETTEXT_PACKAGE, + but use the one from the configure script. + + * po/POTFILES.in: Template for the translatable files. + +2008-06-10 Chris Lord + + * clutter/clutter-main.c: (pre_parse_hook): + Call setlocale on init + + * clutter/x11/clutter-event-x11.c: (translate_key_event): + Fix typo and use the same buffer size as xev + +2008-06-10 Øyvind Kolås + + * clutter/clutter-texture.c: improved documentation for + clutter_texture_set_filter_quality. + +2008-06-10 Chris Lord + + Bug #916 - ClutterKeyEvent:unicode_value is ignored + Bug #950 - AltGr not handled + + * clutter/osx/clutter-event-osx.c: (clutter_event_osx_translate): + * clutter/x11/clutter-event-x11.c: (translate_key_event): + * tests/test-events.c: (fill_keybuf), (input_cb): + Apply patch from Tommi Komulainen, fill the unicode_value attribute of + the ClutterKeyEvent struct. Also use XKeycodeToKeysym, as suggested in + bug #950, comment #2 + +2008-06-10 Matthew Allum + + * clutter/clutter-texture.c: + Minor reformatting cleanups. Emit filter-quality prop on change. + * clutter/glx/clutter-glx-texture-pixmap.c: + Support mipmaps via filter quality prop. + +2008-06-10 Chris Lord + + * tests/Makefile.am: + * tests/test-entry-auto.c: + Add automatic test for ClutterEntry, by Tommi Komulainen + +2008-06-10 Chris Lord + + * clutter/cogl/common/cogl-primitives.c: (_cogl_path_arc): + Draw as expected when end angle is lower than start angle (i.e. do not + swap the angles). This aligns with cairo behaviour. + +2008-06-10 Tommi Komulainen + + Bug#959 - Multiple minor improvements + + * configure.ac: pick up GDKPIXBUF_PREFIX from gdk-pixbuf-2.0 + module, not pango + + * clutter/clutter-keysyms-table.h: cosmetic fix for ifdef guard + name in the comment (leftover from earlier commit) + + * tests/test-textures.c: don't depend on GdkPixbuf as we're not + using any actual features from it, just plain pixel buffer + manipulation + + * clutter/clutter-timeline.c + * clutter/clutter-timeline.h (clutter_timeline_list_markers): Use + gsize* to return number of items, not guint* + * tests/test-paint-wrapper.c: use correct type (guint*) in call + to clutter_actor_get_size() + + * tests/test-depth.c (janus_group): properly take height2 into + account when calculating needed height for the rectangle + + * tests/test-cogl-tex-getset.c: use rowstride, not width*4, when + calculating pixel offsets + + * tests/test-cogl-tex-getset.c: Don't assume/force RGBA format, + also support ARGB format (needed with quartz imageloader.) + +2008-06-09 Tommi Komulainen + + * clutter/osx/clutter-backend-osx.c (clutter_backend_osx_post_parse): + Print GL_VENDOR, GL_RENDERER, GL_VERSION and GL_EXTENSIONS to aid + debugging. + +2008-06-09 Tommi Komulainen + + Bug #930 - add support for quartz imagebackend + + * clutter/cogl/common/cogl-bitmap-pixbuf.c + (_cogl_bitmap_from_file): When USE_QUARTZ is defined implement + using Core Graphics. + * configure.ac: support --with-imagebackend=quartz and print + which imagebackend is selected. Make quartz default on OSX + +2008-06-09 Øyvind Kolås + + * clutter/cogl/common/cogl-primitives.c: (cogl_path_rel_curve_to): + fixed naming of implementation of cogl_path_rel_curve_to (it was + called just cogl_rel_curve_to). + +2008-06-09 Emmanuele Bassi + + * configure.ac: Clean up a bit the X11 and X extensions + checks with PKG_CHECK_EXISTS(). Since we are filling up the + X11_CFLAGS and X11_LIBS variables ourselves there is no + point in polluting the Makefiles with unused variables. + + * clutter/Makefile.am: Remove the pkg-config variable + evaluation and use the values retrieved from the configure + script. + +2008-06-09 Chris Lord + + Bug #914 - ClutterEntry is confused about characters vs. bytes + + * clutter/clutter-entry.c: (clutter_entry_ensure_layout), + (clutter_entry_handle_key_event_internal), + (clutter_entry_set_text): + Fix mix-up of character and byte counts, handle unicode correctly. + Use clutter_key_event_unicode() instead of + clutter_keysym_to_unicode(). + + * clutter/clutter-event.c: (clutter_key_event_unicode): + Don't ignore ClutterKeyEvent.unicode_value + + * clutter/clutter-keysyms-table.h: + Rename header define so as not to conflict with clutter-keysyms.h + + Patch originally by Emmanuele Bassi, with input from Tommi Komulainen. + +2008-06-07 Øyvind Kolås + + * clutter/clutter-texture.c: made the filter-quality proeprty also + control the use of mipmapping. + * clutter/clutter-texture.h: added ClutterTextureQuality enum. + * tests/test-texture-quality.c: new test. + * tests/Makefile.am: added test-texture-quality + +2008-06-06 Emmanuele Bassi + + * clutter/clutter-texture.c: + (clutter_texture_class_init): Do not unrealize on hide(), and + do not realize() on show. By default, clutter_actor_show() will + realize ourselves, and we don't want to unrealize when hidden + to avoid paying the penalty of reading back the texture data + from the video memory. + + * tests/test-actors.c: Show all textures again when pressing + the 'r' key. + +2008-06-06 Neil Roberts + + * tests/test-shader.c: Use the special wrapper vars when building + for GLES 2 and automatically cycle the shaders because it's + difficult to right-click. + +2008-06-06 Neil Roberts + + * tests/test-shader.c: Fixed to use sampler2D instead of + sampler2DRect now that GL_TEXTURE_RECTANGLE support is disabled in + revision 2834. The ClutterTexture actor now has the + 'disable-slicing' property set. The distance in texture + coordinates between pixels is passed in as a uniform so that the + box-blur shader can still work. + +2008-06-06 Emmanuele Bassi + + Bug #952 - Fix test-textures in trunk + + * tests/test-textures.c: Use USE_GDKPIXBUF instead of + USE_PIXBUF. (#952, Gwenole Beauchesne) + +2008-06-06 Emmanuele Bassi + + Bug #951 - Fix clutter_entry_init() in trunk + + * clutter/clutter-entry.c (clutter_entry_init): Remove a + variable shadowing another one. (#951, Tommi Komulainen) + +2008-06-06 Emmanuele Bassi + + Bug #955 - ClutterLabel is missing fallback resolution handling + + * clutter/clutter-label.c (clutter_label_init): Handle + clutter_backend_get_resolution() return value -1 similar to + ClutterEntry (falling back to 96.0). (#955, Tommi Komulainen) + +2008-06-06 Neil Roberts + + * clutter/eglnative/clutter-stage-egl.c + (clutter_stage_egl_realize): Use ES 2 renderable type when + building for GLES 2. + + * clutter/eglnative/clutter-event-egl.c (get_backend_time): Added + a NULL for the microseconds parameter of g_timer_elapsed. + + * clutter/eglnative/clutter-stage-egl.h: + * clutter/eglnative/clutter-egl.h: + * clutter/eglnative/clutter-backend-egl.h: Include + clutter-egl-headers.h instead of including the GL headers directly + so it can include gl2.h when building for GLES 2. + + * clutter/eglnative/clutter-egl-headers.h: + * clutter/eglnative/Makefile.am (libclutter_eglnative_la_SOURCES): + Added clutter-egl-headers.h + + * clutter/cogl/gles/cogl-fixed-fragment-shader.glsl: GLES 2 + doesn't provide a default precision for floats in the fragment + shader and it will reject the shader if there isn't one. + +2008-06-06 Matthew Allum + + Bug #948 - Remove texture rectangle support + + * clutter/clutter-feature.c: + * clutter/clutter-feature.h: + * clutter/clutter-texture.c: + * clutter/cogl/gl/cogl.c: + * clutter/glx/clutter-glx-texture-pixmap.c: + Remove support for GL_TEXTURE_RECTANGLE_ARB (now using just regular + 2D textures, with optional npots extension). Simplifys code, + makes + mipmap & shader support much more sane. + +2008-06-06 Øyvind Kolås + + Bug #931 - suspicious size allocation for pixel data. + + * clutter/cogl/common/cogl-bitmap-pixbuf.c: + (_cogl_bitmap_from_file): allocate height×rowstride and not duplicate + gdkpixbuf's strange optimization saving some bytes at the end of the + pixbuf. + +2008-06-05 Tommi Komulainen + + Bug 913 - cogl fails to build on OSX + + * clutter/cogl/gl/cogl-fbo.c: define GL_READ_FRAMEBUFFER_EXT and + GL_DRAW_FRAMEBUFFER_EXT if not defined in the build system. The + #ifdef can fail if they're not #defines but variables or enums. + As the values are supposed to be industry standard even then + it shouldn't have ill effects. + +2008-06-05 Tommi Komulainen + + Bug #911 - OSX: add multistage support + + * clutter/osx/clutter-backend-osx.{c,h} + (clutter_backend_osx_init_stage, clutter_backend_osx_get_stage, + clutter_backend_osx_redraw, clutter_backend_osx_create_stage, + clutter_backend_osx_ensure_context, clutter_backend_osx_class_init, + clutter_backend_osx_dispose, ClutterGLView:drawRect:): + * clutter/osx/clutter-stage-osx.{c,h} (clutter_stage_osx_realize, + ClutterGLWindow:setFrameSize:): + Adapt to new multistage backend API. Don't keep a pointer to + default stage. Derive from ClutterActor instead of ClutterStage. + Implement ClutterStageWindow interface. Paint, resize and + otherwise manipulate the wrapper rather than self when necessary. + + (clutter_backend_post_parse): Create our singleton GL context + here. We could probably create the context when the default + stage is created, but I think this is more clean. + + * clutter/osx/clutter-event-osx.c (clutter_event_osx_translate) + * clutter/osx/clutter-stage-osx.c (clutter_stage_osx_state_update, + ClutterGLWindow:windowShouldClose:): + * clutter/osx/clutter-stage-osx.h: Export ClutterGLWindow interface + for clutter-event-osx.c to easily get the stage for NSWindow. + Fill in ClutterEventAny::stage on our events. + +2008-06-05 Tommi Komulainen + + Bug #910 - OSX: missing memory pool + + * clutter/osx/clutter-backend-osx.c (clutter_backend_osx_redraw): + Add missing memory pool wrapup. + +2008-06-05 Tommi Komulainen + + Bug #909 - OSX: missing NULL pointer handling + + * clutter/osx/clutter-stage-osx.c (ClutterGLWindow, + clutter_stage_osx_set_title): NSString:stringWithUTF8String: + does not accept NULL values, use empty string ("") instead. + Avoids potential crash. + +2008-06-05 Emmanuele Bassi + + * tests/Makefile.am: + * tests/test-paint-wrapper.c: Add a test case (merely, a copy + of test-actors.c) that verifies that handlers to the ::paint + signal are called in the right order. + +2008-06-05 Emmanuele Bassi + + Bug #840 - Implement prepare-paint and finish-paint signals. + + * clutter/clutter-actor.c: + (clutter_actor_class_init): Add the ::paint, ::realize and + ::unrealize signals to ClutterActor. It is possible to + override the paint, realization and unrealization of an + actor without subclassing it. The ::paint signal handlers + have the same limitations of a ClutterActor::paint implementation + inside a subclass. + + (clutter_actor_realize), + (clutter_actor_unrealize), + (clutter_actor_paint): Emit the signals instead of calling + the functions from the class vtable. + +2008-06-05 Emmanuele Bassi + + * ChangeLog-ivan: Remove the ChangeLog of the clutter-ivan + branch; the branch already contains it. + +2008-06-05 Matthew Allum + + * clutter/glx/clutter-glx-texture-pixmap.h: + Actually export clutter_glx_texture_pixmap_using_extension () + +2008-06-05 Chris Lord + + * clutter/clutter-entry.c: + Correct the documentation for clutter_entry_set_max_length, fixes bug + #915. + +2008-06-04 Robert Bragg + + * tests/test-clip.c: + Removes a spurious #include which may not + be found if using --with-imagebackend=internal + +2008-06-04 Robert Bragg + + * configure.ac: + Checks that for pangocairo >= 1.18, since + pangocairo-font.c uses pango_cairo_font_get_scaled_font which isn't + otherwise available. + +2008-06-03 Neil Roberts + + Applied patch from bug #947 + + * clutter/clutter-stage.c (clutter_stage_get_default): Don't grab + the floating reference when creating the default stage. The stage + manager will take a reference to it so it will behave as any other + stage. + (clutter_stage_new): Don't take the floating reference to the new + stage but let the stage manager keep it instead. + + * clutter/clutter-stage-manager.c + (_clutter_stage_manager_add_stage): Take a reference to the stage + when it is added to the list. + (_clutter_stage_manager_remove_stage): Unref the stage when it is + removed from the list. + (clutter_stage_manager_dispose): Keep track of the 'next' pointer + as a separate variable so we can cope when the stage being + destroyed removes itself from the list as the list is being + iterated. + + * clutter/clutter-actor.c (clutter_actor_destroy): Take a + reference at the beginning of the function even if there is no + parent container so that overall the reference count is not + changed when the actor is unref'd again at the bottom of the + function. Previously it would have a net effect of leaving the + reference count alone unless it is a top level actor in which case + it would unref it. + +2008-06-03 Matthew Allum + + * clutter/glx/clutter-glx-texture-pixmap.c: + Dont always fallback to x11 (slow) updates for a single + failed pixmap. + Minor cleanups. + * clutter/x11/clutter-x11-texture-pixmap.c: + Move shm allocation to only area updates. + +2008-06-03 Øyvind Kolås + + * clutter/clutter-container.c: (container_get_child_property): + s/g_object_set_property/g_object_get_property/ + +2008-06-02 Neil Roberts + + * clutter/pango/pangoclutter-glyph-cache.c + (pango_clutter_glyph_cache_set): When creating a new band, make + sure the texture is wide enough for the glyph, not just tall + enough. + +2008-06-02 Neil Roberts + + Applied 'final patch' from bug #874 + + * clutter/cogl/gles/cogl.c: + * clutter/cogl/gl/cogl.c: The clip planes are now set using the + inverse projection matrix as the modelview matrix so that they can + be specified in screen coordinates. + + * clutter/cogl/gles/cogl-context.h (CoglContext): + * clutter/cogl/gl/cogl-context.h (CoglContext): Added a member to + cache the inverse projection matrix + + * clutter/clutter-fixed.h: Added a constant for converting from + radians to degrees. + + * clutter/clutter-fixed.c (clutter_atani, clutter_atan2i): Added + fixed-point versions of atan and atan2. + + * tests/test-clip.c: Added a test for clipping with various + rotations and depths. + + * tests/Makefile.am (noinst_PROGRAMS): Added test-clip + +2008-06-02 Neil Roberts + + * clutter/cogl/gles/cogl-gles2-wrapper.h: The uniform numbers are + now stored in a separate struct so they can be stored for + application program objects as well. + + * clutter/cogl/gles/cogl.c: Moved stub shader functions into + separate files. + (_cogl_features_init): Report support for the shaders feature on + GLES 2 + + * clutter/cogl/gles/cogl-shader.h: + * clutter/cogl/gles/cogl-shader.c: + * clutter/cogl/gles/cogl-program.h: + * clutter/cogl/gles/cogl-program.c: Separate files to handle + shaders on programs on GLES. If version 1.1 is being used then the + stub functions which all fail are still used. + + * clutter/cogl/gles/cogl-gles2-wrapper.c + (cogl_gles2_wrapper_init, cogl_gles2_wrapper_bind_attributes), + (cogl_gles2_wrapper_get_uniforms): Move the uniforms and attribute + bindings into a separate function so they can be used to bind on + application shaders as well. + (cogl_gles2_wrapper_update_matrix): Now takes a parameter and is + no longer static so that it can be used to update all of the + matrices when a new shader is bound. + + * clutter/cogl/gles/cogl-defines.h.in: Use GL_COMPILE_STATUS for + CGL_OBJECT_COMPILE_STATUS if the latter isn't available (for + example on GLES 2). + + * clutter/cogl/gles/cogl-context.h (CoglContext): Added handle + arrays for programs and shaders. + + * clutter/cogl/gles/cogl-context.c (cogl_create_context) + (cogl_destroy_context): Initialize and destroy program and shader + handle array. + + * clutter/cogl/gles/Makefile.am (libclutter_cogl_la_SOURCES): Add + cogl-{shader,program}.{c,h} + +2008-06-02 Neil Roberts + + * clutter/cogl/gl/cogl-context.c (cogl_destroy_context): Fix + cut-and-paste error where the wrong arrays were being freed. + +2008-06-01 Emmanuele Bassi + + Merge from clutter-0-6: + + * clutter/clutter-model.c: + (clutter_model_iter_set_internal_valist): Add an internal function + wrapping ClutterModelIter::set_value that does not emit the + ::row-changed signal. Emitting this signal before the ::row-added + one is wrong: a row cannot change before being inserted. + + (clutter_model_append), (clutter_model_prepend), + (clutter_model_insert): Use the non-signal emitting variant of + clutter_model_iter_set_valist(). + + (clutter_model_iter_set_valist): Use the internal version and emit + the ::row-changed signal at the end. + +2008-05-31 Emmanuele Bassi + + Bug #943 - Signals are only emitted within a certain area of + the stage + + * clutter/clutter-main.c (clutter_do_event): Use the proper + API and not the macros for the default stage, in case we are + using a backend supporting multiple stages. (Julian Aron Prenner) + +2008-05-30 Emmanuele Bassi + + * clutter/pango/pangoclutter-fontmap.c: + * clutter/pango/pangoclutter-renderer.c: + * clutter/pango/pangoclutter.h + * clutter/pango/pangoclutter-private.h: Add a function retrieving + the font mipmapping setting. + +2008-05-29 Neil Roberts + + * clutter/cogl/gles/cogl-gles2-wrapper.h (CoglGles2Wrapper): Added + uniforms for alpha testing. + + * clutter/cogl/gles/cogl-gles2-wrapper.c + (cogl_gles2_wrapper_init): Get the uniforms for alpha testing + settings. + (cogl_wrap_glEnable, cogl_wrap_glDisable): Enable/disable alpha + testing. + (cogl_wrap_glAlphaFunc): Filled in the wrapper. + + * clutter/cogl/gles/cogl-fixed-fragment-shader.glsl: Added alpha + testing. + + * clutter/cogl/gles/cogl-gles2-wrapper.h: + * clutter/cogl/gles/cogl-gles2-wrapper.c + (cogl_wrap_glGetIntegerv): Added a wrapper for glGetIntegerv so + that it can report zero clip planes. + + * clutter/cogl/gles/cogl.c: + * clutter/cogl/gles/cogl-texture.c: Use the wrapped version of + glGetIntegerv + + * clutter/cogl/gles/cogl-primitives.c (_cogl_path_fill_nodes): Use + _cogl_features_available to check for the stencil buffer instead + of an #ifdef. The stencil buffer is available in the default + profile for the GLES 2 simulator. + +2008-05-29 Emmanuele Bassi + + * configure.ac: Check the --with switches as soon as we have them, + to avoid further checks that will fail anyway. + +2008-05-29 Emmanuele Bassi + + * README: Update the configure arguments list. + +2008-05-28 Neil Roberts + + * clutter/cogl/gles/cogl-gles2-wrapper.c + (cogl_gles2_wrapper_init): Get uniforms for fog parameters and + initialise them. + (cogl_wrap_glDrawArrays): Store the modelview matrix in a uniform + as well so that it can be used for fogging calculations. + (cogl_wrap_glEnable, cogl_wrap_glDisable): Enable/disable fogging. + (cogl_wrap_glFogx, cogl_wrap_glFogxv): Fill in wrapper to set + fogging parameters. + + * clutter/cogl/gles/cogl-fixed-vertex-shader.glsl: Calculate the + fog amount if fogging is enabled. + + * clutter/cogl/gles/cogl-fixed-fragment-shader.glsl: Mix with fog + color. + + * clutter/cogl/gles/cogl-gles2-wrapper.h (CoglGles2Wrapper): Add + uniforms for fogging. + +2008-05-28 Emmanuele Bassi + + * clutter/pango/pangoclutter-font.c: Remove unneeded file. + + * tests/Makefile.am: + * tests/test-random-text.c: Add a test for checking the + glyph cache. + +2008-05-28 Emmanuele Bassi + + Bug #919 - Replacement pango renderer (Neil Roberts) + + * clutter/clutter-backend.h: + * clutter/clutter-backend.c: + (clutter_backend_set_font_options), + (clutter_backend_get_font_options): Add the ability to set + the cairo_font_options_t* for the backend at construction + time, so that backend implementations can have their own + options. + + * clutter/clutter-color.c: Include pango/pango-attributes.h + for the pango_color_parse() function. + + * clutter/clutter-label.c: + (clutter_label_ensure_layout), + (clutter_label_init), (clutter_label_set_text), + (clutter_label_set_font_name), (clutter_label_set_ellipsize), + (clutter_label_set_use_markup): Ensure that the cache is + always primed when the Label changes; this makes sure that + the cache is rebuilt outside the paint run, which should + make the painting perform better especially on embedded + devices. + + * clutter/clutter-entry.c: + (clutter_entry_ensure_layout), + (clutter_entry_init), (clutter_entry_set_text), + (clutter_entry_set_font_name): Ditto as above. + + * clutter/clutter-private.h: + * clutter/clutter-main.[ch]: Create the font-map inside the + main context; add two new functions: + + clutter_clear_glyph_cache() + clutter_set_use_mipmapped_text() + + that control the glyphs cache. + + * clutter/pango/Makefile.am: + * clutter/pango/pangoclutter-fontmap.c: + * clutter/pango/pangoclutter-private.h: + * clutter/pango/pangoclutter-render.c: + * clutter/pango/pangoclutter.h: Rewrite the Pango renderer + using a PangoCairo context and saving the glyphs inside a + more efficient cache. + + * configure.ac: Depend on pangocairo instead of pangoft2. + +2008-05-28 Emmanuele Bassi + + Bug 882 - Allow child properties for containers implementing the + ClutterContainer interface (Øyvind Kolås) + + * clutter/clutter-child-meta.[ch]: Base class for the metadata + of a ClutterActor inside a ClutterContainer; the ChildMeta + object implements a wrapper for storing data that is attached + to a ClutterActor only when it's part of a ClutterContainer. + The ChildMeta object is used to store the child properties + accessible through the ClutterContainer API. + + * clutter/clutter-container.[ch]: Creates the ChildMeta for + each actor, in case the Container specifies the ChildMeta + type to use. + + * clutter/Makefile.am: Add clutter-child-meta.[ch] to the build. + + * clutter/clutter-marshal.list: Add the marshaller for the + ClutterContainer::child-notify signal. + + * clutter/clutter-types.h: Declare ClutterContainer and + ClutterChildMeta to avoid recursive inclusion. + +2008-05-28 Neil Roberts + + * clutter/cogl/gles/Makefile.am: Use old-style Makefile rules for + the stringify script so that automake won't complain. + +2008-05-28 Emmanuele Bassi + + * tests/test-script.c: + * tests/test-script.json: Test merging the same actor from two + different sources. + +2008-05-28 Emmanuele Bassi + + Fix merging of objects with the same id. + + * clutter/clutter-script.c: + (json_object_end): If there already is an ObjectInfo under the + parsed id, merge the construction with the currently stored + state. + + (parse_children), (parse_signals), + (parse_behaviours): Append the newly parsed children, signals + and behaviours, in case the ObjectInfo already has unresolved + items. + + (clutter_script_construct_object): Fix a typo in the type check. + + (clutter_script_init): Do not copy the key inside the hash + table holding the objects - we are already holding it inside + the value. + +2008-05-28 Neil Roberts + + * clutter/cogl/gles/cogl-gles2-wrapper.c (cogl_wrap_glGetFixedv): + Filled in the wrapper for glGetFixedv + +2008-05-28 Neil Roberts + + * clutter/cogl/gles/cogl-texture.c: Use the wrapper for + glTexParameteri. Call glGenerateMipmap after every change to the + texture image data. + + * clutter/cogl/gles/cogl-gles2-wrapper.h: + * clutter/cogl/gles/cogl-gles2-wrapper.c: Added a wrapper for + glTexParameteri so that it can ignore requests to set + GL_GENERATE_MIPMAP. Added a wrapper for glGenerateMipmap that does + nothing on GLES 1 + +2008-05-28 Emmanuele Bassi + + * clutter/clutter-script.c: + (clutter_script_construct_object): Mark top-level objects, + that is objects that don't have their ownership transferred + when building up a ClutterScript. + + (object_info_free): Merge a fix from the stable branch, but + do not check the type - check whether the object is a top + level (we still need the ClutterActor type check in order to + call clutter_actor_destroy()). + +2008-05-28 Emmanuele Bassi + + * clutter/clutter-rectangle.c: + (clutter_rectangle_paint): Remove commented out call to + cogl_enable(); the call is not needed and the comment is + in C99. + +2008-05-27 Neil Roberts + + * clutter/eglx/clutter-stage-egl.h: + * clutter/eglx/clutter-egl-headers.h: + * clutter/eglx/clutter-backend-egl.h: + * clutter/eglx/Makefile.am: Include the GLES and EGL headers via + clutter-egl-headers.h so that the right version can be used + depending on whether the GLES 2 wrapper is being used. + + * configure.ac: Added an automake conditional for whether the GLES + 2 wrapper should be used. + + * clutter/eglx/clutter-stage-egl.c (clutter_stage_egl_realize): + Remove the call to glGetIntegerv to get the max texture size. It + was being called before the GL context was bound so it didn't work + anyway and it was causing trouble for the GLES 2 simulator. + + * clutter/cogl/gles/stringify.sh: Shell script to convert the + shaders into a C string. + + * clutter/cogl/gles/cogl-gles2-wrapper.h: + * clutter/cogl/gles/cogl-gles2-wrapper.c: Wrappers for most of the + missing GL functions in GLES 2. + + * clutter/cogl/gles/cogl-fixed-fragment-shader.glsl: + * clutter/cogl/gles/cogl-fixed-vertex-shader.glsl: New shaders for + GLES 2 + + * clutter/cogl/gles/cogl-defines.h.in: Use the @CLUTTER_GL_HEADER@ + macro instead of always using the GLES 1 header. + + * clutter/cogl/gles/cogl-context.h (CoglContext): Include a field + for the state of the GLES 2 wrapper. + + * clutter/cogl/gles/cogl-texture.c: + * clutter/cogl/gles/cogl-primitives.c: + * clutter/cogl/gles/cogl.c: Use wrapped versions of the GL + functions where neccessary. + + * clutter/cogl/gles/Makefile.am: Add sources for the GLES 2 + wrapper and an extra build step to put the GLSL files into a C + string whenever the files change. + +2008-05-26 Matthew Allum + + * clutter/x11/clutter-stage-x11.c: (clutter_stage_x11_request_coords): + Dont allow the window to be resize to 0 dimentions. (fixes #933) + +2008-05-23 Emmanuele Bassi + + Bug #912 - Invalid use of int* as parameter for glGetIntegerv + + * clutter/cogl/gl/cogl.c (_cogl_features_init): Use GLint + instead of int. (#912, Tommi Komulainen) + +2008-05-23 Emmanuele Bassi + + Bug #928 - Reparenting a child that itself is a container + doesn't work + + * clutter/clutter-actor.c (clutter_actor_set_parent): Realize + an actor when setting its parent, if the parent is realized. + + * clutter/clutter-group.c: + (clutter_group_realize), (clutter_group_class_init): Add the + missing implementation of the ::realize() virtual function; this + makes sure that the children of a Group are realized if the Group + is realized. (#928) + +2008-05-21 Neil Roberts + + * clutter/cogl/gl/cogl.c (error_string): + * clutter/cogl/gles/cogl.c (error_string): Rename to + _cogl_error_string and remove the static scoping so that it can be + called in cogl-texture etc. + + * clutter/cogl/gl/cogl-texture.c (cogl_texture_new_from_foreign): + * clutter/cogl/gles/cogl-texture.c (cogl_texture_new_from_foreign): + GE(*) can't be used to wrap around calls that use the return + value. + + * clutter/cogl/gl/cogl-texture.c (_cogl_texture_quad_sw) + (_cogl_texture_quad_hw, cogl_texture_polygon): Remove GE(*) + wrapper around calls in the middle of a glBegin/glEnd pair which + otherwise always generate an error because glGetError can only be + called outside of the pair. + + * clutter/cogl/gl/cogl-internal.h: Include stdio.h when definig + COGL_DEBUG and declare a prototype for _cogl_error_string. + + * clutter/cogl/gles/cogl-internal.h: Match GE(*) macro to GL + version. + +2008-05-21 Ivan Leben + + * clutter/cogl/gles/cogl-texture.c: + (_cogl_texture_download_from_gl:) Only comment out the broken + check for framebuffer alpha bits, not the check for alpha in + texture format. + +2008-05-20 Øyvind Kolås + + Decouple actor opacity from fill opacity in ClutterRectangle (fixes + race when both are set from clutter script also makes it more + consistent with the behavior of other actors.) + + * clutter/clutter-rectangle.c: (clutter_rectangle_set_color): stop + setting the opacity of the actor from the specified color. + (clutter_rectangle_paint): combine the absolute opacity of the actor + with the alpha of the color when painting. + +2008-05-20 Ivan Leben + + * clutter/cogl/gles/cogl-texture.c: + (cogl_texture_download_from_gl:) Implemented a workaround + for missing alpha framebuffer channel. There are still + some issues with detecting whether alpha is present in the + framebuffer. See comments in code. Test-cogl-tex-getset now + successfully retrieves a RGBA texture image data. + +2008-05-19 Ivan Leben + + * clutter/cogl/gles/cogl-texture.c: + (cogl_texture_download_from_gl:) Store old blending factors + and restore them when done. The lack of ability to retrieve + the alpha channel now more noticable in test-cogl-tex-getset + since the edges of the hand are not antialiased. + + * clutter/cogl/gl(es)/cogl-internal.h: Declare + cogl_blend_func to avoid "implicit implementation" compile + warning. + +2008-05-19 Ivan Leben + + * clutter/cogl/gl(es)/cogl.c: New internal function + cogl_blend_func caches blending setup much like cogl_enable + does with the enable flags. This separates blending factors + setup from the enable/disable operation in preparation of + the texture image retrieval fix for alpha channel on GLES. + (cogl_enable:) Does not modify blending factors anymore. + + * clutter/cogl/gl(es)/cogl-context.h: CoglContext holds two + new variables to cache blending src and dst factors. + + * clutter/cogl/gl(es)/cogl-context.c: + (cogl_create_context:) Initialize blending factors. + + * clutter/cogl/gles/cogl-texture.c: + (cogl_texture_download_from_gl:) Set blending factors to + CGL_ONE, CGL_ZERO which fixes the slighlty improper behavior + where source colour was actually multiplied with its alpha + value in the result (not noticable on current tests). + +2008-05-19 Emmanuele Bassi + + * clutter/eglx/Makefile.am: Fix the INCLUDE directives to + properly include the X11 backend headers. + + * clutter/glx/Makefile.am: Add the libclutter-x11.la static + library to the LDADD directives. + +2008-05-19 Tomas Frydrych + + * clutter/x11/clutter-x11.h: + * clutter/glx/clutter-glx.h: + Include texture pixmap headers. + +2008-05-16 Neil Roberts + + * clutter/eglx/clutter-stage-egl.c (clutter_stage_egl_realize): + Fix name of parent class variable which otherwise breaks the + build. + +2008-05-16 Neil Roberts + + Use the Mesa headers instead of depending on GLee for Win32 + builds. + + * configure.ac: No longer check for GLee + + * clutter/cogl/gl/cogl-defines.h.in: Don't bother including GLee.h + + * build/mingw/mingw-cross-compile.sh: No longer downloads libGLee + but downloads the Mesa library instead and installs the headers + from that. Fixed the libpng version. + +2008-05-16 Tomas Frydrych + + * clutter/glx/Makefile.am: + * clutter/x11/Makefile.am: + Install glx and x11 specific includes into clutter/glx and + clutter/x11 so that header files that include glx/*.h or x11/*.h + when installed. + +2008-05-16 Neil Roberts + + * clutter/win32/clutter-event-win32.c (message_translate): Fix + signedness of old_xpos and old_ypos to get rid of compiler + warnings. + + * clutter/win32/clutter-backend-win32.c + (clutter_backend_win32_get_features): Cast the result of + glGetString to a signed char pointer to avoid compiler warnings. + +2008-05-15 Neil Roberts + + * clutter/win32/clutter-stage-win32.c: + * clutter/win32/clutter-backend-win32.c: Reflect changes to the + GLX/X11 backend in revisions 2708-2709 and 2713-2715 which + simplify the backend a little. + +2008-05-15 Emmanuele Bassi + + * clutter/x11/clutter-backend-x11.c: + * clutter/clutter-event.h: + * clutter/clutter-feature.h: + * clutter/clutter-fixed.c: + * clutter/clutter-model.h: Fix documentation. + + * clutter/eglnative/clutter-backend-egl.[ch]: + * clutter/eglnative/clutter-event-egl.c: Add the same solution + used for the SDL backend in order to get the time of an event. + This should fix the motion event throttling and the click count + on button press. (#906) + + * tests/test-pixmap.c (create_pixmap), (main): Fix preprocessor + directives. + +2008-05-14 Emmanuele Bassi + + * tests/test-threads.c: Add a "progress bar" actor and + make the test take less amount of time to complete. + +2008-05-14 Emmanuele Bassi + + * tests/test-events.c: Clean up a bit, and print out more + messages when pressing one of the rectangles. + + * tests/test-threads.c: Be more verbose in the console, and + apply another behaviour on the rectangle, to show that we + are not blocking. + +2008-05-14 Øyvind Kolås + + * clutter/cogl/gles/cogl.c: (_cogl_features_init): do not set + COGL_FEATURE_TEXTURE_READ_PIXELS, since it is not available. + +2008-05-14 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/clutter-main.c: + * clutter/clutter-private.h: + Rejid Øyvind's previous commit a little moving more into + clutter-main.c and using ClutterContext. + Also Refactor clutter_init & clutter_init_with_args to share + same core init code. + +2008-05-13 Øyvind Kolås + + Made it possible to do picking when the colors stored in the + framebuffer are only approximately the correct value. + + * clutter/clutter-actor.c: + (init_bits): initialize constants about how many bits are + available/will be used for r,g,b components. + (_clutter_pix_to_id): now own function, compute an id from a + pixel into its own function (used from _clutter_do_pick). + (_clutter_id_to_col): now own function, computes the color to use for + a given id. + (clutter_actor_paint): use clutter_id_to_col. + * clutter/clutter-main.c: + (_clutter_do_pick): use _clutter_pix_to_id + (clutter_main): re-enable invocation of fruity app shell. + +2008-05-13 Emmanuele Bassi + + * clutter/fruity/clutter-stage-fruity.c: + (clutter_stage_egl_show), (clutter_stage_egl_hide): Don't chain + up and set flags, as it is not needed anymore. + + (clutter_stage_egl_realize): Set the REALIZED flag. + + * clutter/eglnative/clutter-stage-egl.c: + (clutter_stage_egl_show), (clutter_stage_egl_hide): Don't chain + up and set flags, as it is not needed anymore. + +2008-05-13 Emmanuele Bassi + + * clutter/glx/clutter-stage-glx.c: + (clutter_stage_glx_unrealize): Move the shaders release from here... + + * clutter/glx/clutter-backend-glx.c: + (clutter_backend_glx_dispose): ... to here. Shaders should be + released when the GL context is being destroyed, and that only + happens when the backend is being disposed, now that we support + multiple stages. + +2008-05-13 Emmanuele Bassi + + * clutter/clutter-backend.c: + (_clutter_backend_create_stage): Call _clutter_stage_set_window() + ourselves, thus removing yet another action that backends must + implement and might get wrong; also cuts a backend-agnostic piece + of code duplication. + + * clutter/eglnative/clutter-backend-egl.c: + (clutter_backend_egl_create_stage): Update the EGL native backend. + + * clutter/eglx/clutter-backend-egl.c: + (clutter_backend_egl_create_stage): Update the EGLX backend. + + * clutter/fruity/clutter-backend-fruity.c: + (clutter_backend_egl_create_stage): Update the fruity backend + + * clutter/glx/clutter-backend-glx.c: + (clutter_backend_glx_create_stage): Update the GLX backend. + + * clutter/sdl/clutter-backend-sdl.c: + (clutter_backend_sdl_create_stage): Update the SDL backend. + + * HACKING.backends: Update the ::create_stage() description. + +2008-05-13 Emmanuele Bassi + + * clutter/x11/clutter-event-x11.c (event_translate): Remove the + cheap Expose event compression, as it seems to play games when a + composite manager is running. It's also not really needed, as + the redraw queue will avoid redraws too close to each other + anyway. + + * clutter/x11/clutter-stage-x11.c: + (clutter_stage_x11_show), (clutter_stage_x11_hide): Do not chain + up just to set the flags. This fixes a critical warning coming + from ClutterActor::hide() default implementation. + +2008-05-13 Ivan Leben + + * clutter/cogl/gl/cogl-defines.h.in: + Fix GL function prototypes on OS X by #definining APIENTRY and + APIENTRYP if missing. + +2008-05-12 Ivan Leben + + * clutter/cogl/gl/cogl-defines.h.in: + Defined GL extension functions used by Cogl inside the COGL_ + namespace. + + * clutter/cogl/gl/cogl-context.h: + * clutter/cogl/gl/cogl.c: + Use COGL_ extension function prototypes instead of relying + on glext.h to define them. Should fix the mac compilability + bug, but haven't tested it yet. + +2008-05-12 Matthew Allum + + * clutter/x11/clutter-x11-texture-pixmap.c: + * configure.ac: + * tests/Makefile.am: + Remove the XComposite dep from Clutter itself, just use + in test-pixmap (if available) + +2008-05-12 Emmanuele Bassi + + Rework the stage wrapper/implementation relation: remove + duplicated code and all the bookkeeping from the backends into + ClutterStage whenever possible, to reduce the amount of work a + backend must do (and possibly get wrong). Thanks to Tommi + Komulainen. + + * clutter/clutter-main.c: + (clutter_init_with_args), (clutter_init): Realize the default + stage after creation. The default stage is special, because we + use it in the initialization sequence. This removes the burden + from the backends and reduces the things a backend can get + wrong. + + * clutter/clutter-stage.c: + (clutter_stage_show): Make sure to realize the implementation if + it hasn't been realized yet. + + (clutter_stage_realize): Set the REALIZED flag and call + clutter_stage_ensure_current() if the implementation was + successfully realized. + + (clutter_stage_unrealized): Call clutter_stage_ensure_current() + on unrealize. + + * clutter/glx/clutter-backend-glx.c: + (clutter_backend_glx_create_stage): Do not realize the stage anymore + when creating it, and let the normal realization sequence take + place. + + (clutter_backend_glx_ensure_context): Trap for X11 errors. + + * clutter/glx/clutter-stage-glx.c: + (clutter_stage_glx_realize): Chain up to the X11 implementation + so that we can set up the window state (title, cursor visibility) + when we actually have a X window. Also, do not call + clutter_stage_ensure_current(), and rely on the wrapper to do + it for us. This means we can drop setting the REALIZED flag on + the wrapper. + + (clutter_stage_glx_unrealize): Do not call + clutter_stage_ensure_current() ourselves, and rely on the wrapper + to do it for us. + + * clutter/x11/clutter-stage-x11.c: + (set_wm_title), (set_cursor_visible): Move the WM title and + cursor visibility code inside their own functions. + + (clutter_stage_x11_realize): Set the window title and whether the + cursor is visible or not after realizing the stage. + + (clutter_stage_x11_set_cursor_visible), + (clutter_stage_x11_set_title): Call set_wm_title() and + set_cursor_visible(). + + (clutter_stage_x11_finalize): Free the title string. + + * clutter/x11/clutter-stage-x11.h: Save more of the stage state, + so that we can set it even when the stage hasn't been realized + yet. + + * clutter/eglnative/clutter-backend-egl.c: + (clutter_backend_egl_create_stage): + * clutter/eglnative/clutter-stage-egl.c: + (clutter_stage_egl_unrealize), + (clutter_stage_egl_realize): Update the eglnative backend. + + * clutter/eglx/clutter-backend-egl.c: + (clutter_backend_egl_ensure_context), + (clutter_backend_egl_create_stage): + * clutter/eglx/clutter-stage-egl.c: + (clutter_stage_egl_unrealize), + (clutter_stage_egl_realize): Update the eglx backend. + + * clutter/sdl/clutter-backend-sdl.c: + (clutter_backend_sdl_create_stage): + * clutter/sdl/clutter-stage-sdl.c: + (clutter_stage_sdl_realize): Update the sdl backend. + + * clutter/fruity/clutter-backend-fruity.c: + (clutter_backend_fruity_create_stage): + * clutter/sdl/clutter-stage-fruity.c: + (clutter_stage_fruity_realize): Update the fruity backend. + + * tests/test-multistage.c (on_button_press): Bail out if + clutter_stage_new() returns NULL. + + * HACKING.backends: Update backend writing documentation. + +2008-05-12 Robert Bragg + + * clutter/clutter-timeline.c: + Adds clutter-timeline documentation RE: r2337, explaining + the current timeline semantics. + +2008-05-12 Emmanuele Bassi + + * HACKING.backends: Update documentation. + + * clutter/glx/clutter-stage-glx.c: + (clutter_stage_glx_realize): Avoid setting more flags than + necessary. + +2008-05-09 Neil Roberts + + * clutter/clutter-frame-source.c (clutter_frame_source_add) + (clutter_frame_source_add_full): Add gtk-doc and rename the + 'function' parameter to 'func'. + + * clutter/clutter-frame-source.h: Rename the 'function' parameters + to 'func'. + + * clutter/Makefile.am (source_h): Make clutter-frame-source.h a + public header. + + * clutter/clutter-main.c (clutter_threads_add_frame_source_full): + Improve gtk-doc + +2008-05-09 Emmanuele Bassi + + * clutter/clutter-script-private.h: Add a flag for the + default stage. + + * clutter/clutter-script.c: + (json_object_end): If the "type" member is "ClutterStage" + and we have a "is-default" member set to true then this + is the default stage. + + (clutter_script_construct_object): Special case the default + stage instead of each ClutterStage. + + (object_info_free): Ditto as above. + + * tests/test-script.json: Test the creation of a non-default + stage and the ::destroy handler to quit. + +2008-05-09 Emmanuele Bassi + + Bug #908 - Support transform from G_TYPE_INT to ClutterUnit + + * clutter/clutter-units.c: + (clutter_value_transform_int_unit), + (clutter_unit_get_type): Add GValue transformation function from + integer values to ClutterUnit. (#908) + + (param_unit_validate): Fix validation for ClutterParamSpecUnit; + this allows writable ClutterUnit properties. + + * clutter/clutter-fixed.c: + (clutter_value_transform_int_fixed), + (clutter_value_transform_double_fixed), + (clutter_value_transform_float_fixed): Add GValue transformation + functions from native types (int, double, float) to ClutterFixed. + + (clutter_fixed_get_type): Register the new transformation functions. + + (param_fixed_validate): Fix validation for ClutterParamSpecUnit; + this allows writable ClutterFixed properties. + +2008-05-07 Ivan Leben + + * clutter/cogl/cogl.h.in: + * clutter/cogl/gl(es)/cogl-texture.h: + * clutter/cogl/gl(es)/cogl-texture.c: + cogl_texture_new_* functions take a gboolean auto_mipmap argument. + If TRUE automatic mipmap generation is enabled during the process + of slice texture object creation. + (cogl_texture_new_from_foreign:) now allows mipmap min filter + flags. + + * clutter/clutter-texture.c: + * clutter/glx/clutter-glx-texture-pixmap.c: + * tests/test-cogl-offscreen.c: + * tests/test-cogl-tex-tile.c: + * tests/test-cogl-tex-convert.c: + * tests/test-cogl-tex-polygon.c: + * tests/test-cogl-tex-getset.c: + Pass FALSE for auto_mipmap to cogl_texture_new_*. + + * clutter/pango/pangoclutter-render.c: + (tc_get:) Pass TRUE to cogl_texture_new_with_size and use mipmap + min filter for nicer glyphs at small scales. As a result test-text + has gone all beautiful now. + +2008-05-07 Neil Roberts + + * clutter/clutter-frame-source.h: Added the missing G_BEGIN_DECLS + and G_END_DECLS + +2008-05-07 Emmanuele Bassi + + * clutter/sdl/clutter-backend-sdl.c: + (clutter_backend_sdl_dispose): Destroy the timer that we created... + (clutter_backend_sdl_init): ... here. + + * clutter/sdl/clutter-backend-sdl.h: Add a GTimer for time-based + operations, like the event time. + + * clutter/sdl/clutter-event-sdl.c: + (get_backend_time): Get the elapsed milliseconds for the SDL + backend. + + (_clutter_events_init): Start the timer provided by the backend... + (_clutter_events_uninit): ... and the stop it. + + (key_event_translate), (event_translate): Use the backend time + to fill out the time field of the event structures. This fixes + the motion notification throttling on the SDL backend. + +2008-05-06 Matthew Allum + + * clutter/glx/clutter-glx-texture-pixmap.c: + * clutter/x11/clutter-x11-texture-pixmap.c: + More cleanups, safety additions. + +2008-05-05 Øyvind Kolås + + * clutter/cogl/gl/cogl-primitives.c: + * clutter/cogl/gles/cogl-primitives.c: + * clutter/cogl/common/cogl-primitives.c: moved declaration of + gegl_rectangle and gegl_rectanglex here to satisfy linking + requirements when building the fruity backend. + +2008-05-05 Øyvind Kolås + + * clutter/cogl/cogl.h.in: api review touch ups. + * clutter/cogl/common/cogl-primitives.c: api review touch ups. + * clutter/cogl/gl/cogl-primitives.c: (cogl_path_fill), + (cogl_path_stroke): indentation. + * clutter/cogl/gles/cogl-primitives.c: + (_cogl_path_fill_nodes): free allocated resources. + + * tests/test-cogl-primitives.c: updated to new API, added rotation to + test to show that cogl renders paths correct under perspective + distortion. + +2008-05-02 Emmanuele Bassi + + Bug #900 - clutter_actor_lower() and friends do not queue redraw + + * clutter/clutter-actor.c: + (clutter_actor_raise), + (clutter_actor_lower): Queue a redraw after raising and lowering + and actor in the paint order stack. (#900) + +2008-05-01 Richard Purdie + + * configure.ac: + Set CLUTTER_COGL for fruity. + +2008-05-01 Emmanuele Bassi + + Build fixes for the SDL flavour. + + * clutter/sdl/clutter-backend-sdl.c: Remove an unused function. + + * clutter/sdl/clutter-event-sdl.c: + (clutter_event_dispatch): Properly cast the stage pointer. + + * clutter/sdl/clutter-stage-sdl.c: + (clutter_stage_window_iface_init): Remove the draw_to_pixbuf() + stub and assignment. + +2008-05-01 Richard Purdie + + * configure.ac: + Fix up fruity flavour configure option. + +2008-05-01 Øyvind Kolås + + * clutter/cogl/gles/cogl-primitives.c: (_cogl_path_fill_nodes): draw + the rasterized scanlines as an array of triangles. + +2008-05-01 Emmanuele Bassi + + * clutter/clutter-behaviour.c: + (clutter_behaviour_remove_all): Disconnect the ::destroy + handler when removing all actors, to match the behaviour + of clutter_behaviour_remove(). + +2008-05-01 Matthew Allum + + * clutter/glx/clutter-glx-texture-pixmap.c: + * tests/test-pixmap.c: + Fix up texture-pixmap, now works. + Thanks to Neil for spotting we were actually using + wrong texture type in fbconfig (COGL change). + +2008-04-30 Øyvind Kolås + + * clutter/cogl/gles/cogl-primitives.c: (_cogl_path_fill_nodes): + keep track of direction we are drawing in and make sure we leave + two intersection points when we have changed direction. + +2008-04-30 Øyvind Kolås + + * clutter/cogl/gles/cogl-primitives.c: (_cogl_path_fill_nodes): + scanline rasterizer fallback for GLES without working stencil + buffer (would benefit from optimization/smarter choice of + datastructures). + +2008-04-30 Emmanuele Bassi + + * clutter/clutter-effect.c: + (clutter_effect_closure_destroy): Do not remove the actor + from the behaviour; the behaviour is an internal detail of the + effect, and it will remove the actors anyway when finalized + when g_object_unref() is called. This should guard against + actors being destroyed while an effect is running. + +2008-04-30 Øyvind Kolås + + * clutter/cogl/common/Makefile.am: + * clutter/cogl/common/cogl-primitives.c: + * clutter/cogl/common/cogl-primitives.h: + * clutter/cogl/gl/Makefile.am: + * clutter/cogl/gl/cogl-primitives.c: + * clutter/cogl/gl/cogl-primitives.h: + * clutter/cogl/gles/Makefile.am: + * clutter/cogl/gles/cogl-primitives.c: + * clutter/cogl/gles/cogl-primitives.h: moved duplicated code to the + common directory. + +2008-04-30 Robert Bragg + + * clutter/clutter/x11/clutter-x11-texture-pixmap.c: + In _update_area_real with depth=16 we weren't setting up the alpha + channel. + +2008-04-29 Matthew Allum + + * clutter/glx/Makefile.am: + * clutter/x11/Makefile.am: + Revert header install locations (Mistake in previous commit, + fixes #898) + +2008-04-29 Neil Roberts + + * clutter/clutter-actor.c (clutter_actor_move_anchor_point): The + actor position was being moved in the wrong direction. Perhaps + this was a cut-and-paste bug from move_anchor_point_from_gravity + because in that function ax and ay represent the old anchor + position, but in this function they represent the new. + +2008-04-29 Matthew Allum + + * clutter/glx/Makefile.am: + * clutter/glx/clutter-glx-texture-pixmap.c: + * clutter/glx/clutter-glx-texture-pixmap.h: + * clutter/x11/Makefile.am: + * clutter/x11/clutter-x11-texture-pixmap.c: + * tests/test-pixmap.c: + Commit newer x11 texture pixmap stuff (optionally using SHM). + Also seemingly still broken overhauled glx-texture-pixmap + (code by Robert and myself) + + * configure.ac: + Minor formatting change. + +2008-04-29 Neil Roberts + + Removed COGLhandle and changed shader and program functions to be + wrapped in reference-counted CoglHandles instead. + + * clutter/cogl/gl/cogl-shader.c: + * clutter/cogl/gl/cogl-shader.h: + * clutter/cogl/gl/cogl-program.c: + * clutter/cogl/gl/cogl-program.h: + New files to hold the shader and program functions. + + * clutter/cogl/gl/cogl.c: Removed shader and program functions. + + * clutter/cogl/common/cogl-handle.h: New header to define + COGL_HANDLE_DEFINE which helps build functions to create + reference-counted handles. This reduces the amount of duplicated + code. + + * clutter/cogl/gl/cogl-texture.c: + * clutter/cogl/gles/cogl-texture.c: + * clutter/cogl/gl/cogl-fbo.c: Converted to use COGL_HANDLE_DEFINE + from cogl-handle.h to avoid duplicating some of the common code. + + * clutter/cogl/gles/cogl-defines.h.in: + * clutter/cogl/gl/cogl-defines.h.in: Removed COGLhandle + + * clutter/cogl/gl/cogl-context.h: Added handle arrays for programs + and shaders. + + * clutter/cogl/gl/cogl-context.c (cogl_create_context): Added + initialisers for shader_handles and program_handles. + (cogl_destroy_context): Added calls to g_array_free for all handle + arrays. + + * clutter/cogl/gl/Makefile.am (libclutter_cogl_la_SOURCES): Added + cogl-{program,shader}.{c,h} + + * clutter/cogl/common/Makefile.am + (libclutter_cogl_common_la_SOURCES): Added cogl-handle.h + + * clutter/cogl/gles/cogl.c: + * clutter/cogl/cogl.h.in: Programs and shaders are now wrapped in + CoglHandles instead of COGLhandles. cogl_program_destroy and + cogl_shader_destroy is now replaced with cogl_program_unref and + cogl_shader_unref. cogl_program_ref and cogl_shader_ref are also + added. + + * clutter/clutter-shader.c: Converted to use CoglHandles for the + programs and shaders instead of COGLhandles. + +2008-04-29 Øyvind Kolås + + * clutter/cogl/cogl.h.in: renaming of API's in cogl to make the + primitives and path API a bit smaller and more resembling cairo. + * clutter/cogl/gl/cogl-primitives.c: + * clutter/cogl/gles/cogl-primitives.c: + * clutter/cogl/gles/cogl.c: + + * clutter/clutter-actor.c: + * clutter/clutter-rectangle.c: + * tests/test-cogl-offscreen.c: + * tests/test-cogl-primitives.c: + * tests/test-cogl-tex-convert.c: + * tests/test-cogl-tex-foreign.c: + * tests/test-cogl-tex-getset.c: + * tests/test-cogl-tex-tile.c: updated according to changes in cogl. + +2008-04-29 Robert Bragg + + * clutter/x11/clutter-x11-texture-pixmap.c: + In clutter_x11_texture_pixmap_set_pixmap, dont assume that the actor + size should be changed to match the size of the pixmap. + +2008-04-29 Robert Bragg + + * clutter/cogl/gles/cogl-texture.c: + Replaces an malloc call with g_malloc. + +2008-04-29 Robert Bragg + + * clutter/configure.ac: + When looking for a GLES 1 library, also try the name "GLESv1_CM". + + This also reduces the xfixes version requirement to v3, since we dont + need support for Show/HideCursor. + +2008-04-28 Neil Roberts + + Fixed 'make dist' + + * clutter/cogl/Makefile.am (EXTRA_DIST): Distribute cogl.h.in + instead of cogl.h + (DIST_SUBDIRS): Added common folder + + * clutter/cogl/gl/Makefile.am (libclutter_cogl_la_SOURCES): Remove + cogl-defines.h and use the right location for cogl-defines.gl.h + (EXTRA_DIST): Distribute cogl-defines.h.in + + * clutter/cogl/gles/Makefile.am (libclutter_cogl_la_SOURCES): + Remove cogl-defines.h and use the right location for + cogl-defines.gles.h + (EXTRA_DIST): Distribute cogl-defines.h.in + + * clutter/Makefile.am (DIST_SUBDIRS): Add fruity + +2008-04-28 Neil Roberts + + * clutter/cogl/cogl.h.in (COGL_A_BIT): Added the missing comma + after COGL_PIXEL_FORMAT_G_8 + +2008-04-28 Emmanuele Bassi + + * autogen.sh: Do not just touch the gtk-doc.make file, if we + could not find gtkdocize, but echo an empty EXTRA_DIST into it + so that the automake won't complain later on. + +2008-04-28 Øyvind Kolås + + * clutter/cogl/cogl.h.in: reindented. + +2008-04-28 Emmanuele Bassi + + * clutter/clutter-actor.c: + (parse_rotation_array), + (clutter_actor_set_custom_property): Use the internal, unit based + rotation setter when parsing the rotation from a ClutterScript + file. + + (clutter_geometry_copy), + (clutter_vertex_copy), + (clutter_actor_box_copy): Use the more efficient g_slice_dup(). + + (clutter_actor_get_stage): Add documentation. + + * clutter/clutter-group.c: Documentation fix. + +2008-04-28 Øyvind Kolås + + * clutter/cogl/cogl.h.in: moved the documentation of the cogl + primitives to the main public header. + * clutter/cogl/gl/cogl-primitives.c: from here .. + * clutter/cogl/gles/cogl-primitives.c: .. _and_ here. + +2008-04-28 Øyvind Kolås + + * clutter/cogl/cogl.h.in: added documentation. + +2008-04-28 Emmanuele Bassi + + * clutter/clutter-units.c (param_unit_init): Use the right + macros to set the default minimum and maximum values. + + * clutter/clutter-fixed.c (param_fixed_init): Ditto as above. + +2008-04-28 Matthew Allum + + * autogen.sh: + Dont display 'make' if configure fails. + * configure.ac: + Add new --with-gles version option for eventual GLES2 support + Also minor tidyups. + +2008-04-28 Neil Roberts + + * tests/test-cogl-tex-polygon.c: Added buttons to toggle whether + slicing and linear filtering is enabled. By default slicing is + disabled to help test on GL ES. + +2008-04-28 Neil Roberts + + * tests/Makefile.am (INCLUDES): Added $(top_srcdir)/clutter to the + include path. Otherwise the tests will fail to build trying to + include "json/json-types.h" when building out-of-tree. + +2008-04-28 Emmanuele Bassi + + * clutter/eglnative/clutter-backend-egl.c: + (clutter_backend_egl_redraw): Whitespace fixes. + + * clutter/eglnative/clutter-stage-egl.c: + (clutter_stage_egl_hide): Indentation fixes. + + (clutter_stage_egl_realize): Use g_critical() to report failure, + unset the flags and bail out instead of continuing the realization + of the stage. + +2008-04-25 Neil Roberts + + Merged in the clutter-ivan branch which contained the new public + COGL API. + +2008-04-25 Emmanuele Bassi + + * clutter/sdl/clutter-stage-sdl.[ch]: Port the SDL stage to + the new stage implementation API. + + * clutter/sdl/clutter-backend-sdl.[ch]: Port the SDL backend + to the new backend API. + + * clutter/sdl/clutter-event-sdl.c: + (clutter_event_dispatch): Assign the default stage as the + origin of the event. + +2008-04-24 Emmanuele Bassi + + * configure.ac: Add the --with-json configure switch to + allow building Clutter with the external dependency on + the system JSON-GLib; the default is to use the internal + copy unless explicitly asked to check. + +2008-04-24 Emmanuele Bassi + + * Makefile.am: Add HACKING.backends to the EXTRA_DIST. + +2008-04-24 Emmanuele Bassi + + * HACKING.backends: Add documentation on how to write a + backend for Clutter. + +2008-04-24 Emmanuele Bassi + + * clutter/eglnative/clutter-backend-egl.c: + (clutter_backend_egl_create_stage): Fix checks using a + non assigned member of the ClutterBackendEGL structure. + +2008-04-23 Emmanuele Bassi + + * clutter/eglnative/clutter-backend-egl.[ch]: + * clutter/eglnative/clutter-stage-egl.[ch]: + * clutter/eglnative/clutter-event-egl.c: Port to the new stage + and backend APIs. *WARNING* untested and not compiled. + + * clutter/eglx/clutter-backend-egl.c: + (clutter_backend_egl_init): Set some defaults. + +2008-04-23 Emmanuele Bassi + + * tests/test-script.json: Remove the explicit "visible" + member to test that the visibility of actors is TRUE + by default. + +2008-04-23 Emmanuele Bassi + + * configure.ac: + * clutter/Makefile.am: Do not build the internal JSON-GLib + copy if there is a system installed one. + + * clutter/clutter-json.h: Remove. + + * clutter/clutter-json.h.in: Template for the clutter-json.h + header file, used to opaquely include the JSON-GLib types. + +2008-04-23 Emmanuele Bassi + + * clutter/clutter-actor.c: Document :show-on-set-parent and + the fact that calling clutter_actor_show() and hide() on an + unparented actor will change that property as well as a side + effect. + +2008-04-23 Emmanuele Bassi + + * clutter/clutter-actor.c (clutter_actor_set_property): Use the + internal setter for the rotation center. + +2008-04-23 Emmanuele Bassi + + * clutter/clutter-actor.[ch]: Add units based variant of the + rotation accessors. + +2008-04-23 Emmanuele Bassi + + Bug 892 - Incorrect results using rotation-[center|angle] properties + + * clutter/clutter-actor.c: + (clutter_actor_set_rotation_internal): Inline function for setting + the rotation using fixed point for the angle and units for the + center of rotation. + + (clutter_actor_set_property), + (clutter_actor_set_rotationx): Use the internal setter to avoid + loss of precision and too many conversions to and from units. + +2008-04-23 Emmanuele Bassi + + Bug 891 - assertion failed when test-behave exits + + * clutter/clutter-behaviour.c: + (remove_actor_on_destroy), + (clutter_behaviour_apply), + (clutter_behaviour_remove): Remove the actor if it gets + destroyed before the behaviour. + +2008-04-18 Emmanuele Bassi + + Bug #884 - Add clutter_alpha_set_closure + + * clutter/clutter-alpha.[ch]: Add clutter_alpha_set_closure(), + a GClosure variant of clutter_alpha_set_func(), and reimplement + the latter as a special case of the former. (#884, Xan López) + +2008-04-18 Neil Roberts + + * clutter/clutter-timeline.c (clutter_timeline_get_progressx): + Changed to use clutter_qdiv instead of CLUTTER_FIXED_DIV otherwise + it can't cope with timelines with more than 255 frames. + +2008-04-17 Emmanuele Bassi + + * clutter/clutter-frame-source.c: Small coding style fixes. + +2008-04-17 Neil Roberts + + Applied patch from bug #881 + + * clutter/clutter-frame-source.h: + * clutter/clutter-frame-source.c: + New files that contain a replacement for g_timeout that try to + cope with system delays. + + * clutter/Makefile.am: Added clutter-frame-source.{c,h} + + * clutter/clutter-timeline.c (timeout_add): Use a frame source + instead of a g_timeout. + + * clutter/clutter-main.c (clutter_threads_add_frame_source_full) + (clutter_threads_add_frame_source): New public functions to wrap a + frame source and grab the Clutter mutex. + + * clutter/clutter-timeout-pool.c: Now calculates the timeout + expiration times in the same way as a frame source does so that it + counts time in frame intervals instead of setting the next + expiration time as an offset from the current time. + +2008-04-17 Emmanuele Bassi + + * clutter/clutter-fixed.c: + (clutter_value_transform_fixed_int), + (clutter_value_transform_fixed_double), + (clutter_value_transform_fixed_float), + (clutter_fixed_get_type): Add GValue transformation functions + for ClutterFixed; copying a CLUTTER_TYPE_FIXED GValue into + a G_TYPE_FLOAT/G_TYPE_DOUBLE one will automatically transform + the fixed point representation into a floating point one. Also + add the G_TYPE_INT transformation function to do a plain + fixed->int copy. + + * clutter/clutter-units.c: + (clutter_value_transform_unit_int), + (clutter_unit_get_type): Add a unit->int transformation function. + +2008-04-17 Emmanuele Bassi + + * clutter/clutter-fixed.c (clutter_value_get_fixed): Fix typo + in the function name. + +2008-04-17 Emmanuele Bassi + + * clutter/clutter-units.c (clutter_value_get_unit): Fix typo + in the function name. + +2008-04-17 Emmanuele Bassi + + * HACKING: Amend coding style and tenets, as it is now possible + to install and use unit based properties in a safe way. + +2008-04-17 Emmanuele Bassi + + * clutter/clutter-units.h: + * clutter/clutter-fixed.h: Add boundaries for fixed point + and units values. + + * doc/reference/clutter-sections.txt: Update the documentation. + +2008-04-17 Emmanuele Bassi + + * autogen.sh: Try to continue even if we don't have gtk-doc + installed; this will obviously won't work if you don't pass + --disable-docs --disable-gtk-doc to autogen.sh as well. + +2008-04-17 Emmanuele Bassi + + * clutter/clutter-fixed.[ch]: Add a ClutterFixed fundamental + type, and wrappers for storing it into GValues; also add a + GParamSpec subclass for defining parameters holding + ClutterFixed values. This allows creating GObject properties + using fixed point values. + + * doc/reference/clutter-sections.txt: Document the newly + added API. + +2008-04-17 Emmanuele Bassi + + * clutter/Makefile.am: Add clutter-units.c + + * clutter/clutter-units.[ch]: Add a ClutterUnit fundamental + type, and wrappers for storing it into GValues; also add a + GParamSpec subclass for defining parameters holding ClutterUnit + values. This allows creating GObject properties using units. + + * doc/reference/clutter-sections.txt: Document the newly + added API. + +2008-04-15 Matthew Allum + + Work related to #873; + + * clutter/glx/clutter-backend-glx.c: + * clutter/glx/clutter-backend-glx.h: + * clutter/x11/clutter-x11-texture-pixmap.c: + * clutter/x11/clutter-x11-texture-pixmap.h: + General cleanup of texture pixmap code, adding; + - Pixmap dimentions and depth now auto probed, read only props. + - More X safety traps + - Add support for optionally tracking damage and automatically + updating texture. + + * clutter/glx/clutter-glx-texture-pixmap.c: + * clutter/glx/clutter-glx-texture-pixmap.h: + General cleanup and some safety additions. Needs more work so + 'proper' subclass - dependent on new COGL. + + * clutter/x11/clutter-backend-x11.c: (clutter_x11_remove_filter): + Invert g_return_if check. + + * configure.ac: + Pull in XComposite and XDamage (at least for now) + + * tests/Makefile.am: + * tests/test-pixmap.c: + Add a modified test from Johan for above. + +2008-04-15 Neil Roberts + + Added support for foreign windows to the Win32 backend. + + * clutter/win32/clutter-stage-win32.c + (clutter_stage_win32_request_coords): Don't resize foreign + windows. + (clutter_stage_win32_unrealize): Don't destroy foreign windows. + (clutter_stage_win32_init): Added initialiser for is_foreign_win. + (clutter_win32_get_stage_from_window): Resort to looking in the + stage list if the window isn't the right window class so that it + can still find stages with foreign windows. + (clutter_win32_set_stage_foreign): New public function to set a + foreign window for a stage. + + * clutter/win32/clutter-event-win32.c + (clutter_win32_disable_event_retrieval): New public function to + disable event retrieval. + (message_translate): Don't handle WM_SIZE or WM_MOVE for foreign + windows. + + * clutter/win32/clutter-backend-win32.h (struct + _ClutterBackendWin32): Added a flag to disable event retrieval + + * clutter/win32/clutter-backend-win32.c + (clutter_backend_win32_ensure_context): Update debug note to + include whether the stage is foreign or not. + +2008-04-15 Øyvind Kolås + + * clutter/clutter-actor.c: (clutter_actor_set_shader_param): queue a + redraw when a shader_param is set. Normalized some gtk-doc syntax in + some of the api documentation. + +2008-04-15 Øyvind Kolås + + * clutter/clutter-group.c: fixed typo in docs. + +2008-04-14 Matthew Allum + + * clutter/eglx/clutter-stage-egl.c: + Actually set wm protocols on eglx stage windows. Fixes issues with + cloising stages and cleanup. + +2008-04-14 Matthew Allum + + * clutter/cogl/gles/cogl.c: (cogl_color): + Disable use of color4ub, issues with latest MBX SDL (#857) + + * clutter/eglx/clutter-backend-egl.c: + * clutter/eglx/clutter-stage-egl.c: + * configure.ac: + Fixup for the eglx backend to work with new backend/multistage code. + Some issues remain in destroying stages. + +2008-04-14 Neil Roberts + + Bug #853 + + * clutter/clutter-timeline.c (clutter_timeline_get_progressx): Fix + arithmetic for calculating the reverse progress when the timeline + is backward. (Should subtract from one instead of taking the + reciprocal). + +2008-04-13 Neil Roberts + + Upgraded the Win32 backend to work with the multi-stage + subclassing code. + + * clutter/win32/clutter-stage-win32.h: + * clutter/win32/clutter-stage-win32.c: Now inherits from + ClutterGroup and implements ClutterStageWindow instead of + inheriting directly from ClutterStage. + + * clutter/win32/clutter-event-win32.c (message_translate): Now + takes an extra parameter to return whether DefWindowProc should be + called. This is needed to prevent the default WM_CLOSE handler + from destroying the window. + + * clutter/win32/clutter-backend-win32.c + (clutter_backend_win32_dispose): Destroy all of the stages using + g_slist_foreach as per bug #871. Now also destroys the GL context. + (clutter_backend_win32_get_features): Added assertions to ensure + there is a valid GL context. + (clutter_backend_win32_ensure_context): Accepts NULL stage. Gets + implementation pointer from the stage. + +2008-04-11 Emmanuele Bassi + + * clutter/clutter-container.c: + (clutter_container_get_type): Relax the precondition on the + implementations of ClutterContainer from ClutterActor to + GObject. + +2008-04-11 Emmanuele Bassi + + * README: Add a note about the Shader API changes. + + * clutter/clutter-deprecated.h: Add deprecation symbols. + + * clutter/clutter-shader.[ch]: Rename the :bound read-only + property to :compiled. Also rename clutter_shader_bind() + and clutter_shader_is_bound() to clutter_shader_compil() and + clutter_shader_is_compiled(), respectively. + + * clutter/glx/clutter-stage-glx.c: + (clutter_stage_glx_unrealize): Update after + clutter_shader_release_all() rename. + + * tests/test-shader.c (button_release_cb), (main): Update. + +2008-04-10 Emmanuele Bassi + + * clutter/eglx/clutter-backend-egl.c: + (clutter_backend_egl_ensure_context): Sync up with the GLX + backend. + + (clutter_backend_egl_create_stage): Dumb compilation fix. + + * clutter/glx/clutter-backend-glx.c: + (clutter_backend_glx_create_stage): Unref the stage if we are + erroring out. + +2008-04-10 Emmanuele Bassi + + * clutter/eglx/clutter-stage-egl.c: + (clutter_stage_egl_realize): Sync up with the GLX backend. + +2008-04-09 Emmanuele Bassi + + * clutter/Makefile.am: Update the regular expression to match + all the namespaces we actually use. Thanks to Neil Roberts for + spotting this. A make distclean is needed. + + * clutter/cogl/gl/Makefile.am: + * clutter/cogl/gles/Makefile.am: + * clutter/json/Makefile.am: + * clutter/pango/Makefile.am: Revert previous commit. + +2008-04-09 Emmanuele Bassi + + * clutter/cogl/Makefile.am: + * clutter/cogl/gl/Makefile.am: + * clutter/cogl/gles/Makefile.am: + * clutter/json/Makefile.am: + * clutter/pango/Makefile.am: Fix the visibility of all the + symbols, for the main library and the statically linked ones. + +2008-04-09 Emmanuele Bassi + + * autogen.sh: Clean up a bit + + * clutter/clutter-fixed.[ch]: + (clutter_double_to_fixed), + (clutter_double_to_int), + (clutter_double_to_uint): Make these functions public, as they + are expanded by their respective macros. This fixes the errors + from the linker trying to resolve their name. + +2008-04-09 Neil Roberts + + Applied patch from bug #871 + + * clutter/x11/clutter-backend-x11.c (clutter_backend_x11_dispose): + Call g_slist_foreach instead of iterating over the stage_manager + list manually when deleting stages. Otherwise the 'next' pointer + of the list node can get corrupted when the actor removes itself + from the list. + + * clutter/clutter-stage.c (clutter_stage_dispose): Call + clutter_actor_unrealize in the dispose handler. This fixes + problems where the dispose handler for the ClutterStageWrapper + can't deselect the GL context until the stage is unrealized. + +2008-04-04 Emmanuele Bassi + + * clutter/clutter-backend.c: Add more debug messages + + * clutter/clutter-stage.h: + * clutter/clutter-stage.c: + (clutter_stage_is_default): Add a function to check if the + stage is the default one. + + * clutter/glx/clutter-backend-glx.c: + * clutter/glx/clutter-stage-glx.c: + * clutter/x11/clutter-stage-x11.c: Keep the stage wrapper + and implementation flags in sync, to ensure that the GL + context is always set. + +2008-04-04 Neil Roberts + + * README: Fixed typo + +2008-04-04 Matthew Allum + + * README: + Add a note on new show-on-set-parent prop and stage subclassing. + +2008-04-04 Emmanuele Bassi + + Bug #864 - Allow instantiating and subclassing of ClutterStage + + * clutter/Makefile.am: Add clutter-stage-window.[ch] + + * clutter/clutter-stage-manager.c: + (_clutter_stage_manager_remove_stage): Do not warn if removing + a stage we don't manage, as we might be invoked multiple times + during a ClutterState dispose sequence. + + * clutter/clutter-actor.c: + * clutter/clutter-backend.[ch]: + * clutter/clutter-main.c: + * clutter/clutter-private.h: + * clutter/clutter-stage.[ch]: Make ClutterStage a proxy actor, + with a private actor implementing the ClutterStageWindow + interface for handling the per-backend realization, painting + and unrealization, plus all the windowing system abstraction. + + * clutter/x11/clutter-event-x11.c: + * clutter/x11/clutter-stage-x11.[ch]: Port the X11 backend + to the new backend and stage API and semantics. + + * clutter/glx/clutter-backend-glx.c: + * clutter/glx/clutter-stage-glx.c: Port the GLX backend to + the new backend and stage API and semantics. + + * clutter/eglx/clutter-backend-egl.[ch]: + * clutter/eglx/clutter-stage-egl.[ch]: Port the EGLX backend + to the new backend and stage API and semantics (untested). + + * tests/test-multistage.c (on_button_press): Rename + clutter_stage_create_new() to clutter_stage_new(). + +2008-04-04 Neil Roberts + + Applied patch from bug #810. + + * clutter/x11/clutter-event-x11.c (event_translate): Set a flag + when resizing the stage from a ConfigureNotify event. + + * clutter/x11/clutter-stage-x11.c + (clutter_stage_x11_request_coords): Don't try to resize the window + again if the flag is set. + (clutter_stage_x11_init): Added initialiser for the flag. + + * clutter/x11/clutter-stage-x11.h (struct _ClutterStageX11): Added + the flag. + +2008-04-04 Matthew Allum + + * clutter/clutter-actor.c: + Remove uneeded stage private member. + Add show-on-set-parent prop and make so by default Actors are + now automatically shown when reparented (#791) + + * clutter/eglx/clutter-backend-egl.c: + * clutter/cogl/gles/cogl.c: + A couple of minor comments. + + * clutter/eglnative/Makefile.am: + Add missing clutter-egl.h header (back port from trunk) + + * tests/test-actors.c: + Modify to take advantage of new show-on-set-parent functionality. + +2008-04-03 Emmanuele Bassi + + * clutter/Makefile.am: Only export symbols matching "^clutter.*", + to avoid exposing the library-private symbols starting with + an underscore. + +2008-04-03 Emmanuele Bassi + + * clutter/clutter-alpha.c: ClutterAlpha is an InitiallyUnowned + subclass. This should fix a lot of leakage. (#860, Neil Roberts) + +2008-04-03 Emmanuele Bassi + + * clutter/glx/clutter-backend-glx.c: + (clutter_backend_glx_get_features): Assert if we don't have a + GL context here or if it's not matched to a drawable. Asserting + might seem too drastic, but if we don't have a valid GL context + here then Clutter will segfault anyway, and I'll take an assert() + over a hard to read, deep in GLX guts backtrace any day (and + twice on a monday). + + * clutter/x11/clutter-backend-x11.c: + (clutter_backend_x11_get_features): No need for a variable here. + +2008-04-01 Matthew Allum + + * clutter/clutter-backend.c: + * clutter/glx/clutter-backend-glx.c: + * clutter/glx/clutter-stage-glx.c: + Allow NULL to be passed to _clutter_backend_ensure_context + which essentially clears GL context. This is hooked into stage + unrealisation. Isn't yet quite bulletproof. + Fixes issues with gtk-embed crasher (thanks to Neil). + +2008-04-1 Robert Bragg + + * clutter/glx/clutter-glx-texture-pixmap.c: + In clutter_glx_texture_pixmap_dispose; trap X errors around + glXDestroyGLXPixmap so we can't die due to BadDrawable errors. + +2008-03-31 Matthew Allum + + * README: + Add notes on new multistage feature. + + * clutter/clutter-stage-manager.c: + Dont ref contained stages. + + * clutter/clutter-stage.c: + Automatically remove stage from stage manager on finalisation. + Cleans up warnings when a stage is destroyed. + + * clutter/clutter-backend.h: + * clutter/glx/clutter-backend-glx.c: + Minor formatting cleanups. + + * clutter/glx/clutter-stage-glx.c: + * configure.ac: + * clutter/clutter-version.h.in: + Add a general CLUTTER_STAGE_TYPE define, should be useful for + evntual stage subclassing and creating with g_object_new() + +2008-03-30 Neil Roberts + + * clutter/win32/clutter-backend-win32.c + (clutter_backend_win32_init): Added a call to + timeBeginPeriod. Without this the frame rates are terrible because + the glib timeouts are not accurate enough. However this requires + Glib >= 2.16.0 to take any effect because of a change in the way + g_poll is implemented. See revision 6597 of glib. + (clutter_backend_win32_finalize): Added a call to timeEndPeriod. + + * configure.ac: Added -lwinmm to the library dependencies for the + Win32 backend. + +2008-03-30 Neil Roberts + + * clutter/win32/clutter-win32.h: + * clutter/win32/clutter-stage-win32.h: + * clutter/win32/clutter-stage-win32.c: + * clutter/win32/clutter-event-win32.c: + * clutter/win32/clutter-backend-win32.h: + * clutter/win32/clutter-backend-win32.c: + Upgraded for multi-stage support. + + * clutter/win32/clutter-stage-win32.c + (clutter_stage_win32_request_coords): Fixed so that it doesn't set + the position or size if it hasn't changed. This was causing + problems when the window was resized using the top left corner. In + that case the window receives resize and move messages separately + which caused the window to flash at a different size or position + while one message was handled before the other. + (clutter_stage_win32_realize): Added PFD_GENERIC_ACCELERATED to + the list of pixel format flags to force it to use hardware + acceleration. + +2008-03-28 Matthew Allum + + * clutter/Makefile.am: + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + * clutter/clutter-backend.c: + * clutter/clutter-backend.h: + * clutter/clutter-debug.h: + * clutter/clutter-event.c: + * clutter/clutter-event.h: + * clutter/clutter-feature.h: + * clutter/clutter-group.h: + * clutter/clutter-main.c: + * clutter/clutter-main.h: + * clutter/clutter-private.h: + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: + * clutter/clutter-stage-manager.c + * clutter/clutter-stage-manager.h + * clutter/clutter-types.h: + * clutter/glx/clutter-backend-glx.c: + * clutter/glx/clutter-backend-glx.h: + * clutter/glx/clutter-stage-glx.c: + * clutter/glx/clutter-stage-glx.h: + * clutter/x11/clutter-backend-x11.c: + * clutter/x11/clutter-backend-x11.h: + * clutter/x11/clutter-event-x11.c: + * clutter/x11/clutter-stage-x11.c: + * clutter/x11/clutter-x11.h: + * tests/Makefile.am: + * tests/test-multistage.c: + Initial commit of multi stage support (mostly a merge from the + clutter-multistage branch). + Note, this commit will break all backends except glx. + +2008-03-26 Neil Roberts + + * clutter/win32/clutter-win32.h: Added gtk-doc documentation for + the Win32 backend section. + + * clutter/win32/clutter-stage-win32.c + (clutter_win32_get_stage_window): Fixed punctuation in the + documentation. + + * README: Added notes about the Win32 backend. + +2008-03-26 Neil Roberts + + * clutter/win32/clutter-event-win32.c (clutter_event_check): + Removed the pointless parameter in the call to check_msg_pending. + (check_msg_pending): Fixed to use PeekMessageW instead of + PeekMessage. + +2008-03-25 Neil Roberts + + Added a native Win32 WGL backend. + + * configure.ac: Added the 'win32' flavour. + + * clutter/cogl/gl/cogl.c (cogl_get_proc_address): Added an ifdef + to use wglGetProcAddress with the Win32 backend. + + * clutter/Makefile.am (DIST_SUBDIRS): Added the win32 directory. + + * clutter/win32/clutter-win32.pc.in: + * clutter/win32/clutter-win32.h: + * clutter/win32/clutter-stage-win32.h: + * clutter/win32/clutter-stage-win32.c: + * clutter/win32/clutter-event-win32.c: + * clutter/win32/clutter-backend-win32.h: + * clutter/win32/Makefile.am: + * clutter/win32/clutter-backend-win32.c: New files. + +2008-03-19 Emmanuele Bassi + + * clutter/clutter-model.[ch]: Add a ::copy() virtual function + for copying iterators. + + * clutter/clutter-list-model.c: + (clutter_list_model_iter_copy), + (clutter_list_model_iter_class_init): Implement the ::copy() + function inside the ListModel iterator subclass. + +2008-03-19 Emmanuele Bassi + + * clutter/clutter-group.c: + * clutter/clutter-texture.c: Use CLUTTER_ACTOR_IS_VISIBLE() + and not CLUTTER_ACTOR_IS_MAPPED(). + +2008-03-19 Emmanuele Bassi + + * clutter/clutter-score.[ch]: Small clean ups and refactoring. + Use gulong instead of guint, so we have a bigger id space for + the timelines inside a Score. + +2008-03-19 Chris Lord + + * clutter/clutter-actor.c: + (_clutter_actor_apply_modelview_transform), (clutter_actor_paint): + Apply clip inside paint function instead of transform function + +2008-03-18 Emmanuele Bassi + + * clutter/clutter-score.c: Update documentation. + +2008-03-18 Emmanuele Bassi + + * clutter/clutter-score.[ch]: Remove all the API changes, and + just add a clutter_score_append_at_marker(); the implementation + remains the same, but the marker must be explicitly created by + the developer. The ids are no longer used to create implicit + markers, so they can return to be unsigned integers. (#450) + + * clutter/clutter-timeline.[ch]: + (clutter_timeline_has_marker): Add a function to query a timeline + for a marker being set. + + * tests/test-score.c (main): Update with the API changes. + + * clutter.symbols: Update exported symbols. + +2008-03-18 Emmanuele Bassi + + * clutter/clutter-texture.c: Small clean ups in the coding style. + +2008-03-18 Emmanuele Bassi + + * clutter.symbols: Add new symbols + + * clutter/clutter-score.[ch]: Use the newly added marker API + on the timelines to implement attaching timelines at specific + points, using either milliseconds or frames. + + * tests/test-score.c (main): Test the new API. + +2008-03-18 Emmanuele Bassi + + * clutter/clutter-marshal.list: Add signature for the + ::marker-reached signal marshaller. + + * clutter/clutter-timeline.[ch]: Add timeline marker API; + using markers it is possible to add a unique identifier to + a particular frame of the timeline, and receive a signal + notification when reaching that particular marker while + playing the timeline. (#641) + + * tests/test-timeline.c: Update the test case to check for + the marker-reached signal emission. + + * clutter.symbols: Add new symbols. + +2008-03-10 Øyvind Kolås + + * tests/test-shader.c: improved readability of fragment shader + examples by factoring out common bits into FRAGMENT_SHADER_BEGIN and + FRAGMENT_SHADER_END macros. + +2008-03-09 Matthew Allum + + * clutter/clutter-id-pool.c: (clutter_id_pool_free): + Use g_slice_free not g_free. + * clutter/clutter-main.c: (_clutter_do_pick): + Dont 'over read' the framebuffer when picking (#839, Neil Roberts) + +2008-03-07 Øyvind Kolås + + Refactored the integer id->ClutterActor mapping code to be a self + contained data structure. + + * clutter/clutter-id-pool.[ch]: new files. + * clutter/Makefile.am: added clutter-id-pool.[ch] + * clutter/clutter-private.h: use a ClutterIDPool instead of GArray and + GSList to keep track of the reusable ids. + * clutter/clutter-actor.c: moved id pool logic away. + * clutter/clutter-main.c: simplified id pool creation/finalization. + +2008-03-07 Robert Bragg + + * clutter/clutter-timeline.c: + Timeline changes to fix the issues identified in bugzilla #439 + + Notably, this includes some tweaks to timeline semantics. + So e.g. for a + + 10 frame timeline here are some points about the new timeline code: + + - When you create a timeline it starts with current_frame_num == 0 + + - After starting a timeline, the first timeout is for + current_frame_num == 1 (Notably it isn't 0 since there is a delay + before the first timeout signals so re-asserting the starting point + would give a longer than average first frame.) + + - For a non looping timeline the last timeout would be for + current_frame_num == 10 + + - For a looping timeline the timeout for current_frame_num == + 10 would be followed by a timeout for current_frame_num == 1 + and frame 0 is considered == frame 10. + + - Asking for a timeline of N frames might better be described + as asking for a timeline of _length_ N. + + Warning: Although I tried to test things, I guess it's quite + likely that this breaks somthing depending on a specific quirk + of the previous timeline code. + +2008-03-06 Emmanuele Bassi + + * clutter/clutter-actor.c: + (clutter_actor_set_anchor_point_from_gravity): Fix a stupid + conversion from pixels to units that should I not have made. + +2008-03-06 Emmanuele Bassi + + * README: Update the release notes. + +2008-03-06 Gwenole Beauchesne + + Signed off by: Emmanuele Bassi + + * clutter/clutter-group.c (clutter_group_real_lower): Fix to + actually lower the actor under the 'above' actor. (#822) + +2008-03-06 Emmanuele Bassi + + * clutter/clutter-entry.h: + * clutter/clutter-entry.c: + (clutter_entry_handle_key_event_internal), + (clutter_entry_key_press), (clutter_entry_class_init), + (clutter_entry_handle_key_event): Provide a default class handler + for the key-press-event, so that giving key focus to an entry will + automatically make it work. This deprecates the + clutter_entry_handle_key_event() function. (#824) + + * tests/test-entry.c (main): Remove the handle_key_event() + machinery, and just give focus to the entry. + +2008-03-06 Chris Lord + + * clutter/clutter-model.c: (clutter_model_set_sorting_column): + Don't disable sorting on column 0 + +2008-03-06 Emmanuele Bassi + + Add support for the anchor point inside ClutterScript (#834, + David Stanczak) + + * clutter/clutter-actor.c: + (clutter_actor_set_property), + (clutter_actor_get_property), + (clutter_actor_class_init): Add the :anchor-x and :anchor-y + properties to the ClutterActor class. + + (clutter_actor_set_anchor_point), + (clutter_actor_set_anchor_pointu), + (clutter_actor_set_anchor_point_from_gravity): Reimplement + the pixel based and gravity based API using the units based + one. Emit the ::notify signal for the :anchor-x and :anchor-y + properties. + + (parse_units), + (clutter_actor_parse_custom_node): Parse the :anchor-x and + :anchor-y properties using the custom units format (mm, px, + pt and %). + + * tests/test-script.json: Test the newly added properties. + +2008-03-05 Emmanuele Bassi + + * configure.ac: Add "osx" the the AC_HELP_STRING of the flavour + selection. (#831, Peter Enzerink) + +2008-03-04 Emmanuele Bassi + + * clutter/clutter-main.c (clutter_do_event): Do not throttle the + motion events if the per-actor delivery has been disabled. + +2008-03-04 Øyvind Kolås + + * clutter/pango/pangoclutter-render.c: (draw_glyph): use g_slice_new0 + instead of g_slice_new when allocating the glyph_info, avoiding a + branch based on uninitialized memory. + +2008-03-03 Emmanuele Bassi + + * Makefile.am: Do not recurse into doc if we did not explicitly + enabled the documentation build; we just recurse into doc if we + are doing a dist or a distcheck. + +2008-02-29 Øyvind Kolås + + Reuse the numeric id's used for picking actors to avoid the potential + of overflowing the id numbers when continusly creating and destroying + actors on long running applications for 16bpp. + + * clutter/clutter-private.h: replaced hashtable with GArray and a + GSList for available slots in the array. + * clutter/clutter-actor.c: (create_actor_id): function to create an + actor->id mapping, (release_actor_id): function to mark an existing id + as available for reuse. + * clutter/clutter-main.c: (clutter_context_free): added utility + function for cleaning up the context, + (clutter_get_actor_by_gid): use the GArray for looking up actors. + +2008-02-26 Emmanuele Bassi + + * clutter/clutter-alpha.c: + (clutter_exp_inc_func), (clutter_exp_dec_func): Clamp the value + of the alpha function between [0, MAX_ALPHA]. (#800) + +2008-02-25 Emmanuele Bassi + + * clutter/clutter-main.c (emit_event): Fix the last commit + which inverted a condition. + +2008-02-25 Emmanuele Bassi + + * clutter/clutter-actor.c: Remove the usage of g_return_if_fail() + from static functions: either assert or use g_warning() to check + internal state, as g_return_if_fail() can be compiled out. + + * clutter/clutter-main.c: Ditto as above. + +2008-02-25 Tomas Frydrych + + * clutter/clutter-texture.c: + (texture_update_data): + Set alignment based on actual data rowstride, not the texture + width. + +2008-02-21 Tomas Frydrych + + * clutter/x11/clutter-backend-x11.h: + * clutter/x11/clutter-event-x11.c: + * clutter/x11/clutter-x11.h: + (clutter_x11_handle_event): + (clutter_x11_disable_event_retrieval): + Functions to allow to hook into external XEvent retrieval (for + example when using clutter with gtk); NB: this API is tentative. + +2008-02-21 Emmanuele Bassi + + * clutter/x11/clutter-event-x11.c (event_translate): Ignore + PropertyNotify events if they don't match our window. + + * clutter/x11/clutter-stage-x11.c: + (clutter_stage_x11_request_coords): Chain up to the parent's + request coords. + +2008-02-21 Emmanuele Bassi + + * clutter/x11/clutter-event-x11.c (event_translate): Ignore + ConfigureNotify events if we are painting on a foreign window. + + * clutter/x11/clutter-stage-x11.c: + (clutter_stage_x11_request_coords): Reliquish control of the + window size, if we are painting on a foreign window. This fixes + the GtkClutterEmbed widget. + +2008-02-20 Emmanuele Bassi + + * clutter/clutter-timeline.c (clutter_timeline_set_delay): Relax + the condition to allow 0 msecs of delay (meaning: no delay). + +2008-02-20 Tomas Frydrych + + * clutter/Makefile.am: + Added libclutter_ ... _la_DEPENDENCIES to fix dependency tracking. + +2008-02-20 Tomas Frydrych + + * clutter/x11/clutter-x11.h: + * clutter/x11/clutter-backend-x11.c: + (clutter_x11_set_display): + Function to set X display connection prior to calling + clutter_init(); stripped loads of trailing space. + +2008-02-20 Tomas Frydrych + + * clutter/clutter-marshal.list: + * clutter/glx/Makefile.am: + * clutter/glx/clutter-backend-glx.c: + * clutter/glx/clutter-backend-glx.h: + * clutter/glx/clutter-glx.h: + * clutter/x11/Makefile.am: + ClutterX11TexturePixmap and ClutterGLXTexturePixmap actors (#713; + patch by Johan Bilien). + +2008-02-20 Emmanuele Bassi + + * clutter/clutter-actor.h: + * clutter/clutter-actor.c: + (clutter_actor_get_abs_opacity): Add function that does what + get_opacity() does now... + + (clutter_actor_get_opacity): ... and make get_opacity() do what + it's supposed to be doing. The original get_opacity() returned + a composited value, and there's no way to actually extract the + real opacity value set with set_opacity(). + + * clutter/clutter-clone-texture.c: + * clutter/clutter-rectangle.c: + * clutter/clutter-texture.c: Update to use get_abs_opacity(). + + * clutter/clutter-entry.c: + * clutter/clutter-label.c: Ditto. Also, never change the stored + alpha value. (#804) + + * tests/Makefile.am: + * tests/test-opacity.c: Test suite for the get_opacity() and + get_abs_opacity() API, and correct opacity handling. + + * README: Add note about the change in get_opacity(). + +2008-02-19 Chris Lord + + * clutter/clutter-model.c: (clutter_model_resort): + Don't return when there's no sort function set, leave that to the + model sub-class + +2008-02-18 Emmanuele Bassi + + * configure.ac: + * README: Post stable release bump to 0.7.1 + +2008-02-18 Emmanuele Bassi + + * README: + * NEWS: Release 0.6.0 + +2008-02-18 Emmanuele Bassi + + * clutter/clutter-list-model.c: + (clutter_list_model_iter_set_value): Fix a typo in the conversion + code. + +2008-02-18 Chris Lord + + * README: + Fix spelling mistake and a typo + +2008-02-18 Emmanuele Bassi + + * clutter/clutter-actor.c: + (clutter_actor_get_box_from_vertices): Avoid a masking warning + caused by math.h utter braindamage. + +2008-02-18 Emmanuele Bassi + + * clutter/clutter-actor.c: Document the fact that ancestor can + be NULL in the relative transformation API, and what are the + effects. + +2008-02-15 Matthew Allum + + * clutter/pango/pangoclutter-render.c: (draw_glyph): + More safety checks (#796, Tero Saarni) + +2008-02-15 Chris Lord + + * clutter/clutter-entry.c: + * clutter/clutter-group.c: + * clutter/clutter-label.c: + * clutter/clutter-rectangle.c: + * clutter/clutter-texture.c: + More documentation fixes + +2008-02-15 Chris Lord + + * clutter/clutter-entry.c: (clutter_entry_class_init): + More documentation fixes + +2008-02-15 Chris Lord + + * clutter/clutter-label.c: (clutter_label_class_init): + More documentation fixes + +2008-02-15 Chris Lord + + * clutter/clutter-clone-texture.c: + * clutter/clutter-texture.c: (clutter_texture_class_init): + More documentation fixes + +2008-02-15 Chris Lord + + * clutter/clutter-actor.c: + * clutter/clutter-container.c: + * clutter/clutter-media.c: + * clutter/clutter-rectangle.c: + * clutter/clutter-stage.c: (clutter_stage_class_init): + * clutter/clutter-stage.h: + * clutter/clutter-texture.c: + * doc/reference/clutter-docs.sgml: + Fix more documentation + +2008-02-15 Emmanuele Bassi + + * clutter/clutter-actor.[ch]: + * clutter/clutter-types.h: + * doc/reference/clutter-docs.sgml: Fix a lot of documentation. + +2008-02-15 Matthew Allum + + * clutter/cogl/gles/cogl.c: (cogl_paint_init): + Remove depth test getting turned on by default (unlike GL backend) + +2008-02-15 Tomas Frydrych + + * configure.ac: + * clutter/clutter-version.h.in: + * build/msvc_2k5/clutter-version.h: + Removed unused --without-fpu configure option and CLUTTER_NO_FPU + macro + +2008-02-15 Tomas Frydrych + + * build/mingw/README: + * build/mingw/mingw-cross-compile.sh: + Script that automates cross compilation with mingw by Neil Roberts + + +2008-02-15 Emmanuele Bassi + + * clutter/clutter-actor.[ch]: Rename + clutter_actor_get_box_from_vertices() to + clutter_actor_box_get_from_vertices(). + + * clutter/clutter-group.c (clutter_group_query_coords): Fix the + query_coords() implementation. + +2008-02-15 Tomas Frydrych + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + (clutter_group_query_coords): + Added function to translate vertex array to a bounding box. + + (clutter_actor_is_scaled): + (clutter_actor_is_rotated): + Fixed documentation. + +2008-02-15 Tomas Frydrych + + * clutter/clutter-group.c: (clutter_group_query_coords): + Disabled new code taking into account actor scale and rotation. + +2008-02-14 Tomas Frydrych + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + (clutter_actor_is_scaled): + (clutter_actor_is_rotated): + Convenience functions to test whether actor is scaled or rotated. + + (clutter_actor_apply_relative_transform_to_point): + Removed unused variable. + + * clutter/clutter-group.c: + (clutter_group_query_coords): + Use clutter_actor_get_relative_vertices() to calculate bounding + boxes of children that are scaled or rotated. + +2008-02-14 Tomas Frydrych + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + (clutter_actor_get_relative_vertices): + (clutter_actor_apply_relative_transform_to_point): + Functions to calculate actor vertices in the plane of a given + ancestor. + +2008-02-12 Chris Lord + + * clutter/clutter-texture.c: (texture_get_tile_pixbuf), + (clutter_texture_get_pixbuf): + Fix copying textures to pixbufs for tiled textures and correct #ifndef + typo + + * clutter/clutter-util.c: + Amend documentation + +2008-02-12 Matthew Allum + + * clutter/clutter-texture.c: (texture_get_tile_pixbuf): + ifdef out 'leaked' GL only API call. + +2008-02-12 Tomas Frydrych + + * clutter/clutter-texture.c (texture_update_data): + Fixed incorrect calculation of offset into texture data (needs to + use width of the texture, not of the updated area). + +2008-02-12 Tomas Frydrych + + * clutter/clutter-texture.c (texture_update_data): + Fixed incorrect aligment of texture data. + +2008-02-12 Tomas Frydrych + + * clutter/x11/clutter-event-x11.c (event_translate): + Ignore events not directed at the stage window once they have been + passed to the filter functions. + +2008-02-11 Matthew Allum + + * clutter/clutter-actor.c: + Minor documentation tweak to class description. + + * clutter/clutter-behaviour-scale.c: + 'Force' start + end vals of scale behaviour + (#779, Havoc Pennington) + +2008-02-11 Emmanuele Bassi + + * README: + * NEWS: Release 0.5.6 + + * configure.ac: Post release bump to 0.5.7. + + * clutter/clutter-behaviour-scale.c: + * tests/test-fbo.c: Fix compilation warnings. + +2008-02-11 Tomas Frydrych + + * clutter/clutter-actor.c (clutter_actor_transform_stage_point): + Moved part of the calculation to floating point to avoid overflow + of ClutterFixed range for large actors (bug 613). + +2008-02-10 Matthew Allum + + * clutter/osx/clutter-stage-osx.c + Fix up a couple of typos breaking build. + +2008-02-08 Emmanuele Bassi + + * clutter/clutter-actor.c: Add actor box diagram and notes. + +2008-02-08 Emmanuele Bassi + + * clutter/clutter-behaviour-path.c: Move the nice graph and + description from the Path behaviour... + + * clutter/clutter-behaviour.c: ... to the main Behaviour class. + +2008-02-08 Emmanuele Bassi + + * clutter/clutter-behaviour-path.c: Add a paragraph describing + the effects of different alpha functions on the path behaviour. + +2008-02-08 Emmanuele Bassi + + * clutter/clutter-actor.c: Reference the newly added event-flow.png + + * clutter/clutter-alpha.c: Ditto, with alpha-func.png + + * clutter/clutter-texture.c: Fix the XML. + +2008-02-08 Emmanuele Bassi + + * clutter/clutter-behaviour-path.c: Reference the newly + added image showing the effects of different alpha functions + on the same path behaviour. + + * configure.ac: Find out the prefix of some of the libraries + we depend upon, so that gtk-doc can fix the references for us. + +2008-02-08 Matthew Allum + + * clutter/clutter-texture.c: + Tidy up offscreen code, adding into realize/unrealize. + Add more safety code. + Improve documentation. + +2008-02-08 Emmanuele Bassi + + * clutter/clutter-script.c: + (resolve_alpha_func): Use a whitelist containing the alpha function + provided by Clutter, as a fallback in case g_module_open() does not + work. + + (clutter_script_parse_alpha): Add an explicit warning in case we + cannot find the alpha function used inside a UI definition. + +2008-02-07 Tomas Frydrych + + * clutter/clutter-group.c (clutter_group_query_coords): + Take into account the anchor point when calculating the box size. + +2008-02-07 Emmanuele Bassi + + * clutter/clutter-actor.c: Add a note on clutter_actor_set_size() + reguarding groups. + + * clutter/clutter-group.c: Clarify group sizing. + +2008-02-07 Øyvind Kolås + + * tests/test-shader.c: (button_release_cb): added simplified + implementation of a box-blur shader from Gwenole Beauchesne that + should work on GLSL implementing low-end IGPs not implementing + dynamic branching. The original code used crashed some of these + due to bugs in drivers or similar. Resolves bug #710. + +2008-02-07 Tomas Frydrych + + * tests/test-actors.c: + Reverted previous change. + +2008-02-07 Tomas Frydrych + + * clutter/clutter-actor.c: + (clutter_actor_set_property): + Fixed handling of PROP_ROTATE_CENTER_Y, ROTATE_CENTER_Z + + * tests/test-actors.c: + Adjusted to use anchor point for both group and hands. + +2008-02-07 Neil J. Patel + + * tests/test-actors.c: (frame_cb), (main): + Changed set_anchor to move_anchor. + Changed clutter_actor_rotate x & y values to 0,0. + Switched on scaling because it seems to work without drifting. + +2008-02-07 Emmanuele Bassi + + * clutter/clutter-script-parser.c: + (clutter_script_get_type_from_symbol), + (clutter_script_get_type_from_class): Use BIND_LAZY flag + when looking at the symbols, so we don't load them all up. + + * clutter/clutter-script.c (resolve_alpha_func): Ditto as above. + +2008-02-07 Øyvind Kolås + + * clutter/clutter-actor.c: + (_clutter_actor_apply_modelview_transform): perform translation as + well as anchor point adjustment based on self not being stage (and + not by self not being an orphan). + +2008-02-07 Matthew Allum + + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: + * clutter/eglnative/clutter-stage-egl.c: + * clutter/eglx/clutter-stage-egl.c: + * clutter/osx/clutter-stage-osx.c: + * clutter/sdl/clutter-stage-sdl.c: + * clutter/x11/clutter-stage-x11.c: + Add at least somne basic offscreen handling into all backends. + Remove unused clutter_stage_set_offscreen vfunc. (#549) + + * clutter/clutter-texture.c: + Minor API doc tweak, noting rowstride source in set_area + +2008-02-07 Emmanuele Bassi + + * clutter/clutter-score.c (traverse_children): Actually implement + clutter_score_list_timelines(). + + * tests/test-score.c (main): Test clutter_score_list_timelines(). + +2008-02-07 Matthew Allum + + * clutter/pango/pangoclutter-render.c: + Warn if requested glyph is too big for underlying texture cache. + (see #666) + +2008-02-07 Matthew Allum + + * clutter/clutter-texture.c: (texture_upload_data): + Remove random appearing 'priv->filter_quality =1' (#643) + +2008-02-06 Matthew Allum + + * clutter/clutter-texture.c: + Minor clean up from last commit. + + * tests/test-fbo.c: + Small tweak (rotate offscreen, rather than resize) + +2008-02-06 Matthew Allum + + * clutter/clutter-texture.c: + Initial attempt at handling resizing/tranformed source textures. + + * clutter/pango/pangoclutter-render.c: (draw_glyph): + Guards against freetype returning NULL bitmaps and + thus causing device by zeros on NVIDIA drivers. (see ml) + +2008-02-05 Matthew Allum + + * clutter/clutter-actor.c: (clutter_actor_get_vertices): + Make sure GL related Matrices are initialised. Fixes #756 + + * clutter/clutter-texture.c: + Fix up code from Norways answer to Jean-Michel Basquiat. + (warning on tile_get_pixbuf) + +2008-02-05 Øyvind Kolås + + * clutter/clutter-texture.c: removed spurious left over debug printf. + +2008-02-05 Øyvind Kolås + + * clutter/clutter-texture.c: applied modified patch from Gwenole + Beuchesne adressing bug #635. Adressing a buffer overflow in + clutter_texture_get_pixbuf() when tiling is forced. + +2008-02-04 Emmanuele Bassi + + * clutter/clutter-shader.c (clutter_shader_constructor): Keep the + constructor line under the 80 columns using a variable. + +2008-02-04 Emmanuele Bassi + + * clutter/clutter-actor.c: + * clutter/clutter-shader.c: Small documentation and style fixes + + * tests/test-scale.c: Constify the gravities array. + +2008-02-04 Chris Lord + + * clutter/clutter-actor.c: (clutter_actor_transform_stage_point): + Check that x_out and y_out != NULL before setting their contents + +2008-02-04 Øyvind Kolås + + * clutter/clutter-timeline.c: (clutter_timeline_rewind): updated + documentation to take direction into account. + +2008-02-04 Øyvind Kolås + + * tests/test-fbo.c: (make_shader): + * tests/test-shader.c: (main): multiply the resulting gl_FragColor + with gl_Color before being done to take opacity into account in the + GLSL fragments. + +2008-02-04 Øyvind Kolås + + * clutter/clutter-actor.[ch]: added clutter_actor_get_shader and + renamed clutter_actor_apply_shader to be clutter_actor_set_shader. + Reindented/aligned header. + * clutter/clutter-texture.c: (clutter_texture_paint): temporarily + disable the shader on top of the clutter context's shader stack while + rendering into the FBO. + * tests/test-fbo.c: (main): s/apply_shader/set_shader/ + * tests/test-shader.c: (button_release_cb), (main): + s/apply_shader/set_shader/ + +2008-02-03 Matthew Allum + + * clutter/clutter-actor.c: (clutter_actor_set_rotationx): + Add notify signal for set_rotate + + * clutter/clutter-texture.c: + Add basic cleanup code for fbo's + + * tests/test-fbo.c: (main): + Minor notes. + + * clutter/osx/clutter-stage-osx.c: (clutter_stage_osx_realize): + Turn on vblanking. + +2008-02-03 Matthew Allum + + * clutter/clutter-shader.c: + Minor formatting cleanups to fit in 80 cols. + + * clutter/clutter-texture.c: + More safety checks, clean ups in clutter_texture_new_from_actor() + + * clutter/cogl/gl/cogl.c: + Always clear the FBO initially when rendering + + * tests/test-fbo.c: + Overhall the test as to be more useful (and show current issues) + +2008-02-02 Matthew Allum + + * clutter/clutter-timeline.c: + Document frame number limits in new-frame signal. + + * clutter/x11/clutter-event-x11.c: + Remove uneeded error trap (#751) + +2008-02-01 Matthew Allum + + * clutter/cogl/cogl.h: + * clutter/cogl/gl/cogl.c: (cogl_paint_init), (cogl_enable): + * clutter/cogl/gles/cogl.c: (cogl_enable): + + Disable the depth test and buffer as has some strange side + effects, mainly on x/y axis rotation with multiple layers at + same depth (eg rotating text on a bg has very strange + effect). Seems no clean 100% effective way to fix without other + odd issues.. So for now move to application to handle and add + cogl_enable_depth_test() as for custom actors (i.e groups) to + enable if need be. + +2008-02-01 Matthew Allum + + * clutter/clutter-texture.c: (clutter_texture_new_from_actor): + Fix typo breaking FBO rendering on anything other than a cloned + texture. + +2008-02-01 Matthew Allum + + * clutter/clutter-feature.h: + * clutter/clutter-texture.c: + * clutter/clutter-texture.h: + * clutter/cogl/cogl.h: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl.c: + * tests/Makefile.am: + * tests/test.fbo.c: + Add initial support for FBO's in Clutter (OpenGL only so far). + See new clutter_texture_new_from_actor() + Initial implementation, needs work. + + * clutter/x11/clutter-stage-x11.c: + (clutter_stage_x11_set_cursor_visible): + Fall back to again not relying on xfixes to hide cursor. *sigh* + + * clutter/clutter-deprecated.h: + Add clutter_group_find_child_by_id + +2008-02-01 Øyvind Kolås + + * clutter/cogl/gles/cogl.c: (cogl_rectangle_internal): increase size + of GLfixed[] array to make contents fit. + +2008-02-01 Emmanuele Bassi + + * clutter/clutter-actor.h: Clean up a bit the flag-related macros. + +2008-02-01 Emmanuele Bassi + + * clutter/clutter-actor.c: + (clutter_actor_get_property): Use clutter_actor_get_reactive() + instead of the IS_REACTIVE() macro. + + (clutter_actor_set_reactive): Emit the notify signal for the + reactive property. + + * clutter/clutter-timeline.c: + (timeline_timeout_func), + (clutter_timeline_get_delta): Coding style fixes. + +2008-01-31 Rob Bradford + + * clutter/glx/clutter-stage-glx.c: + * clutter/glx/clutter-backend-glx.c: + * clutter/glx/clutter-backend-glx.h: + Fix formatting. + +2008-01-31 Emmanuele Bassi + + * clutter/clutter-timeline.c (clutter_timeline_skip): Don't + add the frames outside the direction check. (thanks to benoar + on clutter-list for spotting it) + +2007-01-31 Tomas Frydrych + + * clutter/clutter-actor.c: + (clutter_actor_transform_vertices): + Call clutter_actor_query_coords() instead of accessing the actor + box, so that actors that calculate their bounding box on the fly + (like ClutterGroup) work. + + * (_clutter_actor_apply_modelview_transform_recursive): + Made to work for parentless actors. + +2008-01-31 Øyvind Kolås + + * tests/test-depth.c: added a box of cloned hands to further expand + the scope of depth testing scenarios exercised by test-depth. + +2008-01-31 Øyvind Kolås + + * tests/test-depth.c: (timeline_completed): make use of + clutter_timeline_set_direction instead of static state. + (raise_top): made rectangle remain at fixed depth and raise + above each other. + (janus_group): added a rectangle with two faces, one red and + one green, that spins around. + +2008-01-31 Emmanuele Bassi + + * clutter/clutter-entry.h: + * clutter/clutter-entry.c: + (clutter_entry_set_cursor_position), + (clutter_entry_get_cursor_position): Rename [gs]et_position() + to [gs]set_cursor_position(), and avoid method name collisions + with bindings for high-level languages. + + * clutter/clutter-deprecated.h: Add replacement warnings for the + renamed methods. + +2008-01-31 Emmanuele Bassi + + * clutter/clutter-actor.c (clutter_actor_init): Explicitly + memset() to 0 the clip container, so if you get the clip without + having set it, you won't get garbage. + +2008-01-31 Rob Bradford + + * clutter/x11/clutter-backend-x11-private.h: + Add missing start to comment + + * clutter/x11/clutter-backend-x11.c: + * clutter/x11/clutter-event-x11.c: + * clutter/x11/clutter-stage-x11.c: + * clutter/x11/clutter-x11.h: + Remove tabs. + +2008-01-30 Emmanuele Bassi + + * README: Add the osx flavour, and mark it experimental, + along with the sdl backend. EGL-based backends should not be + considered experimental anymore, even though they might require + tweaking. + +2008-01-30 Emmanuele Bassi + + * HACKING: Expand the "document API" point, and the release + process. + + * README: Update the release notes regarding the scale behaviour, + now that the gravity has been removed. + +2007-01-30 Tomas Frydrych + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + Added new clutter_actor_move_anchor_point_ API. + + * clutter/clutter-behaviour-scale.c: + * clutter/clutter-behaviour-scale.h: + * clutter/clutter-effect.c: + * clutter/clutter-effect.h: + * tests/test-actors.c: + * tests/test-effects.c: + * tests/test-scale.c: + Removed gravity from ClutterBehaviourScale. + +2008-01-27 Emmanuele Bassi + + * tests/test-depth.c (main): Use a group instead of pushing + the actors on the stage. + +2008-01-25 Emmanuele Bassi + + * clutter/clutter-group.c (sort_z_order): Invert condition to + return to the same as in revision 1976. + +2008-01-25 Emmanuele Bassi + + * clutter/clutter-label.c (clutter_label_query_coords): Check + if the layout logical rectangle size is bigger than the bounding + box; this usually means that the bounding box changed in one + point and the label private allocation needs to be + updated. (#724) + +2008-01-25 Emmanuele Bassi + + * clutter/x11/Makefile.am: Add the generated clutter-x11 pkg-config + file to CLEANFILES, to pass distcheck. + + * Makefile.am: + * clutter/Makefile.am: Tweak up the Makefiles. + + * README: + * NEWS: Release 0.5.4 + + * configure.ac: Post-release bump to 0.5.5 + +2008-01-25 Emmanuele Bassi + + * clutter/clutter-group.c: Use a shorter Z order sorting function, + avoiding the checks. + +2008-01-25 Øyvind Kolås + + * clutter/clutter-shader.c: added documentation strings for + ClutterShader. + +2008-01-23 Emmanuele Bassi + + * Makefile.am: Use variables, instead of substitutions. + + * clutter/clutter-private.h: + * clutter/clutter-main.h: Make clutter_do_event() public again, + as we need it in clutter-gtk. + + * configure.ac: + * clutter/x11/Makefile.am: + * clutter/x11/clutter-x11.pc.in: Add a clutter-x11 pkg-config + file for clutter-gtk, as it depends on the X11 backend API, as + implemented by the GLX and EGLX backends. + + * clutter/x11/clutter-event-x11.c (event_translate): Do not + propagate DestroyNotify events if the stage doesn't own the + window. + + * tests/test-scale.c (main): Set values different from the default. + +2008-01-21 Emmanuele Bassi + + * clutter/clutter-behaviour-scale.c: + (clutter_behaviour_scale_set_property), + (clutter_behaviour_scale_class_init): Fix stupid typo in the + y-scale-end property declaration. (#720) + +2008-01-21 Emmanuele Bassi + + * clutter/clutter-behaviour-depth.h: + * clutter/clutter-behaviour-depth.c: + (clutter_behaviour_depth_set_bounds), + (clutter_behaviour_depth_get_bounds): Add the depth-start and + depth-end accessors. + + * tests/test-depth.c (timeline_completed): Use set_bounds() + instead of g_object_set(). + + * clutter.symbols: Add clutter_behaviour_depth_set_bounds() + and clutter_behaviour_opacity_get_bounds() to the list of + public symbols. + +2008-01-21 Emmanuele Bassi + + * clutter/clutter-behaviour-scale.c: Use separate variables for + storing the scale boundaries; apparently, using arrays broke + the python bindings. (#720) + +2008-01-21 Matthew Allum + + * clutter/clutter-group.c: + Make sure unrealizing a group also unrealizes children. + + * clutter/glx/clutter-stage-glx.c: + Chain up to group unrealize to make sure textures get unrealized + when changing context (see #718) + + * clutter/clutter-texture.c: + Formatting cleanups + +2008-01-21 Øyvind Kolås + + * tests/test-shader.c: fix incompatible types in shader programs + + Apparently floats can't be multiplied or divided with ints without + explicit type casts. Use 2.0 or float(var) where appropriate. Patch + from Tommi Komulainen (#715). + +2008-01-19 Emmanuele Bassi + + * clutter/clutter-main.c (generate_enter_leave_events): Do not + take the explicit reference, and let clutter_event_copy() do it + for us. (#714, Neil Roberts) + +2008-01-19 Emmanuele Bassi + + * clutter/clutter-event.c (clutter_event_copy): Take an extra + reference on the related actor in ClutterEventCrossing that we + explicitly unref in clutter_event_free(). (#714, Neil Roberts) + +2008-01-18 Emmanuele Bassi + + * tests/test-actors.c (input_cb): Fix the callback signature; + hide the clicked actor only if it's a hand. + +2008-01-18 Emmanuele Bassi + + * clutter/clutter-main.c (clutter_do_event): Check the + return value of the ::event signal for the CLUTTER_DELETE + event type. + + * clutter/clutter-stage.c (clutter_stage_event): Emit the + ::event signal when receiving the CLUTTER_DELETE event; this + allows to intercept the user's closing of the stage window. + +2007-01-18 Tomas Frydrych + + * clutter/clutter-fixed.h: + Added missing proto for clutter_fixed_qdivx(). + +2007-01-18 Tomas Frydrych + + * clutter/clutter-fixed.h: + * clutter/clutter-fixed.c: + Added CLUTTER_QDIV() for 64-bit division (bug 564, patch by + Gwenole Beauchesne). + +2008-01-18 Emmanuele Bassi + + * clutter/clutter-event.h: Add a gunichar field for the Unicode + representation of the key. (#555) + +2008-01-18 Emmanuele Bassi + + * clutter/clutter-actor.h: + * clutter/clutter-script.h: + * clutter/clutter-stage.h: + * clutter/clutter-units.h: Documentation fixes and additions. + +2008-01-18 Emmanuele Bassi + + * clutter.symbols: Add ClutterBehaviourOpacity accessors. + + * clutter/clutter-behaviour-opacity.h: + * clutter/clutter-behaviour-opacity.c: + (clutter_behaviour_opacity_set_bounds), + (clutter_behaviour_opacity_get_bounds): Add accessors for the + opacity-start and opacity-end properties. + + * clutter/clutter-behaviour-scale.h: Fix the argument name to + avoid complaints by gtk-doc. + +2008-01-17 Emmanuele Bassi + + * clutter/clutter-behaviour-scale.c: + (clutter_behaviour_scale_set_gravity): Notify on the right property + name. + +2008-01-17 Emmanuele Bassi + + * clutter.symbols: Add new ClutterBehaviourScale setters. + + * clutter/clutter-behaviour-scale.[ch]: Split the scaling factors + on both axis. Add setters for all the behaviour properties. + + * clutter/clutter-effect.h: + * clutter/clutter-effect.c (clutter_effect_scale): Split the + final scale factor to match the ClutterBehaviourScale changes. (#709) + + * tests/test-actors.c: + * tests/test-effects.c: + * tests/test-rotate.c: + * tests/test-scale.c: Update after API change. + +2008-01-16 Emmanuele Bassi + + * clutter/cogl/cogl.h: Rename COGLhandleARB to COGLhandle. + + * clutter/cogl/gl/cogl-defines.h.in: + * clutter/cogl/gl/cogl.c: Update GL implementation of COGL. + + * clutter/cogl/gles/cogl-defines.h: + * clutter/cogl/gles/cogl.c: Update GLES implementation of COGL. + + * clutter/clutter-shader.c: Fix ClutterShader to use the new + COGLhandle type instead of COGLhandlerARB. + +2008-01-16 Emmanuele Bassi + + Define COGLhandleARB. (patch by Johan Bilien) + + * clutter/cogl/gles/cogl-defines.h: Define COGLhandleARB on + GLES as well (using GLuint) + + * clutter/cogl/gles/cogl.c: Use COGLhandleARB. + +2008-01-14 Tommi Komulainen + + reviewed by: Emmanuele Bassi + + * clutter/osx/clutter-event-osx.c (_clutter_event_osx_put): + Initialize ClutterEvent structure with zeroes (#672) + + The 'source' member was uninitialized and being referenced in + clutter_do_event leading to crash. + +2008-01-14 Emmanuele Bassi + + * tests/test-scale.c: Improve test case for scaling (#684, + Jaap A. Haitsma) + +2008-01-14 Emmanuele Bassi + + * clutter/clutter-timeline.c (timeline_timeout_func): Fix + check if the last frame was reached by skipping a frame (#654, + Johan Bilien) + +2008-01-14 Emmanuele Bassi + + * clutter/clutter-shader.c: Use correct format string for + gssize. (#695, Tommi Komulainen) + +2008-01-14 Emmanuele Bassi + + * clutter/cogl/gl/cogl.c (cogl_get_proc_address): Implement non-GLX + version using GModule and looking up the symbol from the running + process. It should work when linked to library providing the + requested function. (#696, Tommi Komulainen) + +2008-01-14 Emmanuele Bassi + + * configure.ac: Post-release bump to 0.5.3 + + * README: + * NEWS: Release 0.5.2 + +2008-01-14 Emmanuele Bassi + + * clutter.symbols: Add clutter_model_insertv() + + * clutter/clutter-model.[ch] (clutter_model_insertv): Add a vector + based insertion API, for language bindings + +2008-01-12 Emmanuele Bassi + + * clutter/clutter-effect.c (clutter_effect_rotate): Make the + rotate effect work on the passed axis, instead of hardcoding + the X axis. (#700, Neil Roberts) + +2008-01-10 Øyvind Kolås + + Added COGLhandleARB since the underlying type on OSX is void*, + patch from Tommi Komulainen , (#694) + + * clutter/cogl/gl/cogl-defines.h.in: Added COGLhandleARB typedef. + * clutter/cogl/cogl.h: + * clutter/cogl/gl/cogl.c: + * clutter/clutter-shader.c: Use COGLhandleARB instead of COGLint when + referring to program or shader handles. + +2008-01-09 Emmanuele Bassi + + * clutter/Makefile.am: + * clutter/clutter.h: + * clutter/clutter-list-model.[ch]: Complete the ClutterModelDefault + to ClutterListModel rename by renaming the source files + +2008-01-09 Emmanuele Bassi + + * clutter/clutter-model-default.[ch]: Rename ClutterModelDefault + into ClutterListModel, to make it clear that the default + ClutterModel implementation is list-based + + * tests/test-model.c: Update call + +2008-01-09 Emmanuele Bassi + + * clutter/clutter-model-default.c: + (clutter_model_default_new), + (clutter_model_default_newv): Move the constructors in the + right file + + * clutter/clutter-model-private.h: Add a private header for + the ClutterModel implementations + + * clutter/clutter-model.c: + (clutter_model_check_type), + (clutter_model_set_n_columns), + (clutter_model_set_column_type): Mark as private to Clutter, + not static to ClutterModel + + * clutter/Makefile.am: Add clutter-model-private.h + +2008-01-09 Emmanuele Bassi + + * clutter/clutter-label.c: + (clutter_label_ensure_layout): Fix the ClutterUnits to Pango + scale conversion. + +2008-01-08 Emmanuele Bassi + + * clutter/clutter-model.c: + (clutter_model_appendv), + (clutter_model_prependv): Fix the columns length pre-condition + +2008-01-07 Emmanuele Bassi + + * clutter/clutter-model-default.[ch]: Remove the ClutterModelDefault + iterator symbols from the public API; the iterator implementation + is a detail of the default ClutterModel class + + * clutter.symbols: Update + +2008-01-07 Emmanuele Bassi + + * clutter/clutter-model.h: + * clutter/clutter-model.c: + (clutter_model_appendv), + (clutter_model_prependv): Add vector based API for bindings. + + (clutter_model_get_column_name), + (clutter_model_get_column_type), + (clutter_model_set_sorting_column): Fix the check in the condition + on the column index. + + * tests/test-scale.c (on_timeline_completed), (main): Fix spelling + + * clutter.symbols: Update public symbols + +2008-01-04 Emmanuele Bassi + + * clutter.symbols: Add clutter_actor_move_byu() + + * clutter/clutter-actor.h: + * clutter/clutter-actor.c: + (clutter_actor_move_by), + (clutter_actor_move_byu): Add a units-based variant of the + clutter_actor_move_by() function + +2008-01-02 Johan Bilien + + reviewed by: Emmanuele Bassi + + * configure.ac: Use AC_DEFINE_UNQUOTED to expand the + variable. Fixes EGL backend build + +2008-01-02 Emmanuele Bassi + + * configure.ac: Post release bump to 0.5.1 + +2008-01-02 Emmanuele Bassi + + * README: + * NEWS: Release 0.5.0 + +2008-01-02 Emmanuele Bassi + + * clutter/clutter-model-default.c: + (clutter_model_default_get_iter_at_row), + (clutter_model_default_insert_row): Fix off-by-one errors + + (clutter_model_default_class_init): + (clutter_model_default_remove_row): Move the actual removal of the + row to... + + (clutter_model_default_row_removed): ... the signal class handler + of ::row-removed; this way, signal handlers connected to + ::row-removed will get a valid iterator, while signal handlers + connected to ::row-removed with the AFTER flag will get an updated + model + +2007-12-31 Tomas Frydrych + + * configure.ac: + * clutter/Makefile.am: + Added -no-undefined to libtool LDFLAGS for mingw/SDL backend, to + allow building of shared libraries for win32. + +2007-12-31 Tomas Frydrych + + * configure.ac: + * clutter.pc.in: + Added CLUTTER_REQUIRES automake var to allow deps in clutter.pc to + be backend-specific. + +2007-12-28 Emmanuele Bassi + + * clutter/clutter-texture.c: + (clutter_texture_unrealize): Do not read the pixels back if the + texture is being destroyed + +2007-12-28 Emmanuele Bassi + + * clutter/clutter-model.c: + (clutter_model_real_get_n_rows), (clutter_model_class_init), + (clutter_model_get_n_rows): Provide a default implementation of + the get_n_rows() method, so that subclasses do not strictly need + to override it + +2007-12-25 Emmanuele Bassi + + * clutter/clutter-actor.c: + (parse_rotation_array): Inline, and get the JsonArray as a parameter + + (parse_rotation): Update + + * clutter/clutter-script.c: + (warn_missing_attribute): Fix for emacs-style warnings + + (clutter_script_parse_node): Remove an ifdeffed out section + + (clutter_script_construct_parameters), + (clutter_script_construct_object): Rename get_parameters, so + it's obvious what it does + +2007-12-25 Emmanuele Bassi + + * tests/test-script.json: Fix the JSON syntax + +2007-12-25 Emmanuele Bassi + + * clutter/clutter-enum-types.c.in: Fix the template + +2007-12-24 Emmanuele Bassi + + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: + * clutter/clutter-texture.c: Remove some of the remaining FIXMEs + in the API documentation + +2007-12-24 Emmanuele Bassi + + * clutter/clutter-color.c: + * clutter/clutter-event.c: + * clutter/clutter-stage.c: Intern more strings using the I_() macro + + * clutter/clutter-enum-types.c.in: Call g_intern_static_string() + in the enum types template + +2007-12-24 Emmanuele Bassi + + * clutter.symbols: Add clutter_actor_set_clipu() and + clutter_actor_get_clipu() + + * clutter/clutter-actor.h: + * clutter/clutter-actor.c: + (clutter_actor_set_clipu), (clutter_actor_get_clipu): Add the + new units-based versions of the clip accessors + + (clutter_actor_set_clip), (clutter_actor_get_clip): Reimplement + the pixels-based clip accessors as proxies for the units-based + ones + +2007-12-24 Emmanuele Bassi + + * clutter/cogl/cogl.h: Update cogl_clip_set() to accept the + clip components as ClutterFixed values + + * clutter/cogl/gl/cogl.c (cogl_clip_set): Update the GL implementation + of cogl_clip_set() + + * clutter/cogl/gles/cogl.c: + (cogl_rectangle_internal): Provide an internal, inlined rectangle + drawing function using fixed point values, to be shared by + cogl_clip_set() and cogl_rectangle() + + (cogl_clip_set), (cogl_rectangle): Update the GLES implementation + of cogl_clip_set() and cogl_rectangle() to use the new internal + rectangle drawing function + + * clutter/clutter-actor.c: Make the clip an array of ClutterUnit + values instead of pixel-based; this allows higher precision and + device independence + + (_clutter_actor_apply_modelview_transform): Pass the clip + components converting from units to fixed point values, using + the new cogl_clip_set() signature + + (clutter_actor_get_property), (clutter_actor_set_clip), + (clutter_actor_get_clip): Update the accessors of the clip + property + +2007-12-21 Emmanuele Bassi + + * clutter/clutter-actor.h: Remove the unused ::set_depth() and + ::get_depth() virtual functions. (#674, Murray Cumming) + +2007-12-21 Emmanuele Bassi + + * clutter/clutter-group.c: + * clutter/clutter-group.h: Add the clutter_group_add() convenience + function; it's now "undeprecated" and implemented as a macro + + * clutter/clutter-stage.h: Add clutter_stage_add() as a convenience + macro + + * clutter/cogl/cogl.h: Include just the needed headers instead + of the whole clutter.h; this avoids rebuild cogl when not needed + +2007-12-21 Emmanuele Bassi + + * Makefile.am: Move tests build before docs, to cut down the + distcheck failure discovery + + * clutter.symbols: Add clutter_texture_set_area_from_rgb_data() + + * clutter/clutter-actor.c: + * clutter/clutter-script.c: + * clutter/clutter-texture.c: + * clutter/json/json-generator.c: + * clutter/json/json-parser.c: Compilation fixes for passing distcheck + + * tests/test-grab.c: + * tests/test-score.c: + * tests/test-script.c: + * tests/test-shader.c: + * tests/test-unproject.c: Ditto as above + +2007-12-21 Emmanuele Bassi + + * clutter/clutter-label.c: + (clutter_label_ensure_layout): Avoid rounding errors in the layout + computing when switching between Clutter units and Pango units. + +2007-12-19 Øyvind Kolås + + * clutter/clutter-texture.[ch]: (bug #675) added + clutter_texture_set_area_from_rgb_data, sharing some of the + initialization infrastructure with clutter_texture_set_from_rgb_data. + +2007-12-20 Emmanuele Bassi + + * clutter/clutter-container.c: + (clutter_container_lower_child): Fix interface method call + to actually call ClutterContainer::lower. (#670, Gwenole + Beauchesne) + +2007-12-20 Emmanuele Bassi + + * clutter/clutter-label.c: + (clutter_label_query_coords): Return the bounding box set inside + request_coords(), if any; otherwise, return the natural allocation + of the label. (#678, reported by Gwenole Beauchesne) + + * tests/test-rotate.c: Align the label + +2007-12-19 Tomas Frydrych + + * clutter/Makefile.am: + * clutter/cogl/gl/cogl-defines.h.in: + * clutter/pango/pangoclutter-render.c: + * configure.ac: + Fixes to allow cross-compilation with mingw (patch by Neil + Roberts). + Removed trailing whitespace. + +2007-12-18 Øyvind Kolås + + * clutter/clutter-main.c: (generate_enter_leave_events): synthesize + enter event (without related) and corresponding leave event when the + actor the cursor is over has been destroyed. + * clutter/clutter-event.c: (clutter_event_free): only unref the + related_actor when it actually is set. + +2007-12-18 Emmanuele Bassi + + * clutter/clutter-main.c: + (unset_motion_last_actor), + (generate_enter_leave_events): Attach a callback to the destroy + signal on the last motion actor, so if it goes away while the + pointer is in the middle of it we can unset the pointer. + + * clutter/clutter-private.h: Store the last motion actor inside + the global context. + +2007-12-17 Emmanuele Bassi + + * clutter/clutter-actor.c: + (clutter_actor_should_pick_paint), + (clutter_actor_apply_transform_to_point): Fix the whitespace. + + (clutter_actor_set_rotation): Clarify that the coordinates of + the centre of rotation are relative to the anchor point or, + if not set, to the upper left corner of the bounding box. + +2007-12-17 Tomas Frydrych + + * clutter/clutter-behaviour-ellipse.c: + * clutter/clutter-behaviour-rotate.c: + Clamping of start and end angles to <0, 360). + +2007-12-17 Emmanuele Bassi + + * clutter/clutter-behaviour-path.c: Clarify the equivalence + between the upper and lower bounds of the ClutterAlpha and + the position in the path. (#634) + +2007-12-17 Emmanuele Bassi + + * clutter/clutter-texture.c: Mention the fact that a ClutterTexture + will scale its contents to fit inside the requested bounding + box. (#661) + +2007-12-17 Emmanuele Bassi + + * clutter/clutter-actor.c: Fix documentation for + the ::captured-event signal. (#673) + +2007-12-17 Emmanuele Bassi + + * clutter/clutter-actor.c: Clarify the set_clip() method + documentation, pointing out that the clip area origin is + always the top-left corner of an actor. + +2007-12-15 Emmanuele Bassi + + * clutter/clutter-actor.c: + * clutter/clutter-alpha.h: + * clutter/clutter-event.h: + * clutter/clutter-fixed.[ch]: + * clutter/clutter-model.h: + * clutter/clutter-shader.[ch]: + * clutter/clutter-stage.c: Documentation fixes. + +2007-12-15 Emmanuele Bassi + + * clutter/clutter-model-default.c: + (clutter_model_default_iter_next), + (clutter_model_default_iter_prev): Do not instantiate a new + iterator, and update the passed one instead, as we say we do + in the documentation. This avoid leaking tons of iterators. + + * clutter/clutter-model.[ch]: Update the documentation. + + * tests/test-model.c: Prettify some output. + +2007-12-14 Emmanuele Bassi + + * clutter/clutter-behaviour.c: + (clutter_knot_get_type): Use the I_() macro. + + * clutter/clutter-model.[ch]: Make ClutterModel and ClutterModelIter + abstract classes; also, provide more virtual functions inside the + ClutterModel vtable, to allow subclasses and language bindings to + override the entire ClutterModel using other/native data types + to store the rows. + + * clutter/clutter-model-default.[ch]: ClutterModelDefault is a + default implementation of ClutterModel and ClutterModelIter using + GSequence. + + * clutter/Makefile.am: + * clutter/clutter.h: Build glue for ClutterModelDefault. + + * tests/test-model.c: Update for constructor changes. + + * tests/test-shader.c: Fix a typo. + +2007-12-14 Matthew Allum + + * clutter/cogl/gl/cogl-defines.h.in: + * clutter/cogl/gles/cogl-defines.h: + Add CLUTTER_COGL_HAS_GL/GLES defines + +2007-12-11 Øyvind Kolås + + Refined the ClutterShader API based on a patch from Emmanuele Bassi. + + * clutter/clutter-actor.c: (clutter_actor_paint), + (clutter_actor_apply_shader): queue a redraw of actor when shader is + set. + * clutter/clutter-actor.h: indentation. + * clutter/clutter-shader.[ch]: made the fragment and vertex shader + sources properties. Report error through GError when binding shaders. + * tests/test-shader.c: modified to use newer API. + +2007-12-10 Emmanuele Bassi + + * clutter/clutter-model.c: + (clutter_model_get_sorting_column): Fix wrong type check. + +2007-12-10 Emmanuele Bassi + + * clutter/clutter-model.[ch]: Allow unsorting the model (passing + -1 as the sorting column) + + (clutter_model_iter_get_valist): Do not initialise twice che + return value. + +2007-12-10 Emmanuele Bassi + + * clutter/clutter-model.c (clutter_model_iter_get_value): Initialise + the passed GValue like the other getters do. + +2007-12-10 Emmanuele Bassi + + * clutter/clutter-model.h: + * clutter/clutter-model.c: + (clutter_model_append_value), + (clutter_model_prepend_value), + (clutter_model_insert_value): Add a _value() variant for the + insertion methods, for use of the language bindings. + + (clutter_model_append), + (clutter_model_prepend), + (clutter_model_insert): Do not return a boolean: insertion should + never fail unless for a programming error, in which case we have + plenty of warnings. + +2007-12-10 Emmanuele Bassi + + * clutter/clutter-behaviour-ellipse.c: + (clutter_behaviour_ellipse_get_angle_tilt), + (clutter_behaviour_ellipse_get_angle_tiltx), + (clutter_behaviour_ellipse_set_tilt): Fix a double conversion + that was messing up the returned results. (#665) + +2007-12-10 Emmanuele Bassi + + * clutter/clutter-actor.c: + (clutter_actor_set_property), + (clutter_actor_get_property), + (clutter_actor_class_init): Add the rotation-* properties, + controlling the rotation angle and center on each axis. (#614) + + (parse_rotation_array), (parse_rotation), + (clutter_actor_parse_custom_node), + (clutter_actor_set_custom_property), + (clutter_scriptable_iface_init): Add a new "rotation" custom + property for expressing the rotation along each axis in a + compact way: + + "rotation" : [ + { "x-axis" : [ , [ , ] ] }, + { "y-axis" : [ , [ , ] ] }, + { "z-axis" : [ , [ , ] ] } + ] + + (clutter_geometry_get_type),(clutter_vertex_get_type), + (clutter_actor_box_get_type): Use the I_() macro instead of + directly calling g_intern_static_string(). + + * clutter/clutter-entry.c (clutter_entry_request_coords): + * clutter/clutter-label.c (clutter_label_ensure_layout), + (clutter_label_request_coords): Use CLUTTER_UNITS_FROM_DEVICE() + instead of CLUTTER_UNITS_FROM_INT(), as "device" means "pixels". + + * clutter/clutter-private.h: Add the I_() macro for intern + static strings. + + * tests/test-script.json: Test the newly added "rotation" + custom property. + +2007-12-10 Tomas Frydrych + + * tests/Makefile.am: + Fixed a typo. + +2007-12-10 Tomas Frydrych + + * tests/test-viewport.c: + * tests/Makefile.am: + Added a simple viewport test. + +2007-12-10 Tomas Frydrych + + * clutter/clutter-actor.c: + (_clutter_actor_apply_modelview_transform): + Moved offset translation after rotation so that rotation coords + are also relative to the offset point. + +2007-12-09 Emmanuele Bassi + + * tests/test-events.c (input_cb): + * tests/test-text.c (main): Fix compiler errors. (#592, + Gwenole Beauchesne) + +2007-12-09 Emmanuele Bassi + + * clutter/clutter-actor.c: Document the values for full + transparency and full opacity in the set_opacity() + method. (#662) + + * clutter/clutter-behaviour-ellipse.c: Improve consistency + in the apidoc. + +2007-12-08 Emmanuele Bassi + + * configure.ac: Make libtool respect the -s switch of make + and be quiet. + +2007-12-07 Emmanuele Bassi + + * clutter/clutter-actor.h: + * clutter/clutter-actor.c: + (clutter_actor_get_sizeu), + (clutter_actor_get_positionu): Add unit-based accessors to + the size and position. + +2007-12-07 Tomas Frydrych + + * clutter/clutter-behaviour-ellipse.c: + (clutter_behaviour_ellipse_set_angle_start): + (clutter_behaviour_ellipse_set_angle_end): + (clutter_behaviour_ellipse_set_angle_tilt): + (clutter_behaviour_ellipse_set_tilt): + Removed strayed degree -> ClutterAngle conversions left over from + API changes. + + (clutter_behaviour_ellipse_set_angle_tiltx): + Removed stray printf. + +2007-12-07 Tomas Frydrych + + * clutter/clutter-behaviour-ellipse.c: + Fixed tilt setters and getters. + +2007-12-06 Tomas Frydrych + + * clutter/clutter-fixed.c: + * clutter/clutter-fixed.h: + (clutter_sqrti): + Added extra iteration to the Newton-Rapson algorithm for arguments + lesser than 342 to improve precission. + +2007-12-06 Emmanuele Bassi + + * clutter/clutter-main.c: + (clutter_set_motion_events_frequency): Never allow the motion + events devlivery frequency to exceed the default frame rate. + +2007-12-06 Emmanuele Bassi + + * clutter/json/json-parser.[ch]: Use gssize, size we allow -1 + as a length (meaning "use the whole string"). + + (json_parser_load_from_data): Use the passed length instead of + using strlen() all the time. + + * clutter/clutter-script.[ch]: Ditto as above. + +2007-12-06 Emmanuele Bassi + + * clutter/pango/pangoclutter-render.c: Hush a compiler warning + by removing a unused variable. + +2007-12-06 Emmanuele Bassi + + * clutter/clutter-label.c (clutter_label_ensure_layout): If the + label has a requested size, force it when ensuring the layout. + +2007-12-06 Emmanuele Bassi + + * tests/test-unproject.c: Fix type comparison. + + * tests/test-score.c: Save the returned ids. + +2007-12-05 Matthew Allum + + reviewed by: + + * clutter/pango/pangoclutter-render.c: (tc_get), (free_glyph_info), + (draw_glyph), (draw_trapezoid), (pango_clutter_render_layout), + (pango_clutter_render_layout_line), + (pango_clutter_render_clear_caches), (prepare_run), (draw_begin): + +2007-12-05 Emmanuele Bassi + + * clutter/clutter-score.h: Rearrange declarations. + + * clutter/clutter-score.c: More documentation in the long + description of the ClutterScore section. + + * clutter/clutter-debug.h: + * clutter/clutter-main.c: Add the CLUTTER_DEBUG_SHADER flag, + for debugging the shader calls. + + * clutter/clutter-feature.h: Fix the documentation of the + feature flags. + + * clutter/Makefile.am: Remove trailing whitespace. + +2007-12-05 Tomas Frydrych + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + * tests/Makefile.am: + * tests/test-unproject: + (clutter_actor_transform_stage_point): + Added new function for translating stage coordinates into local + actor coordinates. + +2007-12-04 Emmanuele Bassi + + * clutter/clutter-score.c: Better document ClutterScore + and its API. + +2007-12-04 Emmanuele Bassi + + * clutter/clutter-score.[ch]: Reimplement ClutterScore using + a N-ary tree to store the timelines. Remove clutter_score_add(): + the same functionality can be achieved by passing a NULL + parent to clutter_score_append(). + + * tests/test-score.c: Update ClutterScore test unit, and add + debug printouts. + +2007-12-04 Øyvind Kolås + + * clutter/clutter-shader.c: (bind_glsl_shader): use gchar instead of + GLcharARB. + +2007-12-03 Øyvind Kolås + + * clutter/clutter-shader.[ch]: do not include GL.h. + +2007-12-03 Øyvind Kolås + + Support for shaders in clutter. At the moment limited to drivers + providing GLSL support. + + * clutter/cogl/cogl.h: added rather direct binding of needed for glsl + shaders. + * clutter/cogl/gl/cogl-defines.h.in: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl-defines.h: added stubs. + * clutter/cogl/gles/cogl.c: added stubs. + + * clutter/glx/clutter-stage-glx.c: + (clutter_stage_glx_realize): unrelated memory management sanity fix. + (clutter_stage_glx_unrealize): unbind all shaders on stage unrealize. + + * clutter/Makefile.am: added clutter-shader.[ch] + * clutter/clutter-actor.[ch]: adding shader capability to + actors. + * clutter/clutter-feature.h: added CLUTTER_FEATURE_SHADERS_GLSL + * clutter/clutter-private.h: added stack of shaders to context. + * clutter/clutter-shader.[ch]: new. + + * tests/Makefile.am: added shader test. + * tests/test-shader.c: (frame_cb), (main): simple shader test, + cycle through the inline shader with right/left mouse buttons. + +2007-12-03 Øyvind Kolås + + * clutter/glx/clutter-stage-glx.c: for extra sanity, set + stage_x11->xvisinfo = NULL after XFree. Makes using the root window + as foreign window possible. + +2007-11-30 Øyvind Kolås + + * clutter/clutter-timeline.c: (clutter_timeline_get_delta): return the + number of milliseconds passed between new-frame events instead of + since new-frame events, thus making sure that the sum of _get_delta's + returned for all new-frame events is equal to total time elapsed. + +2007-11-30 Emmanuele Bassi + + * clutter/clutter-actor.c (parse_units), + (clutter_actor_parse_custom_node): Do not allow using percentages + of the stage on the stage itself, as it makes little to no + sense. + + * clutter/clutter-script.c: + (clutter_script_construct_object): Rearrange code. + + * tests/test-script.json: Do not set the size of the stage, to + test for the stage size percentage. + +2007-11-30 Emmanuele Bassi + + * clutter/clutter-model.h: Complete the documentation of + the ClutterModelClass structure members. + +2007-11-30 Emmanuele Bassi + + * clutter/clutter-timeline.h: + * clutter/clutter-timeline.c + (timeline_timeout_func), + (clutter_timeline_get_delta): Add a function for retrieving + the number of frames and the time (in milliseconds) elapsed + since the last timeline ::new-frame signal. This can be useful + for implementing a physics engine or just for knowing how if + and how many frames have been skipped. + +2007-11-30 Emmanuele Bassi + + * clutter/clutter-actor.c (parse_units), + (clutter_actor_parse_custom_node), + (clutter_scriptable_iface_init): Override the parsing code + for the x, y, width and height properties of ClutterActor, + to allow strings with modifiers when defining the position + and/or the dimensions of an actor. Bare integers are assumed + as pixels; floating point values in the [0, 1] interval are + assumed as percentages; strings can have these modifiers: + + - px - pixels + - mm - millimeters + - pt - points (at the current resolution) + - % - percentage of the stage + + * clutter/clutter-units.h: Fix the conversion macros + + * tests/test-script.json: Test the new values. + +2007-11-29 Emmanuele Bassi + + * clutter/clutter-model.[ch]: Slight API change in the constructor + functions for ClutterModel: clutter_model_new() now takes a list + of GType/string pairs for both the column type and the column name. + + (clutter_model_set_n_columns), + (clutter_model_set_names), + (clutter_model_set_types): Subclasses of ClutterModel will be able + to call clutter_model_set_types() and clutter_model_set_names() in + any order, provided that they don't call each function more than + once. + + * tests/test-model.c: Update the test case. + +2007-11-29 Tomas Frydrych + + * clutter/clutter-actor.h: + * clutter/clutter-actor.c: + Converted depth and rotation offsets to ClutterUnit. + + (clutter_actor_set_depthu): + (clutter_actor_get_depthu): + Additional ClutterUnit API. + + (_clutter_actor_apply_modelview_transform): + Use cogl_translatex() in place of cogl_translate(). + +2007-11-29 Emmanuele Bassi + + * *: Add svn:ignore property to every directory, so that + svn status starts being useful. + +2007-11-29 Matthew Allum + + * clutter/clutter-main.c: (generate_enter_leave_events): + Minor formatting tweak. + * configure.ac: + Typo fix from Damien Lespiau (via mailing list) + +2007-11-28 Emmanuele Bassi + + Add more introspection capabilities to the base model class + + * clutter/clutter-model.h: + * clutter/clutter-model.c: + (clutter_model_finalize): Do no leak the column types array. + + (clutter_model_get_n_columns): Function for getting the number + of columns inside a model. + + (clutter_model_set_names): Add API for setting the names of the + columns. + + (clutter_model_get_column_name), + (_model_get_column_type): Add API for getting each column's name, + and the default implementation for ClutterModel. + + (clutter_model_get_column_type), + (_model_get_iter_at_row): Add API for getting each column's type, + and the default implementation for ClutterModel. + + * clutter.symbols: Add ClutterModel and ClutterModelIter symbols, + and keep the symbols file sorted. + +2007-11-28 Tomas Frydrych + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + (clutter_actor_set_positionu): + (clutter_actor_set_sizeu): + (clutter_actor_get_widthu): + (clutter_actor_get_heightu): + (clutter_actor_set_widthu): + (clutter_actor_set_heightu): + (clutter_actor_get_xu): + (clutter_actor_get_yu): + (clutter_actor_set_xu): + (clutter_actor_set_yu): + Expanded ClutterActor API with new ClutterUnit-base functions. + + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: + (clutter_stage_get_resolution): + (clutter_stage_get_resolutionx): + New function to query stage resolution (floating and fixed point + versions). + + * clutter/clutter-units.h: + (CLUTTER_UNITS_FROM_STAGE_WIDTH_PERCENTAGE): + (CLUTTER_UNITS_FROM_STAGE_HEIGHT_PERCENTAGE): + (CLUTTER_UNITS_FROM_PARENT_WIDTH_PERCENTAGE): + (CLUTTER_UNITS_FROM_PARENT_HEIGHT_PERCENTAGE): + (CLUTTER_UNITS_FROM_MM): + (CLUTTER_UNITS_FROM_MMX): + (CLUTTER_UNITS_FROM_POINTS): + (CLUTTER_UNITS_FROM_POINTSX): + New macros for conversions to ClutterUnits. + + * clutter.symbols: + Added: + ClutterActor anchor_point functions, + clutter_stage_get_resolution functions. + + Removed: + clutter_actor_scale_with_gravity functions. + +2007-11-28 Emmanuele Bassi + + * clutter/clutter-actor.[ch]: Documentation fixes. + +2007-11-28 Emmanuele Bassi + + Remove the layout containers: they will be moved to a + high-level library. + + * clutter/clutter.h: + * clutter/Makefile.am: Remove layout and boxes from the + build. + + * clutter/clutter-layout.[ch]: Remove the ClutterLayout + interface. + + * clutter/clutter-box.[ch]: + * clutter/clutter-hbox.[ch]: + * clutter/clutter-vbox.[ch]: Remove ClutterBox and its + subclasses. + + * clutter/clutter-label.c: Remove ClutterLayout implementation + + * clutter/clutter-script-private.h: + * clutter/clutter-script-parser.c: + * clutter/clutter-script.c: + (clutter_script_parse_node): Remove special parsing for + ClutterMargin and ClutterPadding. + + * clutter/clutter-types.h: Remove ClutterPadding and ClutterMargin. + + * tests/Makefile.am: + * tests/test-boxes.c: Remove the boxes test case. + +2007-11-28 Tomas Frydrych + + * clutter/NEWS: + Started 0.6.0 section with comment on actor anchor point. + + * clutter/clutter/clutter-actor.c: + * clutter/clutter/clutter-actor.h: + * clutter/clutter/clutter-behaviour-scale.c: + * clutter/clutter/clutter-deprecated.h: + (clutter_actor_set_anchor_point): + (clutter_actor_set_anchor_pointu): + (clutter_actor_get_anchor_point): + (clutter_actor_get_anchor_pointu): + (clutter_actor_set_anchor_point_from_gravity): + New anchor point API deprecating old gravity scaling, added + comments on modelview matrix construction to ClutterActor + documentation. + + (clutter_actor_set_scale_with_gravity): + (clutter_actor_set_scale_with_gravityx): + Deprecated; use clutter_actor_set_anchor_point_from_gravity() instead. + +2007-11-28 Emmanuele Bassi + + * clutter/clutter-effect.[ch]: Add clutter_effect_template_construct() + function, for language bindings that need to set the alpha function + but cannot call the clutter_effect_template_new() ctor themselves. + +2007-11-27 Tomas Frydrych + + * clutter/clutter-behaviour-ellipse.c: + * clutter/clutter-behaviour-ellipse.h: + (clutter_behaviour_ellipse_get_angle_startx): + (clutter_behaviour_ellipse_set_angle_startx): + (clutter_behaviour_ellipse_get_angle_endx): + (clutter_behaviour_ellipse_set_angle_endx): + (clutter_behaviour_ellipse_get_angle_tiltx): + (clutter_behaviour_ellipse_set_angle_tiltx): + Changed to take and return angles in degrees represented as + ClutterFixed. + +2007-11-27 Emmanuele Bassi + + * clutter/clutter-actor.c (clutter_actor_destroy): Remove the + reference we hold on the actor, as it was preventing the finalization + of every child on the stage. + +2007-11-26 Emmanuele Bassi + + * clutter/x11/clutter-stage-x11.c: + (clutter_stage_x11_set_cursor_visible): Restore the XFixes usage, + as it now seems to be have been fixed. + +2007-11-26 Emmanuele Bassi + + * clutter/clutter-actor.c: + (clutter_actor_real_show), + (clutter_actor_real_hide): Do not set the MAPPED flag on the actor + if it is a top-level one (like ClutterStage); the backends are + responsible for setting that flag, as it might be the result of an + asynchronous operation (e.g. on X11). + + * clutter/eglnative/clutter-stage-egl.c: + (clutter_stage_egl_show), + (clutter_stage_egl_hide): Set/unset the CLUTTER_ACTOR_MAPPED flag + on show and hide respectively. + + * clutter/osx/clutter-stage-osx.c: + (clutter_stage_osx_show), + (clutter_stage_osx_hide): Ditto as above. + + * clutter/sdl/clutter-stage-sdl.c: + (clutter_stage_sdl_show), + (clutter_stage_sdl_hide): Ditto as above, plus chain up to the + parent class show/hide virtual functions. + + * clutter/x11/clutter-event-x11.c (event_translate): Use the MapNotify + and UnmapNotify events to call the X11 stage map/unmap functions. + + * clutter/x11/clutter-stage-x11.[ch]: + (clutter_stage_x11_set_fullscreen): Set the fullscreen_on_map flag + with the fullscreen value. + + (clutter_stage_x11_map), (clutter_stage_x11_unmap): Set the MAPPED + flag on the stage actor and redraw; also, if the fullscreen_on_map + flag was set, call clutter_stage_fullscreen() as well. (#648) + + * tests/Makefile.am: + * tests/test-fullscreen.c: Add a fullscreen test case for checking + whether fullscreen works on every backend/platform. + +2007-11-23 Emmanuele Bassi + + * clutter/clutter-actor.c: + (clutter_actor_real_request_coords), + (clutter_actor_request_coords), + (clutter_actor_class_init): Provide a default ::request_coords() + implementation in ClutterActor and use it to store the bounding + box passed to clutter_actor_request_coords(). This makes the code + more reliable and clean, and avoids a call to the subclass + request_coords() method if the bounding box did not change. Now, + every class overriding ClutterActor::request_coords() *must* chain + up to the parent class method or the bounding box will not be + saved inside the ClutterActor structure. + + * clutter/clutter-entry.c: + * clutter/clutter-group.c: + * clutter/clutter-hbox.c: + * clutter/clutter-label.c: + * clutter/clutter-texture.c: + * clutter/clutter-vbox.c: Chain up to the parent class + request_coords() method. + +2007-11-23 Emmanuele Bassi + + * clutter/clutter-event.h: Add more documentation. + +2007-11-23 Emmanuele Bassi + + * tests/test-event.c: Back out an accidental commit. + +2007-11-23 Emmanuele Bassi + + * clutter/clutter-actor.c: + * clutter/clutter-alpha.c: + * clutter/clutter-effect.c: + * clutter/clutter-event.c: + * clutter/clutter-event.h: + * clutter/clutter-group.h: + * clutter/clutter-model.c:, + * clutter/clutter-script.c: + * clutter/clutter-scriptable.h: + * clutter/clutter-stage.c: Documentation fixes. + + * clutter/clutter-score.c: Fix implementation. + +2007-11-23 Emmanuele Bassi + + * clutter/x11/clutter-stage-x11.c: Chain up the hide and show + to the parent's implementation. + +2007-11-23 Emmanuele Bassi + + * clutter/clutter-effect.[ch]: Update the effects API to remove + the start value for most of them. + + (clutter_effect_move): Make it a simple "move from current + position to new coordinates" effect. + + (clutter_effect_path): Rename from clutter_effect_move(). + + (clutter_effect_rotate): Sync up with the new actor rotation API. + + * tests/test-effects.c: Regression test for the effects. + + * tests/Makefile.am: Build glue for test-effects + + * tests/test-behave.c: Emulate a full ramp by using a looping + timeline changing its direction when reaching the last frame. + +2007-11-23 Emmanuele Bassi + + * clutter/clutter-actor.c (clutter_actor_destroy): Bail out + if clutter_actor_destroy() was called on the stage: the stage + is not for the user to destroy. + + * clutter/x11/clutter-backend-x11.c: + * clutter/eglnative/clutter-backend-egl.c: + * clutter/sdl/clutter-backend-sdl.c: + * clutter/osx/clutter-backend-osx.c: Unset the top-level private + flag on the stage when disposing it, so the backends can safely + call clutter_actor_destroy(). + + * clutter/clutter-private.h: Tweak the private flags accessors, + to avoid the typecheck. + +2007-11-22 Emmanuele Bassi + + * clutter/clutter-label.c (clutter_label_new_full): Set the + terminating NULL which was removed when applying patch for + fixing #606. (#645, Gwenole Beauchesne) + +2007-11-22 Øyvind Kolås + + * clutter/clutter-actor.c: mended a couple of typos in documentation. + +2007-11-21 Matthew Allum + + * clutter/cogl/gles/cogl.c: (cogl_fog_set): + Minor fixes for fog on GLES. + +2007-11-21 Emmanuele Bassi + + * clutter/cogl/cogl.h: Add cogl_fog_set() abstracting the + glFog() functions and enabling the GL_FOG flag. + + * clutter/cogl/gl/cogl.c: Add GL implementation of cogl_fog_set(). + + * clutter/cogl/gles/cogl.c: Add GL/ES implementation of + cogl_fog_set(). + + * clutter.symbols: Add new symbols. + + * clutter/clutter-stage.h: Add API to enable depth cueing on + the stage using a linear GL fog, and to set the parameters + for it (#637). + + * clutter/clutter-stage.c (clutter_stage_paint): Enable the + GL fog if the ClutterStage:use-fog property is true. + + * tests/test-depth.c: Test the new stage API. + +2007-11-20 Øyvind Kolås + + * clutter/clutter-main.c: (event_click_count_generate): generalized + click_count generation code. + * tests/test-events.c: (input_cb): extended test to report click_count + for release and scroll events as well as press events. + +2007-11-20 Øyvind Kolås + + * clutter/clutter-main.c: (clutter_do_event): avoid computing source + of events if it is already set (for synthetic events.) + * clutter/clutter-event.c: Add more information to the documentation + of clutter_event_put. + +2007-11-20 Emmanuele Bassi + + * README: Add diff example command lines for submitting patches. + +2007-11-20 Emmanuele Bassi + + * clutter/clutter-actor.c:: + * clutter/clutter-behaviour-opacity.c: + * clutter/clutter-clone-texture.c: + * clutter/clutter-effect.c: + * clutter/clutter-label.c: Remove the usage of G_PARAM_CONSTRUCT + without an override for the ::construct virtual function; using + G_PARAM_CONSTRUCT to set the default value of a property is not + the recommended approach; default values are set inside the + instance init function. + +2007-11-20 Emmanuele Bassi + + * clutter/clutter-texture.c (clutter_texture_init): Set filter-quality + value to 1, to fix the regression caused when applying the patch for + buf #616. + +2007-11-19 Emmanuele Bassi + + * clutter/clutter-label.[ch]: Fix ClutterLabel size allocation when + no bounding box has been provided, and store the box set by the + user so that it can be reused when recomputing the layout. (#600) + + (clutter_label_class_init), + (clutter_label_init): Set the :wrap property default to FALSE. + + * clutter/clutter-units.h: Add ClutterUnit-to-PangoUnit conversion + macro. + + * tests/test-rotate.c: Fix string. + +2007-11-19 Emmanuele Bassi + + * clutter/clutter-behaviour-bspline.c: + * clutter/clutter-behaviour-depth.c: + * clutter/clutter-behaviour-ellipse.c: + * clutter/clutter-behaviour-opacity.c: + * clutter/clutter-behaviour-path.c: + * clutter/clutter-behaviour-rotate.c: + * clutter/clutter-behaviour-scale.c: Fix gtk-doc short description. + +2007-11-19 Emmanuele Bassi + + * clutter.symbols: Update + + * clutter/clutter-actor.h: Rename the angle argument for + set_rotationx() to avoid gtk-doc complaining + + * clutter/clutter-main.h: + * clutter/clutter-main.c: + (clutter_set_motion_events_enabled): Rename for consistency + + (clutter_get_motion_events_frequency), + (clutter_set_motion_events_frequency): Add accessors for the default + motion events deliver frequency. + + (clutter_do_event): Throttle down motion events delivery using the + motion events frequency setting, to avoid excessive redraws. (#608) + + (clutter_context_get_default): Enable per-actor motion events, at + least for now. + + * tests/test-events.c (red_button_cb): + * tests/test-grab.c (green_press_cb): Update. + +2007-11-19 Emmanuele Bassi + + * clutter/clutter-timeline.c (timeline_timeout_func): Do not emit the + ::new-frame signal twice for the last frame. (#531) + +2007-11-19 Øyvind Kolås + + * clutter/clutter-actor.[ch]: (clutter_actor_set_rotationx), + (clutter_actor_set_rotation): swapped axis and angle around, + the new argument order is: (axis, angle, x, y, z). Also removed + deprecated rotation functions from header. + + Updated use of clutter_actor_set_rotation? in the following files: + + * clutter/clutter-behaviour-rotate.c: + * clutter/clutter-effect.c: + * tests/test-actors.c: + * tests/test-project.c: + +2007-11-19 Emmanuele Bassi + + * clutter/clutter-label.[ch]: Constify the color argument + for the ClutterLabel ctor. (#604) + +2007-11-18 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + * clutter/clutter-group.c: + * clutter/clutter-main.c: + * clutter/clutter-stage.c: + * tests/test-events.c: + Parent Actors no longer need to be set reactive for reactive + children to get events. Also makes groups now pickable. + (#597, #423) + + * clutter/clutter-texture.c: + Handle case when 1x1 tiled texture is created, + falling 'back' to being non tiled. (#596) + + * clutter/eglx/clutter-backend-egl.c: + Call EglTerminate on backend shutdown. + +2007-11-18 Emmanuele Bassi + + * clutter.pc.in: Bump up glib-2.0 dependency. + +2007-11-18 Emmanuele Bassi + + * clutter/clutter-model.c: Add gtk-doc section for + ClutterModelIter + + * clutter/clutter-script.h: Fix argument name. + + * clutter/x11/clutter-x11.h: + * clutter/x11/clutter-event-x11.c: + * clutter/x11/clutter-backend-x11.c: Document functions and + types. + +2007-11-18 Emmanuele Bassi + + * clutter.symbols: Update exported symbols. + + * clutter/clutter-actor.[ch]: Remove clutter_actor_rotate_* + and clutter_actor_get_rx* and provide a simpler rotation API: + clutter_actor_set_rotation() and clutter_actor_get_rotation(). + + * clutter/clutter-deprecated.h: Deprecate the old rotation API. + + * clutter/clutter-behaviour-bspline.c: + * clutter/clutter-behaviour-rotate.c: + * clutter/clutter-effect.c: Update internal usage of the + rotation API. + + * tests/test-project.c: Ditto as above. + +2007-11-17 Emmanuele Bassi + + Optimise Atoms usage in the X11 and X11-based backends. + + * clutter/x11/clutter-backend-x11.c: + (clutter_backend_x11_post_parse): Call XInternAtoms() here and + get all the atoms from X in one call. + + * clutter/x11/clutter-backend-x11.h: Store all the atoms inside + the ClutterBackendX11 structure. + + * clutter/x11/clutter-event-x11.c: + (xembed_send_message), (xembed_set_info), + (_clutter_backend_x11_events_init), + (set_user_time), (handle_wm_protocols_event), + (handle_xembed_event), (event_translate): Do not cache atoms + or call XInternAtom() directly, and use the atoms off the X11 + backend structure instead. + + * clutter/x11/clutter-stage-x11.c: + (send_wmspec_change_state), (clutter_stage_x11_set_wm_protocols), + (clutter_stage_x11_set_fullscreen), + (clutter_stage_x11_set_title): Ditto as above. + + * clutter/x11/clutter-stage-x11.h: Update the set_wm_protocols() + method to take the X11 stage implementation. + + * clutter/glx/clutter-stage-glx.c: + (clutter_stage_glx_realize): Update for the set_wm_protocols() + change. + + * tests/test-project.c: (main): Test clutter_stage_set_title(). + +2007-11-17 Emmanuele Bassi + + * configure.ac: Depend on GLib >= 2.14 because of ClutterModel + usage of GSequence. + +2007-11-16 Øyvind Kolås + + * clutter/clutter-main.c: (emit_event): renamed from deliver_event, + (emit_pointer_event): utility function to emit pointer event signals + (which takes pointer grab into account). + (emit_keyboard_event): utility function to emit keyboard event signals + (which takes keyboard grab into account). + (clutter_do_event): use the above utility functions, also reindented + the source. + +2007-11-16 Øyvind Kolås + + * tests/test-grab.c: (main): fix use of clutter_actor_set_reactive + +2007-11-15 Øyvind Kolås + + * clutter/clutter-main.[ch]: added clutter_grab_keyboard, + clutter_ungrab_keyboard and clutter_get_keyboard_grab, in + clutter_do_event deliver keyboard related events only to the + actor with the keyboard grab if a grab exists. + * clutter/clutter-private.h: added keyboard_grab_actor to context. + * tests/test-grab.c: added testing for testing the keyboard grab. + +2007-11-15 Emmanuele Bassi + + * clutter/clutter-texture.c: + (clutter_texture_request_coords), (clutter_texture_class_init), + (clutter_texture_init): Unset :sync-size if explicitly setting + the texture size. (#616) + +2007-11-15 Emmanuele Bassi + + * clutter/clutter-actor.[ch]: Massive API clean-ups. Initial + fixes for bugs #614 and #628. + + * clutter/clutter-main.c: + * clutter/clutter-stage.c: Update internal usage of the actor + API. + + * tests/test-events.c: Update test suite. + +2007-11-15 Øyvind Kolås + + * clutter/clutter-main.c: (generate_enter_leave_events), + (clutter_do_event): moved the generation of enter/leave events + to a utility function. + +2007-11-15 Neil J. Patel + + * clutter/clutter-model.c: + Added some more examples to the documentation, plus explained how the + iters work internally. + +2007-11-15 Øyvind Kolås + + * clutter/clutter-main.[ch]: added clutter_grab_pointer, + clutter_ungrab_pointer and clutter_get_pointer_grab, in + clutter_do_event deliver pointer related events only to the + actor with the pointer grab if a grab exists. + * clutter/clutter-private.h: added pointer_grab_actor to context. + * tests/Makefile.am: + * tests/test-grab.c: added test for testing the pointer grab. + +2007-11-15 Emmanuele Bassi + + * clutter/clutter-timeline.[ch]: Add ClutterTimeline:direction + property, defining the direction (forward or backward) of the + timeline. + + * tests/test-timeline.c: Test the direction property. + + * clutter.symbols: Update exported symbols + +2007-11-15 Emmanuele Bassi + + * clutter/clutter-effect.h: + * clutter/clutter-effect.c: + (clutter_effect_template_new_for_duration): Add a simple constructor + for implicitly creating a ClutterTimeline with a given duration. + +2007-11-15 Emmanuele Bassi + + * clutter.symbols: Update with the new public symbols + + * clutter/clutter-script.h: + * clutter/clutter-script-private.h: + * clutter/clutter-script.c: + (parse_signals), (json_object_end), + (signal_info_free), (object_info_free): Parse the "signals" + member for GObjects. + + (clutter_script_connect_signals), + (clutter_script_connect_signals_full): Add new API for autoconnecting + signal handlers using the UI definition files. + + * tests/test-script.c: + * tests/test-script.json: Test signal autoconnection. + +2007-11-15 Matthew Allum + + * clutter/Makefile.am: + * clutter/eglx/Makefile.am: + * clutter/eglx/clutter-backend-egl.c: + * clutter/eglx/clutter-backend-egl.h: + * clutter/eglx/clutter-eglx.h: + * clutter/eglx/clutter-event-egl.c: + * clutter/eglx/clutter-stage-egl.c: + * clutter/eglx/clutter-stage-egl.h: + * clutter/glx/Makefile.am: + * clutter/glx/clutter-backend-glx.c: + * clutter/glx/clutter-backend-glx.h: + * clutter/glx/clutter-event-glx.c: + * clutter/glx/clutter-glx.h: + * clutter/glx/clutter-stage-glx.c: + * clutter/glx/clutter-stage-glx.h: + * clutter/x11/Makefile.am: + * clutter/x11/clutter-backend-x11-private.h: + * clutter/x11/clutter-backend-x11.c: + * clutter/x11/clutter-backend-x11.h: + * clutter/x11/clutter-event-x11.c: + * clutter/x11/clutter-stage-x11.c: + * clutter/x11/clutter-stage-x11.h: + * clutter/x11/clutter-x11.h: + Create a new X11 backend class of which EGL and GLX 'real' backends + then subclass. Effectively shares all X11 code between both backends + avoids code duplication and brings many missing features to EGL X + backend. Requires some cleanup and testing. (#518) + + * clutter/cogl/gles/cogl.c: (cogl_color): + Add define to use color4ub only if configure finds it. + If not fall back to old code. + + * configure.ac: + Drop support for vincent checks. + Drop sdles backend. + Specifically check for color4ub call. + +2007-11-15 Neil J. Patel + + * clutter/Makefile.am: + * clutter/clutter-model.c: + * clutter/clutter-model.h: + * clutter/clutter.h: + * tests/Makefile.am: + * tests/test-model.c: + Merged ClutterModel, which closes #443. + +2007-11-14 Emmanuele Bassi + + * clutter/clutter-clone-texture.c (set_parent_texture): Hide the + clone texture only if it was visible, and show it again if we + are adding a visible texture. + + * tests/test-script.json: Test the CloneTexture actor. + +2007-11-14 Emmanuele Bassi + + * clutter/clutter-actor.[ch]: Rename clutter_actor_get_id() to + clutter_actor_get_gid(). + + (clutter_actor_set_parent): Use GUINT_TO_POINTER(). + + * clutter/clutter-deprecated.h: Add a replacement warning for + clutter_actor_get_id(). + + * clutter/clutter-texture.c (texture_upload_data): Use + clutter_actor_get_gid(), and don't leak the filename string. + +2007-11-14 Emmanuele Bassi + + * clutter/clutter-scriptable.[ch]: Rename ::set_name and ::get_name + to ::set_id and ::get_id, to avoid potential confusion with the + ClutterActor:name property. + + * clutter/clutter-script.h: + * clutter/clutter-script.c (clutter_script_construct_object): Use + clutter_scriptable_set_id(). + + (clutter_get_script_id): Add a public function to retrieve the ID + used in the UI definition files from an object. + + * clutter/clutter-actor.c: Do not set the name of the actor with + the ID set in the UI definition files. + + * tests/test-script.c: Test clutter_get_script_id(). + + * clutter.symbols: Update with the new symbols. + +2007-11-14 Emmanuele Bassi + + * clutter/cutter-deprecated.h: Don't let everyone know from where + we have stolen^Wtaken inspiration for the deprecation warnings. + +2007-11-13 Øyvind Kolås + + * clutter/clutter-behaviour-bspline.[ch]: + Replaced clutter_behaviour_bspline_append with + clutter_behaviour_bspline_append_knots. Fixes bug #582. + * clutter/clutter-deprecated.h: added deprecation macro reflecting the + API change. + +2007-11-13 Øyvind Kolås + + * clutter/Makefile.am: + * clutter/clutter.h: include clutter-deprecated.h + * clutter/clutter-deprecated.h: added file containing macros that + provides more meaningful errors when compiling clutter using code that + uses deprecated functions. + +2007-11-13 Øyvind Kolås + + Renamed all properties of behaviours (and related + functions/variables/parameters) + to match the pattern something-start, something-end. Fixes bug #577. + + * clutter/clutter-behaviour-depth.c: + * clutter/clutter-behaviour-depth.h: + * clutter/clutter-behaviour-ellipse.c: + * clutter/clutter-behaviour-ellipse.h: + * clutter/clutter-behaviour-path.c: + * clutter/clutter-behaviour-rotate.c: + * clutter/clutter-behaviour-rotate.h: + * clutter/clutter-behaviour-scale.c: + * clutter/clutter-behaviour-scale.h: + * clutter/clutter-effect.c: + * clutter/clutter-effect.h: + * clutter/clutter-script.c: + * tests/test-depth.c: + * tests/test-script.c: + +2007-11-06 Øyvind Kolås + + * clutter/clutter-event.h: made ClutterEventAny have a source field, + rearanged other structs to have source in the same position. + * clutter/clutter-event.c: (clutter_event_get_source): modified to use + the any event. + (clutter_event_free): removed unused variable. + * clutter/clutter-main.c: (deliver_event), (clutter_do_event): reduced + amount of code. As well as deliver button-release events to the stage. + +2007-11-08 Rob Bradford + + * clutter/glx/clutter-glx.h: + Include needed for the definition of XVisualInfo. + +2007-11-08 Rob Bradford + + * clutter/cogl/gles/cogl.c: (cogl_color): + Switch over to using glColor4ub in the GLES backend. It's available in + the header file but missing in the reference manual. + +2007-11-07 Emmanuele Bassi + + * clutter/clutter-actor.[ch]: Fix the declaration of the + class handlers for the ::captured-event, ::enter-event and + ::leave-event signals; the function signatures were missing + the return value the signals marshallers were expecting, and + their names weren't respecting the convention for event-related + signals. + +2007-11-06 Tomas Frydrych + + * clutter/clutter-fixed.h: + Added CLUTTER_SQRTI_ARG_MAX, CLUTTER_SQRTI_5_PERCENT, + CLUTTER_SQRTI_10_PERCENT expressing clutter_sqrti limits. + Stripped trailing whitespace. + + * clutter/clutter-fixed.c: + (clutter_sqrti): + Updated documentation, stripped trailing whitespace. + + * clutter/clutter-behaviour-path.c: + (node_distance): + Use clib sqrt if clutter_sqrti() precission would be worse than + 10%. + Stripped trailing whitespace. + +2007-11-06 Emmanuele Bassi + + * clutter/clutter-layout.h: Add commodity macros to test for + a specific layout flag in one line. + +2007-11-06 Emmanuele Bassi + + * clutter/clutter-box.c (clutter_box_dispose): Call unparent() + on the children, instead of destroy(), to avoid a double free + and a crash when destroying a ClutterBox. + +2007-11-06 Emmanuele Bassi + + * clutter/clutter-label.c: Break the references in ::dispose, + and free the resources in ::finalize. + +2007-11-05 Øyvind Kolås + + * clutter/clutter-container.[ch]: removed find_child_by_id method + from interface (and all implementations of it) since this + functionality is now implemented using a global hash. + * clutter/clutter-box.c: + * clutter/clutter-group.c: + +2007-11-01 Emmanuele Bassi + + * clutter/clutter-script.c: Do not keep ownership of the + pixbufs we load. + +2007-10-31 Øyvind Kolås + + * clutter/clutter-main.c: (_clutter_do_pick): disable dithering + when painting in pick mode. + +2007-10-31 Matthew Allum + + * clutter/clutter-score.c: + Various minor improvements to ClutterScore. + +2007-10-30 Emmanuele Bassi + + * clutter/clutter-layout.c: Fix documentation, with regards to + the containers handling of the children implementing the + ClutterLayout interface. + +2007-10-29 Emmanuele Bassi + + * configure.ac: + * clutter/cogl/gl/cogl-defines.h.in: The OS X backend has a funny + OpenGL header location, so it basically did break every application + including clutter/cogl.h because the GL header inclusion depended + on symbols defined into Clutter's config.h. Now, we define the + GL header into the configure template and use it to create the + cogl-defines.h file cogl.h includes. + +2007-10-29 Emmanuele Bassi + + * clutter/json/json-parser.c: Enable parsing of negative numbers; + GScanner splits negative numbers into two tokens, so we need to + special case them. + +2007-10-29 Emmanuele Bassi + + * clutter/clutter-script.c: Add the :filename and :filename-set + properties, to retrieve the path of the currently parsed file (if + :filename-set is TRUE) from the ClutterScriptable implementations. + +2007-10-28 Matthew Allum + + * clutter/clutter-effect.c: + Small doc fix (#584) + +2007-10-27 Emmanuele Bassi + + * clutter/json/json-parser.c: + (json_scanner_msg_handler): Set the GError to be returned by + the parsing functions into the GScanner error message handler. + + (json_parser_object): Return the symbol token in case we have + a parse error after the member name. + + (json_parser_load_from_data): Propagate the error set in the + message handler, if any. + + * clutter/json/json-node.c (json_node_free): Unref the objects + only if are set, to avoid a couple of needless criticals we + get on error. + + * tests/test-script.json: More properties. + +2007-10-27 Emmanuele Bassi + + * clutter/clutter-script.[ch]: Slight API change in the + clutter_script_get_objects() function: now it takes + object name/object return location pairs and returns the + number of objects found and returned. + + * tests/test-script.c: Exercise the clutter_script_get_objects() + function. + +2007-10-27 Emmanuele Bassi + + * clutter/clutter-rectangle.c (clutter_rectangle_paint): Use + CGL_ENABLE_BLEND flag instead of CGL_BLEND value. (#580, + Gwenole Beauchesne) + +2007-10-27 Emmanuele Bassi + + * clutter/clutter-color.c (clutter_color_to_string): Update the + documentation for the format of the returned string, and remove + the note: now clutter_color_parse() can parse the string this + function returns. + +2007-10-27 Emmanuele Bassi + + * clutter/pango/pangoclutter-render.c: Last usage of guint + replaced with COGLuint. (Tommi Komulainen) + +2007-10-26 Matthew Allum + + * clutter/clutter-texture.c: + * clutter/cogl/cogl.h: + * clutter/cogl/gl/cogl-defines.h: + * clutter/cogl/gles/cogl-defines.h: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl.c: + Switch from use of guint to COGLuint. Avoids problems when + guint != GLuint on some platforms, i.e OSX. + (Tommi Komulainen, #525, #523) + + * clutter/Makefile.am: + * clutter/osx/Makefile.am: + * clutter/osx/clutter-backend-osx.c: + * clutter/osx/clutter-backend-osx.h: + * clutter/osx/clutter-event-osx.c: + * clutter/osx/clutter-osx.h: + * clutter/osx/clutter-stage-osx.c: + * clutter/osx/clutter-stage-osx.h: + * configure.ac: + Add initial Cocoa/OSX Backend (by Tommi Komulainen, see #526) + +2007-10-26 Emmanuele Bassi + + * clutter/clutter-entry.c: Add a :x-align property for aligning + the text in the entry, in case the actor is wider than the + text it shows. + +2007-10-26 Emmanuele Bassi + + * clutter/clutter-main.c: Add a --clutter-default-fps run-time + switch and CLUTTER_DEFAULT_FPS environment variable support for + setting the default frame-rate at run-time. + +2007-10-26 Emmanuele Bassi + + * clutter/clutter-script.h: + * clutter/clutter-script.c: Add a ::get_type_from_name() virtual + function for bindings to override. The current implementation + calls g_type_from_name() and our lazy class resolver. + + * clutter.symbols: Update. + + * doc/reference/clutter-sections.txt: Update. + +2007-10-25 Emmanuele Bassi + + * clutter/clutter-behaviour-path.c: Reverse the list of + parsed knots, to preserve the real ordering after prepending + them (thanks to Øyvind for spotting this). + + * clutter/clutter-behaviour-bspline.c: Ditto as above. + +2007-10-25 Emmanuele Bassi + + * clutter/clutter-script-parser.c: Unset the GValue when + getting a ClutterUnit from a JSON node. + +2007-10-25 Emmanuele Bassi + + * clutter/clutter-behaviour-bspline.c: Implement the + ClutterScriptableIface to parse the custom "knots" property. + +2007-10-25 Emmanuele Bassi + + * tests/test-script.c: + * tests/test-script.json: Rejig the test case and add a + path behaviour to test the knot parsing code. + +2007-10-25 Emmanuele Bassi + + * clutter/cogl/cogl.h: Do not include . + +2007-10-25 Emmanuele Bassi + + * clutter/clutter-behaviour-path.c: Implement the + ClutterScriptableIface to parse the custom "knots" property. + +2007-10-25 Emmanuele Bassi + + * clutter/clutter-texture.c (clutter_texture_set_property): Do + not try to set NULL pixbufs. + +2007-10-25 Emmanuele Bassi + + * clutter/clutter-actor.c: Implement part of the ClutterScriptable + interface, using the ClutterActor API to set and get the name + of an actor. + + (clutter_geometry_copy), (clutter_geometry_free): Use + the slice allocator to avoid fragmentation when setting + properties and emitting signals (that is: when packing + boxed types into GValues). + + (clutter_actor_box_copy), (clutter_actor_box_free), + (clutter_vertex_copy), (clutter_vertex_free): Ditto. + + * clutter/clutter-actor.h: + * clutter/clutter-actor.c: + (clutter_actor_push_transform_child), + (clutter_actor_pop_transfomr_child): Simple wrappers around + COGL API, which avoid including clutter/cogl.h when writing + container actors outside Clutter. + +2007-10-25 Emmanuele Bassi + + * clutter/Makefile.am: + * clutter/clutter.h: + * clutter/clutter-scriptable.[ch]: Add the ClutterScriptable + interface; by implementing this interface, a class can + override the UI definition parsing and transform complex data + types into GObject properties, or allow custom properties. + + * clutter/clutter-script.c: + * clutter/clutter-script-parser.c: + * clutter/clutter-script-private.h: Rearrange the code and + use the ClutterScriptable interface to parse and build the + custom properties. This cleans up the code and also it makes + it more reliable (the complex type parsing is now done using + the target type and not just the name of the property). + +2007-10-25 Emmanuele Bassi + + * clutter/clutter-json.h: Header for including the JSON + parsing and data types. + + * clutter/json/json-types.h: Add JSON_NODE_VALUE_TYPE() macro. + + * clutter/json/Makefile.am: Install the JSON headers into a + private location. This might change in the future, and might + also cause collisions if you're using JSON-GLib and Clutter + at the same time, so be warned. + +2007-10-22 Emmanuele Bassi + + * clutter/clutter-label.c (clutter_label_request_coords): If + we get a size requisition, and we have ellipsization active, + check if we are getting less space than what the layout needs + and recompute the width. + +2007-10-22 Emmanuele Bassi + + * clutter/clutter-color.c (clutter_color_to_string): Change + the print format to "%02x%02x%02x%02x" because we use guint8 + for each component, not guint16. + +2007-10-19 Emmanuele Bassi + + * clutter/clutter-entry.c (clutter_entry_paint): Fixed off by + one error. (#566, Gwenole Beauchesne) + +2007-10-18 Øyvind Kolås + + * clutter/clutter-timeline.c: (clutter_timeline_set_duration): + rearranged arithemetic to allow specifying duration with sub second + precision (also enables durations smaller than one second). + +2007-10-18 Emmanuele Bassi + + * clutter/clutter-script-private.h: + * clutter/clutter-script.h: + * clutter/clutter-script.c: Allow id-less objects: as long + as they have a "type" member, a unique id will be provided. + + (json_object_end): Add merge id to the object information + structure. + + (apply_behaviours), (add_children): Keep the unresolved + objects around. + + (construct_stage), (clutter_script_construct_object): If an + object has unresolved children or behaviours try resolving + them when we ask for it. + + (json_parse_end), (clutter_script_ensure_objects): Ensure + that the objects are fully constructed as best as we can when + finished parsing. + + (object_info_free), (remove_by_merge_id): + (clutter_script_unmerge_objects): Remove objects under the + same merge id returned by the loading functions. (Fixes + bug #558) + + * test/test-script.c: + * test/test-script.json: Test unresolved merging and unmerging + in ClutterScript. + +2007-10-18 Matthew Allum + + * clutter/clutter-score.c: + * clutter/clutter-score.h: + * tests/test-score.c: + Implement more ClutterScore functionality. + +2007-10-17 Emmanuele Bassi + + * clutter/clutter-actor.c: + (clutter_actor_set_property), (clutter_actor_get_property), + (clutter_actor_class_init): Add the :reactive property, to + control reactiveness using the UI definition files. + + (clutter_actor_reparent): Do not assume the parent is a + ClutterContainer, and call the container API only if needed. + + (clutter_actor_destroy): Remove from the parent if needed, + just like the documentation says. + +2007-10-16 Øyvind Kolås + + * clutter/pango/pangoclutter-render.c: (tc_get): Provide for blank + rows/columns of pixels between adjecant glyphs in the texture cache to + avoid bilinear interpolation spillage at edges of glyphs. + +2007-10-16 Øyvind Kolås + + * clutter/clutter-main.c: (clutter_do_event): allow motion events + only delivered to stage to be caught in the capture phase as well + as the bubbling phase. + +2007-10-16 Emmanuele Bassi + + * clutter/json/json-object.c: Automatically transform every + delimiter into an underscore. + + * clutter/clutter-script.c: Implement the "parent_texture" + property translation for ClutterCloneTextures, using the + passed id of the parent texture. + +2007-10-16 Emmanuele Bassi + + * clutter/clutter-timeline.[ch]: Added ClutterTimeline:duration, + a property for setting the duration of a timeline in milliseconds. + The property comes with accessors and a new constructor. The + frame rate used is the default value. + + * clutter/clutter-private.h: + * clutter/clutter-main.[ch]: Add clutter_get_default_frame_rate() + and clutter_set_default_frame_rate(); these two functions control + the default frame rate to be used when creating timelines. Currently + is set to 60 frames-per-second. + +2007-10-16 Tomas Frydrych + + * build/msvc_2k5: + Added MSVC project files. + +2007-10-16 Emmanuele bassi + + * clutter/clutter-color.c: Copy the alpha when shading. + +2007-10-16 Tomas Frydrych + + * clutter.symbols: + Added a bunch of missing symbols. + + * clutter/clutter-script.c: + * json/json-node.c: + Use g_slice_new0 instead of g_slice_new to avoid passing + garbage to functions. + + * tests/test-threads.c: + Replaced non-portable sleep() with g_usleep(). + +2007-10-15 Tomas Frydrych + + * clutter/cogl/gl/cogl-defines.h: + * clutter/cogl/gl/cogl.c: + Fixup GL include for windows. + +2007-10-15 Matthew Allum + + * clutter/clutter-actor.c: + More events documentation. + + * clutter/clutter-event.c: + * clutter/clutter-event.h: + Add synthetic flag and make put_event use it + (via modded patch from pippin) + + * clutter/clutter-main.c: (clutter_do_event): + dont use put event anymore when pushing enter/leave events. + +2007-10-15 Emmanuele Bassi + + * clutter/pango/Makefile.am: Compile with the debug flags, if + set. + +2007-10-12 Emmanuele Bassi + + * clutter.symbols: Remove non-public symbols. + +2007-10-12 Tomas Frydrych + + * clutter.symbols: + A list of public symbols, one per line; semi-autogenerated, so + might not be complete -- PLEASE when adding new public APIs, add + the function name to this file. + +2007-10-12 Emmanuele Bassi + + * clutter/clutter-actor.c: Add a :depth property, so we can + set the initial depth of an actor inside the UI definition + files. + +2007-10-12 Tomas Frydrych + + * tests/test-actors.c: + When using MSVC, define _USE_MATH_DEFINES before including + math.h, otherwise constants like M_PI will not be defined. + +2007-10-12 Emmanuele Bassi + + * clutter/clutter-script.c (construct_timline), + (parse_member_to_property): Transfer ownership of the + implicit timelines to the behaviour, so that they get + unreferenced when the behaviour is destroyed. + + (parse_member_to_property): Reverse the list of children + and behaviours. + +2007-10-12 Tomas Frydrych + + Portability fixes: + + * clutter/clutter-private.h: + Bracket #include "unistd.h" with #ifdef HAVE_UNISTD_H + + * clutter/clutter-fixed.c: + Use "", not <> for inclusion of local files. + + (clutter_sqrtx): forward declare local variables. + + * clutter/clutter-debug.h: + Added non-gcc (c99) implementation of variadic debug macros for + when not compiling with gcc. + + * clutter/pango/pangoclutter-render.c: + Fixed some strange uses of CLUTTER_NOTE() + stripped trailing + whitespace. + +2007-10-12 Tomas Frydrych + + * clutter/clutter-actor.c: + * clutter/clutter-backend.c: + * clutter/clutter-behaviour-depth.c: + * clutter/clutter-box.c: + * clutter/clutter-clone-texture.c: + * clutter/clutter-container.c: + * clutter/clutter-entry.c: + * clutter/clutter-feature.c: + * clutter/clutter-fixed.c: + * clutter/clutter-group.c: + * clutter/clutter-hbox.c: + * clutter/clutter-label.c: + * clutter/clutter-layout.c: + * clutter/clutter-media.c: + * clutter/clutter-rectangle.c: + * clutter/clutter-score.c: + * clutter/clutter-script.c: + * clutter/clutter-stage.c: + * clutter/clutter-texture.c: + * clutter/clutter-timeline.c: + * clutter/clutter-timeout-pool.c: + * clutter/clutter-vbox.c: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl.c: + * clutter/eglnative/clutter-backend-egl.c: + * clutter/eglnative/clutter-event-egl.c: + * clutter/eglnative/clutter-stage-egl.c: + * clutter/eglx/clutter-backend-egl.c: + * clutter/eglx/clutter-event-egl.c: + * clutter/eglx/clutter-stage-egl.c: + * clutter/glx/clutter-event-glx.c: + * clutter/json/json-array.c: + * clutter/json/json-generator.c: + * clutter/json/json-node.c: + * clutter/json/json-object.c: + * clutter/json/json-parser.c: + * clutter/sdl/clutter-backend-sdl.c: + * clutter/sdl/clutter-event-sdl.c: + * clutter/sdl/clutter-stage-sdl.c: + + Fixedup config.h inclusion (must always be bracketed with #ifdef + HAVE_CONFIG_H). + +2007-10-11 Tomas Frydrych + + * clutter/clutter-entry.c: + Avoid using C++ reserverd words to name variables. + +2007-10-11 Øyvind Kolås + + Improve the quality of text when the scale it is shown at screen is + smaller than the original, seems to work well down to about a scale + of 50%. + + * clutter/pango/pangoclutter-fontmap.c: + (pango_clutter_font_map_default_substitute): turn off hinting. + * clutter/pango/pangoclutter-render.c: request linear filtering + instead of nearest neighbour when scaling down. + * tests/test-text.c: replaced test with a a test that renders a sample + grid with various pixel sizes and scales for visual inspection of + text rendering quality. + +2007-10-10 Emmanuele Bassi + + * clutter/glx/clutter-backend-glx.c: Fix documentation of the + filter function API. + + * clutter/clutter-score.c: + * clutter/clutter-effect.c: + * clutter/clutter-actor.c: Documentation fixes. + + * clutter/clutter-actor.h: Automatically typecast to ClutterActor + when setting/checking flags. + +2007-10-10 Emmanuele Bassi + + * clutter/clutter-actor.c: Beautify the ClutterActor documentation. + +2007-10-10 Emmanuele Bassi + + * clutter/clutter-actor.c: Remove the ::event-after signal: + three event layers to connect to seems a bit overkill. + + (clutter_actor_event): Return FALSE, not TRUE by default, + as g_signal_emit() will change the return value if no + handlers are connected + + * clutter/clutter-stage.c: Emit ::notify when we change + the fullscreen property. + + * clutter/clutter-script.c: Add more documentation for the + definition format and keywords. + + (translate_property): Collapse the G_TYPE_ENUM and G_TYPE_FLAGS + cases into one, to simplify the code. + + * tests/test-script.c: Test enumeration conversion by using + a value different from the default. + +2007-10-10 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + * clutter/clutter-event.c: + * clutter/clutter-main.c: + * tests/test-events.c: + Add basic W3 DOM event 'capture' like functionality. + +2007-10-10 Emmanuele Bassi + + * clutter/clutter-script-private.h: + * clutter/clutter-script.c: Parse flags like we parse enums. + +2007-10-10 Emmanuele Bassi + + * clutter/json/json-types.h: + * clutter/json/json-array.c: + * clutter/json/json-object.c: Resync with the upstream copy + of JSON-GLib; add json_object_remove_member() and + json_array_remove_element() and fix the g_hash_table_get_keys() + replacement for GLib 2.12. + + * clutter/clutter-script.c: Clean up the complex properties + parsing code. + +2007-10-10 Emmanuele Bassi + + * clutter/clutter-script.c (json_object_end): Add "type_func" + to the list of attributes we skip. + +2007-10-10 Emmanuele Bassi + + * clutter/json/json-parser.c: Use the commodity JsonNode API + and accept bare values as root nodes. + + * clutter/clutter-script-private.h: + * clutter/clutter-script.c: Unreference the created objects + only if they are top-levels, like ClutterBehaviour and + ClutterTimelines. Actors have floating references, so we + just transfer ownership to their containers, and the stage + is owned by the backend. Add the "type_func" key to the + object definition, so the user can supply its own GType + function if the class name doesn't follow the GObject rules. + Document the ClutterScript public API. + +2007-10-10 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + Add missing enter/leave event signals + + * clutter/clutter-main.c: (clutter_do_event): + Set time in crossing events. + Protect against do_pick() failing. + +2007-10-09 Emmanuele Bassi + + * clutter/clutter-script.c (resolve_alpha_func): Fix the + ClutterAlphaFunc resolution function. + +2007-10-09 Emmanuele Bassi + + * tests/Makefile.am: + * tests/test-script.c: + * tests/test-script.json: Move part of the UI definition into + its own file and exercise clutter_script_load_from_file(). + +2007-10-09 Emmanuele Bassi + + * clutter/clutter-script.c (clutter_script_get_object): Construct + the requested object if it hasn't been already. This allows + referencing objects within the same snippet. + + * tests/test-script.c: Declare a timeline and use it inside + multiple behaviours; apply multiple behaviours to various + actors, then retrieve the timeline to start it when the test + runs. + +2007-10-09 Emmanuele Bassi + + * clutter/clutter-script-private.h: + * clutter/clutter-script.c: Allow applying behaviours directly + inside the UI definition data. + + * tests/test-script.c: Test the "behaviours" member. + +2007-10-09 Rob Bradford + + * clutter/eglnative/clutter-backend-egl.c: + (clutter_backend_egl_dispose): + Call eglTerminate() on the display when the backend is disposed of. + + * clutter/eglnative/clutter-stage-egl.c: + (clutter_stage_egl_realize): + Don't use the createNativeWindow() call, it's not generic EGL. + +2007-10-09 Emmanuele Bassi + + * clutter/clutter-script-private.h: + * clutter/clutter-script.h: + * clutter/clutter-script.c: Add licensing information to + the newly added files. + + * clutter/clutter-script.c: Support creating behaviours with + ClutterScript. ClutterAlpha objects are implicit, but + timelines can be both explicit objects using their id or + implicit objects. Make the property resolution and translation + more robust. Support the pixbuf property. + + * tests/test-script.c: Test the newly added features. + + * docs/reference/clutter-docs.sgml: + * docs/reference/clutter-sections.txt: Add ClutterScript. + +2007-10-09 Emmanuele Bassi + + * clutter/clutter-fixed.h: Add deprecation guards around + CLUTTER_FIXED_INT(). + +2007-10-08 Emmanuele Bassi + + * clutter/clutter-script.c: Parse ClutterMargin and ClutterPadding + properties from arrays or integers (assume pixels). + +2007-10-08 Emmanuele Bassi + + * clutter/clutter-script-private.h: + * clutter/clutter-script.c: Allow defining childrens for every + container actor inside the UI definition files. + +2007-10-08 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + * clutter/clutter-private.h: + * clutter/clutter-main.c: + Add a hash to global clutter context mapping all parented actor + id's to actors. + Add clutter_get_actor_by_id() call. + Convert picking machinery to use above. + (performance/simpler composite actor creation) + + * clutter/clutter-stage.c: (clutter_stage_fullscreen), + (clutter_stage_unfullscreen), (clutter_stage_event): + Only set the fullscreen property on stage state fullscreen event(#545) + Experimental as could be painful to implement on non X backends. + +2007-10-08 Emmanuele Bassi + + * clutter/clutter-script.c (json_parse_end): + * clutter/json/json-object.c (json_object_get_members): Replace + the GLib 2.14 API with the equivalent code for GLib < 2.14. + + * configure.ac: Revert the dependency bump. + +2007-10-08 Emmanuele Bassi + + Initial implementation of the UI definition files. (#424) + + * clutter/json/Makefile.am: + * clutter/json/*.[ch]: In-tree copy of JSON-GLib, a GLib-based + JSON parser/generator library. We use it in-tree because we might + need to change the API. Ideally, we'd depend on it. + + * clutter/clutter.h: + * clutter/clutter-script-private.h: + * clutter/clutter-script.[ch]: ClutterScript, the scenegraph + generator class. It parses JSON streams in form of buffers and + files and builds the scene. + + * clutter/clutter-debug.h: + * clutter/clutter-main.c: Add a "script" debug flag + + * clutter/Makefile.am: Build glue. + + * tests/Makefile.am: + * tests/test-script.c: Add a test case for the ClutterScript. + + * configure.ac: Depend on GLib 2.14, so we can use the + g_hash_table_get_key() and g_hash_table_get_values() functions + for the time being; we can probably reimplement those, but we + are going to need 2.14 anyway if we are going to implement a + list model using GSequence. + +2007-10-08 Emmanuele Bassi + + * tests/test-behave.c: Use the right return type for the + event callbacks. + +2007-10-03 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/clutter-event.c: + * clutter/clutter-event.h: + * clutter/clutter-main.c: + * clutter/clutter-private.h: + * clutter/eglnative/clutter-event-egl.c: + * clutter/eglx/clutter-event-egl.c: + * clutter/glx/clutter-event-glx.c: + * clutter/sdl/clutter-event-sdl.c: + Remove seperate double/triple click events and replace with + a click_count member. + Move calculating click counts from backend to do_event() + Initial implementation of ENTER/LEAVE events. + + * tests/test-events.c: + Add code to test above. + + * tests/test-behave.c: + Sync with newer API. + + * clutter/clutter-score.c: + Silence a warning. + +2007-10-01 Emmanuele Bassi + + * clutter/clutter-fixed.h: Add CLUTTER_FIXED_TO_INT() and + deprecate CLUTTER_FIXED_INT(), for symmetry with + CLUTTER_FIXED_FROM_INT(). + + * clutter/clutter-alpha.c: + * clutter/clutter-behaviour-depth.c: + * clutter/clutter-behaviour-ellipse.c: + * clutter/clutter-behaviour-path.c: + * clutter/clutter-fixed.h: Use CLUTTER_FIXED_TO_INT(). + +2007-10-01 Emmanuele Bassi + + * clutter/clutter-actor.c (clutter_actor_get_size): Implement + get_size() as a wrapper around clutter_actor_query_coords() + instead of calling g_object_get() twice. + + (clutter_actor_init): Initialise the box in one call. + +2007-10-01 Emmanuele Bassi + + * clutter/clutter-actor.[ch]: Remove the ::event-after signal + class handler, as it's not meant to be overridden by sub-classes. + + (clutter_actor_class_init): + Make every event-related signal return a boolean: return TRUE + in a signal handler to block the emission. The value is accumulated + automatically by the signal API. + + (clutter_actor_event): If ::event returns TRUE, skip to emitting + ::event-after. Return the value accumulated by the signal emission + chain. + + * clutter/clutter-private.h: Rename _clutter_boolean_accumlator(). + + * clutter/clutter-main.c (clutter_do_event): If clutter_actor_event() + returns TRUE then stop the event emission chain from child to parent. + + * clutter/clutter-stage.c (clutter_stage_event): Behave like + clutter_actor_event(). + + (clutter_stage_get_key_focus), + (clutter_stage_set_key_focus): Avoid a nasty circular reference + issue: if the actor passed to set_key_focus is NULL then the stage + has the key focus. + + * tests/test-events.c: Update the events test with the API + changes. + +2007-10-01 Tomas Frydrych + + * clutter/clutter-actor.c: + (clutter_actor_set_scale_with_gravityx): + Use CLUTTER_QMUL for better precission (#532, patch by Gwenole + Beauchesne). + + * clutter/clutter-color.c: + (clutter_color_to_hlsx): + Added missing CLUTTER_INT_TO_FIXED conversion (#544, patch by Neil + Roberts). + +2007-10-01 Neil J. Patel + + Patch by: Tommi Komulainen + + * clutter/clutter-entry.c: (clutter_entry_delete_text): + Fix characters vs. bytes inconsistency (#520). + +2007-09-30 Matthew Allum + + * clutter/clutter-event.h: + Removed unused POINTER_ENTER and POINTER_LEAVE states. (#546) + * clutter/clutter-stage.c: (clutter_stage_fullscreen), + (clutter_stage_unfullscreen): + Only Change fullscreen prop if the backend implements fullscreen + methods. (#545) + +2007-09-28 Øyvind Kolås + + * clutter/clutter-container.[ch]: added + clutter_container_find_child_by_name. + +2007-09-28 Øyvind Kolås + + * clutter/glx/clutter-stage-glx.c: (clutter_stage_glx_realize): + removed unused variable perspective. + * tests/test-events.c: (main): added CLUTTER_STAGE() cast. + * tests/test-threads.c: include unistd.h for sleep(). + +2007-09-28 Øyvind Kolås + + * clutter/clutter-label.c: (clutter_label_ensure_layout): avoid + calling pango_layout_set_text|markup before we've got any text. + +2007-09-27 Matthew Allum + + * tests/test-scale.c: + Fix out of about array addressing (#522, Tommi Komulainen) + +2007-09-27 Matthew Allum + + * clutter/clutter-clone-texture.c: + * clutter/clutter-rectangle.c: + Include "config.h" in all c files (#524, Tommi Komulainen) + +2007-09-27 Matthew Allum + + Merge from stable. + + * clutter/clutter-behaviour-path.c: (path_alpha_to_position) + Fix uninitialized variable (#480, Gwenole Beauchesne) + +2007-09-27 Matthew Allum + + * clutter/clutter-event.c: + * clutter/clutter-event.h: + * clutter/clutter-main.c: + Further event tweaks; + - Ref the event actor source + - Protect against off stage events (button releases) (#511) + - Move more into ClutterEventAny + - Add a click count to button event (as yet unused) + - Minor cleanups + + * clutter/clutter-actor.c: + Make scale x/y a property. + + * clutter/clutter-private.h: + Remove _clutter_actor_apply_modelview* + + * clutter/eglx/clutter-backend-egl.c: + Warning cleanup + + * clutter/eglx/clutter-stage-egl.c: + * clutter/glx/clutter-stage-glx.c: + * clutter/sdl/clutter-stage-sdl.c: + Avoid setting viewport directly, but set sync flag. + + * clutter/pango/pangoclutter-render.c: (draw_glyph): + Minor cleanups. + + * clutter/Makefile.am: + * tests/Makefile.am: + * tests/test-score.c + * clutter/clutter.h: + * clutter/clutter-score.h: + * clutter/clutter-score.c: + Add very initial (broken) ClutterScore implementation. + +2007-09-25 Ross Burton + + Merge from stable. + + * clutter/clutter-group.c: + Optimise sort_z_order. + +2007-09-17 Emmanuele Bassi + + Merge from stable + + * clutter/eglnative/clutter-event-egl.c: + Flag every device click after the first as motion events + instead of button presses. (#505, Shreyas Srinivasan) + +2007-09-10 Matthew Allum + + Port from stable branch. + + * clutter/eglnative/clutter-event-egl.c: (clutter_event_dispatch): + Only declare tsevent if we have tslib (#498, Robert Bragg) + +2007-09-06 Emmanuele Bassi + + * clutter/clutter-stage.c: Remove stray include + in ClutterStage: the code requesting it was moved in the backends. + +2007-08-31 Emmanuele Bassi + + * clutter/clutter-rectangle.c: Fix the border drawing: do not + overdraw the rectangle on the border and fix the check for + different border colour. (#488, Neil Roberts) + +2007-08-29 Matthew Allum + + * clutter/clutter-effect.c: (clutter_effect_template_set_property): + Add missing break statement. Whoops. + +2007-08-29 Matthew Allum + + * clutter/clutter-main.c: (_clutter_do_pick): + Call glFinish before reading pixels + * clutter/eglx/clutter-stage-egl.c: (clutter_stage_egl_realize): + Add missing read surface in making context current. + Above fixes via Kate Alhola. + + * clutter/glx/clutter-glx.h: + Add missing filter funcs so there actually exported + +2007-08-24 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/clutter-event.h: + * clutter/clutter-main.c: + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: + * clutter/glx/clutter-backend-glx.c: + * clutter/glx/clutter-backend-glx.h: + * clutter/glx/clutter-event-glx.c: + * clutter/glx/clutter-stage-glx.c: + * clutter/glx/clutter-stage-glx.h: + Add initial support for stage state events. + Fix fullscreening for an already mapped stage. + + * tests/test-events.c: + Print out info from the above. Blue button now toggles + fullscreen. + + * clutter/clutter-effect.c: + * clutter/clutter-effect.h: + Add a setting for templates to ref or clone underlying + timelines. (As to improve sync issues like those in foofone) + + * tests/test-timeline.c: + Also add completed signals. + + * clutter/cogl/gles/cogl.c: (cogl_texture_image_2d): + * configure.ac: + Forward port from stable branch. RGB Image fixes gles + and check for lower case libgles_cm. + +2007-08-24 Tomas Frydrych + + * clutter/clutter-actor.c: + (_clutter_actor_apply_modelview_transform): + + Fixed rotation around x axis (bug 486). + +2007-08-23 Emmanuele Bassi + + * clutter/clutter-private.h: + * clutter/clutter-event.c: Revert the event queue ordering + commit. + + * clutter/eglx/clutter-event-egl.c: + * clutter/glx/clutter-event-glx.c: + * clutter/sdl/clutter-event-sdl.c: Update backends. + +2007-08-22 Tomas Frydrych + + * clutter/clutter-behaviour-rotate.c: + * clutter/clutter-behaviour-ellipse.c: + + Fixed CCW rotation in rotate behaviour (bug 483); fixed overall + path length calculation for angles > 360 in rotate and ellipse. + +2007-08-22 Emmanuele Bassi + + * clutter/clutter-main.c (clutter_threads_dispatch_free): Remove + the main threads locking calls: the main loop might remove the + source while dispatching it, so whether or not we are already + holding the lock is unpredictable for the library. Leave a comment + with the relevant bug number in GNOME's Bugzilla and wait for a + fix in GLib. + +2007-08-21 Emmanuele Bassi + + * clutter/clutter-event.c: Correctly initialise the state + variables used to detect multiple clicks. + + (clutter_event_get_coords): Return the coordinates for + CLUTTER_3BUTTON_PRESS events. + + (clutter_events_pending): Check from the tail of the queue backward, + like we do in clutter_event_get() and clutter_event_peek(). + +2007-08-21 Emmanuele Bassi + + Preserve the ordering of the events in the queue when sythesising + new events in the event translation sequence. (#481) + + * clutter/clutter-event.c: + * clutter/clutter-private.h: Allow flagging new events on the + events queue without breaking ClutterEvent using a masked type. + + (clutter_event_get), (clutter_event_put), + (clutter_event_pending): Ignore events with the CLUTTER_EVENT_PENDING + flag set when walking the events queue. + + * clutter/eglx/clutter-event-egl.c: + * clutter/glx/clutter-event-glx.c: + * clutter/sdl/clutter-event-sdl.c: Push the new events straight + on the queue, with the CLUTTER_EVENT_PENDING flag set; remove the + flag if the event translation was succesful, or remove the event + altogether. + +2007-08-21 Emmanuele Bassi + + * clutter/clutter-stage.c: Add missing documentation for the + ClutterStage properties. + +2007-08-21 Tomas Frydrych + + * clutter/clutter-fixed.c: + (clutter_sqrti): + + Fixes for 64-bit platforms; use of SSE builtin when available + (bugs 478, 479, patches by Gwenole Beauchesne). + +2007-08-20 Emmanuele Bassi + + * clutter/Makefile.am: + * clutter/clutter-enum-types.h.in: + * clutter/clutter-enum-types.c.in: Use template files for + glib-mkenums; this makes the Makefile template a bit more + clean and the enum types generation more customisable (e.g. + when GLib 2.14 has been released, we can use g_once_init_enter() + and g_once_init_leave() to have thread-safe GType functions + for the enum types as well). + +2007-08-20 Emmanuele Bassi + + * clutter/clutter-version.h.in: Fix CLUTTER_CHECK_VERSION() + macro to accept micro versions. (#477, Neil Roberts) + +2007-08-19 Emmanuele Bassi + + Various timeline related changes. + + * clutter/clutter-timeout-pool.c: Use g_list_insert_sorted() to + fix a timeout pool reversal happening with our homegrown + sorted insertion function. (see #470) + + * tests/Makefile.am: + * tests/test-timeline.c: Add a ClutterTimeline test suite, for + finding regressions in the behaviour of the timelines. (#470, + Rob Bradford) + + * clutter/clutter-main.c (clutter_do_event): Use an EVENT note, + not a SCHEDULER one; SCHEDULER is for timelines and idle sources + only. + + * clutter/clutter-version.h.in: Protect the bare numbers of + the version components. + + * clutter/clutter-effect.c: Do not unref the ClutterAlpha, as + the ownership is already of the behaviour used by the effect + closure. + + * clutter/clutter-timeline.c: Emit the ::new-frame signal only + if the timeline is still active + + Always advance at least of one frame. (#471, Rob Bradford) + + Do not rewind the timeline if the user paused it in the ::new-frame + signal handler: either the user has already done it with + clutter_timeline_stop() or it's not what he's expecting if he + called clutter_timeline_pause(). (#372, Johan Bilien) + + If we skipped the last frame before emitting the ::complete + signal, emit ::new-frame with the last frame. + + Do not call clutter_timeline_stop() at the end of a non-looping + timeline, as it emits the ::pause signal as well. Also, rewind the + timeline *after* emitting ::complete, so that calling + clutter_timeline_get_current_frame() in a signal handler still + works. + +2007-08-19 Matthew Allum + + * clutter/eglx/clutter-event-egl.c: (clutter_event_dispatch): + Fix clutter_thread typo (Kate Alhola) + +2007-08-18 Emmanuele Bassi + + * clutter/clutter-effect.c: + * clutter/clutter-main.c: Update the Since: tag for the + backported API. + + * clutter/clutter-behaviour-rotate.c: Fix a typo in the get_center() + method. (#468, Neil Roberts) + + Freeze and thaw the notification queue when changing multiple + properties in the same method. Fix some coding style issues. + +2007-08-15 Emmanuele Bassi + + * clutter/clutter-actor.c: Add checks for the "reactive" flag + accessors. + +2007-08-15 Emmanuele Bassi + + * clutter/clutter-effect.[ch]: Add clutter_effect_depth(), a + simple wrapper around ClutterBehaviourDepth. (#464, Ali Sabil) + +2007-08-15 Emmanuele Bassi + + * clutter/clutter-alpha.c (clutter_smoothstep_inc): Use the + correct type for parameters, to avoid overflow (Ali Sabil). + + * clutter/clutter-behaviour-opacity.c: Use the right format + when printing the unsigned alpha value and opacity to the + debug output. + +2007-08-14 Emmanuele Bassi + + * clutter/clutter-container.[ch]: + * clutter/clutter-actor.c: + * clutter/clutter-group.c: Rename clutter_container_raise() to + clutter_container_raise_child(), and clutter_container_lower() + to clutter_container_lower_child() to avoid clashing with + ClutterActor raise() and lower() respectively. + +2007-08-13 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + * clutter/clutter-event.c: + * clutter/clutter-event.h: + * clutter/clutter-main.c: + * clutter/clutter-main.h: + * clutter/clutter-private.h: + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: + * clutter/clutter-types.h: + Initial implementation of actors emmitting event signals (423); + - Actors set_reactive() to receive mouse events. + (call clutter_enable_motion_events() for per action motion events) + - clutter_stage_set_key_focus () to direct key events. + - Events bubble up to parents (ending at stage) + (original source identified by clutter_event_get_source()) + TODO: + - enter/leave notifys for actors. + - stage specific events - fullscreen + - grabs + + * tests/test-events.c: + Extend a little to use new API + + * clutter/cogl/gl/cogl.c: + * clutter/glx/clutter-backend-glx.c: + Move get_proc_address into cogl and out of backend. + (shaders will need it) + + * clutter/clutter-group.c: (clutter_group_real_lower): + Fix a minor compile warning. + + * TODO: + Sync up. + +2007-08-13 Emmanuele Bassi + + * clutter/clutter-container.[ch]: Add find_child_by_id(), + raise(), lower() and sort_depth_order() virtual functions to + ClutterContainer. + + * clutter/clutter-group.[ch]: Deprecate the redundant calls + from ClutterGroup, and make ClutterGroup implement them as part + of the ClutterContainer interface implementation. + + * clutter/clutter-box.c: Implement the newly added ClutterContainer + methods; now clutter_stage_get_actor_at_pos() works with boxes + as well as groups. + + * clutter/clutter-stage.c: + * clutter/clutter-actor.c: Replace calls to ClutterGroup functions + with ClutterContainer ones. + +2007-08-12 Emmanuele Bassi + + * clutter/clutter-timeout-pool.c: Fix removing and adding timeouts + to the timeout pool during a dispatch of a timeout source already + inside the pool. (#456, based on a patch by Neil Roberts) + + (clutter_timeout_dispatch), (clutter_timeout_pool_dispatch): Hold + the main Clutter lock in the pool dispatch function, instead of + the per-timeout dispatch; this guarantees that the ref+unref of + the single timeouts are done under the main lock. + +2007-08-12 Matthew Allum + + * clutter/clutter-texture.c: (texture_upload_data): + Align texture data correctly for edge tiles. + (#422 - Neil Roberts) + +2007-08-11 Matthew Allum + + * clutter/clutter-texture.c: + Fix typo in clutter_texture_get_pixbuf (#458, Neil Roberts). + Use take_object when getting pixbuf prop to avoid ref leak. (Neil + Roberts) + +2007-08-09 Emmanuele Bassi + + * clutter/clutter-box.c: Rename a variable to fix a compiler + warning. + +2007-08-08 Emmanuele Bassi + + * clutter/clutter-behaviour-ellipse: + (clutter_behaviour_ellipse_get_tiltx): Remove useless + "Return" in the API documentation. + +2007-08-08 Emmanuele Bassi + + * clutter/clutter-timeout-pool.c: Fix sorting of the pool + when inserting and removing timeout sources. (#449, Neil + Roberts) + +2007-08-08 Emmanuele Bassi + + * clutter/clutter-main.c (clutter_get_timestamp): Remove + the microseconds remainder, which is mostly useless. (#447) + +2007-08-08 Emmanuele Bassi + + * clutter/clutter-main.c (clutter_get_timestamp): Return the + correct number of microseconds (#447, Neil Roberts) + +2007-08-08 Emmanuele Bassi + + Merge the clutter.git/threading branch. + + * clutter/clutter-main.c: + * clutter/clutter-main.h: + * clutter/clutter-private.h: Add threading locking and unlocking + functions, to mark a critical section and access the Clutter API + from differen threads. Add an initialisation function and a function + to override the default lock aquisition and release functions, for + bindings and application-specific locking handling. Add MT-safe + versions of g_idle_add() and g_timeout_add() which will call the + functions under the main Clutter lock and without races. The + Clutter thread-safe implementation is basically the same used by + GDK, so the same caveats apply. + + * clutter/clutter-actor.c: + * clutter/clutter-timeline.c: + * clutter/clutter-timeout-pool.c: Use the new threading API when + invoking idle and timeouts. + + * clutter/eglnative/clutter-event-egl.c: + * clutter/eglx/clutter-event-egl.c: + * clutter/glx/clutter-event-glx.c: + * clutter/sdl/clutter-event-sdl.c: Acquire and release the main + Clutter lock when preparing, checking and dispatching the events + on the queue in every backend. + + * tests/Makefile.am: + * tests/test-threads.c: Add a test case, showing how to use the + threading API and write thread-safe Clutter applications. + +2007-08-08 Emmanuele Bassi + + * configure.ac: Bump up to 0.5.0 and start the new development + branch. + +2007-08-07 Emmanuele Bassi + + * configure.ac: Bump up to 0.4.0. + +2007-08-07 Emmanuele Bassi + + * clutter/clutter-entry.c: + * clutter/clutter-fixed.c: + * clutter/pango/pangoclutter.h: Small fixes for passing the + distcheck phase with extra-strict compiler flags. + +2007-08-07 Emmanuele Bassi + + * clutter/clutter-actor.h: + * clutter/clutter-alpha.h: + * clutter/clutter-behaviour-ellipse.[ch]: + * clutter/clutter-behaviour-path.h: + * clutter/clutter-behaviour-rotate.c: + * clutter/clutter-behaviour.h: + * clutter/clutter-box.h: + * clutter/clutter-color.h: + * clutter/clutter-container.h: + * clutter/clutter-effect.h: + * clutter/clutter-entry.h: + * clutter/clutter-fixed.h: + * clutter/clutter-layout.h: + * clutter/clutter-main.h: + * clutter/clutter-stage.h: + * clutter/clutter-texture.h: + * clutter/clutter-units.h: + * clutter/clutter-version.h.in: + * clutter/glx/clutter-glx.h: Documentation additions and + various fixes. + +2007-08-07 Matthew Allum + + * clutter/clutter-behaviour-ellipse.c: + Add a documentation note regarding ellipse setting + the applied actors position. + +2007-08-07 Matthew Allum + + * NEWS: + * README: + More updates ready for 0.4.0 + +2007-08-07 Matthew Allum + + * clutter/clutter-fixed.c: + * clutter/clutter-fixed.h: + Add documentation. + + * clutter/cogl/gl/cogl.c: (cogl_perspective): + Remove CFX_* shortened macros + +2007-08-06 Emmanuele Bassi + + * clutter/clutter-main.[ch]: Remove clutter_threads_enter() + and clutter_threads_leave(); both are no-ops and they just + confuse things. The thread-awareness in Clutter is planned + for 0.4.1/0.5.0. + + * README: + * NEWS: Update. + +2007-08-06 Emmanuele Bassi + + * clutter/clutter-box.[ch]: Implement margin, color and default + padding for ClutterBox. Provide API to pack a child by specifying + every packing detail or just pack with the defaults. ClutterBox + works like the HTML boxing model, API-wise: a box with margins + and padding around each child. Needs work, still. + + * clutter/clutter-hbox.c: + * clutter/clutter-vbox.c: Update with the new API and new attributes. + + * clutter/clutter-types.h: Add ClutterMargin and ClutterPadding. + + * test/test-boxes.c: Exercise the new API. + +2007-08-06 Matthew Allum + + * clutter/clutter-texture.c: + Correct set pixbuf property as GDK_TYPE_PIXBUF + (fix via Neil Roberts) + +2007-08-06 Matthew Allum + + * clutter/clutter-behaviour-depth.c: + Modify to work like all other behvaiours in not forcing + increasing order in behaviour 'limits'. (#436) + Rename limit min/max props to start/end. + + * tests/test-depth.c: + Simplify test-case to work with above change and + without multiple ramps + + * clutter/clutter-behaviour-rotate.c: + Handle CW rotation when end > start and similar for CCW just + like ellipse behaviour. + +2007-08-05 Matthew Allum + + * README: + * clutter/clutter-actor.c: + Document show/hide_all behaviour correctly. + +2007-08-05 Emmanuele Bassi + + * clutter/clutter-behaviour-depth.c: Fix typo in the description. + +2007-08-04 Emmanuele Bassi + + * clutter/clutter-behaviour-depth.c: Clarify the depth behaviour + even more in the description used by the API reference. + +2007-08-04 Emmanuele Bassi + + * clutter/clutter-behaviour-depth.[ch]: Clarify that what drives + the movement along the Z axis is the ClutterAlpha object (we + don't have the luxury of a rollover like the opacity does); + so, if you want to go from 0 to -100 you have to use a + decreasing function, just as well if you want to go from 100 + to 0. Using a min-depth of 100 and a max-depth of 0 and an + increasing function is undefined behaviour. + + * tests/Makefile.am: + * tests/test-depth.c: Add a test case for the depth behaviour. + +2007-08-04 Emmanuele Bassi + + * clutter/clutter-actor.c (clutter_actor_set_opacity): Queue + a redraw when setting the opacity of an actor. + +2007-08-03 Emmanuele Bassi + + * clutter/clutter-behaviour-ellipse.c: + (clutter_behaviour_ellipse_get_angle_tilt): Avoid recursion + by fixing a typo. + + (clutter_behaviour_ellipse_get_angle_begin), + (clutter_behaviour_ellipse_get_angle_end): Correct the angles + here too. + +2007-08-03 Emmanuele Bassi + + * clutter/clutter-behaviour-ellipse.c: + (clutter_behaviour_ellipse_get_property): Do not forget to + correct the angles when returning them. + +2007-08-03 Tomas Frydrych + + * clutter/clutter-behaviour-ellipse.c: + * clutter/clutter-behaviour-ellipse.h: + (clutter_behaviour_ellipse_new): + (clutter_behaviour_ellipse_newx): + + Added direction parameter; made behaviour to respect direction + parameter; unclumped angle_begin and angle_end values. + +2007-08-02 Matthew Allum + + * NEWS: + * README: + Initial updating ready for release. + +2007-08-02 Emmanuele Bassi + + * clutter/eglnative/clutter-backend-egl.c: + * clutter/eglx/clutter-backend-egl.c: + * clutter/sdl/clutter-backend-sdl.c: Set the default resolution + as 96.0 dpi for every backend (we already were under this + assumption anyway, and this makes it easier to change this + setting per-backend). + + * clutter/pango/pangoclutter-fontmap.c: + * clutter/pango/pangoclutter.h: Allow setting the resolution + for the PangoClutterFontMap object and provide the implementation + for the PangoFcFontMap::get_resolution() virtual function. This + allows to set the resolution of the PangoContext when retrieving + it. + + * clutter/clutter-label.c (clutter_label_init): Set the + resolution of the font map with the one the backend gives us. + + * clutter/clutter-entry.c (clutter_entry_init): Ditto. + +2007-08-02 Emmanuele Bassi + + * clutter/clutter-color.c (clutter_color_subtract): Invert the + operands and match what the function says it does. (#435) + +2007-08-01 Matthew Allum + + * clutter/clutter-color.c: (clutter_color_from_pixel): + Fix typo in alpha channel extraction (#434) + +2007-08-01 Emmanuele Bassi + + * clutter/clutter-actor.[ch]: Add floating-point variant of the + clutter_actor_get_r[xyz]angx() functions. + +2007-07-31 Emmanuele Bassi + + * clutter/clutter-stage.[ch]: Fix clutter_stage_set_user_resizable() + name, and add a getter for the property. + + * clutter/glx/clutter-stage-glx.c: Use the accessor, not + g_object_get() to retrieve the value of the resizable property. + +2007-07-31 Emmanuele Bassi + + * clutter/clutter-backend.[ch]: Add clutter_backend_set_resolution() + and clutter_backend_get_resolution(); backends should use the former + to set the resolution of the display when initialising, while actors + should use the latter when sizing themselves depending on the + resolution or the font size. + + * clutter/glx/clutter-backend-glx.c: Set the resolution as 96 dpi + as a default and query the X server when opening the display. + + * clutter/clutter-entry.c: Drop the hardcoded dpi value and use + clutter_backend_get_resolution() to compute the default size. + +2007-07-31 Emmanuele Bassi + + * clutter/clutter-entry.c (clutter_entry_init): Set the default + size of the entry based on the size of the default font. (#414). + +2007-07-31 Emmanuele Bassi + + * clutter/sdl/clutter-backend-sdl.c: Fix a typo in + clutter_backend_sdl_get_features() (#426, Pan Bohui) + +2007-07-30 Matthew Allum + + * AUTHORS: + * HACKING: + * README: + Various updates and improvements. + + * configure.ac: + Remove --disable-fast-fp-conversions + +2007-07-30 Tomas Frydrych + + * clutter/clutter-behaviour-ellipse: + (clutter_behaviour_ellipse_advance): + + Fixed invalid assumption about z cooordiance in calculation of + tilt in y axis. + +2007-07-30 Tomas Frydrych + + * clutter/clutter-actor.c: + + Fixed incorrect order of modelview matrix stack in calculating + actor vertices. + +2007-07-30 Matthew Allum + + * clutter/clutter-backend.h: + Remove #if 0's old backend_api + (generating uneeded documentation) + +2007-07-30 Matthew Allum + + * clutter/clutter-texture.c: + Fix re-relisation for large tiled textures. + * tests/test-textures.c: (main): + Add a show/hide to trigger above (see #442) + +2007-07-29 Emmanuele Bassi + + * clutter/clutter-types.h: Document ClutterGravity enumeration + and remove the only incomplete symbol of the api reference. Now + we are up to 79% documented symbols. + +2007-07-29 Emmanuele Bassi + + * clutter/clutter-media.c: Document ClutterMedia signals; + replace the implementation of clutter_media_set_filename() with + something a wee bit more robust (and portable) than a sprintf(). + +2007-07-29 Emmanuele Bassi + + * clutter/clutter-behaviour-ellipse.c: Documentation + fixes; kill some indirections; freeze the notification + queue when (potentially) emitting multiple notify + signals. + + * clutter/clutter-alpha.h: Remove the unused macro + CLUTTER_TYPE_SMOOTHSTEP. + +2007-07-28 Emmanuele Bassi + + * clutter/clutter-actor.[ch]: Use GInitiallyUnowned + as the parent structure in the ClutterActor structure + definition; somehow, this has escaped everyone attention + in one year and a half. Luckily, GInitiallyUnowned is + as big as GObject. + + (clutter_actor_get_abs_position_units), + (clutter_actor_get_abs_position): Check parameters. + + * clutter/clutter-texture.h: Unmangle the flags enum + type declaration, so that dumb parsers like h2defs.py + are not fooled. + + * clutter/clutter-behaviour-ellipse.[ch]: + * clutter/clutter-effect.c: Fix some documentation + issues and make gtk-doc happy. + +2007-07-27 Tomas Frydrych + + * clutter/clutter-behaviour-ellipse.h: + * clutter/clutter-behaviour-ellipse.c: + * tests/test-behave.c: + (clutter_behaviour_ellipse_get_angle_tilt): + (clutter_behaviour_ellipse_set_angle_tilt): + + Pruned ClutterBehaviourEllipse api. + +2007-07-27 Tomas Frydrych + + * clutter/clutter-behaviour-ellipse.h: + * clutter/clutter-behaviour-ellipse.c: + (clutter_behaviour_ellipse_set_angle_tilt_x): + (clutter_behaviour_ellipse_set_angle_tilt_xx): + (clutter_behaviour_ellipse_get_angle_tilt_x): + (clutter_behaviour_ellipse_get_angle_tilt_xx): + (clutter_behaviour_ellipse_set_angle_tilt_y): + (clutter_behaviour_ellipse_set_angle_tilt_yx): + (clutter_behaviour_ellipse_get_angle_tilt_y): + (clutter_behaviour_ellipse_get_angle_tilt_yx): + (clutter_behaviour_ellipse_set_angle_tilt_z): + (clutter_behaviour_ellipse_set_angle_tilt_zx): + (clutter_behaviour_ellipse_get_angle_tilt_z): + (clutter_behaviour_ellipse_get_angle_tilt_zx): + (clutter_behaviour_ellipse_set_tilt): + (clutter_behaviour_ellipse_set_tiltx): + (clutter_behaviour_ellipse_get_tilt): + (clutter_behaviour_ellipse_get_tiltx): + + * tests/test-behave.c: + + Allow tilting ClutterBehaviourEllipse in all three axis; affects + any code using the previous tilt api. + +2007-07-26 Matthew Allum + + * clutter/clutter-feature.h: + Add new stage feature flags and document. + + * clutter/eglnative/clutter-backend-egl.c: + * clutter/eglx/clutter-backend-egl.c: + * clutter/sdl/clutter-backend-sdl.c: + Set new feature flags. + + * clutter/glx/clutter-backend-glx.c: + * clutter/glx/clutter-stage-glx.c: + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: + Add a 'user_resizeable' setting to the backend and implement + for glx backend. + +2007-07-26 Emmanuele Bassi + + * clutter/clutter-behaviour-ellipse.c: + * clutter/clutter-behaviour.h: + * clutter/clutter-event.c: + * clutter/clutter-texture.h: + * clutter/clutter-types.h: Add missing documentation and fix + parameters names to make gtk-doc happy. + +2007-07-26 Tomas Frydrych + + * clutter/clutter-behaviour-ellipse.h: + * clutter/clutter-behaviour-ellipse.c: + * tests/test-behave.c: + + Removed tilt paramter from ClutterBehaviourEllipse constructors; + Made angles to be relative to 12 o'clock; + Added direction property; + +2007-07-26 Emmanuele Bassi + + * clutter/clutter-types.h: + * clutter/Makefile.am: Add a header for common types, to avoid + inclusion hell. + + * clutter/clutter-actor.h: + * clutter/clutter-behaviour.h: + * clutter/clutter-behaviour-rotate.h: + * clutter/clutter-behaviour-scale.h: Move some boxed types and som + enums to clutter-types.h. + +2007-07-26 Neil J. Patel + + * clutter/clutter-entry.c: (offset_to_bytes), + (clutter_entry_ensure_cursor_position), + (clutter_entry_new_with_text), (clutter_entry_new), + (clutter_entry_insert_unichar), (clutter_entry_delete_chars): + + Fixed utf8 support so it actually works now, for both + inserting and deleting chars. Fixed positioning of cursor for + utf8 chars. Both GString and Pnago need bytes (not + documented!) for string manipulation, so making sure all + values were bytes and not char positions fixed the issue. Set + a default size of 50x50 for the entry, otherwise no chars can + be seen if the size is not set after creation (which confuses + the developer). + +2007-07-26 Emmanuele Bassi + + * clutter/clutter-timeline.c: + Do not accept zero as a value for the num-frames and fps properties + in both the constructor and the setter functions. + +2007-07-26 Emmanuele Bassi + + * clutter/clutter-actor.[ch]: + * clutter/clutter-behaviour-bspline.c: + * clutter/clutter-behaviour.c: + * clutter/clutter-box.[ch]: + * clutter/clutter-clone-texture.c: + * clutter/clutter-entry.c: + * clutter/clutter-group.[ch]: + * clutter/clutter-texture.c: + * clutter/pango/pangoclutter-render.c: + * tests/test-actors.c: + * tests/test-behave.c: + * tests/test-entry.c: + * tests/test-events.c: + * tests/test-project.c: + * tests/test-rotate.c: + * tests/test-scale.c: + * tests/test-text.c: + * tests/test-textures.c: Miscellaneous compiler warning fixes. + +2007-07-26 Emmanuele Bassi + + * configure.ac: + * Makefile.am: Add a configure switch to enable strict + compiler flags, and turn it on when we are doing a distcheck. + +2007-07-25 Matthew Allum + + * Makefile.am: + * HACKING: + Add with initial notes on coding bits and bobs. + + * clutter/clutter-behaviour-scale.c: + Doc fixes. + + * clutter/clutter-event.c: (clutter_event_put): + Doc fixes. + + * clutter/glx/clutter-stage-glx.c: + Disable wm user resizing of stage (At least for now) + Doc fixes. + +2007-07-25 Tomas Frydrych + + * clutter/clutter-fixed.c: + + Fixed endianness issue in fast fp conversions. + +2007-07-25 Tomas Frydrych + + * configure.ac: + * clutter/clutter-fixed.c: + + Added --disable-fast-fp-conversion option. + +2007-07-25 Emmanuele Bassi + + * clutter/clutter-label.[ch]: Ouch, clutter_label_get_alignment() + returns a PangoAlignment, not a boolean. + +2007-07-25 Emmanuele Bassi + + * clutter/clutter-behaviour.h: + * clutter/clutter-behaviour.c: Rename clutter_behaviour_clear() + to clutter_behaviour_remove_all() to avoid method clashes in + bindings. + +2007-07-25 Tomas Frydrych + + * tests/test-rotate.c: + * tests/Makefile.am: + + Added test-rotate. + +2007-07-25 Emmanuele Bassi + + * clutter/clutter-behaviour-bspline.c: Kill off some deep pointer + indirections; use CLUTTER_NOTE() instead of ifdeffed out g_debug(); + add checks in every public entry point; move some initialisations + of private data structures out of the constructor and into the + init function, where they belong. + +2007-07-25 Matthew Allum + + * clutter/clutter-behaviour-rotate.c: + * clutter/clutter-behaviour-rotate.h: + Split 'center' prop into 3 seperate props for each axis. + Use clutter_behaviour_actors_foreach() rather than + clutter_behaviour_get_actors() to avoid copying list. + Call fixed point rotation funcs internally. + + * clutter/clutter-effect.c: + * clutter/clutter-effect.h: + Add new simple rotation based effect funcs. + +2007-07-25 Emmanuele Bassi + + * clutter/clutter.h: Include clutter-behaviour-depth.h + +2007-07-24 Emmanuele Bassi + + * clutter/clutter-behaviour-rotate.[ch]: Add a center property + for the center or rotation; implement the set_bounds() methods. + +2007-07-24 Emmanuele Bassi + + * clutter/eglx/clutter-backend-egl.c: + * clutter/eglnative/clutter-backend-egl.c: + * clutter/sdl/clutter-backend-sdl.c: Destroy the stage in every + backend. + +2007-07-24 Emmanuele Bassi + + * clutter/glx/clutter-backend-glx.c: Destroy the stage, don't + just unref it. + +2007-07-24 Emmanuele Bassi + + * clutter/clutter-main.c: Add debug markers. + +2007-07-24 Emmanuele Bassi + + * clutter/clutter-texture.[ch]: Add a ClutterTextureError + to be returned by the loader functions; use the GObject API + to allocate the private data structure instead of managing it + ourselves; add documentation. + +2007-07-24 Emmanuele Bassi + + * clutter/clutter-actor.c: + * clutter/clutter-box.h: + * clutter/clutter-stage.c: Documentation fixes. + +2007-07-24 Matthew Allum + + * clutter/cogl/gl/cogl-defines.h: + Add CGL_UNSIGNED_INT_8_8_8_8_REV (for big endian machines) + +2007-07-24 Matthew Allum + + * clutter/cogl/gl/cogl-defines.h: + Another GL_TEXTURE_RECTANGLE_ARB related fix (#404) + +2007-07-24 Matthew Allum + + * clutter/clutter-backend.c: + Minor build fixes (#413) + +2007-07-24 Emmanuele Bassi + + * clutter/clutter-effect.h: + * clutter/clutter-effect.c: Add a secondary constructor for + ClutterEffectTemplate, for use of the bindings. + +2007-07-24 Matthew Allum + + * clutter/cogl/gles/cogl.c: (cogl_get_bitmasks): + Fix typo calling glGetIntegerv rather than glGetInteger + +2007-07-24 Matthew Allum + + * clutter/cogl/gl/cogl.c: (cogl_get_features): + learn to use cpp properly. + +2007-07-24 Matthew Allum + + * clutter/clutter-media.c: (clutter_media_base_init): + Remove #if 0! signal - assume causing issues with binding generation. + (#407) + + * clutter/cogl/gl/cogl.c: + Check GL_TEXTURE_RECTANGLE_ARB and GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB + are defined in gl.h (#404) + +2007-07-24 Matthew Allum + + * clutter/glx/clutter-stage-glx.c: (clutter_stage_glx_realize): + Create stage window with correct depth/visual. Via patch from + Robert Bragg (#409). + +2007-07-23 Matthew Allum + + * clutter/clutter-texture.c: (texture_render_to_gl_quad), + (clutter_texture_paint): + Dont be over aggressive in throwing criticals for unrealized + textures. Doesn't make sense for sub classes. (#403) + +2007-07-22 Emmanuele Bassi + + Two small fixes for correctly debugging the deinitialisation + phase of the backend: + + * clutter/glx/clutter-backend-glx.c: Remove the event source + after we unref the main stage. + + * clutter/glx/clutter-stage-glx.c: Add a mark at the end of the + unrealize call (the perl bindings seem to crash before we reach + this point). + +2007-07-22 Emmanuele Bassi + + * clutter/clutter-behaviour-ellipse.c: Remove pointer indirections; + add sanity checks on the public entry points; make all the public + properties floating point (where needed) andconvert them to fixed + point internally. (Partial fix for #389) + +2007-07-22 Emmanuele Bassi + + * clutter/clutter-behaviour.[ch]: Rename ClutterBehaviour::apply + and ClutterBehaviour::remove to ClutterBehaviour::applied and + ClutterBehaviour::removed respectively, and emit them when the + behaviour has been applied (or does no longer apply) to an actor. + + (clutter_behaviour_dispose), (clutter_behaviour_finalize), + (clutter_behaviour_class_init): Move the actor removal to the + ::dispose virtual function, and remove the ::finalize one; + document the missing properties and signals. + + (clutter_behaviour_clear): Add function to clear a behaviour: + every actor will be unreffed and the ClutterBehaviour::removed + signal will be emitted. + +2007-07-21 Matthew Allum + + * clutter/clutter-event.c: + Correct clutter_event_get_state () return type. Fixes #398 + + * clutter/glx/clutter-stage-glx.c: + Disable use XFixes cursor visibility funcs. Appears to have issues + on feisty X Server at least. Fallback should work generally better. + + Fix non offscreen clutter_stage_snapshot to also rotate read pixel + data to correct orientation. + +2007-07-12 Matthew Allum + + * clutter/eglnative/clutter-event-egl.c: (clutter_event_dispatch): + Avoid sending too many events which are just pressure changes. + +2007-07-12 Matthew Allum + + * clutter/clutter-actor.c: (clutter_actor_paint): + * clutter/clutter-stage.c: (clutter_stage_get_actor_at_pos): + * clutter/cogl/cogl.h: + * clutter/cogl/gl/cogl.c: (cogl_get_viewport): + * clutter/cogl/gles/cogl.c: (cogl_get_viewport): + Hopefully fix clutter_actor_at_pos on !32bpp displays. + Based on patch from Pan Bohui, See; + http://bugzilla.openedhand.com/show_bug.cgi?id=390 + + * TODO: + More misc updates. + +2007-07-11 Emmanuele Bassi + + * clutter/clutter-behaviour-opacity.c: + Don't check direction in opacity. + +2007-07-11 Tomas Frydrych + + * clutter/clutter-fixed.h: + Fixed CLUTTER_ANGLE_ macros. + + * clutter/clutter-behaviour-ellipse.h: + * clutter/clutter-behaviour-ellipse.c: + Implemented "apply" signal closer to position actor on the start + of the elliptic path. + + (clutter_behaviour_ellipse_get_angle_begin): + (clutter_behaviour_ellipse_set_angle_begin): + (clutter_behaviour_ellipse_get_angle_end): + (clutter_behaviour_ellipse_set_angle_end): + (clutter_behaviour_ellipse_get_angle_tilt): + (clutter_behaviour_ellipse_set_angle_tilt): + Renamed with an x suffix; added versions for angles in degrees. + +2007-07-09 Matthew Allum + + * TODO: + Updates. + * clutter/clutter-stage.c: + * clutter/glx/clutter-stage-glx.c: + Fix cursor visibility property. + Force a repaint before mapping to attempt to avoid flicker. + +2007-07-09 Richard Purdie + + * clutter/eglnative/clutter-event-egl.c: + * configure.ac: + Add tslib support to eglnative backend. + +2007-07-09 Richard Purdie + + * clutter/eglnative/clutter-backend-egl.c: + Tweaks to the eglnative backend. + +2007-07-09 Richard Purdie + + * clutter/clutter-backend.c: + Make the backend add_option function optional. + +2007-07-09 Emmanuele Bassi + + * clutter/clutter-behaviour-depth.h: + * clutter/clutter-behaviour-depth.c: + * clutter/Makefile.am: Add ClutterBehaviourDepth, a simple + behaviour controlling the depth of a set of actors. + + * clutter/clutter-behaviour-opacity.c: Always make sure that + the opacity applied to the actors is a positive integer, even + in case where the start and end opacity are reversed; use the + correct cast macros for passing the opacity as a pointer. + +2007-07-06 ====================== 0.3.1 Release ======================== + +2007-07-06 Matthew Allum + + * NEWS: + * configure.ac: + Update for 0.3.1 + +2007-07-06 Matthew Allum + + * clutter/eglx/Makefile.am: + * clutter/eglx/clutter-egl.h: + * clutter/eglx/clutter-event-egl.c: + * clutter/eglx/clutter-stage-egl.c: + Rename clutter-egl.h -> clutter-eglx.h + + * NEWS: + * README: + Add info re EGL split. + +2007-07-06 Matthew Allum + + * clutter/Makefile.am: + * clutter/eglnative/Makefile.am: + * clutter/eglnative/clutter-backend-egl.c: + * clutter/eglnative/clutter-backend-egl.h: + * clutter/eglnative/clutter-egl.h: + * clutter/eglnative/clutter-event-egl.c: + * clutter/eglnative/clutter-stage-egl.c: + * clutter/eglnative/clutter-stage-egl.h: + * clutter/eglx/Makefile.am: + * clutter/eglx/clutter-backend-egl.c: + * clutter/eglx/clutter-egl.h: + * clutter/eglx/clutter-event-egl.c: + * clutter/eglx/clutter-stage-egl.c: + * configure.ac: + Add a new 'native' EGL backend for non X based EGL's + (i.e on framebuffer). + Rename old backend to 'eglx' and namespace public funcs with this. + + * clutter/pango/pangoclutter-private.h: + Add extra checks for expected defines. + +2007-07-06 Matthew Allum + + * NEWS: + * README: + Updates for upcoming 0.3.1 release. + * clutter/egl/Makefile.am: + * clutter/egl/clutter-backend-egl.c: + * clutter/egl/clutter-backend-egl.h: + * clutter/egl/clutter-egl.h: + * clutter/egl/clutter-event-egl.c: + * clutter/egl/clutter-stage-egl.c: + * clutter/egl/clutter-stage-egl.h: + * configure.ac: + Move egl -> eglx + +2007-07-06 Matthew Allum + + * clutter/clutter-box.c: (clutter_box_pick): + Call clutter_box_paint rather than actor paint method avoiding + infinte loop (Fixes test-boxes crasher). + + * clutter/glx/clutter-stage-glx.c: (clutter_stage_glx_unrealize): + Trap the X calls to avoid potential X errors. + +2007-07-06 Ross Burton + + * tests/Makefile.am: + Dist redhand.png. + +2007-07-05 Tomas Frydrych + + * cluter/clutter-group.c: + (clutter_group_query_coords:) + Reset box size to zero width and height to report correct size if + the contents of the group shrink. + +2007-07-05 Emmanuele Bassi + + * clutter/clutter-rectangle.c: Fix off-by-border-width bug + in the border creation of a ClutterRectangle. + +2007-07-05 Tomas Frydrych + + * clutter/clutter-fixed.h: + * clutter/clutter-fixed.c: + Added CLUTTER_FLOAT_TO_UINT macro; + (clutter_pow2x): + Fixed sign issue. + +2007-07-04 Emmanuele Bassi + + * clutter/*: Loads of fixes for the API reference. + +2007-07-04 Emmanuele Bassi + + Merge from clutter/work + + * clutter/clutter-alpha.[ch]: Fix the argument names for + the smoothstep alpha functions, for gtk-doc. + + * clutter/clutter-group.c (clutter_group_remove_all): Fix + the iteration on the children list. + +2007-07-04 Emmanuele Bassi + + * clutter/clutter-main.c (clutter_redraw): Move the stage + paint init call from the main redraw function... + + * clutter/clutter-stage.c (clutter_stage_paint): ... to the + ClutterActor::paint() overridden method in ClutterStage. + +2007-07-04 Emmanuele Bassi + + * clutter/clutter.h: + * clutter/Makefile.am: ClutterBackend is marked as public API, + so install the clutter-backend.h header and include it when + including clutter.h. + +2007-07-04 Emmanuele Bassi + + * clutter/clutter-entry.[ch]: Various fixes to ClutterEntry: + fix code style issues; add documentation for the various + properties; add ClutterEntry:entry-padding property, for controlling + the text padding (until we have style properties separated from + the object properties); notify property changes; free resources + in the ::finalize method; rename clutter_entry_add() to + clutter_entry_insert_unichar(), and clutter_entry_remove() to + clutter_entry_delete_chars() - for bindings and for matching the + insert_text() and delete_text() existing methods; add a getter + method for the max-length property. + +2007-07-04 Emmanuele Bassi + + * clutter/clutter-actor.[ch]: Use the right get_type() function + name for ClutterVertex, and add the CLUTTER_TYPE_VERTEX macro. + +2007-07-03 Ross Burton + + * configure.ac: + Check for XFixes 4 and above. + +2007-07-02 Tomas Frydrych + + * clutter/clutter-actor.h: + * clutter/clutter-actor.c: + * tests/test-project.c: + (clutter_actor_apply_transform_to_point): + Use ClutterVertex for input and output parameters. + +2007-07-01 Emmanuele Bassi + + Merge from clutter.git/work branch + + * clutter/clutter-effect.[ch]: Clean up ClutterEffect; use a + pointer to access the private data structure, instead of doing + a type check every time. Add description for the API reference. + + * docs/reference/clutter-sections.txt: + * clutter/*.[ch]: Add various documentation fixes. + + * clutter/clutter-entry.c: Remove a stray g_print() call. + +2007-06-29 Neil J. Patel + + * clutter/clutter-entry.c: (clutter_entry_handle_key_event), + (clutter_entry_add), (clutter_entry_remove): + Check if unichar == 0, and if so, return, as it will cause a delete in + the GString. + +2007-06-20 ============== 0.3 Release ==================================== + +2007-06-29 Matthew Allum + + * clutter/clutter-texture.c: (texture_upload_data): + Fix a SEGV for GL ES textures. + + * clutter/cogl/gles/cogl.c: (cogl_setup_viewport): + Tweak default z_camera for 60 degrees like GL. + + * clutter/egl/clutter-backend-egl.c:: + * clutter/egl/clutter-stage-egl.c: + Fix edpy usage (thanks to Kaj Gronholm). + +2007-06-29 Tomas Frydrych + + * clutter/clutter-group.c: + (clutter_group_query_coords): + Fixed box calculation. + +2007-06-28 Tomas Frydrych + + * clutter/clutter-group.c: + (clutter_group_raise): + (clutter_group_lower): + Fixed SIGSEGV when attempting to raise / lower an only child. + +2007-06-28 Matthew Allum + + * clutter/cogl/gl/cogl.c: (cogl_setup_viewport): + Improve fixed z_camera value for defualt perspective. + Appears pixel perfect on ATI and Intel at least + +2007-06-28 Tomas Frydrych + + * tests/test-perspective.c: + Moved red dots to be positioned 1px off each corner. + +2007-06-28 Matthew Allum + + * tests/Makefile.am: + * tests/test-perspective.c: + Add simple perspective test + +2007-06-27 Tomas Frydrych + + * clutter/clutter-actor.h: + * clutter/clutter-actor.c: + * tests/test-project.c: + Renamed clutter_actor_project_point() to + clutter_actor_apply_trasform_to_point() and + clutter_actor_project_vertices() to clutter_actor_get_vertices(). + +2007-06-27 Tomas Frydrych + + * clutter/clutter-actor.h: + * clutter/clutter-actor.c: + * tests/test-project.c: + (clutter_actor_project_point): + Separated input from output parameters. + +2007-06-27 Matthew Allum + + * Makefile.am: + Dont remove README on make clean + +2007-06-27 Tomas Frydrych + + * clutter/clutter-actor.c: + (_clutter_actor_apply_modelview_transform): + Fixed incorrect order of scaling an rotation that was causing + objects that were both rotated and scaled to change position. + +2007-06-27 Tomas Frydrych + + * clutter/clutter-actor.c: + (clutter_actor_scale_with_gravityx): + Made to work after changes to the behavivour of + clutter_actor_get_absolute_size() for rotated actors. + +2007-06-26 Tomas Frydrych + + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl.c: + (cogl_setup_viewport): + For default perspective angle of 60 degrees, use a hardcoded + z_camera constant that provides minimal artefacts when rendering + text; for other angles we calculate. + +2007-06-26 Tomas Frydrych + + * clutter/clutter-actor.h: + * clutter/clutter-actor.c: + Added fixed point version of clutter_actor_rotate_*() functions + and accessors for rotation angles. + +2007-06-25 Matthew Allum + + * README: + Update a little more. + * clutter/clutter-effect.c: + Add missing func documentation + * clutter/clutter-rectangle.c: + Fix border drawing. + +2007-06-25 Tomas Frydrych + + * clutter/clutter-fixed.h: + Fixed definition of clutter_cosx() macro. + + * clutter/clutter-stage.c: + * clutter/cogl/cogl.h: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl.c: + Changed ClutterPerspective.fovy from ClutterAngle to degrees to + improve precission in Z-camera calculations. + +2007-06-22 Matthew Allum + + * README: + * README.in: + * autogen.sh: + * configure.ac: + Move back to regular README naming at least for now. + +2007-06-22 Matthew Allum + + * NEWS: + * README.in: + * TODO: + Update for 0.3 release. + + * clutter/clutter-actor.c: + Minor doc fixups + + * clutter/clutter-texture.c: + Various minor additions for handling non RGBA data. + Fix a typo breaking clutter_texture_get_pixbuf() on tiled textures. + + * tests/test-actors.c: + Disable scaling to avoid drifting (temporary till API is fixed) + +2007-06-21 Emmanuele Bassi + + * clutter/clutter-timeline.c: Allow disabling the timeline pool + by using the CLUTTER_TIMELINE environment variable set to + "no-pool". + +2007-06-19 Emmanuele Bassi + + * README.in: Update release notes. + +2007-06-19 Matthew Allum + + * clutter/clutter-main.c: (clutter_init_with_args), (clutter_init): + Safer checks for setting progname if NULL is passed in init. + +2007-06-19 Emmanuele Bassi + + * autogen.sh: autoreconf needs a README. + +2007-06-19 Matthew Allum + + * TODO: + Sync up a little. + * clutter/clutter-main.c: + Set a default window title based on g_prgname(). + + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: + * clutter/egl/clutter-stage-egl.c: + * clutter/glx/clutter-stage-glx.c: + * clutter/sdl/clutter-stage-sdl.c: + Alter draw_to_pixbuf to return a pixbuf + + * configure.ac: + Only full in gdk-pixbuf-xlib as a GLX backend dep. + + * tests/test-entry.c: + Fix a couple of warnings. + +2007-06-19 Emmanuele Bassi + + * Makefile.am: Add README.in to the EXTRA_DIST. + +2007-06-19 Emmanuele Bassi + + * configure.ac: + * README.in: Use a template for the README file, so that + it gets the right version number. + +2007-06-19 Matthew Allum + + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: + * clutter/glx/clutter-stage-glx.c: + * clutter/sdl/clutter-stage-sdl.c: + Add window title setting/getting functionality. + + * clutter/clutter-event.c: (clutter_key_event_unicode): + Remove uneeded convert case call. + + * clutter/cogl/gl/cogl.c: (cogl_rectangle) + Use parameters correctly for underlying GL rect call. + + * tests/test-entry.c: + Add a window title. + +2007-06-18 Matthew Allum + + * clutter/sdl/clutter-event-sdl.c: + Seemingly fix SDL Event source. + Add some very basic SDL keysym translation. + (Thanks to Thomas Van Machelen for initial translation code) + + * tests/test-events.c: + Dump some info on keysyms pressed. + +2007-06-16 Emmanuele Bassi + + * clutter/clutter-actor.h: + * clutter/clutter-stage.h: Add 32 padding slots; when we + reach 1.0 it'll be a long road until the following ABI + break. + + * tests/test-behave.c: Don't forget to include headers. + +2007-06-16 Emmanuele Bassi + + * clutter/clutter-container.h: + * clutter/clutter-layout.h: Interfaces are not checked + at compile-time, so there's not need to add padding to + avoid ABI breaks. + +2007-06-16 Emmanuele Bassi + + * configure.ac: Partially revert last commit, and fail + with AC_MSG_ERROR() instead of disabling the manual build + if no jw and xmlto were found. + +2007-06-16 Emmanuele Bassi + + * configure.ac: If the programs required to build the manual + are not found and --enable-manual was passed, then just print + a warning and disable the manual build instead of aborting the + configure. + + * doc/manual/Makefile.am: Use the full path gathered by the + configure script when invoking jw and xmlto. + +2007-06-16 Matthew Allum + + * clutter/clutter-actor.c: + Fix typo in x rotation transform (Thanks to Johan Billen #138) + + * configure.ac: + * doc/manual/Makefile.am: + Fix manual build and required program check. + + * tests/Makefile.am: + Another typo fix. + +2007-06-15 Tomas Frydrych + + * clutter/clutter-actor.c: + Added some comments; renamed MTX_GL_SCALE to MTX_GL_SCALE_X for + consistency; removed some debug output. + +2007-06-14 Tomas Frydrych + + * clutter/clutter-vbox.c: + * clutter/clutter-hbox.c: + (clutter_vbox_pack_child): + (clutter_hbox_pack_child): + Fixed child coords. + +2007-06-14 Emmanuele Bassi + + * clutter/clutter-box.[ch]: Base class for layout containers. + + * clutter/clutter-hbox.[ch]: Horizontal box actor. + + * clutter/clutter-vbox.[ch]: Vertical box actor. + + * clutter/clutter.h: + * clutter/Makefile.am: Build glue + + * tests/Makefile.am: + * tests/test-boxes.c: Test suite for ClutterBox API and + implementations. + +2007-06-14 Matthew Allum + + * clutter/cogl/gl/cogl.c: (cogl_check_extension): + Actually populate this func and remove the static alternate + named one. Means GLX actually checks for available extensions. + Other minor tidy ups. + + * clutter/glx/clutter-backend-glx.c: + * clutter/glx/clutter-backend-glx.h: + Add support for GLX_SGI_swap_control to do vblanking prefering + over glXGetVideoSyncSGI. Should fix issues on Intel chips with + very slow frame rates due to vblank problems. + Thanks to Michel Danzer for tips, see; + http://bugs.freedesktop.org/show_bug.cgi?id=10542 + + * test/test-actors.c: + Change FPS to 60. + +2007-06-14 Emmanuele Bassi + + * clutter/clutter-timeout-pool.c: Make ClutterTimeoutPool + more thread-safe, using a static lock. + + (clutter_timeout_pool_dispatch), (clutter_timeout_pool_remove): Fix + a race condition-turned-in-memory corruption bug, triggered by + removing a timeout from the pool while still spinning the pool + source. + +2007-06-14 Emmanuele Bassi + + * configure.ac: + * doc/manual/Makefile.am: Find xmlto and jw in the path and + use the symbolic names when building the manual. + +2007-06-14 Tomas Frydrych + + * clutter/clutter-actor.c: + (clutter_actor_get_abs_position): + (clutter_actor_get_abs_size): + Reimplement using clutter_actor_project_point() and + clutter_actor_project_vertices(). + + * tests/test-project.c: + Rename clutter_actor_allocate_coords -> clutter_actor_query_coords + +2007-06-14 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + * clutter/clutter-group.c: + * clutter/clutter-label.c: + * clutter/egl/clutter-stage-egl.c: + * clutter/glx/clutter-stage-glx.c: + * clutter/sdl/clutter-stage-sdl.c: + Rename clutter_actor_allocate_coords -> clutter_actor_query_coords + + Change repaints to G_PRIORITY_DEFAULT + 10. + (timelines are G_PRIORITY_DEFAULT + 30, events G_PRIORITY_DEFAULT) + + * clutter/glx/clutter-event-glx.c: + Handle shift modifier in keycode -> keysym translation. + + * tests/test-actors.c: + Remove (broken) screen saver code. + Add scaling behaviour, clean code a little. + +2007-06-13 Tomas Frydrych + + * clutter/clutter-actor.c: + (clutter_actor_project_vertices): + (clutter_actor_project_proint): + Fixed translation of Y coords to match the windowing system. + + * clutter/egl/clutter-stage-egl.c: + * clutter/glx/clutter-stage-glx.c: + * clutter/sdl/clutter-stage-sdl.c: + (clutter_stage_*_request_size): + Initialize viewport when setting/resetting stage side. + + * tests/Makefile.am + * tests/test-project.c: + An interactive test of the projection stuff. + +2007-06-12 Tomas Frydrych + + * clutter/clutter-main.c: + (clutter_redraw): + Clear CLUTTER_ACTOR_SYNC_MATRICES flag after setting up viewport. + +2007-06-12 Matthew Allum + + * doc/manual/Makefile.am: + Fix typo in Makefile so PDF's actually get built. + + * doc/manual/clutter-manual.xml.in: + Add an FAQ section with initial entry. + +2007-06-12 Tomas Frydrych + + * clutter/clutter-fixed.h: + Added shorthand CFX_QMUL macro. + + * clutter/clutter-private.h: + * clutter/clutter-actor.h: + * clutter/clutter-actor.c: + Replaced ClutterVertices with ClutterVertex; + + (clutter_actor_get_transformed_vertices): + (clutter_actor_get_transformed_point): + Replaced with clutter_actor_projected_vertices and + clutter_actor_projected_point. + + (_clutter_actor_apply_modelview_transform): + (_clutter_actor_apply_modelview_transform_recursive): + Private functions to push actor modelview transforms on OpenGL + stack. + + * clutter/cogl/cogl.h: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl.c: + (cogl_get_viewport): + (cogl_get_modelview_matrix): + (cogl_get_projection_matrix): + Functions to access OpenGL transforms. + +2007-06-12 Matthew Allum + + * clutter/clutter-alpha.c: + Remove stray g_debug. + + * clutter/clutter-behaviour-rotate.c: + Register private class member. + + * clutter/clutter-behaviour.c: + * clutter/clutter-behaviour.h: + Add applied and removed signals. + + * Makefile.am: + * configure.ac: + * examples/Makefile.am: + * examples/README: + * examples/behave.c: + * examples/slider.c: + * examples/super-oh.c: + * examples/test-entry.c: + * examples/test-text.c: + * examples/test.c: + * tests/Makefile.am: + Remove examples, moving applicable code into tests. + +2007-06-11 Tomas Frydrych + + * clutter/clutter-alpha.c: + (clutter_alpha_sine_inc): + (clutter_alpha_sine_dec): + (clutter_alpha_sine_half): + Fixed unsigned overflow. + +2007-06-11 Emmanuele Bassi + + * clutter/clutter-event.h: Add full modifier masks enums. + + * clutter/glx/clutter-event-glx.c: Copy the modifier masks from + the native X event structure. + + * clutter/clutter-event.c: Convert to upper case if the + shift or the lock masks are applied. + +2007-06-09 Emmanuele Bassi + + * clutter/clutter.h: + * clutter/clutter-timeout-pool.[ch]: Add a timeout pool source; + every timeout added to this pool will use a single slice of the + main loop. + + * clutter/clutter-timelince.c: Use a per-class timeout pool for + every timeline. + +2007-06-08 Matthew Allum + + * clutter/clutter-texture.c: (clutter_texture_get_pixbuf): + Remove stray printf. + +2007-06-08 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/clutter-debug.h: + * clutter/clutter-main.c: + * clutter/clutter-main.h: + * clutter/clutter-private.h: + * clutter/clutter-timeline.c: + Add 'schedule' debug flag and new CLUTTER_TIMESTAMP macro. + + * clutter/clutter-texture.c: + * clutter/clutter-texture.h: + * clutter/cogl/cogl.h: + * clutter/cogl/gl/cogl-defines.h: + * clutter/cogl/gles/cogl-defines.h: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl.c: + Add initial experiemental YUV texture support. + Move texture rect size checks into cogl. + Better handle moving texture data from video -> system memory + (if support available). + +2007-06-07 Neil J. Patel + + * clutter/clutter-entry.c: (clutter_entry_class_init), + (clutter_entry_handle_key_event): + * clutter/clutter-entry.h: + Added an 'activated' signal, which is emitted when the 'Enter' key is + pressed. + + * examples/test-entry.c: (on_entry_activated), (main): + Added a test handler for the activated signal. + +2007-06-07 Emmanuele Bassi + + * clutter/*: Move documentation from the templates into the + source code. + +2007-06-07 Emmanuele Bassi + + * clutter/clutter-container.[ch]: Add a generic actor container + interface, for actors to implement without subclassing ClutterGroup. + + * clutter/clutter-group.[ch]: Make ClutterGroup implement the + ClutterContainer interface, and deprecate the colliding methods. + + * clutter/clutter-layout.[ch]: Add extended layout interface. + Actors and containers requiring or honouring complex layout + management should implement this interface and provide at least + one of the available layout types: width for height, height for + width, natural size, iterative size request. + + * clutter/clutter-label.c: A ClutterLabel requires height for + width layout management, so it implements the ClutterLayout + interface. + + * clutter/Makefile.am: Add new files to the build. + + * tests/*.c: + * examples/*.c: Update tests and examples code to use the + new ClutterContainer API instead of ClutterGroup. + +2007-06-07 Emmanuele Bassi + + * clutter/clutter-timeline.[ch]: Add a "delay" property, which + delays the real start of the timeline by a number of milliseconds. + + (clutter_timeline_clone): Rename clutter_timeline_copy() to + clutter_timeline_clone(), for consistency. + +2007-06-01 Neil J. Patel + + * clutter/clutter-entry.c: (clutter_entry_set_property), + (clutter_entry_get_property), (clutter_entry_class_init), + (clutter_entry_init), (clutter_entry_set_text), + (clutter_entry_set_max_length): + * clutter/clutter-entry.h: + * examples/test-entry.c: (main): + Added a max-length property whihc limits the length of the text in the + entry. + +2007-06-01 Neil J. Patel + + * clutter/clutter-entry.c: (clutter_entry_ensure_cursor_position), + (clutter_entry_paint), (clutter_entry_init), + (clutter_entry_handle_key_event): + Clipping within the entry class to stop it over-slipping its + boundries. + Text will move within the clip region to keep the cursor always + visible. + Added some padding to the left and right to make sure cursor is + always show. + +2007-06-01 Tomas Frydrych + + * clutter/clutter-actor.c: + * clutter/clutter-stage.c: + * clutter/clutter-private.h: + Removed perspective matrix caching from ClutterStage. + +2007-06-01 Neil J. Patel + + * clutter/clutter-entry.c: (clutter_entry_set_property), + (clutter_entry_get_property), (clutter_entry_ensure_layout), + (clutter_entry_class_init), (clutter_entry_init), + (clutter_entry_set_visibility), (clutter_entry_get_visibility), + (clutter_entry_set_invisible_char), + (clutter_entry_get_invisible_char): + * clutter/clutter-entry.h: + Added text-visibility, which will allow you to show all entered text + as a nominated charaecter ('*' is default). + + * examples/test-entry.c: (main): + +2007-06-01 Neil J. Patel + + * clutter/clutter-entry.c: (clutter_entry_ensure_cursor_position), + (clutter_entry_clear_cursor_position), + (clutter_entry_paint_cursor), (clutter_entry_paint), + (clutter_entry_class_init), (clutter_entry_set_text), + (clutter_entry_set_position): + * clutter/clutter-entry.h: + Added a signla to track cursor movements. + Moved the sursor painting function so it can be subclassed. + +2007-06-01 Tomas Frydrych + + * clutter/clutter-actor.c: + (clutter_actor_get_transformed_point): + Make input again relative to the actor; feed depth into transform. + +2007-06-01 Neil J. Patel + + * clutter/clutter-entry.c: (clutter_entry_class_init), + (clutter_entry_set_text): + * clutter/clutter-entry.h: + * examples/test-entry.c: (on_entry_text_changed), (main): + Added a text-changed signal to the entry. + +2007-06-01 Neil J. Patel + + * clutter/clutter-effect.h: + Removed extra G_END_DECLS outside the #endif + + * clutter/clutter-entry.c: (clutter_entry_handle_key_event), + (clutter_entry_add): + * clutter/clutter-entry.h: + * examples/test-entry.c: (on_key_release_cb): + Added a function to deal with ClutterKeyEvents. Handles the majority + of entry-related keyboard keys. However modifiers still need to be + implemented. + +2007-06-01 Tomas Frydrych + + * clutter/clutter-actor.c: + (mtx_create): + Apply perspective transform before all other transforms. + +2007-06-01 Tomas Frydrych + + * clutter/clutter-stage.c: + (clutter_stage_init): + Call _clutter_stage_refresh_perspective_matrix to initialize the + matrix for default values. + +2007-06-01 Tomas Frydrych + + * clutter/clutter-fixed.h: + * clutter/clutter-behaviour-ellipse.h: + * clutter/clutter-behaviour-ellipse.c: + * clutter/clutter-behaviour-bspline.h: + * clutter/clutter-behaviour-bspline.c: + Documentation fixes. + +2007-05-31 Tomas Frydrych + + * clutter/clutter-stage.c: + * clutter/clutter-private.h: + (_clutter_stage_get_perspective_matrix): + New function. + + * clutter/clutter-actor.c: + (clutter_actor_get_tranformed_vertices): + (clutter_actor_get_tranformed_point): + Apply perspective matrix on the top of actor transform matrix. + +2007-05-31 Neil J Patel + + * clutter/Makefile.am: + * clutter/clutter-entry.c: (clutter_entry_set_property), + (clutter_entry_get_property), (clutter_entry_ensure_layout), + (clutter_entry_clear_layout), + (clutter_entry_ensure_cursor_position), (clutter_entry_paint), + (clutter_entry_request_coords), (clutter_entry_dispose), + (clutter_entry_finalize), (clutter_entry_class_init), + (clutter_entry_init), (clutter_entry_new_with_text), + (clutter_entry_new_full), (clutter_entry_new), + (clutter_entry_get_text), (clutter_entry_set_text), + (clutter_entry_get_font_name), (clutter_entry_set_font_name), + (clutter_entry_set_color), (clutter_entry_get_color), + (clutter_entry_get_layout), (clutter_entry_set_alignment), + (clutter_entry_get_alignment), (clutter_entry_set_position), + (clutter_entry_get_position), (clutter_entry_add), + (clutter_entry_remove), (clutter_entry_insert_text), + (clutter_entry_delete_text), (clutter_entry_set_visible_cursor), + (clutter_entry_get_visible_cursor): + * clutter/clutter-entry.h: + * clutter/clutter.h: + * examples/Makefile.am: + Initial import of ClutterEntry actor. + + * examples/test-entry.c: (on_key_release_cb), (main): + A basic test for ClutterEntry + +2007-05-31 Tomas Frydrych + + * clutter/clutter-actor.c: + (clutter_actor_get_transformed_point): + Fixed coordinance translation. + +2007-05-31 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + Add clutter_actor_get_transformed_point() + + * clutter/clutter-main.c: + Plug in perspective setup to redraw + + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: + Remove audience code for now. + +2007-05-31 Matthew Allum + + * clutter/egl/clutter-backend-egl.c: + * clutter/egl/clutter-backend-egl.h: + * clutter/egl/clutter-event-egl.c: + * clutter/egl/clutter-stage-egl.c: + * clutter/egl/clutter-stage-egl.h: + Rename Egl -> EGL + +2007-05-31 Matthew Allum + + * clutter/glx/clutter-backend-glx.c: + * clutter/glx/clutter-backend-glx.h: + * clutter/glx/clutter-event-glx.c: + * clutter/glx/clutter-glx.h: + * clutter/glx/clutter-stage-glx.c: + * clutter/glx/clutter-stage-glx.h: + Change type nameing from Glx -> GLX. + Add basic event filtering functionality + +2007-05-31 Tomas Frydrych + + * clutter/clutter-behaviour-ellipse.c: + Changed behaviour so that a beginning angle of 0 would correspond + to 12 o'clock. + +2007-05-31 Tomas Frydrych + + * clutter/clutter-fixed.h: + * clutter/clutter-fixed.c: + (_clutter_double_to_int): + Fixed return value to gint; added missing cast that broke negative + number conversions. + + (CLUTTER_ANGLE_FROM_DEGX): + Swapped division and multiplication around to avoid overflows. + + * clutter/clutter-behaviour-ellipse.c: + Fixed incorrectly set lower bounds for angle properties. + + * clutter/clutter-actor.h: + * clutter/clutter-actor.c: + Added ClutterVertices type. + (clutter_actor_get_transformed_vertices): + New function. + +2007-05-31 Matthew Allum + * TODO: + Sync up for whats left for 0.4 release (and 0.6 ideas) + +2007-05-31 Matthew Allum + + * clutter/clutter-behaviour-ellipse.c: + Remove uneeded knot signal + + * clutter/clutter-behaviour-path.c: + Fix so knot signal is emitted only when a knot is reached. + + * clutter/clutter-effect.c: + * clutter/clutter-effect.h: + Add a scale effect. + + * configure.ac: + * doc/manual/Makefile.am: + * doc/manual/clutter-manual.xml.in: + * doc/manual/manual.xsl: + * doc/manual/style.css: + Add various bits for application developers manual. + +2007-05-30 Tomas Frydrych + + * clutter/clutter-alpha.h: + * clutter/clutter-alpha.c: + Removed ClutterSmoothstep struct + (clutter_smoothstep_inc_func): + Renamed to clutter_smoothstep_func. + (clutter_smoothstep_added_func): + Added. + +2007-05-29 Tomas Frydrych + + * clutter/clutter-fixed.h: + (clutter_cosx): + (clutter_cosi): + Fixed wrong sign in cos -> sin tranformation. + + * clutter/clutter-behaviour-ellipse.c: + (clutter_behaviour_ellipse_advance): + Replaced coordinace calculation for tilted ellipse with a sane + algorithm. + + * examples/behave.c: + Added tilt parameter to the example ellptic path. + +2007-05-29 Tomas Frydrych + + * clutter/cogl/gles/cogl.c: + (cogl_setup_viewport): + Fixed z_camera calculation. + +2007-05-28 Matthew Allum + + * clutter/clutter-texture.c: (clutter_texture_unrealize): + Dont even try to move texture pixels from video -> system + ram on unrealisation for GL/ES + +2007-05-28 Matthew Allum + + * clutter/clutter-stage.c: (clutter_stage_get_actor_at_pos): + Fix for GL/ES. Barring texture reads this means all clutter + functionality now works on GL/ES! (no doubt with a few yet to + be discovered bugs) + +2007-05-28 Matthew Allum + + * clutter/clutter-backend.c: + * clutter/clutter-backend.h: + * clutter/glx/clutter-stage-glx.c: + * clutter/glx/clutter-backend-glx.c: + Fix up rendering pipeline removing clutter_backend_XXX_stage_paint + and adding clutter_backend_XXX_redraw instead. Duplicates less + code in backends, avoids clutter_actor_paint() getting called + before stage is set up (viewport wise) and unbreaks things like + picking. + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + * clutter/clutter-main.c: + * clutter/clutter-private.h: + * clutter/clutter-stage.c: (clutter_stage_get_actor_at_pos): + Redo picking functionality a different way (via color indexing) + as to provide more flexibility, possibly speed and more likely + work with GL/ES (doesn't currently however - not sure why). + + * clutter/clutter-group.c: + Add groups own 'pick' method. + + * clutter/cogl/cogl.h: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl.c: + Move clipping funtionality into cogl. + + * clutter/cogl/gles/cogl-defines.h: + Hack around missing BGR format in GL/ES. + + * clutter/egl/clutter-backend-egl.c: + * clutter/egl/clutter-backend-egl.h: + * clutter/egl/clutter-stage-egl.c: + * clutter/sdl/clutter-backend-sdl.c: + * clutter/sdl/clutter-backend-sdl.h: + * clutter/sdl/clutter-event-sdl.c: + * clutter/sdl/clutter-stage-sdl.c: + Update backends to newer API. + Add basic mouse event translation to SDL. + +2007-05-25 Matthew Allum + + * clutter/clutter-color.c: (clutter_color_parse): + Handle #rrggbbaa color setting strings (i.e with alpha). + Set alpha to 0xff if it is not specified. + + * clutter/clutter-stage.c: (clutter_stage_get_actor_at_pos) + Increase select buffer. + + * examples/super-oh.c: + Fix up use of clutter_group_show_all() + +2007-05-25 Tomas Frydrych + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + Renamed clutter_actor_scalex() to clutter_actor_set_scale_with_gravityx + Added floating point version clutter_actor_set_scale_with_gravity. + + * clutter/clutter-units.h: + * clutter/clutter-actor.h: + typedef ClutterUnit + + * clutter/clutter-fixed.h: + * clutter/clutter-stage.c: + CLUTTER_ANGLE_FROM_DEG(), CLUTTER_ANGLE_FROM_DEGX() + renamed CLUTTER_DEGF_TO_CLUTTER_ANGLE to CLUTTER_ANGLE_FROM_DEGF + + * clutter/clutter-behaviour-ellipse.h: + * clutter/clutter-behaviour-ellipse.c: + * examples/behave.c: + (clutter_behaviour_ellipse_new): + Changed signature to take angles in degrees, and x,y offsets. + (clutter_behaviour_ellipse_newx): + Fixed version clutter_behaviour_ellipse_new. + (clutter_behaviour_ellipse_set_center): + (clutter_behaviour_ellipse_get_center): + Changed signature to take x,y coords instead of ClutterKnot. + + clutter/cogl/gl/cogl.c: + clutter/cogl/gles/cogl.c: + (cogl_setup_viewport): + Added z_camera calculation. + +2007-05-25 Matthew Allum + + * Makefile.am: + Install a default flavour .pc file. + + * clutter/clutter-actor.c: + Translate units correctly for translate() + + * clutter/clutter-feature.h: + Add new texture features. + + * clutter/clutter-fixed.h: + Add clutter angle conversion defines. + + * clutter/clutter-group.c: + Use cogl not GL. Dont recurse on show all. + + * clutter/clutter-private.h: + Remove sync_viewport. + + * clutter/clutter-rectangle.c: + Fix cogl typo. + + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: + Add perspective settings. Remove viewport_sync. + Add audience stubs. Fix up actor_at_pos a little (still broken) + + * clutter/clutter-texture.h: + * clutter/clutter-texture.c: + Redo pixel uploading. Add initial (disabled) YUV support. + + * clutter/clutter-timeline.c: + Fire 'completed' signal when looping. + + * clutter/cogl/gl/cogl.c: + Move some backend checks here. + + * clutter/glx/clutter-backend-glx.c: + Actually check target display has GLX ext. + + * clutter/glx/clutter-stage-glx.c: + Handle offscreen failing more gracefully. + + * examples/Makefile.am: + Use AM_LDFLAGS. + + * clutter/clutter-main.c: + * clutter/clutter-feature.c: + * clutter/clutter-backend.c: + * clutter/clutter-alpha.c: + Fix a compile warnings. + + * tests/Makefile.am: + * tests/test-offscreen.c: + * tests/test-scale.c: + More tests. + +2007-05-23 Tomas Frydrych + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + (clutter_actor_get_abs_size_units): + (clutter_actor_get_abs_position_units): + removed from public api + +2007-05-22 Tomas Frydrych + + * configure.ac: + * Makefile.am: + * clutter.pc.in: + * clutter/Makefile.am: + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + * clutter/clutter-group.c: + * clutter/clutter-label.c: + * clutter/clutter-real.h: + * clutter/clutter-units.h: + * clutter/clutter.h: + * clutter/egl/clutter-stage-egl.c: + * clutter/glx/clutter-stage-glx.c: + * clutter/sdl/clutter-stage-sdl.c: + * examples/Makefile.am: + * tests/Makefile.am: + Removed ClutterReal; added clutter-units. + +2007-05-18 Tomas Frydrych + + * configure.ac: + * Makefile.am: + * clutter.pc.in: + * clutter/Makefile.am: + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + * clutter/clutter-behaviour-scale.c: + * clutter/clutter-behaviour-scale.h: + * clutter/clutter-group.c: + * clutter/clutter-label.c: + * clutter/clutter-real.h: + * clutter/egl/clutter-stage-egl.c: + * clutter/glx/clutter-stage-glx.c: + * examples/Makefile.am: + * tests/Makefile.am: + ClutterReal type. + +2007-05-17 Emmanuele Bassi + + * clutter/clutter-main.c: Use clutter_base_init() inside the + initialisation process, instead of calling g_type_init() directly. + + * clutter/clutter-alpha.c: + * clutter/clutter-behaviour-bspline.c: + * clutter/clutter-behaviour-ellipse.c: Fix API documentation. + +2007-05-17 Matthew Allum + + * configure.ac: + Fix CLUTTER_NO_FPU typo. + +2007-05-17 Tomas Frydrych + + * clutter/clutter-alpha.h: + * clutter/clutter-alpha.c: + * doc/reference/clutter-sections.txt: + Added clutter_exp_inc_func() and clutter_exp_dec_func(). + +2007-05-16 Emmanuele Bassi + + * clutter/clutter-main.[ch]: Add clutter_base_init(), semi-private + function to initialise just the base Clutter functionalities; it's + only used by gtk-doc to introspect the classes. + + * clutter/clutter-feature.c: Do not access the private features + data structure unless it has been initialised. + +2007-05-16 Tomas Frydrych + + * clutter/clutter-alpha.h: + * clutter/clutter-alpha.c: + * doc/reference/clutter-sections.txt: + Added clutter_sine_half(). + +2007-05-16 Tomas Frydrych + + * clutter/clutter-alpha.h: + * clutter/clutter-alpha.c: + * doc/reference/clutter-sections.txt: + Fixed clutter_sine_inc(), added clutter_sine_dec(). + +2007-05-16 Tomas Frydrych + + * clutter/clutter-alpha.h: + * clutter/clutter-alpha.c: + * doc/reference/clutter-sections.txt: + * doc/rererence/clutter.types: + * doc/reference/tmpl/clutter-alpha.sgml: + clutter_smoothstep_func alpha function, + ClutterSmoothstep struct for smoothstep function data. + +2007-05-16 Matthew Allum + + * clutter/clutter-backend.c: + * clutter/clutter-backend.h: + * clutter/clutter-feature.c: + * clutter/clutter-feature.h: + * clutter/clutter-main.c: + * clutter/clutter-main.h: + * clutter/clutter-private.h: + * clutter/clutter-stage.c: + * clutter/cogl/cogl.h: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl.c: + * clutter/glx/clutter-backend-glx.c: + * clutter/glx/clutter-backend-glx.h: + * clutter/glx/clutter-glx.h: + * clutter/glx/clutter-stage-glx.c: + * clutter/glx/clutter-stage-glx.h: + Rejig the features() foo, moving mostly into backends/cogl. + +2007-05-15 Tomas Frydrych + + * clutter/clutter-actor.c: + (clutter_actor_get_abs_position): + Removed unnecessary CFX_MUL(). + +2007-05-15 Tomas Frydrych + + * clutter/clutter-behaviour-ellipse.h: + * clutter/clutter-behaviour-ellipse.c: + (clutter_behaviour_ellipse_new): + Added a tilt parameter. + +2007-05-14 Matthew Allum + + * clutter/clutter-behaviour-path.c: + Fix bug where last knot position wouldn't get reached. + + * clutter/clutter-group.c: + Add some docs + + * clutter/clutter-timeline.h: + * clutter/clutter-timeline.c: + Add clutter_timeline_copy (needed for ClutterEffect) + + * clutter/clutter-version.h.in: + Export windowing system / GL backend etc defines. + + * clutter/Makefile.am: + * clutter/clutter-effect.c: + * clutter/clutter-effect.h: + * clutter/clutter.h: + + * clutter/glx/clutter-backend-glx.c: + Minor clean ups. + + * clutter/clutter-alpha.h: + Add a fixme. + + * configure.ac: + Add FPU define. + + * examples/Makefile.am: + * examples/slider.c: + Add Robs slider game. + +2007-05-10 Matthew Allum + + * clutter/egl/clutter-backend-egl.c: + * clutter/egl/clutter-event-egl.c: + * clutter/sdl/clutter-backend-sdl.c: + * clutter/sdl/clutter-event-sdl.c: + Fix SDL & EGL backends to work with newer backend code. + +2007-05-10 Tomas Frydrych + + * clutter/clutter-color.h: + * clutter/clutter-color.c: + Added clutter_color_to/from_hlsx() + (clutter_color_to/from_hls): + Clobber hue to 0 .. 250 + +2007-05-10 Matthew Allum + + * clutter/clutter-backend.c: + * clutter/clutter-backend.h: + * clutter/clutter-event.c: + * clutter/clutter-main.c: + * clutter/clutter-private.h: + * clutter/glx/clutter-backend-glx.c: + * clutter/glx/clutter-backend-glx.h: + * clutter/glx/clutter-event-glx.c: + Rejig backend event code as to simplify a little. + NOTE: This breaks non glx backends. + + * tests/Makefile.am: + * tests/test-events.c: + Add a very simple event test. + + * tests/test-textures.c: (main): + Add some more sizes to the test. + +2007-05-05 Matthew Allum + + * clutter/clutter-texture.c: + Fix typos with new cogl using texture code. Fixes tiled textures. + Add a check for max npots size. + + * configure.ac: + * Makefile.am: + * tests/Makefile.am: + * tests/test-textures.c: + Add a simple texture test. + +2007-05-02 Matthew Allum + + * clutter/Makefile.am: + * clutter/clutter-stage.c: + * clutter/sdl/Makefile.am: + * clutter/sdl/clutter-backend-sdl.c: + * clutter/sdl/clutter-backend-sdl.h: + * clutter/sdl/clutter-event-sdl.c: + * clutter/sdl/clutter-sdl.h: + * clutter/sdl/clutter-stage-sdl.c: + * clutter/sdl/clutter-stage-sdl.h: + * configure.ac: + Add a basic SDL based backend. Lacks real input event handling + (translation) as yet. + Also allows for clutter to be built against dgles. + +2007-05-02 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/cogl/gles/cogl.c: + Fix rotation + other fixed point cleanups. + + * clutter/clutter-texture.h: + Sketch out an updated API. + +2007-05-01 Matthew Allum + + * clutter/clutter-rectangle.c: + Comment out color match check for now as appears to be causing + borders to always get pained. + + * clutter/clutter-texture.h: + Add some format defines (unused as yet) + + * clutter/cogl/gles/cogl.c: + * clutter/egl/clutter-stage-egl.c: + * configure.ac: + Various OpenGL ES backend related fixes and tweaks. + +2007-04-30 Tomas Frydrych + + * clutter/clutter-fixed.c (clutter_sini): + Fixed bug in reducing angle to 0-2pi. + + * clutter/clutter-behaviour-ellipse.h: + * clutter/clutter-behaviour-ellipse.c: + * clutter/clutter.h: + * clutter/Makefile.am: + * doc/clutter.types: + * doc/clutter-docs.sgml: + Added ClutterBehaviourEllipse for movement along + elliptic paths. + + * examples/bspline.c: + * examples/behave.c: + * examples/Makefile.am: + Added --path commandline option to behave to choose different + path types (poly, ellipse, bspline) and dropped bspline example. + +2007-04-28 Matthew Allum + + * clutter/Makefile.am: + * clutter/clutter-debug.h: + * clutter/clutter-fixed.h: + * clutter/clutter-main.c: + * clutter/cogl/gles/Makefile.am: + * clutter/cogl/gles/cogl-defines.h: + * clutter/cogl/gles/cogl.c: + * clutter/egl/clutter-backend-egl.c: + * clutter/egl/clutter-backend-egl.h: + * clutter/egl/clutter-stage-egl.c: + * configure.ac: + Populate most stubs for cogl GL/ES implementation. + (against vincent - see http://svn.o-hand.com/repos/misc/ogles) + Add various fixups to EGL backend. + Code builds and runs (on 16bpp) but yet displays much (is close!) + + * clutter/pango/pangoclutter-render.c: + comment out some rouge glBegin/end calls. + +2007-04-27 Matthew Allum + + * clutter/Makefile.am: + * clutter/clutter-actor.c: + * clutter/clutter-clone-texture.c: + * clutter/clutter-rectangle.c: + * clutter/clutter-stage.c: + * clutter/clutter-texture.c: + * clutter/cogl/cogl.h: + * clutter/cogl/gl/Makefile.am: + * clutter/cogl/gl/cogl-defines.h: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/Makefile.am: + * clutter/cogl/gles/cogl-defines.h: + * clutter/cogl/gles/cogl.c: + * clutter/glx/Makefile.am: + * clutter/glx/clutter-stage-glx.c: + * clutter/pango/Makefile.am: + * clutter/pango/pangoclutter-render.c: + * configure.ac: + Add initial 'cogl' implementation. 'cogl' is a simple abstration + layer over GL and GL/ES used by clutter internally. It should + eventually allow clutter applications to be run on both GL and GL/ES + with just a recompile as well as provide more debugging and potentially + profiling information for GL and GL/ES usage. + + This commit contains the initial GL implementation. + +2007-04-26 Emmanuele Bassi + + Merge from clutter-0-2 + + * clutter/clutter-label.c: Unbreak the "use-markup" property + by actually passing the markup to pango_layout_set_markup(). + +2007-04-25 Emmanuele Bassi + + Merge from clutter.git/master + + * clutter/glx/clutter-event-glx.c: + * clutter/glx/clutter-stage-glx.c: Implement the _NET_WM_PING + protocol handling on the main stage window. + + * clutter/clutter-stage.h: + * clutter/clutter-stage.c: + * clutter/clutter-main.c: Handle CLUTTER_DELETE events internally, + by calling clutter_main_quit(), and remove the ::delete-event + signal from ClutterStage; clean up the signal emission sequence + for the events: emit the ::event signal before emitting any signal + and the ::event-after signal after the signal has been emitted; move + the signal emission calls inside ClutterStage so we can call + g_signal_emit() instead of g_signal_emit_by_name(), thus sparing us + a lookup for each event. + + * examples/test.c: Remove ::delete-event signal handling. + +2007-04-19 Emmanuele Bassi + + Merge from clutter.git/master + + * clutter/clutter-backend.h: + * clutter/clutter-backend.c: Add API for getting screen/display + properties from the backend. + + * clutter/glx/clutter-backend-glx.c: + * clutter/glx/clutter-backend-egl.c: Retrieve screen/display + properties inside the backends init function. + + * clutter/glx/clutter-event-glx.c: Handle the WM_PROTOCOLS + ClientMessage events. + + * clutter/glx/clutter-stage-glx.c: Use XSetWMProtocols to enable + the WM_PROTOCOLS ClientMessage events on the stage window. + + * clutter/glx/clutter-glx.h: Return the Screen pointer and not + the screen number in clutter_glx_get_default_screen(). The screen + number is returned by clutter_backend_get_screen_number(), or + by calling XScreenNumberOfScreen on the returned pointer. + + * clutter/clutter-event.h: Add CLUTTER_DELETE to the event types. + + * clutter/clutter-main.c: Emit the ClutterStage::delete-event + when receiving a CLUTTER_DELETE event; if the signal handlers + return FALSE, call clutter_main_quit(). + + * clutter/clutter-marshal.list: + * clutter/clutter-stage.c: Use the right marshaller function + for the delete-event closure. + + * examples/test.c: Test the "delete-event" signal handler. + +2007-04-16 Emmanuele Bassi + + Merge from clutter.git/merge-from-stable + + * clutter/clutter-event.h: + * clutter/glx/clutter-event-glx.c: Add the XEMBED protocol support + in the GLX backend, for embedding the stage window into another + X window. This allows cross-toolkit inclusion and makes clutter-gtk + possible. + + * clutter/clutter-behaviour-scale.c: Implement every ClutterGravity + value inside the scale behaviour and make the actors anchor to a + gravity when scaling up and down. + + * clutter/clutter-texture.c: Revert to copying GdkPixbuf areas to + correctly implement the texture tiling. This fixes segmentation + faults occurring with cards with a small texture memory area. + + * clutter/clutter-actor.c: Call g_object_freeze_notify() (and take + a reference on the actor) inside clutter_actor_request_size() so + that the notifications get unqueued at the end of the size request. + +2007-04-16 Emmanuele Bassi + + Merge from clutter.git/work + + * clutter/clutter-behaviour-bspline.[ch]: Return a ClutterBehaviour + when splicing the b-spline; fix the header and the API documentation; + hush the compiler warnings; kill of some pointer indirections. + + * clutter/clutter-behaviour-rotate.[ch]: Add a rotate behaviour, + with user defined axis, direction and sweep angle. + + * clutter/clutter-behaviour.c (clutter_behaviour_is_applied): Add + a parameter ISA check and return FALSE if it fails. + +2007-04-12 Tomas Frydrych + + * clutter/clutter-behaviour.h: + * clutter/clutter-behaviour.c: + * clutter/clutter-behaviour-path.h: + * clutter/clutter-behaviour-path.c: + Moved declaration of ClutterKnot from clutter-behaviour path + into clutter-behaviour. + + * clutter/clutter-fixed.h + * clutter/clutter-fixed.c + Added myself as an author. + + * clutter/Makefile.am: + * clutter/clutter.h: + * clutter/clutter-behaviour-bspline.h: + * clutter/clutter-behaviour-bspline.c: + Added new bezier spline behaviour. + + * examples/bspline.c: + * examples/Makefile.am: + An example of using bspline path. + +2007-04-07 Matthew Allum + + * clutter/glx/clutter-backend-glx.c: + Fix version check. + +2007-03-29 Tomas Frydrych + + * clutter/clutter-stage.c: + (perspective): fixed degree -> rad conversion for fovy angle + (perspectivex): fixed degree -> rad conversion for fovy angle, + added code for gle glMultMatrixx(). + +2007-03-29 Tomas Frydrych + + * configure.ac: fixed typo + + * clutter/clutter-fixed.c: + * clutter/clutter-fixed.h: + (clutter_tani): fast implementation of tan() + (clutter_qmulx): improved-precission fixed point multiply + + * clutter/clutter-stage.c: + (perspectivex): fixed point implementaiton of perspective() + (_clutter_stage_sync_viewport): + (clutter_stage_get_actor_at_pos): + use perspectivex() instead of perspective() + +2007-03-27 Matthew Allum + + * clutter/cogl/Makefile.am: + * clutter/cogl/cogl.h: + * clutter/cogl/gles/Makefile.am: + * clutter/cogl/gles/cogl.c: + Begin poplulating cogl GLES code. + + * configure.ac: + * clutter/egl/clutter-event-egl.c: + * clutter/egl/clutter-stage-egl.c: + * clutter/egl/clutter-stage-egl.h: + * clutter/egl/clutter-backend-egl.c: + * clutter/egl/clutter-backend-egl.h: + * clutter/egl/clutter-egl.h: + Add initial EGL/X backend work mostly ported from backend branch. + Builds but untested as yet. + + * clutter/glx/clutter-stage-glx.c: + Only include XFixes Header if we have have it. + + * clutter/clutter-behaviour.c: (clutter_behaviour_apply): + * clutter/clutter-behaviour.h: + Add clutter_behaviour_is_applied() + +2007-03-27 Emmanuele Bassi + + * clutter/clutter-stage.h: Remove unused clutter_stage_flush() + declaration. + +2007-03-27 Emmanuele Bassi + + * clutter/glx/clutter-glx.h: + * clutter/glx/clutter-stage-glx.c: (Re-)Implement the foreign + window setting function for the stage in the GLX backend. + +2007-03-27 Emmanuele Bassi + + * clutter/clutter-stage.h: Declare the clutter_perspective_get_type() + function in the header. + +2007-03-27 Emmanuele Bassi + + * clutter/cogl/cogl.h: Add header and compiler guards. + +2007-03-27 Emmanuele Bassi + + * clutter/glx/clutter-stage-glx.c: Remove the check in the + paint chain up: we know for sure that the parent's paint + vfunc is present. + +2007-03-27 Matthew Allum + + * clutter/clutter-feature.c: + Rejig ifdef's a little. Make drm vblanking Linux only. + + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: + Add a perspective boxed type. + + * clutter/glx/clutter-stage-glx.c: + Add some FIXMEs + + * clutter/Makefile.am: + * clutter/cogl/Makefile.am: + * clutter/cogl/cogl.h: + * clutter/cogl/gl/Makefile.am: + * clutter/cogl/gl/cogl.c: + * configure.ac: + Very initial work on 'cogl' GL/GLES abstraction/utility code. + +2007-03-26 Emmanuele Bassi + + * clutter/clutter-behaviour-scale.[ch]: Add API for getting + the scale bounds and the gravity from a scale behaviour instance. + +2007-03-26 Emmanuele Bassi + + * clutter/clutter-timeline.c: Fix last commit. + +2007-03-25 Emmanuele Bassi + + * clutter/clutter-timeline.c: Slightly lower the proiority + of the ClutterTimeline tick, so that events get a higher + priority in the main loop. + +2007-03-25 Emmanuele Bassi + + * clutter/clutter-event.[ch]: Remove the flags member from + the ClutterEvent structure; remove the ClutterEventFlags + enum. + +2007-03-25 Emmanuele Bassi + + * clutter/clutter-stage.h: Remove the ::get_actor_at_pos() + and ::flush() vfuncs. + + * clutter/glx/clutter-stage-glx.c: Remove the implementations + of those vfuncs from the backend specific code, as they are + pure GL calls. + + * clutter/clutter-stage.c: Add back the actor hit detection + code in the base stage class, along with the viewport + synchronisation function. + + * clutter/clutter-private.h: Declare the private function + _clutter_stage_sync_viewport(). + +2007-03-23 Emmanuele Bassi + + * clutter/clutter-backend.c: Clear the event queue when + disposing the backend object; remove the initialisation + of the backend structure members... + + * clutter/glx/clutter-backend-glx.c: ... and keep it here + in the backends where it belongs. + +2007-03-23 Emmanuele Bassi + + * clutter/clutter-private.h: + * clutter/clutter-backend.h: Move the backend functions + into the private header. + + * clutter/glx/clutter-stage-glx.c: + * clutter/glx/clutter-event-glx.c: + * clutter/clutter-main.c: + * clutter/clutter-stage.c: Update the calls to the private + backend functions. + + * clutter/clutter-backend.[ch]: Add an ::init_features + vfunc to ClutterBackend. + +2007-03-23 Emmanuele Bassi + + * clutter/glx/clutter-stage-glx.c: + Make sure the top-left corner of the box is our origin, + when returning the allocation. + + * clutter/clutter-stage.c: + * clutter/clutter-group.c: Add tracing for the paint + method. + +2007-03-23 Matthew Allum + + * clutter/glx/clutter-stage-glx.c: + (clutter_stage_glx_allocate_coords): + Make new stage return correct width & height. + +2007-03-23 Emmanuele Bassi + + Assorted build fixes to pass distcheck. + + * clutter/glx/Makefile.am: Install the clutter-glx.h header. + + * clutter/Makefile.am: Actually apply linker flags. + + * configure.ac: Use a more readable CLUTTER_API_VERSION instead + of CLUTTER_MAJORMINOR; require gobject-2.0 with glib-2.0 >= 2.10, + as we are using GObject and the slice allocator from glib 2.10. + + * clutter.pc.in: Add the apiversion variable. + +2007-03-23 Emmanuele Bassi + + * clutter/clutter-event.c: Pop and peek the event queue + from the tail - it's a queue, not a stack. + + * clutter/clutter-private.h: + * clutter/clutter-main.c: Add a boolean signal accumulator. + + * clutter/clutter-stage.[ch]: Add an event argument to + the 'delete-event' signal; rename the 'input-event' signal + to 'event'; add the static scope flag to all the stage + events. + + * examples/*.c: Update. + +2007-03-22 Emmanuele Bassi + + * clutter.pc.in: Require gobject-2.0 too. + + * ChangeLog: Fix the previous commit log. + +2007-03-22 Emmanuele Bassi + + * clutter/clutter-private.h: Remove inclusion of backend-specific + headers; update the main context object; add the declarations for + the event queue functions. + + * clutter/clutter-backend.[ch]: Add the abstract ClutterBackend + object, which holds backend-specific settings, the main stage, + and the event queue. Every backend must implement a subclass of + ClutterBackend and ClutterStage. + + * clutter/clutter-feature.c: Protect the GLX specific calls + behing #ifdef HAVE_CLUTTER_GLX. + + * clutter/clutter-actor.c: + * clutter/clutter-group.c: + * clutter/clutter-clone-texture.c: Include GL/gl.h + + * clutter/clutter-event.[ch]: Update public API and implement the + event queue private API; hold a reference on the event objects; + move out the keysym-to-unicode table; add the new event types. + + * clutter/clutter-color.h: Include clutter-fixed.h + + * clutter/clutter-main.c: Update API; get the main stage + from the backend object; process the event received from the + queue; lock/unlock the main mutex if we have one; move the + initialisation process sooner in the init sequence, in order to + have the backend object when we check for options; call the + backed vfuncs in the pre/post parse hooks. + + * clutter/clutter-stage.c: Make ClutterStage and abstract class, + implemented by the backends. + + * clutter/clutter/glx/clutter-glx.h: + * clutter/clutter/glx/clutter-backend-glx.[ch]: + * clutter/clutter/glx/clutter-event-glx.c: + * clutter/clutter/glx/clutter-stage-glx.[ch]: + * clutter/clutter/glx/Makefile.am: Add the GLX backend. + + * clutter/clutter/egl/clutter-backend-egl.[ch]: + * clutter/clutter/egl/clutter-event-egl.c: + * clutter/clutter/egl/clutter-stage-egl.[ch]: + * clutter/clutter/egl/Makefile.am: Add the stub for a EGL backend. + + * examples/*.c: Update for the new API. + + * configure.ac: Check for the XFixes X extension; add a configure + switch for choosing the backend; show the backend we are building + in the summary. + + * clutter.pc.in: Add the backend to the exported variables. + + * clutter/Makefile.am: Install the headers in the + clutter-$api_version/clutter directory, as usual; call the shared + object libclutter-$backend-$api_version; build glue for the + backend static library. + +2007-03-19 Matthew Allum + + * clutter/clutter-label.c: + Simple doc fix. + * clutter/clutter-texture.c: (clutter_texture_get_pixbuf): + Backport of fix to get_pixbuf on non alpha textures from 0_2 branch. + +2007-03-19 Emmanuele Bassi + + * clutter/clutter-texture.c: Clean up code; add checks + in public API. + +2007-02-18 Matthew Allum + + * clutter/clutter-actor.c: (clutter_actor_reparent): + Add a FIXME re calling clutter_group here. + * clutter/clutter-group.c: + Fix clutter_group_remove_all + +2007-02-15 Matthew Allum + + * clutter/clutter-group.h: + Add missing clutter_group_remove_all declaration. + +2007-02-14 Matthew Allum + + * clutter/Makefile.am: + * clutter/clutter-main.c: + * clutter/clutter-stage.c: + * clutter/clutter-version.h.in: + * configure.ac: + * examples/super-oh.c: + Add CLUTTER_FLAVOUR define. + +2007-02-13 Matthew Allum + + * examples/super-oh.c: (screensaver_setup): + Fix example to build with new glx api + +2007-02-07 Emmanuele Bassi + + * clutter/clutter-debug.h: Define the CLUTTER_MARK() + macro even when CLUTTER_ENABLE_DEBUG is not + defined. (#215) + +2007-01-30 Tomas Frydrych + + * clutter/clutter-alpha.c: + (sincx1024_func): + (clutter_sine_func): + (clutter_sine_inc_func): + fixed the fixed point math. + +2007-01-30 Emmanuele Bassi + + * clutter/clutter-alpha.h: + * clutter/clutter-alpha.c: Add the square waveform + function clutter_square_func() to the precooked + alpha functions. + +2007-01-23 Matthew Allum + + * Makefile.am: + * clutter.pc.in: + * clutter/Makefile.am: + * clutter/clutter-backend-glx.c: + * clutter/clutter-backend-glx.h: + * clutter/clutter-event.c: + * clutter/clutter-feature.c: + * clutter/clutter-group.c: + * clutter/clutter-main.c: + * clutter/clutter-main.h: + * clutter/clutter-private.h: + * clutter/clutter-stage-glx.c: + * clutter/clutter-stage-glx.h: + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: + * clutter/clutter-util.c: + * clutter/clutter-util.h: + * clutter/pango/pangoclutter-render.c: + * configure.ac: + * examples/Makefile.am: + Initial work in supporting different GL backends (ie. GLX/EGL/DirectFB etc). + Currently just GLX supported and now mostly self contained. + + * TODO: + Add a note about caching glenables + +2007-01-23 Tomas Frydrych + + * clutter/clutter-fixed.c: + (_clutter_double_to_fixed): + (_clutter_double_to_int): + Fixed to avoid problems with punned pointers and gcc + optimatisation. + + * clutter/pango/pangoclutter-private.h: + Simplified PANGO_PIXELS_26_6 macro. + + * clutter/pango/pangoclutter-font.c: + (_pango_clutter_font_new): + Replace floating with fixed point math. + +2007-01-19 Tomas Frydrych + + * clutter/clutter-fixed.c: (clutter_sqrti): + Use union instead of casting int <-> float to get rid of + punned-pointer warning and avoid gcc optimatisation breaking + the function on arm. + +2007-01-19 Emmanuele Bassi + + Allow the ClutterGroup subclasses to override the add and + remove operations. + + * clutter/clutter-group.c: Move the add and remove code from + clutter_group_add() and clutter_group_remove() to the signal + class closures; make the "add" and "remove" signals as + RUN_FIRST. + +2007-01-19 Tomas Frydrych + + * clutter/clutter-fixed.h.: + * clutter/clutter-fixed.c: + Added fast double to int and double to fixed point conversion + routines; changed CLUTTER_FLOAT_TO_FIXED to use it. + Replaced clutter_sqrti with fixed point implementation of the QIII + algorithm. + + * clutter/clutter-behavior-path.c: use clutter_sqrti always + + * clutter/clutter-alpha.c: + (sinc_func): replaced double -> int cast with CLUTTER_FLOAT_TO_INT + +2007-01-18 Emmanuele Bassi + + * configure.ac: Post release bump to 0.3.0. + +2007-01-18 =============== 0.2 Release ================================ + +2007-01-18 Matthew Allum + + * clutter.doap: + Update for 0.2 release + +2007-01-18 Emmanuele Bassi + + * clutter/clutter-group.h: Add public functions + clutter_group_get_n_children() and clutter_group_get_nth_child(). + + * clutter/clutter-behaviour.h: + * clutter/clutter-behaviour.c: Fix header alignment; fix argument + name for apidoc. + +2007-01-18 Emmanuele Bassi + + * clutter/Makefile.am: Use the build dir when linking to the + internal pango clutter renderer. + +2007-01-18 Tomas Frydrych + + * clutter/clutter-fixed.h: fixed a typo in comment + +2007-01-18 Emmanuele Bassi + + * clutter/clutter-fixed.h: Remove some inline documentation to + make the header more readable. + + * clutter/clutter-behaviour.c: The actors are store inside a + GSList and not in a GList, so change the list operations to + use the right API. + +2007-01-18 Tomas Frydrych + + * clutter/clutter-color.c: + (clutter_color_darken): + (clutter_color_lighten): + Changed calls to clutter_color_shade calls to clutter_color_shadex + +2007-01-17 Matthew Allum + + * configure.ac: + Bump up version to 0.2.0 + +2007-01-17 Tomas Frydrych + * configure.ac: + * clutter/clutter-behavior-path.c: + Added --without-fpu option. + + * doc/refrence/tmpl/clutter-fixed.sgml: + * clutter/clutter-fixed.c: + * clutter/clutter-fixed.h: + Documentation for fixed point API. + + * AUTHORS: added self. + +2007-01-17 Emmanuele Bassi + + * clutter/clutter-feature.h: + * clutter/clutter-feature.c: Move the GL headers from the + header file to the body. + + * clutter/clutter-fixed.h: + * clutter/clutter-fixed.c: Fix apidoc. + + * clutter/clutter-color.h: + * clutter/clutter-color.c: Ditto. + +2007-01-17 Tomas Frydrych + + * clutter/clutter-fixed.h: + * clutter/clutter-fixed.c: + * clutter/clutter-alpha.c: + Renamed clutter_fixed_sin() to clutter_sinx() and + clutter_angle_sin() to clutter_sini(); added clutter_sqrtx() + and clutter_sqrti(); added missing copyright. + + * clutter/clutter-behavior.c: + replaced call to sqrt() with clutter_sqrti() + + * clutter/clutter-behavior-scale.c: + (clutter_behaviour_scale_alpha_notify): + Replaced floating point math with fixed point. + +2007-01-16 Emmanuele Bassi + + * clutter/clutter-feature.c: Use clutter_vblank_method() to + get the VBlank method name from the environment variable OR + the command line switch. + + (clutter_feature_do_init): Move the check on the features + state here, to avoid an expensive function call, and inline + the function. + + * clutter/clutter-fixed.c: Fix gtk-doc. + + * clutter/clutter-main.c: Add a --clutter-vblank command line + switch controlling the VBlank method to be used: it overrides + the CLUTTER_VBLANK environment variable. + + (pre_parse_hook), (clutter_init), + (clutter_init_with_args): Move thread initialisation before + type init, to avoid the warning that comes with newer GLib + versions. + + * clutter/clutter-group.h: + * clutter/clutter-group.c: Mark clutter_group_show_all() and + clutter_group_hide_all() as deprecated. + +2007-01-16 Matthew Allum + + * NEWS: + Minor tweaks + + * TODO: + Sync up, mainly with 0.3 todo items + + * clutter/clutter-behaviour.c: + * clutter/clutter-behaviour.h: + clutter_behaviour_get_n_actors() / clutter_behaviour_get_nth_actor() + Additions. + + * clutter/clutter-stage.c: (clutter_stage_realize): + Experimental (disabled) visual setting code. + + * clutter/clutter-feature.c: + Check for GL_EXT_texture_rectangle (#198 - Frederick Riss) + + * clutter/clutter-group.c: (clutter_group_allocate_coords): + Fix for group size allocation (#199 - Frederick Riss) + + * clutter/clutter-texture.c: (texture_upload_data): + Fix texture unpacking row length (#197 Frederick Riss) + + * examples/Makefile.am: + Fix LDADD in build (#196 - Frederick Riss) + +2007-01-16 Tomas Frydrych + + * clutter/clutter-fixed.h: + Added integer ClutterAngle type, protype of clutter_angle_sin, + convenience macros clutter_fixed_cos and clutter_angle_cos, plus + other convenience macros for commonly used constants and ops. + * clutter/clutter-fixed.c: + (clutter_fixed_sin): + Fixed to work for negative angles. + (clutter_angle_sin): + Fast fixed point sin function for ClutterAngle angles. + * clutter/clutter-alpha.c: + (clutter_sin_func, clutter_sin_inc_func): + Changed to use clutter_angle_sin function. + * clutter-behavior-path.c: + replaced floating point with fixed point operations + * clutter/clutter-color.c: + * clutter/clutter-color.h: + Added (clutter_color_shadex), replaced floating point operations + with fixed point + +2007-01-15 Tomas Frydrych + + * clutter/clutter-fixed.h: (CLUTTER_FIXED_TO_DOUBLE/FLOAT): + Fixed macro so it works for negative values. + * clutter/clutter-fixed.c: (clutter_fixed_sin): + Implemented fixed point sin function. + * clutter/clutter-alpha.c: (clutter_sin_func, clutter_sin_inc_func): + Pluged in fixed point sin function. + +2007-01-07 Matthew Allum + + * clutter/clutter-actor.c: (clutter_actor_allocate_coords): + Fix an amazingly not noticed until now typo. + Minor doc tweaks. + + * clutter/clutter-behaviour-opacity.c: + (clutter_behaviour_alpha_notify): + Take into account initial opacity value when calculating from alpha. + + * clutter/clutter-group.c: + Add new get_nth_child() and get_n_children() api calls. + +2007-01-04 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + Add new set_width/height API calls. + Tweak scaling by reseting matrix. + Make set_opactiy() take parent opacity into account. + Fix clipping. + + * clutter/clutter-alpha.c: + Add more sine functionality. + + * clutter/clutter-behaviour-opacity.c: + Dont make a copy of all applied actors but use a foreach() + + * clutter/clutter-behaviour-scale.c: + Give correct limits to propertys. + Tweak gravity a little more. + Update docs. +: + * clutter/clutter-behaviour.c: (clutter_behaviour_remove): + Minor warning text change. + + * clutter/clutter-feature.c: (clutter_feature_wait_for_vblank): + Minor dri ioctl tweak. + + * clutter/clutter-label.c: + * clutter/clutter-label.h: + Add new label_full api call. + +2006-12-27 Emmanuele Bassi + + * clutter/clutter-stage.[ch]: + * clutter/clutter-event.[ch]: Revert changes; this is what + happens when you keep old tree around. + +2006-12-27 Emmanuele Bassi + + * clutter/clutter-color.h: + * clutter/clutter-color.c: Add clutter_color_to_string(), + which creates a hex-encoded color string from a ClutterColor. + +2006-12-20 Matthew Allum + + * NEWS: + Add some missing improvements. + +2006-12-17 Emmanuele Bassi + + * clutter/clutter-label.c: Remove some gtk-isms; always take + a reference before calling g_object_notify(), as the object + might get disposed while calling the closures inside the + notify queue; notify the changes of the ellipsize property. + +2006-12-14 Emmanuele Bassi + + * clutter/clutter-color.h: + * clutter/clutter-color.c: Expose clutter_color_copy() + and clutter_color_free() for the python bindings, so that + they can manager the conversion automatically; use the + slice allocator when copying/freeing a ClutterColor. + +2006-12-13 Emmanuele Bassi + + * clutter/clutter-color.h: + * clutter/clutter-color.c: Add clutter_color_equal(), + a function for comparing two colors. + + * clutter/clutter-rectangle.c: + (clutter_rectangle_set_color), + (clutter_rectangle_set_border_color): Unset the border if + the color of the rectangle and the color of the border are + the same. + +2006-12-13 Emmanuele Bassi + + * clutter/clutter-actor.c: + * clutter/clutter-clone-texture.c: + * clutter/clutter-event.h: + * clutter/clutter-stage.c: + * clutter/clutter-texture.c: + * clutter/clutter-timeline.c: Update the inline apidoc. + +2006-12-13 Matthew Allum + + * clutter/clutter-actor.c: (clutter_actor_class_init): + Allow actor x,y props to be negative. + +2006-12-12 Emmanuele Bassi + + Rework part of the show/hide machinery. Allow groups sub-classes + and composite actors to override show_all/hide_all in order to + decide which children they wish to show/hide. This means that + if an actor overrides the default show/hide virtual methods, it'll + have to chain up to the parent class show/hide. While we're at it, + provide the fully recursive clutter_actor_show_all() and + clutter_actor_hide_all() methods. + + * clutter/clutter-behaviour-path.c: Add apidoc for the ClutterKnot + functions; add pathological equality case for clutter_knot_equal(). + + * clutter/clutter-event.h: + * clutter/clutter-feature.h: + * clutter/clutter-behaviour.c: + * clutter/clutter-behaviour-scale.c:Fix parameters name so that + gtk-doc doesn't complain. + + * clutter/clutter-actor.c: + * clutter/clutter-event.c: Add apidoc + + * clutter/clutter-actor.h: + * clutter/clutter-actor.c: Add a clutter_actor_show_all() and a + clutter_actor_hide_all() functions; provide a mechanism for + groups and composited actors to programmatically select what to + show/hide when clutter_actor_show_all() and clutter_actor_hide_all() + are called. If you are overriding the ClutterActor::show or + the ClutterActor::hide virtual methods you should chain up with + the parent class. + + * clutter/clutter-group.c: Override show_all and hide_all and + recursively show/hide every child inside the group; + clutter_group_show_all() and clutter_group_hide_all() remain as non + recursive versions of clutter_actor_show_all() and + clutter_actor_hide_all() (maybe we should rename them in order + to avoid name clashes with the bindings). + + * clutter/clutter-stage.c: + * clutter/clutter-texture.c: Chain up with parent class show + and hide vfuncs. + + * clutter/clutter-clone-texture.h: + * clutter/clutter-clone-texture.c: Provide API for changing the + parent texture of a clone texture actor. + + * examples/behave.c: + * examples/super-oh.c: + * examples/test.c: Use clutter_actor_show_all() instead of + clutter_group_show_all(). + +2006-12-08 Matthew Allum + + * clutter.doap: + Put release date in correct format. + +2006-12-08 Emmanuele Bassi + + * clutter/clutter-behaviour.h: Add a function prototype + for the foreach function: we need something more specific + than GFunc; add clutter_behaviour_get_actors(), used to + get a list of the actors. + + * clutter/clutter-behaviour.c: Add debugging notes; add + a warning for behaviour implementations missing the + alpha_notify vfunc; add api documentation + + * clutter/clutter-behaviour-opacity.c: + * clutter/clutter-behaviour-path.c: + * clutter/clutter-behaviour-scale.c: Reimplement the + alpha_notify functions using the new foreach function + and, where possible, by directly iterating on the + actors: this shaves off the number of recalculations + of the property/alpha values, and the number of + functions. + +2006-12-05 Emmanuele Bassi + + * clutter/clutter-rectangle.c: Forgot to set the + pencil color. + +2006-12-05 Emmanuele Bassi + + * behave.c: Add test for clutter_color_parse(). + +2006-12-05 Emmanuele Bassi + + * clutter/clutter-event.c: Move the apidoc out. + +2006-12-05 Emmanuele Bassi + + * clutter/clutter-color.h: + * clutter/clutter-color.c: Add clutter_color_parse(), + which parses a string containing a color definition as + understood by XParseColor() (or pango_color_parse()). + +2006-12-04 Emmanuele Bassi + + Avoid clutter segfaulting when used without invoking + clutter_init(). This is needed when using api documentation + tools and every other tool relying on the GObject + introspection API (esp. on a headless box). see the + note in clutter/clutter-feature.c:clutter_feature_init + for a full explanation. + + * clutter/clutter-feature.c: Call clutter_feature_init() + when needed by one of the accessors of the features + structure. + + * clutter/clutter-main.c: + * clutter/clutter-private.h: Remove clutter_feature_init() + public declaration: the features support check is done the + first time a feature is needed. + + * clutter/clutter-main.c: Do not ever access the clutter + main context pointer directly; instead, obtain a pointer + to it via clutter_context_get_default(), which will always + return something valid. + +2006-12-04 Emmanuele Bassi + + * clutter/clutter-private.h: Add our own READABLE, + WRITABLE and READWRITE paramspec flags, declaring the + string components of the properties GParamSpec as static; + this should shave off some bytes in the memory footprint + and avoid relocations. + + * clutter/clutter-actor.c: + * clutter/clutter-behaviour.c: + * clutter/clutter-behaviour-opacity.c: + * clutter/clutter-behaviour-path.c: + * clutter/clutter-behavuour-scale.c: + * clutter/clutter-clone-texture.c: + * clutter/clutter-label.c: + * clutter/clutter-rectangle.c: + * clutter/clutter-stage.c: + * clutter/clutter-texture.c: + * clutter/clutter-timeline.c: Use the CLUTTER_PARAM_* + macros we just added. + + * clutter/clutter-behaviour-scale.c: Add properties for + the scale begin, scale end and gravity parameters. + + * clutter/clutter-behaviour-path.h: Mark the ClutterKnot + memory management functions as public (for the bindings), + since we use the slice allocator for copying knots around; + add a clutter_knot_equal() function. + + * clutter/clutter-behaviour-path.c: + (node_distance): Use clutter_knot_equal() as a fast path + to avoid the sqrt() in case the nodes we are using are + at the same position. + (path_total_length): Additional check on the existence + of the next node. + + * examples/behave.c: Do not leak the ClutterBehaviour + objects around. + +2006-12-03 Emmanuele Bassi + + * clutter/clutter-texture.h: Clean up. + + * clutter/clutter-texture.c: Typo fix in the name + of ClutterTextureTileDimension. + + * clutter/clutter-behaviour.c: Allow passing NULL + to clutter_behaviour_set_alpha() (as we pass NULL + in the finalize process). + +2006-12-02 Emmanuele Bassi + + * clutter/clutter-version.h.in: Fix a stupid logic + error in the CHECK_VERSION macro. + +2006-11-30 Matthew Allum + + * clutter.doap: + Updates + +2006-11-30 Emmanuele Bassi + + * clutter/clutter-stage.h: + * clutter/clutter-stage.c: + (clutter_stage_swap_buffers): Remove, as the same is done + via clutter_redraw() and clutter_actor_queue_redraw(). + + (clutter_stage_unrealize), (clutter_stage_init), + (clutter_stage_set_xwindow_foreign): Do not call + XDestroyWindow() on the stage Window if we are using a + foreign Window, as we don't control its lifetime. + +2006-11-30 Emmanuele Bassi + + * Makefile.am: Remove the gtk directory from the SUBDIRS. + + * clutter/clutter-stage.h: + * clutter/clutter-stage.c: Add clutter_stage_swap_buffers(), + which swaps the GL buffers. This fixes the redraw in the + GTK widget. + +2006-11-29 Emmanuele Bassi + + * clutter/clutter-stage.c: + (clutter_stage_set_xwindow_foreign): Add checks; + remove an indirection to the private data. + +2006-11-29 Emmanuele Bassi + + * gtk/* + * configure.ac: + * Makfile.am: Remove the GTK+ widget from the + main tree; now Clutter depends just on GLib, + XLibs, GdkPixbuf and OpenGL. + +2006-11-29 Matthew Allum + + * clutter/clutter-stage.c: (clutter_stage_realize): + Set colormap on stage window - should fix issues + with indirect rendering. + +2006-11-23 Matthew Allum + + * clutter/clutter-debug.h: + Fix small macro typo. + +2006-11-22 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/clutter-alpha.c: + * clutter/clutter-behaviour-opacity.c: + * clutter/clutter-behaviour-scale.c: + * clutter/clutter-clone-texture.c: + * clutter/clutter-feature.c: + * clutter/clutter-label.c: + * clutter/clutter-main.c: + * clutter/clutter-stage.c: + * clutter/clutter-texture.c + * clutter/clutter-timeline.c: + * clutter/clutter-debug.h: + Make CLUTTER_NOTE() just take a string rather than a func. + Add more default context to output. + + * configure.ac: + Fix flag and add more help docs for --ebable-debug option. + +2006-11-21 Emmanuele Bassi + + * clutter/clutter-main.c: Add a --g-fatal-warnings switch + for abort()-ing on warnings and criticals. + +2006-11-21 Emmanuele Bassi + + * configure.ac: Enable debug messages also when + --enable-debug is set to "minimum". + + * clutter/Makefile.am: + * clutter/clutter-debug.h: Move all debugging macros inside + this private header; make all debug macros depend on the + CLUTTER_ENABLE_DEBUG compile time define, controlled by + the --enable-debug configure switch; add G_LOG_DOMAIN define. + + * clutter/clutter-main.c: Clean up the debug stuff; add + command line argument parsing using GOption; the debug + messages now are triggered like this: + + CLUTTER_DEBUG=section:section:... clutter-app + + or like this: + + clutter-app --clutter-debug=section:section:... + + where "section" is one of the sections listed in clutter-main.c, + or "all", for all sections; each section is bound to a flag, + which can be used to define a domain when adding a debug note + using the CLUTTER_NOTE() macro; the old CLUTTER_DBG() macro is + just a wrapper around that, under the CLUTTER_DEBUG_MISC domain; + CLUTTER_NOTE() is used like this: + + CLUTTER_NOTE (DOMAIN, log-function); + + where log function is g_printerr(), g_message(), g_warning(), + g_critical() or directly g_log() - for instance: + + CLUTTER_NOTE (PANGO, g_warning ("Cache miss: %d", glyph)); + + will print the warning only if the "pango" flag has been + set to the CLUTTER_DEBUG envvar or passed to the --clutter-debug + command line argument. + + similar to CLUTTER_SHOW_FPS, there's also the --clutter-show-fps + command line switch; also, the --display and --screen command + line switches have been added: the first overrides the DISPLAY + envvar and the second controls the X screen used by Clutter to + get the root window on the display. + + * clutter/clutter-main.h: + * clutter/clutter-main.c: Add extended support for GOption + in Clutter; use clutter_init_with_args() to let Clutter + parse your own command line arguments; use instead + clutter_get_option_group() to get the GOptionGroup used by + Clutter if you want to do the parsing yourself with + g_option_context_parse(). The init sequence has been verified, + updated and moved into common functions where possible. + + * clutter/pango/pangoclutter-render.c: + * clutter/*.c: Include "clutter-debug.h" where needed; use + CLUTTER_NOTE() instead of CLUTTER_DBG(). + + * examples/super-oh.c: Use the new clutter_init_with_args() + function, and add a --num-hands command line switch to + the SuperOH example code controlling the number of hands at + runtime. + +2006-11-21 Emmanuele Bassi + + * configure.ac: Rename G_ENABLE_DEBUG to CLUTTER_ENABLE_DEBUG. + +2006-11-20 Emmanuele Bassi + + * clutter/clutter-rectangle.h: + * clutter/clutter-rectangle.c: Add border to the ClutterRectangle + actor; add "border-width", "border-color" and "has-border" + properties, plus their accessors. The border generation code is + pretty lame, at the moment. + + * examples/behave.c: Add code to test the new rectangle properties. + +2006-11-20 Matthew Allum + + * clutter.doap: + Add an initial DOAP file to project + +2006-11-20 Emmanuele Bassi + + * clutter/Makefile.am: + * clutter/clutter.h: + * clutter/clutter-version.h.in: Auto-generated versioning macros. + + * clutter/clutter-actor.h: + * clutter/clutter-actor.c: Add a ClutterActor::parent-set signal, + for notificating changes of an actor's parent; add api-doc for + the actor's properties; add the ClutterActor "name" property; clean + up a bit some functions; emit the "parent-set" signal when setting + te parent and when unparenting; better warnings when lowering + and raising an actor. + + * configure.ac: + * clutter/Makefile.am: Add a --enable-debug configure option, + with three levels of debugging: no, minimum and yes; default + for development releases (odd minor version) is "yes"; update + the version m4 defines; update the libtool macros: now just + changed the clutter_interface_age when releasing will update + everything else. + +2006-11-17 Emmanuele Bassi + + * clutter/clutter-behaviour-path.h: + * clutter/clutter-behaviour-path.c: Add "since" strings; add + a "knot" property which can be used to append a knot to the path; + fix apidoc. + + * clutter/clutter-alpha.c: Add "since" strings. + + * clutter/clutter-feature.c: Add apidoc. + + * clutter/clutter-behaviour-opacity.c: Add the "opacity-start" + and "opacity-end" properties; rewrite constructor to use them. + +2006-11-17 Emmanuele Bassi + + * clutter/clutter-behaviour-path.h: + * clutter/clutter-behaviour-path.c: Add a "knot-reached" signal, + which is emitted when the path reaches a node in the nodes list; + flesh out the documentation a bit; sync the parameters names + so that gtk-doc doesn't complain about missing stuff. + + * clutter/clutter-behaviour.h: + * clutter/clutter-behaviour.c: Add the alpha value to the + ClutterBehaviour::alpha_notify vfunc, so you don't have to + get the value from the alpha inside the behaviour implementations; + add more documentation. + + * clutter/clutter-alpha.c: Flesh out the description. + + * clutter/clutter-actor.h: Update the header. + + * clutter/clutter-behaviour-opacity.c: + * clutter/clutter-behaviour-scale.c: Update docs. + +2006-11-17 Matthew Allum + + * clutter/clutter-alpha.c: + * clutter/clutter-behaviour-opacity.c: + More docs. + + * clutter/clutter-behaviour-path.h: + * clutter/clutter-behaviour-path.c: + More docs, add clutter_behaviour_path_insert_knot(), + clutter_behaviour_path_remove_knot() + + * clutter/clutter-behaviour-scale.h: + * clutter/clutter-behaviour-scale.c: + More docs, add clutter_behaviour_scale_newx() taking fixed values. + + * clutter/Makefile.am: + * clutter/pango/Makefile.am: + Fix linking warning. + +2006-11-15 Matthew Allum + + * clutter/clutter-actor.h: + * clutter/clutter-actor.c: + Add new API clutter_actor_move_by(), clutter_actor_get_size() + + * clutter/clutter-alpha.c: + * clutter/clutter-alpha.h: + Add clutter alpha sine func + + * clutter/clutter-behaviours.h: + * clutter/clutter-behaviours.c: + Add a basic scale behaviour (needs work) + + * examples/behave.c: (main): + More playing with new behaviour functionality + + * clutter/clutter-feature.c: + * clutter/clutter-feature.h: + * clutter/clutter-main.c: + Add new experimental sync to vblank code + Set env CLUTTER_VBLANK=none to disable. + +2006-11-16 Emmanuele Bassi + + * clutter/clutter-private.h: + * clutter/clutter-actor.c: Implement the defined + clutter_actor_reparent() method; call unrealize + when unparenting an actor. + +2006-11-15 Emmanuele Bassi + + * clutter/clutter-alpha.h: + * clutter/clutter-alpha.c: Add a data parameter to + the ClutterAlphaFunc; add a data+destroy parameter + to clutter_alpha_set_func() and to clutter_alpha_new(), + and turned the latter into clutter_alpha_new_full(); + add a simple, empty constructor clutter_alpha_new(). + + These changes makes writing bindings a tad more easy, + as bindings require passing their own functions in + order to call the real alpha function. + + * clutter/clutter-behaviour.h: Clean up the header. + + * clutter/clutter-behaviours.[ch]: + * clutter/clutter-behaviour-opacity.[ch]: + * clutter/clutter-behaviour-path.[ch]: + * clutter/clutter-behaviour-scale.[ch]: Split the + ClutterBehaviourPath, ClutterBehaviourOpacity and + ClutterBehaviourScale into their own files as they + have been growing a bit. Fix ClutterBehaviourPath + API. + + * clutter/clutter-media.h: Remove the commented + "metadata_available" signal: gtk-doc chokes up on that. + + * clutter/clutter-timeline.h: + * clutter/clutter-timeline.c: Remove the useless + ClutterTimelineAlphaFunc signature; add missing accessor + methods for the properties; clean up a bit. + + * clutter/clutter-util.h: + * clutter/clutter-util.c: Remove unneeded function + clutter_util_can_create_texture(). + + * clutter/clutter-feature.h: Sync the name of + clutter_feature_get_all() with the name declared + in clutter-feature.h. + + * clutter/Makefile.am: + * clutter/clutter.h: Update. + + * examples/behave.c: Update to the new ClutterAlpha + constructor. + + * examples/super-oh.c: Use the right pointer and avoid + the compiler making a fuss about it. + +2006-11-15 Matthew Allum + + * clutter/clutter-actor.h: + * clutter/clutter-actor.c: + Add new API clutter_actor_move_by(), clutter_actor_get_size() + + * clutter/clutter-alpha.c: + * clutter/clutter-alpha.h: + Add clutter alpha sine func + + * clutter/clutter-behaviours.h: + * clutter/clutter-behaviours.c: + Add a basic scale behaviour (needs work) + + * examples/behave.c: (main): + More playing with new behaviour functionality + + * clutter/clutter-feature.c: + * clutter/clutter-feature.h: + * clutter/clutter-main.c: + Add new experimental sync to vblank code + Set env CLUTTER_VBLANK=none to disable. + +2006-11-15 Emmanuele Bassi + + * clutter/clutter-alpha.h: + * clutter/clutter-alpha.c: ClutterAlpha is an initially + floating object, as it makes sense only when bound to + a ClutterBehaviour; add checks for public API. + + * clutter/clutter-behaviour.h: + * clutter/clutter-behaviour.c: Remove the ClutterBehaviour + constructor: ClutterBehaviour is an abstract class which + must be implemented by subclassing; add checks for public + API; unref the actors on finalize; sink the ClutterAlpha + object. + + * clutter/clutter-behaviours.h: ClutterKnot is a boxed + type: add the _get_type() function declaration and the + type macro. + +2006-10-23 Matthew Allum + + * clutter/clutter-alpha.h: + * clutter/clutter-behaviour.c: + * clutter/clutter-behaviour.h: + * clutter/clutter-behaviours.c: + * clutter/clutter-behaviours.h: + * examples/behave.c: + Behaviours now only 'driven' by ClutterAlpha, not any object/prop. + Add simple Clutter path behaviour. + +2006-10-03 Matthew Allum + + * configure.ac: + * clutter/Makefile.am: + * clutter/clutter-actor.c: + * clutter/clutter-label.c: + * clutter/clutter-label.h: + * clutter/pango/Makefile.am: + * clutter/pango/pangoclutter-font.c: + * clutter/pango/pangoclutter-fontmap.c: + * clutter/pango/pangoclutter-private.h: + * clutter/pango/pangoclutter-render.c: + * clutter/pango/pangoclutter.h: + Add initial rough new pango renderer and clutter-label. + + * examples/super-oh.c: + * examples/test.c: + Minor fixups + +2006-09-20 Matthew Allum + + * clutter/clutter-actor.c: (clutter_actor_paint): + * clutter/clutter-clone-texture.c: (clutter_clone_texture_paint): + * clutter/clutter-group.c: (clutter_group_paint): + * clutter/clutter-rectangle.c: (clutter_rectangle_paint): + * clutter/clutter-texture.c: (clutter_texture_paint): + Fix for #156. + clutter_actor_paint() now translates to actor position as + to not fix scaled groups positioning. Sub classes now paint + at 0,0. + +2006-09-19 Matthew Allum + + * clutter/clutter-actor.c: (redraw_update_idle), + (clutter_actor_queue_redraw): + * clutter/clutter-main.c: (clutter_redraw): + Remove now uneeded locks + ( new gst and texture code makes redundant ) + + * clutter/clutter-texture.c: + * clutter/clutter-texture.h: + Redo clutter texture as to not keep a reference + to underlying texture. + +2006-09-15 Matthew Allum + + More fixes from Bastien Nocera (#155): + + * clutter/clutter-main.c: (clutter_init): + * clutter/clutter-main.h: + Add an enum for clutter init to return an error code. + * configure.ac: + Dont check for XInitThreads, there is no need, its part of xlib. + +2006-09-14 Matthew Allum + + Various fixes from Bastien Nocera: + + * clutter/clutter-event.h: + * clutter/clutter-stage.c: (clutter_stage_unrealize), + (clutter_stage_realize), (clutter_stage_request_coords), + (clutter_stage_dispose), (clutter_stage_init): + * clutter/clutter-stage.h: + * gtk/gtk-clutter-test.c: (input_cb), (frame_cb), (main): + * gtk/gtk-clutter.c: (realize): + Misc fixes (#152) + + * clutter/clutter-group.c: (clutter_group_remove): + Remove uneeded ref count (#143) + + * examples/super-oh.c: (input_cb): + Handle key release rather than presses (#154) + + * configure.ac: + Add old style X libs check when x11.pc unavailable (#101) + +2006-09-01 Matthew Allum + + * clutter/Makefile.am: + * clutter/clutter-media.c: + * clutter/clutter-media.h: + * clutter/clutter.h: + Re-add clutter media. + +2006-08-31 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/clutter-group.c: (clutter_group_paint), + (clutter_group_request_coords), (clutter_group_allocate_coords), + (clutter_group_add): + Fix some group sizing/positioning issues. + +2006-08-30 Jorn Baayen + + * clutter.pc.in: + + Remove gstreamer deps. + +2006-08-30 Jorn Baayen + + * README: + * clutter/Makefile.am: + * clutter/clutter-audio.c: + * clutter/clutter-audio.h: + * clutter/clutter-main.c: (clutter_init): + * clutter/clutter-media.c: + * clutter/clutter-media.h: + * clutter/clutter-video-texture.c: + * clutter/clutter-video-texture.h: + * clutter/clutter.h: + * configure.ac: + * examples/Makefile.am: + * examples/README: + * examples/video-cube.c: + * examples/video-player.c: + * gst/Makefile.am: + * gst/clutterimagesink.: + * gst/clutterimagesink.c: + * gst/clutterimagesink.h: + * gtk/Makefile.am: + + Remove gstreamer bits. There live in clutter-gst now. + +2006-08-30 Jorn Baayen + + * clutter/Makefile.am: + * clutter/clutter-audio.c: + * clutter/clutter-audio.h: + * clutter/clutter.h: + + Added ClutterAudio audio playback object. + +2006-08-29 Matthew Allum + + * clutter/clutter-fixed.h: + Add basic fixed point utility defines and type. + + * clutter/Makefile.am: + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + * clutter/clutter-group.c: + * clutter/clutter-stage.c: + * examples/super-oh.c: (main): + Add scale API and functionality. + Rework group sizing. Now group size requests have no effect + but can be scaled. + +2006-08-29 Jorn Baayen + + * clutter/clutter-behaviour.c: (_clutter_behaviour_finalize), + (_clutter_behaviour_set_property), + (_clutter_behaviour_get_property), (clutter_behaviour_class_init), + (clutter_behaviour_init), (clutter_behaviour_apply), + (clutter_behaviour_remove), (clutter_behaviour_remove_all), + (clutter_behaviour_actors_foreach): + * clutter/clutter-behaviour.h: + * clutter/clutter-behaviours.c: + (clutter_behaviour_property_change), + (clutter_behaviour_opacity_dispose), + (clutter_behaviour_opacity_finalize), + (clutter_behaviour_opacity_class_init), + (clutter_behaviour_opacity_init): + * clutter/clutter-behaviours.h: + * clutter/clutter-marshal.list: + * examples/behave.c: (main): + + Behaviours track generic GObject properties. + + * clutter/clutter-video-texture.h: + + Remove signal prototypes - they are already specified in + clutter-media.h. + +2006-08-28 Jorn Baayen + + * clutter/Makefile.am: + * clutter/clutter-alpha.c: + * clutter/clutter-alpha.h: + * clutter/clutter-behaviours.c: + (clutter_behaviour_opacity_dispose), + (clutter_behaviour_opacity_init), + (clutter_behaviour_opacity_frame_foreach), + (clutter_behaviour_opacity_frame): + * clutter/clutter-behaviours.h: + * clutter/clutter-timeline.c: (clutter_timeline_class_init): + * clutter/clutter-timeline.h: + * clutter/clutter.h: + * examples/behave.c: (main): + + Separate alpha calculation into its own class. + + * clutter/clutter-behaviour.c: (clutter_behaviour_set_timelime): + + Correct NULL check. + +2006-08-15 Matthew Allum + + * clutter/clutter-behaviour.h: + Behaviours shouldn't subclass timelines. + +2006-08-15 Matthew Allum + + * clutter/clutter-behaviour.c: + * clutter/clutter-behaviour.h: + * clutter/clutter-behaviours.c: + * clutter/clutter-timeline.c: + * clutter/clutter-timeline.h: + * clutter/clutter.h: + Make basic behaviour infrastructure actually work. + + * examples/Makefile.am: + * examples/behave.c: + Add a simple behaviour demo/test + + * clutter/clutter-media.c: (clutter_media_set_volume): + Actuall set volume rather than position.. (Fixes #141) + +2006-08-14 Matthew Allum + + * clutter/Makefile.am: + * clutter/clutter-behaviour.c: + * clutter/clutter-behaviour.h: + * clutter/clutter-behaviours.c: + * clutter/clutter-behaviours.h: + * clutter/clutter-timeline.c: + * clutter/clutter-timeline.h: + Add very initial new behaviour functionality. + + * clutter/clutter-stage.c: + * clutter/clutter-main.c: + * clutter/clutter-actor.c: + Improve clipping using stencil test rather than scissor check. + ( Should now handle rotated clips etc ). + + * clutter/clutter-group.c: (clutter_group_paint): + Fix typo on position check. + +2006-08-07 Matthew Allum + + * clutter/clutter-video-texture.c: (lay_pipeline): + Set quality of service prop on fakesink to TRUE. + +2006-08-07 Matthew Allum + + * clutter/clutter-actor.c: (clutter_actor_paint): + Remove relic from old stage behaviour - dont unref + it during a clip. + +2006-07-27 Emmanuele Bassi + + * clutter/clutter-feature.c: No need to call clutter_feature_init() + each time: it's private and should never be seen from the outside; + add a warning, just in case something screws up and calls it more + than once. + +2006-07-27 Emmanuele Bassi + + * clutter/clutter-private.h: Move clutter_feature_init() + declaration here: you shouldn't even need to initialise + features yourself. + + * clutter/clutter-feature.c: call clutter_feature_init() + each time you try to access the feature list; add a static + lock around the feature flags container; add api documentation. + + * clutter/clutter-feature.h: Add a type for the feature flags + to make bindings happy. + +2006-07-24 Matthew Allum + + * clutter/Makefile.am: + * clutter/clutter-feature.c: + * clutter/clutter-feature.h: + + Add new funcs for checking for available runtime GL + extensions. + + * clutter/clutter-clone-texture.c: + * clutter/clutter-texture.c: + + Add support for non power of two textures + if GL_TEXTURE_RECTANGLE_ARB extension available ( at runtime ). + Should lower texture memory needs a little. + +2006-07-17 Emmanuele Bassi + + * clutter/clutter-stage.c (clutter_stage_get_default): Fix + api documentation. + +2006-07-15 Emmanuele Bassi + + * clutter/clutter-main.c: + + (clutter_main): Destroy the main stage, instead of unreffing it. + + (clutter_init): Ref and sink the main stage, as it is a top + level actor. + + * clutter/clutter-stage.c (clutter_stage_unrealize): Access + the Window private member directly, instead of calling the + get_xwindow method. + + * examples/test.c (main): Quit on button press. + +2006-07-09 Emmanuele Bassi + + * clutter/clutter-event.h: Change the name of the + ClutterEvent union members to something a little shorter. + +2006-07-06 Emmanuele Bassi + + * configure.ac: Remove the python stuff, now that the bindings + are out of tree. + +2006-07-06 Emmanuele Bassi + + * configure.ac: Mark this as 0.1.1, and change the version info + of the library. + + * clutter/clutter-actor.c: + * clutter/clutter-group.c: Fix documentation. + +2006-07-06 Emmanuele Bassi + + * clutter/clutter-actor.h: + * clutter/clutter-actor.c: + + (clutter_actor_class_init), (clutter_actor_set_property), + (clutter_actor_get_property): Add the "clip" and "has-clip" + properties. + + (clutter_actor_set_clip), (clutter_actor_remove_clip): Emit + the notification for the changed properties. + + (clutter_actor_has_clip): Simple accessor to the "has-clip" + property. + +2006-07-06 Emmanuele Bassi + + Big rework of the actor management semantics: now ClutterActor + objects behave like GtkObjects - that is they have an initial + "floating" reference that gets "sunk" when they are added to + a ClutterGroup. This makes a group responsible of de-allocating + each actor inside it, so you just have to destroy the group to + get every child actor destroyed. Also, now you can do: + + clutter_group_add (group, clutter_video_texture_new ()); + + without having to care about reference counting and explicit + unreffing. + + * clutter/clutter-private.h: Add private flags setter and + getter macros. + + * clutter/clutter-actor.h: + * clutter/clutter-actor.c: Clean up; inherit from GInitiallyUnowned; + add a "visible" property; add the "destroy", "show" and "hide" + signals to ClutterActorClass. + + (clutter_actor_show), (clutter_actor_hide): Refactor a bit; emit + the "show" and "hide" signals. + + (clutter_actor_set_property), (clutter_actor_get_property), + (clutter_actor_class_init): Implement the "visible" property; add + signals. + + (clutter_actor_finalize): Do not leak the actor's name, if it is + set. + + (clutter_actor_dispose): Emit the "destroy" signal here. + + (clutter_actor_init): Sink the initial floating flag if needed. + + (clutter_actor_destroy): Add a function to explicitely destroy + a ClutterActor. + + (clutter_actor_set_parent), (clutter_actor_get_parent), + (clutter_actor_unparent): Make set_parent require a valid parent; + add unparent; check on get_parent; ref_sink the actor when + setting its parent and unref it when unsetting it. Probably we'll + need a function that does reparenting as unparent+set_parent in + a single shot. + + * clutter/clutter-group.h: + * clutter/clutter-group.c (clutter_group_dispose), + (clutter_group_finalize), (clutter_group_add), + (clutter_group_remove): Make the group destroy its children when + disposing it; clean up, and use the newly-available + clutter_actor_unparent(). + + * clutter/clutter-stage.h: + * clutter/clutter-stage.c (clutter_stage_init): ClutterStage is + a top-level actor; clean up. + + * clutter/clutter-video-texture.h: + * clutter/clutter-video-texture.c: Clean up. + + * examples/super-oh.c: + * examples/test.c: + * examples/video-player.c: + * examples/test-text.c: + * examples/video-cube.c: Remove the g_object_unref() call, as the + ClutterStage object is destroyed on clutter_main_quit(). + +2006-06-23 Matthew Allum + + * examples/super-oh.c: + Remove random stage unref fixing trails. Fixes #98 + +2006-06-23 Matthew Allum + + * examples/video-player.c: (size_change): + cast stage height to gint avoiding wierdness for when + video height greater than half display height. Fixed #99 + +2006-06-23 Matthew Allum + + * clutter/clutter-video-texture.c: (clutter_video_texture_new): + Small fix for video playback on Big Endian. See #97 + +2006-06-23 Iain Holmes + + * clutter/clutter-texture.h: Add space :) Sorry. + +2006-06-23 Iain Holmes + + * clutter/clutter-label.h: + * clutter/clutter-group.h: + * clutter/clutter-rectangle.h: + * clutter/clutter-video-texture.h: + * clutter/clutter-event.h: + * clutter/clutter-texture.h: Fix the header layout so that C# parser + can understand everything. + +2006-06-23 Ross Burton + + * configure.ac: + * Makefile.am: + Remove references to bindings/, it's moved. + +2006-06-23 Emmanuele Bassi + + * clutter/clutter-group.c + (clutter_group_get_children): Mention that you must free + the returned list otherwise you'll leak stuff all around. + +2006-06-23 Ross Burton + + * examples/super-oh.c: + Fix build with trails enabled. Still crashes. + +2006-06-23 Ross Burton + + * configure.ac: + Disable static libraries. + +2006-06-22 Matthew Allum + + * web/index.html: + Make OpeneHand link + +2006-06-22 Matthew Allum + + * web/index.html: + Add Pango ref, authors info. + +========== 2006-06-22 0.1 Release ===================== + +2006-06-22 Matthew Allum + + * configure.ac: + * web/index.html: + Correct Bugzilla link. Add debs link + Bump up version to 0.1 ! + +2006-06-22 Matthew Allum + + * NEWS: + Add an entry for 0.1 release + * web/index.html: + * web/style.css: + Add basic website. + +2006-06-22 Iain Holmes + + * clutter/clutter-main.c: Guess what...more docs + +2006-06-22 Iain Holmes + + * clutter/clutter-event.c: Add docs + +2006-06-22 Iain Holmes + + * clutter/clutter-media.c: Add docs + +2006-06-22 Iain Holmes + + * clutter/clutter-texture.c: Fix typos. + + * clutter/clutter-timeline.c: Fix typos. + +2006-06-22 Iain Holmes + + * clutter/clutter-video-texture.c: Docs. + +2006-06-22 Iain Holmes + + * clutter/clutter-group.c: More typo fixes + + * clutter/clutter-event.c: Documentation + +2006-06-22 Emmanuele Bassi + + * clutter/clutter-timeline.h: + * clutter/clutter-timeline.c: Add a "started" and a "paused" + signals; add more sanity checks on the public functions. + + (clutter_timeline_get_loop): Add a getter function for the + loop property. + + * clutter/clutter-marshal.list: Add marshallers. + + * clutter/clutter-timeline.h: + * clutter/clutter-actor.h: Add padding for future expansion + without breaking ABI. + +2006-06-22 Iain Holmes + + * clutter/clutter-actor.c: Fix some typos in the docs. + +2006-06-22 Iain Holmes + + * clutter/clutter-util.c: And more + +2006-06-22 Ross Burton + + * clutter/clutter-label.c: + * clutter/clutter-video-texture.c: + * clutter/clutter-texture.c: + * clutter/clutter-timeline.c: + * clutter/clutter-group.c: + Fix gtk-doc problems. + +2006-06-22 Iain Holmes + + * clutter/clutter-main.c: More documentation + +2006-06-22 Matthew Allum + + * clutter/clutter-main.h: + Remove bogus xvisual call. + +2006-06-22 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + Remove mirroring related calls ( unimplemented ) + * gtk/gtk-clutter-test.c: 0 -> NULL + +2006-06-22 Iain Holmes + + * clutter/clutter-actor.c: + * clutter/clutter-stage.c: + * gtk/gtk-clutter.c: More docs + +2006-06-22 Iain Holmes + + * clutter/clutter-actor.c: Added some more docs. + +2006-06-22 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/clutter-clone-texture.c: + * clutter/clutter-color.c: + * clutter/clutter-event.c: + * clutter/clutter-group.c: + * clutter/clutter-label.c: + * clutter/clutter-main.c: + * clutter/clutter-media.c: + * clutter/clutter-rectangle.c: + * clutter/clutter-stage.c: + * clutter/clutter-texture.c: + * clutter/clutter-timeline.c: + * clutter/clutter-util.c: + * clutter/clutter-video-texture.c: + * configure.ac: + Documentation updates - add section headers. + +2006-06-22 Iain Holmes + + * gtk/gtk-clutter-test.c (main): Don't show the stage. + +2006-06-22 Iain Holmes + + * gtk/gtk-clutter.[ch]: Rewrite to use + clutter_stage_set_xwindow_foreign rather than GtkSocket. + + * gtk/gtk-clutter-test.c: Add fading!1!!!!11! OMGWTFBBQ!!! + +2006-06-21 Emmanuele Bassi + + * examples/video-cube.c (main): Quit on key press. + +2006-06-21 Emmanuele Bassi + + * clutter/Makefile.am: Re-fix distcheck after last commit. + +2006-06-21 Matthew Allum + + * clutter/Makefile.am: + Make sure clutter.h included. + * clutter/clutter-stage.c: (clutter_stage_realize), + (clutter_stage_get_actor_at_pos): + Select for motion events on X window. + Return highest rather than lowest found actor for actor_at_pos. + * examples/Makefile.am: + Remove test-text, remane test video. + * examples/README: + Add info about the included examples. + * examples/test-video.c: + * examples/video-player.c: + Redo test-video a little nicer and rename. + * examples/video-cube.c: + Fix so it at least 'works' again. + * examples/test.c: + Clean up a little. + +2006-06-21 Ross Burton + + * Makefile.am: + * gtk/Makefile.am: + Add gtk widget to distcheck and fix. + +2006-06-21 Emmanuele Bassi + + * clutter/Makefile.am: + * bindings/python/Makefile.am: + * Makefile.am: Fix distcheck + +2006-06-21 Ross Burton + + * clutter/Makefile.am: + * examples/Makefile.am: + Fix dist. + +2006-06-20 Matthew Allum + + * TODO: + Update. + * clutter/clutter-group.c: + Attempt better group sizing code. + * clutter/clutter-label.c: + Minor tweaks. + * clutter/clutter-texture.c: + More debug info, make sure texture is realised for base_size() + * clutter/clutter-video-texture.c: + Seeking fixes + * examples/test.c: (main): + Populate with more randomness. + +2006-06-15 Matthew Allum + + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: + Add clutter_stage_set_xwindow_foreign() call + * clutter/clutter-util.c: + * clutter/clutter-util.h: + Add some X error traps + * examples/super-oh.c: + Toy with us of new clutter_stage_set_xwindow_foreign() for + optional screensaver functionality. + +2006-06-14 Matthew Allum + + * configure.ac: + Add checks for GL/gl.h and GL/glx.h + +2006-06-14 Matthew Allum + + * AUTHORS: + * README: + * TODO: + Update all. + +2006-06-13 Matthew Allum + + * clutter/clutter-video-texture.c: + Add missing license. + +2006-06-13 Matthew Allum + + * clutter/Makefile.am: + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + * clutter/clutter-clone-texture.c: + * clutter/clutter-clone-texture.h: + * clutter/clutter-element.c: + * clutter/clutter-element.h: + * clutter/clutter-group.c: + * clutter/clutter-group.h: + * clutter/clutter-label.c: + * clutter/clutter-label.h: + * clutter/clutter-main.c: + * clutter/clutter-main.h: + * clutter/clutter-rectangle.c: + * clutter/clutter-rectangle.h: + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: + * clutter/clutter-texture.c: + * clutter/clutter-texture.h: + * clutter/clutter-video-texture.c: + * clutter/clutter-video-texture.h: + * clutter/clutter.h: + * examples/super-oh.c: + * examples/test-text.c: + * examples/test-video.c: + * examples/test.c: + * examples/video-cube.c: + * gtk/gtk-clutter-test.c: + * gtk/gtk-clutter.c: + * gtk/gtk-clutter.h: + Element to Actor Renaming. + +2006-06-12 Matthew Allum + + * clutter/Makefile.am: + * clutter/clutter-media.c: + * clutter/clutter-media.h: + * clutter/clutter-video-texture.c: + * clutter/clutter-video-texture.h: + * clutter/clutter.h: + * examples/test-video.c: (main): + * examples/video-cube.c: (main): + Add new 'media' interface. + Drop Totem based video playback code replace with newly + rewritten supper Jorn based code. Clutter is now fully LGPL. + + * clutter/clutter-texture.c: (tile_dimension): + Remove uneeded overlap code. + +2006-06-08 Iain Holmes + + * clutter/clutter-texture.c: + Opps, undo change I didn't mean to commit + +2006-06-08 Iain Holmes + + * configure.ac: + Add gdk-pixbuf-xlib cflags/libs to clutter libs + Build the gtk-clutter.pc file. + + * clutter.pc.in: + Add the gdk-pixbuf-xlib depends. + + * gtk/gtk-clutter.pc.in: + pkg-config stuff for gtk-clutter + + * gtk/Makefile.am: + Install gtk-clutter.pc + +2006-06-08 Matthew Allum + + * clutter/clutter-main.c: + * clutter/clutter-private.h: + * clutter/clutter-stage.c: + Rework and fix offscreen rendering, also rejig GLX + context handling, moving mostly into stage. + Require at least OpenGL 1.2 ( CLAMP_TO_EDGE ) + + * clutter/clutter-texture.c: + Explicity set props on _init() as to avoid nasty can_create + bug failing miserably in certain situations. + Switch to CLAMP_TO_EDGE for textures to avoid tile seams. + Add some more GL error checks. + + * clutter/clutter-label.c: + Extra debug info + + * configure.ac: + Require gdk-pixbuf-xlib-2.0 + +2006-06-06 Matthew Allum + + * configure.ac: + Use pkg-config to check for X. Really Check for GL libs. + Make gtk binding optional. Cleanup a little. + + * Makefile.am: + * gtk/Makefile.am: + Make gtk binding optional + + * clutter/clutter-element.c: + Cleanup a little, notify on size change. + + * clutter/clutter-texture.c: + Lots of cleanups. Add waste prop. Add filter quality prop. + + * clutter/clutter-clone-texture.c: + Make object construction simpler to work better with bindings. + + * clutter/clutter-stage.c: + * clutter/clutter-timeline.c: + Minor reformating, cleanups. + + * examples/test-text.c: (main): + Random experimentation + +2006-06-06 Iain Holmes + + * gtk/gtk-clutter.c (size_request): Take the size of the widget from + the ClutterStage. + (gtk_clutter_class_init): Hook up size-request + +2006-06-06 Iain Holmes + + * gtk/: Add a gtk widget for clutter. + + * configure.ac: Add GTK checks + + * Makefile.am: Go into gtk/ + +2006-06-05 Matthew Allum + + * clutter/clutter-group.c: (clutter_group_remove): + Fix parent check. + +2006-06-05 Matthew Allum + + * clutter/clutter-event.h: + Remove send_event field. Clutter shouldn't need it. + + * clutter/clutter-main.c: (clutter_dispatch_x_event): + Dont malloc a new clutter event for each xevent. + + * clutter/clutter-stage.h: + * clutter/clutter-stage.c: (clutter_stage_class_init), + (clutter_stage_get_default): + Dont ref stage from clutter_stage_get_default. + + * examples/super-oh.c: (main): + Remove some now uneeded debug g_prints + +2006-06-05 Emmanuele Bassi + + * clutter-color.h: + * clutter-color.c: Reimplement ClutterColor as a boxed type; + add convenience API for color handling, like: add, subtract, + shade, HSL color-space conversion, packing and unpacking. + + * clutter-private.h: Update ClutterMainContext, and export the + main context pointer here. + + * clutter-rectangle.h: + * clutter-rectangle.c: Update the color-related code; make + clutter_rectangle_new() and empty constructor and provide + clutter_rectangle_new_with_color(); provide color setter + and getter API. + + * clutter-label.h: + * clutter-label.c: Rename the "font" property to "font-name"; + update the color-related code to the new ClutterColor object; + rename clutter_label_new() to clutter_label_new_with_text(), + and add setters and getters for the properties. + + * clutter-marshal.list: Add VOID:OBJECT and VOID:BOXED marshallers + generators. + + * clutter-stage.h: + * clutter-stage.c: Rework the API: provide a default constructor + for a singleton object, named clutter_stage_get_default(), which + supercedes the clutter_stage() function in clutter-main; provide + new events: button-press-event, button-release-event, + key-press-event and key-release-event; update the color-related + code; + + (clutter_stage_snapshot): Allow negative width and height when + taking a snapshot (meaning: use full width/height). + + (clutter_stage_get_element_at_pos): Rename clutter_stage_pick(). + + * clutter-element.c (clutter_element_paint): Clean up the + stage and color related code. + + * clutter-event.h: + * clutter-event.c: Add generic ClutterAnyEvent type; add + clutter_event_new(), clutter_event_copy() and clutter_event_free(); + make ClutterEvent a boxed type. + + * clutter-main.h: + * clutter-main.c: Remove clutter_stage(); add clutter_main_quit(), + for cleanly quitting from clutter_main(); add multiple mainloops + support; allocate the ClutterCntx instead of adding it to the + stack; re-work the ClutterEvent dispatching. + + * clutter-group.c (clutter_group_add), (clutter_group_remove): Keep + a reference on the element when added to a ClutterGroup. + + * examples/rects.py + * examples/test.c: + * examples/test-text.c: + * examples/video-cube.c: + * examples/super-oh.c: + * examples/test-video.c: Update. + +2006-06-04 Matthew Allum + + * clutter/clutter-element.c: + * clutter/clutter-group.c: + * clutter/clutter-group.h: + Work more on depth ( Z ) setting with sorting. + + * clutter/clutter-main.c: (clutter_redraw): + Experiment with glXWaitVideoSyncSGI. Currently disabled. + +2006-06-02 Matthew Allum + + * clutter/clutter-element.h: + Add missing _depth() declarations + + * clutter/clutter-main.c: + * clutter/clutter-main.h: + * clutter/clutter-private.h: + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: + Rejig GL setup as for stage to support an offscreen property. + Offscreen support is however a little borked. + +2006-06-01 Matthew Allum + + * clutter/clutter-element.c: + Fix a snafu in clutter_element_raise () + + * clutter/clutter-timeline.c: + * clutter/clutter-timeline.h: + Add new clutter_timeline_is_playing() method + +2006-05-29 Matthew Allum + + * clutter/clutter-color.c: (clutter_color_set): + Fix bit shifts in clutter color setters. + +2006-05-29 Matthew Allum + + * clutter/clutter-element.c: + * clutter/clutter-element.h: + Add initial new element depth() getter and setter. + + * clutter/clutter-group.c: + * clutter/clutter-group.h: + Add 2 new methods for listing a groups children externally. + +2006-05-27 Emmanuele Bassi + + * clutter/clutter-clone-texture.c (set_parent_texture), + (clutter_clone_texture_set_property), + (clutter_clone_texture_get_property), + (clutter_clone_texture_class_init), + (clutter_clone_texture_new): Add a "parent-texture" + constructor-only property to simplify the constructor code. + + * clutter/clutter-rectangle.c (clutter_rectangle_new): + * clutter/clutter-timeline.c (clutter_timeline_new): Simplify + the constructor code. + + * examples/rect.py: Use the new method names for clutter.main() + and clutter.stage(). + +2006-05-26 Emmanuele Bassi + + * clutter/clutter-element.c: Fix gtk-doc annotations for public + functions; add sanity checks for public API; factor out some + pointer dereferences. + +2006-05-26 Emmanuele Bassi + + Big entry, small changes. + + * clutter/clutter-rectangle.c: + * clutter/clutter-clone-texture.c: + * clutter/clutter-group.c: + * clutter/clutter-element.c: + * clutter/clutter-label.c: Use the GObject built-in definition + of a private data structure; it removes the need for managing + the allocation/de-allocation of a private structure ourselves. + + * clutter/clutter-group.h: + * clutter/clutter-label.h: Add padding, for adding signals and + other class-wide definitions without breaking ABI. + + * clutter/clutter-element.h: + * clutter/clutter-element.c (clutter_element_box_get_type), + (clutter_element_box_copy): Make ClutterElementBox a GBoxed + type; clean up declarations of the enums and flags. + + * clutter/clutter-group.h: + * clutter/clutter-group.c (clutter_group_add_many_valist), + (clutter_group_add_many): Add a _valist version of + clutter_group_add_many() function, and re-implement the latter + as a proxy for the former; language bindings do not cope + well with variable argument functions. + + * clutter/clutter-video-texture.h: + * clutter/clutter-video-texture.c: Use the right prefix for + the error and for the ratio enumerations. + + * clutter/*.c: + * clutter/*.h: + * clutter/Makefile.am: Use the include path + for parallel installations. + + * clutter/Makefile.am: + * clutter/clutter-enum-types.h: + * clutter/clutter-enum-types.c: Register the enumeration types + inside the GObject type system in order to use them as properties + and bindings automagically pick them up. + + * bindings/python/ChangeLog: Add a changelog for the bindings... + + * doc/reference/ChangeLog: ... and a changelog for the reference. + + * examples/test.c: + * examples/video-cube.c: + * examples/test-video.c: Use the header. + +2006-05-25 Matthew Allum + + * clutter/clutter-clone-texture.c: + (clone_texture_render_to_gl_quad): + Remove uneeded bogus warning. Fix a typo causing large + texture to get incorrectly rendered. + * clutter/clutter-texture.c: (init_tiles), + (texture_render_to_gl_quad), (clutter_texture_sync_pixbuf), + (clutter_texture_realize): + Add some new debug info. + * clutter/clutter-video-texture.c: (fakesink_handoff_cb): + Set the pixbuf from GST_BUFFER_DATA() a little safer. + +2006-05-25 Matthew Allum + + * clutter.pc.in: + Fix prefix snafu via Ross. + +2006-05-24 Matthew Allum + + * clutter/clutter-element.c: (clutter_element_paint), + (clutter_element_class_init): + * clutter/clutter-label.c: (clutter_label_make_pixbuf): + * clutter/clutter-main.c: (clutter_main): + * clutter/clutter-stage.c: (sync_fullscreen), (sync_gl_viewport): + * clutter/clutter-stage.h: + Various minor tweaks / fixes needed by o.p.t + * clutter/clutter-texture.c: (texture_render_to_gl_quad), + (clutter_texture_sync_pixbuf), (clutter_texture_set_property), + (clutter_texture_get_property), (clutter_texture_class_init): + Experiment adding currently borked repreating textures, + * clutter/clutter-timeline.c: (timeline_timeout_func), + (clutter_timeline_skip): + Fix timeline callback frame counting. + * examples/test-video.c: (main): + Experiment with repeated textures. + +2006-05-23 Matthew Allum + + * clutter/clutter-clone-texture.h: + Fix Include. + * clutter/clutter-element.c: (clutter_element_set_parent): + Only unref if parent non NULL + * clutter/clutter-label.c: (clutter_label_class_init), + (clutter_label_set_text), (clutter_label_set_font): + * clutter/clutter-stage.h: + Add some utility defines + * clutter/clutter-texture.c: (init_tiles): + * clutter/clutter-timeline.c: (clutter_timeline_class_init), + (timeline_timeout_func), (clutter_timeline_get_current_frame): + * clutter/clutter-timeline.h: + Add a 'completed' signal + Dont free priv when g_type_class_private used. + * clutter/clutter.h: + Add missing clutter-rectangle.h + * examples/Makefile.am: + * examples/super-oh.c: (main): + * examples/test.c: + * examples/video-cube.c: + Fix includes + +2006-05-22 Matthew Allum + + * clutter/clutter-element.c: + * clutter/clutter-element.h: + * clutter/clutter-event.c: + * clutter/clutter-group.c: (clutter_group_remove_all): + * clutter/clutter-group.h: + * clutter/clutter-main.c: (translate_button_event), + (translate_motion_event): + Improve mouse event handling. + Add code to map arbituary ( i.e cursor ) position to + a clutter element using OpenGL 'picking'. + * clutter/clutter-texture.c: + * clutter/clutter-clone-texture.c: + re-realize parent texture if it gets hidden. + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: + Make sure stage sets gl viewport up even if just default size. + (clutter_texture_hide), (clutter_texture_paint): + * doc/reference/Makefile.am: + * examples/super-oh.c: (input_cb), (frame_cb), (main): + Add test for mouse events, click to remove. + +2006-05-21 Matthew Allum + + * clutter/clutter-element.c: + * clutter/clutter-element.h: + Add new core sizing methods and more documentation. + * clutter/clutter-group.c: + * clutter/clutter-group.h: + Use the sizing bits and documentation. + * clutter/clutter-main.c: + * clutter/clutter-event.h: + Add FPS display when CLUTTER_SHOW_FPS env var set. + Add initial support for mouse events. + * clutter/clutter-stage.c: + Add 'snapshot' method. + * clutter/clutter-texture.c: (clutter_texture_new_from_pixbuf): + * clutter/clutter-texture.h: + Documentation. + * clutter/clutter-timeline.c: + Add support for changing FPS setting on the fly. Document. + * examples/super-oh.c: (frame_cb), (main): + Add an optional motion trails effect. + +2006-05-17 Matthew Allum + + * README: + Add a tiny bit of info + * TODO: + Sync up a little + * clutter/clutter-clone-texture.c: + (clone_texture_render_to_gl_quad): + * clutter/clutter-element.c: (clutter_element_show), + (clutter_element_realize), (clutter_element_unrealize), + (clutter_element_paint), (clutter_element_set_id), + (clutter_element_get_id): + * clutter/clutter-element.h: + Rename REALISE() to REALIZE() + + * clutter/clutter-texture.c: (texture_render_to_gl_quad), + (clutter_texture_sync_pixbuf), (clutter_texture_set_pixbuf): + * clutter/clutter-video-texture.c: (query_timeout), + (got_video_size), (caps_set), (parse_stream_info), + (handle_element_message), (bus_message_cb), + (poll_for_state_change_full), (clutter_video_texture_get_property), + (clutter_video_texture_class_init), (clutter_video_texture_init), + (clutter_video_texture_open), (clutter_video_texture_seek_time), + (stop_play_pipeline): + * clutter/clutter-video-texture.h: + Move over using fakesink and handoff instead of custom element + Support 3 channel pixbufs as textures and thus increase efficiency + of video texture ( also avoids byte swapping. ) + Clean up video texture code somemore. + Add some metadata support. + + * Makefile.am: + * configure.ac: + Disable old custom clutter gst element from build. + + * examples/test-video.c: (foo), (size_change), (tick), (main): + * examples/video-cube.c: (clutter_video_texture_cube_paint): + Sink with new API. Pause on key press. + +2006-05-13 Matthew Allum + + * clutter/clutter-element.c: (redraw_update_idle), + (clutter_element_show), (clutter_element_hide), + (clutter_element_realize), (clutter_element_unrealize), + (clutter_element_class_init), (clutter_element_init), + (clutter_element_queue_redraw), (clutter_element_set_geometry), + (clutter_element_get_geometry), (clutter_element_get_coords), + (clutter_element_set_position), (clutter_element_set_size), + (clutter_element_get_abs_position), (clutter_element_get_width), + (clutter_element_get_height), (clutter_element_get_x), + (clutter_element_get_y), (clutter_element_set_opacity): + * clutter/clutter-texture.c: (clutter_texture_get_base_size), + (clutter_texture_bind_tile), (clutter_texture_get_n_tiles), + (clutter_texture_get_x_tile_detail), + (clutter_texture_get_y_tile_detail): + * doc/reference/Makefile.am: + * doc/reference/clutter.types: + Documentation updates. + +2006-05-13 Matthew Allum + + * clutter.pc.in: + Add @MAJORMINOR@ to installed dirs. + * clutter/clutter-main.c: (clutter_xscreen), (clutter_init): + * clutter/clutter-main.h: + * clutter/clutter-private.h: + Quick fix for debug statements so now only appear + if CLUTTER_DBBUG env var set. + +2006-05-12 Matthew Allum + + * configure.ac: + * Makefile.am: + * clutter/Makefile.am: + * bindings/python/Makefile.am: + * examples/Makefile.am: + * gst/Makefile.am: + Clean up autofoo a bit fixing versioning. + * bootstrap-autotools.sh: + * clutter-1.0.pc.in: + Rename. + +2006-05-12 Matthew Allum + + * bindings/python/Makefile.am: + * bindings/python/clutter.override: + * clutter/Makefile.am: + * clutter/clutter-bin.c: + * clutter/clutter-bin.h: + * clutter/clutter-element.c: (clutter_element_dispose), + (clutter_element_raise), (clutter_element_lower): + * clutter/clutter-group.c: + * clutter/clutter-group.h: + * clutter/clutter-main.c: (clutter_threads_leave): + * clutter/clutter-main.h: + * clutter/clutter-stage.c: (clutter_stage_class_init): + * clutter/clutter-stage.h: + * clutter/clutter.h: + * examples/super-oh.c: (frame_cb), (main): + * examples/test-text.c: (main): + * examples/test-video.c: (main): + * examples/test.c: (main): + * examples/video-cube.c: (main): + Rename clutter-bin to clutter-group + +2006-05-11 Matthew Allum + + * clutter/clutter-clone-texture.c: + (clone_texture_render_to_gl_quad), (clutter_clone_texture_paint), + (clutter_clone_texture_class_init), (clutter_clone_texture_new): + Fix cloning. + * clutter/clutter-element.c: (clutter_element_rotate_z), + (clutter_element_rotate_x), (clutter_element_rotate_y): + Minor tweaks + * examples/Makefile.am: + * examples/super-oh.c: + Add a new demo - unsing rotations and clones. + +2006-05-11 Matthew Allum + + * bindings/python/Makefile.am: + * bindings/python/clutter-base-types.defs: + * bindings/python/clutter-base.defs: + * bindings/python/clutter.override: + Python goodiness from ebassi. + - Element geometry handled nicely. + - get_coords(), get_abs_position() added. + + * clutter/clutter-element.c: (clutter_element_rotate_x), + (clutter_element_rotate_y), (clutter_element_mirror), + * clutter/clutter-element.h: + Add initial rotation API. Make Geometry boxed ( ebassi ) + + * clutter/clutter-stage.c: (sync_gl_viewport): + Set depth in main world transform. + + * clutter/clutter-timeline.h: + Add missing new() api call. + + * examples/test.c: (timeout_text_cb), (frame_cb), (main): + Tou with some rotation + +2006-05-11 Matthew Allum + + reviewed by: + + * bindings/python/Makefile.am: + * bindings/python/clutter-base-types.defs: + * bindings/python/clutter-base.defs: + * bindings/python/clutter.override: + * clutter/clutter-bin.c: (clutter_bin_paint): + * clutter/clutter-element.c: (clutter_element_paint), + (clutter_element_get_height), (clutter_element_get_x), + (clutter_element_get_y), (clutter_element_set_opacity), + (clutter_element_get_opacity), (clutter_element_set_id), + (clutter_element_get_id), (clutter_element_rotate_x), + (clutter_element_rotate_y), (clutter_element_mirror), + (clutter_element_set_clip), (clutter_element_remove_clip), + (clutter_element_set_parent), (clutter_element_get_parent), + (clutter_element_raise), (clutter_element_lower), + (clutter_element_raise_top), (clutter_element_lower_bottom): + * clutter/clutter-element.h: + * clutter/clutter-main.c: (clutter_redraw): + * clutter/clutter-stage.c: (sync_gl_viewport): + * clutter/clutter-timeline.h: + * examples/test.c: (timeout_text_cb), (frame_cb), (main): + +2006-05-09 Matthew Allum + + * COPYING: + * clutter/clutter-bin.c: + * clutter/clutter-bin.h: + * clutter/clutter-clone-texture.c: + * clutter/clutter-clone-texture.h: + * clutter/clutter-color.c: + * clutter/clutter-color.h: + * clutter/clutter-element.c: + * clutter/clutter-element.h: + * clutter/clutter-event.c: + * clutter/clutter-event.h: + * clutter/clutter-keysyms.h: + * clutter/clutter-label.c: + * clutter/clutter-label.h: + * clutter/clutter-main.c: + * clutter/clutter-main.h: + * clutter/clutter-private.h: + * clutter/clutter-rectangle.c: + * clutter/clutter-rectangle.h: + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: + * clutter/clutter-texture.c: + * clutter/clutter-texture.h: + * clutter/clutter-timeline.c: + * clutter/clutter-timeline.h: + * clutter/clutter-util.c: + * clutter/clutter-util.h: + Add license info. + +2006-05-08 Matthew Allum + + * clutter/Makefile.am: + * clutter/clutter-event.c: + * clutter/clutter-event.h: + * clutter/clutter-keysyms.h: + * clutter/clutter-main.c: (clutter_dispatch_x_event): + * clutter/clutter-stage.c: (clutter_stage_class_init): + * clutter/clutter-stage.h: + * clutter/clutter.h: + * bindings/python/Makefile.am: + * bindings/python/clutter.override: + Add basic input event handling. Keys only atm. + +2006-05-08 Matthew Allum + + * TODO: + Sync a little. + * bindings/python/Makefile.am: + * bindings/python/clutter.override: + Fix up so pixbufs now work ( thanks ebassi! ) + Add some missing newer headers. + * clutter/clutter-main.h: + Remove unused clutter_queue_redraw(); + +2006-05-07 Matthew Allum + + * clutter/clutter-element.c: (clutter_element_class_init), + (clutter_element_init), (clutter_element_queue_redraw), + (clutter_element_set_geometry), (clutter_element_get_geometry), + (clutter_element_get_coords), (clutter_element_set_position), + (clutter_element_set_size), (clutter_element_get_abs_position), + (clutter_element_get_width), (clutter_element_get_height), + (clutter_element_get_x), (clutter_element_get_y), + (clutter_element_set_opacity): + * clutter/clutter-main.c: (clutter_dispatch_x_event): + * clutter/clutter-main.h: + * clutter/clutter-private.h: + * clutter/clutter-stage.c: (clutter_stage_set_color): + * clutter/clutter-texture.c: (clutter_texture_set_pixbuf): + Rename clutter_queue_redraw -> clutter_element_queue_redraw + + * clutter/clutter-label.c: (clutter_label_make_pixbuf), + (clutter_label_set_property), (clutter_label_set_text_extents): + * clutter/clutter-label.h: + Fixes to extents + + * examples/Makefile.am: + * examples/test-text.c: + Add sime test text example. + +2006-05-07 Matthew Allum + + * clutter/clutter-label.c: (clutter_label_make_pixbuf), + (clutter_label_get_property), (clutter_label_dispose), + (clutter_label_class_init), (clutter_label_init), + (clutter_label_new_with_text), (clutter_label_new), + (clutter_label_set_text), (clutter_label_set_font), + (clutter_label_set_text_extents), (clutter_label_set_fg_color): + * examples/test.c: (main): + Slight efficiency improvements. Add initial extents API. + +2006-05-07 Matthew Allum + + * TODO: + resync. + * clutter/Makefile.am: + * clutter/clutter-clone-texture.c: + * clutter/clutter-clone-texture.h: + Add new texture clone element. + * clutter/clutter-color.c: + * clutter/clutter-color.h: + Add simple color API. + * clutter/clutter-util.c: + * clutter/clutter-util.h: + Move shared texture funcs into shared util code. + * clutter/clutter-texture.c: (can_create), (tile_dimension), + (init_tiles), (texture_render_to_gl_quad), + (clutter_texture_unrealize), (clutter_texture_sync_pixbuf), + (clutter_texture_realize), (clutter_texture_show), + (clutter_texture_hide), (clutter_texture_paint), + (clutter_texture_finalize), (clutter_texture_set_property), + (clutter_texture_get_property), (clutter_texture_class_init), + (clutter_texture_init), (clutter_texture_set_pixbuf), + (clutter_texture_new_from_pixbuf), (clutter_texture_get_base_size), + (clutter_texture_bind_tile): + Changes for clones to work. + * clutter/clutter-element.c: (clutter_element_paint), + (clutter_element_set_property), (clutter_element_get_property), + (clutter_element_set_position), (clutter_element_set_size), + (clutter_element_get_abs_position), (clutter_element_get_width), + (clutter_element_get_height), (clutter_element_get_x), + (clutter_element_get_y), (clutter_element_set_opacity), + (clutter_element_get_opacity), (clutter_element_set_id), + (clutter_element_get_id), (clutter_element_set_clip): + * clutter/clutter-element.h: + Add clipping and other tweaks. + * clutter/clutter-stage.c: (sync_gl_viewport), + (clutter_stage_paint), (clutter_stage_init): + Add psuedo 3D desktop like GL setup. + * clutter/clutter-label.c: (clutter_label_make_pixbuf): + * clutter/clutter-label.h: + * clutter/clutter-main.c: (clutter_redraw): + * clutter/clutter-main.h: + * clutter/clutter-private.h: + * clutter/clutter-rectangle.c: (clutter_rectangle_paint): + * clutter/clutter-stage.h: + * clutter/clutter-texture.h: + * clutter/clutter-timeline.c: (clutter_timeline_class_init): + * clutter/clutter-video-texture.c: + * clutter/clutter.h: + * examples/test-video.c: (foo), (size_change), (tick), (main): + * examples/test.c: (main): + * examples/video-cube.c: (clutter_video_texture_cube_paint), + (clutter_video_texture_cube_class_init), + (clutter_video_texture_cube_init): + Various minor tweaks for API changes, new features etc. + +2006-05-03 Matthew Allum + + * clutter/clutter-bin.c: (clutter_bin_paint): + * clutter/clutter-bin.h: + * clutter/clutter-element.c: (clutter_element_unrealize), + (clutter_element_paint), (clutter_element_set_property), + (clutter_element_get_property), (clutter_element_dispose), + (clutter_element_finalize), (clutter_element_class_init), + (clutter_element_init), (clutter_element_queue_redraw), + (clutter_element_set_geometry), (clutter_element_get_geometry), + (clutter_element_get_coords), (clutter_element_set_position), + (clutter_element_set_size), (clutter_element_get_abs_position), + (clutter_element_set_opacity), (clutter_element_get_opacity), + (clutter_element_set_clip), (clutter_element_remove_clip), + (clutter_element_set_parent), (clutter_element_get_parent), + (clutter_element_raise), (clutter_element_lower), + (clutter_element_raise_top), (clutter_element_lower_bottom): + * clutter/clutter-element.h: + * clutter/clutter-label.c: (clutter_label_set_fg_color): + * clutter/clutter-rectangle.c: (clutter_rectangle_paint), + (clutter_rectangle_set_property), (clutter_rectangle_init): + * clutter/clutter-stage.c: (sync_xwindow_size): + * clutter/clutter-texture.c: (clutter_texture_paint), + (clutter_texture_set_pixbuf): + Clean up ClutterElement, removing globals, improving sizing + and initial clipping code. + + * clutter/clutter.h: + * clutter/clutter-timeline.c: (clutter_timeline_class_init), + (timeline_timeout_func), (clutter_timeline_start), + (clutter_timeline_pause), (clutter_timeline_rewind), + (clutter_timeline_skip), (clutter_timeline_advance), + (clutter_timeline_get_current_frame), (clutter_timeline_new): + * clutter/clutter-timeline.h: + Various fixes to timelines. Implement frame skipping. + + * examples/test.c: (timeout_text_cb), (main): + Update to use timeline. + +2006-05-02 Matthew Allum + + * TODO: + Update + * clutter/clutter-element.h: + * clutter/clutter-rectangle.h: + Minor formatting cleanups + +2006-05-02 Matthew Allum + + * clutter/Makefile.am: + * clutter/clutter-timeline.c: + * clutter/clutter-timeline.h: + Add initial timeline implementation + +2006-05-02 Matthew Allum + + * bindings/python/Makefile.am: + * bindings/python/cluttermodule.c: (initclutter): + Fix python build with new -1.0 naming. Use of GdkPixbufs + still causing crashes. + +2006-04-30 Matthew Allum + + * clutter/clutter-main.c: (events_init), (redraw_update_idle), + (clutter_queue_redraw), (clutter_redraw): + Fix repaint queueing, using idle handler now. + Clean up some minor compiler warnings. + * clutter/clutter-main.h: + * clutter/clutter-texture.c: (clutter_texture_unrealize), + (clutter_texture_set_pixbuf): + Rename gl_lock/unlock to threads_enter/leaver + +2006-04-30 Matthew Allum + + * Makefile.am: + * clutter-1.0.pc.in: + * clutter/Makefile.am: + * clutter/clutter-bin.h: + * clutter/clutter-label.h: + * clutter/clutter-rectangle.h: + * clutter/clutter-stage.h: + * clutter/clutter-texture.h: + * clutter/clutter-video-texture.h: + * clutter/clutter.h: + * configure.ac: + * examples/Makefile.am: + Add .pc file, tag -1.0 onto lib, includes dir naming. + +2006-04-29 Matthew Allum + + * clutter/clutter-main.c: (clutter_dispatch_x_event), + (clutter_queue_redraw), (clutter_redraw): + Simplify paint event queueing. Does not actually queue + anymore (broken), needs wrong to reduce high number of + uneeded paints. + + * clutter/clutter-texture.c: (clutter_texture_set_pixbuf): + Remove visible check which broke paints of resized texture pixmaps. + +2006-04-19 Matthew Allum + + * clutter/clutter-bin.c: (clutter_bin_paint), (clutter_bin_add): + * clutter/clutter-element.c: (clutter_element_paint): + * clutter/clutter-element.h: + * clutter/clutter-label.c: (clutter_label_set_property), + (clutter_label_get_property), (clutter_label_class_init): + * clutter/clutter-marshal.list: + * clutter/clutter-rectangle.c: (clutter_rectangle_set_property), + (clutter_rectangle_get_property), (clutter_rectangle_class_init): + * clutter/clutter-stage.c: (clutter_stage_dispose), + (clutter_stage_get_property), (clutter_stage_class_init): + * clutter/clutter-texture.c: (clutter_texture_realize), + (clutter_texture_class_init), (clutter_texture_set_pixbuf): + * clutter/clutter-texture.h: + More object cleanups. Add signal to texture size changes. + Fix color props. Adjust element realise flags workings ( broken ). + * examples/test-video.c: (main): + Broken due to realize flag changes. + +2006-04-18 Matthew Allum + + * clutter/clutter-bin.c: (clutter_bin_get_property), + (clutter_bin_finalize), (clutter_bin_class_init), + (clutter_bin_new), (clutter_bin_show_all), (clutter_bin_hide_all), + (clutter_bin_add): + * clutter/clutter-bin.h: + * clutter/clutter-element.c: (clutter_element_get_property), + (clutter_element_finalize), (clutter_element_class_init), + (clutter_element_set_parent), (clutter_element_get_parent), + (clutter_element_raise), (clutter_element_lower): + * clutter/clutter-element.h: + * clutter/clutter-label.c: (clutter_label_make_pixbuf), + (clutter_label_get_property), (clutter_label_dispose), + (clutter_label_finalize), (clutter_label_class_init), + (clutter_label_init), (clutter_label_new_with_text), + (clutter_label_new), (clutter_label_set_text), + (clutter_label_set_font), (clutter_label_set_fg_color): + * clutter/clutter-label.h: + * clutter/clutter-rectangle.c: (clutter_rectangle_paint), + (clutter_rectangle_set_property), (clutter_rectangle_get_property), + (clutter_rectangle_finalize), (clutter_rectangle_dispose), + (clutter_rectangle_class_init), (clutter_rectangle_init), + (clutter_rectangle_new): + * clutter/clutter-texture.c: (clutter_texture_paint), + (clutter_texture_dispose), (clutter_texture_finalize), + (clutter_texture_set_property), (clutter_texture_get_property), + (clutter_texture_class_init), (clutter_texture_init), + (clutter_texture_set_pixbuf), (clutter_texture_new_from_pixbuf): + Various GObject usages cleanups, adding properties and + finalize/dispose functions properly. + +2006-04-18 Matthew Allum + + * bindings/python/Makefile.am: + * bindings/python/clutter.override: + * bindings/python/cluttermodule.c: (initclutter): + * clutter/clutter-label.h: + * clutter/clutter-rectangle.h: + * clutter/clutter-video-texture.h: + More fixups to now less broken python bindings + * examples/rects.py: + A simple python script using bindings + +2006-04-18 Matthew Allum + + * clutter/clutter-marshal.list: + Add missing. + +2006-04-17 Matthew Allum + + * Makefile.am: + * bindings/Makefile.am: + * bindings/python/Makefile.am: + * bindings/python/clutter.override: + * bindings/python/cluttermodule.c: + * configure.ac: + First shot at some python bindings ( broken atm ) + * clutter/clutter-bin.h: + * clutter/clutter-element.h: + * clutter/clutter-stage.h: + * clutter/clutter-texture.h: + * clutter/clutter.h: + Rejig headers a little so h2def.py happier + +2006-04-17 Matthew Allum + + * TODO: + * doc/clutter.types: + * doc/reference/Makefile.am: + Move gtk-doc gubbins to doc/reference + +2006-04-16 Matthew Allum + + * TODO: + More updates + + * clutter/clutter-bin.c: (clutter_bin_paint): + Add translate call + + * clutter/clutter-texture.c: (clutter_texture_dispose), + (clutter_texture_class_init), (clutter_texture_set_pixbuf): + Fixup object finalization a little. + + * bootstrap-autotools.sh: + * configure.ac: + * doc/Makefile.am: + * doc/clutter.types: + Add gtk-doc infrastructure + +2006-04-15 Matthew Allum + + * TODO: + More ideas. + + * clutter/Makefile.am: + * clutter/clutter-rectangle.c: (clutter_rectangle_new): + Sync passed color alpha chan to element opacity, + + * clutter/clutter-video-texture.c: + (clutter_video_texture_error_quark), (signal_eos_delayed), + (query_timeout), (got_video_size), (caps_set), (parse_stream_info), + (handle_element_message) + * clutter/clutter-video-texture.h: + Port more of bacon video widget API. + + * examples/test-video.c: (foo), (tick), (main): + Add a simple overlay displaying playback time. + +2006-04-15 Matthew Allum + + * clutter/clutter-element.c: + * clutter/clutter-label.c: (clutter_label_init), + (clutter_label_new_with_text): + * clutter/clutter-label.h: + * clutter/clutter-main.c: (clutter_redraw), (clutter_gl_unlock): + * clutter/clutter-main.h: + * clutter/clutter-rectangle.c: (clutter_rectangle_init), + (clutter_rectangle_new): + * clutter/clutter-rectangle.h: + * clutter/clutter-texture.c: (clutter_texture_class_init), + (clutter_texture_set_pixbuf), (clutter_texture_new_from_pixbuf): + * clutter/clutter-texture.h: + * clutter/clutter-video-texture.c: (clutter_video_texture_init): + * clutter/clutter-video-texture.h: + * examples/test-video.c: (main): + * examples/test.c: (main): + * examples/video-cube.c: (clutter_video_texture_cube_init), (main): + Make xxx_new() return there type as ClutterElement* + +2006-04-15 Matthew Allum + + * TODO: + Update + * clutter/clutter-main.c: + * clutter/clutter-stage.c: + * clutter/clutter-texture.c: + * clutter/clutter-texture.h: + * gst/clutterimagesink.c: (gst_clutterimagesink_clutterimage_put), + (gst_clutterimagesink_context_get): + Various experiments with textures and 3D views. + + * clutter/clutter-video-texture.c: + (clutter_video_texture_class_init), (clutter_video_texture_init): + * examples/Makefile.am: + * examples/test-video.c: (main): + * examples/video-cube.c: + Add video-cube example + +2006-04-13 Matthew Allum + + * TODO: + Update + + * clutter/clutter-bin.c: + * clutter/clutter-bin.h: + New container element + + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: + Make stage a proper element + + * clutter/Makefile.am: + * clutter/clutter.h: + * clutter/clutter-element.c: (clutter_element_show), + (clutter_element_set_opacity): + * clutter/clutter-element.h: + * clutter/clutter-label.c: (clutter_label_make_pixbuf), + (clutter_label_set_text), (clutter_label_set_font): + * clutter/clutter-private.h: + Various tweaks new api calls. + + * clutter/clutter-main.c: (events_init): + * clutter/clutter-main.h: + Make ClutterContex Private to main + + * clutter/clutter-texture.c: + * clutter/clutter-texture.h: + * clutter/clutter-video-texture.c: + (clutter_video_texture_finalize): + Fix video crash + + * examples/test-video.c: (main): + * examples/test.c: (main): + Fix for API changes. + +2006-04-11 Matthew Allum + + * TODO: + Add + * clutter/clutter-video-texture.c: + (clutter_video_texture_finalize): + * clutter/clutter-video-texture.h: + Remove bogus pixbuf attribute + +2006-04-10 Matthew Allum + + * clutter/clutter-main.c: (clutter_dispatch_x_event), + (clutter_queue_redraw), (clutter_main), (clutter_set_stage_params), + (clutter_init): + * clutter/clutter-main.h: + * clutter/clutter-private.h: + Make Stage non fullscreen ( for now ). Change event loop to + work better with video. + + * clutter/Makefile.am: + * clutter/clutter-label.c: (clutter_label_make_pixbuf), + (clutter_label_class_init), (clutter_label_new_with_text), + (clutter_label_set_text), (clutter_label_set_font): + * clutter/clutter-texture.c: (texture_render_to_gl_quad), + (clutter_texture_unrealize), (clutter_texture_sync_pixbuf), + (clutter_texture_realize), (clutter_texture_show), + (clutter_texture_hide), (clutter_texture_paint), + (clutter_texture_finalize), (clutter_texture_set_property), + (clutter_texture_get_property), (clutter_texture_class_init), + (clutter_texture_init), (clutter_texture_get_pixbuf), + (clutter_texture_set_pixbuf), (clutter_texture_new_from_pixbuf): + * clutter/clutter-texture.h: + * clutter/clutter.h: + Fix leakage. Improve performance. Add support for non tiled + textures. + + * examples/Makefile.am: + * examples/test.c: (timeout_text_cb), (main): + Experiments + + * examples/test-video.c: + * configure.ac: + * gst/Makefile.am: + * gst/clutterimagesink.c: + * gst/clutterimagesink.h: + * clutter/clutter-video-texture.c: + * clutter/clutter-video-texture.h: + Add initial support for video textures with gst-0.10 + + * gst/cltrimagesink.c: + * gst/cltrimagesink.h: + Remove old gst-0.8 sink + +2006-04-05 Matthew Allum + + * clutter/Makefile.am: + * clutter/clutter-element.c: (clutter_element_show), + (clutter_element_hide), (clutter_element_realize), + (clutter_element_unrealize), (clutter_element_paint), + (clutter_element_finalize), (clutter_element_class_init), + (clutter_element_init), (clutter_element_new): + * clutter/clutter-element.h: + * clutter/clutter.h: + * clutter/clutter-main.c: (clutter_dispatch_x_event), + (events_init), (clutter_redraw), (clutter_main), (clutter_init), + (clutter_show_stage): + * clutter/clutter-main.h: + Various minor tweaks. + + * clutter/clutter-private.h: + * clutter/clutter-texture.c: (can_create), (init_tiles), + (clutter_texture_unrealize), (clutter_texture_realize), + (clutter_texture_finalize), (clutter_texture_class_init), + (clutter_texture_init): + * clutter/clutter-texture.h: + Much improve texture class. + + * clutter/clutter-label.c: + * clutter/clutter-label.h: + Add new text rendering class + + * clutter/clutter-rectangle.c: + * clutter/clutter-rectangle.h: + Add basic rectangle drawing class + + * examples/test.c: + Add text rendering and animation to test. + +2006-04-04 Matthew Allum + + * clutter/Makefile.am: + * clutter/clutter-element.c: (clutter_element_realize): + * clutter/clutter-element.h: + * clutter/clutter-image.c: + * clutter/clutter-image.h: + * clutter/clutter-main.c: (clutter_dispatch_x_event), + (clutter_main), (clutter_set_stage_params), (clutter_init): + * clutter/clutter-texture.c: (next_p2), (can_create), + (tile_dimension), (init_tiles), (texture_render_to_gl_quad), + (clutter_texture_unrealize), (clutter_texture_realize), + (clutter_texture_get_pixbuf), (clutter_texture_paint), + (clutter_texture_finalize), (clutter_texture_class_init): + * clutter/clutter-texture.h: + * clutter/clutter.h: + * configure.ac: + * examples/test.c: + Implement basic tiled texture painting. + +2006-04-03 Matthew Allum + + reviewed by: + + * clutter/Makefile.am: + * clutter/clutter-element.c: + * clutter/clutter-element.h: + * clutter/clutter-image.c: + * clutter/clutter-image.h: + * clutter/clutter-main.c: (events_init), (stage_realize), + (clutter_queue_redraw), (clutter_redraw), (clutter_add_to_stage), + (clutter_remove_from_stage), (clutter_main), + (clutter_set_stage_params), (clutter_init): + * clutter/clutter-main.h: + * clutter/clutter-private.h: + * clutter/clutter.h: + * examples/test.c: + +2006-04-02 Matthew Allum + + * clutter/Makefile.am: + * clutter/cltr-animator.c: + * clutter/cltr-animator.h: + * clutter/cltr-button.c: + * clutter/cltr-button.h: + * clutter/cltr-core.c: + * clutter/cltr-core.h: + * clutter/cltr-events.c: + * clutter/cltr-events.h: + * clutter/cltr-glu.c: + * clutter/cltr-glu.h: + * clutter/cltr-label.c: + * clutter/cltr-label.h: + * clutter/cltr-list.c: + * clutter/cltr-list.h: + * clutter/cltr-overlay.c: + * clutter/cltr-overlay.h: + * clutter/cltr-photo-grid.c: + * clutter/cltr-photo-grid.h: + * clutter/cltr-private.h: + * clutter/cltr-scratch.c: + * clutter/cltr-scratch.h: + * clutter/cltr-texture.c: + * clutter/cltr-texture.h: + * clutter/cltr-video.c: + * clutter/cltr-video.h: + * clutter/cltr-widget.c: + * clutter/cltr-widget.h: + * clutter/cltr-window.c: + * clutter/cltr-window.h: + * clutter/cltr.h: + * clutter/clutter-main.c: + * clutter/clutter-main.h: + * clutter/clutter-private.h: + * clutter/clutter.h: + * clutter/fonts.c: + * clutter/fonts.h: + * clutter/pixbuf.c: + * clutter/pixbuf.h: + * clutter/util.c: + * clutter/util.h: + * configure.ac: + * examples/Makefile.am: + * examples/photos.c: + * examples/player.c: + * examples/scratch.c: + * examples/select.c: + * examples/test.c: + Remove old cltr files replacing with beginnings of + rejigged 'clutter' ones. + +2005-05-27 mallum,,, + + * clutter/cltr-animator.c: (cltr_animator_zoom_new), + (cltr_animator_move_new), (cltr_animator_fullzoom_new), + (cltr_animator_new), (cltr_animator_set_args), + (cltr_animator_wrapped_zoom_paint), (cltr_animator_reset), + (cltr_animator_timeout_cb), (cltr_animator_run): + * clutter/cltr-animator.h: + * clutter/cltr-button.c: (cltr_button_set_label), + (cltr_button_paint): + * clutter/cltr-label.c: (cltr_label_new), (cltr_label_set_text), + (cltr_label_get_text), (cltr_label_show), + (cltr_label_handle_xevent), (cltr_label_paint): + * clutter/cltr-label.h: + * clutter/cltr-list.c: (cltr_list_paint): + * clutter/cltr-widget.c: + * examples/select.c: (usage), (video_ctrl_hide), + (video_ctrl_stop_cb), (video_ctrl_play_cb), + (video_ctrl_seek_begin_cb), (init_video_ctrl), (show_video_ctrl), + (populate), (cell_to_item), (zoom_video_out), (init_show_controls), + (handle_xevent), (zoom_out_complete), (zoom_in_complete): + More select hacking ... + +2005-05-23 mallum,,, + + * clutter/cltr-button.c: (cltr_button_new_with_label), + (cltr_button_handle_xevent), (cltr_button_paint): + * clutter/cltr-button.h: + * clutter/cltr-events.c: (cltr_main_loop): + * clutter/cltr-list.c: (cltr_list_cell_new), + (cltr_list_append_cell), (cltr_list_update_layout), + (cltr_list_paint): + * clutter/cltr-list.h: + * clutter/cltr-overlay.c: (cltr_overlay_paint): + * clutter/cltr-private.h: + * clutter/cltr-widget.c: (cltr_widget_show), + (cltr_widget_show_all), (cltr_widget_add_child): + * clutter/cltr-widget.h: + * clutter/cltr-window.c: (cltr_window_show), (cltr_window_paint), + (cltr_window_handle_xevent), (cltr_window_post_paint), + (cltr_window_set_paint_funcs), (cltr_window_xwin), + (cltr_window_hide_cursor), (cltr_window_set_fullscreen): + * clutter/cltr-window.h: + * examples/select.c: (usage), (init_video_ctrl), (show_video_ctrl), + (populate), (cell_to_item), (handle_xevent), (zoom_out_complete), + (zoom_in_complete), (cell_activated), (main): + Much Select hacking + +2005-05-17 mallum,,, + + * clutter/cltr-video.c: (cltr_video_get_pixbuf): + * gst/cltrimagesink.c: (gst_cltrimagesink_change_state), + (gst_cltrimagesink_chain): + Fix thread related segv's on grabbing video image. + Also pop any unplayed data from sink on stop + +2005-05-16 mallum,,, + + * clutter/cltr-animator.c: (cltr_animator_zoom_new), + (cltr_animator_fullzoom_new), (cltr_animator_new), + (cltr_animator_set_args), (cltr_animator_wrapped_paint): + * clutter/cltr-animator.h: + * clutter/cltr-list.c: (cltr_list_cell_new), + (cltr_list_get_active_cell_co_ords), (cltr_list_show), + (cltr_list_on_activate_cell), (cltr_list_update_layout), + (cltr_list_paint): + * clutter/cltr-list.h: + * clutter/cltr-texture.c: (cltr_texture_realize), + (cltr_texture_unref), (cltr_texture_sync_pixbuf), + (cltr_texture_force_rgb_data): + * clutter/cltr-video.c: (got_stream_length), (got_time_tick), + (got_state_change), (parse_stream_info), (cb_iterate), + (cltr_video_play), (cltr_video_set_volume), + (cltr_video_get_volume), (cltr_video_get_pixbuf), + (cltr_video_idler), (cltr_video_set_source), + (cltr_video_handle_xevent), (cltr_video_paint): + * clutter/cltr-video.h: + * clutter/cltr-widget.c: + * clutter/pixbuf.c: (pixbuf_write_png), (load_png_file), + (pixbuf_copy), (pixbuf_fill_rect), (pixbuf_scale_down), + (pixbuf_clone): + * examples/select.c: (usage), (populate), (cell_to_item), + (handle_xevent), (zoom_out_complete), (zoom_in_complete), + (cell_activated), (main): + * gst/cltrimagesink.c: (gst_cltrimagesink_getcaps), + (gst_cltrimagesink_chain): + Far too much hacking. Fix many endian image issues. + Greatly improve select demo + +2005-05-16 mallum,,, + + * clutter/Makefile.am: + * clutter/cltr-animator.c: + * clutter/cltr-animator.h: + * clutter/cltr-list.c: (distfunc), (cltr_list_new), + (cltr_list_get_active_cell_co_ords), (cltr_list_show), + (cltr_list_on_activate_cell), (cltr_list_handle_xevent), + (cltr_list_animate), (cltr_list_timeout_cb), + (cltr_list_update_layout), (cltr_list_paint): + * clutter/cltr-list.h: + * clutter/cltr-private.h: + * clutter/cltr.h: + * clutter/pixbuf.c: (load_png_file): + * examples/player.c: + * examples/select.c: (usage), (populate), (cell_activated), (main): + Work on animator zooming. Also build up select.c much + +2005-05-14 mallum,,, + + * clutter/cltr-animator.c: + Add initial outline + * clutter/cltr-button.c: (cltr_button_new_with_pixbuf), + (cltr_button_handle_xkeyevent), (cltr_button_handle_xevent), + (cltr_button_paint): + various tweaks/experimentation + * clutter/cltr-core.c: (cltr_init), (cltr_display_height): + * clutter/cltr-glu.c: (cltr_glu_set_color): + * clutter/cltr-glu.h: + Add unfilled rect call. + * clutter/cltr-label.c: (cltr_label_new), (cltr_label_paint): + * clutter/cltr-list.c: (distfunc), (cltr_list_cell_new), + (cltr_list_show), (cltr_list_animate), (cltr_list_paint): + update list a little. + * clutter/cltr-overlay.c: (cltr_overlay_handle_xevent), + (cltr_overlay_paint): + * clutter/cltr-private.h: + * clutter/cltr-texture.c: (cltr_texture_realize): + * clutter/cltr-video.c: (cltr_video_paint): + * clutter/cltr.h: + * clutter/fonts.c: (draw_layout_on_pixbuf): + Fix font alpha blending + * examples/Makefile.am: + * examples/player.c: (main): + * examples/scratch.c: (main): + tweaks. + * examples/select.c: + new example + +2005-05-11 mallum,,, + + * clutter/cltr-video.c: (got_buffering), (cltr_video_new), + (cltr_video_play), (cltr_video_idler): + * examples/photos.c: (main): + * examples/player.c: (handle_xevent), (main): + * gst/cltrimagesink.c: (gst_cltrimagesink_chain): + Fix Gl thread related crash on video playback + Make examples less bound to my laptop ;) + +2005-05-06 mallum,,, + + * clutter/cltr-button.c: (cltr_button_new_with_label): + * clutter/cltr-overlay.c: + * clutter/cltr-photo-grid.c: (cltr_photo_grid_cell_new), + (cltr_photo_grid_paint), (cltr_photo_grid_new): + * clutter/cltr-video.c: (cltr_video_print_tag), (got_buffering), + (got_error), (caps_set), (parse_stream_info), (cb_iterate), + (cltr_video_new), (cltr_video_play), (cltr_video_seek), + (cltr_video_seek_time), (cltr_video_stop), (cltr_video_close), + (cltr_video_pause), (cltr_video_can_set_volume), + (cltr_video_set_volume), (cltr_video_get_volume), + (cltr_video_idler), (cltr_video_set_source), (cltr_video_show), + (cltr_video_hide), (cltr_video_handle_xevent), (cltr_video_paint): + * clutter/cltr-video.h: + * clutter/cltr-widget.h: + * clutter/cltr-window.c: (cltr_window_show), (cltr_window_paint), + (cltr_window_handle_xevent), (cltr_window_set_fullscreen), + (cltr_window_focus_widget): + * clutter/cltr-window.h: + * clutter/cltr.h: + * clutter/fonts.c: (get_layout_bitmap), (font_draw), + (font_get_pixel_size): + * configure.ac: + * examples/photos.c: (photo_grid_populate): + * examples/player.c: (handle_xevent), (main): + * examples/scratch.c: (main): + Lots more tweaks, mainly updating video widget. + +2005-04-29 mallum,,, + + * clutter/cltr-button.c: (cltr_button_new), + (cltr_button_on_activate), (cltr_button_new_with_label), + (cltr_button_show): + * clutter/cltr-button.h: + * clutter/cltr-label.c: (cltr_label_new), (cltr_label_paint): + * clutter/cltr-private.h: + * clutter/cltr-video.c: (cltr_video_play): + * clutter/cltr-widget.c: (cltr_widget_new), (cltr_widget_abs_x), + (cltr_widget_abs_y), (cltr_widget_abs_x2), (cltr_widget_abs_y2), + (cltr_widget_width), (cltr_widget_height), (cltr_widget_show), + (cltr_widget_focus), (cltr_widget_unfocus), + (cltr_widget_set_focus_next), (cltr_widget_get_focus_next), + (cltr_widget_show_all): + * clutter/cltr-widget.h: + * clutter/cltr-window.c: (cltr_window_new), + (cltr_window_focus_widget): + * clutter/cltr.h: + * clutter/fonts.c: (draw_layout_on_pixbuf), (font_get_pixel_size): + * examples/scratch.c: (main): + Hack buttons some more + +2005-04-27 mallum,,, + + * clutter/Makefile.am: + * clutter/cltr-button.c: (cltr_button_new): + * clutter/cltr-label.c: + * clutter/cltr-label.h: + * clutter/cltr-photo-grid.c: (cltr_photo_grid_paint): + * clutter/cltr-texture.c: (cltr_texture_realize), + (cltr_texture_new), (cltr_texture_unref), + (cltr_texture_no_tile_new): + * clutter/cltr-texture.h: + * clutter/cltr-video.c: (cltr_video_got_time_tick), (caps_set), + (cltr_video_new), (cltr_video_idler), (cltr_video_set_source), + (cltr_video_play), (cltr_video_pause), (cltr_video_show), + (cltr_video_hide), (cltr_video_handle_xevent), (cltr_video_paint): + * clutter/cltr.h: + * clutter/fonts.c: (font_new), (draw_layout_on_pixbuf), + (font_draw): + * clutter/fonts.h: + * clutter/pixbuf.c: (pixbuf_set_pixel), (pixbuf_get_pixel): + * examples/photos.c: (photo_grid_populate), (main): + * examples/player.c: (main): + Improve video widget, use playbin rather than gst_play + Lots of misc tweaks. + +2005-04-26 mallum,,, + + * clutter/Makefile.am: + * clutter/cltr-core.c: (cltr_init): + * clutter/cltr-events.c: (cltr_events_init), (cltr_main_loop): + * clutter/cltr-photo-grid.c: + * clutter/cltr-private.h: + * clutter/cltr-scratch.c: (cltr_scratch_handle_xevent), + (cltr_scratch_paint): + * clutter/cltr-texture.c: (cltr_texture_render_to_gl_quad), + (init_tiles), (cltr_texture_unrealize), (cltr_texture_realize), + (cltr_texture_new), (cltr_texture_no_tile_new), + (cltr_texture_get_pixbuf): + * clutter/cltr-texture.h: + * clutter/cltr-video.c: + * clutter/cltr-video.h: + * clutter/cltr-widget.c: (cltr_widget_queue_paint): + * clutter/cltr.h: + * examples/Makefile.am: + * examples/player.c: + * gst/cltrimagesink.c: (gst_cltrimagesink_fixate), + (gst_cltrimagesink_getcaps), (gst_cltrimagesink_sink_link), + (gst_cltrimagesink_change_state), (gst_cltrimagesink_chain), + (gst_cltrimagesink_set_property), (gst_cltrimagesink_get_property), + (gst_cltrimagesink_finalize), (gst_cltrimagesink_class_init): + * gst/cltrimagesink.h: + Initial go at very hacky gst video widget + +2005-04-22 mallum,,, + + * clutter/Makefile.am: + * clutter/cltr-button.c: + * clutter/cltr-button.h: + * clutter/cltr-core.c: (cltr_init): + * clutter/cltr-overlay.c: + * clutter/cltr-overlay.h: + * clutter/cltr-photo-grid.c: (cltr_photo_grid_handle_xevent), + (cltr_photo_grid_cell_new), (ctrl_photo_grid_get_zoomed_coords), + (cell_is_offscreen), (cltr_photo_grid_idle_cb), + (cltr_photo_grid_navigate), (cltr_photo_grid_activate_cell), + (cltr_photo_grid_populate), (cltr_photo_grid_update_visual_state), + (cltr_photo_grid_paint), (cltr_photo_grid_show), + (cltr_photo_grid_set_fps), (cltr_photo_grid_get_fps), + (cltr_photo_grid_set_anim_steps), (cltr_photo_grid_get_anim_steps), + (cltr_photo_grid_new): + Fix up grid so external prog can load images. + * clutter/cltr-photo-grid.h: + * clutter/cltr-texture.c: (cltr_texture_realize), + (cltr_texture_new): + * clutter/cltr-texture.h: + * clutter/cltr-window.c: (cltr_window_set_fullscreen): + * clutter/cltr.h: + * clutter/pixbuf.c: (pixbuf_scale_down), (ConvolveImage), + (GaussianBlurImage): + * clutter/pixbuf.h: + New experimental Methods + * configure.ac: + * examples/Makefile.am: + * examples/photos.c: + * examples/player.c: + Add new examples + * gst/Makefile.am: + * gst/cltrimagesink.c: + * gst/cltrimagesink.h: + Add initial crusty ( broken ) gst stuff + +2005-04-13 mallum,,, + + * bootstrap-autotools.sh: + * clutter/Makefile.am: + * clutter/cltr.c: + * configure.ac: + * examples/Makefile.am: + * examples/scratch.c: + Initial autotooling of everything. + +2005-04-07 mallum,,, + + * Makefile: + * cltr-events.c: (cltr_main_loop): + * cltr-list.c: + * cltr-list.h: + Add list widget + * cltr-photo-grid.c: (cltr_photo_grid_cell_new), + (cltr_photo_grid_append_cell), (ctrl_photo_grid_cell_to_coords), + (ctrl_photo_grid_get_zoomed_coords), (cltr_photo_grid_idle_cb), + (cltr_photo_grid_navigate), (cltr_photo_grid_activate_cell), + (cltr_photo_grid_update_visual_state), (cltr_photo_grid_paint), + (cltr_photo_grid_show), (cltr_photo_grid_new): + * cltr-texture.c: + * cltr-widget.c: + * cltr-window.c: (cltr_window_new), (cltr_window_show), + (cltr_window_handle_xevent): + * cltr-window.h: + * cltr.c: (main): + * cltr.h: + * pixbuf.c: (pixbuf_copy): + * pixbuf.h: + Cleanups + +2005-04-03 mallum,,, + + * Makefile: + * cltr-core.c: + * cltr-core.h: + * cltr-events.c: + * cltr-events.h: + * cltr-photo-grid.c: (cltr_photo_grid_handle_xkeyevent), + (cltr_photo_grid_handle_xevent), (cltr_photo_grid_cell_new), + (cltr_photo_grid_append_cell), (ctrl_photo_grid_cell_to_coords), + (ctrl_photo_grid_get_zoomed_coords), (cell_is_offscreen), + (cltr_photo_grid_idle_cb), (cltr_photo_grid_navigate), + (cltr_photo_grid_activate_cell), (cltr_photo_grid_populate), + (cltr_photo_grid_paint), (cltr_photo_grid_show), + (cltr_photo_grid_new): + * cltr-photo-grid.h: + * cltr-private.h: + * cltr-texture.c: + * cltr-texture.h: + * cltr-widget.c: + * cltr-widget.h: + * cltr-window.c: + * cltr-window.h: + * cltr.c: + * cltr.h: + Add very basic initial toolkit infrastructure + +2005-03-31 mallum,,, + + * cltr-photo-grid.c: (cltr_photo_grid_append_cell), + (ctrl_photo_grid_cell_to_coords), + (ctrl_photo_grid_get_zoomed_coords), (cell_is_offscreen), + (cltr_photo_grid_idle_cb), (cltr_photo_grid_navigate), + (cltr_photo_grid_activate_cell), (cltr_photo_grid_populate), + (cltr_photo_grid_redraw), (cltr_photo_grid_new): + * cltr-photo-grid.h: + * cltr-texture.c: (cltr_texture_render_to_gl_quad), (init_tiles), + (cltr_texture_realize): + * cltr-texture.h: + * cltr.c: (main): + Implemented scrolling. Very rough around the edges, needs tidying. + +2005-03-30 mallum,,, + + * Makefile: + * cltr-photo-grid.c: (cltr_photo_grid_redraw), + (cltr_photo_grid_new): + * cltr-tex.c: + * cltr-tex.h: + * cltr-texture.c: (cltr_texture_new): + More renaming + +2005-03-30 mallum,,, + + * cltr-photo-grid.c: (cltr_photo_grid_populate), + (cltr_photo_grid_redraw), (cltr_photo_grid_new): + * cltr-photo-grid.h: + * cltr-tex.c: (next_p2), (cltr_texture_render_to_gl_quad), + (tile_dimension), (init_tiles), (cltr_texture_new): + * cltr-tex.h: + * cltr.h: + Rename CltrImage -> CltrTexture + +2005-03-30 mallum,,, + + * Makefile: + * cltr-photo-grid.c: (cltr_photo_grid_populate), + (cltr_photo_grid_redraw): + * cltr-photo-grid.h: + * cltr-tex.c: + * cltr-tex.h: + * cltr.c: (main): + * cltr.h: + * pixbuf.c: (pixbuf_unref), (pixbuf_copy): + * pixbuf.h: + Add intial new texture tiling code. + +2005-03-27 mallum,,, + + * Makefile: + * cltr-photo-grid.c: (cltr_photo_grid_cell_new), + (ctrl_photo_grid_get_zoomed_coords), (cltr_photo_grid_navigate), + (cltr_photo_grid_activate_cell), (cltr_photo_grid_populate), + (cltr_photo_grid_redraw), (cltr_photo_grid_new): + * cltr-photo-grid.h: + * cltr.c: (cltr_dispatch_x_event), (cltr_init), (test_idle_cb), + (main): + * cltr.h: + Add a very hacky threaded image loader. + Make event handling a little more efficient, though still hacky + * pixbuf.c: (pixel_set_vals), pixbuf.h: + Add copy func ( unused as yet ) + +2005-03-25 mallum,,, + + * cltr-photo-grid.c: (cltr_photo_grid_cell_new), + (ctrl_photo_grid_get_zoomed_coords), (cltr_photo_grid_redraw), + (cltr_photo_grid_new): + * cltr-photo-grid.h: + * cltr.c: (cltr_window_new), (idle_cb), (main): + Use GL matrices in a saner way. + Add random rotation to picts + Random minor tweaks + +2005-03-24 mallum,,, + + * Makefile: + * cltr-photo-grid.c: + * cltr-photo-grid.h: + * cltr.c: (cltr_window_new), (cltr_main_loop): + * cltr.h: + Split up cltr.c a bit. start refactoring a bit. + +2005-03-23 mallum,,, + + * cltr.c: (cltr_photo_grid_populate), (cltr_photo_grid_redraw), + (cltr_photo_grid_new), (main): + * cltr.h: + Various minor tweaks + * pixbuf.c: (pixbuf_set_pixel), (pixbuf_get_pixel): + Fix RGBA ordering in set/get pixel + +2005-03-23 mallum,,, + + * cltr.c: (ctrl_photo_grid_get_trans_coords), + Fix grid co-ords -> translation vals converter + (cltr_photo_grid_navigate), (cltr_photo_grid_redraw), + (cltr_photo_grid_new), (idle_cb): + Fix moving between pictures when zoomed + +2005-03-23 mallum,,, + + * cltr.c: (cltr_dispatch_x_event), (cltr_window_new), + (cltr_main_loop), (cltr_photo_grid_navigate), + (cltr_photo_grid_activate_cell), (cltr_photo_grid_populate), + (cltr_photo_grid_redraw), (cltr_photo_grid_new), (idle_cb), (main): + * cltr.h: + Lots, make the grid roughly work. + + * fonts.c: (get_layout_bitmap), (font_draw): + remove debug printfs + +2005-03-22 mallum,,, + + * cltr.c: (x_event_prepare), (x_event_check), (x_event_dispatch), + (cltr_dispatch_x_event), (cltr_init), (cltr_window_new), + (cltr_photo_grid_append_cell), (cltr_photo_grid_populate), + (cltr_photo_grid_redraw), (cltr_photo_grid_new), + (idle_cb), (main): + * cltr.h: + Add glib event loop diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-actor.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-actor.c --- clutter-0.8.4/clutter/clutter-actor.c 2008-11-13 14:44:32.000000000 +0000 +++ clutter-0.9.0/clutter/clutter-actor.c 2009-01-28 16:47:03.000000000 +0000 @@ -57,13 +57,13 @@ * the actor settings by the following order of operations: * * Translation by actor x, y coords, + * Translation by actor depth (z), * Scaling by scale_x, scale_y, - * Negative translation by anchor point x, - * y, * Rotation around z axis, * Rotation around y axis, * Rotation around x axis, - * Translation by actor depth (z), + * Negative translation by anchor point x, + * y, * Rectangular Clip is applied (this is not an operation on * the matrix as such, but it is done as part of the transform set * up). @@ -183,10 +183,33 @@ #include "cogl/cogl.h" typedef struct _ShaderData ShaderData; +typedef struct _AnchorCoord AnchorCoord; #define CLUTTER_ACTOR_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_ACTOR, ClutterActorPrivate)) +/* Internal helper struct to represent a point that can be stored in + either direct pixel coordinates or as a fraction of the actor's + size. It is used for the anchor point, scale center and rotation + centers. */ +struct _AnchorCoord +{ + gboolean is_fractional; + + union + { + /* Used when is_fractional == TRUE */ + struct + { + gdouble x; + gdouble y; + } fraction; + + /* Use when is_fractional == FALSE */ + ClutterVertex units; + } v; +}; + struct _ClutterActorPrivate { /* fixed_x, fixed_y, and the allocation box are all in parent @@ -221,29 +244,27 @@ /* cached allocation is invalid (request has changed, probably) */ guint needs_allocation : 1; - guint has_clip : 1; + guint show_on_set_parent : 1; + guint has_clip : 1; + ClutterUnit clip[4]; /* Rotation angles */ - ClutterFixed rxang; - ClutterFixed ryang; - ClutterFixed rzang; + gdouble rxang; + gdouble ryang; + gdouble rzang; /* Rotation center: X axis */ - ClutterUnit rxy; - ClutterUnit rxz; + AnchorCoord rx_center; /* Rotation center: Y axis */ - ClutterUnit ryx; - ClutterUnit ryz; + AnchorCoord ry_center; /* Rotation center: Z axis */ - ClutterUnit rzx; - ClutterUnit rzy; + AnchorCoord rz_center; /* Anchor point coordinates */ - ClutterUnit anchor_x; - ClutterUnit anchor_y; + AnchorCoord anchor; /* depth */ ClutterUnit z; @@ -255,12 +276,17 @@ gchar *name; guint32 id; /* Unique ID */ - ClutterFixed scale_x; - ClutterFixed scale_y; + gdouble scale_x; + gdouble scale_y; + + AnchorCoord scale_center; ShaderData *shader_data; - gboolean show_on_set_parent; + PangoContext *pango_context; + + ClutterActor *opacity_parent; + gboolean enable_model_view_transform; }; enum @@ -317,6 +343,9 @@ PROP_SCALE_X, PROP_SCALE_Y, + PROP_SCALE_CENTER_X, + PROP_SCALE_CENTER_Y, + PROP_SCALE_GRAVITY, PROP_ROTATION_ANGLE_X, PROP_ROTATION_ANGLE_Y, @@ -324,9 +353,14 @@ PROP_ROTATION_CENTER_X, PROP_ROTATION_CENTER_Y, PROP_ROTATION_CENTER_Z, + /* This property only makes sense for the z rotation because the + others would depend on the actor having a size along the + z-axis */ + PROP_ROTATION_CENTER_Z_GRAVITY, PROP_ANCHOR_X, PROP_ANCHOR_Y, + PROP_ANCHOR_GRAVITY, PROP_SHOW_ON_SET_PARENT }; @@ -340,6 +374,7 @@ FOCUS_IN, FOCUS_OUT, PAINT, + PICK, REALIZE, UNREALIZE, @@ -392,6 +427,39 @@ static void clutter_actor_set_request_mode (ClutterActor *self, ClutterRequestMode mode); +/* Helper routines for managing anchor coords */ +static void clutter_anchor_coord_get_units (ClutterActor *self, + const AnchorCoord *coord, + ClutterUnit *x, + ClutterUnit *y, + ClutterUnit *z); +static void clutter_anchor_coord_set_units (AnchorCoord *coord, + ClutterUnit x, + ClutterUnit y, + ClutterUnit z); +static ClutterGravity clutter_anchor_coord_get_gravity (AnchorCoord *coord); +static void clutter_anchor_coord_set_gravity (AnchorCoord *coord, + ClutterGravity gravity); +static gboolean clutter_anchor_coord_is_zero (const AnchorCoord *coord); + +/* Helper macro which translates by the anchor coord, applies the + given transformation and then translates back */ +#define TRANSFORM_ABOUT_ANCHOR_COORD(actor, coord, transform) \ + G_STMT_START \ + { \ + ClutterUnit __tx, __ty, __tz; \ + clutter_anchor_coord_get_units ((actor), (coord), \ + &__tx, &__ty, &__tz); \ + cogl_translate (CLUTTER_UNITS_TO_FLOAT (__tx), \ + CLUTTER_UNITS_TO_FLOAT (__ty), \ + CLUTTER_UNITS_TO_FLOAT (__tz)); \ + (transform); \ + cogl_translate (-CLUTTER_UNITS_TO_FLOAT (__tx), \ + -CLUTTER_UNITS_TO_FLOAT (__ty), \ + -CLUTTER_UNITS_TO_FLOAT (__tz)); \ + } \ + G_STMT_END + G_DEFINE_ABSTRACT_TYPE_WITH_CODE (ClutterActor, clutter_actor, G_TYPE_INITIALLY_UNOWNED, @@ -608,10 +676,20 @@ */ if (clutter_actor_should_pick_paint (self)) { - cogl_color (color); - cogl_rectangle (0, 0, - clutter_actor_get_width (self), - clutter_actor_get_height (self)); + ClutterActorBox box = { 0, }; + float width, height; + + clutter_actor_get_allocation_box (self, &box); + + width = CLUTTER_UNITS_TO_FLOAT (box.x2 - box.x1); + height = CLUTTER_UNITS_TO_FLOAT (box.y2 - box.y1); + + cogl_set_source_color4ub (color->red, + color->green, + color->blue, + color->alpha); + + cogl_rectangle (0, 0, width, height); } } @@ -630,8 +708,10 @@ * silhouette. Containers should always recursively call pick for * each child. * - * Since 0.4 - **/ + * This function will emit the #ClutterActor::pick signal. + * + * Since: 0.4 + */ void clutter_actor_pick (ClutterActor *self, const ClutterColor *color) @@ -639,7 +719,7 @@ g_return_if_fail (CLUTTER_IS_ACTOR (self)); g_return_if_fail (color != NULL); - CLUTTER_ACTOR_GET_CLASS (self)->pick (self, color); + g_signal_emit (self, actor_signals[PICK], 0, color); } /** @@ -769,6 +849,24 @@ g_object_thaw_notify (G_OBJECT (self)); } +/* like ClutterVertex, but using float and with a w component */ +typedef struct { + float x; + float y; + float z; + float w; +} fixed_vertex_t; + +/* copies a fixed vertex into a ClutterVertex */ +static inline void +fixed_vertex_to_units (const fixed_vertex_t *f, + ClutterVertex *u) +{ + u->x = CLUTTER_UNITS_FROM_FIXED (f->x); + u->y = CLUTTER_UNITS_FROM_FIXED (f->y); + u->z = CLUTTER_UNITS_FROM_FIXED (f->z); +} + /* * Utility functions for manipulating transformation matrix * @@ -776,41 +874,117 @@ */ #define M(m,row,col) (m)[(col) * 4 + (row)] -/* Transform point (x,y,z) by matrix */ -static void -mtx_transform (ClutterFixed m[16], - ClutterFixed *x, ClutterFixed *y, ClutterFixed *z, - ClutterFixed *w) -{ - ClutterFixed _x, _y, _z, _w; - _x = *x; - _y = *y; - _z = *z; - _w = *w; - - /* We care lot about precision here, so have to use QMUL */ - *x = CFX_QMUL (M (m, 0, 0), _x) + CFX_QMUL (M (m, 0, 1), _y) + - CFX_QMUL (M (m, 0, 2), _z) + CFX_QMUL (M (m, 0, 3), _w); - - *y = CFX_QMUL (M (m, 1, 0), _x) + CFX_QMUL (M (m, 1, 1), _y) + - CFX_QMUL (M (m, 1, 2), _z) + CFX_QMUL (M (m, 1, 3), _w); - - *z = CFX_QMUL (M (m, 2, 0), _x) + CFX_QMUL (M (m, 2, 1), _y) + - CFX_QMUL (M (m, 2, 2), _z) + CFX_QMUL (M (m, 2, 3), _w); - - *w = CFX_QMUL (M (m, 3, 0), _x) + CFX_QMUL (M (m, 3, 1), _y) + - CFX_QMUL (M (m, 3, 2), _z) + CFX_QMUL (M (m, 3, 3), _w); - - /* Specially for Matthew: was going to put a comment here, but could not - * think of anything at all to say ;) - */ +/* Transforms a vertex using the passed matrix; vertex is + * an in-out parameter + */ +static inline void +mtx_transform (const ClutterFixed m[], + fixed_vertex_t *vertex) +{ + float _x, _y, _z, _w; + + _x = vertex->x; + _y = vertex->y; + _z = vertex->z; + _w = vertex->w; + + /* We care lot about precision here, so have to use MUL instead + * of FAST_MUL + */ + vertex->x = CLUTTER_FIXED_MUL (M (m, 0, 0), _x) + + CLUTTER_FIXED_MUL (M (m, 0, 1), _y) + + CLUTTER_FIXED_MUL (M (m, 0, 2), _z) + + CLUTTER_FIXED_MUL (M (m, 0, 3), _w); + + vertex->y = CLUTTER_FIXED_MUL (M (m, 1, 0), _x) + + CLUTTER_FIXED_MUL (M (m, 1, 1), _y) + + CLUTTER_FIXED_MUL (M (m, 1, 2), _z) + + CLUTTER_FIXED_MUL (M (m, 1, 3), _w); + + vertex->z = CLUTTER_FIXED_MUL (M (m, 2, 0), _x) + + CLUTTER_FIXED_MUL (M (m, 2, 1), _y) + + CLUTTER_FIXED_MUL (M (m, 2, 2), _z) + + CLUTTER_FIXED_MUL (M (m, 2, 3), _w); + + vertex->w = CLUTTER_FIXED_MUL (M (m, 3, 0), _x) + + CLUTTER_FIXED_MUL (M (m, 3, 1), _y) + + CLUTTER_FIXED_MUL (M (m, 3, 2), _z) + + CLUTTER_FIXED_MUL (M (m, 3, 3), _w); + + /* Specially for Matthew: was going to put a comment here, but could not + * think of anything at all to say ;) + */ } #undef M +/* Help macros to scale from OpenGL <-1,1> coordinates system to our + * X-window based <0,window-size> coordinates + */ +#define MTX_GL_SCALE_X(x,w,v1,v2) \ + (CLUTTER_FIXED_MUL (((CLUTTER_FIXED_DIV ((x), (w)) + 1.0) / 2), (v1)) + (v2)) +#define MTX_GL_SCALE_Y(y,w,v1,v2) \ + ((v1) - CLUTTER_FIXED_MUL (((CLUTTER_FIXED_DIV ((y), (w)) + 1.0) / 2), \ + (v1)) + (v2)) +#define MTX_GL_SCALE_Z(z,w,v1,v2) (MTX_GL_SCALE_X ((z), (w), (v1), (v2))) + +/* transforms a 4-tuple of coordinates using @matrix and + * places the result into a fixed @vertex + */ +static inline void +fixed_vertex_transform (const ClutterFixed matrix[], + ClutterFixed x, + ClutterFixed y, + ClutterFixed z, + ClutterFixed w, + fixed_vertex_t *vertex) +{ + fixed_vertex_t tmp = { 0, }; + + tmp.x = x; + tmp.y = y; + tmp.z = z; + tmp.w = w; + + mtx_transform (matrix, &tmp); + + *vertex = tmp; +} + +/* scales a fixed @vertex using @matrix and @viewport, and + * transforms the result into ClutterUnits, filling @vertex_p + */ +static inline void +fixed_vertex_scale (const ClutterFixed matrix[], + const fixed_vertex_t *vertex, + const ClutterFixed viewport[], + ClutterVertex *vertex_p) +{ + ClutterFixed v_x, v_y, v_width, v_height; + fixed_vertex_t tmp = { 0, }; + + tmp = *vertex; + + mtx_transform (matrix, &tmp); + + v_x = viewport[0]; + v_y = viewport[1]; + v_width = viewport[2]; + v_height = viewport[3]; + + tmp.x = MTX_GL_SCALE_X (tmp.x, tmp.w, v_width, v_x); + tmp.y = MTX_GL_SCALE_Y (tmp.y, tmp.w, v_height, v_y); + tmp.z = MTX_GL_SCALE_Z (tmp.z, tmp.w, v_width, v_x); + tmp.w = 0; + + fixed_vertex_to_units (&tmp, vertex_p); +} + /* Applies the transforms associated with this actor and its ancestors, * retrieves the resulting OpenGL modelview matrix, and uses the matrix * to transform the supplied point + * + * The point coordinates are in-out parameters */ static void clutter_actor_transform_point_relative (ClutterActor *actor, @@ -821,14 +995,33 @@ ClutterUnit *w) { ClutterFixed mtx[16]; + fixed_vertex_t vertex = { 0, }; + + vertex.x = (x != NULL) ? CLUTTER_UNITS_TO_FIXED (*x) : 0; + vertex.y = (y != NULL) ? CLUTTER_UNITS_TO_FIXED (*y) : 0; + vertex.z = (z != NULL) ? CLUTTER_UNITS_TO_FIXED (*z) : 0; + vertex.w = (w != NULL) ? CLUTTER_UNITS_TO_FIXED (*w) : 0; cogl_push_matrix(); _clutter_actor_apply_modelview_transform_recursive (actor, ancestor); + cogl_get_modelview_matrix (mtx); - mtx_transform (mtx, x, y, z, w); + mtx_transform (mtx, &vertex); cogl_pop_matrix(); + + if (x) + *x = CLUTTER_UNITS_FROM_FIXED (vertex.x); + + if (y) + *y = CLUTTER_UNITS_FROM_FIXED (vertex.y); + + if (z) + *z = CLUTTER_UNITS_FROM_FIXED (vertex.z); + + if (w) + *w = CLUTTER_UNITS_FROM_FIXED (vertex.w); } /* Applies the transforms associated with this actor and its ancestors, @@ -843,22 +1036,34 @@ ClutterUnit *w) { ClutterFixed mtx[16]; + fixed_vertex_t vertex = { 0, }; + + vertex.x = (x != NULL) ? CLUTTER_UNITS_TO_FIXED (*x) : 0; + vertex.y = (y != NULL) ? CLUTTER_UNITS_TO_FIXED (*y) : 0; + vertex.z = (z != NULL) ? CLUTTER_UNITS_TO_FIXED (*z) : 0; + vertex.w = (w != NULL) ? CLUTTER_UNITS_TO_FIXED (*w) : 0; cogl_push_matrix(); _clutter_actor_apply_modelview_transform_recursive (actor, NULL); + cogl_get_modelview_matrix (mtx); - mtx_transform (mtx, x, y, z, w); + mtx_transform (mtx, &vertex); cogl_pop_matrix(); -} -/* Help macros to scale from OpenGL <-1,1> coordinates system to our - * X-window based <0,window-size> coordinates - */ -#define MTX_GL_SCALE_X(x,w,v1,v2) (CFX_QMUL (((CFX_QDIV ((x), (w)) + CFX_ONE) >> 1), (v1)) + (v2)) -#define MTX_GL_SCALE_Y(y,w,v1,v2) ((v1) - CFX_QMUL (((CFX_QDIV ((y), (w)) + CFX_ONE) >> 1), (v1)) + (v2)) -#define MTX_GL_SCALE_Z(z,w,v1,v2) (MTX_GL_SCALE_X ((z), (w), (v1), (v2))) + if (x) + *x = CLUTTER_UNITS_FROM_FIXED (vertex.x); + + if (y) + *y = CLUTTER_UNITS_FROM_FIXED (vertex.y); + + if (z) + *z = CLUTTER_UNITS_FROM_FIXED (vertex.z); + + if (w) + *w = CLUTTER_UNITS_FROM_FIXED (vertex.w); +} /** * clutter_actor_apply_relative_transform_to_point: @@ -880,21 +1085,27 @@ * Since: 0.6 */ void -clutter_actor_apply_relative_transform_to_point (ClutterActor *self, - ClutterActor *ancestor, - ClutterVertex *point, - ClutterVertex *vertex) -{ - ClutterFixed v[4]; - ClutterFixed w = CFX_ONE; +clutter_actor_apply_relative_transform_to_point (ClutterActor *self, + ClutterActor *ancestor, + const ClutterVertex *point, + ClutterVertex *vertex) +{ + ClutterFixed v[4]; + ClutterUnit x, y, z, w; + fixed_vertex_t tmp; g_return_if_fail (CLUTTER_IS_ACTOR (self)); g_return_if_fail (ancestor == NULL || CLUTTER_IS_ACTOR (ancestor)); + g_return_if_fail (point != NULL); + g_return_if_fail (vertex != NULL); + + x = CLUTTER_UNITS_TO_FIXED (vertex->x); + y = CLUTTER_UNITS_TO_FIXED (vertex->y); + z = CLUTTER_UNITS_TO_FIXED (vertex->z); + w = 1.0; /* First we tranform the point using the OpenGL modelview matrix */ - clutter_actor_transform_point_relative (self, ancestor, - &point->x, &point->y, &point->z, - &w); + clutter_actor_transform_point_relative (self, ancestor, &x, &y, &z, &w); cogl_get_viewport (v); @@ -902,9 +1113,12 @@ * The w[3] parameter should always be 1.0 here, so we ignore it; otherwise * we would have to divide the original verts with it. */ - vertex->x = CFX_QMUL ((point->x + CFX_ONE / 2), v[2]); - vertex->y = CFX_QMUL ((CFX_ONE / 2 - point->y), v[3]); - vertex->z = CFX_QMUL ((point->z + CFX_ONE / 2), v[2]); + tmp.x = CLUTTER_FIXED_MUL (CLUTTER_UNITS_TO_FIXED (x) + 0.5, v[2]); + tmp.y = CLUTTER_FIXED_MUL (0.5 - CLUTTER_UNITS_TO_FIXED (y), v[3]); + tmp.z = CLUTTER_FIXED_MUL (CLUTTER_UNITS_TO_FIXED (z) + 0.5, v[2]); + tmp.w = 0; + + fixed_vertex_to_units (&tmp, vertex); } /** @@ -920,29 +1134,45 @@ * Since: 0.4 **/ void -clutter_actor_apply_transform_to_point (ClutterActor *self, - ClutterVertex *point, - ClutterVertex *vertex) -{ - ClutterFixed mtx_p[16]; - ClutterFixed v[4]; - ClutterFixed w = CFX_ONE; - - g_return_if_fail (CLUTTER_IS_ACTOR (self)); +clutter_actor_apply_transform_to_point (ClutterActor *self, + const ClutterVertex *point, + ClutterVertex *vertex) +{ + ClutterUnit x, y, z, w; + ClutterFixed mtx_p[16]; + ClutterFixed v[4]; + fixed_vertex_t tmp = { 0, }; + + g_return_if_fail (CLUTTER_IS_ACTOR (self)); + g_return_if_fail (point != NULL); + g_return_if_fail (vertex != NULL); + + x = point->x; + y = point->y; + z = point->z; + w = CLUTTER_UNITS_FROM_INT (1); /* First we tranform the point using the OpenGL modelview matrix */ - clutter_actor_transform_point (self, &point->x, &point->y, &point->z, &w); + clutter_actor_transform_point (self, &x, &y, &z, &w); + + tmp.x = CLUTTER_UNITS_TO_FIXED (x); + tmp.y = CLUTTER_UNITS_TO_FIXED (y); + tmp.z = CLUTTER_UNITS_TO_FIXED (z); + tmp.w = CLUTTER_UNITS_TO_FIXED (w); cogl_get_projection_matrix (mtx_p); cogl_get_viewport (v); /* Now, transform it again with the projection matrix */ - mtx_transform (mtx_p, &point->x, &point->y, &point->z, &w); + mtx_transform (mtx_p, &tmp); /* Finaly translate from OpenGL coords to window coords */ - vertex->x = MTX_GL_SCALE_X (point->x, w, v[2], v[0]); - vertex->y = MTX_GL_SCALE_Y (point->y, w, v[3], v[1]); - vertex->z = MTX_GL_SCALE_Z (point->z, w, v[2], v[0]); + vertex->x = + CLUTTER_UNITS_FROM_FIXED (MTX_GL_SCALE_X (tmp.x, tmp.w, v[2], v[0])); + vertex->y = + CLUTTER_UNITS_FROM_FIXED (MTX_GL_SCALE_Y (tmp.y, tmp.w, v[3], v[1])); + vertex->z = + CLUTTER_UNITS_FROM_FIXED (MTX_GL_SCALE_Z (tmp.z, tmp.w, v[2], v[0])); } /* Recursively tranform supplied vertices with the tranform for the current @@ -950,66 +1180,27 @@ * for all the vertices in one go). */ static void -clutter_actor_transform_vertices_relative (ClutterActor *self, - ClutterActor *ancestor, - ClutterVertex verts[4], - ClutterFixed w[4]) +clutter_actor_transform_vertices_relative (ClutterActor *self, + ClutterActor *ancestor, + fixed_vertex_t vertices[]) { - ClutterFixed mtx[16]; - ClutterFixed _x, _y, _z, _w; + ClutterActorPrivate *priv = self->priv; + ClutterFixed mtx[16]; + ClutterFixed width, height; + + width = CLUTTER_UNITS_TO_FIXED (priv->allocation.x2 - priv->allocation.x1); + height = CLUTTER_UNITS_TO_FIXED (priv->allocation.y2 - priv->allocation.y1); cogl_push_matrix(); _clutter_actor_apply_modelview_transform_recursive (self, ancestor); + cogl_get_modelview_matrix (mtx); - _x = 0; - _y = 0; - _z = 0; - _w = CFX_ONE; - - mtx_transform (mtx, &_x, &_y, &_z, &_w); - - verts[0].x = _x; - verts[0].y = _y; - verts[0].z = _z; - w[0] = _w; - - _x = self->priv->allocation.x2 - self->priv->allocation.x1; - _y = 0; - _z = 0; - _w = CFX_ONE; - - mtx_transform (mtx, &_x, &_y, &_z, &_w); - - verts[1].x = _x; - verts[1].y = _y; - verts[1].z = _z; - w[1] = _w; - - _x = 0; - _y = self->priv->allocation.y2 - self->priv->allocation.y1; - _z = 0; - _w = CFX_ONE; - - mtx_transform (mtx, &_x, &_y, &_z, &_w); - - verts[2].x = _x; - verts[2].y = _y; - verts[2].z = _z; - w[2] = _w; - - _x = self->priv->allocation.x2 - self->priv->allocation.x1; - _y = self->priv->allocation.y2 - self->priv->allocation.y1; - _z = 0; - _w = CFX_ONE; - - mtx_transform (mtx, &_x, &_y, &_z, &_w); - - verts[3].x = _x; - verts[3].y = _y; - verts[3].z = _z; - w[3] = _w; + fixed_vertex_transform (mtx, 0, 0, 0, 1.0, &vertices[0]); + fixed_vertex_transform (mtx, width, 0, 0, 1.0, &vertices[1]); + fixed_vertex_transform (mtx, 0, height, 0, 1.0, &vertices[2]); + fixed_vertex_transform (mtx, width, height, 0, 1.0, &vertices[3]); cogl_pop_matrix(); } @@ -1024,12 +1215,15 @@ const ClutterActorBox *box, ClutterVertex verts[4]) { - ClutterActor *stage; - ClutterFixed mtx[16]; - ClutterFixed mtx_p[16]; - ClutterFixed _x, _y, _z, _w; - ClutterFixed w[4]; - ClutterFixed v[4]; + ClutterActor *stage; + ClutterFixed mtx[16]; + ClutterFixed mtx_p[16]; + ClutterFixed v[4]; + ClutterFixed width, height; + fixed_vertex_t vertices[4]; + + width = CLUTTER_UNITS_TO_FIXED (box->x2 - box->x1); + height = CLUTTER_UNITS_TO_FIXED (box->y2 - box->y1); /* We essentially have to dupe some code from clutter_redraw() here * to make sure GL Matrices etc are initialised if we're called and we @@ -1050,102 +1244,25 @@ _clutter_stage_maybe_setup_viewport (CLUTTER_STAGE (stage)); cogl_push_matrix(); + _clutter_actor_apply_modelview_transform_recursive (self, NULL); cogl_get_modelview_matrix (mtx); - _x = 0; - _y = 0; - _z = 0; - _w = CFX_ONE; - - mtx_transform (mtx, &_x, &_y, &_z, &_w); - - verts[0].x = _x; - verts[0].y = _y; - verts[0].z = _z; - w[0] = _w; - - _x = box->x2 - box->x1; - _y = 0; - _z = 0; - _w = CFX_ONE; - - mtx_transform (mtx, &_x, &_y, &_z, &_w); - - verts[1].x = _x; - verts[1].y = _y; - verts[1].z = _z; - w[1] = _w; - - _x = 0; - _y = box->y2 - box->y1; - _z = 0; - _w = CFX_ONE; - - mtx_transform (mtx, &_x, &_y, &_z, &_w); - - verts[2].x = _x; - verts[2].y = _y; - verts[2].z = _z; - w[2] = _w; - - _x = box->x2 - box->x1; - _y = box->y2 - box->y1; - _z = 0; - _w = CFX_ONE; - - mtx_transform (mtx, &_x, &_y, &_z, &_w); - - verts[3].x = _x; - verts[3].y = _y; - verts[3].z = _z; - w[3] = _w; + fixed_vertex_transform (mtx, 0, 0, 0, 1.0, &vertices[0]); + fixed_vertex_transform (mtx, width, 0, 0, 1.0, &vertices[1]); + fixed_vertex_transform (mtx, 0, height, 0, 1.0, &vertices[2]); + fixed_vertex_transform (mtx, width, height, 0, 1.0, &vertices[3]); cogl_pop_matrix(); cogl_get_projection_matrix (mtx_p); cogl_get_viewport (v); - mtx_transform (mtx_p, - &verts[0].x, - &verts[0].y, - &verts[0].z, - &w[0]); - - verts[0].x = MTX_GL_SCALE_X (verts[0].x, w[0], v[2], v[0]); - verts[0].y = MTX_GL_SCALE_Y (verts[0].y, w[0], v[3], v[1]); - verts[0].z = MTX_GL_SCALE_Z (verts[0].z, w[0], v[2], v[0]); - - mtx_transform (mtx_p, - &verts[1].x, - &verts[1].y, - &verts[1].z, - &w[1]); - - verts[1].x = MTX_GL_SCALE_X (verts[1].x, w[1], v[2], v[0]); - verts[1].y = MTX_GL_SCALE_Y (verts[1].y, w[1], v[3], v[1]); - verts[1].z = MTX_GL_SCALE_Z (verts[1].z, w[1], v[2], v[0]); - - mtx_transform (mtx_p, - &verts[2].x, - &verts[2].y, - &verts[2].z, - &w[2]); - - verts[2].x = MTX_GL_SCALE_X (verts[2].x, w[2], v[2], v[0]); - verts[2].y = MTX_GL_SCALE_Y (verts[2].y, w[2], v[3], v[1]); - verts[2].z = MTX_GL_SCALE_Z (verts[2].z, w[2], v[2], v[0]); - - mtx_transform (mtx_p, - &verts[3].x, - &verts[3].y, - &verts[3].z, - &w[3]); - - verts[3].x = MTX_GL_SCALE_X (verts[3].x, w[3], v[2], v[0]); - verts[3].y = MTX_GL_SCALE_Y (verts[3].y, w[3], v[3], v[1]); - verts[3].z = MTX_GL_SCALE_Z (verts[3].z, w[3], v[2], v[0]); + fixed_vertex_scale (mtx_p, &vertices[0], v, &verts[0]); + fixed_vertex_scale (mtx_p, &vertices[1], v, &verts[1]); + fixed_vertex_scale (mtx_p, &vertices[2], v, &verts[2]); + fixed_vertex_scale (mtx_p, &vertices[3], v, &verts[3]); } /** @@ -1160,10 +1277,10 @@ * actor in the plane of @ancestor. The returned vertices relate to * the #ClutterActorBox coordinates as follows: * - * v[0] contains (x1, y1) - * v[1] contains (x2, y1) - * v[2] contains (x1, y2) - * v[3] contains (x2, y2) + * @verts[0] contains (x1, y1) + * @verts[1] contains (x2, y1) + * @verts[2] contains (x1, y2) + * @verts[3] contains (x2, y2) * * * If @ancestor is %NULL the ancestor will be the #ClutterStage. In @@ -1176,12 +1293,13 @@ void clutter_actor_get_allocation_vertices (ClutterActor *self, ClutterActor *ancestor, - ClutterVertex verts[4]) + ClutterVertex verts[]) { - ClutterFixed v[4]; - ClutterFixed w[4]; - ClutterActorPrivate *priv; - ClutterActor *stage; + ClutterActorPrivate *priv; + ClutterActor *stage; + ClutterFixed v[4]; + fixed_vertex_t vertices[4]; + fixed_vertex_t tmp = { 0, }; g_return_if_fail (CLUTTER_IS_ACTOR (self)); g_return_if_fail (ancestor == NULL || CLUTTER_IS_ACTOR (ancestor)); @@ -1213,28 +1331,33 @@ if (priv->needs_allocation) _clutter_stage_maybe_relayout (stage); - clutter_actor_transform_vertices_relative (self, ancestor, verts, w); + clutter_actor_transform_vertices_relative (self, ancestor, vertices); + cogl_get_viewport (v); /* - * The w[3] parameter should always be 1.0 here, so we ignore it; otherwise - * we would have to devide the original verts with it. + * The w[3] parameter should always be 1.0 here, so we ignore it; + * otherwise we would have to divide the original verts with it. */ - verts[0].x = CFX_QMUL ((verts[0].x + CFX_ONE / 2), v[2]); - verts[0].y = CFX_QMUL ((CFX_ONE / 2 - verts[0].y), v[3]); - verts[0].z = CFX_QMUL ((verts[0].z + CFX_ONE / 2), v[2]); - - verts[1].x = CFX_QMUL ((verts[1].x + CFX_ONE / 2), v[2]); - verts[1].y = CFX_QMUL ((CFX_ONE / 2 - verts[1].y), v[3]); - verts[1].z = CFX_QMUL ((verts[1].z + CFX_ONE / 2), v[2]); - - verts[2].x = CFX_QMUL ((verts[2].x + CFX_ONE / 2), v[2]); - verts[2].y = CFX_QMUL ((CFX_ONE / 2 - verts[2].y), v[3]); - verts[2].z = CFX_QMUL ((verts[2].z + CFX_ONE / 2), v[2]); - - verts[3].x = CFX_QMUL ((verts[3].x + CFX_ONE / 2), v[2]); - verts[3].y = CFX_QMUL ((CFX_ONE / 2 - verts[3].y), v[3]); - verts[3].z = CFX_QMUL ((verts[3].z + CFX_ONE / 2), v[2]); + tmp.x = CLUTTER_FIXED_MUL ((vertices[0].x + 0.5), v[2]); + tmp.y = CLUTTER_FIXED_MUL ((0.5 - vertices[0].y), v[3]); + tmp.z = CLUTTER_FIXED_MUL ((vertices[0].z + 0.5), v[2]); + fixed_vertex_to_units (&tmp, &verts[0]); + + tmp.x = CLUTTER_FIXED_MUL ((vertices[1].x + 0.5), v[2]); + tmp.y = CLUTTER_FIXED_MUL ((0.5 - vertices[1].y), v[3]); + tmp.z = CLUTTER_FIXED_MUL ((vertices[1].z + 0.5), v[2]); + fixed_vertex_to_units (&tmp, &verts[1]); + + tmp.x = CLUTTER_FIXED_MUL ((vertices[2].x + 0.5), v[2]); + tmp.y = CLUTTER_FIXED_MUL ((0.5 - vertices[2].y), v[3]); + tmp.z = CLUTTER_FIXED_MUL ((vertices[2].z + 0.5), v[2]); + fixed_vertex_to_units (&tmp, &verts[2]); + + tmp.x = CLUTTER_FIXED_MUL ((vertices[3].x + 0.5), v[2]); + tmp.y = CLUTTER_FIXED_MUL ((0.5 - vertices[3].y), v[3]); + tmp.z = CLUTTER_FIXED_MUL ((vertices[3].z + 0.5), v[2]); + fixed_vertex_to_units (&tmp, &verts[3]); } /** @@ -1300,65 +1423,46 @@ gboolean is_stage = CLUTTER_IS_STAGE (self); if (!is_stage) - cogl_translatex (CLUTTER_UNITS_TO_FIXED (priv->allocation.x1), - CLUTTER_UNITS_TO_FIXED (priv->allocation.y1), + cogl_translate (CLUTTER_UNITS_TO_FLOAT (priv->allocation.x1), + CLUTTER_UNITS_TO_FLOAT (priv->allocation.y1), 0); + if (priv->z) + cogl_translate (0, 0, priv->z); + /* * because the rotation involves translations, we must scale before * applying the rotations (if we apply the scale after the rotations, * the translations included in the rotation are not scaled and so the * entire object will move on the screen as a result of rotating it). */ - if (priv->scale_x != CFX_ONE || priv->scale_y != CFX_ONE) - cogl_scale (priv->scale_x, priv->scale_y); - - if (priv->rzang) - { - cogl_translatex (CLUTTER_UNITS_TO_FIXED (priv->rzx), - CLUTTER_UNITS_TO_FIXED (priv->rzy), - 0); - - cogl_rotatex (priv->rzang, 0, 0, CFX_ONE); - - cogl_translatex (CLUTTER_UNITS_TO_FIXED (-priv->rzx), - CLUTTER_UNITS_TO_FIXED (-priv->rzy), - 0); - } + if (priv->scale_x != 1.0 || priv->scale_y != 1.0) + TRANSFORM_ABOUT_ANCHOR_COORD (self, &priv->scale_center, + cogl_scale (priv->scale_x, + priv->scale_y, + 1.0)); + + if (priv->rzang) + TRANSFORM_ABOUT_ANCHOR_COORD (self, &priv->rz_center, + cogl_rotate (priv->rzang, + 0, 0, 1.0)); if (priv->ryang) - { - cogl_translatex (CLUTTER_UNITS_TO_FIXED (priv->ryx), - 0, - CLUTTER_UNITS_TO_FIXED (priv->z + priv->ryz)); - - cogl_rotatex (priv->ryang, 0, CFX_ONE, 0); - - cogl_translatex (CLUTTER_UNITS_TO_FIXED (-priv->ryx), - 0, - CLUTTER_UNITS_TO_FIXED (-(priv->z + priv->ryz))); - } + TRANSFORM_ABOUT_ANCHOR_COORD (self, &priv->ry_center, + cogl_rotate (priv->ryang, + 0, 1.0, 0)); if (priv->rxang) - { - cogl_translatex (0, - CLUTTER_UNITS_TO_FIXED (priv->rxy), - CLUTTER_UNITS_TO_FIXED (priv->z + priv->rxz)); - - cogl_rotatex (priv->rxang, CFX_ONE, 0, 0); - - cogl_translatex (0, - CLUTTER_UNITS_TO_FIXED (-priv->rxy), - CLUTTER_UNITS_TO_FIXED (-(priv->z + priv->rxz))); + TRANSFORM_ABOUT_ANCHOR_COORD (self, &priv->rx_center, + cogl_rotate (priv->rxang, + 1.0, 0, 0)); + + if (!is_stage && !clutter_anchor_coord_is_zero (&priv->anchor)) + { + ClutterUnit x, y, z; + clutter_anchor_coord_get_units (self, &priv->anchor, &x, &y, &z); + cogl_translate (-x, -y, -z); } - - if (!is_stage && (priv->anchor_x || priv->anchor_y)) - cogl_translatex (CLUTTER_UNITS_TO_FIXED (-priv->anchor_x), - CLUTTER_UNITS_TO_FIXED (-priv->anchor_y), - 0); - - if (priv->z) - cogl_translatex (0, 0, priv->z); } /* Recursively applies the transforms associated with this actor and @@ -1408,6 +1512,8 @@ * * This function should not be called directly by applications. * Call clutter_actor_queue_redraw() to queue paints, instead. + * + * This function will emit the #ClutterActor::paint signal. */ void clutter_actor_paint (ClutterActor *self) @@ -1432,9 +1538,13 @@ } } + /* mark that we are in the paint process */ + CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_PAINT); + cogl_push_matrix(); - _clutter_actor_apply_modelview_transform (self); + if (priv->enable_model_view_transform) + _clutter_actor_apply_modelview_transform (self); if (priv->has_clip) { @@ -1456,7 +1566,7 @@ * color. See clutter_stage_get_actor_at_pos() for where * picking is enabled. */ - clutter_actor_pick (self, &col); + g_signal_emit (self, actor_signals[PICK], 0, &col); } else { @@ -1471,19 +1581,18 @@ cogl_clip_unset(); cogl_pop_matrix(); + + /* paint sequence complete */ + CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_PAINT); } -/* fixed point, unit based rotation setter, to be used by - * set_property() so that we don't lose precision in the - * center coordinates by converting them to and from units +/* internal helper function set the rotation angle without affecting + the center point */ -static inline void +static void clutter_actor_set_rotation_internal (ClutterActor *self, ClutterRotateAxis axis, - ClutterFixed angle, - ClutterUnit center_x, - ClutterUnit center_y, - ClutterUnit center_z) + gdouble angle) { ClutterActorPrivate *priv = self->priv; @@ -1494,26 +1603,17 @@ { case CLUTTER_X_AXIS: priv->rxang = angle; - priv->rxy = center_y; - priv->rxz = center_z; g_object_notify (G_OBJECT (self), "rotation-angle-x"); - g_object_notify (G_OBJECT (self), "rotation-center-x"); break; case CLUTTER_Y_AXIS: priv->ryang = angle; - priv->ryx = center_x; - priv->ryz = center_z; g_object_notify (G_OBJECT (self), "rotation-angle-y"); - g_object_notify (G_OBJECT (self), "rotation-center-y"); break; case CLUTTER_Z_AXIS: priv->rzang = angle; - priv->rzx = center_x; - priv->rzy = center_y; g_object_notify (G_OBJECT (self), "rotation-angle-z"); - g_object_notify (G_OBJECT (self), "rotation-center-z"); break; } @@ -1603,16 +1703,48 @@ clutter_actor_hide (actor); break; case PROP_SCALE_X: - clutter_actor_set_scalex - (actor, - CLUTTER_FLOAT_TO_FIXED (g_value_get_double (value)), - priv->scale_y); + clutter_actor_set_scale (actor, + g_value_get_double (value), + priv->scale_y); break; case PROP_SCALE_Y: - clutter_actor_set_scalex - (actor, - priv->scale_x, - CLUTTER_FLOAT_TO_FIXED (g_value_get_double (value))); + clutter_actor_set_scale (actor, + priv->scale_x, + g_value_get_double (value)); + break; + case PROP_SCALE_CENTER_X: + { + int center_x = g_value_get_int (value); + ClutterUnit center_y; + + clutter_anchor_coord_get_units (actor, &priv->scale_center, + NULL, ¢er_y, NULL); + clutter_actor_set_scale_fullu (actor, + priv->scale_x, + priv->scale_y, + CLUTTER_UNITS_FROM_DEVICE (center_x), + center_y); + } + break; + case PROP_SCALE_CENTER_Y: + { + ClutterUnit center_x; + gint center_y = g_value_get_int (value); + + clutter_anchor_coord_get_units (actor, &priv->scale_center, + ¢er_x, NULL, NULL); + clutter_actor_set_scale_fullu (actor, + priv->scale_x, + priv->scale_y, + center_x, + CLUTTER_UNITS_FROM_DEVICE (center_y)); + } + break; + case PROP_SCALE_GRAVITY: + clutter_actor_set_scale_with_gravity (actor, + priv->scale_x, + priv->scale_y, + g_value_get_enum (value)); break; case PROP_CLIP: { @@ -1627,99 +1759,91 @@ clutter_actor_set_reactive (actor, g_value_get_boolean (value)); break; case PROP_ROTATION_ANGLE_X: - { - ClutterFixed angle; - - angle = CLUTTER_FLOAT_TO_FIXED (g_value_get_double (value)); - clutter_actor_set_rotation_internal (actor, - CLUTTER_X_AXIS, - angle, - 0, - priv->rxy, - priv->rxz); - } + clutter_actor_set_rotation_internal (actor, + CLUTTER_X_AXIS, + g_value_get_double (value)); break; case PROP_ROTATION_ANGLE_Y: - { - ClutterFixed angle; - - angle = CLUTTER_FLOAT_TO_FIXED (g_value_get_double (value)); - clutter_actor_set_rotation_internal (actor, - CLUTTER_Y_AXIS, - angle, - priv->ryx, - 0, - priv->ryz); - } + clutter_actor_set_rotation_internal (actor, + CLUTTER_Y_AXIS, + g_value_get_double (value)); break; case PROP_ROTATION_ANGLE_Z: - { - ClutterFixed angle; - - angle = CLUTTER_FLOAT_TO_FIXED (g_value_get_double (value)); - clutter_actor_set_rotation_internal (actor, - CLUTTER_Z_AXIS, - angle, - priv->rzx, - priv->rzy, - 0); - } + clutter_actor_set_rotation_internal (actor, + CLUTTER_Z_AXIS, + g_value_get_double (value)); break; case PROP_ROTATION_CENTER_X: { - ClutterVertex *center; + const ClutterVertex *center; - center = g_value_get_boxed (value); - clutter_actor_set_rotation_internal (actor, - CLUTTER_X_AXIS, - priv->rxang, - 0, - center->y, - center->z); + if ((center = g_value_get_boxed (value))) + clutter_actor_set_rotation (actor, + CLUTTER_X_AXIS, + priv->rxang, + center->x, + center->y, + center->z); } break; case PROP_ROTATION_CENTER_Y: { - ClutterVertex *center; + const ClutterVertex *center; - center = g_value_get_boxed (value); - clutter_actor_set_rotation_internal (actor, - CLUTTER_Y_AXIS, - priv->ryang, - center->x, - 0, - center->z); + if ((center = g_value_get_boxed (value))) + clutter_actor_set_rotation (actor, + CLUTTER_Y_AXIS, + priv->ryang, + center->x, + center->y, + center->z); } break; case PROP_ROTATION_CENTER_Z: { - ClutterVertex *center; + const ClutterVertex *center; - center = g_value_get_boxed (value); - clutter_actor_set_rotation_internal (actor, - CLUTTER_Z_AXIS, - priv->rzang, - center->x, - center->y, - 0); + if ((center = g_value_get_boxed (value))) + clutter_actor_set_rotation (actor, + CLUTTER_Z_AXIS, + priv->rzang, + center->x, + center->y, + center->z); } break; + case PROP_ROTATION_CENTER_Z_GRAVITY: + clutter_actor_set_z_rotation_from_gravity + (actor, priv->rzang, g_value_get_enum (value)); + break; case PROP_ANCHOR_X: { int anchor_x = g_value_get_int (value); + ClutterUnit anchor_y; + + clutter_anchor_coord_get_units (actor, &priv->anchor, + NULL, &anchor_y, NULL); clutter_actor_set_anchor_pointu (actor, CLUTTER_UNITS_FROM_DEVICE (anchor_x), - priv->anchor_y); + anchor_y); } break; case PROP_ANCHOR_Y: { - int anchor_y = g_value_get_int (value); + ClutterUnit anchor_x; + int anchor_y = g_value_get_int (value); + + clutter_anchor_coord_get_units (actor, &priv->anchor, + &anchor_x, NULL, NULL); clutter_actor_set_anchor_pointu (actor, - priv->anchor_x, + anchor_x, CLUTTER_UNITS_FROM_DEVICE (anchor_y)); } break; + case PROP_ANCHOR_GRAVITY: + clutter_actor_set_anchor_point_from_gravity (actor, + g_value_get_enum (value)); + break; case PROP_SHOW_ON_SET_PARENT: priv->show_on_set_parent = g_value_get_boolean (value); break; @@ -1823,58 +1947,91 @@ } break; case PROP_SCALE_X: - g_value_set_double (value, CLUTTER_FIXED_TO_DOUBLE (priv->scale_x)); + g_value_set_double (value, priv->scale_x); break; case PROP_SCALE_Y: - g_value_set_double (value, CLUTTER_FIXED_TO_DOUBLE (priv->scale_y)); + g_value_set_double (value, priv->scale_y); + break; + case PROP_SCALE_CENTER_X: + { + gint center; + clutter_actor_get_scale_center (actor, ¢er, NULL); + g_value_set_int (value, center); + } + break; + case PROP_SCALE_CENTER_Y: + { + gint center; + clutter_actor_get_scale_center (actor, NULL, ¢er); + g_value_set_int (value, center); + } + break; + case PROP_SCALE_GRAVITY: + g_value_set_enum (value, clutter_actor_get_scale_gravity (actor)); break; case PROP_REACTIVE: g_value_set_boolean (value, clutter_actor_get_reactive (actor)); break; case PROP_ROTATION_ANGLE_X: - g_value_set_double (value, CLUTTER_FIXED_TO_DOUBLE (priv->rxang)); + g_value_set_double (value, priv->rxang); break; case PROP_ROTATION_ANGLE_Y: - g_value_set_double (value, CLUTTER_FIXED_TO_DOUBLE (priv->ryang)); + g_value_set_double (value, priv->ryang); break; case PROP_ROTATION_ANGLE_Z: - g_value_set_double (value, CLUTTER_FIXED_TO_DOUBLE (priv->rzang)); + g_value_set_double (value, priv->rzang); break; case PROP_ROTATION_CENTER_X: { - ClutterVertex center = { 0, }; + ClutterVertex center; - center.y = priv->rxy; - center.z = priv->rxz; + clutter_actor_get_rotationu (actor, CLUTTER_X_AXIS, + ¢er.x, ¢er.y, ¢er.z); g_value_set_boxed (value, ¢er); } break; case PROP_ROTATION_CENTER_Y: { - ClutterVertex center = { 0, }; + ClutterVertex center; - center.x = priv->ryx; - center.z = priv->ryz; + clutter_actor_get_rotationu (actor, CLUTTER_Y_AXIS, + ¢er.x, ¢er.y, ¢er.z); g_value_set_boxed (value, ¢er); } break; case PROP_ROTATION_CENTER_Z: { - ClutterVertex center = { 0, }; + ClutterVertex center; - center.x = priv->rzx; - center.y = priv->rzy; + clutter_actor_get_rotationu (actor, CLUTTER_Z_AXIS, + ¢er.x, ¢er.y, ¢er.z); g_value_set_boxed (value, ¢er); } break; + case PROP_ROTATION_CENTER_Z_GRAVITY: + g_value_set_enum (value, clutter_actor_get_z_rotation_gravity (actor)); + break; case PROP_ANCHOR_X: - g_value_set_int (value, CLUTTER_UNITS_TO_DEVICE (priv->anchor_x)); + { + ClutterUnit anchor_x; + clutter_anchor_coord_get_units (actor, &priv->anchor, + &anchor_x, NULL, NULL); + g_value_set_int (value, CLUTTER_UNITS_TO_DEVICE (anchor_x)); + } break; case PROP_ANCHOR_Y: - g_value_set_int (value, CLUTTER_UNITS_TO_DEVICE (priv->anchor_y)); + { + ClutterUnit anchor_y; + clutter_anchor_coord_get_units (actor, &priv->anchor, + NULL, &anchor_y, NULL); + g_value_set_int (value, CLUTTER_UNITS_TO_DEVICE (anchor_y)); + } + break; + case PROP_ANCHOR_GRAVITY: + g_value_set_enum (value, clutter_actor_get_anchor_point_gravity (actor)); break; case PROP_SHOW_ON_SET_PARENT: g_value_set_boolean (value, priv->show_on_set_parent); @@ -1911,6 +2068,12 @@ destroy_shader_data (self); + if (priv->pango_context) + { + g_object_unref (priv->pango_context); + priv->pango_context = NULL; + } + g_signal_emit (self, actor_signals[DESTROY], 0); G_OBJECT_CLASS (clutter_actor_parent_class)->dispose (object); @@ -1935,6 +2098,7 @@ clutter_actor_class_init (ClutterActorClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); + GParamSpec *pspec; object_class->set_property = clutter_actor_set_property; object_class->get_property = clutter_actor_get_property; @@ -2362,7 +2526,7 @@ NULL, CLUTTER_PARAM_READWRITE)); /** - * ClutterActor::scale-x: + * ClutterActor:scale-x: * * The horizontal scale of the actor * @@ -2379,7 +2543,7 @@ 1.0, CLUTTER_PARAM_READWRITE)); /** - * ClutterActor::scale-y: + * ClutterActor:scale-y: * * The vertical scale of the actor * @@ -2395,8 +2559,53 @@ G_MAXDOUBLE, 1.0, CLUTTER_PARAM_READWRITE)); + + /** + * ClutterActor:scale-center-x: + * + * The horizontal center point for scaling + * + * Since: 1.0 + */ + pspec = g_param_spec_int ("scale-center-x", + "Scale-Center-X", + "Horizontal scale center", + G_MININT, G_MAXINT, 0, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (object_class, PROP_SCALE_CENTER_X, pspec); + + /** + * ClutterActor:scale-center-y: + * + * The vertical center point for scaling + * + * Since: 1.0 + */ + pspec = g_param_spec_int ("scale-center-y", + "Scale-Center-Y", + "Vertical scale center", + G_MININT, G_MAXINT, 0, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (object_class, PROP_SCALE_CENTER_Y, pspec); + + /** + * ClutterActor:scale-gravity: + * + * The center point for scaling expressed as a #ClutterGravity + * + * Since: 1.0 + */ + pspec = g_param_spec_enum ("scale-gravity", + "Scale-Gravity", + "The center of scaling", + CLUTTER_TYPE_GRAVITY, + CLUTTER_GRAVITY_NONE, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (object_class, + PROP_SCALE_GRAVITY, pspec); + /** - * ClutterActor::rotation-angle-x: + * ClutterActor:rotation-angle-x: * * The rotation angle on the X axis. * @@ -2413,7 +2622,7 @@ 0.0, CLUTTER_PARAM_READWRITE)); /** - * ClutterActor::rotation-angle-y: + * ClutterActor:rotation-angle-y: * * The rotation angle on the Y axis. * @@ -2430,7 +2639,7 @@ 0.0, CLUTTER_PARAM_READWRITE)); /** - * ClutterActor::rotation-angle-z: + * ClutterActor:rotation-angle-z: * * The rotation angle on the Z axis. * @@ -2447,7 +2656,7 @@ 0.0, CLUTTER_PARAM_READWRITE)); /** - * ClutterActor::rotation-center-x: + * ClutterActor:rotation-center-x: * * The rotation center on the X axis. * @@ -2462,7 +2671,7 @@ CLUTTER_TYPE_VERTEX, CLUTTER_PARAM_READWRITE)); /** - * ClutterActor::rotation-center-y: + * ClutterActor:rotation-center-y: * * The rotation center on the Y axis. * @@ -2477,7 +2686,7 @@ CLUTTER_TYPE_VERTEX, CLUTTER_PARAM_READWRITE)); /** - * ClutterActor::rotation-center-z: + * ClutterActor:rotation-center-z: * * The rotation center on the Z axis. * @@ -2491,8 +2700,26 @@ "The rotation center on the Z axis", CLUTTER_TYPE_VERTEX, CLUTTER_PARAM_READWRITE)); + + /** + * ClutterActor:rotation-center-z-gravity: + * + * The rotation center on the Z axis expressed as a #ClutterGravity. + * + * Since: 1.0 + */ + pspec = g_param_spec_enum ("rotation-center-z-gravity", + "Rotation-Center-Z-Gravity", + "Center point for rotation around the Z axis", + CLUTTER_TYPE_GRAVITY, + CLUTTER_GRAVITY_NONE, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (object_class, + PROP_ROTATION_CENTER_Z_GRAVITY, + pspec); + /** - * ClutterActor::anchor-x: + * ClutterActor:anchor-x: * * The X coordinate of an actor's anchor point, relative to * the actor coordinate space, in pixels. @@ -2509,7 +2736,7 @@ 0, CLUTTER_PARAM_READWRITE)); /** - * ClutterActor::anchor-y: + * ClutterActor:anchor-y: * * The Y coordinate of an actor's anchor point, relative to * the actor coordinate space, in pixels. @@ -2527,6 +2754,22 @@ CLUTTER_PARAM_READWRITE)); /** + * ClutterActor:anchor-gravity: + * + * The anchor point expressed as a #ClutterGravity. + * + * Since: 1.0 + */ + pspec = g_param_spec_enum ("anchor-gravity", + "Anchor-Gravity", + "The anchor point as a ClutterGravity", + CLUTTER_TYPE_GRAVITY, + CLUTTER_GRAVITY_NONE, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (object_class, + PROP_ANCHOR_GRAVITY, pspec); + + /** * ClutterActor:show-on-set-parent: * * If %TRUE, the actor is automatically shown when parented. @@ -2939,6 +3182,34 @@ clutter_marshal_VOID__VOID, G_TYPE_NONE, 0); + /** + * ClutterActor::pick: + * @actor: the #ClutterActor that received the signal + * @color: the #ClutterColor to be used when picking + * + * The ::pick signal is emitted each time an actor is being painted + * in "pick mode". The pick mode is used to identify the actor during + * the event handling phase, or by clutter_stage_get_actor_at_pos(). + * The actor should paint its shape using the passed @pick_color. + * + * Subclasses of #ClutterActor should override the class signal handler + * and paint themselves in that function. + * + * It is possible to connect a handler to the ::pick signal in order + * to set up some custom aspect of a paint in pick mode. + * + * Since: 1.0 + */ + actor_signals[PICK] = + g_signal_new (I_("pick"), + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ClutterActorClass, pick), + NULL, NULL, + clutter_marshal_VOID__BOXED, + G_TYPE_NONE, 1, + CLUTTER_TYPE_COLOR); + klass->show = clutter_actor_real_show; klass->show_all = clutter_actor_show; klass->hide = clutter_actor_real_hide; @@ -2960,8 +3231,8 @@ priv->has_clip = FALSE; priv->opacity = 0xff; priv->id = clutter_id_pool_add (CLUTTER_CONTEXT()->id_pool, self); - priv->scale_x = CFX_ONE; - priv->scale_y = CFX_ONE; + priv->scale_x = 1.0; + priv->scale_y = 1.0; priv->shader_data = NULL; priv->show_on_set_parent = TRUE; @@ -2969,6 +3240,9 @@ priv->needs_height_request = TRUE; priv->needs_allocation = TRUE; + priv->opacity_parent = NULL; + priv->enable_model_view_transform = TRUE; + memset (priv->clip, 0, sizeof (ClutterUnit) * 4); } @@ -3019,6 +3293,9 @@ * * Applications rarely need to call this, as redraws are handled * automatically by modification functions. + * + * This function will not do anything if @self is not visible, or + * if the actor is inside an invisible part of the scenegraph. */ void clutter_actor_queue_redraw (ClutterActor *self) @@ -3027,7 +3304,16 @@ g_return_if_fail (CLUTTER_IS_ACTOR (self)); - /* FIXME: should we check we're visible here? */ + /* short-circuit the trivial case */ + if (!CLUTTER_ACTOR_IS_VISIBLE (self)) + return; + + /* check if any part of the scenegraph we're in + * is not visible + */ + if (!clutter_actor_get_paint_visibility (self)) + return; + if ((stage = clutter_actor_get_stage (self)) != NULL) clutter_stage_queue_redraw (CLUTTER_STAGE (stage)); } @@ -3190,8 +3476,9 @@ if (natural_width < min_width) { - g_warning ("Actor of type %s reported a natural width of %d (%d px) " - "lower than min width %d (%d px)", + g_warning ("Actor of type %s reported a natural width " + "of %" CLUTTER_UNITS_FORMAT " (%d px) lower " + "than min width %" CLUTTER_UNITS_FORMAT " (%d px)", G_OBJECT_TYPE_NAME (self), natural_width, CLUTTER_UNITS_TO_DEVICE (natural_width), min_width, CLUTTER_UNITS_TO_DEVICE (min_width)); @@ -3260,8 +3547,9 @@ if (natural_height < min_height) { - g_warning ("Actor of type %s reported a natural height of %d " - "(%d px) lower than min height %d (%d px)", + g_warning ("Actor of type %s reported a natural height " + "of %" CLUTTER_UNITS_FORMAT " (%d px) lower than " + "min height %" CLUTTER_UNITS_FORMAT " (%d px)", G_OBJECT_TYPE_NAME (self), natural_height, CLUTTER_UNITS_TO_DEVICE (natural_height), min_height, CLUTTER_UNITS_TO_DEVICE (min_height)); @@ -4802,20 +5090,21 @@ } /** - * clutter_actor_set_scalex: + * clutter_actor_set_scale: * @self: A #ClutterActor - * @scale_x: #ClutterFixed factor to scale actor by horizontally. - * @scale_y: #ClutterFixed factor to scale actor by vertically. + * @scale_x: double factor to scale actor by horizontally. + * @scale_y: double factor to scale actor by vertically. * - * Fixed point version of clutter_actor_set_scale(). + * Scales an actor with the given factors. The scaling is relative to + * the scale center and the anchor point. The scale center is + * unchanged by this function and defaults to 0,0. * - * Scales an actor with the given factors. The scaling is always - * relative to the anchor point. + * Since: 0.2 */ void -clutter_actor_set_scalex (ClutterActor *self, - ClutterFixed scale_x, - ClutterFixed scale_y) +clutter_actor_set_scale (ClutterActor *self, + gdouble scale_x, + gdouble scale_y) { g_return_if_fail (CLUTTER_IS_ACTOR (self)); @@ -4829,71 +5118,145 @@ g_object_notify (G_OBJECT (self), "scale-y"); g_object_thaw_notify (G_OBJECT (self)); - g_object_unref (self); if (CLUTTER_ACTOR_IS_VISIBLE (self)) clutter_actor_queue_redraw (self); + + g_object_unref (self); } /** - * clutter_actor_set_scale: + * clutter_actor_set_scale_full: * @self: A #ClutterActor * @scale_x: double factor to scale actor by horizontally. * @scale_y: double factor to scale actor by vertically. + * @center_x: X coordinate of the center of the scale. + * @center_y: Y coordinate of the center of the scale * - * Scales an actor with the given factors. The scaling is always - * relative to the anchor point. + * Scales an actor with the given factors around the given center + * point. The center point is specified in pixels relative to the + * anchor point (usually the top left corner of the actor). * - * Since: 0.2 + * Since: 1.0 */ void -clutter_actor_set_scale (ClutterActor *self, - double scale_x, - double scale_y) +clutter_actor_set_scale_full (ClutterActor *self, + gdouble scale_x, + gdouble scale_y, + int center_x, + int center_y) { g_return_if_fail (CLUTTER_IS_ACTOR (self)); - clutter_actor_set_scalex (self, - CLUTTER_FLOAT_TO_FIXED (scale_x), - CLUTTER_FLOAT_TO_FIXED (scale_y)); + clutter_actor_set_scale_fullu (self, scale_x, scale_y, + CLUTTER_UNITS_FROM_DEVICE (center_x), + CLUTTER_UNITS_FROM_DEVICE (center_y)); } /** - * clutter_actor_get_scalex: + * clutter_actor_set_scale_fullu: * @self: A #ClutterActor - * @scale_x: Location to store horizonal scale factor, or %NULL. - * @scale_y: Location to store vertical scale factor, or %NULL. + * @scale_x: double factor to scale actor by horizontally. + * @scale_y: double factor to scale actor by vertically. + * @center_x: X coordinate of the center of the scale. + * @center_y: Y coordinate of the center of the scale * - * Fixed point version of clutter_actor_get_scale(). + * %ClutterUnit version of clutter_actor_set_scale_full(). * - * Retrieves the scale factors of an actor. + * Scales an actor with the given factors around the given center + * point. The center point is specified in + * %ClutterUnits relative to the anchor point (usually + * the top left corner of the actor). * - * Since: 0.2 + * Since: 1.0 */ void -clutter_actor_get_scalex (ClutterActor *self, - ClutterFixed *scale_x, - ClutterFixed *scale_y) +clutter_actor_set_scale_fullu (ClutterActor *self, + gdouble scale_x, + gdouble scale_y, + ClutterUnit center_x, + ClutterUnit center_y) { + ClutterActorPrivate *priv; + g_return_if_fail (CLUTTER_IS_ACTOR (self)); - if (scale_x) - *scale_x = self->priv->scale_x; + priv = self->priv; - if (scale_y) - *scale_y = self->priv->scale_y; + g_object_ref (self); + g_object_freeze_notify (G_OBJECT (self)); + + clutter_actor_set_scale (self, scale_x, scale_y); + + if (priv->scale_center.is_fractional) + g_object_notify (G_OBJECT (self), "scale-gravity"); + g_object_notify (G_OBJECT (self), "scale-center-x"); + g_object_notify (G_OBJECT (self), "scale-center-y"); + + clutter_anchor_coord_set_units (&priv->scale_center, center_x, center_y, 0); + + g_object_thaw_notify (G_OBJECT (self)); + g_object_unref (self); } /** - * clutter_actor_get_scale: + * clutter_actor_set_scale_with_gravity: * @self: A #ClutterActor - * @scale_x: Location to store horizonal float scale factor, or %NULL. - * @scale_y: Location to store vertical float scale factor, or %NULL. - * - * Retrieves an actors scale in floating point. + * @scale_x: double factor to scale actor by horizontally. + * @scale_y: double factor to scale actor by vertically. + * @gravity: the location of the scale center expressed as a compass + * direction. * - * Since: 0.2 - */ + * Scales an actor with the given factors around the given + * center point. The center point is specified as one of the compass + * directions in #ClutterGravity. For example, setting it to north + * will cause the top of the actor to remain unchanged and the rest of + * the actor to expand left, right and downwards. + * + * Since: 1.0 + */ +void +clutter_actor_set_scale_with_gravity (ClutterActor *self, + gdouble scale_x, + gdouble scale_y, + ClutterGravity gravity) +{ + ClutterActorPrivate *priv; + + g_return_if_fail (CLUTTER_IS_ACTOR (self)); + + priv = self->priv; + + if (gravity == CLUTTER_GRAVITY_NONE) + clutter_actor_set_scale_full (self, scale_x, scale_y, 0, 0); + else + { + g_object_ref (self); + g_object_freeze_notify (G_OBJECT (self)); + + clutter_actor_set_scale (self, scale_x, scale_y); + + g_object_notify (G_OBJECT (self), "scale-gravity"); + g_object_notify (G_OBJECT (self), "scale-center-x"); + g_object_notify (G_OBJECT (self), "scale-center-y"); + + clutter_anchor_coord_set_gravity (&priv->scale_center, gravity); + + g_object_thaw_notify (G_OBJECT (self)); + g_object_unref (self); + } +} + +/** + * clutter_actor_get_scale: + * @self: A #ClutterActor + * @scale_x: Location to store horizonal float scale factor, or %NULL. + * @scale_y: Location to store vertical float scale factor, or %NULL. + * + * Retrieves an actors scale in floating point. + * + * Since: 0.2 + */ void clutter_actor_get_scale (ClutterActor *self, gdouble *scale_x, @@ -4909,6 +5272,82 @@ } /** + * clutter_actor_get_scale_center: + * @self: A #ClutterActor + * @center_x: Location to store the X position of the scale center, or %NULL. + * @center_y: Location to store the Y position of the scale center, or %NULL. + * + * Retrieves the scale center coordinate in pixels relative to the top + * left corner of the actor. If the scale center was specified using a + * #ClutterGravity this will calculate the pixel offset using the + * current size of the actor. + * + * Since: 1.0 + */ +void +clutter_actor_get_scale_center (ClutterActor *self, + gint *center_x, + gint *center_y) +{ + ClutterUnit xu, yu; + + g_return_if_fail (CLUTTER_IS_ACTOR (self)); + + clutter_actor_get_scale_centeru (self, &xu, &yu); + + if (center_x) + *center_x = CLUTTER_UNITS_TO_DEVICE (xu); + if (center_y) + *center_y = CLUTTER_UNITS_TO_DEVICE (yu); +} + +/** + * clutter_actor_get_scale_centeru: + * @self: A #ClutterActor + * @center_x: Location to store the X position of the scale center, or %NULL. + * @center_y: Location to store the Y position of the scale center, or %NULL. + * + * ClutterUnits version of clutter_actor_get_scale_center(). + * + * Retrieves the scale center coordinate in units relative to the top + * left corner of the actor. If the scale center was specified using a + * #ClutterGravity this will calculate the unit offset using the + * current size of the actor. + * + * Since: 1.0 + */ +void +clutter_actor_get_scale_centeru (ClutterActor *self, + ClutterUnit *center_x, + ClutterUnit *center_y) +{ + g_return_if_fail (CLUTTER_IS_ACTOR (self)); + + clutter_anchor_coord_get_units (self, &self->priv->scale_center, + center_x, center_y, NULL); +} + +/** + * clutter_actor_get_scale_gravity: + * @self: A #ClutterActor + * + * Retrieves the scale center as a compass direction. If the scale + * center was specified in pixels or units this will return + * %CLUTTER_GRAVITY_NONE. + * + * Return value: the scale gravity + * + * Since: 1.0 + */ +ClutterGravity +clutter_actor_get_scale_gravity (ClutterActor *self) +{ + g_return_val_if_fail (CLUTTER_IS_ACTOR (self), CLUTTER_GRAVITY_NONE); + + return clutter_anchor_coord_get_gravity (&self->priv->scale_center); +} + +/** * clutter_actor_set_opacity: * @self: A #ClutterActor * @opacity: New opacity value for the actor. @@ -4954,7 +5393,10 @@ priv = self->priv; - parent = priv->parent_actor; + if (priv->opacity_parent) + parent = priv->opacity_parent; + else + parent = priv->parent_actor; /* Factor in the actual actors opacity with parents */ if (G_LIKELY (parent)) @@ -5159,42 +5601,35 @@ ClutterUnit y, ClutterUnit z) { + ClutterActorPrivate *priv; + g_return_if_fail (CLUTTER_IS_ACTOR (self)); - clutter_actor_set_rotation_internal (self, axis, - CLUTTER_FLOAT_TO_FIXED (angle), - x, y, z); -} + priv = self->priv; -/** - * clutter_actor_set_rotationx: - * @self: a #ClutterActor - * @axis: the axis of rotation - * @angle: the angle of rotation - * @x: X coordinate of the rotation center - * @y: Y coordinate of the rotation center - * @z: Z coordinate of the rotation center - * - * Sets the rotation angle of @self around the given axis. - * - * This function is the fixed point variant of clutter_actor_set_rotation(). - * - * Since: 0.6 - */ -void -clutter_actor_set_rotationx (ClutterActor *self, - ClutterRotateAxis axis, - ClutterFixed angle, - gint x, - gint y, - gint z) -{ - g_return_if_fail (CLUTTER_IS_ACTOR (self)); + g_object_freeze_notify (G_OBJECT (self)); + + clutter_actor_set_rotation_internal (self, axis, angle); - clutter_actor_set_rotation_internal (self, axis, angle, - CLUTTER_UNITS_FROM_DEVICE (x), - CLUTTER_UNITS_FROM_DEVICE (y), - CLUTTER_UNITS_FROM_DEVICE (z)); + switch (axis) + { + case CLUTTER_X_AXIS: + clutter_anchor_coord_set_units (&priv->rx_center, x, y, z); + g_object_notify (G_OBJECT (self), "rotation-center-x"); + break; + case CLUTTER_Y_AXIS: + clutter_anchor_coord_set_units (&priv->ry_center, x, y, z); + g_object_notify (G_OBJECT (self), "rotation-center-y"); + break; + case CLUTTER_Z_AXIS: + if (priv->rz_center.is_fractional) + g_object_notify (G_OBJECT (self), "rotation-center-z-gravity"); + clutter_anchor_coord_set_units (&priv->rz_center, x, y, z); + g_object_notify (G_OBJECT (self), "rotation-center-z"); + break; + } + + g_object_thaw_notify (G_OBJECT (self)); } /** @@ -5231,9 +5666,51 @@ { g_return_if_fail (CLUTTER_IS_ACTOR (self)); - clutter_actor_set_rotationx (self, axis, - CLUTTER_FLOAT_TO_FIXED (angle), - x, y, z); + clutter_actor_set_rotationu (self, axis, angle, + CLUTTER_UNITS_FROM_DEVICE (x), + CLUTTER_UNITS_FROM_DEVICE (y), + CLUTTER_UNITS_FROM_DEVICE (z)); +} + +/** + * clutter_actor_set_z_rotation_from_gravity: + * @self: a #ClutterActor + * @angle: the angle of rotation + * @gravity: the center point of the rotation + * + * Sets the rotation angle of @self around the Z axis using the center + * point specified as a compass point. For example to rotate such that + * the center of the actor remains static you can use + * %CLUTTER_GRAVITY_CENTER. If the actor changes size the center point + * will move accordingly. + * + * Since: 1.0 + */ +void +clutter_actor_set_z_rotation_from_gravity (ClutterActor *self, + gdouble angle, + ClutterGravity gravity) +{ + ClutterActorPrivate *priv; + + g_return_if_fail (CLUTTER_IS_ACTOR (self)); + + if (gravity == CLUTTER_GRAVITY_NONE) + clutter_actor_set_rotation (self, CLUTTER_Z_AXIS, angle, 0, 0, 0); + else + { + priv = self->priv; + + g_object_freeze_notify (G_OBJECT (self)); + + clutter_actor_set_rotation_internal (self, CLUTTER_Z_AXIS, angle); + + clutter_anchor_coord_set_gravity (&priv->rz_center, gravity); + g_object_notify (G_OBJECT (self), "rotation-center-z-gravity"); + g_object_notify (G_OBJECT (self), "rotation-center-z"); + + g_object_thaw_notify (G_OBJECT (self)); + } } /** @@ -5265,6 +5742,7 @@ { ClutterActorPrivate *priv; gdouble retval = 0; + AnchorCoord *anchor_coord = NULL; g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0); @@ -5273,91 +5751,23 @@ switch (axis) { case CLUTTER_X_AXIS: - retval = CLUTTER_FIXED_TO_DOUBLE (priv->rxang); - if (y) - *y = priv->rxy; - if (z) - *z = priv->rxz; - break; - - case CLUTTER_Y_AXIS: - retval = CLUTTER_FIXED_TO_DOUBLE (priv->ryang); - if (x) - *x = priv->ryx; - if (z) - *z = priv->ryz; - break; - - case CLUTTER_Z_AXIS: - retval = CLUTTER_FIXED_TO_DOUBLE (priv->rzang); - if (x) - *x = priv->rzx; - if (y) - *y = priv->rzy; - break; - } - - return retval; -} - -/** - * clutter_actor_get_rotationx: - * @self: a #ClutterActor - * @axis: the axis of rotation - * @x: return value for the X coordinate of the center of rotation - * @y: return value for the Y coordinate of the center of rotation - * @z: return value for the Z coordinate of the center of rotation - * - * Retrieves the angle and center of rotation on the given axis, - * set using clutter_actor_set_rotation(). - * - * This function is the fixed point variant of clutter_actor_get_rotation(). - * - * Return value: the angle of rotation as a fixed point value. - * - * Since: 0.6 - */ -ClutterFixed -clutter_actor_get_rotationx (ClutterActor *self, - ClutterRotateAxis axis, - gint *x, - gint *y, - gint *z) -{ - ClutterActorPrivate *priv; - ClutterFixed retval = 0; - - g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0); - - priv = self->priv; - - switch (axis) - { - case CLUTTER_X_AXIS: + anchor_coord = &priv->rx_center; retval = priv->rxang; - if (y) - *y = CLUTTER_UNITS_TO_DEVICE (priv->rxy); - if (z) - *z = CLUTTER_UNITS_TO_DEVICE (priv->rxz); break; case CLUTTER_Y_AXIS: + anchor_coord = &priv->ry_center; retval = priv->ryang; - if (x) - *x = CLUTTER_UNITS_TO_DEVICE (priv->ryx); - if (z) - *z = CLUTTER_UNITS_TO_DEVICE (priv->ryz); break; case CLUTTER_Z_AXIS: + anchor_coord = &priv->rz_center; retval = priv->rzang; - if (x) - *x = CLUTTER_UNITS_TO_DEVICE (priv->rzx); - if (y) - *y = CLUTTER_UNITS_TO_DEVICE (priv->rzy); break; } + clutter_anchor_coord_get_units (self, anchor_coord, x, y, z); + return retval; } @@ -5386,11 +5796,38 @@ gint *y, gint *z) { + ClutterUnit xu, yu, zu; + gdouble angle; + g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0.0); - return CLUTTER_FIXED_TO_FLOAT (clutter_actor_get_rotationx (self, - axis, - x, y, z)); + angle = clutter_actor_get_rotationu (self, axis, &xu, &yu, &zu); + + *x = CLUTTER_UNITS_TO_DEVICE (xu); + *y = CLUTTER_UNITS_TO_DEVICE (yu); + *z = CLUTTER_UNITS_TO_DEVICE (zu); + + return angle; +} + +/** + * clutter_actor_get_z_rotation_gravity: + * @self: A #ClutterActor + * + * Retrieves the center for the rotation around the Z axis as a + * compass direction. If the center was specified in pixels or units + * this will return %CLUTTER_GRAVITY_NONE. + * + * Return value: the Z rotation center + * + * Since: 1.0 + */ +ClutterGravity +clutter_actor_get_z_rotation_gravity (ClutterActor *self) +{ + g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0.0); + + return clutter_anchor_coord_get_gravity (&self->priv->rz_center); } /** @@ -5422,6 +5859,13 @@ priv = self->priv; + if (priv->has_clip && + priv->clip[0] == xoff && + priv->clip[1] == yoff && + priv->clip[2] == width && + priv->clip[3] == height) + return; + priv->clip[0] = xoff; priv->clip[1] = yoff; priv->clip[2] = width; @@ -5474,6 +5918,9 @@ { g_return_if_fail (CLUTTER_IS_ACTOR (self)); + if (!self->priv->has_clip) + return; + self->priv->has_clip = FALSE; clutter_actor_queue_redraw (self); @@ -6124,31 +6571,18 @@ gint anchor_x, gint anchor_y) { - ClutterActorPrivate *priv; - ClutterUnit ax = CLUTTER_UNITS_FROM_DEVICE (anchor_x); - ClutterUnit ay = CLUTTER_UNITS_FROM_DEVICE (anchor_y); - ClutterUnit dx; - ClutterUnit dy; - g_return_if_fail (CLUTTER_IS_ACTOR (self)); - priv = self->priv; - - dx = ax - priv->anchor_x; - dy = ay - priv->anchor_y; - - priv->anchor_x = ax; - priv->anchor_y = ay; - - if (priv->position_set) - clutter_actor_move_byu (self, dx, dy); + clutter_actor_move_anchor_pointu (self, + CLUTTER_UNITS_FROM_DEVICE (anchor_x), + CLUTTER_UNITS_FROM_DEVICE (anchor_y)); } /** * clutter_actor_get_anchor_point: * @self: a #ClutterActor * @anchor_x: return location for the X coordinate of the anchor point - * @anchor_y: return location for the y coordinate of the anchor point + * @anchor_y: return location for the Y coordinate of the anchor point * * Gets the current anchor point of the @actor in pixels. * @@ -6160,16 +6594,19 @@ gint *anchor_y) { ClutterActorPrivate *priv; + ClutterUnit xu, yu; g_return_if_fail (CLUTTER_IS_ACTOR (self)); priv = self->priv; + clutter_anchor_coord_get_units (self, &priv->anchor, &xu, &yu, NULL); + if (anchor_x) - *anchor_x = CLUTTER_UNITS_TO_DEVICE (priv->anchor_x); + *anchor_x = CLUTTER_UNITS_TO_DEVICE (xu); if (anchor_y) - *anchor_y = CLUTTER_UNITS_TO_DEVICE (priv->anchor_y); + *anchor_y = CLUTTER_UNITS_TO_DEVICE (yu); } /** @@ -6192,6 +6629,7 @@ { ClutterActorPrivate *priv; gboolean changed = FALSE; + ClutterUnit old_anchor_x, old_anchor_y; g_return_if_fail (CLUTTER_IS_ACTOR (self)); @@ -6199,20 +6637,26 @@ g_object_freeze_notify (G_OBJECT (self)); - if (priv->anchor_x != anchor_x) + clutter_anchor_coord_get_units (self, &priv->anchor, + &old_anchor_x, &old_anchor_y, NULL); + + if (priv->anchor.is_fractional) + g_object_notify (G_OBJECT (self), "anchor-gravity"); + + if (old_anchor_x != anchor_x) { - priv->anchor_x = anchor_x; g_object_notify (G_OBJECT (self), "anchor-x"); changed = TRUE; } - if (priv->anchor_y != anchor_y) + if (old_anchor_y != anchor_y) { - priv->anchor_y = anchor_y; g_object_notify (G_OBJECT (self), "anchor-y"); changed = TRUE; } + clutter_anchor_coord_set_units (&priv->anchor, anchor_x, anchor_y, 0); + g_object_thaw_notify (G_OBJECT (self)); if (changed && CLUTTER_ACTOR_IS_VISIBLE (self)) @@ -6220,6 +6664,28 @@ } /** + * clutter_actor_get_anchor_point_gravity: + * @self: a #ClutterActor + * + * Retrieves the anchor position expressed as a #ClutterGravity. If + * the anchor point was specified using pixels or units this will + * return %CLUTTER_GRAVITY_NONE. + * + * Since: 1.0 + */ +ClutterGravity +clutter_actor_get_anchor_point_gravity (ClutterActor *self) +{ + ClutterActorPrivate *priv; + + g_return_val_if_fail (CLUTTER_IS_ACTOR (self), CLUTTER_GRAVITY_NONE); + + priv = self->priv; + + return clutter_anchor_coord_get_gravity (&priv->anchor); +} + +/** * clutter_actor_move_anchor_pointu: * @self: a #ClutterActor * @anchor_x: X coordinate of the anchor point @@ -6236,28 +6702,32 @@ ClutterUnit anchor_y) { ClutterActorPrivate *priv; - ClutterUnit dx; - ClutterUnit dy; + ClutterUnit old_anchor_x, old_anchor_y; g_return_if_fail (CLUTTER_IS_ACTOR (self)); priv = self->priv; - dx = anchor_x - priv->anchor_x; - dy = anchor_y - priv->anchor_y; + clutter_anchor_coord_get_units (self, &priv->anchor, + &old_anchor_x, &old_anchor_y, NULL); - priv->anchor_x = anchor_x; - priv->anchor_y = anchor_y; + g_object_freeze_notify (G_OBJECT (self)); + + clutter_actor_set_anchor_point (self, anchor_x, anchor_y); if (priv->position_set) - clutter_actor_move_byu (self, dx, dy); + clutter_actor_move_byu (self, + anchor_x - old_anchor_x, + anchor_y - old_anchor_y); + + g_object_thaw_notify (G_OBJECT (self)); } /** * clutter_actor_get_anchor_pointu: * @self: a #ClutterActor - * @anchor_x: return location for the X coordinace of the anchor point - * @anchor_y: return location for the X coordinace of the anchor point + * @anchor_x: return location for the X coordinate of the anchor point + * @anchor_y: return location for the Y coordinate of the anchor point * * Gets the current anchor point of the @actor in #ClutterUnits. * @@ -6274,11 +6744,8 @@ priv = self->priv; - if (anchor_x) - *anchor_x = priv->anchor_x; - - if (anchor_y) - *anchor_y = priv->anchor_y; + clutter_anchor_coord_get_units (self, &priv->anchor, + anchor_x, anchor_y, NULL); } /** @@ -6290,11 +6757,11 @@ * actor postion so that its relative position within its parent remains * unchanged. * - * Note that the anchor is still stored as a point and the gravity - * value is forgotten. For example, if you set the anchor point to - * %CLUTTER_GRAVITY_SOUTH_EAST and later double the size of the actor, - * the anchor point will not move to the bottom right and will now be - * in the center of the actor. + * Since version 1.0 the anchor point will be stored as a gravity so + * that if the actor changes size then the anchor point will move. For + * example, if you set the anchor point to %CLUTTER_GRAVITY_SOUTH_EAST + * and later double the size of the actor, the anchor point will move + * to the bottom right. * * Since: 0.6 */ @@ -6302,25 +6769,27 @@ clutter_actor_move_anchor_point_from_gravity (ClutterActor *self, ClutterGravity gravity) { - ClutterUnit ax, ay, dx, dy; + ClutterUnit old_anchor_x, old_anchor_y, new_anchor_x, new_anchor_y; ClutterActorPrivate *priv; g_return_if_fail (CLUTTER_IS_ACTOR (self)); priv = self->priv; - ax = priv->anchor_x; - ay = priv->anchor_y; + g_object_freeze_notify (G_OBJECT (self)); + clutter_anchor_coord_get_units (self, &priv->anchor, + &old_anchor_x, &old_anchor_y, NULL); clutter_actor_set_anchor_point_from_gravity (self, gravity); - - dx = priv->anchor_x - ax; - dy = priv->anchor_y - ay; + clutter_anchor_coord_get_units (self, &priv->anchor, + &new_anchor_x, &new_anchor_y, NULL); if (priv->position_set) - { - clutter_actor_move_byu (self, dx, dy); - } + clutter_actor_move_byu (self, + new_anchor_x - old_anchor_x, + new_anchor_y - old_anchor_y); + + g_object_thaw_notify (G_OBJECT (self)); } /** @@ -6331,11 +6800,11 @@ * Sets an anchor point on the actor, based on the given gravity (this is a * convenience function wrapping clutter_actor_set_anchor_point()). * - * Note that the anchor is still stored as a point and the gravity - * value is forgotten. For example, if you set the anchor point to - * %CLUTTER_GRAVITY_SOUTH_EAST and later double the size of the actor, - * the anchor point will not move to the bottom right and will now be - * in the center of the actor. + * Since version 1.0 the anchor point will be stored as a gravity so + * that if the actor changes size then the anchor point will move. For + * example, if you set the anchor point to %CLUTTER_GRAVITY_SOUTH_EAST + * and later double the size of the actor, the anchor point will move + * to the bottom right. * * Since: 0.6 */ @@ -6343,53 +6812,18 @@ clutter_actor_set_anchor_point_from_gravity (ClutterActor *self, ClutterGravity gravity) { - ClutterActorPrivate *priv; - ClutterUnit w, h, x, y; - g_return_if_fail (CLUTTER_IS_ACTOR (self)); - priv = self->priv; - - x = 0; - y = 0; - clutter_actor_get_sizeu (self, &w, &h); - - switch (gravity) + if (gravity == CLUTTER_GRAVITY_NONE) + clutter_actor_set_anchor_point (self, 0, 0); + else { - case CLUTTER_GRAVITY_NORTH: - x = w / 2; - break; - case CLUTTER_GRAVITY_SOUTH: - x = w / 2; - y = h; - break; - case CLUTTER_GRAVITY_EAST: - x = w; - y = h / 2; - break; - case CLUTTER_GRAVITY_NORTH_EAST: - x = w; - break; - case CLUTTER_GRAVITY_SOUTH_EAST: - x = w; - y = h; - break; - case CLUTTER_GRAVITY_SOUTH_WEST: - y = h; - break; - case CLUTTER_GRAVITY_WEST: - y = h / 2; - break; - case CLUTTER_GRAVITY_CENTER: - x = w / 2; - y = h / 2; - break; - case CLUTTER_GRAVITY_NONE: - case CLUTTER_GRAVITY_NORTH_WEST: - break; - } + clutter_anchor_coord_set_gravity (&self->priv->anchor, gravity); - clutter_actor_set_anchor_pointu (self, x, y); + g_object_notify (G_OBJECT (self), "anchor-gravity"); + g_object_notify (G_OBJECT (self), "anchor-x"); + g_object_notify (G_OBJECT (self), "anchor-y"); + } } typedef enum @@ -6459,6 +6893,8 @@ if (end[0] == '%' && end[1] == '\0') { + ClutterActor *stage; + if (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL) { g_warning ("Unable to set percentage of %s on a top-level " @@ -6471,12 +6907,20 @@ goto out; } + stage = clutter_actor_get_stage (self); + if (stage == NULL) + stage = clutter_stage_get_default (); + if (dimension == PARSE_X || dimension == PARSE_WIDTH || dimension == PARSE_ANCHOR_X) - retval = CLUTTER_UNITS_FROM_STAGE_WIDTH_PERCENTAGE (val); + { + retval = clutter_actor_get_widthu (stage) * val; + } else - retval = CLUTTER_UNITS_FROM_STAGE_HEIGHT_PERCENTAGE (val); + { + retval = clutter_actor_get_heightu (stage) * val; + } goto out; } @@ -6491,7 +6935,12 @@ } else if (G_VALUE_HOLDS (&value, G_TYPE_DOUBLE)) { - gint val; + ClutterActor *stage; + gdouble val; + + stage = clutter_actor_get_stage (self); + if (stage == NULL) + stage = clutter_stage_get_default (); if (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL) { @@ -6504,14 +6953,18 @@ goto out; } - val = CLAMP (g_value_get_double (&value) * 100, 0, 100); + val = g_value_get_double (&value); if (dimension == PARSE_X || dimension == PARSE_WIDTH || dimension == PARSE_ANCHOR_X) - retval = CLUTTER_UNITS_FROM_STAGE_WIDTH_PERCENTAGE (val); + { + retval = clutter_actor_get_widthu (stage) * val; + } else - retval = CLUTTER_UNITS_FROM_STAGE_HEIGHT_PERCENTAGE (val); + { + retval = clutter_actor_get_heightu (stage) * val; + } } else { @@ -6530,7 +6983,7 @@ typedef struct { ClutterRotateAxis axis; - ClutterFixed angle; + gdouble angle; ClutterUnit center_x; ClutterUnit center_y; @@ -6550,7 +7003,7 @@ /* angle */ element = json_array_get_element (array, 0); if (JSON_NODE_TYPE (element) == JSON_NODE_VALUE) - info->angle = CLUTTER_FLOAT_TO_FIXED (json_node_get_double (element)); + info->angle = json_node_get_double (element); else return FALSE; @@ -6763,11 +7216,11 @@ info = g_value_get_pointer (value); - clutter_actor_set_rotation_internal (CLUTTER_ACTOR (scriptable), - info->axis, info->angle, - info->center_x, - info->center_y, - info->center_z); + clutter_actor_set_rotationu (CLUTTER_ACTOR (scriptable), + info->axis, info->angle, + info->center_x, + info->center_y, + info->center_z); g_slice_free (RotationInfo, info); } @@ -6812,17 +7265,18 @@ * Since: 0.6 */ gboolean -clutter_actor_transform_stage_point (ClutterActor *self, - ClutterUnit x, - ClutterUnit y, - ClutterUnit *x_out, - ClutterUnit *y_out) +clutter_actor_transform_stage_point (ClutterActor *self, + ClutterUnit x, + ClutterUnit y, + ClutterUnit *x_out, + ClutterUnit *y_out) { ClutterVertex v[4]; ClutterFixed ST[3][3]; ClutterFixed RQ[3][3]; int du, dv, xi, yi; - ClutterFixed xf, yf, wf, px, py, det; + ClutterUnit px, py; + ClutterFixed xf, yf, wf, det; ClutterActorPrivate *priv; g_return_val_if_fail (CLUTTER_IS_ACTOR (self), FALSE); @@ -6835,11 +7289,12 @@ * * http://www.cs.cmu.edu/~ph/texfund/texfund.pdf * - * and the sample implementaion at http://www.cs.cmu.edu/~ph/src/texfund/. + * and the sample implementation at http://www.cs.cmu.edu/~ph/src/texfund/. * - * Our texture is a rectangle with origin [0,0], so we are mapping from quad - * to rectangle only, which significantly simplifies things; the function - * calls have been unrolled, and most of the math is done in fixed point. + * Our texture is a rectangle with origin [0, 0], so we are mapping from + * quad to rectangle only, which significantly simplifies things; the + * function calls have been unrolled, and most of the math is done in fixed + * point. */ clutter_actor_get_abs_allocation_vertices (self, v); @@ -6856,9 +7311,11 @@ #define FP2FX CLUTTER_FLOAT_TO_FIXED #define FX2FP CLUTTER_FIXED_TO_DOUBLE +#define UX2FP CLUTTER_UNITS_TO_FLOAT +#define UX2FX CLUTTER_UNITS_TO_FIXED #define FP2INT CLUTTER_FLOAT_TO_INT -#define DET2X(a,b, c,d) (CFX_QMUL(a,d) - CFX_QMUL(b,c)) -#define DET2FP(a,b, c,d) (a*d - b*c) +#define DET2X(a,b,c,d) ((a * d) - (b * c)) +#define DET2FP(a,b,c,d) ((a) * (d) - (b) * (c)) /* * First, find mapping from unit uv square to xy quadrilateral; this @@ -6870,20 +7327,21 @@ py = v[0].y - v[1].y + v[3].y - v[2].y; if (!px && !py) - { /* affine transform */ - RQ[0][0] = v[1].x - v[0].x; - RQ[1][0] = v[3].x - v[1].x; - RQ[2][0] = v[0].x; - RQ[0][1] = v[1].y - v[0].y; - RQ[1][1] = v[3].y - v[1].y; - RQ[2][1] = v[0].y; + { + /* affine transform */ + RQ[0][0] = UX2FX (v[1].x - v[0].x); + RQ[1][0] = UX2FX (v[3].x - v[1].x); + RQ[2][0] = UX2FX (v[0].x); + RQ[0][1] = UX2FX (v[1].y - v[0].y); + RQ[1][1] = UX2FX (v[3].y - v[1].y); + RQ[2][1] = UX2FX (v[0].y); RQ[0][2] = 0; RQ[1][2] = 0; - RQ[2][2] = CFX_ONE; + RQ[2][2] = 1.0; } else - { /* - * projective transform + { + /* projective transform * * Must do this in floating point, as the del value can overflow the * range of ClutterFixed for large actors. @@ -6893,13 +7351,12 @@ */ double dx1, dx2, dy1, dy2, del; - dx1 = FX2FP (v[1].x - v[3].x); - dx2 = FX2FP (v[2].x - v[3].x); - dy1 = FX2FP (v[1].y - v[3].y); - dy2 = FX2FP (v[2].y - v[3].y); - - del = DET2FP (dx1,dx2, dy1,dy2); + dx1 = UX2FP (v[1].x - v[3].x); + dx2 = UX2FP (v[2].x - v[3].x); + dy1 = UX2FP (v[1].y - v[3].y); + dy2 = UX2FP (v[2].y - v[3].y); + del = DET2FP (dx1, dx2, dy1, dy2); if (!del) return FALSE; @@ -6907,16 +7364,20 @@ * The division here needs to be done in floating point for * precisions reasons. */ - RQ[0][2] = FP2FX (DET2FP (FX2FP(px),dx2, FX2FP(py),dy2) / del); - RQ[1][2] = FP2FX (DET2FP (dx1,FX2FP(px), dy1,FX2FP(py)) / del); - RQ[1][2] = FP2FX (DET2FP(dx1,FX2FP(px), dy1,FX2FP(py))/del); - RQ[2][2] = CFX_ONE; - RQ[0][0] = v[1].x - v[0].x + CFX_QMUL (RQ[0][2], v[1].x); - RQ[1][0] = v[2].x - v[0].x + CFX_QMUL (RQ[1][2], v[2].x); - RQ[2][0] = v[0].x; - RQ[0][1] = v[1].y - v[0].y + CFX_QMUL (RQ[0][2], v[1].y); - RQ[1][1] = v[2].y - v[0].y + CFX_QMUL (RQ[1][2], v[2].y); - RQ[2][1] = v[0].y; + RQ[0][2] = FP2FX (DET2FP (UX2FP (px), dx2, UX2FP (py), dy2) / del); + RQ[1][2] = FP2FX (DET2FP (dx1, UX2FP (px), dy1, UX2FP (py)) / del); + RQ[1][2] = FP2FX (DET2FP (dx1, UX2FP (px), dy1, UX2FP (py)) / del); + RQ[2][2] = 1.0; + RQ[0][0] = UX2FX (v[1].x - v[0].x) + + CLUTTER_FIXED_MUL (RQ[0][2], UX2FX (v[1].x)); + RQ[1][0] = UX2FX (v[2].x - v[0].x) + + CLUTTER_FIXED_MUL (RQ[1][2], UX2FX (v[2].x)); + RQ[2][0] = UX2FX (v[0].x); + RQ[0][1] = UX2FX (v[1].y - v[0].y) + + CLUTTER_FIXED_MUL (RQ[0][2], UX2FX (v[1].y)); + RQ[1][1] = UX2FX (v[2].y - v[0].y) + + CLUTTER_FIXED_MUL (RQ[1][2], UX2FX (v[2].y)); + RQ[2][1] = UX2FX (v[0].y); } /* @@ -6947,31 +7408,35 @@ /* * Check the resutling martix is OK. */ - det = CFX_QMUL (RQ[0][0], ST[0][0]) + CFX_QMUL (RQ[0][1], ST[0][1]) + - CFX_QMUL (RQ[0][2], ST[0][2]); + det = CLUTTER_FIXED_MUL (RQ[0][0], ST[0][0]) + + CLUTTER_FIXED_MUL (RQ[0][1], ST[0][1]) + + CLUTTER_FIXED_MUL (RQ[0][2], ST[0][2]); if (!det) return FALSE; /* - * Now transform our point with the ST matrix; the notional w coordiance - * is 1, hence the last part is simply added. + * Now transform our point with the ST matrix; the notional w + * coordinate is 1, hence the last part is simply added. */ xi = CLUTTER_UNITS_TO_DEVICE (x); yi = CLUTTER_UNITS_TO_DEVICE (y); - xf = xi*ST[0][0] + yi*ST[1][0] + ST[2][0]; - yf = xi*ST[0][1] + yi*ST[1][1] + ST[2][1]; - wf = xi*ST[0][2] + yi*ST[1][2] + ST[2][2]; + xf = xi * ST[0][0] + yi * ST[1][0] + ST[2][0]; + yf = xi * ST[0][1] + yi * ST[1][1] + ST[2][1]; + wf = xi * ST[0][2] + yi * ST[1][2] + ST[2][2]; /* * The division needs to be done in floating point for precision reasons. */ if (x_out) *x_out = CLUTTER_UNITS_FROM_FLOAT (FX2FP (xf) / FX2FP (wf)); + if (y_out) *y_out = CLUTTER_UNITS_FROM_FLOAT (FX2FP (yf) / FX2FP (wf)); +#undef UX2FX +#undef UX2FP #undef FP2FX #undef FX2FP #undef FP2INT @@ -7073,29 +7538,23 @@ /******************************************************************************/ -typedef struct _BoxedFloat BoxedFloat; - -struct _BoxedFloat -{ - gfloat value; -}; - -static void -boxed_float_free (gpointer data) -{ - if (G_LIKELY (data)) - g_slice_free (BoxedFloat, data); -} - struct _ShaderData { ClutterShader *shader; - GHashTable *float1f_hash; /*< list of values that should be set + GHashTable *value_hash; /*< list of GValue's that should be set * on the shader before each paint cycle */ }; static void +shader_value_free (gpointer data) +{ + GValue *var = data; + g_value_unset (var); + g_slice_free (GValue, var); +} + +static void destroy_shader_data (ClutterActor *self) { ClutterActorPrivate *actor_priv = self->priv; @@ -7110,10 +7569,10 @@ shader_data->shader = NULL; } - if (shader_data->float1f_hash) + if (shader_data->value_hash) { - g_hash_table_destroy (shader_data->float1f_hash); - shader_data->float1f_hash = NULL; + g_hash_table_destroy (shader_data->value_hash); + shader_data->value_hash = NULL; } g_free (shader_data); @@ -7172,11 +7631,11 @@ g_return_val_if_fail (CLUTTER_IS_ACTOR (self), FALSE); g_return_val_if_fail (shader == NULL || CLUTTER_IS_SHADER (shader), FALSE); - /* if shader passed in is NULL we destroy the shader */ - if (shader == NULL) - { - destroy_shader_data (self); - } + if (shader) + g_object_ref (shader); + else + /* if shader passed in is NULL we destroy the shader */ + destroy_shader_data (self); actor_priv = self->priv; shader_data = actor_priv->shader_data; @@ -7184,21 +7643,15 @@ if (!shader_data) { actor_priv->shader_data = shader_data = g_new0 (ShaderData, 1); - shader_data->float1f_hash = + shader_data->value_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, - boxed_float_free); + shader_value_free); } if (shader_data->shader) - { - g_object_unref (shader_data->shader); - shader_data->shader = NULL; - } + g_object_unref (shader_data->shader); - if (shader) - { - shader_data->shader = g_object_ref (shader); - } + shader_data->shader = shader; if (CLUTTER_ACTOR_IS_VISIBLE (self)) clutter_actor_queue_redraw (self); @@ -7212,10 +7665,10 @@ gpointer value, gpointer user_data) { - ClutterShader *shader = CLUTTER_SHADER (user_data); - BoxedFloat *box = value; + ClutterShader *shader = user_data; + GValue *var = value; - clutter_shader_set_uniform_1f (shader, key, box->value); + clutter_shader_set_uniform (shader, (const gchar *)key, var); } static void @@ -7240,7 +7693,7 @@ { clutter_shader_set_is_enabled (shader, TRUE); - g_hash_table_foreach (shader_data->float1f_hash, set_each_param, shader); + g_hash_table_foreach (shader_data->value_hash, set_each_param, shader); if (!repeat) context->shaders = g_slist_prepend (context->shaders, actor); @@ -7289,19 +7742,24 @@ * Sets the value for a named parameter of the shader applied * to @actor. * - * Since: 0.6 + * Since: 1.0 */ void clutter_actor_set_shader_param (ClutterActor *self, const gchar *param, - gfloat value) + const GValue *value) { ClutterActorPrivate *priv; ShaderData *shader_data; - BoxedFloat *box; + GValue *var; 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)); priv = self->priv; shader_data = priv->shader_data; @@ -7309,15 +7767,68 @@ if (!shader_data) return; - box = g_slice_new (BoxedFloat); - box->value = value; - g_hash_table_insert (shader_data->float1f_hash, g_strdup (param), box); + 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); if (CLUTTER_ACTOR_IS_VISIBLE (self)) clutter_actor_queue_redraw (self); } /** + * 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 + */ +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 (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 + */ +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 (self, param, &var); + + g_value_unset (&var); +} + +/** * clutter_actor_is_rotated: * @self: a #ClutterActor * @@ -7361,7 +7872,7 @@ priv = self->priv; - if (priv->scale_x != CFX_ONE || priv->scale_y != CFX_ONE) + if (priv->scale_x != 1.0 || priv->scale_y != 1.0) return TRUE; return FALSE; @@ -7487,3 +7998,280 @@ clutter_actor_allocate (self, &actor_box, absolute_origin_changed); } + +/** + * clutter_actor_grab_key_focus: + * @self: a #ClutterActor + * + * Sets the key focus of the #ClutterStage including @self + * to this #ClutterActor. + * + * Since: 1.0 + */ +void +clutter_actor_grab_key_focus (ClutterActor *self) +{ + ClutterActor *parent; + + g_return_if_fail (CLUTTER_IS_ACTOR (self)); + + parent = clutter_actor_get_parent (self); + if (!parent) + return; + + parent = clutter_actor_get_stage (self); + if (parent && CLUTTER_IS_STAGE (parent)) + clutter_stage_set_key_focus (CLUTTER_STAGE (parent), self); +} + +/** + * clutter_actor_get_pango_context: + * @self: a #ClutterActor + * + * Retrieves the #PangoContext for @self. The actor's #PangoContext + * is already configured using the appropriate font map, resolution + * and font options. + * + * Unlike clutter_actor_create_pango_context(), this context is owend + * by the #ClutterActor and it will be updated each time the options + * stored by the #ClutterBackend change. + * + * You can use the returned #PangoContext to create a #PangoLayout + * and render text using cogl_pango_render_layout() to reuse the + * glyphs cache also used by Clutter. + * + * Return value: the #PangoContext for a #ClutterActor. The returned + * #PangoContext is owned by the actor and should not be unreferenced + * by the application code + * + * Since: 1.0 + */ +PangoContext * +clutter_actor_get_pango_context (ClutterActor *self) +{ + ClutterActorPrivate *priv; + ClutterMainContext *ctx; + + g_return_val_if_fail (CLUTTER_IS_ACTOR (self), NULL); + + priv = self->priv; + + if (priv->pango_context) + return priv->pango_context; + + ctx = CLUTTER_CONTEXT (); + priv->pango_context = _clutter_context_get_pango_context (ctx); + g_object_ref (priv->pango_context); + + return priv->pango_context; +} + +/** + * clutter_actor_create_pango_context: + * @self: a #ClutterActor + * + * Creates a #PangoContext for the given actor. The #PangoContext + * is already configured using the appropriate font map, resolution + * and font options. + * + * See also clutter_actor_get_pango_context(). + * + * Return value: the newly created #PangoContext. Use g_object_ref() + * on the returned value to deallocate its resources + * + * Since: 1.0 + */ +PangoContext * +clutter_actor_create_pango_context (ClutterActor *self) +{ + ClutterMainContext *ctx; + PangoContext *retval; + + g_return_val_if_fail (CLUTTER_IS_ACTOR (self), NULL); + + ctx = CLUTTER_CONTEXT (); + retval = _clutter_context_create_pango_context (ctx); + + return retval; +} + +/* Allows overriding the parent traversed when querying an actors paint + * opacity. Used by ClutterClone. */ +void +_clutter_actor_set_opacity_parent (ClutterActor *self, + ClutterActor *parent) +{ + g_return_if_fail (CLUTTER_IS_ACTOR (self)); + + self->priv->opacity_parent = parent; +} + +/* Allows you to disable applying the actors model view transform during + * a paint. Used by ClutterClone. */ +void +_clutter_actor_set_enable_model_view_transform (ClutterActor *self, + gboolean enable) +{ + g_return_if_fail (CLUTTER_IS_ACTOR (self)); + + self->priv->enable_model_view_transform = enable; +} + +static void +clutter_anchor_coord_get_units (ClutterActor *self, + const AnchorCoord *coord, + ClutterUnit *x, + ClutterUnit *y, + ClutterUnit *z) +{ + if (G_UNLIKELY (coord->is_fractional)) + { + ClutterUnit actor_width, actor_height; + + clutter_actor_get_sizeu (self, &actor_width, &actor_height); + + if (x) + *x = actor_width * coord->v.fraction.x; + if (y) + *y = actor_height * coord->v.fraction.y; + if (z) + *z = 0; + } + else + { + if (x) + *x = coord->v.units.x; + if (y) + *y = coord->v.units.y; + if (z) + *z = coord->v.units.z; + } +} + +static void +clutter_anchor_coord_set_units (AnchorCoord *coord, + ClutterUnit x, + ClutterUnit y, + ClutterUnit z) +{ + coord->is_fractional = FALSE; + coord->v.units.x = x; + coord->v.units.y = y; + coord->v.units.z = z; +} + +static ClutterGravity +clutter_anchor_coord_get_gravity (AnchorCoord *coord) +{ + if (coord->is_fractional) + { + if (coord->v.fraction.x == 0.0) + { + if (coord->v.fraction.y == 0.0) + return CLUTTER_GRAVITY_NORTH_WEST; + else if (coord->v.fraction.y == 0.5) + return CLUTTER_GRAVITY_WEST; + else if (coord->v.fraction.y == 1.0) + return CLUTTER_GRAVITY_SOUTH_WEST; + else + return CLUTTER_GRAVITY_NONE; + } + else if (coord->v.fraction.x == 0.5) + { + if (coord->v.fraction.y == 0.0) + return CLUTTER_GRAVITY_NORTH; + else if (coord->v.fraction.y == 0.5) + return CLUTTER_GRAVITY_CENTER; + else if (coord->v.fraction.y == 1.0) + return CLUTTER_GRAVITY_SOUTH; + else + return CLUTTER_GRAVITY_NONE; + } + else if (coord->v.fraction.x == 1.0) + { + if (coord->v.fraction.y == 0.0) + return CLUTTER_GRAVITY_NORTH_EAST; + else if (coord->v.fraction.y == 0.5) + return CLUTTER_GRAVITY_EAST; + else if (coord->v.fraction.y == 1.0) + return CLUTTER_GRAVITY_SOUTH_EAST; + else + return CLUTTER_GRAVITY_NONE; + } + else + return CLUTTER_GRAVITY_NONE; + } + else + return CLUTTER_GRAVITY_NONE; +} + +static void +clutter_anchor_coord_set_gravity (AnchorCoord *coord, + ClutterGravity gravity) +{ + switch (gravity) + { + case CLUTTER_GRAVITY_NORTH: + coord->v.fraction.x = 0.5; + coord->v.fraction.y = 0.0; + break; + + case CLUTTER_GRAVITY_NORTH_EAST: + coord->v.fraction.x = 1.0; + coord->v.fraction.y = 0.0; + break; + + case CLUTTER_GRAVITY_EAST: + coord->v.fraction.x = 1.0; + coord->v.fraction.y = 0.5; + break; + + case CLUTTER_GRAVITY_SOUTH_EAST: + coord->v.fraction.x = 1.0; + coord->v.fraction.y = 1.0; + break; + + case CLUTTER_GRAVITY_SOUTH: + coord->v.fraction.x = 0.5; + coord->v.fraction.y = 1.0; + break; + + case CLUTTER_GRAVITY_SOUTH_WEST: + coord->v.fraction.x = 0.0; + coord->v.fraction.y = 1.0; + break; + + case CLUTTER_GRAVITY_WEST: + coord->v.fraction.x = 0.0; + coord->v.fraction.y = 0.5; + break; + + case CLUTTER_GRAVITY_NORTH_WEST: + coord->v.fraction.x = 0.0; + coord->v.fraction.y = 0.0; + break; + + case CLUTTER_GRAVITY_CENTER: + coord->v.fraction.x = 0.5; + coord->v.fraction.y = 0.5; + break; + + default: + coord->v.fraction.x = 0.0; + coord->v.fraction.y = 0.0; + break; + } + + coord->is_fractional = TRUE; +} + +static gboolean +clutter_anchor_coord_is_zero (const AnchorCoord *coord) +{ + if (coord->is_fractional) + return coord->v.fraction.x == 0.0 && coord->v.fraction.y == 0.0; + else + return (coord->v.units.x == 0.0 + && coord->v.units.y == 0.0 + && coord->v.units.z == 0.0); +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-actor.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-actor.h --- clutter-0.8.4/clutter/clutter-actor.h 2008-11-13 14:44:32.000000000 +0000 +++ clutter-0.9.0/clutter/clutter-actor.h 2009-01-28 16:47:03.000000000 +0000 @@ -18,17 +18,21 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ -#ifndef _HAVE_CLUTTER_ACTOR_H -#define _HAVE_CLUTTER_ACTOR_H +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_ACTOR_H__ +#define __CLUTTER_ACTOR_H__ /* clutter-actor.h */ #include +#include + #include #include #include @@ -70,10 +74,10 @@ */ #define CLUTTER_ACTOR_UNSET_FLAGS(a,f) (((ClutterActor*)(a))->flags &= ~(f)) -#define CLUTTER_ACTOR_IS_MAPPED(e) (((ClutterActor*)(e))->flags & CLUTTER_ACTOR_MAPPED) -#define CLUTTER_ACTOR_IS_REALIZED(e) (((ClutterActor*)(e))->flags & CLUTTER_ACTOR_REALIZED) +#define CLUTTER_ACTOR_IS_MAPPED(e) ((((ClutterActor*)(e))->flags & CLUTTER_ACTOR_MAPPED) != FALSE) +#define CLUTTER_ACTOR_IS_REALIZED(e) ((((ClutterActor*)(e))->flags & CLUTTER_ACTOR_REALIZED) != FALSE) #define CLUTTER_ACTOR_IS_VISIBLE(e) (CLUTTER_ACTOR_IS_MAPPED (e) && CLUTTER_ACTOR_IS_REALIZED (e)) -#define CLUTTER_ACTOR_IS_REACTIVE(e) (((ClutterActor*)(e))->flags & CLUTTER_ACTOR_REACTIVE) +#define CLUTTER_ACTOR_IS_REACTIVE(e) ((((ClutterActor*)(e))->flags & CLUTTER_ACTOR_REACTIVE) != FALSE) typedef struct _ClutterActorClass ClutterActorClass; typedef struct _ClutterActorBox ClutterActorBox; @@ -386,38 +390,33 @@ gint x, gint y, gint z); -void clutter_actor_set_rotationx (ClutterActor *self, - ClutterRotateAxis axis, - ClutterFixed angle, - gint x, - gint y, - gint z); void clutter_actor_set_rotationu (ClutterActor *self, ClutterRotateAxis axis, gdouble angle, ClutterUnit x, ClutterUnit y, ClutterUnit z); +void clutter_actor_set_z_rotation_from_gravity (ClutterActor *self, + gdouble angle, + ClutterGravity gravity); gdouble clutter_actor_get_rotation (ClutterActor *self, ClutterRotateAxis axis, gint *x, gint *y, gint *z); -ClutterFixed clutter_actor_get_rotationx (ClutterActor *self, - ClutterRotateAxis axis, - gint *x, - gint *y, - gint *z); gdouble clutter_actor_get_rotationu (ClutterActor *self, ClutterRotateAxis axis, ClutterUnit *x, ClutterUnit *y, ClutterUnit *z); +ClutterGravity clutter_actor_get_z_rotation_gravity (ClutterActor *self); void clutter_actor_set_opacity (ClutterActor *self, guint8 opacity); guint8 clutter_actor_get_opacity (ClutterActor *self); guint8 clutter_actor_get_paint_opacity (ClutterActor *self); +gboolean clutter_actor_get_paint_visibility (ClutterActor *self); + void clutter_actor_set_name (ClutterActor *self, const gchar *name); @@ -468,18 +467,33 @@ ClutterUnit depth); ClutterUnit clutter_actor_get_depthu (ClutterActor *self); -void clutter_actor_set_scalex (ClutterActor *self, - ClutterFixed scale_x, - ClutterFixed scale_y); void clutter_actor_set_scale (ClutterActor *self, gdouble scale_x, gdouble scale_y); -void clutter_actor_get_scalex (ClutterActor *self, - ClutterFixed *scale_x, - ClutterFixed *scale_y); +void clutter_actor_set_scale_full (ClutterActor *self, + gdouble scale_x, + gdouble scale_y, + int center_x, + int center_y); +void clutter_actor_set_scale_fullu (ClutterActor *self, + gdouble scale_x, + gdouble scale_y, + ClutterUnit center_x, + ClutterUnit center_y); +void clutter_actor_set_scale_with_gravity (ClutterActor *self, + gdouble scale_x, + gdouble scale_y, + ClutterGravity gravity); void clutter_actor_get_scale (ClutterActor *self, gdouble *scale_x, gdouble *scale_y); +void clutter_actor_get_scale_center (ClutterActor *self, + gint *center_x, + gint *center_y); +void clutter_actor_get_scale_centeru (ClutterActor *self, + ClutterUnit *center_x, + ClutterUnit *center_y); +ClutterGravity clutter_actor_get_scale_gravity (ClutterActor *self); void clutter_actor_move_by (ClutterActor *self, gint dx, @@ -503,6 +517,12 @@ ClutterShader * clutter_actor_get_shader (ClutterActor *self); void clutter_actor_set_shader_param (ClutterActor *self, const gchar *param, + const GValue *value); +void clutter_actor_set_shader_param_int (ClutterActor *self, + const gchar *param, + gint value); +void clutter_actor_set_shader_param_float (ClutterActor *self, + const gchar *param, gfloat value); void clutter_actor_set_anchor_point (ClutterActor *self, @@ -514,6 +534,7 @@ void clutter_actor_get_anchor_point (ClutterActor *self, gint *anchor_x, gint *anchor_y); +ClutterGravity clutter_actor_get_anchor_point_gravity (ClutterActor *self); void clutter_actor_set_anchor_pointu (ClutterActor *self, ClutterUnit anchor_x, ClutterUnit anchor_y); @@ -537,21 +558,24 @@ gboolean clutter_actor_is_scaled (ClutterActor *self); gboolean clutter_actor_should_pick_paint (ClutterActor *self); -void clutter_actor_box_get_from_vertices (ClutterVertex vtx[4], - ClutterActorBox *box); +void clutter_actor_box_get_from_vertices (ClutterVertex vtx[4], + ClutterActorBox *box); + +void clutter_actor_get_abs_allocation_vertices (ClutterActor *self, + ClutterVertex verts[4]); -void clutter_actor_get_abs_allocation_vertices (ClutterActor *self, - ClutterVertex verts[4]); +void clutter_actor_apply_transform_to_point (ClutterActor *self, + const ClutterVertex *point, + ClutterVertex *vertex); +void clutter_actor_apply_relative_transform_to_point (ClutterActor *self, + ClutterActor *ancestor, + const ClutterVertex *point, + ClutterVertex *vertex); -void clutter_actor_apply_transform_to_point (ClutterActor *self, - ClutterVertex *point, - ClutterVertex *vertex); -void clutter_actor_apply_relative_transform_to_point (ClutterActor *self, - ClutterActor *ancestor, - ClutterVertex *point, - ClutterVertex *vertex); +void clutter_actor_grab_key_focus (ClutterActor *self); -gboolean clutter_actor_get_paint_visibility (ClutterActor *self); +PangoContext *clutter_actor_get_pango_context (ClutterActor *self); +PangoContext *clutter_actor_create_pango_context (ClutterActor *self); G_END_DECLS diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-alpha.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-alpha.c --- clutter-0.8.4/clutter/clutter-alpha.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-alpha.c 2009-01-28 08:12:44.000000000 +0000 @@ -8,7 +8,8 @@ * Emmanuele Bassi * Tomas Frydrych * - * Copyright (C) 2006, 2007 OpenedHand + * Copyright (C) 2006, 2007, 2008 OpenedHand + * Copyright (C) 2009 Intel Corp. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -31,21 +32,36 @@ * @short_description: A class for calculating an alpha value as a function * of time. * - * #ClutterAlpha is a class for calculating an integer value between - * 0 and %CLUTTER_ALPHA_MAX_ALPHA as a function of time. You should - * provide a #ClutterTimeline and bind it to the #ClutterAlpha object; - * you should also provide a function returning the alpha value depending - * on the position inside the timeline; this function will be executed - * each time a new frame in the #ClutterTimeline is reached. Since the - * alpha function is controlled by the timeline instance, you can pause - * or stop the #ClutterAlpha from calling the alpha function by controlling - * the #ClutterTimeline object. - * - * #ClutterAlpha is used to "drive" a #ClutterBehaviour instance. - * - *
- * Graphic representation of some alpha functions - * + * #ClutterAlpha is a class for calculating an floating point value + * dependent only on the position of a #ClutterTimeline. + * + * A #ClutterAlpha binds a #ClutterTimeline to a progress function which + * translates the time T into an adimensional factor alpha. The factor can + * then be used to drive a #ClutterBehaviour, which will translate the + * alpha value into something meaningful for a #ClutterActor. + * + * You should provide a #ClutterTimeline and bind it to the #ClutterAlpha + * instance using clutter_alpha_set_timeline(). You should also set an + * "animation mode", either by using the #ClutterAnimatioMode values that + * Clutter itself provides or by registering custom functions using + * clutter_alpha_register_func(). + * + * Instead of a #ClutterAnimationMode you may provide a function returning + * the alpha value depending on the progress of the timeline, using + * clutter_alpha_set_func() or clutter_alpha_set_closure(). The alpha + * function will be executed each time a new frame in the #ClutterTimeline + * is reached. + * + * Since the alpha function is controlled by the timeline instance, you can + * pause, stop or resume the #ClutterAlpha from calling the alpha function by + * using the appropriate functions of the #ClutterTimeline object. + * + * #ClutterAlpha is used to "drive" a #ClutterBehaviour instance, and it + * is internally used by the #ClutterAnimation API. + * + *
+ * Easing modes provided by Clutter + * *
* * Since: 0.2 @@ -58,10 +74,11 @@ #include #include "clutter-alpha.h" +#include "clutter-debug.h" +#include "clutter-enum-types.h" #include "clutter-main.h" #include "clutter-marshal.h" #include "clutter-private.h" -#include "clutter-debug.h" G_DEFINE_TYPE (ClutterAlpha, clutter_alpha, G_TYPE_INITIALLY_UNOWNED); @@ -71,9 +88,11 @@ ClutterTimeline *timeline; guint timeline_new_frame_id; - guint32 alpha; + gdouble alpha; GClosure *closure; + + gulong mode; }; enum @@ -81,7 +100,8 @@ PROP_0, PROP_TIMELINE, - PROP_ALPHA + PROP_ALPHA, + PROP_MODE }; static void @@ -113,6 +133,11 @@ case PROP_TIMELINE: clutter_alpha_set_timeline (alpha, g_value_get_object (value)); break; + + case PROP_MODE: + clutter_alpha_set_mode (alpha, g_value_get_ulong (value)); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -136,9 +161,15 @@ case PROP_TIMELINE: g_value_set_object (value, priv->timeline); break; + case PROP_ALPHA: - g_value_set_uint (value, priv->alpha); + g_value_set_double (value, priv->alpha); break; + + case PROP_MODE: + g_value_set_ulong (value, priv->mode); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -171,6 +202,7 @@ clutter_alpha_class_init (ClutterAlphaClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); + GParamSpec *pspec; object_class->set_property = clutter_alpha_set_property; object_class->get_property = clutter_alpha_get_property; @@ -186,29 +218,50 @@ * * Since: 0.2 */ - g_object_class_install_property (object_class, - PROP_TIMELINE, - g_param_spec_object ("timeline", - "Timeline", - "Timeline", - CLUTTER_TYPE_TIMELINE, - CLUTTER_PARAM_READWRITE)); + pspec = g_param_spec_object ("timeline", + "Timeline", + "Timeline used by the alpha", + CLUTTER_TYPE_TIMELINE, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (object_class, PROP_TIMELINE, pspec); + /** * ClutterAlpha:alpha: * - * The alpha value as computed by the alpha function. + * The alpha value as computed by the alpha function. The linear + * interval is 0.0 to 1.0, but the Alpha allows overshooting by + * one unit in each direction, so the valid interval is -1.0 to 2.0. * * Since: 0.2 */ - g_object_class_install_property (object_class, - PROP_ALPHA, - g_param_spec_uint ("alpha", - "Alpha value", - "Alpha value", - 0, - CLUTTER_ALPHA_MAX_ALPHA, - 0, - CLUTTER_PARAM_READABLE)); + pspec = g_param_spec_double ("alpha", + "Alpha value", + "Alpha value", + -1.0, 2.0, + 0.0, + CLUTTER_PARAM_READABLE); + g_object_class_install_property (object_class, PROP_ALPHA, pspec); + + /** + * ClutterAlpha:mode: + * + * The progress function logical id - either a value from the + * #ClutterAnimationMode enumeration or a value returned by + * clutter_alpha_register_func(). + * + * If %CLUTTER_CUSTOM_MODE is used then the function set using + * clutter_alpha_set_closure() or clutter_alpha_set_func() + * will be used. + * + * Since: 1.0 + */ + pspec = g_param_spec_ulong ("mode", + "Mode", + "Progress mode", + 0, G_MAXULONG, + CLUTTER_CUSTOM_MODE, + G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE); + g_object_class_install_property (object_class, PROP_MODE, pspec); } static void @@ -217,6 +270,9 @@ self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, CLUTTER_TYPE_ALPHA, ClutterAlphaPrivate); + + self->priv->mode = CLUTTER_CUSTOM_MODE; + self->priv->alpha = 0.0; } /** @@ -229,11 +285,11 @@ * * Since: 0.2 */ -guint32 +gdouble clutter_alpha_get_alpha (ClutterAlpha *alpha) { ClutterAlphaPrivate *priv; - guint32 retval = 0; + gdouble retval = 0; g_return_val_if_fail (CLUTTER_IS_ALPHA (alpha), 0); @@ -246,18 +302,14 @@ g_object_ref (alpha); - g_value_init (&result_value, G_TYPE_UINT); + g_value_init (&result_value, G_TYPE_DOUBLE); g_value_init (¶ms, CLUTTER_TYPE_ALPHA); g_value_set_object (¶ms, alpha); - g_closure_invoke (priv->closure, - &result_value, - 1, - ¶ms, - NULL); + g_closure_invoke (priv->closure, &result_value, 1, ¶ms, NULL); - retval = g_value_get_uint (&result_value); + retval = g_value_get_double (&result_value); g_value_unset (&result_value); g_value_unset (¶ms); @@ -268,14 +320,44 @@ return retval; } +/* + * clutter_alpha_set_closure_internal: + * @alpha: a #ClutterAlpha + * @closure: a #GClosure + * + * Sets the @closure for @alpha. This function does not + * set the #ClutterAlpha:mode property and does not emit + * the #GObject::notify signal for it. + */ +static inline void +clutter_alpha_set_closure_internal (ClutterAlpha *alpha, + GClosure *closure) +{ + ClutterAlphaPrivate *priv = alpha->priv; + + if (priv->closure) + g_closure_unref (priv->closure); + + /* need to take ownership of the closure before sinking it */ + priv->closure = g_closure_ref (closure); + g_closure_sink (closure); + + /* set the marshaller */ + if (G_CLOSURE_NEEDS_MARSHAL (closure)) + { + GClosureMarshal marshal = clutter_marshal_DOUBLE__VOID; + + g_closure_set_marshal (closure, marshal); + } +} + /** * clutter_alpha_set_closure: * @alpha: A #ClutterAlpha * @closure: A #GClosure * - * Sets the #GClosure used to compute - * the alpha value at each frame of the #ClutterTimeline - * bound to @alpha. + * Sets the #GClosure used to compute the alpha value at each + * frame of the #ClutterTimeline bound to @alpha. * * Since: 0.8 */ @@ -290,24 +372,16 @@ priv = alpha->priv; - if (priv->closure) - g_closure_unref (priv->closure); - - priv->closure = g_closure_ref (closure); - g_closure_sink (closure); - - if (G_CLOSURE_NEEDS_MARSHAL (closure)) - { - GClosureMarshal marshal = clutter_marshal_UINT__VOID; + clutter_alpha_set_closure_internal (alpha, closure); - g_closure_set_marshal (closure, marshal); - } + priv->mode = CLUTTER_CUSTOM_MODE; + g_object_notify (G_OBJECT (alpha), "mode"); } /** * clutter_alpha_set_func: * @alpha: A #ClutterAlpha - * @func: A #ClutterAlphaAlphaFunc + * @func: A #ClutterAlphaFunc * @data: user data to be passed to the alpha function, or %NULL * @destroy: notify function used when disposing the alpha function * @@ -315,6 +389,8 @@ * the alpha value at each frame of the #ClutterTimeline * bound to @alpha. * + * This function will not register @func as a global alpha function. + * * Since: 0.2 */ void @@ -323,13 +399,19 @@ gpointer data, GDestroyNotify destroy) { + ClutterAlphaPrivate *priv; GClosure *closure; g_return_if_fail (CLUTTER_IS_ALPHA (alpha)); g_return_if_fail (func != NULL); - + + priv = alpha->priv; + closure = g_cclosure_new (G_CALLBACK (func), data, (GClosureNotify) destroy); - clutter_alpha_set_closure (alpha, closure); + clutter_alpha_set_closure_internal (alpha, closure); + + priv->mode = CLUTTER_CUSTOM_MODE; + g_object_notify (G_OBJECT (alpha), "mode"); } /** @@ -352,6 +434,9 @@ priv = alpha->priv; + if (priv->timeline == timeline) + return; + if (priv->timeline) { g_signal_handlers_disconnect_by_func (priv->timeline, @@ -370,6 +455,8 @@ G_CALLBACK (timeline_new_frame_cb), alpha); } + + g_object_notify (G_OBJECT (alpha), "timeline"); } /** @@ -414,22 +501,53 @@ /** * clutter_alpha_new_full: * @timeline: #ClutterTimeline timeline - * @func: #ClutterAlphaFunc alpha function - * @data: data to be passed to the alpha function - * @destroy: notify to be called when removing the alpha function + * @mode: animation mode * * Creates a new #ClutterAlpha instance and sets the timeline - * and alpha function. + * and animation mode. + * + * See also clutter_alpha_set_timeline() and clutter_alpha_set_mode(). * * Return Value: the newly created #ClutterAlpha * - * Since: 0.2 + * Since: 1.0 */ ClutterAlpha * -clutter_alpha_new_full (ClutterTimeline *timeline, - ClutterAlphaFunc func, - gpointer data, - GDestroyNotify destroy) +clutter_alpha_new_full (ClutterTimeline *timeline, + gulong mode) +{ + g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), NULL); + g_return_val_if_fail (mode != CLUTTER_ANIMATION_LAST, NULL); + + return g_object_new (CLUTTER_TYPE_ALPHA, + "timeline", timeline, + "mode", mode, + NULL); +} + +/** + * clutter_alpha_new_with_func: + * @timeline: a #ClutterTimeline + * @func: a #ClutterAlphaFunc + * @data: data to pass to the function, or %NULL + * @destroy: function to call when removing the alpha function, or %NULL + * + * Creates a new #ClutterAlpha instances and sets the timeline + * and the alpha function. + * + * This function will not register @func as a global alpha function. + * + * See also clutter_alpha_set_timeline() and clutter_alpha_set_func(). + * + * Return value: the newly created #ClutterAlpha + * + * Since: 1.0 + */ +ClutterAlpha * +clutter_alpha_new_with_func (ClutterTimeline *timeline, + ClutterAlphaFunc func, + gpointer data, + GDestroyNotify destroy) { ClutterAlpha *retval; @@ -437,7 +555,6 @@ g_return_val_if_fail (func != NULL, NULL); retval = clutter_alpha_new (); - clutter_alpha_set_timeline (retval, timeline); clutter_alpha_set_func (retval, func, data, destroy); @@ -445,580 +562,644 @@ } /** - * CLUTTER_ALPHA_RAMP_INC: - * - * Convenience symbol for clutter_ramp_inc_func(). - * - * Since: 0.2 - */ - -/** - * clutter_ramp_inc_func: + * clutter_alpha_get_mode: * @alpha: a #ClutterAlpha - * @dummy: unused argument * - * Convenience alpha function for a monotonic increasing ramp. You - * can use this function as the alpha function for clutter_alpha_set_func(). + * Retrieves the #ClutterAnimatioMode used by @alpha. * - * Return value: an alpha value. + * Return value: the animation mode * - * Since: 0.2 + * Since: 1.0 */ -guint32 -clutter_ramp_inc_func (ClutterAlpha *alpha, - gpointer dummy) +gulong +clutter_alpha_get_mode (ClutterAlpha *alpha) { - ClutterTimeline *timeline; - gint current_frame_num, n_frames; + g_return_val_if_fail (CLUTTER_IS_ALPHA (alpha), CLUTTER_CUSTOM_MODE); - timeline = clutter_alpha_get_timeline (alpha); + return alpha->priv->mode; +} - current_frame_num = clutter_timeline_get_current_frame (timeline); - n_frames = clutter_timeline_get_n_frames (timeline); +static gdouble +clutter_linear (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; - return (current_frame_num * CLUTTER_ALPHA_MAX_ALPHA) / n_frames; + return clutter_timeline_get_progress (timeline); } -/** - * CLUTTER_ALPHA_RAMP_DEC: - * - * Convenience symbol for clutter_ramp_dec_func(). - * - * Since: 0.2 - */ +static gdouble +clutter_ease_in_quad (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble progress = clutter_timeline_get_progress (timeline); -/** - * clutter_ramp_dec_func: - * @alpha: a #ClutterAlpha - * @dummy: unused argument - * - * Convenience alpha function for a monotonic decreasing ramp. You - * can use this function as the alpha function for clutter_alpha_set_func(). - * - * Return value: an alpha value. - * - * Since: 0.2 - */ -guint32 -clutter_ramp_dec_func (ClutterAlpha *alpha, - gpointer dummy) + return progress * progress; +} + +static gdouble +clutter_ease_out_quad (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) { - ClutterTimeline *timeline; - gint current_frame_num, n_frames; + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); - timeline = clutter_alpha_get_timeline (alpha); + return -1.0 * (t /= d) * (t - 2); +} + +static gdouble +clutter_ease_in_out_quad (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); - current_frame_num = clutter_timeline_get_current_frame (timeline); - n_frames = clutter_timeline_get_n_frames (timeline); + if ((t /= d / 2) < 1) + return 0.5 * t * t; - return (n_frames - current_frame_num) - * CLUTTER_ALPHA_MAX_ALPHA - / n_frames; + return -0.5 * ((--t) * (t - 2) - 1); } -/** - * CLUTTER_ALPHA_RAMP: - * - * Convenience symbol for clutter_ramp_func(). - * - * Since: 0.2 - */ +static gdouble +clutter_ease_in_cubic (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); -/** - * clutter_ramp_func: - * @alpha: a #ClutterAlpha - * @dummy: unused argument - * - * Convenience alpha function for a full ramp function (increase for - * half the time, decrease for the remaining half). You can use this - * function as the alpha function for clutter_alpha_set_func(). - * - * Return value: an alpha value. - * - * Since: 0.2 - */ -guint32 -clutter_ramp_func (ClutterAlpha *alpha, - gpointer dummy) + return (t /= d) * t * t; +} + +static gdouble +clutter_ease_out_cubic (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) { - ClutterTimeline *timeline; - gint current_frame_num, n_frames; + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); + + return (t = t / d - 1) * t * t + 1; +} - timeline = clutter_alpha_get_timeline (alpha); +static gdouble +clutter_ease_in_out_cubic (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); - current_frame_num = clutter_timeline_get_current_frame (timeline); - n_frames = clutter_timeline_get_n_frames (timeline); + if ((t /= d / 2) < 1) + return 0.5 * t * t * t; - if (current_frame_num > (n_frames / 2)) - { - return (n_frames - current_frame_num) - * CLUTTER_ALPHA_MAX_ALPHA - / (n_frames / 2); - } - else - { - return current_frame_num - * CLUTTER_ALPHA_MAX_ALPHA - / (n_frames / 2); - } + return 0.5 * ((t -= 2) * t * t + 2); } -static guint32 -sincx1024_func (ClutterAlpha *alpha, - ClutterAngle angle, - ClutterFixed offset) +static gdouble +clutter_ease_in_quart (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) { - ClutterTimeline *timeline; - gint current_frame_num, n_frames; - ClutterAngle x; - unsigned int sine; - - timeline = clutter_alpha_get_timeline (alpha); + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); + + return (t /= d) * t * t * t; +} - current_frame_num = clutter_timeline_get_current_frame (timeline); - n_frames = clutter_timeline_get_n_frames (timeline); +static gdouble +clutter_ease_out_quart (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); - x = angle * current_frame_num / n_frames; + return -0.5 * ((t = t / d - 1) * t * t * t - 1); +} - x -= (512 * 512 / angle); - - sine = ((clutter_sini (x) + offset)/2) * CLUTTER_ALPHA_MAX_ALPHA; +static gdouble +clutter_ease_in_out_quart (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); - sine = sine >> CFX_Q; - - return sine; + if ((t /= d / 2) < 1) + return 0.5 * t * t * t * t; + + return -0.5 * ((t -= 2) * t * t * t - 2); } -#if 0 -/* - * The following two functions are left in place for reference - * purposes. - */ -static guint32 -sincx_func (ClutterAlpha *alpha, - ClutterFixed angle, - ClutterFixed offset) + +static gdouble +clutter_ease_in_quint (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) + { + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); + + return (t /= d) * t * t * t * t; +} + +static gdouble +clutter_ease_out_quint (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) { - ClutterTimeline *timeline; - gint current_frame_num, n_frames; - ClutterFixed x, sine; - - timeline = clutter_alpha_get_timeline (alpha); + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); - current_frame_num = clutter_timeline_get_current_frame (timeline); - n_frames = clutter_timeline_get_n_frames (timeline); + return (t = t / d - 1) * t * t * t * t + 1; +} - x = angle * current_frame_num / n_frames; - x = CLUTTER_FIXED_MUL (x, CFX_PI) - CLUTTER_FIXED_DIV (CFX_PI, angle); +static gdouble +clutter_ease_in_out_quint (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); - sine = (clutter_fixed_sin (x) + offset)/2; + if ((t /= d / 2) < 1) + return 0.5 * t * t * t * t * t; - CLUTTER_NOTE (ALPHA, "sine: %2f\n", CLUTTER_FIXED_TO_DOUBLE (sine)); + return 0.5 * ((t -= 2) * t * t * t * t + 2); +} + +static gdouble +clutter_ease_in_sine (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); - return CLUTTER_FIXED_TO_INT (sine * CLUTTER_ALPHA_MAX_ALPHA); + return -1.0 * cos (t / d * G_PI_2) + 1.0; } -/* NB: angle is not in radians but in muliples of PI, i.e., 2.0 - * represents full circle. - */ -static guint32 -sinc_func (ClutterAlpha *alpha, - float angle, - float offset) +static gdouble +clutter_ease_out_sine (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) { - ClutterTimeline *timeline; - gint current_frame_num, n_frames; - gdouble x, sine; - - timeline = clutter_alpha_get_timeline (alpha); + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); - current_frame_num = clutter_timeline_get_current_frame (timeline); - n_frames = clutter_timeline_get_n_frames (timeline); + return sin (t / d * G_PI_2); +} - /* FIXME: fixed point, and fixed point sine() */ +static gdouble +clutter_ease_in_out_sine (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); - x = (gdouble) (current_frame_num * angle * G_PI) / n_frames ; - sine = (sin (x - (G_PI / angle)) + offset) * 0.5f; + return -0.5 * (cos (G_PI * t / d) - 1); +} - CLUTTER_NOTE (ALPHA, "sine: %2f\n",sine); +static gdouble +clutter_ease_in_expo (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); - return CLUTTER_FLOAT_TO_INT ((sine * (gdouble) CLUTTER_ALPHA_MAX_ALPHA)); + return (t == 0) ? 0.0 : pow (2, 10 * (t / d - 1)); } -#endif -/** - * CLUTTER_ALPHA_SINE: - * - * Convenience symbol for clutter_sine_func(). - * - * Since: 0.2 - */ +static gdouble +clutter_ease_out_expo (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); -/** - * clutter_sine_func: - * @alpha: a #ClutterAlpha - * @dummy: unused argument - * - * Convenience alpha function for a sine wave. You can use this - * function as the alpha function for clutter_alpha_set_func(). - * - * Return value: an alpha value. - * - * Since: 0.2 - */ -guint32 -clutter_sine_func (ClutterAlpha *alpha, - gpointer dummy) -{ -#if 0 - return sinc_func (alpha, 2.0, 1.0); -#else - /* 2.0 above represents full circle */ - return sincx1024_func (alpha, 1024, CFX_ONE); -#endif + return (t == d) ? 1.0 : -pow (2, -10 * t / d) + 1; } -/** - * CLUTTER_ALPHA_SINE_INC: - * - * Convenience symbol for clutter_sine_inc_func(). - * - * Since: 0.2 - */ +static gdouble +clutter_ease_in_out_expo (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); -/** - * clutter_sine_inc_func: - * @alpha: a #ClutterAlpha - * @dummy: unused argument - * - * Convenience alpha function for a sine wave over interval [0, pi / 2]. - * You can use this function as the alpha function for - * clutter_alpha_set_func(). - * - * Return value: an alpha value. - * - * Since: 0.2 - */ -guint32 -clutter_sine_inc_func (ClutterAlpha *alpha, - gpointer dummy) -{ - ClutterTimeline * timeline; - gint frame; - gint n_frames; - ClutterAngle x; - ClutterFixed sine; - - timeline = clutter_alpha_get_timeline (alpha); - frame = clutter_timeline_get_current_frame (timeline); - n_frames = clutter_timeline_get_n_frames (timeline); + if (t == 0) + return 0.0; - x = 256 * frame / n_frames; + if (t == d) + return 1.0; - sine = clutter_sini (x) * CLUTTER_ALPHA_MAX_ALPHA; + if ((t /= d / 2) < 1) + return 0.5 * pow (2, 10 * (t - 1)); - return ((guint32)sine) >> CFX_Q; + return 0.5 * (-pow (2, -10 * --t) + 2); } -/** - * CLUTTER_ALPHA_SINE_DEC: - * - * Convenience symbol for clutter_sine_dec_func(). - * - * Since: 0.2 - */ +static gdouble +clutter_ease_in_circ (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); -/** - * clutter_sine_dec_func: - * @alpha: a #ClutterAlpha - * @dummy: unused argument - * - * Convenience alpha function for a sine wave over interval [pi / 2, pi]. - * You can use this function as the alpha function for - * clutter_alpha_set_func(). - * - * Return value: an alpha value. - * - * Since: 0.4 - */ -guint32 -clutter_sine_dec_func (ClutterAlpha *alpha, - gpointer dummy) + return -1.0 * (sqrt (1 - (t /= d) * t) - 1); +} + +static gdouble +clutter_ease_out_circ (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) { - ClutterTimeline * timeline; - gint frame; - gint n_frames; - ClutterAngle x; - ClutterFixed sine; - - timeline = clutter_alpha_get_timeline (alpha); - frame = clutter_timeline_get_current_frame (timeline); - n_frames = clutter_timeline_get_n_frames (timeline); + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); - x = 256 * frame / n_frames + 256; + return sqrt (1 - (t = t / d - 1) * t); +} + +static gdouble +clutter_ease_in_out_circ (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); - sine = clutter_sini (x) * CLUTTER_ALPHA_MAX_ALPHA; + if ((t /= d / 2) < 1) + return -0.5 * (sqrt (1 - t * t) - 1); - return ((guint32)sine) >> CFX_Q; + return 0.5 * (sqrt (1 - (t -= 2) * t) + 1); } -/** - * CLUTTER_ALPHA_SINE_HALF: - * - * Convenience symbol for clutter_sine_half_func(). - * - * Since: 0.4 - */ +static gdouble +clutter_ease_in_elastic (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); + gdouble p = d * .3; + gdouble s = p / 4; -/** - * clutter_sine_half_func: - * @alpha: a #ClutterAlpha - * @dummy: unused argument - * - * Convenience alpha function for a sine wave over interval [0, pi]. - * You can use this function as the alpha function for - * clutter_alpha_set_func(). - * - * Return value: an alpha value. - * - * Since: 0.4 - */ -guint32 -clutter_sine_half_func (ClutterAlpha *alpha, - gpointer dummy) + if ((t /= d) == 1) + return 1.0; + + return -(pow (2, 10 * (t -= 1)) * sin ((t * d - s) * (2 * G_PI) / p)); +} + +static gdouble +clutter_ease_out_elastic (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) { - ClutterTimeline * timeline; - gint frame; - gint n_frames; - ClutterAngle x; - ClutterFixed sine; - - timeline = clutter_alpha_get_timeline (alpha); - frame = clutter_timeline_get_current_frame (timeline); - n_frames = clutter_timeline_get_n_frames (timeline); + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); + gdouble p = d * .3; + gdouble s = p / 4; + + if ((t /= d) == 1) + return 1.0; + + return pow (2, -10 * t) * sin ((t * d - s) * (2 * G_PI) / p) + 1.0; +} - x = 512 * frame / n_frames; +static gdouble +clutter_ease_in_out_elastic (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); + gdouble p = d * (.3 * 1.5); + gdouble s = p / 4; - sine = clutter_sini (x) * CLUTTER_ALPHA_MAX_ALPHA; + if ((t /= d / 2) == 2) + return 1.0; - return ((guint32)sine) >> CFX_Q; + if (t < 1) + return -.5 * (pow (2, 10 * (t -= 1)) * sin ((t * d - s) * (2 * G_PI) / p)); + else + { + return pow (2, -10 * (t -= 1)) + * sin ((t * d - s) * (2 * G_PI) / p) + * .5 + 1.0; + } } -/** - * CLUTTER_ALPHA_SQUARE: - * - * Convenience symbol for clutter_square_func(). - * - * Since: 0.4 - */ +static gdouble +clutter_ease_in_back (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); -/** - * clutter_square_func: - * @alpha: a #ClutterAlpha - * @dummy: unused argument - * - * Convenience alpha function for a square wave. You can use this - * function as the alpha function for clutter_alpha_set_func(). - * - * Return value: an alpha value - * - * Since: 0.4 - */ -guint32 -clutter_square_func (ClutterAlpha *alpha, - gpointer dummy) + return (t /= d) * t * ((1.70158 + 1) * t - 1.70158); +} + +static gdouble +clutter_ease_out_back (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) { - ClutterTimeline *timeline; - gint current_frame_num, n_frames; + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); - timeline = clutter_alpha_get_timeline (alpha); + return (t = t / d - 1) * t * ((1.70158 + 1) * t + 1.70158) + 1; +} - current_frame_num = clutter_timeline_get_current_frame (timeline); - n_frames = clutter_timeline_get_n_frames (timeline); +static gdouble +clutter_ease_in_out_back (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); + gdouble s = 1.70158; + + if ((t /= d / 2) < 1) + return 0.5 * (t * t * (((s *= (1.525)) + 1) * t - s)); - return (current_frame_num > (n_frames / 2)) ? CLUTTER_ALPHA_MAX_ALPHA - : 0; + return 0.5 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2); } -/** - * CLUTTER_ALPHA_SMOOTHSTEP_INC: - * - * Convenience symbol for clutter_smoothstep_inc_func(). - * - * Since: 0.4 - */ +static gdouble +ease_out_bounce_internal (gdouble t, + gdouble d) +{ + if ((t /= d) < (1 / 2.75)) + return 7.5625 * t * t; + else if (t < (2 / 2.75)) + return 7.5625 * (t -= (1.5 / 2.75)) * t + .75; + else if (t < (2.5 / 2.75)) + return 7.5625 * (t -= (2.25 / 2.75)) * t + .9375; + else + return 7.5625 * (t -= (2.625 / 2.75)) * t + .984375; +} -/** - * clutter_smoothstep_inc_func: - * @alpha: a #ClutterAlpha - * @dummy: unused - * - * Convenience alpha function for a smoothstep curve. You can use this - * function as the alpha function for clutter_alpha_set_func(). - * - * Return value: an alpha value - * - * Since: 0.4 - */ -guint32 -clutter_smoothstep_inc_func (ClutterAlpha *alpha, - gpointer dummy) -{ - ClutterTimeline *timeline; - gint frame; - gint n_frames; - guint32 r; - guint32 x; - - /* - * The smoothstep function uses f(x) = -2x^3 + 3x^2 where x is from <0,1>, - * and precission is critical -- we use 8.24 fixed format for this operation. - * The earlier operations involve division, which we cannot do in 8.24 for - * numbers in <0,1> we use ClutterFixed. - */ - timeline = clutter_alpha_get_timeline (alpha); - frame = clutter_timeline_get_current_frame (timeline); - n_frames = clutter_timeline_get_n_frames (timeline); +static gdouble +ease_in_bounce_internal (gdouble t, + gdouble d) +{ + return 1.0 - ease_out_bounce_internal (d - t, d); +} - /* - * Convert x to 8.24 for next step. - */ - x = CFX_DIV (frame, n_frames) << 8; +static gdouble +clutter_ease_in_bounce (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); - /* - * f(x) = -2x^3 + 3x^2 - * - * Convert result to ClutterFixed to avoid overflow in next step. - */ - r = ((x >> 12) * (x >> 12) * 3 - (x >> 15) * (x >> 16) * (x >> 16)) >> 8; + return ease_in_bounce_internal (t, d); +} - return CFX_INT (r * CLUTTER_ALPHA_MAX_ALPHA); +static gdouble +clutter_ease_out_bounce (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); + + return ease_out_bounce_internal (t, d); } -/** - * CLUTTER_ALPHA_SMOOTHSTEP_DEC: - * - * Convenience symbol for clutter_smoothstep_dec_func(). +static gdouble +clutter_ease_in_out_bounce (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = alpha->priv->timeline; + gdouble t = clutter_timeline_get_current_frame (timeline); + gdouble d = clutter_timeline_get_n_frames (timeline); + + if (t < d / 2) + return ease_in_bounce_internal (t * 2, d) * 0.5; + else + return ease_out_bounce_internal (t * 2 - d, d) * 0.5 + 1.0 * 0.5; +} + +/* static enum/function mapping table for the animation modes + * we provide internally * - * Since: 0.4 + * XXX - keep in sync with ClutterAnimationMode */ +static const struct { + gulong mode; + ClutterAlphaFunc func; +} animation_modes[] = { + { CLUTTER_CUSTOM_MODE, NULL }, + + { CLUTTER_LINEAR, clutter_linear }, + { CLUTTER_EASE_IN_QUAD, clutter_ease_in_quad }, + { CLUTTER_EASE_OUT_QUAD, clutter_ease_out_quad }, + { CLUTTER_EASE_IN_OUT_QUAD, clutter_ease_in_out_quad }, + { CLUTTER_EASE_IN_CUBIC, clutter_ease_in_cubic }, + { CLUTTER_EASE_OUT_CUBIC, clutter_ease_out_cubic }, + { CLUTTER_EASE_IN_OUT_CUBIC, clutter_ease_in_out_cubic }, + { CLUTTER_EASE_IN_QUART, clutter_ease_in_quart }, + { CLUTTER_EASE_OUT_QUART, clutter_ease_out_quart }, + { CLUTTER_EASE_IN_OUT_QUART, clutter_ease_in_out_quart }, + { CLUTTER_EASE_IN_QUINT, clutter_ease_in_quint }, + { CLUTTER_EASE_OUT_QUINT, clutter_ease_out_quint }, + { CLUTTER_EASE_IN_OUT_QUINT, clutter_ease_in_out_quint }, + { CLUTTER_EASE_IN_SINE, clutter_ease_in_sine }, + { CLUTTER_EASE_OUT_SINE, clutter_ease_out_sine }, + { CLUTTER_EASE_IN_OUT_SINE, clutter_ease_in_out_sine }, + { CLUTTER_EASE_IN_EXPO, clutter_ease_in_expo }, + { CLUTTER_EASE_OUT_EXPO, clutter_ease_out_expo }, + { CLUTTER_EASE_IN_OUT_EXPO, clutter_ease_in_out_expo }, + { CLUTTER_EASE_IN_CIRC, clutter_ease_in_circ }, + { CLUTTER_EASE_OUT_CIRC, clutter_ease_out_circ }, + { CLUTTER_EASE_IN_OUT_CIRC, clutter_ease_in_out_circ }, + { CLUTTER_EASE_IN_ELASTIC, clutter_ease_in_elastic }, + { CLUTTER_EASE_OUT_ELASTIC, clutter_ease_out_elastic }, + { CLUTTER_EASE_IN_OUT_ELASTIC, clutter_ease_in_out_elastic }, + { CLUTTER_EASE_IN_BACK, clutter_ease_in_back }, + { CLUTTER_EASE_OUT_BACK, clutter_ease_out_back }, + { CLUTTER_EASE_IN_OUT_BACK, clutter_ease_in_out_back }, + { CLUTTER_EASE_IN_BOUNCE, clutter_ease_in_bounce }, + { CLUTTER_EASE_OUT_BOUNCE, clutter_ease_out_bounce }, + { CLUTTER_EASE_IN_OUT_BOUNCE, clutter_ease_in_out_bounce }, + + { CLUTTER_ANIMATION_LAST, NULL }, +}; + +typedef struct _AlphaData { + guint closure_set : 1; + + ClutterAlphaFunc func; + gpointer data; + + GClosure *closure; +} AlphaData; + +static GPtrArray *clutter_alphas = NULL; /** - * clutter_smoothstep_dec_func: + * clutter_alpha_set_mode: * @alpha: a #ClutterAlpha - * @dummy: unused + * @mode: a #ClutterAnimationMode * - * Convenience alpha function for a downward smoothstep curve. You can use - * this function as the alpha function for clutter_alpha_set_func(). + * Sets the progress function of @alpha using the symbolic value + * of @mode, as taken by the #ClutterAnimationMode enumeration or + * using the value returned by clutter_alpha_register_func(). * - * Return value: an alpha value - * - * Since: 0.4 + * Since: 1.0 */ -guint32 -clutter_smoothstep_dec_func (ClutterAlpha *alpha, - gpointer dummy) +void +clutter_alpha_set_mode (ClutterAlpha *alpha, + gulong mode) { - return CLUTTER_ALPHA_MAX_ALPHA - clutter_smoothstep_inc_func (alpha, dummy); + ClutterAlphaPrivate *priv; + + g_return_if_fail (CLUTTER_IS_ALPHA (alpha)); + g_return_if_fail (mode != CLUTTER_ANIMATION_LAST); + + priv = alpha->priv; + + if (mode == CLUTTER_CUSTOM_MODE) + { + priv->mode = mode; + } + else if (mode < CLUTTER_ANIMATION_LAST) + { + GClosure *closure; + + /* sanity check to avoid getting an out of sync + * enum/function mapping + */ + g_assert (animation_modes[mode].mode == mode); + g_assert (animation_modes[mode].func != NULL); + + closure = g_cclosure_new (G_CALLBACK (animation_modes[mode].func), + NULL, + NULL); + clutter_alpha_set_closure_internal (alpha, closure); + + priv->mode = mode; + } + else if (mode > CLUTTER_ANIMATION_LAST) + { + AlphaData *alpha_data = NULL; + gulong real_index = 0; + + if (G_UNLIKELY (clutter_alphas == NULL)) + { + g_warning ("No alpha functions defined for ClutterAlpha to use. " + "Use clutter_alpha_register_func() to register an " + "alpha function."); + return; + } + + real_index = mode - CLUTTER_ANIMATION_LAST - 1; + + alpha_data = g_ptr_array_index (clutter_alphas, real_index); + if (G_UNLIKELY (alpha_data == NULL)) + { + g_warning ("No alpha function registered for mode %lu.", + mode); + return; + } + + if (alpha_data->closure_set) + clutter_alpha_set_closure (alpha, alpha_data->closure); + else + { + GClosure *closure; + + closure = g_cclosure_new (G_CALLBACK (alpha_data->func), + alpha_data->data, + NULL); + clutter_alpha_set_closure_internal (alpha, closure); + } + + priv->mode = mode; + } + else + g_assert_not_reached (); + + g_object_notify (G_OBJECT (alpha), "mode"); } -/** - * CLUTTER_ALPHA_EXP_INC: - * - * Convenience symbol for clutter_exp_inc_func() - * - * Since: 0.4 - */ +static gulong +register_alpha_internal (AlphaData *alpha_data) +{ + if (G_UNLIKELY (clutter_alphas == NULL)) + clutter_alphas = g_ptr_array_new (); + + g_ptr_array_add (clutter_alphas, alpha_data); + + return clutter_alphas->len + CLUTTER_ANIMATION_LAST; +} /** - * clutter_exp_inc_func: - * @alpha: a #ClutterAlpha - * @dummy: unused argument + * clutter_alpha_register_func: + * @func: a #ClutterAlphaFunc + * @data: user data to pass to @func, or %NULL + * + * Registers a global alpha function and returns its logical id + * to be used by clutter_alpha_set_mode() or by #ClutterAnimation. * - * Convenience alpha function for a 2^x curve. You can use this function as the - * alpha function for clutter_alpha_set_func(). + * The logical id is always greater than %CLUTTER_ANIMATION_LAST. * - * Return value: an alpha value. + * Return value: the logical id of the alpha function * - * Since: 0.4 + * Since: 1.0 */ -guint32 -clutter_exp_inc_func (ClutterAlpha *alpha, - gpointer dummy) +gulong +clutter_alpha_register_func (ClutterAlphaFunc func, + gpointer data) { - ClutterTimeline * timeline; - gint frame; - gint n_frames; - ClutterFixed x; - ClutterFixed x_alpha_max = 0x100000; - guint32 result; - - /* - * Choose x_alpha_max such that - * - * (2^x_alpha_max) - 1 == CLUTTER_ALPHA_MAX_ALPHA - */ -#if CLUTTER_ALPHA_MAX_ALPHA != 0xffff -#error Adjust x_alpha_max to match CLUTTER_ALPHA_MAX_ALPHA -#endif - - timeline = clutter_alpha_get_timeline (alpha); - frame = clutter_timeline_get_current_frame (timeline); - n_frames = clutter_timeline_get_n_frames (timeline); + AlphaData *alpha_data; - x = x_alpha_max * frame / n_frames; + g_return_val_if_fail (func != NULL, 0); - result = CLAMP (clutter_pow2x (x) - 1, 0, CLUTTER_ALPHA_MAX_ALPHA); + alpha_data = g_slice_new (AlphaData); + alpha_data->closure_set = FALSE; + alpha_data->func = func; + alpha_data->data = data; - return result; + return register_alpha_internal (alpha_data); } /** - * CLUTTER_ALPHA_EXP_DEC: + * clutter_alpha_register_closure: + * @closure: a #GClosure * - * Convenience symbold for clutter_exp_dec_func(). + * #GClosure variant of clutter_alpha_register_func(). * - * Since: 0.4 - */ - -/** - * clutter_exp_dec_func: - * @alpha: a #ClutterAlpha - * @dummy: unused argument + * Registers a global alpha function and returns its logical id + * to be used by clutter_alpha_set_mode() or by #ClutterAnimation. * - * Convenience alpha function for a decreasing 2^x curve. You can use this - * function as the alpha function for clutter_alpha_set_func(). + * The logical id is always greater than %CLUTTER_ANIMATION_LAST. * - * Return value: an alpha value. + * Return value: the logical id of the alpha function * - * Since: 0.4 + * Since: 1.0 */ -guint32 -clutter_exp_dec_func (ClutterAlpha *alpha, - gpointer dummy) +gulong +clutter_alpha_register_closure (GClosure *closure) { - ClutterTimeline * timeline; - gint frame; - gint n_frames; - ClutterFixed x; - ClutterFixed x_alpha_max = 0x100000; - guint32 result; - - /* - * Choose x_alpha_max such that - * - * (2^x_alpha_max) - 1 == CLUTTER_ALPHA_MAX_ALPHA - */ -#if CLUTTER_ALPHA_MAX_ALPHA != 0xffff -#error Adjust x_alpha_max to match CLUTTER_ALPHA_MAX_ALPHA -#endif - - timeline = clutter_alpha_get_timeline (alpha); - frame = clutter_timeline_get_current_frame (timeline); - n_frames = clutter_timeline_get_n_frames (timeline); + AlphaData *alpha_data; - x = (x_alpha_max * (n_frames - frame)) / n_frames; + g_return_val_if_fail (closure != NULL, 0); - result = CLAMP (clutter_pow2x (x) - 1, 0, CLUTTER_ALPHA_MAX_ALPHA); + alpha_data = g_slice_new (AlphaData); + alpha_data->closure_set = TRUE; + alpha_data->closure = closure; - return result; + return register_alpha_internal (alpha_data); } diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-alpha.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-alpha.h --- clutter-0.8.4/clutter/clutter-alpha.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-alpha.h 2009-01-28 08:12:44.000000000 +0000 @@ -8,7 +8,8 @@ * Emmanuele Bassi * Tomas Frydrych * - * Copyright (C) 2006, 2007 OpenedHand + * Copyright (C) 2006, 2007, 2008 OpenedHand + * Copyright (C) 2009 Intel Corp. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -21,60 +22,45 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __CLUTTER_ALPHA_H__ #define __CLUTTER_ALPHA_H__ -#include #include -#include +#include G_BEGIN_DECLS -#define CLUTTER_TYPE_ALPHA clutter_alpha_get_type() - -#define CLUTTER_ALPHA(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - CLUTTER_TYPE_ALPHA, ClutterAlpha)) - -#define CLUTTER_ALPHA_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - CLUTTER_TYPE_ALPHA, ClutterAlphaClass)) - -#define CLUTTER_IS_ALPHA(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - CLUTTER_TYPE_ALPHA)) - -#define CLUTTER_IS_ALPHA_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - CLUTTER_TYPE_ALPHA)) - -#define CLUTTER_ALPHA_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - CLUTTER_TYPE_ALPHA, ClutterAlphaClass)) - -typedef struct _ClutterAlpha ClutterAlpha; -typedef struct _ClutterAlphaClass ClutterAlphaClass; -typedef struct _ClutterAlphaPrivate ClutterAlphaPrivate; +#define CLUTTER_TYPE_ALPHA (clutter_alpha_get_type ()) +#define CLUTTER_ALPHA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ALPHA, ClutterAlpha)) +#define CLUTTER_ALPHA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_ALPHA, ClutterAlphaClass)) +#define CLUTTER_IS_ALPHA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ALPHA)) +#define CLUTTER_IS_ALPHA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_ALPHA)) +#define CLUTTER_ALPHA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_ALPHA, ClutterAlphaClass)) + +typedef struct _ClutterAlpha ClutterAlpha; +typedef struct _ClutterAlphaClass ClutterAlphaClass; +typedef struct _ClutterAlphaPrivate ClutterAlphaPrivate; /** * ClutterAlphaFunc: * @alpha: a #ClutterAlpha * @user_data: user data passed to the function * - * A function of time, which returns a value between 0 and - * %CLUTTER_ALPHA_MAX_ALPHA. + * A function returning a value depending on the position of + * the #ClutterTimeline bound to @alpha. * - * Return value: an unsigned integer value, between 0 and - * %CLUTTER_ALPHA_MAX_ALPHA. + * Return value: a floating point value * * Since: 0.2 */ -typedef guint32 (*ClutterAlphaFunc) (ClutterAlpha *alpha, +typedef gdouble (*ClutterAlphaFunc) (ClutterAlpha *alpha, gpointer user_data); /** @@ -90,6 +76,7 @@ { /*< private >*/ GInitiallyUnowned parent; + ClutterAlphaPrivate *priv; }; @@ -112,71 +99,33 @@ void (*_clutter_alpha_5) (void); }; -/** - * CLUTTER_ALPHA_MAX_ALPHA: - * - * Maximum value returned by #ClutterAlphaFunc - * - * Since: 0.2 - */ -#define CLUTTER_ALPHA_MAX_ALPHA 0xffff - GType clutter_alpha_get_type (void) G_GNUC_CONST; -ClutterAlpha * clutter_alpha_new (void); -ClutterAlpha * clutter_alpha_new_full (ClutterTimeline *timeline, - ClutterAlphaFunc func, - gpointer data, - GDestroyNotify destroy); -guint32 clutter_alpha_get_alpha (ClutterAlpha *alpha); -void clutter_alpha_set_func (ClutterAlpha *alpha, - ClutterAlphaFunc func, - gpointer data, - GDestroyNotify destroy); -void clutter_alpha_set_closure (ClutterAlpha *alpha, - GClosure *closure); -void clutter_alpha_set_timeline (ClutterAlpha *alpha, - ClutterTimeline *timeline); -ClutterTimeline *clutter_alpha_get_timeline (ClutterAlpha *alpha); - -/* convenience functions */ -#define CLUTTER_ALPHA_RAMP_INC clutter_ramp_inc_func -#define CLUTTER_ALPHA_RAMP_DEC clutter_ramp_dec_func -#define CLUTTER_ALPHA_RAMP clutter_ramp_func -#define CLUTTER_ALPHA_SINE clutter_sine_func -#define CLUTTER_ALPHA_SINE_INC clutter_sine_inc_func -#define CLUTTER_ALPHA_SINE_DEC clutter_sine_dec_func -#define CLUTTER_ALPHA_SINE_HALF clutter_sine_half_func -#define CLUTTER_ALPHA_SQUARE clutter_square_func -#define CLUTTER_ALPHA_SMOOTHSTEP_INC clutter_smoothstep_inc_func -#define CLUTTER_ALPHA_SMOOTHSTEP_DEC clutter_smoothstep_dec_func -#define CLUTTER_ALPHA_EXP_INC clutter_exp_inc_func -#define CLUTTER_ALPHA_EXP_DEC clutter_exp_dec_func - -guint32 clutter_ramp_inc_func (ClutterAlpha *alpha, - gpointer dummy); -guint32 clutter_ramp_dec_func (ClutterAlpha *alpha, - gpointer dummy); -guint32 clutter_ramp_func (ClutterAlpha *alpha, - gpointer dummy); -guint32 clutter_sine_func (ClutterAlpha *alpha, - gpointer dummy); -guint32 clutter_sine_inc_func (ClutterAlpha *alpha, - gpointer dummy); -guint32 clutter_sine_dec_func (ClutterAlpha *alpha, - gpointer dummy); -guint32 clutter_sine_half_func (ClutterAlpha *alpha, - gpointer dummy); -guint32 clutter_square_func (ClutterAlpha *alpha, - gpointer dummy); -guint32 clutter_smoothstep_inc_func (ClutterAlpha *alpha, - gpointer dummy); -guint32 clutter_smoothstep_dec_func (ClutterAlpha *alpha, - gpointer dummy); -guint32 clutter_exp_inc_func (ClutterAlpha *alpha, - gpointer dummy); -guint32 clutter_exp_dec_func (ClutterAlpha *alpha, - gpointer dummy); +ClutterAlpha * clutter_alpha_new (void); +ClutterAlpha * clutter_alpha_new_full (ClutterTimeline *timeline, + gulong mode); +ClutterAlpha * clutter_alpha_new_with_func (ClutterTimeline *timeline, + ClutterAlphaFunc func, + gpointer data, + GDestroyNotify destroy); + +gdouble clutter_alpha_get_alpha (ClutterAlpha *alpha); +void clutter_alpha_set_func (ClutterAlpha *alpha, + ClutterAlphaFunc func, + gpointer data, + GDestroyNotify destroy); +void clutter_alpha_set_closure (ClutterAlpha *alpha, + GClosure *closure); +void clutter_alpha_set_timeline (ClutterAlpha *alpha, + ClutterTimeline *timeline); +ClutterTimeline *clutter_alpha_get_timeline (ClutterAlpha *alpha); +void clutter_alpha_set_mode (ClutterAlpha *alpha, + gulong mode); +gulong clutter_alpha_get_mode (ClutterAlpha *alpha); + +gulong clutter_alpha_register_func (ClutterAlphaFunc func, + gpointer data); +gulong clutter_alpha_register_closure (GClosure *closure); G_END_DECLS diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-animatable.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-animatable.c --- clutter-0.8.4/clutter/clutter-animatable.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-animatable.c 2009-01-28 08:12:44.000000000 +0000 @@ -0,0 +1,117 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Copyright (C) 2009 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 . + * + * Author: + * Emmanuele Bassi + */ + +/** + * SECTION:clutter-animatable + * @short_description: Interface for animatable classes + * + * #ClutterAnimatable is an interface that allows a #GObject class + * to control how a #ClutterAnimation will animate a property. + * + * Each #ClutterAnimatable should implement the animate_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. + * + * If a #ClutterAnimatable is animated by a #ClutterAnimation + * instance, the #ClutterAnimation will call + * clutter_animatable_animate_property() passing the name of the + * currently animated property; the initial and final values of + * the animation interval; the progress factor. The #ClutterAnimatable + * implementation should return the computed value for the animated + * property. + * + * #ClutterAnimatable is available since Clutter 1.0 + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "clutter-animatable.h" +#include "clutter-debug.h" +#include "clutter-private.h" + +GType +clutter_animatable_get_type (void) +{ + static GType a_type = 0; + + if (G_UNLIKELY (a_type == 0)) + a_type = g_type_register_static_simple (G_TYPE_INTERFACE, + I_("ClutterAnimatable"), + sizeof (ClutterAnimatableIface), + NULL, 0, NULL, 0); + + return a_type; +} + +/** + * clutter_animatable_animate_property: + * @animatable: a #ClutterAnimatable + * @animation: a #ClutterAnimation + * @property_name: the name of the animated property + * @initial_value: the initial value of the animation interval + * @final_value: the final value of the animation interval + * @progress: the progress factor + * @value: return location for the animation value + * + * Calls the animate_property() virtual function for @animatable. + * + * The @initial_value and @final_value #GValues must contain + * the same type; @value must have been initialized to the same + * type of @initial_value and @final_value. + * + * All implementation of the #ClutterAnimatable interface must + * implement this function. + * + * Since: 1.0 + */ +void +clutter_animatable_animate_property (ClutterAnimatable *animatable, + ClutterAnimation *animation, + const gchar *property_name, + const GValue *initial_value, + const GValue *final_value, + gdouble progress, + GValue *value) +{ + g_return_if_fail (CLUTTER_IS_ANIMATABLE (animatable)); + g_return_if_fail (CLUTTER_IS_ANIMATION (animation)); + g_return_if_fail (property_name != NULL); + g_return_if_fail (initial_value != NULL && final_value != NULL); + g_return_if_fail (G_VALUE_TYPE (initial_value) != G_TYPE_INVALID); + g_return_if_fail (G_VALUE_TYPE (final_value) != G_TYPE_INVALID); + g_return_if_fail (value != NULL); + g_return_if_fail (G_VALUE_TYPE (value) == G_VALUE_TYPE (initial_value) && + G_VALUE_TYPE (value) == G_VALUE_TYPE (final_value)); + + CLUTTER_ANIMATABLE_GET_IFACE (animatable)->animate_property (animatable, + animation, + property_name, + initial_value, + final_value, + progress, + value); +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-animatable.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-animatable.h --- clutter-0.8.4/clutter/clutter-animatable.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-animatable.h 2009-01-28 08:12:44.000000000 +0000 @@ -0,0 +1,80 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Copyright (C) 2009 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 . + * + * Author: + * Emmanuele Bassi + */ + +#ifndef __CLUTTER_ANIMATABLE_H__ +#define __CLUTTER_ANIMATABLE_H__ + +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#include + +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)) + +typedef struct _ClutterAnimatable ClutterAnimatable; /* dummy typedef */ +typedef struct _ClutterAnimatableIface ClutterAnimatableIface; + +/** + * ClutterAnimatableIface: + * @animate_property: virtual function for animating a property + * + * Base interface for #GObjects that can be animated by a + * a #ClutterAnimation. + * + * Since: 1.0 + */ +struct _ClutterAnimatableIface +{ + /*< private >*/ + GTypeInterface parent_iface; + + /*< public >*/ + void (* animate_property) (ClutterAnimatable *animatable, + ClutterAnimation *animation, + const gchar *property_name, + const GValue *initial_value, + const GValue *final_value, + gdouble progress, + GValue *value); +}; + +GType clutter_animatable_get_type (void) G_GNUC_CONST; + +void clutter_animatable_animate_property (ClutterAnimatable *animatable, + ClutterAnimation *animation, + const gchar *property_name, + const GValue *initial_value, + const GValue *final_value, + gdouble progress, + GValue *value); + +G_END_DECLS + +#endif /* __CLUTTER_ANIMATABLE_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-animation.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-animation.c --- clutter-0.8.4/clutter/clutter-animation.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-animation.c 2009-01-28 08:12:44.000000000 +0000 @@ -0,0 +1,1466 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Copyright (C) 2008 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 . + * + * Author: + * Emmanuele Bassi + */ + +/** + * SECTION:clutter-animation + * @short_description: Simple implicit animations + * + * #ClutterAnimation is an object providing simple, implicit animations + * for #GObjects. + * + * #ClutterAnimation instances will bind a #GObject property belonging + * to a #GObject to a #ClutterInterval, and will then use a #ClutterTimeline + * to interpolate the property between the initial and final values of the + * interval. + * + * For convenience, it is possible to use the clutter_actor_animate() + * function call which will take care of setting up and tearing down + * a #ClutterAnimation instance and animate an actor between its current + * state and the specified final state. + * + * #ClutterAnimation is available since Clutter 1.0 + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include "clutter-alpha.h" +#include "clutter-animatable.h" +#include "clutter-animation.h" +#include "clutter-debug.h" +#include "clutter-enum-types.h" +#include "clutter-interval.h" +#include "clutter-private.h" + +enum +{ + PROP_0, + + PROP_OBJECT, + PROP_MODE, + PROP_DURATION, + PROP_LOOP, + PROP_TIMELINE, + PROP_ALPHA +}; + +enum +{ + COMPLETED, + + LAST_SIGNAL +}; + +#define CLUTTER_ANIMATION_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_ANIMATION, ClutterAnimationPrivate)) + +struct _ClutterAnimationPrivate +{ + GObject *object; + + GHashTable *properties; + + gulong mode; + + guint loop : 1; + guint duration; + ClutterTimeline *timeline; + guint timeline_completed_id; + + ClutterAlpha *alpha; + guint alpha_notify_id; +}; + +static guint animation_signals[LAST_SIGNAL] = { 0, }; + +static GQuark quark_object_animation = 0; + +G_DEFINE_TYPE (ClutterAnimation, clutter_animation, G_TYPE_INITIALLY_UNOWNED); + +static void on_animation_weak_notify (gpointer data, + GObject *animation_pointer); + +static void +clutter_animation_finalize (GObject *gobject) +{ + ClutterAnimationPrivate *priv = CLUTTER_ANIMATION (gobject)->priv; + + g_hash_table_destroy (priv->properties); + + G_OBJECT_CLASS (clutter_animation_parent_class)->finalize (gobject); +} + +static void +clutter_animation_dispose (GObject *gobject) +{ + ClutterAnimationPrivate *priv = CLUTTER_ANIMATION (gobject)->priv; + + if (priv->object) + { + g_object_weak_unref (G_OBJECT (gobject), + on_animation_weak_notify, + priv->object); + g_object_set_qdata (priv->object, quark_object_animation, NULL); + g_object_unref (priv->object); + priv->object = NULL; + } + + if (priv->timeline) + { + if (priv->timeline_completed_id) + { + g_signal_handler_disconnect (priv->timeline, + priv->timeline_completed_id); + priv->timeline_completed_id = 0; + } + + g_object_unref (priv->timeline); + priv->timeline = NULL; + } + + if (priv->alpha) + { + if (priv->alpha_notify_id) + { + g_signal_handler_disconnect (priv->alpha, priv->alpha_notify_id); + priv->alpha_notify_id = 0; + } + + g_object_unref (priv->alpha); + priv->alpha = NULL; + } + + G_OBJECT_CLASS (clutter_animation_parent_class)->dispose (gobject); +} + +static void +clutter_animation_set_property (GObject *gobject, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + ClutterAnimation *animation = CLUTTER_ANIMATION (gobject); + + switch (prop_id) + { + case PROP_OBJECT: + clutter_animation_set_object (animation, g_value_get_object (value)); + break; + + case PROP_MODE: + clutter_animation_set_mode (animation, g_value_get_ulong (value)); + break; + + case PROP_DURATION: + clutter_animation_set_duration (animation, g_value_get_uint (value)); + break; + + case PROP_LOOP: + clutter_animation_set_loop (animation, g_value_get_boolean (value)); + break; + + case PROP_TIMELINE: + clutter_animation_set_timeline (animation, g_value_get_object (value)); + break; + + case PROP_ALPHA: + clutter_animation_set_alpha (animation, g_value_get_object (value)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +clutter_animation_get_property (GObject *gobject, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + ClutterAnimationPrivate *priv = CLUTTER_ANIMATION (gobject)->priv; + + switch (prop_id) + { + case PROP_OBJECT: + g_value_set_object (value, priv->object); + break; + + case PROP_MODE: + g_value_set_ulong (value, priv->mode); + break; + + case PROP_DURATION: + g_value_set_uint (value, priv->duration); + break; + + case PROP_LOOP: + g_value_set_boolean (value, priv->loop); + break; + + case PROP_TIMELINE: + g_value_set_object (value, priv->timeline); + break; + + case PROP_ALPHA: + g_value_set_object (value, priv->alpha); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +clutter_animation_real_completed (ClutterAnimation *animation) +{ + CLUTTER_NOTE (ANIMATION, "Animation [%p] complete: unreffing", + animation); + + g_object_unref (animation); +} + +static void +clutter_animation_class_init (ClutterAnimationClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GParamSpec *pspec; + + quark_object_animation = + g_quark_from_static_string ("clutter-actor-animation"); + + g_type_class_add_private (klass, sizeof (ClutterAnimationPrivate)); + + klass->completed = clutter_animation_real_completed; + + gobject_class->set_property = clutter_animation_set_property; + gobject_class->get_property = clutter_animation_get_property; + gobject_class->dispose = clutter_animation_dispose; + gobject_class->finalize = clutter_animation_finalize; + + /** + * ClutterAnimation:objct: + * + * The #GObject to which the animation applies. + * + * Since: 1.0 + */ + pspec = g_param_spec_object ("object", + "Object", + "Object to which the animation applies", + G_TYPE_OBJECT, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_OBJECT, pspec); + + /** + * ClutterAnimation:mode: + * + * The animation mode, either a value from #ClutterAnimationMode + * or a value returned by clutter_alpha_register_func(). The + * default value is %CLUTTER_LINEAR. + * + * Since: 1.0 + */ + pspec = g_param_spec_ulong ("mode", + "Mode", + "The mode of the animation", + 0, G_MAXULONG, + CLUTTER_LINEAR, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_MODE, pspec); + + /** + * ClutterAnimation:duration: + * + * The duration of the animation, expressed in milliseconds. + * + * Since: 1.0 + */ + pspec = g_param_spec_uint ("duration", + "Duration", + "Duration of the animation, in milliseconds", + 0, G_MAXUINT, 0, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_DURATION, pspec); + + /** + * ClutterAnimation:loop: + * + * Whether the animation should loop. + * + * Since: 1.0 + */ + pspec = g_param_spec_boolean ("loop", + "Loop", + "Whether the animation should loop", + FALSE, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_LOOP, pspec); + + /** + * ClutterAnimation:timeline: + * + * The #ClutterTimeline used by the animation. + * + * Since: 1.0 + */ + pspec = g_param_spec_object ("timeline", + "Timeline", + "The timeline used by the animation", + CLUTTER_TYPE_TIMELINE, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_TIMELINE, pspec); + + /** + * ClutterAnimation:alpha: + * + * The #ClutterAlpha used by the animation. + * + * Since: 1.0 + */ + pspec = g_param_spec_object ("alpha", + "Alpha", + "The alpha used by the animation", + CLUTTER_TYPE_ALPHA, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_ALPHA, pspec); + + /** + * ClutterAniamtion::completed: + * @animation: the animation that emitted the signal + * + * The ::completed signal is emitted once the animation has + * been completed. + * + * Since: 1.0 + */ + animation_signals[COMPLETED] = + g_signal_new (I_("completed"), + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ClutterAnimationClass, completed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); +} + +static void +clutter_animation_init (ClutterAnimation *self) +{ + self->priv = CLUTTER_ANIMATION_GET_PRIVATE (self); + + self->priv->mode = CLUTTER_LINEAR; + self->priv->properties = + g_hash_table_new_full (g_str_hash, g_str_equal, + (GDestroyNotify) g_free, + (GDestroyNotify) g_object_unref); +} + +static inline void +clutter_animation_bind_property_internal (ClutterAnimation *animation, + GParamSpec *pspec, + ClutterInterval *interval) +{ + ClutterAnimationPrivate *priv = animation->priv; + + if (!clutter_interval_validate (interval, pspec)) + { + g_warning ("Cannot bind property `%s': the interval is out " + "of bounds", + pspec->name); + return; + } + + g_hash_table_insert (priv->properties, + g_strdup (pspec->name), + g_object_ref_sink (interval)); +} + +static inline void +clutter_animation_update_property_internal (ClutterAnimation *animation, + GParamSpec *pspec, + ClutterInterval *interval) +{ + ClutterAnimationPrivate *priv = animation->priv; + + if (!clutter_interval_validate (interval, pspec)) + { + g_warning ("Cannot bind property `%s': the interval is out " + "of bounds", + pspec->name); + return; + } + + g_hash_table_replace (priv->properties, + g_strdup (pspec->name), + g_object_ref_sink (interval)); +} + +/** + * clutter_animation_bind_property: + * @animation: a #ClutterAnimation + * @property_name: the property to control + * @interval: a #ClutterInterval + * + * Binds @interval to the @property_name of the #GObject + * attached to @animation. The #ClutterAnimation will take + * ownership of the passed #ClutterInterval. + * + * If you need to update the interval instance use + * clutter_animation_update_property() instead. + * + * Since: 1.0 + */ +void +clutter_animation_bind_property (ClutterAnimation *animation, + const gchar *property_name, + ClutterInterval *interval) +{ + ClutterAnimationPrivate *priv; + GObjectClass *klass; + GParamSpec *pspec; + + g_return_if_fail (CLUTTER_IS_ANIMATION (animation)); + g_return_if_fail (property_name != NULL); + g_return_if_fail (CLUTTER_IS_INTERVAL (interval)); + + priv = animation->priv; + + if (G_UNLIKELY (!priv->object)) + { + g_warning ("Cannot bind property `%s': the animation has no " + "object set. You need to call clutter_animation_set_object() " + "first to be able to bind a property", + property_name); + return; + } + + if (G_UNLIKELY (clutter_animation_has_property (animation, property_name))) + { + g_warning ("Cannot bind property `%s': the animation already has " + "a bound property with the same name", + property_name); + return; + } + + klass = G_OBJECT_GET_CLASS (priv->object); + pspec = g_object_class_find_property (klass, property_name); + if (!pspec) + { + g_warning ("Cannot bind property `%s': objects of type `%s' have " + "no such property", + property_name, + g_type_name (G_OBJECT_TYPE (priv->object))); + return; + } + + if (!(pspec->flags & G_PARAM_WRITABLE)) + { + g_warning ("Cannot bind property `%s': the property is not writable", + property_name); + return; + } + + if (!g_value_type_compatible (G_PARAM_SPEC_VALUE_TYPE (pspec), + clutter_interval_get_value_type (interval))) + { + g_warning ("Cannot bind property `%s': the interval value of " + "type `%s' is not compatible with the property value " + "of type `%s'", + property_name, + g_type_name (clutter_interval_get_value_type (interval)), + g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec))); + return; + } + + clutter_animation_bind_property_internal (animation, pspec, interval); +} + +/** + * clutter_animation_unbind_property: + * @animation: a #ClutterAnimation + * @property_name: name of the property + * + * Removes @property_name from the list of animated properties. + * + * Since: 1.0 + */ +void +clutter_animation_unbind_property (ClutterAnimation *animation, + const gchar *property_name) +{ + ClutterAnimationPrivate *priv; + + g_return_if_fail (CLUTTER_IS_ANIMATION (animation)); + g_return_if_fail (property_name != NULL); + + priv = animation->priv; + + if (!clutter_animation_has_property (animation, property_name)) + { + g_warning ("Cannot unbind property `%s': the animation has " + "no bound property with that name", + property_name); + return; + } + + g_hash_table_remove (priv->properties, property_name); +} + +/** + * clutter_animation_has_property: + * @animation: a #ClutterAnimation + * @property_name: name of the property + * + * Checks whether @animation is controlling @property_name. + * + * Return value: %TRUE if the property is animated by the + * #ClutterAnimation, %FALSE otherwise + * + * Since: 1.0 + */ +gboolean +clutter_animation_has_property (ClutterAnimation *animation, + const gchar *property_name) +{ + ClutterAnimationPrivate *priv; + + g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), FALSE); + g_return_val_if_fail (property_name != NULL, FALSE); + + priv = animation->priv; + + return g_hash_table_lookup (priv->properties, property_name) != NULL; +} + +/** + * clutter_animation_update_property: + * @animation: a #ClutterAnimation + * @property_name: name of the property + * @interval: a #ClutterInterval + * + * Changes the @interval for @property_name. The #ClutterAnimation + * will take ownership of the passed #ClutterInterval. + * + * Since: 1.0 + */ +void +clutter_animation_update_property (ClutterAnimation *animation, + const gchar *property_name, + ClutterInterval *interval) +{ + ClutterAnimationPrivate *priv; + GObjectClass *klass; + GParamSpec *pspec; + + g_return_if_fail (CLUTTER_IS_ANIMATION (animation)); + g_return_if_fail (property_name != NULL); + g_return_if_fail (CLUTTER_IS_INTERVAL (interval)); + + priv = animation->priv; + + if (!clutter_animation_has_property (animation, property_name)) + { + g_warning ("Cannot unbind property `%s': the animation has " + "no bound property with that name", + property_name); + return; + } + + klass = G_OBJECT_GET_CLASS (priv->object); + pspec = g_object_class_find_property (klass, property_name); + if (!pspec) + { + g_warning ("Cannot bind property `%s': objects of type `%s' have " + "no such property", + property_name, + g_type_name (G_OBJECT_TYPE (priv->object))); + return; + } + + if (!g_value_type_compatible (G_PARAM_SPEC_VALUE_TYPE (pspec), + clutter_interval_get_value_type (interval))) + { + g_warning ("Cannot bind property `%s': the interval value of " + "type `%s' is not compatible with the property value " + "of type `%s'", + property_name, + g_type_name (clutter_interval_get_value_type (interval)), + g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec))); + return; + } + + clutter_animation_update_property_internal (animation, pspec, interval); +} + +/** + * clutter_animation_get_interval: + * @animation: a #ClutterAnimation + * @property_name: name of the property + * + * Retrieves the #ClutterInterval associated to @property_name + * inside @animation. + * + * Return value: a #ClutterInterval or %NULL if no property with + * the same name was found. The returned interval is owned by + * the #ClutterAnimation and should not be unreferenced + * + * Since: 1.0 + */ +ClutterInterval * +clutter_animation_get_interval (ClutterAnimation *animation, + const gchar *property_name) +{ + ClutterAnimationPrivate *priv; + + g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), NULL); + g_return_val_if_fail (property_name != NULL, NULL); + + priv = animation->priv; + + return g_hash_table_lookup (priv->properties, property_name); +} + +static void +on_timeline_completed (ClutterTimeline *timeline, + ClutterAnimation *animation) +{ + CLUTTER_NOTE (ANIMATION, "Timeline [%p] complete", timeline); + + if (!animation->priv->loop) + g_signal_emit (animation, animation_signals[COMPLETED], 0); +} + +static void +on_alpha_notify (GObject *gobject, + GParamSpec *pspec, + ClutterAnimation *animation) +{ + ClutterAnimationPrivate *priv = animation->priv; + GList *properties, *p; + gdouble alpha_value; + gboolean is_animatable = FALSE; + ClutterAnimatable *animatable = NULL; + + alpha_value = clutter_alpha_get_alpha (CLUTTER_ALPHA (gobject)); + + if (CLUTTER_IS_ANIMATABLE (priv->object)) + { + animatable = CLUTTER_ANIMATABLE (priv->object); + is_animatable = TRUE; + } + + g_object_freeze_notify (priv->object); + + properties = g_hash_table_get_keys (priv->properties); + for (p = properties; p != NULL; p = p->next) + { + const gchar *p_name = p->data; + ClutterInterval *interval; + GValue value = { 0, }; + + interval = g_hash_table_lookup (priv->properties, p_name); + g_assert (CLUTTER_IS_INTERVAL (interval)); + + g_value_init (&value, clutter_interval_get_value_type (interval)); + + if (is_animatable) + { + const GValue *initial, *final; + + initial = clutter_interval_peek_initial_value (interval); + final = clutter_interval_peek_final_value (interval); + + CLUTTER_NOTE (ANIMATION, "Animatable property `%s'", p_name); + clutter_animatable_animate_property (animatable, animation, + p_name, + initial, final, + alpha_value, + &value); + + g_object_set_property (priv->object, p_name, &value); + } + else + { + CLUTTER_NOTE (ANIMATION, "Standard property `%s'", p_name); + + if (clutter_interval_compute_value (interval, alpha_value, &value)) + g_object_set_property (priv->object, p_name, &value); + } + + g_value_unset (&value); + } + + g_list_free (properties); + + g_object_thaw_notify (priv->object); +} + +/* + * Removes the animation pointer from the qdata section of the + * actor attached to the animation + */ +static void +on_animation_weak_notify (gpointer data, + GObject *animation_pointer) +{ + GObject *actor = data; + + CLUTTER_NOTE (ANIMATION, "Removing Animation from actor %d[%p]", + clutter_actor_get_gid (CLUTTER_ACTOR (actor)), + actor); + + g_object_set_qdata (actor, quark_object_animation, NULL); +} + +ClutterAnimation * +clutter_animation_new (void) +{ + return g_object_new (CLUTTER_TYPE_ANIMATION, NULL); +} + +/** + * clutter_animation_set_object: + * @animation: a #ClutterAnimation + * @object: a #GObject + * + * Attaches @animation to @object. The #ClutterAnimation will take a + * reference on @object. + * + * Since: 1.0 + */ +void +clutter_animation_set_object (ClutterAnimation *animation, + GObject *object) +{ + ClutterAnimationPrivate *priv; + + g_return_if_fail (CLUTTER_IS_ANIMATION (animation)); + g_return_if_fail (G_IS_OBJECT (object)); + + priv = animation->priv; + + g_object_ref (object); + + if (priv->object) + { + g_object_weak_unref (G_OBJECT (animation), + on_animation_weak_notify, + priv->object); + g_object_set_qdata (priv->object, quark_object_animation, NULL); + g_object_unref (priv->object); + } + + priv->object = object; + g_object_weak_ref (G_OBJECT (animation), + on_animation_weak_notify, + priv->object); + g_object_set_qdata (G_OBJECT (priv->object), + quark_object_animation, + animation); + + g_object_notify (G_OBJECT (animation), "object"); +} + +/** + * clutter_animation_get_object: + * @animation: a #ClutterAnimation + * + * Retrieves the #GObject attached to @animation. + * + * Return value: a #GObject + * + * Since: 1.0 + */ +GObject * +clutter_animation_get_object (ClutterAnimation *animation) +{ + g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), NULL); + + return animation->priv->object; +} + +static inline void +clutter_animation_set_mode_internal (ClutterAnimation *animation, + ClutterAlpha *alpha) +{ + ClutterAnimationPrivate *priv = animation->priv; + + if (alpha) + clutter_alpha_set_mode (alpha, priv->mode); +} + +/** + * clutter_animation_set_mode: + * @animation: a #ClutterAnimation + * @mode: an animation mode logical id + * + * Sets the animation @mode of @animation. The animation @mode is + * a logical id, either coming from the #ClutterAnimationMode enumeration + * or the return value of clutter_alpha_register_func(). + * + * Since: 1.0 + */ +void +clutter_animation_set_mode (ClutterAnimation *animation, + gulong mode) +{ + ClutterAnimationPrivate *priv; + + g_return_if_fail (CLUTTER_IS_ANIMATION (animation)); + + priv = animation->priv; + + priv->mode = mode; + clutter_animation_set_mode_internal (animation, priv->alpha); + + g_object_notify (G_OBJECT (animation), "mode"); +} + +/** + * clutter_animation_get_mode: + * @animation: a #ClutterAnimation + * + * Retrieves the animation mode of @animation, as set by + * clutter_animation_set_mode(). + * + * Return value: the mode for the animation + * + * Since: 1.0 + */ +gulong +clutter_animation_get_mode (ClutterAnimation *animation) +{ + g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), CLUTTER_LINEAR); + + return animation->priv->mode; +} + +/** + * clutter_animation_set_duration: + * @animation: a #ClutterAnimation + * @msecs: the duration in milliseconds + * + * Sets the duration of @animation in milliseconds. + * + * Since: 1.0 + */ +void +clutter_animation_set_duration (ClutterAnimation *animation, + gint msecs) +{ + ClutterAnimationPrivate *priv; + + g_return_if_fail (CLUTTER_IS_ANIMATION (animation)); + + priv = animation->priv; + + priv->duration = msecs; + + if (priv->timeline) + { + gboolean was_playing; + + was_playing = clutter_timeline_is_playing (priv->timeline); + if (was_playing) + clutter_timeline_stop (priv->timeline); + + clutter_timeline_set_duration (priv->timeline, msecs); + + if (was_playing) + clutter_timeline_start (priv->timeline); + } + + g_object_notify (G_OBJECT (animation), "duration"); +} + +/** + * clutter_animation_set_loop: + * @animation: a #ClutterAnimation + * @loop: %TRUE if the animation should loop + * + * Sets whether @animation should loop over itself once finished. + * + * A looping #ClutterAnimation will not emit the #ClutterAnimation::completed + * signal when finished. + * + * Since: 1.0 + */ +void +clutter_animation_set_loop (ClutterAnimation *animation, + gboolean loop) +{ + ClutterAnimationPrivate *priv; + + g_return_if_fail (CLUTTER_IS_ANIMATION (animation)); + + priv = animation->priv; + + if (priv->loop != loop) + { + priv->loop = loop; + + if (priv->timeline) + clutter_timeline_set_loop (priv->timeline, priv->loop); + + g_object_notify (G_OBJECT (animation), "loop"); + } +} + +/** + * clutter_animation_get_loop: + * @animation: a #ClutterAnimation + * + * Retrieves whether @animation is looping. + * + * Return value: %TRUE if the animation is looping + * + * Since: 1.0 + */ +gboolean +clutter_animation_get_loop (ClutterAnimation *animation) +{ + g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), FALSE); + + return animation->priv->loop; +} + +/** + * clutter_animation_get_duration: + * @animation: a #ClutterAnimation + * + * Retrieves the duration of @animation, in milliseconds. + * + * Return value: the duration of the animation + * + * Since: 1.0 + */ +guint +clutter_animation_get_duration (ClutterAnimation *animation) +{ + g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), 0); + + return animation->priv->duration; +} + +/** + * clutter_animation_set_timeline: + * @animation: a #ClutterAnimation + * @timeline: a #ClutterTimeline or %NULL + * + * Sets the #ClutterTimeline used by @animation. + * + * The #ClutterAnimation:duration and #ClutterAnimation:loop properties + * will be set using the corresponding #ClutterTimeline properties as a + * side effect. + * + * If @timeline is %NULL a new #ClutterTimeline will be constructed + * using the current values of the #ClutterAnimation:duration and + * #ClutterAnimation:loop properties. + * + * Since: 1.0 + */ +void +clutter_animation_set_timeline (ClutterAnimation *animation, + ClutterTimeline *timeline) +{ + ClutterAnimationPrivate *priv; + + g_return_if_fail (CLUTTER_IS_ANIMATION (animation)); + g_return_if_fail (timeline == NULL || CLUTTER_IS_TIMELINE (timeline)); + + priv = animation->priv; + + if (timeline && priv->timeline == timeline) + return; + + g_object_freeze_notify (G_OBJECT (animation)); + + if (priv->timeline) + { + if (priv->timeline_completed_id) + g_signal_handler_disconnect (priv->timeline, + priv->timeline_completed_id); + + g_object_unref (priv->timeline); + priv->timeline_completed_id = 0; + priv->timeline = 0; + } + + if (!timeline) + timeline = g_object_new (CLUTTER_TYPE_TIMELINE, + "duration", priv->duration, + "loop", priv->loop, + NULL); + else + { + priv->duration = clutter_timeline_get_duration (timeline); + g_object_notify (G_OBJECT (animation), "duration"); + + priv->loop = clutter_timeline_get_loop (timeline); + g_object_notify (G_OBJECT (animation), "loop"); + } + + priv->timeline = g_object_ref (timeline); + g_object_notify (G_OBJECT (animation), "timeline"); + + priv->timeline_completed_id = + g_signal_connect (timeline, "completed", + G_CALLBACK (on_timeline_completed), + animation); + + g_object_thaw_notify (G_OBJECT (animation)); +} + +/** + * clutter_animation_get_timeline: + * @animation: a #ClutterAnimation + * + * Retrieves the #ClutterTimeline used by @animation + * + * Return value: the timeline used by the animation + * + * Since: 1.0 + */ +ClutterTimeline * +clutter_animation_get_timeline (ClutterAnimation *animation) +{ + g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), NULL); + + return animation->priv->timeline; +} + +/** + * clutter_animation_set_alpha: + * @animation: a #ClutterAnimation + * @alpha: a #ClutterAlpha, or %NULL + * + * Sets @alpha as the #ClutterAlpha used by @animation. + * + * If @alpha is %NULL, a new #ClutterAlpha will be constructed from + * the current values of the #ClutterAnimation:mode and + * #ClutterAnimation:timeline properties. + * + * Since: 1.0 + */ +void +clutter_animation_set_alpha (ClutterAnimation *animation, + ClutterAlpha *alpha) +{ + ClutterAnimationPrivate *priv; + + g_return_if_fail (CLUTTER_IS_ANIMATION (animation)); + g_return_if_fail (alpha == NULL || CLUTTER_IS_ALPHA (alpha)); + + priv = animation->priv; + + if (!alpha) + { + ClutterTimeline *timeline; + + timeline = clutter_animation_get_timeline (animation); + + alpha = clutter_alpha_new (); + clutter_alpha_set_timeline (alpha, timeline); + clutter_animation_set_mode_internal (animation, alpha); + } + + g_object_ref_sink (alpha); + + if (priv->alpha) + { + if (priv->alpha_notify_id) + g_signal_handler_disconnect (priv->alpha, priv->alpha_notify_id); + + g_object_unref (priv->alpha); + priv->alpha_notify_id = 0; + priv->alpha = NULL; + } + + priv->alpha = alpha; + + priv->alpha_notify_id = + g_signal_connect (alpha, "notify::alpha", + G_CALLBACK (on_alpha_notify), + animation); +} + +/** + * clutter_animation_get_alpha: + * @animation: a #ClutterAnimation + * + * Retrieves the #ClutterAlpha used by @animation. + * + * Return value: the alpha object used by the animation + * + * Since: 1.0 + */ +ClutterAlpha * +clutter_animation_get_alpha (ClutterAnimation *animation) +{ + g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), NULL); + + return animation->priv->alpha; +} + +/* + * starts the timeline + */ +static void +clutter_animation_start (ClutterAnimation *animation) +{ + if (animation->priv->timeline) + clutter_timeline_start (animation->priv->timeline); + else + { + /* sanity check */ + g_warning (G_STRLOC ": no timeline found, unable to start the animation"); + } +} + +static inline void +clutter_animation_setup_valist (ClutterAnimation *animation, + const gchar *first_property_name, + va_list var_args) +{ + ClutterAnimationPrivate *priv = animation->priv; + GObjectClass *klass; + const gchar *property_name; + + klass = G_OBJECT_GET_CLASS (priv->object); + + property_name = first_property_name; + while (property_name != NULL) + { + GValue final = { 0, }; + GParamSpec *pspec = NULL; + gboolean is_fixed = FALSE; + gchar *error = NULL; + + /* fixed properties will not be animated */ + if (g_str_has_prefix (property_name, "fixed::")) + { + is_fixed = TRUE; + property_name += 7; + } + + pspec = g_object_class_find_property (klass, property_name); + if (!pspec) + { + g_warning ("Cannot bind property `%s': objects of type `%s' do " + "not have this property", + property_name, + g_type_name (G_OBJECT_TYPE (priv->object))); + break; + } + + if (!(pspec->flags & G_PARAM_WRITABLE)) + { + g_warning ("Cannot bind property `%s': the property is " + "not writable", + property_name); + break; + } + + g_value_init (&final, G_PARAM_SPEC_VALUE_TYPE (pspec)); + G_VALUE_COLLECT (&final, var_args, 0, &error); + if (error) + { + g_warning ("%s: %s", G_STRLOC, error); + g_free (error); + break; + } + + /* create an interval and bind it to the property, in case + * it's not a fixed property, otherwise just set it + */ + if (G_LIKELY (!is_fixed)) + { + ClutterInterval *interval; + GValue initial = { 0, }; + + g_value_init (&initial, G_PARAM_SPEC_VALUE_TYPE (pspec)); + g_object_get_property (priv->object, property_name, &initial); + + interval = + clutter_interval_new_with_values (G_PARAM_SPEC_VALUE_TYPE (pspec), + &initial, + &final); + + if (!clutter_animation_has_property (animation, pspec->name)) + clutter_animation_bind_property_internal (animation, + pspec, + interval); + else + clutter_animation_update_property_internal (animation, + pspec, + interval); + + g_value_unset (&initial); + } + else + g_object_set_property (priv->object, property_name, &final); + + g_value_unset (&final); + + property_name = va_arg (var_args, gchar*); + } + + /* start the animation by default */ + clutter_animation_start (animation); +} + +/** + * clutter_actor_animate_with_alpha: + * @actor: a #ClutterActor + * @alpha: a #ClutterAlpha + * @first_property_name: the name of a property + * @VarArgs: a %NULL terminated list of property names and + * property values + * + * Animates the given list of properties of @actor between the current + * value for each property and a new final value. The animation has a + * definite behaviour given by the passed @alpha. + * + * See clutter_actor_animate() for further details. + * + * This function is useful if you want to use an existing #ClutterAlpha + * to animate @actor. + * + * Return value: a #ClutterAnimation object. The object is owned by the + * #ClutterActor and should not be unreferenced with g_object_unref() + * + * Since: 1.0 + */ +ClutterAnimation * +clutter_actor_animate_with_alpha (ClutterActor *actor, + ClutterAlpha *alpha, + const gchar *first_property_name, + ...) +{ + ClutterAnimation *animation; + ClutterTimeline *timeline; + va_list args; + + g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), NULL); + g_return_val_if_fail (CLUTTER_IS_ALPHA (alpha), NULL); + g_return_val_if_fail (first_property_name != NULL, NULL); + + timeline = clutter_alpha_get_timeline (alpha); + if (G_UNLIKELY (!timeline)) + { + g_warning ("The passed ClutterAlpha does not have an " + "associated ClutterTimeline."); + return NULL; + } + + animation = g_object_get_qdata (G_OBJECT (actor), quark_object_animation); + if (G_LIKELY (!animation)) + { + animation = clutter_animation_new (); + CLUTTER_NOTE (ANIMATION, "Created new Animation [%p]", animation); + } + else + CLUTTER_NOTE (ANIMATION, "Reusing Animation [%p]", animation); + + clutter_animation_set_timeline (animation, timeline); + clutter_animation_set_alpha (animation, alpha); + clutter_animation_set_object (animation, G_OBJECT (actor)); + + va_start (args, first_property_name); + clutter_animation_setup_valist (animation, first_property_name, args); + va_end (args); + + return animation; +} + +/** + * clutter_actor_animate_with_timeline: + * @actor: a #ClutterActor + * @mode: an animation mode logical id + * @timeline: a #ClutterTimeline + * @first_property_name: the name of a property + * @VarArgs: a %NULL terminated list of property names and + * property values + * + * Animates the given list of properties of @actor between the current + * value for each property and a new final value. The animation has a + * definite duration given by @timeline and a speed given by the @mode. + * + * See clutter_actor_animate() for further details. + * + * This function is useful if you want to use an existing timeline + * to animate @actor. + * + * Return value: a #ClutterAnimation object. The object is owned by the + * #ClutterActor and should not be unreferenced with g_object_unref() + * + * Since: 1.0 + */ +ClutterAnimation * +clutter_actor_animate_with_timeline (ClutterActor *actor, + gulong mode, + ClutterTimeline *timeline, + const gchar *first_property_name, + ...) +{ + ClutterAnimation *animation; + va_list args; + + g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), NULL); + g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), NULL); + g_return_val_if_fail (first_property_name != NULL, NULL); + + animation = g_object_get_qdata (G_OBJECT (actor), quark_object_animation); + if (G_LIKELY (!animation)) + { + animation = clutter_animation_new (); + CLUTTER_NOTE (ANIMATION, "Created new Animation [%p]", animation); + } + else + CLUTTER_NOTE (ANIMATION, "Reusing Animation [%p]", animation); + + clutter_animation_set_timeline (animation, timeline); + clutter_animation_set_alpha (animation, NULL); + clutter_animation_set_mode (animation, mode); + clutter_animation_set_object (animation, G_OBJECT (actor)); + + va_start (args, first_property_name); + clutter_animation_setup_valist (animation, first_property_name, args); + va_end (args); + + return animation; +} + +/** + * clutter_actor_animate: + * @actor: a #ClutterActor + * @mode: an animation mode logical id + * @duration: duration of the animation, in milliseconds + * @first_property_name: the name of a property + * @VarArgs: a %NULL terminated list of property names and + * property values + * + * Animates the given list of properties of @actor between the current + * value for each property and a new final value. The animation has a + * definite duration and a speed given by the @mode. + * + * For example, this: + * + * |[ + * clutter_actor_animate (rectangle, CLUTTER_LINEAR, 250, + * "width", 100, + * "height", 100, + * NULL); + * ]| + * + * will make width and height properties of the #ClutterActor "rectangle" + * grow linearly between the current value and 100 pixels, in 250 milliseconds. + * + * The animation @mode is a logical id, either from the #ClutterAnimationMode + * enumeration of from clutter_alpha_register_func(). + * + * All the properties specified will be animated between the current value + * and the final value. If a property should be set at the beginning of + * the animation but not updated during the animation, it should be prefixed + * by the "fixed::" string, for instance: + * + * |[ + * clutter_actor_animate (actor, CLUTTER_EASE_IN, 100, + * "rotation-angle-z", 360, + * "fixed::rotation-center-x", 100, + * "fixed::rotation-center-y", 100, + * NULL); + * ]| + * + * Will animate the "rotation-angle-z" property between the current value + * and 360 degrees, and set the "rotation-center-x" and "rotation-center-y" + * to the fixed value of 100 pixels. + * + * This function will implicitly create a #ClutterAnimation object which + * will be assigned to the @actor and will be returned to the developer + * to control the animation or to know when the animation has been + * completed. + * + * Calling this function on an actor that is already being animated + * will cause the current animation to change with the new final value. + * + * Unless the animation is looping, it will become invalid as soon + * as it is complete. To avoid this, you should keep a reference on the + * returned value using g_object_ref(). + * + * Return value: a #ClutterAnimation object. The object is owned by the + * #ClutterActor and should not be unreferenced with g_object_unref() + * + * Since: 1.0 + */ +ClutterAnimation * +clutter_actor_animate (ClutterActor *actor, + gulong mode, + guint duration, + const gchar *first_property_name, + ...) +{ + ClutterAnimation *animation; + va_list args; + + g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), NULL); + g_return_val_if_fail (mode != CLUTTER_CUSTOM_MODE, NULL); + g_return_val_if_fail (duration > 0, NULL); + g_return_val_if_fail (first_property_name != NULL, NULL); + + animation = g_object_get_qdata (G_OBJECT (actor), quark_object_animation); + if (G_LIKELY (!animation)) + { + /* if there is no animation already attached to the actor, + * create one and set up the timeline and alpha using the + * current values for duration, mode and loop + */ + animation = clutter_animation_new (); + clutter_animation_set_timeline (animation, NULL); + clutter_animation_set_alpha (animation, NULL); + clutter_animation_set_object (animation, G_OBJECT (actor)); + + CLUTTER_NOTE (ANIMATION, "Created new Animation [%p]", animation); + } + else + CLUTTER_NOTE (ANIMATION, "Reusing Animation [%p]", animation); + + /* force the update of duration and mode using the new + * values coming from the parameters of this function + */ + clutter_animation_set_duration (animation, duration); + clutter_animation_set_mode (animation, mode); + + va_start (args, first_property_name); + clutter_animation_setup_valist (animation, first_property_name, args); + va_end (args); + + return animation; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-animation.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-animation.h --- clutter-0.8.4/clutter/clutter-animation.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-animation.h 2009-01-28 08:12:44.000000000 +0000 @@ -0,0 +1,149 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Copyright (C) 2008 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 . + * + * Author: + * Emmanuele Bassi + */ + +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_ANIMATION_H__ +#define __CLUTTER_ANIMATION_H__ + +#include +#include +#include +#include +#include + +G_BEGIN_DECLS + +#define CLUTTER_TYPE_ANIMATION (clutter_animation_get_type ()) +#define CLUTTER_ANIMATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ANIMATION, ClutterAnimation)) +#define CLUTTER_IS_ANIMATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ANIMATION)) +#define CLUTTER_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_ANIMATION, ClutterAnimationClass)) +#define CLUTTER_IS_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_ANIMATION)) +#define CLUTTER_ANIMATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_ANIMATION, ClutterAnimationClass)) + +typedef struct _ClutterAnimation ClutterAnimation; +typedef struct _ClutterAnimationPrivate ClutterAnimationPrivate; +typedef struct _ClutterAnimationClass ClutterAnimationClass; + +/** + * ClutterAnimation: + * + * The #ClutterAnimation structure contains only private data and should + * be accessed using the provided functions. + * + * Since: 1.0 + */ +struct _ClutterAnimation +{ + /*< private >*/ + GInitiallyUnowned parent_instance; + + ClutterAnimationPrivate *priv; +}; + +/** + * ClutterAnimationClass: + * @completed: class handler for the #ClutterAnimation::completed signal + * + * The #ClutterAnimationClass structure contains only private data and + * should be accessed using the provided functions. + * + * Since: 1.0 + */ +struct _ClutterAnimationClass +{ + /*< private >*/ + GInitiallyUnownedClass parent_class; + + /*< public >*/ + void (* completed) (ClutterAnimation *animation); + + /*< private >*/ + /* padding for future expansion */ + void (*_clutter_reserved1) (void); + void (*_clutter_reserved2) (void); + void (*_clutter_reserved3) (void); + void (*_clutter_reserved4) (void); + void (*_clutter_reserved5) (void); + void (*_clutter_reserved6) (void); + void (*_clutter_reserved7) (void); + void (*_clutter_reserved8) (void); +}; + +GType clutter_animation_get_type (void) G_GNUC_CONST; + +ClutterAnimation * clutter_animation_new (void); + +void clutter_animation_set_object (ClutterAnimation *animation, + GObject *object); +GObject * clutter_animation_get_object (ClutterAnimation *animation); +void clutter_animation_set_mode (ClutterAnimation *animation, + gulong mode); +gulong clutter_animation_get_mode (ClutterAnimation *animation); +void clutter_animation_set_duration (ClutterAnimation *animation, + gint msecs); +guint clutter_animation_get_duration (ClutterAnimation *animation); +void clutter_animation_set_loop (ClutterAnimation *animation, + gboolean loop); +gboolean clutter_animation_get_loop (ClutterAnimation *animation); +void clutter_animation_set_timeline (ClutterAnimation *animation, + ClutterTimeline *timeline); +ClutterTimeline * clutter_animation_get_timeline (ClutterAnimation *animation); +void clutter_animation_set_alpha (ClutterAnimation *animation, + ClutterAlpha *alpha); +ClutterAlpha * clutter_animation_get_alpha (ClutterAnimation *animation); + +void clutter_animation_bind_property (ClutterAnimation *animation, + const gchar *property_name, + ClutterInterval *interval); +gboolean clutter_animation_has_property (ClutterAnimation *animation, + const gchar *property_name); +void clutter_animation_update_property (ClutterAnimation *animation, + const gchar *property_name, + ClutterInterval *interval); +void clutter_animation_unbind_property (ClutterAnimation *animation, + const gchar *property_name); +ClutterInterval *clutter_animation_get_interval (ClutterAnimation *animation, + const gchar *property_name); + +ClutterAnimation * clutter_actor_animate (ClutterActor *actor, + gulong mode, + guint duration, + const gchar *first_property_name, + ...) G_GNUC_NULL_TERMINATED; +ClutterAnimation * clutter_actor_animate_with_timeline (ClutterActor *actor, + gulong mode, + ClutterTimeline *timeline, + const gchar *first_property_name, + ...) G_GNUC_NULL_TERMINATED; +ClutterAnimation * clutter_actor_animate_with_alpha (ClutterActor *actor, + ClutterAlpha *alpha, + const gchar *first_property_name, + ...) G_GNUC_NULL_TERMINATED; + +G_END_DECLS + +#endif /* __CLUTTER_ANIMATION_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-backend.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-backend.c --- clutter-0.8.4/clutter/clutter-backend.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-backend.c 2009-01-28 08:12:44.000000000 +0000 @@ -44,10 +44,13 @@ #include "clutter-backend.h" #include "clutter-debug.h" #include "clutter-fixed.h" +#include "clutter-marshal.h" #include "clutter-private.h" G_DEFINE_ABSTRACT_TYPE (ClutterBackend, clutter_backend, G_TYPE_OBJECT); +#define DEFAULT_FONT_NAME "Sans 10" + #define CLUTTER_BACKEND_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_BACKEND, ClutterBackendPrivate)) @@ -57,30 +60,99 @@ guint double_click_time; guint double_click_distance; - ClutterFixed resolution; + gdouble resolution; + gdouble units_per_em; cairo_font_options_t *font_options; + + gchar *font_name; +}; + +enum +{ + RESOLUTION_CHANGED, + FONT_CHANGED, + + LAST_SIGNAL }; +static guint backend_signals[LAST_SIGNAL] = { 0, }; + static void clutter_backend_dispose (GObject *gobject) { + ClutterBackendPrivate *priv = CLUTTER_BACKEND (gobject)->priv; ClutterMainContext *clutter_context; clutter_context = clutter_context_get_default (); if (clutter_context && clutter_context->events_queue) { - g_queue_foreach (clutter_context->events_queue, (GFunc) clutter_event_free, NULL); + g_queue_foreach (clutter_context->events_queue, + (GFunc) clutter_event_free, + NULL); g_queue_free (clutter_context->events_queue); clutter_context->events_queue = NULL; } + g_free (priv->font_name); + clutter_backend_set_font_options (CLUTTER_BACKEND (gobject), NULL); G_OBJECT_CLASS (clutter_backend_parent_class)->dispose (gobject); } +static inline void +update_units_per_em (ClutterBackend *backend) +{ + ClutterBackendPrivate *priv = backend->priv; + const gchar *font_name; + gdouble dpi; + + font_name = clutter_backend_get_font_name (backend); + dpi = clutter_backend_get_resolution (backend); + + if (G_LIKELY (font_name != NULL && *font_name != '\0')) + { + PangoFontDescription *font_desc; + gdouble font_size = 0; + + font_desc = pango_font_description_from_string (font_name); + if (G_LIKELY (font_desc != NULL)) + { + gint pango_size; + gboolean is_absolute; + + pango_size = pango_font_description_get_size (font_desc); + is_absolute = + pango_font_description_get_size_is_absolute (font_desc); + if (!is_absolute) + font_size = ((gdouble) font_size) / PANGO_SCALE; + + pango_font_description_free (font_desc); + } + + /* 10 points at 96 DPI is 12 pixels */ + priv->units_per_em = 1.2 * font_size + * dpi + / 96.0; + } + else + priv->units_per_em = -1.0; +} + +static void +clutter_backend_real_resolution_changed (ClutterBackend *backend) +{ + update_units_per_em (backend); +} + +static void +clutter_backend_real_font_changed (ClutterBackend *backend) +{ + update_units_per_em (backend); +} + static void clutter_backend_class_init (ClutterBackendClass *klass) { @@ -89,6 +161,27 @@ gobject_class->dispose = clutter_backend_dispose; g_type_class_add_private (gobject_class, sizeof (ClutterBackendPrivate)); + + backend_signals[RESOLUTION_CHANGED] = + g_signal_new (I_("resolution-changed"), + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (ClutterBackendClass, resolution_changed), + NULL, NULL, + clutter_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + backend_signals[FONT_CHANGED] = + g_signal_new (I_("font-changed"), + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (ClutterBackendClass, font_changed), + NULL, NULL, + clutter_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + klass->resolution_changed = clutter_backend_real_resolution_changed; + klass->font_changed = clutter_backend_real_font_changed; } static void @@ -96,8 +189,10 @@ { ClutterBackendPrivate *priv; - priv = backend->priv = CLUTTER_BACKEND_GET_PRIVATE(backend); + priv = backend->priv = CLUTTER_BACKEND_GET_PRIVATE (backend); + priv->resolution = -1.0; + priv->units_per_em = -1.0; } void @@ -215,9 +310,6 @@ * potential issue of GL calls with no context) */ current_context_stage = stage; - - if (stage) - CLUTTER_SET_PRIVATE_FLAGS (stage, CLUTTER_ACTOR_SYNC_MATRICES); } else CLUTTER_NOTE (MULTISTAGE, "Stage is the same"); @@ -256,15 +348,30 @@ klass->init_events (backend); } +ClutterUnit +_clutter_backend_get_units_per_em (ClutterBackend *backend) +{ + ClutterBackendPrivate *priv; + + g_return_val_if_fail (CLUTTER_IS_BACKEND (backend), 0); + + priv = backend->priv; + + if (G_UNLIKELY (priv->units_per_em < 0)) + update_units_per_em (backend); + + return priv->units_per_em; +} /** * clutter_get_default_backend: * - * FIXME + * Retrieves the default #ClutterBackend used by Clutter. The + * #ClutterBackend holds backend-specific configuration options. * * Return value: the default backend. You should not ref or - * unref the returned object. Applications should not rarely need - * to use this. + * unref the returned object. Applications should rarely need + * to use this. * * Since: 0.4 */ @@ -373,23 +480,21 @@ clutter_backend_set_resolution (ClutterBackend *backend, gdouble dpi) { - ClutterFixed fixed_dpi; ClutterBackendPrivate *priv; g_return_if_fail (CLUTTER_IS_BACKEND (backend)); + priv = backend->priv; + if (dpi < 0) dpi = -1.0; - priv = backend->priv; - - fixed_dpi = CLUTTER_FLOAT_TO_FIXED (dpi); - if (priv->resolution != fixed_dpi) - priv->resolution = fixed_dpi; + priv->resolution = dpi; if (CLUTTER_CONTEXT ()->font_map) - pango_clutter_font_map_set_resolution (CLUTTER_CONTEXT ()->font_map, - CLUTTER_FIXED_TO_FLOAT (fixed_dpi)); + cogl_pango_font_map_set_resolution (CLUTTER_CONTEXT ()->font_map, dpi); + + g_signal_emit (backend, backend_signals[RESOLUTION_CHANGED], 0); } /** @@ -409,7 +514,7 @@ { g_return_val_if_fail (CLUTTER_IS_BACKEND (backend), -1.0); - return CLUTTER_FIXED_TO_FLOAT (backend->priv->resolution); + return backend->priv->resolution; } /** @@ -445,6 +550,8 @@ priv->font_options = cairo_font_options_copy (options); else priv->font_options = NULL; + + g_signal_emit (backend, backend_signals[FONT_CHANGED], 0); } } @@ -482,3 +589,63 @@ return priv->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 + */ +void +clutter_backend_set_font_name (ClutterBackend *backend, + const gchar *font_name) +{ + ClutterBackendPrivate *priv; + + g_return_if_fail (CLUTTER_IS_BACKEND (backend)); + + priv = backend->priv; + + g_free (priv->font_name); + + if (font_name == NULL || *font_name == '\0') + priv->font_name = g_strdup (DEFAULT_FONT_NAME); + else + priv->font_name = g_strdup (font_name); + + g_signal_emit (backend, backend_signals[FONT_CHANGED], 0); +} + +/** + * 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 + */ +G_CONST_RETURN gchar * +clutter_backend_get_font_name (ClutterBackend *backend) +{ + ClutterBackendPrivate *priv; + + g_return_val_if_fail (CLUTTER_IS_BACKEND (backend), NULL); + + priv = backend->priv; + + if (G_LIKELY (priv->font_name)) + return priv->font_name; + + priv->font_name = g_strdup (DEFAULT_FONT_NAME); + + return priv->font_name; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-backend.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-backend.h --- clutter-0.8.4/clutter/clutter-backend.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-backend.h 2009-01-28 08:12:44.000000000 +0000 @@ -18,16 +18,20 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __CLUTTER_BACKEND_H__ #define __CLUTTER_BACKEND_H__ #include #include +#include + #include #include #include @@ -75,6 +79,10 @@ ClutterStage *stage); void (* ensure_context) (ClutterBackend *backend, ClutterStage *stage); + + /* signals */ + void (* resolution_changed) (ClutterBackend *backend); + void (* font_changed) (ClutterBackend *backend); }; GType clutter_backend_get_type (void) G_GNUC_CONST; @@ -93,6 +101,9 @@ void clutter_backend_set_font_options (ClutterBackend *backend, cairo_font_options_t *options); cairo_font_options_t *clutter_backend_get_font_options (ClutterBackend *backend); +void clutter_backend_set_font_name (ClutterBackend *backend, + const gchar *font_name); +G_CONST_RETURN gchar *clutter_backend_get_font_name (ClutterBackend *backend); G_END_DECLS diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-behaviour-bspline.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-behaviour-bspline.c --- clutter-0.8.4/clutter/clutter-behaviour-bspline.c 2008-10-20 22:48:37.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-behaviour-bspline.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,1228 +0,0 @@ -/* -*- mode:C; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Tomas Frydrych - * - * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/** - * SECTION:clutter-behaviour-bspline - * @short_description: A behaviour interpolating position along a B-Spline - * - * #ClutterBehaviourBspline interpolates actors along a defined B-Spline path. - * - * A bezier spline is a set of cubic bezier curves defined by a sequence of - * control points given when creating a new #ClutterBehaviourBspline instance. - * - * Additional bezier curves can be added to the end of the bspline using - * clutter_behaviour_bspline_append_* family of functions, control points can - * be moved using clutter_behaviour_bspline_adjust(). The bspline can be split - * into two with clutter_behaviour_bspline_split(), and bsplines can be - * concatenated using clutter_behaviour_bspline_join(). - * - * Each time the behaviour reaches a point on the path, the "knot-reached" - * signal is emitted. - * - * Since: 0.4 - */ - -#include "clutter-behaviour-bspline.h" -#include "clutter-debug.h" -#include "clutter-fixed.h" -#include "clutter-marshal.h" -#include "clutter-private.h" -#include "clutter-scriptable.h" -#include "clutter-script-private.h" - -#include -#include - -/* - * We have some experimental code here to allow for constant velocity - * movement of actors along the bezier path, this macro enables it. - */ -#undef CBZ_L2T_INTERPOLATION - -/**************************************************************************** - * ClutterBezier -- represenation of a cubic bezier curve * - * (private; a building block for the public bspline object) * - ****************************************************************************/ - -/* - * The t parameter of the bezier is from interval <0,1>, so we can use - * 14.18 format and special multiplication functions that preserve - * more of the least significant bits but would overflow if the value - * is > 1 - */ -#define CBZ_T_Q 18 -#define CBZ_T_ONE (1 << CBZ_T_Q) -#define CBZ_T_MUL(x,y) ((((x) >> 3) * ((y) >> 3)) >> 12) -#define CBZ_T_POW2(x) CBZ_T_MUL (x, x) -#define CBZ_T_POW3(x) CBZ_T_MUL (CBZ_T_POW2 (x), x) -#define CBZ_T_DIV(x,y) ((((x) << 9)/(y)) << 9) - -/* - * Constants for sampling of the bezier - */ -#define CBZ_T_SAMPLES 128 -#define CBZ_T_STEP (CBZ_T_ONE / CBZ_T_SAMPLES) -#define CBZ_L_STEP (CBZ_T_ONE / CBZ_T_SAMPLES) - -typedef gint32 _FixedT; - -/* - * This is a private type representing a single cubic bezier - */ -typedef struct _ClutterBezier -{ - /* - * bezier coefficients -- these are calculated using multiplication and - * addition from integer input, so these are also integers - */ - gint ax; - gint bx; - gint cx; - gint dx; - - gint ay; - gint by; - gint cy; - gint dy; - - /* length of the bezier */ - guint length; - -#ifdef CBZ_L2T_INTERPOLATION - /* - * coefficients for the L -> t bezier; these are calculated from fixed - * point input, and more specifically numbers that have been normalised - * to fit <0,1>, so these are also fixed point, and we can used the - * _FixedT type here. - */ - _FixedT La; - _FixedT Lb; - _FixedT Lc; - /* _FixedT Ld; == 0 */ -#endif -} ClutterBezier; - -static ClutterBezier * -clutter_bezier_new () -{ - return g_slice_new0 (ClutterBezier); -} - -static void -clutter_bezier_free (ClutterBezier * b) -{ - if (G_LIKELY (b)) - { - g_slice_free (ClutterBezier, b); - } -} - -static ClutterBezier * -clutter_bezier_clone_and_move (ClutterBezier *b, gint x, gint y) -{ - ClutterBezier * b2 = clutter_bezier_new (); - memcpy (b2, b, sizeof (ClutterBezier)); - - b2->dx += x; - b2->dy += y; - - return b2; -} - -#ifdef CBZ_L2T_INTERPOLATION -/* - * L is relative advance along the bezier curve from interval <0,1> - */ -static _FixedT -clutter_bezier_L2t (ClutterBezier *b, _FixedT L) -{ - _FixedT t = CBZ_T_MUL (b->La, CBZ_T_POW3(L)) - + CBZ_T_MUL (b->Lb, CBZ_T_POW2(L)) - + CBZ_T_MUL (b->Lc, L); - - if (t > CBZ_T_ONE) - t = CBZ_T_ONE; - else if (t < 0) - t = 0; - - return t; -} -#endif - -static gint -clutter_bezier_t2x (ClutterBezier * b, _FixedT t) -{ - /* - * NB -- the int coefficients can be at most 8192 for the multiplication - * to work in this fashion due to the limits of the 14.18 fixed. - */ - return ((b->ax*CBZ_T_POW3(t) + b->bx*CBZ_T_POW2(t) + b->cx*t) >> CBZ_T_Q) - + b->dx; -} - -static gint -clutter_bezier_t2y (ClutterBezier * b, _FixedT t) -{ - /* - * NB -- the int coefficients can be at most 8192 for the multiplication - * to work in this fashion due to the limits of the 14.18 fixed. - */ - return ((b->ay*CBZ_T_POW3(t) + b->by*CBZ_T_POW2(t) + b->cy*t) >> CBZ_T_Q) - + b->dy; -} - -/* - * Advances along the bezier to relative length L and returns the coordinances - * in knot - */ -static void -clutter_bezier_advance (ClutterBezier *b, _FixedT L, ClutterKnot * knot) -{ -#ifdef CBZ_L2T_INTERPOLATION - _FixedT t = clutter_bezier_L2t (b, L); -#else - _FixedT t = L; -#endif - - knot->x = clutter_bezier_t2x (b, t); - knot->y = clutter_bezier_t2y (b, t); - - CLUTTER_NOTE (BEHAVIOUR, "advancing to relative pt %f: t %f, {%d,%d}", - (double) L / (double) CBZ_T_ONE, - (double) t / (double) CBZ_T_ONE, - knot->x, knot->y); -} - -static void -clutter_bezier_init (ClutterBezier *b, - gint x_0, gint y_0, - gint x_1, gint y_1, - gint x_2, gint y_2, - gint x_3, gint y_3) -{ - _FixedT t; - int i; - int xp = x_0; - int yp = y_0; - _FixedT length [CBZ_T_SAMPLES + 1]; - -#ifdef CBZ_L2T_INTERPOLATION - int j, k; - _FixedT L; - _FixedT t_equalized [CBZ_T_SAMPLES + 1]; -#endif - -#if 0 - g_debug ("Initializing bezier at {{%d,%d},{%d,%d},{%d,%d},{%d,%d}}", - x0, y0, x1, y1, x2, y2, x3, y3); -#endif - - b->dx = x_0; - b->dy = y_0; - - b->cx = 3 * (x_1 - x_0); - b->cy = 3 * (y_1 - y_0); - - b->bx = 3 * (x_2 - x_1) - b->cx; - b->by = 3 * (y_2 - y_1) - b->cy; - - b->ax = x_3 - 3 * x_2 + 3 * x_1 - x_0; - b->ay = y_3 - 3 * y_2 + 3 * y_1 - y_0; - -#if 0 - g_debug ("Cooeficients {{%d,%d},{%d,%d},{%d,%d},{%d,%d}}", - b->ax, b->ay, b->bx, b->by, b->cx, b->cy, b->dx, b->dy); -#endif - - /* - * Because of the way we do the multiplication in bezeir_t2x,y - * these coefficients need to be at most 0x1fff; this should be the case, - * I think, but have added this warning to catch any problems -- if it - * triggers, we need to change those two functions a bit. - */ - if (b->ax > 0x1fff || b->bx > 0x1fff || b->cx > 0x1fff) - g_warning ("Calculated coefficents will result in multiplication " - "overflow in clutter_bezier_t2x and clutter_bezier_t2y."); - - /* - * Sample the bezier with CBZ_T_SAMPLES and calculate length at - * each point. - * - * We are working with integers here, so we use the fast sqrti function. - */ - length[0] = 0; - - for (t = CBZ_T_STEP, i = 1; i <= CBZ_T_SAMPLES; ++i, t += CBZ_T_STEP) - { - int x = clutter_bezier_t2x (b, t); - int y = clutter_bezier_t2y (b, t); - - guint l = clutter_sqrti ((y - yp)*(y - yp) + (x - xp)*(x - xp)); - - l += length[i-1]; - - length[i] = l; - - xp = x; - yp = y; - } - - b->length = length[CBZ_T_SAMPLES]; - -#if 0 - g_debug ("length %d", b->length); -#endif - -#ifdef CBZ_L2T_INTERPOLATION - /* - * Now normalize the length values, converting them into _FixedT - */ - for (i = 0; i <= CBZ_T_SAMPLES; ++i) - { - length[i] = (length[i] << CBZ_T_Q) / b->length; - } - - /* - * Now generate a L -> t table such that the L will equidistant - * over <0,1> - */ - t_equalized[0] = 0; - - for (i = 1, j = 1, L = CBZ_L_STEP; i < CBZ_T_SAMPLES; ++i, L += CBZ_L_STEP) - { - _FixedT l1, l2; - _FixedT d1, d2, d; - _FixedT t1, t2; - - /* find the band for our L */ - for (k = j; k < CBZ_T_SAMPLES; ++k) - { - if (L < length[k]) - break; - } - - /* - * Now we know that L is from (length[k-1],length[k]> - * We remember k-1 in order not to have to iterate over the - * whole length array in the next iteration of the main loop - */ - j = k - 1; - - /* - * Now interpolate equlised t as a weighted average - */ - l1 = length[k-1]; - l2 = length[k]; - d1 = l2 - L; - d2 = L - l1; - d = l2 - l1; - t1 = (k - 1) * CBZ_T_STEP; - t2 = k * CBZ_T_STEP; - - t_equalized[i] = (t1*d1 + t2*d2)/d; - - if (t_equalized[i] < t_equalized[i-1]) - g_debug ("wrong t: L %f, l1 %f, l2 %f, t1 %f, t2 %f", - (double) (L)/(double)CBZ_T_ONE, - (double) (l1)/(double)CBZ_T_ONE, - (double) (l2)/(double)CBZ_T_ONE, - (double) (t1)/(double)CBZ_T_ONE, - (double) (t2)/(double)CBZ_T_ONE); - - } - - t_equalized[CBZ_T_SAMPLES] = CBZ_T_ONE; - - /* We now fit a bezier -- at this stage, do a single fit through our values - * at 0, 1/3, 2/3 and 1 - * - * FIXME -- do we need to use a better fitting approach to choose the best - * beziere. The actual curve we acquire this way is not too bad shapwise, - * but (probably due to rounding errors) the resulting curve no longer - * satisfies the necessary condition that for L2 > L1, t2 > t1, which - * causes oscilation. - */ - -#if 0 - /* - * These are the control points we use to calculate the curve coefficients - * for bezier t(L); these are not needed directly, but are implied in the - * calculations below. - * - * (p0 is 0,0, and p3 is 1,1) - */ - p1 = (18 * t_equalized[CBZ_T_SAMPLES/3] - - 9 * t_equalized[2*CBZ_T_SAMPLES/3] + - 2 << CBZ_T_Q) / 6; - - p2 = (18 * t_equalized[2*CBZ_T_SAMPLES/3] - - 9 * t_equalized[CBZ_T_SAMPLES/3] - - (5 << CBZ_T_Q)) / 6; -#endif - - b->Lc = (18 * t_equalized[CBZ_T_SAMPLES/3] - - 9 * t_equalized[2*CBZ_T_SAMPLES/3] + - (2 << CBZ_T_Q)) >> 1; - - b->Lb = (36 * t_equalized[2*CBZ_T_SAMPLES/3] - - 45 * t_equalized[CBZ_T_SAMPLES/3] - - (9 << CBZ_T_Q)) >> 1; - - b->La = ((27 * (t_equalized[CBZ_T_SAMPLES/3] - - t_equalized[2*CBZ_T_SAMPLES/3]) + - (7 << CBZ_T_Q)) >> 1) + CBZ_T_ONE; - - g_debug ("t(1/3) %f, t(2/3) %f", - (double)t_equalized[CBZ_T_SAMPLES/3]/(double)CBZ_T_ONE, - (double)t_equalized[2*CBZ_T_SAMPLES/3]/(double)CBZ_T_ONE); - - g_debug ("L -> t coefficients: %f, %f, %f", - (double)b->La/(double)CBZ_T_ONE, - (double)b->Lb/(double)CBZ_T_ONE, - (double)b->Lc/(double)CBZ_T_ONE); - - - /* - * For debugging, you can load these values into a spreadsheet and graph - * them to see how well the approximation matches the data - */ - for (i = 0; i < CBZ_T_SAMPLES; ++i) - { - g_print ("%f, %f, %f\n", - (double)(i*CBZ_T_STEP)/(double)CBZ_T_ONE, - (double)(t_equalized[i])/(double)CBZ_T_ONE, - (double)(clutter_bezier_L2t(b,i*CBZ_T_STEP))/(double)CBZ_T_ONE); - } -#endif -} - -/* - * Moves a control point at indx to location represented by knot - */ -static void -clutter_bezier_adjust (ClutterBezier * b, ClutterKnot * knot, guint indx) -{ - guint x[4], y[4]; - - g_assert (indx < 4); - - x[0] = b->dx; - y[0] = b->dy; - - x[1] = b->cx / 3 + x[0]; - y[1] = b->cy / 3 + y[0]; - - x[2] = b->bx / 3 + b->cx + x[1]; - y[2] = b->by / 3 + b->cy + y[1]; - - x[3] = b->ax + x[0] + b->cx + b->bx; - y[3] = b->ay + y[0] + b->cy + b->by; - - x[indx] = knot->x; - y[indx] = knot->y; - - clutter_bezier_init (b, x[0], y[0], x[1], y[1], x[2], y[2], x[3], y[3]); -} - - -/**************************************************************************** - * * - * ClutterBehaviourBspline * - * * - ****************************************************************************/ - -static void clutter_scriptable_iface_init (ClutterScriptableIface *iface); - -G_DEFINE_TYPE_WITH_CODE (ClutterBehaviourBspline, - clutter_behaviour_bspline, - CLUTTER_TYPE_BEHAVIOUR, - G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_SCRIPTABLE, - clutter_scriptable_iface_init)); - -#define CLUTTER_BEHAVIOUR_BSPLINE_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \ - CLUTTER_TYPE_BEHAVIOUR_BSPLINE, \ - ClutterBehaviourBsplinePrivate)) - -enum - { - KNOT_REACHED, - - LAST_SIGNAL - }; - -static guint bspline_signals[LAST_SIGNAL] = { 0, }; - -struct _ClutterBehaviourBsplinePrivate -{ - /* - * The individual bezier curves that make up this bspline - */ - GArray * splines; - - /* - * The length of the bspline - */ - guint length; - - /* - * Bspline offsets (these allow us to move the bspline without having to - * mess about with the individual beziers). - * - * NB: this is not the actual origin, but an adjustment to the origin of - * the first bezier; it defaults to 0 unless the user explicitely changes - * the bspline offset. - */ - gint x; - gint y; - - /* - * A temporary stack of control points used by the append methods - */ - GArray * point_stack; -}; - -static void -clutter_behaviour_bspline_finalize (GObject *object) -{ - ClutterBehaviourBspline *self = CLUTTER_BEHAVIOUR_BSPLINE (object); - ClutterBehaviourBsplinePrivate *priv = self->priv; - gint i; - - for (i = 0; i < priv->splines->len; ++i) - clutter_bezier_free (g_array_index (priv->splines, ClutterBezier*, i)); - - g_array_free (priv->splines, TRUE); - - for (i = 0; i < priv->point_stack->len; ++i) - clutter_knot_free (g_array_index (priv->point_stack, ClutterKnot*, i)); - - g_array_free (priv->point_stack, TRUE); - - G_OBJECT_CLASS (clutter_behaviour_bspline_parent_class)->finalize (object); -} - -static void -actor_apply_knot_foreach (ClutterBehaviour *behaviour, - ClutterActor *actor, - gpointer data) -{ - ClutterKnot *knot = data; - - clutter_actor_set_position (actor, knot->x, knot->y); -} - -/* - * Advances to a point that is at distance 'to' along the spline; - * - * returns FALSE if the length is beyond the end of the bspline. - */ -static gboolean -clutter_behaviour_bspline_advance (ClutterBehaviourBspline *bs, - guint to) -{ - ClutterBehaviourBsplinePrivate *priv = bs->priv; - gint i; - guint length = 0; - ClutterKnot knot; - - if (to > priv->length) - return FALSE; - - for (i = 0; i < priv->splines->len; ++i) - { - ClutterBezier *b = g_array_index (priv->splines, ClutterBezier*, i); - - if (length + b->length >= to) - { - _FixedT L = ((to - length) << CBZ_T_Q) / b->length; - - clutter_bezier_advance (b, L, &knot); - - knot.x += bs->priv->x; - knot.y += bs->priv->y; - - CLUTTER_NOTE (BEHAVIOUR, "advancing to length %d: (%d, %d)", - to, knot.x, knot.y); - - clutter_behaviour_actors_foreach (CLUTTER_BEHAVIOUR (bs), - actor_apply_knot_foreach, - &knot); - - g_signal_emit (bs, bspline_signals[KNOT_REACHED], 0, &knot); - - return TRUE; - } - - length += b->length; - } - - /* should not be reached */ - return FALSE; -} - -static void -clutter_behaviour_bspline_alpha_notify (ClutterBehaviour * behave, - guint32 alpha) -{ - ClutterBehaviourBspline * bs = CLUTTER_BEHAVIOUR_BSPLINE (behave); - gint to = (alpha * bs->priv->length) / CLUTTER_ALPHA_MAX_ALPHA; - - clutter_behaviour_bspline_advance (bs, to); -} - -static void -clutter_behaviour_bspline_class_init (ClutterBehaviourBsplineClass *klass) -{ - GObjectClass * object_class = G_OBJECT_CLASS (klass); - ClutterBehaviourClass * behave_class = CLUTTER_BEHAVIOUR_CLASS (klass); - - object_class->finalize = clutter_behaviour_bspline_finalize; - - behave_class->alpha_notify = clutter_behaviour_bspline_alpha_notify; - - /** - * ClutterBehaviourBspline::knot-reached: - * @pathb: the object which received the signal - * @knot: the #ClutterKnot reached - * - * This signal is emitted at the end of each frame. - * - * Since: 0.2 - */ - bspline_signals[KNOT_REACHED] = - g_signal_new ("knot-reached", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ClutterBehaviourBsplineClass, knot_reached), - NULL, NULL, - clutter_marshal_VOID__BOXED, - G_TYPE_NONE, 1, - CLUTTER_TYPE_KNOT); - - g_type_class_add_private (klass, sizeof (ClutterBehaviourBsplinePrivate)); -} - -static void -clutter_behaviour_bspline_init (ClutterBehaviourBspline * self) -{ - ClutterBehaviourBsplinePrivate *priv; - - self->priv = priv = CLUTTER_BEHAVIOUR_BSPLINE_GET_PRIVATE (self); - - priv->splines = g_array_new (FALSE, FALSE, sizeof (ClutterBezier *)); - priv->point_stack = g_array_new (FALSE, FALSE, sizeof (ClutterKnot *)); - priv->length = 0; -} - -static void -clutter_behaviour_bspline_set_custom_property (ClutterScriptable *scriptable, - ClutterScript *script, - const gchar *name, - const GValue *value) -{ - if (strcmp (name, "knots") == 0) - { - ClutterBehaviourBspline *bspline; - GSList *knots, *l; - - if (!G_VALUE_HOLDS (value, G_TYPE_POINTER)) - return; - - bspline = CLUTTER_BEHAVIOUR_BSPLINE (scriptable); - - knots = g_value_get_pointer (value); - for (l = knots; l != NULL; l = l->next) - { - ClutterKnot *knot = l->data; - - clutter_behaviour_bspline_append_knot (bspline, knot); - clutter_knot_free (knot); - } - - g_slist_free (knots); - } - else - g_object_set_property (G_OBJECT (scriptable), name, value); -} - -static gboolean -clutter_behaviour_bspline_parse_custom_node (ClutterScriptable *scriptable, - ClutterScript *script, - GValue *value, - const gchar *name, - JsonNode *node) -{ - if (strcmp (name, "knots") == 0) - { - JsonArray *array; - guint knots_len, i; - GSList *knots = NULL; - - array = json_node_get_array (node); - knots_len = json_array_get_length (array); - - for (i = 0; i < knots_len; i++) - { - JsonNode *val = json_array_get_element (array, i); - ClutterKnot knot = { 0, }; - - if (clutter_script_parse_knot (script, val, &knot)) - { - CLUTTER_NOTE (SCRIPT, "parsed knot [ x:%d, y:%d ]", - knot.x, knot.y); - - knots = g_slist_prepend (knots, clutter_knot_copy (&knot)); - } - } - - g_value_init (value, G_TYPE_POINTER); - g_value_set_pointer (value, g_slist_reverse (knots)); - - return TRUE; - } - - return FALSE; -} - -static void -clutter_scriptable_iface_init (ClutterScriptableIface *iface) -{ - iface->parse_custom_node = clutter_behaviour_bspline_parse_custom_node; - iface->set_custom_property = clutter_behaviour_bspline_set_custom_property; -} - -/** - * clutter_behaviour_bspline_new: - * @alpha: a #ClutterAlpha, or %NULL - * @knots: a list of #ClutterKnots representing individual control points - * @n_knots: the number of control points - * - * Creates a new bezier spline behaviour. You can use this behaviour to drive - * actors along the bezier spline, described by the @knots control points. - * - * Bspline is defined by 3n + 1 points, n >=1; any trailing points passed - * into this function are stored internally and used during any subsequent - * clutter_behaviour_bspline_append_* operations. - * - * Return value: a #ClutterBehaviour - * - * Since: 0.4 - */ -ClutterBehaviour * -clutter_behaviour_bspline_new (ClutterAlpha *alpha, - const ClutterKnot *knots, - guint n_knots) -{ - ClutterBehaviourBspline *bs; - gint i; - - g_return_val_if_fail (alpha == NULL || CLUTTER_IS_ALPHA (alpha), NULL); - - bs = g_object_new (CLUTTER_TYPE_BEHAVIOUR_BSPLINE, "alpha", alpha, NULL); - - for (i = 0; i < n_knots; ++i) - clutter_behaviour_bspline_append_knot (bs, &knots[i]); - - return CLUTTER_BEHAVIOUR (bs); -} - -/* - * Appends a single spline; knots points to 4 knots if this is first - * bezier in the spline, 3 subsequently - */ -static void -clutter_behaviour_bspline_append_spline (ClutterBehaviourBspline * bs, - const ClutterKnot ** knots) -{ - ClutterBehaviourBsplinePrivate *priv; - gint i; - ClutterBezier * b; - ClutterKnot knot0; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_BSPLINE (bs)); - priv = bs->priv; - - if (priv->splines->len) - { - /* Get the first point from the last curve */ - ClutterBezier *b_last; - - b_last = g_array_index (priv->splines, - ClutterBezier *, - priv->splines->len - 1); - - knot0.x = b_last->ax + b_last->bx + b_last->cx + b_last->dx; - knot0.y = b_last->ay + b_last->by + b_last->cy + b_last->dy; - - i = 0; - } - else - { - knot0.x = knots[0]->x; - knot0.y = knots[0]->y; - i = 1; - } - - b = clutter_bezier_new (); - clutter_bezier_init (b, - knot0.x, - knot0.y, - knots[i]->x, knots[i]->y, - knots[i + 1]->x, knots[i + 1]->y, - knots[i + 2]->x, knots[i + 2]->y); - - priv->splines = g_array_append_val (priv->splines, b); - - priv->length += b->length; -} - -/** - * clutter_behaviour_bspline_append_knot: - * @bs: a #ClutterBehaviourBspline - * @knot: a #ClutterKnot control point to append. - * - * Appends a #ClutterKnot control point to the bezier spline bs. Note, that - * since a bezier is defined by 4 control points, the point gets stored in - * a temporary chache, and only when there are enough control points to - * create a new bezier curve will the bspline extended. - * - * Since: 0.4 - */ -void -clutter_behaviour_bspline_append_knot (ClutterBehaviourBspline * bs, - const ClutterKnot * knot) -{ - ClutterBehaviourBsplinePrivate *priv; - ClutterKnot * k = clutter_knot_copy (knot); - guint needed = 3; - guint i; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_BSPLINE (bs)); - priv = bs->priv; - - g_array_append_val (priv->point_stack, k); - - if (priv->splines->len == 0) - needed = 4; - - if (priv->point_stack->len == needed) - { - clutter_behaviour_bspline_append_spline (bs, - (const ClutterKnot**) priv->point_stack->data); - - for (i = 0; i < needed; ++i) - { - clutter_knot_free (g_array_index (priv->point_stack, - ClutterKnot *, - i)); - } - - g_array_set_size (priv->point_stack, 0); - } -} - -static void -clutter_behaviour_bspline_append_knots_valist (ClutterBehaviourBspline *bs, - const ClutterKnot *first_knot, - va_list args) -{ - const ClutterKnot * knot; - - knot = first_knot; - while (knot) - { - clutter_behaviour_bspline_append_knot (bs, knot); - knot = va_arg (args, ClutterKnot*); - } -} - -/** - * clutter_behaviour_bspline_append_knots: - * @bs: a #ClutterBehaviourBspline - * @first_knot: first #ClutterKnot - * @VarArgs: a NULL-terminated array of #ClutterKnot control points. - * - * Appends a bezier spline defined by the last control point of bezier spline - * bs and the array of #ClutterKnot control points to the orginal bezier spline - * bs. - * - * Since: 0.6 - */ -void -clutter_behaviour_bspline_append_knots (ClutterBehaviourBspline * bs, - const ClutterKnot * first_knot, - ...) -{ - va_list args; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_BSPLINE (bs)); - g_return_if_fail (first_knot != NULL); - - va_start (args, first_knot); - clutter_behaviour_bspline_append_knots_valist (bs, first_knot, args); - va_end (args); -} - -/** - * clutter_behaviour_bspline_truncate: - * @bs: a #ClutterBehaviourBspline - * @offset: offset of control where the bspline should be truncated - * - * Truncates the bezier spline at the control point; if the control point at - * offset is not one of the on-curve points, the bspline will be - * truncated at the nearest preceeding on-curve point. - * - * Since: 0.4 - */ -void -clutter_behaviour_bspline_truncate (ClutterBehaviourBspline *bs, - guint offset) -{ - ClutterBehaviourBsplinePrivate *priv; - guint i; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_BSPLINE (bs)); - - if (!offset) - { - clutter_behaviour_bspline_clear (bs); - return; - } - - priv = bs->priv; - - /* convert control point offset to the offset of last spline to keep */ - offset = (offset - 1) / 3; - - priv->splines = g_array_set_size (priv->splines, offset + 1); - priv->length = 0; - - for (i = 0; i < priv->splines->len; ++i) - { - ClutterBezier *b; - - b = g_array_index (priv->splines, ClutterBezier*, i); - - priv->length += b->length; - } - -} - -/** - * clutter_behaviour_bspline_clear: - * @bs: a #ClutterBehaviourBspline - * - * Empties a bspline. - * - * Since: 0.4 - */ -void -clutter_behaviour_bspline_clear (ClutterBehaviourBspline *bs) -{ - ClutterBehaviourBsplinePrivate *priv; - gint i; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_BSPLINE (bs)); - - priv = bs->priv; - - for (i = 0; i < priv->splines->len; ++i) - clutter_bezier_free (g_array_index (priv->splines, ClutterBezier*, i)); - - g_array_set_size (priv->splines, 0); - - for (i = 0; i < priv->point_stack->len; ++i) - clutter_knot_free (g_array_index (priv->point_stack, ClutterKnot*, i)); - - g_array_set_size (priv->point_stack, 0); - - priv->x = 0; - priv->y = 0; - priv->length = 0; -} - -/** - * clutter_behaviour_bspline_join: - * @bs1: a #ClutterBehaviourBspline - * @bs2: a #ClutterBehaviourBspline - * - * Joins a copy of bezier spline bs2 onto the end of bezier spline bs1; bs2 is - * not modified. - * - * Since: 0.4 - */ -void -clutter_behaviour_bspline_join (ClutterBehaviourBspline *bs1, - ClutterBehaviourBspline *bs2) -{ - ClutterBehaviourBsplinePrivate *priv; - gint i, x_1, y_1; - ClutterKnot knot; - ClutterBezier *b, *b2; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_BSPLINE (bs1)); - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_BSPLINE (bs2)); - - clutter_behaviour_bspline_get_origin (bs2, &knot); - - priv = bs1->priv; - - b = g_array_index (priv->splines, ClutterBezier*, priv->splines->len - 1); - - x_1 = clutter_bezier_t2x (b, CBZ_T_ONE); - y_1 = clutter_bezier_t2y (b, CBZ_T_ONE); - - /* - * need to move bs2 so it joins bs1 - */ - x_1 -= knot.x; - y_1 -= knot.y; - - for (i = 0; i < priv->splines->len; ++i) - { - b = g_array_index (bs2->priv->splines, ClutterBezier*, i); - b2 = clutter_bezier_clone_and_move (b, x_1, y_1); - - priv->length += b2->length; - g_array_append_val (priv->splines, b2); - } -} - -/** - * clutter_behaviour_bspline_split: - * @bs: a #ClutterBehaviourBspline - * @offset: an offset of the control point at which to split the spline. - * - * Splits a bezier spline into two at the control point at offset; if the - * control point at offset is not one of the on-curve bezier points, the - * bspline will be split at the nearest on-curve point before the offset. - * The original bspline is shortened appropriately. - * - * Return value: new ClutterBehaviourBspline. - * - * Since: 0.4 - */ -ClutterBehaviour * -clutter_behaviour_bspline_split (ClutterBehaviourBspline *bs, - guint offset) -{ - ClutterBehaviourBsplinePrivate *priv; - ClutterBehaviourBspline * bs2 = NULL; - ClutterAlpha * alpha; - guint i, split, length2 = 0; - - g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_BSPLINE (bs), NULL); - - priv = bs->priv; - - split = offset / 3; - - if (split == 0 || split >= priv->splines->len) - return NULL; - - alpha = clutter_behaviour_get_alpha (CLUTTER_BEHAVIOUR (bs)); - - bs2 = g_object_new (CLUTTER_TYPE_BEHAVIOUR_BSPLINE, "alpha", alpha, NULL); - - bs2->priv->x = priv->x; - bs2->priv->y = priv->y; - - for (i = split; i < priv->splines->len; ++i) - { - ClutterBezier *b; - - b = g_array_index (priv->splines, ClutterBezier*, i); - g_array_append_val (bs2->priv->splines, b); - - length2 += b->length; - } - - bs2->priv->length -= length2; - bs2->priv->length = length2; - - g_array_set_size (priv->splines, split); - - return CLUTTER_BEHAVIOUR (bs2); -} - -/** - * clutter_behaviour_bspline_adjust: - * @bs: a #ClutterBehaviourBspline - * @offset: an index of control point to ajdust - * @knot: a #ClutterKnot with new coordinances for the control point. - * - * Change the coordinaces of control point at index to those represented by - * the knot. - * - * Since: 0.4 - */ -void -clutter_behaviour_bspline_adjust (ClutterBehaviourBspline *bs, - guint offset, - ClutterKnot *knot) -{ - ClutterBehaviourBsplinePrivate *priv; - ClutterBezier * b1 = NULL; - ClutterBezier * b2 = NULL; - guint p1_indx = 0; - guint p2_indx = 0; - guint old_length; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_BSPLINE (bs)); - - priv = bs->priv; - - /* - * Find the bezier(s) affected by change of this control point - * and the relative position of the control point within them - */ - - if (offset == 0) - b1 = g_array_index (priv->splines, ClutterBezier*, 0); - else if (offset + 1 == priv->splines->len) - { - b2 = g_array_index (priv->splines, - ClutterBezier*, - priv->splines->len - 1); - p2_indx = 3; - } - else - { - guint mod3 = offset % 3; - guint i = offset / 3; - - if (mod3 == 0) - { - /* on-curve point, i.e., two beziers */ - b1 = g_array_index (priv->splines, ClutterBezier*, i - 1); - b2 = g_array_index (priv->splines, ClutterBezier*, i); - p1_indx = 3; - } - else - { - b1 = g_array_index (priv->splines, ClutterBezier*, i); - p1_indx = mod3; - } - } - - /* - * Adjust the bezier(s) and total bspline length - */ - if (b1) - { - old_length = b1->length; - clutter_bezier_adjust (b1, knot, p1_indx); - priv->length = priv->length - old_length + b1->length; - } - - if (b2) - { - old_length = b2->length; - clutter_bezier_adjust (b2, knot, p2_indx); - priv->length = priv->length - old_length + b2->length; - } -} - -/** - * clutter_behaviour_bspline_set_origin - * @bs: a #ClutterBehaviourBspline - * @knot: a #ClutterKnot origin for the bezier - * - * Sets the origin of the bezier to the point represented by knot. (Initially - * the origin of a bspline is given by the position of the first control point - * of the first bezier curve.) - * - * Since: 0.4 - */ -void -clutter_behaviour_bspline_set_origin (ClutterBehaviourBspline * bs, - ClutterKnot * knot) -{ - ClutterBehaviourBsplinePrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_BSPLINE (bs)); - - priv = bs->priv; - - if (priv->splines->len == 0) - { - priv->x = knot->x; - priv->y = knot->y; - } - else - { - ClutterBezier *b; - - b = g_array_index (priv->splines, ClutterBezier*, 0); - - priv->x = knot->x - b->dx; - priv->y = knot->y - b->dy; - - CLUTTER_NOTE (BEHAVIOUR, "setting origin to (%d, %d): " - "b (%d, %d), adjustment (%d, %d)", - knot->x, knot->y, - b->dx, b->dy, - priv->x, priv->y); - } -} - -/** - * clutter_behaviour_bspline_get_origin - * @bs: a #ClutterBehaviourBspline - * @knot: a #ClutterKnot where to store the origin of the bezier - * - * Gets the origin of the bezier. - * - * Since: 0.4 - */ -void -clutter_behaviour_bspline_get_origin (ClutterBehaviourBspline *bs, - ClutterKnot *knot) -{ - ClutterBehaviourBsplinePrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_BSPLINE (bs)); - g_return_if_fail (knot != NULL); - - priv = bs->priv; - - if (priv->splines->len == 0) - { - knot->x = priv->x; - knot->y = priv->y; - } - else - { - ClutterBezier *b; - - b = g_array_index (priv->splines, ClutterBezier*, 0); - - knot->x = priv->x + b->dx; - knot->y = priv->y + b->dy; - } -} - diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-behaviour-bspline.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-behaviour-bspline.h --- clutter-0.8.4/clutter/clutter-behaviour-bspline.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-behaviour-bspline.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,127 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Tomas Frydrych - * - * Copyright (C) 2006, 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 . - */ - -#ifndef __CLUTTER_BEHAVIOUR_BSPLINE_H__ -#define __CLUTTER_BEHAVIOUR_BSPLINE_H__ - -#include -#include -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_BEHAVIOUR_BSPLINE (clutter_behaviour_bspline_get_type ()) - -#define CLUTTER_BEHAVIOUR_BSPLINE(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - CLUTTER_TYPE_BEHAVIOUR_BSPLINE, ClutterBehaviourBspline)) - -#define CLUTTER_BEHAVIOUR_BSPLINE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - CLUTTER_TYPE_BEHAVIOUR_BSPLINE, ClutterBehaviourBsplineClass)) - -#define CLUTTER_IS_BEHAVIOUR_BSPLINE(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - CLUTTER_TYPE_BEHAVIOUR_BSPLINE)) - -#define CLUTTER_IS_BEHAVIOUR_BSPLINE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - CLUTTER_TYPE_BEHAVIOUR_BSPLINE)) - -#define CLUTTER_BEHAVIOUR_BSPLINE_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - CLUTTER_TYPE_BEHAVIOUR_BSPLINE, ClutterBehaviourBsplineClass)) - -typedef struct _ClutterBehaviourBspline ClutterBehaviourBspline; -typedef struct _ClutterBehaviourBsplinePrivate ClutterBehaviourBsplinePrivate; -typedef struct _ClutterBehaviourBsplineClass ClutterBehaviourBsplineClass; - -/** - * ClutterBehaviourBspline: - * - * #ClutterBehaviourBspline-struct contains only private data and - * should be accessed using the functions below. - * - * Since: 0.2 - */ -struct _ClutterBehaviourBspline -{ - ClutterBehaviour parent_instance; - ClutterBehaviourBsplinePrivate *priv; -}; - -/** - * ClutterBehaviourBsplineClass: - * @knot_reached: class handler for the #ClutterBehaviourBspline::knot-reached - * signal - * - * #ClutterBehaviourBsplineClass-struct contains only private data - * and should be accessed using the functions below. - * - * Since: 0.2 - */ -struct _ClutterBehaviourBsplineClass -{ - /*< private >*/ - ClutterBehaviourClass parent_class; - - /*< public >*/ - void (*knot_reached) (ClutterBehaviourBspline *bsplineb, - const ClutterKnot *knot); - - /*< private >*/ - /* padding for future expansion */ - void (*_clutter_bspline_1) (void); - void (*_clutter_bspline_2) (void); - void (*_clutter_bspline_3) (void); - void (*_clutter_bspline_4) (void); -}; - -GType clutter_behaviour_bspline_get_type (void) G_GNUC_CONST; - -ClutterBehaviour *clutter_behaviour_bspline_new (ClutterAlpha *alpha, - const ClutterKnot *knots, - guint n_knots); -void clutter_behaviour_bspline_append_knot (ClutterBehaviourBspline *bs, - const ClutterKnot *knot); -void clutter_behaviour_bspline_append_knots (ClutterBehaviourBspline *bs, - const ClutterKnot *first_knot, - ...) G_GNUC_NULL_TERMINATED; -void clutter_behaviour_bspline_truncate (ClutterBehaviourBspline *bs, - guint offset); -void clutter_behaviour_bspline_join (ClutterBehaviourBspline *bs1, - ClutterBehaviourBspline *bs2); -ClutterBehaviour *clutter_behaviour_bspline_split (ClutterBehaviourBspline *bs, - guint offset); -void clutter_behaviour_bspline_clear (ClutterBehaviourBspline *bs); -void clutter_behaviour_bspline_adjust (ClutterBehaviourBspline *bs, - guint offset, - ClutterKnot *knot); -void clutter_behaviour_bspline_set_origin (ClutterBehaviourBspline *bs, - ClutterKnot *knot); -void clutter_behaviour_bspline_get_origin (ClutterBehaviourBspline *bs, - ClutterKnot *knot); - -G_END_DECLS - -#endif /* __CLUTTER_BEHAVIOUR_BSPLINE_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-behaviour.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-behaviour.c --- clutter-0.8.4/clutter/clutter-behaviour.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-behaviour.c 2009-01-28 16:45:24.000000000 +0000 @@ -240,7 +240,7 @@ static void clutter_behaviour_alpha_notify_unimplemented (ClutterBehaviour *behaviour, - guint32 alpha_value) + gdouble alpha_value) { g_warning ("ClutterBehaviourClass::alpha_notify not implemented for `%s'", g_type_name (G_TYPE_FROM_INSTANCE (behaviour))); @@ -362,7 +362,7 @@ return; } - priv->actors = g_slist_prepend (priv->actors, g_object_ref (actor)); + priv->actors = g_slist_append (priv->actors, g_object_ref (actor)); g_signal_connect (actor, "destroy", G_CALLBACK (remove_actor_on_destroy), behave); @@ -533,11 +533,9 @@ if (klass->alpha_notify) { - guint32 alpha_value; + gdouble alpha_value = clutter_alpha_get_alpha (behave->priv->alpha); - alpha_value = clutter_alpha_get_alpha (behave->priv->alpha); - - CLUTTER_NOTE (BEHAVIOUR, "calling %s::alpha_notify (%p, %d)", + CLUTTER_NOTE (BEHAVIOUR, "calling %s::alpha_notify (%p, %.4f)", g_type_name (G_TYPE_FROM_CLASS (klass)), behave, alpha_value); @@ -570,6 +568,9 @@ priv = behave->priv; + if (alpha) + g_object_ref_sink (alpha); + if (priv->notify_id) { CLUTTER_NOTE (BEHAVIOUR, "removing previous notify-id (%d)", @@ -590,7 +591,6 @@ if (alpha) { priv->alpha = alpha; - g_object_ref_sink (priv->alpha); priv->notify_id = g_signal_connect (priv->alpha, "notify::alpha", G_CALLBACK(notify_cb), @@ -627,7 +627,7 @@ for (l = priv->actors; l != NULL; l = l->next) retval = g_slist_prepend (retval, l->data); - return retval; + return g_slist_reverse (retval); } /** diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-behaviour-depth.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-behaviour-depth.c --- clutter-0.8.4/clutter/clutter-behaviour-depth.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-behaviour-depth.c 2009-01-28 08:12:44.000000000 +0000 @@ -74,21 +74,18 @@ static void clutter_behaviour_depth_alpha_notify (ClutterBehaviour *behaviour, - guint32 alpha_value) + gdouble alpha_value) { - ClutterFixed factor; ClutterBehaviourDepthPrivate *priv; gint depth; priv = CLUTTER_BEHAVIOUR_DEPTH (behaviour)->priv; /* Need to create factor as to avoid borking signedness */ - factor = CLUTTER_INT_TO_FIXED (alpha_value) / CLUTTER_ALPHA_MAX_ALPHA; - depth = priv->depth_start - + CLUTTER_FIXED_TO_INT (factor - * (priv->depth_end - priv->depth_start)); + depth = (alpha_value * (priv->depth_end - priv->depth_start)) + + priv->depth_start; - CLUTTER_NOTE (BEHAVIOUR, "alpha: %d, depth: %d", alpha_value, depth); + CLUTTER_NOTE (BEHAVIOUR, "alpha: %.4f, depth: %d", alpha_value, depth); clutter_behaviour_actors_foreach (behaviour, alpha_notify_foreach, diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-behaviour-depth.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-behaviour-depth.h --- clutter-0.8.4/clutter/clutter-behaviour-depth.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-behaviour-depth.h 2009-01-28 08:12:44.000000000 +0000 @@ -20,11 +20,13 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __CLUTTER_BEHAVIOUR_DEPTH__ #define __CLUTTER_BEHAVIOUR_DEPTH__ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-behaviour-ellipse.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-behaviour-ellipse.c --- clutter-0.8.4/clutter/clutter-behaviour-ellipse.c 2008-11-13 14:50:21.000000000 +0000 +++ clutter-0.9.0/clutter/clutter-behaviour-ellipse.c 2009-01-28 16:45:24.000000000 +0000 @@ -83,14 +83,14 @@ { ClutterKnot center; - gint a; - gint b; + gint a; + gint b; - ClutterAngle angle_start; - ClutterAngle angle_end; - ClutterAngle angle_tilt_x; - ClutterAngle angle_tilt_y; - ClutterAngle angle_tilt_z; + gfloat angle_start; + gfloat angle_end; + gfloat angle_tilt_x; + gfloat angle_tilt_y; + gfloat angle_tilt_z; ClutterRotateDirection direction; }; @@ -104,14 +104,14 @@ static void clutter_behaviour_ellipse_advance (ClutterBehaviourEllipse *e, - ClutterAngle angle, + float angle, knot3d *knot) { ClutterBehaviourEllipsePrivate *priv = e->priv; gint x, y, z; - x = CLUTTER_FIXED_TO_INT (priv->a * clutter_cosi (angle)); - y = CLUTTER_FIXED_TO_INT (priv->b * clutter_sini (angle)); + x = priv->a * cosf (angle * (G_PI / 180.0)); + y = priv->b * sinf (angle * (G_PI / 180.0)); z = 0; if (priv->angle_tilt_z) @@ -124,49 +124,48 @@ * sin (a + b) and cos (a + b) * */ - ClutterFixed x2, y2; + gfloat x2, y2; - x2 = x * clutter_cosi (priv->angle_tilt_z) - - y * clutter_sini (priv->angle_tilt_z); + x2 = x * cosf (priv->angle_tilt_z * (G_PI / 180.0)) + - y * sinf (priv->angle_tilt_z * (G_PI / 180.0)); - y2 = y * clutter_cosi (priv->angle_tilt_z) - + x * clutter_sini (priv->angle_tilt_z); + y2 = y * cosf (priv->angle_tilt_z * (G_PI / 180.0)) + + x * sinf (priv->angle_tilt_z * (G_PI / 180.0)); - x = CLUTTER_FIXED_TO_INT (x2); - y = CLUTTER_FIXED_TO_INT (y2); + x = (x2); + y = (y2); } if (priv->angle_tilt_x) { - ClutterFixed z2, y2; + gfloat z2, y2; - z2 = - y * clutter_sini (priv->angle_tilt_x); + z2 = - y * sinf (priv->angle_tilt_x * (G_PI / 180.0)); + y2 = y * cosf (priv->angle_tilt_x * (G_PI / 180.0)); - y2 = y * clutter_cosi (priv->angle_tilt_x); - - z = CLUTTER_FIXED_TO_INT (z2); - y = CLUTTER_FIXED_TO_INT (y2); + z = z2; + y = y2; } if (priv->angle_tilt_y) { - ClutterFixed x2, z2; + gfloat x2, z2; - x2 = x * clutter_cosi (priv->angle_tilt_y) - - z * clutter_sini (priv->angle_tilt_y); + x2 = x * cosf (priv->angle_tilt_y * (G_PI / 180.0)) + - z * sinf (priv->angle_tilt_y * (G_PI / 180.0)); - z2 = z * clutter_cosi (priv->angle_tilt_y) - + x * clutter_sini (priv->angle_tilt_y); + z2 = z * cosf (priv->angle_tilt_y * (G_PI / 180.0)) + + x * sinf (priv->angle_tilt_y * (G_PI / 180.0)); - x = CLUTTER_FIXED_TO_INT (x2); - z = CLUTTER_FIXED_TO_INT (z2); + x = x2; + z = z2; } knot->x = x; knot->y = y; knot->z = z; - CLUTTER_NOTE (BEHAVIOUR, "advancing to angle %d [%d, %d] (a: %d, b: %d)", + CLUTTER_NOTE (BEHAVIOUR, "advancing to angle %.2f [%d, %d] (a: %d, b: %d)", angle, knot->x, knot->y, priv->a, priv->b); @@ -178,51 +177,52 @@ ClutterActor *actor, gpointer data) { + ClutterBehaviourEllipsePrivate *priv; knot3d *knot = data; + priv = ((ClutterBehaviourEllipse *) behave)->priv; + clutter_actor_set_position (actor, knot->x, knot->y); - clutter_actor_set_depth (actor, knot->z); + + if (priv->angle_tilt_x != 0 || priv->angle_tilt_y != 0) + clutter_actor_set_depth (actor, knot->z); } -static inline ClutterAngle -clamp_angle (ClutterAngle a) +static inline float +clamp_angle (float a) { - ClutterAngle a1, a2; gint rounds; - /* Need to add the 256 offset here, since the user space 0 maps to our - * -256 - */ - rounds = (a+256) / 1024; - a1 = rounds * 1024; - a2 = a - a1; + rounds = a / 360; + if (a < 0) + rounds--; - return a2; + return a - 360 * rounds; } static void clutter_behaviour_ellipse_alpha_notify (ClutterBehaviour *behave, - guint32 alpha) + gdouble alpha) { ClutterBehaviourEllipse *self = CLUTTER_BEHAVIOUR_ELLIPSE (behave); ClutterBehaviourEllipsePrivate *priv = self->priv; - ClutterAngle start, end; + gfloat start, end; + gfloat angle = 0; knot3d knot; - ClutterAngle angle = 0; start = priv->angle_start; end = priv->angle_end; if (priv->direction == CLUTTER_ROTATE_CW && start >= end) { - end += 1024; + end += 360; } else if (priv->direction == CLUTTER_ROTATE_CCW && start <= end) { - end -= 1024; + end -= 360; } - angle = (end - start) * alpha / CLUTTER_ALPHA_MAX_ALPHA + start; + angle = (end - start) * alpha + start; clutter_behaviour_ellipse_advance (self, angle, &knot); @@ -244,30 +244,25 @@ switch (prop_id) { case PROP_ANGLE_START: - priv->angle_start = - CLUTTER_ANGLE_FROM_DEG (g_value_get_double (value)) - 256; + priv->angle_start = g_value_get_double (value); break; case PROP_ANGLE_END: - priv->angle_end = - CLUTTER_ANGLE_FROM_DEG (g_value_get_double (value)) - 256; + priv->angle_end = g_value_get_double (value); break; case PROP_ANGLE_TILT_X: - priv->angle_tilt_x = - CLUTTER_ANGLE_FROM_DEG (g_value_get_double (value)); + priv->angle_tilt_x = g_value_get_double (value); break; case PROP_ANGLE_TILT_Y: - priv->angle_tilt_y = - CLUTTER_ANGLE_FROM_DEG (g_value_get_double (value)); + priv->angle_tilt_y = g_value_get_double (value); break; case PROP_ANGLE_TILT_Z: - priv->angle_tilt_z = - CLUTTER_ANGLE_FROM_DEG (g_value_get_double (value)); + priv->angle_tilt_z = g_value_get_double (value); break; case PROP_WIDTH: - priv->a = g_value_get_int (value) >> 1; + priv->a = g_value_get_int (value) / 2; break; case PROP_HEIGHT: - priv->b = g_value_get_int (value) >> 1; + priv->b = g_value_get_int (value) / 2; break; case PROP_CENTER: { @@ -298,30 +293,25 @@ switch (prop_id) { case PROP_ANGLE_START: - g_value_set_double (value, - CLUTTER_ANGLE_TO_DEG (priv->angle_start + 256)); + g_value_set_double (value, priv->angle_start); break; case PROP_ANGLE_END: - g_value_set_double (value, - CLUTTER_ANGLE_TO_DEG (priv->angle_end + 256)); + g_value_set_double (value, priv->angle_end); break; case PROP_ANGLE_TILT_X: - g_value_set_double (value, - CLUTTER_ANGLE_TO_DEG (priv->angle_tilt_x)); + g_value_set_double (value, priv->angle_tilt_x); break; case PROP_ANGLE_TILT_Y: - g_value_set_double (value, - CLUTTER_ANGLE_TO_DEG (priv->angle_tilt_y)); + g_value_set_double (value, priv->angle_tilt_y); break; case PROP_ANGLE_TILT_Z: - g_value_set_double (value, - CLUTTER_ANGLE_TO_DEG (priv->angle_tilt_z)); + g_value_set_double (value, priv->angle_tilt_z); break; case PROP_WIDTH: - g_value_set_int (value, (priv->a << 1)); + g_value_set_int (value, (priv->a * 2)); break; case PROP_HEIGHT: - g_value_set_int (value, (priv->b << 1)); + g_value_set_int (value, (priv->b * 2)); break; case PROP_CENTER: g_value_set_boxed (value, &priv->center); @@ -340,7 +330,7 @@ ClutterActor *actor) { ClutterBehaviourEllipse *e = CLUTTER_BEHAVIOUR_ELLIPSE (behave); - ClutterBehaviourEllipsePrivate *priv = e->priv;; + ClutterBehaviourEllipsePrivate *priv = e->priv; knot3d knot = { 0, }; clutter_behaviour_ellipse_advance (e, priv->angle_start, &knot); @@ -510,12 +500,8 @@ priv->direction = CLUTTER_ROTATE_CW; - /* The inital values have to reflect the 90 degree offset between the normal - * mathematical space and the clutter clock-based space; the default end - * value of 360 is clamped to 0. - */ - priv->angle_start = -256; - priv->angle_end = -256; + priv->angle_start = 0; + priv->angle_end = 0; } /** @@ -608,8 +594,8 @@ "width", width, "height", height, "direction", direction, - "angle-start", CLUTTER_ANGLE_FROM_DEGX (start), - "angle-end", CLUTTER_ANGLE_FROM_DEGX (end), + "angle-start", (double)CLUTTER_FIXED_TO_FLOAT (start), + "angle-end", (double)CLUTTER_FIXED_TO_FLOAT (end), NULL); } @@ -692,9 +678,9 @@ priv = self->priv; - if (priv->a != width >> 1) + if (priv->a != width / 2) { - priv->a = width >> 1; + priv->a = width / 2; g_object_notify (G_OBJECT (self), "width"); } @@ -715,7 +701,7 @@ { g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self), 0); - return self->priv->a << 1; + return self->priv->a * 2; } /** @@ -737,9 +723,9 @@ priv = self->priv; - if (priv->b != height >> 1) + if (priv->b != height / 2) { - priv->b = height >> 1; + priv->b = height / 2; g_object_notify (G_OBJECT (self), "height"); } @@ -760,7 +746,7 @@ { g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self), 0); - return self->priv->b << 1; + return self->priv->b * 2; } /** @@ -777,10 +763,11 @@ clutter_behaviour_ellipse_set_angle_start (ClutterBehaviourEllipse *self, gdouble angle_start) { + ClutterFixed new_angle = CLUTTER_FLOAT_TO_FIXED (angle_start); + g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self)); - clutter_behaviour_ellipse_set_angle_startx (self, - CLUTTER_FLOAT_TO_FIXED (angle_start)); + clutter_behaviour_ellipse_set_angle_startx (self, new_angle); } /** @@ -799,10 +786,10 @@ ClutterFixed angle_start) { ClutterBehaviourEllipsePrivate *priv; - ClutterAngle new_angle; + float new_angle; g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self)); - new_angle = clamp_angle (CLUTTER_ANGLE_FROM_DEGX (angle_start) - 256); + new_angle = clamp_angle (CLUTTER_FIXED_TO_FLOAT (angle_start)); priv = self->priv; if (priv->angle_start != new_angle) @@ -827,7 +814,7 @@ { g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self), 0.0); - return CLUTTER_ANGLE_TO_DEG (self->priv->angle_start + 256); + return (double)self->priv->angle_start; } /** @@ -845,7 +832,7 @@ { g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self), 0); - return CLUTTER_ANGLE_TO_DEGX (self->priv->angle_start); + return CLUTTER_FLOAT_TO_FIXED (self->priv->angle_start); } /** @@ -862,10 +849,11 @@ clutter_behaviour_ellipse_set_angle_end (ClutterBehaviourEllipse *self, gdouble angle_end) { + ClutterFixed new_angle = CLUTTER_FLOAT_TO_FIXED (angle_end); + g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self)); - clutter_behaviour_ellipse_set_angle_endx (self, - CLUTTER_FLOAT_TO_FIXED (angle_end)); + clutter_behaviour_ellipse_set_angle_endx (self, new_angle); } /** @@ -884,11 +872,11 @@ ClutterFixed angle_end) { ClutterBehaviourEllipsePrivate *priv; - ClutterAngle new_angle; + float new_angle; g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self)); - new_angle = clamp_angle (CLUTTER_ANGLE_FROM_DEGX (angle_end) - 256); + new_angle = clamp_angle (CLUTTER_FIXED_TO_FLOAT (angle_end)); priv = self->priv; @@ -915,7 +903,7 @@ { g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self), 0.0); - return CLUTTER_ANGLE_TO_DEG (self->priv->angle_end + 256); + return self->priv->angle_end; } /** @@ -933,7 +921,7 @@ { g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self), 0); - return CLUTTER_ANGLE_TO_DEGX (self->priv->angle_end); + return CLUTTER_FLOAT_TO_FIXED (self->priv->angle_end); } /** @@ -952,11 +940,11 @@ ClutterRotateAxis axis, gdouble angle_tilt) { + ClutterFixed new_angle = CLUTTER_FLOAT_TO_FIXED (angle_tilt); + g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self)); - clutter_behaviour_ellipse_set_angle_tiltx (self, - axis, - CLUTTER_FLOAT_TO_FIXED (angle_tilt)); + clutter_behaviour_ellipse_set_angle_tiltx (self, axis, new_angle); } /** @@ -976,11 +964,11 @@ ClutterFixed angle_tilt) { ClutterBehaviourEllipsePrivate *priv; - ClutterAngle new_angle; + float new_angle; g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self)); - new_angle = CLUTTER_ANGLE_FROM_DEGX (angle_tilt); + new_angle = CLUTTER_FIXED_TO_FLOAT (angle_tilt); priv = self->priv; @@ -1035,11 +1023,11 @@ switch (axis) { case CLUTTER_X_AXIS: - return CLUTTER_ANGLE_TO_DEG (self->priv->angle_tilt_x); + return self->priv->angle_tilt_x; case CLUTTER_Y_AXIS: - return CLUTTER_ANGLE_TO_DEG (self->priv->angle_tilt_y); + return self->priv->angle_tilt_y; case CLUTTER_Z_AXIS: - return CLUTTER_ANGLE_TO_DEG (self->priv->angle_tilt_z); + return self->priv->angle_tilt_z; } return 0; @@ -1065,11 +1053,11 @@ switch (axis) { case CLUTTER_X_AXIS: - return CLUTTER_ANGLE_TO_DEGX (self->priv->angle_tilt_x); + return CLUTTER_FLOAT_TO_FIXED (self->priv->angle_tilt_x); case CLUTTER_Y_AXIS: - return CLUTTER_ANGLE_TO_DEGX (self->priv->angle_tilt_y); + return CLUTTER_FLOAT_TO_FIXED (self->priv->angle_tilt_y); case CLUTTER_Z_AXIS: - return CLUTTER_ANGLE_TO_DEGX (self->priv->angle_tilt_z); + return CLUTTER_FLOAT_TO_FIXED (self->priv->angle_tilt_z); } return 0; @@ -1093,13 +1081,13 @@ gdouble angle_tilt_z) { ClutterBehaviourEllipsePrivate *priv; - ClutterAngle new_angle_x, new_angle_y, new_angle_z; + float new_angle_x, new_angle_y, new_angle_z; g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self)); - new_angle_x = CLUTTER_ANGLE_FROM_DEG (angle_tilt_x); - new_angle_y = CLUTTER_ANGLE_FROM_DEG (angle_tilt_y); - new_angle_z = CLUTTER_ANGLE_FROM_DEG (angle_tilt_z); + new_angle_x = (float)angle_tilt_x; + new_angle_y = (float)angle_tilt_y; + new_angle_z = (float)angle_tilt_z; priv = self->priv; @@ -1147,13 +1135,13 @@ ClutterFixed angle_tilt_z) { ClutterBehaviourEllipsePrivate *priv; - ClutterAngle new_angle_x, new_angle_y, new_angle_z; + float new_angle_x, new_angle_y, new_angle_z; g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self)); - new_angle_x = CLUTTER_ANGLE_FROM_DEGX (angle_tilt_x); - new_angle_y = CLUTTER_ANGLE_FROM_DEGX (angle_tilt_y); - new_angle_z = CLUTTER_ANGLE_FROM_DEGX (angle_tilt_z); + new_angle_x = CLUTTER_FIXED_TO_FLOAT (angle_tilt_x); + new_angle_y = CLUTTER_FIXED_TO_FLOAT (angle_tilt_y); + new_angle_z = CLUTTER_FIXED_TO_FLOAT (angle_tilt_z); priv = self->priv; @@ -1207,13 +1195,13 @@ priv = self->priv; if (angle_tilt_x) - *angle_tilt_x = CLUTTER_ANGLE_TO_DEG (priv->angle_tilt_x); + *angle_tilt_x = priv->angle_tilt_x; if (angle_tilt_y) - *angle_tilt_y = CLUTTER_ANGLE_TO_DEG (priv->angle_tilt_y); + *angle_tilt_y = priv->angle_tilt_y; if (angle_tilt_z) - *angle_tilt_z = CLUTTER_ANGLE_TO_DEG (priv->angle_tilt_z); + *angle_tilt_z = priv->angle_tilt_z; } /** @@ -1243,13 +1231,13 @@ priv = self->priv; if (angle_tilt_x) - *angle_tilt_x = CLUTTER_ANGLE_TO_DEGX (priv->angle_tilt_x); + *angle_tilt_x = priv->angle_tilt_x; if (angle_tilt_y) - *angle_tilt_y = CLUTTER_ANGLE_TO_DEGX (priv->angle_tilt_y); + *angle_tilt_y = priv->angle_tilt_y; if (angle_tilt_z) - *angle_tilt_z = CLUTTER_ANGLE_TO_DEGX (priv->angle_tilt_z); + *angle_tilt_z = priv->angle_tilt_z; } /** diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-behaviour-ellipse.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-behaviour-ellipse.h --- clutter-0.8.4/clutter/clutter-behaviour-ellipse.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-behaviour-ellipse.h 2009-01-28 08:12:44.000000000 +0000 @@ -18,11 +18,13 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __CLUTTER_BEHAVIOUR_ELLIPSE_H__ #define __CLUTTER_BEHAVIOUR_ELLIPSE_H__ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-behaviour.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-behaviour.h --- clutter-0.8.4/clutter/clutter-behaviour.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-behaviour.h 2009-01-28 08:12:44.000000000 +0000 @@ -23,8 +23,12 @@ * License along with this library. If not, see . */ -#ifndef _HAVE_CLUTTER_BEHAVIOUR_H -#define _HAVE_CLUTTER_BEHAVIOUR_H +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_BEHAVIOUR_H__ +#define __CLUTTER_BEHAVIOUR_H__ #include #include @@ -109,7 +113,7 @@ /*< public >*/ /* vfunc, not signal */ void (*alpha_notify) (ClutterBehaviour *behave, - guint32 alpha_value); + gdouble alpha_value); /* signals */ void (*applied) (ClutterBehaviour *behave, diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-behaviour-opacity.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-behaviour-opacity.c --- clutter-0.8.4/clutter/clutter-behaviour-opacity.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-behaviour-opacity.c 2009-01-28 08:12:44.000000000 +0000 @@ -87,7 +87,7 @@ static void clutter_behaviour_alpha_notify (ClutterBehaviour *behave, - guint32 alpha_value) + gdouble alpha_value) { ClutterBehaviourOpacityPrivate *priv; guint8 opacity; @@ -96,10 +96,9 @@ opacity = alpha_value * (priv->opacity_end - priv->opacity_start) - / CLUTTER_ALPHA_MAX_ALPHA + priv->opacity_start; - CLUTTER_NOTE (BEHAVIOUR, "alpha: %u, opacity: %u", + CLUTTER_NOTE (BEHAVIOUR, "alpha: %.4f, opacity: %u", alpha_value, opacity); diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-behaviour-opacity.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-behaviour-opacity.h --- clutter-0.8.4/clutter/clutter-behaviour-opacity.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-behaviour-opacity.h 2009-01-28 08:12:44.000000000 +0000 @@ -20,11 +20,13 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __CLUTTER_BEHAVIOUR_OPACITY_H__ #define __CLUTTER_BEHAVIOUR_OPACITY_H__ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-behaviour-path.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-behaviour-path.c --- clutter-0.8.4/clutter/clutter-behaviour-path.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-behaviour-path.c 2009-01-28 08:12:44.000000000 +0000 @@ -25,20 +25,29 @@ /** * SECTION:clutter-behaviour-path - * @short_description: A behaviour interpolating position along a path + * @short_description: A behaviour for moving actors along a #ClutterPath * * #ClutterBehaviourPath interpolates actors along a defined path. * - * A path is a set of #ClutterKnots object given when creating a new - * #ClutterBehaviourPath instance. Knots can be also added to the path - * using clutter_behaviour_path_append_knot(). The whole path can be - * cleared using clutter_behaviour_path_clear(). Each time the behaviour - * reaches a knot in the path, the "knot-reached" signal is emitted. - * - * This first knot in the path is reached with the lower bound value - * provided by the #ClutterAlpha objectused by the behaviour; the last - * knot in the path is reached with the upper bound value provided by - * the #ClutterAlpha object used by the behaviour. + * A path is described by a #ClutterPath object. The path can contain + * straight line parts and bezier curves. If the path contains + * %CLUTTER_PATH_MOVE_TO parts then the actors will jump to those + * coordinates. This can be used make disjoint paths. + * + * When creating a path behaviour in a #ClutterScript, you can specify + * the path property directly as a string. For example: + * + * |[ + * { + * "id" : "spline-path", + * "type" : "ClutterBehaviourPath", + * "path" : "M 50 50 L 100 100", + * "alpha" : { + * "timeline" : "main-timeline", + * "function" : "ramp + * } + * } + * ]| * * If the alpha function is a periodic function, i.e. it returns to * 0 after reaching %CLUTTER_ALPHA_MAX_ALPHA, then the actors will walk @@ -54,13 +63,14 @@ #include "clutter-actor.h" #include "clutter-behaviour.h" #include "clutter-behaviour-path.h" +#include "clutter-bezier.h" #include "clutter-debug.h" #include "clutter-enum-types.h" #include "clutter-main.h" #include "clutter-marshal.h" #include "clutter-private.h" -#include "clutter-scriptable.h" #include "clutter-script-private.h" +#include "clutter-scriptable.h" #include @@ -68,14 +78,14 @@ G_DEFINE_TYPE_WITH_CODE (ClutterBehaviourPath, clutter_behaviour_path, - CLUTTER_TYPE_BEHAVIOUR, + CLUTTER_TYPE_BEHAVIOUR, G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_SCRIPTABLE, clutter_scriptable_iface_init)); struct _ClutterBehaviourPathPrivate { - GSList *knots; - ClutterKnot *last_knot_passed; + ClutterPath *path; + guint last_knot_passed; }; #define CLUTTER_BEHAVIOUR_PATH_GET_PRIVATE(obj) \ @@ -96,73 +106,10 @@ { PROP_0, - PROP_KNOT + PROP_PATH }; static void -clutter_behaviour_path_finalize (GObject *object) -{ - ClutterBehaviourPath *self = CLUTTER_BEHAVIOUR_PATH(object); - - g_slist_foreach (self->priv->knots, (GFunc) clutter_knot_free, NULL); - g_slist_free (self->priv->knots); - - G_OBJECT_CLASS (clutter_behaviour_path_parent_class)->finalize (object); -} - -static inline void -interpolate (const ClutterKnot *start, - const ClutterKnot *end, - ClutterKnot *out, - ClutterFixed t) -{ - out->x = start->x + CLUTTER_FIXED_TO_INT (t * (end->x - start->x)); - out->y = start->y + CLUTTER_FIXED_TO_INT (t * (end->y - start->y)); -} - -static gint -node_distance (const ClutterKnot *start, - const ClutterKnot *end) -{ - gint t; - - g_return_val_if_fail (start != NULL, 0); - g_return_val_if_fail (end != NULL, 0); - - if (clutter_knot_equal (start, end)) - return 0; - - t = (end->x - start->x) * (end->x - start->x) + - (end->y - start->y) * (end->y - start->y); - - /* - * If we are using limited precision sqrti implementation, fallback on - * clib sqrt if the precission would be less than 10% - */ -#if INT_MAX > CLUTTER_SQRTI_ARG_10_PERCENT - if (t <= CLUTTER_SQRTI_ARG_10_PERCENT) - return clutter_sqrti (t); - else - return CLUTTER_FLOAT_TO_INT(sqrt(t)); -#else - return clutter_sqrti (t); -#endif -} - -static gint -path_total_length (ClutterBehaviourPath *behave) -{ - GSList *l; - gint len = 0; - - for (l = behave->priv->knots; l != NULL; l = l->next) - if (l->next && l->next->data) - len += node_distance (l->data, l->next->data); - - return len; -} - -static void actor_apply_knot_foreach (ClutterBehaviour *behaviour, ClutterActor *actor, gpointer data) @@ -175,105 +122,50 @@ } static void -path_alpha_to_position (ClutterBehaviourPath *behave, - guint32 alpha) +clutter_behaviour_path_alpha_notify (ClutterBehaviour *behave, + gdouble alpha_value) { - ClutterBehaviourPathPrivate *priv = behave->priv; - ClutterBehaviour *behaviour = CLUTTER_BEHAVIOUR (behave); - GSList *l; - gint total_len, offset, dist = 0; - - /* FIXME: Optimise. Much of the data used here can be pre-generated - * ( total_len, dist between knots ) when knots are added/removed. - */ - - /* Calculation as follows: - * o Get total length of path - * o Find the offset on path where alpha val corresponds to - * o Figure out between which knots this offset lies. - * o Interpolate new co-ords via dist between these knots - * o Apply to actors. - */ - - total_len = path_total_length (behave); - offset = (alpha * total_len) / CLUTTER_ALPHA_MAX_ALPHA; - - CLUTTER_NOTE (BEHAVIOUR, "alpha %i vs %i, len: %i vs %i", - alpha, CLUTTER_ALPHA_MAX_ALPHA, - offset, total_len); + ClutterBehaviourPath *pathb = CLUTTER_BEHAVIOUR_PATH (behave); + ClutterBehaviourPathPrivate *priv = pathb->priv; + ClutterKnot position; + guint knot_num; - if (offset == 0) + if (priv->path) + knot_num = clutter_path_get_position (priv->path, alpha_value, &position); + else { - /* first knot */ - clutter_behaviour_actors_foreach (behaviour, - actor_apply_knot_foreach, - priv->knots->data); - - priv->last_knot_passed = (ClutterKnot*)priv->knots->data; - g_signal_emit (behave, path_signals[KNOT_REACHED], 0, - priv->knots->data); - return; + memset (&position, 0, sizeof (position)); + knot_num = 0; } - if (offset == total_len) - { - /* Special case for last knot */ - ClutterKnot *last_knot = (g_slist_last (priv->knots))->data; - - clutter_behaviour_actors_foreach (behaviour, - actor_apply_knot_foreach, - last_knot); + clutter_behaviour_actors_foreach (behave, + actor_apply_knot_foreach, + &position); - priv->last_knot_passed = (ClutterKnot*)priv->knots->data; - g_signal_emit (behave, path_signals[KNOT_REACHED], 0, last_knot); - - return; - } - - for (l = priv->knots; l != NULL; l = l->next) + if (knot_num != priv->last_knot_passed) { - gint dist_to_next = 0; - ClutterKnot *knot = l->data; - - if (l->next) - { - ClutterKnot *next = l->next->data; - - dist_to_next = node_distance (knot, next); - - if (offset >= dist && offset < (dist + dist_to_next)) - { - ClutterKnot new; - ClutterFixed t; - - t = CLUTTER_INT_TO_FIXED (offset - dist) / dist_to_next; - - interpolate (knot, next, &new, t); - - clutter_behaviour_actors_foreach (behaviour, - actor_apply_knot_foreach, - &new); - - if (knot != priv->last_knot_passed) - { - /* We just passed a new Knot */ - priv->last_knot_passed = knot; - g_signal_emit (behave, path_signals[KNOT_REACHED], 0, knot); - } - - return; - } - } - - dist += dist_to_next; + g_signal_emit (behave, path_signals[KNOT_REACHED], 0, knot_num); + priv->last_knot_passed = knot_num; } } static void -clutter_behaviour_path_alpha_notify (ClutterBehaviour *behave, - guint32 alpha_value) +clutter_behaviour_path_get_property (GObject *gobject, + guint prop_id, + GValue *value, + GParamSpec *pspec) { - path_alpha_to_position (CLUTTER_BEHAVIOUR_PATH (behave), alpha_value); + ClutterBehaviourPath *pathb = CLUTTER_BEHAVIOUR_PATH (gobject); + + switch (prop_id) + { + case PROP_PATH: + g_value_set_object (value, clutter_behaviour_path_get_path (pathb)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } } static void @@ -286,8 +178,8 @@ switch (prop_id) { - case PROP_KNOT: - clutter_behaviour_path_append_knot (pathb, g_value_get_boxed (value)); + case PROP_PATH: + clutter_behaviour_path_set_path (pathb, g_value_get_object (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); @@ -296,33 +188,38 @@ } static void +clutter_behaviour_path_dispose (GObject *gobject) +{ + ClutterBehaviourPath *pathb = CLUTTER_BEHAVIOUR_PATH (gobject); + + clutter_behaviour_path_set_path (pathb, NULL); + + G_OBJECT_CLASS (clutter_behaviour_path_parent_class)->dispose (gobject); +} + +static void clutter_behaviour_path_class_init (ClutterBehaviourPathClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); ClutterBehaviourClass *behave_class = CLUTTER_BEHAVIOUR_CLASS (klass); + GParamSpec *pspec; + gobject_class->get_property = clutter_behaviour_path_get_property; gobject_class->set_property = clutter_behaviour_path_set_property; - gobject_class->finalize = clutter_behaviour_path_finalize; + gobject_class->dispose = clutter_behaviour_path_dispose; - /** - * ClutterBehaviourPath:knot: - * - * This property can be used to append a new knot to the path. - * - * Since: 0.2 - */ - g_object_class_install_property (gobject_class, - PROP_KNOT, - g_param_spec_boxed ("knot", - "Knot", - "Can be used to append a knot to the path", - CLUTTER_TYPE_KNOT, - CLUTTER_PARAM_WRITABLE)); + pspec = g_param_spec_object ("path", + "Path", + "The ClutterPath object representing the path " + "to animate along", + CLUTTER_TYPE_PATH, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_PATH, pspec); /** * ClutterBehaviourPath::knot-reached: * @pathb: the object which received the signal - * @knot: the #ClutterKnot reached + * @knot_num: the index of the #ClutterPathKnot reached * * This signal is emitted each time a node defined inside the path * is reached. @@ -335,51 +232,16 @@ G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ClutterBehaviourPathClass, knot_reached), NULL, NULL, - clutter_marshal_VOID__BOXED, + clutter_marshal_VOID__UINT, G_TYPE_NONE, 1, - CLUTTER_TYPE_KNOT); + G_TYPE_UINT); behave_class->alpha_notify = clutter_behaviour_path_alpha_notify; g_type_class_add_private (klass, sizeof (ClutterBehaviourPathPrivate)); } -static void -clutter_behaviour_path_init (ClutterBehaviourPath *self) -{ - ClutterBehaviourPathPrivate *priv; - - self->priv = priv = CLUTTER_BEHAVIOUR_PATH_GET_PRIVATE (self); -} - -static void -clutter_behaviour_path_set_custom_property (ClutterScriptable *scriptable, - ClutterScript *script, - const gchar *name, - const GValue *value) -{ - if (strcmp (name, "knots") == 0) - { - ClutterBehaviourPath *path = CLUTTER_BEHAVIOUR_PATH (scriptable); - GSList *knots, *l; - - if (!G_VALUE_HOLDS (value, G_TYPE_POINTER)) - return; - - knots = g_value_get_pointer (value); - for (l = knots; l != NULL; l = l->next) - { - ClutterKnot *knot = l->data; - - clutter_behaviour_path_append_knot (path, knot); - clutter_knot_free (knot); - } - - g_slist_free (knots); - } - else - g_object_set_property (G_OBJECT (scriptable), name, value); -} +static ClutterScriptableIface *parent_scriptable_iface = NULL; static gboolean clutter_behaviour_path_parse_custom_node (ClutterScriptable *scriptable, @@ -388,237 +250,190 @@ const gchar *name, JsonNode *node) { - if (strcmp (name, "knots") == 0) + if (strcmp ("path", name) == 0) { - JsonArray *array; - guint knots_len, i; - GSList *knots = NULL; - - array = json_node_get_array (node); - knots_len = json_array_get_length (array); - - for (i = 0; i < knots_len; i++) - { - JsonNode *val = json_array_get_element (array, i); - ClutterKnot knot = { 0, }; - - if (clutter_script_parse_knot (script, val, &knot)) - { - CLUTTER_NOTE (SCRIPT, "parsed knot [ x:%d, y:%d ]", - knot.x, knot.y); - - knots = g_slist_prepend (knots, clutter_knot_copy (&knot)); - } - } + ClutterPath *path; + GValue node_value = { 0 }; + + path = g_object_ref_sink (clutter_path_new ()); + + json_node_get_value (node, &node_value); - g_value_init (value, G_TYPE_POINTER); - g_value_set_pointer (value, g_slist_reverse (knots)); + if (!G_VALUE_HOLDS (&node_value, G_TYPE_STRING) + || !clutter_path_set_description (path, + g_value_get_string (&node_value))) + g_warning ("Invalid path description"); + + g_value_unset (&node_value); + + g_value_init (value, G_TYPE_OBJECT); + g_value_take_object (value, path); return TRUE; } - - return FALSE; + /* chain up */ + else if (parent_scriptable_iface->parse_custom_node) + return parent_scriptable_iface->parse_custom_node (scriptable, script, + value, name, node); + else + return FALSE; } static void clutter_scriptable_iface_init (ClutterScriptableIface *iface) { + parent_scriptable_iface = g_type_interface_peek_parent (iface); + + if (!parent_scriptable_iface) + parent_scriptable_iface + = g_type_default_interface_peek (CLUTTER_TYPE_SCRIPTABLE); + iface->parse_custom_node = clutter_behaviour_path_parse_custom_node; - iface->set_custom_property = clutter_behaviour_path_set_custom_property; +} + +static void +clutter_behaviour_path_init (ClutterBehaviourPath *self) +{ + ClutterBehaviourPathPrivate *priv; + + self->priv = priv = CLUTTER_BEHAVIOUR_PATH_GET_PRIVATE (self); + + priv->path = NULL; + priv->last_knot_passed = G_MAXUINT; } /** * clutter_behaviour_path_new: * @alpha: a #ClutterAlpha, or %NULL - * @knots: a list of #ClutterKnots, or %NULL for an empty path - * @n_knots: the number of nodes in the path + * @path: a #ClutterPath or %NULL for an empty path * * Creates a new path behaviour. You can use this behaviour to drive - * actors along the nodes of a path, described by the @knots. + * actors along the nodes of a path, described by @path. + * + * This will claim the floating reference on the #ClutterPath so you + * do not need to unref if it. * * Return value: a #ClutterBehaviour * * Since: 0.2 */ ClutterBehaviour * -clutter_behaviour_path_new (ClutterAlpha *alpha, - const ClutterKnot *knots, - guint n_knots) -{ - ClutterBehaviourPath *behave; - gint i; - - behave = g_object_new (CLUTTER_TYPE_BEHAVIOUR_PATH, - "alpha", alpha, - NULL); - - for (i = 0; i < n_knots; i++) - { - ClutterKnot knot = knots[i]; - - clutter_behaviour_path_append_knot (behave, &knot); - } - - return CLUTTER_BEHAVIOUR (behave); +clutter_behaviour_path_new (ClutterAlpha *alpha, + ClutterPath *path) +{ + return g_object_new (CLUTTER_TYPE_BEHAVIOUR_PATH, + "alpha", alpha, + "path", path, + NULL); } /** - * clutter_behaviour_path_get_knots: - * @pathb: a #ClutterBehvaiourPath + * clutter_behaviour_path_new_with_description: + * @alpha: a #ClutterAlpha + * @desc: a string description of the path * - * Returns a copy of the list of knots contained by @pathb + * Creates a new path behaviour using the path described by @desc. See + * clutter_path_add_string() for a description of the format. * - * Return value: a #GSList of the paths knots. + * Return value: a #ClutterBehaviour * - * Since: 0.2 + * Since: 1.0 */ -GSList * -clutter_behaviour_path_get_knots (ClutterBehaviourPath *pathb) +ClutterBehaviour * +clutter_behaviour_path_new_with_description (ClutterAlpha *alpha, + const gchar *desc) { - GSList *retval, *l; - - g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_PATH (pathb), NULL); - - retval = NULL; - for (l = pathb->priv->knots; l != NULL; l = l->next) - retval = g_slist_prepend (retval, l->data); - - return g_slist_reverse (retval); + return g_object_new (CLUTTER_TYPE_BEHAVIOUR_PATH, + "alpha", alpha, + "path", clutter_path_new_with_description (desc), + NULL); } /** - * clutter_behaviour_path_append_knot: - * @pathb: a #ClutterBehvaiourPath - * @knot: a #ClutterKnot to append. + * clutter_behaviour_path_new_with_knots: + * @alpha: a #ClutterAlpha + * @knots: an array of #ClutterKnots + * @n_knots: number of entries in @knots + * + * Creates a new path behaviour that will make the actors visit all of + * the given knots in order with straight lines in between. + * + * A path will be created where the first knot is used in a + * %CLUTTER_PATH_MOVE_TO and the subsequent knots are used in + * %CLUTTER_PATH_LINE_TOs. * - * Appends a #ClutterKnot to the path + * Return value: a #ClutterBehaviour * - * Since: 0.2 + * Since: 1.0 */ -void -clutter_behaviour_path_append_knot (ClutterBehaviourPath *pathb, - const ClutterKnot *knot) +ClutterBehaviour * +clutter_behaviour_path_new_with_knots (ClutterAlpha *alpha, + const ClutterKnot *knots, + guint n_knots) { - ClutterBehaviourPathPrivate *priv; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_PATH (pathb)); - g_return_if_fail (knot != NULL); + ClutterPath *path = clutter_path_new (); + guint i; - priv = pathb->priv; - priv->knots = g_slist_append (priv->knots, clutter_knot_copy (knot)); -} - -/** - * clutter_behaviour_path_insert_knot: - * @pathb: a #ClutterBehvaiourPath - * @offset: position in path to insert knot. - * @knot: a #ClutterKnot to append. - * - * Inserts a #ClutterKnot in the path at specified position. Values greater - * than total number of knots will append the knot at the end of path. - * - * Since: 0.2 - */ -void -clutter_behaviour_path_insert_knot (ClutterBehaviourPath *pathb, - guint offset, - const ClutterKnot *knot) -{ - ClutterBehaviourPathPrivate *priv; + if (n_knots > 0) + { + clutter_path_add_move_to (path, knots[0].x, knots[0].y); - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_PATH (pathb)); - g_return_if_fail (knot != NULL); + for (i = 1; i < n_knots; i++) + clutter_path_add_line_to (path, knots[i].x, knots[i].y); + } - priv = pathb->priv; - priv->knots = g_slist_insert (priv->knots, clutter_knot_copy (knot), offset); + return g_object_new (CLUTTER_TYPE_BEHAVIOUR_PATH, + "alpha", alpha, + "path", path, + NULL); } /** - * clutter_behaviour_path_remove_knot: - * @pathb: a #ClutterBehvaiourPath - * @offset: position in path to remove knot. - * - * Removes a #ClutterKnot in the path at specified offset. + * clutter_behaviour_path_set_path: + * @pathb: the path behaviour + * @path: the new path to follow + * + * Change the path that the actors will follow. This will take the + * floating reference on the #ClutterPath so you do not need to unref + * it. * - * Since: 0.2 + * Since: 1.0 */ void -clutter_behaviour_path_remove_knot (ClutterBehaviourPath *pathb, - guint offset) +clutter_behaviour_path_set_path (ClutterBehaviourPath *pathb, + ClutterPath *path) { ClutterBehaviourPathPrivate *priv; - GSList *togo; g_return_if_fail (CLUTTER_IS_BEHAVIOUR_PATH (pathb)); priv = pathb->priv; - togo = g_slist_nth (priv->knots, offset); + if (path) + g_object_ref_sink (path); - if (togo) - { - clutter_knot_free ((ClutterKnot*)togo->data); - priv->knots = g_slist_delete_link (priv->knots, togo); - } -} + if (priv->path) + g_object_unref (priv->path); -static void -clutter_behaviour_path_append_knots_valist (ClutterBehaviourPath *pathb, - const ClutterKnot *first_knot, - va_list args) -{ - const ClutterKnot * knot; + priv->path = path; - knot = first_knot; - while (knot) - { - clutter_behaviour_path_append_knot (pathb, knot); - knot = va_arg (args, ClutterKnot*); - } + g_object_notify (G_OBJECT (pathb), "path"); } /** - * clutter_behaviour_path_append_knots: - * @pathb: a #ClutterBehvaiourPath - * @first_knot: the #ClutterKnot knot to add to the path - * @Varargs: additional knots to add to the path - * - * Adds a NULL-terminated list of knots to a path. This function is - * equivalent to calling clutter_behaviour_path_append_knot() for each - * member of the list. + * clutter_behaviour_path_get_path: + * @pathb: a #ClutterBehaviourPath instance * - * Since: 0.2 - */ -void -clutter_behaviour_path_append_knots (ClutterBehaviourPath *pathb, - const ClutterKnot *first_knot, - ...) -{ - va_list args; - - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_PATH (pathb)); - g_return_if_fail (first_knot != NULL); - - va_start (args, first_knot); - clutter_behaviour_path_append_knots_valist (pathb, first_knot, args); - va_end (args); -} - -/** - * clutter_behaviour_path_clear: - * @pathb: a #ClutterBehvaiourPath + * Get the current path of the behaviour * - * Removes all knots from a path + * Return value: the path * - * Since: 0.2 + * Since: 1.0 */ -void -clutter_behaviour_path_clear (ClutterBehaviourPath *pathb) +ClutterPath * +clutter_behaviour_path_get_path (ClutterBehaviourPath *pathb) { - g_return_if_fail (CLUTTER_IS_BEHAVIOUR_PATH (pathb)); - - g_slist_foreach (pathb->priv->knots, (GFunc) clutter_knot_free, NULL); - g_slist_free (pathb->priv->knots); + g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_PATH (pathb), NULL); - pathb->priv->knots = NULL; + return pathb->priv->path; } diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-behaviour-path.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-behaviour-path.h --- clutter-0.8.4/clutter/clutter-behaviour-path.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-behaviour-path.h 2009-01-28 08:12:44.000000000 +0000 @@ -20,16 +20,19 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __CLUTTER_BEHAVIOUR_PATH_H__ #define __CLUTTER_BEHAVIOUR_PATH_H__ #include #include +#include G_BEGIN_DECLS @@ -80,7 +83,7 @@ /*< public >*/ void (*knot_reached) (ClutterBehaviourPath *pathb, - const ClutterKnot *knot); + guint knot_num); /*< private >*/ void (*_clutter_path_1) (void); @@ -92,21 +95,21 @@ GType clutter_behaviour_path_get_type (void) G_GNUC_CONST; ClutterBehaviour *clutter_behaviour_path_new (ClutterAlpha *alpha, + ClutterPath *path); + +ClutterBehaviour *clutter_behaviour_path_new_with_description + (ClutterAlpha *alpha, + const gchar *desc); + +ClutterBehaviour *clutter_behaviour_path_new_with_knots + (ClutterAlpha *alpha, const ClutterKnot *knots, guint n_knots); -GSList * clutter_behaviour_path_get_knots (ClutterBehaviourPath *pathb); -void clutter_behaviour_path_append_knot (ClutterBehaviourPath *pathb, - const ClutterKnot *knot); -void clutter_behaviour_path_append_knots (ClutterBehaviourPath *pathb, - const ClutterKnot *first_knot, - ...) G_GNUC_NULL_TERMINATED; -void clutter_behaviour_path_insert_knot (ClutterBehaviourPath *pathb, - guint offset, - const ClutterKnot *knot); -void clutter_behaviour_path_remove_knot (ClutterBehaviourPath *pathb, - guint offset); -void clutter_behaviour_path_clear (ClutterBehaviourPath *pathb); +void clutter_behaviour_path_set_path (ClutterBehaviourPath *pathb, + ClutterPath *path); + +ClutterPath * clutter_behaviour_path_get_path (ClutterBehaviourPath *pathb); G_END_DECLS diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-behaviour-rotate.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-behaviour-rotate.c --- clutter-0.8.4/clutter/clutter-behaviour-rotate.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-behaviour-rotate.c 2009-01-28 16:47:03.000000000 +0000 @@ -95,11 +95,11 @@ rotate_behaviour = CLUTTER_BEHAVIOUR_ROTATE (behaviour); priv = rotate_behaviour->priv; - clutter_actor_set_rotationx (actor, priv->axis, - angle, - priv->center_x, - priv->center_y, - priv->center_z); + clutter_actor_set_rotation (actor, priv->axis, + CLUTTER_FIXED_TO_DOUBLE (angle), + priv->center_x, + priv->center_y, + priv->center_z); } static inline @@ -108,8 +108,8 @@ ClutterFixed a1, a2; gint rounds; - rounds = a / CFX_360; - a1 = rounds * CFX_360; + rounds = a / 360.0; + a1 = rounds * 360.0; a2 = a - a1; return a2; @@ -117,7 +117,7 @@ static void clutter_behaviour_rotate_alpha_notify (ClutterBehaviour *behaviour, - guint32 alpha_value) + gdouble alpha_value) { ClutterFixed factor, angle, start, end; ClutterBehaviourRotate *rotate_behaviour; @@ -126,22 +126,22 @@ rotate_behaviour = CLUTTER_BEHAVIOUR_ROTATE (behaviour); priv = rotate_behaviour->priv; - factor = CLUTTER_INT_TO_FIXED (alpha_value) / CLUTTER_ALPHA_MAX_ALPHA; - angle = 0; - - start = priv->angle_start; - end = priv->angle_end; + factor = CLUTTER_FLOAT_TO_FIXED (alpha_value); + angle = 0; + start = priv->angle_start; + end = priv->angle_end; if (priv->direction == CLUTTER_ROTATE_CW && start >= end) { - end += CFX_360; + end += 360.0; } else if (priv->direction == CLUTTER_ROTATE_CCW && start <= end) { - end -= CFX_360; + end -= 360.0; } - angle = CFX_MUL ((end - start), factor) + start; + angle = CLUTTER_FIXED_MUL ((end - start), alpha_value) + + start; clutter_behaviour_actors_foreach (behaviour, alpha_notify_foreach, @@ -619,7 +619,7 @@ priv = rotate->priv; - if (angle_start); + if (angle_start) *angle_start = priv->angle_start; if (angle_end) diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-behaviour-rotate.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-behaviour-rotate.h --- clutter-0.8.4/clutter/clutter-behaviour-rotate.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-behaviour-rotate.h 2009-01-28 08:12:44.000000000 +0000 @@ -18,11 +18,13 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __CLUTTER_BEHAVIOUR_ROTATE_H__ #define __CLUTTER_BEHAVIOUR_ROTATE_H__ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-behaviour-scale.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-behaviour-scale.c --- clutter-0.8.4/clutter/clutter-behaviour-scale.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-behaviour-scale.c 2009-01-28 16:47:03.000000000 +0000 @@ -85,12 +85,14 @@ { ScaleFrameClosure *closure = data; - clutter_actor_set_scalex (actor, closure->scale_x, closure->scale_y); + clutter_actor_set_scale (actor, + CLUTTER_FIXED_TO_DOUBLE (closure->scale_x), + CLUTTER_FIXED_TO_DOUBLE (closure->scale_y)); } static void clutter_behaviour_scale_alpha_notify (ClutterBehaviour *behave, - guint32 alpha_value) + gdouble alpha_value) { ClutterBehaviourScalePrivate *priv; ClutterFixed scale_x, scale_y; @@ -101,7 +103,7 @@ /* Fix the start/end values, avoids potential rounding errors on large * values. */ - if (alpha_value == CLUTTER_ALPHA_MAX_ALPHA) + if (alpha_value == 1.0) { scale_x = priv->x_scale_end; scale_y = priv->y_scale_end; @@ -115,14 +117,14 @@ { ClutterFixed factor; - factor = CLUTTER_INT_TO_FIXED (alpha_value) / CLUTTER_ALPHA_MAX_ALPHA; + factor = CLUTTER_FLOAT_TO_FIXED (alpha_value); - scale_x = CLUTTER_FIXED_MUL (factor, - (priv->x_scale_end - priv->x_scale_start)); + scale_x = + CLUTTER_FIXED_MUL (factor, (priv->x_scale_end - priv->x_scale_start)); scale_x += priv->x_scale_start; - scale_y = CLUTTER_FIXED_MUL (factor, - (priv->y_scale_end - priv->y_scale_start)); + scale_y = + CLUTTER_FIXED_MUL (factor, (priv->y_scale_end - priv->y_scale_start)); scale_y += priv->y_scale_start; } @@ -276,8 +278,8 @@ self->priv = priv = CLUTTER_BEHAVIOUR_SCALE_GET_PRIVATE (self); - priv->x_scale_start = priv->x_scale_end = CFX_ONE; - priv->y_scale_start = priv->y_scale_end = CFX_ONE; + priv->x_scale_start = priv->x_scale_end = 1.0; + priv->y_scale_start = priv->y_scale_end = 1.0; } /** diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-behaviour-scale.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-behaviour-scale.h --- clutter-0.8.4/clutter/clutter-behaviour-scale.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-behaviour-scale.h 2009-01-28 08:12:44.000000000 +0000 @@ -20,11 +20,13 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __CLUTTER_BEHAVIOUR_SCALE_H__ #define __CLUTTER_BEHAVIOUR_SCALE_H__ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-bezier.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-bezier.c --- clutter-0.8.4/clutter/clutter-bezier.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-bezier.c 2009-01-28 08:12:44.000000000 +0000 @@ -0,0 +1,426 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Authored By Tomas Frydrych + * + * 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, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include +#include "clutter-bezier.h" +#include "clutter-debug.h" + +/* + * We have some experimental code here to allow for constant velocity + * movement of actors along the bezier path, this macro enables it. + */ +#undef CBZ_L2T_INTERPOLATION + +/**************************************************************************** + * ClutterBezier -- represenation of a cubic bezier curve * + * (private; a building block for the public bspline object) * + ****************************************************************************/ + +/* + * The t parameter of the bezier is from interval <0,1>, so we can use + * 14.18 format and special multiplication functions that preserve + * more of the least significant bits but would overflow if the value + * is > 1 + */ +#define CBZ_T_Q 18 +#define CBZ_T_ONE (1 << CBZ_T_Q) +#define CBZ_T_MUL(x,y) ((((x) >> 3) * ((y) >> 3)) >> 12) +#define CBZ_T_POW2(x) CBZ_T_MUL (x, x) +#define CBZ_T_POW3(x) CBZ_T_MUL (CBZ_T_POW2 (x), x) +#define CBZ_T_DIV(x,y) ((((x) << 9)/(y)) << 9) + +/* + * Constants for sampling of the bezier + */ +#define CBZ_T_SAMPLES 128 +#define CBZ_T_STEP (CBZ_T_ONE / CBZ_T_SAMPLES) +#define CBZ_L_STEP (CBZ_T_ONE / CBZ_T_SAMPLES) + +typedef gint32 _FixedT; + +/* + * This is a private type representing a single cubic bezier + */ +struct _ClutterBezier +{ + /* + * bezier coefficients -- these are calculated using multiplication and + * addition from integer input, so these are also integers + */ + gint ax; + gint bx; + gint cx; + gint dx; + + gint ay; + gint by; + gint cy; + gint dy; + + /* length of the bezier */ + guint length; + +#ifdef CBZ_L2T_INTERPOLATION + /* + * coefficients for the L -> t bezier; these are calculated from fixed + * point input, and more specifically numbers that have been normalised + * to fit <0,1>, so these are also fixed point, and we can used the + * _FixedT type here. + */ + _FixedT La; + _FixedT Lb; + _FixedT Lc; + /* _FixedT Ld; == 0 */ +#endif +}; + +ClutterBezier * +_clutter_bezier_new () +{ + return g_slice_new0 (ClutterBezier); +} + +void +_clutter_bezier_free (ClutterBezier * b) +{ + if (G_LIKELY (b)) + { + g_slice_free (ClutterBezier, b); + } +} + +ClutterBezier * +_clutter_bezier_clone_and_move (const ClutterBezier *b, gint x, gint y) +{ + ClutterBezier * b2 = _clutter_bezier_new (); + memcpy (b2, b, sizeof (ClutterBezier)); + + b2->dx += x; + b2->dy += y; + + return b2; +} + +#ifdef CBZ_L2T_INTERPOLATION +/* + * L is relative advance along the bezier curve from interval <0,1> + */ +static _FixedT +_clutter_bezier_L2t (const ClutterBezier *b, _FixedT L) +{ + _FixedT t = CBZ_T_MUL (b->La, CBZ_T_POW3(L)) + + CBZ_T_MUL (b->Lb, CBZ_T_POW2(L)) + + CBZ_T_MUL (b->Lc, L); + + if (t > CBZ_T_ONE) + t = CBZ_T_ONE; + else if (t < 0) + t = 0; + + return t; +} +#endif + +static gint +_clutter_bezier_t2x (const ClutterBezier * b, _FixedT t) +{ + /* + * NB -- the int coefficients can be at most 8192 for the multiplication + * to work in this fashion due to the limits of the 14.18 fixed. + */ + return ((b->ax*CBZ_T_POW3(t) + b->bx*CBZ_T_POW2(t) + b->cx*t) >> CBZ_T_Q) + + b->dx; +} + +gint +_clutter_bezier_t2y (const ClutterBezier * b, _FixedT t) +{ + /* + * NB -- the int coefficients can be at most 8192 for the multiplication + * to work in this fashion due to the limits of the 14.18 fixed. + */ + return ((b->ay*CBZ_T_POW3(t) + b->by*CBZ_T_POW2(t) + b->cy*t) >> CBZ_T_Q) + + b->dy; +} + +/* + * Advances along the bezier to relative length L and returns the coordinances + * in knot + */ +void +_clutter_bezier_advance (const ClutterBezier *b, gint L, ClutterKnot * knot) +{ +#ifdef CBZ_L2T_INTERPOLATION + _FixedT t = clutter_bezier_L2t (b, L); +#else + _FixedT t = L; +#endif + + knot->x = _clutter_bezier_t2x (b, t); + knot->y = _clutter_bezier_t2y (b, t); + + CLUTTER_NOTE (BEHAVIOUR, "advancing to relative pt %f: t %f, {%d,%d}", + (double) L / (double) CBZ_T_ONE, + (double) t / (double) CBZ_T_ONE, + knot->x, knot->y); +} + +void +_clutter_bezier_init (ClutterBezier *b, + gint x_0, gint y_0, + gint x_1, gint y_1, + gint x_2, gint y_2, + gint x_3, gint y_3) +{ + _FixedT t; + int i; + int xp = x_0; + int yp = y_0; + _FixedT length [CBZ_T_SAMPLES + 1]; + +#ifdef CBZ_L2T_INTERPOLATION + int j, k; + _FixedT L; + _FixedT t_equalized [CBZ_T_SAMPLES + 1]; +#endif + +#if 0 + g_debug ("Initializing bezier at {{%d,%d},{%d,%d},{%d,%d},{%d,%d}}", + x0, y0, x1, y1, x2, y2, x3, y3); +#endif + + b->dx = x_0; + b->dy = y_0; + + b->cx = 3 * (x_1 - x_0); + b->cy = 3 * (y_1 - y_0); + + b->bx = 3 * (x_2 - x_1) - b->cx; + b->by = 3 * (y_2 - y_1) - b->cy; + + b->ax = x_3 - 3 * x_2 + 3 * x_1 - x_0; + b->ay = y_3 - 3 * y_2 + 3 * y_1 - y_0; + +#if 0 + g_debug ("Cooeficients {{%d,%d},{%d,%d},{%d,%d},{%d,%d}}", + b->ax, b->ay, b->bx, b->by, b->cx, b->cy, b->dx, b->dy); +#endif + + /* + * Because of the way we do the multiplication in bezeir_t2x,y + * these coefficients need to be at most 0x1fff; this should be the case, + * I think, but have added this warning to catch any problems -- if it + * triggers, we need to change those two functions a bit. + */ + if (b->ax > 0x1fff || b->bx > 0x1fff || b->cx > 0x1fff) + g_warning ("Calculated coefficents will result in multiplication " + "overflow in clutter_bezier_t2x and clutter_bezier_t2y."); + + /* + * Sample the bezier with CBZ_T_SAMPLES and calculate length at + * each point. + * + * We are working with integers here, so we use the fast sqrti function. + */ + length[0] = 0; + + for (t = CBZ_T_STEP, i = 1; i <= CBZ_T_SAMPLES; ++i, t += CBZ_T_STEP) + { + int x = _clutter_bezier_t2x (b, t); + int y = _clutter_bezier_t2y (b, t); + + guint l = cogl_sqrti ((y - yp)*(y - yp) + (x - xp)*(x - xp)); + + l += length[i-1]; + + length[i] = l; + + xp = x; + yp = y; + } + + b->length = length[CBZ_T_SAMPLES]; + +#if 0 + g_debug ("length %d", b->length); +#endif + +#ifdef CBZ_L2T_INTERPOLATION + /* + * Now normalize the length values, converting them into _FixedT + */ + for (i = 0; i <= CBZ_T_SAMPLES; ++i) + { + length[i] = (length[i] << CBZ_T_Q) / b->length; + } + + /* + * Now generate a L -> t table such that the L will equidistant + * over <0,1> + */ + t_equalized[0] = 0; + + for (i = 1, j = 1, L = CBZ_L_STEP; i < CBZ_T_SAMPLES; ++i, L += CBZ_L_STEP) + { + _FixedT l1, l2; + _FixedT d1, d2, d; + _FixedT t1, t2; + + /* find the band for our L */ + for (k = j; k < CBZ_T_SAMPLES; ++k) + { + if (L < length[k]) + break; + } + + /* + * Now we know that L is from (length[k-1],length[k]> + * We remember k-1 in order not to have to iterate over the + * whole length array in the next iteration of the main loop + */ + j = k - 1; + + /* + * Now interpolate equlised t as a weighted average + */ + l1 = length[k-1]; + l2 = length[k]; + d1 = l2 - L; + d2 = L - l1; + d = l2 - l1; + t1 = (k - 1) * CBZ_T_STEP; + t2 = k * CBZ_T_STEP; + + t_equalized[i] = (t1*d1 + t2*d2)/d; + + if (t_equalized[i] < t_equalized[i-1]) + g_debug ("wrong t: L %f, l1 %f, l2 %f, t1 %f, t2 %f", + (double) (L)/(double)CBZ_T_ONE, + (double) (l1)/(double)CBZ_T_ONE, + (double) (l2)/(double)CBZ_T_ONE, + (double) (t1)/(double)CBZ_T_ONE, + (double) (t2)/(double)CBZ_T_ONE); + + } + + t_equalized[CBZ_T_SAMPLES] = CBZ_T_ONE; + + /* We now fit a bezier -- at this stage, do a single fit through our values + * at 0, 1/3, 2/3 and 1 + * + * FIXME -- do we need to use a better fitting approach to choose the best + * beziere. The actual curve we acquire this way is not too bad shapwise, + * but (probably due to rounding errors) the resulting curve no longer + * satisfies the necessary condition that for L2 > L1, t2 > t1, which + * causes oscilation. + */ + +#if 0 + /* + * These are the control points we use to calculate the curve coefficients + * for bezier t(L); these are not needed directly, but are implied in the + * calculations below. + * + * (p0 is 0,0, and p3 is 1,1) + */ + p1 = (18 * t_equalized[CBZ_T_SAMPLES/3] - + 9 * t_equalized[2*CBZ_T_SAMPLES/3] + + 2 << CBZ_T_Q) / 6; + + p2 = (18 * t_equalized[2*CBZ_T_SAMPLES/3] - + 9 * t_equalized[CBZ_T_SAMPLES/3] - + (5 << CBZ_T_Q)) / 6; +#endif + + b->Lc = (18 * t_equalized[CBZ_T_SAMPLES/3] - + 9 * t_equalized[2*CBZ_T_SAMPLES/3] + + (2 << CBZ_T_Q)) >> 1; + + b->Lb = (36 * t_equalized[2*CBZ_T_SAMPLES/3] - + 45 * t_equalized[CBZ_T_SAMPLES/3] - + (9 << CBZ_T_Q)) >> 1; + + b->La = ((27 * (t_equalized[CBZ_T_SAMPLES/3] - + t_equalized[2*CBZ_T_SAMPLES/3]) + + (7 << CBZ_T_Q)) >> 1) + CBZ_T_ONE; + + g_debug ("t(1/3) %f, t(2/3) %f", + (double)t_equalized[CBZ_T_SAMPLES/3]/(double)CBZ_T_ONE, + (double)t_equalized[2*CBZ_T_SAMPLES/3]/(double)CBZ_T_ONE); + + g_debug ("L -> t coefficients: %f, %f, %f", + (double)b->La/(double)CBZ_T_ONE, + (double)b->Lb/(double)CBZ_T_ONE, + (double)b->Lc/(double)CBZ_T_ONE); + + + /* + * For debugging, you can load these values into a spreadsheet and graph + * them to see how well the approximation matches the data + */ + for (i = 0; i < CBZ_T_SAMPLES; ++i) + { + g_print ("%f, %f, %f\n", + (double)(i*CBZ_T_STEP)/(double)CBZ_T_ONE, + (double)(t_equalized[i])/(double)CBZ_T_ONE, + (double)(clutter_bezier_L2t(b,i*CBZ_T_STEP))/(double)CBZ_T_ONE); + } +#endif +} + +/* + * Moves a control point at indx to location represented by knot + */ +void +_clutter_bezier_adjust (ClutterBezier * b, ClutterKnot * knot, guint indx) +{ + guint x[4], y[4]; + + g_assert (indx < 4); + + x[0] = b->dx; + y[0] = b->dy; + + x[1] = b->cx / 3 + x[0]; + y[1] = b->cy / 3 + y[0]; + + x[2] = b->bx / 3 + b->cx + x[1]; + y[2] = b->by / 3 + b->cy + y[1]; + + x[3] = b->ax + x[0] + b->cx + b->bx; + y[3] = b->ay + y[0] + b->cy + b->by; + + x[indx] = knot->x; + y[indx] = knot->y; + + _clutter_bezier_init (b, x[0], y[0], x[1], y[1], x[2], y[2], x[3], y[3]); +} + +guint +_clutter_bezier_get_length (const ClutterBezier *b) +{ + return b->length; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-bezier.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-bezier.h --- clutter-0.8.4/clutter/clutter-bezier.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-bezier.h 2009-01-28 08:12:44.000000000 +0000 @@ -0,0 +1,65 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Authored By Tomas Frydrych + * + * Copyright (C) 2006, 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 . + */ + +#ifndef __CLUTTER_BEZIER_H__ +#define __CLUTTER_BEZIER_H__ + +#include +#include "clutter-types.h" + +G_BEGIN_DECLS + +/* This is used in _clutter_bezier_advance to represent the full + length of the bezier curve. Anything less than that represents a + fraction of the length */ +#define CLUTTER_BEZIER_MAX_LENGTH (1 << 18) + +typedef struct _ClutterBezier ClutterBezier; + +ClutterBezier *_clutter_bezier_new (); + +void _clutter_bezier_free (ClutterBezier * b); + +ClutterBezier *_clutter_bezier_clone_and_move (const ClutterBezier *b, + gint x, + gint y); + +void _clutter_bezier_advance (const ClutterBezier *b, + gint L, + ClutterKnot *knot); + +void _clutter_bezier_init (ClutterBezier *b, + gint x_0, gint y_0, + gint x_1, gint y_1, + gint x_2, gint y_2, + gint x_3, gint y_3); + +void _clutter_bezier_adjust (ClutterBezier *b, + ClutterKnot *knot, + guint indx); + +guint _clutter_bezier_get_length (const ClutterBezier *b); + +G_END_DECLS + +#endif /* __CLUTTER_BEZIER_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-binding-pool.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-binding-pool.c --- clutter-0.8.4/clutter/clutter-binding-pool.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-binding-pool.c 2009-01-28 08:12:44.000000000 +0000 @@ -0,0 +1,926 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Copyright (C) 2008 Intel Corporation. + * + * Authored By: Emmanuele Bassi + * + * 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 . + */ + +/** + * SECTION:clutter-binding-pool + * @short_description: Pool for key bindings + * + * #ClutterBindingPool is a data structure holding a set of key bindings. + * Each key binding associates a key symbol (eventually with modifiers) + * to an action. A callback function is associated to each action. + * + * For a given key symbol and modifier mask combination there can be only one + * action; for each action there can be only one callback. There can be + * multiple actions with the same name, and the same callback can be used + * to handle multiple key bindings. + * + * Actors requiring key bindings should create a new #ClutterBindingPool + * inside their class initialization function and then install actions + * like this: + * + * |[ + * static void + * foo_class_init (FooClass *klass) + * { + * ClutterBindingPool *binding_pool; + * + * binding_pool = clutter_binding_pool_get_for_class (klass); + * + * clutter_binding_pool_install_action (binding_pool, "move-up", + * CLUTTER_Up, 0, + * G_CALLBACK (foo_action_move_up), + * NULL, NULL); + * clutter_binding_pool_install_action (binding_pool, "move-up", + * CLUTTER_KP_Up, 0, + * G_CALLBACK (foo_action_move_up), + * NULL, NULL); + * } + * ]| + * + * The callback has a signature of: + * + * |[ + * gboolean (* callback) (GObject *instance, + * const gchar *action_name, + * guint key_val, + * ClutterModifierType modifiers, + * gpointer user_data); + * ]| + * + * The actor should then override the #ClutterActor::key-press-event and + * use clutter_binding_pool_activate() to match a #ClutterKeyEvent structure + * to one of the actions: + * + * |[ + * ClutterBindingPool *pool; + * + * /* retrieve the binding pool for the type of the actor */ + * pool = clutter_binding_pool_find (G_OBJECT_TYPE_NAME (actor)); + * + * /* activate any callback matching the key symbol and modifiers + * * mask of the key event. the returned value can be directly + * * used to signal that the actor has handled the event. + * */ + * return clutter_binding_pool_activate (pool, G_OBJECT (actor), + * key_event->keyval, + * key_event->modifier_state); + * ]| + * + * The clutter_binding_pool_activate() function will return %FALSE if + * no action for the given key binding was found, if the action was + * blocked (using clutter_binding_pool_block_action()) or if the + * key binding handler returned %FALSE. + * + * #ClutterBindingPool is available since Clutter 1.0 + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "clutter-binding-pool.h" +#include "clutter-debug.h" +#include "clutter-enum-types.h" +#include "clutter-marshal.h" +#include "clutter-private.h" + +#define CLUTTER_BINDING_POOL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), CLUTTER_TYPE_BINDING_POOL, ClutterBindingPoolClass)) +#define CLUTTER_IS_BINDING_POOL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CLUTTER_TYPE_BINDING_POOL)) +#define CLUTTER_BINDING_POOL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CLUTTER_TYPE_BINDING_POOL, ClutterBindingPoolClass)) + +#define BINDING_MOD_MASK ((CLUTTER_SHIFT_MASK | \ + CLUTTER_CONTROL_MASK | \ + CLUTTER_MOD1_MASK | \ + CLUTTER_SUPER_MASK | \ + CLUTTER_HYPER_MASK | \ + CLUTTER_META_MASK) | CLUTTER_RELEASE_MASK) + +typedef struct _ClutterBindingPoolClass ClutterBindingPoolClass; +typedef struct _ClutterBindingEntry ClutterBindingEntry; + +static GSList *clutter_binding_pools = NULL; +static GQuark key_class_bindings = 0; + +struct _ClutterBindingPool +{ + GObject parent_instance; + + gchar *name; /* interned string, do not free */ + + GSList *entries; + GHashTable *entries_hash; +}; + +struct _ClutterBindingPoolClass +{ + GObjectClass parent_class; +}; + +struct _ClutterBindingEntry +{ + gchar *name; /* interned string, do not free */ + + guint key_val; + ClutterModifierType modifiers; + + GClosure *closure; + + guint is_blocked : 1; +}; + +enum +{ + PROP_0, + + PROP_NAME +}; + +G_DEFINE_TYPE (ClutterBindingPool, clutter_binding_pool, G_TYPE_OBJECT); + +static guint +binding_entry_hash (gconstpointer v) +{ + const ClutterBindingEntry *e = v; + guint h; + + h = e->key_val; + h ^= e->modifiers; + + return h; +} + +static gint +binding_entry_compare (gconstpointer v1, + gconstpointer v2) +{ + const ClutterBindingEntry *e1 = v1; + const ClutterBindingEntry *e2 = v2; + + return (e1->key_val == e2->key_val && e1->modifiers == e2->modifiers); +} + +static ClutterBindingEntry * +binding_entry_new (const gchar *name, + guint key_val, + ClutterModifierType modifiers) +{ + ClutterBindingEntry *entry; + + modifiers = modifiers & BINDING_MOD_MASK; + + entry = g_slice_new (ClutterBindingEntry); + entry->key_val = key_val; + entry->modifiers = modifiers; + entry->name = (gchar *) g_intern_string (name); + entry->closure = NULL; + entry->is_blocked = FALSE; + + return entry; +} + +static ClutterBindingEntry * +binding_pool_lookup_entry (ClutterBindingPool *pool, + guint key_val, + ClutterModifierType modifiers) +{ + ClutterBindingEntry lookup_entry = { 0, }; + + lookup_entry.key_val = key_val; + lookup_entry.modifiers = modifiers; + + return g_hash_table_lookup (pool->entries_hash, &lookup_entry); +} + +static void +binding_entry_free (gpointer data) +{ + if (G_LIKELY (data)) + { + ClutterBindingEntry *entry = data; + + g_closure_unref (entry->closure); + + g_slice_free (ClutterBindingEntry, entry); + } +} + +static void +clutter_binding_pool_finalize (GObject *gobject) +{ + ClutterBindingPool *pool = CLUTTER_BINDING_POOL (gobject); + + /* remove from the pools */ + clutter_binding_pools = g_slist_remove (clutter_binding_pools, pool); + + g_hash_table_destroy (pool->entries_hash); + + g_slist_foreach (pool->entries, (GFunc) binding_entry_free, NULL); + g_slist_free (pool->entries); + + G_OBJECT_CLASS (clutter_binding_pool_parent_class)->finalize (gobject); +} + +static void +clutter_binding_pool_set_property (GObject *gobject, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + ClutterBindingPool *pool = CLUTTER_BINDING_POOL (gobject); + + switch (prop_id) + { + case PROP_NAME: + pool->name = (gchar *) g_intern_string (g_value_get_string (value)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +clutter_binding_pool_get_property (GObject *gobject, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + ClutterBindingPool *pool = CLUTTER_BINDING_POOL (gobject); + + switch (prop_id) + { + case PROP_NAME: + g_value_set_string (value, pool->name); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +clutter_binding_pool_constructed (GObject *gobject) +{ + ClutterBindingPool *pool = CLUTTER_BINDING_POOL (gobject); + + /* bad monkey! bad, bad monkey! */ + if (G_UNLIKELY (pool->name == NULL)) + g_critical ("No name set for ClutterBindingPool %p", pool); + + if (G_OBJECT_CLASS (clutter_binding_pool_parent_class)->constructed) + G_OBJECT_CLASS (clutter_binding_pool_parent_class)->constructed (gobject); +} + +static void +clutter_binding_pool_class_init (ClutterBindingPoolClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GParamSpec *pspec = NULL; + + gobject_class->constructed = clutter_binding_pool_constructed; + gobject_class->set_property = clutter_binding_pool_set_property; + gobject_class->get_property = clutter_binding_pool_get_property; + gobject_class->finalize = clutter_binding_pool_finalize; + + /** + * ClutterBindingPool:name: + * + * The unique name of the #ClutterBindingPool. + * + * Since: 1.0 + */ + pspec = g_param_spec_string ("name", + "Name", + "The unique name of the binding pool", + NULL, + CLUTTER_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY); + g_object_class_install_property (gobject_class, PROP_NAME, pspec); +} + +static void +clutter_binding_pool_init (ClutterBindingPool *pool) +{ + pool->name = NULL; + pool->entries = NULL; + pool->entries_hash = g_hash_table_new (binding_entry_hash, + binding_entry_compare); + + clutter_binding_pools = g_slist_prepend (clutter_binding_pools, pool); +} + +/** + * clutter_binding_pool_new: + * @name: the name of the binding pool + * + * Creates a new #ClutterBindingPool that can be used to store + * key bindings for an actor. The @name must be a unique identifier + * for the binding pool, so that clutter_binding_pool_find() will + * be able to return the correct binding pool. + * + * Return value: the newly created binding pool with the given + * name. Use g_object_unref() when done. + * + * Since: 1.0 + */ +ClutterBindingPool * +clutter_binding_pool_new (const gchar *name) +{ + ClutterBindingPool *pool; + + g_return_val_if_fail (name != NULL, NULL); + + pool = clutter_binding_pool_find (name); + if (G_UNLIKELY (pool)) + { + g_warning ("A binding pool named '%s' is already present " + "in the binding pools list", + pool->name); + return NULL; + } + + return g_object_new (CLUTTER_TYPE_BINDING_POOL, "name", name, NULL); +} + +/** + * clutter_binding_pool_get_for_class: + * @klass: a #GObjectClass pointer + * + * Retrieves the #ClutterBindingPool for the given #GObject class + * and, eventually, creates it. This function is a wrapper around + * clutter_binding_pool_new() and uses the class type name as the + * unique name for the binding pool. + * + * Calling this function multiple times will return the same + * #ClutterBindingPool. + * + * A binding pool for a class can also be retrieved using + * clutter_binding_pool_find() with the class type name: + * + * |[ + * pool = clutter_binding_pool_find (G_OBJECT_TYPE_NAME (instance)); + * ]| + * + * Return value: the binding pool for the given class. The returned + * #ClutterBindingPool is owned by Clutter and should not be freed + * directly + * + * Since: 1.0 + */ +ClutterBindingPool * +clutter_binding_pool_get_for_class (gpointer klass) +{ + ClutterBindingPool *pool; + + g_return_val_if_fail (G_IS_OBJECT_CLASS (klass), NULL); + + if (G_UNLIKELY (key_class_bindings == 0)) + key_class_bindings = g_quark_from_static_string ("clutter-bindings-set"); + + pool = g_dataset_id_get_data (klass, key_class_bindings); + if (pool) + return pool; + + pool = clutter_binding_pool_new (G_OBJECT_CLASS_NAME (klass)); + g_dataset_id_set_data_full (klass, key_class_bindings, + pool, + g_object_unref); + + return pool; +} + +/** + * clutter_binding_pool_find: + * @name: the name of the binding pool to find + * + * Finds the #ClutterBindingPool with @name. + * + * Return value: a pointer to the #ClutterBindingPool, or %NULL + * + * Since: 1.0 + */ +ClutterBindingPool * +clutter_binding_pool_find (const gchar *name) +{ + GSList *l; + + g_return_val_if_fail (name != NULL, NULL); + + for (l = clutter_binding_pools; l != NULL; l = l->next) + { + ClutterBindingPool *pool = l->data; + + if (g_str_equal (pool->name, (gpointer) name)) + return pool; + } + + return NULL; +} + +/** + * clutter_binding_pool_install_action: + * @pool: a #ClutterBindingPool + * @action_name: the name of the action + * @key_val: key symbol + * @modifiers: bitmask of modifiers + * @callback: function to be called when the action is activated + * @data: data to be passed to @callback + * @notify: function to be called when the action is removed + * from the pool + * + * Installs a new action inside a #ClutterBindingPool. The action + * is bound to @key_val and @modifiers. + * + * The same action name can be used for multiple @key_val, @modifiers + * pairs. + * + * When an action has been activated using clutter_binding_pool_activate() + * the passed @callback will be invoked (with @data). + * + * Actions can be blocked with clutter_binding_pool_block_action() + * and then unblocked using clutter_binding_pool_unblock_action(). + * + * Since: 1.0 + */ +void +clutter_binding_pool_install_action (ClutterBindingPool *pool, + const gchar *action_name, + guint key_val, + ClutterModifierType modifiers, + GCallback callback, + gpointer data, + GDestroyNotify notify) +{ + ClutterBindingEntry *entry; + GClosure *closure; + + g_return_if_fail (pool != NULL); + g_return_if_fail (action_name != NULL); + g_return_if_fail (key_val != 0); + g_return_if_fail (callback != NULL); + + entry = binding_pool_lookup_entry (pool, key_val, modifiers); + if (G_UNLIKELY (entry)) + { + g_warning ("There already is an action '%s' for the given " + "key symbol of %d (modifiers: %d) installed inside " + "the binding pool.", + entry->name, + entry->key_val, entry->modifiers); + return; + } + else + entry = binding_entry_new (action_name, key_val, modifiers); + + closure = g_cclosure_new (callback, data, (GClosureNotify) notify); + entry->closure = g_closure_ref (closure); + g_closure_sink (closure); + + if (G_CLOSURE_NEEDS_MARSHAL (closure)) + { + GClosureMarshal marshal; + + marshal = clutter_marshal_BOOLEAN__STRING_UINT_ENUM; + g_closure_set_marshal (closure, marshal); + } + + pool->entries = g_slist_prepend (pool->entries, entry); + g_hash_table_insert (pool->entries_hash, entry, entry); +} + +/** + * clutter_binding_pool_install_closure: + * @pool: a #ClutterBindingPool + * @action_name: the name of the action + * @key_val: key symbol + * @modifiers: bitmask of modifiers + * @closure: a #GClosure + * + * A #GClosure variant of clutter_binding_pool_install_action(). + * + * Installs a new action inside a #ClutterBindingPool. The action + * is bound to @key_val and @modifiers. + * + * The same action name can be used for multiple @key_val, @modifiers + * pairs. + * + * When an action has been activated using clutter_binding_pool_activate() + * the passed @closure will be invoked. + * + * Actions can be blocked with clutter_binding_pool_block_action() + * and then unblocked using clutter_binding_pool_unblock_action(). + * + * Since: 1.0 + */ +void +clutter_binding_pool_install_closure (ClutterBindingPool *pool, + const gchar *action_name, + guint key_val, + ClutterModifierType modifiers, + GClosure *closure) +{ + ClutterBindingEntry *entry; + + g_return_if_fail (pool != NULL); + g_return_if_fail (action_name != NULL); + g_return_if_fail (key_val != 0); + g_return_if_fail (closure != NULL); + + entry = binding_pool_lookup_entry (pool, key_val, modifiers); + if (G_UNLIKELY (entry)) + { + g_warning ("There already is an action '%s' for the given " + "key symbol of %d (modifiers: %d) installed inside " + "the binding pool.", + entry->name, + entry->key_val, entry->modifiers); + return; + } + else + entry = binding_entry_new (action_name, key_val, modifiers); + + entry->closure = g_closure_ref (closure); + g_closure_sink (closure); + + if (G_CLOSURE_NEEDS_MARSHAL (closure)) + { + GClosureMarshal marshal; + + marshal = clutter_marshal_BOOLEAN__STRING_UINT_ENUM; + g_closure_set_marshal (closure, marshal); + } + + pool->entries = g_slist_prepend (pool->entries, entry); + g_hash_table_insert (pool->entries_hash, entry, entry); +} + +/** + * clutter_binding_pool_override_action: + * @pool: a #ClutterBindingPool + * @key_val: key symbol + * @modifiers: bitmask of modifiers + * @callback: function to be called when the action is activated + * @data: data to be passed to @callback + * @notify: function to be called when the action is removed + * from the pool + * + * Allows overriding the action for @key_val and @modifiers inside a + * #ClutterBindingPool. See clutter_binding_pool_install_action(). + * + * When an action has been activated using clutter_binding_pool_activate() + * the passed @callback will be invoked (with @data). + * + * Actions can be blocked with clutter_binding_pool_block_action() + * and then unblocked using clutter_binding_pool_unblock_action(). + * + * Since: 1.0 + */ +void +clutter_binding_pool_override_action (ClutterBindingPool *pool, + guint key_val, + ClutterModifierType modifiers, + GCallback callback, + gpointer data, + GDestroyNotify notify) +{ + ClutterBindingEntry *entry; + GClosure *closure; + + g_return_if_fail (pool != NULL); + g_return_if_fail (key_val != 0); + g_return_if_fail (callback != NULL); + + entry = binding_pool_lookup_entry (pool, key_val, modifiers); + if (G_UNLIKELY (entry == NULL)) + { + g_warning ("There is no action for the given key symbol " + "of %d (modifiers: %d) installed inside the " + "binding pool.", + key_val, modifiers); + return; + } + + if (entry->closure) + { + g_closure_unref (entry->closure); + entry->closure = NULL; + } + + closure = g_cclosure_new (callback, data, (GClosureNotify) notify); + entry->closure = g_closure_ref (closure); + g_closure_sink (closure); + + if (G_CLOSURE_NEEDS_MARSHAL (closure)) + { + GClosureMarshal marshal; + + marshal = clutter_marshal_BOOLEAN__STRING_UINT_ENUM; + g_closure_set_marshal (closure, marshal); + } +} + +/** + * clutter_binding_pool_override_closure: + * @pool: a #ClutterBindingPool + * @key_val: key symbol + * @modifiers: bitmask of modifiers + * @closure: a #GClosure + * + * A #GClosure variant of clutter_binding_pool_override_action(). + * + * Allows overriding the action for @key_val and @modifiers inside a + * #ClutterBindingPool. See clutter_binding_pool_install_closure(). + * + * When an action has been activated using clutter_binding_pool_activate() + * the passed @callback will be invoked (with @data). + * + * Actions can be blocked with clutter_binding_pool_block_action() + * and then unblocked using clutter_binding_pool_unblock_action(). + * + * Since: 1.0 + */ +void +clutter_binding_pool_override_closure (ClutterBindingPool *pool, + guint key_val, + ClutterModifierType modifiers, + GClosure *closure) +{ + ClutterBindingEntry *entry; + + g_return_if_fail (pool != NULL); + g_return_if_fail (key_val != 0); + g_return_if_fail (closure != NULL); + + entry = binding_pool_lookup_entry (pool, key_val, modifiers); + if (G_UNLIKELY (entry == NULL)) + { + g_warning ("There is no action for the given key symbol " + "of %d (modifiers: %d) installed inside the " + "binding pool.", + key_val, modifiers); + return; + } + + if (entry->closure) + { + g_closure_unref (entry->closure); + entry->closure = NULL; + } + + entry->closure = g_closure_ref (closure); + g_closure_sink (closure); + + if (G_CLOSURE_NEEDS_MARSHAL (closure)) + { + GClosureMarshal marshal; + + marshal = clutter_marshal_BOOLEAN__STRING_UINT_ENUM; + g_closure_set_marshal (closure, marshal); + } +} + +/** + * clutter_binding_pool_find_action: + * @pool: a #ClutterBindingPool + * @key_val: a key symbol + * @modifiers: a bitmask for the modifiers + * + * Retrieves the name of the action matching the given key symbol + * and modifiers bitmask. + * + * Return value: the name of the action, if found, or %NULL. The + * returned string is owned by the binding pool and should never + * be modified or freed + * + * Since: 1.0 + */ +G_CONST_RETURN gchar * +clutter_binding_pool_find_action (ClutterBindingPool *pool, + guint key_val, + ClutterModifierType modifiers) +{ + ClutterBindingEntry *entry; + + g_return_val_if_fail (pool != NULL, NULL); + g_return_val_if_fail (key_val != 0, NULL); + + entry = binding_pool_lookup_entry (pool, key_val, modifiers); + if (!entry) + return NULL; + + return entry->name; +} + +/** + * clutter_binding_pool_remove_action: + * @pool: a #ClutterBindingPool + * @key_val: a key symbol + * @modifiers: a bitmask for the modifiers + * + * Removes the action matching the given @key_val, @modifiers pair, + * if any exists. + * + * Since: 1.0 + */ +void +clutter_binding_pool_remove_action (ClutterBindingPool *pool, + guint key_val, + ClutterModifierType modifiers) +{ + ClutterBindingEntry remove_entry = { 0, }; + GSList *l; + + g_return_if_fail (pool != NULL); + g_return_if_fail (key_val != 0); + + modifiers = modifiers & BINDING_MOD_MASK; + + remove_entry.key_val = key_val; + remove_entry.modifiers = modifiers; + + for (l = pool->entries; l != NULL; l = l->data) + { + ClutterBindingEntry *e = l->data; + + if (e->key_val == remove_entry.key_val && + e->modifiers == remove_entry.modifiers) + { + pool->entries = g_slist_remove_link (pool->entries, l); + break; + } + } + + g_hash_table_remove (pool->entries_hash, &remove_entry); +} + +static gboolean +clutter_binding_entry_invoke (ClutterBindingEntry *entry, + GObject *gobject) +{ + GValue params[4] = { { 0, }, { 0, }, { 0, }, { 0, } }; + GValue result = { 0, }; + gboolean retval = TRUE; + + g_value_init (¶ms[0], G_TYPE_OBJECT); + g_value_set_object (¶ms[0], gobject); + + g_value_init (¶ms[1], G_TYPE_STRING); + g_value_set_string (¶ms[1], entry->name); + + g_value_init (¶ms[2], G_TYPE_UINT); + g_value_set_uint (¶ms[2], entry->key_val); + + g_value_init (¶ms[3], CLUTTER_TYPE_MODIFIER_TYPE); + g_value_set_flags (¶ms[3], entry->modifiers); + + g_value_init (&result, G_TYPE_BOOLEAN); + + g_closure_invoke (entry->closure, &result, 4, params, NULL); + + retval = g_value_get_boolean (&result); + + g_value_unset (&result); + + g_value_unset (¶ms[0]); + g_value_unset (¶ms[1]); + g_value_unset (¶ms[2]); + g_value_unset (¶ms[3]); + + return retval; +} + +/** + * clutter_binding_pool_activate: + * @pool: a #ClutterBindingPool + * @key_val: the key symbol + * @modifiers: bitmask for the modifiers + * @gobject: a #GObject + * + * Activates the callback associated to the action that is + * bound to the @key_val and @modifiers pair. + * + * The callback has the following signature: + * + * |[ + * void (* callback) (GObject *gobject, + * const gchar *action_name, + * guint key_val, + * ClutterModifierType modifiers, + * gpointer user_data); + * ]| + * + * Where the #GObject instance is @gobject and the user data + * is the one passed when installing the action with + * clutter_binding_pool_install_action(). + * + * If the action bound to the @key_val, @modifiers pair has been + * blocked using clutter_binding_pool_block_action(), the callback + * will not be invoked, and this function will return %FALSE. + * + * Return value: %TRUE if an action was found and was activated + * + * Since: 1.0 + */ +gboolean +clutter_binding_pool_activate (ClutterBindingPool *pool, + guint key_val, + ClutterModifierType modifiers, + GObject *gobject) +{ + ClutterBindingEntry *entry = NULL; + + g_return_val_if_fail (pool != NULL, FALSE); + g_return_val_if_fail (key_val != 0, FALSE); + g_return_val_if_fail (G_IS_OBJECT (gobject), FALSE); + + modifiers = (modifiers & BINDING_MOD_MASK); + + entry = binding_pool_lookup_entry (pool, key_val, modifiers); + if (!entry) + return FALSE; + + if (!entry->is_blocked) + return clutter_binding_entry_invoke (entry, gobject); + + return FALSE; +} + +/** + * clutter_binding_pool_block_action: + * @pool: a #ClutterBindingPool + * @action_name: an action name + * + * Blocks all the actions with name @action_name inside @pool. + * + * Since: 1.0 + */ +void +clutter_binding_pool_block_action (ClutterBindingPool *pool, + const gchar *action_name) +{ + GSList *l; + + g_return_if_fail (pool != NULL); + g_return_if_fail (action_name != NULL); + + for (l = pool->entries; l != NULL; l = l->next) + { + ClutterBindingEntry *entry = l->data; + + if (g_str_equal (entry->name, (gpointer) action_name)) + entry->is_blocked = TRUE; + } +} + +/** + * clutter_binding_pool_unblock_action: + * @pool: a #ClutterBindingPool + * @action_name: an action name + * + * Unblockes all the actions with name @action_name inside @pool. + * + * Unblocking an action does not cause the callback bound to it to + * be invoked in case clutter_binding_pool_activate() was called on + * an action previously blocked with clutter_binding_pool_block_action(). + * + * Since: 1.0 + */ +void +clutter_binding_pool_unblock_action (ClutterBindingPool *pool, + const gchar *action_name) +{ + GSList *l; + + g_return_if_fail (pool != NULL); + g_return_if_fail (action_name != NULL); + + for (l = pool->entries; l != NULL; l = l->next) + { + ClutterBindingEntry *entry = l->data; + + if (g_str_equal (entry->name, (gpointer) action_name)) + entry->is_blocked = FALSE; + } +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-binding-pool.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-binding-pool.h --- clutter-0.8.4/clutter/clutter-binding-pool.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-binding-pool.h 2009-01-28 08:12:44.000000000 +0000 @@ -0,0 +1,119 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Copyright (C) 2008 Intel Corporation. + * + * Authored By: Emmanuele Bassi + * + * 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 . + */ + +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_BINDING_POOL_H__ +#define __CLUTTER_BINDING_POOL_H__ + +#include +#include + +G_BEGIN_DECLS + +#define CLUTTER_TYPE_BINDING_POOL (clutter_binding_pool_get_type ()) +#define CLUTTER_BINDING_POOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BINDING_POOL, ClutterBindingPool)) +#define CLUTTER_IS_BINDING_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BINDING_POOL)) + +/** + * ClutterBindingPool: + * + * Container of key bindings. The #ClutterBindingPool struct is + * private. + * + * Since: 1.0 + */ +typedef struct _ClutterBindingPool ClutterBindingPool; + +/** + * ClutterBindingActionFunc: + * @gobject: a #GObject + * @action_name: the name of the action + * @key_val: the key symbol + * @modifiers: bitmask of the modifier flags + * + * The prototype for the callback function registered with + * clutter_binding_pool_install_action() and invoked by + * clutter_binding_pool_activate(). + * + * Return value: the function should return %TRUE if the key + * binding has been handled, and return %FALSE otherwise + * + * Since: 1.0 + */ +typedef gboolean (* ClutterBindingActionFunc) (GObject *gobject, + const gchar *action_name, + guint key_val, + ClutterModifierType modifiers); + +GType clutter_binding_pool_get_type (void) G_GNUC_CONST; + +ClutterBindingPool * clutter_binding_pool_new (const gchar *name); +ClutterBindingPool * clutter_binding_pool_get_for_class (gpointer klass); +ClutterBindingPool * clutter_binding_pool_find (const gchar *name); + +void clutter_binding_pool_install_action (ClutterBindingPool *pool, + const gchar *action_name, + guint key_val, + ClutterModifierType modifiers, + GCallback callback, + gpointer data, + GDestroyNotify notify); +void clutter_binding_pool_install_closure (ClutterBindingPool *pool, + const gchar *action_name, + guint key_val, + ClutterModifierType modifiers, + GClosure *closure); +void clutter_binding_pool_override_action (ClutterBindingPool *pool, + guint key_val, + ClutterModifierType modifiers, + GCallback callback, + gpointer data, + GDestroyNotify notify); +void clutter_binding_pool_override_closure (ClutterBindingPool *pool, + guint key_val, + ClutterModifierType modifiers, + GClosure *closure); + +G_CONST_RETURN gchar *clutter_binding_pool_find_action (ClutterBindingPool *pool, + guint key_val, + ClutterModifierType modifiers); +void clutter_binding_pool_remove_action (ClutterBindingPool *pool, + guint key_val, + ClutterModifierType modifiers); + +gboolean clutter_binding_pool_activate (ClutterBindingPool *pool, + guint key_val, + ClutterModifierType modifiers, + GObject *gobject); + +void clutter_binding_pool_block_action (ClutterBindingPool *pool, + const gchar *action_name); +void clutter_binding_pool_unblock_action (ClutterBindingPool *pool, + const gchar *action_name); + +G_END_DECLS + +#endif /* __CLUTTER_BINDING_POOL_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-cairo-texture.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-cairo-texture.c --- clutter-0.8.4/clutter/clutter-cairo-texture.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-cairo-texture.c 2009-01-28 08:12:44.000000000 +0000 @@ -0,0 +1,762 @@ +/* + * Clutter + * + * An OpenGL based 'interactive canvas' library. + * + * Authored By: Emmanuele Bassi + * Matthew Allum + * Chris Lord + * Iain Holmes + * Neil Roberts + * + * Copyright (C) 2008 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, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:clutter-cairo-texture + * @short_description: Texture with Cairo integration + * + * #ClutterCairoTexture is a #ClutterTexture that displays the contents + * of a Cairo context. The #ClutterCairoTexture actor will create a + * Cairo image surface which will then be uploaded to a GL texture when + * needed. + * + * #ClutterCairoTexture will provide a #cairo_t context by using the + * clutter_cairo_texture_create() and clutter_cairo_texture_create_region() + * functions; you can use the Cairo API to draw on the context and then + * call cairo_destroy() when done. + * + * As soon as the context is destroyed with cairo_destroy(), the contents + * of the surface will be uploaded into the #ClutterCairoTexture actor: + * + * |[ + * cairo_t *cr; + * + * cr = clutter_cairo_texture_create (CLUTTER_CAIRO_TEXTURE (texture)); + * + * /* draw on the context */ + * + * cairo_destroy (cr); + * ]| + * + * Note that you should never use the code above inside the + * #ClutterActor::paint or #ClutterActor::pick virtual functions or + * signal handlers because it will lead to performance + * degradation. + * + * Since #ClutterCairoTexture uses a Cairo image surface + * internally all the drawing operations will be performed in + * software and not using hardware acceleration. This can lead to + * performance degradation if the contents of the texture change + * frequently. + * + * #ClutterCairoTexture is available since Clutter 1.0. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include "clutter-cairo-texture.h" +#include "clutter-debug.h" +#include "clutter-private.h" + +G_DEFINE_TYPE (ClutterCairoTexture, + clutter_cairo_texture, + CLUTTER_TYPE_TEXTURE); + +enum +{ + PROP_0, + + PROP_SURFACE_WIDTH, + PROP_SURFACE_HEIGHT +}; + +#ifdef CLUTTER_ENABLE_DEBUG +#define clutter_warn_if_paint_fail(obj) G_STMT_START { \ + if (CLUTTER_PRIVATE_FLAGS ((obj)) & CLUTTER_ACTOR_IN_PAINT) { \ + g_warning ("%s should not be called during the paint sequence " \ + "of a ClutterCairoTexture as it will likely cause " \ + "performance issues.", G_STRFUNC); \ + } } G_STMT_END +#else +#define clutter_warn_if_paint_fail(obj) /* void */ +#endif /* CLUTTER_ENABLE_DEBUG */ + +#define CLUTTER_CAIRO_TEXTURE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_CAIRO_TEXTURE, ClutterCairoTexturePrivate)) + +struct _ClutterCairoTexturePrivate +{ + cairo_format_t format; + + cairo_surface_t *cr_surface; + guchar *cr_surface_data; + + guint width; + guint height; + guint rowstride; +}; + +typedef struct +{ + gint x; + gint y; + guint width; + guint height; +} ClutterCairoTextureRectangle; + +typedef struct +{ + ClutterCairoTexture *cairo; + ClutterCairoTextureRectangle rect; +} ClutterCairoTextureContext; + +static const cairo_user_data_key_t clutter_cairo_texture_surface_key; +static const cairo_user_data_key_t clutter_cairo_texture_context_key; + +static void +clutter_cairo_texture_surface_destroy (void *data) +{ + ClutterCairoTexture *cairo = data; + + cairo->priv->cr_surface = NULL; +} + +static void +clutter_cairo_texture_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + ClutterCairoTexturePrivate *priv; + + priv = CLUTTER_CAIRO_TEXTURE (object)->priv; + + switch (prop_id) + { + case PROP_SURFACE_WIDTH: + priv->width = g_value_get_uint (value); + break; + + case PROP_SURFACE_HEIGHT: + priv->height = g_value_get_uint (value); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +clutter_cairo_texture_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + ClutterCairoTexturePrivate *priv; + + priv = CLUTTER_CAIRO_TEXTURE (object)->priv; + + switch (prop_id) + { + case PROP_SURFACE_WIDTH: + g_value_set_uint (value, priv->width); + break; + + case PROP_SURFACE_HEIGHT: + g_value_set_uint (value, priv->height); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +clutter_cairo_texture_finalize (GObject *object) +{ + ClutterCairoTexturePrivate *priv = CLUTTER_CAIRO_TEXTURE (object)->priv; + + if (priv->cr_surface) + { + cairo_surface_t *surface = priv->cr_surface; + + cairo_surface_finish (priv->cr_surface); + cairo_surface_set_user_data (priv->cr_surface, + &clutter_cairo_texture_surface_key, + NULL, NULL); + cairo_surface_destroy (surface); + + priv->cr_surface = NULL; + } + + if (priv->cr_surface_data) + { + g_free (priv->cr_surface_data); + priv->cr_surface_data = NULL; + } + + G_OBJECT_CLASS (clutter_cairo_texture_parent_class)->finalize (object); +} + +static inline void +clutter_cairo_texture_surface_resize_internal (ClutterCairoTexture *cairo) +{ + ClutterCairoTexturePrivate *priv = cairo->priv; + + if (priv->cr_surface) + { + cairo_surface_t *surface = priv->cr_surface; + + /* If the surface is already the right size then don't bother + doing anything */ + if (priv->width == cairo_image_surface_get_width (priv->cr_surface) + && priv->height == cairo_image_surface_get_height (priv->cr_surface)) + return; + + cairo_surface_finish (surface); + cairo_surface_set_user_data (surface, + &clutter_cairo_texture_surface_key, + NULL, NULL); + cairo_surface_destroy (surface); + + priv->cr_surface = NULL; + } + + if (priv->cr_surface_data) + { + g_free (priv->cr_surface_data); + priv->cr_surface_data = NULL; + } + + if (priv->width == 0 || priv->height == 0) + return; + +#if CAIRO_VERSION > 106000 + priv->rowstride = cairo_format_stride_for_width (priv->format, priv->width); +#else + /* poor man's version of cairo_format_stride_for_width() */ + switch (priv->format) + { + case CAIRO_FORMAT_ARGB32: + case CAIRO_FORMAT_RGB24: + priv->rowstride = priv->width * 4; + break; + + case CAIRO_FORMAT_A8: + case CAIRO_FORMAT_A1: + priv->rowstride = priv->width; + break; + + default: + g_assert_not_reached (); + break; + } +#endif /* CAIRO_VERSION > 106000 */ + + priv->cr_surface_data = g_malloc0 (priv->height * priv->rowstride); + priv->cr_surface = + cairo_image_surface_create_for_data (priv->cr_surface_data, + priv->format, + priv->width, priv->height, + priv->rowstride); + + cairo_surface_set_user_data (priv->cr_surface, + &clutter_cairo_texture_surface_key, + cairo, + clutter_cairo_texture_surface_destroy); + + /* The texture data will be all zeroes so we can use it to create a + * blank Cogl texture even though its in a different format + */ + clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (cairo), + priv->cr_surface_data, + TRUE, priv->width, priv->height, + priv->rowstride, + 4, 0, NULL); +} + +static void +clutter_cairo_texture_notify (GObject *object, + GParamSpec *pspec) +{ + /* When the surface width or height changes then resize the cairo + surface. This is done here instead of directly in set_property so + that if both the width and height properties are set using a + single call to g_object_set then the surface will only be resized + once because the notifications will be frozen in between */ + if (!strcmp ("surface-width", pspec->name) + || !strcmp ("surface-height", pspec->name)) + { + ClutterCairoTexture *cairo = CLUTTER_CAIRO_TEXTURE (object); + + clutter_cairo_texture_surface_resize_internal (cairo); + } + + if (G_OBJECT_CLASS (clutter_cairo_texture_parent_class)->notify) + G_OBJECT_CLASS (clutter_cairo_texture_parent_class)->notify (object, pspec); +} + +static void +clutter_cairo_texture_get_preferred_width (ClutterActor *actor, + ClutterUnit for_height, + ClutterUnit *min_width, + ClutterUnit *natural_width) +{ + ClutterCairoTexturePrivate *priv = CLUTTER_CAIRO_TEXTURE (actor)->priv; + + if (min_width) + *min_width = 0; + + if (natural_width) + *natural_width = CLUTTER_UNITS_FROM_DEVICE (priv->width); +} + +static void +clutter_cairo_texture_get_preferred_height (ClutterActor *actor, + ClutterUnit for_width, + ClutterUnit *min_height, + ClutterUnit *natural_height) +{ + ClutterCairoTexturePrivate *priv = CLUTTER_CAIRO_TEXTURE (actor)->priv; + + if (min_height) + *min_height = 0; + + if (natural_height) + *natural_height = CLUTTER_UNITS_FROM_DEVICE (priv->height); +} + +static void +clutter_cairo_texture_class_init (ClutterCairoTextureClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); + + gobject_class->finalize = clutter_cairo_texture_finalize; + gobject_class->set_property = clutter_cairo_texture_set_property; + gobject_class->get_property = clutter_cairo_texture_get_property; + gobject_class->notify = clutter_cairo_texture_notify; + + actor_class->get_preferred_width = + clutter_cairo_texture_get_preferred_width; + actor_class->get_preferred_height = + clutter_cairo_texture_get_preferred_height; + + g_type_class_add_private (gobject_class, sizeof (ClutterCairoTexturePrivate)); + + /** + * ClutterCairoTexture:surface-width: + * + * The width of the Cairo surface used by the #ClutterCairoTexture + * actor, in pixels. + * + * Since: 1.0 + */ + g_object_class_install_property (gobject_class, + PROP_SURFACE_WIDTH, + g_param_spec_uint ("surface-width", + "Surface-Width", + "Surface Width", + 0, G_MAXUINT, + 0, + CLUTTER_PARAM_READWRITE)); + /** + * ClutterCairoTexture:surface-height: + * + * The height of the Cairo surface used by the #ClutterCairoTexture + * actor, in pixels. + * + * Since: 1.0 + */ + g_object_class_install_property (gobject_class, + PROP_SURFACE_HEIGHT, + g_param_spec_uint ("surface-height", + "Surface-Height", + "Surface Height", + 0, G_MAXUINT, + 0, + CLUTTER_PARAM_READWRITE)); +} + +static void +clutter_cairo_texture_init (ClutterCairoTexture *self) +{ + ClutterCairoTexturePrivate *priv; + + self->priv = priv = CLUTTER_CAIRO_TEXTURE_GET_PRIVATE (self); + + /* FIXME - we are hardcoding the format; it would be good to have + * a :surface-format construct-only property for creating + * textures with a different format and have the cairo surface + * match that format + */ + priv->format = CAIRO_FORMAT_ARGB32; +} + +/** + * clutter_cairo_texture_new: + * @width: the width of the surface + * @height: the height of the surface + * + * Creates a new #ClutterCairoTexture actor, with a surface of @width by + * @height pixels. + * + * Return value: the newly created #ClutterCairoTexture actor + * + * Since: 1.0 + */ +ClutterActor* +clutter_cairo_texture_new (guint width, + guint height) +{ + return g_object_new (CLUTTER_TYPE_CAIRO_TEXTURE, + "surface-width", width, + "surface-height", height, + NULL); +} + +static void +clutter_cairo_texture_context_destroy (void *data) +{ + ClutterCairoTextureContext *ctxt = data; + ClutterCairoTexture *cairo = ctxt->cairo; + ClutterCairoTexturePrivate *priv; + + gint cairo_width, cairo_height, cairo_rowstride; + gint surface_width, surface_height; + guchar *pixbuf_data, *dst, *cairo_data; + guint *src, pixbuf_rowstride; + gint x, y; + + priv = CLUTTER_CAIRO_TEXTURE_GET_PRIVATE (cairo); + + if (!priv->cr_surface) + return; + + surface_width = cairo_image_surface_get_width (priv->cr_surface); + surface_height = cairo_image_surface_get_height (priv->cr_surface); + + cairo_width = MIN (ctxt->rect.width, surface_width); + cairo_height = MIN (ctxt->rect.height, surface_height); + + if (!cairo_width || !cairo_height) + { + g_free (ctxt); + return; + } + + cairo_rowstride = priv->rowstride; + cairo_data = priv->cr_surface_data; + pixbuf_data = g_malloc (cairo_width * cairo_height * 4); + pixbuf_rowstride = cairo_width * 4; + + /* BAH BAH BAH ! un-pre-multiply alpha... + * + * FIXME: Need to figure out if GL has a premult texture + * format, or we need to change the order of the + * paint sequence in Clutter. or go back to battling + * glitz (ugh). + * + * in theory, this could be moved to a shader, but apparently + * the performance gain is not really worth it. + */ + for (y = 0; y < cairo_height; y++) + { + src = (unsigned int *) (cairo_data + + ((y + ctxt->rect.y) * cairo_rowstride) + + (ctxt->rect.x * 4)); + dst = pixbuf_data + y * pixbuf_rowstride; + + for (x = 0; x < cairo_width; x++) + { + guchar alpha = (*src >> 24) & 0xff; + + if (alpha == 0) + dst[0] = dst[1] = dst[2] = dst[3] = alpha; + else + { + dst[0] = (((*src >> 16) & 0xff) * 255 ) / alpha; + dst[1] = (((*src >> 8) & 0xff) * 255 ) / alpha; + dst[2] = (((*src >> 0) & 0xff) * 255 ) / alpha; + dst[3] = alpha; + } + + dst += 4; + src++; + } + } + + clutter_texture_set_area_from_rgb_data (CLUTTER_TEXTURE (cairo), + pixbuf_data, + TRUE, + ctxt->rect.x, + ctxt->rect.y, + cairo_width, cairo_height, + pixbuf_rowstride, + 4, 0, NULL); + + g_free (pixbuf_data); + g_free (ctxt); + + if (CLUTTER_ACTOR_IS_VISIBLE (cairo)) + clutter_actor_queue_redraw (CLUTTER_ACTOR (cairo)); +} + +static void +intersect_rectangles (ClutterCairoTextureRectangle *a, + ClutterCairoTextureRectangle *b, + ClutterCairoTextureRectangle *inter) +{ + gint dest_x, dest_y; + gint dest_width, dest_height; + + dest_x = MAX (a->x, b->x); + dest_y = MAX (a->y, b->y); + dest_width = MIN (a->x + a->width, b->x + b->width) - dest_x; + dest_height = MIN (a->y + a->height, b->y + b->height) - dest_y; + + if (dest_width > 0 && dest_height > 0) + { + inter->x = dest_x; + inter->y = dest_y; + inter->width = dest_width; + inter->height = dest_height; + } + else + { + inter->x = 0; + inter->y = 0; + inter->width = 0; + inter->height = 0; + } +} + +/** + * clutter_cairo_texture_create_region: + * @self: a #ClutterCairoTexture + * @x_offset: offset of the region on the X axis + * @y_offset: offset of the region on the Y axis + * @width: width of the region, or -1 for the full surface width + * @height: height of the region, or -1 for the full surface height + * + * Creates a new Cairo context that will updat the region defined + * by @x_offset, @y_offset, @width and @height. + * + * Do not call this function within the paint virtual + * function or from a callback to the #ClutterActor::paint + * signal. + * + * Return value: a newly created Cairo context. Use cairo_destroy() + * to upload the contents of the context when done drawing + * + * Since: 1.0 + */ +cairo_t * +clutter_cairo_texture_create_region (ClutterCairoTexture *self, + gint x_offset, + gint y_offset, + gint width, + gint height) +{ + ClutterCairoTexturePrivate *priv; + ClutterCairoTextureContext *ctxt; + ClutterCairoTextureRectangle region, area, inter; + cairo_t *cr; + + g_return_val_if_fail (CLUTTER_IS_CAIRO_TEXTURE (self), NULL); + + clutter_warn_if_paint_fail (self); + + priv = self->priv; + + if (width < 0) + width = priv->width; + + if (height < 0) + height = priv->height; + + if (width == 0 || height == 0) + { + g_warning ("Unable to create a context for an image surface of " + "width %d and height %d. Set the surface size to be " + "at least 1 pixel by 1 pixel.", + width, height); + return NULL; + } + + if (!priv->cr_surface) + return NULL; + + ctxt = g_new0 (ClutterCairoTextureContext, 1); + ctxt->cairo = self; + + region.x = x_offset; + region.y = y_offset; + region.width = width; + region.height = height; + + area.x = 0; + area.y = 0; + area.width = priv->width; + area.height = priv->height; + + /* Limit the region to the visible rectangle */ + intersect_rectangles (&area, ®ion, &inter); + + ctxt->rect.x = inter.x; + ctxt->rect.y = inter.y; + ctxt->rect.width = inter.width; + ctxt->rect.height = inter.height; + + cr = cairo_create (priv->cr_surface); + cairo_set_user_data (cr, &clutter_cairo_texture_context_key, + ctxt, clutter_cairo_texture_context_destroy); + + return cr; +} + +/** + * clutter_cairo_texture_create: + * @self: a #ClutterCairoTexture + * + * Creates a new Cairo context for the @cairo texture. It is + * similar to using clutter_cairo_texture_create_region() with @x_offset + * and @y_offset of 0, @width equal to the @cairo texture surface width + * and @height equal to the @cairo texture surface height. + * + * Do not call this function within the paint virtual + * function or from a callback to the #ClutterActor::paint + * signal. + * + * Return value: a newly created Cairo context. Use cairo_destroy() + * to upload the contents of the context when done drawing + * + * Since: 1.0 + */ +cairo_t * +clutter_cairo_texture_create (ClutterCairoTexture *self) +{ + g_return_val_if_fail (CLUTTER_IS_CAIRO_TEXTURE (self), NULL); + + clutter_warn_if_paint_fail (self); + + return clutter_cairo_texture_create_region (self, 0, 0, -1, -1); +} + +/** + * clutter_cairo_set_source_color: + * @cr: a Cairo context + * @color: a #ClutterColor + * + * Utility function for setting the source color of @cr using + * a #ClutterColor. + * + * Since: 1.0 + */ +void +clutter_cairo_set_source_color (cairo_t *cr, + const ClutterColor *color) +{ + g_return_if_fail (cr != NULL); + g_return_if_fail (color != NULL); + + if (color->alpha == 0xff) + cairo_set_source_rgb (cr, + color->red / 255.0, + color->green / 255.0, + color->blue / 255.0); + else + cairo_set_source_rgba (cr, + color->red / 255.0, + color->green / 255.0, + color->blue / 255.0, + color->alpha / 255.0); +} + +/** + * clutter_cairo_texture_set_surface_size: + * @self: a #ClutterCairoTexture + * @width: the new width of the surface + * @height: the new height of the surface + * + * Resizes the Cairo surface used by @self to @width and @height. + * + * Since: 1.0 + */ +void +clutter_cairo_texture_set_surface_size (ClutterCairoTexture *self, + guint width, + guint height) +{ + ClutterCairoTexturePrivate *priv; + + g_return_if_fail (CLUTTER_IS_CAIRO_TEXTURE (self)); + + priv = self->priv; + + if (width == priv->width && height == priv->height) + return; + + g_object_freeze_notify (G_OBJECT (self)); + + if (priv->width != width) + { + priv->width = width; + g_object_notify (G_OBJECT (self), "surface-width"); + } + + if (priv->height != height) + { + priv->height = height; + g_object_notify (G_OBJECT (self), "surface-height"); + } + + clutter_cairo_texture_surface_resize_internal (self); + + g_object_thaw_notify (G_OBJECT (self)); +} + +/** + * clutter_cairo_texture_get_surface_size: + * @self: a #ClutterCairoTexture + * @width: return location for the surface width, or %NULL + * @height: return location for the surface height, or %NULL + * + * Retrieves the surface width and height for @self. + * + * Since: 1.0 + */ +void +clutter_cairo_texture_get_surface_size (ClutterCairoTexture *self, + guint *width, + guint *height) +{ + g_return_if_fail (CLUTTER_IS_CAIRO_TEXTURE (self)); + + if (width) + *width = self->priv->width; + + if (height) + *height = self->priv->height; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-cairo-texture.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-cairo-texture.h --- clutter-0.8.4/clutter/clutter-cairo-texture.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-cairo-texture.h 2009-01-28 08:12:44.000000000 +0000 @@ -0,0 +1,106 @@ +/* + * Clutter + * + * An OpenGL based 'interactive canvas' library. + * + * Authored By: Emmanuele Bassi + * Matthew Allum + * Chris Lord + * Iain Holmes + * Neil Roberts + * + * Copyright (C) 2008 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, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_CAIRO_TEXTURE_H__ +#define __CLUTTER_CAIRO_TEXTURE_H__ + +#include +#include + +G_BEGIN_DECLS + +#define CLUTTER_TYPE_CAIRO_TEXTURE (clutter_cairo_texture_get_type ()) +#define CLUTTER_CAIRO_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_CAIRO_TEXTURE, ClutterCairoTexture)) +#define CLUTTER_CAIRO_TEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_CAIRO_TEXTURE, ClutterCairoTextureClass)) +#define CLUTTER_IS_CAIRO_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_CAIRO_TEXTURE)) +#define CLUTTER_IS_CAIRO_TEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_CAIRO_TEXTURE)) +#define CLUTTER_CAIRO_TEXTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_CAIRO_TEXTURE, ClutterCairoTextureClass)) + +typedef struct _ClutterCairoTexture ClutterCairoTexture; +typedef struct _ClutterCairoTextureClass ClutterCairoTextureClass; +typedef struct _ClutterCairoTexturePrivate ClutterCairoTexturePrivate; + +/** + * ClutterCairoTexture: + * + * The #ClutterCairoTexture struct contains only private data. + * + * Since: 1.0 + */ +struct _ClutterCairoTexture +{ + /*< private >*/ + ClutterTexture parent_instance; + + ClutterCairoTexturePrivate *priv; +}; + +/** + * ClutterCairoTextureClass: + * + * The #ClutterCairoTextureClass struct contains only private data. + * + * Since: 1.0 + */ +struct _ClutterCairoTextureClass +{ + /*< private >*/ + ClutterTextureClass parent_class; + + void (*_clutter_cairo_1) (void); + void (*_clutter_cairo_2) (void); + void (*_clutter_cairo_3) (void); + void (*_clutter_cairo_4) (void); +}; + +GType clutter_cairo_texture_get_type (void) G_GNUC_CONST; +ClutterActor *clutter_cairo_texture_new (guint width, + guint height); +cairo_t * clutter_cairo_texture_create_region (ClutterCairoTexture *self, + gint x_offset, + gint y_offset, + gint width, + gint height); +cairo_t * clutter_cairo_texture_create (ClutterCairoTexture *self); +void clutter_cairo_texture_set_surface_size (ClutterCairoTexture *self, + guint width, + guint height); +void clutter_cairo_texture_get_surface_size (ClutterCairoTexture *self, + guint *width, + guint *height); + +void clutter_cairo_set_source_color (cairo_t *cr, + const ClutterColor *color); + +G_END_DECLS + +#endif /* __CLUTTER_CAIRO_TEXTURE_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-child-meta.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-child-meta.h --- clutter-0.8.4/clutter/clutter-child-meta.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-child-meta.h 2009-01-28 08:12:44.000000000 +0000 @@ -22,11 +22,13 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __CLUTTER_CHILD_META_H__ #define __CLUTTER_CHILD_META_H__ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-clone.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-clone.c --- clutter-0.8.4/clutter/clutter-clone.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-clone.c 2009-01-28 16:45:24.000000000 +0000 @@ -0,0 +1,325 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Copyright (C) 2008 Intel Corporation. + * + * Authored By: Robert Bragg + * + * 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 . + */ + +/** + * SECTION:clutterclone + * @short_description: An actor that displays a clone of a source actor + * + * #ClutterClone is a #ClutterActor which draws with the paint + * function of another actor, scaled to fit its own allocation. + * + * #ClutterClone can be used to efficiently clone any other actor. + * + * This is different from clutter_texture_new_from_actor() + * which requires support for FBOs in the underlying GL + * implementation. + * + * #ClutterClone is available since Clutter 1.0 + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "clutter-color.h" +#include "clutter-clone.h" +#include "clutter-debug.h" +#include "clutter-main.h" +#include "clutter-private.h" + +#include "cogl/cogl.h" + +G_DEFINE_TYPE (ClutterClone, clutter_clone, CLUTTER_TYPE_ACTOR); + +enum +{ + PROP_0, + + PROP_SOURCE +}; + +#define CLUTTER_CLONE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_CLONE, ClutterClonePrivate)) + +struct _ClutterClonePrivate +{ + ClutterActor *clone_source; +}; + +static void +clutter_clone_get_preferred_width (ClutterActor *self, + ClutterUnit for_height, + ClutterUnit *min_width_p, + ClutterUnit *natural_width_p) +{ + ClutterClonePrivate *priv = CLUTTER_CLONE (self)->priv; + ClutterActor *clone_source = priv->clone_source; + + if (G_UNLIKELY (clone_source == NULL)) + { + if (min_width_p) + *min_width_p = 0; + + if (natural_width_p) + *natural_width_p = 0; + } + else + clutter_actor_get_preferred_width (clone_source, + for_height, + min_width_p, + natural_width_p); +} + +static void +clutter_clone_get_preferred_height (ClutterActor *self, + ClutterUnit for_width, + ClutterUnit *min_height_p, + ClutterUnit *natural_height_p) +{ + ClutterClonePrivate *priv = CLUTTER_CLONE (self)->priv; + ClutterActor *clone_source = priv->clone_source; + + if (G_UNLIKELY (clone_source == NULL)) + { + if (min_height_p) + *min_height_p = 0; + + if (natural_height_p) + *natural_height_p = 0; + } + else + clutter_actor_get_preferred_height (clone_source, + for_width, + min_height_p, + natural_height_p); +} + +static void +clutter_clone_paint (ClutterActor *self) +{ + ClutterClone *clone = CLUTTER_CLONE (self); + ClutterClonePrivate *priv = clone->priv; + ClutterGeometry geom; + ClutterGeometry clone_source_geom; + gfloat x_scale, y_scale; + + if (G_UNLIKELY (priv->clone_source == NULL)) + return; + + CLUTTER_NOTE (PAINT, + "painting clone actor '%s'", + clutter_actor_get_name (self) ? clutter_actor_get_name (self) + : "unknown"); + + clutter_actor_get_allocation_geometry (self, &geom); + clutter_actor_get_allocation_geometry (priv->clone_source, + &clone_source_geom); + + /* We need to scale what the clone-source actor paints to fill our own + * allocation... */ + + x_scale = (gfloat) geom.width / clone_source_geom.width; + y_scale = (gfloat) geom.height / clone_source_geom.height; + + cogl_scale (x_scale, y_scale, 1.0); + + /* The final bits of magic: + * - We need to make sure that when the clone-source actor's paint method + * calls clutter_actor_get_paint_opacity, it traverses our parent not it's + * real parent. + * - We need to stop clutter_actor_paint applying the model view matrix of + * the clone source actor. + */ + _clutter_actor_set_opacity_parent (priv->clone_source, + clutter_actor_get_parent (self)); + _clutter_actor_set_enable_model_view_transform (priv->clone_source, FALSE); + + clutter_actor_paint (priv->clone_source); + + _clutter_actor_set_enable_model_view_transform (priv->clone_source, TRUE); + _clutter_actor_set_opacity_parent (priv->clone_source, NULL); +} + +static void +clutter_clone_set_property (GObject *gobject, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + ClutterClone *clone = CLUTTER_CLONE (gobject); + + switch (prop_id) + { + case PROP_SOURCE: + clutter_clone_set_source (clone, g_value_get_object (value)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +clutter_clone_get_property (GObject *gobject, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + ClutterClonePrivate *priv = CLUTTER_CLONE (gobject)->priv; + + switch (prop_id) + { + case PROP_SOURCE: + g_value_set_object (value, priv->clone_source); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +clutter_clone_dispose (GObject *gobject) +{ + ClutterClonePrivate *priv = CLUTTER_CLONE (gobject)->priv; + + if (priv->clone_source) + { + g_object_unref (priv->clone_source); + priv->clone_source = NULL; + } + + G_OBJECT_CLASS (clutter_clone_parent_class)->dispose (gobject); +} + +static void +clutter_clone_class_init (ClutterCloneClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); + GParamSpec *pspec = NULL; + + g_type_class_add_private (gobject_class, sizeof (ClutterClonePrivate)); + + actor_class->paint = clutter_clone_paint; + actor_class->get_preferred_width = clutter_clone_get_preferred_width; + actor_class->get_preferred_height = clutter_clone_get_preferred_height; + + gobject_class->dispose = clutter_clone_dispose; + gobject_class->set_property = clutter_clone_set_property; + gobject_class->get_property = clutter_clone_get_property; + + /** + * ClutterClone:source: + * + * This property specifies the source actor being cloned. + * + * Since: 1.0 + */ + pspec = g_param_spec_object ("source", + "Source", + "Specifies the actor to be cloned", + CLUTTER_TYPE_ACTOR, + G_PARAM_CONSTRUCT_ONLY | + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_SOURCE, pspec); +} + +static void +clutter_clone_init (ClutterClone *self) +{ + ClutterClonePrivate *priv; + + self->priv = priv = CLUTTER_CLONE_GET_PRIVATE (self); + + priv->clone_source = NULL; +} + +/** + * clutter_clone_new: + * @source: a #ClutterActor, or %NULL + * + * Creates a new #ClutterActor which clones @source/ + * + * Return value: the newly created #ClutterClone + * + * Since: 1.0 + */ +ClutterActor * +clutter_clone_new (ClutterActor *source) +{ + return g_object_new (CLUTTER_TYPE_CLONE, "source", source, NULL); +} + +/** + * clutter_clone_set_source: + * @clone: a #ClutterClone + * @source: a #ClutterActor, or %NULL + * + * Sets @source as the source actor to be cloned by @clone. + * + * Since: 1.0 + */ +void +clutter_clone_set_source (ClutterClone *clone, + ClutterActor *source) +{ + ClutterClonePrivate *priv; + + g_return_if_fail (CLUTTER_IS_CLONE (clone)); + g_return_if_fail (source == NULL || CLUTTER_IS_ACTOR (source)); + + priv = clone->priv; + + if (priv->clone_source) + { + g_object_unref (priv->clone_source); + priv->clone_source = NULL; + } + + if (source) + priv->clone_source = g_object_ref (source); + + g_object_notify (G_OBJECT (clone), "source"); + + clutter_actor_queue_relayout (CLUTTER_ACTOR (clone)); +} + +/** + * clutter_clone_get_source: + * @clone: a #ClutterClone + * + * Retrieves the source #ClutterActor being cloned by @clone + * + * Return value: the actor source for the clone + * + * Since: 1.0 + */ +ClutterActor * +clutter_clone_get_source (ClutterClone *clone) +{ + g_return_val_if_fail (CLUTTER_IS_CLONE (clone), NULL); + + return clone->priv->clone_source; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-clone.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-clone.h --- clutter-0.8.4/clutter/clutter-clone.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-clone.h 2009-01-28 16:45:24.000000000 +0000 @@ -0,0 +1,75 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Copyright (C) 2008 Intel Corporation. + * + * Authored By: Robert Bragg + * + * 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 . + */ + +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_CLONE_H__ +#define __CLUTTER_CLONE_H__ + +#include + +G_BEGIN_DECLS + +#define CLUTTER_TYPE_CLONE (clutter_clone_get_type()) +#define CLUTTER_CLONE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_CLONE, ClutterClone)) +#define CLUTTER_CLONE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_CLONE, ClutterCloneClass)) +#define CLUTTER_IS_CLONE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_CLONE)) +#define CLUTTER_IS_CLONE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_CLONE)) +#define CLUTTER_CLONE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_CLONE, ClutterCloneClass)) + +typedef struct _ClutterClone ClutterClone; +typedef struct _ClutterCloneClass ClutterCloneClass; +typedef struct _ClutterClonePrivate ClutterClonePrivate; + +struct _ClutterClone +{ + /*< private >*/ + ClutterActor parent_instance; + + ClutterClonePrivate *priv; +}; + +struct _ClutterCloneClass +{ + /*< private >*/ + ClutterActorClass parent_class; + + /* padding for future expansion */ + void (*_clutter_actor_clone1) (void); + void (*_clutter_actor_clone2) (void); + void (*_clutter_actor_clone3) (void); + void (*_clutter_actor_clone4) (void); +}; + +GType clutter_clone_get_type (void) G_GNUC_CONST; + +ClutterActor *clutter_clone_new (ClutterActor *source); +void clutter_clone_set_source (ClutterClone *clone, + ClutterActor *source); +ClutterActor *clutter_clone_get_source (ClutterClone *clone); + +G_END_DECLS + +#endif /* __CLUTTER_CLONE_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-clone-texture.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-clone-texture.c --- clutter-0.8.4/clutter/clutter-clone-texture.c 2008-11-13 14:44:32.000000000 +0000 +++ clutter-0.9.0/clutter/clutter-clone-texture.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,453 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/** - * SECTION:clutter-clone-texture - * @short_description: Actor for cloning existing textures in an - * efficient way. - * - * #ClutterCloneTexture allows the cloning of existing #ClutterTexture based - * actors whilst saving underlying graphics resources. - */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "clutter-clone-texture.h" -#include "clutter-main.h" -#include "clutter-feature.h" -#include "clutter-actor.h" -#include "clutter-util.h" -#include "clutter-enum-types.h" -#include "clutter-private.h" -#include "clutter-debug.h" - -#include "cogl/cogl.h" - -enum -{ - PROP_0, - PROP_PARENT_TEXTURE, - PROP_REPEAT_Y, - PROP_REPEAT_X -}; - -G_DEFINE_TYPE (ClutterCloneTexture, - clutter_clone_texture, - CLUTTER_TYPE_ACTOR); - -#define CLUTTER_CLONE_TEXTURE_GET_PRIVATE(obj) \ -(G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_CLONE_TEXTURE, ClutterCloneTexturePrivate)) - -struct _ClutterCloneTexturePrivate -{ - ClutterTexture *parent_texture; - guint repeat_x : 1; - guint repeat_y : 1; -}; - -static void -clutter_clone_texture_get_preferred_width (ClutterActor *self, - ClutterUnit for_height, - ClutterUnit *min_width_p, - ClutterUnit *natural_width_p) -{ - ClutterCloneTexturePrivate *priv = CLUTTER_CLONE_TEXTURE (self)->priv; - ClutterActor *parent_texture; - ClutterActorClass *parent_texture_class; - - /* Note that by calling the get_width_request virtual method directly - * and skipping the clutter_actor_get_preferred_width() wrapper, we - * are ignoring any size request override set on the parent texture - * and just getting the normal size of the parent texture. - */ - parent_texture = CLUTTER_ACTOR (priv->parent_texture); - if (!parent_texture) - { - if (min_width_p) - *min_width_p = 0; - - if (natural_width_p) - *natural_width_p = 0; - - return; - } - - parent_texture_class = CLUTTER_ACTOR_GET_CLASS (parent_texture); - parent_texture_class->get_preferred_width (parent_texture, - for_height, - min_width_p, - natural_width_p); -} - -static void -clutter_clone_texture_get_preferred_height (ClutterActor *self, - ClutterUnit for_width, - ClutterUnit *min_height_p, - ClutterUnit *natural_height_p) -{ - ClutterCloneTexturePrivate *priv = CLUTTER_CLONE_TEXTURE (self)->priv; - ClutterActor *parent_texture; - ClutterActorClass *parent_texture_class; - - /* Note that by calling the get_height_request virtual method directly - * and skipping the clutter_actor_get_preferred_height() wrapper, we - * are ignoring any size request override set on the parent texture and - * just getting the normal size of the parent texture. - */ - parent_texture = CLUTTER_ACTOR (priv->parent_texture); - if (!parent_texture) - { - if (min_height_p) - *min_height_p = 0; - - if (natural_height_p) - *natural_height_p = 0; - - return; - } - - parent_texture_class = CLUTTER_ACTOR_GET_CLASS (parent_texture); - parent_texture_class->get_preferred_height (parent_texture, - for_width, - min_height_p, - natural_height_p); -} - -static void -clutter_clone_texture_paint (ClutterActor *self) -{ - ClutterCloneTexturePrivate *priv; - ClutterActor *parent_texture; - gint x_1, y_1, x_2, y_2; - ClutterColor col = { 0xff, 0xff, 0xff, 0xff }; - CoglHandle cogl_texture; - ClutterFixed t_w, t_h; - guint tex_width, tex_height; - - priv = CLUTTER_CLONE_TEXTURE (self)->priv; - - /* no need to paint stuff if we don't have a texture to clone */ - if (!priv->parent_texture) - return; - - CLUTTER_NOTE (PAINT, - "painting clone texture '%s'", - clutter_actor_get_name (self) ? clutter_actor_get_name (self) - : "unknown"); - - /* parent texture may have been hidden, there for need to make sure its - * realised with resources available. - */ - parent_texture = CLUTTER_ACTOR (priv->parent_texture); - if (!CLUTTER_ACTOR_IS_REALIZED (parent_texture)) - clutter_actor_realize (parent_texture); - - /* If 'parent' texture isn't visible we run its paint to be sure it - * updates. Needed for TFP and likely FBOs. - * Potentially could cause issues - */ - if (!clutter_actor_get_paint_visibility(parent_texture)) - { - CLUTTER_SET_PRIVATE_FLAGS(parent_texture, - CLUTTER_TEXTURE_IN_CLONE_PAINT); - g_signal_emit_by_name (priv->parent_texture, "paint", NULL); - CLUTTER_UNSET_PRIVATE_FLAGS(parent_texture, - CLUTTER_TEXTURE_IN_CLONE_PAINT); - } - - col.alpha = clutter_actor_get_paint_opacity (self); - cogl_color (&col); - - clutter_actor_get_allocation_coords (self, &x_1, &y_1, &x_2, &y_2); - - CLUTTER_NOTE (PAINT, "paint to x1: %i, y1: %i x2: %i, y2: %i " - "opacity: %i", - x_1, y_1, x_2, y_2, - clutter_actor_get_opacity (self)); - - cogl_texture = clutter_texture_get_cogl_texture (priv->parent_texture); - - if (cogl_texture == COGL_INVALID_HANDLE) - return; - - tex_width = cogl_texture_get_width (cogl_texture); - tex_height = cogl_texture_get_height (cogl_texture); - - if (priv->repeat_x && tex_width > 0) - t_w = CFX_QDIV (CLUTTER_INT_TO_FIXED (x_2 - x_1), - CLUTTER_INT_TO_FIXED (tex_width)); - else - t_w = CFX_ONE; - if (priv->repeat_y && tex_height > 0) - t_h = CFX_QDIV (CLUTTER_INT_TO_FIXED (y_2 - y_1), - CLUTTER_INT_TO_FIXED (tex_height)); - else - t_h = CFX_ONE; - - /* Parent paint translated us into position */ - cogl_texture_rectangle (cogl_texture, 0, 0, - CLUTTER_INT_TO_FIXED (x_2 - x_1), - CLUTTER_INT_TO_FIXED (y_2 - y_1), - 0, 0, t_w, t_h); -} - -static void -set_parent_texture (ClutterCloneTexture *ctexture, - ClutterTexture *texture) -{ - ClutterCloneTexturePrivate *priv = ctexture->priv; - ClutterActor *actor = CLUTTER_ACTOR (ctexture); - gboolean was_visible = CLUTTER_ACTOR_IS_VISIBLE (ctexture); - - if (priv->parent_texture) - { - g_object_unref (priv->parent_texture); - priv->parent_texture = NULL; - - if (was_visible) - clutter_actor_hide (actor); - } - - if (texture) - { - priv->parent_texture = g_object_ref (texture); - - /* queue a redraw if the cloned texture is already visible */ - if (CLUTTER_ACTOR_IS_VISIBLE (priv->parent_texture) && - was_visible) - { - clutter_actor_show (actor); - clutter_actor_queue_redraw (actor); - } - - clutter_actor_queue_relayout (actor); - } - -} - -static void -clutter_clone_texture_dispose (GObject *object) -{ - ClutterCloneTexture *self = CLUTTER_CLONE_TEXTURE(object); - ClutterCloneTexturePrivate *priv = self->priv; - - if (priv->parent_texture) - g_object_unref (priv->parent_texture); - - priv->parent_texture = NULL; - - G_OBJECT_CLASS (clutter_clone_texture_parent_class)->dispose (object); -} - -static void -clutter_clone_texture_finalize (GObject *object) -{ - G_OBJECT_CLASS (clutter_clone_texture_parent_class)->finalize (object); -} - -static void -clutter_clone_texture_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ClutterCloneTexture *ctexture = CLUTTER_CLONE_TEXTURE (object); - ClutterCloneTexturePrivate *priv; - - priv = ctexture->priv; - - switch (prop_id) - { - case PROP_PARENT_TEXTURE: - set_parent_texture (ctexture, g_value_get_object (value)); - break; - case PROP_REPEAT_X: - if (priv->repeat_x != g_value_get_boolean (value)) - { - priv->repeat_x = !priv->repeat_x; - clutter_actor_queue_redraw (CLUTTER_ACTOR (ctexture)); - } - break; - case PROP_REPEAT_Y: - if (priv->repeat_y != g_value_get_boolean (value)) - { - priv->repeat_y = !priv->repeat_y; - clutter_actor_queue_redraw (CLUTTER_ACTOR (ctexture)); - } - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -clutter_clone_texture_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ClutterCloneTexture *ctexture = CLUTTER_CLONE_TEXTURE (object); - ClutterCloneTexturePrivate *priv; - - priv = ctexture->priv; - - switch (prop_id) - { - case PROP_PARENT_TEXTURE: - g_value_set_object (value, ctexture->priv->parent_texture); - break; - case PROP_REPEAT_X: - g_value_set_boolean (value, priv->repeat_x); - break; - case PROP_REPEAT_Y: - g_value_set_boolean (value, priv->repeat_y); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -clutter_clone_texture_class_init (ClutterCloneTextureClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); - - actor_class->paint = - clutter_clone_texture_paint; - actor_class->get_preferred_width = - clutter_clone_texture_get_preferred_width; - actor_class->get_preferred_height = - clutter_clone_texture_get_preferred_height; - - gobject_class->finalize = clutter_clone_texture_finalize; - gobject_class->dispose = clutter_clone_texture_dispose; - gobject_class->set_property = clutter_clone_texture_set_property; - gobject_class->get_property = clutter_clone_texture_get_property; - - g_object_class_install_property - (gobject_class, PROP_PARENT_TEXTURE, - g_param_spec_object ("parent-texture", - "Parent Texture", - "The parent texture to clone", - CLUTTER_TYPE_TEXTURE, - CLUTTER_PARAM_READWRITE)); - - g_object_class_install_property - (gobject_class, PROP_REPEAT_X, - g_param_spec_boolean ("repeat-x", - "Tile underlying pixbuf in x direction", - "Reapeat underlying pixbuf rather than scale " - "in x direction.", - FALSE, - CLUTTER_PARAM_READWRITE)); - - g_object_class_install_property - (gobject_class, PROP_REPEAT_Y, - g_param_spec_boolean ("repeat-y", - "Tile underlying pixbuf in y direction", - "Reapeat underlying pixbuf rather than scale " - "in y direction.", - FALSE, - CLUTTER_PARAM_READWRITE)); - - g_type_class_add_private (gobject_class, sizeof (ClutterCloneTexturePrivate)); -} - -static void -clutter_clone_texture_init (ClutterCloneTexture *self) -{ - ClutterCloneTexturePrivate *priv; - - self->priv = priv = CLUTTER_CLONE_TEXTURE_GET_PRIVATE (self); - priv->parent_texture = NULL; -} - -/** - * clutter_clone_texture_new: - * @texture: a #ClutterTexture, or %NULL - * - * Creates an efficient 'clone' of a pre-existing texture with which it - * shares the underlying pixbuf data. - * - * You can use clutter_clone_texture_set_parent_texture() to change the - * cloned texture. - * - * Return value: the newly created #ClutterCloneTexture - */ -ClutterActor * -clutter_clone_texture_new (ClutterTexture *texture) -{ - g_return_val_if_fail (texture == NULL || CLUTTER_IS_TEXTURE (texture), NULL); - - return g_object_new (CLUTTER_TYPE_CLONE_TEXTURE, - "parent-texture", texture, - NULL); -} - -/** - * clutter_clone_texture_get_parent_texture: - * @clone: a #ClutterCloneTexture - * - * Retrieves the parent #ClutterTexture used by @clone. - * - * Return value: a #ClutterTexture actor, or %NULL - * - * Since: 0.2 - */ -ClutterTexture * -clutter_clone_texture_get_parent_texture (ClutterCloneTexture *clone) -{ - g_return_val_if_fail (CLUTTER_IS_CLONE_TEXTURE (clone), NULL); - - return clone->priv->parent_texture; -} - -/** - * clutter_clone_texture_set_parent_texture: - * @clone: a #ClutterCloneTexture - * @texture: a #ClutterTexture or %NULL - * - * Sets the parent texture cloned by the #ClutterCloneTexture. - * - * Since: 0.2 - */ -void -clutter_clone_texture_set_parent_texture (ClutterCloneTexture *clone, - ClutterTexture *texture) -{ - g_return_if_fail (CLUTTER_IS_CLONE_TEXTURE (clone)); - g_return_if_fail (texture == NULL || CLUTTER_IS_TEXTURE (texture)); - - g_object_ref (clone); - - set_parent_texture (clone, texture); - - g_object_notify (G_OBJECT (clone), "parent-texture"); - g_object_unref (clone); -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-clone-texture.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-clone-texture.h --- clutter-0.8.4/clutter/clutter-clone-texture.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-clone-texture.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,88 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef _HAVE_CLUTTER_CLONE_TEXTURE_H -#define _HAVE_CLUTTER_CLONE_TEXTURE_H - -#include -#include - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_CLONE_TEXTURE (clutter_clone_texture_get_type ()) - -#define CLUTTER_CLONE_TEXTURE(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - CLUTTER_TYPE_CLONE_TEXTURE, ClutterCloneTexture)) - -#define CLUTTER_CLONE_TEXTURE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - CLUTTER_TYPE_CLONE_TEXTURE, ClutterCloneTextureClass)) - -#define CLUTTER_IS_CLONE_TEXTURE(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - CLUTTER_TYPE_CLONE_TEXTURE)) - -#define CLUTTER_IS_CLONE_TEXTURE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - CLUTTER_TYPE_CLONE_TEXTURE)) - -#define CLUTTER_CLONE_TEXTURE_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - CLUTTER_TYPE_CLONE_TEXTURE, ClutterCloneTextureClass)) - -typedef struct _ClutterCloneTexture ClutterCloneTexture; -typedef struct _ClutterCloneTexturePrivate ClutterCloneTexturePrivate; -typedef struct _ClutterCloneTextureClass ClutterCloneTextureClass; - -struct _ClutterCloneTexture -{ - ClutterActor parent; - - /*< priv >*/ - ClutterCloneTexturePrivate *priv; -}; - -struct _ClutterCloneTextureClass -{ - ClutterActorClass parent_class; - - /* padding for future expansion */ - void (*_clutter_clone_1) (void); - void (*_clutter_clone_2) (void); - void (*_clutter_clone_3) (void); - void (*_clutter_clone_4) (void); -}; - -GType clutter_clone_texture_get_type (void) G_GNUC_CONST; - -ClutterActor * clutter_clone_texture_new (ClutterTexture *texture); -ClutterTexture *clutter_clone_texture_get_parent_texture (ClutterCloneTexture *clone); -void clutter_clone_texture_set_parent_texture (ClutterCloneTexture *clone, - ClutterTexture *texture); - -G_END_DECLS - -#endif diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-color.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-color.c --- clutter-0.8.4/clutter/clutter-color.c 2008-11-13 14:44:32.000000000 +0000 +++ clutter-0.9.0/clutter/clutter-color.c 2009-01-28 08:12:44.000000000 +0000 @@ -154,9 +154,9 @@ g_return_if_fail (src != NULL); - red = CLUTTER_INT_TO_FIXED (src->red) / 255; - green = CLUTTER_INT_TO_FIXED (src->green) / 255; - blue = CLUTTER_INT_TO_FIXED (src->blue) / 255; + red = (float)(src->red) / 255; + green = (float)(src->green) / 255; + blue = (float)(src->blue) / 255; if (red > green) { @@ -189,22 +189,31 @@ if (max != min) { - if (l <= CFX_ONE/2) - s = CFX_DIV ((max - min), (max + min)); + if (l <= 0.5) + s = CLUTTER_FIXED_DIV ((max - min), (max + min)); else - s = CFX_DIV ((max - min), (CLUTTER_INT_TO_FIXED (2) - max - min)); + s = CLUTTER_FIXED_DIV ((max - min), + ((float)(2) - max - min)); delta = max - min; + if (red == max) - h = CFX_DIV ((green - blue), delta); + h = CLUTTER_FIXED_DIV ((green - blue), delta); else if (green == max) - h = CLUTTER_INT_TO_FIXED (2) + CFX_DIV ((blue - red), delta); + { + h = (float)(2) + + CLUTTER_FIXED_DIV ((blue - red), delta); + } else if (blue == max) - h = CLUTTER_INT_TO_FIXED (4) + CFX_DIV ((red - green), delta); + { + h = (float)(4) + + CLUTTER_FIXED_DIV ((red - green), delta); + } h *= 60; + if (h < 0) - h += CLUTTER_INT_TO_FIXED (360); + h += 360.0; } if (hue) @@ -242,66 +251,102 @@ l = luminance; s = saturation; - if (l <= CFX_ONE/2) - m2 = CFX_MUL (l, (CFX_ONE + s)); + if (l <= 0.5) + m2 = CLUTTER_FIXED_MUL (l, (1.0 + s)); else - m2 = l + s - CFX_MUL (l,s); + m2 = l + s - CLUTTER_FIXED_MUL (l, s); m1 = 2 * l - m2; if (s == 0) { - dest->red = (guint8) CFX_INT (l * 255); - dest->green = (guint8) CFX_INT (l * 255); - dest->blue = (guint8) CFX_INT (l * 255); + dest->red = (guint8) (l * 255); + dest->green = (guint8) (l * 255); + dest->blue = (guint8) (l * 255); } else { - h = hue + CFX_120; - while (h > CFX_360) - h -= CFX_360; + h = hue + 120.0; + + while (h > 360.0) + h -= 360.0; + while (h < 0) - h += CFX_360; + h += 360.0; - if (h < CFX_60) - dest->red = (guint8) CFX_INT((m1 + CFX_MUL((m2-m1), h) / 60) * 255); - else if (h < CFX_180) - dest->red = (guint8) CFX_INT (m2 * 255); - else if (h < CFX_240) - dest->red = (guint8)CFX_INT((m1+CFX_MUL((m2-m1),(CFX_240-h))/60)*255); + if (h < 60.0) + { + float tmp; + + tmp = (m1 + CLUTTER_FIXED_MUL ((m2 - m1), h) / 60); + dest->red = (guint8) (tmp * 255); + } + else if (h < 180.0) + dest->red = (guint8) (m2 * 255); + else if (h < 240.0) + { + float tmp; + + tmp = (m1 + CLUTTER_FIXED_MUL ((m2 - m1), (240.0 - h))) + / 60; + dest->red = (guint8) (tmp * 255); + } else - dest->red = (guint8) CFX_INT (m1 * 255); + dest->red = (guint8) (m1 * 255); h = hue; - while (h > CFX_360) - h -= CFX_360; + while (h > 360.0) + h -= 360.0; while (h < 0) - h += CFX_360; + h += 360.0; - if (h < CFX_60) - dest->green = (guint8)CFX_INT((m1 + CFX_MUL((m2 - m1), h) / 60) * 255); - else if (h < CFX_180) - dest->green = (guint8) CFX_INT (m2 * 255); - else if (h < CFX_240) - dest->green = - (guint8) CFX_INT((m1 + CFX_MUL ((m2-m1), (CFX_240-h)) / 60) * 255); + if (h < 60.0) + { + float tmp; + + tmp = (m1 + CLUTTER_FIXED_MUL ((m2 - m1), h) / 60); + dest->green = (guint8) (tmp * 255); + } + else if (h < 180.0) + dest->green = (guint8) (m2 * 255); + else if (h < 240.0) + { + float tmp; + + tmp = (m1 + CLUTTER_FIXED_MUL ((m2 - m1) , (240.0 - h))) + / 60; + dest->green = (guint8) (tmp * 255); + } else - dest->green = (guint8) CFX_INT (m1 * 255); + dest->green = (guint8) (m1 * 255); + + h = hue - 120.0; + + while (h > 360.0) + h -= 360.0; - h = hue - CFX_120; - while (h > CFX_360) - h -= CFX_360; while (h < 0) - h += CFX_360; + h += 360.0; - if (h < CFX_60) - dest->blue = (guint8) CFX_INT ((m1 + CFX_MUL ((m2-m1), h) / 60) * 255); - else if (h < CFX_180) - dest->blue = (guint8) CFX_INT (m2 * 255); - else if (h < CFX_240) - dest->blue = (guint8)CFX_INT((m1+CFX_MUL((m2-m1),(CFX_240-h))/60)*255); + if (h < 60.0) + { + float tmp; + + tmp = (m1 + CLUTTER_FIXED_MUL ((m2 - m1), h) / 60); + dest->blue = (guint8) (tmp * 255); + } + else if (h < 180.0) + dest->blue = (guint8) (m2 * 255); + else if (h < 240.0) + { + float tmp; + + tmp = (m1 + CLUTTER_FIXED_MUL ((m2 - m1), (240.0 - h))) + / 60; + dest->blue = (guint8) (tmp * 255); + } else - dest->blue = (guint8) CFX_INT(m1 * 255); + dest->blue = (guint8) (m1 * 255); } } @@ -326,13 +371,13 @@ clutter_color_to_hlsx (src, &h, &l, &s); if (hue) - *hue = (guint8) CFX_INT (h * 255) / 360; + *hue = (guint8) (h * 255) / 360; if (luminance) - *luminance = (guint8) CFX_INT (l * 255); + *luminance = (guint8) (l * 255); if (saturation) - *saturation = (guint8) CFX_INT (s * 255); + *saturation = (guint8) (s * 255); } /** @@ -354,9 +399,9 @@ { ClutterFixed h, l, s; - h = CLUTTER_INT_TO_FIXED (hue * 360) / 255; - l = CLUTTER_INT_TO_FIXED (luminance) / 255; - s = CLUTTER_INT_TO_FIXED (saturation) / 255; + h = (float)(hue * 360) / 255; + l = (float)(luminance) / 255; + s = (float)(saturation) / 255; clutter_color_from_hlsx (dest, h, l, s); } @@ -403,15 +448,15 @@ clutter_color_to_hlsx (src, &h, &l, &s); - l = CFX_MUL (l, shade); - if (l > CFX_ONE) - l = CFX_ONE; + l = CLUTTER_FIXED_MUL (l, shade); + if (l > 1.0) + l = 1.0; else if (l < 0) l = 0; - s = CFX_MUL (s, shade); - if (s > CFX_ONE) - s = CFX_ONE; + s = CLUTTER_FIXED_MUL (s, shade); + if (s > 1.0) + s = 1.0; else if (s < 0) s = 0; @@ -450,10 +495,10 @@ { g_return_if_fail (dest != NULL); - dest->red = pixel >> 24; + dest->red = pixel >> 24; dest->green = (pixel >> 16) & 0xff; - dest->blue = (pixel >> 8) & 0xff; - dest->alpha = pixel & 0xff; + dest->blue = (pixel >> 8) & 0xff; + dest->alpha = pixel & 0xff; } /** @@ -483,6 +528,9 @@ { PangoColor pango_color; + g_return_val_if_fail (color != NULL, FALSE); + g_return_val_if_fail (dest != NULL, FALSE); + /* parse ourselves to get alpha */ if (color[0] == '#') { @@ -492,9 +540,9 @@ { if (strlen (color) == 9) { - dest->red = result >> 24 & 0xff; + dest->red = (result >> 24) & 0xff; dest->green = (result >> 16) & 0xff; - dest->blue = (result >> 8) & 0xff; + dest->blue = (result >> 8) & 0xff; dest->alpha = result & 0xff; return TRUE; @@ -502,7 +550,7 @@ else if (strlen (color) == 7) { dest->red = (result >> 16) & 0xff; - dest->green = (result >> 8) & 0xff; + dest->green = (result >> 8) & 0xff; dest->blue = result & 0xff; dest->alpha = 0xff; @@ -641,10 +689,10 @@ color = g_slice_new (ClutterColor); - color->red = CLAMP (red, 0, 255); - color->green = CLAMP (green, 0, 255); - color->blue = CLAMP (blue, 0, 255); - color->alpha = CLAMP (alpha, 0, 255); + color->red = red; + color->green = green; + color->blue = blue; + color->alpha = alpha; return color; } @@ -776,8 +824,8 @@ * Since: 0.8.4 */ void -clutter_value_set_color (GValue *value, - ClutterColor *color) +clutter_value_set_color (GValue *value, + const ClutterColor *color) { g_return_if_fail (CLUTTER_VALUE_HOLDS_COLOR (value)); @@ -794,7 +842,7 @@ * * Since: 0.8.4 */ -const ClutterColor * +G_CONST_RETURN ClutterColor * clutter_value_get_color (const GValue *value) { g_return_val_if_fail (CLUTTER_VALUE_HOLDS_COLOR (value), NULL); diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-color.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-color.h --- clutter-0.8.4/clutter/clutter-color.h 2008-11-13 14:44:32.000000000 +0000 +++ clutter-0.9.0/clutter/clutter-color.h 2009-01-28 08:12:44.000000000 +0000 @@ -18,13 +18,15 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ -#ifndef _HAVE_CLUTTER_COLOR_H -#define _HAVE_CLUTTER_COLOR_H +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_COLOR_H__ +#define __CLUTTER_COLOR_H__ #include #include @@ -53,6 +55,10 @@ guint8 alpha; }; +ClutterColor *clutter_color_new (guint8 red, + guint8 green, + guint8 blue, + guint8 alpha); ClutterColor *clutter_color_copy (const ClutterColor *color); void clutter_color_free (ClutterColor *color); gboolean clutter_color_parse (const gchar *color, @@ -103,13 +109,9 @@ void clutter_color_from_pixel (ClutterColor *dest, guint32 pixel); - - - #define CLUTTER_TYPE_PARAM_COLOR (clutter_param_color_get_type ()) #define CLUTTER_PARAM_SPEC_COLOR(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), CLUTTER_TYPE_PARAM_COLOR, ClutterParamSpecColor)) #define CLUTTER_IS_PARAM_SPEC_COLOR(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), CLUTTER_TYPE_PARAM_COLOR)) -#define CLUTTER_VALUE_HOLDS_COLOR(x) (G_VALUE_HOLDS ((x), CLUTTER_TYPE_COLOR)) /** * CLUTTER_VALUE_HOLDS_COLOR: @@ -119,12 +121,18 @@ * * Since: 1.0 */ +#define CLUTTER_VALUE_HOLDS_COLOR(x) (G_VALUE_HOLDS ((x), CLUTTER_TYPE_COLOR)) typedef struct _ClutterParamSpecColor ClutterParamSpecColor; /** * ClutterParamSpecColor: * @default_value: default color value + * + * A #GParamSpec subclass for defining properties holding + * a #ClutterColor. + * + * Since: 1.0 */ struct _ClutterParamSpecColor { @@ -135,17 +143,16 @@ ClutterColor *default_value; }; -GType clutter_param_color_get_type (void) G_GNUC_CONST; - -void clutter_value_set_color (GValue *value, - ClutterColor *color); -const ClutterColor *clutter_value_get_color (const GValue *value); - -GParamSpec *clutter_param_spec_color (const gchar *name, - const gchar *nick, - const gchar *blurb, - const ClutterColor *default_value, - GParamFlags flags); +void clutter_value_set_color (GValue *value, + const ClutterColor *color); +G_CONST_RETURN ClutterColor *clutter_value_get_color (const GValue *value); + +GType clutter_param_color_get_type (void) G_GNUC_CONST; +GParamSpec *clutter_param_spec_color (const gchar *name, + const gchar *nick, + const gchar *blurb, + const ClutterColor *default_value, + GParamFlags flags); G_END_DECLS diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-container.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-container.c --- clutter-0.8.4/clutter/clutter-container.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-container.c 2009-01-28 08:12:44.000000000 +0000 @@ -43,6 +43,23 @@ #include "clutter-private.h" #include "clutter-enum-types.h" +#define CLUTTER_CONTAINER_WARN_NOT_IMPLEMENTED(container,vfunc) \ + G_STMT_START { \ + g_warning ("Container of type `%s' does not implement " \ + "the required ClutterContainer::%s virtual " \ + "function.", \ + G_OBJECT_TYPE_NAME ((container)), \ + (vfunc)); \ + } G_STMT_END + +#define CLUTTER_CONTAINER_NOTE_NOT_IMPLEMENTED(container,vfunc) \ + G_STMT_START { \ + CLUTTER_NOTE (ACTOR, "Container of type `%s' does not " \ + "implement the ClutterContainer::%s " \ + "virtual function.", \ + G_OBJECT_TYPE_NAME ((container)), \ + (vfunc)); \ + } G_STMT_END /** * SECTION:clutter-container @@ -69,24 +86,17 @@ static guint container_signals[LAST_SIGNAL] = { 0, }; static GQuark quark_child_meta = 0; -static ClutterChildMeta * -get_child_meta (ClutterContainer *container, - ClutterActor *actor); - -static void -create_child_meta (ClutterContainer *container, - ClutterActor *actor); - -static void -destroy_child_meta (ClutterContainer *container, - ClutterActor *actor); - -static void -clutter_container_create_child_meta (ClutterContainer *container, - ClutterActor *actor); -static void -clutter_container_destroy_child_meta (ClutterContainer *container, - ClutterActor *actor); +static ClutterChildMeta *get_child_meta (ClutterContainer *container, + ClutterActor *actor); +static void create_child_meta (ClutterContainer *container, + ClutterActor *actor); +static void destroy_child_meta (ClutterContainer *container, + ClutterActor *actor); + +static void clutter_container_create_child_meta (ClutterContainer *container, + ClutterActor *actor); +static void clutter_container_destroy_child_meta (ClutterContainer *container, + ClutterActor *actor); static void @@ -178,7 +188,7 @@ if (G_UNLIKELY (!container_type)) { - GTypeInfo container_info = + const GTypeInfo container_info = { sizeof (ClutterContainerIface), clutter_container_base_init, @@ -239,17 +249,25 @@ clutter_container_add_actor (ClutterContainer *container, ClutterActor *actor) { + ClutterContainerIface *iface; ClutterActor *parent; g_return_if_fail (CLUTTER_IS_CONTAINER (container)); g_return_if_fail (CLUTTER_IS_ACTOR (actor)); + iface = CLUTTER_CONTAINER_GET_IFACE (container); + if (!iface->add) + { + CLUTTER_CONTAINER_WARN_NOT_IMPLEMENTED (container, "add"); + return; + } + parent = clutter_actor_get_parent (actor); if (parent) { g_warning ("Attempting to add actor of type `%s' to a " - "group of type `%s', but the actor has already " - "a parent of type `%s'.", + "container of type `%s', but the actor has " + "already a parent of type `%s'.", g_type_name (G_OBJECT_TYPE (actor)), g_type_name (G_OBJECT_TYPE (container)), g_type_name (G_OBJECT_TYPE (parent))); @@ -257,7 +275,8 @@ } clutter_container_create_child_meta (container, actor); - CLUTTER_CONTAINER_GET_IFACE (container)->add (container, actor); + + iface->add (container, actor); } /** @@ -333,24 +352,33 @@ clutter_container_remove_actor (ClutterContainer *container, ClutterActor *actor) { + ClutterContainerIface *iface; ClutterActor *parent; g_return_if_fail (CLUTTER_IS_CONTAINER (container)); g_return_if_fail (CLUTTER_IS_ACTOR (actor)); + iface = CLUTTER_CONTAINER_GET_IFACE (container); + if (!iface->remove) + { + CLUTTER_CONTAINER_WARN_NOT_IMPLEMENTED (container, "remove"); + return; + } + parent = clutter_actor_get_parent (actor); if (parent != CLUTTER_ACTOR (container)) { g_warning ("Attempting to remove actor of type `%s' from " - "group of class `%s', but the group is not the " - "actor's parent.", + "group of class `%s', but the container is not " + "the actor's parent.", g_type_name (G_OBJECT_TYPE (actor)), g_type_name (G_OBJECT_TYPE (container))); return; } clutter_container_destroy_child_meta (container, actor); - CLUTTER_CONTAINER_GET_IFACE (container)->remove (container, actor); + + iface->remove (container, actor); } /** @@ -429,12 +457,19 @@ ClutterCallback callback, gpointer user_data) { + ClutterContainerIface *iface; + g_return_if_fail (CLUTTER_IS_CONTAINER (container)); g_return_if_fail (callback != NULL); - CLUTTER_CONTAINER_GET_IFACE (container)->foreach (container, - callback, - user_data); + iface = CLUTTER_CONTAINER_GET_IFACE (container); + if (!iface->foreach) + { + CLUTTER_CONTAINER_WARN_NOT_IMPLEMENTED (container, "foreach"); + return; + } + + iface->foreach (container, callback, user_data); } /** @@ -452,10 +487,19 @@ ClutterActor *actor, ClutterActor *sibling) { + ClutterContainerIface *iface; + g_return_if_fail (CLUTTER_IS_CONTAINER (container)); g_return_if_fail (CLUTTER_IS_ACTOR (actor)); g_return_if_fail (sibling == NULL || CLUTTER_IS_ACTOR (sibling)); + iface = CLUTTER_CONTAINER_GET_IFACE (container); + if (!iface->raise) + { + CLUTTER_CONTAINER_NOTE_NOT_IMPLEMENTED (container, "raise"); + return; + }; + if (actor == sibling) return; @@ -478,7 +522,7 @@ return; } - CLUTTER_CONTAINER_GET_IFACE (container)->raise (container, actor, sibling); + iface->raise (container, actor, sibling); } /** @@ -496,10 +540,19 @@ ClutterActor *actor, ClutterActor *sibling) { + ClutterContainerIface *iface; + g_return_if_fail (CLUTTER_IS_CONTAINER (container)); g_return_if_fail (CLUTTER_IS_ACTOR (actor)); g_return_if_fail (sibling == NULL || CLUTTER_IS_ACTOR (sibling)); + iface = CLUTTER_CONTAINER_GET_IFACE (container); + if (!iface->lower) + { + CLUTTER_CONTAINER_NOTE_NOT_IMPLEMENTED (container, "lower"); + return; + } + if (actor == sibling) return; @@ -522,7 +575,7 @@ return; } - CLUTTER_CONTAINER_GET_IFACE (container)->lower (container, actor, sibling); + iface->lower (container, actor, sibling); } /** @@ -537,9 +590,15 @@ void clutter_container_sort_depth_order (ClutterContainer *container) { + ClutterContainerIface *iface; + g_return_if_fail (CLUTTER_IS_CONTAINER (container)); - CLUTTER_CONTAINER_GET_IFACE (container)->sort_depth_order (container); + iface = CLUTTER_CONTAINER_GET_IFACE (container); + if (iface->sort_depth_order) + iface->sort_depth_order (container); + else + CLUTTER_CONTAINER_NOTE_NOT_IMPLEMENTED (container, "sort_depth_order"); } /** diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-container.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-container.h --- clutter-0.8.4/clutter/clutter-container.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-container.h 2009-01-28 08:12:44.000000000 +0000 @@ -18,14 +18,16 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . * * ClutterContainer: Generic actor container interface. * Author: Emmanuele Bassi */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __CLUTTER_CONTAINER_H__ #define __CLUTTER_CONTAINER_H__ @@ -44,9 +46,12 @@ /** * ClutterContainerIface: - * @add: virtual function for adding an actor to the container - * @remove: virtual function for removing an actor from the container - * @foreach: virtual function for iterating over the container's children + * @add: virtual function for adding an actor to the container. The + * implementation of this virtual function is required. + * @remove: virtual function for removing an actor from the container. The + * implementation of this virtual function is required. + * @foreach: virtual function for iterating over the container's children. + * The implementation of this virtual function is required. * @raise: virtual function for raising a child * @lower: virtual function for lowering a child * @sort_depth_order: virtual function for sorting the children of a @@ -65,7 +70,9 @@ * @actor_removed: class handler for #ClutterContainer::actor_removed * @child_notify: class handler for #ClutterContainer::child-notify * - * Base interface for container actors. + * Base interface for container actors. The @add, @remove and @foreach + * virtual functions must be provided by any implementation; the other + * virtual functions are optional. * * Since: 0.4 */ @@ -82,6 +89,8 @@ void (* foreach) (ClutterContainer *container, ClutterCallback callback, gpointer user_data); + + /* child stacking */ void (* raise) (ClutterContainer *container, ClutterActor *actor, ClutterActor *sibling); @@ -91,7 +100,6 @@ void (* sort_depth_order) (ClutterContainer *container); /* ClutterChildMeta management */ - GType child_meta_type; void (* create_child_meta) (ClutterContainer *container, ClutterActor *actor); diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-debug.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-debug.h --- clutter-0.8.4/clutter/clutter-debug.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-debug.h 2009-01-28 08:12:44.000000000 +0000 @@ -20,7 +20,8 @@ CLUTTER_DEBUG_SCHEDULER = 1 << 10, CLUTTER_DEBUG_SCRIPT = 1 << 11, CLUTTER_DEBUG_SHADER = 1 << 12, - CLUTTER_DEBUG_MULTISTAGE = 1 << 13 + CLUTTER_DEBUG_MULTISTAGE = 1 << 13, + CLUTTER_DEBUG_ANIMATION = 1 << 14 } ClutterDebugFlag; #ifdef CLUTTER_ENABLE_DEBUG diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-deprecated.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-deprecated.h --- clutter-0.8.4/clutter/clutter-deprecated.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-deprecated.h 2009-01-28 16:47:03.000000000 +0000 @@ -33,8 +33,7 @@ #define clutter_actor_get_rxangx clutter_actor_get_rxangx_DEPRECATED_BY_clutter_actor_get_rotationx #define clutter_actor_get_ryangx clutter_actor_get_ryangx_DEPRECATED_BY_clutter_actor_get_rotationx #define clutter_actor_get_rzangx clutter_actor_get_rzangx_DEPRECATED_BY_clutter_actor_get_rotationx -#define clutter_actor_set_scale_with_gravity clutter_actor_set_scale_with_gravity_DEPRECATED_BY_clutter_actor_set_anchor_point_from_gravity -#define clutter_actor_set_scale_with_gravityx clutter_actor_set_scale_with_gravity_DEPRECATED_BY_clutter_actor_set_anchor_point_from_gravity +#define clutter_actor_set_scale_with_gravityx clutter_actor_set_scale_with_gravityx_DEPRECATED_BY_clutter_actor_set_scale_with_gravity #define clutter_entry_set_position clutter_entry_set_position_REPLACED_BY_clutter_entry_set_cursor_position #define clutter_entry_get_position clutter_entry_get_position_REPLACED_BY_clutter_entry_get_cursor_position @@ -52,4 +51,10 @@ #define clutter_actor_get_abs_size clutter_actor_get_abs_size_REPLACED_BY_clutter_actor_get_transformed_size #define clutter_actor_get_abs_opacity clutter_actor_get_abs_opacity_REPLACED_BY_clutter_actor_get_paint_opacity +#define clutter_stage_get_resolution clutter_backend_get_resolution +#define clutter_stage_get_resolutionx clutter_backend_get_resolution + +#define clutter_set_use_mipmapped_text clutter_actor_set_use_mipmapped_text_REPLACED_BY_clutter_set_font_flags +#define clutter_get_use_mipmapped_text clutter_actor_get_use_mipmapped_text_REPLACED_BY_clutter_get_font_flags + #endif /* CLUTTER_DEPRECATED_H */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-effect.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-effect.c --- clutter-0.8.4/clutter/clutter-effect.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-effect.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,836 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * Jorn Baayen - * Emmanuele Bassi - * - * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/** - * SECTION:clutter-effect - * @short_description: Utility Class for basic visual effects - * - * The #ClutterEffectTemplate class provides a simple API for applying - * pre-defined effects to a single actor. It works as a wrapper around - * the #ClutterBehaviour objects - * - * Since: 0.4 - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include "clutter-alpha.h" -#include "clutter-main.h" -#include "clutter-marshal.h" -#include "clutter-private.h" -#include "clutter-debug.h" -#include "clutter-behaviour-bspline.h" -#include "clutter-behaviour-depth.h" -#include "clutter-behaviour-ellipse.h" -#include "clutter-behaviour-opacity.h" -#include "clutter-behaviour-path.h" -#include "clutter-behaviour-rotate.h" -#include "clutter-behaviour-scale.h" - -#include "clutter-effect.h" - -typedef struct ClutterEffectClosure -{ - ClutterActor *actor; - ClutterTimeline *timeline; - ClutterAlpha *alpha; - ClutterBehaviour *behave; - - gulong signal_id; - - ClutterEffectCompleteFunc completed_func; - gpointer completed_data; - ClutterEffectTemplate *template; -} -ClutterEffectClosure; - -G_DEFINE_TYPE (ClutterEffectTemplate, clutter_effect_template, G_TYPE_OBJECT); - -#define EFFECT_TEMPLATE_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ - CLUTTER_TYPE_EFFECT_TEMPLATE, \ - ClutterEffectTemplatePrivate)) - -struct _ClutterEffectTemplatePrivate -{ - ClutterTimeline *timeline; - - guint do_clone : 1; - guint dirty : 1; - - ClutterAlphaFunc alpha_func; - gpointer alpha_data; - GDestroyNotify alpha_notify; -}; - -enum -{ - PROP_0, - - PROP_TIMELINE, - PROP_DO_CLONE -}; - -static void -clutter_effect_template_finalize (GObject *gobject) -{ - ClutterEffectTemplate *template = CLUTTER_EFFECT_TEMPLATE (gobject); - ClutterEffectTemplatePrivate *priv = template->priv; - - if (priv->alpha_notify) - { - priv->alpha_notify (priv->alpha_data); - priv->alpha_notify = NULL; - } - - priv->alpha_data = NULL; - priv->alpha_func = NULL; - - G_OBJECT_CLASS (clutter_effect_template_parent_class)->finalize (gobject); -} - -static void -clutter_effect_template_dispose (GObject *object) -{ - ClutterEffectTemplate *template; - ClutterEffectTemplatePrivate *priv; - - template = CLUTTER_EFFECT_TEMPLATE (object); - priv = template->priv; - - if (priv->timeline) - { - g_object_unref (priv->timeline); - priv->timeline = NULL; - } - - G_OBJECT_CLASS (clutter_effect_template_parent_class)->dispose (object); -} - -static void -clutter_effect_template_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ClutterEffectTemplate *template; - ClutterEffectTemplatePrivate *priv; - - template = CLUTTER_EFFECT_TEMPLATE (object); - priv = template->priv; - - switch (prop_id) - { - case PROP_TIMELINE: - priv->timeline = g_value_dup_object (value); - break; - case PROP_DO_CLONE: - clutter_effect_template_set_timeline_clone (template, - g_value_get_boolean (value)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -clutter_effect_template_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ClutterEffectTemplate *template; - ClutterEffectTemplatePrivate *priv; - - template = CLUTTER_EFFECT_TEMPLATE (object); - priv = template->priv; - - switch (prop_id) - { - case PROP_TIMELINE: - g_value_set_object (value, priv->timeline); - break; - case PROP_DO_CLONE: - g_value_set_boolean (value, priv->do_clone); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -clutter_effect_template_class_init (ClutterEffectTemplateClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - g_type_class_add_private (klass, sizeof (ClutterEffectTemplatePrivate)); - - object_class->finalize = clutter_effect_template_finalize; - object_class->dispose = clutter_effect_template_dispose; - object_class->set_property = clutter_effect_template_set_property; - object_class->get_property = clutter_effect_template_get_property; - - /** - * ClutterEffectTemplate:timeline: - * - * #ClutterTimeline to be used by the template - * - * Since: 0.4 - */ - g_object_class_install_property - (object_class, - PROP_TIMELINE, - g_param_spec_object ("timeline", - "Timeline", - "Timeline to use as a reference for the Template", - CLUTTER_TYPE_TIMELINE, - G_PARAM_CONSTRUCT_ONLY | - CLUTTER_PARAM_READWRITE)); - - /** - * ClutterEffectTemplate:clone: - * - * Controls if effects should clone or reference the templated timeline - * - * Since: 0.6 - */ - g_object_class_install_property - (object_class, - PROP_DO_CLONE, - g_param_spec_boolean ("clone", - "Clone", - "controls if effects should clone or reference the templated timeline", - TRUE, - CLUTTER_PARAM_READWRITE)); - -} - -static void -clutter_effect_template_init (ClutterEffectTemplate *self) -{ - self->priv = EFFECT_TEMPLATE_PRIVATE (self); - - self->priv->do_clone = TRUE; - self->priv->dirty = TRUE; -} - -static void -clutter_effect_template_set_alpha_func (ClutterEffectTemplate *self, - ClutterAlphaFunc alpha_func, - gpointer alpha_data, - GDestroyNotify alpha_notify) -{ - ClutterEffectTemplatePrivate *priv; - - priv = self->priv; - - if (priv->alpha_notify) - { - priv->alpha_notify (priv->alpha_data); - priv->alpha_notify = NULL; - } - - priv->alpha_data = alpha_data; - priv->alpha_notify = alpha_notify; - priv->alpha_func = alpha_func; - - priv->dirty = FALSE; -} - -/** - * clutter_effect_template_set_timeline_clone: - * @template_: A #ClutterEffectTemplate - * @setting: A boolean indicating if effects should clone the timeline. - * - * Sets if effects using this template should make a copy of the - * templates timeline (default) or reference the effects timeline. - * - * Since: 0.6 - */ -void -clutter_effect_template_set_timeline_clone (ClutterEffectTemplate *template_, - gboolean setting) -{ - g_return_if_fail (CLUTTER_IS_EFFECT_TEMPLATE (template_)); - - if (template_->priv->do_clone != setting) - { - template_->priv->do_clone = setting; - - g_object_notify (G_OBJECT (template_), "clone"); - } -} - -/** - * clutter_effect_template_get_timeline_clone: - * @template_: A #ClutterEffectTemplate - * - * Gets whether timelines should be cloned when creating a new - * effect or just referenced. - * - * Return value: %TRUE if the templates timeline is to be cloned. - * - * Since: 0.6 - */ -gboolean -clutter_effect_template_get_timeline_clone (ClutterEffectTemplate *template_) -{ - g_return_val_if_fail (CLUTTER_IS_EFFECT_TEMPLATE (template_), FALSE); - - return template_->priv->do_clone; -} - - -/** - * clutter_effect_template_new: - * @timeline: A #ClutterTimeline for the template (will be cloned) - * @alpha_func: An alpha func to use for the template. - * - * Creates a new #ClutterEffectTemplate, to be used with the effects API. - * - * A #ClutterEffectTemplate binds a timeline and an alpha function and can - * be used as a template for multiple calls of clutter_effect_fade(), - * clutter_effect_move() and clutter_effect_scale(). - * - * This API is intended for simple animations involving a single actor; - * for more complex animations, you should see #ClutterBehaviour and the - * derived classes. - * - * Return value: a #ClutterEffectTemplate - * - * Since: 0.4 - */ -ClutterEffectTemplate* -clutter_effect_template_new (ClutterTimeline *timeline, - ClutterAlphaFunc alpha_func) -{ - ClutterEffectTemplate *retval; - - g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), NULL); - g_return_val_if_fail (alpha_func != NULL, NULL); - - retval = g_object_new (CLUTTER_TYPE_EFFECT_TEMPLATE, - "timeline", timeline, - NULL); - - clutter_effect_template_set_alpha_func (retval, alpha_func, NULL, NULL); - - return retval; -} - -/** - * clutter_effect_template_new_full: - * @timeline: a #ClutterTimeline - * @alpha_func: an alpha function to use for the template - * @user_data: data to be passed to the alpha function, or %NULL - * @notify: function to be called when disposing the alpha function's use - * data, or %NULL - * - * Creates a new #ClutterEffectTemplate, to be used with the effects API. - * - * A #ClutterEffectTemplate binds a timeline and an alpha function and can - * be used as a template for multiple calls of clutter_effect_fade(), - * clutter_effect_move() and clutter_effect_scale(). - * - * This API is intended for simple animations involving a single actor; - * for more complex animations, you should see #ClutterBehaviour and the - * derived classes. - * - * This function is intended for language bindings only: if @notify is - * not %NULL it will be called to dispose of @user_data. - * - * Return value: the newly created #ClutterEffectTemplate object - * - * Since: 0.4 - */ -ClutterEffectTemplate * -clutter_effect_template_new_full (ClutterTimeline *timeline, - ClutterAlphaFunc alpha_func, - gpointer user_data, - GDestroyNotify notify) -{ - ClutterEffectTemplate *retval; - - g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), NULL); - g_return_val_if_fail (alpha_func != NULL, NULL); - - retval = g_object_new (CLUTTER_TYPE_EFFECT_TEMPLATE, - "timeline", timeline, - NULL); - - clutter_effect_template_set_alpha_func (retval, - alpha_func, - user_data, notify); - - return retval; -} - -/** - * clutter_effect_template_new_for_duration: - * @msecs: the duration of the effects, in milliseconds - * @alpha_func: an alpha function to use for the template - * - * Creates a new #ClutterEffectTemplate, to be used with the effects API. - * - * A #ClutterEffectTemplate binds a timeline and an alpha function and can - * be used as a template for multiple calls of clutter_effect_fade(), - * clutter_effect_move() and clutter_effect_scale(). - * - * This API is intended for simple animations involving a single actor; - * for more complex animations, you should see #ClutterBehaviour and the - * derived classes. - * - * This function creates a #ClutterTimeline with a duration of @msecs - * milliseconds and transfers ownership of the timeline object to the - * returned #ClutterEffectTemplate. - * - * Return value: the newly created #ClutterEffectTemplate object - * - * Since: 0.6 - */ -ClutterEffectTemplate * -clutter_effect_template_new_for_duration (guint msecs, - ClutterAlphaFunc alpha_func) -{ - ClutterTimeline *timeline; - ClutterEffectTemplate *retval; - - g_return_val_if_fail (msecs > 0, NULL); - g_return_val_if_fail (alpha_func != NULL, NULL); - - timeline = clutter_timeline_new_for_duration (msecs); - retval = clutter_effect_template_new (timeline, alpha_func); - - /* the effect template takes ownership of the timeline */ - g_object_unref (timeline); - - return retval; -} - -/** - * clutter_effect_template_construct: - * @template_: a #ClutterEffectTemplate - * @timeline: a #ClutterTimeline - * @alpha_func: an alpha function to use for the template - * @user_data: data to be passed to the alpha function, or %NULL - * @notify: function to be called when disposing the alpha function's use - * data, or %NULL - * - * Constructs a #ClutterEffectTemplate, to be used with the effects API. - * - * This function can only be called once after the creation of @template_ - * and is only useful for language bindings. - * - * Since: 0.6 - */ -void -clutter_effect_template_construct (ClutterEffectTemplate *template_, - ClutterTimeline *timeline, - ClutterAlphaFunc alpha_func, - gpointer user_data, - GDestroyNotify notify) -{ - ClutterEffectTemplatePrivate *priv; - - g_return_if_fail (CLUTTER_IS_EFFECT_TEMPLATE (template_)); - g_return_if_fail (CLUTTER_IS_TIMELINE (timeline)); - g_return_if_fail (alpha_func != NULL); - - if (!template_->priv->dirty) - return; - - priv = template_->priv; - - if (priv->timeline) - g_object_unref (priv->timeline); - - priv->timeline = g_object_ref (timeline); - clutter_effect_template_set_alpha_func (template_, - alpha_func, - user_data, notify); -} - -static void -clutter_effect_closure_destroy (ClutterEffectClosure *c) -{ - g_signal_handler_disconnect (c->timeline, c->signal_id); - - g_object_unref (c->actor); - g_object_unref (c->template); - g_object_unref (c->behave); - g_object_unref (c->timeline); - - g_slice_free (ClutterEffectClosure, c); -} - -static ClutterEffectClosure * -clutter_effect_closure_new (ClutterEffectTemplate *template, - ClutterActor *actor, - GCallback complete) -{ - ClutterEffectClosure *c; - ClutterEffectTemplatePrivate *priv = EFFECT_TEMPLATE_PRIVATE(template); - - c = g_slice_new0(ClutterEffectClosure); - - g_object_ref (actor); - g_object_ref (template); - - c->template = template; - c->actor = actor; - - if (clutter_effect_template_get_timeline_clone (template)) - c->timeline = clutter_timeline_clone (priv->timeline); - else - { - c->timeline = priv->timeline; - g_object_ref (priv->timeline); - } - - c->alpha = clutter_alpha_new_full (c->timeline, - priv->alpha_func, - priv->alpha_data, - NULL); - - c->signal_id = - g_signal_connect (c->timeline, "completed", G_CALLBACK (complete), c); - - return c; -} - -static void -on_effect_complete (ClutterTimeline *timeline, - gpointer user_data) -{ - ClutterEffectClosure *c = (ClutterEffectClosure*)user_data; - - if (c->completed_func) - c->completed_func (c->actor, c->completed_data); - - clutter_effect_closure_destroy (c); -} - -/** - * clutter_effect_fade: - * @template_: A #ClutterEffectTemplate - * @actor: A #ClutterActor to apply the effect to. - * @opacity_end: Final opacity value to apply to actor - * @func: A #ClutterEffectCompleteFunc to call on effect - * completion or %NULL - * @data: Data to pass to supplied #ClutterEffectCompleteFunc - * or %NULL - * - * Simple effect for fading a single #ClutterActor. - * - * Return value: a #ClutterTimeline for the effect. Will be unrefed by - * the effect when completed. - * - * Since: 0.6 - */ -ClutterTimeline * -clutter_effect_fade (ClutterEffectTemplate *template_, - ClutterActor *actor, - guint8 opacity_end, - ClutterEffectCompleteFunc func, - gpointer data) -{ - ClutterEffectClosure *c; - guint8 opacity_start; - - c = clutter_effect_closure_new (template_, - actor, - G_CALLBACK (on_effect_complete)); - - c->completed_func = func; - c->completed_data = data; - - opacity_start = clutter_actor_get_opacity (actor); - - c->behave = clutter_behaviour_opacity_new (c->alpha, - opacity_start, - opacity_end); - - clutter_behaviour_apply (c->behave, actor); - clutter_timeline_start (c->timeline); - - return c->timeline; -} - -/** - * clutter_effect_depth: - * @template_: A #ClutterEffectTemplate - * @actor: A #ClutterActor to apply the effect to. - * @depth_end: Final depth value to apply to actor - * @func: A #ClutterEffectCompleteFunc to call on effect - * completion or %NULL - * @data: Data to pass to supplied #ClutterEffectCompleteFunc - * or %NULL - * - * Simple effect for changing the depth of a single #ClutterActor. - * - * Return value: a #ClutterTimeline for the effect. Will be unrefed by - * the effect when completed. - * - * Since: 0.6 - */ -ClutterTimeline * -clutter_effect_depth (ClutterEffectTemplate *template_, - ClutterActor *actor, - gint depth_end, - ClutterEffectCompleteFunc func, - gpointer data) -{ - ClutterEffectClosure *c; - gint depth_start; - - c = clutter_effect_closure_new (template_, - actor, - G_CALLBACK (on_effect_complete)); - - c->completed_func = func; - c->completed_data = data; - - depth_start = clutter_actor_get_depth (actor); - - c->behave = clutter_behaviour_depth_new (c->alpha, depth_start, depth_end); - - clutter_behaviour_apply (c->behave, actor); - clutter_timeline_start (c->timeline); - - return c->timeline; -} - -/** - * clutter_effect_move: - * @template_: A #ClutterEffectTemplate - * @actor: A #ClutterActor to apply the effect to. - * @x: X coordinate of the destination - * @y: Y coordinate of the destination - * @func: A #ClutterEffectCompleteFunc to call on effect - * completion or %NULL - * @data: Data to pass to supplied #ClutterEffectCompleteFunc - * or %NULL - * - * Simple effect for moving a single #ClutterActor along to a - * destination point. - * - * Return value: a #ClutterTimeline for the effect. Will be unreferenced by - * the effect when completed. - * - * Since: 0.6 - */ -ClutterTimeline * -clutter_effect_move (ClutterEffectTemplate *template_, - ClutterActor *actor, - gint x, - gint y, - ClutterEffectCompleteFunc func, - gpointer data) -{ - ClutterEffectClosure *c; - ClutterKnot knots[2]; - - c = clutter_effect_closure_new (template_, - actor, - G_CALLBACK (on_effect_complete)); - - c->completed_func = func; - c->completed_data = data; - - knots[0].x = clutter_actor_get_x (actor); - knots[0].y = clutter_actor_get_y (actor); - - knots[1].x = x; - knots[1].y = y; - - c->behave = clutter_behaviour_path_new (c->alpha, knots, 2); - - clutter_behaviour_apply (c->behave, actor); - clutter_timeline_start (c->timeline); - - return c->timeline; -} -/** - * clutter_effect_path: - * @template_: A #ClutterEffectTemplate - * @actor: A #ClutterActor to apply the effect to. - * @knots: An array of #ClutterKnots representing path for the actor - * @n_knots: Number of #ClutterKnots in passed array. - * @func: A #ClutterEffectCompleteFunc to call on effect - * completion or %NULL - * @data: Data to pass to supplied #ClutterEffectCompleteFunc - * or %NULL - * - * Simple effect for moving a single #ClutterActor along a path. - * - * Return value: a #ClutterTimeline for the effect. Will be unreferenced by - * the effect when completed. - * - * Since: 0.6 - */ -ClutterTimeline * -clutter_effect_path (ClutterEffectTemplate *template_, - ClutterActor *actor, - const ClutterKnot *knots, - guint n_knots, - ClutterEffectCompleteFunc func, - gpointer data) -{ - ClutterEffectClosure *c; - - c = clutter_effect_closure_new (template_, - actor, - G_CALLBACK (on_effect_complete)); - - c->completed_func = func; - c->completed_data = data; - - if (n_knots) - clutter_actor_set_position (actor, knots[0].x, knots[0].y); - - c->behave = clutter_behaviour_path_new (c->alpha, knots, n_knots); - - clutter_behaviour_apply (c->behave, actor); - clutter_timeline_start (c->timeline); - - return c->timeline; -} - -/** - * clutter_effect_scale: - * @template_: A #ClutterEffectTemplate - * @actor: A #ClutterActor to apply the effect to. - * @x_scale_end: Final X axis scale factor to apply to actor - * @y_scale_end: Final Y axis scale factor to apply to actor - * @func: A #ClutterEffectCompleteFunc to call on effect - * completion or NULL - * @data: Data to pass to supplied #ClutterEffectCompleteFunc - * or NULL - * - * Simple effect for scaling a single #ClutterActor. - * - * Return value: a #ClutterTimeline for the effect. Will be unreferenced by - * the effect when completed. - * - * Since: 0.6 - */ -ClutterTimeline * -clutter_effect_scale (ClutterEffectTemplate *template_, - ClutterActor *actor, - gdouble x_scale_end, - gdouble y_scale_end, - ClutterEffectCompleteFunc func, - gpointer data) -{ - ClutterEffectClosure *c; - gdouble x_scale_start, y_scale_start; - - c = clutter_effect_closure_new (template_, - actor, - G_CALLBACK (on_effect_complete)); - - c->completed_func = func; - c->completed_data = data; - - clutter_actor_get_scale (actor, &x_scale_start, &y_scale_start); - c->behave = clutter_behaviour_scale_new (c->alpha, - x_scale_start, y_scale_start, - x_scale_end, y_scale_end); - - clutter_behaviour_apply (c->behave, actor); - clutter_timeline_start (c->timeline); - - return c->timeline; -} - -/** - * clutter_effect_rotate: - * @template_: a #ClutterEffectTemplate - * @actor: a #ClutterActor to apply the effect to. - * @axis: axis of rotation - * @angle: final angle to apply to actor - * @center_x: position on X axis to rotate about. - * @center_y: position on Y axis to rotate about. - * @center_z: position on Z axis to rotate about. - * @direction: a #ClutterRotateDirection for the rotation. - * @func: a #ClutterEffectCompleteFunc to call on effect - * completion or %NULL - * @data: user data to pass to supplied @func or %NULL - * - * Simple effect for rotating a single #ClutterActor. - * - * Return value: a #ClutterTimeline for the effect. Will be unreferenced by - * the effect when completed. - * - * Since: 0.6 - */ -ClutterTimeline * -clutter_effect_rotate (ClutterEffectTemplate *template_, - ClutterActor *actor, - ClutterRotateAxis axis, - gdouble angle_end, - gint center_x, - gint center_y, - gint center_z, - ClutterRotateDirection direction, - ClutterEffectCompleteFunc func, - gpointer data) -{ - ClutterEffectClosure *c; - gdouble angle_start; - - c = clutter_effect_closure_new (template_, - actor, - G_CALLBACK (on_effect_complete)); - - c->completed_func = func; - c->completed_data = data; - - angle_start = clutter_actor_get_rotation (actor, axis, NULL, NULL, NULL); - - c->behave = clutter_behaviour_rotate_new (c->alpha, - axis, - direction, - angle_start, - angle_end); - g_object_set (c->behave, - "center-x", center_x, - "center-y", center_y, - "center-z", center_z, - NULL); - - clutter_behaviour_apply (c->behave, actor); - clutter_timeline_start (c->timeline); - - return c->timeline; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-effect.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-effect.h --- clutter-0.8.4/clutter/clutter-effect.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-effect.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,160 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * Copyright (C) 2006, 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef _CLUTTER_EFFECT -#define _CLUTTER_EFFECT - -#include -#include -#include -#include -#include - -G_BEGIN_DECLS - -/** - * ClutterEffectCompleteFunc: - * @actor: a #ClutterActor - * @user_data: user data - * - * Callback function invoked when an effect is complete. - * - * Since: 0.4 - */ -typedef void (*ClutterEffectCompleteFunc) (ClutterActor *actor, - gpointer user_data); - -#define CLUTTER_TYPE_EFFECT_TEMPLATE clutter_effect_template_get_type() - -#define CLUTTER_EFFECT_TEMPLATE(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - CLUTTER_TYPE_EFFECT_TEMPLATE, ClutterEffectTemplate)) - -#define CLUTTER_EFFECT_TEMPLATE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - CLUTTER_TYPE_EFFECT_TEMPLATE, ClutterEffectTemplateClass)) - -#define CLUTTER_IS_EFFECT_TEMPLATE(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - CLUTTER_TYPE_EFFECT_TEMPLATE)) - -#define CLUTTER_IS_EFFECT_TEMPLATE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - CLUTTER_TYPE_EFFECT_TEMPLATE)) - -#define CLUTTER_EFFECT_TEMPLATE_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - CLUTTER_TYPE_EFFECT_TEMPLATE, ClutterEffectTemplateClass)) - -typedef struct _ClutterEffectTemplate ClutterEffectTemplate; -typedef struct _ClutterEffectTemplatePrivate ClutterEffectTemplatePrivate; -typedef struct _ClutterEffectTemplateClass ClutterEffectTemplateClass; - - -struct _ClutterEffectTemplate -{ - /*< private >*/ - GObject parent_instance; - - ClutterEffectTemplatePrivate *priv; -}; - -struct _ClutterEffectTemplateClass -{ - /*< private >*/ - GObjectClass parent_class; - - /* padding, for future expansion */ - void (*_clutter_reserved1) (void); - void (*_clutter_reserved2) (void); - void (*_clutter_reserved3) (void); - void (*_clutter_reserved4) (void); -}; - -GType clutter_effect_template_get_type (void) G_GNUC_CONST; -ClutterEffectTemplate *clutter_effect_template_new (ClutterTimeline *timeline, - ClutterAlphaFunc alpha_func); -ClutterEffectTemplate *clutter_effect_template_new_full (ClutterTimeline *timeline, - ClutterAlphaFunc alpha_func, - gpointer user_data, - GDestroyNotify notify); -ClutterEffectTemplate *clutter_effect_template_new_for_duration (guint msecs, - ClutterAlphaFunc alpha_func); -void clutter_effect_template_construct (ClutterEffectTemplate *template_, - ClutterTimeline *timeline, - ClutterAlphaFunc alpha_func, - gpointer user_data, - GDestroyNotify notify); -void clutter_effect_template_set_timeline_clone (ClutterEffectTemplate *template_, - gboolean setting); -gboolean clutter_effect_template_get_timeline_clone (ClutterEffectTemplate *template_); - - -/* - * Clutter effects - */ - -ClutterTimeline *clutter_effect_fade (ClutterEffectTemplate *template_, - ClutterActor *actor, - guint8 opacity_end, - ClutterEffectCompleteFunc func, - gpointer data); -ClutterTimeline *clutter_effect_depth (ClutterEffectTemplate *template_, - ClutterActor *actor, - gint depth_end, - ClutterEffectCompleteFunc func, - gpointer data); -ClutterTimeline *clutter_effect_move (ClutterEffectTemplate *template_, - ClutterActor *actor, - gint x, - gint y, - ClutterEffectCompleteFunc func, - gpointer data); -ClutterTimeline *clutter_effect_path (ClutterEffectTemplate *template_, - ClutterActor *actor, - const ClutterKnot *knots, - guint n_knots, - ClutterEffectCompleteFunc func, - gpointer data); -ClutterTimeline *clutter_effect_scale (ClutterEffectTemplate *template_, - ClutterActor *actor, - gdouble x_scale_end, - gdouble y_scale_end, - ClutterEffectCompleteFunc func, - gpointer data); -ClutterTimeline *clutter_effect_rotate (ClutterEffectTemplate *template_, - ClutterActor *actor, - ClutterRotateAxis axis, - gdouble angle, - gint center_x, - gint center_y, - gint center_z, - ClutterRotateDirection direction, - ClutterEffectCompleteFunc func, - gpointer data); - -G_END_DECLS - -#endif /* _CLUTTER_EFFECT */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-entry.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-entry.c --- clutter-0.8.4/clutter/clutter-entry.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-entry.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,1789 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * Neil Jagdish Patel - * - * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/** - * SECTION:clutter-entry - * @short_description: A single line text entry actor - * - * #ClutterEntry is a #ClutterTexture that allows single line text entry. - * - * #ClutterEntry is available since Clutter 0.4. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include "clutter-entry.h" - -#include "clutter-debug.h" -#include "clutter-enum-types.h" -#include "clutter-keysyms.h" -#include "clutter-main.h" -#include "clutter-marshal.h" -#include "clutter-private.h" -#include "clutter-rectangle.h" -#include "clutter-units.h" -#include "pangoclutter.h" - -#define DEFAULT_FONT_NAME "Sans 10" -#define ENTRY_CURSOR_WIDTH 1 -#define ENTRY_PADDING 5 - -G_DEFINE_TYPE (ClutterEntry, clutter_entry, CLUTTER_TYPE_ACTOR); - -/* Probably move into main */ -static PangoContext *_context = NULL; - -enum -{ - PROP_0, - - PROP_FONT_NAME, - PROP_TEXT, - PROP_COLOR, - PROP_ALIGNMENT, /* FIXME */ - PROP_POSITION, - PROP_CURSOR, - PROP_TEXT_VISIBLE, - PROP_MAX_LENGTH, - PROP_ENTRY_PADDING, - PROP_X_ALIGN -}; - -enum -{ - TEXT_CHANGED, - CURSOR_EVENT, - ACTIVATE, - - LAST_SIGNAL -}; - -static guint entry_signals[LAST_SIGNAL] = { 0, }; - -#define CLUTTER_ENTRY_GET_PRIVATE(obj) \ -(G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_ENTRY, ClutterEntryPrivate)) - -struct _ClutterEntryPrivate -{ - PangoContext *context; - PangoFontDescription *desc; - - ClutterColor fgcol; - - gchar *text; - gchar *font_name; - gboolean text_visible; - gunichar priv_char; - - gint extents_width; - gint extents_height; - - gint width; - gint n_chars; /* number of chars */ - gint n_bytes; /* number of bytes */ - - guint alignment : 2; - guint wrap : 1; - guint use_underline : 1; - guint use_markup : 1; - guint ellipsize : 3; - guint single_line_mode : 1; - guint wrap_mode : 3; - gint position; - gint text_x; - gint max_length; - gint entry_padding; - gdouble x_align; - - PangoAttrList *attrs; - PangoAttrList *effective_attrs; - PangoLayout *layout; - gint width_chars; - - ClutterGeometry cursor_pos; - gboolean show_cursor; -}; - -static void -clutter_entry_set_entry_padding (ClutterEntry *entry, - guint padding) -{ - ClutterEntryPrivate *priv = entry->priv; - - if (priv->entry_padding != padding) - { - priv->entry_padding = padding; - - if (CLUTTER_ACTOR_IS_VISIBLE (entry)) - clutter_actor_queue_redraw (CLUTTER_ACTOR (entry)); - - g_object_notify (G_OBJECT (entry), "entry-padding"); - } -} - -static void -clutter_entry_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ClutterEntry *entry; - ClutterEntryPrivate *priv; - - entry = CLUTTER_ENTRY (object); - priv = entry->priv; - - switch (prop_id) - { - case PROP_FONT_NAME: - clutter_entry_set_font_name (entry, g_value_get_string (value)); - break; - case PROP_TEXT: - clutter_entry_set_text (entry, g_value_get_string (value)); - break; - case PROP_COLOR: - clutter_entry_set_color (entry, g_value_get_boxed (value)); - break; - case PROP_ALIGNMENT: - clutter_entry_set_alignment (entry, g_value_get_enum (value)); - break; - case PROP_POSITION: - clutter_entry_set_cursor_position (entry, g_value_get_int (value)); - break; - case PROP_CURSOR: - clutter_entry_set_visible_cursor (entry, g_value_get_boolean (value)); - break; - case PROP_TEXT_VISIBLE: - clutter_entry_set_visibility (entry, g_value_get_boolean (value)); - break; - case PROP_MAX_LENGTH: - clutter_entry_set_max_length (entry, g_value_get_int (value)); - break; - case PROP_ENTRY_PADDING: - clutter_entry_set_entry_padding (entry, g_value_get_uint (value)); - break; - case PROP_X_ALIGN: - entry->priv->x_align = g_value_get_double (value); - clutter_actor_queue_redraw (CLUTTER_ACTOR (object)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -clutter_entry_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ClutterEntry *entry; - ClutterEntryPrivate *priv; - ClutterColor color; - - entry = CLUTTER_ENTRY(object); - priv = entry->priv; - - switch (prop_id) - { - case PROP_FONT_NAME: - g_value_set_string (value, priv->font_name); - break; - case PROP_TEXT: - g_value_set_string (value, priv->text); - break; - case PROP_COLOR: - clutter_entry_get_color (entry, &color); - g_value_set_boxed (value, &color); - break; - case PROP_ALIGNMENT: - g_value_set_enum (value, priv->alignment); - break; - case PROP_POSITION: - g_value_set_int (value, priv->position); - break; - case PROP_CURSOR: - g_value_set_boolean (value, priv->show_cursor); - break; - case PROP_TEXT_VISIBLE: - g_value_set_boolean (value, priv->text_visible); - break; - case PROP_MAX_LENGTH: - g_value_set_int (value, priv->max_length); - break; - case PROP_ENTRY_PADDING: - g_value_set_uint (value, priv->entry_padding); - break; - case PROP_X_ALIGN: - g_value_set_double (value, priv->x_align); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -clutter_entry_ensure_layout (ClutterEntry *entry, gint width) -{ - ClutterEntryPrivate *priv; - - priv = entry->priv; - - if (!priv->layout) - { - priv->layout = pango_layout_new (_context); - - if (priv->effective_attrs) - pango_layout_set_attributes (priv->layout, priv->effective_attrs); - - pango_layout_set_alignment (priv->layout, priv->alignment); - pango_layout_set_ellipsize (priv->layout, priv->ellipsize); - pango_layout_set_single_paragraph_mode (priv->layout, - priv->single_line_mode); - - pango_layout_set_font_description (priv->layout, priv->desc); - - if (priv->text_visible) - pango_layout_set_text (priv->layout, priv->text, priv->n_bytes); - else - { - GString *str = g_string_sized_new (priv->n_bytes); - gunichar invisible_char; - gchar buf[7]; - gint char_len, i; - - if (priv->priv_char != 0) - invisible_char = priv->priv_char; - else - invisible_char = '*'; - - /* we need to convert the string built of invisible characters - * into UTF-8 for it to be fed to the Pango layout - */ - memset (buf, 0, sizeof (buf)); - char_len = g_unichar_to_utf8 (invisible_char, buf); - - for (i = 0; i < priv->n_chars; i++) - g_string_append_len (str, buf, char_len); - - pango_layout_set_text (priv->layout, str->str, str->len); - - g_string_free (str, TRUE); - } - - if (priv->wrap) - pango_layout_set_wrap (priv->layout, priv->wrap_mode); - - if (priv->wrap && width > 0) - pango_layout_set_width (priv->layout, width * PANGO_SCALE); - else - pango_layout_set_width (priv->layout, -1); - - /* Prime the cache for the layout */ - pango_clutter_ensure_glyph_cache_for_layout (priv->layout); - } -} - -static void -clutter_entry_clear_layout (ClutterEntry *entry) -{ - if (entry->priv->layout) - { - g_object_unref (entry->priv->layout); - entry->priv->layout = NULL; - } -} - -static gint -offset_to_bytes (const gchar *text, gint pos) -{ - gchar *c = NULL; - gint i, j, len; - - if (pos < 1) - return pos; - - c = g_utf8_next_char (text); - j = 1; - len = strlen (text); - - for (i = 0; i < len; i++) - { - if (&text[i] == c) - { - if (j == pos) - break; - else - { - c = g_utf8_next_char (c); - j++; - } - } - } - return i; -} - - -static void -clutter_entry_ensure_cursor_position (ClutterEntry *entry) -{ - ClutterEntryPrivate *priv; - gint index_; - PangoRectangle rect; - gint priv_char_bytes; - - priv = entry->priv; - - /* If characters are invisible, get the byte-length of the invisible - * character. If priv_char is 0, we use '*', which is ASCII (1 byte). - */ - if (!priv->text_visible && priv->priv_char) - priv_char_bytes = g_unichar_to_utf8 (priv->priv_char, NULL); - else - priv_char_bytes = 1; - - if (priv->position == -1) - { - if (priv->text_visible) - index_ = strlen (priv->text); - else - index_ = priv->n_chars * priv_char_bytes; - } - else - { - if (priv->text_visible) - index_ = offset_to_bytes (priv->text, priv->position); - else - index_ = priv->position * priv_char_bytes; - } - - pango_layout_get_cursor_pos (priv->layout, index_, &rect, NULL); - priv->cursor_pos.x = rect.x / PANGO_SCALE; - priv->cursor_pos.y = rect.y / PANGO_SCALE; - priv->cursor_pos.width = ENTRY_CURSOR_WIDTH; - priv->cursor_pos.height = rect.height / PANGO_SCALE; - - g_signal_emit (entry, entry_signals[CURSOR_EVENT], 0, &priv->cursor_pos); -} - -static void -clutter_entry_clear_cursor_position (ClutterEntry *entry) -{ - entry->priv->cursor_pos.width = 0; -} - -void -clutter_entry_paint_cursor (ClutterEntry *entry) -{ - ClutterEntryPrivate *priv; - - priv = entry->priv; - - if (priv->show_cursor) - { - cogl_color (&priv->fgcol); - cogl_rectangle (priv->cursor_pos.x, - priv->cursor_pos.y, - priv->cursor_pos.width, - priv->cursor_pos.height); - } -} - -static void -clutter_entry_paint (ClutterActor *self) -{ - ClutterEntry *entry; - ClutterEntryPrivate *priv; - PangoRectangle logical; - gint width, actor_width; - gint text_width; - gint cursor_x; - ClutterColor color = { 0, }; - - entry = CLUTTER_ENTRY(self); - priv = entry->priv; - - if (priv->desc == NULL || priv->text == NULL) - { - CLUTTER_NOTE (ACTOR, "layout: %p , desc: %p, text %p", - priv->layout, - priv->desc, - priv->text); - return; - } - - if (priv->width < 0) - width = clutter_actor_get_width (self); - else - width = priv->width; - - cogl_clip_set (0, 0, CLUTTER_INT_TO_FIXED (width), - CLUTTER_INT_TO_FIXED (clutter_actor_get_height (self))); - - actor_width = width - (2 * priv->entry_padding); - clutter_entry_ensure_layout (entry, actor_width); - clutter_entry_ensure_cursor_position (entry); - - pango_layout_get_extents (priv->layout, NULL, &logical); - text_width = logical.width / PANGO_SCALE; - - if (actor_width < text_width) - { - /* We need to do some scrolling */ - cursor_x = priv->cursor_pos.x; - - /* If the cursor is at the begining or the end of the text, the placement - * is easy, however, if the cursor is in the middle somewhere, we need to - * make sure the text doesn't move until the cursor is either in the - * far left or far right - */ - - if (priv->position == 0) - priv->text_x = 0; - else if (priv->position == -1) - { - priv->text_x = actor_width - text_width; - priv->cursor_pos.x += priv->text_x + priv->entry_padding; - } - else - { - if (priv->text_x <= 0) - { - gint diff = -1 * priv->text_x; - - if (cursor_x < diff) - priv->text_x += diff - cursor_x; - else if (cursor_x > (diff + actor_width)) - priv->text_x -= cursor_x - (diff+actor_width); - } - - priv->cursor_pos.x += priv->text_x + priv->entry_padding; - } - - } - else - { - priv->text_x = (actor_width - text_width) * priv->x_align; - priv->cursor_pos.x += priv->text_x + priv->entry_padding; - } - - memcpy (&color, &priv->fgcol, sizeof (ClutterColor)); - color.alpha = clutter_actor_get_paint_opacity (self); - - pango_clutter_render_layout (priv->layout, - priv->text_x + priv->entry_padding, 0, - &color, 0); - - if (CLUTTER_ENTRY_GET_CLASS (entry)->paint_cursor) - CLUTTER_ENTRY_GET_CLASS (entry)->paint_cursor (entry); - - cogl_clip_unset (); -} - -static void -clutter_entry_allocate (ClutterActor *self, - const ClutterActorBox *box, - gboolean absolute_origin_changed) -{ - ClutterEntry *entry = CLUTTER_ENTRY (self); - ClutterEntryPrivate *priv = entry->priv; - gint width; - - width = CLUTTER_UNITS_TO_DEVICE (box->x2 - box->x1); - - if (priv->width != width) - { - clutter_entry_clear_layout (entry); - clutter_entry_ensure_layout (entry, width); - - priv->width = width; - } - - CLUTTER_ACTOR_CLASS (clutter_entry_parent_class)->allocate (self, box, absolute_origin_changed); -} - -static inline void -clutter_entry_handle_key_event_internal (ClutterEntry *entry, - ClutterKeyEvent *event) -{ - gunichar key_unichar; - ClutterEntryPrivate *priv = entry->priv; - gint pos = priv->position; - gint len = 0; - gint keyval = clutter_key_event_symbol (event); - - if (priv->text) - len = g_utf8_strlen (priv->text, -1); - - switch (keyval) - { - case CLUTTER_Return: - case CLUTTER_KP_Enter: - case CLUTTER_ISO_Enter: - g_signal_emit (entry, entry_signals[ACTIVATE], 0); - break; - - case CLUTTER_Escape: - case CLUTTER_Up: - case CLUTTER_KP_Up: - case CLUTTER_Down: - case CLUTTER_KP_Down: - case CLUTTER_Shift_L: - case CLUTTER_Shift_R: - break; - - case CLUTTER_BackSpace: - if (pos != 0 && len != 0) - clutter_entry_delete_chars (entry, 1); - break; - - case CLUTTER_Delete: - case CLUTTER_KP_Delete: - if (len && pos != -1) - clutter_entry_delete_text (entry, pos, pos+1);; - break; - - case CLUTTER_Left: - case CLUTTER_KP_Left: - if (pos != 0 && len != 0) - { - if (pos == -1) - clutter_entry_set_cursor_position (entry, len - 1); - else - clutter_entry_set_cursor_position (entry, pos - 1); - } - break; - - case CLUTTER_Right: - case CLUTTER_KP_Right: - if (pos != -1 && len != 0) - { - if (pos != len) - clutter_entry_set_cursor_position (entry, pos + 1); - } - break; - - case CLUTTER_End: - case CLUTTER_KP_End: - clutter_entry_set_cursor_position (entry, -1); - break; - - case CLUTTER_Begin: - case CLUTTER_Home: - case CLUTTER_KP_Home: - clutter_entry_set_cursor_position (entry, 0); - break; - - default: - key_unichar = clutter_key_event_unicode (event); - if (g_unichar_validate (key_unichar)) - clutter_entry_insert_unichar (entry, key_unichar); - break; - } -} - -static gboolean -clutter_entry_key_press (ClutterActor *actor, - ClutterKeyEvent *event) -{ - clutter_entry_handle_key_event_internal (CLUTTER_ENTRY (actor), event); - - return TRUE; -} - -static void -clutter_entry_dispose (GObject *object) -{ - ClutterEntry *self = CLUTTER_ENTRY(object); - ClutterEntryPrivate *priv; - - priv = self->priv; - - if (priv->layout) - { - g_object_unref (priv->layout); - priv->layout = NULL; - } - - if (priv->context) - { - g_object_unref (priv->context); - priv->context = NULL; - } - - G_OBJECT_CLASS (clutter_entry_parent_class)->dispose (object); -} - -static void -clutter_entry_finalize (GObject *object) -{ - ClutterEntryPrivate *priv = CLUTTER_ENTRY (object)->priv; - - if (priv->desc) - pango_font_description_free (priv->desc); - - g_free (priv->text); - g_free (priv->font_name); - - G_OBJECT_CLASS (clutter_entry_parent_class)->finalize (object); -} - -static void -clutter_entry_class_init (ClutterEntryClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); - - klass->paint_cursor = clutter_entry_paint_cursor; - - actor_class->paint = clutter_entry_paint; - actor_class->allocate = clutter_entry_allocate; - actor_class->key_press_event = clutter_entry_key_press; - - gobject_class->finalize = clutter_entry_finalize; - gobject_class->dispose = clutter_entry_dispose; - gobject_class->set_property = clutter_entry_set_property; - gobject_class->get_property = clutter_entry_get_property; - - /** - * ClutterEntry:font-name: - * - * The font to be used by the entry, expressed in a string that - * can be parsed by pango_font_description_from_string(). - * - * Since: 0.4 - */ - g_object_class_install_property - (gobject_class, PROP_FONT_NAME, - g_param_spec_string ("font-name", - "Font Name", - "Pango font description", - NULL, - CLUTTER_PARAM_READWRITE)); - /** - * ClutterEntry:text: - * - * The text inside the entry. - * - * Since: 0.4 - */ - g_object_class_install_property - (gobject_class, PROP_TEXT, - g_param_spec_string ("text", - "Text", - "Text to render", - NULL, - CLUTTER_PARAM_READWRITE)); - /** - * ClutterEntry:color: - * - * The color of the text inside the entry. - * - * Since: 0.4 - */ - g_object_class_install_property - (gobject_class, PROP_COLOR, - g_param_spec_boxed ("color", - "Font Colour", - "Font Colour", - CLUTTER_TYPE_COLOR, - CLUTTER_PARAM_READWRITE)); - /** - * ClutterEntry:alignment: - * - * The preferred alignment for the string. - * - * Since: 0.4 - */ - g_object_class_install_property - (gobject_class, PROP_ALIGNMENT, - g_param_spec_enum ("alignment", - "Alignment", - "The preferred alignment for the string,", - PANGO_TYPE_ALIGNMENT, - PANGO_ALIGN_LEFT, - CLUTTER_PARAM_READWRITE)); - /** - * ClutterEntry:position: - * - * The current input cursor position. -1 is taken to be the end of the text - * - * Since: 0.4 - */ - g_object_class_install_property - (gobject_class, PROP_POSITION, - g_param_spec_int ("position", - "Position", - "The cursor position", - -1, G_MAXINT, - -1, - CLUTTER_PARAM_READWRITE)); - - /** - * ClutterEntry:cursor-visible: - * - * Whether the input cursor is visible or not. - * - * Since: 0.4 - */ - g_object_class_install_property - (gobject_class, PROP_CURSOR, - g_param_spec_boolean ( "cursor-visible", - "Cursor Visible", - "Whether the input cursor is visible", - TRUE, - CLUTTER_PARAM_READWRITE)); - - /** - * ClutterEntry:text-visible: - * - * Whether the text is visible in plain form, or replaced by the - * character set by clutter_entry_set_invisible_char(). - * - * Since: 0.4 - */ - g_object_class_install_property - (gobject_class, PROP_TEXT_VISIBLE, - g_param_spec_boolean ("text-visible", - "Text Visible", - "Whether the text is visible in plain form", - TRUE, - CLUTTER_PARAM_READWRITE)); - - /** - * ClutterEntry:max-length: - * - * The maximum length of the entry text. - * - * Since: 0.4 - */ - g_object_class_install_property - (gobject_class, PROP_MAX_LENGTH, - g_param_spec_int ("max-length", - "Max Length", - "The maximum length of the entry text", - 0, G_MAXINT, - 0, - CLUTTER_PARAM_READWRITE)); - /** - * ClutterEntry:entry-padding: - * - * The padding space between the text and the entry right and left borders. - * - * Since: 0.4 - */ - g_object_class_install_property - (gobject_class, PROP_ENTRY_PADDING, - g_param_spec_uint ("entry-padding", - "Entry Padding", - "The padding space between the text and the left and " - "right borders", - 0, G_MAXUINT, - ENTRY_PADDING, - CLUTTER_PARAM_READWRITE)); - /** - * ClutterEntry:x-align: - * - * Horizontal alignment to be used for the text (0.0 for left alignment, - * 1.0 for right alignment). - * - * Since: 0.6 - */ - g_object_class_install_property (gobject_class, - PROP_X_ALIGN, - g_param_spec_double ("x-align", - "Horizontal Alignment", - "The horizontal alignment to be used for the text", - 0.0, 1.0, 0.0, - CLUTTER_PARAM_READWRITE)); - /** - * ClutterEntry::text-changed: - * @entry: the actor which received the event - * - * The ::text-changed signal is emitted after @entry's text changes - */ - entry_signals[TEXT_CHANGED] = - g_signal_new ("text-changed", - G_TYPE_FROM_CLASS (gobject_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ClutterEntryClass, text_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - /** - * ClutterEntry::cursor-event: - * @entry: the actor which received the event - * @geometry: a #ClutterGeometry - * - * The ::cursor-event signal is emitted each time the input cursor's geometry - * changes, this could be a positional or size change. If you would like to - * implement your own input cursor, set the cursor-visible property to %FALSE, - * and connect to this signal to position and size your own cursor. - * - * Since: 0.4 - */ - entry_signals[CURSOR_EVENT] = - g_signal_new ("cursor-event", - G_TYPE_FROM_CLASS (gobject_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ClutterEntryClass, cursor_event), - NULL, NULL, - clutter_marshal_VOID__BOXED, - G_TYPE_NONE, 1, - CLUTTER_TYPE_GEOMETRY | G_SIGNAL_TYPE_STATIC_SCOPE); - - /** - * ClutterEntry::activate: - * @entry: the actor which received the event - * - * The ::activate signal is emitted each time the entry is 'activated' - * by the user, normally by pressing the 'Enter' key. - * - * Since: 0.4 - */ - entry_signals[ACTIVATE] = - g_signal_new ("activate", - G_TYPE_FROM_CLASS (gobject_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ClutterEntryClass, activate), - NULL, NULL, - clutter_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - g_type_class_add_private (gobject_class, sizeof (ClutterEntryPrivate)); -} - -static void -clutter_entry_init (ClutterEntry *self) -{ - ClutterEntryPrivate *priv; - gdouble resolution; - gint font_size; - - self->priv = priv = CLUTTER_ENTRY_GET_PRIVATE (self); - - if (G_UNLIKELY (_context == NULL)) - _context = _clutter_context_create_pango_context (CLUTTER_CONTEXT ()); - - resolution = pango_cairo_context_get_resolution (_context); - - priv->alignment = PANGO_ALIGN_LEFT; - priv->wrap = FALSE; - priv->wrap_mode = PANGO_WRAP_WORD; - priv->ellipsize = PANGO_ELLIPSIZE_NONE; - priv->use_underline = FALSE; - priv->use_markup = FALSE; - priv->layout = NULL; - priv->text = NULL; - priv->attrs = NULL; - priv->position = -1; - priv->priv_char = '*'; - priv->text_visible = TRUE; - priv->text_x = 0; - priv->max_length = 0; - priv->entry_padding = ENTRY_PADDING; - priv->x_align = 0.0; - - priv->fgcol.red = 0; - priv->fgcol.green = 0; - priv->fgcol.blue = 0; - priv->fgcol.alpha = 255; - - priv->font_name = g_strdup (DEFAULT_FONT_NAME); - priv->desc = pango_font_description_from_string (priv->font_name); - - /* we use the font size to set the default width and height, in case - * the user doesn't call clutter_actor_set_size(). - */ - font_size = PANGO_PIXELS (pango_font_description_get_size (priv->desc)) - * resolution - / 72.0; - clutter_actor_set_size (CLUTTER_ACTOR (self), font_size * 20, 50); - - priv->show_cursor = TRUE; -} - -/** - * clutter_entry_new_with_text: - * @font_name: the name (and size) of the font to be used - * @text: the text to be displayed - * - * Creates a new #ClutterEntry displaying @text using @font_name. - * - * Return value: the newly created #ClutterEntry - * - * Since: 0.4 - */ -ClutterActor * -clutter_entry_new_with_text (const gchar *font_name, - const gchar *text) -{ - ClutterActor *entry = clutter_entry_new (); - - g_object_set (entry, - "font-name", font_name, - "text", text, - NULL); - return entry; -} - -/** - * clutter_entry_new_full: - * @font_name: the name (and size) of the font to be used - * @text: the text to be displayed - * @color: #ClutterColor for text - * - * Creates a new #ClutterEntry displaying @text with @color - * using @font_name. - * - * Return value: the newly created #ClutterEntry - * - * Since: 0.4 - */ -ClutterActor * -clutter_entry_new_full (const gchar *font_name, - const gchar *text, - const ClutterColor *color) -{ - ClutterActor *entry; - - entry = clutter_entry_new_with_text (font_name, text); - clutter_entry_set_color (CLUTTER_ENTRY(entry), color); - - return entry; -} - -/** - * clutter_entry_new: - * - * Creates a new, empty #ClutterEntry. - * - * Returns: the newly created #ClutterEntry - */ -ClutterActor * -clutter_entry_new (void) -{ - ClutterActor *entry = g_object_new (CLUTTER_TYPE_ENTRY, - NULL); - clutter_actor_set_size (entry, 50, 50); - - return entry; -} - -/** - * clutter_entry_get_text: - * @entry: a #ClutterEntry - * - * Retrieves the text displayed by @entry. - * - * Return value: the text of the entry. The returned string is - * owned by #ClutterEntry and should not be modified or freed. - * - * Since: 0.4 - */ -G_CONST_RETURN gchar * -clutter_entry_get_text (ClutterEntry *entry) -{ - g_return_val_if_fail (CLUTTER_IS_ENTRY (entry), NULL); - - return entry->priv->text; -} - -/** - * clutter_entry_set_text: - * @entry: a #ClutterEntry - * @text: the text to be displayed - * - * Sets @text as the text to be displayed by @entry. The - * ClutterEntry::text-changed signal is emitted. - * - * Since: 0.4 - */ -void -clutter_entry_set_text (ClutterEntry *entry, - const gchar *text) -{ - ClutterEntryPrivate *priv; - - g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - g_return_if_fail (text != NULL); - - priv = entry->priv; - - g_object_ref (entry); - - if (priv->max_length > 0) - { - gint len = g_utf8_strlen (text, -1); - - if (len < priv->max_length) - { - g_free (priv->text); - - priv->text = g_strdup (text); - priv->n_bytes = strlen (text); - priv->n_chars = len; - } - else - { - gchar * n = g_malloc0 (priv->max_length + 1); - - g_utf8_strncpy (n, text, priv->max_length); - g_free (priv->text); - - priv->text = n; - priv->n_bytes = strlen (n); - priv->n_chars = priv->max_length; - } - } - else - { - g_free (priv->text); - - priv->text = g_strdup (text); - priv->n_bytes = strlen (text); - priv->n_chars = g_utf8_strlen (priv->text, -1); - } - - clutter_entry_clear_layout (entry); - clutter_entry_clear_cursor_position (entry); - /* Recreate the layout so the glyph cache will be primed */ - clutter_entry_ensure_layout (entry, -1); - - if (CLUTTER_ACTOR_IS_VISIBLE (entry)) - clutter_actor_queue_redraw (CLUTTER_ACTOR (entry)); - - g_signal_emit (G_OBJECT (entry), entry_signals[TEXT_CHANGED], 0); - - g_object_notify (G_OBJECT (entry), "text"); - g_object_unref (entry); -} - -/** - * clutter_entry_get_font_name: - * @entry: a #ClutterEntry - * - * Retrieves the font used by @entry. - * - * Return value: a string containing the font name, in a format - * understandable by pango_font_description_from_string(). The - * string is owned by #ClutterEntry and should not be modified - * or freed. - * - * Since: 0.4 - */ -G_CONST_RETURN gchar * -clutter_entry_get_font_name (ClutterEntry *entry) -{ - g_return_val_if_fail (CLUTTER_IS_ENTRY (entry), NULL); - - return entry->priv->font_name; -} - -/** - * clutter_entry_set_font_name: - * @entry: a #ClutterEntry - * @font_name: a font name and size, or %NULL for the default font - * - * Sets @font_name as the font used by @entry. - * - * @font_name must be a string containing the font name and its - * size, similarly to what you would feed to the - * pango_font_description_from_string() function. - * - * Since: 0.4 - */ -void -clutter_entry_set_font_name (ClutterEntry *entry, - const gchar *font_name) -{ - ClutterEntryPrivate *priv; - PangoFontDescription *desc; - - g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - - if (!font_name || font_name[0] == '\0') - font_name = DEFAULT_FONT_NAME; - - priv = entry->priv; - - if (strcmp (priv->font_name, font_name) == 0) - return; - - desc = pango_font_description_from_string (font_name); - if (!desc) - { - g_warning ("Attempting to create a PangoFontDescription for " - "font name `%s', but failed.", - font_name); - return; - } - - g_object_ref (entry); - - g_free (priv->font_name); - priv->font_name = g_strdup (font_name); - - if (priv->desc) - pango_font_description_free (priv->desc); - - priv->desc = desc; - - if (entry->priv->text && entry->priv->text[0] != '\0') - { - clutter_entry_clear_layout (entry); - /* Recreate the layout so the glyph cache will be primed */ - clutter_entry_ensure_layout (entry, -1); - - if (CLUTTER_ACTOR_IS_VISIBLE (entry)) - clutter_actor_queue_redraw (CLUTTER_ACTOR (entry)); - } - - g_object_notify (G_OBJECT (entry), "font-name"); - g_object_unref (entry); -} - - -/** - * clutter_entry_set_color: - * @entry: a #ClutterEntry - * @color: a #ClutterColor - * - * Sets the color of @entry. - * - * Since: 0.4 - */ -void -clutter_entry_set_color (ClutterEntry *entry, - const ClutterColor *color) -{ - ClutterActor *actor; - ClutterEntryPrivate *priv; - - g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - g_return_if_fail (color != NULL); - - priv = entry->priv; - - g_object_ref (entry); - - priv->fgcol.red = color->red; - priv->fgcol.green = color->green; - priv->fgcol.blue = color->blue; - priv->fgcol.alpha = color->alpha; - - actor = CLUTTER_ACTOR (entry); - - clutter_actor_set_opacity (actor, priv->fgcol.alpha); - - if (CLUTTER_ACTOR_IS_VISIBLE (actor)) - clutter_actor_queue_redraw (actor); - - g_object_notify (G_OBJECT (entry), "color"); - g_object_unref (entry); -} - -/** - * clutter_entry_get_color: - * @entry: a #ClutterEntry - * @color: return location for a #ClutterColor - * - * Retrieves the color of @entry. - * - * Since: 0.4 - */ -void -clutter_entry_get_color (ClutterEntry *entry, - ClutterColor *color) -{ - ClutterEntryPrivate *priv; - - g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - g_return_if_fail (color != NULL); - - priv = entry->priv; - - color->red = priv->fgcol.red; - color->green = priv->fgcol.green; - color->blue = priv->fgcol.blue; - color->alpha = priv->fgcol.alpha; -} - -/** - * clutter_entry_get_layout: - * @entry: a #ClutterEntry - * - * Gets the #PangoLayout used to display the entry. - * The layout is useful to e.g. convert text positions to - * pixel positions. - * The returned layout is owned by the entry so need not be - * freed by the caller. - * - * Return value: the #PangoLayout for this entry - * - * Since: 0.4 - **/ -PangoLayout * -clutter_entry_get_layout (ClutterEntry *entry) -{ - g_return_val_if_fail (CLUTTER_IS_ENTRY (entry), NULL); - - clutter_entry_ensure_layout (entry, -1); - - return entry->priv->layout; -} - -/** - * clutter_entry_set_alignment: - * @entry: a #ClutterEntry - * @alignment: A #PangoAlignment - * - * Sets text alignment of the entry. - * - * Since: 0.4 - */ -void -clutter_entry_set_alignment (ClutterEntry *entry, - PangoAlignment alignment) -{ - ClutterEntryPrivate *priv; - - g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - - priv = entry->priv; - - if (priv->alignment != alignment) - { - g_object_ref (entry); - - priv->alignment = alignment; - - clutter_entry_clear_layout (entry); - - if (CLUTTER_ACTOR_IS_VISIBLE (entry)) - clutter_actor_queue_redraw (CLUTTER_ACTOR (entry)); - - g_object_notify (G_OBJECT (entry), "alignment"); - g_object_unref (entry); - } -} - -/** - * clutter_entry_get_alignment: - * @entry: a #ClutterEntry - * - * Returns the entry's text alignment - * - * Return value: The entry's #PangoAlignment - * - * Since 0.4 - */ -PangoAlignment -clutter_entry_get_alignment (ClutterEntry *entry) -{ - g_return_val_if_fail (CLUTTER_IS_ENTRY (entry), FALSE); - - return entry->priv->alignment; -} - -/** - * clutter_entry_set_cursor_position: - * @entry: a #ClutterEntry - * @position: the position of the cursor. - * - * Sets the position of the cursor. The @position must be less than or - * equal to the number of characters in the entry. A value of -1 indicates - * that the position should be set after the last character in the entry. - * Note that this position is in characters, not in bytes. - * - * Since: 0.6 - */ -void -clutter_entry_set_cursor_position (ClutterEntry *entry, - gint position) -{ - ClutterEntryPrivate *priv; - gint len; - - g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - - priv = entry->priv; - - if (priv->text == NULL) - return; - - len = g_utf8_strlen (priv->text, -1); - - if (position < 0 || position >= len) - priv->position = -1; - else - priv->position = position; - - clutter_entry_clear_cursor_position (entry); - - if (CLUTTER_ACTOR_IS_VISIBLE (entry)) - clutter_actor_queue_redraw (CLUTTER_ACTOR (entry)); -} - -/** - * clutter_entry_get_cursor_position: - * @entry: a #ClutterEntry - * - * Gets the position, in characters, of the cursor in @entry. - * - * Return value: the position of the cursor. - * - * Since: 0.6 - */ -gint -clutter_entry_get_cursor_position (ClutterEntry *entry) -{ - ClutterEntryPrivate *priv; - - g_return_val_if_fail (CLUTTER_IS_ENTRY (entry), 0); - - priv = entry->priv; - - return priv->position; -} - -/** - * clutter_entry_handle_key_event: - * @entry: a #ClutterEntry - * @kev: a #ClutterKeyEvent - * - * This function will handle a #ClutterKeyEvent, like those returned in a - * key-press/release-event, and will translate it for the @entry. This includes - * non-alphanumeric keys, such as the arrows keys, which will move the - * input cursor. You should use this function inside a handler for the - * ClutterStage::key-press-event or ClutterStage::key-release-event. - * - * Since: 0.4 - * - * Deprecated: 0.8: The key events will automatically be handled when - * giving the key focus to an entry using clutter_stage_set_key_focus(). - */ -void -clutter_entry_handle_key_event (ClutterEntry *entry, - ClutterKeyEvent *kev) -{ - g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - - clutter_entry_handle_key_event_internal (entry, kev); -} - -/** - * clutter_entry_insert_unichar: - * @entry: a #ClutterEntry - * @wc: a Unicode character - * - * Insert a character to the right of the current position of the cursor, - * and updates the position of the cursor. - * - * Since: 0.4 - */ -void -clutter_entry_insert_unichar (ClutterEntry *entry, - gunichar wc) -{ - ClutterEntryPrivate *priv; - GString *new = NULL; - glong pos; - - g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - g_return_if_fail (g_unichar_validate (wc)); - - if (wc == 0) - return; - - priv = entry->priv; - - g_object_ref (entry); - - new = g_string_new (priv->text); - pos = offset_to_bytes (priv->text, priv->position); - new = g_string_insert_unichar (new, pos, wc); - - clutter_entry_set_text (entry, new->str); - - if (priv->position >= 0) - clutter_entry_set_cursor_position (entry, priv->position + 1); - - g_string_free (new, TRUE); - - g_object_notify (G_OBJECT (entry), "text"); - g_object_unref (entry); -} - -/** - * clutter_entry_delete_chars: - * @entry: a #ClutterEntry - * @len: the number of characters to remove. - * - * Characters are removed from before the current postion of the cursor. - * - * Since: 0.4 - */ -void -clutter_entry_delete_chars (ClutterEntry *entry, - guint num) -{ - ClutterEntryPrivate *priv; - GString *new = NULL; - gint len; - gint pos; - gint num_pos; - - g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - - priv = entry->priv; - - if (!priv->text) - return; - - g_object_ref (entry); - - len = g_utf8_strlen (priv->text, -1); - new = g_string_new (priv->text); - - if (priv->position == -1) - { - num_pos = offset_to_bytes (priv->text, len - num); - new = g_string_erase (new, num_pos, -1); - } - else - { - pos = offset_to_bytes (priv->text, priv->position - num); - num_pos = offset_to_bytes (priv->text, priv->position); - new = g_string_erase (new, pos, num_pos-pos); - } - clutter_entry_set_text (entry, new->str); - - if (priv->position > 0) - clutter_entry_set_cursor_position (entry, priv->position - num); - - g_string_free (new, TRUE); - - g_object_notify (G_OBJECT (entry), "text"); - g_object_unref (entry); -} - -/** - * clutter_entry_insert_text: - * @entry: a #ClutterEntry - * @text: the text to insert - * @position: the position at which to insert the text. - * - * Insert text at a specifc position. - * - * A value of 0 indicates that the text will be inserted before the first - * character in the entry's text, and a value of -1 indicates that the text - * will be inserted after the last character in the entry's text. - * - * Since: 0.4 - */ -void -clutter_entry_insert_text (ClutterEntry *entry, - const gchar *text, - gssize position) -{ - ClutterEntryPrivate *priv; - GString *new = NULL; - - g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - - priv = entry->priv; - - new = g_string_new (priv->text); - new = g_string_insert (new, position, text); - - clutter_entry_set_text (entry, new->str); - - g_string_free (new, TRUE); -} - -/** - * clutter_entry_delete_text: - * @entry: a #ClutterEntry - * @start_pos: the starting position. - * @end_pos: the end position. - * - * Deletes a sequence of characters. The characters that are deleted are - * those characters at positions from @start_pos up to, but not including, - * @end_pos. If @end_pos is negative, then the characters deleted will be - * those characters from @start_pos to the end of the text. - * - * Since: 0.4 - */ -void -clutter_entry_delete_text (ClutterEntry *entry, - gssize start_pos, - gssize end_pos) -{ - ClutterEntryPrivate *priv; - GString *new = NULL; - gint start_bytes; - gint end_bytes; - - g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - - priv = entry->priv; - - if (!priv->text) - return; - - start_bytes = offset_to_bytes (priv->text, start_pos); - end_bytes = offset_to_bytes (priv->text, end_pos); - - new = g_string_new (priv->text); - new = g_string_erase (new, start_bytes, end_bytes - start_bytes); - - clutter_entry_set_text (entry, new->str); - - g_string_free (new, TRUE); -} - -/** - * clutter_entry_set_visible_cursor: - * @entry: a #ClutterEntry - * @visible: whether the input cursor should be visible - * - * Sets the visibility of the input cursor. - * - * Since: 0.4 - */ -void -clutter_entry_set_visible_cursor (ClutterEntry *entry, - gboolean visible) -{ - ClutterEntryPrivate *priv; - - g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - - priv = entry->priv; - - if (priv->show_cursor != visible) - { - priv->show_cursor = visible; - - g_object_notify (G_OBJECT (entry), "cursor-visible"); - - if (CLUTTER_ACTOR_IS_VISIBLE (entry)) - clutter_actor_queue_redraw (CLUTTER_ACTOR (entry)); - } -} - -/** - * clutter_entry_get_visible_cursor: - * @entry: a #ClutterEntry - * - * Returns the input cursor's visibility - * - * Return value: whether the input cursor is visible - * - * Since: 0.4 - */ -gboolean -clutter_entry_get_visible_cursor (ClutterEntry *entry) -{ - g_return_val_if_fail (CLUTTER_IS_ENTRY (entry), FALSE); - - return entry->priv->show_cursor; -} - -/** - * clutter_entry_set_visibility: - * @entry: a #ClutterEntry - * @visible: %TRUE if the contents of the entry are displayed as plaintext. - * - * Sets whether the contents of the entry are visible or not. When visibility - * is set to %FALSE, characters are displayed as the invisible char, and will - * also appear that way when the text in the entry widget is copied elsewhere. - * - * The default invisible char is the asterisk '*', but it can be changed with - * clutter_entry_set_invisible_char(). - * - * Since: 0.4 - */ -void -clutter_entry_set_visibility (ClutterEntry *entry, gboolean visible) -{ - ClutterEntryPrivate *priv; - - g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - - priv = entry->priv; - - priv->text_visible = visible; - - clutter_entry_clear_layout (entry); - clutter_entry_clear_cursor_position (entry); - - if (CLUTTER_ACTOR_IS_VISIBLE (entry)) - clutter_actor_queue_redraw (CLUTTER_ACTOR (entry)); -} - -/** - * clutter_entry_get_visibility: - * @entry: a #ClutterEntry - * - * Returns the entry text visibility. - * - * Return value: %TRUE if the contents of the entry are displayed as plaintext. - * - * Since: 0.4 - */ -gboolean -clutter_entry_get_visibility (ClutterEntry *entry) -{ - g_return_val_if_fail (CLUTTER_IS_ENTRY (entry), TRUE); - - return entry->priv->text_visible; -} - -/** - * clutter_entry_set_invisible_char: - * @entry: a #ClutterEntry - * @wc: a Unicode character - * - * Sets the character to use in place of the actual text when - * clutter_entry_set_visibility() has been called to set text visibility - * to %FALSE. i.e. this is the character used in "password mode" to show the - * user how many characters have been typed. The default invisible char is an - * asterisk ('*'). If you set the invisible char to 0, then the user will get - * no feedback at all; there will be no text on the screen as they type. - * - * Since: 0.4 - */ -void -clutter_entry_set_invisible_char (ClutterEntry *entry, gunichar wc) -{ - ClutterEntryPrivate *priv; - - g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - - priv = entry->priv; - - priv->priv_char = wc; - - if (!priv->text_visible) - return; - - clutter_entry_clear_layout (entry); - clutter_entry_clear_cursor_position (entry); - - if (CLUTTER_ACTOR_IS_VISIBLE (entry)) - clutter_actor_queue_redraw (CLUTTER_ACTOR (entry)); -} - -/** - * clutter_entry_get_invisible_char: - * @entry: a #ClutterEntry - * - * Returns the character to use in place of the actual text when text-visibility - * is set to %FALSE - * - * Return value: a Unicode character - * - **/ -gunichar -clutter_entry_get_invisible_char (ClutterEntry *entry) -{ - ClutterEntryPrivate *priv; - - g_return_val_if_fail (CLUTTER_IS_ENTRY (entry), TRUE); - - priv = entry->priv; - - return priv->priv_char; -} - -/** - * clutter_entry_set_max_length: - * @entry: a #ClutterEntry - * @max: the maximum number of characters allowed in the entry; 0 - * to disable or -1 to set the length of the current string - * - * Sets the maximum allowed length of the contents of the actor. If the - * current contents are longer than the given length, then they will be - * truncated to fit. - * - * Since: 0.4 - */ -void -clutter_entry_set_max_length (ClutterEntry *entry, - gint max) -{ - ClutterEntryPrivate *priv; - gchar *new = NULL; - - g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - - priv = entry->priv; - - if (priv->max_length != max) - { - g_object_ref (entry); - - if (max < 0) - max = g_utf8_strlen (priv->text, -1); - - priv->max_length = max; - - new = g_strdup (priv->text); - clutter_entry_set_text (entry, new); - g_free (new); - - g_object_notify (G_OBJECT (entry), "max-length"); - g_object_unref (entry); - } -} - -/** - * clutter_entry_get_max_length: - * @entry: a #ClutterEntry - * - * Gets the maximum length of text that can be set into @entry. - * See clutter_entry_set_max_length(). - * - * Return value: the maximum number of characters. - * - * Since: 0.4 - */ -gint -clutter_entry_get_max_length (ClutterEntry *entry) -{ - g_return_val_if_fail (CLUTTER_IS_ENTRY (entry), -1); - - return entry->priv->max_length; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-entry.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-entry.h --- clutter-0.8.4/clutter/clutter-entry.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-entry.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,163 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * Neil Jagdish Patel -#include -#include -#include - - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_ENTRY (clutter_entry_get_type ()) - -#define CLUTTER_ENTRY(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - CLUTTER_TYPE_ENTRY, ClutterEntry)) - -#define CLUTTER_ENTRY_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - CLUTTER_TYPE_ENTRY, ClutterEntryClass)) - -#define CLUTTER_IS_ENTRY(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - CLUTTER_TYPE_ENTRY)) - -#define CLUTTER_IS_ENTRY_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - CLUTTER_TYPE_ENTRY)) - -#define CLUTTER_ENTRY_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - CLUTTER_TYPE_ENTRY, ClutterEntryClass)) - -typedef struct _ClutterEntry ClutterEntry; -typedef struct _ClutterEntryClass ClutterEntryClass; -typedef struct _ClutterEntryPrivate ClutterEntryPrivate; - -struct _ClutterEntry -{ - /*< private >*/ - ClutterActor parent_instance; - - ClutterEntryPrivate *priv; -}; - -/** - * ClutterEntryClass: - * @paint_cursor: virtual function for subclasses to use to draw a custom - * cursor instead of the default one - * @text_changed: signal class handler for ClutterEntry::text-changed - * @cursor_event: signal class handler for ClutterEntry::cursor-event - * @activate: signal class handler for ClutterEntry::activate - * - * Class fo entry actors. - * - * Since: 0.4 - */ -struct _ClutterEntryClass -{ - /*< private >*/ - ClutterActorClass parent_class; - - /*< public >*/ - /* vfuncs, not signals */ - void (* paint_cursor) (ClutterEntry *entry); - - /* signals */ - void (* text_changed) (ClutterEntry *entry); - void (* cursor_event) (ClutterEntry *entry, - ClutterGeometry *geometry); - void (* activate) (ClutterEntry *entry); - - /*< private >*/ - /* padding for future */ - void (*_clutter_entry_1) (void); - void (*_clutter_entry_2) (void); - void (*_clutter_entry_3) (void); - void (*_clutter_entry_4) (void); -}; - -GType clutter_entry_get_type (void) G_GNUC_CONST; - -ClutterActor * clutter_entry_new (void); -ClutterActor * clutter_entry_new_full (const gchar *font_name, - const gchar *text, - const ClutterColor *color); -ClutterActor * clutter_entry_new_with_text (const gchar *font_name, - const gchar *text); -void clutter_entry_set_text (ClutterEntry *entry, - const gchar *text); -G_CONST_RETURN gchar *clutter_entry_get_text (ClutterEntry *entry); -void clutter_entry_set_font_name (ClutterEntry *entry, - const gchar *font_name); -G_CONST_RETURN gchar *clutter_entry_get_font_name (ClutterEntry *entry); -void clutter_entry_set_color (ClutterEntry *entry, - const ClutterColor *color); -void clutter_entry_get_color (ClutterEntry *entry, - ClutterColor *color); -PangoLayout * clutter_entry_get_layout (ClutterEntry *entry); -void clutter_entry_set_alignment (ClutterEntry *entry, - PangoAlignment alignment); -PangoAlignment clutter_entry_get_alignment (ClutterEntry *entry); -void clutter_entry_set_cursor_position (ClutterEntry *entry, - gint position); -gint clutter_entry_get_cursor_position (ClutterEntry *entry); -void clutter_entry_insert_unichar (ClutterEntry *entry, - gunichar wc); -void clutter_entry_delete_chars (ClutterEntry *entry, - guint len); -void clutter_entry_insert_text (ClutterEntry *entry, - const gchar *text, - gssize position); -void clutter_entry_delete_text (ClutterEntry *entry, - gssize start_pos, - gssize end_pos); -void clutter_entry_set_visible_cursor (ClutterEntry *entry, - gboolean visible); -gboolean clutter_entry_get_visible_cursor (ClutterEntry *entry); - -void clutter_entry_set_visibility (ClutterEntry *entry, - gboolean visible); -gboolean clutter_entry_get_visibility (ClutterEntry *entry); -void clutter_entry_set_invisible_char (ClutterEntry *entry, - gunichar wc); -gunichar clutter_entry_get_invisible_char (ClutterEntry *entry); -void clutter_entry_set_max_length (ClutterEntry *entry, - gint max); -gint clutter_entry_get_max_length (ClutterEntry *entry); - -#ifndef CLUTTER_DISABLE_DEPRECATED -void clutter_entry_handle_key_event (ClutterEntry *entry, - ClutterKeyEvent *kev); -#endif - -G_END_DECLS - -#endif /* _HAVE_CLUTTER_ENTRY_H */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-enum-types.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-enum-types.c --- clutter-0.8.4/clutter/clutter-enum-types.c 2008-12-01 11:38:25.000000000 +0000 +++ clutter-0.9.0/clutter/clutter-enum-types.c 2009-01-29 12:41:11.000000000 +0000 @@ -40,6 +40,11 @@ { CLUTTER_BUTTON3_MASK, "CLUTTER_BUTTON3_MASK", "button3-mask" }, { CLUTTER_BUTTON4_MASK, "CLUTTER_BUTTON4_MASK", "button4-mask" }, { CLUTTER_BUTTON5_MASK, "CLUTTER_BUTTON5_MASK", "button5-mask" }, + { CLUTTER_SUPER_MASK, "CLUTTER_SUPER_MASK", "super-mask" }, + { CLUTTER_HYPER_MASK, "CLUTTER_HYPER_MASK", "hyper-mask" }, + { CLUTTER_META_MASK, "CLUTTER_META_MASK", "meta-mask" }, + { CLUTTER_RELEASE_MASK, "CLUTTER_RELEASE_MASK", "release-mask" }, + { CLUTTER_MODIFIER_MASK, "CLUTTER_MODIFIER_MASK", "modifier-mask" }, { 0, NULL, NULL } }; etype = g_flags_register_static (g_intern_static_string ("ClutterModifierType"), values); @@ -158,6 +163,27 @@ } return etype; } +/* enumerations from "./clutter-path.h" */ +#include "./clutter-path.h" +GType +clutter_path_node_type_get_type(void) { + static GType etype = 0; + if (G_UNLIKELY (!etype)) + { + static const GEnumValue values[] = { + { CLUTTER_PATH_MOVE_TO, "CLUTTER_PATH_MOVE_TO", "move-to" }, + { CLUTTER_PATH_LINE_TO, "CLUTTER_PATH_LINE_TO", "line-to" }, + { CLUTTER_PATH_CURVE_TO, "CLUTTER_PATH_CURVE_TO", "curve-to" }, + { CLUTTER_PATH_CLOSE, "CLUTTER_PATH_CLOSE", "close" }, + { CLUTTER_PATH_REL_MOVE_TO, "CLUTTER_PATH_REL_MOVE_TO", "rel-move-to" }, + { CLUTTER_PATH_REL_LINE_TO, "CLUTTER_PATH_REL_LINE_TO", "rel-line-to" }, + { CLUTTER_PATH_REL_CURVE_TO, "CLUTTER_PATH_REL_CURVE_TO", "rel-curve-to" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static (g_intern_static_string ("ClutterPathNodeType"), values); + } + return etype; +} /* enumerations from "./clutter-script.h" */ #include "./clutter-script.h" GType @@ -322,6 +348,65 @@ } return etype; } +GType +clutter_animation_mode_get_type(void) { + static GType etype = 0; + if (G_UNLIKELY (!etype)) + { + static const GEnumValue values[] = { + { CLUTTER_CUSTOM_MODE, "CLUTTER_CUSTOM_MODE", "custom-mode" }, + { CLUTTER_LINEAR, "CLUTTER_LINEAR", "linear" }, + { CLUTTER_EASE_IN_QUAD, "CLUTTER_EASE_IN_QUAD", "ease-in-quad" }, + { CLUTTER_EASE_OUT_QUAD, "CLUTTER_EASE_OUT_QUAD", "ease-out-quad" }, + { CLUTTER_EASE_IN_OUT_QUAD, "CLUTTER_EASE_IN_OUT_QUAD", "ease-in-out-quad" }, + { CLUTTER_EASE_IN_CUBIC, "CLUTTER_EASE_IN_CUBIC", "ease-in-cubic" }, + { CLUTTER_EASE_OUT_CUBIC, "CLUTTER_EASE_OUT_CUBIC", "ease-out-cubic" }, + { CLUTTER_EASE_IN_OUT_CUBIC, "CLUTTER_EASE_IN_OUT_CUBIC", "ease-in-out-cubic" }, + { CLUTTER_EASE_IN_QUART, "CLUTTER_EASE_IN_QUART", "ease-in-quart" }, + { CLUTTER_EASE_OUT_QUART, "CLUTTER_EASE_OUT_QUART", "ease-out-quart" }, + { CLUTTER_EASE_IN_OUT_QUART, "CLUTTER_EASE_IN_OUT_QUART", "ease-in-out-quart" }, + { CLUTTER_EASE_IN_QUINT, "CLUTTER_EASE_IN_QUINT", "ease-in-quint" }, + { CLUTTER_EASE_OUT_QUINT, "CLUTTER_EASE_OUT_QUINT", "ease-out-quint" }, + { CLUTTER_EASE_IN_OUT_QUINT, "CLUTTER_EASE_IN_OUT_QUINT", "ease-in-out-quint" }, + { CLUTTER_EASE_IN_SINE, "CLUTTER_EASE_IN_SINE", "ease-in-sine" }, + { CLUTTER_EASE_OUT_SINE, "CLUTTER_EASE_OUT_SINE", "ease-out-sine" }, + { CLUTTER_EASE_IN_OUT_SINE, "CLUTTER_EASE_IN_OUT_SINE", "ease-in-out-sine" }, + { CLUTTER_EASE_IN_EXPO, "CLUTTER_EASE_IN_EXPO", "ease-in-expo" }, + { CLUTTER_EASE_OUT_EXPO, "CLUTTER_EASE_OUT_EXPO", "ease-out-expo" }, + { CLUTTER_EASE_IN_OUT_EXPO, "CLUTTER_EASE_IN_OUT_EXPO", "ease-in-out-expo" }, + { CLUTTER_EASE_IN_CIRC, "CLUTTER_EASE_IN_CIRC", "ease-in-circ" }, + { CLUTTER_EASE_OUT_CIRC, "CLUTTER_EASE_OUT_CIRC", "ease-out-circ" }, + { CLUTTER_EASE_IN_OUT_CIRC, "CLUTTER_EASE_IN_OUT_CIRC", "ease-in-out-circ" }, + { CLUTTER_EASE_IN_ELASTIC, "CLUTTER_EASE_IN_ELASTIC", "ease-in-elastic" }, + { CLUTTER_EASE_OUT_ELASTIC, "CLUTTER_EASE_OUT_ELASTIC", "ease-out-elastic" }, + { CLUTTER_EASE_IN_OUT_ELASTIC, "CLUTTER_EASE_IN_OUT_ELASTIC", "ease-in-out-elastic" }, + { CLUTTER_EASE_IN_BACK, "CLUTTER_EASE_IN_BACK", "ease-in-back" }, + { CLUTTER_EASE_OUT_BACK, "CLUTTER_EASE_OUT_BACK", "ease-out-back" }, + { CLUTTER_EASE_IN_OUT_BACK, "CLUTTER_EASE_IN_OUT_BACK", "ease-in-out-back" }, + { CLUTTER_EASE_IN_BOUNCE, "CLUTTER_EASE_IN_BOUNCE", "ease-in-bounce" }, + { CLUTTER_EASE_OUT_BOUNCE, "CLUTTER_EASE_OUT_BOUNCE", "ease-out-bounce" }, + { CLUTTER_EASE_IN_OUT_BOUNCE, "CLUTTER_EASE_IN_OUT_BOUNCE", "ease-in-out-bounce" }, + { CLUTTER_ANIMATION_LAST, "CLUTTER_ANIMATION_LAST", "animation-last" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static (g_intern_static_string ("ClutterAnimationMode"), values); + } + return etype; +} +GType +clutter_font_flags_get_type(void) { + static GType etype = 0; + if (G_UNLIKELY (!etype)) + { + static const GFlagsValue values[] = { + { CLUTTER_FONT_MIPMAPPING, "CLUTTER_FONT_MIPMAPPING", "mipmapping" }, + { CLUTTER_FONT_HINTING, "CLUTTER_FONT_HINTING", "hinting" }, + { 0, NULL, NULL } + }; + etype = g_flags_register_static (g_intern_static_string ("ClutterFontFlags"), values); + } + return etype; +} /* Generated data ends here */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-enum-types.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-enum-types.h --- clutter-0.8.4/clutter/clutter-enum-types.h 2008-12-01 11:38:25.000000000 +0000 +++ clutter-0.9.0/clutter/clutter-enum-types.h 2009-01-29 12:41:11.000000000 +0000 @@ -36,6 +36,10 @@ GType clutter_init_error_get_type (void) G_GNUC_CONST; #define CLUTTER_TYPE_INIT_ERROR (clutter_init_error_get_type()) +/* enumerations from "./clutter-path.h" */ +GType clutter_path_node_type_get_type (void) G_GNUC_CONST; +#define CLUTTER_TYPE_PATH_NODE_TYPE (clutter_path_node_type_get_type()) + /* enumerations from "./clutter-script.h" */ GType clutter_script_error_get_type (void) G_GNUC_CONST; #define CLUTTER_TYPE_SCRIPT_ERROR (clutter_script_error_get_type()) @@ -71,6 +75,12 @@ GType clutter_request_mode_get_type (void) G_GNUC_CONST; #define CLUTTER_TYPE_REQUEST_MODE (clutter_request_mode_get_type()) +GType clutter_animation_mode_get_type (void) G_GNUC_CONST; +#define CLUTTER_TYPE_ANIMATION_MODE (clutter_animation_mode_get_type()) + +GType clutter_font_flags_get_type (void) G_GNUC_CONST; +#define CLUTTER_TYPE_FONT_FLAGS (clutter_font_flags_get_type()) + G_END_DECLS #endif /* !__CLUTTER_ENUM_TYPES_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-event.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-event.c --- clutter-0.8.4/clutter/clutter-event.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-event.c 2009-01-28 08:12:44.000000000 +0000 @@ -224,9 +224,9 @@ * clutter_key_event_symbol: * @keyev: A #ClutterKeyEvent * - * Retrieves the value of the key that caused @keyev. + * Retrieves the symbol of the key that caused @keyev. * - * Return value: The keysym representing the key + * Return value: The key symbol representing the key */ guint clutter_key_event_symbol (ClutterKeyEvent *keyev) @@ -273,7 +273,7 @@ /** * clutter_keysym_to_unicode: - * @keyval: a clutter key symbol + * @keyval: a key symbol * * Convert from a Clutter key symbol to the corresponding ISO10646 (Unicode) * character. @@ -412,19 +412,6 @@ new_event = clutter_event_new (CLUTTER_NOTHING); *new_event = *event; - /* deep copies or references must be added here */ - switch (new_event->type) - { - case CLUTTER_ENTER: - case CLUTTER_LEAVE: - if (new_event->crossing.related) - g_object_ref (new_event->crossing.related); - break; - - default: - break; - } - return new_event; } @@ -439,10 +426,6 @@ { if (G_LIKELY (event)) { - if ((event->type == CLUTTER_LEAVE || event->type == CLUTTER_ENTER) && - event->crossing.related) - g_object_unref (event->crossing.related); - g_slice_free (ClutterEvent, event); } } diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-event.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-event.h --- clutter-0.8.4/clutter/clutter-event.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-event.h 2009-01-28 08:12:44.000000000 +0000 @@ -21,8 +21,12 @@ * License along with this library. If not, see . */ -#ifndef _HAVE_CLUTTER_EVENT_H -#define _HAVE_CLUTTER_EVENT_H +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_EVENT_H__ +#define __CLUTTER_EVENT_H__ #include #include @@ -64,6 +68,11 @@ * @CLUTTER_BUTTON3_MASK: Mask applied by the third pointer button * @CLUTTER_BUTTON4_MASK: Mask applied by the fourth pointer button * @CLUTTER_BUTTON5_MASK: Mask applied by the fifth pointer button + * @CLUTTER_SUPER_MASK: Mask applied by the Super key + * @CLUTTER_HYPER_MASK: Mask applied by the Hyper key + * @CLUTTER_META_MASK: Mask applied by the Meta key + * @CLUTTER_RELEASE_MASK: Mask applied during release + * @CLUTTER_MODIFIER_MASK: A mask covering all modifier types * * Masks applied to a #ClutterEvent by modifiers. * @@ -82,7 +91,17 @@ CLUTTER_BUTTON2_MASK = 1 << 9, CLUTTER_BUTTON3_MASK = 1 << 10, CLUTTER_BUTTON4_MASK = 1 << 11, - CLUTTER_BUTTON5_MASK = 1 << 12 + CLUTTER_BUTTON5_MASK = 1 << 12, + + /* bits 15 to 25 are currently unused; bit 29 is used internally */ + + CLUTTER_SUPER_MASK = 1 << 26, + CLUTTER_HYPER_MASK = 1 << 27, + CLUTTER_META_MASK = 1 << 28, + + CLUTTER_RELEASE_MASK = 1 << 30, + + CLUTTER_MODIFIER_MASK = 0x5c001fff } ClutterModifierType; /** @@ -245,8 +264,8 @@ * @flags: event flags * @stage: event source stage * @source: event source actor - * @x: event X coordinate - * @y: event Y coordinate + * @x: event X coordinate, relative to the stage + * @y: event Y coordinate, relative to the stage * @modifier_state: button modifiers * @button: event button * @click_count: number of button presses within the default time @@ -254,7 +273,11 @@ * @axes: reserved for future use * @device: reserved for future use * - * Button event + * Button event. + * + * The event coordinates are relative to the stage that received the + * event, and can be transformed into actor-relative coordinates by + * using clutter_actor_transform_stage_point(). * * Since: 0.2 */ @@ -428,7 +451,7 @@ void clutter_event_get_coords (ClutterEvent *event, gint *x, gint *y); -gint clutter_event_get_device_id (ClutterEvent *event); +gint clutter_event_get_device_id (ClutterEvent *event); ClutterActor* clutter_event_get_source (ClutterEvent *event); guint clutter_key_event_symbol (ClutterKeyEvent *keyev); @@ -439,8 +462,8 @@ guint32 clutter_keysym_to_unicode (guint keyval); -ClutterStage* clutter_event_get_stage (ClutterEvent *event); +ClutterStage* clutter_event_get_stage (ClutterEvent *event); G_END_DECLS -#endif +#endif /* __CLUTTER_EVENT_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-feature.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-feature.h --- clutter-0.8.4/clutter/clutter-feature.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-feature.h 2009-01-28 08:12:44.000000000 +0000 @@ -18,10 +18,13 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ + +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + /** * SECTION:clutter-main * @short_description: Various 'global' clutter functions. @@ -30,8 +33,8 @@ * functions for mainloops, events and threads */ -#ifndef _HAVE_CLUTTER_FEATURE_H -#define _HAVE_CLUTTER_FEATURE_H +#ifndef __CLUTTER_FEATURE_H__ +#define __CLUTTER_FEATURE_H__ #include @@ -74,5 +77,4 @@ G_END_DECLS -#endif - +#endif /* __CLUTTER_FEATURE_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-fixed.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-fixed.c --- clutter-0.8.4/clutter/clutter-fixed.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-fixed.c 2009-01-28 08:12:44.000000000 +0000 @@ -65,1013 +65,11 @@ * * * Two fixed point numbers can only be multiplied and divided by the - * provided #CLUTTER_FIXED_MUL and #CLUTTER_FIXED_DIV macros. + * provided %CLUTTER_FIXED_MUL and %CLUTTER_FIXED_DIV macros. * * */ -/* pre-computed sin table for 1st quadrant - * - * Currently contains 257 entries. - * - * The current error (compared to system sin) is about - * 0.5% for values near the start of the table where the - * curve is steep, but improving rapidly. If this precission - * is not enough, we can increase the size of the table - */ -static ClutterFixed sin_tbl [] = -{ - 0x00000000L, 0x00000192L, 0x00000324L, 0x000004B6L, - 0x00000648L, 0x000007DAL, 0x0000096CL, 0x00000AFEL, - 0x00000C90L, 0x00000E21L, 0x00000FB3L, 0x00001144L, - 0x000012D5L, 0x00001466L, 0x000015F7L, 0x00001787L, - 0x00001918L, 0x00001AA8L, 0x00001C38L, 0x00001DC7L, - 0x00001F56L, 0x000020E5L, 0x00002274L, 0x00002402L, - 0x00002590L, 0x0000271EL, 0x000028ABL, 0x00002A38L, - 0x00002BC4L, 0x00002D50L, 0x00002EDCL, 0x00003067L, - 0x000031F1L, 0x0000337CL, 0x00003505L, 0x0000368EL, - 0x00003817L, 0x0000399FL, 0x00003B27L, 0x00003CAEL, - 0x00003E34L, 0x00003FBAL, 0x0000413FL, 0x000042C3L, - 0x00004447L, 0x000045CBL, 0x0000474DL, 0x000048CFL, - 0x00004A50L, 0x00004BD1L, 0x00004D50L, 0x00004ECFL, - 0x0000504DL, 0x000051CBL, 0x00005348L, 0x000054C3L, - 0x0000563EL, 0x000057B9L, 0x00005932L, 0x00005AAAL, - 0x00005C22L, 0x00005D99L, 0x00005F0FL, 0x00006084L, - 0x000061F8L, 0x0000636BL, 0x000064DDL, 0x0000664EL, - 0x000067BEL, 0x0000692DL, 0x00006A9BL, 0x00006C08L, - 0x00006D74L, 0x00006EDFL, 0x00007049L, 0x000071B2L, - 0x0000731AL, 0x00007480L, 0x000075E6L, 0x0000774AL, - 0x000078ADL, 0x00007A10L, 0x00007B70L, 0x00007CD0L, - 0x00007E2FL, 0x00007F8CL, 0x000080E8L, 0x00008243L, - 0x0000839CL, 0x000084F5L, 0x0000864CL, 0x000087A1L, - 0x000088F6L, 0x00008A49L, 0x00008B9AL, 0x00008CEBL, - 0x00008E3AL, 0x00008F88L, 0x000090D4L, 0x0000921FL, - 0x00009368L, 0x000094B0L, 0x000095F7L, 0x0000973CL, - 0x00009880L, 0x000099C2L, 0x00009B03L, 0x00009C42L, - 0x00009D80L, 0x00009EBCL, 0x00009FF7L, 0x0000A130L, - 0x0000A268L, 0x0000A39EL, 0x0000A4D2L, 0x0000A605L, - 0x0000A736L, 0x0000A866L, 0x0000A994L, 0x0000AAC1L, - 0x0000ABEBL, 0x0000AD14L, 0x0000AE3CL, 0x0000AF62L, - 0x0000B086L, 0x0000B1A8L, 0x0000B2C9L, 0x0000B3E8L, - 0x0000B505L, 0x0000B620L, 0x0000B73AL, 0x0000B852L, - 0x0000B968L, 0x0000BA7DL, 0x0000BB8FL, 0x0000BCA0L, - 0x0000BDAFL, 0x0000BEBCL, 0x0000BFC7L, 0x0000C0D1L, - 0x0000C1D8L, 0x0000C2DEL, 0x0000C3E2L, 0x0000C4E4L, - 0x0000C5E4L, 0x0000C6E2L, 0x0000C7DEL, 0x0000C8D9L, - 0x0000C9D1L, 0x0000CAC7L, 0x0000CBBCL, 0x0000CCAEL, - 0x0000CD9FL, 0x0000CE8EL, 0x0000CF7AL, 0x0000D065L, - 0x0000D14DL, 0x0000D234L, 0x0000D318L, 0x0000D3FBL, - 0x0000D4DBL, 0x0000D5BAL, 0x0000D696L, 0x0000D770L, - 0x0000D848L, 0x0000D91EL, 0x0000D9F2L, 0x0000DAC4L, - 0x0000DB94L, 0x0000DC62L, 0x0000DD2DL, 0x0000DDF7L, - 0x0000DEBEL, 0x0000DF83L, 0x0000E046L, 0x0000E107L, - 0x0000E1C6L, 0x0000E282L, 0x0000E33CL, 0x0000E3F4L, - 0x0000E4AAL, 0x0000E55EL, 0x0000E610L, 0x0000E6BFL, - 0x0000E76CL, 0x0000E817L, 0x0000E8BFL, 0x0000E966L, - 0x0000EA0AL, 0x0000EAABL, 0x0000EB4BL, 0x0000EBE8L, - 0x0000EC83L, 0x0000ED1CL, 0x0000EDB3L, 0x0000EE47L, - 0x0000EED9L, 0x0000EF68L, 0x0000EFF5L, 0x0000F080L, - 0x0000F109L, 0x0000F18FL, 0x0000F213L, 0x0000F295L, - 0x0000F314L, 0x0000F391L, 0x0000F40CL, 0x0000F484L, - 0x0000F4FAL, 0x0000F56EL, 0x0000F5DFL, 0x0000F64EL, - 0x0000F6BAL, 0x0000F724L, 0x0000F78CL, 0x0000F7F1L, - 0x0000F854L, 0x0000F8B4L, 0x0000F913L, 0x0000F96EL, - 0x0000F9C8L, 0x0000FA1FL, 0x0000FA73L, 0x0000FAC5L, - 0x0000FB15L, 0x0000FB62L, 0x0000FBADL, 0x0000FBF5L, - 0x0000FC3BL, 0x0000FC7FL, 0x0000FCC0L, 0x0000FCFEL, - 0x0000FD3BL, 0x0000FD74L, 0x0000FDACL, 0x0000FDE1L, - 0x0000FE13L, 0x0000FE43L, 0x0000FE71L, 0x0000FE9CL, - 0x0000FEC4L, 0x0000FEEBL, 0x0000FF0EL, 0x0000FF30L, - 0x0000FF4EL, 0x0000FF6BL, 0x0000FF85L, 0x0000FF9CL, - 0x0000FFB1L, 0x0000FFC4L, 0x0000FFD4L, 0x0000FFE1L, - 0x0000FFECL, 0x0000FFF5L, 0x0000FFFBL, 0x0000FFFFL, - 0x00010000L, -}; - -/* the difference of the angle for two adjacent values in the table - * expressed as ClutterFixed number - */ -#define CFX_SIN_STEP 0x00000192 - -/* */ -const double _magic = 68719476736.0 * 1.5; - -/* Where in the 64 bits of double is the mantisa */ -#if (__FLOAT_WORD_ORDER == 1234) -#define _CFX_MAN 0 -#elif (__FLOAT_WORD_ORDER == 4321) -#define _CFX_MAN 1 -#else -#define CFX_NO_FAST_CONVERSIONS -#endif - -/* - * clutter_double_to_fixed : - * @value: value to be converted - * - * A fast conversion from double precision floating to fixed point - * - * Return value: Fixed point representation of the value - * - * Since: 0.2 - */ -ClutterFixed -clutter_double_to_fixed (double val) -{ -#ifdef CFX_NO_FAST_CONVERSIONS - return (ClutterFixed)(val * (double)CFX_ONE); -#else - union - { - double d; - unsigned int i[2]; - } dbl; - - dbl.d = val; - dbl.d = dbl.d + _magic; - return dbl.i[_CFX_MAN]; -#endif -} - -/* - * clutter_double_to_int : - * @value: value to be converted - * - * A fast conversion from doulbe precision floatint point to int; - * used this instead of casting double/float to int. - * - * Return value: Integer part of the double - * - * Since: 0.2 - */ -gint -clutter_double_to_int (double val) -{ -#ifdef CFX_NO_FAST_CONVERSIONS - return (gint)(val); -#else - union - { - double d; - unsigned int i[2]; - } dbl; - - dbl.d = val; - dbl.d = dbl.d + _magic; - return ((int)dbl.i[_CFX_MAN]) >> 16; -#endif -} - -guint -clutter_double_to_uint (double val) -{ -#ifdef CFX_NO_FAST_CONVERSIONS - return (guint)(val); -#else - union - { - double d; - unsigned int i[2]; - } dbl; - - dbl.d = val; - dbl.d = dbl.d + _magic; - return (dbl.i[_CFX_MAN]) >> 16; -#endif -} - -#undef _CFX_MAN - -/** - * clutter_sinx: - * @angle: a #ClutterFixed angle in radians - * - * Fixed point implementation of sine function - * - * Return value: #ClutterFixed sine value. - * - * Since: 0.2 - */ -ClutterFixed -clutter_sinx (ClutterFixed angle) -{ - int sign = 1, indx1, indx2; - ClutterFixed low, high, d1, d2; - - /* convert negative angle to positive + sign */ - if ((int)angle < 0) - { - sign = 1 + ~sign; - angle = 1 + ~angle; - } - - /* reduce to <0, 2*pi) */ - angle = angle % CFX_2PI; - - /* reduce to first quadrant and sign */ - if (angle > CFX_PI) - { - sign = 1 + ~sign; - if (angle > CFX_PI + CFX_PI_2) - { - /* fourth qudrant */ - angle = CFX_2PI - angle; - } - else - { - /* third quadrant */ - angle -= CFX_PI; - } - } - else - { - if (angle > CFX_PI_2) - { - /* second quadrant */ - angle = CFX_PI - angle; - } - } - - /* Calculate indices of the two nearest values in our table - * and return weighted average - * - * Handle the end of the table gracefully - */ - indx1 = CLUTTER_FIXED_DIV (angle, CFX_SIN_STEP); - indx1 = CLUTTER_FIXED_TO_INT (indx1); - - if (indx1 == sizeof (sin_tbl)/sizeof (ClutterFixed) - 1) - { - indx2 = indx1; - indx1 = indx2 - 1; - } - else - { - indx2 = indx1 + 1; - } - - low = sin_tbl[indx1]; - high = sin_tbl[indx2]; - - d1 = angle - indx1 * CFX_SIN_STEP; - d2 = indx2 * CFX_SIN_STEP - angle; - - angle = ((low * d2 + high * d1) / (CFX_SIN_STEP)); - - if (sign < 0) - angle = (1 + ~angle); - - return angle; -} - -/** - * clutter_sini: - * @angle: a #ClutterAngle - * - * Very fast fixed point implementation of sine function. - * - * ClutterAngle is an integer such that 1024 represents - * full circle. - * - * Return value: #ClutterFixed sine value. - * - * Since: 0.2 - */ -ClutterFixed -clutter_sini (ClutterAngle angle) -{ - int sign = 1; - ClutterFixed result; - - /* reduce negative angle to positive + sign */ - if (angle < 0) - { - sign = 1 + ~sign; - angle = 1 + ~angle; - } - - /* reduce to <0, 2*pi) */ - angle &= 0x3ff; - - /* reduce to first quadrant and sign */ - if (angle > 512) - { - sign = 1 + ~sign; - if (angle > 768) - { - /* fourth qudrant */ - angle = 1024 - angle; - } - else - { - /* third quadrant */ - angle -= 512; - } - } - else - { - if (angle > 256) - { - /* second quadrant */ - angle = 512 - angle; - } - } - - result = sin_tbl[angle]; - - if (sign < 0) - result = (1 + ~result); - - return result; -} - -/* pre-computed tan table for 1st quadrant - * - * Currently contains 257 entries. - * - */ -static ClutterFixed tan_tbl [] = -{ - 0x00000000L, 0x00000192L, 0x00000324L, 0x000004b7L, - 0x00000649L, 0x000007dbL, 0x0000096eL, 0x00000b01L, - 0x00000c94L, 0x00000e27L, 0x00000fbaL, 0x0000114eL, - 0x000012e2L, 0x00001477L, 0x0000160cL, 0x000017a1L, - 0x00001937L, 0x00001acdL, 0x00001c64L, 0x00001dfbL, - 0x00001f93L, 0x0000212cL, 0x000022c5L, 0x0000245fL, - 0x000025f9L, 0x00002795L, 0x00002931L, 0x00002aceL, - 0x00002c6cL, 0x00002e0aL, 0x00002faaL, 0x0000314aL, - 0x000032ecL, 0x0000348eL, 0x00003632L, 0x000037d7L, - 0x0000397dL, 0x00003b24L, 0x00003cccL, 0x00003e75L, - 0x00004020L, 0x000041ccL, 0x00004379L, 0x00004528L, - 0x000046d8L, 0x0000488aL, 0x00004a3dL, 0x00004bf2L, - 0x00004da8L, 0x00004f60L, 0x0000511aL, 0x000052d5L, - 0x00005492L, 0x00005651L, 0x00005812L, 0x000059d5L, - 0x00005b99L, 0x00005d60L, 0x00005f28L, 0x000060f3L, - 0x000062c0L, 0x0000648fL, 0x00006660L, 0x00006834L, - 0x00006a0aL, 0x00006be2L, 0x00006dbdL, 0x00006f9aL, - 0x0000717aL, 0x0000735dL, 0x00007542L, 0x0000772aL, - 0x00007914L, 0x00007b02L, 0x00007cf2L, 0x00007ee6L, - 0x000080dcL, 0x000082d6L, 0x000084d2L, 0x000086d2L, - 0x000088d6L, 0x00008adcL, 0x00008ce7L, 0x00008ef4L, - 0x00009106L, 0x0000931bL, 0x00009534L, 0x00009750L, - 0x00009971L, 0x00009b95L, 0x00009dbeL, 0x00009febL, - 0x0000a21cL, 0x0000a452L, 0x0000a68cL, 0x0000a8caL, - 0x0000ab0eL, 0x0000ad56L, 0x0000afa3L, 0x0000b1f5L, - 0x0000b44cL, 0x0000b6a8L, 0x0000b909L, 0x0000bb70L, - 0x0000bdddL, 0x0000c04fL, 0x0000c2c7L, 0x0000c545L, - 0x0000c7c9L, 0x0000ca53L, 0x0000cce3L, 0x0000cf7aL, - 0x0000d218L, 0x0000d4bcL, 0x0000d768L, 0x0000da1aL, - 0x0000dcd4L, 0x0000df95L, 0x0000e25eL, 0x0000e52eL, - 0x0000e806L, 0x0000eae7L, 0x0000edd0L, 0x0000f0c1L, - 0x0000f3bbL, 0x0000f6bfL, 0x0000f9cbL, 0x0000fce1L, - 0x00010000L, 0x00010329L, 0x0001065dL, 0x0001099aL, - 0x00010ce3L, 0x00011036L, 0x00011394L, 0x000116feL, - 0x00011a74L, 0x00011df6L, 0x00012184L, 0x0001251fL, - 0x000128c6L, 0x00012c7cL, 0x0001303fL, 0x00013410L, - 0x000137f0L, 0x00013bdfL, 0x00013fddL, 0x000143ebL, - 0x00014809L, 0x00014c37L, 0x00015077L, 0x000154c9L, - 0x0001592dL, 0x00015da4L, 0x0001622eL, 0x000166ccL, - 0x00016b7eL, 0x00017045L, 0x00017523L, 0x00017a17L, - 0x00017f22L, 0x00018444L, 0x00018980L, 0x00018ed5L, - 0x00019445L, 0x000199cfL, 0x00019f76L, 0x0001a53aL, - 0x0001ab1cL, 0x0001b11dL, 0x0001b73fL, 0x0001bd82L, - 0x0001c3e7L, 0x0001ca71L, 0x0001d11fL, 0x0001d7f4L, - 0x0001def1L, 0x0001e618L, 0x0001ed6aL, 0x0001f4e8L, - 0x0001fc96L, 0x00020473L, 0x00020c84L, 0x000214c9L, - 0x00021d44L, 0x000225f9L, 0x00022ee9L, 0x00023818L, - 0x00024187L, 0x00024b3aL, 0x00025534L, 0x00025f78L, - 0x00026a0aL, 0x000274edL, 0x00028026L, 0x00028bb8L, - 0x000297a8L, 0x0002a3fbL, 0x0002b0b5L, 0x0002bdddL, - 0x0002cb79L, 0x0002d98eL, 0x0002e823L, 0x0002f740L, - 0x000306ecL, 0x00031730L, 0x00032816L, 0x000339a6L, - 0x00034bebL, 0x00035ef2L, 0x000372c6L, 0x00038776L, - 0x00039d11L, 0x0003b3a6L, 0x0003cb48L, 0x0003e40aL, - 0x0003fe02L, 0x00041949L, 0x000435f7L, 0x0004542bL, - 0x00047405L, 0x000495a9L, 0x0004b940L, 0x0004def6L, - 0x00050700L, 0x00053196L, 0x00055ef9L, 0x00058f75L, - 0x0005c35dL, 0x0005fb14L, 0x00063709L, 0x000677c0L, - 0x0006bdd0L, 0x000709ecL, 0x00075ce6L, 0x0007b7bbL, - 0x00081b98L, 0x000889e9L, 0x0009046eL, 0x00098d4dL, - 0x000a2736L, 0x000ad593L, 0x000b9cc6L, 0x000c828aL, - 0x000d8e82L, 0x000ecb1bL, 0x001046eaL, 0x00121703L, - 0x00145b00L, 0x0017448dL, 0x001b2672L, 0x002095afL, - 0x0028bc49L, 0x0036519aL, 0x00517bb6L, 0x00a2f8fdL, - 0x46d3eab2L, -}; - -/** - * clutter_tani: - * @angle: a #ClutterAngle - * - * Very fast fixed point implementation of tan function. - * - * ClutterAngle is an integer such that 1024 represents - * full circle. - * - * Return value: #ClutterFixed sine value. - * - * Since: 0.3 - */ -ClutterFixed -clutter_tani (ClutterAngle angle) -{ - int sign = 1; - ClutterFixed result; - - /* reduce negative angle to positive + sign */ - if (angle < 0) - { - sign = 1 + ~sign; - angle = 1 + ~angle; - } - - /* reduce to <0, pi) */ - angle &= 0x1ff; - - /* reduce to first quadrant and sign */ - if (angle > 256) - { - sign = 1 + ~sign; - angle = 512 - angle; - } - - result = tan_tbl[angle]; - - if (sign < 0) - result = (1 + ~result); - - return result; -} - -/* 257-value table of atan. atan_tbl[0] is atan(0.0) and atan_tbl[256] - is atan(1). The angles are radians in ClutterFixed - truncated to 16-bit (they're all less than one) */ -static guint16 atan_tbl[] = - { - 0x0000, 0x00FF, 0x01FF, 0x02FF, 0x03FF, 0x04FF, 0x05FF, 0x06FF, - 0x07FF, 0x08FF, 0x09FE, 0x0AFE, 0x0BFD, 0x0CFD, 0x0DFC, 0x0EFB, - 0x0FFA, 0x10F9, 0x11F8, 0x12F7, 0x13F5, 0x14F3, 0x15F2, 0x16F0, - 0x17EE, 0x18EB, 0x19E9, 0x1AE6, 0x1BE3, 0x1CE0, 0x1DDD, 0x1ED9, - 0x1FD5, 0x20D1, 0x21CD, 0x22C8, 0x23C3, 0x24BE, 0x25B9, 0x26B3, - 0x27AD, 0x28A7, 0x29A1, 0x2A9A, 0x2B93, 0x2C8B, 0x2D83, 0x2E7B, - 0x2F72, 0x306A, 0x3160, 0x3257, 0x334D, 0x3442, 0x3538, 0x362D, - 0x3721, 0x3815, 0x3909, 0x39FC, 0x3AEF, 0x3BE2, 0x3CD4, 0x3DC5, - 0x3EB6, 0x3FA7, 0x4097, 0x4187, 0x4277, 0x4365, 0x4454, 0x4542, - 0x462F, 0x471C, 0x4809, 0x48F5, 0x49E0, 0x4ACB, 0x4BB6, 0x4CA0, - 0x4D89, 0x4E72, 0x4F5B, 0x5043, 0x512A, 0x5211, 0x52F7, 0x53DD, - 0x54C2, 0x55A7, 0x568B, 0x576F, 0x5852, 0x5934, 0x5A16, 0x5AF7, - 0x5BD8, 0x5CB8, 0x5D98, 0x5E77, 0x5F55, 0x6033, 0x6110, 0x61ED, - 0x62C9, 0x63A4, 0x647F, 0x6559, 0x6633, 0x670C, 0x67E4, 0x68BC, - 0x6993, 0x6A6A, 0x6B40, 0x6C15, 0x6CEA, 0x6DBE, 0x6E91, 0x6F64, - 0x7036, 0x7108, 0x71D9, 0x72A9, 0x7379, 0x7448, 0x7516, 0x75E4, - 0x76B1, 0x777E, 0x7849, 0x7915, 0x79DF, 0x7AA9, 0x7B72, 0x7C3B, - 0x7D03, 0x7DCA, 0x7E91, 0x7F57, 0x801C, 0x80E1, 0x81A5, 0x8269, - 0x832B, 0x83EE, 0x84AF, 0x8570, 0x8630, 0x86F0, 0x87AF, 0x886D, - 0x892A, 0x89E7, 0x8AA4, 0x8B5F, 0x8C1A, 0x8CD5, 0x8D8E, 0x8E47, - 0x8F00, 0x8FB8, 0x906F, 0x9125, 0x91DB, 0x9290, 0x9345, 0x93F9, - 0x94AC, 0x955F, 0x9611, 0x96C2, 0x9773, 0x9823, 0x98D2, 0x9981, - 0x9A2F, 0x9ADD, 0x9B89, 0x9C36, 0x9CE1, 0x9D8C, 0x9E37, 0x9EE0, - 0x9F89, 0xA032, 0xA0DA, 0xA181, 0xA228, 0xA2CE, 0xA373, 0xA418, - 0xA4BC, 0xA560, 0xA602, 0xA6A5, 0xA746, 0xA7E8, 0xA888, 0xA928, - 0xA9C7, 0xAA66, 0xAB04, 0xABA1, 0xAC3E, 0xACDB, 0xAD76, 0xAE11, - 0xAEAC, 0xAF46, 0xAFDF, 0xB078, 0xB110, 0xB1A7, 0xB23E, 0xB2D5, - 0xB36B, 0xB400, 0xB495, 0xB529, 0xB5BC, 0xB64F, 0xB6E2, 0xB773, - 0xB805, 0xB895, 0xB926, 0xB9B5, 0xBA44, 0xBAD3, 0xBB61, 0xBBEE, - 0xBC7B, 0xBD07, 0xBD93, 0xBE1E, 0xBEA9, 0xBF33, 0xBFBC, 0xC046, - 0xC0CE, 0xC156, 0xC1DD, 0xC264, 0xC2EB, 0xC371, 0xC3F6, 0xC47B, - 0xC4FF, 0xC583, 0xC606, 0xC689, 0xC70B, 0xC78D, 0xC80E, 0xC88F, - 0xC90F - }; - -/** - * clutter_atani: - * @x: The tangent to calculate the angle for - * - * Fast fixed-point version of the arctangent function. - * - * Return value: The angle in radians represented as a #ClutterFixed - * for which the tangent is @x. - */ -ClutterFixed -clutter_atani (ClutterFixed x) -{ - gboolean negative = FALSE; - ClutterFixed angle; - - if (x < 0) - { - negative = TRUE; - x = -x; - } - - if (x > CFX_ONE) - /* if x > 1 then atan(x) = pi/2 - atan(1/x) */ - angle = CFX_PI / 2 - atan_tbl[CFX_QDIV (CFX_ONE, x) >> 8]; - else - angle = atan_tbl[x >> 8]; - - return negative ? -angle : angle; -} - -/** - * clutter_atan2i: - * @y: Numerator of tangent - * @x: Denominator of tangent - * - * Calculates the arctangent of @y / @x but uses the sign of both - * arguments to return the angle in right quadrant. - * - * Return value: The arctangent of @y / @x - */ -ClutterFixed -clutter_atan2i (ClutterFixed y, ClutterFixed x) -{ - ClutterFixed angle; - - if (x == 0) - angle = y >= 0 ? CFX_PI_2 : -CFX_PI_2; - else - { - angle = clutter_atani (CFX_QDIV (y, x)); - - if (x < 0) - angle += y >= 0 ? CFX_PI : -CFX_PI; - } - - return angle; -} - -ClutterFixed sqrt_tbl [] = -{ - 0x00000000L, 0x00010000L, 0x00016A0AL, 0x0001BB68L, - 0x00020000L, 0x00023C6FL, 0x00027312L, 0x0002A550L, - 0x0002D414L, 0x00030000L, 0x0003298BL, 0x0003510EL, - 0x000376CFL, 0x00039B05L, 0x0003BDDDL, 0x0003DF7CL, - 0x00040000L, 0x00041F84L, 0x00043E1EL, 0x00045BE1L, - 0x000478DEL, 0x00049524L, 0x0004B0BFL, 0x0004CBBCL, - 0x0004E624L, 0x00050000L, 0x00051959L, 0x00053237L, - 0x00054AA0L, 0x0005629AL, 0x00057A2BL, 0x00059159L, - 0x0005A828L, 0x0005BE9CL, 0x0005D4B9L, 0x0005EA84L, - 0x00060000L, 0x00061530L, 0x00062A17L, 0x00063EB8L, - 0x00065316L, 0x00066733L, 0x00067B12L, 0x00068EB4L, - 0x0006A21DL, 0x0006B54DL, 0x0006C847L, 0x0006DB0CL, - 0x0006ED9FL, 0x00070000L, 0x00071232L, 0x00072435L, - 0x0007360BL, 0x000747B5L, 0x00075935L, 0x00076A8CL, - 0x00077BBBL, 0x00078CC2L, 0x00079DA3L, 0x0007AE60L, - 0x0007BEF8L, 0x0007CF6DL, 0x0007DFBFL, 0x0007EFF0L, - 0x00080000L, 0x00080FF0L, 0x00081FC1L, 0x00082F73L, - 0x00083F08L, 0x00084E7FL, 0x00085DDAL, 0x00086D18L, - 0x00087C3BL, 0x00088B44L, 0x00089A32L, 0x0008A906L, - 0x0008B7C2L, 0x0008C664L, 0x0008D4EEL, 0x0008E361L, - 0x0008F1BCL, 0x00090000L, 0x00090E2EL, 0x00091C45L, - 0x00092A47L, 0x00093834L, 0x0009460CL, 0x000953CFL, - 0x0009617EL, 0x00096F19L, 0x00097CA1L, 0x00098A16L, - 0x00099777L, 0x0009A4C6L, 0x0009B203L, 0x0009BF2EL, - 0x0009CC47L, 0x0009D94FL, 0x0009E645L, 0x0009F32BL, - 0x000A0000L, 0x000A0CC5L, 0x000A1979L, 0x000A261EL, - 0x000A32B3L, 0x000A3F38L, 0x000A4BAEL, 0x000A5816L, - 0x000A646EL, 0x000A70B8L, 0x000A7CF3L, 0x000A8921L, - 0x000A9540L, 0x000AA151L, 0x000AAD55L, 0x000AB94BL, - 0x000AC534L, 0x000AD110L, 0x000ADCDFL, 0x000AE8A1L, - 0x000AF457L, 0x000B0000L, 0x000B0B9DL, 0x000B172DL, - 0x000B22B2L, 0x000B2E2BL, 0x000B3998L, 0x000B44F9L, - 0x000B504FL, 0x000B5B9AL, 0x000B66D9L, 0x000B720EL, - 0x000B7D37L, 0x000B8856L, 0x000B936AL, 0x000B9E74L, - 0x000BA973L, 0x000BB467L, 0x000BBF52L, 0x000BCA32L, - 0x000BD508L, 0x000BDFD5L, 0x000BEA98L, 0x000BF551L, - 0x000C0000L, 0x000C0AA6L, 0x000C1543L, 0x000C1FD6L, - 0x000C2A60L, 0x000C34E1L, 0x000C3F59L, 0x000C49C8L, - 0x000C542EL, 0x000C5E8CL, 0x000C68E0L, 0x000C732DL, - 0x000C7D70L, 0x000C87ACL, 0x000C91DFL, 0x000C9C0AL, - 0x000CA62CL, 0x000CB047L, 0x000CBA59L, 0x000CC464L, - 0x000CCE66L, 0x000CD861L, 0x000CE254L, 0x000CEC40L, - 0x000CF624L, 0x000D0000L, 0x000D09D5L, 0x000D13A2L, - 0x000D1D69L, 0x000D2727L, 0x000D30DFL, 0x000D3A90L, - 0x000D4439L, 0x000D4DDCL, 0x000D5777L, 0x000D610CL, - 0x000D6A9AL, 0x000D7421L, 0x000D7DA1L, 0x000D871BL, - 0x000D908EL, 0x000D99FAL, 0x000DA360L, 0x000DACBFL, - 0x000DB618L, 0x000DBF6BL, 0x000DC8B7L, 0x000DD1FEL, - 0x000DDB3DL, 0x000DE477L, 0x000DEDABL, 0x000DF6D8L, - 0x000E0000L, 0x000E0922L, 0x000E123DL, 0x000E1B53L, - 0x000E2463L, 0x000E2D6DL, 0x000E3672L, 0x000E3F70L, - 0x000E4869L, 0x000E515DL, 0x000E5A4BL, 0x000E6333L, - 0x000E6C16L, 0x000E74F3L, 0x000E7DCBL, 0x000E869DL, - 0x000E8F6BL, 0x000E9832L, 0x000EA0F5L, 0x000EA9B2L, - 0x000EB26BL, 0x000EBB1EL, 0x000EC3CBL, 0x000ECC74L, - 0x000ED518L, 0x000EDDB7L, 0x000EE650L, 0x000EEEE5L, - 0x000EF775L, 0x000F0000L, 0x000F0886L, 0x000F1107L, - 0x000F1984L, 0x000F21FCL, 0x000F2A6FL, 0x000F32DDL, - 0x000F3B47L, 0x000F43ACL, 0x000F4C0CL, 0x000F5468L, - 0x000F5CBFL, 0x000F6512L, 0x000F6D60L, 0x000F75AAL, - 0x000F7DEFL, 0x000F8630L, 0x000F8E6DL, 0x000F96A5L, - 0x000F9ED9L, 0x000FA709L, 0x000FAF34L, 0x000FB75BL, - 0x000FBF7EL, 0x000FC79DL, 0x000FCFB7L, 0x000FD7CEL, - 0x000FDFE0L, 0x000FE7EEL, 0x000FEFF8L, 0x000FF7FEL, - 0x00100000L, -}; - -/** - * clutter_sqrtx: - * @x: a #ClutterFixed - * - * A fixed point implementation of squre root - * - * Return value: #ClutterFixed square root. - * - * Since: 0.2 - */ -ClutterFixed -clutter_sqrtx (ClutterFixed x) -{ - /* The idea for this comes from the Alegro library, exploiting the - * fact that, - * sqrt (x) = sqrt (x/d) * sqrt (d); - * - * For d == 2^(n): - * - * sqrt (x) = sqrt (x/2^(2n)) * 2^n - * - * By locating suitable n for given x such that x >> 2n is in <0,255> - * we can use a LUT of precomputed values. - * - * This algorithm provides both good performance and precission; - * on ARM this function is about 5 times faster than c-lib sqrt, whilst - * producing errors < 1%. - * - */ - int t = 0; - int sh = 0; - unsigned int mask = 0x40000000; - unsigned fract = x & 0x0000ffff; - unsigned int d1, d2; - ClutterFixed v1, v2; - - if (x <= 0) - return 0; - - if (x > CFX_255 || x < CFX_ONE) - { - /* - * Find the highest bit set - */ -#if __arm__ - /* This actually requires at least arm v5, but gcc does not seem - * to set the architecture defines correctly, and it is I think - * very unlikely that anyone will want to use clutter on anything - * less than v5. - */ - int bit; - __asm__ ("clz %0, %1\n" - "rsb %0, %0, #31\n" - :"=r"(bit) - :"r" (x)); - - /* make even (2n) */ - bit &= 0xfffffffe; -#else - /* TODO -- add i386 branch using bshr - * - * NB: it's been said that the bshr instruction is poorly implemented - * and that it is possible to write a faster code in C using binary - * search -- at some point we should explore this - */ - int bit = 30; - while (bit >= 0) - { - if (x & mask) - break; - - mask = (mask >> 1 | mask >> 2); - bit -= 2; - } -#endif - - /* now bit indicates the highest bit set; there are two scenarios - * - * 1) bit < 23: Our number is smaller so we shift it left to maximase - * precision (< 16 really, since <16,23> never goes - * through here. - * - * 2) bit > 23: our number is above the table, so we shift right - */ - - sh = ((bit - 22) >> 1); - if (bit >= 8) - t = (x >> (16 - 22 + bit)); - else - t = (x << (22 - 16 - bit)); - } - else - { - t = CLUTTER_FIXED_TO_INT (x); - } - - /* Do a weighted average of the two nearest values */ - v1 = sqrt_tbl[t]; - v2 = sqrt_tbl[t+1]; - - /* - * 12 is fairly arbitrary -- we want integer that is not too big to cost - * us precission - */ - d1 = (unsigned)(fract) >> 12; - d2 = ((unsigned)CFX_ONE >> 12) - d1; - - x = ((v1*d2) + (v2*d1))/(CFX_ONE >> 12); - - if (sh > 0) - x = x << sh; - else if (sh < 0) - x = (x >> (1 + ~sh)); - - return x; -} - -/** - * clutter_sqrti: - * @x: integer value - * - * Very fast fixed point implementation of square root for integers. - * - * This function is at least 6x faster than clib sqrt() on x86, and (this is - * not a typo!) about 500x faster on ARM without FPU. It's error is < 5% - * for arguments < #CLUTTER_SQRTI_ARG_5_PERCENT and < 10% for arguments < - * #CLUTTER_SQRTI_ARG_10_PERCENT. The maximum argument that can be passed to - * this function is CLUTTER_SQRTI_ARG_MAX. - * - * Return value: integer square root. - * - * - * Since: 0.2 - */ -gint -clutter_sqrti (gint number) -{ -#if defined __SSE2__ - /* The GCC built-in with SSE2 (sqrtsd) is up to twice as fast as - * the pure integer code below. It is also more accurate. - */ - return __builtin_sqrt (number); -#else - /* This is a fixed point implementation of the Quake III sqrt algorithm, - * described, for example, at - * http://www.codemaestro.com/reviews/review00000105.html - * - * While the original QIII is extremely fast, the use of floating division - * and multiplication makes it perform very on arm processors without FPU. - * - * The key to successfully replacing the floating point operations with - * fixed point is in the choice of the fixed point format. The QIII - * algorithm does not calculate the square root, but its reciprocal ('y' - * below), which is only at the end turned to the inverse value. In order - * for the algorithm to produce satisfactory results, the reciprocal value - * must be represented with sufficient precission; the 16.16 we use - * elsewhere in clutter is not good enough, and 10.22 is used instead. - */ - ClutterFixed x; - guint32 y_1; /* 10.22 fixed point */ - guint32 f = 0x600000; /* '1.5' as 10.22 fixed */ - - union - { - float f; - guint32 i; - } flt, flt2; - - flt.f = number; - - x = CLUTTER_INT_TO_FIXED (number) / 2; - - /* The QIII initial estimate */ - flt.i = 0x5f3759df - ( flt.i >> 1 ); - - /* Now, we convert the float to 10.22 fixed. We exploit the mechanism - * described at http://www.d6.com/users/checker/pdfs/gdmfp.pdf. - * - * We want 22 bit fraction; a single precission float uses 23 bit - * mantisa, so we only need to add 2^(23-22) (no need for the 1.5 - * multiplier as we are only dealing with positive numbers). - * - * Note: we have to use two separate variables here -- for some reason, - * if we try to use just the flt variable, gcc on ARM optimises the whole - * addition out, and it all goes pear shape, since without it, the bits - * in the float will not be correctly aligned. - */ - flt2.f = flt.f + 2.0; - flt2.i &= 0x7FFFFF; - - /* Now we correct the estimate */ - y_1 = (flt2.i >> 11) * (flt2.i >> 11); - y_1 = (y_1 >> 8) * (x >> 8); - - y_1 = f - y_1; - flt2.i = (flt2.i >> 11) * (y_1 >> 11); - - /* If the original argument is less than 342, we do another - * iteration to improve precission (for arguments >= 342, the single - * iteration produces generally better results). - */ - if (x < 171) - { - y_1 = (flt2.i >> 11) * (flt2.i >> 11); - y_1 = (y_1 >> 8) * (x >> 8); - - y_1 = f - y_1; - flt2.i = (flt2.i >> 11) * (y_1 >> 11); - } - - /* Invert, round and convert from 10.22 to an integer - * 0x1e3c68 is a magical rounding constant that produces slightly - * better results than 0x200000. - */ - return (number * flt2.i + 0x1e3c68) >> 22; -#endif -} - -/** - * clutter_qmulx: - * @op1: #ClutterFixed - * @op2: #ClutterFixed - * - * Multiplies two fixed values using 64bit arithmetic; this provides - * significantly better precission than the #CLUTTER_FIXED_MUL macro, - * but at performance cost (about 2.7 times slowdown on ARMv5e, and 2 times - * on x86). - * - * Return value: the result of the operation - * - * Since: 0.4 - */ -ClutterFixed -clutter_qmulx (ClutterFixed op1, ClutterFixed op2) -{ -#ifdef __arm__ - /* This provides about 12% speedeup on the gcc -O2 optimised - * C version - * - * Based on code found in the following thread: - * http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2006-August/014405.html - */ - int res_low, res_hi; - - __asm__ ("smull %0, %1, %2, %3 \n" - "mov %0, %0, lsr %4 \n" - "add %1, %0, %1, lsl %5 \n" - : "=r"(res_hi), "=r"(res_low)\ - : "r"(op1), "r"(op2), "i"(CFX_Q), "i"(32-CFX_Q)); - - return (ClutterFixed) res_low; -#else - long long r = (long long) op1 * (long long) op2; - - return (unsigned int)(r >> CFX_Q); -#endif -} - -/** - * clutter_qdivx: - * @op1: #ClutterFixed - * @op2: #ClutterFixed - * - * Divides two fixed values using 64bit arithmetic; this provides - * significantly better precission than the #CLUTTER_FIXED_DIV macro, - * but at performance cost. - * - * Return value: #ClutterFixed - * - * Since: 0.4 - */ -ClutterFixed -clutter_qdivx (ClutterFixed op1, - ClutterFixed op2) -{ - return (ClutterFixed) ((((gint64) op1) << CFX_Q) / op2); -} - -/* - * The log2x() and pow2x() functions - * - * The implementation of the log2x() and pow2x() exploits the well-documented - * fact that the exponent part of IEEE floating number provides a good estimate - * of log2 of that number, while the mantisa serves as a good error-correction. - * - * The implemenation here uses a quadratic error correction as described by - * Ian Stephenson at http://www.dctsystems.co.uk/Software/power.html. - */ - -/** - * clutter_log2x : - * @x: value to calculate base 2 logarithm from - * - * Calculates base 2 logarithm. - * - * This function is some 2.5 times faster on x86, and over 12 times faster on - * fpu-less arm, than using libc log(). - * - * Return value: base 2 logarithm. - * - * Since: 0.4 - */ -ClutterFixed -clutter_log2x (guint x) -{ - /* Note: we could easily have a version for ClutterFixed x, but the int - * precission is enough for the current purposes. - */ - union - { - float f; - ClutterFixed i; - } flt; - - ClutterFixed magic = 0x58bb; - ClutterFixed y; - - /* - * Convert x to float, then extract exponent. - * - * We want the result to be 16.16 fixed, so we shift (23-16) bits only - */ - flt.f = x; - flt.i >>= 7; - flt.i -= CLUTTER_INT_TO_FIXED (127); - - y = CLUTTER_FIXED_FRACTION (flt.i); - - y = CFX_MUL ((y - CFX_MUL (y, y)), magic); - - return flt.i + y; -} - -/** - * clutter_pow2x : - * @x: exponent - * - * Calculates 2 to x power. - * - * This function is around 11 times faster on x86, and around 22 times faster - * on fpu-less arm than libc pow(2, x). - * - * Return value: 2 in x power. - * - * Since: 0.4 - */ -guint -clutter_pow2x (ClutterFixed x) -{ - /* Note: we could easily have a version that produces ClutterFixed result, - * but the the range would be limited to x < 15, and the int precission - * is enough for the current purposes. - */ - - union - { - float f; - guint32 i; - } flt; - - ClutterFixed magic = 0x56f7; - ClutterFixed y; - - flt.i = x; - - /* - * Reverse of the log2x function -- convert the fixed value to a suitable - * floating point exponent, and mantisa adjusted with quadratic error - * correction y. - */ - y = CLUTTER_FIXED_FRACTION (x); - y = CFX_MUL ((y - CFX_MUL (y, y)), magic); - - /* Shift the exponent into it's position in the floating point - * representation; as our number is not int but 16.16 fixed, shift only - * by (23 - 16) - */ - flt.i += (CLUTTER_INT_TO_FIXED (127) - y); - flt.i <<= 7; - - return CLUTTER_FLOAT_TO_UINT (flt.f); -} - - -/** - * clutter_powx : - * @x: base - * @y: #ClutterFixed exponent - * - * Calculates x to y power. (Note, if x is a constant it will be faster to - * calculate the power as clutter_pow2x (CLUTTER_FIXED_MUL(y, log2 (x))) - * - * Return value: x in y power. - * - * Since: 0.4 - */ -guint -clutter_powx (guint x, ClutterFixed y) -{ - return clutter_pow2x (CFX_MUL (y, clutter_log2x (x))); -} - static GTypeInfo _info = { 0, NULL, @@ -1132,7 +130,7 @@ clutter_value_transform_fixed_int (const GValue *src, GValue *dest) { - dest->data[0].v_int = CLUTTER_FIXED_TO_INT (src->data[0].v_int); + dest->data[0].v_int = (src->data[0].v_int); } static void @@ -1153,7 +151,7 @@ clutter_value_transform_int_fixed (const GValue *src, GValue *dest) { - dest->data[0].v_int = CLUTTER_INT_TO_FIXED (src->data[0].v_int); + dest->data[0].v_int = (float)(src->data[0].v_int); } static void @@ -1253,8 +251,8 @@ { ClutterParamSpecFixed *fspec = CLUTTER_PARAM_SPEC_FIXED (pspec); - fspec->minimum = CLUTTER_MINFIXED; - fspec->maximum = CLUTTER_MAXFIXED; + fspec->minimum = CLUTTER_MAXFIXED; + fspec->maximum = CLUTTER_MINFIXED; fspec->default_value = 0; } @@ -1270,7 +268,7 @@ GValue *value) { ClutterParamSpecFixed *fspec = CLUTTER_PARAM_SPEC_FIXED (pspec); - gint oval = CLUTTER_FIXED_TO_INT (value->data[0].v_int); + gint oval = (value->data[0].v_int); gint min, max, val; g_assert (CLUTTER_IS_PARAM_SPEC_FIXED (pspec)); @@ -1281,7 +279,7 @@ min = fspec->minimum; max = fspec->maximum; - val = CLUTTER_FIXED_TO_INT (value->data[0].v_int); + val = (value->data[0].v_int); val = CLAMP (val, min, max); if (val != oval) @@ -1346,12 +344,12 @@ * Since: 0.8 */ GParamSpec * -clutter_param_spec_fixed (const gchar *name, - const gchar *nick, - const gchar *blurb, - ClutterUnit minimum, - ClutterUnit maximum, - ClutterUnit default_value, +clutter_param_spec_fixed (const gchar *name, + const gchar *nick, + const gchar *blurb, + ClutterFixed minimum, + ClutterFixed maximum, + ClutterFixed default_value, GParamFlags flags) { ClutterParamSpecFixed *fspec; diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-fixed.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-fixed.h --- clutter-0.8.4/clutter/clutter-fixed.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-fixed.h 2009-01-28 08:12:44.000000000 +0000 @@ -19,15 +19,18 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ -#ifndef _HAVE_CLUTTER_FIXED_H -#define _HAVE_CLUTTER_FIXED_H +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_FIXED_H__ +#define __CLUTTER_FIXED_H__ #include +#include G_BEGIN_DECLS @@ -36,128 +39,118 @@ * * Fixed point number (16.16) */ -typedef gint32 ClutterFixed; +typedef float ClutterFixed; /** * ClutterAngle: * - * Integer representation of an angle such that 1024 corresponds to - * full circle (i.e., 2*Pi). + * An abstract representation of an angle. */ -typedef gint32 ClutterAngle; /* angle such that 1024 == 2*PI */ +typedef float ClutterAngle; -#define CLUTTER_ANGLE_FROM_DEG(x) (CLUTTER_FLOAT_TO_INT (((x) * 1024.0) / 360.0)) -#define CLUTTER_ANGLE_FROM_DEGF(x) (CLUTTER_FLOAT_TO_INT (((float)(x) * 1024.0f) / 360.0f)) -#define CLUTTER_ANGLE_FROM_DEGX(x) (CFX_INT((((x)/360)*1024) + CFX_HALF)) -#define CLUTTER_ANGLE_TO_DEG(x) (((x) * 360.0)/ 1024.0) -#define CLUTTER_ANGLE_TO_DEGF(x) (((float)(x) * 360.0)/ 1024.0) -#define CLUTTER_ANGLE_TO_DEGX(x) (CLUTTER_INT_TO_FIXED((x) * 45)/128) +#define CLUTTER_ANGLE_FROM_DEG(x) ((float)(x)) +#define CLUTTER_ANGLE_FROM_DEGX(x) (CLUTTER_FIXED_TO_FLOAT (x)) +#define CLUTTER_ANGLE_TO_DEG(x) ((float)(x)) +#define CLUTTER_ANGLE_TO_DEGX(x) (CLUTTER_FLOAT_TO_FIXED (x)) /* * some commonly used constants */ /** - * CFX_Q: - * - * Size in bits of decimal part of floating point value. - */ -#define CFX_Q 16 /* Decimal part size in bits */ - -/** * CFX_ONE: * * 1.0 represented as a fixed point value. */ -#define CFX_ONE (1 << CFX_Q) /* 1 */ +#define CFX_ONE 1.0 /** * CFX_HALF: * * 0.5 represented as a fixed point value. */ -#define CFX_HALF 32768 +#define CFX_HALF 0.5 /** * CFX_MAX: * * Maximum fixed point value. */ -#define CFX_MAX 0x7fffffff +#define CFX_MAX G_MAXFLOAT /** * CFX_MIN: * * Minimum fixed point value. */ -#define CFX_MIN 0x80000000 +#define CFX_MIN (-G_MAXFLOAT) /** * CFX_PI: * * Fixed point representation of Pi */ -#define CFX_PI 0x0003243f +#define CFX_PI G_PI /** * CFX_2PI: * * Fixed point representation of Pi*2 */ -#define CFX_2PI 0x0006487f +#define CFX_2PI (G_PI * 2) /** * CFX_PI_2: * * Fixed point representation of Pi/2 */ -#define CFX_PI_2 0x00019220 /* pi/2 */ +#define CFX_PI_2 (G_PI / 2) /** * CFX_PI_4: * * Fixed point representation of Pi/4 */ -#define CFX_PI_4 0x0000c910 /* pi/4 */ +#define CFX_PI_4 (G_PI / 4) /** * CFX_360: * * Fixed point representation of the number 360 */ -#define CFX_360 CLUTTER_INT_TO_FIXED (360) +#define CFX_360 360.0 /** * CFX_240: * * Fixed point representation of the number 240 */ -#define CFX_240 CLUTTER_INT_TO_FIXED (240) +#define CFX_240 240.0 /** * CFX_180: * * Fixed point representation of the number 180 */ -#define CFX_180 CLUTTER_INT_TO_FIXED (180) +#define CFX_180 180.0 /** * CFX_120: * * Fixed point representation of the number 120 */ -#define CFX_120 CLUTTER_INT_TO_FIXED (120) +#define CFX_120 120.0 /** * CFX_60: * * Fixed point representation of the number 60 */ -#define CFX_60 CLUTTER_INT_TO_FIXED (60) +#define CFX_60 60.0 /** * CFX_RADIANS_TO_DEGREES: * * Fixed point representation of the number 180 / pi */ -#define CFX_RADIANS_TO_DEGREES 0x394bb8 +#define CFX_RADIANS_TO_DEGREES (180.0 / G_PI) /** * CFX_255: * * Fixed point representation of the number 255 */ -#define CFX_255 CLUTTER_INT_TO_FIXED (255) +#define CFX_255 255.0 /** * CLUTTER_FIXED_TO_FLOAT: @@ -165,7 +158,7 @@ * * Convert a fixed point value to float. */ -#define CLUTTER_FIXED_TO_FLOAT(x) ((float) ((int)(x) / 65536.0)) +#define CLUTTER_FIXED_TO_FLOAT(x) (x) /** * CLUTTER_FIXED_TO_DOUBLE: @@ -173,7 +166,7 @@ * * Convert a fixed point value to double. */ -#define CLUTTER_FIXED_TO_DOUBLE(x) ((double) ((int)(x) / 65536.0)) +#define CLUTTER_FIXED_TO_DOUBLE(x) ((double)(x)) /** * CLUTTER_FLOAT_TO_FIXED: @@ -181,7 +174,7 @@ * * Convert a float value to fixed. */ -#define CLUTTER_FLOAT_TO_FIXED(x) (clutter_double_to_fixed ((x))) +#define CLUTTER_FLOAT_TO_FIXED(x) ((x)) /** * CLUTTER_FLOAT_TO_INT: @@ -189,7 +182,7 @@ * * Convert a float value to int. */ -#define CLUTTER_FLOAT_TO_INT(x) (clutter_double_to_int ((x))) +#define CLUTTER_FLOAT_TO_INT(x) ((int)(x)) /** * CLUTTER_FLOAT_TO_UINT: @@ -197,7 +190,7 @@ * * Convert a float value to unsigned int. */ -#define CLUTTER_FLOAT_TO_UINT(x) (clutter_double_to_uint ((x))) +#define CLUTTER_FLOAT_TO_UINT(x) ((unsigned int)(x)) /** * CLUTTER_INT_TO_FIXED: @@ -205,7 +198,7 @@ * * Convert an integer value to fixed point. */ -#define CLUTTER_INT_TO_FIXED(x) ((x) << CFX_Q) +#define CLUTTER_INT_TO_FIXED(x) ((float)(x)) /** * CLUTTER_FIXED_TO_INT: @@ -215,21 +208,7 @@ * * Since: 0.6 */ -#define CLUTTER_FIXED_TO_INT(x) ((x) >> CFX_Q) - -#ifndef CLUTTER_DISABLE_DEPRECATED - -/** - * CLUTTER_FIXED_INT: - * @x: a fixed point value - * - * Convert a fixed point value to integer (removing decimal part). - * - * Deprecated:0.6: Use %CLUTTER_FIXED_TO_INT instead - */ -#define CLUTTER_FIXED_INT(x) CLUTTER_FIXED_TO_INT((x)) - -#endif /* !CLUTTER_DISABLE_DEPRECATED */ +#define CLUTTER_FIXED_TO_INT(x) ((int)(x)) /** * CLUTTER_FIXED_FRACTION: @@ -237,7 +216,7 @@ * * Retrieves the fractionary part of a fixed point value */ -#define CLUTTER_FIXED_FRACTION(x) ((x) & ((1 << CFX_Q) - 1)) +#define CLUTTER_FIXED_FRACTION(x) ((x)-floorf (x)) /** * CLUTTER_FIXED_FLOOR: @@ -245,15 +224,15 @@ * * Round down a fixed point value to an integer. */ -#define CLUTTER_FIXED_FLOOR(x) (((x) >= 0) ? ((x) >> CFX_Q) \ - : ~((~(x)) >> CFX_Q)) +#define CLUTTER_FIXED_FLOOR(x) (floorf (x)) + /** * CLUTTER_FIXED_CEIL: * @x: a fixed point value * * Round up a fixed point value to an integer. */ -#define CLUTTER_FIXED_CEIL(x) (CLUTTER_FIXED_FLOOR (x + 0xffff)) +#define CLUTTER_FIXED_CEIL(x) (ceilf (x)) /** * CLUTTER_FIXED_MUL: @@ -262,7 +241,7 @@ * * Multiply two fixed point values */ -#define CLUTTER_FIXED_MUL(x,y) ((x) >> 8) * ((y) >> 8) +#define CLUTTER_FIXED_MUL(x,y) ((x) * (y)) /** * CLUTTER_FIXED_DIV: @@ -271,145 +250,16 @@ * * Divide two fixed point values */ -#define CLUTTER_FIXED_DIV(x,y) ((((x) << 8)/(y)) << 8) - -/* Some handy fixed point short aliases to avoid exessively long lines */ -/* FIXME: Remove from public API */ -/*< private >*/ -#define CFX_INT CLUTTER_FIXED_INT -#define CFX_MUL CLUTTER_FIXED_MUL -#define CFX_DIV CLUTTER_FIXED_DIV -#define CFX_QMUL(x,y) clutter_qmulx (x,y) -#define CFX_QDIV(x,y) clutter_qdivx (x,y) - -/*< public >*/ -/* Fixed point math routines */ -G_INLINE_FUNC -ClutterFixed clutter_qmulx (ClutterFixed op1, - ClutterFixed op2); -#if defined (G_CAN_INLINE) -G_INLINE_FUNC -ClutterFixed clutter_qmulx (ClutterFixed op1, - ClutterFixed op2) -{ -#ifdef __arm__ - int res_low, res_hi; - - __asm__ ("smull %0, %1, %2, %3 \n" - "mov %0, %0, lsr %4 \n" - "add %1, %0, %1, lsl %5 \n" - : "=r"(res_hi), "=r"(res_low)\ - : "r"(op1), "r"(op2), "i"(CFX_Q), "i"(32-CFX_Q)); - - return (ClutterFixed) res_low; -#else - long long r = (long long) op1 * (long long) op2; - - return (unsigned int)(r >> CFX_Q); -#endif -} -#endif - -G_INLINE_FUNC -ClutterFixed clutter_qdivx (ClutterFixed op1, - ClutterFixed op2); -#if defined (G_CAN_INLINE) -G_INLINE_FUNC -ClutterFixed clutter_qdivx (ClutterFixed op1, - ClutterFixed op2) -{ - return (ClutterFixed) ((((gint64) op1) << CFX_Q) / op2); -} -#endif - -ClutterFixed clutter_sinx (ClutterFixed angle); -ClutterFixed clutter_sini (ClutterAngle angle); - -ClutterFixed clutter_tani (ClutterAngle angle); - -ClutterFixed clutter_atani (ClutterFixed x); -ClutterFixed clutter_atan2i (ClutterFixed y, ClutterFixed x); - -/* convenience macros for the cos functions */ - -/** - * clutter_cosx: - * @angle: a #ClutterFixed angle in radians - * - * Fixed point cosine function - * - * Return value: #ClutterFixed cosine value. - * - * Note: Implemneted as a macro. - * - * Since: 0.2 - */ -#define clutter_cosx(angle) (clutter_sinx((angle) + CFX_PI_2)) - -/** - * clutter_cosi: - * @angle: a #ClutterAngle angle - * - * Very fast fixed point implementation of cosine function. - * - * ClutterAngle is an integer such that 1024 represents - * full circle. - * - * Return value: #ClutterFixed cosine value. - * - * Note: Implemneted as a macro. - * - * Since: 0.2 - */ -#define clutter_cosi(angle) (clutter_sini ((angle) + 256)) - -/** - * CLUTTER_SQRTI_ARG_MAX - * - * Maximum argument that can be passed to #clutter_sqrti function. - * - * Since: 0.6 - */ -#ifndef __SSE2__ -#define CLUTTER_SQRTI_ARG_MAX 0x3fffff -#else -#define CLUTTER_SQRTI_ARG_MAX INT_MAX -#endif - -/** - * CLUTTER_SQRTI_ARG_5_PERCENT - * - * Maximum argument that can be passed to #clutter_sqrti for which the - * resulting error is < 5% - * - * Since: 0.6 - */ -#ifndef __SSE2__ -#define CLUTTER_SQRTI_ARG_5_PERCENT 210 -#else -#define CLUTTER_SQRTI_ARG_5_PERCENT INT_MAX -#endif - -/** - * CLUTTER_SQRTI_ARG_10_PERCENT - * - * Maximum argument that can be passed to #clutter_sqrti for which the - * resulting error is < 10% - * - * Since: 0.6 - */ -#ifndef __SSE2__ -#define CLUTTER_SQRTI_ARG_10_PERCENT 5590 -#else -#define CLUTTER_SQRTI_ARG_10_PERCENT INT_MAX -#endif +#define CLUTTER_FIXED_DIV(x,y) ((x) / (y)) -ClutterFixed clutter_sqrtx (ClutterFixed x); -gint clutter_sqrti (gint x); +#define clutter_qmulx(x,y) ((x) * (y)) +#define clutter_qdivx(x,y) ((x) / (y)) -ClutterFixed clutter_log2x (guint x); -guint clutter_pow2x (ClutterFixed x); -guint clutter_powx (guint x, ClutterFixed y); +#define clutter_sinx(a) sinf (a * (G_PI/180.0)) +#define clutter_tanx(a) tanf (a * (G_PI/180.0)) +#define clutter_atanx(a) atanf (a * (G_PI/180.0)) +#define clutter_atan2x(x,y) atan2f (x, y) +#define clutter_cosx(a) cosf (a * (G_PI/180.0)) #define CLUTTER_TYPE_FIXED (clutter_fixed_get_type ()) #define CLUTTER_TYPE_PARAM_FIXED (clutter_param_fixed_get_type ()) @@ -435,7 +285,7 @@ * * Since: 0.8 */ -#define CLUTTER_MAXFIXED CFX_MAX +#define CLUTTER_MAXFIXED G_MAXFLOAT /** * CLUTTER_MINFIXED: @@ -444,7 +294,7 @@ * * Since: 0.8 */ -#define CLUTTER_MINFIXED CFX_MIN +#define CLUTTER_MINFIXED (-G_MAXFLOAT) /** * ClutterParamSpecFixed @@ -482,11 +332,7 @@ ClutterFixed default_value, GParamFlags flags); -/* */ -extern ClutterFixed clutter_double_to_fixed (double value); -extern gint clutter_double_to_int (double value); -extern guint clutter_double_to_unit (double value); G_END_DECLS -#endif /* _HAVE_CLUTTER_FIXED_H */ +#endif /* __CLUTTER_FIXED_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-frame-source.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-frame-source.h --- clutter-0.8.4/clutter/clutter-frame-source.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-frame-source.h 2009-01-28 08:12:44.000000000 +0000 @@ -18,13 +18,15 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ -#ifndef _CLUTTER_FRAME_SOURCE_H -#define _CLUTTER_FRAME_SOURCE_H +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_FRAME_SOURCE_H__ +#define __CLUTTER_FRAME_SOURCE_H__ #include @@ -42,4 +44,4 @@ G_END_DECLS -#endif /* _CLUTTER_FRAME_SOURCE_H */ +#endif /* __CLUTTER_FRAME_SOURCE_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-group.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-group.c --- clutter-0.8.4/clutter/clutter-group.c 2008-11-26 16:46:19.000000000 +0000 +++ clutter-0.9.0/clutter/clutter-group.c 2009-01-28 08:12:44.000000000 +0000 @@ -569,7 +569,7 @@ priv->children = g_list_sort (priv->children, sort_z_order); - if (CLUTTER_ACTOR_IS_VISIBLE (CLUTTER_ACTOR (self))) + if (CLUTTER_ACTOR_IS_VISIBLE (self)) clutter_actor_queue_redraw (CLUTTER_ACTOR (self)); } diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-group.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-group.h --- clutter-0.8.4/clutter/clutter-group.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-group.h 2009-01-28 08:12:44.000000000 +0000 @@ -18,11 +18,13 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __CLUTTER_GROUP_H__ #define __CLUTTER_GROUP_H__ @@ -92,6 +94,7 @@ gint clutter_group_get_n_children (ClutterGroup *self); void clutter_group_remove_all (ClutterGroup *group); +/* for Mr. Mallum */ #define clutter_group_add(group,actor) G_STMT_START { \ if (CLUTTER_IS_GROUP ((group)) && CLUTTER_IS_ACTOR ((actor))) \ { \ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter.h --- clutter-0.8.4/clutter/clutter.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter.h 2009-01-28 16:45:24.000000000 +0000 @@ -23,46 +23,53 @@ * Boston, MA 02111-1307, USA. */ -#ifndef _HAVE_CLUTTER_H -#define _HAVE_CLUTTER_H +#ifndef __CLUTTER_H__ +#define __CLUTTER_H__ + +#define __CLUTTER_H_INSIDE__ #include "clutter-actor.h" #include "clutter-alpha.h" +#include "clutter-animatable.h" +#include "clutter-animation.h" #include "clutter-backend.h" -#include "clutter-color.h" -#include "clutter-container.h" -#include "clutter-behaviour.h" -#include "clutter-behaviour-bspline.h" #include "clutter-behaviour-depth.h" #include "clutter-behaviour-ellipse.h" +#include "clutter-behaviour.h" #include "clutter-behaviour-opacity.h" #include "clutter-behaviour-path.h" #include "clutter-behaviour-rotate.h" #include "clutter-behaviour-scale.h" +#include "clutter-binding-pool.h" +#include "clutter-cairo-texture.h" #include "clutter-child-meta.h" -#include "clutter-clone-texture.h" +#include "clutter-clone.h" +#include "clutter-color.h" +#include "clutter-container.h" #include "clutter-deprecated.h" -#include "clutter-effect.h" -#include "clutter-entry.h" #include "clutter-event.h" #include "clutter-feature.h" -#include "clutter-rectangle.h" +#include "clutter-frame-source.h" #include "clutter-group.h" +#include "clutter-interval.h" #include "clutter-keysyms.h" -#include "clutter-label.h" #include "clutter-list-model.h" #include "clutter-main.h" #include "clutter-media.h" #include "clutter-model.h" +#include "clutter-path.h" +#include "clutter-rectangle.h" +#include "clutter-score.h" +#include "clutter-scriptable.h" +#include "clutter-script.h" +#include "clutter-shader.h" +#include "clutter-shader-types.h" #include "clutter-stage.h" #include "clutter-stage-manager.h" #include "clutter-texture.h" -#include "clutter-frame-source.h" -#include "clutter-timeout-pool.h" +#include "clutter-text.h" #include "clutter-timeline.h" -#include "clutter-score.h" -#include "clutter-script.h" -#include "clutter-scriptable.h" +#include "clutter-timeout-pool.h" #include "clutter-types.h" #include "clutter-units.h" #include "clutter-util.h" @@ -70,4 +77,6 @@ #include "clutter-enum-types.h" -#endif +#undef __CLUTTER_H_INSIDE__ + +#endif /* __CLUTTER_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-id-pool.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-id-pool.h --- clutter-0.8.4/clutter/clutter-id-pool.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-id-pool.h 2009-01-28 08:12:44.000000000 +0000 @@ -18,9 +18,7 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . * * ClutterIDPool: pool of reusable integer ids associated with pointers. * diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-interval.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-interval.c --- clutter-0.8.4/clutter/clutter-interval.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-interval.c 2009-01-28 08:12:44.000000000 +0000 @@ -0,0 +1,975 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Copyright (C) 2008 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 . + * + * Author: + * Emmanuele Bassi + */ + +/** + * SECTION:clutter-interval + * @short_description: An object holding an interval of two values + * + * #ClutterInterval is a simple object that can hold two values + * defining an interval. #ClutterInterval can hold any value that + * can be enclosed inside a #GValue. + * + * Once a #ClutterInterval for a specific #GType has been instantiated + * the #ClutterInterval:value-type property cannot be changed anymore. + * + * #ClutterInterval starts with a floating reference; this means that + * any object taking a reference on a #ClutterInterval instance should + * also take ownership of the interval by using g_object_ref_sink(). + * + * #ClutterInterval is used by #ClutterAnimation to define the + * interval of values that an implicit animation should tween over. + * + * #ClutterInterval can be subclassed to override the validation + * and value computation. + * + * #ClutterInterval is available since Clutter 1.0 + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include +#include +#include + +#include "clutter-color.h" +#include "clutter-fixed.h" +#include "clutter-interval.h" +#include "clutter-units.h" + +typedef struct +{ + GType value_type; + ClutterProgressFunc func; +} ProgressData; + +static GHashTable *progress_funcs = NULL; + +enum +{ + PROP_0, + + PROP_VALUE_TYPE +}; + +#define CLUTTER_INTERVAL_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_INTERVAL, ClutterIntervalPrivate)) + +struct _ClutterIntervalPrivate +{ + GType value_type; + + GValue *values; +}; + +G_DEFINE_TYPE (ClutterInterval, clutter_interval, G_TYPE_INITIALLY_UNOWNED); + +static gboolean +clutter_interval_real_validate (ClutterInterval *interval, + GParamSpec *pspec) +{ + GType pspec_gtype = G_PARAM_SPEC_VALUE_TYPE (pspec); + + /* check the GTypes we provide first */ + if (pspec_gtype == CLUTTER_TYPE_UNIT) + { + ClutterParamSpecUnit *pspec_unit = CLUTTER_PARAM_SPEC_UNIT (pspec); + ClutterFixed a, b; + + a = b = 0; + clutter_interval_get_interval (interval, &a, &b); + if ((a >= pspec_unit->minimum && a <= pspec_unit->maximum) && + (b >= pspec_unit->minimum && b <= pspec_unit->maximum)) + return TRUE; + else + return FALSE; + } + else if (pspec_gtype == CLUTTER_TYPE_FIXED) + { + ClutterParamSpecFixed *pspec_fixed = CLUTTER_PARAM_SPEC_FIXED (pspec); + ClutterFixed a, b; + + a = b = 0; + clutter_interval_get_interval (interval, &a, &b); + if ((a >= pspec_fixed->minimum && a <= pspec_fixed->maximum) && + (b >= pspec_fixed->minimum && b <= pspec_fixed->maximum)) + return TRUE; + else + return FALSE; + } + + /* then check the fundamental types */ + switch (G_TYPE_FUNDAMENTAL (pspec_gtype)) + { + case G_TYPE_INT: + { + GParamSpecInt *pspec_int = G_PARAM_SPEC_INT (pspec); + gint a, b; + + a = b = 0; + clutter_interval_get_interval (interval, &a, &b); + if ((a >= pspec_int->minimum && a <= pspec_int->maximum) && + (b >= pspec_int->minimum && b <= pspec_int->maximum)) + return TRUE; + else + return FALSE; + } + break; + + case G_TYPE_UINT: + { + GParamSpecUInt *pspec_uint = G_PARAM_SPEC_UINT (pspec); + guint a, b; + + a = b = 0; + clutter_interval_get_interval (interval, &a, &b); + if ((a >= pspec_uint->minimum && a <= pspec_uint->maximum) && + (b >= pspec_uint->minimum && b <= pspec_uint->maximum)) + return TRUE; + else + return FALSE; + } + break; + + case G_TYPE_UCHAR: + { + GParamSpecUChar *pspec_uchar = G_PARAM_SPEC_UCHAR (pspec); + guchar a, b; + + a = b = 0; + clutter_interval_get_interval (interval, &a, &b); + if ((a >= pspec_uchar->minimum && a <= pspec_uchar->maximum) && + (b >= pspec_uchar->minimum && b <= pspec_uchar->maximum)) + return TRUE; + else + return FALSE; + } + break; + + case G_TYPE_BOOLEAN: + return TRUE; + + default: + break; + } + + return TRUE; +} + +static gboolean +clutter_interval_real_compute_value (ClutterInterval *interval, + gdouble factor, + GValue *value) +{ + GValue *initial, *final; + GType value_type; + gboolean retval = FALSE; + + initial = clutter_interval_peek_initial_value (interval); + final = clutter_interval_peek_final_value (interval); + + value_type = clutter_interval_get_value_type (interval); + + if (G_UNLIKELY (progress_funcs != NULL)) + { + ProgressData *p_data; + + p_data = + g_hash_table_lookup (progress_funcs, GUINT_TO_POINTER (value_type)); + + /* if we have a progress function, and that function was + * successful in computing the progress, then we bail out + * as fast as we can + */ + if (p_data != NULL) + { + retval = p_data->func (initial, final, factor, value); + if (retval) + return retval; + } + } + + switch (G_TYPE_FUNDAMENTAL (value_type)) + { + case G_TYPE_INT: + { + gint ia, ib, res; + + ia = g_value_get_int (initial); + ib = g_value_get_int (final); + + res = (factor * (ib - ia)) + ia; + + g_value_set_int (value, res); + + retval = TRUE; + } + break; + + case G_TYPE_UINT: + { + guint ia, ib, res; + + ia = g_value_get_uint (initial); + ib = g_value_get_uint (final); + + res = (factor * (ib - (gdouble) ia)) + ia; + + g_value_set_uint (value, res); + + retval = TRUE; + } + break; + + case G_TYPE_UCHAR: + { + guchar ia, ib, res; + + ia = g_value_get_uchar (initial); + ib = g_value_get_uchar (final); + + res = (factor * (ib - (gdouble) ia)) + ia; + + g_value_set_uchar (value, res); + + retval = TRUE; + } + break; + + case G_TYPE_FLOAT: + case G_TYPE_DOUBLE: + { + gdouble ia, ib, res; + + ia = g_value_get_double (initial); + ib = g_value_get_double (final); + + res = (factor * (ib - ia)) + ia; + + if (value_type == G_TYPE_DOUBLE) + g_value_set_double (value, res); + else + g_value_set_float (value, res); + + retval = TRUE; + } + break; + + case G_TYPE_BOOLEAN: + if (CLUTTER_FLOAT_TO_FIXED (factor) > 0.5) + g_value_set_boolean (value, TRUE); + else + g_value_set_boolean (value, FALSE); + + retval = TRUE; + break; + + case G_TYPE_BOXED: + if (value_type == CLUTTER_TYPE_COLOR) + { + const ClutterColor *ia, *ib; + ClutterColor res = { 0, }; + + ia = clutter_value_get_color (initial); + ib = clutter_value_get_color (final); + + res.red = (factor * (ib->red - (gdouble) ia->red)) + ia->red; + res.green = (factor * (ib->green - (gdouble) ia->green)) + ia->green; + res.blue = (factor * (ib->blue - (gdouble) ia->blue)) + ia->blue; + res.alpha = (factor * (ib->alpha - (gdouble) ia->alpha)) + ia->alpha; + + clutter_value_set_color (value, &res); + + retval = TRUE; + } + break; + + default: + break; + } + + return retval; +} + +static void +clutter_interval_finalize (GObject *gobject) +{ + ClutterIntervalPrivate *priv = CLUTTER_INTERVAL (gobject)->priv; + + g_value_unset (&priv->values[0]); + g_value_unset (&priv->values[1]); + + g_free (priv->values); +} + +static void +clutter_interval_set_property (GObject *gobject, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + ClutterIntervalPrivate *priv = CLUTTER_INTERVAL_GET_PRIVATE (gobject); + + switch (prop_id) + { + case PROP_VALUE_TYPE: + priv->value_type = g_value_get_gtype (value); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +clutter_interval_get_property (GObject *gobject, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + ClutterIntervalPrivate *priv = CLUTTER_INTERVAL_GET_PRIVATE (gobject); + + switch (prop_id) + { + case PROP_VALUE_TYPE: + g_value_set_gtype (value, priv->value_type); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +clutter_interval_class_init (ClutterIntervalClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GParamSpec *pspec; + + g_type_class_add_private (klass, sizeof (ClutterIntervalPrivate)); + + klass->validate = clutter_interval_real_validate; + klass->compute_value = clutter_interval_real_compute_value; + + gobject_class->set_property = clutter_interval_set_property, + gobject_class->get_property = clutter_interval_get_property; + gobject_class->finalize = clutter_interval_finalize; + + /** + * ClutterInterval:value-type: + * + * The type of the values in the interval. + * + * Since: 1.0 + */ + pspec = g_param_spec_gtype ("value-type", + "Value Type", + "The type of the values in the interval", + G_TYPE_NONE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); + g_object_class_install_property (gobject_class, PROP_VALUE_TYPE, pspec); +} + +static void +clutter_interval_init (ClutterInterval *self) +{ + ClutterIntervalPrivate *priv; + + self->priv = priv = CLUTTER_INTERVAL_GET_PRIVATE (self); + + priv->value_type = G_TYPE_INVALID; + priv->values = g_malloc0 (sizeof (GValue) * 2); +} + +static void +clutter_interval_set_interval_valist (ClutterInterval *interval, + va_list var_args) +{ + GType gtype = interval->priv->value_type; + GValue value = { 0, }; + gchar *error; + + /* initial value */ + g_value_init (&value, gtype); + G_VALUE_COLLECT (&value, var_args, 0, &error); + if (error) + { + g_warning ("%s: %s", G_STRLOC, error); + + /* we leak the value here as it might not be in a valid state + * given the error and calling g_value_unset() might lead to + * undefined behaviour + */ + g_free (error); + return; + } + + clutter_interval_set_initial_value (interval, &value); + g_value_unset (&value); + + /* final value */ + g_value_init (&value, gtype); + G_VALUE_COLLECT (&value, var_args, 0, &error); + if (error) + { + g_warning ("%s: %s", G_STRLOC, error); + + /* see above */ + g_free (error); + return; + } + + clutter_interval_set_final_value (interval, &value); + g_value_unset (&value); +} + +static void +clutter_interval_get_interval_valist (ClutterInterval *interval, + va_list var_args) +{ + GType gtype = interval->priv->value_type; + GValue value = { 0, }; + gchar *error; + + /* initial value */ + g_value_init (&value, gtype); + clutter_interval_get_initial_value (interval, &value); + G_VALUE_LCOPY (&value, var_args, 0, &error); + if (error) + { + g_warning ("%s: %s", G_STRLOC, error); + g_free (error); + g_value_unset (&value); + return; + } + + g_value_unset (&value); + + /* final value */ + g_value_init (&value, gtype); + clutter_interval_get_final_value (interval, &value); + G_VALUE_LCOPY (&value, var_args, 0, &error); + if (error) + { + g_warning ("%s: %s", G_STRLOC, error); + g_free (error); + g_value_unset (&value); + return; + } + + g_value_unset (&value); +} + +/** + * clutter_interval_new: + * @gtype: the type of the values in the interval + * @Varargs: the initial value and the final value of the interval + * + * Creates a new #ClutterInterval holding values of type @gtype. + * + * This function avoids using a #GValue for the initial and final values + * of the interval: + * + * |[ + * interval = clutter_interval_new (G_TYPE_FLOAT, 0.0, 1.0); + * interval = clutter_interval_new (G_TYPE_BOOLEAN, FALSE, TRUE); + * interval = clutter_interval_new (G_TYPE_INT, 0, 360); + * ]| + * + * Return value: the newly created #ClutterInterval + * + * Since: 1.0 + */ +ClutterInterval * +clutter_interval_new (GType gtype, + ...) +{ + ClutterInterval *retval; + va_list args; + + g_return_val_if_fail (gtype != G_TYPE_INVALID, NULL); + + retval = g_object_new (CLUTTER_TYPE_INTERVAL, "value-type", gtype, NULL); + + va_start (args, gtype); + clutter_interval_set_interval_valist (retval, args); + va_end (args); + + return retval; +} + +/** + * clutter_interval_new_with_values: + * @gtype: the type of the values in the interval + * @initial: a #GValue holding the initial value of the interval + * @final: a #GValue holding the final value of the interval + * + * Creates a new #ClutterInterval of type @gtype, between @initial + * and @final. + * + * This function is useful for language bindings. + * + * Return value: the newly created #ClutterInterval + * + * Since: 1.0 + */ +ClutterInterval * +clutter_interval_new_with_values (GType gtype, + const GValue *initial, + const GValue *final) +{ + ClutterInterval *retval; + + g_return_val_if_fail (gtype != G_TYPE_INVALID, NULL); + g_return_val_if_fail (initial != NULL, NULL); + g_return_val_if_fail (final != NULL, NULL); + g_return_val_if_fail (G_VALUE_TYPE (initial) == gtype, NULL); + g_return_val_if_fail (G_VALUE_TYPE (final) == gtype, NULL); + + retval = g_object_new (CLUTTER_TYPE_INTERVAL, "value-type", gtype, NULL); + + clutter_interval_set_initial_value (retval, initial); + clutter_interval_set_final_value (retval, final); + + return retval; +} + +/** + * clutter_interval_clone: + * @interval: a #ClutterInterval + * + * Creates a copy of @interval. + * + * Return value: the newly created #ClutterInterval + * + * Since: 1.0 + */ +ClutterInterval * +clutter_interval_clone (ClutterInterval *interval) +{ + ClutterInterval *retval; + GType gtype; + GValue *tmp; + + g_return_val_if_fail (CLUTTER_IS_INTERVAL (interval), NULL); + g_return_val_if_fail (interval->priv->value_type != G_TYPE_INVALID, NULL); + + gtype = interval->priv->value_type; + retval = g_object_new (CLUTTER_TYPE_INTERVAL, "value-type", gtype, NULL); + + tmp = clutter_interval_peek_initial_value (interval); + clutter_interval_set_initial_value (retval, tmp); + + tmp = clutter_interval_peek_final_value (interval); + clutter_interval_set_final_value (retval, tmp); + + return retval; +} + +/** + * clutter_interval_get_value_type: + * @interval: a #ClutterInterval + * + * Retrieves the #GType of the values inside @interval. + * + * Return value: the type of the value, or G_TYPE_INVALID + * + * Since: 1.0 + */ +GType +clutter_interval_get_value_type (ClutterInterval *interval) +{ + g_return_val_if_fail (CLUTTER_IS_INTERVAL (interval), G_TYPE_INVALID); + + return interval->priv->value_type; +} + +static inline void +clutter_interval_set_value_internal (ClutterInterval *interval, + gint index_, + const GValue *value) +{ + ClutterIntervalPrivate *priv = interval->priv; + + if (G_IS_VALUE (&priv->values[index_])) + g_value_unset (&priv->values[index_]); + + g_value_init (&priv->values[index_], priv->value_type); + g_value_copy (value, &priv->values[index_]); +} + +static inline void +clutter_interval_get_value_internal (ClutterInterval *interval, + gint index_, + GValue *value) +{ + ClutterIntervalPrivate *priv = interval->priv; + + g_value_copy (&priv->values[index_], value); +} + +/** + * clutter_interval_set_initial_value: + * @interval: a #ClutterInterval + * @value: a #GValue + * + * Sets the initial value of @interval to @value. The value is copied + * inside the #ClutterInterval. + * + * Since: 1.0 + */ +void +clutter_interval_set_initial_value (ClutterInterval *interval, + const GValue *value) +{ + ClutterIntervalPrivate *priv; + + g_return_if_fail (CLUTTER_IS_INTERVAL (interval)); + g_return_if_fail (value != NULL); + + priv = interval->priv; + + g_return_if_fail (G_VALUE_TYPE (value) == priv->value_type); + + clutter_interval_set_value_internal (interval, 0, value); +} + +/** + * clutter_interval_get_initial_value: + * @interval: a #ClutterInterval + * @value: a #GValue + * + * Retrieves the initial value of @interval and copies + * it into @value. + * + * The passed #GValue must be initialized to the value held by + * the #ClutterInterval. + * + * Since: 1.0 + */ +void +clutter_interval_get_initial_value (ClutterInterval *interval, + GValue *value) +{ + ClutterIntervalPrivate *priv; + + g_return_if_fail (CLUTTER_IS_INTERVAL (interval)); + g_return_if_fail (value != NULL); + + priv = interval->priv; + + clutter_interval_get_value_internal (interval, 0, value); +} + +/** + * clutter_interval_peek_initial_value: + * @interval: a #ClutterInterval + * + * Gets the pointer to the initial value of @interval + * + * Return value: the initial value of the interval. The value + * is owned by the #ClutterInterval and it should not be + * modified or freed + * + * Since: 1.0 + */ +GValue * +clutter_interval_peek_initial_value (ClutterInterval *interval) +{ + g_return_val_if_fail (CLUTTER_IS_INTERVAL (interval), NULL); + + return interval->priv->values; +} + +/** + * clutter_interval_set_final_value: + * @interval: a #ClutterInterval + * @value: a #GValue + * + * Sets the final value of @interval to @value. The value is + * copied inside the #ClutterInterval. + * + * Since: 1.0 + */ +void +clutter_interval_set_final_value (ClutterInterval *interval, + const GValue *value) +{ + ClutterIntervalPrivate *priv; + + g_return_if_fail (CLUTTER_IS_INTERVAL (interval)); + g_return_if_fail (value != NULL); + + priv = interval->priv; + + g_return_if_fail (G_VALUE_TYPE (value) == priv->value_type); + + clutter_interval_set_value_internal (interval, 1, value); +} + +/** + * clutter_interval_get_final_value: + * @interval: a #ClutterInterval + * @value: a #GValue + * + * Retrieves the final value of @interval and copies + * it into @value. + * + * The passed #GValue must be initialized to the value held by + * the #ClutterInterval. + * + * Since: 1.0 + */ +void +clutter_interval_get_final_value (ClutterInterval *interval, + GValue *value) +{ + ClutterIntervalPrivate *priv; + + g_return_if_fail (CLUTTER_IS_INTERVAL (interval)); + g_return_if_fail (value != NULL); + + priv = interval->priv; + + clutter_interval_get_value_internal (interval, 1, value); +} + +/** + * clutter_interval_peek_final_value: + * @interval: a #ClutterInterval + * + * Gets the pointer to the final value of @interval + * + * Return value: the final value of the interval. The value + * is owned by the #ClutterInterval and it should not be + * modified or freed + * + * Since: 1.0 + */ +GValue * +clutter_interval_peek_final_value (ClutterInterval *interval) +{ + g_return_val_if_fail (CLUTTER_IS_INTERVAL (interval), NULL); + + return interval->priv->values + 1; +} + +/** + * clutter_interval_set_interval: + * @interval: a #ClutterInterval + * @Varargs: the initial and final values of the interval + * + * Variable arguments wrapper for clutter_interval_set_initial_value() + * and clutter_interval_set_final_value() that avoids using the + * #GValue arguments: + * + * |[ + * clutter_interval_set_interval (interval, 0, 50); + * clutter_interval_set_interval (interval, 1.0, 0.0); + * clutter_interval_set_interval (interval, FALSE, TRUE); + * ]| + * + * This function is meant for the convenience of the C API; bindings + * should reimplement this function using the #GValue-based API. + * + * Since: 1.0 + */ +void +clutter_interval_set_interval (ClutterInterval *interval, + ...) +{ + va_list args; + + g_return_if_fail (CLUTTER_IS_INTERVAL (interval)); + g_return_if_fail (interval->priv->value_type != G_TYPE_INVALID); + + va_start (args, interval); + clutter_interval_set_interval_valist (interval, args); + va_end (args); +} + +/** + * clutter_interval_get_interval: + * @interval: a #ClutterInterval + * @Varargs: return locations for the initial and final values of + * the interval + * + * Variable arguments wrapper for clutter_interval_get_initial_value() + * and clutter_interval_get_final_value() that avoids using the + * #GValue arguments: + * + * |[ + * gint a = 0, b = 0; + * clutter_interval_get_interval (interval, &a, &b); + * ]| + * + * This function is meant for the convenience of the C API; bindings + * should reimplement this function using the #GValue-based API. + * + * Since: 1.0 + */ +void +clutter_interval_get_interval (ClutterInterval *interval, + ...) +{ + va_list args; + + g_return_if_fail (CLUTTER_IS_INTERVAL (interval)); + g_return_if_fail (interval->priv->value_type != G_TYPE_INVALID); + + va_start (args, interval); + clutter_interval_get_interval_valist (interval, args); + va_end (args); +} + +/** + * clutter_interval_validate: + * @interval: a #ClutterInterval + * @pspec: a #GParamSpec + * + * Validates the initial and final values of @interval against + * a #GParamSpec. + * + * Return value: %TRUE if the #ClutterInterval is valid, %FALSE otherwise + * + * Since: 1.0 + */ +gboolean +clutter_interval_validate (ClutterInterval *interval, + GParamSpec *pspec) +{ + g_return_val_if_fail (CLUTTER_IS_INTERVAL (interval), FALSE); + g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), FALSE); + + return CLUTTER_INTERVAL_GET_CLASS (interval)->validate (interval, pspec); +} + +/** + * clutter_interval_compute_value: + * @interval: a #ClutterInterval + * @factor: the progress factor, between 0 and 1 + * @value: return location for an initialized #GValue + * + * Computes the value between the @interval boundaries given the + * progress @factor and puts it into @value. + * + * Return value: %TRUE if the operation was successful + * + * Since: 1.0 + */ +gboolean +clutter_interval_compute_value (ClutterInterval *interval, + gdouble factor, + GValue *value) +{ + g_return_val_if_fail (CLUTTER_IS_INTERVAL (interval), FALSE); + g_return_val_if_fail (value != NULL, FALSE); + + return CLUTTER_INTERVAL_GET_CLASS (interval)->compute_value (interval, + factor, + value); +} + +/** + * clutter_interval_register_progress_func: + * @value_type: a #GType + * @func: a #ClutterProgressFunc, or %NULL to unset a previously + * set progress function + * + * Sets the progress function for a given @value_type, like: + * + * |[ + * clutter_interval_register_progress_func (MY_TYPE_FOO, + * my_foo_progress); + * ]| + * + * Whenever a #ClutterInterval instance using the default + * #ClutterInterval::compute_value implementation is set as an + * interval between two #GValue of type @value_type, it will call + * @func to establish the value depending on the given progress, + * for instance: + * + * |[ + * static gboolean + * my_int_progress (const GValue *a, + * const GValue *b, + * gdouble progress, + * GValue *retval) + * { + * gint ia = g_value_get_int (a); + * gint ib = g_value_get_int (b); + * gint res = factor * (ib - ia) + ia; + * + * g_value_set_int (retval, res); + * + * return TRUE; + * } + * + * clutter_interval_register_progress_func (G_TYPE_INT, my_int_progress); + * ]| + * + * To unset a previously set progress function of a #GType, pass %NULL + * for @func. + * + * Since: 1.0 + */ +void +clutter_interval_register_progress_func (GType value_type, + ClutterProgressFunc func) +{ + ProgressData *progress_func; + + g_return_if_fail (value_type != G_TYPE_INVALID); + + if (G_UNLIKELY (progress_funcs == NULL)) + progress_funcs = g_hash_table_new (NULL, NULL); + + progress_func = + g_hash_table_lookup (progress_funcs, GUINT_TO_POINTER (value_type)); + if (G_UNLIKELY (progress_func)) + { + if (func == NULL) + { + g_hash_table_remove (progress_funcs, GUINT_TO_POINTER (value_type)); + g_slice_free (ProgressData, progress_func); + } + else + progress_func->func = func; + } + else + { + progress_func = g_slice_new (ProgressData); + progress_func->value_type = value_type; + progress_func->func = func; + + g_hash_table_replace (progress_funcs, + GUINT_TO_POINTER (value_type), + progress_func); + } +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-interval.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-interval.h --- clutter-0.8.4/clutter/clutter-interval.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-interval.h 2009-01-28 08:12:44.000000000 +0000 @@ -0,0 +1,162 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Copyright (C) 2008 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 . + * + * Author: + * Emmanuele Bassi + */ + +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_INTERVAL_H__ +#define __CLUTTER_INTERVAL_H__ + +#include + +G_BEGIN_DECLS + +#define CLUTTER_TYPE_INTERVAL (clutter_interval_get_type ()) +#define CLUTTER_INTERVAL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_INTERVAL, ClutterInterval)) +#define CLUTTER_IS_INTERVAL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_INTERVAL)) +#define CLUTTER_INTERVAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_INTERVAL, ClutterIntervalClass)) +#define CLUTTER_IS_INTERVAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_INTERVAL)) +#define CLUTTER_INTERVAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_INTERVAL, ClutterIntervalClass)) + +typedef struct _ClutterInterval ClutterInterval; +typedef struct _ClutterIntervalPrivate ClutterIntervalPrivate; +typedef struct _ClutterIntervalClass ClutterIntervalClass; + +/** + * ClutterProgressFunc: + * @a: the initial value of an interval + * @b: the final value of an interval + * @progress: the progress factor, between 0 and 1 + * @retval: the value used to store the progress + * + * Prototype of the progress function used to compute the value + * between the two ends @a and @b of an interval depending on + * the value of @progress. + * + * The #GValue in @retval is already initialized with the same + * type as @a and @b. + * + * This function will be called by #ClutterInterval if the + * type of the values of the interval was registered using + * clutter_interval_register_progress_func(). + * + * Return value: %TRUE if the function successfully computed + * the value and stored it inside @retval + * + * Since: 1.0 + */ +typedef gboolean (* ClutterProgressFunc) (const GValue *a, + const GValue *b, + gdouble progress, + GValue *retval); + +/** + * ClutterInterval: + * + * The #ClutterInterval structure contains only private data and should + * be accessed using the provided functions. + * + * Since: 1.0 + */ +struct _ClutterInterval +{ + /*< private >*/ + GInitiallyUnowned parent_instance; + + ClutterIntervalPrivate *priv; +}; + +/** + * ClutterIntervalClass: + * @validate: virtual function for validating an interval + * using a #GParamSpec + * @compute_value: virtual function for computing the value + * inside an interval using an adimensional factor between 0 and 1 + * + * The #ClutterIntervalClass contains only private data. + * + * Since: 1.0 + */ +struct _ClutterIntervalClass +{ + /*< private >*/ + GInitiallyUnownedClass parent_class; + + /*< public >*/ + gboolean (* validate) (ClutterInterval *interval, + GParamSpec *pspec); + gboolean (* compute_value) (ClutterInterval *interval, + gdouble factor, + GValue *value); + + /*< private >*/ + /* padding for future expansion */ + void (*_clutter_reserved1) (void); + void (*_clutter_reserved2) (void); + void (*_clutter_reserved3) (void); + void (*_clutter_reserved4) (void); + void (*_clutter_reserved5) (void); + void (*_clutter_reserved6) (void); +}; + +GType clutter_interval_get_type (void) G_GNUC_CONST; + +ClutterInterval *clutter_interval_new (GType gtype, + ...); +ClutterInterval *clutter_interval_new_with_values (GType gtype, + const GValue *initial, + const GValue *final); + +ClutterInterval *clutter_interval_clone (ClutterInterval *interval); + +GType clutter_interval_get_value_type (ClutterInterval *interval); +void clutter_interval_set_initial_value (ClutterInterval *interval, + const GValue *value); +void clutter_interval_get_initial_value (ClutterInterval *interval, + GValue *value); +GValue * clutter_interval_peek_initial_value (ClutterInterval *interval); +void clutter_interval_set_final_value (ClutterInterval *interval, + const GValue *value); +void clutter_interval_get_final_value (ClutterInterval *interval, + GValue *value); +GValue * clutter_interval_peek_final_value (ClutterInterval *interval); + +void clutter_interval_set_interval (ClutterInterval *interval, + ...); +void clutter_interval_get_interval (ClutterInterval *interval, + ...); + +gboolean clutter_interval_validate (ClutterInterval *interval, + GParamSpec *pspec); +gboolean clutter_interval_compute_value (ClutterInterval *interval, + gdouble factor, + GValue *value); + +void clutter_interval_register_progress_func (GType value_type, + ClutterProgressFunc func); + +G_END_DECLS + +#endif /* __CLUTTER_INTERVAL_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-label.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-label.c --- clutter-0.8.4/clutter/clutter-label.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-label.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,1303 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/** - * SECTION:clutter-label - * @short_description: Actor for displaying text - * - * #ClutterLabel is a #ClutterActor that displays text using Pango. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "clutter-label.h" -#include "clutter-main.h" -#include "clutter-enum-types.h" -#include "clutter-private.h" -#include "clutter-debug.h" -#include "clutter-units.h" - -#include "pangoclutter.h" - -#define DEFAULT_FONT_NAME "Sans 10" - -G_DEFINE_TYPE (ClutterLabel, clutter_label, CLUTTER_TYPE_ACTOR) - -/* Probably move into main */ -static PangoContext *_context = NULL; - -enum -{ - PROP_0, - PROP_FONT_NAME, - PROP_TEXT, - PROP_COLOR, - PROP_ATTRIBUTES, - PROP_USE_MARKUP, - PROP_ALIGNMENT, - PROP_WRAP, - PROP_WRAP_MODE, - PROP_JUSTIFY, - PROP_ELLIPSIZE, -}; - -#define CLUTTER_LABEL_GET_PRIVATE(obj) \ -(G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_LABEL, ClutterLabelPrivate)) - -typedef struct _ClutterLabelCachedLayout ClutterLabelCachedLayout; - -struct _ClutterLabelCachedLayout -{ - /* Cached layout. Pango internally caches the computed extents when - they are requested so there is no need to cache that as well */ - PangoLayout *layout; - /* The width that used to generate this layout */ - ClutterUnit width; - /* A number representing the age of this cache (so that when a new - layout is needed the last used cache is replaced) */ - guint age; -}; - -/* We need at least three cached layouts to run the allocation without - regenerating a new layout. First the layout will be generated at - full width to get the preferred width, then it will be generated at - the preferred width to get the preferred height and then it might - be regenerated at a different width to get the height for the - actual allocated width */ -#define CLUTTER_LABEL_N_CACHED_LAYOUTS 3 - -struct _ClutterLabelPrivate -{ - PangoFontDescription *font_desc; - - ClutterColor fgcol; - - gchar *text; - gchar *font_name; - - guint alignment : 2; - guint wrap : 1; - guint use_underline : 1; - guint use_markup : 1; - guint ellipsize : 3; - guint single_line_mode : 1; - guint wrap_mode : 3; - guint justify : 1; - - PangoAttrList *attrs; - PangoAttrList *effective_attrs; - - ClutterLabelCachedLayout cached_layouts[CLUTTER_LABEL_N_CACHED_LAYOUTS]; - guint cache_age; -}; - -/* - * clutter_label_create_layout_no_cache: - * @label: a #ClutterLabel - * @allocation_width: the width of the layout, or -1 - * - * Creates a new #PangoLayout for the given @allocation_width, using - * the layout properties of the @label. - * - * This function will not touch the glyphs cache. - * - * This function should be used by clutter_label_get_preferred_width() - * and clutter_label_get_preferred_height(). - */ -static PangoLayout * -clutter_label_create_layout_no_cache (ClutterLabel *label, - ClutterUnit allocation_width) -{ - ClutterLabelPrivate *priv = label->priv; - PangoLayout *layout; - - layout = pango_layout_new (_context); - - if (priv->effective_attrs) - pango_layout_set_attributes (layout, priv->effective_attrs); - - pango_layout_set_alignment (layout, priv->alignment); - pango_layout_set_single_paragraph_mode (layout, priv->single_line_mode); - - pango_layout_set_font_description (layout, priv->font_desc); - pango_layout_set_justify (layout, priv->justify); - - if (priv->text) - { - if (!priv->use_markup) - pango_layout_set_text (layout, priv->text, -1); - else - pango_layout_set_markup (layout, priv->text, -1); - } - - if (allocation_width > 0 && - (priv->ellipsize != PANGO_ELLIPSIZE_NONE || priv->wrap)) - { - int layout_width, layout_height; - - pango_layout_get_size (layout, &layout_width, &layout_height); - - /* No need to set ellipsize or wrap if we already have enough - * space, since we don't want to make the layout wider than it - * would be otherwise. - */ - - if (CLUTTER_UNITS_FROM_PANGO_UNIT (layout_width) > allocation_width) - { - if (priv->ellipsize != PANGO_ELLIPSIZE_NONE) - { - gint width; - - width = allocation_width > 0 - ? CLUTTER_UNITS_TO_PANGO_UNIT (allocation_width) - : -1; - - pango_layout_set_ellipsize (layout, priv->ellipsize); - pango_layout_set_width (layout, width); - } - else if (priv->wrap) - { - gint width; - - width = allocation_width > 0 - ? CLUTTER_UNITS_TO_PANGO_UNIT (allocation_width) - : -1; - - pango_layout_set_wrap (layout, priv->wrap_mode); - pango_layout_set_width (layout, width); - } - } - } - - return layout; -} - -static void -clutter_label_dirty_cache (ClutterLabel *label) -{ - ClutterLabelPrivate *priv = label->priv; - int i; - - /* Delete the cached layouts so they will be recreated the next time - they are needed */ - for (i = 0; i < CLUTTER_LABEL_N_CACHED_LAYOUTS; i++) - if (priv->cached_layouts[i].layout) - { - g_object_unref (priv->cached_layouts[i].layout); - priv->cached_layouts[i].layout = NULL; - } -} - -/* - * clutter_label_create_layout: - * @label: a #ClutterLabel - * @allocation_width: the allocation width - * - * Like clutter_label_create_layout_no_cache(), but will also ensure - * the glyphs cache. If a previously cached layout generated using the - * same width is available then that will be used instead of - * generating a new one. - */ -static PangoLayout * -clutter_label_create_layout (ClutterLabel *label, - ClutterUnit allocation_width) -{ - ClutterLabelPrivate *priv = label->priv; - int i; - ClutterLabelCachedLayout *oldest_cache = priv->cached_layouts; - gboolean found_free_cache = FALSE; - - /* Search for a cached layout with the same width and keep track of - the oldest one */ - for (i = 0; i < CLUTTER_LABEL_N_CACHED_LAYOUTS; i++) - { - if (priv->cached_layouts[i].layout == NULL) - { - /* Always prefer free cache spaces */ - found_free_cache = TRUE; - oldest_cache = priv->cached_layouts + i; - } - /* If this cached layout is using the same width then we can - just return that directly */ - else if (priv->cached_layouts[i].width == allocation_width) - { - CLUTTER_NOTE (ACTOR, "ClutterLabel: %p: cache hit for width %i", - label, CLUTTER_UNITS_TO_DEVICE (allocation_width)); - return priv->cached_layouts[i].layout; - } - else if (!found_free_cache && (priv->cached_layouts[i].age - < oldest_cache->age)) - oldest_cache = priv->cached_layouts + i; - } - - CLUTTER_NOTE (ACTOR, "ClutterLabel: %p: cache miss for width %i", - label, CLUTTER_UNITS_TO_DEVICE (allocation_width)); - - /* If we make it here then we didn't have a cached version so we - need to recreate the layout */ - if (oldest_cache->layout) - g_object_unref (oldest_cache->layout); - - oldest_cache->layout - = clutter_label_create_layout_no_cache (label, allocation_width); - - pango_clutter_ensure_glyph_cache_for_layout (oldest_cache->layout); - - /* Mark the 'time' this cache was created and advance the time */ - oldest_cache->age = priv->cache_age++; - - oldest_cache->width = allocation_width; - - return oldest_cache->layout; -} - -static void -clutter_label_paint (ClutterActor *self) -{ - ClutterLabel *label = CLUTTER_LABEL (self); - ClutterLabelPrivate *priv = label->priv; - PangoLayout *layout; - ClutterColor color = { 0, }; - ClutterActorBox alloc = { 0, }; - - if (priv->font_desc == NULL || priv->text == NULL) - { - CLUTTER_NOTE (ACTOR, "desc: %p, text %p", - priv->font_desc ? priv->font_desc : 0x0, - priv->text ? priv->text : 0x0); - return; - } - - CLUTTER_NOTE (PAINT, "painting label (text:`%s')", priv->text); - - clutter_actor_get_allocation_box (self, &alloc); - layout = clutter_label_create_layout (label, alloc.x2 - alloc.x1); - - memcpy (&color, &priv->fgcol, sizeof (ClutterColor)); - color.alpha = clutter_actor_get_paint_opacity (self); - - pango_clutter_render_layout (layout, 0, 0, &color, 0); -} - -static void -clutter_label_get_preferred_width (ClutterActor *self, - ClutterUnit for_height, - ClutterUnit *min_width_p, - ClutterUnit *natural_width_p) -{ - ClutterLabel *label = CLUTTER_LABEL (self); - ClutterLabelPrivate *priv = label->priv; - PangoRectangle logical_rect = { 0, }; - PangoLayout *layout; - ClutterUnit layout_width; - - layout = clutter_label_create_layout (label, -1); - - pango_layout_get_extents (layout, NULL, &logical_rect); - - layout_width = logical_rect.width > 0 - ? CLUTTER_UNITS_FROM_PANGO_UNIT (logical_rect.width) - : 1; - - if (min_width_p) - { - if (priv->wrap || priv->ellipsize) - *min_width_p = 1; - else - *min_width_p = layout_width; - } - - if (natural_width_p) - *natural_width_p = layout_width; -} - -static void -clutter_label_get_preferred_height (ClutterActor *self, - ClutterUnit for_width, - ClutterUnit *min_height_p, - ClutterUnit *natural_height_p) -{ - ClutterLabel *label = CLUTTER_LABEL (self); - - if (for_width == 0) - { - if (min_height_p) - *min_height_p = 0; - - if (natural_height_p) - *natural_height_p = 0; - } - else - { - PangoLayout *layout; - PangoRectangle logical_rect = { 0, }; - ClutterUnit height; - - layout = clutter_label_create_layout (label, for_width); - - pango_layout_get_extents (layout, NULL, &logical_rect); - height = CLUTTER_UNITS_FROM_PANGO_UNIT (logical_rect.height); - - if (min_height_p) - *min_height_p = height; - - if (natural_height_p) - *natural_height_p = height; - } -} - -static void -clutter_label_allocate (ClutterActor *self, - const ClutterActorBox *box, - gboolean origin_changed) -{ - ClutterLabel *label = CLUTTER_LABEL (self); - ClutterActorClass *parent_class; - - /* Ensure that there is a cached label with the right width so that - we don't need to create the label during the paint run */ - clutter_label_create_layout (label, box->x2 - box->x1); - - parent_class = CLUTTER_ACTOR_CLASS (clutter_label_parent_class); - parent_class->allocate (self, box, origin_changed); -} - -static void -clutter_label_dispose (GObject *object) -{ - ClutterLabel *self = CLUTTER_LABEL(object); - ClutterLabelPrivate *priv; - - priv = self->priv; - - /* Get rid of the cached layouts */ - clutter_label_dirty_cache (self); - - G_OBJECT_CLASS (clutter_label_parent_class)->dispose (object); -} - -static void -clutter_label_finalize (GObject *object) -{ - ClutterLabel *self = CLUTTER_LABEL(object); - ClutterLabelPrivate *priv; - - priv = self->priv; - - if (priv->font_desc) - pango_font_description_free (priv->font_desc); - - g_free (priv->text); - g_free (priv->font_name); - - G_OBJECT_CLASS (clutter_label_parent_class)->finalize (object); -} - -static void -clutter_label_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ClutterLabel *label; - ClutterLabelPrivate *priv; - - label = CLUTTER_LABEL(object); - priv = label->priv; - - switch (prop_id) - { - case PROP_FONT_NAME: - clutter_label_set_font_name (label, g_value_get_string (value)); - break; - case PROP_TEXT: - clutter_label_set_text (label, g_value_get_string (value)); - break; - case PROP_COLOR: - clutter_label_set_color (label, g_value_get_boxed (value)); - break; - case PROP_ATTRIBUTES: - clutter_label_set_attributes (label, g_value_get_boxed (value)); - break; - case PROP_ALIGNMENT: - clutter_label_set_alignment (label, g_value_get_enum (value)); - break; - case PROP_USE_MARKUP: - clutter_label_set_use_markup (label, g_value_get_boolean (value)); - break; - case PROP_WRAP: - clutter_label_set_line_wrap (label, g_value_get_boolean (value)); - break; - case PROP_JUSTIFY: - clutter_label_set_justify (label, g_value_get_boolean (value)); - break; - case PROP_WRAP_MODE: - clutter_label_set_line_wrap_mode (label, g_value_get_enum (value)); - break; - case PROP_ELLIPSIZE: - clutter_label_set_ellipsize (label, g_value_get_enum (value)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -clutter_label_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ClutterLabel *label; - ClutterLabelPrivate *priv; - ClutterColor color; - - label = CLUTTER_LABEL (object); - priv = label->priv; - - switch (prop_id) - { - case PROP_FONT_NAME: - g_value_set_string (value, priv->font_name); - break; - case PROP_TEXT: - g_value_set_string (value, priv->text); - break; - case PROP_COLOR: - clutter_label_get_color (label, &color); - g_value_set_boxed (value, &color); - break; - case PROP_ATTRIBUTES: - g_value_set_boxed (value, priv->attrs); - break; - case PROP_ALIGNMENT: - g_value_set_enum (value, priv->alignment); - break; - case PROP_USE_MARKUP: - g_value_set_boolean (value, priv->use_markup); - break; - case PROP_JUSTIFY: - g_value_set_boolean (value, priv->justify); - break; - case PROP_WRAP: - g_value_set_boolean (value, priv->wrap); - break; - case PROP_WRAP_MODE: - g_value_set_enum (value, priv->wrap_mode); - break; - case PROP_ELLIPSIZE: - g_value_set_enum (value, priv->ellipsize); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -clutter_label_class_init (ClutterLabelClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); - - actor_class->paint = clutter_label_paint; - actor_class->get_preferred_width = clutter_label_get_preferred_width; - actor_class->get_preferred_height = clutter_label_get_preferred_height; - actor_class->allocate = clutter_label_allocate; - - gobject_class->finalize = clutter_label_finalize; - gobject_class->dispose = clutter_label_dispose; - gobject_class->set_property = clutter_label_set_property; - gobject_class->get_property = clutter_label_get_property; - - g_object_class_install_property - (gobject_class, PROP_FONT_NAME, - g_param_spec_string ("font-name", - "Font Name", - "Pango font description", - NULL, - CLUTTER_PARAM_READWRITE)); - g_object_class_install_property - (gobject_class, PROP_TEXT, - g_param_spec_string ("text", - "Text", - "Text to render", - NULL, - CLUTTER_PARAM_READWRITE)); - g_object_class_install_property - (gobject_class, PROP_COLOR, - g_param_spec_boxed ("color", - "Font Colour", - "Font Colour", - CLUTTER_TYPE_COLOR, - CLUTTER_PARAM_READWRITE)); - g_object_class_install_property - (gobject_class, PROP_ATTRIBUTES, - g_param_spec_boxed ("attributes", - "Attributes", - "A list of style attributes to apply to the " - "text of the label", - PANGO_TYPE_ATTR_LIST, - CLUTTER_PARAM_READWRITE)); - g_object_class_install_property - (gobject_class, PROP_USE_MARKUP, - g_param_spec_boolean ("use-markup", - "Use markup", - "The text of the label includes XML markup. " - "See pango_parse_markup()", - FALSE, - CLUTTER_PARAM_READWRITE)); - g_object_class_install_property - (gobject_class, PROP_WRAP, - g_param_spec_boolean ("wrap", - "Line wrap", - "If set, wrap lines if the text becomes too wide", - FALSE, - CLUTTER_PARAM_READWRITE)); - g_object_class_install_property - (gobject_class, PROP_WRAP_MODE, - g_param_spec_enum ("wrap-mode", - "Line wrap mode", - "If wrap is set, controls how line-wrapping is done", - PANGO_TYPE_WRAP_MODE, - PANGO_WRAP_WORD, - CLUTTER_PARAM_READWRITE)); - g_object_class_install_property - (gobject_class, PROP_ELLIPSIZE, - g_param_spec_enum ( "ellipsize", - "Ellipsize", - "The preferred place to ellipsize the string, " - "if the label does not have enough room to " - "display the entire string", - PANGO_TYPE_ELLIPSIZE_MODE, - PANGO_ELLIPSIZE_NONE, - CLUTTER_PARAM_READWRITE)); - g_object_class_install_property - (gobject_class, PROP_ALIGNMENT, - g_param_spec_enum ( "alignment", - "Alignment", - "The preferred alignment for the string", - PANGO_TYPE_ALIGNMENT, - PANGO_ALIGN_LEFT, - CLUTTER_PARAM_READWRITE)); - /** - * ClutterLabel:justify: - * - * Whether the contents of the label should be justified on both - * margins. - * - * Since: 0.6 - */ - g_object_class_install_property (gobject_class, - PROP_JUSTIFY, - g_param_spec_boolean ("justify", - "Justify", - "Whether the contents of the label should be justified", - FALSE, - CLUTTER_PARAM_READWRITE)); - - g_type_class_add_private (gobject_class, sizeof (ClutterLabelPrivate)); -} - -static void -clutter_label_init (ClutterLabel *self) -{ - ClutterLabelPrivate *priv; - int i; - - self->priv = priv = CLUTTER_LABEL_GET_PRIVATE (self); - - if (G_UNLIKELY (_context == NULL)) - _context = _clutter_context_create_pango_context (CLUTTER_CONTEXT ()); - - priv->alignment = PANGO_ALIGN_LEFT; - priv->wrap = FALSE; - priv->wrap_mode = PANGO_WRAP_WORD; - priv->ellipsize = PANGO_ELLIPSIZE_NONE; - priv->use_underline = FALSE; - priv->use_markup = FALSE; - priv->justify = FALSE; - - for (i = 0; i < CLUTTER_LABEL_N_CACHED_LAYOUTS; i++) - priv->cached_layouts[i].layout = NULL; - - priv->text = NULL; - priv->attrs = NULL; - - priv->fgcol.red = 0; - priv->fgcol.green = 0; - priv->fgcol.blue = 0; - priv->fgcol.alpha = 255; - - priv->font_name = g_strdup (DEFAULT_FONT_NAME); - priv->font_desc = pango_font_description_from_string (priv->font_name); -} - -/** - * clutter_label_new_with_text: - * @font_name: the name (and size) of the font to be used - * @text: the text to be displayed - * - * Creates a new #ClutterLabel displaying @text using @font_name. - * - * Return value: a #ClutterLabel - */ -ClutterActor* -clutter_label_new_with_text (const gchar *font_name, - const gchar *text) -{ - return g_object_new (CLUTTER_TYPE_LABEL, - "font-name", font_name, - "text", text, - NULL); -} - -/** - * clutter_label_new_full: - * @font_name: the name (and size) of the font to be used - * @text: the text to be displayed - * @color: #ClutterColor for text - * - * Creates a new #ClutterLabel displaying @text with @color - * using @font_name. - * - * Return value: a #ClutterLabel - */ -ClutterActor* -clutter_label_new_full (const gchar *font_name, - const gchar *text, - const ClutterColor *color) -{ - return g_object_new (CLUTTER_TYPE_LABEL, - "font-name", font_name, - "text", text, - "color", color, - NULL); -} - -/** - * clutter_label_new: - * - * Creates a new, empty #ClutterLabel. - * - * Returns: the newly created #ClutterLabel - */ -ClutterActor * -clutter_label_new (void) -{ - return g_object_new (CLUTTER_TYPE_LABEL, NULL); -} - -/** - * clutter_label_get_text: - * @label: a #ClutterLabel - * - * Retrieves the text displayed by @label - * - * Return value: the text of the label. The returned string is - * owned by #ClutterLabel and should not be modified or freed. - */ -G_CONST_RETURN gchar * -clutter_label_get_text (ClutterLabel *label) -{ - g_return_val_if_fail (CLUTTER_IS_LABEL (label), NULL); - - return label->priv->text; -} - -/** - * clutter_label_set_text: - * @label: a #ClutterLabel - * @text: the text to be displayed - * - * Sets @text as the text to be displayed by @label. - */ -void -clutter_label_set_text (ClutterLabel *label, - const gchar *text) -{ - ClutterLabelPrivate *priv; - - g_return_if_fail (CLUTTER_IS_LABEL (label)); - - priv = label->priv; - - g_free (priv->text); - - priv->text = g_strdup (text); - - clutter_label_dirty_cache (label); - - clutter_actor_queue_relayout (CLUTTER_ACTOR (label)); - - g_object_notify (G_OBJECT (label), "text"); -} - -/** - * clutter_label_get_font_name: - * @label: a #ClutterLabel - * - * Retrieves the font used by @label. - * - * Return value: a string containing the font name, in a format - * understandable by pango_font_description_from_string(). The - * string is owned by @label and should not be modified - * or freed. - */ -G_CONST_RETURN gchar * -clutter_label_get_font_name (ClutterLabel *label) -{ - g_return_val_if_fail (CLUTTER_IS_LABEL (label), NULL); - - return label->priv->font_name; -} - -/** - * clutter_label_set_font_name: - * @label: a #ClutterLabel - * @font_name: a font name and size, or %NULL for the default font - * - * Sets @font_name as the font used by @label. - * - * @font_name must be a string containing the font name and its - * size, similarly to what you would feed to the - * pango_font_description_from_string() function. - */ -void -clutter_label_set_font_name (ClutterLabel *label, - const gchar *font_name) -{ - ClutterLabelPrivate *priv; - PangoFontDescription *desc; - - g_return_if_fail (CLUTTER_IS_LABEL (label)); - - if (!font_name || font_name[0] == '\0') - font_name = DEFAULT_FONT_NAME; - - priv = label->priv; - - if (strcmp (priv->font_name, font_name) == 0) - return; - - desc = pango_font_description_from_string (font_name); - if (!desc) - { - g_warning ("Attempting to create a PangoFontDescription for " - "font name `%s', but failed.", - font_name); - return; - } - - g_free (priv->font_name); - priv->font_name = g_strdup (font_name); - - if (priv->font_desc) - pango_font_description_free (priv->font_desc); - - priv->font_desc = desc; - - clutter_label_dirty_cache (label); - - if (label->priv->text && label->priv->text[0] != '\0') - clutter_actor_queue_relayout (CLUTTER_ACTOR (label)); - - g_object_notify (G_OBJECT (label), "font-name"); -} - - -/** - * clutter_label_set_color: - * @label: a #ClutterLabel - * @color: a #ClutterColor - * - * Sets the color of @label. - */ -void -clutter_label_set_color (ClutterLabel *label, - const ClutterColor *color) -{ - ClutterActor *actor; - ClutterLabelPrivate *priv; - - g_return_if_fail (CLUTTER_IS_LABEL (label)); - g_return_if_fail (color != NULL); - - priv = label->priv; - - g_object_ref (label); - - priv->fgcol.red = color->red; - priv->fgcol.green = color->green; - priv->fgcol.blue = color->blue; - priv->fgcol.alpha = color->alpha; - - actor = CLUTTER_ACTOR (label); - - clutter_actor_set_opacity (actor, priv->fgcol.alpha); - - if (CLUTTER_ACTOR_IS_VISIBLE (actor)) - clutter_actor_queue_redraw (actor); - - g_object_notify (G_OBJECT (label), "color"); - g_object_unref (label); -} - -/** - * clutter_label_get_color: - * @label: a #ClutterLabel - * @color: return location for a #ClutterColor - * - * Retrieves the color of @label. - */ -void -clutter_label_get_color (ClutterLabel *label, - ClutterColor *color) -{ - ClutterLabelPrivate *priv; - - g_return_if_fail (CLUTTER_IS_LABEL (label)); - g_return_if_fail (color != NULL); - - priv = label->priv; - - color->red = priv->fgcol.red; - color->green = priv->fgcol.green; - color->blue = priv->fgcol.blue; - color->alpha = priv->fgcol.alpha; -} - -/** - * clutter_label_set_ellipsize: - * @label: a #ClutterLabel - * @mode: a #PangoEllipsizeMode - * - * Sets the mode used to ellipsize (add an ellipsis: "...") to the text - * if there is not enough space to render the entire string. - * - * Since: 0.2 - **/ -void -clutter_label_set_ellipsize (ClutterLabel *label, - PangoEllipsizeMode mode) -{ - ClutterLabelPrivate *priv; - - g_return_if_fail (CLUTTER_IS_LABEL (label)); - g_return_if_fail (mode >= PANGO_ELLIPSIZE_NONE && - mode <= PANGO_ELLIPSIZE_END); - - priv = label->priv; - - if ((PangoEllipsizeMode) priv->ellipsize != mode) - { - priv->ellipsize = mode; - - clutter_label_dirty_cache (label); - - clutter_actor_queue_relayout (CLUTTER_ACTOR (label)); - - g_object_notify (G_OBJECT (label), "ellipsize"); - } -} - -/** - * clutter_label_get_ellipsize: - * @label: a #ClutterLabel - * - * Returns the ellipsizing position of the label. - * See clutter_label_set_ellipsize(). - * - * Return value: #PangoEllipsizeMode - * - * Since: 0.2 - **/ -PangoEllipsizeMode -clutter_label_get_ellipsize (ClutterLabel *label) -{ - g_return_val_if_fail (CLUTTER_IS_LABEL (label), PANGO_ELLIPSIZE_NONE); - - return label->priv->ellipsize; -} - -/** - * clutter_label_set_line_wrap: - * @label: a #ClutterLabel - * @wrap: the setting - * - * Toggles line wrapping within the #ClutterLabel widget. %TRUE makes - * it break lines if text exceeds the widget's size. %FALSE lets the - * text get cut off by the edge of the widget if it exceeds the widget - * size. - * - * Since: 0.2 - */ -void -clutter_label_set_line_wrap (ClutterLabel *label, - gboolean wrap) -{ - ClutterLabelPrivate *priv; - - g_return_if_fail (CLUTTER_IS_LABEL (label)); - - priv = label->priv; - - wrap = wrap != FALSE; - - if (priv->wrap != wrap) - { - priv->wrap = wrap; - - clutter_label_dirty_cache (label); - - clutter_actor_queue_relayout (CLUTTER_ACTOR (label)); - - g_object_notify (G_OBJECT (label), "wrap"); - } -} - -/** - * clutter_label_get_line_wrap: - * @label: a #ClutterLabel - * - * Returns whether lines in the label are automatically wrapped. - * See clutter_label_set_line_wrap (). - * - * Return value: %TRUE if the lines of the label are automatically wrapped. - * - * Since: 0.2 - */ -gboolean -clutter_label_get_line_wrap (ClutterLabel *label) -{ - g_return_val_if_fail (CLUTTER_IS_LABEL (label), FALSE); - - return label->priv->wrap; -} - -/** - * clutter_label_set_line_wrap_mode: - * @label: a #ClutterLabel - * @wrap_mode: the line wrapping mode - * - * If line wrapping is on (see clutter_label_set_line_wrap()) this controls how - * the line wrapping is done. The default is %PANGO_WRAP_WORD which means - * wrap on word boundaries. - * - * Since: 0.2 - **/ -void -clutter_label_set_line_wrap_mode (ClutterLabel *label, - PangoWrapMode wrap_mode) -{ - ClutterLabelPrivate *priv; - - g_return_if_fail (CLUTTER_IS_LABEL (label)); - - priv = label->priv; - - if (priv->wrap_mode != wrap_mode) - { - priv->wrap_mode = wrap_mode; - - clutter_label_dirty_cache (label); - - clutter_actor_queue_relayout (CLUTTER_ACTOR (label)); - - g_object_notify (G_OBJECT (label), "wrap-mode"); - } -} - -/** - * clutter_label_get_line_wrap_mode: - * @label: a #ClutterLabel - * - * Returns line wrap mode used by the label. - * See clutter_label_set_line_wrap_mode (). - * - * Return value: %TRUE if the lines of the label are automatically wrapped. - * - * Since: 0.2 - */ -PangoWrapMode -clutter_label_get_line_wrap_mode (ClutterLabel *label) -{ - g_return_val_if_fail (CLUTTER_IS_LABEL (label), FALSE); - - return label->priv->wrap_mode; -} - -/** - * clutter_label_get_layout: - * @label: a #ClutterLabel - * - * Gets the #PangoLayout used to display the label. - * The layout is useful to e.g. convert text positions to - * pixel positions. - * The returned layout is owned by the label so need not be - * freed by the caller. - * - * Return value: the #PangoLayout for this label - * - * Since: 0.2 - **/ -PangoLayout * -clutter_label_get_layout (ClutterLabel *label) -{ - ClutterUnit width; - - g_return_val_if_fail (CLUTTER_IS_LABEL (label), NULL); - - width = clutter_actor_get_widthu (CLUTTER_ACTOR (label)); - - return clutter_label_create_layout (label, width); -} - -static inline void -clutter_label_set_attributes_internal (ClutterLabel *label, - PangoAttrList *attrs) -{ -} - -/** - * clutter_label_set_attributes: - * @label: a #ClutterLabel - * @attrs: a #PangoAttrList - * - * Sets a #PangoAttrList; the attributes in the list are applied to the - * label text. The attributes set with this function will be ignored - * if the "use_markup" property - * is %TRUE. - * - * Since: 0.2 - **/ -void -clutter_label_set_attributes (ClutterLabel *label, - PangoAttrList *attrs) -{ - ClutterLabelPrivate *priv; - - g_return_if_fail (CLUTTER_IS_LABEL (label)); - - priv = label->priv; - - if (attrs) - pango_attr_list_ref (attrs); - - if (priv->attrs) - pango_attr_list_unref (priv->attrs); - - if (!priv->use_markup) - { - if (attrs) - pango_attr_list_ref (attrs); - - if (priv->effective_attrs) - pango_attr_list_unref (priv->effective_attrs); - - priv->effective_attrs = attrs; - } - - priv->attrs = attrs; - - clutter_label_dirty_cache (label); - - g_object_notify (G_OBJECT (label), "attributes"); - - clutter_actor_queue_relayout (CLUTTER_ACTOR (label)); -} - -/** - * clutter_label_get_attributes: - * @label: a #ClutterLabel - * - * Gets the attribute list that was set on the label using - * clutter_label_set_attributes(), if any. - * - * Return value: the attribute list, or %NULL if none was set. - * - * Since: 0.2 - **/ -PangoAttrList * -clutter_label_get_attributes (ClutterLabel *label) -{ - g_return_val_if_fail (CLUTTER_IS_LABEL (label), NULL); - - return label->priv->attrs; -} - -/** - * clutter_label_set_use_markup: - * @label: a #ClutterLabel - * @setting: %TRUE if the label's text should be parsed for markup. - * - * Sets whether the text of the label contains markup in Pango's text markup - * language. - **/ -void -clutter_label_set_use_markup (ClutterLabel *label, - gboolean setting) -{ - ClutterLabelPrivate *priv; - - g_return_if_fail (CLUTTER_IS_LABEL (label)); - - priv = label->priv; - - if (priv->use_markup != setting) - { - priv->use_markup = setting; - - clutter_label_dirty_cache (label); - - clutter_actor_queue_relayout (CLUTTER_ACTOR (label)); - - g_object_notify (G_OBJECT (label), "use-markup"); - } -} - -/** - * clutter_label_get_use_markup: - * @label: a #ClutterLabel - * - * Returns whether the label's text is interpreted as marked up with - * the Pango text markup - * language. See clutter_label_set_use_markup (). - * - * Return value: %TRUE if the label's text will be parsed for markup. - **/ -gboolean -clutter_label_get_use_markup (ClutterLabel *label) -{ - g_return_val_if_fail (CLUTTER_IS_LABEL (label), FALSE); - - return label->priv->use_markup; -} - -/** - * clutter_label_set_alignment: - * @label: a #ClutterLabel - * @alignment: A #PangoAlignment - * - * Sets text alignment of the label. - * - * The alignment will only be used when the contents of the - * label are enough to wrap, and the #ClutterLabel:wrap - * property is set to %TRUE. - **/ -void -clutter_label_set_alignment (ClutterLabel *label, - PangoAlignment alignment) -{ - ClutterLabelPrivate *priv; - - g_return_if_fail (CLUTTER_IS_LABEL (label)); - - priv = label->priv; - - if (priv->alignment != alignment) - { - priv->alignment = alignment; - - clutter_label_dirty_cache (label); - - clutter_actor_queue_relayout (CLUTTER_ACTOR (label)); - - g_object_notify (G_OBJECT (label), "alignment"); - } -} - -/** - * clutter_label_get_alignment: - * @label: a #ClutterLabel - * - * Returns the label's text alignment - * - * Return value: The label's #PangoAlignment - * - * Since 0.2 - **/ -PangoAlignment -clutter_label_get_alignment (ClutterLabel *label) -{ - g_return_val_if_fail (CLUTTER_IS_LABEL (label), FALSE); - - return label->priv->alignment; -} - -/** - * clutter_label_set_justify: - * @label: a #ClutterLabel - * @justify: whether the text should be justified - * - * Sets whether the text of the @label actor should be justified - * on both margins. This setting is ignored if Clutter is compiled - * against Pango < 1.18. - * - * Since: 0.6 - */ -void -clutter_label_set_justify (ClutterLabel *label, - gboolean justify) -{ - ClutterLabelPrivate *priv; - - g_return_if_fail (CLUTTER_IS_LABEL (label)); - - priv = label->priv; - - if (priv->justify != justify) - { - priv->justify = justify; - - clutter_label_dirty_cache (label); - - clutter_actor_queue_relayout (CLUTTER_ACTOR (label)); - - g_object_notify (G_OBJECT (label), "justify"); - } -} - -/** - * clutter_label_get_justify: - * @label: a #ClutterLabel - * - * Retrieves whether the label should justify the text on both margins. - * - * Return value: %TRUE if the text should be justified - * - * Since: 0.6 - */ -gboolean -clutter_label_get_justify (ClutterLabel *label) -{ - g_return_val_if_fail (CLUTTER_IS_LABEL (label), FALSE); - - return label->priv->justify; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-label.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-label.h --- clutter-0.8.4/clutter/clutter-label.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-label.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,126 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef _HAVE_CLUTTER_LABEL_H -#define _HAVE_CLUTTER_LABEL_H - -#include -#include -#include - - -G_BEGIN_DECLS - -#define CLUTTER_TYPE_LABEL (clutter_label_get_type ()) - -#define CLUTTER_LABEL(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - CLUTTER_TYPE_LABEL, ClutterLabel)) - -#define CLUTTER_LABEL_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - CLUTTER_TYPE_LABEL, ClutterLabelClass)) - -#define CLUTTER_IS_LABEL(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - CLUTTER_TYPE_LABEL)) - -#define CLUTTER_IS_LABEL_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - CLUTTER_TYPE_LABEL)) - -#define CLUTTER_LABEL_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - CLUTTER_TYPE_LABEL, ClutterLabelClass)) - -typedef struct _ClutterLabel ClutterLabel; -typedef struct _ClutterLabelClass ClutterLabelClass; -typedef struct _ClutterLabelPrivate ClutterLabelPrivate; - -struct _ClutterLabel -{ - ClutterActor parent; - - /*< private >*/ - ClutterLabelPrivate *priv; -}; - -struct _ClutterLabelClass -{ - /*< private >*/ - ClutterActorClass parent_class; - - void (*_clutter_label_1) (void); - void (*_clutter_label_2) (void); - void (*_clutter_label_3) (void); - void (*_clutter_label_4) (void); -}; - -GType clutter_label_get_type (void) G_GNUC_CONST; - -ClutterActor * clutter_label_new (void); - -ClutterActor* clutter_label_new_full (const gchar *font_name, - const gchar *text, - const ClutterColor *color); - -ClutterActor * clutter_label_new_with_text (const gchar *font_name, - const gchar *text); -void clutter_label_set_text (ClutterLabel *label, - const gchar *text); -G_CONST_RETURN gchar *clutter_label_get_text (ClutterLabel *label); -void clutter_label_set_font_name (ClutterLabel *label, - const gchar *font_name); -G_CONST_RETURN gchar *clutter_label_get_font_name (ClutterLabel *label); -void clutter_label_set_color (ClutterLabel *label, - const ClutterColor *color); -void clutter_label_get_color (ClutterLabel *label, - ClutterColor *color); -void clutter_label_set_ellipsize (ClutterLabel *label, - PangoEllipsizeMode mode); -PangoEllipsizeMode clutter_label_get_ellipsize (ClutterLabel *label); -void clutter_label_set_line_wrap (ClutterLabel *label, - gboolean wrap); -gboolean clutter_label_get_line_wrap (ClutterLabel *label); -void clutter_label_set_line_wrap_mode (ClutterLabel *label, - PangoWrapMode wrap_mode); -PangoWrapMode clutter_label_get_line_wrap_mode (ClutterLabel *label); -PangoLayout * clutter_label_get_layout (ClutterLabel *label); -void clutter_label_set_attributes (ClutterLabel *label, - PangoAttrList *attrs); -PangoAttrList * clutter_label_get_attributes (ClutterLabel *label); -void clutter_label_set_use_markup (ClutterLabel *label, - gboolean setting); -gboolean clutter_label_get_use_markup (ClutterLabel *label); -void clutter_label_set_alignment (ClutterLabel *label, - PangoAlignment alignment); -PangoAlignment clutter_label_get_alignment (ClutterLabel *label); -void clutter_label_set_justify (ClutterLabel *label, - gboolean justify); -gboolean clutter_label_get_justify (ClutterLabel *label); - -G_END_DECLS - -#endif /* _HAVE_CLUTTER_LABEL_H */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-list-model.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-list-model.h --- clutter-0.8.4/clutter/clutter-list-model.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-list-model.h 2009-01-28 08:12:44.000000000 +0000 @@ -20,13 +20,15 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . * * NB: Inspiration for column storage taken from GtkListStore */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __CLUTTER_LIST_MODEL_H__ #define __CLUTTER_LIST_MODEL_H__ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-main.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-main.c --- clutter-0.8.4/clutter/clutter-main.c 2008-11-13 14:44:32.000000000 +0000 +++ clutter-0.9.0/clutter/clutter-main.c 2009-01-28 16:45:24.000000000 +0000 @@ -50,23 +50,26 @@ #include "clutter-frame-source.h" #include "cogl/cogl.h" +#include "pango/cogl-pango.h" /* main context */ -static ClutterMainContext *ClutterCntx = NULL; +static ClutterMainContext *ClutterCntx = NULL; /* main lock and locking/unlocking functions */ -static GMutex *clutter_threads_mutex = NULL; -static GCallback clutter_threads_lock = NULL; -static GCallback clutter_threads_unlock = NULL; - -static gboolean clutter_is_initialized = FALSE; -static gboolean clutter_show_fps = FALSE; -static gboolean clutter_fatal_warnings = FALSE; +static GMutex *clutter_threads_mutex = NULL; +static GCallback clutter_threads_lock = NULL; +static GCallback clutter_threads_unlock = NULL; -static guint clutter_default_fps = 60; +static gboolean clutter_is_initialized = FALSE; +static gboolean clutter_show_fps = FALSE; +static gboolean clutter_fatal_warnings = FALSE; -static guint clutter_main_loop_level = 0; -static GSList *main_loops = NULL; +static guint clutter_default_fps = 60; + +static guint clutter_main_loop_level = 0; +static GSList *main_loops = NULL; + +static PangoDirection clutter_text_direction = PANGO_DIRECTION_LTR; guint clutter_debug_flags = 0; /* global clutter debug flag */ @@ -86,6 +89,7 @@ { "script", CLUTTER_DEBUG_SCRIPT }, { "shader", CLUTTER_DEBUG_SHADER }, { "multistage", CLUTTER_DEBUG_MULTISTAGE }, + { "animation", CLUTTER_DEBUG_ANIMATION } }; #endif /* CLUTTER_ENABLE_DEBUG */ @@ -351,7 +355,7 @@ ClutterMainContext *context; guchar pixel[4]; GLint viewport[4]; - ClutterColor white = { 0xff, 0xff, 0xff, 0xff }; + CoglColor white; guint32 id; GLboolean dither_was_on; @@ -362,6 +366,7 @@ /* needed for when a context switch happens */ _clutter_stage_maybe_setup_viewport (stage); + cogl_color_set_from_4ub (&white, 255, 255, 255, 255); cogl_paint_init (&white); /* Disable dithering (if any) when doing the painting in pick mode */ @@ -383,13 +388,13 @@ */ glFinish(); + /* Read the color of the screen co-ords pixel */ + glReadPixels (x, viewport[3] - y -1, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel); + /* Restore whether GL_DITHER was enabled */ if (dither_was_on) glEnable (GL_DITHER); - /* Read the color of the screen co-ords pixel */ - glReadPixels (x, viewport[3] - y -1, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel); - if (pixel[0] == 0xff && pixel[1] == 0xff && pixel[2] == 0xff) return CLUTTER_ACTOR (stage); @@ -398,23 +403,100 @@ return clutter_get_actor_by_gid (id); } -PangoContext * -_clutter_context_create_pango_context (ClutterMainContext *self) +static PangoDirection +clutter_get_text_direction (void) { - PangoContext *context; - gdouble resolution; + PangoDirection dir = PANGO_DIRECTION_LTR; + const gchar *direction; + + direction = g_getenv ("CLUTTER_TEXT_DIRECTION"); + if (direction && *direction != '\0') + { + if (strcmp (direction, "rtl") == 0) + dir = PANGO_DIRECTION_RTL; + else if (strcmp (direction, "ltr") == 0) + dir = PANGO_DIRECTION_LTR; + } + else + { + /* Translate to default:RTL if you want your widgets + * to be RTL, otherwise translate to default:LTR. + * + * Do *not* translate it to "predefinito:LTR": if it + * it isn't default:LTR or default:RTL it will not work + */ + char *e = _("default:LTR"); + + if (strcmp (e, "default:RTL") == 0) + dir = PANGO_DIRECTION_RTL; + else if (strcmp (e, "default:LTR") == 0) + dir = PANGO_DIRECTION_LTR; + else + g_warning ("Whoever translated default:LTR did so wrongly."); + } + + return dir; +} + +static void +update_pango_context (ClutterBackend *backend, + PangoContext *context) +{ + PangoFontDescription *font_desc; cairo_font_options_t *font_options; + const gchar *font_name; + gdouble resolution; + + /* update the text direction */ + pango_context_set_base_dir (context, clutter_text_direction); + + /* get the configuration for the PangoContext from the backend */ + font_name = clutter_backend_get_font_name (backend); + font_options = clutter_backend_get_font_options (backend); + resolution = clutter_backend_get_resolution (backend); + + font_desc = pango_font_description_from_string (font_name); - resolution = clutter_backend_get_resolution (self->backend); if (resolution < 0) resolution = 96.0; /* fall back */ - context = pango_clutter_font_map_create_context (self->font_map); - + pango_context_set_font_description (context, font_desc); + pango_cairo_context_set_font_options (context, font_options); pango_cairo_context_set_resolution (context, resolution); - font_options = clutter_backend_get_font_options (self->backend); - pango_cairo_context_set_font_options (context, font_options); + pango_font_description_free (font_desc); +} + +PangoContext * +_clutter_context_get_pango_context (ClutterMainContext *self) +{ + if (G_UNLIKELY (self->pango_context == NULL)) + { + PangoContext *context; + + context = cogl_pango_font_map_create_context (self->font_map); + self->pango_context = context; + + g_signal_connect (self->backend, "resolution-changed", + G_CALLBACK (update_pango_context), + self->pango_context); + g_signal_connect (self->backend, "font-changed", + G_CALLBACK (update_pango_context), + self->pango_context); + } + + update_pango_context (self->backend, self->pango_context); + + return self->pango_context; +} + +PangoContext * +_clutter_context_create_pango_context (ClutterMainContext *self) +{ + PangoContext *context; + + context = cogl_pango_font_map_create_context (self->font_map); + update_pango_context (self->backend, context); return context; } @@ -1001,6 +1083,17 @@ #endif } +static gboolean +clutter_arg_direction_cb (const char *key, + const char *value, + gpointer user_data) +{ + clutter_text_direction = + (strcmp (value, "rtl") == 0) ? PANGO_DIRECTION_RTL + : PANGO_DIRECTION_LTR; + + return TRUE; +} #ifdef CLUTTER_ENABLE_DEBUG static gboolean @@ -1064,17 +1157,6 @@ if (!_clutter_backend_post_parse (backend, error)) return CLUTTER_INIT_ERROR_BACKEND; - /* - * Resolution requires display to be open, so can only be queried after - * the post_parse hooks run. - */ - ctx->font_map = PANGO_CLUTTER_FONT_MAP (pango_clutter_font_map_new ()); - - resolution = clutter_backend_get_resolution (ctx->backend); - pango_clutter_font_map_set_resolution (ctx->font_map, resolution); - - pango_clutter_font_map_set_use_mipmapping (ctx->font_map, TRUE); - /* Stage will give us a GL Context etc */ stage = clutter_stage_get_default (); if (!stage) @@ -1107,6 +1189,21 @@ * start issueing cogl commands */ + /* + * Resolution requires display to be open, so can only be queried after + * the post_parse hooks run. + * + * NB: cogl_pango requires a Cogl context. + */ + ctx->font_map = COGL_PANGO_FONT_MAP (cogl_pango_font_map_new ()); + + resolution = clutter_backend_get_resolution (ctx->backend); + cogl_pango_font_map_set_resolution (ctx->font_map, resolution); + cogl_pango_font_map_set_use_mipmapping (ctx->font_map, TRUE); + + clutter_text_direction = clutter_get_text_direction (); + + /* Figure out framebuffer masks used for pick */ cogl_get_bitmasks (&ctx->fb_r_mask, &ctx->fb_g_mask, &ctx->fb_b_mask, NULL); @@ -1140,16 +1237,19 @@ static GOptionEntry clutter_args[] = { { "clutter-show-fps", 0, 0, G_OPTION_ARG_NONE, &clutter_show_fps, - "Show frames per second", NULL }, + N_("Show frames per second"), NULL }, { "clutter-default-fps", 0, 0, G_OPTION_ARG_INT, &clutter_default_fps, - "Default frame rate", "FPS" }, + N_("Default frame rate"), "FPS" }, { "g-fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &clutter_fatal_warnings, - "Make all warnings fatal", NULL }, + N_("Make all warnings fatal"), NULL }, + { "clutter-text-direction", 0, 0, G_OPTION_ARG_CALLBACK, + clutter_arg_direction_cb, + N_("Direction for the text"), "DIRECTION" }, #ifdef CLUTTER_ENABLE_DEBUG { "clutter-debug", 0, 0, G_OPTION_ARG_CALLBACK, clutter_arg_debug_cb, - "Clutter debugging flags to set", "FLAGS" }, + N_("Clutter debugging flags to set"), "FLAGS" }, { "clutter-no-debug", 0, 0, G_OPTION_ARG_CALLBACK, clutter_arg_no_debug_cb, - "Clutter debugging flags to unset", "FLAGS" }, + N_("Clutter debugging flags to unset"), "FLAGS" }, #endif /* CLUTTER_ENABLE_DEBUG */ { NULL, }, }; @@ -1292,13 +1392,14 @@ context = clutter_context_get_default (); group = g_option_group_new ("clutter", - "Clutter Options", - "Show Clutter Options", + _("Clutter Options"), + _("Show Clutter Options"), NULL, NULL); g_option_group_set_parse_hooks (group, pre_parse_hook, post_parse_hook); g_option_group_add_entries (group, clutter_args); + g_option_group_set_translation_domain (group, GETTEXT_PACKAGE); /* add backend-specific options */ _clutter_backend_add_options (context->backend, group); @@ -1717,61 +1818,90 @@ dev->motion_last_actor = NULL; } +static ClutterInputDevice * clutter_event_get_device (ClutterEvent *event); + +/* This function should perhaps be public and in clutter-event.c ? + */ +static ClutterInputDevice * +clutter_event_get_device (ClutterEvent *event) +{ + g_return_val_if_fail (event != NULL, NULL); + + switch (event->type) + { + case CLUTTER_NOTHING: + case CLUTTER_STAGE_STATE: + case CLUTTER_DESTROY_NOTIFY: + case CLUTTER_CLIENT_MESSAGE: + case CLUTTER_DELETE: + case CLUTTER_ENTER: + case CLUTTER_LEAVE: + return NULL; + break; + case CLUTTER_BUTTON_PRESS: + case CLUTTER_BUTTON_RELEASE: + return event->button.device; + case CLUTTER_MOTION: + return event->motion.device; + case CLUTTER_SCROLL: + return event->scroll.device; + break; + case CLUTTER_KEY_PRESS: + case CLUTTER_KEY_RELEASE: + break; + } + return NULL; +} + static inline void generate_enter_leave_events (ClutterEvent *event) { ClutterMainContext *context = ClutterCntx; ClutterActor *motion_current_actor = event->motion.source; ClutterActor *last_actor = context->motion_last_actor; + ClutterInputDevice *device = clutter_event_get_device (event); - if (event->motion.device != NULL) - last_actor = event->motion.device->motion_last_actor; + if (device != NULL) + last_actor = device->motion_last_actor; if (last_actor != motion_current_actor) { if (motion_current_actor) { + gint x, y; ClutterEvent cev; - cev.crossing.device = event->motion.device; + cev.crossing.device = device; + clutter_event_get_coords (event, &x, &y); if (context->motion_last_actor) { cev.crossing.type = CLUTTER_LEAVE; cev.crossing.time = event->any.time; cev.crossing.flags = 0; - cev.crossing.x = event->motion.x; - cev.crossing.y = event->motion.y; + cev.crossing.x = x; + cev.crossing.y = y; cev.crossing.source = last_actor; cev.crossing.stage = event->any.stage; - - /* unref in free */ cev.crossing.related = motion_current_actor; - g_queue_push_head (context->events_queue, - clutter_event_copy (&cev)); + emit_pointer_event (&cev, device); } cev.crossing.type = CLUTTER_ENTER; cev.crossing.time = event->any.time; cev.crossing.flags = 0; - cev.crossing.x = event->motion.x; - cev.crossing.y = event->motion.y; + cev.crossing.x = x; + cev.crossing.y = y; cev.crossing.source = motion_current_actor; cev.crossing.stage = event->any.stage; if (context->motion_last_actor) cev.crossing.related = last_actor; else - { - /* the previous actor we were getting events from seems to have - * vanished - */ - cev.crossing.related = NULL; - } + cev.crossing.related = NULL; - g_queue_push_head (context->events_queue, - clutter_event_copy (&cev)); + emit_pointer_event (&cev, device); } } @@ -1780,18 +1910,18 @@ g_signal_handlers_disconnect_by_func (last_actor, G_CALLBACK (unset_motion_last_actor), - event->motion.device); + device); } if (motion_current_actor && last_actor != motion_current_actor) { g_signal_connect (motion_current_actor, "destroy", G_CALLBACK (unset_motion_last_actor), - event->motion.device); + device); } - if (event->motion.device != NULL) - event->motion.device->motion_last_actor = motion_current_actor; + if (device != NULL) + device->motion_last_actor = motion_current_actor; else context->motion_last_actor = motion_current_actor; } @@ -2011,12 +2141,10 @@ CLUTTER_NOTE (EVENT, "Reactive event received at %i, %i - actor: %p", x, y, actor); - if (event->type == CLUTTER_MOTION) - { - /* Generate enter leave events (if any) */ - generate_enter_leave_events (event); - } - else /* (button event) */ + /* Create, enter/leave events if needed */ + generate_enter_leave_events (event); + + if (event->type != CLUTTER_MOTION) { /* Generate click count */ event_click_count_generate (event); @@ -2089,6 +2217,9 @@ initialised = TRUE; + bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + /* initialise GLib type system */ g_type_init (); @@ -2459,49 +2590,92 @@ clutter_clear_glyph_cache (void) { if (CLUTTER_CONTEXT ()->font_map) - pango_clutter_font_map_clear_glyph_cache (CLUTTER_CONTEXT ()->font_map); + cogl_pango_font_map_clear_glyph_cache (CLUTTER_CONTEXT ()->font_map); } /** - * clutter_set_use_mipmapped_text: - * @value: %TRUE to enable mipmapping or %FALSE to disable. + * clutter_set_font_flags: + * @flags: The new flags * - * Sets whether subsequent text rendering operations will use - * mipmapped textures or not. Using mipmapped textures will improve - * the quality for scaled down text but will use more texture memory. + * Sets the font quality options for subsequent text rendering + * operations. * - * Since: 0.8 + * Using mipmapped textures will improve the quality for scaled down + * text but will use more texture memory. + * + * Enabling hinting improves text quality for static text but may + * introduce some artifacts if the text is animated. + * + * Since: 1.0 */ void -clutter_set_use_mipmapped_text (gboolean value) +clutter_set_font_flags (ClutterFontFlags flags) { + ClutterFontFlags old_flags, changed_flags; + cairo_font_options_t *font_options; + if (CLUTTER_CONTEXT ()->font_map) - pango_clutter_font_map_set_use_mipmapping (CLUTTER_CONTEXT ()->font_map, - value); + cogl_pango_font_map_set_use_mipmapping (CLUTTER_CONTEXT ()->font_map, + (flags + & CLUTTER_FONT_MIPMAPPING) != 0); + + old_flags = clutter_get_font_flags (); + + font_options = clutter_backend_get_font_options (CLUTTER_CONTEXT ()->backend); + font_options = cairo_font_options_copy (font_options); + + /* Only set the font options that have actually changed so we don't + override a detailed setting from the backend */ + changed_flags = old_flags ^ flags; + + if ((changed_flags & CLUTTER_FONT_HINTING)) + cairo_font_options_set_hint_style (font_options, + (flags & CLUTTER_FONT_HINTING) + ? CAIRO_HINT_STYLE_FULL + : CAIRO_HINT_STYLE_NONE); + + clutter_backend_set_font_options (CLUTTER_CONTEXT ()->backend, font_options); + + cairo_font_options_destroy (font_options); + + if (CLUTTER_CONTEXT ()->pango_context) + update_pango_context (CLUTTER_CONTEXT ()->backend, + CLUTTER_CONTEXT ()->pango_context); } /** - * clutter_get_use_mipmapped_text: + * clutter_get_font_flags: * - * Gets whether mipmapped textures are used in text operations. - * See clutter_set_use_mipmapped_text(). + * Gets the current font flags for rendering text. See + * clutter_set_font_flags(). * - * Return value: %TRUE if text operations should use mipmapped - * textures + * Return value: The font flags * - * Since: 0.8 + * Since: 1.0 */ -gboolean -clutter_get_use_mipmapped_text (void) +ClutterFontFlags +clutter_get_font_flags (void) { - PangoClutterFontMap *font_map = NULL; + ClutterMainContext *ctxt = CLUTTER_CONTEXT (); + CoglPangoFontMap *font_map = NULL; + cairo_font_options_t *font_options; + ClutterFontFlags flags = 0; font_map = CLUTTER_CONTEXT ()->font_map; - if (font_map) - return pango_clutter_font_map_get_use_mipmapping (font_map); + if (G_LIKELY (font_map) + && cogl_pango_font_map_get_use_mipmapping (font_map)) + flags |= CLUTTER_FONT_MIPMAPPING; + + font_options = clutter_backend_get_font_options (ctxt->backend); + + if ((cairo_font_options_get_hint_style (font_options) + != CAIRO_HINT_STYLE_DEFAULT) + && (cairo_font_options_get_hint_style (font_options) + != CAIRO_HINT_STYLE_NONE)) + flags |= CLUTTER_FONT_HINTING; - return FALSE; + return flags; } /** @@ -2535,3 +2709,25 @@ return NULL; } + +/** + * clutter_get_font_map: + * + * Retrieves the #PangoFontMap instance used by Clutter. + * You can use the global font map object with the COGL + * Pango API. + * + * Return value: the #PangoFontMap instance. The returned + * value is owned by Clutter and it should never be + * unreferenced. + * + * Since: 1.0 + */ +PangoFontMap * +clutter_get_font_map (void) +{ + if (CLUTTER_CONTEXT ()->font_map) + return PANGO_FONT_MAP (CLUTTER_CONTEXT ()->font_map); + + return NULL; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-main.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-main.h --- clutter-0.8.4/clutter/clutter-main.h 2008-10-21 19:45:02.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-main.h 2009-01-28 16:45:24.000000000 +0000 @@ -18,16 +18,19 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ -#ifndef _HAVE_CLUTTER_MAIN_H -#define _HAVE_CLUTTER_MAIN_H +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_MAIN_H__ +#define __CLUTTER_MAIN_H__ #include #include +#include G_BEGIN_DECLS @@ -152,8 +155,8 @@ ClutterActor * clutter_get_keyboard_grab (void); void clutter_clear_glyph_cache (void); -void clutter_set_use_mipmapped_text (gboolean value); -gboolean clutter_get_use_mipmapped_text (void); +void clutter_set_font_flags (ClutterFontFlags flags); +ClutterFontFlags clutter_get_font_flags (void); ClutterInputDevice* clutter_get_input_device_for_id (gint id); @@ -162,7 +165,8 @@ void clutter_ungrab_pointer_for_device (gint id); +PangoFontMap * clutter_get_font_map (void); G_END_DECLS -#endif /* _HAVE_CLUTTER_MAIN_H */ +#endif /* _CLUTTER_MAIN_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-marshal.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-marshal.c --- clutter-0.8.4/clutter/clutter-marshal.c 2008-12-01 11:38:25.000000000 +0000 +++ clutter-0.9.0/clutter/clutter-marshal.c 2009-01-30 12:34:12.000000000 +0000 @@ -87,7 +87,87 @@ g_value_set_boolean (return_value, v_return); } -/* UINT:VOID (./clutter-marshal.list:2) */ +/* BOOLEAN:STRING,UINT,ENUM (./clutter-marshal.list:2) */ +void +clutter_marshal_BOOLEAN__STRING_UINT_ENUM (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_UINT_ENUM) (gpointer data1, + gpointer arg_1, + guint arg_2, + gint arg_3, + gpointer data2); + register GMarshalFunc_BOOLEAN__STRING_UINT_ENUM callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + gboolean v_return; + + g_return_if_fail (return_value != NULL); + g_return_if_fail (n_param_values == 4); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_BOOLEAN__STRING_UINT_ENUM) (marshal_data ? marshal_data : cc->callback); + + v_return = callback (data1, + g_marshal_value_peek_string (param_values + 1), + g_marshal_value_peek_uint (param_values + 2), + g_marshal_value_peek_enum (param_values + 3), + data2); + + g_value_set_boolean (return_value, v_return); +} + +/* DOUBLE:VOID (./clutter-marshal.list:3) */ +void +clutter_marshal_DOUBLE__VOID (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef gdouble (*GMarshalFunc_DOUBLE__VOID) (gpointer data1, + gpointer data2); + register GMarshalFunc_DOUBLE__VOID callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + gdouble v_return; + + g_return_if_fail (return_value != NULL); + g_return_if_fail (n_param_values == 1); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_DOUBLE__VOID) (marshal_data ? marshal_data : cc->callback); + + v_return = callback (data1, + data2); + + g_value_set_double (return_value, v_return); +} + +/* UINT:VOID (./clutter-marshal.list:4) */ void clutter_marshal_UINT__VOID (GClosure *closure, GValue *return_value G_GNUC_UNUSED, @@ -124,11 +204,11 @@ g_value_set_uint (return_value, v_return); } -/* VOID:BOXED (./clutter-marshal.list:3) */ +/* VOID:BOXED (./clutter-marshal.list:5) */ -/* VOID:INT (./clutter-marshal.list:4) */ +/* VOID:INT (./clutter-marshal.list:6) */ -/* VOID:INT64,INT64,FLOAT,BOOLEAN (./clutter-marshal.list:5) */ +/* VOID:INT64,INT64,FLOAT,BOOLEAN (./clutter-marshal.list:7) */ void clutter_marshal_VOID__INT64_INT64_FLOAT_BOOLEAN (GClosure *closure, GValue *return_value G_GNUC_UNUSED, @@ -169,7 +249,7 @@ data2); } -/* VOID:INT,INT (./clutter-marshal.list:6) */ +/* VOID:INT,INT (./clutter-marshal.list:8) */ void clutter_marshal_VOID__INT_INT (GClosure *closure, GValue *return_value G_GNUC_UNUSED, @@ -206,7 +286,7 @@ data2); } -/* VOID:INT,INT,INT,INT (./clutter-marshal.list:7) */ +/* VOID:INT,INT,INT,INT (./clutter-marshal.list:9) */ void clutter_marshal_VOID__INT_INT_INT_INT (GClosure *closure, GValue *return_value G_GNUC_UNUSED, @@ -247,9 +327,9 @@ data2); } -/* VOID:OBJECT (./clutter-marshal.list:8) */ +/* VOID:OBJECT (./clutter-marshal.list:10) */ -/* VOID:OBJECT,OBJECT,PARAM (./clutter-marshal.list:9) */ +/* VOID:OBJECT,OBJECT,PARAM (./clutter-marshal.list:11) */ void clutter_marshal_VOID__OBJECT_OBJECT_PARAM (GClosure *closure, GValue *return_value G_GNUC_UNUSED, @@ -288,7 +368,7 @@ data2); } -/* VOID:OBJECT,POINTER (./clutter-marshal.list:10) */ +/* VOID:OBJECT,POINTER (./clutter-marshal.list:12) */ void clutter_marshal_VOID__OBJECT_POINTER (GClosure *closure, GValue *return_value G_GNUC_UNUSED, @@ -325,7 +405,7 @@ data2); } -/* VOID:STRING,BOOLEAN,BOOLEAN (./clutter-marshal.list:11) */ +/* VOID:STRING,BOOLEAN,BOOLEAN (./clutter-marshal.list:13) */ void clutter_marshal_VOID__STRING_BOOLEAN_BOOLEAN (GClosure *closure, GValue *return_value G_GNUC_UNUSED, @@ -364,7 +444,7 @@ data2); } -/* VOID:STRING,INT (./clutter-marshal.list:12) */ +/* VOID:STRING,INT (./clutter-marshal.list:14) */ void clutter_marshal_VOID__STRING_INT (GClosure *closure, GValue *return_value G_GNUC_UNUSED, @@ -401,5 +481,7 @@ data2); } -/* VOID:VOID (./clutter-marshal.list:13) */ +/* VOID:UINT (./clutter-marshal.list:15) */ + +/* VOID:VOID (./clutter-marshal.list:16) */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-marshal.list /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-marshal.list --- clutter-0.8.4/clutter/clutter-marshal.list 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-marshal.list 2009-01-28 08:12:45.000000000 +0000 @@ -1,4 +1,6 @@ BOOLEAN:BOXED +BOOLEAN:STRING,UINT,ENUM +DOUBLE:VOID UINT:VOID VOID:BOXED VOID:INT @@ -10,4 +12,5 @@ VOID:OBJECT,POINTER VOID:STRING,BOOLEAN,BOOLEAN VOID:STRING,INT +VOID:UINT VOID:VOID diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-media.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-media.c --- clutter-0.8.4/clutter/clutter-media.c 2008-11-13 14:54:53.000000000 +0000 +++ clutter-0.9.0/clutter/clutter-media.c 2009-01-28 08:12:45.000000000 +0000 @@ -3,9 +3,11 @@ * * An OpenGL based 'interactive canvas' library. * - * Authored By Matthew Allum + * Authored By: Matthew Allum + * Emmanuele Bassi * * Copyright (C) 2006 OpenedHand + * Copyright (C) 2009 Intel Corp. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,22 +20,20 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ /** * SECTION:clutter-media - * @short_description: An interface for controlling playback of media data. + * @short_description: An interface for controlling playback of media data * * #ClutterMedia is an interface for controlling playback of media sources. * - * It is not implemented inside Clutter, but other integration libraries - * like Clutter-GStreamer, implement it to offer a uniform API for - * applications. + * Clutter core does not provide an implementation of this interface, but + * other integration libraries like Clutter-GStreamer implement it to offer + * a uniform API for applications. * - * ClutterMedia is available since Clutter 0.2 + * #ClutterMedia is available since Clutter 0.2 */ #ifdef HAVE_CONFIG_H @@ -47,124 +47,125 @@ enum { - EOS, - ERROR, + EOS_SIGNAL, + ERROR_SIGNAL, /* can't be called 'ERROR' otherwise it clashes with wingdi.h */ LAST_SIGNAL }; -static void clutter_media_base_init (gpointer g_class); - static guint media_signals[LAST_SIGNAL] = { 0, }; -GType -clutter_media_get_type (void) +static void +clutter_media_base_init (gpointer g_iface) { - static GType media_type = 0; + static gboolean was_initialized = FALSE; - if (!media_type) + if (G_UNLIKELY (!was_initialized)) { - static const GTypeInfo media_info = - { - sizeof (ClutterMediaInterface), - clutter_media_base_init, - NULL, - }; + GParamSpec *pspec = NULL; - media_type = g_type_register_static (G_TYPE_INTERFACE, "ClutterMedia", - &media_info, 0); - } + was_initialized = TRUE; - return media_type; -} + /** + * ClutterMedia:uri: + * + * The location of a media file, expressed as a valid URI. + * + * Since: 0.2 + */ + pspec = g_param_spec_string ("uri", + "URI", + "URI of a media file", + NULL, + CLUTTER_PARAM_READWRITE); + g_object_interface_install_property (g_iface, pspec); -static void -clutter_media_base_init (gpointer g_iface) -{ - static gboolean initialized = FALSE; + /** + * ClutterMedia:playing: + * + * Whether the #ClutterMedia actor is playing. + * + * Since: 0.2 + */ + pspec = g_param_spec_boolean ("playing", + "Playing", + "Wheter the actor is playing", + FALSE, + CLUTTER_PARAM_READWRITE); + g_object_interface_install_property (g_iface, pspec); - if (G_UNLIKELY (!initialized)) - { - initialized = TRUE; + /** + * ClutterMedia:progress: + * + * The current progress of the playback, as a normalized + * value between 0.0 and 1.0. + * + * Since: 1.0 + */ + pspec = g_param_spec_double ("progress", + "Progress", + "Current progress of the playback", + 0.0, 1.0, 0.0, + CLUTTER_PARAM_READWRITE); + g_object_interface_install_property (g_iface, pspec); - /* props */ + /** + * ClutterMedia:audio-volume: + * + * The volume of the audio, as a normalized value between + * 0.0 and 1.0. + * + * Since: 1.0 + */ + pspec = g_param_spec_double ("audio-volume", + "Audio Volume", + "The volume of the audio", + 0.0, 1.0, 0.5, + CLUTTER_PARAM_READWRITE); + g_object_interface_install_property (g_iface, pspec); - g_object_interface_install_property - (g_iface, - g_param_spec_string - ("uri", - "URI", - "The loaded URI.", - NULL, - G_PARAM_READWRITE | - G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB)); - - g_object_interface_install_property - (g_iface, - g_param_spec_boolean - ("playing", - "Playing", - "TRUE if playing.", - FALSE, - G_PARAM_READWRITE | - G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB)); - - g_object_interface_install_property - (g_iface, - g_param_spec_int - ("position", - "Position", - "The position in the current stream in seconds.", - 0, G_MAXINT, 0, - G_PARAM_READWRITE | - G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB)); - - g_object_interface_install_property - (g_iface, - g_param_spec_double - ("volume", - "Volume", - "The audio volume.", - 0, 100, 50, - G_PARAM_READWRITE | - G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB)); - - g_object_interface_install_property - (g_iface, - g_param_spec_boolean - ("can-seek", - "Can seek", - "TRUE if the current stream is seekable.", - FALSE, - G_PARAM_READABLE | - G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB)); - - g_object_interface_install_property - (g_iface, - g_param_spec_int - ("buffer-percent", - "Buffer percent", - "The percentage the current stream buffer is filled.", - 0, 100, 0, - G_PARAM_READABLE | - G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB)); - - g_object_interface_install_property - (g_iface, - g_param_spec_int - ("duration", - "Duration", - "The duration of the current stream in seconds.", - 0, G_MAXINT, 0, - G_PARAM_READABLE | - G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB)); + /** + * ClutterMedia:can-seek: + * + * Whether the current stream is seekable. + * + * Since: 0.2 + */ + pspec = g_param_spec_boolean ("can-seek", + "Can Seek", + "Whether the current stream is seekable", + FALSE, + CLUTTER_PARAM_READABLE); + g_object_interface_install_property (g_iface, pspec); + + /** + * ClutterMedia:buffer-fill: + * + * The fill level of the buffer for the current stream, + * as a value between 0.0 and 1.0. + * + * Since: 1.0 + */ + pspec = g_param_spec_double ("buffer-fill", + "Buffer Fill", + "The fill level of the buffer", + 0.0, 1.0, 0.0, + CLUTTER_PARAM_READABLE); + g_object_interface_install_property (g_iface, pspec); + + /** + * ClutterMedia:duration: + * + * The duration of the current stream, in seconds + * + * Since: 0.2 + */ + pspec = g_param_spec_uint ("duration", + "Duration", + "The duration of the stream, in seconds", + 0, G_MAXUINT, 0, + CLUTTER_PARAM_READABLE); + g_object_interface_install_property (g_iface, pspec); /** * ClutterMedia::eos: @@ -174,11 +175,11 @@ * * Since: 0.2 */ - media_signals[EOS] = + media_signals[EOS_SIGNAL] = g_signal_new ("eos", CLUTTER_TYPE_MEDIA, G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ClutterMediaInterface, eos), + G_STRUCT_OFFSET (ClutterMediaIface, eos), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); @@ -191,11 +192,11 @@ * * Since: 0.2 */ - media_signals[ERROR] = + media_signals[ERROR_SIGNAL] = g_signal_new ("error", CLUTTER_TYPE_MEDIA, G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ClutterMediaInterface, error), + G_STRUCT_OFFSET (ClutterMediaIface, error), NULL, NULL, g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, @@ -203,10 +204,32 @@ } } + +GType +clutter_media_get_type (void) +{ + static GType media_type = 0; + + if (G_UNLIKELY (media_type == 0)) + { + const GTypeInfo media_info = { + sizeof (ClutterMediaIface), /* class size */ + clutter_media_base_init, /* base_init */ + NULL, /* base_finalize */ + }; + + media_type = g_type_register_static (G_TYPE_INTERFACE, + I_("ClutterMedia"), + &media_info, 0); + } + + return media_type; +} + /** * clutter_media_set_uri: - * @media: #ClutterMedia object - * @uri: URI + * @media: a #ClutterMedia + * @uri: the URI of the media stream * * Sets the URI of @media to @uri. * @@ -214,37 +237,42 @@ */ void clutter_media_set_uri (ClutterMedia *media, - const char *uri) + const gchar *uri) { g_return_if_fail (CLUTTER_IS_MEDIA(media)); - CLUTTER_MEDIA_GET_INTERFACE (media)->set_uri (media, uri); + g_object_set (G_OBJECT (media), "uri", uri, NULL); } /** * clutter_media_get_uri: - * @media: A #ClutterMedia object + * @media: a #ClutterMedia * * Retrieves the URI from @media. * - * Return value: The URI as a string. + * Return value: the URI of the media stream. Use g_free() + * to free the returned string * * Since: 0.2 */ -const char* +gchar * clutter_media_get_uri (ClutterMedia *media) { + gchar *retval = NULL; + g_return_val_if_fail (CLUTTER_IS_MEDIA(media), NULL); - return CLUTTER_MEDIA_GET_INTERFACE (media)->get_uri (media); + g_object_get (G_OBJECT (media), "uri", &retval, NULL); + + return retval; } /** * clutter_media_set_playing: - * @media: A #ClutterMedia object - * @playing: TRUE to start playing, FALSE to stop. + * @media: a #ClutterMedia + * @playing: %TRUE to start playing * - * Starts or stops @media playing. + * Starts or stops playing of @media. * * Since: 0.2 */ @@ -254,7 +282,7 @@ { g_return_if_fail (CLUTTER_IS_MEDIA(media)); - CLUTTER_MEDIA_GET_INTERFACE (media)->set_playing (media, playing); + g_object_set (G_OBJECT (media), "playing", playing, NULL); } /** @@ -270,86 +298,99 @@ gboolean clutter_media_get_playing (ClutterMedia *media) { - g_return_val_if_fail (CLUTTER_IS_MEDIA(media), FALSE); + gboolean is_playing = FALSE; + + g_return_val_if_fail (CLUTTER_IS_MEDIA (media), FALSE); + + g_object_get (G_OBJECT (media), "playing", &is_playing, NULL); - return CLUTTER_MEDIA_GET_INTERFACE (media)->get_playing (media); + return is_playing; } /** - * clutter_media_set_position: - * @media: A #ClutterMedia object - * @position: The desired position. + * clutter_media_set_progress: + * @media: a #ClutterMedia + * @progress: the progress of the playback, between 0.0 and 1.0 * - * Sets the playback position of @media to @position. + * Sets the playback progress of @media. The @progress is + * a normalized value between 0.0 (begin) and 1.0 (end). * - * Since: 0.2 + * Since: 1.0 */ void -clutter_media_set_position (ClutterMedia *media, - int position) +clutter_media_set_progress (ClutterMedia *media, + gdouble progress) { - g_return_if_fail (CLUTTER_IS_MEDIA(media)); + g_return_if_fail (CLUTTER_IS_MEDIA (media)); - CLUTTER_MEDIA_GET_INTERFACE (media)->set_position (media, position); + g_object_set (G_OBJECT (media), "progress", progress, NULL); } /** - * clutter_media_get_position: - * @media: A #ClutterMedia object + * clutter_media_get_progress: + * @media: a #ClutterMedia * - * Retrieves the position of @media. + * Retrieves the playback progress of @media. * - * Return value: The playback position. + * Return value: the playback progress, between 0.0 and 1.0 * - * Since: 0.2 + * Since: 1.0 */ -int -clutter_media_get_position (ClutterMedia *media) +gdouble +clutter_media_get_progress (ClutterMedia *media) { - g_return_val_if_fail (CLUTTER_IS_MEDIA(media), 0); + gdouble retval = 0.0; - return CLUTTER_MEDIA_GET_INTERFACE (media)->get_position (media); + g_return_val_if_fail (CLUTTER_IS_MEDIA (media), 0); + + g_object_get (G_OBJECT (media), "progress", &retval, NULL); + + return retval; } /** - * clutter_media_set_volume: - * @media: A #ClutterMedia object - * @volume: The volume as a double between 0.0 and 1.0 + * clutter_media_set_audio_volume: + * @media: a #ClutterMedia + * @volume: the volume as a double between 0.0 and 1.0 * * Sets the playback volume of @media to @volume. * - * Since: 0.2 + * Since: 1.0 */ void -clutter_media_set_volume (ClutterMedia *media, - double volume) +clutter_media_set_audio_volume (ClutterMedia *media, + gdouble volume) { g_return_if_fail (CLUTTER_IS_MEDIA(media)); - CLUTTER_MEDIA_GET_INTERFACE (media)->set_volume (media, volume); + g_object_set (G_OBJECT (media), "audio-volume", volume, NULL); } /** - * clutter_media_get_volume: - * @media: A #ClutterMedia object + * clutter_media_get_audio_volume: + * @media: a #ClutterMedia * * Retrieves the playback volume of @media. * * Return value: The playback volume between 0.0 and 1.0 * - * Since: 0.2 + * Since: 1.0 */ -double -clutter_media_get_volume (ClutterMedia *media) +gdouble +clutter_media_get_audio_volume (ClutterMedia *media) { - g_return_val_if_fail (CLUTTER_IS_MEDIA(media), 0.0); + gdouble retval = 0.0; - return CLUTTER_MEDIA_GET_INTERFACE (media)->get_volume (media); + g_return_val_if_fail (CLUTTER_IS_MEDIA (media), 0.0); + + g_object_get (G_OBJECT (media), "audio-volume", &retval, NULL); + + return retval; } /** * clutter_media_get_can_seek: - * @media: A #ClutterMedia object + * @media: a #ClutterMedia * * Retrieves whether @media is seekable or not. * @@ -360,55 +401,67 @@ gboolean clutter_media_get_can_seek (ClutterMedia *media) { - g_return_val_if_fail (CLUTTER_IS_MEDIA(media), FALSE); + gboolean retval = FALSE; - return CLUTTER_MEDIA_GET_INTERFACE (media)->can_seek (media); + g_return_val_if_fail (CLUTTER_IS_MEDIA (media), FALSE); + + g_object_get (G_OBJECT (media), "can-seek", &retval, NULL); + + return retval; } /** - * clutter_media_get_buffer_percent: - * @media: A #ClutterMedia object + * clutter_media_get_buffer_fill: + * @media: a #ClutterMedia * * Retrieves the amount of the stream that is buffered. * - * Return value: percentage value + * Return value: the fill level, between 0.0 and 1.0 * - * Since: 0.2 + * Since: 1.0 */ -int -clutter_media_get_buffer_percent (ClutterMedia *media) +gdouble +clutter_media_get_buffer_fill (ClutterMedia *media) { - g_return_val_if_fail (CLUTTER_IS_MEDIA(media), 0); + gdouble retval = 0.0; + + g_return_val_if_fail (CLUTTER_IS_MEDIA (media), 0); - return CLUTTER_MEDIA_GET_INTERFACE (media)->get_buffer_percent (media); + g_object_get (G_OBJECT (media), "buffer-fill", &retval, NULL); + + return retval; } /** * clutter_media_get_duration: - * @media: A #ClutterMedia object + * @media: a #ClutterMedia * * Retrieves the duration of the media stream that @media represents. * - * Return value: The length of the media stream. + * Return value: the duration of the media stream, in seconds * * Since: 0.2 */ -int +guint clutter_media_get_duration (ClutterMedia *media) { + guint retval = 0; + g_return_val_if_fail (CLUTTER_IS_MEDIA(media), 0); - return CLUTTER_MEDIA_GET_INTERFACE (media)->get_duration (media); + g_object_get (G_OBJECT (media), "duration", &retval, NULL); + + return retval; } /* helper funcs */ /** * clutter_media_set_filename: - * @media: A #ClutterMedia object - * @filename: A filename to media file. + * @media: a #ClutterMedia + * @filename: A filename * - * Sets the filename of the media source. + * Sets the source of @media using a file path. * * Since: 0.2 */ @@ -432,7 +485,7 @@ if (uri_error) { - g_signal_emit (media, media_signals[ERROR], 0, uri_error); + g_signal_emit (media, media_signals[ERROR_SIGNAL], 0, uri_error); g_error_free (uri_error); return; } diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-media.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-media.h --- clutter-0.8.4/clutter/clutter-media.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-media.h 2009-01-28 08:12:45.000000000 +0000 @@ -3,9 +3,11 @@ * * An OpenGL based 'interactive canvas' library. * - * Authored By Matthew Allum + * Authored By: Matthew Allum + * Emmanuele Bassi * * Copyright (C) 2006 OpenedHand + * Copyright (C) 2009 Intel Corp. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,103 +20,60 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ -#ifndef _HAVE_CLUTTER_MEDIA_H -#define _HAVE_CLUTTER_MEDIA_H +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_MEDIA_H__ +#define __CLUTTER_MEDIA_H__ #include G_BEGIN_DECLS -#define CLUTTER_TYPE_MEDIA clutter_media_get_type() - -#define CLUTTER_MEDIA(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - CLUTTER_TYPE_MEDIA, ClutterMedia)) - -#define CLUTTER_IS_MEDIA(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - CLUTTER_TYPE_MEDIA)) - -#define CLUTTER_MEDIA_GET_INTERFACE(obj) \ - (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \ - CLUTTER_TYPE_MEDIA, ClutterMediaInterface)) +#define CLUTTER_TYPE_MEDIA (clutter_media_get_type ()) +#define CLUTTER_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_MEDIA, ClutterMedia)) +#define CLUTTER_IS_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_MEDIA)) +#define CLUTTER_MEDIA_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_MEDIA, ClutterMediaInterface)) -typedef struct _ClutterMedia ClutterMedia; -typedef struct _ClutterMediaInterface ClutterMediaInterface; +typedef struct _ClutterMedia ClutterMedia; /* dummy typedef */ +typedef struct _ClutterMediaIface ClutterMediaIface; -struct _ClutterMediaInterface +struct _ClutterMediaIface { - GTypeInterface base_iface; - void (*set_uri) (ClutterMedia *media, - const char *uri); - const char *(*get_uri) (ClutterMedia *media); - void (*set_playing) (ClutterMedia *media, - gboolean playing); - gboolean (*get_playing) (ClutterMedia *media); - void (*set_position) (ClutterMedia *media, - int position); - int (*get_position) (ClutterMedia *media); - void (*set_volume) (ClutterMedia *media, - double volume); - double (*get_volume) (ClutterMedia *media); - gboolean (*can_seek) (ClutterMedia *media); - int (*get_buffer_percent) (ClutterMedia *media); - int (*get_duration) (ClutterMedia *media); + /*< private >*/ + GTypeInterface base_iface; /* signals */ - void (* eos) (ClutterMedia *media); - void (* error) (ClutterMedia *media, - GError *error); + void (* eos) (ClutterMedia *media); + void (* error) (ClutterMedia *media, + const GError *error); }; +GType clutter_media_get_type (void) G_GNUC_CONST; -GType clutter_media_get_type (void); - -void -clutter_media_set_uri (ClutterMedia *media, - const char *uri); -const char * -clutter_media_get_uri (ClutterMedia *media); - -void -clutter_media_set_playing (ClutterMedia *media, - gboolean playing); - -gboolean -clutter_media_get_playing (ClutterMedia *media); - -void -clutter_media_set_position (ClutterMedia *media, - int position); - -int -clutter_media_get_position (ClutterMedia *media); - -void -clutter_media_set_volume (ClutterMedia *media, - double volume); - -double -clutter_media_get_volume (ClutterMedia *media); - -gboolean -clutter_media_get_can_seek (ClutterMedia *media); - -int -clutter_media_get_buffer_percent (ClutterMedia *media); - -int -clutter_media_get_duration (ClutterMedia *media); - -void -clutter_media_set_filename (ClutterMedia *media, - const gchar *filename); +void clutter_media_set_uri (ClutterMedia *media, + const gchar *uri); +gchar * clutter_media_get_uri (ClutterMedia *media); +void clutter_media_set_filename (ClutterMedia *media, + const gchar *filename); + +void clutter_media_set_playing (ClutterMedia *media, + gboolean playing); +gboolean clutter_media_get_playing (ClutterMedia *media); +void clutter_media_set_progress (ClutterMedia *media, + gdouble progress); +gdouble clutter_media_get_progress (ClutterMedia *media); +void clutter_media_set_audio_volume (ClutterMedia *media, + gdouble volume); +gdouble clutter_media_get_audio_volume (ClutterMedia *media); +gboolean clutter_media_get_can_seek (ClutterMedia *media); +gdouble clutter_media_get_buffer_fill (ClutterMedia *media); +guint clutter_media_get_duration (ClutterMedia *media); G_END_DECLS -#endif +#endif /* __CLUTTER_MEDIA_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-model.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-model.h --- clutter-0.8.4/clutter/clutter-model.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-model.h 2009-01-28 08:12:45.000000000 +0000 @@ -20,15 +20,16 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __CLUTTER_MODEL_H__ #define __CLUTTER_MODEL_H__ -#include #include G_BEGIN_DECLS diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-path.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-path.c --- clutter-0.8.4/clutter/clutter-path.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-path.c 2009-01-28 08:12:45.000000000 +0000 @@ -0,0 +1,1549 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Authored By Matthew Allum + * + * Copyright (C) 2008 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 . + */ + +/** + * SECTION:clutter-path + * @short_description: An object describing a path with straight lines + * and bezier curves. + * + * A #ClutterPath contains a description of a path consisting of + * straight lines and bezier curves. This can be used in a + * #ClutterBehaviourPath to animate an actor moving along the path. + * + * The path consists of a series of nodes. Each node is one of the + * following four types: + * + * + * %CLUTTER_PATH_MOVE_TO + * + * Changes the position of the path to the given pair of + * coordinates. This is usually used as the first node of a path to + * mark the start position. If it is used in the middle of a path then + * the path will be disjoint and the actor will appear to jump to the + * new position when animated. + * + * %CLUTTER_PATH_LINE_TO + * + * Creates a straight line from the previous point to the given point. + * + * %CLUTTER_PATH_CURVE_TO + * + * Creates a bezier curve. The end of the last node is used as the + * first control point and the three subsequent coordinates given in + * the node as used as the other three. + * + * %CLUTTER_PATH_CLOSE + * + * Creates a straight line from the last node to the last + * %CLUTTER_PATH_MOVE_TO node. This can be used to close a path so + * that it will appear as a loop when animated. + * + * + * + * The first three types have the corresponding relative versions + * %CLUTTER_PATH_REL_MOVE_TO, %CLUTTER_PATH_REL_LINE_TO and + * %CLUTTER_PATH_REL_CURVE_TO. These are exactly the same except the + * coordinates are given relative to the previous node instead of as + * direct screen positions. + * + * You can build a path using the node adding functions such as + * clutter_path_add_line_to(). Alternatively the path can be described + * in a string using a subset of the SVG path syntax. See + * clutter_path_add_string() for details. + * + * #ClutterPath is available since Clutter 1.0 + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#include "clutter-path.h" +#include "clutter-types.h" +#include "clutter-bezier.h" +#include "clutter-private.h" + +G_DEFINE_TYPE (ClutterPath, clutter_path, G_TYPE_INITIALLY_UNOWNED); + +#define CLUTTER_PATH_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_PATH, \ + ClutterPathPrivate)) + +#define CLUTTER_PATH_NODE_TYPE_IS_VALID(t) \ + ((((t) & ~CLUTTER_PATH_RELATIVE) >= CLUTTER_PATH_MOVE_TO \ + && ((t) & ~CLUTTER_PATH_RELATIVE) <= CLUTTER_PATH_CURVE_TO) \ + || (t) == CLUTTER_PATH_CLOSE) + +enum +{ + PROP_0, + + PROP_DESCRIPTION, + PROP_LENGTH +}; + +typedef struct _ClutterPathNodeFull ClutterPathNodeFull; + +struct _ClutterPathNodeFull +{ + ClutterPathNode k; + + ClutterBezier *bezier; + + guint length; +}; + +struct _ClutterPathPrivate +{ + GSList *nodes, *nodes_tail; + gboolean nodes_dirty; + + guint total_length; +}; + +/* Character tests that don't pay attention to the locale */ +#define clutter_path_isspace(ch) memchr (" \f\n\r\t\v", (ch), 6) +#define clutter_path_isdigit(ch) ((ch) >= '0' && (ch) <= '9') + +static ClutterPathNodeFull *clutter_path_node_full_new (void); +static void clutter_path_node_full_free (ClutterPathNodeFull *node); + +static void clutter_path_finalize (GObject *object); + +static void +clutter_path_get_property (GObject *gobject, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + ClutterPath *path = CLUTTER_PATH (gobject); + + switch (prop_id) + { + case PROP_DESCRIPTION: + g_value_take_string (value, clutter_path_get_description (path)); + break; + case PROP_LENGTH: + g_value_set_uint (value, clutter_path_get_length (path)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +clutter_path_set_property (GObject *gobject, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + ClutterPath *path = CLUTTER_PATH (gobject); + + switch (prop_id) + { + case PROP_DESCRIPTION: + if (!clutter_path_set_description (path, g_value_get_string (value))) + g_warning ("Invalid path description"); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +clutter_path_class_init (ClutterPathClass *klass) +{ + GObjectClass *gobject_class = (GObjectClass *) klass; + GParamSpec *pspec; + + gobject_class->get_property = clutter_path_get_property; + gobject_class->set_property = clutter_path_set_property; + gobject_class->finalize = clutter_path_finalize; + + pspec = g_param_spec_string ("description", + "Description", + "SVG-style description of the path", + "", + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_DESCRIPTION, pspec); + + pspec = g_param_spec_uint ("length", + "Length", + "An approximation of the total length " + "of the path.", + 0, G_MAXUINT, 0, + CLUTTER_PARAM_READABLE); + g_object_class_install_property (gobject_class, PROP_LENGTH, pspec); + + g_type_class_add_private (klass, sizeof (ClutterPathPrivate)); +} + +static void +clutter_path_init (ClutterPath *self) +{ + self->priv = CLUTTER_PATH_GET_PRIVATE (self); +} + +static void +clutter_path_finalize (GObject *object) +{ + ClutterPath *self = (ClutterPath *) object; + + clutter_path_clear (self); + + G_OBJECT_CLASS (clutter_path_parent_class)->finalize (object); +} + +/** + * clutter_path_new: + * + * Creates a new #ClutterPath instance with no nodes. + * + * The object has a floating reference so if you add it to a + * #ClutterBehaviourPath then you do not need to unref it. + * + * Return value: the newly created #ClutterPath + * + * Since: 1.0 + */ +ClutterPath * +clutter_path_new (void) +{ + ClutterPath *self = g_object_new (CLUTTER_TYPE_PATH, NULL); + + return self; +} + +/** + * clutter_path_new_with_description: + * @desc: a string describing the path + * + * Creates a new #ClutterPath instance with the nodes described in + * @desc. See clutter_path_add_string() for details of the format of + * the string. + * + * The object has a floating reference so if you add it to a + * #ClutterBehaviourPath then you do not need to unref it. + * + * Return value: the newly created #ClutterPath + * + * Since: 1.0 + */ +ClutterPath * +clutter_path_new_with_description (const gchar *desc) +{ + return g_object_new (CLUTTER_TYPE_PATH, + "description", desc, + NULL); +} + +/** + * clutter_path_clear: + * @path: a #ClutterPath + * + * Removes all nodes from the path. + * + * Since: 1.0 + */ +void +clutter_path_clear (ClutterPath *path) +{ + ClutterPathPrivate *priv = path->priv; + + g_slist_foreach (priv->nodes, (GFunc) clutter_path_node_full_free, NULL); + g_slist_free (priv->nodes); + + priv->nodes = priv->nodes_tail = NULL; + priv->nodes_dirty = TRUE; +} + +/* Takes ownership of the node */ +static void +clutter_path_add_node_full (ClutterPath *path, + ClutterPathNodeFull *node) +{ + ClutterPathPrivate *priv = path->priv; + GSList *new_node; + + new_node = g_slist_prepend (NULL, node); + + if (priv->nodes_tail == NULL) + priv->nodes = new_node; + else + priv->nodes_tail->next = new_node; + + priv->nodes_tail = new_node; + + priv->nodes_dirty = TRUE; +} + +/* Helper function to make the rest of teh add_* functions shorter */ +static void +clutter_path_add_node_helper (ClutterPath *path, + ClutterPathNodeType type, + int num_coords, + ...) +{ + ClutterPathNodeFull *node; + int i; + va_list ap; + + node = clutter_path_node_full_new (); + + node->k.type = type; + + va_start (ap, num_coords); + + for (i = 0; i < num_coords; i++) + { + node->k.points[i].x = va_arg (ap, gint); + node->k.points[i].y = va_arg (ap, gint); + } + + va_end (ap); + + clutter_path_add_node_full (path, node); +} + +/** + * clutter_path_add_move_to: + * @path: a #ClutterPath + * @x: the x coordinate + * @y: the y coordinate + * + * Adds a #CLUTTER_PATH_MOVE_TO type node to the path. This is usually + * used as the first node in a path. It can also be used in the middle + * of the path to cause the actor to jump to the new coordinate. + * + * Since: 1.0 + */ +void +clutter_path_add_move_to (ClutterPath *path, + gint x, + gint y) +{ + g_return_if_fail (CLUTTER_IS_PATH (path)); + + clutter_path_add_node_helper (path, CLUTTER_PATH_MOVE_TO, 1, x, y); +} + +/** + * clutter_path_add_rel_move_to: + * @path: a #ClutterPath + * @x: the x coordinate + * @y: the y coordinate + * + * Same as clutter_path_add_move_to() except the coordinates are + * relative to the previous node. + * + * Since: 1.0 + */ +void +clutter_path_add_rel_move_to (ClutterPath *path, + gint x, + gint y) +{ + g_return_if_fail (CLUTTER_IS_PATH (path)); + + clutter_path_add_node_helper (path, CLUTTER_PATH_REL_MOVE_TO, 1, x, y); +} + +/** + * clutter_path_add_line_to: + * @path: a #ClutterPath + * @x: the x coordinate + * @y: the y coordinate + * + * Adds a #CLUTTER_PATH_LINE_TO type node to the path. This causes the + * actor to move to the new coordinates in a straight line. + * + * Since: 1.0 + */ +void +clutter_path_add_line_to (ClutterPath *path, + gint x, + gint y) +{ + g_return_if_fail (CLUTTER_IS_PATH (path)); + + clutter_path_add_node_helper (path, CLUTTER_PATH_LINE_TO, 1, x, y); +} + +/** + * clutter_path_add_rel_line_to: + * @path: a #ClutterPath + * @x: the x coordinate + * @y: the y coordinate + * + * Same as clutter_path_add_line_to() except the coordinates are + * relative to the previous node. + * + * Since: 1.0 + */ +void +clutter_path_add_rel_line_to (ClutterPath *path, + gint x, + gint y) +{ + g_return_if_fail (CLUTTER_IS_PATH (path)); + + clutter_path_add_node_helper (path, CLUTTER_PATH_REL_LINE_TO, 1, x, y); +} + +/** + * clutter_path_add_curve_to: + * @path: a #ClutterPath + * @x_1: the x coordinate of the first control point + * @y_1: the y coordinate of the first control point + * @x_2: the x coordinate of the second control point + * @y_2: the y coordinate of the second control point + * @x_3: the x coordinate of the third control point + * @y_3: the y coordinate of the third control point + * + * Adds a #CLUTTER_PATH_CURVE_TO type node to the path. This causes + * the actor to follow a bezier from the last node to (@x_3, @y_3) using + * (@x_1, @y_1) and (@x_2,@y_2) as control points. + * + * Since: 1.0 + */ +void +clutter_path_add_curve_to (ClutterPath *path, + gint x_1, + gint y_1, + gint x_2, + gint y_2, + gint x_3, + gint y_3) +{ + g_return_if_fail (CLUTTER_IS_PATH (path)); + + clutter_path_add_node_helper (path, CLUTTER_PATH_CURVE_TO, 3, + x_1, y_1, + x_2, y_2, + x_3, y_3); +} + +/** + * clutter_path_add_rel_curve_to: + * @path: a #ClutterPath + * @x_1: the x coordinate of the first control point + * @y_1: the y coordinate of the first control point + * @x_2: the x coordinate of the second control point + * @y_2: the y coordinate of the second control point + * @x_3: the x coordinate of the third control point + * @y_3: the y coordinate of the third control point + * + * Same as clutter_path_add_curve_to() except the coordinates are + * relative to the previous node. + * + * Since: 1.0 + */ +void +clutter_path_add_rel_curve_to (ClutterPath *path, + gint x_1, + gint y_1, + gint x_2, + gint y_2, + gint x_3, + gint y_3) +{ + g_return_if_fail (CLUTTER_IS_PATH (path)); + + clutter_path_add_node_helper (path, CLUTTER_PATH_REL_CURVE_TO, 3, + x_1, y_1, + x_2, y_2, + x_3, y_3); +} + +/** + * clutter_path_add_close: + * @path: a #ClutterPath + * + * Adds a #CLUTTER_PATH_CLOSE type node to the path. This creates a + * straight line from the last node to the last #CLUTTER_PATH_MOVE_TO + * type node. + * + * Since: 1.0 + */ +void +clutter_path_add_close (ClutterPath *path) +{ + g_return_if_fail (CLUTTER_IS_PATH (path)); + + clutter_path_add_node_helper (path, CLUTTER_PATH_CLOSE, 0); +} + +static gboolean +clutter_path_parse_number (const gchar **pin, + gboolean allow_comma, + gint *ret) +{ + gint val = 0; + gboolean negative = FALSE; + gint digit_count = 0; + const gchar *p = *pin; + + /* Skip leading spaces */ + while (clutter_path_isspace (*p)) + p++; + + /* Optional comma */ + if (allow_comma && *p == ',') + { + p++; + while (clutter_path_isspace (*p)) + p++; + } + + /* Optional sign */ + if (*p == '+') + p++; + else if (*p == '-') + { + negative = TRUE; + p++; + } + + /* Some digits */ + while (clutter_path_isdigit (*p)) + { + val = val * 10 + *p - '0'; + digit_count++; + p++; + } + + /* We need at least one digit */ + if (digit_count < 1) + return FALSE; + + /* Optional fractional part which we ignore */ + if (*p == '.') + { + p++; + digit_count = 0; + while (clutter_path_isdigit (*p)) + { + digit_count++; + p++; + } + /* If there is a fractional part then it also needs at least one + digit */ + if (digit_count < 1) + return FALSE; + } + + *pin = p; + *ret = negative ? -val : val; + + return TRUE; +} + +static gboolean +clutter_path_parse_description (const gchar *p, + GSList **ret) +{ + GSList *nodes = NULL; + ClutterPathNodeFull *node; + + while (TRUE) + { + /* Skip leading whitespace */ + while (clutter_path_isspace (*p)) + p++; + + /* It is not an error to end now */ + if (*p == '\0') + break; + + switch (*p) + { + case 'M': + case 'm': + case 'L': + case 'l': + node = clutter_path_node_full_new (); + nodes = g_slist_prepend (nodes, node); + + node->k.type = (*p == 'M' ? CLUTTER_PATH_MOVE_TO + : *p == 'm' ? CLUTTER_PATH_REL_MOVE_TO + : *p == 'L' ? CLUTTER_PATH_LINE_TO + : CLUTTER_PATH_REL_LINE_TO); + p++; + + if (!clutter_path_parse_number (&p, FALSE, &node->k.points[0].x) + || !clutter_path_parse_number (&p, TRUE, &node->k.points[0].y)) + goto fail; + break; + + case 'C': + case 'c': + node = clutter_path_node_full_new (); + nodes = g_slist_prepend (nodes, node); + + node->k.type = (*p == 'C' ? CLUTTER_PATH_CURVE_TO + : CLUTTER_PATH_REL_CURVE_TO); + p++; + + if (!clutter_path_parse_number (&p, FALSE, &node->k.points[0].x) + || !clutter_path_parse_number (&p, TRUE, &node->k.points[0].y) + || !clutter_path_parse_number (&p, TRUE, &node->k.points[1].x) + || !clutter_path_parse_number (&p, TRUE, &node->k.points[1].y) + || !clutter_path_parse_number (&p, TRUE, &node->k.points[2].x) + || !clutter_path_parse_number (&p, TRUE, &node->k.points[2].y)) + goto fail; + break; + + case 'Z': + case 'z': + node = clutter_path_node_full_new (); + nodes = g_slist_prepend (nodes, node); + p++; + + node->k.type = CLUTTER_PATH_CLOSE; + break; + + default: + goto fail; + } + } + + *ret = g_slist_reverse (nodes); + return TRUE; + + fail: + g_slist_foreach (nodes, (GFunc) clutter_path_node_full_free, NULL); + g_slist_free (nodes); + return FALSE; +} + +/* Takes ownership of the node list */ +static void +clutter_path_add_nodes (ClutterPath *path, + GSList *nodes) +{ + ClutterPathPrivate *priv = path->priv; + + if (priv->nodes_tail == NULL) + priv->nodes = nodes; + else + priv->nodes_tail->next = nodes; + + while (nodes) + { + priv->nodes_tail = nodes; + nodes = nodes->next; + } + + priv->nodes_dirty = TRUE; +} + +/** + * clutter_path_add_string: + * @path: a #ClutterPath + * @str: a string describing the new nodes + * + * Adds new nodes to the end of the path as described in @str. The + * format is a subset of the SVG path format. Each node is represented + * by a letter and is followed by zero, one or three pairs of + * coordinates. The coordinates can be separated by spaces or a + * comma. The types are: + * + * + * M + * + * Adds a %CLUTTER_PATH_MOVE_TO node. Takes one pair of coordinates. + * + * L + * + * Adds a %CLUTTER_PATH_LINE_TO node. Takes one pair of coordinates. + * + * C + * + * Adds a %CLUTTER_PATH_CURVE_TO node. Takes three pairs of coordinates. + * + * z + * + * Adds a %CLUTTER_PATH_CLOSE node. No coordinates are needed. + * + * + * + * The M, L and C commands can also be specified in lower case which + * means the coordinates are relative to the previous node. + * + * For example, to move an actor in a 100 by 100 pixel square centered + * on the point 300,300 you could use the following path: + * + * + * + * M 250,350 l 0 -100 L 350,250 l 0 100 z + * + * + * + * If the path description isn't valid %FALSE will be returned and no + * nodes will be added. + * + * Return value: %TRUE is the path description was valid or %FALSE + * otherwise. + * + * Since: 1.0 + */ +gboolean +clutter_path_add_string (ClutterPath *path, + const gchar *str) +{ + GSList *nodes; + + g_return_val_if_fail (CLUTTER_IS_PATH (path), FALSE); + + if (clutter_path_parse_description (str, &nodes)) + { + clutter_path_add_nodes (path, nodes); + + return TRUE; + } + else + return FALSE; +} + +/** + * clutter_path_add_node: + * @path: a #ClutterPath + * @node: a #ClutterPathNode + * + * Adds @node to the end of the path. + * + * Since: 1.0 + */ +void +clutter_path_add_node (ClutterPath *path, + const ClutterPathNode *node) +{ + ClutterPathNodeFull *node_full; + + g_return_if_fail (CLUTTER_IS_PATH (path)); + g_return_if_fail (node != NULL); + g_return_if_fail (CLUTTER_PATH_NODE_TYPE_IS_VALID (node->type)); + + node_full = clutter_path_node_full_new (); + node_full->k = *node; + + clutter_path_add_node_full (path, node_full); +} + +/** + * clutter_path_add_cairo_path: + * @path: a #ClutterPath + * @cpath: a Cairo path + * + * Add the nodes of the Cairo path to the end of @path. + * + * Since: 1.0 + */ +void +clutter_path_add_cairo_path (ClutterPath *path, + const cairo_path_t *cpath) +{ + int num_data; + const cairo_path_data_t *p; + + g_return_if_fail (CLUTTER_IS_PATH (path)); + g_return_if_fail (cpath != NULL); + + /* Iterate over each command in the cairo path */ + for (num_data = cpath->num_data, p = cpath->data; + num_data > 0; + num_data -= p->header.length, p += p->header.length) + { + switch (p->header.type) + { + case CAIRO_PATH_MOVE_TO: + g_assert (p->header.length >= 2); + + clutter_path_add_move_to (path, p[1].point.x, p[1].point.y); + break; + + case CAIRO_PATH_LINE_TO: + g_assert (p->header.length >= 2); + + clutter_path_add_line_to (path, p[1].point.x, p[1].point.y); + break; + + case CAIRO_PATH_CURVE_TO: + g_assert (p->header.length >= 4); + + clutter_path_add_curve_to (path, + p[1].point.x, p[1].point.y, + p[2].point.x, p[2].point.y, + p[3].point.x, p[3].point.y); + break; + + case CAIRO_PATH_CLOSE_PATH: + clutter_path_add_close (path); + } + } +} + +static void +clutter_path_add_node_to_cairo_path (const ClutterPathNode *node, + gpointer data) +{ + cairo_t *cr = data; + + switch (node->type) + { + case CLUTTER_PATH_MOVE_TO: + cairo_move_to (cr, node->points[0].x, node->points[0].y); + break; + + case CLUTTER_PATH_LINE_TO: + cairo_line_to (cr, node->points[0].x, node->points[0].y); + break; + + case CLUTTER_PATH_CURVE_TO: + cairo_curve_to (cr, + node->points[0].x, node->points[0].y, + node->points[1].x, node->points[1].y, + node->points[2].x, node->points[2].y); + break; + + case CLUTTER_PATH_REL_MOVE_TO: + cairo_rel_move_to (cr, node->points[0].x, node->points[0].y); + break; + + case CLUTTER_PATH_REL_LINE_TO: + cairo_rel_line_to (cr, node->points[0].x, node->points[0].y); + break; + + case CLUTTER_PATH_REL_CURVE_TO: + cairo_rel_curve_to (cr, + node->points[0].x, node->points[0].y, + node->points[1].x, node->points[1].y, + node->points[2].x, node->points[2].y); + break; + + case CLUTTER_PATH_CLOSE: + cairo_close_path (cr); + } +} + +/** + * clutter_path_to_cairo_path: + * @path: a #ClutterPath + * @cr: a Cairo context + * + * Add the nodes of the ClutterPath to the path in the Cairo context. + * + * Since: 1.0 + */ +void +clutter_path_to_cairo_path (ClutterPath *path, + cairo_t *cr) +{ + g_return_if_fail (CLUTTER_IS_PATH (path)); + g_return_if_fail (cr != NULL); + + clutter_path_foreach (path, clutter_path_add_node_to_cairo_path, cr); +} + +/** + * clutter_path_get_n_nodes: + * @path: a #ClutterPath + * + * Retrieves the number of nodes in the path. + * + * Return value: the number of nodes. + * + * Since: 1.0 + */ +guint +clutter_path_get_n_nodes (ClutterPath *path) +{ + ClutterPathPrivate *priv; + + g_return_val_if_fail (CLUTTER_IS_PATH (path), 0); + + priv = path->priv; + + return g_slist_length (priv->nodes); +} + +/** + * clutter_path_get_node: + * @path: a #ClutterPath + * @index_: the node number to retrieve + * @node: a location to store a copy of the node + * + * Retrieves the node of the path indexed by @index. + * + * Since: 1.0 + */ +void +clutter_path_get_node (ClutterPath *path, + guint index_, + ClutterPathNode *node) +{ + ClutterPathNodeFull *node_full; + ClutterPathPrivate *priv; + + g_return_if_fail (CLUTTER_IS_PATH (path)); + + priv = path->priv; + + node_full = g_slist_nth_data (priv->nodes, index_); + + g_return_if_fail (node_full != NULL); + + *node = node_full->k; +} + +/** + * clutter_path_get_nodes: + * @path: a #ClutterPath + * + * Returns a #GSList of #ClutterPathNodes. The list should be + * freed with g_slist_free(). The nodes are owned by the path and + * should not be freed. Altering the path may cause the nodes in the + * list to become invalid so you should copy them if you want to keep + * the list. + * + * Return value: a list of nodes in the path. + * + * Since: 1.0 + */ +GSList * +clutter_path_get_nodes (ClutterPath *path) +{ + ClutterPathPrivate *priv; + + g_return_val_if_fail (CLUTTER_IS_PATH (path), NULL); + + priv = path->priv; + + return g_slist_copy (priv->nodes); +} + +/** + * clutter_path_foreach: + * @path: a #ClutterPath + * @callback: the function to call with each node + * @user_data: user data to pass to the function + * + * Calls a function for each node of the path. + * + * Since: 1.0 + */ +void +clutter_path_foreach (ClutterPath *path, + ClutterPathCallback callback, + gpointer user_data) +{ + ClutterPathPrivate *priv; + + g_return_if_fail (CLUTTER_IS_PATH (path)); + + priv = path->priv; + + g_slist_foreach (priv->nodes, (GFunc) callback, user_data); +} + +/** + * clutter_path_insert_node: + * @path: a #ClutterPath + * @index_: offset of where to insert the node + * @node: the node to insert + * + * Inserts @node into the path before the node at the given offset. If + * @index_ is negative it will append the node to the end of the path. + * + * Since: 1.0 + */ +void +clutter_path_insert_node (ClutterPath *path, + gint index_, + const ClutterPathNode *node) +{ + ClutterPathPrivate *priv; + ClutterPathNodeFull *node_full; + + g_return_if_fail (CLUTTER_IS_PATH (path)); + g_return_if_fail (node != NULL); + g_return_if_fail (CLUTTER_PATH_NODE_TYPE_IS_VALID (node->type)); + + priv = path->priv; + + node_full = clutter_path_node_full_new (); + node_full->k = *node; + + priv->nodes = g_slist_insert (priv->nodes, node_full, index_); + + if (priv->nodes_tail == NULL) + priv->nodes_tail = priv->nodes; + else if (priv->nodes_tail->next) + priv->nodes_tail = priv->nodes_tail->next; + + priv->nodes_dirty = TRUE; +} + +/** + * clutter_path_remove_node: + * @path: a #ClutterPath + * @index_: index of the node to remove + * + * Removes the node at the given offset from the path. + * + * Since: 1.0 + */ +void +clutter_path_remove_node (ClutterPath *path, + guint index_) +{ + ClutterPathPrivate *priv; + GSList *node, *prev = NULL; + + g_return_if_fail (CLUTTER_IS_PATH (path)); + + priv = path->priv; + + for (node = priv->nodes; node && index_--; node = node->next) + prev = node; + + if (node) + { + clutter_path_node_full_free (node->data); + + if (prev) + prev->next = node->next; + else + priv->nodes = node->next; + + if (node == priv->nodes_tail) + priv->nodes_tail = prev; + + g_slist_free_1 (node); + + priv->nodes_dirty = TRUE; + } +} + +/** + * clutter_path_replace_node: + * @path: a #ClutterPath + * @index_: index to the existing node + * @node: the replacement node + * + * Replaces the node at offset @index_ with @node. + * + * Since: 1.0 + */ +void +clutter_path_replace_node (ClutterPath *path, + guint index_, + const ClutterPathNode *node) +{ + ClutterPathPrivate *priv; + ClutterPathNodeFull *node_full; + + g_return_if_fail (CLUTTER_IS_PATH (path)); + g_return_if_fail (node != NULL); + g_return_if_fail (CLUTTER_PATH_NODE_TYPE_IS_VALID (node->type)); + + priv = path->priv; + + if ((node_full = g_slist_nth_data (priv->nodes, index_))) + { + node_full->k = *node; + + priv->nodes_dirty = TRUE; + } +} + +/** + * clutter_path_set_description: + * @path: a #ClutterPath + * @str: a string describing the path + * + * Replaces all of the nodes in the path with nodes described by + * @str. See clutter_path_add_string() for details of the format. + * + * If the string is invalid then %FALSE is returned and the path is + * unaltered. + * + * Return value: %TRUE is the path was valid, %FALSE otherwise. + * + * Since: 1.0 + */ +gboolean +clutter_path_set_description (ClutterPath *path, const gchar *str) +{ + GSList *nodes; + + g_return_val_if_fail (CLUTTER_IS_PATH (path), FALSE); + + if (clutter_path_parse_description (str, &nodes)) + { + clutter_path_clear (path); + clutter_path_add_nodes (path, nodes); + + return TRUE; + } + else + return FALSE; +} + +/** + * clutter_path_get_description: + * @path: a #ClutterPath + * + * Returns a newly allocated string describing the path in the same + * format as used by clutter_path_add_string(). + * + * Return value: a string description of the path. Free with g_free(). + * + * Since: 1.0 + */ +gchar * +clutter_path_get_description (ClutterPath *path) +{ + ClutterPathPrivate *priv; + GString *str; + GSList *l; + + g_return_val_if_fail (CLUTTER_IS_PATH (path), FALSE); + + priv = path->priv; + + str = g_string_new (""); + + for (l = priv->nodes; l; l = l->next) + { + ClutterPathNodeFull *node = l->data; + gchar letter = '?'; + gint params = 0; + gint i; + + switch (node->k.type) + { + case CLUTTER_PATH_MOVE_TO: + letter = 'M'; + params = 1; + break; + + case CLUTTER_PATH_REL_MOVE_TO: + letter = 'm'; + params = 1; + break; + + case CLUTTER_PATH_LINE_TO: + letter = 'L'; + params = 1; + break; + + case CLUTTER_PATH_REL_LINE_TO: + letter = 'l'; + params = 1; + break; + + case CLUTTER_PATH_CURVE_TO: + letter = 'C'; + params = 3; + break; + + case CLUTTER_PATH_REL_CURVE_TO: + letter = 'c'; + params = 3; + break; + + case CLUTTER_PATH_CLOSE: + letter = 'z'; + params = 0; + break; + } + + if (str->len > 0) + g_string_append_c (str, ' '); + g_string_append_c (str, letter); + + for (i = 0; i < params; i++) + g_string_append_printf (str, " %i %i", + node->k.points[i].x, + node->k.points[i].y); + } + + return g_string_free (str, FALSE); +} + +static gint +clutter_path_node_distance (const ClutterKnot *start, + const ClutterKnot *end) +{ + gint t; + + g_return_val_if_fail (start != NULL, 0); + g_return_val_if_fail (end != NULL, 0); + + if (clutter_knot_equal (start, end)) + return 0; + + t = (end->x - start->x) * (end->x - start->x) + + (end->y - start->y) * (end->y - start->y); + + /* + * If we are using limited precision sqrti implementation, fallback on + * clib sqrt if the precission would be less than 10% + */ +#if INT_MAX > COGL_SQRTI_ARG_10_PERCENT + if (t <= COGL_SQRTI_ARG_10_PERCENT) + return cogl_sqrti (t); + else + return COGL_FLOAT_TO_INT (sqrtf(t)); +#else + return cogl_sqrti (t); +#endif +} + +static void +clutter_path_ensure_node_data (ClutterPath *path) +{ + ClutterPathPrivate *priv = path->priv; + + /* Recalculate the nodes data if has changed */ + if (priv->nodes_dirty) + { + GSList *l; + ClutterKnot last_position = { 0, 0 }; + ClutterKnot loop_start = { 0, 0 }; + ClutterKnot points[3]; + + priv->total_length = 0; + + for (l = priv->nodes; l; l = l->next) + { + ClutterPathNodeFull *node = l->data; + gboolean relative = (node->k.type & CLUTTER_PATH_RELATIVE) != 0; + + switch (node->k.type & ~CLUTTER_PATH_RELATIVE) + { + case CLUTTER_PATH_MOVE_TO: + node->length = 0; + + /* Store the actual position in point[1] */ + if (relative) + { + node->k.points[1].x = last_position.x + node->k.points[0].x; + node->k.points[1].y = last_position.y + node->k.points[0].y; + } + else + node->k.points[1] = node->k.points[0]; + + last_position = node->k.points[1]; + loop_start = node->k.points[1]; + break; + + case CLUTTER_PATH_LINE_TO: + /* Use point[1] as the start point and point[2] as the end + point */ + node->k.points[1] = last_position; + + if (relative) + { + node->k.points[2].x = (node->k.points[1].x + + node->k.points[0].x); + node->k.points[2].y = (node->k.points[1].y + + node->k.points[0].y); + } + else + node->k.points[2] = node->k.points[0]; + + last_position = node->k.points[2]; + + node->length = clutter_path_node_distance (node->k.points + 1, + node->k.points + 2); + break; + + case CLUTTER_PATH_CURVE_TO: + /* Convert to a bezier curve */ + if (node->bezier == NULL) + node->bezier = _clutter_bezier_new (); + + if (relative) + { + int i; + + for (i = 0; i < 3; i++) + { + points[i].x = last_position.x + node->k.points[i].x; + points[i].y = last_position.y + node->k.points[i].y; + } + } + else + memcpy (points, node->k.points, sizeof (ClutterKnot) * 3); + + _clutter_bezier_init (node->bezier, + last_position.x, last_position.y, + points[0].x, points[0].y, + points[1].x, points[1].y, + points[2].x, points[2].y); + + last_position = points[2]; + + node->length = _clutter_bezier_get_length (node->bezier); + + break; + + case CLUTTER_PATH_CLOSE: + /* Convert to a line to from last_point to loop_start */ + node->k.points[1] = last_position; + node->k.points[2] = loop_start; + last_position = node->k.points[2]; + + node->length = clutter_path_node_distance (node->k.points + 1, + node->k.points + 2); + break; + } + + priv->total_length += node->length; + } + + priv->nodes_dirty = FALSE; + } +} + +/** + * clutter_path_get_position: + * @path: a #ClutterPath + * @progress: a position along the path as a fraction of its length + * @position: location to store the position + * + * The value in @progress represents a position along the path where + * 0.0 is the beginning and 1.0 is the end of the path. An + * interpolated position is then stored in @position. + * + * Return value: index of the node used to calculate the position. + * + * Since: 1.0 + */ +guint +clutter_path_get_position (ClutterPath *path, + gdouble progress, + ClutterKnot *position) +{ + ClutterPathPrivate *priv; + GSList *l; + guint point_distance, length = 0, node_num = 0; + ClutterPathNodeFull *node; + + g_return_val_if_fail (CLUTTER_IS_PATH (path), 0); + g_return_val_if_fail (progress >= 0.0 && progress <= 1.0, 0); + + priv = path->priv; + + clutter_path_ensure_node_data (path); + + /* Special case if the path is empty, just return 0,0 for want of + something better */ + if (priv->nodes == NULL) + { + memset (position, 0, sizeof (ClutterKnot)); + return 0; + } + + /* Convert the progress to a length along the path */ + point_distance = progress * priv->total_length; + + /* Find the node that covers this point */ + for (l = priv->nodes; + l->next && point_distance >= (((ClutterPathNodeFull *) l->data)->length + + length); + l = l->next) + { + length += ((ClutterPathNodeFull *) l->data)->length; + node_num++; + } + + node = l->data; + + /* Convert the point distance to a distance along the node */ + point_distance -= length; + if (point_distance > node->length) + point_distance = node->length; + + switch (node->k.type & ~CLUTTER_PATH_RELATIVE) + { + case CLUTTER_PATH_MOVE_TO: + *position = node->k.points[1]; + break; + + case CLUTTER_PATH_LINE_TO: + case CLUTTER_PATH_CLOSE: + if (node->length == 0) + *position = node->k.points[1]; + else + { + position->x = (node->k.points[1].x + + ((node->k.points[2].x - node->k.points[1].x) + * (gint) point_distance / (gint) node->length)); + position->y = (node->k.points[1].y + + ((node->k.points[2].y - node->k.points[1].y) + * (gint) point_distance / (gint) node->length)); + } + break; + + case CLUTTER_PATH_CURVE_TO: + _clutter_bezier_advance (node->bezier, + point_distance * CLUTTER_BEZIER_MAX_LENGTH + / node->length, + position); + break; + } + + return node_num; +} + +/** + * clutter_path_get_length: + * @path: a #ClutterPath + * + * Retrieves an approximation of the total length of the path. + * + * Return value: the length of the path. + * + * Since: 1.0 + */ +guint +clutter_path_get_length (ClutterPath *path) +{ + g_return_val_if_fail (CLUTTER_IS_PATH (path), 0); + + clutter_path_ensure_node_data (path); + + return path->priv->total_length; +} + +static ClutterPathNodeFull * +clutter_path_node_full_new (void) +{ + return g_slice_new0 (ClutterPathNodeFull); +} + +static void +clutter_path_node_full_free (ClutterPathNodeFull *node) +{ + if (node->bezier) + _clutter_bezier_free (node->bezier); + + g_slice_free (ClutterPathNodeFull, node); +} + +/** + * clutter_path_node_copy: + * @node: a #ClutterPathNode + * + * Makes an allocated copy of a node. + * + * Return value: the copied node. + * + * Since: 1.0 + */ +ClutterPathNode * +clutter_path_node_copy (const ClutterPathNode *node) +{ + return g_slice_dup (ClutterPathNode, node); +} + +/** + * clutter_path_node_free: + * @node: a #ClutterPathNode + * + * Frees the memory of an allocated node. + * + * Since: 1.0 + */ +void +clutter_path_node_free (ClutterPathNode *node) +{ + if (G_LIKELY (node)) + g_slice_free (ClutterPathNode, node); +} + +/** + * clutter_path_node_equal: + * @node_a: First node + * @node_b: Second node + * + * Compares two nodes and checks if they are the same type with the + * same coordinates. + * + * Return value: %TRUE if the nodes are the same. + * + * Since: 1.0 + */ +gboolean +clutter_path_node_equal (const ClutterPathNode *node_a, + const ClutterPathNode *node_b) +{ + guint n_points, i; + + g_return_val_if_fail (node_a != NULL, FALSE); + g_return_val_if_fail (node_b != NULL, FALSE); + + if (node_a->type != node_b->type) + return FALSE; + + switch (node_a->type & ~CLUTTER_PATH_RELATIVE) + { + case CLUTTER_PATH_MOVE_TO: n_points = 1; break; + case CLUTTER_PATH_LINE_TO: n_points = 1; break; + case CLUTTER_PATH_CURVE_TO: n_points = 3; break; + case CLUTTER_PATH_CLOSE: n_points = 0; break; + default: return FALSE; + } + + for (i = 0; i < n_points; i++) + if (node_a->points[i].x != node_b->points[i].x + || node_a->points[i].y != node_b->points[i].y) + return FALSE; + + return TRUE; +} + +GType +clutter_path_node_get_type (void) +{ + static GType our_type = 0; + + if (G_UNLIKELY (!our_type)) + { + our_type = + g_boxed_type_register_static (I_("ClutterPathNode"), + (GBoxedCopyFunc) clutter_path_node_copy, + (GBoxedFreeFunc) clutter_path_node_free); + } + + return our_type; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-path.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-path.h --- clutter-0.8.4/clutter/clutter-path.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-path.h 2009-01-28 08:12:45.000000000 +0000 @@ -0,0 +1,218 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Authored By Matthew Allum + * + * Copyright (C) 2008 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 . + */ + +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_PATH_H__ +#define __CLUTTER_PATH_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +#define CLUTTER_TYPE_PATH (clutter_path_get_type ()) +#define CLUTTER_TYPE_PATH_NODE (clutter_path_node_get_type ()) +#define CLUTTER_PATH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_PATH, ClutterPath)) +#define CLUTTER_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_PATH, ClutterPathClass)) +#define CLUTTER_IS_PATH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_PATH)) +#define CLUTTER_IS_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_PATH)) +#define CLUTTER_PATH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_PATH, ClutterPathClass)) + +#define CLUTTER_PATH_RELATIVE (32) + +/** + * ClutterPathNodeType: + * @CLUTTER_PATH_MOVE_TO: jump to the given position + * @CLUTTER_PATH_LINE_TO: create a line from the last node to the + * given position + * @CLUTTER_PATH_CURVE_TO: bezier curve using the last position and + * three control points. + * @CLUTTER_PATH_CLOSE: create a line from the last node to the last + * %CLUTTER_PATH_MOVE_TO node. + * @CLUTTER_PATH_REL_MOVE_TO: same as %CLUTTER_PATH_MOVE_TO but with + * coordinates relative to the last node. + * @CLUTTER_PATH_REL_LINE_TO: same as %CLUTTER_PATH_LINE_TO but with + * coordinates relative to the last node. + * @CLUTTER_PATH_REL_CURVE_TO: same as %CLUTTER_PATH_CURVE_TO but with + * coordinates relative to the last node. + * + * Types of nodes in a #ClutterPath. + * + * Since: 1.0 + */ +typedef enum { + CLUTTER_PATH_MOVE_TO = 0, + CLUTTER_PATH_LINE_TO = 1, + CLUTTER_PATH_CURVE_TO = 2, + CLUTTER_PATH_CLOSE = 3, + + CLUTTER_PATH_REL_MOVE_TO = CLUTTER_PATH_MOVE_TO | CLUTTER_PATH_RELATIVE, + CLUTTER_PATH_REL_LINE_TO = CLUTTER_PATH_LINE_TO | CLUTTER_PATH_RELATIVE, + CLUTTER_PATH_REL_CURVE_TO = CLUTTER_PATH_CURVE_TO | CLUTTER_PATH_RELATIVE +} ClutterPathNodeType; + +typedef struct _ClutterPath ClutterPath; +typedef struct _ClutterPathClass ClutterPathClass; +typedef struct _ClutterPathPrivate ClutterPathPrivate; +typedef struct _ClutterPathNode ClutterPathNode; + +/** + * ClutterPathCallback: + * @node: the node + * @data: optional data passed to the function + * + * This function is passed to clutter_path_foreach() and will be + * called for each node contained in the path. + * + * Since: 1.0 + */ +typedef void (* ClutterPathCallback) (const ClutterPathNode *node, + gpointer data); + +/** + * ClutterPath: + * + * The #ClutterPath struct contains only private data and should + * be accessed with the functions below. + * + * Since: 1.0 + */ +struct _ClutterPath +{ + /*< private >*/ + GInitiallyUnowned parent; + + ClutterPathPrivate *priv; +}; + +/** + * ClutterPathClass: + * + * The #ClutterPathClass struct contains only private data. + * + * Since: 1.0 + */ +struct _ClutterPathClass +{ + /*< private >*/ + GInitiallyUnownedClass parent_class; +}; + +/** + * ClutterPathNode: + * @type: the node's type + * @points: the coordinates of the node + * + * Represents a single node of a #ClutterPath. + * + * Some of the coordinates in @points may be unused for some node + * types. %CLUTTER_PATH_MOVE_TO and %CLUTTER_PATH_LINE_TO use only two + * pairs of coordinates, %CLUTTER_PATH_CURVE_TO uses all three and + * %CLUTTER_PATH_CLOSE uses none. + * + * Since: 1.0 + */ +struct _ClutterPathNode +{ + ClutterPathNodeType type; + + ClutterKnot points[3]; +}; + +GType clutter_path_get_type (void) G_GNUC_CONST; +GType clutter_path_node_get_type (void) G_GNUC_CONST; + +ClutterPath *clutter_path_new (void); +ClutterPath *clutter_path_new_with_description (const gchar *desc); +void clutter_path_add_move_to (ClutterPath *path, + gint x, + gint y); +void clutter_path_add_rel_move_to (ClutterPath *path, + gint x, + gint y); +void clutter_path_add_line_to (ClutterPath *path, + gint x, + gint y); +void clutter_path_add_rel_line_to (ClutterPath *path, + gint x, + gint y); +void clutter_path_add_curve_to (ClutterPath *path, + gint x_1, + gint y_1, + gint x_2, + gint y_2, + gint x_3, + gint y_3); +void clutter_path_add_rel_curve_to (ClutterPath *path, + gint x_1, + gint y_1, + gint x_2, + gint y_2, + gint x_3, + gint y_3); +void clutter_path_add_close (ClutterPath *path); +gboolean clutter_path_add_string (ClutterPath *path, + const gchar *str); +void clutter_path_add_node (ClutterPath *path, + const ClutterPathNode *node); +void clutter_path_add_cairo_path (ClutterPath *path, + const cairo_path_t *cpath); +guint clutter_path_get_n_nodes (ClutterPath *path); +void clutter_path_get_node (ClutterPath *path, + guint index_, + ClutterPathNode *node); +GSList * clutter_path_get_nodes (ClutterPath *path); +void clutter_path_foreach (ClutterPath *path, + ClutterPathCallback callback, + gpointer user_data); +void clutter_path_insert_node (ClutterPath *path, + gint index_, + const ClutterPathNode *node); +void clutter_path_remove_node (ClutterPath *path, + guint index_); +void clutter_path_replace_node (ClutterPath *path, + guint index_, + const ClutterPathNode *node); +gchar * clutter_path_get_description (ClutterPath *path); +gboolean clutter_path_set_description (ClutterPath *path, + const gchar *str); +void clutter_path_clear (ClutterPath *path); +void clutter_path_to_cairo_path (ClutterPath *path, + cairo_t *cr); +guint clutter_path_get_position (ClutterPath *path, + gdouble progress, + ClutterKnot *position); +guint clutter_path_get_length (ClutterPath *path); + +ClutterPathNode *clutter_path_node_copy (const ClutterPathNode *node); +void clutter_path_node_free (ClutterPathNode *node); +gboolean clutter_path_node_equal (const ClutterPathNode *node_a, + const ClutterPathNode *node_b); + +G_END_DECLS + +#endif /* __CLUTTER_PATH_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-private.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-private.h --- clutter-0.8.4/clutter/clutter-private.h 2008-11-13 14:44:32.000000000 +0000 +++ clutter-0.9.0/clutter/clutter-private.h 2009-01-28 16:45:24.000000000 +0000 @@ -38,6 +38,8 @@ #include +#include "pango/cogl-pango.h" + #include "clutter-backend.h" #include "clutter-event.h" #include "clutter-feature.h" @@ -45,7 +47,6 @@ #include "clutter-stage-manager.h" #include "clutter-stage-window.h" #include "clutter-stage.h" -#include "pango/pangoclutter.h" G_BEGIN_DECLS @@ -125,15 +126,17 @@ gint fb_r_mask, fb_g_mask, fb_b_mask; gint fb_r_mask_used, fb_g_mask_used, fb_b_mask_used; - PangoClutterFontMap *font_map; /* Global font map */ + PangoContext *pango_context; /* Global Pango context */ + CoglPangoFontMap *font_map; /* Global font map */ - GSList *input_devices; /* For extra input devices, i.e - MultiTouch */ + GSList *input_devices; /* For extra input devices, i.e + MultiTouch */ }; #define CLUTTER_CONTEXT() (clutter_context_get_default ()) ClutterMainContext *clutter_context_get_default (void); PangoContext *_clutter_context_create_pango_context (ClutterMainContext *self); +PangoContext *_clutter_context_get_pango_context (ClutterMainContext *self); #define CLUTTER_PRIVATE_FLAGS(a) (((ClutterActor *) (a))->private_flags) #define CLUTTER_SET_PRIVATE_FLAGS(a,f) (CLUTTER_PRIVATE_FLAGS (a) |= (f)) @@ -191,6 +194,8 @@ ClutterFeatureFlags _clutter_backend_get_features (ClutterBackend *backend); +ClutterUnit _clutter_backend_get_units_per_em (ClutterBackend *backend); + void _clutter_feature_init (void); /* Picking code */ @@ -216,6 +221,12 @@ void _clutter_actor_apply_modelview_transform_recursive (ClutterActor *self, ClutterActor *ancestor); +void _clutter_actor_set_opacity_parent (ClutterActor *self, + ClutterActor *parent); + +void _clutter_actor_set_enable_model_view_transform (ClutterActor *self, + gboolean enable); + G_END_DECLS #endif /* _HAVE_CLUTTER_PRIVATE_H */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-rectangle.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-rectangle.c --- clutter-0.8.4/clutter/clutter-rectangle.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-rectangle.c 2009-01-29 08:31:37.000000000 +0000 @@ -33,10 +33,11 @@ #include "config.h" #endif -#include "clutter-rectangle.h" +#include "clutter-color.h" +#include "clutter-debug.h" #include "clutter-main.h" #include "clutter-private.h" -#include "clutter-debug.h" +#include "clutter-rectangle.h" #include "cogl/cogl.h" @@ -67,13 +68,16 @@ guint has_border : 1; }; +static const ClutterColor default_color = { 255, 255, 255, 255 }; +static const ClutterColor default_border_color = { 0, 0, 0, 255 }; + static void clutter_rectangle_paint (ClutterActor *self) { ClutterRectangle *rectangle = CLUTTER_RECTANGLE(self); ClutterRectanglePrivate *priv; ClutterGeometry geom; - ClutterColor tmp_col; + guint8 tmp_alpha; rectangle = CLUTTER_RECTANGLE(self); priv = rectangle->priv; @@ -89,56 +93,64 @@ */ if (priv->has_border) { - tmp_col.red = priv->border_color.red; - tmp_col.green = priv->border_color.green; - tmp_col.blue = priv->border_color.blue; - tmp_col.alpha = clutter_actor_get_paint_opacity (self) - * priv->border_color.alpha - / 255; - - cogl_color (&tmp_col); + /* compute the composited opacity of the actor taking into + * account the opacity of the color set by the user + */ + tmp_alpha = clutter_actor_get_paint_opacity (self) + * priv->border_color.alpha + / 255; + + /* paint the border */ + cogl_set_source_color4ub (priv->border_color.red, + priv->border_color.green, + priv->border_color.blue, + tmp_alpha); /* this sucks, but it's the only way to make a border */ cogl_rectangle (priv->border_width, 0, - geom.width - priv->border_width, + geom.width, priv->border_width); cogl_rectangle (geom.width - priv->border_width, priv->border_width, - priv->border_width, - geom.height - priv->border_width); + geom.width, + geom.height); cogl_rectangle (0, geom.height - priv->border_width, geom.width - priv->border_width, - priv->border_width); + geom.height); cogl_rectangle (0, 0, priv->border_width, geom.height - priv->border_width); - tmp_col.red = priv->color.red; - tmp_col.green = priv->color.green; - tmp_col.blue = priv->color.blue; - tmp_col.alpha = clutter_actor_get_paint_opacity (self) - * priv->color.alpha - / 255; - - cogl_color (&tmp_col); + tmp_alpha = clutter_actor_get_paint_opacity (self) + * priv->color.alpha + / 255; + + /* now paint the rectangle */ + cogl_set_source_color4ub (priv->color.red, + priv->color.green, + priv->color.blue, + tmp_alpha); cogl_rectangle (priv->border_width, priv->border_width, - geom.width - priv->border_width * 2, - geom.height - priv->border_width * 2); + geom.width - priv->border_width, + geom.height - priv->border_width); } else { - tmp_col.red = priv->color.red; - tmp_col.green = priv->color.green; - tmp_col.blue = priv->color.blue; - tmp_col.alpha = clutter_actor_get_paint_opacity (self) - * priv->color.alpha - / 255; - - cogl_color (&tmp_col); + /* compute the composited opacity of the actor taking into + * account the opacity of the color set by the user + */ + tmp_alpha = clutter_actor_get_paint_opacity (self) + * priv->color.alpha + / 255; + + cogl_set_source_color4ub (priv->color.red, + priv->color.green, + priv->color.blue, + tmp_alpha); cogl_rectangle (0, 0, geom.width, geom.height); } @@ -155,11 +167,11 @@ switch (prop_id) { case PROP_COLOR: - clutter_rectangle_set_color (rectangle, g_value_get_boxed (value)); + clutter_rectangle_set_color (rectangle, clutter_value_get_color (value)); break; case PROP_BORDER_COLOR: clutter_rectangle_set_border_color (rectangle, - g_value_get_boxed (value)); + clutter_value_get_color (value)); break; case PROP_BORDER_WIDTH: clutter_rectangle_set_border_width (rectangle, @@ -180,24 +192,21 @@ GValue *value, GParamSpec *pspec) { - ClutterRectangle *rectangle = CLUTTER_RECTANGLE(object); - ClutterColor color; + ClutterRectanglePrivate *priv = CLUTTER_RECTANGLE(object)->priv; switch (prop_id) { case PROP_COLOR: - clutter_rectangle_get_color (rectangle, &color); - g_value_set_boxed (value, &color); + clutter_value_set_color (value, &priv->color); break; case PROP_BORDER_COLOR: - clutter_rectangle_get_border_color (rectangle, &color); - g_value_set_boxed (value, &color); + clutter_value_set_color (value, &priv->border_color); break; case PROP_BORDER_WIDTH: - g_value_set_uint (value, rectangle->priv->border_width); + g_value_set_uint (value, priv->border_width); break; case PROP_HAS_BORDER: - g_value_set_boolean (value, rectangle->priv->has_border); + g_value_set_boolean (value, priv->has_border); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -222,8 +231,9 @@ static void clutter_rectangle_class_init (ClutterRectangleClass *klass) { - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); + GParamSpec *pspec; actor_class->paint = clutter_rectangle_paint; @@ -237,13 +247,13 @@ * * The color of the rectangle. */ - g_object_class_install_property (gobject_class, - PROP_COLOR, - g_param_spec_boxed ("color", - "Color", - "The color of the rectangle", - CLUTTER_TYPE_COLOR, - CLUTTER_PARAM_READWRITE)); + pspec = clutter_param_spec_color ("color", + "Color", + "The color of the rectangle", + &default_color, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_COLOR, pspec); + /** * ClutterRectangle:border-color: * @@ -251,13 +261,13 @@ * * Since: 0.2 */ - g_object_class_install_property (gobject_class, - PROP_BORDER_COLOR, - g_param_spec_boxed ("border-color", - "Border Color", - "The color of the border of the rectangle", - CLUTTER_TYPE_COLOR, - CLUTTER_PARAM_READWRITE)); + pspec = clutter_param_spec_color ("border-color", + "Border Color", + "The color of the border of the rectangle", + &default_border_color, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_BORDER_COLOR, pspec); + /** * ClutterRectangle:border-width: * @@ -298,15 +308,8 @@ self->priv = priv = CLUTTER_RECTANGLE_GET_PRIVATE (self); - priv->color.red = 0xff; - priv->color.green = 0xff; - priv->color.blue = 0xff; - priv->color.alpha = 0xff; - - priv->border_color.red = 0x00; - priv->border_color.green = 0x00; - priv->border_color.blue = 0x00; - priv->border_color.alpha = 0xff; + priv->color = default_color; + priv->border_color = default_border_color; priv->border_width = 0; diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-rectangle.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-rectangle.h --- clutter-0.8.4/clutter/clutter-rectangle.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-rectangle.h 2009-01-28 08:12:45.000000000 +0000 @@ -18,13 +18,15 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ -#ifndef _HAVE_CLUTTER_RECTANGLE_H -#define _HAVE_CLUTTER_RECTANGLE_H +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_RECTANGLE_H__ +#define __CLUTTER_RECTANGLE_H__ #include #include @@ -32,27 +34,12 @@ G_BEGIN_DECLS -#define CLUTTER_TYPE_RECTANGLE clutter_rectangle_get_type() - -#define CLUTTER_RECTANGLE(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - CLUTTER_TYPE_RECTANGLE, ClutterRectangle)) - -#define CLUTTER_RECTANGLE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - CLUTTER_TYPE_RECTANGLE, ClutterRectangleClass)) - -#define CLUTTER_IS_RECTANGLE(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - CLUTTER_TYPE_RECTANGLE)) - -#define CLUTTER_IS_RECTANGLE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - CLUTTER_TYPE_RECTANGLE)) - -#define CLUTTER_RECTANGLE_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - CLUTTER_TYPE_RECTANGLE, ClutterRectangleClass)) +#define CLUTTER_TYPE_RECTANGLE (clutter_rectangle_get_type()) +#define CLUTTER_RECTANGLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_RECTANGLE, ClutterRectangle)) +#define CLUTTER_RECTANGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_RECTANGLE, ClutterRectangleClass)) +#define CLUTTER_IS_RECTANGLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_RECTANGLE)) +#define CLUTTER_IS_RECTANGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_RECTANGLE)) +#define CLUTTER_RECTANGLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_RECTANGLE, ClutterRectangleClass)) typedef struct _ClutterRectangle ClutterRectangle; typedef struct _ClutterRectangleClass ClutterRectangleClass; @@ -60,14 +47,15 @@ struct _ClutterRectangle { + /*< private >*/ ClutterActor parent; - /*< private >*/ ClutterRectanglePrivate *priv; }; struct _ClutterRectangleClass { + /*< private >*/ ClutterActorClass parent_class; /* padding for future expansion */ @@ -96,4 +84,4 @@ G_END_DECLS -#endif +#endif /* __CLUTTER_RECTANGLE_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-score.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-score.h --- clutter-0.8.4/clutter/clutter-score.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-score.h 2009-01-28 08:12:45.000000000 +0000 @@ -18,11 +18,13 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __CLUTTER_SCORE_H__ #define __CLUTTER_SCORE_H__ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-scriptable.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-scriptable.h --- clutter-0.8.4/clutter/clutter-scriptable.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-scriptable.h 2009-01-28 08:12:45.000000000 +0000 @@ -19,11 +19,13 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __CLUTTER_SCRIPTABLE_H__ #define __CLUTTER_SCRIPTABLE_H__ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-script.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-script.c --- clutter-0.8.4/clutter/clutter-script.c 2008-11-28 18:09:48.000000000 +0000 +++ clutter-0.9.0/clutter/clutter-script.c 2009-01-28 08:12:45.000000000 +0000 @@ -169,6 +169,10 @@ #include #include +#ifdef USE_GDKPIXBUF +#include +#endif + #include "clutter-actor.h" #include "clutter-alpha.h" #include "clutter-behaviour.h" @@ -180,6 +184,7 @@ #include "clutter-script-private.h" #include "clutter-scriptable.h" +#include "clutter-enum-types.h" #include "clutter-private.h" #include "clutter-debug.h" @@ -513,97 +518,77 @@ return retval; } -/* ugh. if g_module_open() fails (*cough* python *cough*) we need a fallback - * for finding at least our own functions. +/* define the names of the animation modes to match the ones + * that developers might be more accustomed to */ static const struct { const gchar *name; - const gchar *short_name; - ClutterAlphaFunc symbol; -} clutter_alphas[] = { - { - "clutter_ramp_inc_func", - "ramp-inc", - CLUTTER_ALPHA_RAMP_INC - }, - { - "clutter_ramp_dec_func", - "ramp-dec", - CLUTTER_ALPHA_RAMP_DEC - }, - { - "clutter_ramp_func", - "ramp", - CLUTTER_ALPHA_RAMP - }, - { - "clutter_sine_inc_func", - "sine-inc", - CLUTTER_ALPHA_SINE_INC - }, - { - "clutter_sine_dec_func", - "sine-dec", - CLUTTER_ALPHA_SINE_DEC - }, - { - "clutter_sine_half_func", - "sine-half", - CLUTTER_ALPHA_SINE_HALF - }, - { - "clutter_sine_func", - "sine", - CLUTTER_ALPHA_SINE - }, - { - "clutter_square_func", - "square", - CLUTTER_ALPHA_SQUARE - }, - { - "clutter_smoothstep_inc_func", - "smoothstep-inc", - CLUTTER_ALPHA_SMOOTHSTEP_INC - }, - { - "clutter_smoothstep_dec_func", - "smoothstep-dec", - CLUTTER_ALPHA_SMOOTHSTEP_DEC - }, - { - "clutter_exp_inc_func", - "exp-inc", - CLUTTER_ALPHA_EXP_INC - }, - { - "clutter_exp_dec_func", - "exp-dec", - CLUTTER_ALPHA_EXP_DEC - } + ClutterAnimationMode mode; +} animation_modes[] = { + { "linear", CLUTTER_LINEAR }, + { "easeInQuad", CLUTTER_EASE_IN_QUAD }, + { "easeOutQuad", CLUTTER_EASE_OUT_QUAD }, + { "easeInOutQuad", CLUTTER_EASE_IN_OUT_QUAD }, + { "easeInCubic", CLUTTER_EASE_IN_CUBIC }, + { "easeOutCubic", CLUTTER_EASE_OUT_CUBIC }, + { "easeInOutCubic", CLUTTER_EASE_IN_OUT_CUBIC }, + { "easeInQuart", CLUTTER_EASE_IN_QUART }, + { "easeOutQuart", CLUTTER_EASE_OUT_QUART }, + { "easeInOutQuart", CLUTTER_EASE_IN_OUT_QUART }, + { "easeInQuint", CLUTTER_EASE_IN_QUINT }, + { "easeOutQuint", CLUTTER_EASE_OUT_QUINT }, + { "easeInOutQuint", CLUTTER_EASE_IN_OUT_QUINT }, + { "easeInSine", CLUTTER_EASE_IN_SINE }, + { "easeOutSine", CLUTTER_EASE_OUT_SINE }, + { "easeInOutSine", CLUTTER_EASE_IN_OUT_SINE }, + { "easeInExpo", CLUTTER_EASE_IN_EXPO }, + { "easeOutExpo", CLUTTER_EASE_OUT_EXPO }, + { "easeInOutExpo", CLUTTER_EASE_IN_OUT_EXPO }, + { "easeInCirc", CLUTTER_EASE_IN_CIRC }, + { "easeOutCirc", CLUTTER_EASE_OUT_CIRC }, + { "easeInOutCirc", CLUTTER_EASE_IN_OUT_CIRC }, + { "easeInElastic", CLUTTER_EASE_IN_ELASTIC }, + { "easeOutElastic", CLUTTER_EASE_OUT_ELASTIC }, + { "easeInOutElastic", CLUTTER_EASE_IN_OUT_ELASTIC }, + { "easeInBack", CLUTTER_EASE_IN_BACK }, + { "easeOutBack", CLUTTER_EASE_OUT_BACK }, + { "easeInOutBack", CLUTTER_EASE_IN_OUT_BACK }, + { "easeInBounce", CLUTTER_EASE_IN_BOUNCE }, + { "easeOutBounce", CLUTTER_EASE_OUT_BOUNCE }, + { "easeInOutBounce", CLUTTER_EASE_IN_OUT_BOUNCE }, }; -static const gint n_clutter_alphas = G_N_ELEMENTS (clutter_alphas); +static const gint n_animation_modes = G_N_ELEMENTS (animation_modes); + +static ClutterAnimationMode +resolve_animation_mode (const gchar *name) +{ + gint i, res = 0; + + for (i = 0; i < n_animation_modes; i++) + { + if (strcmp (animation_modes[i].name, name) == 0) + return animation_modes[i].mode; + } + + if (clutter_script_enum_from_string (CLUTTER_TYPE_ANIMATION_MODE, + name, &res)) + return res; + + g_warning ("Unable to find the animation mode '%s'", name); + + return CLUTTER_CUSTOM_MODE; +} static ClutterAlphaFunc resolve_alpha_func (const gchar *name) { static GModule *module = NULL; ClutterAlphaFunc func; - gint i; CLUTTER_NOTE (SCRIPT, "Looking up `%s' alpha function", name); - for (i = 0; i < n_clutter_alphas; i++) - if (strcmp (name, clutter_alphas[i].name) == 0 || - strcmp (name, clutter_alphas[i].short_name) == 0) - { - CLUTTER_NOTE (SCRIPT, "Found `%s' alpha function in the whitelist", - name); - return clutter_alphas[i].symbol; - } - if (G_UNLIKELY (!module)) module = g_module_open (NULL, G_MODULE_BIND_LAZY); @@ -625,6 +610,7 @@ JsonObject *object; ClutterTimeline *timeline = NULL; ClutterAlphaFunc alpha_func = NULL; + ClutterAnimationMode mode = CLUTTER_CUSTOM_MODE; JsonNode *val; gboolean unref_timeline = FALSE; @@ -651,25 +637,39 @@ } } - val = json_object_get_member (object, "function"); + val = json_object_get_member (object, "mode"); if (val && json_node_get_string (val) != NULL) + mode = resolve_animation_mode (json_node_get_string (val)); + + if (mode == CLUTTER_CUSTOM_MODE) { - alpha_func = resolve_alpha_func (json_node_get_string (val)); - if (!alpha_func) + val = json_object_get_member (object, "function"); + if (val && json_node_get_string (val) != NULL) { - g_warning ("Unable to find the function `%s' in the " - "Clutter alpha functions or the symbols table", - json_node_get_string (val)); + alpha_func = resolve_alpha_func (json_node_get_string (val)); + if (!alpha_func) + { + g_warning ("Unable to find the function `%s' in the " + "Clutter alpha functions or the symbols table", + json_node_get_string (val)); + } } } - CLUTTER_NOTE (SCRIPT, "Parsed alpha: %s timeline (%p) and func:%p", + CLUTTER_NOTE (SCRIPT, "Parsed alpha: %s timeline (%p) (mode:%d, func:%p)", unref_timeline ? "implicit" : "explicit", timeline ? timeline : 0x0, + mode != CLUTTER_CUSTOM_MODE ? mode : 0, alpha_func ? alpha_func : 0x0); retval = g_object_new (CLUTTER_TYPE_ALPHA, NULL); - clutter_alpha_set_func (CLUTTER_ALPHA (retval), alpha_func, NULL, NULL); + + if (mode != CLUTTER_CUSTOM_MODE) + clutter_alpha_set_mode (CLUTTER_ALPHA (retval), mode); + + if (alpha_func != NULL) + clutter_alpha_set_func (CLUTTER_ALPHA (retval), alpha_func, NULL, NULL); + clutter_alpha_set_timeline (CLUTTER_ALPHA (retval), timeline); if (unref_timeline) g_object_unref (timeline); @@ -878,7 +878,7 @@ return TRUE; } } - else if (G_VALUE_HOLDS (value, CLUTTER_TYPE_COLOR)) + else if (CLUTTER_VALUE_HOLDS_COLOR (value)) { ClutterColor color = { 0, }; @@ -930,7 +930,7 @@ return TRUE; } } - else if (G_VALUE_HOLDS (value, CLUTTER_TYPE_COLOR)) + else if (CLUTTER_VALUE_HOLDS_COLOR (value)) { ClutterColor color = { 0, }; @@ -2353,7 +2353,8 @@ for (i = 0; i < n_paths; i++, iter++) new_paths[iter] = g_strdup (paths[i]); - CLUTTER_NOTE (SCRIPT, "Added %d new search paths (new size: %d)", + CLUTTER_NOTE (SCRIPT, + "Added %" G_GSIZE_FORMAT " new search paths (new size: %d)", n_paths, g_strv_length (new_paths)); diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-script.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-script.h --- clutter-0.8.4/clutter/clutter-script.h 2008-11-28 18:09:48.000000000 +0000 +++ clutter-0.9.0/clutter/clutter-script.h 2009-01-28 08:12:45.000000000 +0000 @@ -18,11 +18,13 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __CLUTTER_SCRIPT_H__ #define __CLUTTER_SCRIPT_H__ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-shader.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-shader.c --- clutter-0.8.4/clutter/clutter-shader.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-shader.c 2009-01-28 08:12:45.000000000 +0000 @@ -70,7 +70,6 @@ { guint compiled : 1; /* Shader is bound to the GL context */ guint is_enabled : 1; - guint vertex_is_glsl : 1; guint fragment_is_glsl : 1; @@ -95,9 +94,6 @@ G_DEFINE_TYPE (ClutterShader, clutter_shader, G_TYPE_OBJECT); -G_CONST_RETURN gchar *clutter_shader_get_source (ClutterShader *shader, - ClutterShaderType type); - static void clutter_shader_finalize (GObject *object) { @@ -193,7 +189,6 @@ return object; } - static void clutter_shader_class_init (ClutterShaderClass *klass) { @@ -341,8 +336,8 @@ g_free (priv->fragment_source); - CLUTTER_NOTE (SHADER, "setting fragment shader (GLSL:%s, len:%" - G_GSSIZE_FORMAT ")", + CLUTTER_NOTE (SHADER, + "setting fragment shader (GLSL:%s, len:%" G_GSSIZE_FORMAT ")", is_glsl ? "yes" : "no", length); @@ -387,8 +382,8 @@ g_free (priv->vertex_source); - CLUTTER_NOTE (SHADER, "setting vertex shader (GLSL:%s, len:%" - G_GSSIZE_FORMAT ")", + CLUTTER_NOTE (SHADER, + "setting vertex shader (GLSL:%s, len:%" G_GSSIZE_FORMAT ")", is_glsl ? "yes" : "no", length); @@ -668,6 +663,7 @@ GLfloat foo = value; g_return_if_fail (CLUTTER_IS_SHADER (shader)); + g_return_if_fail (name != NULL); priv = shader->priv; @@ -675,13 +671,83 @@ cogl_program_uniform_1f (location, foo); } +/** + * clutter_shader_set_uniform: + * @shader: a #ClutterShader. + * @name: name of uniform in GLSL shader program to set. + * @value: a #ClutterShaderFloat, #ClutterShaderInt or #ClutterShaderMatrix + * #GValue. + * + * Sets a user configurable variable in the GLSL shader programs attached to + * a #ClutterShader. + * + * Since: 1.0 + */ +void +clutter_shader_set_uniform (ClutterShader *shader, + const gchar *name, + const GValue *value) +{ + ClutterShaderPrivate *priv; + GLint location = 0; + gsize size; + + g_return_if_fail (CLUTTER_IS_SHADER (shader)); + g_return_if_fail (name != NULL); + g_return_if_fail (value != 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)); + + priv = shader->priv; + g_return_if_fail (priv->program != COGL_INVALID_HANDLE); + + location = cogl_program_get_uniform_location (priv->program, name); + + if (CLUTTER_VALUE_HOLDS_SHADER_FLOAT (value)) + { + const GLfloat *floats; + + floats = clutter_value_get_shader_float (value, &size); + cogl_program_uniform_float (location, size, 1, floats); + } + else if (CLUTTER_VALUE_HOLDS_SHADER_INT (value)) + { + const COGLint *ints; + + ints = clutter_value_get_shader_int (value, &size); + cogl_program_uniform_int (location, size, 1, ints); + } + else if (CLUTTER_VALUE_HOLDS_SHADER_MATRIX (value)) + { + const GLfloat *matrix; + + matrix = clutter_value_get_shader_matrix (value, &size); + cogl_program_uniform_matrix (location, size, 1, FALSE, matrix); + } + else if (G_VALUE_HOLDS_FLOAT (value)) + { + GLfloat float_val = g_value_get_float (value); + + cogl_program_uniform_float (location, 1, 1, &float_val); + } + else if (G_VALUE_HOLDS_INT (value)) + { + COGLint int_val = g_value_get_int (value); + + cogl_program_uniform_int (location, 1, 1, &int_val); + } + else + g_assert_not_reached (); +} + /* * _clutter_shader_release_all: * * Iterate through all #ClutterShaders and tell them to release GL context * related sources. - * - * Since: 0.6 */ void _clutter_shader_release_all (void) @@ -730,6 +796,57 @@ return shader->priv->vertex_source; } +/** + * clutter_shader_get_cogl_program: + * @shader: a #ClutterShader + * + * Retrieves the underlying #CoglHandle for the shader program. + * + * Return value: A #CoglHandle for the shader program, or %NULL + * + * Since: 1.0 + */ +CoglHandle +clutter_shader_get_cogl_program (ClutterShader *shader) +{ + g_return_val_if_fail (CLUTTER_IS_SHADER (shader), NULL); + return shader->priv->program; +} + +/** + * clutter_shader_get_cogl_fragment_shader: + * @shader: a #ClutterShader + * + * Retrieves the underlying #CoglHandle for the fragment shader. + * + * Return value: A #CoglHandle for the fragment shader, or %NULL + * + * Since: 1.0 + */ +CoglHandle +clutter_shader_get_cogl_fragment_shader (ClutterShader *shader) +{ + g_return_val_if_fail (CLUTTER_IS_SHADER (shader), NULL); + return shader->priv->fragment_shader; +} + +/** + * clutter_shader_get_cogl_vertex_shader: + * @shader: a #ClutterShader + * + * Retrieves the underlying #CoglHandle for the vertex shader. + * + * Return value: A #CoglHandle for the vertex shader, or %NULL + * + * Since: 1.0 + */ +CoglHandle +clutter_shader_get_cogl_vertex_shader (ClutterShader *shader) +{ + g_return_val_if_fail (CLUTTER_IS_SHADER (shader), NULL); + return shader->priv->vertex_shader; +} + GQuark clutter_shader_error_quark (void) { diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-shader.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-shader.h --- clutter-0.8.4/clutter/clutter-shader.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-shader.h 2009-01-28 08:12:45.000000000 +0000 @@ -19,16 +19,17 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif #ifndef __CLUTTER_SHADER_H__ #define __CLUTTER_SHADER_H__ -#include +#include G_BEGIN_DECLS @@ -74,34 +75,45 @@ GObjectClass parent_class; }; -GQuark clutter_shader_error_quark (void); -GType clutter_shader_get_type (void) G_GNUC_CONST; +GQuark clutter_shader_error_quark (void); +GType clutter_shader_get_type (void) G_GNUC_CONST; -ClutterShader * clutter_shader_new (void); +ClutterShader * clutter_shader_new (void); -void clutter_shader_set_is_enabled (ClutterShader *shader, - gboolean enabled); -gboolean clutter_shader_get_is_enabled (ClutterShader *shader); - -gboolean clutter_shader_compile (ClutterShader *shader, - GError **error); -void clutter_shader_release (ClutterShader *shader); -gboolean clutter_shader_is_compiled (ClutterShader *shader); - -void clutter_shader_set_vertex_source (ClutterShader *shader, - const gchar *data, - gssize length); -void clutter_shader_set_fragment_source (ClutterShader *shader, - const gchar *data, - gssize length); - -G_CONST_RETURN gchar *clutter_shader_get_vertex_source (ClutterShader *shader); -G_CONST_RETURN gchar *clutter_shader_get_fragment_source (ClutterShader *shader); - -void clutter_shader_set_uniform_1f (ClutterShader *shader, - const gchar *name, - gfloat value); -/* should be private and internal */ +void clutter_shader_set_is_enabled (ClutterShader *shader, + gboolean enabled); +gboolean clutter_shader_get_is_enabled (ClutterShader *shader); + +gboolean clutter_shader_compile (ClutterShader *shader, + GError **error); +void clutter_shader_release (ClutterShader *shader); +gboolean clutter_shader_is_compiled (ClutterShader *shader); + +void clutter_shader_set_vertex_source (ClutterShader *shader, + const gchar *data, + gssize length); +void clutter_shader_set_fragment_source (ClutterShader *shader, + const gchar *data, + gssize length); + +G_CONST_RETURN gchar *clutter_shader_get_vertex_source (ClutterShader *shader); +G_CONST_RETURN gchar *clutter_shader_get_fragment_source (ClutterShader *shader); + +void clutter_shader_set_uniform (ClutterShader *shader, + const gchar *name, + const GValue *value); + +CoglHandle clutter_shader_get_cogl_program (ClutterShader *shader); +CoglHandle clutter_shader_get_cogl_fragment_shader (ClutterShader *shader); +CoglHandle clutter_shader_get_cogl_vertex_shader (ClutterShader *shader); + +#ifndef CLUTTER_DISABLE_DEPRECATED +void clutter_shader_set_uniform_1f (ClutterShader *shader, + const gchar *name, + gfloat value); +#endif + +/* private */ void _clutter_shader_release_all (void); G_END_DECLS diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-shader-types.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-shader-types.c --- clutter-0.8.4/clutter/clutter-shader-types.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-shader-types.c 2009-01-28 08:12:45.000000000 +0000 @@ -0,0 +1,563 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Authored By Matthew Allum + * Chris Lord + * + * 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, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include "clutter-shader-types.h" +#include "clutter-private.h" + +static GTypeInfo shader_float_info = { + 0, + NULL, + NULL, + NULL, + NULL, + NULL, + 0, + 0, + NULL, + NULL, +}; + +static GTypeFundamentalInfo shader_float_finfo = { 0, }; + +static GTypeInfo shader_int_info = { + 0, + NULL, + NULL, + NULL, + NULL, + NULL, + 0, + 0, + NULL, + NULL, +}; + +static GTypeFundamentalInfo shader_int_finfo = { 0, }; + +static GTypeInfo shader_matrix_info = { + 0, + NULL, + NULL, + NULL, + NULL, + NULL, + 0, + 0, + NULL, + NULL, +}; + +static GTypeFundamentalInfo shader_matrix_finfo = { 0, }; + +struct _ClutterShaderFloat +{ + gint size; + GLfloat value[4]; +}; + +struct _ClutterShaderInt +{ + gint size; + COGLint value[4]; +}; + +struct _ClutterShaderMatrix +{ + gint size; + GLfloat value[16]; +}; + +static gpointer +clutter_value_peek_pointer (const GValue *value) +{ + return value->data[0].v_pointer; +} + +/* Float */ + +static void +clutter_value_init_shader_float (GValue *value) +{ + value->data[0].v_pointer = g_slice_new0 (ClutterShaderFloat); +} + +static void +clutter_value_free_shader_float (GValue *value) +{ + g_slice_free (ClutterShaderFloat, value->data[0].v_pointer); +} + +static void +clutter_value_copy_shader_float (const GValue *src, + GValue *dest) +{ + dest->data[0].v_pointer = + g_slice_dup (ClutterShaderFloat, src->data[0].v_pointer); +} + +static gchar * +clutter_value_collect_shader_float (GValue *value, + guint n_collect_values, + GTypeCValue *collect_values, + guint collect_flags) +{ + gint float_count = collect_values[0].v_int; + const float *floats = collect_values[1].v_pointer; + + if (!floats) + return g_strdup_printf ("value location for `%s' passed as NULL", + G_VALUE_TYPE_NAME (value)); + + clutter_value_init_shader_float (value); + clutter_value_set_shader_float (value, float_count, floats); + + return NULL; +} + +static gchar * +clutter_value_lcopy_shader_float (const GValue *value, + guint n_collect_values, + GTypeCValue *collect_values, + guint collect_flags) +{ + gint *float_count = collect_values[0].v_pointer; + float **floats = collect_values[1].v_pointer; + ClutterShaderFloat *shader_float = value->data[0].v_pointer; + + if (!float_count || !floats) + return g_strdup_printf ("value location for `%s' passed as NULL", + G_VALUE_TYPE_NAME (value)); + + *float_count = shader_float->size; + *floats = g_memdup (shader_float->value, shader_float->size * sizeof (float)); + + return NULL; +} + +static const GTypeValueTable _clutter_shader_float_value_table = { + clutter_value_init_shader_float, + clutter_value_free_shader_float, + clutter_value_copy_shader_float, + clutter_value_peek_pointer, + "ip", + clutter_value_collect_shader_float, + "pp", + clutter_value_lcopy_shader_float +}; + +GType +clutter_shader_float_get_type (void) +{ + static GType _clutter_shader_float_type = 0; + + if (G_UNLIKELY (_clutter_shader_float_type == 0)) + { + shader_float_info.value_table = & _clutter_shader_float_value_table; + _clutter_shader_float_type = + g_type_register_fundamental (g_type_fundamental_next (), + I_("ClutterShaderFloat"), + &shader_float_info, + &shader_float_finfo, 0); + } + + return _clutter_shader_float_type; +} + + +/* Integer */ + +static void +clutter_value_init_shader_int (GValue *value) +{ + value->data[0].v_pointer = g_slice_new0 (ClutterShaderInt); +} + +static void +clutter_value_free_shader_int (GValue *value) +{ + g_slice_free (ClutterShaderInt, value->data[0].v_pointer); +} + +static void +clutter_value_copy_shader_int (const GValue *src, + GValue *dest) +{ + dest->data[0].v_pointer = + g_slice_dup (ClutterShaderInt, src->data[0].v_pointer); +} + +static gchar * +clutter_value_collect_shader_int (GValue *value, + guint n_collect_values, + GTypeCValue *collect_values, + guint collect_flags) +{ + gint int_count = collect_values[0].v_int; + const COGLint *ints = collect_values[1].v_pointer; + + if (!ints) + return g_strdup_printf ("value location for `%s' passed as NULL", + G_VALUE_TYPE_NAME (value)); + + clutter_value_init_shader_int (value); + clutter_value_set_shader_int (value, int_count, ints); + + return NULL; +} + +static gchar * +clutter_value_lcopy_shader_int (const GValue *value, + guint n_collect_values, + GTypeCValue *collect_values, + guint collect_flags) +{ + gint *int_count = collect_values[0].v_pointer; + COGLint **ints = collect_values[1].v_pointer; + ClutterShaderInt *shader_int = value->data[0].v_pointer; + + if (!int_count || !ints) + return g_strdup_printf ("value location for `%s' passed as NULL", + G_VALUE_TYPE_NAME (value)); + + *int_count = shader_int->size; + *ints = g_memdup (shader_int->value, shader_int->size * sizeof (COGLint)); + + return NULL; +} + +static const GTypeValueTable _clutter_shader_int_value_table = { + clutter_value_init_shader_int, + clutter_value_free_shader_int, + clutter_value_copy_shader_int, + clutter_value_peek_pointer, + "ip", + clutter_value_collect_shader_int, + "pp", + clutter_value_lcopy_shader_int +}; + +GType +clutter_shader_int_get_type (void) +{ + static GType _clutter_shader_int_type = 0; + + if (G_UNLIKELY (_clutter_shader_int_type == 0)) + { + shader_int_info.value_table = & _clutter_shader_int_value_table; + _clutter_shader_int_type = + g_type_register_fundamental (g_type_fundamental_next (), + I_("ClutterShaderInt"), + &shader_int_info, + &shader_int_finfo, 0); + } + + return _clutter_shader_int_type; +} + + +/* Matrix */ + +static void +clutter_value_init_shader_matrix (GValue *value) +{ + value->data[0].v_pointer = g_slice_new0 (ClutterShaderMatrix); +} + +static void +clutter_value_free_shader_matrix (GValue *value) +{ + g_slice_free (ClutterShaderMatrix, value->data[0].v_pointer); +} + +static void +clutter_value_copy_shader_matrix (const GValue *src, + GValue *dest) +{ + dest->data[0].v_pointer = + g_slice_dup (ClutterShaderMatrix, src->data[0].v_pointer); +} + +static gchar * +clutter_value_collect_shader_matrix (GValue *value, + guint n_collect_values, + GTypeCValue *collect_values, + guint collect_flags) +{ + gint float_count = collect_values[0].v_int; + const float *floats = collect_values[1].v_pointer; + + if (!floats) + return g_strdup_printf ("value location for `%s' passed as NULL", + G_VALUE_TYPE_NAME (value)); + + clutter_value_init_shader_matrix (value); + clutter_value_set_shader_matrix (value, float_count, floats); + + return NULL; +} + +static gchar * +clutter_value_lcopy_shader_matrix (const GValue *value, + guint n_collect_values, + GTypeCValue *collect_values, + guint collect_flags) +{ + gint *float_count = collect_values[0].v_pointer; + float **floats = collect_values[1].v_pointer; + ClutterShaderFloat *shader_float = value->data[0].v_pointer; + + if (!float_count || !floats) + return g_strdup_printf ("value location for `%s' passed as NULL", + G_VALUE_TYPE_NAME (value)); + + *float_count = shader_float->size; + *floats = g_memdup (shader_float->value, + shader_float->size * shader_float->size * sizeof (float)); + + return NULL; +} + +static const GTypeValueTable _clutter_shader_matrix_value_table = { + clutter_value_init_shader_matrix, + clutter_value_free_shader_matrix, + clutter_value_copy_shader_matrix, + clutter_value_peek_pointer, + "ip", + clutter_value_collect_shader_matrix, + "pp", + clutter_value_lcopy_shader_matrix +}; + +GType +clutter_shader_matrix_get_type (void) +{ + static GType _clutter_shader_matrix_type = 0; + + if (G_UNLIKELY (_clutter_shader_matrix_type == 0)) + { + shader_matrix_info.value_table = & _clutter_shader_matrix_value_table; + _clutter_shader_matrix_type = + g_type_register_fundamental (g_type_fundamental_next (), + I_("ClutterShaderMatrix"), + &shader_matrix_info, + &shader_matrix_finfo, 0); + } + + return _clutter_shader_matrix_type; +} + + +/* Utility functions */ + +/** + * clutter_value_set_shader_float: + * @value: a #GValue + * @size: number of floating point values in @floats + * @floats: an array of floating point values + * + * Sets @floats as the contents of @value. The passed #GValue + * must have been initialized using %CLUTTER_TYPE_SHADER_FLOAT. + * + * Since: 0.8 + */ +void +clutter_value_set_shader_float (GValue *value, + gint size, + const gfloat *floats) +{ + ClutterShaderFloat *shader_float; + gint i; + + g_return_if_fail (CLUTTER_VALUE_HOLDS_SHADER_FLOAT (value)); + + shader_float = value->data[0].v_pointer; + + shader_float->size = size; + + for (i = 0; i < size; i++) + shader_float->value[i] = floats[i]; +} + +/** + * clutter_value_set_shader_int: + * @value: a #GValue + * @size: number of integer values in @ints + * @ints: an array of integer values + * + * Sets @ints as the contents of @value. The passed #GValue + * must have been initialized using %CLUTTER_TYPE_SHADER_INT. + * + * Since: 0.8 + */ +void +clutter_value_set_shader_int (GValue *value, + gint size, + const gint *ints) +{ + ClutterShaderInt *shader_int; + gint i; + + g_return_if_fail (CLUTTER_VALUE_HOLDS_SHADER_INT (value)); + + shader_int = value->data[0].v_pointer; + + shader_int->size = size; + + for (i = 0; i < size; i++) + shader_int->value[i] = ints[i]; +} + +/** + * clutter_value_set_shader_matrix: + * @value: a #GValue + * @size: number of floating point values in @floats + * @matrix: a matrix of floating point values + * + * Sets @matrix as the contents of @value. The passed #GValue + * must have been initialized using %CLUTTER_TYPE_SHADER_MATRIX. + * + * Since: 0.8 + */ +void +clutter_value_set_shader_matrix (GValue *value, + gint size, + const gfloat *matrix) +{ + ClutterShaderMatrix *shader_matrix; + gint i; + + g_return_if_fail (CLUTTER_VALUE_HOLDS_SHADER_MATRIX (value)); + + shader_matrix = value->data[0].v_pointer; + + shader_matrix->size = size; + + for (i = 0; i < size * size; i++) + shader_matrix->value[i] = matrix[i]; +} + +/** + * clutter_value_get_shader_float: + * @value: a #GValue + * @length: return location for the number of returned floating + * point values, or %NULL + * + * Retrieves the list of floating point values stored inside + * the passed #GValue. @value must have been initialized with + * %CLUTTER_TYPE_SHADER_FLOAT. + * + * Return value: the pointer to a list of floating point values. + * The returned value is owned by the #GValue and should never + * be modified or freed. + * + * Since: 0.8 + */ +G_CONST_RETURN gfloat * +clutter_value_get_shader_float (const GValue *value, + gsize *length) +{ + ClutterShaderFloat *shader_float; + + g_return_val_if_fail (CLUTTER_VALUE_HOLDS_SHADER_FLOAT (value), 0); + + shader_float = value->data[0].v_pointer; + + if (length) + *length = shader_float->size; + + return shader_float->value; +} + +/** + * clutter_value_get_shader_int: + * @value: a #GValue + * @length: return location for the number of returned integer + * values, or %NULL + * + * Retrieves the list of integer values stored inside the passed + * #GValue. @value must have been initialized with + * %CLUTTER_TYPE_SHADER_INT. + * + * Return value: the pointer to a list of integer values. + * The returned value is owned by the #GValue and should never + * be modified or freed. + * + * Since: 0.8 + */ +G_CONST_RETURN COGLint * +clutter_value_get_shader_int (const GValue *value, + gsize *length) +{ + ClutterShaderInt *shader_int; + + g_return_val_if_fail (CLUTTER_VALUE_HOLDS_SHADER_INT (value), 0); + + shader_int = value->data[0].v_pointer; + + if (length) + *length = shader_int->size; + + return shader_int->value; +} + +/** + * clutter_value_get_shader_matrix: + * @value: a #GValue + * @length: return location for the number of returned floating + * point values, or %NULL + * + * Retrieves a matrix of floating point values stored inside + * the passed #GValue. @value must have been initialized with + * %CLUTTER_TYPE_SHADER_MATRIX. + * + * Return value: the pointer to a matrix of floating point values. + * The returned value is owned by the #GValue and should never + * be modified or freed. + * + * Since: 0.8 + */ +G_CONST_RETURN gfloat * +clutter_value_get_shader_matrix (const GValue *value, + gsize *length) +{ + ClutterShaderMatrix *shader_matrix; + + g_return_val_if_fail (CLUTTER_VALUE_HOLDS_SHADER_MATRIX (value), 0); + + shader_matrix = value->data[0].v_pointer; + + if (length) + *length = shader_matrix->size; + + return shader_matrix->value; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-shader-types.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-shader-types.h --- clutter-0.8.4/clutter/clutter-shader-types.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-shader-types.h 2009-01-28 08:12:45.000000000 +0000 @@ -0,0 +1,96 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Authored By Matthew Allum + * + * Copyright (C) 2008 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 . + */ + +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_SHADER_TYPES_H__ +#define __CLUTTER_SHADER_TYPES_H__ + +#include +#include + +G_BEGIN_DECLS + +#define CLUTTER_TYPE_SHADER_FLOAT (clutter_shader_float_get_type ()) +#define CLUTTER_TYPE_SHADER_INT (clutter_shader_int_get_type ()) +#define CLUTTER_TYPE_SHADER_MATRIX (clutter_shader_matrix_get_type ()) + +typedef struct _ClutterShaderFloat ClutterShaderFloat; +typedef struct _ClutterShaderInt ClutterShaderInt; +typedef struct _ClutterShaderMatrix ClutterShaderMatrix; + +/** + * CLUTTER_VALUE_HOLDS_SHADER_FLOAT: + * @x: a #GValue + * + * Evaluates to %TRUE if @x holds a #ClutterShaderFloat. + * + * Since: 1.0 + */ +#define CLUTTER_VALUE_HOLDS_SHADER_FLOAT(x) (G_VALUE_HOLDS ((x), CLUTTER_TYPE_SHADER_FLOAT)) + +/** + * CLUTTER_VALUE_HOLDS_SHADER_INT: + * @x: a #GValue + * + * Evaluates to %TRUE if @x holds a #ClutterShaderInt. + * + * Since: 1.0 + */ +#define CLUTTER_VALUE_HOLDS_SHADER_INT(x) (G_VALUE_HOLDS ((x), CLUTTER_TYPE_SHADER_INT)) + +/** + * CLUTTER_VALUE_HOLDS_SHADER_MATRIX: + * @x: a #GValue + * + * Evaluates to %TRUE if @x holds a #ClutterShaderMatrix. + * + * Since: 1.0 + */ +#define CLUTTER_VALUE_HOLDS_SHADER_MATRIX(x) (G_VALUE_HOLDS ((x), CLUTTER_TYPE_SHADER_MATRIX)) + +GType clutter_shader_float_get_type (void) G_GNUC_CONST; +GType clutter_shader_int_get_type (void) G_GNUC_CONST; +GType clutter_shader_matrix_get_type (void) G_GNUC_CONST; + +void clutter_value_set_shader_float (GValue *value, + gint size, + const gfloat *floats); +void clutter_value_set_shader_int (GValue *value, + gint size, + const gint *ints); +void clutter_value_set_shader_matrix (GValue *value, + gint size, + const gfloat *matrix); +G_CONST_RETURN gfloat * clutter_value_get_shader_float (const GValue *value, + gsize *length); +G_CONST_RETURN COGLint *clutter_value_get_shader_int (const GValue *value, + gsize *length); +G_CONST_RETURN GLfloat *clutter_value_get_shader_matrix (const GValue *value, + gsize *length); + +G_END_DECLS + +#endif /* __CLUTTER_SHADER_TYPES_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-stage.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-stage.c --- clutter-0.8.4/clutter/clutter-stage.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-stage.c 2009-01-28 16:45:24.000000000 +0000 @@ -115,11 +115,15 @@ UNFULLSCREEN, ACTIVATE, DEACTIVATE, + QUEUE_REDRAW, + LAST_SIGNAL }; static guint stage_signals[LAST_SIGNAL] = { 0, }; +static const ClutterColor default_stage_color = { 255, 255, 255, 255 }; + static void clutter_stage_get_preferred_width (ClutterActor *self, ClutterUnit for_height, @@ -209,16 +213,20 @@ clutter_stage_paint (ClutterActor *self) { ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv; - - CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_PAINT); + CoglColor stage_color; CLUTTER_NOTE (PAINT, "Initializing stage paint"); - cogl_paint_init (&priv->color); + cogl_color_set_from_4ub (&stage_color, + priv->color.red, + priv->color.green, + priv->color.blue, + priv->color.alpha); + cogl_paint_init (&stage_color); if (priv->use_fog) { - cogl_fog_set (&priv->color, + cogl_fog_set (&stage_color, priv->fog.density, priv->fog.z_near, priv->fog.z_far); @@ -227,8 +235,6 @@ CLUTTER_NOTE (PAINT, "Proxying the paint to the stage implementation"); clutter_actor_paint (priv->impl); - CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_PAINT); - /* this will take care of painting every child */ CLUTTER_ACTOR_CLASS (clutter_stage_parent_class)->paint (self); } @@ -252,6 +258,11 @@ CLUTTER_ACTOR_SET_FLAGS (self, CLUTTER_ACTOR_REALIZED); + /* Make sure the viewport and projection matrix are valid for the + first paint (which will likely occur before the ConfigureNotify + is received) */ + CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_SYNC_MATRICES); + g_assert (priv->impl != NULL); CLUTTER_ACTOR_GET_CLASS (priv->impl)->realize (priv->impl); @@ -331,6 +342,42 @@ clutter_actor_allocate (CLUTTER_ACTOR (stage), &box, FALSE); } +static gboolean +redraw_update_idle (gpointer user_data) +{ + ClutterStage *stage = user_data; + ClutterStagePrivate *priv = stage->priv; + + if (priv->update_idle) + { + g_source_remove (priv->update_idle); + priv->update_idle = 0; + } + + CLUTTER_NOTE (MULTISTAGE, "redrawing via idle for stage:%p", stage); + clutter_redraw (stage); + + return FALSE; +} + +static void +clutter_stage_real_queue_redraw (ClutterStage *stage) +{ + ClutterStagePrivate *priv = stage->priv; + + if (priv->update_idle == 0) + { + CLUTTER_TIMESTAMP (SCHEDULER, "Adding idle source for stage: %p", stage); + + /* FIXME: weak_ref self in case we dissapear before paint? */ + priv->update_idle = + clutter_threads_add_idle_full (CLUTTER_PRIORITY_REDRAW, + redraw_update_idle, + stage, + NULL); + } +} + static void clutter_stage_set_property (GObject *object, guint prop_id, @@ -348,7 +395,7 @@ switch (prop_id) { case PROP_COLOR: - clutter_stage_set_color (stage, g_value_get_boxed (value)); + clutter_stage_set_color (stage, clutter_value_get_color (value)); break; case PROP_OFFSCREEN: if (priv->is_offscreen == g_value_get_boolean (value)) @@ -408,7 +455,6 @@ { ClutterStage *stage; ClutterStagePrivate *priv; - ClutterColor color; ClutterPerspective perspective; stage = CLUTTER_STAGE(object); @@ -417,8 +463,7 @@ switch (prop_id) { case PROP_COLOR: - clutter_stage_get_color (stage, &color); - g_value_set_boxed (value, &color); + clutter_value_set_color (value, &priv->color); break; case PROP_OFFSCREEN: g_value_set_boolean (value, priv->is_offscreen); @@ -491,6 +536,7 @@ { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); + GParamSpec *pspec; gobject_class->set_property = clutter_stage_set_property; gobject_class->get_property = clutter_stage_get_property; @@ -563,13 +609,12 @@ * * The color of the main stage. */ - g_object_class_install_property - (gobject_class, PROP_COLOR, - g_param_spec_boxed ("color", - "Color", - "The color of the main stage", - CLUTTER_TYPE_COLOR, - CLUTTER_PARAM_READWRITE)); + pspec = clutter_param_spec_color ("color", + "Color", + "The color of the stage", + &default_stage_color, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_COLOR, pspec); /** * ClutterStage:perspective: @@ -685,8 +730,58 @@ NULL, NULL, clutter_marshal_VOID__VOID, G_TYPE_NONE, 0); + /** + * ClutterStage::queue-redraw: + * @stage: the stage which was queued for redraw + * + * The ::queue-redraw signal is emitted each time a #ClutterStage + * has been queued for a redraw. You can use this signal to know + * when clutter_stage_queue_redraw() has been called. + * + * Toolkits embedding a #ClutterStage which require a redraw and + * relayout cycle can stop the emission of this signal using the + * GSignal API, redraw the UI and then call clutter_redraw() + * themselves, like: + * + * |[ + * static void + * on_redraw_complete (void) + * { + * /* execute the Clutter drawing pipeline */ + * clutter_redraw (); + * } + * + * static void + * on_stage_queue_redraw (ClutterStage *stage) + * { + * /* this prevents the default handler to run */ + * g_signal_stop_emission_by_name (stage, "queue-redraw"); + * + * /* queue a redraw with the host toolkit and call + * * a function when the redraw has been completed + * */ + * queue_a_redraw (G_CALLBACK (on_redraw_complete)); + * } + * ]| + * + * This signal is emitted before the Clutter paint + * pipeline is run. If you want to know when the pipeline has been + * completed you should connect to the ::paint signal on the Stage + * with g_signal_connect_after(). + * + * Since: 1.0 + */ + stage_signals[QUEUE_REDRAW] = + g_signal_new (I_("queue-redraw"), + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ClutterStageClass, queue_redraw), + NULL, NULL, + clutter_marshal_VOID__VOID, + G_TYPE_NONE, 0); klass->fullscreen = clutter_stage_real_fullscreen; + klass->queue_redraw = clutter_stage_real_queue_redraw; g_type_class_add_private (gobject_class, sizeof (ClutterStagePrivate)); } @@ -723,13 +818,10 @@ priv->is_cursor_visible = TRUE; priv->use_fog = FALSE; - priv->color.red = 0xff; - priv->color.green = 0xff; - priv->color.blue = 0xff; - priv->color.alpha = 0xff; + priv->color = default_stage_color; - priv->perspective.fovy = CFX_60; /* 60 Degrees */ - priv->perspective.aspect = CFX_ONE; + priv->perspective.fovy = 60.0; /* 60 Degrees */ + priv->perspective.aspect = 1.0; priv->perspective.z_near = CLUTTER_FLOAT_TO_FIXED (0.1); priv->perspective.z_far = CLUTTER_FLOAT_TO_FIXED (100.0); @@ -1202,7 +1294,7 @@ /* The y co-ordinate should be given in OpenGL's coordinate system so 0 is the bottom row */ - y = stage_height - 1 - y - height; + y = stage_height - y - height; glFinish (); @@ -1325,7 +1417,7 @@ * * Sets the stage title. * - * Since 0.4 + * Since: 0.4 **/ void clutter_stage_set_title (ClutterStage *stage, @@ -1631,52 +1723,6 @@ *fog = stage->priv->fog; } -/** - * clutter_stage_get_resolution: - * @stage: the #ClutterStage - * - * Retrieves the resolution (in DPI) of the stage from the default - * backend. - * - * Return value: the resolution of the stage - * - * Since: 0.6 - */ -gdouble -clutter_stage_get_resolution (ClutterStage *stage) -{ - ClutterMainContext *context; - - context = clutter_context_get_default (); - g_assert (context != NULL); - - return clutter_backend_get_resolution (context->backend); -} - -/** - * clutter_stage_get_resolutionx: - * @stage: the #ClutterStage - * - * Fixed point version of clutter_stage_get_resolution(). - * - * Return value: the resolution of the stage - * - * Since: 0.6 - */ -ClutterFixed -clutter_stage_get_resolutionx (ClutterStage *stage) -{ - ClutterFixed res; - ClutterMainContext *context; - - context = clutter_context_get_default (); - g_assert (context != NULL); - - res = clutter_backend_get_resolution (context->backend); - - return CLUTTER_FLOAT_TO_FIXED (res); -} - /*** Perspective boxed type ******/ static ClutterPerspective * @@ -1802,22 +1848,29 @@ _clutter_backend_ensure_context (ctx->backend, stage); } -static gboolean -redraw_update_idle (gpointer user_data) +/** + * clutter_stage_ensure_viewport: + * @stage: a #ClutterStage + * + * Ensures that the GL viewport is updated with the current + * stage window size. + * + * This function will queue a redraw of @stage. + * + * This function should not be called by applications; it is used + * when embedding a #ClutterStage into a toolkit with another + * windowing system, like GTK+. + * + * Since: 1.0 + */ +void +clutter_stage_ensure_viewport (ClutterStage *stage) { - ClutterStage *stage = user_data; - ClutterStagePrivate *priv = stage->priv; - - if (priv->update_idle) - { - g_source_remove (priv->update_idle); - priv->update_idle = 0; - } + g_return_if_fail (CLUTTER_IS_STAGE (stage)); - CLUTTER_NOTE (MULTISTAGE, "redrawing via idle for stage:%p", stage); - clutter_redraw (stage); + CLUTTER_SET_PRIVATE_FLAGS (stage, CLUTTER_ACTOR_SYNC_MATRICES); - return FALSE; + clutter_stage_queue_redraw (stage); } /** @@ -1836,17 +1889,7 @@ { g_return_if_fail (CLUTTER_IS_STAGE (stage)); - if (!stage->priv->update_idle) - { - CLUTTER_TIMESTAMP (SCHEDULER, "Adding idle source for stage: %p", stage); - - /* FIXME: weak_ref self in case we dissapear before paint? */ - stage->priv->update_idle = - clutter_threads_add_idle_full (CLUTTER_PRIORITY_REDRAW, - redraw_update_idle, - stage, - NULL); - } + g_signal_emit (stage, stage_signals[QUEUE_REDRAW], 0); } /** diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-stage.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-stage.h --- clutter-0.8.4/clutter/clutter-stage.h 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-stage.h 2009-01-28 08:12:45.000000000 +0000 @@ -18,11 +18,13 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __CLUTTER_STAGE_H__ #define __CLUTTER_STAGE_H__ @@ -31,10 +33,6 @@ #include #include -#ifdef USE_GDKPIXBUF -#include -#endif - G_BEGIN_DECLS #define CLUTTER_TYPE_PERSPECTIVE (clutter_perspective_get_type ()) @@ -64,7 +62,7 @@ /** * CLUTTER_STAGE_WIDTH: * - * Macro that evaluates to the current stage width + * Macro that evaluates to the width of the default stage * * Since: 0.2 */ @@ -74,7 +72,7 @@ /** * CLUTTER_STAGE_HEIGHT: * - * Macro that evaluates to the current stage height + * Macro that evaluates to the height of the default stage * * Since: 0.2 */ @@ -108,6 +106,8 @@ void (* activate) (ClutterStage *stage); void (* deactivate) (ClutterStage *stage); + void (* queue_redraw) (ClutterStage *stage); + /*< private >*/ /* padding for future expansion */ gpointer _padding_dummy[32]; @@ -220,8 +220,6 @@ ClutterFog *fog); void clutter_stage_get_fogx (ClutterStage *stage, ClutterFog *fog); -gdouble clutter_stage_get_resolution (ClutterStage *stage); -ClutterFixed clutter_stage_get_resolutionx (ClutterStage *stage); void clutter_stage_set_key_focus (ClutterStage *stage, ClutterActor *actor); @@ -231,6 +229,7 @@ void clutter_stage_ensure_current (ClutterStage *stage); void clutter_stage_queue_redraw (ClutterStage *stage); gboolean clutter_stage_is_default (ClutterStage *stage); +void clutter_stage_ensure_viewport (ClutterStage *stage); /* Commodity macro */ #define clutter_stage_add(stage,actor) G_STMT_START { \ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-stage-manager.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-stage-manager.h --- clutter-0.8.4/clutter/clutter-stage-manager.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-stage-manager.h 2009-01-28 08:12:45.000000000 +0000 @@ -18,15 +18,16 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __CLUTTER_STAGE_MANAGER_H__ #define __CLUTTER_STAGE_MANAGER_H__ -#include #include #include @@ -44,6 +45,7 @@ struct _ClutterStageManagerClass { + /*< private >*/ GObjectClass parent_class; void (* stage_added) (ClutterStageManager *stage_manager, diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-stage-window.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-stage-window.h --- clutter-0.8.4/clutter/clutter-stage-window.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-stage-window.h 2009-01-28 08:12:45.000000000 +0000 @@ -2,9 +2,6 @@ #define __CLUTTER_STAGE_WINDOW_H__ #include -#ifdef USE_GDKPIXBUF -#include -#endif G_BEGIN_DECLS diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-text.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-text.c --- clutter-0.8.4/clutter/clutter-text.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-text.c 2009-01-29 13:30:31.000000000 +0000 @@ -0,0 +1,3803 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Copyright (C) 2008 Intel Corporation. + * + * Authored By: Øyvind Kolås + * Emmanuele Bassi + * + * 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 . + */ + +/** + * SECTION:clutter-text + * @short_description: An actor for displaying and editing text + * + * #ClutterText is an actor that displays custom text using Pango + * as the text rendering engine. + * + * #ClutterText also allows inline editing of the text if the + * actor is set editable using clutter_text_set_editable(). + * + * Selection using keyboard or pointers can be enabled using + * clutter_text_set_selectable(). + * + * #ClutterText is available since Clutter 1.0 + */ + +/* TODO: undo/redo hooks? */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include "clutter-text.h" + +#include "clutter-binding-pool.h" +#include "clutter-debug.h" +#include "clutter-enum-types.h" +#include "clutter-keysyms.h" +#include "clutter-main.h" +#include "clutter-private.h" /* includes pango/cogl-pango.h */ +#include "clutter-units.h" + +/* cursor width in pixels */ +#define DEFAULT_CURSOR_SIZE 2 + +/* We need at least three cached layouts to run the allocation without + * regenerating a new layout. First the layout will be generated at + * full width to get the preferred width, then it will be generated at + * the preferred width to get the preferred height and then it might + * be regenerated at a different width to get the height for the + * actual allocated width + */ +#define N_CACHED_LAYOUTS 3 + +#define CLUTTER_TEXT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_TEXT, ClutterTextPrivate)) + +typedef struct _LayoutCache LayoutCache; + +static const ClutterColor default_cursor_color = { 0, 0, 0, 255 }; +static const ClutterColor default_text_color = { 0, 0, 0, 255 }; + +G_DEFINE_TYPE (ClutterText, clutter_text, CLUTTER_TYPE_ACTOR); + +struct _LayoutCache +{ + /* Cached layout. Pango internally caches the computed extents + * when they are requested so there is no need to cache that as + * well + */ + PangoLayout *layout; + + /* The width that used to generate this layout */ + ClutterUnit width; + + /* A number representing the age of this cache (so that when a + * new layout is needed the last used cache is replaced) + */ + guint age; +}; + +struct _ClutterTextPrivate +{ + PangoFontDescription *font_desc; + + gchar *text; + gchar *font_name; + + ClutterColor text_color; + + LayoutCache cached_layouts[N_CACHED_LAYOUTS]; + guint cache_age; + + PangoAttrList *attrs; + PangoAttrList *effective_attrs; + + guint alignment : 2; + guint wrap : 1; + guint use_underline : 1; + guint use_markup : 1; + guint ellipsize : 3; + guint single_line_mode : 1; + guint wrap_mode : 3; + guint justify : 1; + guint editable : 1; + guint cursor_visible : 1; + guint activatable : 1; + guint selectable : 1; + guint in_select_drag : 1; + guint cursor_color_set : 1; + + /* current cursor position */ + gint position; + + /* current 'other end of selection' position */ + gint selection_bound; + + /* the x position in the PangoLayout, used to + * avoid drifting when repeatedly moving up|down + */ + gint x_pos; + + /* the x position of the PangoLayout when in + * single line mode, to scroll the contents of the + * text actor + */ + gint text_x; + + /* the length of the text, in bytes */ + gint n_bytes; + + /* the length of the text, in characters */ + gint n_chars; + + /* Where to draw the cursor */ + ClutterGeometry cursor_pos; + ClutterColor cursor_color; + guint cursor_size; + + gint max_length; + + gunichar password_char; + + /* Signal handler for when the backend changes its font settings */ + guint font_changed_id; +}; + +enum +{ + PROP_0, + + PROP_FONT_NAME, + PROP_TEXT, + PROP_COLOR, + PROP_USE_MARKUP, + PROP_ATTRIBUTES, + PROP_ALIGNMENT, + PROP_LINE_WRAP, + PROP_LINE_WRAP_MODE, + PROP_JUSTIFY, + PROP_ELLIPSIZE, + PROP_POSITION, + PROP_SELECTION_BOUND, + PROP_CURSOR_VISIBLE, + PROP_CURSOR_COLOR, + PROP_CURSOR_COLOR_SET, + PROP_CURSOR_SIZE, + PROP_EDITABLE, + PROP_SELECTABLE, + PROP_ACTIVATABLE, + PROP_PASSWORD_CHAR, + PROP_MAX_LENGTH, + PROP_SINGLE_LINE_MODE +}; + +enum +{ + TEXT_CHANGED, + CURSOR_EVENT, + ACTIVATE, + + LAST_SIGNAL +}; + +static guint text_signals[LAST_SIGNAL] = { 0, }; + +static void clutter_text_font_changed_cb (ClutterText *text); + +#define offset_real(t,p) ((p) == -1 ? g_utf8_strlen ((t), -1) : (p)) + +static gint +offset_to_bytes (const gchar *text, + gint pos) +{ + const gchar *ptr; + + if (pos < 0) + return strlen (text); + + /* Loop over each character in the string until we either reach the + end or the requested position */ + for (ptr = text; *ptr && pos-- > 0; ptr = g_utf8_next_char (ptr)); + + return ptr - text; +} + +#define bytes_to_offset(t,p) (g_utf8_pointer_to_offset ((t), (t) + (p))) + + +static inline void +clutter_text_clear_selection (ClutterText *self) +{ + ClutterTextPrivate *priv = self->priv; + + priv->selection_bound = priv->position; +} + +static PangoLayout * +clutter_text_create_layout_no_cache (ClutterText *text, + ClutterUnit allocation_width) +{ + ClutterTextPrivate *priv = text->priv; + PangoContext *context; + PangoLayout *layout; + + context = clutter_actor_get_pango_context (CLUTTER_ACTOR (text)); + layout = pango_layout_new (context); + + pango_layout_set_font_description (layout, priv->font_desc); + + if (priv->effective_attrs) + pango_layout_set_attributes (layout, priv->effective_attrs); + + pango_layout_set_alignment (layout, priv->alignment); + pango_layout_set_single_paragraph_mode (layout, priv->single_line_mode); + pango_layout_set_justify (layout, priv->justify); + + if (priv->text) + { + if (priv->use_markup && !priv->editable) + pango_layout_set_markup (layout, priv->text, -1); + else + { + if (G_LIKELY (priv->password_char == 0)) + pango_layout_set_text (layout, priv->text, priv->n_bytes); + else + { + GString *str = g_string_sized_new (priv->n_bytes); + gunichar invisible_char; + gchar buf[7]; + gint char_len, i; + + invisible_char = priv->password_char; + + /* we need to convert the string built of invisible + * characters into UTF-8 for it to be fed to the Pango + * layout + */ + memset (buf, 0, sizeof (buf)); + char_len = g_unichar_to_utf8 (invisible_char, buf); + + for (i = 0; i < priv->n_chars; i++) + g_string_append_len (str, buf, char_len); + + pango_layout_set_text (layout, str->str, str->len); + + g_string_free (str, TRUE); + } + } + } + + if (allocation_width > 0 && + (priv->ellipsize != PANGO_ELLIPSIZE_NONE || priv->wrap)) + { + int layout_width, layout_height; + + pango_layout_get_size (layout, &layout_width, &layout_height); + + /* No need to set ellipsize or wrap if we already have enough + * space, since we don't want to make the layout wider than it + * would be otherwise. + */ + + if (CLUTTER_UNITS_FROM_PANGO_UNIT (layout_width) > allocation_width) + { + if (priv->ellipsize != PANGO_ELLIPSIZE_NONE) + { + gint width; + + width = allocation_width > 0 + ? CLUTTER_UNITS_TO_PANGO_UNIT (allocation_width) + : -1; + + pango_layout_set_ellipsize (layout, priv->ellipsize); + pango_layout_set_width (layout, width); + } + else if (priv->wrap) + { + gint width; + + width = allocation_width > 0 + ? CLUTTER_UNITS_TO_PANGO_UNIT (allocation_width) + : -1; + + pango_layout_set_wrap (layout, priv->wrap_mode); + pango_layout_set_width (layout, width); + } + } + } + + return layout; +} + +static void +clutter_text_dirty_cache (ClutterText *text) +{ + ClutterTextPrivate *priv = text->priv; + int i; + + /* Delete the cached layouts so they will be recreated the next time + they are needed */ + for (i = 0; i < N_CACHED_LAYOUTS; i++) + if (priv->cached_layouts[i].layout) + { + g_object_unref (priv->cached_layouts[i].layout); + priv->cached_layouts[i].layout = NULL; + } +} + +static void +clutter_text_font_changed_cb (ClutterText *text) +{ + clutter_text_dirty_cache (text); + clutter_actor_queue_relayout (CLUTTER_ACTOR (text)); +} + +/* + * clutter_text_create_layout: + * @text: a #ClutterText + * @allocation_width: the allocation width + * + * Like clutter_text_create_layout_no_cache(), but will also ensure + * the glyphs cache. If a previously cached layout generated using the + * same width is available then that will be used instead of + * generating a new one. + */ +static PangoLayout * +clutter_text_create_layout (ClutterText *text, + ClutterUnit allocation_width) +{ + ClutterTextPrivate *priv = text->priv; + LayoutCache *oldest_cache = priv->cached_layouts; + gboolean found_free_cache = FALSE; + int i; + + /* Search for a cached layout with the same width and keep track of + the oldest one */ + for (i = 0; i < N_CACHED_LAYOUTS; i++) + { + if (priv->cached_layouts[i].layout == NULL) + { + /* Always prefer free cache spaces */ + found_free_cache = TRUE; + oldest_cache = priv->cached_layouts + i; + } + /* If this cached layout is using the same width then we can + just return that directly */ + else if (priv->cached_layouts[i].width == allocation_width) + { + CLUTTER_NOTE (ACTOR, "ClutterText: %p: cache hit for width %i", + text, + CLUTTER_UNITS_TO_DEVICE (allocation_width)); + + return priv->cached_layouts[i].layout; + } + else if (!found_free_cache && + (priv->cached_layouts[i].age < oldest_cache->age)) + { + oldest_cache = priv->cached_layouts + i; + } + } + + CLUTTER_NOTE (ACTOR, "ClutterText: %p: cache miss for width %i", + text, + CLUTTER_UNITS_TO_DEVICE (allocation_width)); + + /* If we make it here then we didn't have a cached version so we + need to recreate the layout */ + if (oldest_cache->layout) + g_object_unref (oldest_cache->layout); + + oldest_cache->layout = + clutter_text_create_layout_no_cache (text, allocation_width); + + cogl_pango_ensure_glyph_cache_for_layout (oldest_cache->layout); + + /* Mark the 'time' this cache was created and advance the time */ + oldest_cache->age = priv->cache_age++; + oldest_cache->width = allocation_width; + + return oldest_cache->layout; +} + +static gint +clutter_text_coords_to_position (ClutterText *text, + gint x, + gint y) +{ + gint index_; + gint px, py; + gint trailing; + + px = x * PANGO_SCALE; + py = y * PANGO_SCALE; + + pango_layout_xy_to_index (clutter_text_get_layout (text), + px, py, + &index_, &trailing); + + return index_ + trailing; +} + +/* + * clutter_text_position_to_coords: + * @self: a #ClutterText + * @position: position in characters + * @x: return location for the X coordinate, or %NULL + * @y: return location for the Y coordinate, or %NULL + * @line_height: return location for the line height, or %NULL + * + * Retrieves the coordinates of the given @position. + * + * Return value: %TRUE if the conversion was successful + */ +static gboolean +clutter_text_position_to_coords (ClutterText *self, + gint position, + ClutterUnit *x, + ClutterUnit *y, + ClutterUnit *line_height) +{ + ClutterTextPrivate *priv = self->priv; + PangoRectangle rect; + gint password_char_bytes = 1; + gint index_; + + if (priv->password_char != 0) + password_char_bytes = g_unichar_to_utf8 (priv->password_char, NULL); + + if (position == -1) + { + if (priv->password_char == 0) + index_ = priv->n_bytes; + else + index_ = priv->n_chars * password_char_bytes; + } + else if (position == 0) + { + index_ = 0; + } + else + { + if (priv->password_char == 0) + index_ = offset_to_bytes (priv->text, position); + else + index_ = priv->position * password_char_bytes; + } + + pango_layout_get_cursor_pos (clutter_text_get_layout (self), index_, + &rect, NULL); + + if (x) + *x = CLUTTER_UNITS_FROM_PANGO_UNIT (rect.x); + + if (y) + *y = CLUTTER_UNITS_FROM_PANGO_UNIT (rect.y); + + if (line_height) + *line_height = CLUTTER_UNITS_FROM_PANGO_UNIT (rect.height); + + /* FIXME: should return false if coords were outside text */ + return TRUE; +} + +static inline void +clutter_text_ensure_cursor_position (ClutterText *self) +{ + ClutterTextPrivate *priv = self->priv; + ClutterUnit x, y, cursor_height; + + x = y = cursor_height = 0; + clutter_text_position_to_coords (self, priv->position, + &x, &y, + &cursor_height); + + priv->cursor_pos.x = CLUTTER_UNITS_TO_DEVICE (x); + priv->cursor_pos.y = CLUTTER_UNITS_TO_DEVICE (y); + priv->cursor_pos.width = priv->cursor_size; + priv->cursor_pos.height = CLUTTER_UNITS_TO_DEVICE (cursor_height) - 2; + + g_signal_emit (self, text_signals[CURSOR_EVENT], 0, &priv->cursor_pos); +} + +static gboolean +clutter_text_truncate_selection (ClutterText *self) +{ + ClutterTextPrivate *priv = self->priv; + gint start_index; + gint end_index; + + if (!priv->text) + return TRUE; + + start_index = offset_real (priv->text, priv->position); + end_index = offset_real (priv->text, priv->selection_bound); + + if (end_index == start_index) + return FALSE; + + if (end_index < start_index) + { + gint temp = start_index; + start_index = end_index; + end_index = temp; + } + + clutter_text_delete_text (self, start_index, end_index); + + priv->position = start_index; + priv->selection_bound = start_index; + + return TRUE; +} + +static void +clutter_text_set_property (GObject *gobject, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + ClutterText *self = CLUTTER_TEXT (gobject); + + switch (prop_id) + { + case PROP_TEXT: + clutter_text_set_text (self, g_value_get_string (value)); + break; + + case PROP_COLOR: + clutter_text_set_color (self, clutter_value_get_color (value)); + break; + + case PROP_FONT_NAME: + clutter_text_set_font_name (self, g_value_get_string (value)); + break; + + case PROP_USE_MARKUP: + clutter_text_set_use_markup (self, g_value_get_boolean (value)); + break; + + case PROP_ATTRIBUTES: + clutter_text_set_attributes (self, g_value_get_boxed (value)); + break; + + case PROP_ALIGNMENT: + clutter_text_set_alignment (self, g_value_get_enum (value)); + break; + + case PROP_LINE_WRAP: + clutter_text_set_line_wrap (self, g_value_get_boolean (value)); + break; + + case PROP_LINE_WRAP_MODE: + clutter_text_set_line_wrap_mode (self, g_value_get_enum (value)); + break; + + case PROP_JUSTIFY: + clutter_text_set_justify (self, g_value_get_boolean (value)); + break; + + case PROP_ELLIPSIZE: + clutter_text_set_ellipsize (self, g_value_get_enum (value)); + break; + + case PROP_POSITION: + clutter_text_set_cursor_position (self, g_value_get_int (value)); + break; + + case PROP_SELECTION_BOUND: + clutter_text_set_selection_bound (self, g_value_get_int (value)); + break; + + case PROP_CURSOR_VISIBLE: + clutter_text_set_cursor_visible (self, g_value_get_boolean (value)); + break; + + case PROP_CURSOR_COLOR: + clutter_text_set_cursor_color (self, g_value_get_boxed (value)); + break; + + case PROP_CURSOR_SIZE: + clutter_text_set_cursor_size (self, g_value_get_int (value)); + break; + + case PROP_EDITABLE: + clutter_text_set_editable (self, g_value_get_boolean (value)); + break; + + case PROP_ACTIVATABLE: + clutter_text_set_activatable (self, g_value_get_boolean (value)); + break; + + case PROP_SELECTABLE: + clutter_text_set_selectable (self, g_value_get_boolean (value)); + break; + + case PROP_PASSWORD_CHAR: + clutter_text_set_password_char (self, g_value_get_uint (value)); + break; + + case PROP_MAX_LENGTH: + clutter_text_set_max_length (self, g_value_get_int (value)); + break; + + case PROP_SINGLE_LINE_MODE: + clutter_text_set_single_line_mode (self, g_value_get_boolean (value)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + } +} + +static void +clutter_text_get_property (GObject *gobject, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + ClutterTextPrivate *priv = CLUTTER_TEXT (gobject)->priv; + + switch (prop_id) + { + case PROP_TEXT: + g_value_set_string (value, priv->text); + break; + + case PROP_FONT_NAME: + g_value_set_string (value, priv->font_name); + break; + + case PROP_COLOR: + clutter_value_set_color (value, &priv->text_color); + break; + + case PROP_CURSOR_VISIBLE: + g_value_set_boolean (value, priv->cursor_visible); + break; + + case PROP_CURSOR_COLOR: + clutter_value_set_color (value, &priv->cursor_color); + break; + + case PROP_CURSOR_COLOR_SET: + g_value_set_boolean (value, priv->cursor_color_set); + break; + + case PROP_CURSOR_SIZE: + g_value_set_int (value, priv->cursor_size); + break; + + case PROP_POSITION: + g_value_set_int (value, priv->position); + break; + + case PROP_SELECTION_BOUND: + g_value_set_int (value, priv->selection_bound); + break; + + case PROP_EDITABLE: + g_value_set_boolean (value, priv->editable); + break; + + case PROP_SELECTABLE: + g_value_set_boolean (value, priv->selectable); + break; + + case PROP_ACTIVATABLE: + g_value_set_boolean (value, priv->activatable); + break; + + case PROP_PASSWORD_CHAR: + g_value_set_uint (value, priv->password_char); + break; + + case PROP_MAX_LENGTH: + g_value_set_int (value, priv->max_length); + break; + + case PROP_SINGLE_LINE_MODE: + g_value_set_boolean (value, priv->single_line_mode); + break; + + case PROP_ELLIPSIZE: + g_value_set_enum (value, priv->ellipsize); + break; + + case PROP_LINE_WRAP: + g_value_set_boolean (value, priv->wrap); + break; + + case PROP_LINE_WRAP_MODE: + g_value_set_enum (value, priv->wrap_mode); + break; + + case PROP_ALIGNMENT: + g_value_set_enum (value, priv->alignment); + break; + + case PROP_JUSTIFY: + g_value_set_boolean (value, priv->justify); + break; + + case PROP_ATTRIBUTES: + g_value_set_boxed (value, priv->attrs); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + } +} + +static void +clutter_text_dispose (GObject *gobject) +{ + ClutterText *self = CLUTTER_TEXT (gobject); + ClutterTextPrivate *priv = self->priv; + + /* get rid of the entire cache */ + clutter_text_dirty_cache (self); + + if (priv->font_changed_id) + { + g_signal_handler_disconnect (clutter_get_default_backend (), + priv->font_changed_id); + priv->font_changed_id = 0; + } + + G_OBJECT_CLASS (clutter_text_parent_class)->dispose (gobject); +} + +static void +clutter_text_finalize (GObject *gobject) +{ + ClutterText *self = CLUTTER_TEXT (gobject); + ClutterTextPrivate *priv = self->priv; + + if (priv->font_desc) + pango_font_description_free (priv->font_desc); + + g_free (priv->text); + g_free (priv->font_name); + + G_OBJECT_CLASS (clutter_text_parent_class)->finalize (gobject); +} + +static void +cursor_paint (ClutterText *self) +{ + ClutterTextPrivate *priv = self->priv; + ClutterActor *actor = CLUTTER_ACTOR (self); + guint8 real_opacity; + + if (priv->editable && priv->cursor_visible) + { + if (priv->cursor_color_set) + { + real_opacity = clutter_actor_get_paint_opacity (actor) + * priv->cursor_color.alpha + / 255; + + cogl_set_source_color4ub (priv->cursor_color.red, + priv->cursor_color.green, + priv->cursor_color.blue, + real_opacity); + } + else + { + real_opacity = clutter_actor_get_paint_opacity (actor) + * priv->text_color.alpha + / 255; + + cogl_set_source_color4ub (priv->text_color.red, + priv->text_color.green, + priv->text_color.blue, + real_opacity); + } + + if (priv->position == 0) + priv->cursor_pos.x -= priv->cursor_size; + + if (priv->position == priv->selection_bound) + { + cogl_rectangle (priv->cursor_pos.x, + priv->cursor_pos.y, + priv->cursor_pos.x + priv->cursor_pos.width, + priv->cursor_pos.y + priv->cursor_pos.height); + } + else + { + PangoLayout *layout = clutter_text_get_layout (self); + const gchar *utf8 = priv->text; + gint lines; + gint start_index; + gint end_index; + gint line_no; + + if (priv->position == 0) + start_index = 0; + else + start_index = offset_to_bytes (utf8, priv->position); + + if (priv->selection_bound == 0) + end_index = 0; + else + end_index = offset_to_bytes (utf8, priv->selection_bound); + + if (start_index > end_index) + { + gint temp = start_index; + start_index = end_index; + end_index = temp; + } + + lines = pango_layout_get_line_count (layout); + + for (line_no = 0; line_no < lines; line_no++) + { + PangoLayoutLine *line; + gint n_ranges; + gint *ranges; + gint i; + gint index_; + gint maxindex; + ClutterUnit y, height; + + line = pango_layout_get_line_readonly (layout, line_no); + pango_layout_line_x_to_index (line, G_MAXINT, &maxindex, NULL); + if (maxindex < start_index) + continue; + + pango_layout_line_get_x_ranges (line, start_index, end_index, + &ranges, + &n_ranges); + pango_layout_line_x_to_index (line, 0, &index_, NULL); + + clutter_text_position_to_coords (self, + bytes_to_offset (utf8, index_), + NULL, &y, &height); + + for (i = 0; i < n_ranges; i++) + { + gint range_x; + gint range_width; + + range_x = ranges[i * 2] + / PANGO_SCALE; + range_width = (ranges[i * 2 + 1] - ranges[i * 2]) + / PANGO_SCALE; + + cogl_rectangle (range_x, + CLUTTER_UNITS_TO_DEVICE (y), + range_x + range_width, + CLUTTER_UNITS_TO_DEVICE (y) + + CLUTTER_UNITS_TO_DEVICE (height)); + } + + g_free (ranges); + } + } + } +} + +static gboolean +clutter_text_button_press (ClutterActor *actor, + ClutterButtonEvent *event) +{ + ClutterText *self = CLUTTER_TEXT (actor); + ClutterTextPrivate *priv = self->priv; + ClutterUnit x, y; + gint index_; + + x = CLUTTER_UNITS_FROM_INT (event->x); + y = CLUTTER_UNITS_FROM_INT (event->y); + + clutter_actor_transform_stage_point (actor, x, y, &x, &y); + + index_ = clutter_text_coords_to_position (self, + CLUTTER_UNITS_TO_INT (x), + CLUTTER_UNITS_TO_INT (y)); + + clutter_text_set_cursor_position (self, bytes_to_offset (priv->text, index_)); + clutter_text_set_selection_bound (self, bytes_to_offset (priv->text, index_)); + + /* grab the pointer */ + priv->in_select_drag = TRUE; + clutter_grab_pointer (actor); + + /* we'll steal keyfocus if we do not have it */ + clutter_actor_grab_key_focus (actor); + + return TRUE; +} + +static gboolean +clutter_text_motion (ClutterActor *actor, + ClutterMotionEvent *mev) +{ + ClutterText *ttext = CLUTTER_TEXT (actor); + ClutterTextPrivate *priv = ttext->priv; + ClutterUnit x, y; + gint index_; + const gchar *text; + + if (!priv->in_select_drag) + return FALSE; + + text = clutter_text_get_text (ttext); + + x = CLUTTER_UNITS_FROM_INT (mev->x); + y = CLUTTER_UNITS_FROM_INT (mev->y); + + clutter_actor_transform_stage_point (actor, x, y, &x, &y); + + index_ = clutter_text_coords_to_position (ttext, + CLUTTER_UNITS_TO_INT (x), + CLUTTER_UNITS_TO_INT (y)); + + if (priv->selectable) + clutter_text_set_cursor_position (ttext, bytes_to_offset (text, index_)); + else + { + clutter_text_set_cursor_position (ttext, bytes_to_offset (text, index_)); + clutter_text_set_selection_bound (ttext, bytes_to_offset (text, index_)); + } + + return TRUE; +} + +static gboolean +clutter_text_button_release (ClutterActor *actor, + ClutterButtonEvent *bev) +{ + ClutterText *ttext = CLUTTER_TEXT (actor); + ClutterTextPrivate *priv = ttext->priv; + + if (priv->in_select_drag) + { + clutter_ungrab_pointer (); + priv->in_select_drag = FALSE; + + return TRUE; + } + + return FALSE; +} + +static gboolean +clutter_text_key_press (ClutterActor *actor, + ClutterKeyEvent *event) +{ + ClutterText *self = CLUTTER_TEXT (actor); + ClutterTextPrivate *priv = self->priv; + ClutterBindingPool *pool; + gboolean res; + gint keyval; + + if (!priv->editable) + return FALSE; + + keyval = clutter_key_event_symbol (event); + + pool = clutter_binding_pool_find (G_OBJECT_TYPE_NAME (actor)); + g_assert (pool != NULL); + + /* we allow passing synthetic events that only contain + * the Unicode value and not the key symbol + */ + if (keyval == 0 && (event->flags & CLUTTER_EVENT_FLAG_SYNTHETIC)) + res = FALSE; + else + res = clutter_binding_pool_activate (pool, keyval, + event->modifier_state, + G_OBJECT (actor)); + + /* if the key binding has handled the event we bail out + * as fast as we can; otherwise, we try to insert the + * Unicode character inside the key event into the text + * actor + */ + if (res) + return TRUE; + else + { + gunichar key_unichar = clutter_key_event_unicode (event); + + /* return is reported as CR, but we want LF */ + if (key_unichar == '\r') + key_unichar = '\n'; + + if (key_unichar == '\n' || + (g_unichar_validate (key_unichar) && + !g_unichar_iscntrl (key_unichar))) + { + /* truncate the eventual selection so that the + * Unicode character can replace it + */ + clutter_text_truncate_selection (self); + clutter_text_insert_unichar (self, key_unichar); + + return TRUE; + } + } + + return FALSE; +} + +#define TEXT_PADDING 2 + +static void +clutter_text_paint (ClutterActor *self) +{ + ClutterText *text = CLUTTER_TEXT (self); + ClutterTextPrivate *priv = text->priv; + PangoLayout *layout; + ClutterActorBox alloc = { 0, }; + CoglColor color = { 0, }; + guint8 real_opacity; + gint text_x = priv->text_x; + gboolean clip_set = FALSE; + + if (G_UNLIKELY (priv->font_desc == NULL || priv->text == NULL)) + { + CLUTTER_NOTE (ACTOR, "desc: %p, text %p", + priv->font_desc ? priv->font_desc : 0x0, + priv->text ? priv->text : 0x0); + return; + } + + clutter_actor_get_allocation_box (self, &alloc); + layout = clutter_text_create_layout (text, alloc.x2 - alloc.x1); + + if (priv->editable && priv->cursor_visible) + clutter_text_ensure_cursor_position (text); + + if (priv->editable && priv->single_line_mode) + { + PangoRectangle logical_rect = { 0, }; + gint actor_width, text_width; + + pango_layout_get_extents (layout, NULL, &logical_rect); + + cogl_clip_set (0, 0, + CLUTTER_UNITS_TO_FIXED (alloc.x2 - alloc.x1), + CLUTTER_UNITS_TO_FIXED (alloc.y2 - alloc.y1)); + clip_set = TRUE; + + actor_width = (CLUTTER_UNITS_TO_DEVICE (alloc.x2 - alloc.x1)) + - 2 * TEXT_PADDING; + text_width = logical_rect.width / PANGO_SCALE; + + if (actor_width < text_width) + { + gint cursor_x = priv->cursor_pos.x; + + if (priv->position == -1) + { + text_x = actor_width - text_width; + priv->cursor_pos.x += text_x + TEXT_PADDING; + } + else if (priv->position == 0) + { + text_x = 0; + } + else + { + if (text_x <= 0) + { + gint diff = -1 * text_x; + + if (cursor_x < diff) + text_x += diff - cursor_x; + else if (cursor_x > (diff + actor_width)) + text_x -= cursor_x - (diff - actor_width); + } + } + } + else + { + text_x = 0; + priv->cursor_pos.x += text_x + TEXT_PADDING; + } + } + else + text_x = 0; + + cursor_paint (text); + + real_opacity = clutter_actor_get_paint_opacity (self) + * priv->text_color.alpha + / 255; + + CLUTTER_NOTE (PAINT, "painting text (text:`%s')", priv->text); + + cogl_color_set_from_4ub (&color, + priv->text_color.red, + priv->text_color.green, + priv->text_color.blue, + real_opacity); + cogl_pango_render_layout (layout, text_x, 0, &color, 0); + + if (clip_set) + cogl_clip_unset (); + + priv->text_x = text_x; +} + +static void +clutter_text_get_preferred_width (ClutterActor *self, + ClutterUnit for_height, + ClutterUnit *min_width_p, + ClutterUnit *natural_width_p) +{ + ClutterText *text = CLUTTER_TEXT (self); + ClutterTextPrivate *priv = text->priv; + PangoRectangle logical_rect = { 0, }; + PangoLayout *layout; + gint logical_width; + ClutterUnit layout_width; + + layout = clutter_text_create_layout (text, -1); + + pango_layout_get_extents (layout, NULL, &logical_rect); + + /* the X coordinate of the logical rectangle might be non-zero + * according to the Pango documentation; hence, we need to offset + * the width accordingly + */ + logical_width = logical_rect.x + logical_rect.width; + + layout_width = logical_width > 0 + ? CLUTTER_UNITS_FROM_PANGO_UNIT (logical_width) + : 1; + + if (min_width_p) + { + if (priv->wrap || priv->ellipsize) + *min_width_p = 1; + else + *min_width_p = layout_width; + } + + if (natural_width_p) + *natural_width_p = layout_width; +} + +static void +clutter_text_get_preferred_height (ClutterActor *self, + ClutterUnit for_width, + ClutterUnit *min_height_p, + ClutterUnit *natural_height_p) +{ + ClutterText *text = CLUTTER_TEXT (self); + + if (for_width == 0) + { + if (min_height_p) + *min_height_p = 0; + + if (natural_height_p) + *natural_height_p = 0; + } + else + { + PangoLayout *layout; + PangoRectangle logical_rect = { 0, }; + gint logical_height; + ClutterUnit layout_height; + + layout = clutter_text_create_layout (text, for_width); + + pango_layout_get_extents (layout, NULL, &logical_rect); + + /* the Y coordinate of the logical rectangle might be non-zero + * according to the Pango documentation; hence, we need to offset + * the height accordingly + */ + logical_height = logical_rect.y + logical_rect.height; + + layout_height = CLUTTER_UNITS_FROM_PANGO_UNIT (logical_height); + + if (min_height_p) + *min_height_p = layout_height; + + if (natural_height_p) + *natural_height_p = layout_height; + } +} + +static void +clutter_text_allocate (ClutterActor *self, + const ClutterActorBox *box, + gboolean origin_changed) +{ + ClutterText *text = CLUTTER_TEXT (self); + ClutterActorClass *parent_class; + + /* Ensure that there is a cached layout with the right width so + * that we don't need to create the text during the paint run + */ + clutter_text_create_layout (text, box->x2 - box->x1); + + parent_class = CLUTTER_ACTOR_CLASS (clutter_text_parent_class); + parent_class->allocate (self, box, origin_changed); +} + +static gboolean +clutter_text_real_move_left (ClutterText *self, + const gchar *action, + guint keyval, + ClutterModifierType modifiers) +{ + ClutterTextPrivate *priv = self->priv; + gint pos = priv->position; + gint len; + + len = priv->n_chars; + + if (pos != 0 && len !=0) + { + if (pos == -1) + clutter_text_set_cursor_position (self, len - 1); + else + clutter_text_set_cursor_position (self, pos - 1); + } + + if (!(priv->selectable && (modifiers & CLUTTER_SHIFT_MASK))) + clutter_text_clear_selection (self); + + return TRUE; +} + +static gboolean +clutter_text_real_move_right (ClutterText *self, + const gchar *action, + guint keyval, + ClutterModifierType modifiers) +{ + ClutterTextPrivate *priv = self->priv; + gint pos = priv->position; + gint len; + + len = priv->n_chars; + + if (pos != -1 && len !=0) + { + if (pos != len) + clutter_text_set_cursor_position (self, pos + 1); + } + + if (!(priv->selectable && (modifiers & CLUTTER_SHIFT_MASK))) + clutter_text_clear_selection (self); + + return TRUE; +} + +static gboolean +clutter_text_real_move_up (ClutterText *self, + const gchar *action, + guint keyval, + ClutterModifierType modifiers) +{ + ClutterTextPrivate *priv = self->priv; + PangoLayoutLine *layout_line; + PangoLayout *layout; + gint line_no; + gint index_, trailing; + gint x; + + layout = clutter_text_get_layout (self); + + if (priv->position == 0) + index_ = 0; + else + index_ = offset_to_bytes (priv->text, priv->position); + + pango_layout_index_to_line_x (layout, index_, + 0, + &line_no, &x); + + line_no -= 1; + if (line_no < 0) + return FALSE; + + if (priv->x_pos != -1) + x = priv->x_pos; + + layout_line = pango_layout_get_line_readonly (layout, line_no); + if (!layout_line) + return FALSE; + + pango_layout_line_x_to_index (layout_line, x, &index_, &trailing); + + { + gint pos = bytes_to_offset (priv->text, index_); + + clutter_text_set_cursor_position (self, pos + trailing); + } + + /* Store the target x position to avoid drifting left and right when + moving the cursor up and down */ + priv->x_pos = x; + + if (!(priv->selectable && (modifiers & CLUTTER_SHIFT_MASK))) + clutter_text_clear_selection (self); + + return TRUE; +} + +static gboolean +clutter_text_real_move_down (ClutterText *self, + const gchar *action, + guint keyval, + ClutterModifierType modifiers) +{ + ClutterTextPrivate *priv = self->priv; + PangoLayoutLine *layout_line; + PangoLayout *layout; + gint line_no; + gint index_, trailing; + gint x; + + layout = clutter_text_get_layout (self); + + if (priv->position == 0) + index_ = 0; + else + index_ = offset_to_bytes (priv->text, priv->position); + + pango_layout_index_to_line_x (layout, index_, + 0, + &line_no, &x); + + if (priv->x_pos != -1) + x = priv->x_pos; + + layout_line = pango_layout_get_line_readonly (layout, line_no + 1); + if (!layout_line) + return FALSE; + + pango_layout_line_x_to_index (layout_line, x, &index_, &trailing); + + { + gint pos = bytes_to_offset (priv->text, index_); + + clutter_text_set_cursor_position (self, pos + trailing); + } + + /* Store the target x position to avoid drifting left and right when + moving the cursor up and down */ + priv->x_pos = x; + + if (!(priv->selectable && (modifiers & CLUTTER_SHIFT_MASK))) + clutter_text_clear_selection (self); + + return TRUE; +} + +static gboolean +clutter_text_real_line_start (ClutterText *self, + const gchar *action, + guint keyval, + ClutterModifierType modifiers) +{ + ClutterTextPrivate *priv = self->priv; + PangoLayoutLine *layout_line; + PangoLayout *layout; + gint line_no; + gint index_; + gint position; + + layout = clutter_text_get_layout (self); + + if (priv->position == 0) + index_ = 0; + else + index_ = offset_to_bytes (priv->text, priv->position); + + pango_layout_index_to_line_x (layout, index_, + 0, + &line_no, NULL); + + layout_line = pango_layout_get_line_readonly (layout, line_no); + if (!layout_line) + return FALSE; + + pango_layout_line_x_to_index (layout_line, 0, &index_, NULL); + + position = bytes_to_offset (priv->text, index_); + clutter_text_set_cursor_position (self, position); + + if (!(priv->selectable && (modifiers & CLUTTER_SHIFT_MASK))) + clutter_text_clear_selection (self); + + return TRUE; +} + +static gboolean +clutter_text_real_line_end (ClutterText *self, + const gchar *action, + guint keyval, + ClutterModifierType modifiers) +{ + ClutterTextPrivate *priv = self->priv; + PangoLayoutLine *layout_line; + PangoLayout *layout; + gint line_no; + gint index_; + gint trailing; + gint position; + + layout = clutter_text_get_layout (self); + + if (priv->position == 0) + index_ = 0; + else + index_ = offset_to_bytes (priv->text, priv->position); + + pango_layout_index_to_line_x (layout, index_, + 0, + &line_no, NULL); + + layout_line = pango_layout_get_line_readonly (layout, line_no); + if (!layout_line) + return FALSE; + + pango_layout_line_x_to_index (layout_line, G_MAXINT, &index_, &trailing); + index_ += trailing; + + position = bytes_to_offset (priv->text, index_); + + clutter_text_set_cursor_position (self, position); + + if (!(priv->selectable && (modifiers & CLUTTER_SHIFT_MASK))) + clutter_text_clear_selection (self); + + return TRUE; +} + +static gboolean +clutter_text_real_select_all (ClutterText *self, + const gchar *action, + guint keyval, + ClutterModifierType modifiers) +{ + clutter_text_set_cursor_position (self, 0); + clutter_text_set_selection_bound (self, self->priv->n_chars); + + return TRUE; +} + +static gboolean +clutter_text_real_del_next (ClutterText *self, + const gchar *action, + guint keyval, + ClutterModifierType modifiers) +{ + ClutterTextPrivate *priv = self->priv; + gint pos; + gint len; + + if (clutter_text_truncate_selection (self)) + return TRUE; + + pos = priv->position; + len = priv->n_chars; + + if (len && pos != -1 && pos < len) + clutter_text_delete_text (self, pos, pos + 1); + + return TRUE; +} + +static gboolean +clutter_text_real_del_prev (ClutterText *self, + const gchar *action, + guint keyval, + ClutterModifierType modifiers) +{ + ClutterTextPrivate *priv = self->priv; + gint pos; + gint len; + + if (clutter_text_truncate_selection (self)) + return TRUE; + + pos = priv->position; + len = priv->n_chars; + + if (pos != 0 && len != 0) + { + if (pos == -1) + { + clutter_text_set_cursor_position (self, len - 1); + clutter_text_set_selection_bound (self, len - 1); + + clutter_text_delete_text (self, len - 1, len); + } + else + { + clutter_text_set_cursor_position (self, pos - 1); + clutter_text_set_selection_bound (self, pos - 1); + + clutter_text_delete_text (self, pos - 1, pos); + } + } + + return TRUE; +} + +static gboolean +clutter_text_real_activate (ClutterText *self, + const gchar *action, + guint keyval, + ClutterModifierType modifiers) +{ + return clutter_text_activate (self); +} + +static inline void +clutter_text_add_move_binding (ClutterBindingPool *pool, + const gchar *action, + guint key_val, + GCallback callback) +{ + clutter_binding_pool_install_action (pool, action, + key_val, 0, + callback, + NULL, NULL); + clutter_binding_pool_install_action (pool, action, + key_val, CLUTTER_SHIFT_MASK, + callback, + NULL, NULL); +} + +static void +clutter_text_class_init (ClutterTextClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); + ClutterBindingPool *binding_pool; + GParamSpec *pspec; + + g_type_class_add_private (klass, sizeof (ClutterTextPrivate)); + + gobject_class->set_property = clutter_text_set_property; + gobject_class->get_property = clutter_text_get_property; + gobject_class->dispose = clutter_text_dispose; + gobject_class->finalize = clutter_text_finalize; + + actor_class->paint = clutter_text_paint; + actor_class->get_preferred_width = clutter_text_get_preferred_width; + actor_class->get_preferred_height = clutter_text_get_preferred_height; + actor_class->allocate = clutter_text_allocate; + actor_class->key_press_event = clutter_text_key_press; + actor_class->button_press_event = clutter_text_button_press; + actor_class->button_release_event = clutter_text_button_release; + actor_class->motion_event = clutter_text_motion; + + /** + * ClutterText:font-name: + * + * The font to be used by the #ClutterText, as a string + * that can be parsed by pango_font_description_from_string(). + * + * Since: 1.0 + */ + pspec = g_param_spec_string ("font-name", + "Font Name", + "The font to be used by the text", + NULL, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_FONT_NAME, pspec); + + /** + * ClutterText:text: + * + * The text to render inside the actor. + * + * Since: 1.0 + */ + pspec = g_param_spec_string ("text", + "Text", + "The text to render", + "", + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_TEXT, pspec); + + /** + * ClutterText:color: + * + * The color used to render the text. + * + * Since: 1.0 + */ + pspec = clutter_param_spec_color ("color", + "Font Color", + "Color of the font used by the text", + &default_text_color, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_COLOR, pspec); + + /** + * ClutterText:editable: + * + * Whether key events delivered to the actor causes editing. + * + * Since: 1.0 + */ + pspec = g_param_spec_boolean ("editable", + "Editable", + "Whether the text is editable", + TRUE, + G_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_EDITABLE, pspec); + + /** + * ClutterText:selectable: + * + * Whether it is possible to select text, either using the pointer + * or the keyboard. + * + * Since: 1.0 + */ + pspec = g_param_spec_boolean ("selectable", + "Selectable", + "Whether the text is selectable", + TRUE, + G_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_SELECTABLE, pspec); + + /** + * ClutterText:activatable: + * + * Toggles whether return invokes the activate signal or not. + * + * Since: 1.0 + */ + pspec = g_param_spec_boolean ("activatable", + "Activatable", + "Whether pressing return causes the " + "activate signal to be emitted", + TRUE, + G_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_ACTIVATABLE, pspec); + + /** + * ClutterText:cursor-visible: + * + * Whether the input cursor is visible or not, it will only be visible + * if both #ClutterText:cursor-visible and #ClutterText:editable are + * set to %TRUE. + * + * Since: 1.0 + */ + pspec = g_param_spec_boolean ("cursor-visible", + "Cursor Visible", + "Whether the input cursor is visible", + TRUE, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_CURSOR_VISIBLE, pspec); + + /** + * ClutterText:cursor-color: + * + * The color of the cursor. + * + * Since: 1.0 + */ + pspec = clutter_param_spec_color ("cursor-color", + "Cursor Color", + "Cursor Color", + &default_cursor_color, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_CURSOR_COLOR, pspec); + + /** + * ClutterText:cursor-color-set: + * + * Will be set to %TRUE if #ClutterText:cursor-color has been set. + * + * Since: 1.0 + */ + pspec = g_param_spec_boolean ("cursor-color-set", + "Cursor Color Set", + "Whether the cursor color has been set", + FALSE, + CLUTTER_PARAM_READABLE); + g_object_class_install_property (gobject_class, PROP_CURSOR_COLOR_SET, pspec); + + /** + * ClutterText:cursor-size: + * + * The size of the cursor, in pixels. If set to -1 the size used will + * be the default cursor size of 2 pixels. + * + * Since: 1.0 + */ + pspec = g_param_spec_int ("cursor-size", + "Cursor Size", + "The width of the cursor, in pixels", + -1, G_MAXINT, DEFAULT_CURSOR_SIZE, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_CURSOR_SIZE, pspec); + + /** + * ClutterText:position: + * + * The current input cursor position. -1 is taken to be the end of the text + * + * Since: 1.0 + */ + pspec = g_param_spec_int ("position", + "Position", + "The cursor position", + -1, G_MAXINT, + -1, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_POSITION, pspec); + + /** + * ClutterText:selection-bound: + * + * The current input cursor position. -1 is taken to be the end of the text + * + * Since: 1.0 + */ + pspec = g_param_spec_int ("selection-bound", + "Selection-bound", + "The cursor position of the other end " + "of the selection", + -1, G_MAXINT, + -1, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_SELECTION_BOUND, pspec); + + /** + * ClutterText:attributes: + * + * A list of #PangoStyleAttributes to be applied to the + * contents of the #ClutterText actor. + * + * Since: 1.0 + */ + pspec = g_param_spec_boxed ("attributes", + "Attributes", + "A list of style attributes to apply to " + "the contents of the actor", + PANGO_TYPE_ATTR_LIST, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_ATTRIBUTES, pspec); + + /** + * ClutterText:use-markup: + * + * Whether the text includes Pango markup. See pango_layout_set_markup() + * in the Pango documentation. + * + * Since: 1.0 + */ + pspec = g_param_spec_boolean ("use-markup", + "Use markup", + "Whether or not the text " + "includes Pango markup", + FALSE, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_USE_MARKUP, pspec); + + /** + * ClutterText:line-wrap: + * + * Whether to wrap the lines of #ClutterText:text if the contents + * exceed the available allocation. The wrapping strategy is + * controlled by the #ClutterText:line-wrap-mode property. + * + * Since: 1.0 + */ + pspec = g_param_spec_boolean ("line-wrap", + "Line wrap", + "If set, wrap the lines if the text " + "becomes too wide", + FALSE, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_LINE_WRAP, pspec); + + /** + * ClutterText:line-wrap-mode: + * + * If #ClutterText:line-wrap is set to %TRUE, this property will + * control how the text is wrapped. + * + * Since: 1.0 + */ + pspec = g_param_spec_enum ("line-wrap-mode", + "Line wrap mode", + "Control how line-wrapping is done", + PANGO_TYPE_WRAP_MODE, + PANGO_WRAP_WORD, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_LINE_WRAP_MODE, pspec); + + /** + * ClutterText:ellipsize: + * + * The preferred place to ellipsize the contents of the #ClutterText actor + * + * Since: 1.0 + */ + pspec = g_param_spec_enum ("ellipsize", + "Ellipsize", + "The preferred place to ellipsize the string", + PANGO_TYPE_ELLIPSIZE_MODE, + PANGO_ELLIPSIZE_NONE, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_ELLIPSIZE, pspec); + + /** + * ClutterText:alignment: + * + * The preferred alignment for the text. This property controls + * the alignment of multi-line paragraphs. + * + * Since: 1.0 + */ + pspec = g_param_spec_enum ("alignment", + "Alignment", + "The preferred alignment for the string, " + "for multi-line text", + PANGO_TYPE_ALIGNMENT, + PANGO_ALIGN_LEFT, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_ALIGNMENT, pspec); + + /** + * ClutterText:justify: + * + * Whether the contents of the #ClutterText should be justified + * on both margins. + * + * Since: 1.0 + */ + pspec = g_param_spec_boolean ("justify", + "Justify", + "Whether the text should be justified", + FALSE, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_JUSTIFY, pspec); + + /** + * ClutterText:password-char: + * + * If non-zero, the character that should be used in place of + * the actual text in a password text actor. + * + * Since: 1.0 + */ + pspec = g_param_spec_unichar ("password-char", + "Password Character", + "If non-zero, use this character to " + "display the actor's contents", + 0, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_PASSWORD_CHAR, pspec); + + /** + * ClutterText:max-length: + * + * The maximum length of the contents of the #ClutterText actor. + * + * Since: 1.0 + */ + pspec = g_param_spec_int ("max-length", + "Max Length", + "Maximum length of the text inside the actor", + -1, G_MAXINT, 0, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_MAX_LENGTH, pspec); + + /** + * ClutterText:single-line-mode: + * + * Whether the #ClutterText actor should be in single line mode + * or not. A single line #ClutterText actor will only contain a + * single line of text, scrolling it in case its length is bigger + * than the allocated size. + * + * Setting this property will also set the #ClutterText:activatable + * property as a side-effect. + * + * Since: 1.0 + */ + pspec = g_param_spec_boolean ("single-line-mode", + "Single Line Mode", + "Whether the text should be a single line", + FALSE, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_SINGLE_LINE_MODE, pspec); + + /** + * ClutterText::text-changed: + * @self: the #ClutterText that emitted the signal + * + * The ::text-changed signal is emitted after @actor's text changes + * + * Since: 1.0 + */ + text_signals[TEXT_CHANGED] = + g_signal_new ("text-changed", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ClutterTextClass, text_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + /** + * ClutterText::cursor-event: + * @self: the #ClutterText that emitted the signal + * @geometry: the coordinates of the cursor + * + * The ::cursor-event signal is emitted whenever the cursor position + * changes inside a #ClutterText actor. Inside @geometry it is stored + * the current position and size of the cursor, relative to the actor + * itself. + * + * Since: 1.0 + */ + text_signals[CURSOR_EVENT] = + g_signal_new ("cursor-event", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ClutterTextClass, cursor_event), + NULL, NULL, + g_cclosure_marshal_VOID__BOXED, + G_TYPE_NONE, 1, + CLUTTER_TYPE_GEOMETRY | G_SIGNAL_TYPE_STATIC_SCOPE); + + /** + * ClutterText::activate + * @self: the #ClutterText that emitted the signal + * + * The ::activate signal is emitted each time the actor is 'activated' + * by the user, normally by pressing the 'Enter' key. The signal is + * emitted only if #ClutterText:activatable is set to %TRUE. + * + * Since: 1.0 + */ + text_signals[ACTIVATE] = + g_signal_new ("activate", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ClutterTextClass, activate), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + binding_pool = clutter_binding_pool_get_for_class (klass); + + clutter_text_add_move_binding (binding_pool, "move-left", + CLUTTER_Left, + G_CALLBACK (clutter_text_real_move_left)); + clutter_text_add_move_binding (binding_pool, "move-left", + CLUTTER_KP_Left, + G_CALLBACK (clutter_text_real_move_left)); + clutter_text_add_move_binding (binding_pool, "move-right", + CLUTTER_Right, + G_CALLBACK (clutter_text_real_move_right)); + clutter_text_add_move_binding (binding_pool, "move-right", + CLUTTER_KP_Right, + G_CALLBACK (clutter_text_real_move_right)); + clutter_text_add_move_binding (binding_pool, "move-up", + CLUTTER_Up, + G_CALLBACK (clutter_text_real_move_up)); + clutter_text_add_move_binding (binding_pool, "move-up", + CLUTTER_KP_Up, + G_CALLBACK (clutter_text_real_move_up)); + clutter_text_add_move_binding (binding_pool, "move-down", + CLUTTER_Down, + G_CALLBACK (clutter_text_real_move_down)); + clutter_text_add_move_binding (binding_pool, "move-down", + CLUTTER_KP_Down, + G_CALLBACK (clutter_text_real_move_down)); + + clutter_text_add_move_binding (binding_pool, "line-start", + CLUTTER_Home, + G_CALLBACK (clutter_text_real_line_start)); + clutter_text_add_move_binding (binding_pool, "line-start", + CLUTTER_KP_Home, + G_CALLBACK (clutter_text_real_line_start)); + clutter_text_add_move_binding (binding_pool, "line-start", + CLUTTER_Begin, + G_CALLBACK (clutter_text_real_line_start)); + clutter_text_add_move_binding (binding_pool, "line-end", + CLUTTER_End, + G_CALLBACK (clutter_text_real_line_end)); + clutter_text_add_move_binding (binding_pool, "line-end", + CLUTTER_KP_End, + G_CALLBACK (clutter_text_real_line_end)); + + clutter_binding_pool_install_action (binding_pool, "select-all", + CLUTTER_a, CLUTTER_CONTROL_MASK, + G_CALLBACK (clutter_text_real_select_all), + NULL, NULL); + + clutter_binding_pool_install_action (binding_pool, "delete-next", + CLUTTER_Delete, 0, + G_CALLBACK (clutter_text_real_del_next), + NULL, NULL); + clutter_binding_pool_install_action (binding_pool, "delete-next", + CLUTTER_KP_Delete, 0, + G_CALLBACK (clutter_text_real_del_next), + NULL, NULL); + clutter_binding_pool_install_action (binding_pool, "delete-prev", + CLUTTER_BackSpace, 0, + G_CALLBACK (clutter_text_real_del_prev), + NULL, NULL); + + clutter_binding_pool_install_action (binding_pool, "activate", + CLUTTER_Return, 0, + G_CALLBACK (clutter_text_real_activate), + NULL, NULL); + clutter_binding_pool_install_action (binding_pool, "activate", + CLUTTER_KP_Enter, 0, + G_CALLBACK (clutter_text_real_activate), + NULL, NULL); + clutter_binding_pool_install_action (binding_pool, "activate", + CLUTTER_ISO_Enter, 0, + G_CALLBACK (clutter_text_real_activate), + NULL, NULL); +} + +static void +clutter_text_init (ClutterText *self) +{ + ClutterTextPrivate *priv; + const gchar *font_name; + int i; + + self->priv = priv = CLUTTER_TEXT_GET_PRIVATE (self); + + priv->alignment = PANGO_ALIGN_LEFT; + priv->wrap = FALSE; + priv->wrap_mode = PANGO_WRAP_WORD; + priv->ellipsize = PANGO_ELLIPSIZE_NONE; + priv->use_underline = FALSE; + priv->use_markup = FALSE; + priv->justify = FALSE; + + for (i = 0; i < N_CACHED_LAYOUTS; i++) + priv->cached_layouts[i].layout = NULL; + + /* default to "" so that clutter_text_get_text() will + * return a valid string and we can safely call strlen() + * or strcmp() on it + */ + priv->text = g_strdup (""); + + priv->text_color = default_text_color; + priv->cursor_color = default_cursor_color; + + /* get the default font name from the context */ + font_name = clutter_backend_get_font_name (clutter_get_default_backend ()); + priv->font_name = g_strdup (font_name); + priv->font_desc = pango_font_description_from_string (font_name); + + priv->position = -1; + priv->selection_bound = -1; + + priv->x_pos = -1; + priv->cursor_visible = TRUE; + priv->editable = FALSE; + priv->selectable = TRUE; + + priv->cursor_color_set = FALSE; + + priv->password_char = 0; + + priv->max_length = 0; + + priv->cursor_size = DEFAULT_CURSOR_SIZE; + + priv->font_changed_id + = g_signal_connect_swapped (clutter_get_default_backend (), + "font-changed", + G_CALLBACK (clutter_text_font_changed_cb), + self); +} + +/** + * clutter_text_new: + * + * Creates a new #ClutterText actor. This actor can be used to + * display and edit text. + * + * Return value: the newly created #ClutterText actor + * + * Since: 1.0 + */ +ClutterActor * +clutter_text_new (void) +{ + return g_object_new (CLUTTER_TYPE_TEXT, NULL); +} + +/** + * clutter_text_new_full: + * @font_name: a string with a font description + * @text: the contents of the actor + * @color: the color to be used to render @text + * + * Creates a new #ClutterText actor, using @font_name as the font + * description; @text will be used to set the contents of the actor; + * and @color will be used as the color to render @text. + * + * This function is equivalent to calling clutter_text_new(), + * clutter_text_set_font_name(), clutter_text_set_text() and + * clutter_text_set_color(). + * + * Return value: the newly created #ClutterText actor + * + * Since: 1.0 + */ +ClutterActor * +clutter_text_new_full (const gchar *font_name, + const gchar *text, + const ClutterColor *color) +{ + return g_object_new (CLUTTER_TYPE_TEXT, + "font-name", font_name, + "text", text, + "color", color, + NULL); +} + +/** + * clutter_text_new_with_text: + * @font_name: a string with a font description + * @text: the contents of the actor + * + * Creates a new #ClutterText actor, using @font_name as the font + * description; @text will be used to set the contents of the actor. + * + * This function is equivalent to calling clutter_text_new(), + * clutter_text_set_font_name(), and clutter_text_set_text(). + * + * Return value: the newly created #ClutterText actor + * + * Since: 1.0 + */ +ClutterActor * +clutter_text_new_with_text (const gchar *font_name, + const gchar *text) +{ + return g_object_new (CLUTTER_TYPE_TEXT, + "font-name", font_name, + "text", text, + NULL); +} + +/** + * clutter_text_set_editable: + * @self: a #ClutterText + * @editable: whether the #ClutterText should be editable + * + * Sets whether the #ClutterText actor should be editable. + * + * An editable #ClutterText with key focus set using + * clutter_actor_grab_key_focus() or clutter_stage_take_key_focus() + * will receive key events and will update its contents accordingly. + * + * Since: 1.0 + */ +void +clutter_text_set_editable (ClutterText *self, + gboolean editable) +{ + ClutterTextPrivate *priv; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + + priv = self->priv; + + if (priv->editable != editable) + { + priv->editable = editable; + + if (CLUTTER_ACTOR_IS_VISIBLE (self)) + clutter_actor_queue_redraw (CLUTTER_ACTOR (self)); + + g_object_notify (G_OBJECT (self), "editable"); + } +} + +/** + * clutter_text_get_editable: + * @self: a #ClutterText + * + * Retrieves whether a #ClutterText is editable or not. + * + * Return value: %TRUE if the actor is editable + * + * Since: 1.0 + */ +gboolean +clutter_text_get_editable (ClutterText *self) +{ + g_return_val_if_fail (CLUTTER_IS_TEXT (self), FALSE); + + return self->priv->editable; +} + +/** + * clutter_text_set_selectable: + * @self: a #ClutterText + * @selectable: whether the #ClutterText actor should be selectable + * + * Sets whether a #ClutterText actor should be selectable. + * + * A selectable #ClutterText will allow selecting its contents using + * the pointer or the keyboard. + * + * Since: 1.0 + */ +void +clutter_text_set_selectable (ClutterText *self, + gboolean selectable) +{ + ClutterTextPrivate *priv; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + + priv = self->priv; + + if (priv->selectable != selectable) + { + priv->selectable = selectable; + + if (CLUTTER_ACTOR_IS_VISIBLE (self)) + clutter_actor_queue_redraw (CLUTTER_ACTOR (self)); + + g_object_notify (G_OBJECT (self), "selectable"); + } +} + +/** + * clutter_text_get_selectable: + * @self: a #ClutterText + * + * Retrieves whether a #ClutterText is selectable or not. + * + * Return value: %TRUE if the actor is selectable + * + * Since: 1.0 + */ +gboolean +clutter_text_get_selectable (ClutterText *self) +{ + g_return_val_if_fail (CLUTTER_IS_TEXT (self), TRUE); + + return self->priv->selectable; +} + +/** + * clutter_text_set_activatable: + * @self: a #ClutterText + * @activatable: whether the #ClutterText actor should be activatable + * + * Sets whether a #ClutterText actor should be activatable. + * + * An activatable #ClutterText actor will emit the #ClutterText::activate + * signal whenever the 'Enter' (or 'Return') key is pressed; if it is not + * activatable, a new line will be appended to the current content. + * + * An activatable #ClutterText must also be set as editable using + * clutter_text_set_editable(). + * + * Since: 1.0 + */ +void +clutter_text_set_activatable (ClutterText *self, + gboolean activatable) +{ + ClutterTextPrivate *priv; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + + priv = self->priv; + + if (priv->activatable != activatable) + { + priv->activatable = activatable; + + if (CLUTTER_ACTOR_IS_VISIBLE (self)) + clutter_actor_queue_redraw (CLUTTER_ACTOR (self)); + + g_object_notify (G_OBJECT (self), "activatable"); + } +} + +/** + * clutter_text_get_activatable: + * @self: a #ClutterText + * + * Retrieves whether a #ClutterText is activatable or not. + * + * Return value: %TRUE if the actor is activatable + * + * Since: 1.0 + */ +gboolean +clutter_text_get_activatable (ClutterText *self) +{ + g_return_val_if_fail (CLUTTER_IS_TEXT (self), TRUE); + + return self->priv->activatable; +} + +/** + * clutter_text_activate: + * @self: a #ClutterText + * + * Emits the #ClutterText::activate signal, if @self has been set + * as activatable using clutter_text_set_activatable(). + * + * This function can be used to emit the ::activate signal inside + * a #ClutterActor::captured-event or #ClutterActor::key-press-event + * signal handlers before the default signal handler for the + * #ClutterText is invoked. + * + * Return value: %TRUE if the ::activate signal has been emitted, + * and %FALSE otherwise + * + * Since: 1.0 + */ +gboolean +clutter_text_activate (ClutterText *self) +{ + ClutterTextPrivate *priv; + + g_return_val_if_fail (CLUTTER_IS_TEXT (self), FALSE); + + priv = self->priv; + + if (priv->activatable) + { + g_signal_emit (self, text_signals[ACTIVATE], 0); + return TRUE; + } + + return FALSE; +} + +/** + * clutter_text_set_cursor_visible: + * @self: a #ClutterText + * @cursor_visible: whether the cursor should be visible + * + * Sets whether the cursor of a #ClutterText actor should be + * visible or not. + * + * The color of the cursor will be the same as the text color + * unless clutter_text_set_cursor_color() has been called. + * + * The size of the cursor can be set using clutter_text_set_cursor_size(). + * + * The position of the cursor can be changed programmatically using + * clutter_text_set_cursor_position(). + * + * Since: 1.0 + */ +void +clutter_text_set_cursor_visible (ClutterText *self, + gboolean cursor_visible) +{ + ClutterTextPrivate *priv; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + + priv = self->priv; + + if (priv->cursor_visible != cursor_visible) + { + priv->cursor_visible = cursor_visible; + + if (CLUTTER_ACTOR_IS_VISIBLE (self)) + clutter_actor_queue_redraw (CLUTTER_ACTOR (self)); + + g_object_notify (G_OBJECT (self), "cursor-visible"); + } +} + +/** + * clutter_text_get_cursor_visible: + * @self: a #ClutterText + * + * Retrieves whether the cursor of a #ClutterText actor is visible. + * + * Return value: %TRUE if the cursor is visible + * + * Since: 1.0 + */ +gboolean +clutter_text_get_cursor_visible (ClutterText *self) +{ + g_return_val_if_fail (CLUTTER_IS_TEXT (self), TRUE); + + return self->priv->cursor_visible; +} + +/** + * clutter_text_set_cursor_color: + * @self: a #ClutterText + * @color: the color of the cursor, or %NULL to unset it + * + * Sets the color of the cursor of a #ClutterText actor. + * + * If @color is %NULL, the cursor color will be the same as the + * text color. + * + * Since: 1.0 + */ +void +clutter_text_set_cursor_color (ClutterText *self, + const ClutterColor *color) +{ + ClutterTextPrivate *priv; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + + priv = self->priv; + + if (color) + { + priv->cursor_color = *color; + priv->cursor_color_set = TRUE; + } + else + priv->cursor_color_set = FALSE; + + if (CLUTTER_ACTOR_IS_VISIBLE (self)) + clutter_actor_queue_redraw (CLUTTER_ACTOR (self)); + + g_object_notify (G_OBJECT (self), "cursor-color"); + g_object_notify (G_OBJECT (self), "cursor-color-set"); +} + +/** + * clutter_text_get_cursor_color: + * @self: a #ClutterText + * @color: return location for a #ClutterColor + * + * Retrieves the color of the cursor of a #ClutterText actor. + * + * Since: 1.0 + */ +void +clutter_text_get_cursor_color (ClutterText *self, + ClutterColor *color) +{ + ClutterTextPrivate *priv; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + g_return_if_fail (color != NULL); + + priv = self->priv; + + *color = priv->cursor_color; +} + +/** + * clutter_text_set_selection: + * @self: a #ClutterText + * @start_pos: start of the selection, in characters + * @end_pos: end of the selection, in characters + * + * Selects the region of text between @start_pos and @end_pos. + * + * This function changes the position of the cursor to match + * @start_pos and the selection bound to match @end_pos. + * + * Since: 1.0 + */ +void +clutter_text_set_selection (ClutterText *self, + gssize start_pos, + gssize end_pos) +{ + ClutterTextPrivate *priv; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + + priv = self->priv; + + if (end_pos < 0) + end_pos = priv->n_chars; + + start_pos = MIN (priv->n_chars, start_pos); + end_pos = MIN (priv->n_chars, end_pos); + + g_object_freeze_notify (G_OBJECT (self)); + + clutter_text_set_cursor_position (self, start_pos); + clutter_text_set_selection_bound (self, end_pos); + + g_object_thaw_notify (G_OBJECT (self)); +} + +/** + * clutter_text_get_selection: + * @self: a #ClutterText + * + * Retrieves the currently selected text. + * + * Return value: a newly allocated string containing the currently + * selected text, or %NULL. Use g_free() to free the returned + * string. + * + * Since: 1.0 + */ +gchar * +clutter_text_get_selection (ClutterText *self) +{ + ClutterTextPrivate *priv; + gchar *str; + gint len; + gint start_index, end_index; + gint start_offset, end_offset; + + g_return_val_if_fail (CLUTTER_IS_TEXT (self), NULL); + + priv = self->priv; + + start_index = priv->position; + end_index = priv->selection_bound; + + if (end_index == start_index) + return g_strdup (""); + + if (end_index < start_index) + { + gint temp = start_index; + start_index = end_index; + end_index = temp; + } + + start_offset = offset_to_bytes (priv->text, start_index); + end_offset = offset_to_bytes (priv->text, end_index); + len = end_offset - start_offset; + + str = g_malloc (len + 1); + g_utf8_strncpy (str, priv->text + start_offset, end_index - start_index); + + return str; +} + +/** + * clutter_text_set_selection_bound: + * @self: a #ClutterText + * @selection_bound: the position of the end of the selection, in characters + * + * Sets the other end of the selection, starting from the current + * cursor position. + * + * If @selection_bound is -1, the selection unset. + * + * Since: 1.0 + */ +void +clutter_text_set_selection_bound (ClutterText *self, + gint selection_bound) +{ + ClutterTextPrivate *priv; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + + priv = self->priv; + + if (priv->selection_bound != selection_bound) + { + priv->selection_bound = selection_bound; + + if (CLUTTER_ACTOR_IS_VISIBLE (self)) + clutter_actor_queue_redraw (CLUTTER_ACTOR (self)); + + g_object_notify (G_OBJECT (self), "selection-bound"); + } +} + +/** + * clutter_text_get_selection_bound: + * @self: a #ClutterText + * + * Retrieves the other end of the selection of a #ClutterText actor, + * in characters from the current cursor position. + * + * Return value: the position of the other end of the selection + * + * Since: 1.0 + */ +gint +clutter_text_get_selection_bound (ClutterText *self) +{ + g_return_val_if_fail (CLUTTER_IS_TEXT (self), -1); + + return self->priv->selection_bound; +} + +/** + * clutter_text_get_font_name: + * @self: a #ClutterText + * + * Retrieves the font name as set by clutter_text_set_font_name(). + * + * Return value: a string containing the font name. The returned + * string is owned by the #ClutterText actor and should not be + * modified or freed + * + * Since: 1.0 + */ +G_CONST_RETURN gchar * +clutter_text_get_font_name (ClutterText *text) +{ + g_return_val_if_fail (CLUTTER_IS_TEXT (text), NULL); + + return text->priv->font_name; +} + +/** + * clutter_text_set_font_name: + * @self: a #ClutterText + * @font_name: a font name, or %NULL to set the default font name + * + * Sets the font used by a #ClutterText. 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, + * like: + * + * |[ + * clutter_text_set_font_name (text, "Sans 10pt"); + * clutter_text_set_font_name (text, "Serif 16px"); + * clutter_text_set_font_name (text, "Helvetica 10"); + * ]| + * + * Since: 1.0 + */ +void +clutter_text_set_font_name (ClutterText *self, + const gchar *font_name) +{ + ClutterTextPrivate *priv; + PangoFontDescription *desc; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + + /* get the default font name from the backend */ + if (!font_name || font_name[0] == '\0') + font_name = clutter_backend_get_font_name (clutter_get_default_backend ()); + + priv = self->priv; + + if (priv->font_name && strcmp (priv->font_name, font_name) == 0) + return; + + desc = pango_font_description_from_string (font_name); + if (!desc) + { + g_warning ("Attempting to create a PangoFontDescription for " + "font name `%s', but failed.", + font_name); + return; + } + + g_free (priv->font_name); + priv->font_name = g_strdup (font_name); + + if (priv->font_desc) + pango_font_description_free (priv->font_desc); + + priv->font_desc = desc; + + clutter_text_dirty_cache (self); + + if (priv->text && priv->text[0] != '\0') + clutter_actor_queue_relayout (CLUTTER_ACTOR (self)); + + g_object_notify (G_OBJECT (self), "font-name"); +} + +/** + * clutter_text_get_text: + * @self: a #ClutterText + * + * Retrieves a pointer to the current contents of a #ClutterText + * actor. + * + * If you need a copy of the contents for manipulating, either + * use g_strdup() on the returned string, or use: + * + * |[ + * copy = clutter_text_get_chars (text, 0, -1); + * ]| + * + * Which will return a newly allocated string. + * + * Return value: the contents of the actor. The returned string + * is owned by the #ClutterText actor and should never be + * modified or freed + * + * Since: 1.0 + */ +G_CONST_RETURN gchar * +clutter_text_get_text (ClutterText *self) +{ + g_return_val_if_fail (CLUTTER_IS_TEXT (self), NULL); + + return self->priv->text; +} + +/** + * clutter_text_set_text: + * @self: a #ClutterText + * @text: the text to set + * + * Sets the contents of a #ClutterText actor. The @text string + * must not be %NULL; to unset the current contents of the + * #ClutterText actor simply pass "" (an empty string). + * + * Since: 1.0 + */ +void +clutter_text_set_text (ClutterText *self, + const gchar *text) +{ + ClutterTextPrivate *priv; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + g_return_if_fail (text != NULL); + + priv = self->priv; + + if (priv->max_length > 0) + { + gint len = g_utf8_strlen (text, -1); + + if (len < priv->max_length) + { + g_free (priv->text); + + priv->text = g_strdup (text); + priv->n_bytes = strlen (text); + priv->n_chars = len; + } + else + { + gchar *n = g_malloc0 (priv->max_length + 1); + + g_free (priv->text); + + g_utf8_strncpy (n, text, priv->max_length); + + priv->text = n; + priv->n_bytes = strlen (n); + priv->n_chars = priv->max_length; + } + } + else + { + g_free (priv->text); + + priv->text = g_strdup (text); + priv->n_bytes = strlen (text); + priv->n_chars = g_utf8_strlen (text, -1); + } + + clutter_text_dirty_cache (self); + + clutter_actor_queue_relayout (CLUTTER_ACTOR (self)); + + g_signal_emit (self, text_signals[TEXT_CHANGED], 0); + + g_object_notify (G_OBJECT (self), "text"); +} + +/** + * clutter_text_get_layout: + * @self: a #ClutterText + * + * Retrieves the current #PangoLayout used by a #ClutterText actor. + * + * Return value: a #PangoLayout. The returned object is owned by + * the #ClutterText actor and should not be modified or freed + * + * Since: 1.0 + */ +PangoLayout * +clutter_text_get_layout (ClutterText *self) +{ + ClutterUnit width; + + g_return_val_if_fail (CLUTTER_IS_TEXT (self), NULL); + + width = clutter_actor_get_widthu (CLUTTER_ACTOR (self)); + + return clutter_text_create_layout (self, width); +} + +/** + * clutter_text_set_color: + * @self: a #ClutterText + * @color: a #ClutterColor + * + * Sets the color of the contents of a #ClutterText actor. + * + * The overall opacity of the #ClutterText actor will be the + * result of the alpha value of @color and the composited + * opacity of the actor itself on the scenegraph, as returned + * by clutter_actor_get_paint_opacity(). + * + * Since: 1.0 + */ +void +clutter_text_set_color (ClutterText *self, + const ClutterColor *color) +{ + ClutterTextPrivate *priv; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + g_return_if_fail (color != NULL); + + priv = self->priv; + + priv->text_color = *color; + + if (CLUTTER_ACTOR_IS_VISIBLE (self)) + clutter_actor_queue_redraw (CLUTTER_ACTOR (self)); + + g_object_notify (G_OBJECT (self), "color"); +} + +/** + * clutter_text_get_color: + * @self: a #ClutterText + * @color: return location for a #ClutterColor + * + * Retrieves the text color as set by clutter_text_get_color(). + * + * Since: 1.0 + */ +void +clutter_text_get_color (ClutterText *self, + ClutterColor *color) +{ + ClutterTextPrivate *priv; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + g_return_if_fail (color != NULL); + + priv = self->priv; + + *color = priv->text_color; +} + +/** + * clutter_text_set_ellipsize: + * @self: a #ClutterText + * @mode: a #PangoEllipsizeMode + * + * Sets the mode used to ellipsize (add an ellipsis: "...") to the + * text if there is not enough space to render the entire contents + * of a #ClutterText actor + * + * Since: 1.0 + */ +void +clutter_text_set_ellipsize (ClutterText *self, + PangoEllipsizeMode mode) +{ + ClutterTextPrivate *priv; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + g_return_if_fail (mode >= PANGO_ELLIPSIZE_NONE && + mode <= PANGO_ELLIPSIZE_END); + + priv = self->priv; + + if ((PangoEllipsizeMode) priv->ellipsize != mode) + { + priv->ellipsize = mode; + + clutter_text_dirty_cache (self); + + clutter_actor_queue_relayout (CLUTTER_ACTOR (self)); + + g_object_notify (G_OBJECT (self), "ellipsize"); + } +} + +/** + * clutter_text_get_ellipsize: + * @self: a #ClutterText + * + * Returns the ellipsizing position of a #ClutterText actor, as + * set by clutter_text_set_ellipsize(). + * + * Return value: #PangoEllipsizeMode + * + * Since: 1.0 + */ +PangoEllipsizeMode +clutter_text_get_ellipsize (ClutterText *self) +{ + g_return_val_if_fail (CLUTTER_IS_TEXT (self), PANGO_ELLIPSIZE_NONE); + + return self->priv->ellipsize; +} + +/** + * clutter_text_get_line_wrap: + * @self: a #ClutterText + * + * Retrieves the value set using clutter_text_set_line_wrap(). + * + * Return value: %TRUE if the #ClutterText actor should wrap + * its contents + * + * Since: 1.0 + */ +gboolean +clutter_text_get_line_wrap (ClutterText *self) +{ + g_return_val_if_fail (CLUTTER_IS_TEXT (self), FALSE); + + return self->priv->wrap; +} + +/** + * clutter_text_set_line_wrap: + * @self: a #ClutterText + * @line_wrap: whether the contents should wrap + * + * Sets whether the contents of a #ClutterText actor should wrap, + * if they don't fit the size assigned to the actor. + * + * Since: 1.0 + */ +void +clutter_text_set_line_wrap (ClutterText *self, + gboolean line_wrap) +{ + ClutterTextPrivate *priv; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + + priv = self->priv; + + if (priv->wrap != line_wrap) + { + priv->wrap = line_wrap; + + clutter_text_dirty_cache (self); + + clutter_actor_queue_relayout (CLUTTER_ACTOR (self)); + + g_object_notify (G_OBJECT (self), "line-wrap"); + } +} + +/** + * clutter_text_set_line_wrap_mode: + * @self: a #ClutterText + * @wrap_mode: the line wrapping mode + * + * If line wrapping is enabled (see clutter_text_set_line_wrap()) this + * function controls how the line wrapping is performed. The default is + * %PANGO_WRAP_WORD which means wrap on word boundaries. + * + * Since: 1.0 + */ +void +clutter_text_set_line_wrap_mode (ClutterText *self, + PangoWrapMode wrap_mode) +{ + ClutterTextPrivate *priv; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + + priv = self->priv; + + if (priv->wrap_mode != wrap_mode) + { + priv->wrap_mode = wrap_mode; + + clutter_text_dirty_cache (self); + + clutter_actor_queue_relayout (CLUTTER_ACTOR (self)); + + g_object_notify (G_OBJECT (self), "line-wrap-mode"); + } +} + +/** + * clutter_text_get_line_wrap_mode: + * @self: a #ClutterText + * + * Retrieves the line wrap mode used by the #ClutterText actor. + * + * See clutter_text_set_line_wrap_mode (). + * + * Return value: the wrap mode used by the #ClutterText + * + * Since: 1.0 + */ +PangoWrapMode +clutter_text_get_line_wrap_mode (ClutterText *self) +{ + g_return_val_if_fail (CLUTTER_IS_TEXT (self), PANGO_WRAP_WORD); + + return self->priv->wrap_mode; +} + +/** + * clutter_text_set_attributes: + * @self: a #ClutterText + * @attrs: a #PangoAttrList or %NULL to unset the attributes + * + * Sets the attributes list that are going to be applied to the + * #ClutterText contents. The attributes set with this function + * will be ignored if the #ClutterText:use_markup property is + * set to %TRUE. + * + * The #ClutterText actor will take a reference on the #PangoAttrList + * passed to this function. + * + * Since: 1.0 + */ +void +clutter_text_set_attributes (ClutterText *self, + PangoAttrList *attrs) +{ + ClutterTextPrivate *priv; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + + priv = self->priv; + + if (attrs) + pango_attr_list_ref (attrs); + + if (priv->attrs) + pango_attr_list_unref (priv->attrs); + + if (!priv->use_markup) + { + if (attrs) + pango_attr_list_ref (attrs); + + if (priv->effective_attrs) + pango_attr_list_unref (priv->effective_attrs); + + priv->effective_attrs = attrs; + } + + priv->attrs = attrs; + + clutter_text_dirty_cache (self); + + g_object_notify (G_OBJECT (self), "attributes"); + + clutter_actor_queue_relayout (CLUTTER_ACTOR (self)); +} + +/** + * clutter_text_get_attributes: + * @self: a #ClutterText + * + * Gets the attribute list that was set on the #ClutterText actor + * clutter_text_set_attributes(), if any. + * + * Return value: the attribute list, or %NULL if none was set. The + * returned value is owned by the #ClutterText and should not be + * unreferenced. + * + * Since: 1.0 + */ +PangoAttrList * +clutter_text_get_attributes (ClutterText *self) +{ + g_return_val_if_fail (CLUTTER_IS_TEXT (self), NULL); + + return self->priv->attrs; +} + +/** + * clutter_text_set_alignment: + * @self: a #ClutterText + * @alignment: A #PangoAlignment + * + * Sets text alignment of the #ClutterText actor. + * + * The alignment will only be used when the contents of the + * #ClutterText actor are enough to wrap, and the #ClutterText:line-wrap + * property is set to %TRUE. + * + * Since: 1.0 + */ +void +clutter_text_set_alignment (ClutterText *self, + PangoAlignment alignment) +{ + ClutterTextPrivate *priv; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + + priv = self->priv; + + if (priv->alignment != alignment) + { + priv->alignment = alignment; + + clutter_text_dirty_cache (self); + + clutter_actor_queue_relayout (CLUTTER_ACTOR (self)); + + g_object_notify (G_OBJECT (self), "alignment"); + } +} + +/** + * clutter_text_get_alignment: + * @self: a #ClutterText + * + * Retrieves the alignment of @self. + * + * Return value: a #PangoAlignment + * + * Since 1.0 + */ +PangoAlignment +clutter_text_get_alignment (ClutterText *self) +{ + g_return_val_if_fail (CLUTTER_IS_TEXT (self), PANGO_ALIGN_LEFT); + + return self->priv->alignment; +} + +/** + * clutter_text_set_use_markup: + * @self: a #ClutterText + * @setting: %TRUE if the text should be parsed for markup. + * + * Sets whether the contents of the #ClutterText actor contains markup + * in Pango's text markup language. + * + * Calling this function on an editable #ClutterText will not cause + * the actor to parse any markup. + * + * Since: 1.0 + */ +void +clutter_text_set_use_markup (ClutterText *self, + gboolean setting) +{ + ClutterTextPrivate *priv; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + + priv = self->priv; + + if (priv->use_markup != setting) + { + priv->use_markup = setting; + + clutter_text_dirty_cache (self); + + clutter_actor_queue_relayout (CLUTTER_ACTOR (self)); + + g_object_notify (G_OBJECT (self), "use-markup"); + } +} + +/** + * clutter_text_get_use_markup: + * @self: a #ClutterText + * + * Retrieves whether the contents of the #ClutterText actor should be + * parsed for the Pango text markup. + * + * Return value: %TRUE if the contents will be parsed for markup + * + * Since: 1.0 + */ +gboolean +clutter_text_get_use_markup (ClutterText *self) +{ + g_return_val_if_fail (CLUTTER_IS_TEXT (self), FALSE); + + return self->priv->use_markup; +} + +/** + * clutter_text_set_justify: + * @self: a #ClutterText + * @justify: whether the text should be justified + * + * Sets whether the text of the #ClutterText actor should be justified + * on both margins. This setting is ignored if Clutter is compiled + * against Pango < 1.18. + * + * Since: 1.0 + */ +void +clutter_text_set_justify (ClutterText *self, + gboolean justify) +{ + ClutterTextPrivate *priv; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + + priv = self->priv; + + if (priv->justify != justify) + { + priv->justify = justify; + + clutter_text_dirty_cache (self); + + clutter_actor_queue_relayout (CLUTTER_ACTOR (self)); + + g_object_notify (G_OBJECT (self), "justify"); + } +} + +/** + * clutter_text_get_justify: + * @self: a #ClutterText + * + * Retrieves whether the #ClutterText actor should justify its contents + * on both margins. + * + * Return value: %TRUE if the text should be justified + * + * Since: 0.6 + */ +gboolean +clutter_text_get_justify (ClutterText *self) +{ + g_return_val_if_fail (CLUTTER_IS_TEXT (self), FALSE); + + return self->priv->justify; +} + +/** + * clutter_text_get_cursor_position: + * @self: a #ClutterText + * + * Retrieves the cursor position. + * + * Return value: the cursor position, in characters + * + * Since: 1.0 + */ +gint +clutter_text_get_cursor_position (ClutterText *self) +{ + g_return_val_if_fail (CLUTTER_IS_TEXT (self), -1); + + return self->priv->position; +} + +/** + * clutter_text_set_cursor_position: + * @self: a #ClutterText + * @position: the new cursor position, in characters + * + * Sets the cursor of a #ClutterText actor at @position. + * + * The position is expressed in characters, not in bytes. + * + * Since: 1.0 + */ +void +clutter_text_set_cursor_position (ClutterText *self, + gint position) +{ + ClutterTextPrivate *priv; + gint len; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + + priv = self->priv; + + len = priv->n_chars; + + if (position < 0 || position >= len) + priv->position = -1; + else + priv->position = position; + + /* Forget the target x position so that it will be recalculated next + time the cursor is moved up or down */ + priv->x_pos = -1; + + if (CLUTTER_ACTOR_IS_VISIBLE (self)) + clutter_actor_queue_redraw (CLUTTER_ACTOR (self)); +} + +/** + * clutter_text_set_cursor_size: + * @self: a #ClutterText + * @size: the size of the cursor, in pixels, or -1 to use the + * default value + * + * Sets the size of the cursor of a #ClutterText. The cursor + * will only be visible if the #ClutterText:cursor-visible property + * is set to %TRUE. + * + * Since: 1.0 + */ +void +clutter_text_set_cursor_size (ClutterText *self, + gint size) +{ + ClutterTextPrivate *priv; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + + priv = self->priv; + + if (priv->cursor_size != size) + { + if (size < 0) + size = DEFAULT_CURSOR_SIZE; + + priv->cursor_size = size; + + if (CLUTTER_ACTOR_IS_VISIBLE (self)) + clutter_actor_queue_redraw (CLUTTER_ACTOR (self)); + + g_object_notify (G_OBJECT (self), "cursor-size"); + } +} + +/** + * clutter_text_get_cursor_size: + * @self: a #ClutterText + * + * Retrieves the size of the cursor of a #ClutterText actor. + * + * Return value: the size of the cursor, in pixels + * + * Since: 1.0 + */ +guint +clutter_text_get_cursor_size (ClutterText *self) +{ + g_return_val_if_fail (CLUTTER_IS_TEXT (self), DEFAULT_CURSOR_SIZE); + + return self->priv->cursor_size; +} + +/** + * clutter_text_set_password_char: + * @self: a #ClutterText + * @wc: a Unicode character, or 0 to unset the password character + * + * Sets the character to use in place of the actual text in a + * password text actor. + * + * If @wc is 0 the text will be displayed as it is entered in the + * #ClutterText actor. + * + * Since: 1.0 + */ +void +clutter_text_set_password_char (ClutterText *self, + gunichar wc) +{ + ClutterTextPrivate *priv; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + + priv = self->priv; + + if (priv->password_char != wc) + { + priv->password_char = wc; + + clutter_text_dirty_cache (self); + clutter_actor_queue_relayout (CLUTTER_ACTOR (self)); + + g_object_notify (G_OBJECT (self), "password-char"); + } +} + +/** + * clutter_text_get_password_char: + * @self: a #ClutterText + * + * Retrieves the character to use in place of the actual text + * as set by clutter_text_set_password_char(). + * + * Return value: a Unicode character or 0 if the password + * character is not set + * + * Since: 1.0 + */ +gunichar +clutter_text_get_password_char (ClutterText *self) +{ + g_return_val_if_fail (CLUTTER_IS_TEXT (self), 0); + + return self->priv->password_char; +} + +/** + * clutter_text_set_max_length: + * @self: a #ClutterText + * @max: the maximum number of characters allowed in the text actor; 0 + * to disable or -1 to set the length of the current string + * + * Sets the maximum allowed length of the contents of the actor. If the + * current contents are longer than the given length, then they will be + * truncated to fit. + * + * Since: 1.0 + */ +void +clutter_text_set_max_length (ClutterText *self, + gint max) +{ + ClutterTextPrivate *priv; + gchar *new = NULL; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + + priv = self->priv; + + if (priv->max_length != max) + { + if (max < 0) + max = priv->n_chars; + + priv->max_length = max; + + new = g_strdup (priv->text); + clutter_text_set_text (self, new); + g_free (new); + + g_object_notify (G_OBJECT (self), "max-length"); + } +} + +/** + * clutter_text_get_max_length: + * @self: a #ClutterText + * + * Gets the maximum length of text that can be set into a text actor. + * + * See clutter_text_set_max_length(). + * + * Return value: the maximum number of characters. + * + * Since: 1.0 + */ +gint +clutter_text_get_max_length (ClutterText *self) +{ + g_return_val_if_fail (CLUTTER_IS_TEXT (self), 0); + + return self->priv->max_length; +} + +/** + * clutter_text_insert_unichar: + * @self: a #ClutterText + * @wc: a Unicode character + * + * Inserts @wc at the current cursor position of a + * #ClutterText actor. + * + * Since: 1.0 + */ +void +clutter_text_insert_unichar (ClutterText *self, + gunichar wc) +{ + ClutterTextPrivate *priv; + GString *new = NULL; + glong pos; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + g_return_if_fail (g_unichar_validate (wc)); + + if (wc == 0) + return; + + priv = self->priv; + + new = g_string_new (priv->text); + + if (priv->text) + pos = offset_to_bytes (priv->text, priv->position); + else + pos = 0; + + new = g_string_insert_unichar (new, pos, wc); + + clutter_text_set_text (self, new->str); + + if (priv->position >= 0) + { + clutter_text_set_cursor_position (self, priv->position + 1); + clutter_text_set_selection_bound (self, priv->position); + } + + g_string_free (new, TRUE); +} + +/** + * clutter_text_insert_text: + * @self: a #ClutterText + * @text: the text to be inserted + * @position: the position of the insertion, or -1 + * + * Inserts @text into a #ClutterActor at the given position. + * + * If @position is a negative number, the text will be appended + * at the end of the current contents of the #ClutterText. + * + * The position is expressed in characters, not in bytes. + * + * Since: 1.0 + */ +void +clutter_text_insert_text (ClutterText *self, + const gchar *text, + gssize position) +{ + ClutterTextPrivate *priv; + GString *new = NULL; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + g_return_if_fail (text != NULL); + + priv = self->priv; + + new = g_string_new (priv->text); + new = g_string_insert (new, position, text); + + clutter_text_set_text (self, new->str); + + g_string_free (new, TRUE); +} + +/** + * clutter_text_delete_text: + * @self: a #ClutterText + * @start_pos: starting position + * @end_pos: ending position + * + * Deletes the text inside a #ClutterText actor between @start_pos + * and @end_pos. + * + * The starting and ending positions are expressed in characters, + * not in bytes. + * + * Since: 1.0 + */ +void +clutter_text_delete_text (ClutterText *self, + gssize start_pos, + gssize end_pos) +{ + ClutterTextPrivate *priv; + GString *new = NULL; + gint start_bytes; + gint end_bytes; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + + priv = self->priv; + + if (!priv->text) + return; + + if (start_pos == 0) + start_bytes = 0; + else + start_bytes = offset_to_bytes (priv->text, start_pos); + + if (end_pos == -1) + end_bytes = offset_to_bytes (priv->text, priv->n_chars); + else + end_bytes = offset_to_bytes (priv->text, end_pos); + + new = g_string_new (priv->text); + new = g_string_erase (new, start_bytes, end_bytes - start_bytes); + + clutter_text_set_text (self, new->str); + + g_string_free (new, TRUE); +} + +/** + * clutter_text_delete_chars: + * @self: a #ClutterText + * @n_chars: the number of characters to delete + * + * Deletes @n_chars inside a #ClutterText actor, starting from the + * current cursor position. + * + * Since: 1.0 + */ +void +clutter_text_delete_chars (ClutterText *self, + guint n_chars) +{ + ClutterTextPrivate *priv; + GString *new = NULL; + gint len; + gint pos; + gint num_pos; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + + priv = self->priv; + + if (!priv->text) + return; + + len = priv->n_chars; + new = g_string_new (priv->text); + + if (priv->position == -1) + { + num_pos = offset_to_bytes (priv->text, priv->n_chars - n_chars); + new = g_string_erase (new, num_pos, -1); + } + else + { + pos = offset_to_bytes (priv->text, priv->position - n_chars); + num_pos = offset_to_bytes (priv->text, priv->position); + new = g_string_erase (new, pos, num_pos - pos); + } + + clutter_text_set_text (self, new->str); + + if (priv->position > 0) + clutter_text_set_cursor_position (self, priv->position - n_chars); + + g_string_free (new, TRUE); + + g_object_notify (G_OBJECT (self), "text"); +} + +/** + * clutter_text_get_chars: + * @self: a #ClutterText + * @start_pos: start of text, in characters + * @end_pos: end of text, in characters + * + * Retrieves the contents of the #ClutterText actor between + * @start_pos and @end_pos. + * + * The positions are specified in characters, not in bytes. + * + * Return value: a newly allocated string with the contents of + * the text actor between the specified positions. Use g_free() + * to free the resources when done + * + * Since: 1.0 + */ +gchar * +clutter_text_get_chars (ClutterText *self, + gssize start_pos, + gssize end_pos) +{ + ClutterTextPrivate *priv; + gint start_index, end_index; + + g_return_val_if_fail (CLUTTER_IS_TEXT (self), NULL); + + priv = self->priv; + + if (end_pos < 0) + end_pos = priv->n_chars; + + start_pos = MIN (priv->n_chars, start_pos); + end_pos = MIN (priv->n_chars, end_pos); + + start_index = g_utf8_offset_to_pointer (priv->text, start_pos) + - priv->text; + end_index = g_utf8_offset_to_pointer (priv->text, end_pos) + - priv->text; + + return g_strndup (priv->text + start_index, end_index - start_index); +} + +/** + * clutter_text_set_single_line_mode: + * @self: a #ClutterText + * @single_line: whether to enable single line mode + * + * Sets whether a #ClutterText actor should be in single line mode + * or not. + * + * A text actor in single line mode will not wrap text and will clip + * the the visible area to the predefined size. The contents of the + * text actor will scroll to display the end of the text if its length + * is bigger than the allocated width. + * + * When setting the single line mode the #ClutterText:activatable + * property is also set as a side effect. Instead of entering a new + * line character, the text actor will emit the #ClutterText::activate + * signal. + * + * Since: 1.0 + */ +void +clutter_text_set_single_line_mode (ClutterText *self, + gboolean single_line) +{ + ClutterTextPrivate *priv; + + g_return_if_fail (CLUTTER_IS_TEXT (self)); + + priv = self->priv; + + if (priv->single_line_mode != single_line) + { + g_object_freeze_notify (G_OBJECT (self)); + + priv->single_line_mode = single_line; + + if (priv->single_line_mode) + { + priv->activatable = TRUE; + + g_object_notify (G_OBJECT (self), "activatable"); + } + + clutter_text_dirty_cache (self); + clutter_actor_queue_relayout (CLUTTER_ACTOR (self)); + + g_object_notify (G_OBJECT (self), "single-line-mode"); + + g_object_thaw_notify (G_OBJECT (self)); + } +} + +/** + * clutter_text_get_single_line_mode: + * @self: a #ClutterText + * + * Retrieves whether the #ClutterText actor is in single line mode. + * + * Return value: %TRUE if the #ClutterText actor is in single line mode + * + * Since: 1.0 + */ +gboolean +clutter_text_get_single_line_mode (ClutterText *self) +{ + g_return_val_if_fail (CLUTTER_IS_TEXT (self), FALSE); + + return self->priv->single_line_mode; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-text.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-text.h --- clutter-0.8.4/clutter/clutter-text.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-text.h 2009-01-29 13:30:31.000000000 +0000 @@ -0,0 +1,198 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Copyright (C) 2008 Intel Corporation. + * + * Authored By: Øyvind Kolås + * Emmanuele Bassi + * + * 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 . + */ + +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_TEXT_H__ +#define __CLUTTER_TEXT_H__ + +#include +#include + +G_BEGIN_DECLS + +#define CLUTTER_TYPE_TEXT (clutter_text_get_type ()) +#define CLUTTER_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_TEXT, ClutterText)) +#define CLUTTER_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_TEXT, ClutterTextClass)) +#define CLUTTER_IS_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_TEXT)) +#define CLUTTER_IS_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_TEXT)) +#define CLUTTER_TEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_TEXT, ClutterTextClass)) + +typedef struct _ClutterText ClutterText; +typedef struct _ClutterTextPrivate ClutterTextPrivate; +typedef struct _ClutterTextClass ClutterTextClass; + +/** + * ClutterText: + * + * The #ClutterText struct contains only private data. + * + * Since: 1.0 + */ +struct _ClutterText +{ + /*< private >*/ + ClutterActor parent_instance; + + ClutterTextPrivate *priv; +}; + +/** + * ClutterTextClass: + * @text_changed: class handler for the #ClutterText::text-changed signal + * @activate: class handler for the #ClutterText::activate signal + * @cursor_event: class handler for the #ClutterText::cursor_event signal + * + * The #ClutterTextClass struct contains only private data. + * + * Since: 1.0 + */ +struct _ClutterTextClass +{ + /*< private >*/ + ClutterActorClass parent_class; + + /*< public >*/ + /* signals, not vfuncs */ + void (* text_changed) (ClutterText *self); + void (* activate) (ClutterText *self); + void (* cursor_event) (ClutterText *self, + const ClutterGeometry *geometry); + + /*< private >*/ + /* padding for future expansion */ + void (* _clutter_reserved1) (void); + void (* _clutter_reserved2) (void); + void (* _clutter_reserved3) (void); + void (* _clutter_reserved4) (void); + void (* _clutter_reserved5) (void); + void (* _clutter_reserved6) (void); + void (* _clutter_reserved7) (void); + void (* _clutter_reserved8) (void); +}; + +GType clutter_text_get_type (void) G_GNUC_CONST; + +ClutterActor * clutter_text_new (void); +ClutterActor * clutter_text_new_full (const gchar *font_name, + const gchar *text, + const ClutterColor *color); +ClutterActor * clutter_text_new_with_text (const gchar *font_name, + const gchar *text); + +G_CONST_RETURN gchar *clutter_text_get_text (ClutterText *self); +void clutter_text_set_text (ClutterText *self, + const gchar *text); +PangoLayout * clutter_text_get_layout (ClutterText *self); +void clutter_text_set_color (ClutterText *self, + const ClutterColor *color); +void clutter_text_get_color (ClutterText *self, + ClutterColor *color); +void clutter_text_set_font_name (ClutterText *self, + const gchar *font_name); +G_CONST_RETURN gchar *clutter_text_get_font_name (ClutterText *self); + +void clutter_text_set_ellipsize (ClutterText *self, + PangoEllipsizeMode mode); +PangoEllipsizeMode clutter_text_get_ellipsize (ClutterText *self); +void clutter_text_set_line_wrap (ClutterText *self, + gboolean line_wrap); +gboolean clutter_text_get_line_wrap (ClutterText *self); +void clutter_text_set_line_wrap_mode (ClutterText *self, + PangoWrapMode wrap_mode); +PangoWrapMode clutter_text_get_line_wrap_mode (ClutterText *self); +PangoLayout * clutter_text_get_layout (ClutterText *self); +void clutter_text_set_attributes (ClutterText *self, + PangoAttrList *attrs); +PangoAttrList * clutter_text_get_attributes (ClutterText *self); +void clutter_text_set_use_markup (ClutterText *self, + gboolean setting); +gboolean clutter_text_get_use_markup (ClutterText *self); +void clutter_text_set_alignment (ClutterText *self, + PangoAlignment alignment); +PangoAlignment clutter_text_get_alignment (ClutterText *self); +void clutter_text_set_justify (ClutterText *self, + gboolean justify); +gboolean clutter_text_get_justify (ClutterText *self); + +void clutter_text_insert_unichar (ClutterText *self, + gunichar wc); +void clutter_text_delete_chars (ClutterText *self, + guint n_chars); +void clutter_text_insert_text (ClutterText *self, + const gchar *text, + gssize position); +void clutter_text_delete_text (ClutterText *self, + gssize start_pos, + gssize end_pos); +gchar * clutter_text_get_chars (ClutterText *self, + gssize start_pos, + gssize end_pos); +void clutter_text_set_editable (ClutterText *self, + gboolean editable); +gboolean clutter_text_get_editable (ClutterText *self); +void clutter_text_set_activatable (ClutterText *self, + gboolean activatable); +gboolean clutter_text_get_activatable (ClutterText *self); + +gint clutter_text_get_cursor_position (ClutterText *self); +void clutter_text_set_cursor_position (ClutterText *self, + gint position); +void clutter_text_set_cursor_visible (ClutterText *self, + gboolean cursor_visible); +gboolean clutter_text_get_cursor_visible (ClutterText *self); +void clutter_text_set_cursor_color (ClutterText *self, + const ClutterColor *color); +void clutter_text_get_cursor_color (ClutterText *self, + ClutterColor *color); +void clutter_text_set_cursor_size (ClutterText *self, + gint size); +guint clutter_text_get_cursor_size (ClutterText *self); +void clutter_text_set_selectable (ClutterText *self, + gboolean selectable); +gboolean clutter_text_get_selectable (ClutterText *self); +void clutter_text_set_selection_bound (ClutterText *self, + gint selection_bound); +gint clutter_text_get_selection_bound (ClutterText *self); +void clutter_text_set_selection (ClutterText *self, + gssize start_pos, + gssize end_pos); +gchar * clutter_text_get_selection (ClutterText *self); +void clutter_text_set_password_char (ClutterText *self, + gunichar wc); +gunichar clutter_text_get_password_char (ClutterText *self); +void clutter_text_set_max_length (ClutterText *self, + gint max); +gint clutter_text_get_max_length (ClutterText *self); +void clutter_text_set_single_line_mode (ClutterText *self, + gboolean single_line); +gboolean clutter_text_get_single_line_mode (ClutterText *self); + +gboolean clutter_text_activate (ClutterText *self); + +G_END_DECLS + +#endif /* __CLUTTER_TEXT_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-texture.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-texture.c --- clutter-0.8.4/clutter/clutter-texture.c 2008-11-13 14:44:32.000000000 +0000 +++ clutter-0.9.0/clutter/clutter-texture.c 2009-01-28 16:45:24.000000000 +0000 @@ -79,7 +79,8 @@ gint height; gint max_tile_waste; ClutterTextureQuality filter_quality; - CoglHandle texture; + CoglHandle material; + CoglHandle fbo_texture; gboolean no_slice; ClutterActor *fbo_source; @@ -96,6 +97,13 @@ guint repeat_y : 1; guint in_dispose : 1; guint keep_aspect_ratio : 1; + guint load_async : 1; + + GThread *load_thread; + guint load_idle; + gchar *load_filename; + CoglBitmap *load_bitmap; + GError *load_error; }; enum @@ -109,14 +117,21 @@ PROP_REPEAT_X, PROP_FILTER_QUALITY, PROP_COGL_TEXTURE, +#if EXPOSE_COGL_MATERIAL_PROP + PROP_COGL_MATERIAL, +#endif PROP_FILENAME, - PROP_KEEP_ASPECT_RATIO + PROP_KEEP_ASPECT_RATIO, + PROP_LOAD_ASYNC }; enum { SIZE_CHANGE, PIXBUF_CHANGE, + LOAD_SUCCESS, + LOAD_FINISHED, + LAST_SIGNAL }; @@ -175,11 +190,7 @@ CLUTTER_MARK(); - if (priv->texture != COGL_INVALID_HANDLE) - { - cogl_texture_unref (priv->texture); - priv->texture = COGL_INVALID_HANDLE; - } + cogl_material_remove_layer (priv->material, 0); } static void @@ -191,7 +202,7 @@ texture = CLUTTER_TEXTURE(actor); priv = texture->priv; - if (priv->texture == COGL_INVALID_HANDLE) + if (priv->material == COGL_INVALID_HANDLE) return; /* there's no need to read the pixels back when unrealizing inside @@ -247,24 +258,31 @@ if (priv->fbo_source) { + CoglTextureFlags flags = COGL_TEXTURE_NONE; + gint max_waste = -1; + /* Handle FBO's */ - if (priv->texture != COGL_INVALID_HANDLE) - cogl_texture_unref (priv->texture); + if (priv->fbo_texture != COGL_INVALID_HANDLE) + cogl_texture_unref (priv->fbo_texture); + + if (!priv->no_slice) + max_waste = priv->max_tile_waste; - priv->texture - = cogl_texture_new_with_size - (priv->width, - priv->height, - priv->no_slice ? -1 : priv->max_tile_waste, - priv->filter_quality == CLUTTER_TEXTURE_QUALITY_HIGH, - COGL_PIXEL_FORMAT_RGBA_8888); + if (priv->filter_quality == CLUTTER_TEXTURE_QUALITY_HIGH) + flags |= COGL_TEXTURE_AUTO_MIPMAP; - cogl_texture_set_filters (priv->texture, + priv->fbo_texture = + cogl_texture_new_with_size (priv->width, + priv->height, + max_waste, flags, + COGL_PIXEL_FORMAT_RGBA_8888); + + cogl_texture_set_filters (priv->fbo_texture, clutter_texture_quality_to_cogl_min_filter (priv->filter_quality), clutter_texture_quality_to_cogl_mag_filter (priv->filter_quality)); - priv->fbo_handle = cogl_offscreen_new_to_texture (priv->texture); + priv->fbo_handle = cogl_offscreen_new_to_texture (priv->fbo_texture); if (priv->fbo_handle == COGL_INVALID_HANDLE) { @@ -332,13 +350,13 @@ /* Set the natural width so as to preserve the aspect ratio */ ClutterFixed ratio, height; - ratio = clutter_qdivx (CLUTTER_INT_TO_FIXED (priv->width), - CLUTTER_INT_TO_FIXED (priv->height)); + ratio = CLUTTER_FIXED_DIV ((float)(priv->width), + (float)(priv->height)); height = CLUTTER_UNITS_TO_FIXED (for_height); *natural_width_p = - CLUTTER_UNITS_FROM_FIXED (clutter_qmulx (ratio, height)); + CLUTTER_UNITS_FROM_FIXED (CLUTTER_FIXED_MUL (ratio, height)); } } } @@ -376,14 +394,14 @@ { /* Set the natural height so as to preserve the aspect ratio */ ClutterFixed ratio, width; - - ratio = clutter_qdivx (CLUTTER_INT_TO_FIXED (priv->height), - CLUTTER_INT_TO_FIXED (priv->width)); + + ratio = CLUTTER_FIXED_DIV ((float)(priv->height), + (float)(priv->width)); width = CLUTTER_UNITS_TO_FIXED (for_width); - + *natural_height_p = - CLUTTER_UNITS_FROM_FIXED (clutter_qmulx (ratio, width)); + CLUTTER_UNITS_FROM_FIXED (CLUTTER_FIXED_MUL (ratio, width)); } } } @@ -417,7 +435,8 @@ ClutterTexturePrivate *priv = CLUTTER_TEXTURE (self)->priv; ClutterVertex verts[4]; ClutterFixed viewport[4]; - ClutterFixed x_min, x_max, y_min, y_max; + ClutterUnit x_min, x_max, y_min, y_max; + ClutterFixed tx_min, tx_max, ty_min, ty_max; ClutterPerspective perspective; ClutterStage *stage; ClutterFixed tan_angle, near_size; @@ -450,21 +469,26 @@ /* Convert the coordinates back to [-1,1] range */ cogl_get_viewport (viewport); - x_min = CFX_QDIV (x_min, viewport[2]) * 2 - CFX_ONE; - x_max = CFX_QDIV (x_max, viewport[2]) * 2 - CFX_ONE; - y_min = CFX_QDIV (y_min, viewport[3]) * 2 - CFX_ONE; - y_max = CFX_QDIV (y_max, viewport[3]) * 2 - CFX_ONE; + + tx_min = CLUTTER_FIXED_DIV (CLUTTER_UNITS_TO_FIXED (x_min), viewport[2]) + * 2 - 1.0; + tx_max = CLUTTER_FIXED_DIV (CLUTTER_UNITS_TO_FIXED (x_max), viewport[2]) + * 2 - 1.0; + ty_min = CLUTTER_FIXED_DIV (CLUTTER_UNITS_TO_FIXED (y_min), viewport[3]) + * 2 - 1.0; + ty_max = CLUTTER_FIXED_DIV (CLUTTER_UNITS_TO_FIXED (y_max), viewport[3]) + * 2 - 1.0; /* Set up a projection matrix so that the actor will be projected as if it was drawn at its original location */ - tan_angle = clutter_tani (CLUTTER_ANGLE_FROM_DEGX (perspective.fovy / 2)); - near_size = CFX_QMUL (perspective.z_near, tan_angle); + tan_angle = tanf ((perspective.fovy / 2) * (G_PI/180.0)); + near_size = CLUTTER_FIXED_MUL (perspective.z_near, tan_angle); - cogl_frustum (CFX_QMUL (x_min, near_size), - CFX_QMUL (x_max, near_size), - CFX_QMUL (-y_min, near_size), - CFX_QMUL (-y_max, near_size), - perspective.z_near, perspective.z_far); + cogl_frustum (CLUTTER_FIXED_MUL (tx_min, near_size), + CLUTTER_FIXED_MUL (tx_max, near_size), + CLUTTER_FIXED_MUL (-ty_min, near_size), + CLUTTER_FIXED_MUL (-ty_max, near_size), + perspective.z_near, perspective.z_far); } static void @@ -473,8 +497,7 @@ ClutterTexture *texture = CLUTTER_TEXTURE (self); ClutterTexturePrivate *priv = texture->priv; gint x_1, y_1, x_2, y_2; - ClutterColor col = { 0xff, 0xff, 0xff, 0xff }; - ClutterColor transparent_col = { 0, 0, 0, 0 }; + CoglColor transparent_col; ClutterFixed t_w, t_h; if (!CLUTTER_ACTOR_IS_REALIZED (CLUTTER_ACTOR(texture))) @@ -528,6 +551,7 @@ } /* cogl_paint_init is called to clear the buffers */ + cogl_color_set_from_4ub (&transparent_col, 0, 0, 0, 0); cogl_paint_init (&transparent_col); /* Clear the clipping stack so that if the FBO actor is being @@ -544,8 +568,10 @@ /* Restore the perspective matrix using cogl_perspective so that the inverse matrix will be right */ - cogl_perspective (perspective.fovy, perspective.aspect, - perspective.z_near, perspective.z_far); + cogl_perspective (perspective.fovy, + perspective.aspect, + perspective.z_near, + perspective.z_far); /* If there is a shader on top of the shader stack, turn it back on. */ if (shader) @@ -563,8 +589,9 @@ "painting texture '%s'", clutter_actor_get_name (self) ? clutter_actor_get_name (self) : "unknown"); - col.alpha = clutter_actor_get_paint_opacity (self); - cogl_color (&col); + + cogl_material_set_color4ub (priv->material, 0xff, 0xff, 0xff, + clutter_actor_get_paint_opacity (self)); clutter_actor_get_allocation_coords (self, &x_1, &y_1, &x_2, &y_2); @@ -574,21 +601,62 @@ clutter_actor_get_opacity (self)); if (priv->repeat_x && priv->width > 0) - t_w = CFX_QDIV (CLUTTER_INT_TO_FIXED (x_2 - x_1), - CLUTTER_INT_TO_FIXED (priv->width)); + t_w = CLUTTER_FIXED_DIV ((float)(x_2 - x_1), + (float)(priv->width)); else - t_w = CFX_ONE; + t_w = 1.0; + if (priv->repeat_y && priv->height > 0) - t_h = CFX_QDIV (CLUTTER_INT_TO_FIXED (y_2 - y_1), - CLUTTER_INT_TO_FIXED (priv->height)); + t_h = CLUTTER_FIXED_DIV ((float)(y_2 - y_1), + (float)(priv->height)); else - t_h = CFX_ONE; + t_h = 1.0; /* Paint will have translated us */ - cogl_texture_rectangle (priv->texture, 0, 0, - CLUTTER_INT_TO_FIXED (x_2 - x_1), - CLUTTER_INT_TO_FIXED (y_2 - y_1), - 0, 0, t_w, t_h); + cogl_set_source (priv->material); + cogl_rectangle_with_texture_coords (0, 0, + (float) (x_2 - x_1), + (float) (y_2 - y_1), + 0, 0, t_w, t_h); +} + +/* + * clutter_texture_async_load_cancel: + * @texture: a #ClutterTexture + * + * Cancels an asynchronous loading operation, whether done + * with threads enabled or just using the main loop + */ +static void +clutter_texture_async_load_cancel (ClutterTexture *texture) +{ + ClutterTexturePrivate *priv = texture->priv; + + if (priv->load_thread) + { + g_thread_join (priv->load_thread); + priv->load_thread = NULL; + } + + if (priv->load_idle) + { + g_source_remove (priv->load_idle); + priv->load_idle = 0; + } + + if (priv->load_error) + { + g_error_free (priv->load_error); + priv->load_error = NULL; + } + + if (priv->load_bitmap) + { + cogl_bitmap_free (priv->load_bitmap); + priv->load_bitmap = NULL; + } + + g_free (priv->load_filename); } static void @@ -615,7 +683,9 @@ g_free (priv->local_data); priv->local_data = NULL; } - + + clutter_texture_async_load_cancel (texture); + G_OBJECT_CLASS (clutter_texture_parent_class)->dispose (object); } @@ -665,6 +735,12 @@ clutter_texture_set_cogl_texture (texture, (CoglHandle) g_value_get_boxed (value)); break; +#if EXPOSE_COGL_MATERIAL_PROP + case PROP_COGL_MATERIAL: + clutter_texture_set_cogl_material + (texture, (CoglHandle) g_value_get_boxed (value)); + break; +#endif case PROP_FILENAME: clutter_texture_set_from_file (texture, g_value_get_string (value), @@ -676,6 +752,9 @@ case PROP_KEEP_ASPECT_RATIO: priv->keep_aspect_ratio = g_value_get_boolean (value); break; + case PROP_LOAD_ASYNC: + priv->load_async = g_value_get_boolean (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -690,6 +769,7 @@ { ClutterTexture *texture; ClutterTexturePrivate *priv; + CoglHandle cogl_texture; texture = CLUTTER_TEXTURE(object); priv = texture->priv; @@ -700,10 +780,11 @@ g_value_set_int (value, clutter_texture_get_max_tile_waste (texture)); break; case PROP_PIXEL_FORMAT: - if (priv->texture == COGL_INVALID_HANDLE) + cogl_texture = clutter_texture_get_cogl_texture (texture); + if (cogl_texture == COGL_INVALID_HANDLE) g_value_set_int (value, COGL_PIXEL_FORMAT_ANY); else - g_value_set_int (value, cogl_texture_get_format (priv->texture)); + g_value_set_int (value, cogl_texture_get_format (cogl_texture)); break; case PROP_SYNC_SIZE: g_value_set_boolean (value, priv->sync_actor_size); @@ -720,12 +801,20 @@ case PROP_COGL_TEXTURE: g_value_set_boxed (value, clutter_texture_get_cogl_texture (texture)); break; +#if EXPOSE_COGL_MATERIAL_PROP + case PROP_COGL_MATERIAL: + g_value_set_boxed (value, clutter_texture_get_cogl_material (texture)); + break; +#endif case PROP_NO_SLICE: g_value_set_boolean (value, priv->no_slice); break; case PROP_KEEP_ASPECT_RATIO: g_value_set_boolean (value, priv->keep_aspect_ratio); break; + case PROP_LOAD_ASYNC: + g_value_set_boolean (value, priv->load_async); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -812,7 +901,7 @@ "smaller values less texture memory.", -1, G_MAXINT, - 64, + 63, G_PARAM_CONSTRUCT_ONLY | CLUTTER_PARAM_READWRITE)); g_object_class_install_property @@ -834,6 +923,17 @@ CLUTTER_TYPE_TEXTURE_HANDLE, G_PARAM_READWRITE)); +#if EXPOSE_COGL_MATERIAL_PROP + g_object_class_install_property + (gobject_class, PROP_COGL_MATERIAL, + g_param_spec_boxed ("cogl-material", + "COGL Material", + "The underlying COGL material handle used to draw " + "this actor", + CLUTTER_TYPE_MATERIAL_HANDLE, + G_PARAM_READWRITE)); +#endif + g_object_class_install_property (gobject_class, PROP_FILENAME, g_param_spec_string ("filename", @@ -852,6 +952,29 @@ CLUTTER_PARAM_READWRITE)); /** + * ClutterTexture:load-async: + * + * Tries to load a texture from a filename by using a local thread + * to perform the read operations. Threading is only enabled if + * g_thread_init() has been called prior to clutter_init(), otherwise + * #ClutterTexture will use the main loop to load the image. + * + * The upload of the texture data on the GL pipeline is not + * asynchronous, as it must be performed from within the same + * thread that called clutter_main(). + * + * Since: 1.0 + */ + g_object_class_install_property + (gobject_class, PROP_LOAD_ASYNC, + g_param_spec_boolean ("load-async", + "Load asynchronously", + "Load files inside a thread to avoid blocking when " + "loading images.", + FALSE, + CLUTTER_PARAM_READWRITE)); + + /** * ClutterTexture::size-change: * @texture: the texture which received the signal * @width: the width of the new texture @@ -886,6 +1009,27 @@ g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + /** + * ClutterTexture::load-finished: + * @texture: the texture which received the signal + * @error: A set error, or %NULL + * + * The ::load-finished signal is emitted when a texture load has + * completed. If there was an error during loading, @error will + * be set, otherwise it will be %NULL + * + * Since: 1.0 + */ + texture_signals[LOAD_FINISHED] = + g_signal_new (I_("load-finished"), + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ClutterTextureClass, load_finished), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, + 1, + G_TYPE_POINTER); } static ClutterScriptableIface *parent_scriptable_iface = NULL; @@ -936,7 +1080,7 @@ parent_scriptable_iface = g_type_interface_peek_parent (iface); if (!parent_scriptable_iface) - parent_scriptable_iface = g_type_default_interface_peek + parent_scriptable_iface = g_type_default_interface_peek (CLUTTER_TYPE_SCRIPTABLE); iface->set_custom_property = clutter_texture_set_custom_property; @@ -949,12 +1093,13 @@ self->priv = priv = CLUTTER_TEXTURE_GET_PRIVATE (self); - priv->max_tile_waste = 64; + priv->max_tile_waste = 63; priv->filter_quality = CLUTTER_TEXTURE_QUALITY_MEDIUM; priv->repeat_x = FALSE; priv->repeat_y = FALSE; priv->sync_actor_size = TRUE; - priv->texture = COGL_INVALID_HANDLE; + priv->material = cogl_material_new (); + priv->fbo_texture = COGL_INVALID_HANDLE; priv->fbo_handle = COGL_INVALID_HANDLE; priv->local_data = NULL; priv->keep_aspect_ratio = FALSE; @@ -966,6 +1111,7 @@ ClutterTexturePrivate *priv; int bpp; CoglPixelFormat pixel_format; + CoglHandle cogl_texture; priv = texture->priv; @@ -975,12 +1121,14 @@ priv->local_data = NULL; } - if (priv->texture == COGL_INVALID_HANDLE) + if (priv->material == COGL_INVALID_HANDLE) return; - priv->local_data_width = cogl_texture_get_width (priv->texture); - priv->local_data_height = cogl_texture_get_height (priv->texture); - pixel_format = cogl_texture_get_format (priv->texture); + cogl_texture = clutter_texture_get_cogl_texture (texture); + + priv->local_data_width = cogl_texture_get_width (cogl_texture); + priv->local_data_height = cogl_texture_get_height (cogl_texture); + pixel_format = cogl_texture_get_format (cogl_texture); priv->local_data_has_alpha = pixel_format & COGL_A_BIT; bpp = priv->local_data_has_alpha ? 4 : 3; @@ -996,7 +1144,7 @@ priv->local_data = g_malloc (priv->local_data_rowstride * priv->local_data_height); - if (cogl_texture_get_data (priv->texture, + if (cogl_texture_get_data (cogl_texture, priv->local_data_has_alpha ? COGL_PIXEL_FORMAT_RGBA_8888 : COGL_PIXEL_FORMAT_RGB_888, @@ -1026,11 +1174,63 @@ priv->local_data_rowstride, priv->local_data_has_alpha ? 4: 3, 0, NULL); - + g_free (priv->local_data); priv->local_data = NULL; } +#if EXPOSE_COGL_MATERIAL_PROP +/** + * clutter_texture_get_cogl_material: + * @texture: A #ClutterTexture + * + * Returns a handle to the underlying COGL material used for drawing + * the actor. No extra reference is taken so if you need to keep the + * handle then you should call cogl_material_ref on it. + * + * Since: 1.0 + * + * Return value: COGL material handle + */ +CoglHandle +clutter_texture_get_cogl_material (ClutterTexture *texture) +{ + return texture->priv->material; +} + +/** + * clutter_texture_set_cogl_material: + * @texture: A #ClutterTexture + * @cogl_material: A CoglHandle for a material + * + * Replaces the underlying COGL texture drawn by this actor with + * @cogl_tex. A reference to the texture is taken so if the handle is + * no longer needed it should be deref'd with cogl_texture_unref. + * + * Since: 0.8 + * + */ +void +clutter_texture_set_cogl_material (ClutterTexture *texture, + CoglHandle cogl_material) +{ + CoglHandle cogl_texture; + + /* This */ + if (texture->priv->material) + cogl_material_unref (texture->priv->material); + + texture->priv->material = cogl_material; + + /* XXX: We are re-asserting the first layer of the new material to ensure the + * priv state is in sync with the contents of the material. */ + cogl_texture = clutter_texture_get_cogl_texture (texture); + clutter_texture_set_cogl_texture (texture, cogl_texture); + /* XXX: If we add support for more material layers, this will need + * extending */ +} +#endif + /** * clutter_texture_get_cogl_texture * @texture: A #ClutterTexture @@ -1046,9 +1246,17 @@ CoglHandle clutter_texture_get_cogl_texture (ClutterTexture *texture) { + const GList *layers; + int n_layers; + g_return_val_if_fail (CLUTTER_IS_TEXTURE (texture), COGL_INVALID_HANDLE); - return texture->priv->texture; + layers = cogl_material_get_layers (texture->priv->material); + n_layers = g_list_length ((GList *)layers); + if (n_layers == 0) + return COGL_INVALID_HANDLE; + + return cogl_material_layer_get_texture (layers->data); } /** @@ -1088,7 +1296,8 @@ /* Remove old texture */ texture_free_gl_resources (texture); /* Use the new texture */ - priv->texture = cogl_tex; + + cogl_material_set_layer (priv->material, 0, cogl_tex); size_change = width != priv->width || height != priv->height; priv->width = width; @@ -1106,7 +1315,8 @@ priv->width, priv->height); - clutter_actor_queue_relayout (CLUTTER_ACTOR (texture)); + if (priv->sync_actor_size) + clutter_actor_queue_relayout (CLUTTER_ACTOR (texture)); } /* rename signal */ @@ -1129,19 +1339,25 @@ gint bpp, GError **error) { - CoglHandle new_texture; - ClutterTexturePrivate *priv; - - priv = texture->priv; + ClutterTexturePrivate *priv = texture->priv; + CoglHandle new_texture = COGL_INVALID_HANDLE; + CoglTextureFlags flags = COGL_TEXTURE_NONE; + gint max_waste = -1; + + if (!priv->no_slice) + max_waste = priv->max_tile_waste; + + if (priv->filter_quality == CLUTTER_TEXTURE_QUALITY_HIGH) + flags |= COGL_TEXTURE_AUTO_MIPMAP; + + new_texture = cogl_texture_new_from_data (width, height, + max_waste, flags, + source_format, + COGL_PIXEL_FORMAT_ANY, + rowstride, + data); - if ((new_texture = cogl_texture_new_from_data - (width, height, - priv->no_slice ? -1 : priv->max_tile_waste, - priv->filter_quality == CLUTTER_TEXTURE_QUALITY_HIGH, - source_format, - COGL_PIXEL_FORMAT_ANY, - rowstride, - data)) == COGL_INVALID_HANDLE) + if (G_UNLIKELY (new_texture == COGL_INVALID_HANDLE)) { g_set_error (error, CLUTTER_TEXTURE_ERROR, CLUTTER_TEXTURE_ERROR_BAD_FORMAT, @@ -1158,6 +1374,8 @@ cogl_texture_unref (new_texture); + g_signal_emit (texture, texture_signals[LOAD_FINISHED], 0, error); + return TRUE; } @@ -1169,7 +1387,7 @@ * @width: Width in pixels of image data. * @height: Height in pixels of image data * @rowstride: Distance in bytes between row starts. - * @bpp: bytes per pixel (Currently only 3 and 4 supported, + * @bpp: bytes per pixel (Currently only 3 and 4 supported, * depending on @has_alpha) * @flags: #ClutterTextureFlags * @error: return location for a #GError, or %NULL. @@ -1251,15 +1469,15 @@ * * Return value: %TRUE if the texture was successfully updated * - * Since 0.4. - **/ + * Since: 0.4 + */ gboolean -clutter_texture_set_from_yuv_data (ClutterTexture *texture, - const guchar *data, - gint width, - gint height, - ClutterTextureFlags flags, - GError **error) +clutter_texture_set_from_yuv_data (ClutterTexture *texture, + const guchar *data, + gint width, + gint height, + ClutterTextureFlags flags, + GError **error) { ClutterTexturePrivate *priv; @@ -1291,6 +1509,188 @@ error); } +/* + * clutter_texture_async_load_complete: + * @self: a #ClutterTexture + * @error: load error + * + * If @error is %NULL, loads the #CoglBitmap into a #CoglTexture. + * + * This function emits the ::load-finished signal on @self. + */ +static void +clutter_texture_async_load_complete (ClutterTexture *self, + const GError *error) +{ + ClutterTexturePrivate *priv = self->priv; + CoglHandle handle; + CoglTextureFlags flags = COGL_TEXTURE_NONE; + gint waste = -1; + + if (error == NULL) + { + if (priv->no_slice) + waste = priv->max_tile_waste; + + if (priv->filter_quality == CLUTTER_TEXTURE_QUALITY_HIGH) + flags |= COGL_TEXTURE_AUTO_MIPMAP; + + handle = cogl_texture_new_from_bitmap (priv->load_bitmap, + waste, flags, + COGL_PIXEL_FORMAT_ANY); + clutter_texture_set_cogl_texture (self, handle); + cogl_texture_unref (handle); + + cogl_bitmap_free (priv->load_bitmap); + priv->load_bitmap = NULL; + } + + g_signal_emit (self, texture_signals[LOAD_FINISHED], 0, error); + + clutter_actor_queue_relayout (CLUTTER_ACTOR (self)); +} + +static gboolean +clutter_texture_thread_cb (gpointer data) +{ + ClutterTexture *self = data; + ClutterTexturePrivate *priv = self->priv; + + priv->load_idle = 0; + + if (priv->load_thread) + { + g_thread_join (priv->load_thread); + priv->load_thread = NULL; + } + else + return FALSE; + + clutter_texture_async_load_complete (self, priv->load_error); + + if (priv->load_error) + { + g_error_free (priv->load_error); + priv->load_error = NULL; + } + + return FALSE; +} + +static gpointer +clutter_texture_thread_func (gpointer data) +{ + ClutterTexture *self = data; + ClutterTexturePrivate *priv = self->priv; + + /* Try loading with imaging backend */ + priv->load_bitmap = cogl_bitmap_new_from_file (priv->load_filename, + &priv->load_error); + g_free (priv->load_filename); + priv->load_filename = NULL; + + /* make sure we load the image in the main thread, where we + * hold the main Clutter lock + */ + priv->load_idle = + clutter_threads_add_idle (clutter_texture_thread_cb, self); + + return NULL; +} + +static gboolean +clutter_texture_idle_func (gpointer data) +{ + ClutterTexture *self = data; + ClutterTexturePrivate *priv = self->priv; + GError *internal_error; + + internal_error = NULL; + priv->load_bitmap = cogl_bitmap_new_from_file (priv->load_filename, + &internal_error); + + clutter_texture_async_load_complete (self, internal_error); + + g_free (priv->load_filename); + priv->load_filename = NULL; + + if (internal_error) + g_error_free (internal_error); + + return FALSE; +} + +/* + * clutter_texture_async_load: + * @self: a #ClutterTexture + * @error: return location for a #GError + * + * Starts an asynchronous load of the file name stored inside + * the load_filename private member. + * + * If threading is enabled we use a GThread to perform the actual + * I/O; if threading is not enabled, we use an idle GSource. + * + * The I/O is the only bit done in a thread -- uploading the + * texture data to the GL pipeline must be done from within the + * same thread that called clutter_main(). Threaded upload should + * be part of the GL implementation. + * + * This function will block until we get a size from the file + * so that we can effectively get the size the texture actor after + * clutter_texture_set_from_file(). + * + * Return value: %TRUE if the asynchronous loading was successfully + * initiated, %FALSE otherwise + */ +static gboolean +clutter_texture_async_load (ClutterTexture *self, + GError **error) +{ + ClutterTexturePrivate *priv = self->priv; + gint width, height; + gboolean res; + + g_assert (priv->load_filename != NULL); + + /* ask the file for a size; if we cannot get the size then + * there's no point in even continuing the asynchronous + * loading, so we just stop there + */ + res = cogl_bitmap_get_size_from_file (priv->load_filename, + &width, + &height); + if (!res) + { + g_set_error (error, CLUTTER_TEXTURE_ERROR, + CLUTTER_TEXTURE_ERROR_BAD_FORMAT, + "Failed to create COGL texture"); + return FALSE; + } + else + { + priv->width = width; + priv->height = height; + } + + if (g_thread_supported ()) + { + priv->load_thread = + g_thread_create ((GThreadFunc) clutter_texture_thread_func, + self, TRUE, + error); + + return priv->load_thread != NULL? TRUE : FALSE; + } + else + { + priv->load_idle = + clutter_threads_add_idle (clutter_texture_idle_func, self); + + return TRUE; + } +} + /** * clutter_texture_set_from_file: * @texture: A #ClutterTexture @@ -1300,6 +1700,12 @@ * Sets the #ClutterTexture image data from an image file. In case of * failure, %FALSE is returned and @error is set. * + * If #ClutterTexture:load-async is set to %TRUE, this function + * will return as soon as possible, and the actual image loading + * from disk will be performed asynchronously. #ClutterTexture::load-finished + * will be emitted when the image has been loaded or if an error + * occurred. + * * Return value: %TRUE if the image was successfully loaded and set * * Since: 0.8 @@ -1309,28 +1715,48 @@ const gchar *filename, GError **error) { - CoglHandle new_texture; - ClutterTexturePrivate *priv; + ClutterTexturePrivate *priv; + CoglHandle new_texture = COGL_INVALID_HANDLE; + GError *internal_error = NULL; + CoglTextureFlags flags = COGL_TEXTURE_NONE; + gint max_waste = -1; priv = texture->priv; g_return_val_if_fail (error == NULL || *error == NULL, FALSE); - if ((new_texture = cogl_texture_new_from_file - (filename, - priv->no_slice ? -1 : priv->max_tile_waste, - priv->filter_quality == CLUTTER_TEXTURE_QUALITY_HIGH, - COGL_PIXEL_FORMAT_ANY, - error)) - == COGL_INVALID_HANDLE) + if (priv->load_async) + { + clutter_texture_async_load_cancel (texture); + + priv->load_filename = g_strdup (filename); + + return clutter_texture_async_load (texture, error); + } + + if (priv->no_slice) + max_waste = priv->max_tile_waste; + + if (priv->filter_quality == CLUTTER_TEXTURE_QUALITY_HIGH) + flags |= COGL_TEXTURE_AUTO_MIPMAP; + + new_texture = cogl_texture_new_from_file (filename, + max_waste, flags, + COGL_PIXEL_FORMAT_ANY, + &internal_error); + if (new_texture == COGL_INVALID_HANDLE) { /* If COGL didn't give an error then make one up */ - if (error && *error == NULL) + if (internal_error == NULL) { g_set_error (error, CLUTTER_TEXTURE_ERROR, CLUTTER_TEXTURE_ERROR_BAD_FORMAT, "Failed to create COGL texture"); } + else + g_propagate_error (error, internal_error); + + g_signal_emit (texture, texture_signals[LOAD_FINISHED], 0, error); return FALSE; } @@ -1343,6 +1769,8 @@ cogl_texture_unref (new_texture); + g_signal_emit (texture, texture_signals[LOAD_FINISHED], 0, error); + return TRUE; } @@ -1377,11 +1805,12 @@ if (filter_quality != old_quality) { + CoglHandle cogl_texture = clutter_texture_get_cogl_texture (texture); priv->filter_quality = filter_quality; /* Is this actually needed - causes problems with TFP mipmaps */ - if (priv->texture != COGL_INVALID_HANDLE) - cogl_texture_set_filters (priv->texture, + if (cogl_texture != COGL_INVALID_HANDLE) + cogl_texture_set_filters (cogl_texture, clutter_texture_quality_to_cogl_min_filter (priv->filter_quality), clutter_texture_quality_to_cogl_mag_filter (priv->filter_quality)); @@ -1449,15 +1878,17 @@ gint max_tile_waste) { ClutterTexturePrivate *priv; + CoglHandle cogl_texture; g_return_if_fail (CLUTTER_IS_TEXTURE (texture)); priv = texture->priv; + cogl_texture = clutter_texture_get_cogl_texture (texture); /* There's no point in changing the max_tile_waste if the texture has already been created because it will be overridden with the value from the texture handle */ - if (priv->texture == COGL_INVALID_HANDLE) + if (cogl_texture == COGL_INVALID_HANDLE) priv->max_tile_waste = max_tile_waste; } @@ -1477,17 +1908,19 @@ clutter_texture_get_max_tile_waste (ClutterTexture *texture) { ClutterTexturePrivate *priv; + CoglHandle cogl_texture; g_return_val_if_fail (CLUTTER_IS_TEXTURE (texture), 0); priv = texture->priv; + cogl_texture = clutter_texture_get_cogl_texture (texture); - if (priv->texture == COGL_INVALID_HANDLE) + if (cogl_texture == COGL_INVALID_HANDLE) return texture->priv->max_tile_waste; else /* If we have a valid texture handle then use the value from that instead */ - return cogl_texture_get_max_waste (texture->priv->texture); + return cogl_texture_get_max_waste (cogl_texture); } /** @@ -1575,7 +2008,7 @@ * @width: Width in pixels of region to update. * @height: Height in pixels of region to update. * @rowstride: Distance in bytes between row starts on source buffer. - * @bpp: bytes per pixel (Currently only 3 and 4 supported, + * @bpp: bytes per pixel (Currently only 3 and 4 supported, * depending on @has_alpha) * @flags: #ClutterTextureFlags * @error: return location for a #GError, or %NULL @@ -1584,7 +2017,7 @@ * * Return value: %TRUE on success, %FALSE on failure. * - * Since 0.6. + * Since: 0.6 */ gboolean clutter_texture_set_area_from_rgb_data (ClutterTexture *texture, @@ -1601,6 +2034,7 @@ { ClutterTexturePrivate *priv; CoglPixelFormat source_format; + CoglHandle cogl_texture; priv = texture->priv; @@ -1633,7 +2067,8 @@ clutter_actor_realize (CLUTTER_ACTOR (texture)); - if (priv->texture == COGL_INVALID_HANDLE) + cogl_texture = clutter_texture_get_cogl_texture (texture); + if (cogl_texture == COGL_INVALID_HANDLE) { g_set_error (error, CLUTTER_TEXTURE_ERROR, CLUTTER_TEXTURE_ERROR_BAD_FORMAT, @@ -1641,7 +2076,7 @@ return FALSE; } - if (!cogl_texture_set_region (priv->texture, + if (!cogl_texture_set_region (cogl_texture, 0, 0, x, y, width, height, width, height, @@ -1676,25 +2111,31 @@ if (w != priv->width || h != priv->height) { + CoglTextureFlags flags = COGL_TEXTURE_NONE; + /* tear down the FBO */ cogl_offscreen_unref (priv->fbo_handle); texture_free_gl_resources (texture); - priv->width = w; - priv->height = h; + priv->width = w; + priv->height = h; + + if (priv->filter_quality == CLUTTER_TEXTURE_QUALITY_HIGH) + flags |= COGL_TEXTURE_AUTO_MIPMAP; - priv->texture = cogl_texture_new_with_size (MAX (priv->width, 1), - MAX (priv->height, 1), - -1, - priv->filter_quality == CLUTTER_TEXTURE_QUALITY_HIGH, - COGL_PIXEL_FORMAT_RGBA_8888); + priv->fbo_texture = + cogl_texture_new_with_size (MAX (priv->width, 1), + MAX (priv->height, 1), + -1, + flags, + COGL_PIXEL_FORMAT_RGBA_8888); - cogl_texture_set_filters (priv->texture, + cogl_texture_set_filters (priv->fbo_texture, clutter_texture_quality_to_cogl_min_filter (priv->filter_quality), clutter_texture_quality_to_cogl_mag_filter (priv->filter_quality)); - priv->fbo_handle = cogl_offscreen_new_to_texture (priv->texture); + priv->fbo_handle = cogl_offscreen_new_to_texture (priv->fbo_texture); if (priv->fbo_handle == COGL_INVALID_HANDLE) { @@ -1704,7 +2145,7 @@ return; } - clutter_actor_set_size (CLUTTER_ACTOR(texture), w, h); + clutter_actor_set_size (CLUTTER_ACTOR (texture), w, h); } } @@ -1734,7 +2175,7 @@ * * Note this function is intented as a utility call for uniformly applying * shaders to groups and other potential visual effects. It requires that - * the %CLUTTER_FEATURE_OFFSCREEN feature is supported by the current backend + * the %CLUTTER_FEATURE_OFFSCREEN feature is supported by the current backend * and the target system. * * Some tips on usage: @@ -1827,7 +2268,7 @@ return NULL; /* Hopefully now were good.. */ - texture = g_object_new (CLUTTER_TYPE_TEXTURE, + texture = g_object_new (CLUTTER_TYPE_TEXTURE, "disable-slicing", TRUE, NULL); @@ -1879,9 +2320,9 @@ priv->width = w; priv->height = h; - clutter_actor_set_size (CLUTTER_ACTOR(texture), priv->width, priv->height); + clutter_actor_set_size (CLUTTER_ACTOR (texture), priv->width, priv->height); - return CLUTTER_ACTOR(texture); + return CLUTTER_ACTOR (texture); } static void @@ -1938,3 +2379,22 @@ return our_type; } + +#if EXPOSE_COGL_MATERIAL_PROP +GType +clutter_material_handle_get_type (void) +{ + static GType our_type = 0; + + if (G_UNLIKELY (!our_type)) + { + our_type = + g_boxed_type_register_static (I_("ClutterMaterialHandle"), + (GBoxedCopyFunc) cogl_material_ref, + (GBoxedFreeFunc) cogl_material_unref); + } + + return our_type; +} +#endif + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-texture.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-texture.h --- clutter-0.8.4/clutter/clutter-texture.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-texture.h 2009-01-28 16:45:24.000000000 +0000 @@ -21,8 +21,12 @@ * License along with this library. If not, see . */ -#ifndef _HAVE_CLUTTER_TEXTURE_H -#define _HAVE_CLUTTER_TEXTURE_H +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_TEXTURE_H__ +#define __CLUTTER_TEXTURE_H__ #include #include @@ -37,6 +41,7 @@ #define CLUTTER_TEXTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_TEXTURE, ClutterTextureClass)) #define CLUTTER_TYPE_TEXTURE_HANDLE (clutter_texture_handle_get_type ()) +#define CLUTTER_TYPE_MATERIAL_HANDLE (clutter_material_handle_get_type ()) /** * ClutterTextureError: @@ -76,10 +81,12 @@ { ClutterActorClass parent_class; - void (*size_change) (ClutterTexture *texture, - gint width, + void (*size_change) (ClutterTexture *texture, + gint width, gint height); void (*pixbuf_change) (ClutterTexture *texture); + void (*load_finished) (ClutterTexture *texture, + GError *error); /*< private >*/ /* padding, for future expansion */ @@ -88,7 +95,6 @@ void (*_clutter_texture3) (void); void (*_clutter_texture4) (void); void (*_clutter_texture5) (void); - void (*_clutter_texture6) (void); }; /** @@ -131,6 +137,7 @@ GType clutter_texture_get_type (void) G_GNUC_CONST; GType clutter_texture_handle_get_type (void) G_GNUC_CONST; +GType clutter_material_handle_get_type (void) G_GNUC_CONST; ClutterActor * clutter_texture_new (void); ClutterActor * clutter_texture_new_from_file (const gchar *filename, @@ -177,7 +184,10 @@ CoglHandle clutter_texture_get_cogl_texture (ClutterTexture *texture); void clutter_texture_set_cogl_texture (ClutterTexture *texture, CoglHandle cogl_tex); +CoglHandle clutter_texture_get_cogl_material (ClutterTexture *texture); +void clutter_texture_set_cogl_material (ClutterTexture *texture, + CoglHandle cogl_material); G_END_DECLS -#endif /* _HAVE_CLUTTER_TEXTURE_H */ +#endif /* __CLUTTER_TEXTURE_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-timeline.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-timeline.c --- clutter-0.8.4/clutter/clutter-timeline.c 2008-11-04 16:36:17.000000000 +0000 +++ clutter-0.9.0/clutter/clutter-timeline.c 2009-01-28 16:45:24.000000000 +0000 @@ -40,33 +40,34 @@ * your application. * * One way to visualise a timeline is as a path with marks along its length. - * When creating a timeline of @n_frames via clutter_timeline_new(), then the - * number of frames can be seen as the paths length, and each unit of length - * (each frame) is delimited by a mark. + * When creating a timeline of N frames via clutter_timeline_new(), then the + * number of frames can be seen as the paths length, and each unit of + * length (each frame) is delimited by a mark. * - * For a non looping timeline there will be (n_frames + 1) marks along its + * For a non looping timeline there will be (N frames + 1) marks along its * length. For a looping timeline, the two ends are joined with one mark. * Technically this mark represents two discrete frame numbers, but for a * looping timeline the start and end frame numbers are considered equivalent. * - * When you create a timeline it starts with - * clutter_timeline_get_current_frame() == 0. + * When you create a timeline it will be initialized so that the current + * frame, as returned by clutter_timeline_get_current_frame(), will be 0. * - * After starting a timeline, the first timeout is for current_frame_num == 1 - * (Notably it isn't 0 since there is a delay before the first timeout signals - * so re-asserting the starting frame (0) wouldn't make sense.) - * Notably, this implies that actors you intend to be affected by the - * timeline's progress, should be manually primed/positioned for frame 0 which - * will be displayed before the first timeout. (If you are not careful about + * After starting a timeline, the first timeout is for frame number + * one (notably it isn't zero since there is a delay before the first + * #ClutterTimeline::new-frame signal, so re-asserting the frame number + * zero wouldn't make sense). + * + * This implies that actors you intend to be affected by the timeline's + * progress should be manually primed or positioned for frame zero which + * will be displayed before the first timeout (if you are not careful about * this point you will likely see flashes of incorrect actor state in your - * program) + * program). * - * For a non looping timeline the last timeout would be for - * current_frame_num == @n_frames + * For a non looping timeline the last timeout would be for the number + * of frames in the timeline, as returned by clutter_timeline_get_n_frames(). * - * For a looping timeline the timeout for current_frame_num == @n_frames would - * be followed by a timeout for current_frame_num == 1 (remember frame 0 is - * considered == frame (@n_frames)). + * For a looping timeline the timeout for the last frame would be followed + * by a timeout for frame number 1. * * There may be times when a system is not able to meet the frame rate * requested for a timeline, and in this case the frame number will be @@ -74,9 +75,8 @@ * the time that the timeline was started, not from the time of the last * timeout, so a given timeline should basically elapse in the same - real * world - time on any given system. An invariable here though is that - * current_frame_num == @n_frames will always be signaled, but notably frame 1 - * can be interpolated past and so never signaled. - * + * the last frame will always be signaled, but notably frame number 1 can + * be interpolated past and thus never signaled. */ #ifdef HAVE_CONFIG_H @@ -111,7 +111,7 @@ gint skipped_frames; GTimeVal prev_frame_timeval; - guint msecs_delta; + guint msecs_delta; GHashTable *markers_by_frame; GHashTable *markers_by_name; @@ -148,9 +148,9 @@ LAST_SIGNAL }; -static guint timeline_signals[LAST_SIGNAL] = { 0 }; -static gint timeline_use_pool = -1; -static ClutterTimeoutPool *timeline_pool = NULL; +static guint timeline_signals[LAST_SIGNAL] = { 0, }; +static gint timeline_use_pool = -1; +static ClutterTimeoutPool *timeline_pool = NULL; static inline void timeline_pool_init (void) @@ -254,21 +254,27 @@ case PROP_FPS: clutter_timeline_set_speed (timeline, g_value_get_uint (value)); break; + case PROP_NUM_FRAMES: clutter_timeline_set_n_frames (timeline, g_value_get_uint (value)); break; + case PROP_LOOP: priv->loop = g_value_get_boolean (value); break; + case PROP_DELAY: priv->delay = g_value_get_uint (value); break; + case PROP_DURATION: clutter_timeline_set_duration (timeline, g_value_get_uint (value)); break; + case PROP_DIRECTION: clutter_timeline_set_direction (timeline, g_value_get_enum (value)); break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -292,21 +298,27 @@ case PROP_FPS: g_value_set_uint (value, priv->fps); break; + case PROP_NUM_FRAMES: g_value_set_uint (value, priv->n_frames); break; + case PROP_LOOP: g_value_set_boolean (value, priv->loop); break; + case PROP_DELAY: g_value_set_uint (value, priv->delay); break; + case PROP_DURATION: g_value_set_uint (value, clutter_timeline_get_duration (timeline)); break; + case PROP_DIRECTION: g_value_set_enum (value, priv->direction); break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -318,8 +330,11 @@ { ClutterTimelinePrivate *priv = CLUTTER_TIMELINE (object)->priv; - g_hash_table_destroy (priv->markers_by_frame); - g_hash_table_destroy (priv->markers_by_name); + if (priv->markers_by_frame) + g_hash_table_destroy (priv->markers_by_frame); + + if (priv->markers_by_name) + g_hash_table_destroy (priv->markers_by_name); G_OBJECT_CLASS (clutter_timeline_parent_class)->finalize (object); } @@ -351,6 +366,7 @@ clutter_timeline_class_init (ClutterTimelineClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); + GParamSpec *pspec; timeline_pool_init (); @@ -364,42 +380,45 @@ /** * ClutterTimeline:fps: * - * Timeline frames per second. Because of the nature of the main - * loop used by Clutter this is to be considered a best approximation. + * Number of frames per second. Because of the nature of the main + * loop used by Clutter, we can only accept a granularity of one + * frame per millisecond. + * + * This value is to be considered a best approximation. */ - g_object_class_install_property (object_class, - PROP_FPS, - g_param_spec_uint ("fps", - "Frames Per Second", - "Timeline frames per second", - 1, 1000, - 60, - CLUTTER_PARAM_READWRITE)); + pspec = g_param_spec_uint ("fps", + "Frames Per Second", + "Frames per second", + 1, 1000, + 60, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (object_class, PROP_FPS, pspec); + /** * ClutterTimeline:num-frames: * * Total number of frames for the timeline. */ - g_object_class_install_property (object_class, - PROP_NUM_FRAMES, - g_param_spec_uint ("num-frames", - "Total number of frames", - "Timelines total number of frames", - 1, G_MAXUINT, - 1, - CLUTTER_PARAM_READWRITE)); + pspec = g_param_spec_uint ("num-frames", + "Total number of frames", + "Total number of frames", + 1, G_MAXUINT, + 1, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (object_class, PROP_NUM_FRAMES, pspec); + /** * ClutterTimeline:loop: * * Whether the timeline should automatically rewind and restart. */ - g_object_class_install_property (object_class, - PROP_LOOP, - g_param_spec_boolean ("loop", - "Loop", - "Should the timeline automatically restart", - FALSE, - CLUTTER_PARAM_READWRITE)); + pspec = g_param_spec_boolean ("loop", + "Loop", + "Should the timeline automatically restart", + FALSE, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (object_class, PROP_LOOP, pspec); + /** * ClutterTimeline:delay: * @@ -408,14 +427,14 @@ * * Since: 0.4 */ - g_object_class_install_property (object_class, - PROP_DELAY, - g_param_spec_uint ("delay", - "Delay", - "Delay before start", - 0, G_MAXUINT, - 0, - CLUTTER_PARAM_READWRITE)); + pspec = g_param_spec_uint ("delay", + "Delay", + "Delay before start", + 0, G_MAXUINT, + 0, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (object_class, PROP_DELAY, pspec); + /** * ClutterTimeline:duration: * @@ -424,14 +443,14 @@ * * Since: 0.6 */ - g_object_class_install_property (object_class, - PROP_DURATION, - g_param_spec_uint ("duration", - "Duration", - "Duration of the timeline in milliseconds", - 0, G_MAXUINT, - 1000, - CLUTTER_PARAM_READWRITE)); + pspec = g_param_spec_uint ("duration", + "Duration", + "Duration of the timeline in milliseconds", + 0, G_MAXUINT, + 1000, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (object_class, PROP_DURATION, pspec); + /** * ClutterTimeline:direction: * @@ -440,14 +459,13 @@ * * Since: 0.6 */ - g_object_class_install_property (object_class, - PROP_DIRECTION, - g_param_spec_enum ("direction", - "Direction", - "Direction of the timeline", - CLUTTER_TYPE_TIMELINE_DIRECTION, - CLUTTER_TIMELINE_FORWARD, - CLUTTER_PARAM_READWRITE)); + pspec = g_param_spec_enum ("direction", + "Direction", + "Direction of the timeline", + CLUTTER_TYPE_TIMELINE_DIRECTION, + CLUTTER_TIMELINE_FORWARD, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (object_class, PROP_DIRECTION, pspec); /** * ClutterTimeline::new-frame: @@ -459,7 +477,7 @@ * timeline is reached. */ timeline_signals[NEW_FRAME] = - g_signal_new ("new-frame", + g_signal_new (I_("new-frame"), G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ClutterTimelineClass, new_frame), @@ -475,7 +493,7 @@ * number of frames specified by the ClutterTimeline:num-frames property. */ timeline_signals[COMPLETED] = - g_signal_new ("completed", + g_signal_new (I_("completed"), G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ClutterTimelineClass, completed), @@ -492,7 +510,7 @@ * expired. */ timeline_signals[STARTED] = - g_signal_new ("started", + g_signal_new (I_("started"), G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ClutterTimelineClass, started), @@ -506,7 +524,7 @@ * The ::paused signal is emitted when clutter_timeline_pause() is invoked. */ timeline_signals[PAUSED] = - g_signal_new ("paused", + g_signal_new (I_("paused"), G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ClutterTimelineClass, paused), @@ -545,9 +563,10 @@ * Since: 0.8 */ timeline_signals[MARKER_REACHED] = - g_signal_new ("marker-reached", + g_signal_new (I_("marker-reached"), G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_DETAILED | G_SIGNAL_NO_HOOKS, + G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | + G_SIGNAL_DETAILED | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (ClutterTimelineClass, marker_reached), NULL, NULL, clutter_marshal_VOID__STRING_INT, @@ -561,18 +580,13 @@ { ClutterTimelinePrivate *priv; - self->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (self, - CLUTTER_TYPE_TIMELINE, - ClutterTimelinePrivate); + self->priv = priv = + G_TYPE_INSTANCE_GET_PRIVATE (self, CLUTTER_TYPE_TIMELINE, + ClutterTimelinePrivate); priv->fps = clutter_get_default_frame_rate (); priv->n_frames = 0; priv->msecs_delta = 0; - - priv->markers_by_frame = g_hash_table_new (NULL, NULL); - priv->markers_by_name = g_hash_table_new_full (g_str_hash, g_str_equal, - NULL, - timeline_marker_free); } static void @@ -584,12 +598,18 @@ g_signal_emit (timeline, timeline_signals[NEW_FRAME], 0, priv->current_frame_num); + /* shortcircuit here if we don't have any marker installed */ + if (priv->markers_by_name == NULL || + priv->markers_by_frame == NULL) + return; + for (i = priv->skipped_frames; i >= 0; i--) { - gint frame_num = priv->current_frame_num - + (priv->direction == CLUTTER_TIMELINE_FORWARD ? -i : i); + gint frame_num; GSList *markers, *l; + frame_num = priv->current_frame_num + + (priv->direction == CLUTTER_TIMELINE_FORWARD ? -i : i); markers = g_hash_table_lookup (priv->markers_by_frame, GUINT_TO_POINTER (frame_num)); for (l = markers; l; l = l->next) @@ -607,12 +627,23 @@ } static gboolean +is_complete (ClutterTimeline *timeline) +{ + ClutterTimelinePrivate *priv = timeline->priv; + + return ((priv->direction == CLUTTER_TIMELINE_FORWARD) && + (priv->current_frame_num >= priv->n_frames)) || + ((priv->direction == CLUTTER_TIMELINE_BACKWARD) && + (priv->current_frame_num <= 0)); +} + +static gboolean timeline_timeout_func (gpointer data) { ClutterTimeline *timeline = data; ClutterTimelinePrivate *priv; GTimeVal timeval; - guint n_frames; + guint n_frames, speed; gulong msecs; priv = timeline->priv; @@ -639,7 +670,11 @@ msecs = (timeval.tv_sec - priv->prev_frame_timeval.tv_sec) * 1000; msecs += (timeval.tv_usec - priv->prev_frame_timeval.tv_usec) / 1000; priv->msecs_delta = msecs; - n_frames = msecs / (1000 / priv->fps); + + /* we need to avoid fps > 1000 */ + speed = MAX (1000 / priv->fps, 1); + + n_frames = msecs / speed; if (n_frames == 0) n_frames = 1; @@ -660,12 +695,7 @@ priv->current_frame_num -= n_frames; /* If we have not reached the end of the timeline: */ - if (!( - ((priv->direction == CLUTTER_TIMELINE_FORWARD) && - (priv->current_frame_num >= priv->n_frames)) || - ((priv->direction == CLUTTER_TIMELINE_BACKWARD) && - (priv->current_frame_num <= 0)) - )) + if (!is_complete (timeline)) { /* Emit the signal */ emit_frame_signal (timeline); @@ -728,7 +758,7 @@ /* We remove the timeout now, so that the completed signal handler * may choose to re-start the timeline * - * ** Perhaps we should remove this earlier, and regardless + * XXX Perhaps we should remove this earlier, and regardless * of priv->loop. Are we limiting the things that could be done in * the above new-frame signal handler */ timeout_remove (priv->timeout_id); @@ -784,10 +814,10 @@ static guint timeline_timeout_add (ClutterTimeline *timeline, - guint interval, - GSourceFunc func, - gpointer data, - GDestroyNotify notify) + guint interval, + GSourceFunc func, + gpointer data, + GDestroyNotify notify) { ClutterTimelinePrivate *priv; GTimeVal timeval; @@ -799,6 +829,7 @@ g_get_current_time (&timeval); priv->prev_frame_timeval = timeval; } + priv->skipped_frames = 0; priv->msecs_delta = 0; @@ -949,9 +980,9 @@ * @timeline: A #ClutterTimeline * * Rewinds #ClutterTimeline to the first frame if its direction is - * CLUTTER_TIMELINE_FORWARD and the last frame if it is - * CLUTTER_TIMELINE_BACKWARD. - **/ + * %CLUTTER_TIMELINE_FORWARD and the last frame if it is + * %CLUTTER_TIMELINE_BACKWARD. + */ void clutter_timeline_rewind (ClutterTimeline *timeline) { @@ -972,8 +1003,8 @@ * @timeline: A #ClutterTimeline * @n_frames: Number of frames to skip * - * Advance timeline by requested number of frames. - **/ + * Advance timeline by the requested number of frames. + */ void clutter_timeline_skip (ClutterTimeline *timeline, guint n_frames) @@ -1005,8 +1036,13 @@ * @timeline: A #ClutterTimeline * @frame_num: Frame number to advance to * - * Advance timeline to requested frame number - **/ + * Advance timeline to the requested frame number. + * + * The @timeline will not emit the #ClutterTimeline::new-frame + * signal for @frame_num. The first ::new-frame signal after the call to + * clutter_timeline_advance() will be emitted for a frame following + * @frame_num. + */ void clutter_timeline_advance (ClutterTimeline *timeline, guint frame_num) @@ -1026,8 +1062,8 @@ * * Request the current frame number of the timeline. * - * Return Value: current frame number - **/ + * Return value: current frame number + */ gint clutter_timeline_get_current_frame (ClutterTimeline *timeline) { @@ -1042,8 +1078,8 @@ * * Request the total number of frames for the #ClutterTimeline. * - * Return Value: Number of frames for this #ClutterTimeline. - **/ + * Return value: the number of frames + */ guint clutter_timeline_get_n_frames (ClutterTimeline *timeline) { @@ -1072,8 +1108,6 @@ if (priv->n_frames != n_frames) { - g_object_ref (timeline); - g_object_freeze_notify (G_OBJECT (timeline)); priv->n_frames = n_frames; @@ -1082,17 +1116,17 @@ g_object_notify (G_OBJECT (timeline), "duration"); g_object_thaw_notify (G_OBJECT (timeline)); - g_object_unref (timeline); } } /** * clutter_timeline_set_speed: * @timeline: A #ClutterTimeline - * @fps: New speed of timeline as frames per second + * @fps: New speed of timeline as frames per second, + * between 1 and 1000 * - * Set the speed in frames per second of the timeline. - **/ + * Sets the speed of @timeline in frames per second. + */ void clutter_timeline_set_speed (ClutterTimeline *timeline, guint fps) @@ -1100,7 +1134,7 @@ ClutterTimelinePrivate *priv; g_return_if_fail (CLUTTER_IS_TIMELINE (timeline)); - g_return_if_fail (fps > 0); + g_return_if_fail (fps > 0 && fps <= 1000); priv = timeline->priv; @@ -1152,9 +1186,9 @@ * clutter_timeline_is_playing: * @timeline: A #ClutterTimeline * - * Query state of a #ClutterTimeline instance. + * Queries state of a #ClutterTimeline. * - * Return Value: TRUE if timeline is currently playing, FALSE if not. + * Return value: %TRUE if timeline is currently playing */ gboolean clutter_timeline_is_playing (ClutterTimeline *timeline) @@ -1175,7 +1209,7 @@ * * Return Value: a new #ClutterTimeline, cloned from @timeline * - * Since 0.4 + * Since: 0.4 */ ClutterTimeline * clutter_timeline_clone (ClutterTimeline *timeline) @@ -1229,7 +1263,7 @@ guint fps) { g_return_val_if_fail (n_frames > 0, NULL); - g_return_val_if_fail (fps > 0, NULL); + g_return_val_if_fail (fps > 0 && fps <= 1000, NULL); return g_object_new (CLUTTER_TYPE_TIMELINE, "fps", fps, @@ -1329,6 +1363,7 @@ if (n_frames < 1) n_frames = 1; + /* this will notify :duration as well */ clutter_timeline_set_n_frames (timeline, n_frames); } @@ -1370,11 +1405,8 @@ priv = timeline->priv; - progress = clutter_qdivx (CLUTTER_INT_TO_FIXED (priv->current_frame_num), - CLUTTER_INT_TO_FIXED (priv->n_frames)); - - if (priv->direction == CLUTTER_TIMELINE_BACKWARD) - progress = CFX_ONE - progress; + progress = CLUTTER_FIXED_DIV ((float)(priv->current_frame_num), + (float)(priv->n_frames)); return progress; } @@ -1479,6 +1511,16 @@ TimelineMarker *marker; GSList *markers; + /* create the hash tables that will hold the markers */ + if (G_UNLIKELY (priv->markers_by_name == NULL || + priv->markers_by_frame == NULL)) + { + priv->markers_by_name = g_hash_table_new_full (g_str_hash, g_str_equal, + NULL, + timeline_marker_free); + priv->markers_by_frame = g_hash_table_new (NULL, NULL); + } + marker = g_hash_table_lookup (priv->markers_by_name, marker_name); if (G_UNLIKELY (marker)) { @@ -1594,6 +1636,12 @@ priv = timeline->priv; + if (G_UNLIKELY (priv->markers_by_name == NULL || + priv->markers_by_frame == NULL)) + { + return NULL; + } + if (frame_num < 0) { GList *markers, *l; @@ -1631,6 +1679,11 @@ * * Advances @timeline to the frame of the given @marker_name. * + * Like clutter_timeline_advance(), this function will not + * emit the #ClutterTimeline::new-frame for the frame where @marker_name + * is set, nor it will emit #ClutterTimeline::marker-reached for + * @marker_name. + * * Since: 0.8 */ void @@ -1645,6 +1698,13 @@ priv = timeline->priv; + if (G_UNLIKELY (priv->markers_by_name == NULL || + priv->markers_by_frame == NULL)) + { + g_warning ("No marker named `%s' found.", marker_name); + return; + } + marker = g_hash_table_lookup (priv->markers_by_name, marker_name); if (!marker) { @@ -1677,6 +1737,13 @@ priv = timeline->priv; + if (G_UNLIKELY (priv->markers_by_name == NULL || + priv->markers_by_frame == NULL)) + { + g_warning ("No marker named `%s' found.", marker_name); + return; + } + marker = g_hash_table_lookup (priv->markers_by_name, marker_name); if (!marker) { @@ -1731,6 +1798,10 @@ g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), FALSE); g_return_val_if_fail (marker_name != NULL, FALSE); + if (G_UNLIKELY (timeline->priv->markers_by_name == NULL || + timeline->priv->markers_by_frame == NULL)) + return FALSE; + return NULL != g_hash_table_lookup (timeline->priv->markers_by_name, marker_name); } diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-timeline.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-timeline.h --- clutter-0.8.4/clutter/clutter-timeline.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-timeline.h 2009-01-28 08:12:45.000000000 +0000 @@ -18,13 +18,15 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ -#ifndef _HAVE_CLUTTER_TIMELINE_H -#define _HAVE_CLUTTER_TIMELINE_H +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_TIMELINE_H__ +#define __CLUTTER_TIMELINE_H__ #include #include @@ -161,4 +163,4 @@ G_END_DECLS -#endif /* _HAVE_CLUTTER_TIMELINE_H */ +#endif /* _CLUTTER_TIMELINE_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-timeout-pool.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-timeout-pool.h --- clutter-0.8.4/clutter/clutter-timeout-pool.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-timeout-pool.h 2009-01-28 08:12:45.000000000 +0000 @@ -18,9 +18,7 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . * * ClutterTimeoutPool: pool of timeout functions using the same slice of * the GLib main loop @@ -30,6 +28,10 @@ * Based on similar code by Tristan van Berkom */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __CLUTTER_TIMEOUT_POOL_H__ #define __CLUTTER_TIMEOUT_POOL_H__ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-types.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-types.h --- clutter-0.8.4/clutter/clutter-types.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-types.h 2009-01-28 16:45:24.000000000 +0000 @@ -18,11 +18,13 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + #ifndef __CLUTTER_TYPES_H__ #define __CLUTTER_TYPES_H__ @@ -184,6 +186,149 @@ CLUTTER_REQUEST_WIDTH_FOR_HEIGHT } ClutterRequestMode; +/** + * ClutterAnimationMode: + * @CLUTTER_CUSTOM_MODE: custom progress function + * @CLUTTER_LINEAR: linear tweening + * @CLUTTER_EASE_IN_QUAD: quadratic tweening + * @CLUTTER_EASE_OUT_QUAD: quadratic tweening, inverse of + * %CLUTTER_EASE_IN_QUAD + * @CLUTTER_EASE_IN_OUT_QUAD: quadratic tweening, combininig + * %CLUTTER_EASE_IN_QUAD and %CLUTTER_EASE_OUT_QUAD + * @CLUTTER_EASE_IN_CUBIC: cubic tweening + * @CLUTTER_EASE_OUT_CUBIC: cubic tweening, invers of + * %CLUTTER_EASE_IN_CUBIC + * @CLUTTER_EASE_IN_OUT_CUBIC: cubic tweening, combining + * %CLUTTER_EASE_IN_CUBIC and %CLUTTER_EASE_OUT_CUBIC + * @CLUTTER_EASE_IN_QUART: quartic tweening + * @CLUTTER_EASE_OUT_QUART: quartic tweening, inverse of + * %CLUTTER_EASE_IN_QUART + * @CLUTTER_EASE_IN_OUT_QUART: quartic tweening, combining + * %CLUTTER_EASE_IN_QUART and %CLUTTER_EASE_OUT_QUART + * @CLUTTER_EASE_IN_QUINT: quintic tweening + * @CLUTTER_EASE_OUT_QUINT: quintic tweening, inverse of + * %CLUTTER_EASE_IN_QUINT + * @CLUTTER_EASE_IN_OUT_QUINT: fifth power tweening, combining + * %CLUTTER_EASE_IN_QUINT and %CLUTTER_EASE_OUT_QUINT + * @CLUTTER_EASE_IN_SINE: sinusoidal tweening + * @CLUTTER_EASE_OUT_SINE: sinusoidal tweening, inverse of + * %CLUTTER_EASE_IN_SINE + * @CLUTTER_EASE_IN_OUT_SINE: sine wave tweening, combining + * %CLUTTER_EASE_IN_SINE and %CLUTTER_EASE_OUT_SINE + * @CLUTTER_EASE_IN_EXPO: exponential tweening + * @CLUTTER_EASE_OUT_EXPO: exponential tweening, inverse of + * %CLUTTER_EASE_IN_EXPO + * @CLUTTER_EASE_IN_OUT_EXPO: exponential tweening, combining + * %CLUTTER_EASE_IN_EXPO and %CLUTTER_EASE_OUT_EXPO + * @CLUTTER_EASE_IN_CIRC: circular tweening + * @CLUTTER_EASE_OUT_CIRC: circular tweening, inverse of + * %CLUTTER_EASE_IN_CIRC + * @CLUTTER_EASE_IN_OUT_CIRC: circular tweening, combining + * %CLUTTER_EASE_IN_CIRC and %CLUTTER_EASE_OUT_CIRC + * @CLUTTER_EASE_IN_ELASTIC: elastic tweening, with offshoot on start + * @CLUTTER_EASE_OUT_ELASTIC: elastic tweening, with offshoot on end + * @CLUTTER_EASE_IN_OUT_ELASTIC: elastic tweening with offshoot on both ends + * @CLUTTER_EASE_IN_BACK: overshooting cubic tweening, with + * backtracking on start + * @CLUTTER_EASE_OUT_BACK: overshooting cubic tweening, with + * backtracking on end + * @CLUTTER_EASE_IN_OUT_BACK: overshooting cubic tweening, with + * backtracking on both ends + * @CLUTTER_EASE_IN_BOUNCE: exponentially decaying parabolic (bounce) + * tweening, with bounce on start + * @CLUTTER_EASE_OUT_BOUNCE: exponentially decaying parabolic (bounce) + * tweening, with bounce on end + * @CLUTTER_EASE_IN_OUT_BOUNCE: exponentially decaying parabolic (bounce) + * tweening, with bounce on both ends + * @CLUTTER_ANIMATION_LAST: last animation mode, used as a guard for + * registered global alpha functions + * + * The animation modes used by #ClutterAlpha and #ClutterAnimation. This + * enumeration can be expanded in later versions of Clutter. See the + * #ClutterAlpha documentation for a graph of all the animation modes. + * + * Every global alpha function registered using clutter_alpha_register_func() + * or clutter_alpha_register_closure() will have a logical id greater than + * %CLUTTER_ANIMATION_LAST. + * + * Since: 1.0 + */ +typedef enum { + CLUTTER_CUSTOM_MODE = 0, + + /* linear */ + CLUTTER_LINEAR, + + /* quadratic */ + CLUTTER_EASE_IN_QUAD, + CLUTTER_EASE_OUT_QUAD, + CLUTTER_EASE_IN_OUT_QUAD, + + /* cubic */ + CLUTTER_EASE_IN_CUBIC, + CLUTTER_EASE_OUT_CUBIC, + CLUTTER_EASE_IN_OUT_CUBIC, + + /* quartic */ + CLUTTER_EASE_IN_QUART, + CLUTTER_EASE_OUT_QUART, + CLUTTER_EASE_IN_OUT_QUART, + + /* quintic */ + CLUTTER_EASE_IN_QUINT, + CLUTTER_EASE_OUT_QUINT, + CLUTTER_EASE_IN_OUT_QUINT, + + /* sinusoidal */ + CLUTTER_EASE_IN_SINE, + CLUTTER_EASE_OUT_SINE, + CLUTTER_EASE_IN_OUT_SINE, + + /* exponential */ + CLUTTER_EASE_IN_EXPO, + CLUTTER_EASE_OUT_EXPO, + CLUTTER_EASE_IN_OUT_EXPO, + + /* circular */ + CLUTTER_EASE_IN_CIRC, + CLUTTER_EASE_OUT_CIRC, + CLUTTER_EASE_IN_OUT_CIRC, + + /* elastic */ + CLUTTER_EASE_IN_ELASTIC, + CLUTTER_EASE_OUT_ELASTIC, + CLUTTER_EASE_IN_OUT_ELASTIC, + + /* overshooting cubic */ + CLUTTER_EASE_IN_BACK, + CLUTTER_EASE_OUT_BACK, + CLUTTER_EASE_IN_OUT_BACK, + + /* exponentially decaying parabolic */ + CLUTTER_EASE_IN_BOUNCE, + CLUTTER_EASE_OUT_BOUNCE, + CLUTTER_EASE_IN_OUT_BOUNCE, + + /* guard, before registered alpha functions */ + CLUTTER_ANIMATION_LAST +} ClutterAnimationMode; + +/** + * ClutterFontFlags: + * @CLUTTER_FONT_MIPMAPPING: Set to use mipmaps for the glyph cache textures. + * @CLUTTER_FONT_HINTING: Set to enable hinting on the glyphs. + * + * Runtime flags to change the font quality. To be used with + * clutter_set_font_flags(). + * + * Since: 1.0 + */ +typedef enum +{ + CLUTTER_FONT_MIPMAPPING = (1 << 0), + CLUTTER_FONT_HINTING = (1 << 1), +} ClutterFontFlags; + G_END_DECLS #endif /* __CLUTTER_TYPES_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-units.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-units.c --- clutter-0.8.4/clutter/clutter-units.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-units.c 2009-01-28 08:12:45.000000000 +0000 @@ -101,6 +101,81 @@ #include "clutter-units.h" #include "clutter-private.h" +#define DPI_FALLBACK (96.0) + +#define FLOAT_EPSILON (1e-30) + +/** + * clutter_units_mm: + * @mm: millimeters to convert + * + * Converts a value in millimeters to #ClutterUnits at + * the current DPI. + * + * Return value: the value in units + * + * Since: 1.0 + */ +ClutterUnit +clutter_units_mm (gdouble mm) +{ + ClutterBackend *backend; + gdouble dpi; + + backend = clutter_get_default_backend (); + dpi = clutter_backend_get_resolution (backend); + if (dpi < 0) + dpi = DPI_FALLBACK; + + return mm * dpi / 25.4; +} + +/** + * clutter_units_pt: + * @pt: typographic points to convert + * + * Converts a value in typographic points to #ClutterUnits + * at the current DPI. + * + * Return value: the value in units + * + * Since: 1.0 + */ +ClutterUnit +clutter_units_pt (gdouble pt) +{ + ClutterBackend *backend; + gdouble dpi; + + backend = clutter_get_default_backend (); + dpi = clutter_backend_get_resolution (backend); + if (dpi < 0) + dpi = DPI_FALLBACK; + + return pt * dpi / 72.0; +} + +/** + * clutter_units_em: + * @em: em to convert + * + * Converts a value in em to #ClutterUnits at the + * current DPI. + * + * Return value: the value in units + * + * Since: 1.0 + */ +ClutterUnit +clutter_units_em (gdouble em) +{ + ClutterBackend *backend; + + backend = clutter_get_default_backend (); + + return em * _clutter_backend_get_units_per_em (backend); +} + static GTypeInfo _info = { 0, NULL, @@ -119,14 +194,14 @@ static void clutter_value_init_unit (GValue *value) { - value->data[0].v_int = 0; + value->data[0].v_float = 0.0; } static void clutter_value_copy_unit (const GValue *src, GValue *dest) { - dest->data[0].v_int = src->data[0].v_int; + dest->data[0].v_float = src->data[0].v_float; } static gchar * @@ -135,7 +210,7 @@ GTypeCValue *collect_values, guint collect_flags) { - value->data[0].v_int = collect_values[0].v_int; + value->data[0].v_float = collect_values[0].v_double; return NULL; } @@ -146,13 +221,13 @@ GTypeCValue *collect_values, guint collect_flags) { - gint32 *units_p = collect_values[0].v_pointer; + gfloat *units_p = collect_values[0].v_pointer; if (!units_p) return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); - *units_p = value->data[0].v_int; + *units_p = value->data[0].v_float; return NULL; } @@ -161,14 +236,14 @@ clutter_value_transform_unit_int (const GValue *src, GValue *dest) { - dest->data[0].v_int = CLUTTER_UNITS_TO_INT (src->data[0].v_int); + dest->data[0].v_int = CLUTTER_UNITS_TO_INT (src->data[0].v_float); } static void clutter_value_transform_int_unit (const GValue *src, GValue *dest) { - dest->data[0].v_int = CLUTTER_UNITS_FROM_INT (src->data[0].v_int); + dest->data[0].v_float = CLUTTER_UNITS_FROM_INT (src->data[0].v_int); } static const GTypeValueTable _clutter_unit_value_table = { @@ -176,7 +251,7 @@ NULL, clutter_value_copy_unit, NULL, - "i", + "d", clutter_value_collect_unit, "p", clutter_value_lcopy_unit @@ -219,7 +294,7 @@ { g_return_if_fail (CLUTTER_VALUE_HOLDS_UNIT (value)); - value->data[0].v_int = units; + value->data[0].v_float = units; } /** @@ -237,7 +312,7 @@ { g_return_val_if_fail (CLUTTER_VALUE_HOLDS_UNIT (value), 0); - return value->data[0].v_int; + return value->data[0].v_float; } static void @@ -254,7 +329,7 @@ param_unit_set_default (GParamSpec *pspec, GValue *value) { - value->data[0].v_int = CLUTTER_PARAM_SPEC_UNIT (pspec)->default_value; + value->data[0].v_float = CLUTTER_PARAM_SPEC_UNIT (pspec)->default_value; } static gboolean @@ -262,26 +337,15 @@ GValue *value) { ClutterParamSpecUnit *uspec = CLUTTER_PARAM_SPEC_UNIT (pspec); - gint oval = CLUTTER_UNITS_TO_INT (value->data[0].v_int); - gint min, max, val; + gfloat oval = value->data[0].v_float; g_assert (CLUTTER_IS_PARAM_SPEC_UNIT (pspec)); - /* we compare the integer part of the value because the minimum - * and maximum values cover just that part of the representation - */ - min = uspec->minimum; - max = uspec->maximum; - val = CLUTTER_UNITS_TO_INT (value->data[0].v_int); + value->data[0].v_float = CLAMP (value->data[0].v_float, + uspec->minimum, + uspec->maximum); - val = CLAMP (val, min, max); - if (val != oval) - { - value->data[0].v_int = val; - return TRUE; - } - - return FALSE; + return value->data[0].v_float != oval; } static gint @@ -289,10 +353,12 @@ const GValue *value1, const GValue *value2) { - if (value1->data[0].v_int < value2->data[0].v_int) - return -1; + gfloat epsilon = FLOAT_EPSILON; + + if (value1->data[0].v_float < value2->data[0].v_float) + return - (value2->data[0].v_float - value1->data[0].v_float > epsilon); else - return value1->data[0].v_int > value2->data[0].v_int; + return value1->data[0].v_float - value2->data[0].v_float > epsilon; } GType diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-units.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-units.h --- clutter-0.8.4/clutter/clutter-units.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-units.h 2009-01-28 08:12:45.000000000 +0000 @@ -4,9 +4,11 @@ * * An OpenGL based 'interactive canvas' library. * - * Authored By Tomas Frydrych + * Authored By: Tomas Frydrych + * Emmanuele Bassu * - * Copyright (C) 2007 OpenedHand + * Copyright (C) 2007, 2008 OpenedHand + * Copyright (C) 2009 Intel Corp. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,13 +21,15 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ -#ifndef _HAVE_CLUTTER_UNITS_H -#define _HAVE_CLUTTER_UNITS_H +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly.h" +#endif + +#ifndef __CLUTTER_UNITS_H__ +#define __CLUTTER_UNITS_H__ #include #include @@ -40,24 +44,34 @@ * * Since: 0.4 */ -typedef gint32 ClutterUnit; - -/* - * Currently CLUTTER_UNIT maps directly onto ClutterFixed. Nevertheless, the - * _FROM_FIXED and _TO_FIXED macros should always be used in case that we - * decide to change this relationship in the future. - */ +typedef float ClutterUnit; -#define CLUTTER_UNITS_FROM_INT(x) CLUTTER_INT_TO_FIXED ((x)) -#define CLUTTER_UNITS_TO_INT(x) CLUTTER_FIXED_TO_INT ((x)) +#define CLUTTER_UNITS_FROM_INT(x) ((float)(x)) +#define CLUTTER_UNITS_TO_INT(x) ((int)(x)) -#define CLUTTER_UNITS_FROM_FLOAT(x) CLUTTER_FLOAT_TO_FIXED ((x)) -#define CLUTTER_UNITS_TO_FLOAT(x) CLUTTER_FIXED_TO_FLOAT ((x)) +#define CLUTTER_UNITS_FROM_FLOAT(x) (x) +#define CLUTTER_UNITS_TO_FLOAT(x) (x) #define CLUTTER_UNITS_FROM_FIXED(x) (x) #define CLUTTER_UNITS_TO_FIXED(x) (x) /** + * CLUTTER_UNITS_FORMAT: + * + * Format string that should be used for scanning and printing units. + * It is a string literal, but it does not include the percent sign to + * allow precision and length modifiers between the percent sign and + * the format: + * + * |[ + * g_print ("%" CLUTTER_UNITS_FORMAT, units); + * ]| + * + * Since: 1.0 + */ +#define CLUTTER_UNITS_FORMAT "f" + +/** * CLUTTER_UNITS_FROM_DEVICE: * @x: value in pixels * @@ -77,9 +91,6 @@ */ #define CLUTTER_UNITS_TO_DEVICE(x) CLUTTER_UNITS_TO_INT ((x)) -#define CLUTTER_UNITS_TMP_FROM_DEVICE(x) (x) -#define CLUTTER_UNITS_TMP_TO_DEVICE(x) (x) - /** * CLUTTER_UNITS_FROM_PANGO_UNIT: * @x: value in Pango units @@ -88,7 +99,7 @@ * * Since: 0.6 */ -#define CLUTTER_UNITS_FROM_PANGO_UNIT(x) ((x) << 6) +#define CLUTTER_UNITS_FROM_PANGO_UNIT(x) ((float)((x) / 1024)) /** * CLUTTER_UNITS_TO_PANGO_UNIT: @@ -98,19 +109,7 @@ * * Since: 0.6 */ -#define CLUTTER_UNITS_TO_PANGO_UNIT(x) ((x) >> 6) - -#define CLUTTER_UNITS_FROM_STAGE_WIDTH_PERCENTAGE(x) \ - ((clutter_actor_get_widthu (clutter_stage_get_default ()) * x) / 100) - -#define CLUTTER_UNITS_FROM_STAGE_HEIGHT_PERCENTAGE(x) \ - ((clutter_actor_get_heightu (clutter_stage_get_default ()) * x) / 100) - -#define CLUTTER_UNITS_FROM_PARENT_WIDTH_PERCENTAGE(a, x) \ - ((clutter_actor_get_widthu (clutter_actor_get_parent (a)) * x) / 100) - -#define CLUTTER_UNITS_FROM_PARENT_HEIGHT_PERCENTAGE(a, x) \ - ((clutter_actor_get_heightu (clutter_actor_get_parent (a)) * x) / 100) +#define CLUTTER_UNITS_TO_PANGO_UNIT(x) ((int)((x) * 1024)) /** * CLUTTER_UNITS_FROM_MM: @@ -120,11 +119,7 @@ * * Since: 0.6 */ -#define CLUTTER_UNITS_FROM_MM(x) \ - (CLUTTER_UNITS_FROM_FLOAT ((((x) * clutter_stage_get_resolution ((ClutterStage *) clutter_stage_get_default ())) / 25.4))) - -#define CLUTTER_UNITS_FROM_MMX(x) \ - (CFX_DIV (CFX_MUL ((x), clutter_stage_get_resolutionx ((ClutterStage *) clutter_stage_get_default ())), 0x196666)) +#define CLUTTER_UNITS_FROM_MM(x) (clutter_units_mm (x)) /** * CLUTTER_UNITS_FROM_POINTS: @@ -134,11 +129,21 @@ * * Since: 0.6 */ -#define CLUTTER_UNITS_FROM_POINTS(x) \ - CLUTTER_UNITS_FROM_FLOAT ((((x) * clutter_stage_get_resolution ((ClutterStage *) clutter_stage_get_default ())) / 72.0)) +#define CLUTTER_UNITS_FROM_POINTS(x) (clutter_units_pt (x)) + +/** + * CLUTTER_UNITS_FROM_EM: + * @x: a value in em + * + * Converts a value in em into #ClutterUnits + * + * Since: 1.0 + */ +#define CLUTTER_UNITS_FROM_EM(x) (clutter_units_em (x)) -#define CLUTTER_UNITS_FROM_POINTSX(x) \ - (CFX_MUL ((x), clutter_stage_get_resolutionx ((ClutterStage *) clutter_stage_get_default ())) / 72) +ClutterUnit clutter_units_mm (gdouble mm); +ClutterUnit clutter_units_pt (gdouble pt); +ClutterUnit clutter_units_em (gdouble em); #define CLUTTER_TYPE_UNIT (clutter_unit_get_type ()) #define CLUTTER_TYPE_PARAM_UNIT (clutter_param_unit_get_type ()) @@ -152,7 +157,7 @@ * * Since: 0.8 */ -#define CLUTTER_MAXUNIT (0x7fffffff) +#define CLUTTER_MAXUNIT (G_MAXFLOAT) /** * CLUTTER_MINUNIT: @@ -161,7 +166,7 @@ * * Since: 0.8 */ -#define CLUTTER_MINUNIT (0x80000000) +#define CLUTTER_MINUNIT (-G_MAXFLOAT) /** * CLUTTER_VALUE_HOLDS_UNIT: @@ -213,4 +218,4 @@ G_END_DECLS -#endif /* _HAVE_CLUTTER_UNITS_H */ +#endif /* __CLUTTER_UNITS_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-util.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-util.h --- clutter-0.8.4/clutter/clutter-util.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/clutter-util.h 2009-01-28 08:12:45.000000000 +0000 @@ -18,13 +18,15 @@ * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ -#ifndef _HAVE_CLUTTER_UTIL_H -#define _HAVE_CLUTTER_UTIL_H +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_UTIL_H__ +#define __CLUTTER_UTIL_H__ #include diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/clutter-version.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/clutter-version.h --- clutter-0.8.4/clutter/clutter-version.h 2008-12-01 11:36:54.000000000 +0000 +++ clutter-0.9.0/clutter/clutter-version.h 2009-01-30 12:31:29.000000000 +0000 @@ -46,21 +46,21 @@ * * The minor version of the Clutter library (2, if %CLUTTER_VERSION is 1.2.3) */ -#define CLUTTER_MINOR_VERSION (8) +#define CLUTTER_MINOR_VERSION (9) /** * CLUTTER_MICRO_VERSION: * * The micro version of the Clutter library (3, if %CLUTTER_VERSION is 1.2.3) */ -#define CLUTTER_MICRO_VERSION (4) +#define CLUTTER_MICRO_VERSION (0) /** * CLUTTER_VERSION: * * The full version of the Clutter library, like 1.2.3 */ -#define CLUTTER_VERSION 0.8.4 +#define CLUTTER_VERSION 0.9.0 /** * CLUTTER_VERSION_S: @@ -68,7 +68,7 @@ * The full version of the Clutter library, in string form (suited for * string concatenation) */ -#define CLUTTER_VERSION_S "0.8.4" +#define CLUTTER_VERSION_S "0.9.0" /** * CLUTTER_VERSION_HEX: diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/cogl-color.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/cogl-color.h --- clutter-0.8.4/clutter/cogl/cogl-color.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/cogl-color.h 2009-01-29 08:31:37.000000000 +0000 @@ -0,0 +1,284 @@ +/* cogl-color.h: Color type for COGL + * This file is part of Clutter + * + * Copyright (C) 2008 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 . + */ + +#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __COGL_COLOR_H__ +#define __COGL_COLOR_H__ + +#include + +G_BEGIN_DECLS + +CoglColor *cogl_color_new (void); +CoglColor *cogl_color_copy (const CoglColor *color); +void cogl_color_free (CoglColor *color); + +/** + * cogl_color_set_from_4ub: + * @dest: return location for a #CoglColor + * @red: value of the red channel, between 0 and 255 + * @green: value of the green channel, between 0 and 255 + * @blue: value of the blue channel, between 0 and 255 + * @alpha: value of the alpha channel, between 0 and 255 + * + * Sets the values of the passed channels into a #CoglColor. + * + * Since: 1.0 + */ +void cogl_color_set_from_4ub (CoglColor *dest, + guint8 red, + guint8 green, + guint8 blue, + guint8 alpha); + +/** + * cogl_color_set_from_4f: + * @dest: return location for a #CoglColor + * @red: value of the red channel, between 0 and %1.0 + * @green: value of the green channel, between 0 and %1.0 + * @blue: value of the blue channel, between 0 and %1.0 + * @alpha: value of the alpha channel, between 0 and %1.0 + * + * Sets the values of the passed channels into a #CoglColor + * + * Since: 1.0 + */ +void cogl_color_set_from_4f (CoglColor *dest, + float red, + float green, + float blue, + float alpha); + +/** + * cogl_color_get_red_byte: + * @color: a #CoglColor + * + * Retrieves the red channel of @color as a byte value + * between 0 and 255 + * + * Return value: the red channel of the passed color + * + * Since: 1.0 + */ +unsigned char cogl_color_get_red_byte (const CoglColor *color); + +/** + * cogl_color_get_green_byte: + * @color: a #CoglColor + * + * Retrieves the green channel of @color as a byte value + * between 0 and 255 + * + * Return value: the green channel of the passed color + * + * Since: 1.0 + */ +unsigned char cogl_color_get_green_byte (const CoglColor *color); + +/** + * cogl_color_get_blue_byte: + * @color: a #CoglColor + * + * Retrieves the blue channel of @color as a byte value + * between 0 and 255 + * + * Return value: the blue channel of the passed color + * + * Since: 1.0 + */ +unsigned char cogl_color_get_blue_byte (const CoglColor *color); + +/** + * cogl_color_get_alpha_byte: + * @color: a #CoglColor + * + * Retrieves the alpha channel of @color as a byte value + * between 0 and 255 + * + * Return value: the alpha channel of the passed color + * + * Since: 1.0 + */ +unsigned char cogl_color_get_alpha_byte (const CoglColor *color); + +/** + * cogl_color_get_red_float: + * @color: a #CoglColor + * + * Retrieves the red channel of @color as a floating point + * value between 0.0 and 1.0 + * + * Return value: the red channel of the passed color + * + * Since: 1.0 + */ +float cogl_color_get_red_float (const CoglColor *color); + +/** + * cogl_color_get_green_float: + * @color: a #CoglColor + * + * Retrieves the green channel of @color as a floating point + * value between 0.0 and 1.0 + * + * Return value: the green channel of the passed color + * + * Since: 1.0 + */ +float cogl_color_get_green_float (const CoglColor *color); + +/** + * cogl_color_get_blue_float: + * @color: a #CoglColor + * + * Retrieves the blue channel of @color as a floating point + * value between 0.0 and 1.0 + * + * Return value: the blue channel of the passed color + * + * Since: 1.0 + */ +float cogl_color_get_blue_float (const CoglColor *color); + +/** + * cogl_color_get_alpha_float: + * @color: a #CoglColor + * + * Retrieves the alpha channel of @color as a floating point + * value between 0.0 and 1.0 + * + * Return value: the alpha channel of the passed color + * + * Since: 1.0 + */ +float cogl_color_get_alpha_float (const CoglColor *color); + +/** + * cogl_color_get_red: + * @color: a #CoglColor + * + * Retrieves the red channel of @color as a fixed point + * value between 0 and %1.0. + * + * Return value: the red channel of the passed color + * + * Since: 1.0 + */ +float cogl_color_get_red (const CoglColor *color); + +/** + * cogl_color_get_green: + * @color: a #CoglColor + * + * Retrieves the green channel of @color as a fixed point + * value between 0 and %1.0. + * + * Return value: the green channel of the passed color + * + * Since: 1.0 + */ +float cogl_color_get_green (const CoglColor *color); + +/** + * cogl_color_get_blue: + * @color: a #CoglColor + * + * Retrieves the blue channel of @color as a fixed point + * value between 0 and %1.0. + * + * Return value: the blue channel of the passed color + * + * Since: 1.0 + */ +float cogl_color_get_blue (const CoglColor *color); + +/** + * cogl_color_get_alpha: + * @color: a #CoglColor + * + * Retrieves the alpha channel of @color as a fixed point + * value between 0 and %1.0. + * + * Return value: the alpha channel of the passed color + * + * Since: 1.0 + */ +float cogl_color_get_alpha (const CoglColor *color); + +/** + * cogl_set_source_color: + * @color: a #CoglColor + * + * Sets the source color using normalized values for each component. + * This color will be used for any subsequent drawing operation. + * + * See also cogl_set_source_color4ub() and cogl_set_source_color4f() + * if you already have the color components. + * + * Since: 1.0 + */ +void cogl_set_source_color (const CoglColor *color); + +/** + * cogl_set_source_color4ub: + * @red: value of the red channel, between 0 and 255 + * @green: value of the green channel, between 0 and 255 + * @blue: value of the blue channel, between 0 and 255 + * @alpha: value of the alpha channel, between 0 and 255 + * + * Sets the source color using unsigned bytes for each component. This + * color will be used for any subsequent drawing operation. + * + * The value for each component is an unsigned byte in the range + * between 0 and 255. + * + * Since: 1.0 + */ +void cogl_set_source_color4ub (guint8 red, + guint8 green, + guint8 blue, + guint8 alpha); + +/** + * cogl_set_source_color4f: + * @red: value of the red channel, between 0 and %1.0 + * @green: value of the green channel, between 0 and %1.0 + * @blue: value of the blue channel, between 0 and %1.0 + * @alpha: value of the alpha channel, between 0 and %1.0 + * + * Sets the source color using normalized values for each component. + * This color will be used for any subsequent drawing operation. + * + * The value for each component is a fixed point number in the range + * between 0 and %1.0. If the values passed in are outside that + * range, they will be clamped. + * + * Since: 1.0 + */ +void cogl_set_source_color4f (float red, + float green, + float blue, + float alpha); + +G_END_DECLS + +#endif /* __COGL_COLOR_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/cogl-defines-gles.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/cogl-defines-gles.h --- clutter-0.8.4/clutter/cogl/cogl-defines-gles.h 2008-12-01 11:36:55.000000000 +0000 +++ clutter-0.9.0/clutter/cogl/cogl-defines-gles.h 2009-01-30 12:31:30.000000000 +0000 @@ -162,7 +162,11 @@ #define CGL_STENCIL_PASS_DEPTH_PASS GL_STENCIL_PASS_DEPTH_PASS #define CGL_STENCIL_REF GL_STENCIL_REF #define CGL_STENCIL_WRITEMASK GL_STENCIL_WRITEMASK +#ifdef HAVE_COGL_GLES2 +#define CGL_MATRIX_MODE 0x0BA0 /* bad style but works for now */ +#else #define CGL_MATRIX_MODE GL_MATRIX_MODE +#endif #define CGL_VIEWPORT GL_VIEWPORT #define CGL_MODELVIEW_STACK_DEPTH GL_MODELVIEW_STACK_DEPTH #define CGL_PROJECTION_STACK_DEPTH GL_PROJECTION_STACK_DEPTH @@ -190,7 +194,11 @@ #define CGL_MAX_VIEWPORT_DIMS GL_MAX_VIEWPORT_DIMS #define CGL_MAX_ELEMENTS_VERTICES GL_MAX_ELEMENTS_VERTICES #define CGL_MAX_ELEMENTS_INDICES GL_MAX_ELEMENTS_INDICES -#define CGL_MAX_TEXTURE_UNITS GL_MAX_TEXTURE_UNITS +#ifdef HAVE_COGL_GLES2 +#define CGL_MAX_COMBINED_TEXTURE_IMAGE_UNITS GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS +#else +#define CGL_MAX_COMBINED_TEXTURE_IMAGE_UNITS GL_MAX_TEXTURE_UNITS +#endif #define CGL_SUBPIXEL_BITS GL_SUBPIXEL_BITS #define CGL_RED_BITS GL_RED_BITS #define CGL_GREEN_BITS GL_GREEN_BITS @@ -315,7 +323,7 @@ /* PixelType */ /* GL_UNSIGNED_BYTE */ -#define CGL_UNSIGNED_SHORT_4_4_4_4 GL_UNSIGNED_SHORT_4_4_4_4 +#define CGL_UNSIGNED_SHORT_4_4_4_4 GL_UNSIGNED_SHORT_4_4_4_4 #define CGL_UNSIGNED_SHORT_5_5_5_1 GL_UNSIGNED_SHORT_5_5_5_1 #define CGL_UNSIGNED_SHORT_5_6_5 CGL_UNSIGNED_SHORT_5_6_5 diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/cogl-defines-gl.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/cogl-defines-gl.h --- clutter-0.8.4/clutter/cogl/cogl-defines-gl.h 2008-12-01 11:36:54.000000000 +0000 +++ clutter-0.9.0/clutter/cogl/cogl-defines-gl.h 2009-01-30 12:31:30.000000000 +0000 @@ -309,6 +309,7 @@ #define CGL_MAX_TEXTURE_STACK_DEPTH GL_MAX_TEXTURE_STACK_DEPTH #define CGL_MAX_VIEWPORT_DIMS GL_MAX_VIEWPORT_DIMS #define CGL_MAX_CLIENT_ATTRIB_STACK_DEPTH GL_MAX_CLIENT_ATTRIB_STACK_DEPTH +#define CGL_MAX_COMBINED_TEXTURE_IMAGE_UNITS GL_MAX_TEXTURE_UNITS #define CGL_ATTRIB_STACK_DEPTH GL_ATTRIB_STACK_DEPTH #define CGL_CLIENT_ATTRIB_STACK_DEPTH GL_CLIENT_ATTRIB_STACK_DEPTH #define CGL_COLOR_CLEAR_VALUE GL_COLOR_CLEAR_VALUE @@ -838,10 +839,190 @@ GLint *params); typedef void + (APIENTRYP COGL_PFNGLVERTEXATTRIBPOINTERARBPROC) + (GLuint index, + GLint size, + GLenum type, + GLboolean normalized, + GLsizei stride, + const GLvoid *pointer); + +typedef void + (APIENTRYP COGL_PFNGLENABLEVERTEXATTRIBARRAYARBPROC) + (GLuint index); + +typedef void + (APIENTRYP COGL_PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) + (GLuint index); + +typedef void + (APIENTRYP COGL_PFNGLGENBUFFERSARBPROC) + (GLuint n, + GLuint *buffers); + +typedef void + (APIENTRYP COGL_PFNGLBINDBUFFERARBPROC) + (GLenum target, + GLuint buffer); + +typedef void + (APIENTRYP COGL_PFNGLBUFFERDATAARBPROC) + (GLenum target, + GLsizeiptr size, + const GLvoid *data, + GLenum usage); + +typedef void + (APIENTRYP COGL_PFNGLBUFFERSUBDATAARBPROC) + (GLenum target, + GLintptr offset, + GLsizeiptr size, + const GLvoid *data); + +typedef void * + (APIENTRYP COGL_PFNGLMAPBUFFERARBPROC) + (GLenum target, + GLenum access); + +typedef GLboolean + (APIENTRYP COGL_PFNGLUNMAPBUFFERARBPROC) + (GLenum target); + +typedef void + (APIENTRYP COGL_PFNGLDELETEBUFFERSARBPROC) + (GLsizei n, + const GLuint *buffers); + +typedef void (APIENTRYP COGL_PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void + (APIENTRYP COGL_PFNGLUNIFORM2FARBPROC) + (GLint location, + GLfloat v0, + GLfloat v1); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM3FARBPROC) + (GLint location, + GLfloat v0, + GLfloat v1, + GLfloat v2); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM4FARBPROC) + (GLint location, + GLfloat v0, + GLfloat v1, + GLfloat v2, + GLfloat v3); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM1FVARBPROC) + (GLint location, + GLsizei count, + const GLfloat * value); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM2FVARBPROC) + (GLint location, + GLsizei count, + const GLfloat * value); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM3FVARBPROC) + (GLint location, + GLsizei count, + const GLfloat * value); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM4FVARBPROC) + (GLint location, + GLsizei count, + const GLfloat * value); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM1IARBPROC) + (GLint location, + GLint v0); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM2IARBPROC) + (GLint location, + GLint v0, + GLint v1); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM3IARBPROC) + (GLint location, + GLint v0, + GLint v1, + GLint v2); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM4IARBPROC) + (GLint location, + GLint v0, + GLint v1, + GLint v2, + GLint v3); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM1IVARBPROC) + (GLint location, + GLsizei count, + const GLint * value); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM2IVARBPROC) + (GLint location, + GLsizei count, + const GLint * value); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM3IVARBPROC) + (GLint location, + GLsizei count, + const GLint * value); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM4IVARBPROC) + (GLint location, + GLsizei count, + const GLint * value); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORMMATRIX2FVARBPROC) + (GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORMMATRIX3FVARBPROC) + (GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORMMATRIX4FVARBPROC) + (GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value); + +typedef void + (APIENTRYP COGL_PFNGLDRAWRANGEELEMENTSPROC) + (GLenum mode, + GLuint start, + GLuint end, + GLsizei count, + GLenum type, + const GLvoid *indices); + G_END_DECLS #endif diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/cogl-deprecated.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/cogl-deprecated.h --- clutter-0.8.4/clutter/cogl/cogl-deprecated.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/cogl-deprecated.h 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,5 @@ +#ifndef COGL_DEPRECATED_H + +#define cogl_color cogl_color_REPLACED_BY_cogl_set_source_color + +#endif diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/cogl-fixed.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/cogl-fixed.h --- clutter-0.8.4/clutter/cogl/cogl-fixed.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/cogl-fixed.h 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,767 @@ +/* cogl-fixed.h: Fixed point API + * This file is part of Clutter + * + * Copyright (C) 2008 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 . + */ + +#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __COGL_FIXED_H__ +#define __COGL_FIXED_H__ + +#include + +/** + * SECTION:cogl-fixed + * @short_description: Fixed Point API + * + * COGL has a fixed point API targeted at platforms without a floating + * point unit, such as embedded devices. On such platforms this API should + * be preferred to the floating point one as it does not trigger the slow + * path of software emulation, relying on integer math for fixed-to-floating + * and floating-to-fixed notations conversion. + * + * It is not recommened for use on platforms with a floating point unit + * (e.g. desktop systems), nor for use in language bindings. + * + * Basic rules of Fixed Point arithmethic: + * + * + * Two fixed point numbers can be directly added, subtracted and + * have their modulus taken. + * + * + * To add other numerical type to a fixed point number it has to + * be first converted to fixed point. + * + * + * A fixed point number can be directly multiplied or divided by + * an integer. + * + * + * Two fixed point numbers can only be multiplied and divided by + * the provided %COGL_FIXED_MUL and %COGL_FIXED_DIV macros. + * + * + * + * The fixed point API is available since COGL 1.0. + */ + +G_BEGIN_DECLS + +/** + * COGL_FIXED_BITS: + * + * Evaluates to the number of bits used by the #CoglFixed type. + * + * Since: 1.0 + */ +#define COGL_FIXED_BITS (32) + +/** + * COGL_FIXED_Q: + * + * Evaluates to the number of bits used for the non-integer part + * of the #CoglFixed type. + * + * Since: 1.0 + */ +#define COGL_FIXED_Q (COGL_FIXED_BITS - 16) + +/** + * COGL_FIXED_1: + * + * The number 1 expressed as a #CoglFixed number. + * + * Since: 1.0 + */ +#define COGL_FIXED_1 (1 << COGL_FIXED_Q) + +/** + * COGL_FIXED_0_5: + * + * The number 0.5 expressed as a #CoglFixed number. + * + * Since: 1.0 + */ +#define COGL_FIXED_0_5 (32768) + +/** + * COGL_FIXED_EPSILON: + * + * A very small number expressed as a #CoglFixed number. + * + * Since: 1.0 + */ +#define COGL_FIXED_EPSILON (1) + +/** + * COGL_FIXED_MAX: + * + * The biggest number representable using #CoglFixed + * + * Since: 1.0 + */ +#define COGL_FIXED_MAX (0x7fffffff) + +/** + * COGL_FIXED_MIN: + * + * The smallest number representable using #CoglFixed + * + * Since: 1.0 + */ +#define COGL_FIXED_MIN (0x80000000) + +/** + * COGL_FIXED_PI: + * + * The number pi, expressed as a #CoglFixed number. + * + * Since: 1.0 + */ +#define COGL_FIXED_PI (0x0003243f) + +/** + * COGL_FIXED_2_PI: + * + * Two times pi, expressed as a #CoglFixed number. + * + * Since: 1.0 + */ +#define COGL_FIXED_2_PI (0x0006487f) + +/** + * COGL_FIXED_PI_2: + * + * Half pi, expressed as a #CoglFixed number. + * + * Since: 1.0 + */ +#define COGL_FIXED_PI_2 (0x00019220) + +/** + * COGL_FIXED_PI_4: + * + * pi / 4, expressed as #CoglFixed number. + * + * Since: 1.0 + */ +#define COGL_FIXED_PI_4 (0x0000c910) + +/** + * COGL_FIXED_360: + * + * Evaluates to the number 360 in fixed point notation. + * + * Since: 1.0 + */ +#define COGL_FIXED_360 (COGL_FIXED_FROM_INT (360)) + +/** + * COGL_FIXED_270: + * + * Evaluates to the number 270 in fixed point notation. + * + * Since: 1.0 + */ +#define COGL_FIXED_270 (COGL_FIXED_FROM_INT (270)) + +/** + * COGL_FIXED_255: + * + * Evaluates to the number 255 in fixed point notation. + * + * Since: 1.0 + */ +#define COGL_FIXED_255 (COGL_FIXED_FROM_INT (255)) + +/** + * COGL_FIXED_240: + * + * Evaluates to the number 240 in fixed point notation. + * + * Since: 1.0 + */ +#define COGL_FIXED_240 (COGL_FIXED_FROM_INT (240)) + +/** + * COGL_FIXED_180: + * + * Evaluates to the number 180 in fixed point notation. + * + * Since: 1.0 + */ +#define COGL_FIXED_180 (COGL_FIXED_FROM_INT (180)) + +/** + * COGL_FIXED_120: + * + * Evaluates to the number 120 in fixed point notation. + * + * Since: 1.0 + */ +#define COGL_FIXED_120 (COGL_FIXED_FROM_INT (120)) + +/** + * COGL_FIXED_90: + * + * Evaluates to the number 90 in fixed point notation. + * + * Since: 1.0 + */ +#define COGL_FIXED_90 (COGL_FIXED_FROM_INT (90)) + +/** + * COGL_FIXED_60: + * + * Evaluates to the number 60 in fixed point notation. + * + * Since: 1.0 + */ +#define COGL_FIXED_60 (COGL_FIXED_FROM_INT (60)) + +/** + * COGL_FIXED_45: + * + * Evaluates to the number 45 in fixed point notation. + * + * Since: 1.0 + */ +#define COGL_FIXED_45 (COGL_FIXED_FROM_INT (45)) + +/** + * COGL_FIXED_30: + * + * Evaluates to the number 30 in fixed point notation. + * + * Since: 1.0 + */ +#define COGL_FIXED_30 (COGL_FIXED_FROM_INT (30)) + +/** + * COGL_RADIANS_TO_DEGREES: + * + * Evaluates to 180 / pi in fixed point notation. + * + * Since: 1.0 + */ +#define COGL_RADIANS_TO_DEGREES (0x394bb8) + +/* + * conversion macros + */ + +/** + * COGL_FIXED_FROM_FLOAT: + * @x: a floating point number + * + * Converts @x from a floating point to a fixed point notation. + * + * Since: 1.0 + */ +#define COGL_FIXED_FROM_FLOAT(x) (cogl_double_to_fixed (x)) + +/** + * COGL_FIXED_TO_FLOAT: + * @x: a #CoglFixed number + * + * Converts @x from a fixed point to a floating point notation, in + * single precision. + * + * Since: 1.0 + */ +#define COGL_FIXED_TO_FLOAT(x) ((float) ((int)(x) / 65536.0)) + +/** + * COGL_FIXED_TO_FLOAT: + * @x: a #CoglFixed number + * + * Converts @x from a fixed point to a floatint point notation, in + * double precision. + * + * Since: 1.0 + */ +#define COGL_FIXED_TO_DOUBLE(x) ((double) ((int)(x) / 65536.0)) + +/** + * COGL_FIXED_FROM_INT: + * @x: an integer number + * + * Converts @x from an integer to a fixed point notation. + * + * Since: 1.0 + */ +#define COGL_FIXED_FROM_INT(x) ((x) << COGL_FIXED_Q) + +/** + * COGL_FIXED_TO_INT: + * @x: a #CoglFixed number + * + * Converts @x from a fixed point notation to an integer, dropping + * the fractional part without rounding. + * + * Since: 1.0 + */ +#define COGL_FIXED_TO_INT(x) ((x) >> COGL_FIXED_Q) + +/** + * COGL_FLOAT_TO_INT: + * @x: a floatint point number + * + * Converts @x from a floating point notation to a signed integer. + * + * Since: 1.0 + */ +#define COGL_FLOAT_TO_INT(x) (cogl_double_to_int ((x))) + +/** + * COGL_FLOAT_TO_UINT: + * @x: a floatint point number + * + * Converts @x from a floating point notation to an unsigned integer. + * + * Since: 1.0 + */ +#define COGL_FLOAT_TO_UINT(x) (cogl_double_to_uint ((x))) + +/* + * fixed point math functions + */ + +/** + * COGL_FIXED_FRACTION: + * @x: a #CoglFixed number + * + * Retrieves the fractionary part of @x. + * + * Since: 1.0 + */ +#define COGL_FIXED_FRACTION(x) ((x) & ((1 << COGL_FIXED_Q) - 1)) + +/** + * COGL_FIXED_FLOOR: + * @x: a #CoglFixed number + * + * Rounds down a fixed point number to the previous integer. + * + * Since: 1.0 + */ +#define COGL_FIXED_FLOOR(x) (((x) >= 0) ? ((x) >> COGL_FIXED_Q) \ + : ~((~(x)) >> COGL_FIXED_Q)) + +/** + * COGL_FIXED_CEIL: + * @x: a #CoglFixed number + * + * Rounds up a fixed point number to the next integer. + * + * Since: 1.0 + */ +#define COGL_FIXED_CEIL(x) (COGL_FIXED_FLOOR ((x) + 0xffff)) + +/** + * COGL_FIXED_MUL: + * @a: a #CoglFixed number + * @b: a #CoglFixed number + * + * Computes (a * b). + * + * Since: 1.0 + */ +#define COGL_FIXED_MUL(a,b) (cogl_fixed_mul ((a), (b))) + +/** + * COGL_FIXED_DIV: + * @a: a #CoglFixed number + * @b: a #CoglFixed number + * + * Computes (a / b). + * + * Since: 1.0 + */ +#define COGL_FIXED_DIV(a,b) (cogl_fixed_div ((a), (b))) + +/** + * COGL_FIXED_MUL_DIV: + * @a: a #CoglFixed number + * @b: a #CoglFixed number + * @c: a #CoglFixed number + * + * Computes ((a * b) / c). It is logically equivalent to: + * + * |[ + * res = COGL_FIXED_DIV (COGL_FIXED_MUL (a, b), c); + * ]| + * + * But it is shorter to type. + * + * Since: 1.0 + */ +#define COGL_FIXED_MUL_DIV(a,b,c) (cogl_fixed_mul_div ((a), (b), (c))) + +/** + * COGL_FIXED_FAST_MUL: + * @a: a #CoglFixed number + * @b: a #CoglFixed number + * + * Fast version of %COGL_FIXED_MUL, implemented as a macro. + * + * This macro might lose precision. If the precision of the result + * is important use %COGL_FIXED_MUL instead. + * + * Since: 1.0 + */ +#define COGL_FIXED_FAST_MUL(a,b) ((a) >> 8) * ((b) >> 8) + +/** + * COGL_FIXED_FAST_DIV: + * @a: a #CoglFixed number + * @b: a #CoglFixed number + * + * Fast version of %COGL_FIXED_DIV, implemented as a macro. + * + * This macro might lose precision. If the precision of the result + * is important use %COGL_FIXED_DIV instead. + * + * Since: 1.0 + */ +#define COGL_FIXED_FAST_DIV(a,b) ((((a) << 8) / (b)) << 8) + +/** + * cogl_fixed_sin: + * @angle: a #CoglFixed number + * + * Computes the sine of @angle. + * + * Return value: the sine of the passed angle, in fixed point notation + * + * Since: 1.0 + */ +CoglFixed cogl_fixed_sin (CoglFixed angle); + +/** + * cogl_fixed_tan: + * @angle: a #CoglFixed number + * + * Computes the tangent of @angle. + * + * Return value: the tangent of the passed angle, in fixed point notation + * + * Since: 1.0 + */ +CoglFixed cogl_fixed_tan (CoglFixed angle); + +/** + * cogl_fixed_cos: + * @angle: a #CoglFixed number + * + * Computes the cosine of @angle. + * + * Return value: the cosine of the passed angle, in fixed point notation + * + * Since: 1.0 + */ +CoglFixed cogl_fixed_cos (CoglFixed angle); + +/** + * cogl_fixed_atani: + * @a: a #CoglFixed number + * + * Computes the arc tangent of @a. + * + * Return value: the arc tangent of the passed value, in fixed point notation + * + * Since: 1.0 + */ +CoglFixed cogl_fixed_atani (CoglFixed a); + +/** + * cogl_fixed_atan2: + * @a: the numerator as a #CoglFixed number + * @b: the denominator as a #CoglFixed number + * + * Computes the arc tangent of @a / @b but uses the sign of both + * arguments to return the angle in right quadrant. + * + * Return value: the arc tangent of the passed fraction, in fixed point + * notation + * + * Since: 1.0 + */ +CoglFixed cogl_fixed_atan2 (CoglFixed a, + CoglFixed b); + +/*< public >*/ + +/* Fixed point math routines */ +G_INLINE_FUNC CoglFixed cogl_fixed_mul (CoglFixed a, + CoglFixed b); +G_INLINE_FUNC CoglFixed cogl_fixed_div (CoglFixed a, + CoglFixed b); +G_INLINE_FUNC CoglFixed cogl_fixed_mul_div (CoglFixed a, + CoglFixed b, + CoglFixed c); + +/** + * COGL_SQRTI_ARG_MAX: + * + * Maximum argument that can be passed to cogl_sqrti() function. + * + * Since: 1.0 + */ +#ifndef __SSE2__ +#define COGL_SQRTI_ARG_MAX 0x3fffff +#else +#define COGL_SQRTI_ARG_MAX INT_MAX +#endif + +/** + * COGL_SQRTI_ARG_5_PERCENT: + * + * Maximum argument that can be passed to cogl_sqrti() for which the + * resulting error is < 5% + * + * Since: 1.0 + */ +#ifndef __SSE2__ +#define COGL_SQRTI_ARG_5_PERCENT 210 +#else +#define COGL_SQRTI_ARG_5_PERCENT INT_MAX +#endif + +/** + * COGL_SQRTI_ARG_10_PERCENT: + * + * Maximum argument that can be passed to cogl_sqrti() for which the + * resulting error is < 10% + * + * Since: 1.0 + */ +#ifndef __SSE2__ +#define COGL_SQRTI_ARG_10_PERCENT 5590 +#else +#define COGL_SQRTI_ARG_10_PERCENT INT_MAX +#endif + +/** + * cogl_fixed_sqrt: + * @x: a #CoglFixed number + * + * Computes the square root of @x. + * + * Return value: the square root of the passed value, in floating point + * notation + * + * Since: 1.0 + */ +CoglFixed cogl_fixed_sqrt (CoglFixed x); + +/** + * cogl_fixed_log2: + * @x: value to calculate base 2 logarithm from + * + * Calculates base 2 logarithm. + * + * This function is some 2.5 times faster on x86, and over 12 times faster on + * fpu-less arm, than using libc log(). + * + * Return value: base 2 logarithm. + * + * Since: 1.0 + */ +CoglFixed cogl_fixed_log2 (guint x); + +/** + * cogl_fixed_pow2: + * @x: a #CoglFixed number + * + * Calculates 2 to the @x power. + * + * This function is around 11 times faster on x86, and around 22 times faster + * on fpu-less arm than libc pow(2, x). + * + * Return value: the power of 2 to the passed value + * + * Since: 1.0 + */ +guint cogl_fixed_pow2 (CoglFixed x); + +/** + * cogl_fixed_pow: + * @x: base + * @y: #CoglFixed exponent + * + * Calculates @x to the @y power. + * + * Return value: the power of @x to the @y + * + * Since: 1.0 + */ +guint cogl_fixed_pow (guint x, + CoglFixed y); + +/** + * cogl_sqrti: + * @x: integer value + * + * Very fast fixed point implementation of square root for integers. + * + * This function is at least 6x faster than clib sqrt() on x86, and (this is + * not a typo!) about 500x faster on ARM without FPU. It's error is less than + * 5% for arguments smaller than %COGL_SQRTI_ARG_5_PERCENT and less than 10% + * for narguments smaller than %COGL_SQRTI_ARG_10_PERCENT. The maximum + * argument that can be passed to this function is %COGL_SQRTI_ARG_MAX. + * + * Return value: integer square root. + * + * Since: 1.0 + */ +gint cogl_sqrti (gint x); + +/** + * COGL_ANGLE_FROM_DEG: + * @x: an angle in degrees in floating point notation + * + * Converts an angle in degrees into a #CoglAngle. + * + * Since: 1.0 + */ +#define COGL_ANGLE_FROM_DEG(x) (COGL_FLOAT_TO_INT (((float)(x) * 1024.0f) / 360.0f)) + +/** + * COGL_ANGLE_TO_DEG: + * @x: a #CoglAngle + * + * Converts a #CoglAngle into an angle in degrees, using floatint point + * notation. + * + * Since: 1.0 + */ +#define COGL_ANGLE_TO_DEG(x) (((float)(x) * 360.0) / 1024.0) + +/** + * COGL_ANGLE_FROM_DEGX: + * @x: an angle in degrees in fixed point notation + * + * Converts an angle in degrees into a #CoglAngle. + * + * Since: 1.0 + */ +#define COGL_ANGLE_FROM_DEGX(x) (COGL_FIXED_TO_INT ((((x) / 360) * 1024) + COGL_FIXED_0_5)) + +/** + * COGL_ANGLE_TO_DEGX: + * @x: a #CoglAngle + * + * Converts a #CoglAngle into an angle in degrees, using fixed point notation + * + * Since: 1.0 + */ +#define COGL_ANGLE_TO_DEGX(x) (COGL_FIXED_FROM_INT ((x) * 45) / 128) + +/** + * cogl_angle_sin: + * @angle: an angle expressed using #CoglAngle + * + * Computes the sine of @angle + * + * Return value: the sine of the passed angle + * + * Since: 1.0 + */ +CoglFixed cogl_angle_sin (CoglAngle angle); + +/** + * cogl_angle_tan: + * @angle: an angle expressed using #CoglAngle + * + * Computes the tangent of @angle + * + * Return value: the tangent of the passed angle + * + * Since: 1.0 + */ +CoglFixed cogl_angle_tan (CoglAngle angle); + +/** + * cogl_angle_cos: + * @angle: an angle expressed using #CoglAngle + * + * Computes the cosine of @angle + * + * Return value: the cosine of the passed angle + * + * Since: 1.0 + */ +CoglFixed cogl_angle_cos (CoglAngle angle); + +/*< private >*/ + +#if defined (G_CAN_INLINE) +G_INLINE_FUNC CoglFixed +cogl_fixed_mul (CoglFixed a, + CoglFixed b) +{ +# ifdef __arm__ + int res_low, res_hi; + + __asm__ ("smull %0, %1, %2, %3 \n" + "mov %0, %0, lsr %4 \n" + "add %1, %0, %1, lsl %5 \n" + : "=r"(res_hi), "=r"(res_low)\ + : "r"(a), "r"(b), "i"(COGL_FIXED_Q), "i"(32 - COGL_FIXED_Q)); + + return (CoglFixed) res_low; +# else + long long r = (long long) a * (long long) b; + + return (unsigned int)(r >> COGL_FIXED_Q); +# endif +} +#endif + +#if defined (G_CAN_INLINE) +G_INLINE_FUNC CoglFixed +cogl_fixed_div (CoglFixed a, + CoglFixed b) +{ + return (CoglFixed) ((((gint64) a) << COGL_FIXED_Q) / b); +} +#endif + +#if defined(G_CAN_INLINE) +G_INLINE_FUNC CoglFixed +cogl_fixed_mul_div (CoglFixed a, + CoglFixed b, + CoglFixed c) +{ + CoglFixed ab = cogl_fixed_mul (a, b); + CoglFixed quo = cogl_fixed_div (ab, c); + + return quo; +} +#endif + +extern CoglFixed cogl_double_to_fixed (double value); +extern gint cogl_double_to_int (double value); +extern guint cogl_double_to_unit (double value); + +G_END_DECLS + +#endif /* __COGL_FIXED_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/cogl.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/cogl.h --- clutter-0.8.4/clutter/cogl/cogl.h 2008-12-01 11:36:54.000000000 +0000 +++ clutter-0.9.0/clutter/cogl/cogl.h 2009-01-30 12:31:30.000000000 +0000 @@ -23,199 +23,29 @@ * Boston, MA 02111-1307, USA. */ -/* - * COGL - * ==== - * - * 'cogl' is a very simple abstraction layer which wraps GL and GLES. - * - * - * !!!! DO NOT USE THIS API YET OUTSIDE OF CLUTTER CORE !!!! - * THE API WILL FLUCTUATE WILDLY - * - * TODO: - * - Use ClutterReal for fixed/float params. - * - Add Perspective/viewport setup - * - Add Features.. - */ - #ifndef __COGL_H__ #define __COGL_H__ +#define __COGL_H_INSIDE__ + #include -#include -#include -#include -#include #include -G_BEGIN_DECLS - -/* Enum declarations */ - -#define COGL_PIXEL_FORMAT_24 2 -#define COGL_PIXEL_FORMAT_32 3 -#define COGL_A_BIT (1 << 4) -#define COGL_BGR_BIT (1 << 5) -#define COGL_AFIRST_BIT (1 << 6) -#define COGL_PREMULT_BIT (1 << 7) -#define COGL_UNORDERED_MASK 0x0F -#define COGL_UNPREMULT_MASK 0x7F - -/** - * CoglPixelFormat: - * @COGL_PIXEL_FORMAT_ANY: - * @COGL_PIXEL_FORMAT_A_8: - * @COGL_PIXEL_FORMAT_RGB_888: - * @COGL_PIXEL_FORMAT_BGR_888: - * @COGL_PIXEL_FORMAT_RGBA_8888: - * @COGL_PIXEL_FORMAT_BGRA_8888: - * @COGL_PIXEL_FORMAT_ARGB_8888: - * @COGL_PIXEL_FORMAT_ABGR_8888: - * @COGL_PIXEL_FORMAT_RGBA_8888_PRE: - * @COGL_PIXEL_FORMAT_BGRA_8888_PRE: - * @COGL_PIXEL_FORMAT_ARGB_8888_PRE: - * @COGL_PIXEL_FORMAT_ABGR_8888_PRE: - * @COGL_PIXEL_FORMAT_RGB_565: - * @COGL_PIXEL_FORMAT_RGBA_4444: - * @COGL_PIXEL_FORMAT_RGBA_5551: - * @COGL_PIXEL_FORMAT_RGBA_4444_PRE: - * @COGL_PIXEL_FORMAT_RGBA_5551_PRE: - * @COGL_PIXEL_FORMAT_YUV: - * @COGL_PIXEL_FORMAT_G_8: - * - * Pixel formats used by COGL. - */ -typedef enum -{ - COGL_PIXEL_FORMAT_ANY = 0, - COGL_PIXEL_FORMAT_A_8 = 1 | COGL_A_BIT, - - COGL_PIXEL_FORMAT_RGB_565 = 4, - COGL_PIXEL_FORMAT_RGBA_4444 = 5 | COGL_A_BIT, - COGL_PIXEL_FORMAT_RGBA_5551 = 6 | COGL_A_BIT, - COGL_PIXEL_FORMAT_YUV = 7, - COGL_PIXEL_FORMAT_G_8 = 8, - - COGL_PIXEL_FORMAT_RGB_888 = COGL_PIXEL_FORMAT_24, - - COGL_PIXEL_FORMAT_BGR_888 = (COGL_PIXEL_FORMAT_24 | - COGL_BGR_BIT), - - COGL_PIXEL_FORMAT_RGBA_8888 = COGL_PIXEL_FORMAT_32 | - COGL_A_BIT, - - COGL_PIXEL_FORMAT_BGRA_8888 = (COGL_PIXEL_FORMAT_32 | - COGL_A_BIT | - COGL_BGR_BIT), - - COGL_PIXEL_FORMAT_ARGB_8888 = (COGL_PIXEL_FORMAT_32 | - COGL_A_BIT | - COGL_AFIRST_BIT), - - COGL_PIXEL_FORMAT_ABGR_8888 = (COGL_PIXEL_FORMAT_32 | - COGL_A_BIT | - COGL_BGR_BIT | - COGL_AFIRST_BIT), - - COGL_PIXEL_FORMAT_RGBA_8888_PRE = (COGL_PIXEL_FORMAT_32 | - COGL_A_BIT | - COGL_PREMULT_BIT), - - COGL_PIXEL_FORMAT_BGRA_8888_PRE = (COGL_PIXEL_FORMAT_32 | - COGL_A_BIT | - COGL_PREMULT_BIT | - COGL_BGR_BIT), - - COGL_PIXEL_FORMAT_ARGB_8888_PRE = (COGL_PIXEL_FORMAT_32 | - COGL_A_BIT | - COGL_PREMULT_BIT | - COGL_AFIRST_BIT), - - COGL_PIXEL_FORMAT_ABGR_8888_PRE = (COGL_PIXEL_FORMAT_32 | - COGL_A_BIT | - COGL_PREMULT_BIT | - COGL_BGR_BIT | - COGL_AFIRST_BIT), - - COGL_PIXEL_FORMAT_RGBA_4444_PRE = (COGL_PIXEL_FORMAT_RGBA_4444 | - COGL_A_BIT | - COGL_PREMULT_BIT), - - COGL_PIXEL_FORMAT_RGBA_5551_PRE = (COGL_PIXEL_FORMAT_RGBA_5551 | - COGL_A_BIT | - COGL_PREMULT_BIT), - - -} CoglPixelFormat; - -/** - * CoglFeatureFlags: - * @COGL_FEATURE_TEXTURE_RECTANGLE: - * @COGL_FEATURE_TEXTURE_NPOT: - * @COGL_FEATURE_TEXTURE_YUV: - * @COGL_FEATURE_TEXTURE_READ_PIXELS: - * @COGL_FEATURE_SHADERS_GLSL: - * @COGL_FEATURE_OFFSCREEN: - * @COGL_FEATURE_OFFSCREEN_MULTISAMPLE: - * @COGL_FEATURE_OFFSCREEN_BLIT: - * @COGL_FEATURE_FOUR_CLIP_PLANES: - * @COGL_FEATURE_STENCIL_BUFFER: - * - * Flags for the supported features. - */ -typedef enum -{ - COGL_FEATURE_TEXTURE_RECTANGLE = (1 << 1), - COGL_FEATURE_TEXTURE_NPOT = (1 << 2), - COGL_FEATURE_TEXTURE_YUV = (1 << 3), - COGL_FEATURE_TEXTURE_READ_PIXELS = (1 << 4), - COGL_FEATURE_SHADERS_GLSL = (1 << 5), - COGL_FEATURE_OFFSCREEN = (1 << 6), - COGL_FEATURE_OFFSCREEN_MULTISAMPLE = (1 << 7), - COGL_FEATURE_OFFSCREEN_BLIT = (1 << 8), - COGL_FEATURE_FOUR_CLIP_PLANES = (1 << 9), - COGL_FEATURE_STENCIL_BUFFER = (1 << 10) - -} CoglFeatureFlags; - -/** - * CoglBufferTarget: - * @COGL_WINDOW_BUFFER: - * @COGL_MASK_BUFFER: - * @COGL_OFFSCREEN_BUFFER: - * - * - */ -typedef enum -{ - COGL_WINDOW_BUFFER = (1 << 1), - COGL_MASK_BUFFER = (1 << 2), - COGL_OFFSCREEN_BUFFER = (1 << 3) - -} CoglBufferTarget; - -/** - * CoglTextureVertex: - * @x: Model x-coordinate - * @y: Model y-coordinate - * @z: Model z-coordinate - * @tx: Texture x-coordinate - * @ty: Texture y-coordinate - * @color: The color to use at this vertex. This is ignored if - * @use_color is %FALSE when calling cogl_texture_polygon(). - * - * Used to specify vertex information when calling cogl_texture_polygon(). - */ -struct _CoglTextureVertex -{ - ClutterFixed x, y, z; - ClutterFixed tx, ty; - ClutterColor color; -}; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -typedef struct _CoglTextureVertex CoglTextureVertex; +G_BEGIN_DECLS /** * SECTION:cogl @@ -242,31 +72,6 @@ /* Misc */ /** - * COGL_INVALID_HANDLE: - * - * A COGL handle that is not valid, used for unitialized handles as well as - * error conditions. - */ -#define COGL_INVALID_HANDLE NULL - -/** - * CoglHandle: - * - * Type used for storing references to cogl objects, the CoglHandle is - * a fully opaque type without any public data members. - */ -typedef gpointer CoglHandle; - -/** - * CoglFuncPtr: - * - * The type used by cogl for function pointers, note that this type - * is used as a generic catch-all cast for function pointers and the - * actual arguments and return type may be different. - */ -typedef void (* CoglFuncPtr) (void); - -/** * cogl_get_features: * * Returns all of the features supported by COGL. @@ -275,7 +80,7 @@ * * Since: 0.8 */ -ClutterFeatureFlags cogl_get_features (void); +CoglFeatureFlags cogl_get_features (void); /** * cogl_features_available: @@ -341,10 +146,10 @@ * Replaces the current projection matrix with a perspective matrix * based on the provided values. */ -void cogl_perspective (ClutterFixed fovy, - ClutterFixed aspect, - ClutterFixed z_near, - ClutterFixed z_far); +void cogl_perspective (float fovy, + float aspect, + float z_near, + float z_far); /** * cogl_frustum: @@ -360,12 +165,12 @@ * * Since: 0.8.2 */ -void cogl_frustum (ClutterFixed left, - ClutterFixed right, - ClutterFixed bottom, - ClutterFixed top, - ClutterFixed z_near, - ClutterFixed z_far); +void cogl_frustum (float left, + float right, + float bottom, + float top, + float z_near, + float z_far); /** * cogl_setup_viewport: @@ -385,10 +190,10 @@ */ void cogl_setup_viewport (guint width, guint height, - ClutterFixed fovy, - ClutterFixed aspect, - ClutterFixed z_near, - ClutterFixed z_far); + float fovy, + float aspect, + float z_near, + float z_far); /** * cogl_viewport: @@ -421,15 +226,17 @@ * cogl_scale: * @x: Amount to scale along the x-axis * @y: Amount to scale along the y-axis + * @z: Amount to scale along the z-axis * - * Multiplies the current model-view matrix by one that scales the x - * and y axes by the given values. + * Multiplies the current model-view matrix by one that scales the x, + * y and z axes by the given values. */ -void cogl_scale (ClutterFixed x, - ClutterFixed y); +void cogl_scale (float x, + float y, + float z); /** - * cogl_translatex: + * cogl_translate: * @x: Distance to translate along the x-axis * @y: Distance to translate along the y-axis * @z: Distance to translate along the z-axis @@ -437,26 +244,12 @@ * Multiplies the current model-view matrix by one that translates the * model along all three axes according to the given values. */ -void cogl_translatex (ClutterFixed x, - ClutterFixed y, - ClutterFixed z); - -/** - * cogl_translate: - * @x: Distance to translate along the x-axis - * @y: Distance to translate along the y-axis - * @z: Distance to translate along the z-axis - * - * Integer version of cogl_translatex(). Multiplies the current - * model-view matrix by one that translates the model along all three - * axes according to the given values. - */ -void cogl_translate (gint x, - gint y, - gint z); +void cogl_translate (float x, + float y, + float z); /** - * cogl_rotatex: + * cogl_rotate: * @angle: Angle in degrees to rotate. * @x: X-component of vertex to rotate around. * @y: Y-component of vertex to rotate around. @@ -468,55 +261,39 @@ * degrees about the vertex (0, 0, 1) causes a small counter-clockwise * rotation. */ -void cogl_rotatex (ClutterFixed angle, - gint x, - gint y, - gint z); - -/** - * cogl_rotate: - * @angle: Angle in degrees to rotate. - * @x: X-component of vertex to rotate around. - * @y: Y-component of vertex to rotate around. - * @z: Z-component of vertex to rotate around. - * - * Integer version of cogl_rotatex(). Multiplies the current - * model-view matrix by one that rotates the model around the vertex - * specified by @x, @y and @z. - */ -void cogl_rotate (gint angle, - gint x, - gint y, - gint z); +void cogl_rotate (float angle, + float x, + float y, + float z); /** * cogl_get_modelview_matrix: - * @m: pointer to a 4x4 array of #ClutterFixeds to receive the matrix + * @m: pointer to a 4x4 array of #floats to receive the matrix * * Stores the current model-view matrix in @m. The matrix is in * column-major order. */ -void cogl_get_modelview_matrix (ClutterFixed m[16]); +void cogl_get_modelview_matrix (float m[16]); /** * cogl_get_projection_matrix: - * @m: pointer to a 4x4 array of #ClutterFixeds to receive the matrix + * @m: pointer to a 4x4 array of #floats to receive the matrix * * Stores the current projection matrix in @m. The matrix is in * column-major order. */ -void cogl_get_projection_matrix (ClutterFixed m[16]); +void cogl_get_projection_matrix (float m[16]); /** * cogl_get_viewport: - * @v: pointer to a 4 element array of #ClutterFixeds to + * @v: pointer to a 4 element array of #floats to * receive the viewport dimensions. * * Stores the current viewport in @v. @v[0] and @v[1] get the x and y * position of the viewport and @v[2] and @v[3] get the width and * height. */ -void cogl_get_viewport (ClutterFixed v[4]); +void cogl_get_viewport (float v[4]); /** * cogl_clip_set: @@ -530,21 +307,60 @@ * will be clipped so that only the portion inside the rectangle will * be displayed. The rectangle dimensions are transformed by the * current model-view matrix. + * + * The rectangle is intersected with the current clip region. To undo + * the effect of this function, call cogl_clip_unset(). + */ +void cogl_clip_set (float x_offset, + float y_offset, + float width, + float height); + +/** + * cogl_clip_set_from_path: + * + * Sets a new clipping area using the current path. The current path + * is then cleared. The clipping area is intersected with the previous + * clipping area. To restore the previous clipping area, call + * cogl_clip_unset(). + * + * Since: 1.0 + */ +void cogl_clip_set_from_path (void); + +/** + * cogl_clip_set_from_path_preserve: + * + * Sets a new clipping area using the current path. The current path + * is then cleared. The clipping area is intersected with the previous + * clipping area. To restore the previous clipping area, call + * cogl_clip_unset(). + * + * Since: 1.0 */ -void cogl_clip_set (ClutterFixed x_offset, - ClutterFixed y_offset, - ClutterFixed width, - ClutterFixed height); +void cogl_clip_set_from_path_preserve (void); /** * cogl_clip_unset: * - * Removes the current clipping rectangle so that all drawing - * operations extend to full size of the viewport again. + * Reverts the clipping region to the state before the last call to + * cogl_clip_set(). */ void cogl_clip_unset (void); /** + * cogl_clip_ensure: + * + * Ensures that the current clipping region has been set in GL. This + * will automatically be called before any Cogl primitives but it + * maybe be neccessary to call if you are using raw GL calls with + * clipping. + * + * Since: 1.0 + */ +void cogl_clip_ensure (void); + +/** * cogl_clip_stack_save: * * Save the entire state of the clipping stack and then clear all @@ -580,17 +396,16 @@ void cogl_enable_depth_test (gboolean setting); /** - * cogl_alpha_func: - * @func: the comparison function to use, one of CGL_NEVER, CGL_LESS, - * CGL_EQUAL, CGL_LEQUAL, CGL_GREATER, CGL_NOTEQUAL, CGL_GEQUAL and GL_ALWAYS. - * @ref: reference value. - * - * Changes the alpha test to use the specified function specified in @func, - * comparing with the value in @ref. The default function is CGL_ALWAYS the - * initial reference value is 1.0. + * cogl_enable_backface_culling: + * @setting: %TRUE to enable backface culling or %FALSE to disable. + * + * Sets whether textures positioned so that their backface is showing + * should be hidden. This can be used to efficiently draw two-sided + * textures or fully closed cubes without enabling depth testing. Only + * calls to cogl_texture_rectangle() and cogl_texture_polygon() are + * affected. Backface culling is disabled by default. */ -void cogl_alpha_func (COGLenum func, - ClutterFixed ref); +void cogl_enable_backface_culling (gboolean setting); /** * cogl_fog_set: @@ -606,10 +421,10 @@ * with @fog_color. Fogging will remain enabled until the next call to * cogl_paint_init(). */ -void cogl_fog_set (const ClutterColor *fog_color, - ClutterFixed density, - ClutterFixed z_near, - ClutterFixed z_far); +void cogl_fog_set (const CoglColor *fog_color, + float density, + float z_near, + float z_far); /** * cogl_paint_init: @@ -618,964 +433,10 @@ * Clears the color buffer to @color. The depth buffer and stencil * buffers are also cleared and fogging and lighting are disabled. */ -void cogl_paint_init (const ClutterColor *color); - -/** - * SECTION:cogl-texture - * @short_description: Fuctions for creating and manipulating textures - * - * COGL allows creating and manipulating GL textures using a uniform - * API that tries to hide all the various complexities of creating, - * loading and manipulating textures. - */ - -/* Textures api */ - -/** - * cogl_texture_new_with_size: - * @width: width of texture in pixels. - * @height: height of texture in pixels. - * @max_waste: maximum extra horizontal and|or vertical margin pixels to make - * texture fit GPU limitations. - * @auto_mipmap: enable or disable automatic generation of mipmap pyramid - * from the base level image whenever it is updated. - * @internal_format: the #CoglPixelFormat to use for the GPU storage of the - * texture. - * - * Create a new texture with specified dimensions and pixel format. - * - * Returns: a #CoglHandle to the newly created texture or COGL_INVALID_HANDLE - * if texture creation failed. - */ -CoglHandle cogl_texture_new_with_size (guint width, - guint height, - gint max_waste, - gboolean auto_mipmap, - CoglPixelFormat internal_format); - -/** - * cogl_texture_new_from_file: - * @filename: the file to load - * @max_waste: maximum extra horizontal and|or vertical margin pixels to make - * texture fit GPU limitations. - * @auto_mipmap: enable or disable automatic generation of mipmap pyramid - * from the base level image whenever it is updated. - * @internal_format: the #CoglPixelFormat to use for the GPU storage of the - * texture. - * @error: a #GError or NULL. - * - * Load an image file from disk. - * - * Returns: a #CoglHandle to the newly created texture or COGL_INVALID_HANDLE - * if creating the texture failed. - */ -CoglHandle cogl_texture_new_from_file (const gchar *filename, - gint max_waste, - gboolean auto_mipmap, - CoglPixelFormat internal_format, - GError **error); - -/** - * cogl_texture_new_from_data: - * @width: width of texture in pixels. - * @height: height of texture in pixels. - * @max_waste: maximum extra horizontal and|or vertical margin pixels to make - * @auto_mipmap: enable or disable automatic generation of mipmap pyramid - * from the base level image whenever it is updated. - * @format: the #CoglPixelFormat the buffer is stored in in RAM - * @internal_format: the #CoglPixelFormat that will be used for storing the - * buffer on the GPU. - * @rowstride: the memory offset in bytes between the starts of scanlines in - * @data. - * @data: pointer the memory region where the source buffer resides. - * - * Create a new cogl texture based on data residing in memory. - * - * Returns: a #CoglHandle to the newly created texture or COGL_INVALID_HANDLE - * if creating the texture failed. - */ -CoglHandle cogl_texture_new_from_data (guint width, - guint height, - gint max_waste, - gboolean auto_mipmap, - CoglPixelFormat format, - CoglPixelFormat internal_format, - guint rowstride, - const guchar *data); - -/** - * cogl_texture_new_from_foreign: - * @gl_handle: opengl target type of foreign texture - * @gl_target: opengl handle of foreign texture. - * @width: width of foreign texture - * @height: height of foreign texture. - * @x_pot_waste: maximum horizontal waste. - * @y_pot_waste: maximum vertical waste. - * @format: format of the foreign texture. - * - * Create a cogl texture based on an existing OpenGL texture, the width, height - * and format are passed along since it is not possible to query this from a - * handle with GLES 1.0. - * - * Returns: a #CoglHandle to the newly created texture or COGL_INVALID_HANDLE - * if creating the texture failed. - */ -CoglHandle cogl_texture_new_from_foreign (GLuint gl_handle, - GLenum gl_target, - GLuint width, - GLuint height, - GLuint x_pot_waste, - GLuint y_pot_waste, - CoglPixelFormat format); - -/** - * cogl_is_texture: - * @handle: A CoglHandle - * - * Gets whether the given handle references an existing texture object. - * - * Returns: %TRUE if the handle references a texture, - * %FALSE otherwise - */ -gboolean cogl_is_texture (CoglHandle handle); - -/** - * cogl_texture_get_width: - * @handle: a #CoglHandle for a texture. - * - * Query the width of a cogl texture. - * - * Returns: the width of the GPU side texture in pixels: - */ -guint cogl_texture_get_width (CoglHandle handle); - -/** - * cogl_texture_get_height: - * @handle: a #CoglHandle for a texture. - * - * Query the height of a cogl texture. - * - * Returns: the height of the GPU side texture in pixels: - */ -guint cogl_texture_get_height (CoglHandle handle); - -/** - * cogl_texture_get_format: - * @handle: a #CoglHandle for a texture. - * - * Query the #CoglPixelFormat of a cogl texture. - * - * Returns: the #CoglPixelFormat of the GPU side texture. - */ -CoglPixelFormat cogl_texture_get_format (CoglHandle handle); - - -/** - * cogl_texture_get_rowstride: - * @handle: a #CoglHandle for a texture. - * - * Query the rowstride of a cogl texture. - * - * Returns: the offset in bytes between each consequetive row of pixels. - */ -guint cogl_texture_get_rowstride (CoglHandle handle); - -/** - * cogl_texture_get_max_waste: - * @handle: a #CoglHandle for a texture. - * - * Query the maximum wasted (unused) pixels in one dimension of a GPU side - * texture. - * - * Returns: the maximum waste. - */ -gint cogl_texture_get_max_waste (CoglHandle handle); - -/** - * cogl_texture_get_min_filter: - * @handle: a #CoglHandle for a texture. - * - * Query the currently set downscaling filter for a cogl texture. - * - * Returns: the current downscaling filter for a cogl texture. - */ -COGLenum cogl_texture_get_min_filter (CoglHandle handle); - -/** - * cogl_texture_get_mag_filter: - * @handle: a #CoglHandle for a texture. - * - * Query the currently set downscaling filter for a cogl texture. - * - * Returns: the current downscaling filter for a cogl texture. - */ -COGLenum cogl_texture_get_mag_filter (CoglHandle handle); - -/** - * cogl_texture_is_sliced: - * @handle: a #CoglHandle for a texture. - * - * Query if a texture is sliced (stored as multiple GPU side tecture - * objects). - * - * Returns: %TRUE if the texture is sliced, %FALSE if the texture - * is stored as a single GPU texture. - */ -gboolean cogl_texture_is_sliced (CoglHandle handle); - -/** - * cogl_texture_get_gl_texture: - * @handle: a #CoglHandle for a texture. - * @out_gl_handle: pointer to return location for the textures GL handle, or - * NULL. - * @out_gl_target: pointer to return location for the GL target type, or NULL. - * - * Query the GL handles for a GPU side texture through it's #CoglHandle, - * if the texture is spliced the data for the first sub texture will be - * queried. - * - * Returns: %TRUE if the handle was successfully retrieved %FALSE - * if the handle was invalid. - */ -gboolean cogl_texture_get_gl_texture (CoglHandle handle, - GLuint *out_gl_handle, - GLenum *out_gl_target); - -/** - * cogl_texture_get_data: - * @handle: a #CoglHandle for a texture. - * @format: the #CoglPixelFormat to store the texture as. - * @rowstride: the rowstride of @data or retrieved from texture if none is - * specified. - * @data: memory location to write contents of buffer, or %NULL if we're - * only querying the data size through the return value. - * - * Copy the pixel data from a cogl texture to system memory. - * - * Returns: the size of the texture data in bytes (or 0 if the texture - * is not valid.) - */ -gint cogl_texture_get_data (CoglHandle handle, - CoglPixelFormat format, - guint rowstride, - guchar *data); - -/** - * cogl_texture_set_filters: - * @handle: a #CoglHandle. - * @min_filter: the filter used when scaling the texture down. - * @mag_filter: the filter used when magnifying the texture. - * - * Changes the decimation and interpolation filters used when the texture is - * drawn at other scales than 100%. - */ -void cogl_texture_set_filters (CoglHandle handle, - COGLenum min_filter, - COGLenum mag_filter); - - -/** - * cogl_texture_set_region: - * @handle: a #CoglHandle. - * @src_x: upper left coordinate to use from source data. - * @src_y: upper left coordinate to use from source data. - * @dst_x: upper left destination horizontal coordinate. - * @dst_y: upper left destination vertical coordinate. - * @dst_width: width of destination region to write. - * @dst_height: height of destination region to write. - * @width: width of source data buffer. - * @height: height of source data buffer. - * @format: the #CoglPixelFormat used in the source buffer. - * @rowstride: rowstride of source buffer (computed from width if none - * specified) - * @data: the actual pixel data. - * - * Sets the pixels in a rectangular subregion of @handle from an in-memory - * buffer containing pixel data. - * - * Returns: %TRUE if the subregion upload was successful, otherwise %FALSE. - */ -gboolean cogl_texture_set_region (CoglHandle handle, - gint src_x, - gint src_y, - gint dst_x, - gint dst_y, - guint dst_width, - guint dst_height, - gint width, - gint height, - CoglPixelFormat format, - guint rowstride, - const guchar *data); - -/** - * cogl_texture_ref: - * @handle: a @CoglHandle. - * - * Increment the reference count for a cogl texture. - * - * Returns: the @handle. - */ -CoglHandle cogl_texture_ref (CoglHandle handle); - -/** - * cogl_texture_unref: - * @handle: a @CoglHandle. - * - * Deccrement the reference count for a cogl texture. - */ -void cogl_texture_unref (CoglHandle handle); - -/** - * cogl_texture_rectangle: - * @handle: a @CoglHandle. - * @x1: x coordinate upper left on screen. - * @y1: y coordinate upper left on screen. - * @x2: x coordinate lower right on screen. - * @y2: y coordinate lower right on screen. - * @tx1: x part of texture coordinate to use for upper left pixel - * @ty1: y part of texture coordinate to use for upper left pixel - * @tx2: x part of texture coordinate to use for lower right pixel - * @ty2: y part of texture coordinate to use for left pixel - * - * Draw a rectangle from a texture to the display, to draw the entire - * texture pass in @tx1=0.0 @ty1=0.0 @tx2=1.0 @ty2=1.0. - */ -void cogl_texture_rectangle (CoglHandle handle, - ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2, - ClutterFixed tx1, - ClutterFixed ty1, - ClutterFixed tx2, - ClutterFixed ty2); - -/** - * cogl_texture_polygon: - * @handle: A CoglHandle for a texture - * @n_vertices: The length of the vertices array - * @vertices: An array of #CoglTextureVertex structs - * @use_color: %TRUE if the color member of #CoglTextureVertex should be used - * - * Draws a polygon from a texture with the given model and texture - * coordinates. This can be used to draw arbitrary shapes textured - * with a COGL texture. If @use_color is %TRUE then the current COGL - * color will be changed for each vertex using the value specified in - * the color member of #CoglTextureVertex. This can be used for - * example to make the texture fade out by setting the alpha value of - * the color. - * - * All of the texture coordinates must be in the range [0,1] and - * repeating the texture is not supported. - * - * Because of the way this function is implemented it will currently - * only work if either the texture is not sliced or the backend is not - * OpenGL ES and the minifying and magnifying functions are both set - * to CGL_NEAREST. - */ -void cogl_texture_polygon (CoglHandle handle, - guint n_vertices, - CoglTextureVertex *vertices, - gboolean use_color); - -/* Primitives API */ - -/** - * SECTION:cogl-primitives - * @short_description: Functions that draw various primitive shapes and - * allow for construction of more complex paths. - * - * There are three levels on which drawing with cogl can be used. The - * highest level functions construct various simple primitive shapes - * to be either filled or stroked. Using a lower-level set of functions - * more complex and arbitrary paths can be constructed by concatenating - * straight line, bezier curve and arc segments. Additionally there - * are utility functions that draw the most common primitives - rectangles - * and trapezoids - in a maximaly optimized fashion. - * - * When constructing arbitrary paths, the current pen location is - * initialized using the move_to command. The subsequent path segments - * implicitly use the last pen location as their first vertex and move - * the pen location to the last vertex they produce at the end. Also - * there are special versions of functions that allow specifying the - * vertices of the path segments relative to the last pen location - * rather then in the absolute coordinates. - */ - - - -/** - * cogl_color: - * @color: new current @ClutterColor. - * - * Changes the color of cogl's current paint, which is used for filling and stroking - * primitives. - */ -void cogl_color (const ClutterColor *color); - - -/** - * cogl_rectangle: - * @x: X coordinate of the top-left corner - * @y: Y coordinate of the top-left corner - * @width: Width of the rectangle - * @height: Height of the rectangle - * - * Fills a rectangle at the given coordinates with the current - * drawing color in a highly optimizied fashion. - **/ -void cogl_rectangle (gint x, - gint y, - guint width, - guint height); - -/** - * cogl_rectanglex: - * @x: X coordinate of the top-left corner - * @y: Y coordinate of the top-left corner - * @width: Width of the rectangle - * @height: Height of the rectangle - * - * A fixed-point version of cogl_fast_fill_rectangle. - **/ -void cogl_rectanglex (ClutterFixed x, - ClutterFixed y, - ClutterFixed width, - ClutterFixed height); - -/** - * cogl_path_fill: - * - * Fills the constructed shape using the current drawing color. - **/ -void cogl_path_fill (void); - -/** - * cogl_path_stroke: - * - * Strokes the constructed shape using the current drawing color - * and a width of 1 pixel (regardless of the current transformation - * matrix). - **/ -void cogl_path_stroke (void); - - -/** - * cogl_path_move_to: - * @x: X coordinate of the pen location to move to. - * @y: Y coordinate of the pen location to move to. - * - * Clears the previously constructed shape and begins a new path - * contour by moving the pen to the given coordinates. - **/ -void cogl_path_move_to (ClutterFixed x, - ClutterFixed y); - - -/** - * cogl_path_rel_move_to: - * @x: X offset from the current pen location to move the pen to. - * @y: Y offset from the current pen location to move the pen to. - * - * Clears the previously constructed shape and begins a new path - * contour by moving the pen to the given coordinates relative - * to the current pen location. - **/ -void cogl_path_rel_move_to (ClutterFixed x, - ClutterFixed y); - -/** - * cogl_path_line_to: - * @x: X coordinate of the end line vertex - * @y: Y coordinate of the end line vertex - * - * Adds a straight line segment to the current path that ends at the - * given coordinates. - **/ -void cogl_path_line_to (ClutterFixed x, - ClutterFixed y); - -/** - * cogl_path_rel_line_to: - * @x: X offset from the current pen location of the end line vertex - * @y: Y offset from the current pen location of the end line vertex - * - * Adds a straight line segment to the current path that ends at the - * given coordinates relative to the current pen location. - **/ -void cogl_path_rel_line_to (ClutterFixed x, - ClutterFixed y); - - -/** - * cogl_path_arc: - * @center_x: X coordinate of the elliptical arc center - * @center_y: Y coordinate of the elliptical arc center - * @radius_x: X radius of the elliptical arc - * @radius_y: Y radious of the elliptical arc - * @angle_1: Angle in the unit-circle at which the arc begin - * @angle_2: Angle in the unit-circle at which the arc ends - * - * Adds an elliptical arc segment to the current path. A straight line - * segment will link the current pen location with the first vertex - * of the arc. If you perform a move_to to the arcs start just before - * drawing it you create a free standing arc. - **/ -void cogl_path_arc (ClutterFixed center_x, - ClutterFixed center_y, - ClutterFixed radius_x, - ClutterFixed radius_y, - ClutterAngle angle_1, - ClutterAngle angle_2); - - - -/** - * cogl_path_curve_to: - * @x1: X coordinate of the second bezier control point - * @y1: Y coordinate of the second bezier control point - * @x2: X coordinate of the third bezier control point - * @y2: Y coordinate of the third bezier control point - * @x3: X coordinate of the fourth bezier control point - * @y3: Y coordinate of the fourth bezier control point - * - * Adds a cubic bezier curve segment to the current path with the given - * second, third and fourth control points and using current pen location - * as the first control point. - **/ -void cogl_path_curve_to (ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2, - ClutterFixed x3, - ClutterFixed y3); - -/** - * cogl_path_rel_curve_to: - * @x1: X coordinate of the second bezier control point - * @y1: Y coordinate of the second bezier control point - * @x2: X coordinate of the third bezier control point - * @y2: Y coordinate of the third bezier control point - * @x3: X coordinate of the fourth bezier control point - * @y3: Y coordinate of the fourth bezier control point - * - * Adds a cubic bezier curve segment to the current path with the given - * second, third and fourth control points and using current pen location - * as the first control point. The given coordinates are relative to the - * current pen location. - */ -void cogl_path_rel_curve_to (ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2, - ClutterFixed x3, - ClutterFixed y3); - -/** - * cogl_path_close: - * - * Closes the path being constructed by adding a straight line segment - * to it that ends at the first vertex of the path. - **/ -void cogl_path_close (void); - -/** - * cogl_path_line: - * @x1: X coordinate of the start line vertex - * @y1: Y coordinate of the start line vertex - * @x2: X coordinate of the end line vertex - * @y2: Y coordinate of the end line vertex - * - * Clears the previously constructed shape and constructs a straight - * line shape start and ending at the given coordinates. - **/ -void cogl_path_line (ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2); - -/** - * cogl_path_polyline: - * @coords: A pointer to the first element of an array of fixed-point - * values that specify the vertex coordinates. - * @num_points: The total number of vertices. - * - * Clears the previously constructed shape and constructs a series of straight - * line segments, starting from the first given vertex coordinate. Each - * subsequent segment stars where the previous one ended and ends at the next - * given vertex coordinate. - * - * The coords array must contain 2 * num_points values. The first value - * represents the X coordinate of the first vertex, the second value - * represents the Y coordinate of the first vertex, continuing in the same - * fashion for the rest of the vertices. (num_points - 1) segments will - * be constructed. - **/ -void cogl_path_polyline (ClutterFixed *coords, - gint num_points); - - -/** - * cogl_path_polygon: - * @coords: A pointer to the first element of an array of fixed-point - * values that specify the vertex coordinates. - * @num_points: The total number of vertices. - * - * Clears the previously constructed shape and constructs a polygonal - * shape of the given number of vertices. - * - * The coords array must contain 2 * num_points values. The first value - * represents the X coordinate of the first vertex, the second value - * represents the Y coordinate of the first vertex, continuing in the same - * fashion for the rest of the vertices. - **/ -void cogl_path_polygon (ClutterFixed *coords, - gint num_points); - - -/** - * cogl_path_rectangle: - * @x: X coordinate of the top-left corner. - * @y: Y coordinate of the top-left corner. - * @width: Rectangle width. - * @height: Rectangle height. - * - * Clears the previously constructed shape and constructs a rectangular - * shape at the given coordinates. - **/ -void cogl_path_rectangle (ClutterFixed x, - ClutterFixed y, - ClutterFixed width, - ClutterFixed height); - -/** - * cogl_path_ellipse: - * @center_x: X coordinate of the ellipse center - * @center_y: Y coordinate of the ellipse center - * @radius_x: X radius of the ellipse - * @radius_y: Y radius of the ellipse - * - * Clears the previously constructed shape and constructs an ellipse - * shape. - **/ -void cogl_path_ellipse (ClutterFixed center_x, - ClutterFixed center_y, - ClutterFixed radius_x, - ClutterFixed radius_y); - -/** - * cogl_path_round_rectangle: - * @x: X coordinate of the top-left corner - * @y: Y coordinate of the top-left corner - * @width: Width of the rectangle - * @height: Height of the rectangle - * @radius: Radius of the corner arcs. - * @arc_step: Angle increment resolution for subdivision of - * the corner arcs. - * - * Clears the previously constructed shape and constructs a rectangular - * shape with rounded corners. - **/ -void cogl_path_round_rectangle (ClutterFixed x, - ClutterFixed y, - ClutterFixed width, - ClutterFixed height, - ClutterFixed radius, - ClutterAngle arc_step); - -/** - * SECTION:cogl-shaders - * @short_description: Fuctions for accessing the programmable GL pipeline - * - * COGL allows accessing the GL programmable pipeline in order to create - * vertex and fragment shaders. - * - * The only supported format is GLSL shaders. - */ - -/** - * cogl_create_shader: - * @shader_type: CGL_VERTEX_SHADER or CGL_FRAGMENT_SHADER. - * - * Create a new shader handle, use #cogl_shader_source to set the source code - * to be used on it. - * - * Returns: a new shader handle. - */ -CoglHandle cogl_create_shader (COGLenum shader_type); - -/** - * cogl_shader_ref: - * @handle: A #CoglHandle to a shader. - * - * Add an extra reference to a shader. - * - * Returns: @handle - */ -CoglHandle cogl_shader_ref (CoglHandle handle); - -/** - * cogl_shader_unref: - * @handle: A #CoglHandle to a shader. - * - * Removes a reference to a shader. If it was the last reference the - * shader object will be destroyed. - */ -void cogl_shader_unref (CoglHandle handle); - -/** - * cogl_is_shader: - * @handle: A CoglHandle - * - * Gets whether the given handle references an existing shader object. - * - * Returns: %TRUE if the handle references a shader, - * %FALSE otherwise - */ -gboolean cogl_is_shader (CoglHandle handle); - -/** - * cogl_shader_source: - * @shader: #CoglHandle for a shader. - * @source: GLSL shader source. - * - * Replaces the current GLSL source associated with a shader with a new - * one. - */ -void cogl_shader_source (CoglHandle shader, - const gchar *source); -/** - * cogl_shader_compile: - * @handle: #CoglHandle for a shader. - * - * Compiles the shader, no return value, but the shader is now ready for - * linking into a program. - */ -void cogl_shader_compile (CoglHandle handle); - -/** - * cogl_shader_get_info_log: - * @handle: #CoglHandle for a shader. - * @size: maximum number of bytes to retrieve. - * @buffer: location for info log. - * - * Retrieves the information log for a coglobject, can be used in conjunction - * with #cogl_shader_get_parameteriv to retrieve the compiler warnings/error - * messages that caused a shader to not compile correctly, mainly useful for - * debugging purposes. - */ -void cogl_shader_get_info_log (CoglHandle handle, - guint size, - gchar *buffer); - -/** - * cogl_shader_get_parameteriv: - * @handle: #CoglHandle for a shader. - * @pname: the named COGL parameter to retrieve. - * @dest: storage location for COGLint return value. - * - * Retrieve a named parameter from a shader can be used to query to compile - * satus of a shader by passing in CGL_OBJECT_COMPILE_STATUS for @pname. - */ -void cogl_shader_get_parameteriv (CoglHandle handle, - COGLenum pname, - COGLint *dest); - -/** - * cogl_create_program: - * - * Create a new cogl program object that can be used to replace parts of the GL - * rendering pipeline with custom code. - * - * Returns: a new cogl program. - */ -CoglHandle cogl_create_program (void); - -/** - * cogl_program_ref: - * @handle: A #CoglHandle to a program. - * - * Add an extra reference to a program. - * - * Returns: @handle - */ -CoglHandle cogl_program_ref (CoglHandle handle); - -/** - * cogl_program_unref: - * @handle: A #CoglHandle to a program. - * - * Removes a reference to a program. If it was the last reference the - * program object will be destroyed. - */ -void cogl_program_unref (CoglHandle handle); - -/** - * cogl_is_program: - * @handle: A CoglHandle - * - * Gets whether the given handle references an existing program object. - * - * Returns: %TRUE if the handle references a program, - * %FALSE otherwise - */ -gboolean cogl_is_program (CoglHandle handle); - -/** - * cogl_program_attach_shader: - * @program_handle: a #CoglHandle for a shdaer program. - * @shader_handle: a #CoglHandle for a vertex of fragment shader. - * - * Attaches a shader to a program object, a program can have one vertex shader - * and one fragment shader attached. - */ -void cogl_program_attach_shader (CoglHandle program_handle, - CoglHandle shader_handle); - - -/** - * cogl_program_link: - * @handle: a #CoglHandle for a shader program. - * - * Links a program making it ready for use. - */ -void cogl_program_link (CoglHandle handle); - -/** - * cogl_program_use: - * @handle: a #CoglHandle for a shader program or COGL_INVALID_HANDLE. - * - * Activate a specific shader program replacing that part of the GL - * rendering pipeline, if passed in COGL_INVALID_HANDLE the default - * behavior of GL is reinstated. - */ -void cogl_program_use (CoglHandle handle); - -/** - * cogl_program_get_uniform_location: - * @handle: a #CoglHandle for a shader program. - * @uniform_name: the name of a uniform. - * - * Retrieve the location (offset) of a uniform variable in a shader program, a - * uniform is a variable that is constant for all vertices/fragments for a - * shader object and is possible to modify as an external parameter. - * - * Returns: the offset of a uniform in a specified program, this uniform can be - * set using #cogl_program_uniform_1f when the program is in use. - */ -COGLint cogl_program_get_uniform_location - (CoglHandle handle, - const gchar *uniform_name); - - -/** - * cogl_program_uniform_1f: - * @uniform_no: the unform to set. - * @value: the new value of the uniform. - * - * Changes the value of a uniform in the currently used (see #cogl_program_use) - * shader program. - */ -void cogl_program_uniform_1f (COGLint uniform_no, - gfloat value); - -/** - * SECTION:cogl-offscreen - * @short_description: Fuctions for creating and manipulating offscreen - * frame buffer objects - * - * COGL allows creating and operating on FBOs (Framebuffer Objects). - */ - -/* Offscreen api */ - -/** - * cogl_offscreen_new_to_texture: - * @texhandle: - * - * Returns: - */ -CoglHandle cogl_offscreen_new_to_texture (CoglHandle texhandle); - -/** - * cogl_offscreen_new_multisample: - * - * - * Returns: - */ -CoglHandle cogl_offscreen_new_multisample (void); - -/** - * cogl_offscreen_ref: - * @handle: - * - * Returns: - */ -CoglHandle cogl_offscreen_ref (CoglHandle handle); - -/** - * cogl_is_offscreen: - * @handle: A CoglHandle - * - * Gets whether the given handle references an existing offscreen - * buffer object. - * - * Returns: %TRUE if the handle references an offscreen buffer, - * %FALSE otherwise - */ -gboolean cogl_is_offscreen (CoglHandle handle); - -/** - * cogl_offscreen_unref: - * @handle: - * - */ -void cogl_offscreen_unref (CoglHandle handle); - -/** - * cogl_offscreen_blit: - * @src_buffer: - * @dst_buffer: - * - */ -void cogl_offscreen_blit (CoglHandle src_buffer, - CoglHandle dst_buffer); - -/** - * cogl_offscreen_blit_region: - * @src_buffer: - * @dst_buffer: - * @src_x: - * @src_y: - * @src_w: - * @src_h: - * @dst_x: - * @dst_y: - * @dst_w: - * @dst_h: - * - */ -void cogl_offscreen_blit_region (CoglHandle src_buffer, - CoglHandle dst_buffer, - gint src_x, - gint src_y, - gint src_w, - gint src_h, - gint dst_x, - gint dst_y, - gint dst_w, - gint dst_h); - -/** - * cogl_draw_buffer: - * @target: - * @offscreen: - * - */ -void cogl_draw_buffer (CoglBufferTarget target, - CoglHandle offscreen); +void cogl_paint_init (const CoglColor *color); G_END_DECLS +#undef __COGL_H_INSIDE__ + #endif /* __COGL_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/cogl.h.in /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/cogl.h.in --- clutter-0.8.4/clutter/cogl/cogl.h.in 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/cogl.h.in 2009-01-28 16:45:24.000000000 +0000 @@ -23,199 +23,29 @@ * Boston, MA 02111-1307, USA. */ -/* - * COGL - * ==== - * - * 'cogl' is a very simple abstraction layer which wraps GL and GLES. - * - * - * !!!! DO NOT USE THIS API YET OUTSIDE OF CLUTTER CORE !!!! - * THE API WILL FLUCTUATE WILDLY - * - * TODO: - * - Use ClutterReal for fixed/float params. - * - Add Perspective/viewport setup - * - Add Features.. - */ - #ifndef __COGL_H__ #define __COGL_H__ +#define __COGL_H_INSIDE__ + #include -#include -#include -#include -#include #include -G_BEGIN_DECLS - -/* Enum declarations */ - -#define COGL_PIXEL_FORMAT_24 2 -#define COGL_PIXEL_FORMAT_32 3 -#define COGL_A_BIT (1 << 4) -#define COGL_BGR_BIT (1 << 5) -#define COGL_AFIRST_BIT (1 << 6) -#define COGL_PREMULT_BIT (1 << 7) -#define COGL_UNORDERED_MASK 0x0F -#define COGL_UNPREMULT_MASK 0x7F - -/** - * CoglPixelFormat: - * @COGL_PIXEL_FORMAT_ANY: - * @COGL_PIXEL_FORMAT_A_8: - * @COGL_PIXEL_FORMAT_RGB_888: - * @COGL_PIXEL_FORMAT_BGR_888: - * @COGL_PIXEL_FORMAT_RGBA_8888: - * @COGL_PIXEL_FORMAT_BGRA_8888: - * @COGL_PIXEL_FORMAT_ARGB_8888: - * @COGL_PIXEL_FORMAT_ABGR_8888: - * @COGL_PIXEL_FORMAT_RGBA_8888_PRE: - * @COGL_PIXEL_FORMAT_BGRA_8888_PRE: - * @COGL_PIXEL_FORMAT_ARGB_8888_PRE: - * @COGL_PIXEL_FORMAT_ABGR_8888_PRE: - * @COGL_PIXEL_FORMAT_RGB_565: - * @COGL_PIXEL_FORMAT_RGBA_4444: - * @COGL_PIXEL_FORMAT_RGBA_5551: - * @COGL_PIXEL_FORMAT_RGBA_4444_PRE: - * @COGL_PIXEL_FORMAT_RGBA_5551_PRE: - * @COGL_PIXEL_FORMAT_YUV: - * @COGL_PIXEL_FORMAT_G_8: - * - * Pixel formats used by COGL. - */ -typedef enum -{ - COGL_PIXEL_FORMAT_ANY = 0, - COGL_PIXEL_FORMAT_A_8 = 1 | COGL_A_BIT, - - COGL_PIXEL_FORMAT_RGB_565 = 4, - COGL_PIXEL_FORMAT_RGBA_4444 = 5 | COGL_A_BIT, - COGL_PIXEL_FORMAT_RGBA_5551 = 6 | COGL_A_BIT, - COGL_PIXEL_FORMAT_YUV = 7, - COGL_PIXEL_FORMAT_G_8 = 8, - - COGL_PIXEL_FORMAT_RGB_888 = COGL_PIXEL_FORMAT_24, - - COGL_PIXEL_FORMAT_BGR_888 = (COGL_PIXEL_FORMAT_24 | - COGL_BGR_BIT), - - COGL_PIXEL_FORMAT_RGBA_8888 = COGL_PIXEL_FORMAT_32 | - COGL_A_BIT, - - COGL_PIXEL_FORMAT_BGRA_8888 = (COGL_PIXEL_FORMAT_32 | - COGL_A_BIT | - COGL_BGR_BIT), - - COGL_PIXEL_FORMAT_ARGB_8888 = (COGL_PIXEL_FORMAT_32 | - COGL_A_BIT | - COGL_AFIRST_BIT), - - COGL_PIXEL_FORMAT_ABGR_8888 = (COGL_PIXEL_FORMAT_32 | - COGL_A_BIT | - COGL_BGR_BIT | - COGL_AFIRST_BIT), - - COGL_PIXEL_FORMAT_RGBA_8888_PRE = (COGL_PIXEL_FORMAT_32 | - COGL_A_BIT | - COGL_PREMULT_BIT), - - COGL_PIXEL_FORMAT_BGRA_8888_PRE = (COGL_PIXEL_FORMAT_32 | - COGL_A_BIT | - COGL_PREMULT_BIT | - COGL_BGR_BIT), - - COGL_PIXEL_FORMAT_ARGB_8888_PRE = (COGL_PIXEL_FORMAT_32 | - COGL_A_BIT | - COGL_PREMULT_BIT | - COGL_AFIRST_BIT), - - COGL_PIXEL_FORMAT_ABGR_8888_PRE = (COGL_PIXEL_FORMAT_32 | - COGL_A_BIT | - COGL_PREMULT_BIT | - COGL_BGR_BIT | - COGL_AFIRST_BIT), - - COGL_PIXEL_FORMAT_RGBA_4444_PRE = (COGL_PIXEL_FORMAT_RGBA_4444 | - COGL_A_BIT | - COGL_PREMULT_BIT), - - COGL_PIXEL_FORMAT_RGBA_5551_PRE = (COGL_PIXEL_FORMAT_RGBA_5551 | - COGL_A_BIT | - COGL_PREMULT_BIT), - - -} CoglPixelFormat; - -/** - * CoglFeatureFlags: - * @COGL_FEATURE_TEXTURE_RECTANGLE: - * @COGL_FEATURE_TEXTURE_NPOT: - * @COGL_FEATURE_TEXTURE_YUV: - * @COGL_FEATURE_TEXTURE_READ_PIXELS: - * @COGL_FEATURE_SHADERS_GLSL: - * @COGL_FEATURE_OFFSCREEN: - * @COGL_FEATURE_OFFSCREEN_MULTISAMPLE: - * @COGL_FEATURE_OFFSCREEN_BLIT: - * @COGL_FEATURE_FOUR_CLIP_PLANES: - * @COGL_FEATURE_STENCIL_BUFFER: - * - * Flags for the supported features. - */ -typedef enum -{ - COGL_FEATURE_TEXTURE_RECTANGLE = (1 << 1), - COGL_FEATURE_TEXTURE_NPOT = (1 << 2), - COGL_FEATURE_TEXTURE_YUV = (1 << 3), - COGL_FEATURE_TEXTURE_READ_PIXELS = (1 << 4), - COGL_FEATURE_SHADERS_GLSL = (1 << 5), - COGL_FEATURE_OFFSCREEN = (1 << 6), - COGL_FEATURE_OFFSCREEN_MULTISAMPLE = (1 << 7), - COGL_FEATURE_OFFSCREEN_BLIT = (1 << 8), - COGL_FEATURE_FOUR_CLIP_PLANES = (1 << 9), - COGL_FEATURE_STENCIL_BUFFER = (1 << 10) - -} CoglFeatureFlags; - -/** - * CoglBufferTarget: - * @COGL_WINDOW_BUFFER: - * @COGL_MASK_BUFFER: - * @COGL_OFFSCREEN_BUFFER: - * - * - */ -typedef enum -{ - COGL_WINDOW_BUFFER = (1 << 1), - COGL_MASK_BUFFER = (1 << 2), - COGL_OFFSCREEN_BUFFER = (1 << 3) - -} CoglBufferTarget; - -/** - * CoglTextureVertex: - * @x: Model x-coordinate - * @y: Model y-coordinate - * @z: Model z-coordinate - * @tx: Texture x-coordinate - * @ty: Texture y-coordinate - * @color: The color to use at this vertex. This is ignored if - * @use_color is %FALSE when calling cogl_texture_polygon(). - * - * Used to specify vertex information when calling cogl_texture_polygon(). - */ -struct _CoglTextureVertex -{ - ClutterFixed x, y, z; - ClutterFixed tx, ty; - ClutterColor color; -}; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -typedef struct _CoglTextureVertex CoglTextureVertex; +G_BEGIN_DECLS /** * SECTION:cogl @@ -242,31 +72,6 @@ /* Misc */ /** - * COGL_INVALID_HANDLE: - * - * A COGL handle that is not valid, used for unitialized handles as well as - * error conditions. - */ -#define COGL_INVALID_HANDLE NULL - -/** - * CoglHandle: - * - * Type used for storing references to cogl objects, the CoglHandle is - * a fully opaque type without any public data members. - */ -typedef gpointer CoglHandle; - -/** - * CoglFuncPtr: - * - * The type used by cogl for function pointers, note that this type - * is used as a generic catch-all cast for function pointers and the - * actual arguments and return type may be different. - */ -typedef void (* CoglFuncPtr) (void); - -/** * cogl_get_features: * * Returns all of the features supported by COGL. @@ -275,7 +80,7 @@ * * Since: 0.8 */ -ClutterFeatureFlags cogl_get_features (void); +CoglFeatureFlags cogl_get_features (void); /** * cogl_features_available: @@ -341,10 +146,10 @@ * Replaces the current projection matrix with a perspective matrix * based on the provided values. */ -void cogl_perspective (ClutterFixed fovy, - ClutterFixed aspect, - ClutterFixed z_near, - ClutterFixed z_far); +void cogl_perspective (float fovy, + float aspect, + float z_near, + float z_far); /** * cogl_frustum: @@ -360,12 +165,12 @@ * * Since: 0.8.2 */ -void cogl_frustum (ClutterFixed left, - ClutterFixed right, - ClutterFixed bottom, - ClutterFixed top, - ClutterFixed z_near, - ClutterFixed z_far); +void cogl_frustum (float left, + float right, + float bottom, + float top, + float z_near, + float z_far); /** * cogl_setup_viewport: @@ -385,10 +190,10 @@ */ void cogl_setup_viewport (guint width, guint height, - ClutterFixed fovy, - ClutterFixed aspect, - ClutterFixed z_near, - ClutterFixed z_far); + float fovy, + float aspect, + float z_near, + float z_far); /** * cogl_viewport: @@ -421,15 +226,17 @@ * cogl_scale: * @x: Amount to scale along the x-axis * @y: Amount to scale along the y-axis + * @z: Amount to scale along the z-axis * - * Multiplies the current model-view matrix by one that scales the x - * and y axes by the given values. + * Multiplies the current model-view matrix by one that scales the x, + * y and z axes by the given values. */ -void cogl_scale (ClutterFixed x, - ClutterFixed y); +void cogl_scale (float x, + float y, + float z); /** - * cogl_translatex: + * cogl_translate: * @x: Distance to translate along the x-axis * @y: Distance to translate along the y-axis * @z: Distance to translate along the z-axis @@ -437,26 +244,12 @@ * Multiplies the current model-view matrix by one that translates the * model along all three axes according to the given values. */ -void cogl_translatex (ClutterFixed x, - ClutterFixed y, - ClutterFixed z); - -/** - * cogl_translate: - * @x: Distance to translate along the x-axis - * @y: Distance to translate along the y-axis - * @z: Distance to translate along the z-axis - * - * Integer version of cogl_translatex(). Multiplies the current - * model-view matrix by one that translates the model along all three - * axes according to the given values. - */ -void cogl_translate (gint x, - gint y, - gint z); +void cogl_translate (float x, + float y, + float z); /** - * cogl_rotatex: + * cogl_rotate: * @angle: Angle in degrees to rotate. * @x: X-component of vertex to rotate around. * @y: Y-component of vertex to rotate around. @@ -468,55 +261,39 @@ * degrees about the vertex (0, 0, 1) causes a small counter-clockwise * rotation. */ -void cogl_rotatex (ClutterFixed angle, - gint x, - gint y, - gint z); - -/** - * cogl_rotate: - * @angle: Angle in degrees to rotate. - * @x: X-component of vertex to rotate around. - * @y: Y-component of vertex to rotate around. - * @z: Z-component of vertex to rotate around. - * - * Integer version of cogl_rotatex(). Multiplies the current - * model-view matrix by one that rotates the model around the vertex - * specified by @x, @y and @z. - */ -void cogl_rotate (gint angle, - gint x, - gint y, - gint z); +void cogl_rotate (float angle, + float x, + float y, + float z); /** * cogl_get_modelview_matrix: - * @m: pointer to a 4x4 array of #ClutterFixeds to receive the matrix + * @m: pointer to a 4x4 array of #floats to receive the matrix * * Stores the current model-view matrix in @m. The matrix is in * column-major order. */ -void cogl_get_modelview_matrix (ClutterFixed m[16]); +void cogl_get_modelview_matrix (float m[16]); /** * cogl_get_projection_matrix: - * @m: pointer to a 4x4 array of #ClutterFixeds to receive the matrix + * @m: pointer to a 4x4 array of #floats to receive the matrix * * Stores the current projection matrix in @m. The matrix is in * column-major order. */ -void cogl_get_projection_matrix (ClutterFixed m[16]); +void cogl_get_projection_matrix (float m[16]); /** * cogl_get_viewport: - * @v: pointer to a 4 element array of #ClutterFixeds to + * @v: pointer to a 4 element array of #floats to * receive the viewport dimensions. * * Stores the current viewport in @v. @v[0] and @v[1] get the x and y * position of the viewport and @v[2] and @v[3] get the width and * height. */ -void cogl_get_viewport (ClutterFixed v[4]); +void cogl_get_viewport (float v[4]); /** * cogl_clip_set: @@ -530,21 +307,60 @@ * will be clipped so that only the portion inside the rectangle will * be displayed. The rectangle dimensions are transformed by the * current model-view matrix. + * + * The rectangle is intersected with the current clip region. To undo + * the effect of this function, call cogl_clip_unset(). + */ +void cogl_clip_set (float x_offset, + float y_offset, + float width, + float height); + +/** + * cogl_clip_set_from_path: + * + * Sets a new clipping area using the current path. The current path + * is then cleared. The clipping area is intersected with the previous + * clipping area. To restore the previous clipping area, call + * cogl_clip_unset(). + * + * Since: 1.0 + */ +void cogl_clip_set_from_path (void); + +/** + * cogl_clip_set_from_path_preserve: + * + * Sets a new clipping area using the current path. The current path + * is then cleared. The clipping area is intersected with the previous + * clipping area. To restore the previous clipping area, call + * cogl_clip_unset(). + * + * Since: 1.0 */ -void cogl_clip_set (ClutterFixed x_offset, - ClutterFixed y_offset, - ClutterFixed width, - ClutterFixed height); +void cogl_clip_set_from_path_preserve (void); /** * cogl_clip_unset: * - * Removes the current clipping rectangle so that all drawing - * operations extend to full size of the viewport again. + * Reverts the clipping region to the state before the last call to + * cogl_clip_set(). */ void cogl_clip_unset (void); /** + * cogl_clip_ensure: + * + * Ensures that the current clipping region has been set in GL. This + * will automatically be called before any Cogl primitives but it + * maybe be neccessary to call if you are using raw GL calls with + * clipping. + * + * Since: 1.0 + */ +void cogl_clip_ensure (void); + +/** * cogl_clip_stack_save: * * Save the entire state of the clipping stack and then clear all @@ -580,17 +396,16 @@ void cogl_enable_depth_test (gboolean setting); /** - * cogl_alpha_func: - * @func: the comparison function to use, one of CGL_NEVER, CGL_LESS, - * CGL_EQUAL, CGL_LEQUAL, CGL_GREATER, CGL_NOTEQUAL, CGL_GEQUAL and GL_ALWAYS. - * @ref: reference value. - * - * Changes the alpha test to use the specified function specified in @func, - * comparing with the value in @ref. The default function is CGL_ALWAYS the - * initial reference value is 1.0. + * cogl_enable_backface_culling: + * @setting: %TRUE to enable backface culling or %FALSE to disable. + * + * Sets whether textures positioned so that their backface is showing + * should be hidden. This can be used to efficiently draw two-sided + * textures or fully closed cubes without enabling depth testing. Only + * calls to cogl_texture_rectangle() and cogl_texture_polygon() are + * affected. Backface culling is disabled by default. */ -void cogl_alpha_func (COGLenum func, - ClutterFixed ref); +void cogl_enable_backface_culling (gboolean setting); /** * cogl_fog_set: @@ -606,10 +421,10 @@ * with @fog_color. Fogging will remain enabled until the next call to * cogl_paint_init(). */ -void cogl_fog_set (const ClutterColor *fog_color, - ClutterFixed density, - ClutterFixed z_near, - ClutterFixed z_far); +void cogl_fog_set (const CoglColor *fog_color, + float density, + float z_near, + float z_far); /** * cogl_paint_init: @@ -618,964 +433,10 @@ * Clears the color buffer to @color. The depth buffer and stencil * buffers are also cleared and fogging and lighting are disabled. */ -void cogl_paint_init (const ClutterColor *color); - -/** - * SECTION:cogl-texture - * @short_description: Fuctions for creating and manipulating textures - * - * COGL allows creating and manipulating GL textures using a uniform - * API that tries to hide all the various complexities of creating, - * loading and manipulating textures. - */ - -/* Textures api */ - -/** - * cogl_texture_new_with_size: - * @width: width of texture in pixels. - * @height: height of texture in pixels. - * @max_waste: maximum extra horizontal and|or vertical margin pixels to make - * texture fit GPU limitations. - * @auto_mipmap: enable or disable automatic generation of mipmap pyramid - * from the base level image whenever it is updated. - * @internal_format: the #CoglPixelFormat to use for the GPU storage of the - * texture. - * - * Create a new texture with specified dimensions and pixel format. - * - * Returns: a #CoglHandle to the newly created texture or COGL_INVALID_HANDLE - * if texture creation failed. - */ -CoglHandle cogl_texture_new_with_size (guint width, - guint height, - gint max_waste, - gboolean auto_mipmap, - CoglPixelFormat internal_format); - -/** - * cogl_texture_new_from_file: - * @filename: the file to load - * @max_waste: maximum extra horizontal and|or vertical margin pixels to make - * texture fit GPU limitations. - * @auto_mipmap: enable or disable automatic generation of mipmap pyramid - * from the base level image whenever it is updated. - * @internal_format: the #CoglPixelFormat to use for the GPU storage of the - * texture. - * @error: a #GError or NULL. - * - * Load an image file from disk. - * - * Returns: a #CoglHandle to the newly created texture or COGL_INVALID_HANDLE - * if creating the texture failed. - */ -CoglHandle cogl_texture_new_from_file (const gchar *filename, - gint max_waste, - gboolean auto_mipmap, - CoglPixelFormat internal_format, - GError **error); - -/** - * cogl_texture_new_from_data: - * @width: width of texture in pixels. - * @height: height of texture in pixels. - * @max_waste: maximum extra horizontal and|or vertical margin pixels to make - * @auto_mipmap: enable or disable automatic generation of mipmap pyramid - * from the base level image whenever it is updated. - * @format: the #CoglPixelFormat the buffer is stored in in RAM - * @internal_format: the #CoglPixelFormat that will be used for storing the - * buffer on the GPU. - * @rowstride: the memory offset in bytes between the starts of scanlines in - * @data. - * @data: pointer the memory region where the source buffer resides. - * - * Create a new cogl texture based on data residing in memory. - * - * Returns: a #CoglHandle to the newly created texture or COGL_INVALID_HANDLE - * if creating the texture failed. - */ -CoglHandle cogl_texture_new_from_data (guint width, - guint height, - gint max_waste, - gboolean auto_mipmap, - CoglPixelFormat format, - CoglPixelFormat internal_format, - guint rowstride, - const guchar *data); - -/** - * cogl_texture_new_from_foreign: - * @gl_handle: opengl target type of foreign texture - * @gl_target: opengl handle of foreign texture. - * @width: width of foreign texture - * @height: height of foreign texture. - * @x_pot_waste: maximum horizontal waste. - * @y_pot_waste: maximum vertical waste. - * @format: format of the foreign texture. - * - * Create a cogl texture based on an existing OpenGL texture, the width, height - * and format are passed along since it is not possible to query this from a - * handle with GLES 1.0. - * - * Returns: a #CoglHandle to the newly created texture or COGL_INVALID_HANDLE - * if creating the texture failed. - */ -CoglHandle cogl_texture_new_from_foreign (GLuint gl_handle, - GLenum gl_target, - GLuint width, - GLuint height, - GLuint x_pot_waste, - GLuint y_pot_waste, - CoglPixelFormat format); - -/** - * cogl_is_texture: - * @handle: A CoglHandle - * - * Gets whether the given handle references an existing texture object. - * - * Returns: %TRUE if the handle references a texture, - * %FALSE otherwise - */ -gboolean cogl_is_texture (CoglHandle handle); - -/** - * cogl_texture_get_width: - * @handle: a #CoglHandle for a texture. - * - * Query the width of a cogl texture. - * - * Returns: the width of the GPU side texture in pixels: - */ -guint cogl_texture_get_width (CoglHandle handle); - -/** - * cogl_texture_get_height: - * @handle: a #CoglHandle for a texture. - * - * Query the height of a cogl texture. - * - * Returns: the height of the GPU side texture in pixels: - */ -guint cogl_texture_get_height (CoglHandle handle); - -/** - * cogl_texture_get_format: - * @handle: a #CoglHandle for a texture. - * - * Query the #CoglPixelFormat of a cogl texture. - * - * Returns: the #CoglPixelFormat of the GPU side texture. - */ -CoglPixelFormat cogl_texture_get_format (CoglHandle handle); - - -/** - * cogl_texture_get_rowstride: - * @handle: a #CoglHandle for a texture. - * - * Query the rowstride of a cogl texture. - * - * Returns: the offset in bytes between each consequetive row of pixels. - */ -guint cogl_texture_get_rowstride (CoglHandle handle); - -/** - * cogl_texture_get_max_waste: - * @handle: a #CoglHandle for a texture. - * - * Query the maximum wasted (unused) pixels in one dimension of a GPU side - * texture. - * - * Returns: the maximum waste. - */ -gint cogl_texture_get_max_waste (CoglHandle handle); - -/** - * cogl_texture_get_min_filter: - * @handle: a #CoglHandle for a texture. - * - * Query the currently set downscaling filter for a cogl texture. - * - * Returns: the current downscaling filter for a cogl texture. - */ -COGLenum cogl_texture_get_min_filter (CoglHandle handle); - -/** - * cogl_texture_get_mag_filter: - * @handle: a #CoglHandle for a texture. - * - * Query the currently set downscaling filter for a cogl texture. - * - * Returns: the current downscaling filter for a cogl texture. - */ -COGLenum cogl_texture_get_mag_filter (CoglHandle handle); - -/** - * cogl_texture_is_sliced: - * @handle: a #CoglHandle for a texture. - * - * Query if a texture is sliced (stored as multiple GPU side tecture - * objects). - * - * Returns: %TRUE if the texture is sliced, %FALSE if the texture - * is stored as a single GPU texture. - */ -gboolean cogl_texture_is_sliced (CoglHandle handle); - -/** - * cogl_texture_get_gl_texture: - * @handle: a #CoglHandle for a texture. - * @out_gl_handle: pointer to return location for the textures GL handle, or - * NULL. - * @out_gl_target: pointer to return location for the GL target type, or NULL. - * - * Query the GL handles for a GPU side texture through it's #CoglHandle, - * if the texture is spliced the data for the first sub texture will be - * queried. - * - * Returns: %TRUE if the handle was successfully retrieved %FALSE - * if the handle was invalid. - */ -gboolean cogl_texture_get_gl_texture (CoglHandle handle, - GLuint *out_gl_handle, - GLenum *out_gl_target); - -/** - * cogl_texture_get_data: - * @handle: a #CoglHandle for a texture. - * @format: the #CoglPixelFormat to store the texture as. - * @rowstride: the rowstride of @data or retrieved from texture if none is - * specified. - * @data: memory location to write contents of buffer, or %NULL if we're - * only querying the data size through the return value. - * - * Copy the pixel data from a cogl texture to system memory. - * - * Returns: the size of the texture data in bytes (or 0 if the texture - * is not valid.) - */ -gint cogl_texture_get_data (CoglHandle handle, - CoglPixelFormat format, - guint rowstride, - guchar *data); - -/** - * cogl_texture_set_filters: - * @handle: a #CoglHandle. - * @min_filter: the filter used when scaling the texture down. - * @mag_filter: the filter used when magnifying the texture. - * - * Changes the decimation and interpolation filters used when the texture is - * drawn at other scales than 100%. - */ -void cogl_texture_set_filters (CoglHandle handle, - COGLenum min_filter, - COGLenum mag_filter); - - -/** - * cogl_texture_set_region: - * @handle: a #CoglHandle. - * @src_x: upper left coordinate to use from source data. - * @src_y: upper left coordinate to use from source data. - * @dst_x: upper left destination horizontal coordinate. - * @dst_y: upper left destination vertical coordinate. - * @dst_width: width of destination region to write. - * @dst_height: height of destination region to write. - * @width: width of source data buffer. - * @height: height of source data buffer. - * @format: the #CoglPixelFormat used in the source buffer. - * @rowstride: rowstride of source buffer (computed from width if none - * specified) - * @data: the actual pixel data. - * - * Sets the pixels in a rectangular subregion of @handle from an in-memory - * buffer containing pixel data. - * - * Returns: %TRUE if the subregion upload was successful, otherwise %FALSE. - */ -gboolean cogl_texture_set_region (CoglHandle handle, - gint src_x, - gint src_y, - gint dst_x, - gint dst_y, - guint dst_width, - guint dst_height, - gint width, - gint height, - CoglPixelFormat format, - guint rowstride, - const guchar *data); - -/** - * cogl_texture_ref: - * @handle: a @CoglHandle. - * - * Increment the reference count for a cogl texture. - * - * Returns: the @handle. - */ -CoglHandle cogl_texture_ref (CoglHandle handle); - -/** - * cogl_texture_unref: - * @handle: a @CoglHandle. - * - * Deccrement the reference count for a cogl texture. - */ -void cogl_texture_unref (CoglHandle handle); - -/** - * cogl_texture_rectangle: - * @handle: a @CoglHandle. - * @x1: x coordinate upper left on screen. - * @y1: y coordinate upper left on screen. - * @x2: x coordinate lower right on screen. - * @y2: y coordinate lower right on screen. - * @tx1: x part of texture coordinate to use for upper left pixel - * @ty1: y part of texture coordinate to use for upper left pixel - * @tx2: x part of texture coordinate to use for lower right pixel - * @ty2: y part of texture coordinate to use for left pixel - * - * Draw a rectangle from a texture to the display, to draw the entire - * texture pass in @tx1=0.0 @ty1=0.0 @tx2=1.0 @ty2=1.0. - */ -void cogl_texture_rectangle (CoglHandle handle, - ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2, - ClutterFixed tx1, - ClutterFixed ty1, - ClutterFixed tx2, - ClutterFixed ty2); - -/** - * cogl_texture_polygon: - * @handle: A CoglHandle for a texture - * @n_vertices: The length of the vertices array - * @vertices: An array of #CoglTextureVertex structs - * @use_color: %TRUE if the color member of #CoglTextureVertex should be used - * - * Draws a polygon from a texture with the given model and texture - * coordinates. This can be used to draw arbitrary shapes textured - * with a COGL texture. If @use_color is %TRUE then the current COGL - * color will be changed for each vertex using the value specified in - * the color member of #CoglTextureVertex. This can be used for - * example to make the texture fade out by setting the alpha value of - * the color. - * - * All of the texture coordinates must be in the range [0,1] and - * repeating the texture is not supported. - * - * Because of the way this function is implemented it will currently - * only work if either the texture is not sliced or the backend is not - * OpenGL ES and the minifying and magnifying functions are both set - * to CGL_NEAREST. - */ -void cogl_texture_polygon (CoglHandle handle, - guint n_vertices, - CoglTextureVertex *vertices, - gboolean use_color); - -/* Primitives API */ - -/** - * SECTION:cogl-primitives - * @short_description: Functions that draw various primitive shapes and - * allow for construction of more complex paths. - * - * There are three levels on which drawing with cogl can be used. The - * highest level functions construct various simple primitive shapes - * to be either filled or stroked. Using a lower-level set of functions - * more complex and arbitrary paths can be constructed by concatenating - * straight line, bezier curve and arc segments. Additionally there - * are utility functions that draw the most common primitives - rectangles - * and trapezoids - in a maximaly optimized fashion. - * - * When constructing arbitrary paths, the current pen location is - * initialized using the move_to command. The subsequent path segments - * implicitly use the last pen location as their first vertex and move - * the pen location to the last vertex they produce at the end. Also - * there are special versions of functions that allow specifying the - * vertices of the path segments relative to the last pen location - * rather then in the absolute coordinates. - */ - - - -/** - * cogl_color: - * @color: new current @ClutterColor. - * - * Changes the color of cogl's current paint, which is used for filling and stroking - * primitives. - */ -void cogl_color (const ClutterColor *color); - - -/** - * cogl_rectangle: - * @x: X coordinate of the top-left corner - * @y: Y coordinate of the top-left corner - * @width: Width of the rectangle - * @height: Height of the rectangle - * - * Fills a rectangle at the given coordinates with the current - * drawing color in a highly optimizied fashion. - **/ -void cogl_rectangle (gint x, - gint y, - guint width, - guint height); - -/** - * cogl_rectanglex: - * @x: X coordinate of the top-left corner - * @y: Y coordinate of the top-left corner - * @width: Width of the rectangle - * @height: Height of the rectangle - * - * A fixed-point version of cogl_fast_fill_rectangle. - **/ -void cogl_rectanglex (ClutterFixed x, - ClutterFixed y, - ClutterFixed width, - ClutterFixed height); - -/** - * cogl_path_fill: - * - * Fills the constructed shape using the current drawing color. - **/ -void cogl_path_fill (void); - -/** - * cogl_path_stroke: - * - * Strokes the constructed shape using the current drawing color - * and a width of 1 pixel (regardless of the current transformation - * matrix). - **/ -void cogl_path_stroke (void); - - -/** - * cogl_path_move_to: - * @x: X coordinate of the pen location to move to. - * @y: Y coordinate of the pen location to move to. - * - * Clears the previously constructed shape and begins a new path - * contour by moving the pen to the given coordinates. - **/ -void cogl_path_move_to (ClutterFixed x, - ClutterFixed y); - - -/** - * cogl_path_rel_move_to: - * @x: X offset from the current pen location to move the pen to. - * @y: Y offset from the current pen location to move the pen to. - * - * Clears the previously constructed shape and begins a new path - * contour by moving the pen to the given coordinates relative - * to the current pen location. - **/ -void cogl_path_rel_move_to (ClutterFixed x, - ClutterFixed y); - -/** - * cogl_path_line_to: - * @x: X coordinate of the end line vertex - * @y: Y coordinate of the end line vertex - * - * Adds a straight line segment to the current path that ends at the - * given coordinates. - **/ -void cogl_path_line_to (ClutterFixed x, - ClutterFixed y); - -/** - * cogl_path_rel_line_to: - * @x: X offset from the current pen location of the end line vertex - * @y: Y offset from the current pen location of the end line vertex - * - * Adds a straight line segment to the current path that ends at the - * given coordinates relative to the current pen location. - **/ -void cogl_path_rel_line_to (ClutterFixed x, - ClutterFixed y); - - -/** - * cogl_path_arc: - * @center_x: X coordinate of the elliptical arc center - * @center_y: Y coordinate of the elliptical arc center - * @radius_x: X radius of the elliptical arc - * @radius_y: Y radious of the elliptical arc - * @angle_1: Angle in the unit-circle at which the arc begin - * @angle_2: Angle in the unit-circle at which the arc ends - * - * Adds an elliptical arc segment to the current path. A straight line - * segment will link the current pen location with the first vertex - * of the arc. If you perform a move_to to the arcs start just before - * drawing it you create a free standing arc. - **/ -void cogl_path_arc (ClutterFixed center_x, - ClutterFixed center_y, - ClutterFixed radius_x, - ClutterFixed radius_y, - ClutterAngle angle_1, - ClutterAngle angle_2); - - - -/** - * cogl_path_curve_to: - * @x1: X coordinate of the second bezier control point - * @y1: Y coordinate of the second bezier control point - * @x2: X coordinate of the third bezier control point - * @y2: Y coordinate of the third bezier control point - * @x3: X coordinate of the fourth bezier control point - * @y3: Y coordinate of the fourth bezier control point - * - * Adds a cubic bezier curve segment to the current path with the given - * second, third and fourth control points and using current pen location - * as the first control point. - **/ -void cogl_path_curve_to (ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2, - ClutterFixed x3, - ClutterFixed y3); - -/** - * cogl_path_rel_curve_to: - * @x1: X coordinate of the second bezier control point - * @y1: Y coordinate of the second bezier control point - * @x2: X coordinate of the third bezier control point - * @y2: Y coordinate of the third bezier control point - * @x3: X coordinate of the fourth bezier control point - * @y3: Y coordinate of the fourth bezier control point - * - * Adds a cubic bezier curve segment to the current path with the given - * second, third and fourth control points and using current pen location - * as the first control point. The given coordinates are relative to the - * current pen location. - */ -void cogl_path_rel_curve_to (ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2, - ClutterFixed x3, - ClutterFixed y3); - -/** - * cogl_path_close: - * - * Closes the path being constructed by adding a straight line segment - * to it that ends at the first vertex of the path. - **/ -void cogl_path_close (void); - -/** - * cogl_path_line: - * @x1: X coordinate of the start line vertex - * @y1: Y coordinate of the start line vertex - * @x2: X coordinate of the end line vertex - * @y2: Y coordinate of the end line vertex - * - * Clears the previously constructed shape and constructs a straight - * line shape start and ending at the given coordinates. - **/ -void cogl_path_line (ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2); - -/** - * cogl_path_polyline: - * @coords: A pointer to the first element of an array of fixed-point - * values that specify the vertex coordinates. - * @num_points: The total number of vertices. - * - * Clears the previously constructed shape and constructs a series of straight - * line segments, starting from the first given vertex coordinate. Each - * subsequent segment stars where the previous one ended and ends at the next - * given vertex coordinate. - * - * The coords array must contain 2 * num_points values. The first value - * represents the X coordinate of the first vertex, the second value - * represents the Y coordinate of the first vertex, continuing in the same - * fashion for the rest of the vertices. (num_points - 1) segments will - * be constructed. - **/ -void cogl_path_polyline (ClutterFixed *coords, - gint num_points); - - -/** - * cogl_path_polygon: - * @coords: A pointer to the first element of an array of fixed-point - * values that specify the vertex coordinates. - * @num_points: The total number of vertices. - * - * Clears the previously constructed shape and constructs a polygonal - * shape of the given number of vertices. - * - * The coords array must contain 2 * num_points values. The first value - * represents the X coordinate of the first vertex, the second value - * represents the Y coordinate of the first vertex, continuing in the same - * fashion for the rest of the vertices. - **/ -void cogl_path_polygon (ClutterFixed *coords, - gint num_points); - - -/** - * cogl_path_rectangle: - * @x: X coordinate of the top-left corner. - * @y: Y coordinate of the top-left corner. - * @width: Rectangle width. - * @height: Rectangle height. - * - * Clears the previously constructed shape and constructs a rectangular - * shape at the given coordinates. - **/ -void cogl_path_rectangle (ClutterFixed x, - ClutterFixed y, - ClutterFixed width, - ClutterFixed height); - -/** - * cogl_path_ellipse: - * @center_x: X coordinate of the ellipse center - * @center_y: Y coordinate of the ellipse center - * @radius_x: X radius of the ellipse - * @radius_y: Y radius of the ellipse - * - * Clears the previously constructed shape and constructs an ellipse - * shape. - **/ -void cogl_path_ellipse (ClutterFixed center_x, - ClutterFixed center_y, - ClutterFixed radius_x, - ClutterFixed radius_y); - -/** - * cogl_path_round_rectangle: - * @x: X coordinate of the top-left corner - * @y: Y coordinate of the top-left corner - * @width: Width of the rectangle - * @height: Height of the rectangle - * @radius: Radius of the corner arcs. - * @arc_step: Angle increment resolution for subdivision of - * the corner arcs. - * - * Clears the previously constructed shape and constructs a rectangular - * shape with rounded corners. - **/ -void cogl_path_round_rectangle (ClutterFixed x, - ClutterFixed y, - ClutterFixed width, - ClutterFixed height, - ClutterFixed radius, - ClutterAngle arc_step); - -/** - * SECTION:cogl-shaders - * @short_description: Fuctions for accessing the programmable GL pipeline - * - * COGL allows accessing the GL programmable pipeline in order to create - * vertex and fragment shaders. - * - * The only supported format is GLSL shaders. - */ - -/** - * cogl_create_shader: - * @shader_type: CGL_VERTEX_SHADER or CGL_FRAGMENT_SHADER. - * - * Create a new shader handle, use #cogl_shader_source to set the source code - * to be used on it. - * - * Returns: a new shader handle. - */ -CoglHandle cogl_create_shader (COGLenum shader_type); - -/** - * cogl_shader_ref: - * @handle: A #CoglHandle to a shader. - * - * Add an extra reference to a shader. - * - * Returns: @handle - */ -CoglHandle cogl_shader_ref (CoglHandle handle); - -/** - * cogl_shader_unref: - * @handle: A #CoglHandle to a shader. - * - * Removes a reference to a shader. If it was the last reference the - * shader object will be destroyed. - */ -void cogl_shader_unref (CoglHandle handle); - -/** - * cogl_is_shader: - * @handle: A CoglHandle - * - * Gets whether the given handle references an existing shader object. - * - * Returns: %TRUE if the handle references a shader, - * %FALSE otherwise - */ -gboolean cogl_is_shader (CoglHandle handle); - -/** - * cogl_shader_source: - * @shader: #CoglHandle for a shader. - * @source: GLSL shader source. - * - * Replaces the current GLSL source associated with a shader with a new - * one. - */ -void cogl_shader_source (CoglHandle shader, - const gchar *source); -/** - * cogl_shader_compile: - * @handle: #CoglHandle for a shader. - * - * Compiles the shader, no return value, but the shader is now ready for - * linking into a program. - */ -void cogl_shader_compile (CoglHandle handle); - -/** - * cogl_shader_get_info_log: - * @handle: #CoglHandle for a shader. - * @size: maximum number of bytes to retrieve. - * @buffer: location for info log. - * - * Retrieves the information log for a coglobject, can be used in conjunction - * with #cogl_shader_get_parameteriv to retrieve the compiler warnings/error - * messages that caused a shader to not compile correctly, mainly useful for - * debugging purposes. - */ -void cogl_shader_get_info_log (CoglHandle handle, - guint size, - gchar *buffer); - -/** - * cogl_shader_get_parameteriv: - * @handle: #CoglHandle for a shader. - * @pname: the named COGL parameter to retrieve. - * @dest: storage location for COGLint return value. - * - * Retrieve a named parameter from a shader can be used to query to compile - * satus of a shader by passing in CGL_OBJECT_COMPILE_STATUS for @pname. - */ -void cogl_shader_get_parameteriv (CoglHandle handle, - COGLenum pname, - COGLint *dest); - -/** - * cogl_create_program: - * - * Create a new cogl program object that can be used to replace parts of the GL - * rendering pipeline with custom code. - * - * Returns: a new cogl program. - */ -CoglHandle cogl_create_program (void); - -/** - * cogl_program_ref: - * @handle: A #CoglHandle to a program. - * - * Add an extra reference to a program. - * - * Returns: @handle - */ -CoglHandle cogl_program_ref (CoglHandle handle); - -/** - * cogl_program_unref: - * @handle: A #CoglHandle to a program. - * - * Removes a reference to a program. If it was the last reference the - * program object will be destroyed. - */ -void cogl_program_unref (CoglHandle handle); - -/** - * cogl_is_program: - * @handle: A CoglHandle - * - * Gets whether the given handle references an existing program object. - * - * Returns: %TRUE if the handle references a program, - * %FALSE otherwise - */ -gboolean cogl_is_program (CoglHandle handle); - -/** - * cogl_program_attach_shader: - * @program_handle: a #CoglHandle for a shdaer program. - * @shader_handle: a #CoglHandle for a vertex of fragment shader. - * - * Attaches a shader to a program object, a program can have one vertex shader - * and one fragment shader attached. - */ -void cogl_program_attach_shader (CoglHandle program_handle, - CoglHandle shader_handle); - - -/** - * cogl_program_link: - * @handle: a #CoglHandle for a shader program. - * - * Links a program making it ready for use. - */ -void cogl_program_link (CoglHandle handle); - -/** - * cogl_program_use: - * @handle: a #CoglHandle for a shader program or COGL_INVALID_HANDLE. - * - * Activate a specific shader program replacing that part of the GL - * rendering pipeline, if passed in COGL_INVALID_HANDLE the default - * behavior of GL is reinstated. - */ -void cogl_program_use (CoglHandle handle); - -/** - * cogl_program_get_uniform_location: - * @handle: a #CoglHandle for a shader program. - * @uniform_name: the name of a uniform. - * - * Retrieve the location (offset) of a uniform variable in a shader program, a - * uniform is a variable that is constant for all vertices/fragments for a - * shader object and is possible to modify as an external parameter. - * - * Returns: the offset of a uniform in a specified program, this uniform can be - * set using #cogl_program_uniform_1f when the program is in use. - */ -COGLint cogl_program_get_uniform_location - (CoglHandle handle, - const gchar *uniform_name); - - -/** - * cogl_program_uniform_1f: - * @uniform_no: the unform to set. - * @value: the new value of the uniform. - * - * Changes the value of a uniform in the currently used (see #cogl_program_use) - * shader program. - */ -void cogl_program_uniform_1f (COGLint uniform_no, - gfloat value); - -/** - * SECTION:cogl-offscreen - * @short_description: Fuctions for creating and manipulating offscreen - * frame buffer objects - * - * COGL allows creating and operating on FBOs (Framebuffer Objects). - */ - -/* Offscreen api */ - -/** - * cogl_offscreen_new_to_texture: - * @texhandle: - * - * Returns: - */ -CoglHandle cogl_offscreen_new_to_texture (CoglHandle texhandle); - -/** - * cogl_offscreen_new_multisample: - * - * - * Returns: - */ -CoglHandle cogl_offscreen_new_multisample (void); - -/** - * cogl_offscreen_ref: - * @handle: - * - * Returns: - */ -CoglHandle cogl_offscreen_ref (CoglHandle handle); - -/** - * cogl_is_offscreen: - * @handle: A CoglHandle - * - * Gets whether the given handle references an existing offscreen - * buffer object. - * - * Returns: %TRUE if the handle references an offscreen buffer, - * %FALSE otherwise - */ -gboolean cogl_is_offscreen (CoglHandle handle); - -/** - * cogl_offscreen_unref: - * @handle: - * - */ -void cogl_offscreen_unref (CoglHandle handle); - -/** - * cogl_offscreen_blit: - * @src_buffer: - * @dst_buffer: - * - */ -void cogl_offscreen_blit (CoglHandle src_buffer, - CoglHandle dst_buffer); - -/** - * cogl_offscreen_blit_region: - * @src_buffer: - * @dst_buffer: - * @src_x: - * @src_y: - * @src_w: - * @src_h: - * @dst_x: - * @dst_y: - * @dst_w: - * @dst_h: - * - */ -void cogl_offscreen_blit_region (CoglHandle src_buffer, - CoglHandle dst_buffer, - gint src_x, - gint src_y, - gint src_w, - gint src_h, - gint dst_x, - gint dst_y, - gint dst_w, - gint dst_h); - -/** - * cogl_draw_buffer: - * @target: - * @offscreen: - * - */ -void cogl_draw_buffer (CoglBufferTarget target, - CoglHandle offscreen); +void cogl_paint_init (const CoglColor *color); G_END_DECLS +#undef __COGL_H_INSIDE__ + #endif /* __COGL_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/cogl-material.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/cogl-material.h --- clutter-0.8.4/clutter/cogl/cogl-material.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/cogl-material.h 2009-01-28 16:45:24.000000000 +0000 @@ -0,0 +1,837 @@ +#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __COGL_MATERIAL_H__ +#define __COGL_MATERIAL_H__ + +G_BEGIN_DECLS + +#include +#include + +/** + * SECTION:cogl-material + * @short_description: Fuctions for creating and manipulating materials + * + * COGL allows creating and manipulating materials used to fill in + * geometry. Materials may simply be lighting attributes (such as an + * ambient and diffuse colour) or might represent one or more textures + * blended together. + */ + + +/** + * cogl_material_new: + * + * Allocates and initializes a blank white material + * + * Returns: a handle to the new material + */ +CoglHandle cogl_material_new (void); + +/** + * cogl_material_ref: + * @handle: a @CoglHandle. + * + * Increment the reference count for a cogl material. + * + * Returns: the @handle. + * + * Since 1.0 + */ +CoglHandle cogl_material_ref (CoglHandle handle); + +/** + * cogl_material_unref: + * @handle: a @CoglHandle. + * + * Decrement the reference count for a cogl material. + * + * Since 1.0 + */ +void cogl_material_unref (CoglHandle handle); + + + +/** + * cogl_material_set_color: + * @material: A CoglMaterial object + * @color: The components of the color + * + * This is the basic color of the material, used when no lighting is enabled. + * + * The default value is (1.0, 1.0, 1.0, 1.0) + * + * Since 1.0 + */ +void cogl_material_set_color (CoglHandle material, const CoglColor *color); + +/** + * cogl_material_set_color: + * @material: A CoglMaterial object + * @red: The red component + * @green: The green component + * @blue: The blue component + * @alpha: The alpha component + * + * This is the basic color of the material, used when no lighting is enabled. + * + * The default value is (1.0, 1.0, 1.0, 1.0) + * + * Since 1.0 + */ +void cogl_material_set_color4ub (CoglHandle handle, + guint8 red, + guint8 green, + guint8 blue, + guint8 alpha); + +/** + * cogl_material_get_color: + * @material: A CoglMaterial object + * @color: The location to store the color + * + * This retrieves the current material color. + * + * Since 1.0 + */ +void cogl_material_get_color (CoglHandle handle, CoglColor *color); + +/** + * cogl_material_set_ambient: + * @material: A CoglMaterial object + * @ambient: The components of the desired ambient color + * + * Exposing the standard OpenGL lighting model; this function sets + * the material's ambient color. The ambient color affects the overall + * color of the object. Since the diffuse color will be intense when + * the light hits the surface directly, the ambient will most aparent + * where the light hits at a slant. + * + * The default value is (0.2, 0.2, 0.2, 1.0) + * + * Since 1.0 + */ +void cogl_material_set_ambient (CoglHandle material, + const CoglColor *ambient); + +/** + * cogl_material_get_ambient: + * @material: A CoglMaterial object + * @ambient: The location to store the ambient color + * + * This retrieves the materials current ambient color. + * + * Since 1.0 + */ +void cogl_material_get_ambient (CoglHandle handle, CoglColor *ambient); + +/** + * cogl_material_set_diffuse: + * @material: A CoglMaterial object + * @diffuse: The components of the desired diffuse color + * + * Exposing the standard OpenGL lighting model; this function sets + * the material's diffuse color. The diffuse color is most intense + * where the light hits the surface directly; perpendicular to the + * surface. + * + * The default value is (0.8, 0.8, 0.8, 1.0) + * + * Since 1.0 + */ +void cogl_material_set_diffuse (CoglHandle material, + const CoglColor *diffuse); + +/** + * cogl_material_get_diffuse: + * @material: A CoglMaterial object + * @diffuse: The location to store the diffuse color + * + * This retrieves the materials current diffuse color. + * + * Since 1.0 + */ +void cogl_material_get_diffuse (CoglHandle handle, CoglColor *diffuse); + +/** + * cogl_material_set_ambient_and_diffuse: + * @material: A CoglMaterial object + * @color: The components of the desired ambient and diffuse colors + * + * This is a convenience for setting the diffuse and ambient color + * of the material at the same time. + * + * The default ambient color is (0.2, 0.2, 0.2, 1.0) + * The default diffuse color is (0.8, 0.8, 0.8, 1.0) + * + * Since 1.0 + */ +void cogl_material_set_ambient_and_diffuse (CoglHandle material, + const CoglColor *color); + +/** + * cogl_material_set_specular: + * @material: A CoglMaterial object + * @specular: The components of the desired specular color + * + * Exposing the standard OpenGL lighting model; this function sets + * the material's specular color. The intensity of the specular color + * depends on the viewport position, and is brightest along the lines + * of reflection. + * + * The default value is (0.0, 0.0, 0.0, 1.0) + * + * Since 1.0 + */ +void cogl_material_set_specular (CoglHandle material, + const CoglColor *specular); + +/** + * cogl_material_get_specular: + * @material: A CoglMaterial object + * @specular: The location to store the specular color + * + * This retrieves the materials current specular color. + * + * Since 1.0 + */ +void cogl_material_get_specular (CoglHandle handle, CoglColor *specular); + +/** + * cogl_material_set_shininess: + * @material: A CoglMaterial object + * shininess: The desired shininess; range: [0.0, 1.0] + * + * This function sets the materials shininess which determines how + * specular highlights are calculated. A higher shininess will produce + * smaller brigher highlights. + * + * The default value is 0.0 + * + * Since 1.0 + */ +void cogl_material_set_shininess (CoglHandle material, + float shininess); +/** + * cogl_material_get_shininess: + * @material: A CoglMaterial object + * + * This retrieves the materials current emission color. + * + * Return value: The materials current shininess value + * + * Since 1.0 + */ +float cogl_material_get_shininess (CoglHandle handle); + +/** + * cogl_material_set_emission: + * @material: A CoglMaterial object + * @emission: The components of the desired emissive color + * + * Exposing the standard OpenGL lighting model; this function sets + * the material's emissive color. It will look like the surface is + * a light source emitting this color. + * + * The default value is (0.0, 0.0, 0.0, 1.0) + * + * Since 1.0 + */ +void cogl_material_set_emission (CoglHandle material, + const CoglColor *emission); + +/** + * cogl_material_get_emission: + * @material: A CoglMaterial object + * @emission: The location to store the emission color + * + * This retrieves the materials current emission color. + * + * Since 1.0 + */ +void cogl_material_get_emission (CoglHandle handle, CoglColor *emission); + +/** + * CoglMaterialAlphaFunc: + * @COGL_MATERIAL_ALPHA_FUNC_NEVER: Never let the fragment through. + * @COGL_MATERIAL_ALPHA_FUNC_LESS: Let the fragment through if the incoming + * alpha value is less than the reference alpha + * value. + * @COGL_MATERIAL_ALPHA_FUNC_EQUAL: Let the fragment through if the incoming + * alpha value equals the reference alpha + * value. + * @COGL_MATERIAL_ALPHA_FUNC_LEQUAL: Let the fragment through if the incoming + * alpha value is less than or equal to the + * reference alpha value. + * @COGL_MATERIAL_ALPHA_FUNC_GREATER: Let the fragment through if the incoming + * alpha value is greater than the reference + * alpha value. + * @COGL_MATERIAL_ALPHA_FUNC_NOTEQUAL: Let the fragment through if the incoming + * alpha value does not equal the reference + * alpha value. + * @COGL_MATERIAL_ALPHA_FUNC_GEQUAL: Let the fragment through if the incoming + * alpha value is greater than or equal to the + * reference alpha value. + * @COGL_MATERIAL_ALPHA_FUNC_ALWAYS: Always let the fragment through. + * + * Alpha testing happens before blending primitives with the framebuffer and + * gives an opportunity to discard fragments based on a comparison with the + * incoming alpha value and a reference alpha value. The #CoglMaterialAlphaFunc + * determines how the comparison is done. + */ +typedef enum _CoglMaterialAlphaFunc +{ + COGL_MATERIAL_ALPHA_FUNC_NEVER = GL_NEVER, + COGL_MATERIAL_ALPHA_FUNC_LESS = GL_LESS, + COGL_MATERIAL_ALPHA_FUNC_EQUAL = GL_EQUAL, + COGL_MATERIAL_ALPHA_FUNC_LEQUAL = GL_LEQUAL, + COGL_MATERIAL_ALPHA_FUNC_GREATER = GL_GREATER, + COGL_MATERIAL_ALPHA_FUNC_NOTEQUAL = GL_NOTEQUAL, + COGL_MATERIAL_ALPHA_FUNC_GEQUAL = GL_GEQUAL, + COGL_MATERIAL_ALPHA_FUNC_ALWAYS = GL_ALWAYS +} CoglMaterialAlphaFunc; + +/** + * cogl_material_set_alpha_test_function: + * @material: A CoglMaterial object + * @alpha_func: A @CoglMaterialAlphaFunc constant + * @alpha_reference: A reference point that the chosen alpha function uses + * to compare incoming fragments to. + * + * Before a primitive is blended with the framebuffer, it goes through an + * alpha test stage which lets you discard fragments based on the current + * alpha value. This function lets you change the function used to evaluate + * the alpha channel, and thus determine which fragments are discarded + * and which continue on to the blending stage. + * + * The default is COGL_MATERIAL_ALPHA_FUNC_ALWAYS + * + * Since 1.0 + */ +void cogl_material_set_alpha_test_function (CoglHandle material, + CoglMaterialAlphaFunc alpha_func, + float alpha_reference); + +/** + * CoglMaterialBlendFactor: + * @COGL_MATERIAL_BLEND_FACTOR_ZERO: (0, 0, 0, 0) + * @COGL_MATERIAL_BLEND_FACTOR_ONE: (1, 1, 1, 1) + * @COGL_MATERIAL_BLEND_FACTOR_SRC_COLOR: (Rs, Gs, Bs, As) + * @COGL_MATERIAL_BLEND_FACTOR_DST_COLOR: (Rd, Gd, Bd, Ad) + * @COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_SRC_COLOR: (1-Rs, 1-Gs, 1-Bs, 1-As) + * @COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_DST_COLOR: (1-Rd, 1-Gd, 1-Bd, 1-Ad) + * @COGL_MATERIAL_BLEND_FACTOR_SRC_ALPHA: (As, As, As, As) + * @COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA: (1-As, 1-As, 1-As, 1-As) + * @COGL_MATERIAL_BLEND_FACTOR_DST_ALPHA: (Ad, Ad, Ad, Ad) + * @COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_DST_ALPHA: (1-Ad, 1-Ad, 1-Ad, 1-Ad) + * @COGL_MATERIAL_BLEND_FACTOR_SRC_ALPHA_SATURATE: (f,f,f,1) where f=MIN(As,1-Ad) + * + * Blending occurs after the alpha test function, and combines fragments with + * the framebuffer. + * + * A fixed function is used to determine the blended color, which is based on + * the incoming source color of your fragment (Rs, Gs, Bs, As), a source + * factor (Sr, Sg, Sb, Sa), a destination color (Rd, Rg, Rb, Ra) and + * a destination factor (Dr, Dg, Db, Da), and is given by these equations: + * + * + * R = Rs*Sr + Rd*Dr + * G = Gs*Sg + Gd*Dg + * B = Bs*Sb + Bd*Db + * A = As*Sa + Ad*Da + * + * + * All factors have a range [0, 1] + * + * The factors are selected with the following constants: + */ +typedef enum _CoglMaterialBlendFactor +{ + COGL_MATERIAL_BLEND_FACTOR_ZERO = GL_ZERO, + COGL_MATERIAL_BLEND_FACTOR_ONE = GL_ONE, + COGL_MATERIAL_BLEND_FACTOR_SRC_COLOR = GL_SRC_COLOR, + COGL_MATERIAL_BLEND_FACTOR_DST_COLOR = GL_DST_COLOR, + COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = GL_ONE_MINUS_SRC_COLOR, + COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_DST_COLOR = GL_ONE_MINUS_DST_COLOR, + COGL_MATERIAL_BLEND_FACTOR_SRC_ALPHA = GL_SRC_ALPHA, + COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = GL_ONE_MINUS_SRC_ALPHA, + COGL_MATERIAL_BLEND_FACTOR_DST_ALPHA = GL_DST_ALPHA, + COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = GL_ONE_MINUS_DST_ALPHA, + COGL_MATERIAL_BLEND_FACTOR_SRC_ALPHA_SATURATE = GL_SRC_ALPHA_SATURATE, +} CoglMaterialBlendFactor; + +/** + * cogl_material_set_blend_factors: + * @material: A CoglMaterial object + * @src_factor: Chooses the @CoglMaterialBlendFactor you want plugged in to + * the blend equation. + * @dst_factor: Chooses the @CoglMaterialBlendFactor you want plugged in to + * the blend equation. + * + * This function lets you control how primitives using this material will get + * blended with the contents of your framebuffer. The blended RGBA components + * are calculated like this: + * + * (RsSr+RdDr, GsSg+GdDg, BsSb+BsSb, AsSa+AdDa) + * + * Where (Rs,Gs,Bs,As) represents your source - material- color, + * (Rd,Gd,Bd,Ad) represents your destination - framebuffer - color, + * (Sr,Sg,Sb,Sa) represents your source blend factor and + * (Dr,Dg,Db,Da) represents you destination blend factor. + * + * All factors lie in the range [0,1] and incoming color components are also + * normalized to the range [0,1] + * + * Since 1.0 + */ +void cogl_material_set_blend_factors (CoglHandle material, + CoglMaterialBlendFactor src_factor, + CoglMaterialBlendFactor dst_factor); + +/** + * cogl_material_set_layer: + * @material: A CoglMaterial object + * + * In addition to the standard OpenGL lighting model a Cogl material may have + * one or more layers comprised of textures that can be blended together in + * order, with a number of different texture combine modes. This function + * defines a new texture layer. + * + * The index values of multiple layers do not have to be consecutive; it is + * only their relative order that is important. + * + * XXX: In the future, we may define other types of material layers, such + * as purely GLSL based layers. + * + * Since 1.0 + */ +void cogl_material_set_layer (CoglHandle material, + gint layer_index, + CoglHandle texture); + +/** + * cogl_material_add_texture: + * @material: A CoglMaterial object + * @layer_index: Specifies the layer you want to remove + * + * This function removes a layer from your material + */ +void cogl_material_remove_layer (CoglHandle material, + gint layer_index); + +/** + * CoglMaterialLayerCombineFunc: + * @COGL_MATERIAL_LAYER_COMBINE_FUNC_REPLACE: Arg0 + * @COGL_MATERIAL_LAYER_COMBINE_FUNC_MODULATE: Arg0 x Arg1 + * @COGL_MATERIAL_LAYER_COMBINE_FUNC_ADD: Arg0 + Arg1 + * @COGL_MATERIAL_LAYER_COMBINE_FUNC_ADD_SIGNED: Arg0 + Arg1 - 0.5 + * @COGL_MATERIAL_LAYER_COMBINE_FUNC_INTERPOLATE: Arg0 x Arg + Arg1 x (1-Arg2) + * @COGL_MATERIAL_LAYER_COMBINE_FUNC_SUBTRACT: Arg0 - Arg1 + * @COGL_MATERIAL_LAYER_COMBINE_FUNC_DOT3_RGB: 4 x ((Arg0r - 0.5) x (Arg1r - 0.5)) + + * @COGL_MATERIAL_LAYER_COMBINE_FUNC_DOT3_RGBA: ((Arg0b - 0.5) x (Arg1b - 0.5)) + + * + * A material may comprise of 1 or more layers that can be combined using a + * number of different functions. By default layers are modulated, which is + * to say the components of the current source layer S are simply multipled + * together with the combined results of the previous layer P like this: + * + * + * (Rs*Rp, Gs*Gp, Bs*Bp, As*Ap) + * + * + * For more advanced techniques, Cogl exposes the fixed function texture + * combining capabilities of your GPU to give you greater control. + */ +typedef enum _CoglMaterialLayerCombineFunc +{ + COGL_MATERIAL_LAYER_COMBINE_FUNC_REPLACE = GL_REPLACE, + COGL_MATERIAL_LAYER_COMBINE_FUNC_MODULATE = GL_MODULATE, + COGL_MATERIAL_LAYER_COMBINE_FUNC_ADD = GL_ADD, + COGL_MATERIAL_LAYER_COMBINE_FUNC_ADD_SIGNED = GL_ADD_SIGNED, + COGL_MATERIAL_LAYER_COMBINE_FUNC_INTERPOLATE = GL_INTERPOLATE, + COGL_MATERIAL_LAYER_COMBINE_FUNC_SUBTRACT = GL_SUBTRACT, + COGL_MATERIAL_LAYER_COMBINE_FUNC_DOT3_RGB = GL_DOT3_RGB, + COGL_MATERIAL_LAYER_COMBINE_FUNC_DOT3_RGBA = GL_DOT3_RGBA +} CoglMaterialLayerCombineFunc; + +/** + * CoglMaterialLayerCombineChannels: + * @COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGB: Modify the function or argument + * src/op for the RGB components of a + * layer + * @COGL_MATERIAL_LAYER_COMBINE_CHANNELS_ALPHA: Modify the function or argument + * src/op for the Alpha component of a + * layer + * @COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA: Modify the function or argument + * src/op for all the components of a + * layer + * + * Cogl optionally lets you describe 2 seperate combine modes for a single + * layer; 1 for the RGB components, and 1 for the Alpha component, so in this + * case you would repeat the 3 steps documented with the + * @cogl_material_set_layer_combine_function function for each channel + * selector. + * + * (Note: you can't have different modes for each channel, so if you need more + * control you will need to use a glsl fragment shader) + */ +typedef enum _CoglMaterialLayerCombineChannels +{ + COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGB, + COGL_MATERIAL_LAYER_COMBINE_CHANNELS_ALPHA, + COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA +} CoglMaterialLayerCombineChannels; + +/** + * cogl_material_set_layer_combine_function: + * @material: A CoglMaterial object + * @layer_index: Specifies the layer whos combine mode you want to modify + * @channels: Specifies which channels combine mode you want to modify + * (RGB, ALPHA, or RGBA) + * @func: Specifies the function you want to use for combining fragments + * of the specified layer with the results of previously combined + * layers. + * + * There are three basic steps to describing how a layer should be combined: + * + * + * Choose a function. + * + * + * Specify the source color for each argument of the chosen function. (Note + * the functions don't all take the same number of arguments) + * + * + * Specify an operator for each argument that can modify the corresponding + * source color before the function is applied. + * + * + * + * Cogl optionally lets you describe 2 seperate combine modes for a single + * layer; 1 for the RGB components, and 1 for the Alpha component, so in this + * case you would repeat the 3 steps for each channel selector. + * + * (Note: you can't have different modes for each channel, so if you need more + * control you will need to use a glsl fragment shader) + * + * For example here is how you could elect to use the ADD function for all + * components of layer 1 in your material: + * + * //Step 1: Choose a function. Note the ADD function takes 2 arguments... + * cogl_material_set_layer_combine_function (material, + * 1, + * COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA) + * COGL_MATERIAL_LAYER_COMBINE_FUNC_ADD); + * //Step 2: Specify the source color for the 2 ADD function arguments... + * cogl_material_set_layer_combine_arg_src (material, + * 1,//layer index + * 0,//argument index + * COGL_MATERIAL_LAYER_COMBINE_SRC_PREVIOUS); + * cogl_material_set_layer_combine_arg_src (material, + * 1,//layer index + * 1,//argument index + * COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA) + * COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE); + * //Step 3: Specify the operators used to modify the arguments... + * cogl_material_set_layer_combine_arg_op (material, + * 1,//layer index + * 0,//argument index + * COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA, + * COGL_MATERIAL_LAYER_COMBINE_OP_SRC_COLOR); + * cogl_material_set_layer_combine_arg_op (material, + * 1,//layer index + * 1,//argument index + * COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA, + * COGL_MATERIAL_LAYER_COMBINE_OP_SRC_COLOR); + * + */ +void cogl_material_set_layer_combine_function (CoglHandle material, + gint layer_index, + CoglMaterialLayerCombineChannels channels, + CoglMaterialLayerCombineFunc func); + +/** + * CoglMaterialLayerCombineSrc: + * @COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE: The fragment color of the current texture layer + * @COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE0: The fragment color of texture unit 0 + * @COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE1: The fragment color of texture unit 1 + * @COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE2: The fragment color of texture unit 2..7 + * @COGL_MATERIAL_LAYER_COMBINE_SRC_CONSTANT: A fixed constant color (TODO: no API yet to specify the actual color!) + * @COGL_MATERIAL_LAYER_COMBINE_SRC_PRIMARY_COLOR: The basic color of the primitive ignoring texturing + * @COGL_MATERIAL_LAYER_COMBINE_SRC_PREVIOUS: The result of combining all previous layers + * + * Note for the constants @COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE0..n the + * numbers may not correspond to the indices you choose for your layers since + * your layer indices don't need to be contiguous. If you need to use these + * it would probably be sensible to ensure the layer indices do infact + * correspond. + */ +typedef enum _CoglMaterialLayerCombineSrc +{ + COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE = GL_TEXTURE, + + /* Can we find a nicer way... */ + COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE0 = GL_TEXTURE0, + COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE1 = GL_TEXTURE1, + COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE2 = GL_TEXTURE2, + COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE3 = GL_TEXTURE3, + COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE4 = GL_TEXTURE4, + COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE5 = GL_TEXTURE5, + COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE6 = GL_TEXTURE6, + COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE7 = GL_TEXTURE7, + /* .. who would ever need more than 8 texture layers.. :-) */ + + COGL_MATERIAL_LAYER_COMBINE_SRC_CONSTANT = GL_CONSTANT, + COGL_MATERIAL_LAYER_COMBINE_SRC_PRIMARY_COLOR = GL_PRIMARY_COLOR, + COGL_MATERIAL_LAYER_COMBINE_SRC_PREVIOUS = GL_PREVIOUS +} CoglMaterialLayerCombineSrc; + +/** + * cogl_material_set_layer_combine_arg_src: + * @material: A CoglMaterial object + * @layer_index: + * @argument: + * @channels: + * @src: + * + */ +void cogl_material_set_layer_combine_arg_src (CoglHandle material, + gint layer_index, + gint argument, + CoglMaterialLayerCombineChannels channels, + CoglMaterialLayerCombineSrc src); + +typedef enum _CoglMaterialLayerCombineOp +{ + COGL_MATERIAL_LAYER_COMBINE_OP_SRC_COLOR = GL_SRC_COLOR, + COGL_MATERIAL_LAYER_COMBINE_OP_ONE_MINUS_SRC_COLOR = GL_ONE_MINUS_SRC_COLOR, + + COGL_MATERIAL_LAYER_COMBINE_OP_SRC_ALPHA = GL_SRC_ALPHA, + COGL_MATERIAL_LAYER_COMBINE_OP_ONE_MINUS_SRC_ALPHA = GL_ONE_MINUS_SRC_ALPHA +} CoglMaterialLayerCombineOp; + +/** + * cogl_material_set_layer_combine_arg_op: + * @material: A CoglMaterial object + * @layer_index: + * @argument: + * @channels: + * @op: + * + */ +void cogl_material_set_layer_combine_arg_op (CoglHandle material, + gint layer_index, + gint argument, + CoglMaterialLayerCombineChannels channels, + CoglMaterialLayerCombineOp op); + +/* TODO: */ +#if 0 + I think it would be be really neat to support a simple string description + of the fixed function texture combine modes exposed above. I think we can + consider this stuff to be set in stone from the POV that more advanced + texture combine functions are catered for with GLSL, so it seems reasonable + to find a concise string representation that can represent all the above + modes in a *much* more readable/useable fashion. I think somthing like + this would be quite nice: + + "MODULATE(TEXTURE[RGB], PREVIOUS[A])" + "ADD(TEXTURE[A],PREVIOUS[RGB])" + "INTERPOLATE(TEXTURE[1-A], PREVIOUS[RGB])" + +void cogl_material_set_layer_rgb_combine (CoglHandle material + gint layer_index, + const char *combine_description); +void cogl_material_set_layer_alpha_combine (CoglHandle material + gint layer_index, + const char *combine_description); +#endif + +/** + * cogl_material_set_layer_matrix: + * @material: A CoglMaterial object + * + * This function lets you set a matrix that can be used to e.g. translate + * and rotate a single layer of a material used to fill your geometry. + */ +void cogl_material_set_layer_matrix (CoglHandle material, + gint layer_index, + CoglMatrix *matrix); + +/** + * cogl_material_get_cogl_enable_flags: + * @material: A CoglMaterial object + * + * This determines what flags need to be passed to cogl_enable before + * this material can be used. Normally you shouldn't need to use this + * function directly since Cogl will do this internally, but if you are + * developing custom primitives directly with OpenGL you may want to use + * this. + * + * Note: This API is hopfully just a stop-gap solution. Ideally + * cogl_enable will be replaced. + */ +/* TODO: find a nicer solution! */ +gulong +cogl_material_get_cogl_enable_flags (CoglHandle handle); + +/** + * cogl_material_get_layers: + * @material: A CoglMaterial object + * + * This function lets you access a materials internal list of layers + * for iteration. + * + * Note: Normally you shouldn't need to use this function directly since + * Cogl will do this internally, but if you are developing custom primitives + * directly with OpenGL, you will need to iterate the layers that you want + * to texture with. + * + * Note: This function may return more layers than OpenGL can use at once + * so it's your responsability limit yourself to + * CGL_MAX_COMBINED_TEXTURE_IMAGE_UNITS. + * + * Note: It's a bit out of the ordinary to return a const GList *, but it + * was considered sensible to try and avoid list manipulation for every + * primitive emitted in a scene, every frame. + */ +const GList *cogl_material_get_layers (CoglHandle material_handle); + +/** + * CoglMaterialLayerType: + * @COGL_MATERIAL_LAYER_TYPE_TEXTURE: The layer represents a CoglTexture + */ +typedef enum _CoglMaterialLayerType +{ + COGL_MATERIAL_LAYER_TYPE_TEXTURE +} CoglMaterialLayerType; + +/** + * cogl_material_layer_get_type: + * @material: A CoglMaterial object + * + * Currently there is only one type of layer defined: + * COGL_MATERIAL_LAYER_TYPE_TEXTURE, but considering we may add purely GLSL + * based layers in the future, you should write code that checks the type + * first. + * + * Note: Normally you shouldn't need to use this function directly since + * Cogl will do this internally, but if you are developing custom primitives + * directly with OpenGL, you will need to iterate the layers that you want + * to texture with, and thus should be checking the layer types. + */ +CoglMaterialLayerType cogl_material_layer_get_type (CoglHandle layer_handle); + +/** + * cogl_material_layer_get_texture: + * @layer_handle: A CoglMaterial layer object + * + * This lets you extract a CoglTexture handle for a specific layer. Normally + * you shouldn't need to use this function directly since Cogl will do this + * internally, but if you are developing custom primitives directly with + * OpenGL you may need this. + * + * Note: In the future, we may support purely GLSL based layers which will + * likley return COGL_INVALID_HANDLE if you try to get the texture. + * Considering this, you should always call cogl_material_layer_get_type + * first, to check it is of type COGL_MATERIAL_LAYER_TYPE_TEXTURE. + */ +CoglHandle cogl_material_layer_get_texture (CoglHandle layer_handle); + +/** + * CoglMaterialLayerFlags: + * @COGL_MATERIAL_LAYER_FLAG_USER_MATRIX: Means the user has supplied a + * custom texture matrix. + */ +typedef enum _CoglMaterialLayerFlags +{ + COGL_MATERIAL_LAYER_FLAG_HAS_USER_MATRIX = 1L<<0 +} CoglMaterialLayerFlags; +/* XXX: NB: if you add flags here you will need to update + * CoglMaterialLayerPrivFlags!!! */ + +/** + * cogl_material_layer_get_flags: + * @layer_handle: A CoglMaterial layer object + * + * This lets you get a number of flag attributes about the layer. Normally + * you shouldn't need to use this function directly since Cogl will do this + * internally, but if you are developing custom primitives directly with + * OpenGL you may need this. + */ +gulong cogl_material_layer_get_flags (CoglHandle layer_handle); + +/** + * CoglMaterialFlushOption: + * @COGL_MATERIAL_FLUSH_FALLBACK_MASK: Follow this by a guin32 mask + * of the layers that can't be supported with the user supplied texture + * and need to be replaced with fallback textures. (1 = fallback, and the + * least significant bit = layer 0) + * @COGL_MATERIAL_FLUSH_DISABLE_MASK: Follow this by a guint32 mask + * of the layers that you want to completly disable texturing for + * (1 = fallback, and the least significant bit = layer 0) + * @COGL_MATERIAL_FLUSH_LAYER0_OVERRIDE: Follow this by a GLuint OpenGL texture + * name to override the texture used for layer 0 of the material. This is + * intended for dealing with sliced textures where you will need to point + * to each of the texture slices in turn when drawing your geometry. + * Passing a value of 0 is the same as not passing the option at all. + */ +typedef enum _CoglMaterialFlushOption +{ + COGL_MATERIAL_FLUSH_FALLBACK_MASK = 1, + COGL_MATERIAL_FLUSH_DISABLE_MASK, + COGL_MATERIAL_FLUSH_LAYER0_OVERRIDE, +} CoglMaterialFlushOption; + +/** + * cogl_material_flush_gl_state: + * @material: A CoglMaterial object + * @...: A NULL terminated list of (CoglMaterialFlushOption, data) pairs + * + * This function commits the state of the specified CoglMaterial - including + * the texture state for all the layers - to the OpenGL[ES] driver. + * + * Normally you shouldn't need to use this function directly, but if you + * are developing a custom primitive using raw OpenGL that works with + * CoglMaterials, then you may want to use this function. + * + * Since 1.0 + */ +void cogl_material_flush_gl_state (CoglHandle material, + ...) G_GNUC_NULL_TERMINATED; + +/** + * cogl_set_source: + * @material: A CoglMaterial object + * + * This function sets the source material that will be used to fill + * subsequent geometry emitted via the cogl API. + * + * Note: in the future we may add the ability to set a front facing + * material, and a back facing material, in which case this function + * will set both to the same. + * + * Since 1.0 + */ +/* XXX: This doesn't really belong to the cogl-material API, it should + * move to cogl.h */ +void cogl_set_source (CoglHandle material); + +/** + * cogl_set_source_texture: + * @texture_handle: The Cogl texture you want as your source + * + * This is a convenience function for creating a material with the first + * layer set to #texture_handle and setting that material as the source with + * cogl_set_source. + * + * Since 1.0 + */ +void cogl_set_source_texture (CoglHandle texture_handle); + +G_END_DECLS + +#endif /* __COGL_MATERIAL_H__ */ + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/cogl-matrix.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/cogl-matrix.h --- clutter-0.8.4/clutter/cogl/cogl-matrix.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/cogl-matrix.h 2009-01-28 16:45:24.000000000 +0000 @@ -0,0 +1,146 @@ +#ifndef __COGL_MATRIX_H +#define __COGL_MATRIX_H + +#include + +G_BEGIN_DECLS + +/** + * SECTION:cogl-matrix + * @short_description: Fuctions for initializing and manipulating 4x4 + * matrices. + * + * Matrices are used in Cogl to describe affine model-view transforms and + * texture transforms, and projective transforms. This exposes a utility API + * that can be used for direct manipulation of these matrices. + */ + + +/** + * CoglMatrix: + * + * A CoglMatrix holds a 4x4 transform matrix. This is a single precision, + * column-major matrix which means it is compatible with what OpenGL expects. + * + * A CoglMatix can represent transforms such as, rotations, scaling, + * translation, sheering, and linear projections. You can combine these + * transforms by multiplying multiple matrices in the order you want them + * applied. + * + * The transformation of a vertex (x, y, z, w) by a CoglMatrix is given by: + * + * x_new = xx * x + xy * y + xz * z + xw * w + * y_new = yx * x + yy * y + yz * z + yw * w + * z_new = zx * x + zy * y + zz * z + zw * w + * w_new = wx * x + wy * y + wz * z + ww * w + * + * Where w is normally 1 + */ +typedef struct _CoglMatrix { + /* column 0 */ + float xx; + float yx; + float zx; + float wx; + + /* column 1 */ + float xy; + float yy; + float zy; + float wy; + + /* column 2 */ + float xz; + float yz; + float zz; + float wz; + + /* column 3 */ + float xw; + float yw; + float zw; + float ww; + + /*< private >*/ + + /* Note: we may want to extend this later with private flags + * and a cache of the inverse transform matrix. */ +} CoglMatrix; + +/** + * cogl_matrix_init_identity: + * @matrix: A 4x4 transformation matrix + * + * Resets matrix to the identity matrix: + * + * .xx=1; .xy=0; .xz=0; .xw=0; + * .yx=0; .yy=1; .yz=0; .yw=0; + * .zx=0; .zy=0; .zz=1; .zw=0; + * .wx=0; .wy=0; .wz=0; .ww=1; + * + */ +void cogl_matrix_init_identity (CoglMatrix *matrix); + +/** + * cogl_matrix_multiply: + * @result: The address of a 4x4 matrix to store the result in + * @a: A 4x4 transformation matrix + * @b: A 4x4 transformation matrix + * + * This function multiples the two supplied matricies together and stores + * the result in #result + */ +void cogl_matrix_multiply (CoglMatrix *result, + const CoglMatrix *a, + const CoglMatrix *b); + +/** + * cogl_matrix_rotate: + * @matrix: A 4x4 transformation matrix + * @angle: The angle you want to rotate in degrees + * @x: X component of your rotation vector + * @y: Y component of your rotation vector + * @z: Z component of your rotation vector + * + * This function multiples your matrix with a rotation matrix that applies + * a rotation of #angle degrees around the specified 3D vector. + */ +void cogl_matrix_rotate (CoglMatrix *matrix, + float angle, + float x, + float y, + float z); + +/* cogl_matrix_translate: + * @matrix: A 4x4 transformation matrix + * @x: The X translation you want to apply + * @y: The Y translation you want to apply + * @z: The Z translation you want to apply + * + * This function multiples your matrix with a transform matrix that translates + * along the X, Y and Z axis. + */ +void cogl_matrix_translate (CoglMatrix *matrix, + float x, + float y, + float z); + +/** + * cogl_matrix_scale: + * @matrix: A 4x4 transformation matrix + * @sx: The X scale factor + * @sy: The Y scale factor + * @sz: The Z scale factor + * + * This function multiples your matrix with a transform matrix that scales + * along the X, Y and Z axis. + */ +void cogl_matrix_scale (CoglMatrix *matrix, + float sx, + float sy, + float sz); + +G_END_DECLS + +#endif /* __COGL_MATRIX_H */ + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/cogl-offscreen.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/cogl-offscreen.h --- clutter-0.8.4/clutter/cogl/cogl-offscreen.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/cogl-offscreen.h 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,129 @@ +/* cogl-offscreen.h: Offscreen objects + * This file is part of Clutter + * + * Copyright (C) 2008 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 . + */ + +#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __COGL_OFFSCREEN_H__ +#define __COGL_OFFSCREEN_H__ + +#include + +G_BEGIN_DECLS + +/** + * SECTION:cogl-offscreen + * @short_description: Fuctions for creating and manipulating offscreen + * frame buffer objects + * + * COGL allows creating and operating on FBOs (Framebuffer Objects). + */ + +/* Offscreen api */ + +/** + * cogl_offscreen_new_to_texture: + * @texhandle: + * + * Returns: + */ +CoglHandle cogl_offscreen_new_to_texture (CoglHandle texhandle); + +/** + * cogl_offscreen_new_multisample: + * + * + * Returns: + */ +CoglHandle cogl_offscreen_new_multisample (void); + +/** + * cogl_offscreen_ref: + * @handle: + * + * Returns: + */ +CoglHandle cogl_offscreen_ref (CoglHandle handle); + +/** + * cogl_is_offscreen: + * @handle: A CoglHandle + * + * Gets whether the given handle references an existing offscreen + * buffer object. + * + * Returns: %TRUE if the handle references an offscreen buffer, + * %FALSE otherwise + */ +gboolean cogl_is_offscreen (CoglHandle handle); + +/** + * cogl_offscreen_unref: + * @handle: + * + */ +void cogl_offscreen_unref (CoglHandle handle); + +/** + * cogl_offscreen_blit: + * @src_buffer: + * @dst_buffer: + * + */ +void cogl_offscreen_blit (CoglHandle src_buffer, + CoglHandle dst_buffer); + +/** + * cogl_offscreen_blit_region: + * @src_buffer: + * @dst_buffer: + * @src_x: + * @src_y: + * @src_w: + * @src_h: + * @dst_x: + * @dst_y: + * @dst_w: + * @dst_h: + * + */ +void cogl_offscreen_blit_region (CoglHandle src_buffer, + CoglHandle dst_buffer, + gint src_x, + gint src_y, + gint src_w, + gint src_h, + gint dst_x, + gint dst_y, + gint dst_w, + gint dst_h); + +/** + * cogl_draw_buffer: + * @target: + * @offscreen: + * + */ +void cogl_draw_buffer (CoglBufferTarget target, + CoglHandle offscreen); + +G_END_DECLS + +#endif /* __COGL_OFFSCREEN_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/cogl-path.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/cogl-path.h --- clutter-0.8.4/clutter/cogl/cogl-path.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/cogl-path.h 2009-01-29 08:31:37.000000000 +0000 @@ -0,0 +1,343 @@ +/* cogl-path.h: Path primitives + * This file is part of Clutter + * + * Copyright (C) 2008 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 . + */ + +#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __COGL_PATH_H__ +#define __COGL_PATH_H__ + +#include + +G_BEGIN_DECLS + +/** + * SECTION:cogl-primitives + * @short_description: Functions that draw various primitive shapes and + * allow for construction of more complex paths. + * + * There are three levels on which drawing with cogl can be used. The + * highest level functions construct various simple primitive shapes + * to be either filled or stroked. Using a lower-level set of functions + * more complex and arbitrary paths can be constructed by concatenating + * straight line, bezier curve and arc segments. Additionally there + * are utility functions that draw the most common primitives - rectangles + * and trapezoids - in a maximaly optimized fashion. + * + * When constructing arbitrary paths, the current pen location is + * initialized using the move_to command. The subsequent path segments + * implicitly use the last pen location as their first vertex and move + * the pen location to the last vertex they produce at the end. Also + * there are special versions of functions that allow specifying the + * vertices of the path segments relative to the last pen location + * rather then in the absolute coordinates. + */ + +/** + * cogl_rectangle: + * @x1: X coordinate of the top-left corner + * @y1: Y coordinate of the top-left corner + * @x2: X coordinate of the bottom-right corner + * @y2: Y coordinate of the bottom-right corner + * + * Fills a rectangle at the given coordinates with the current source material + **/ +void cogl_rectangle (float x1, + float y1, + float x2, + float y2); + +/** + * cogl_path_fill: + * + * Fills the constructed shape using the current drawing color. The + * current path is then cleared. To use the path again, call + * cogl_path_fill_preserve() instead. + **/ +void cogl_path_fill (void); + +/** + * cogl_path_fill_preserve: + * + * Fills the constructed shape using the current drawing color and + * preserves the path to be used again. + * + * Since: 1.0 + **/ +void cogl_path_fill_preserve (void); + +/** + * cogl_path_stroke: + * + * Strokes the constructed shape using the current drawing color and a + * width of 1 pixel (regardless of the current transformation + * matrix). To current path is then cleared. To use the path again, + * call cogl_path_stroke_preserve() instead. + **/ +void cogl_path_stroke (void); + + +/** + * cogl_path_stroke_preserve: + * + * Strokes the constructed shape using the current drawing color and + * preserves the path to be used again. + * + * Since: 1.0 + **/ +void cogl_path_stroke_preserve (void); + +/** + * cogl_path_new: + * + * Clears the current path and starts a new one. + * + * Since: 1.0 + */ +void cogl_path_new (void); + +/** + * cogl_path_move_to: + * @x: X coordinate of the pen location to move to. + * @y: Y coordinate of the pen location to move to. + * + * Moves the pen to the given location. If there is an existing path + * this will start a new disjoint subpath. + **/ +void cogl_path_move_to (float x, + float y); + + +/** + * cogl_path_rel_move_to: + * @x: X offset from the current pen location to move the pen to. + * @y: Y offset from the current pen location to move the pen to. + * + * Moves the pen to the given offset relative to the current pen + * location. If there is an existing path this will start a new + * disjoint subpath. + **/ +void cogl_path_rel_move_to (float x, + float y); + +/** + * cogl_path_line_to: + * @x: X coordinate of the end line vertex + * @y: Y coordinate of the end line vertex + * + * Adds a straight line segment to the current path that ends at the + * given coordinates. + **/ +void cogl_path_line_to (float x, + float y); + +/** + * cogl_path_rel_line_to: + * @x: X offset from the current pen location of the end line vertex + * @y: Y offset from the current pen location of the end line vertex + * + * Adds a straight line segment to the current path that ends at the + * given coordinates relative to the current pen location. + **/ +void cogl_path_rel_line_to (float x, + float y); + + +/** + * cogl_path_arc: + * @center_x: X coordinate of the elliptical arc center + * @center_y: Y coordinate of the elliptical arc center + * @radius_x: X radius of the elliptical arc + * @radius_y: Y radious of the elliptical arc + * @angle_1: Angle in the unit-circle at which the arc begin + * @angle_2: Angle in the unit-circle at which the arc ends + * + * Adds an elliptical arc segment to the current path. A straight line + * segment will link the current pen location with the first vertex + * of the arc. If you perform a move_to to the arcs start just before + * drawing it you create a free standing arc. + **/ +void cogl_path_arc (float center_x, + float center_y, + float radius_x, + float radius_y, + float angle_1, + float angle_2); + + + +/** + * cogl_path_curve_to: + * @x1: X coordinate of the second bezier control point + * @y1: Y coordinate of the second bezier control point + * @x2: X coordinate of the third bezier control point + * @y2: Y coordinate of the third bezier control point + * @x3: X coordinate of the fourth bezier control point + * @y3: Y coordinate of the fourth bezier control point + * + * Adds a cubic bezier curve segment to the current path with the given + * second, third and fourth control points and using current pen location + * as the first control point. + **/ +void cogl_path_curve_to (float x1, + float y1, + float x2, + float y2, + float x3, + float y3); + +/** + * cogl_path_rel_curve_to: + * @x1: X coordinate of the second bezier control point + * @y1: Y coordinate of the second bezier control point + * @x2: X coordinate of the third bezier control point + * @y2: Y coordinate of the third bezier control point + * @x3: X coordinate of the fourth bezier control point + * @y3: Y coordinate of the fourth bezier control point + * + * Adds a cubic bezier curve segment to the current path with the given + * second, third and fourth control points and using current pen location + * as the first control point. The given coordinates are relative to the + * current pen location. + */ +void cogl_path_rel_curve_to (float x1, + float y1, + float x2, + float y2, + float x3, + float y3); + +/** + * cogl_path_close: + * + * Closes the path being constructed by adding a straight line segment + * to it that ends at the first vertex of the path. + **/ +void cogl_path_close (void); + +/** + * cogl_path_line: + * @x1: X coordinate of the start line vertex + * @y1: Y coordinate of the start line vertex + * @x2: X coordinate of the end line vertex + * @y2: Y coordinate of the end line vertex + * + * Constructs a straight line shape starting and ending at the given + * coordinates. If there is an existing path this will start a new + * disjoint sub-path. + **/ +void cogl_path_line (float x1, + float y1, + float x2, + float y2); + +/** + * cogl_path_polyline: + * @coords: A pointer to the first element of an array of fixed-point + * values that specify the vertex coordinates. + * @num_points: The total number of vertices. + * + * Constructs a series of straight line segments, starting from the + * first given vertex coordinate. If there is an existing path this + * will start a new disjoint sub-path. Each subsequent segment starts + * where the previous one ended and ends at the next given vertex + * coordinate. + * + * The coords array must contain 2 * num_points values. The first value + * represents the X coordinate of the first vertex, the second value + * represents the Y coordinate of the first vertex, continuing in the same + * fashion for the rest of the vertices. (num_points - 1) segments will + * be constructed. + **/ +void cogl_path_polyline (float *coords, + gint num_points); + + +/** + * cogl_path_polygon: + * @coords: A pointer to the first element of an array of fixed-point + * values that specify the vertex coordinates. + * @num_points: The total number of vertices. + * + * Constructs a polygonal shape of the given number of vertices. If + * there is an existing path this will start a new disjoint sub-path. + * + * The coords array must contain 2 * num_points values. The first value + * represents the X coordinate of the first vertex, the second value + * represents the Y coordinate of the first vertex, continuing in the same + * fashion for the rest of the vertices. + **/ +void cogl_path_polygon (float *coords, + gint num_points); + + +/** + * cogl_path_rectangle: + * @x: X coordinate of the top-left corner. + * @y: Y coordinate of the top-left corner. + * @width: Rectangle width. + * @height: Rectangle height. + * + * Constructs a rectangular shape at the given coordinates. If there + * is an existing path this will start a new disjoint sub-path. + **/ +void cogl_path_rectangle (float x, + float y, + float width, + float height); + +/** + * cogl_path_ellipse: + * @center_x: X coordinate of the ellipse center + * @center_y: Y coordinate of the ellipse center + * @radius_x: X radius of the ellipse + * @radius_y: Y radius of the ellipse + * + * Constructs an ellipse shape. If there is an existing path this will + * start a new disjoint sub-path. + **/ +void cogl_path_ellipse (float center_x, + float center_y, + float radius_x, + float radius_y); + +/** + * cogl_path_round_rectangle: + * @x: X coordinate of the top-left corner + * @y: Y coordinate of the top-left corner + * @width: Width of the rectangle + * @height: Height of the rectangle + * @radius: Radius of the corner arcs. + * @arc_step: Angle increment resolution for subdivision of + * the corner arcs. + * + * Constructs a rectangular shape with rounded corners. If there is an + * existing path this will start a new disjoint sub-path. + **/ +void cogl_path_round_rectangle (float x, + float y, + float width, + float height, + float radius, + float arc_step); + +G_END_DECLS + +#endif /* __COGL_PATH_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/cogl-shader.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/cogl-shader.h --- clutter-0.8.4/clutter/cogl/cogl-shader.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/cogl-shader.h 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,288 @@ +/* cogl-shader.h: Shaders and programmable pipeline + * This file is part of Clutter + * + * Copyright (C) 2008 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 . + */ + +#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __COGL_SHADER_H__ +#define __COGL_SHADER_H__ + +#include + +G_BEGIN_DECLS + +/** + * SECTION:cogl-shaders + * @short_description: Fuctions for accessing the programmable GL pipeline + * + * COGL allows accessing the GL programmable pipeline in order to create + * vertex and fragment shaders. + * + * The only supported format is GLSL shaders. + */ + +/** + * cogl_create_shader: + * @shader_type: CGL_VERTEX_SHADER or CGL_FRAGMENT_SHADER. + * + * Create a new shader handle, use #cogl_shader_source to set the source code + * to be used on it. + * + * Returns: a new shader handle. + */ +CoglHandle cogl_create_shader (COGLenum shader_type); + +/** + * cogl_shader_ref: + * @handle: A #CoglHandle to a shader. + * + * Add an extra reference to a shader. + * + * Returns: @handle + */ +CoglHandle cogl_shader_ref (CoglHandle handle); + +/** + * cogl_shader_unref: + * @handle: A #CoglHandle to a shader. + * + * Removes a reference to a shader. If it was the last reference the + * shader object will be destroyed. + */ +void cogl_shader_unref (CoglHandle handle); + +/** + * cogl_is_shader: + * @handle: A CoglHandle + * + * Gets whether the given handle references an existing shader object. + * + * Returns: %TRUE if the handle references a shader, + * %FALSE otherwise + */ +gboolean cogl_is_shader (CoglHandle handle); + +/** + * cogl_shader_source: + * @shader: #CoglHandle for a shader. + * @source: GLSL shader source. + * + * Replaces the current GLSL source associated with a shader with a new + * one. + */ +void cogl_shader_source (CoglHandle shader, + const gchar *source); +/** + * cogl_shader_compile: + * @handle: #CoglHandle for a shader. + * + * Compiles the shader, no return value, but the shader is now ready for + * linking into a program. + */ +void cogl_shader_compile (CoglHandle handle); + +/** + * cogl_shader_get_info_log: + * @handle: #CoglHandle for a shader. + * @size: maximum number of bytes to retrieve. + * @buffer: location for info log. + * + * Retrieves the information log for a coglobject, can be used in conjunction + * with #cogl_shader_get_parameteriv to retrieve the compiler warnings/error + * messages that caused a shader to not compile correctly, mainly useful for + * debugging purposes. + */ +void cogl_shader_get_info_log (CoglHandle handle, + guint size, + gchar *buffer); + +/** + * cogl_shader_get_parameteriv: + * @handle: #CoglHandle for a shader. + * @pname: the named COGL parameter to retrieve. + * @dest: storage location for COGLint return value. + * + * Retrieve a named parameter from a shader can be used to query to compile + * satus of a shader by passing in CGL_OBJECT_COMPILE_STATUS for @pname. + */ +void cogl_shader_get_parameteriv (CoglHandle handle, + COGLenum pname, + COGLint *dest); + +/** + * cogl_create_program: + * + * Create a new cogl program object that can be used to replace parts of the GL + * rendering pipeline with custom code. + * + * Returns: a new cogl program. + */ +CoglHandle cogl_create_program (void); + +/** + * cogl_program_ref: + * @handle: A #CoglHandle to a program. + * + * Add an extra reference to a program. + * + * Returns: @handle + */ +CoglHandle cogl_program_ref (CoglHandle handle); + +/** + * cogl_program_unref: + * @handle: A #CoglHandle to a program. + * + * Removes a reference to a program. If it was the last reference the + * program object will be destroyed. + */ +void cogl_program_unref (CoglHandle handle); + +/** + * cogl_is_program: + * @handle: A CoglHandle + * + * Gets whether the given handle references an existing program object. + * + * Returns: %TRUE if the handle references a program, + * %FALSE otherwise + */ +gboolean cogl_is_program (CoglHandle handle); + +/** + * cogl_program_attach_shader: + * @program_handle: a #CoglHandle for a shdaer program. + * @shader_handle: a #CoglHandle for a vertex of fragment shader. + * + * Attaches a shader to a program object, a program can have one vertex shader + * and one fragment shader attached. + */ +void cogl_program_attach_shader (CoglHandle program_handle, + CoglHandle shader_handle); + + +/** + * cogl_program_link: + * @handle: a #CoglHandle for a shader program. + * + * Links a program making it ready for use. + */ +void cogl_program_link (CoglHandle handle); + +/** + * cogl_program_use: + * @handle: a #CoglHandle for a shader program or %COGL_INVALID_HANDLE. + * + * Activate a specific shader program replacing that part of the GL + * rendering pipeline, if passed in %COGL_INVALID_HANDLE the default + * behavior of GL is reinstated. + */ +void cogl_program_use (CoglHandle handle); + +/** + * cogl_program_get_uniform_location: + * @handle: a #CoglHandle for a shader program. + * @uniform_name: the name of a uniform. + * + * Retrieve the location (offset) of a uniform variable in a shader program, + * a uniform is a variable that is constant for all vertices/fragments for a + * shader object and is possible to modify as an external parameter. + * + * Return value: the offset of a uniform in a specified program. + * This uniform can be set using cogl_program_uniform_1f() when the + * program is in use. + */ +COGLint cogl_program_get_uniform_location + (CoglHandle handle, + const gchar *uniform_name); + +/** + * cogl_program_uniform_1f: + * @uniform_no: the unform to set. + * @value: the new value of the uniform. + * + * Changes the value of a floating point uniform in the currently + * used (see cogl_program_use()) shader program. + */ +void cogl_program_uniform_1f (COGLint uniform_no, + gfloat value); + +/** + * cogl_program_uniform_1i: + * @uniform_no: the unform to set. + * @value: the new value of the uniform. + * + * Changes the value of an integer uniform in the currently + * used (see cogl_program_use()) shader program. + */ +void cogl_program_uniform_1i (COGLint uniform_no, + gint value); + + /** + * cogl_program_uniform_float: + * @uniform_no: the uniform to set. + * @size: Size of float vector. + * @count: Size of array of uniforms. + * @value: the new value of the uniform. + * + * Changes the value of a float vector uniform, or uniform array in the + * currently used (see #cogl_program_use) shader program. + */ +void cogl_program_uniform_float (COGLint uniform_no, + gint size, + gint count, + const GLfloat *value); + +/** + * cogl_program_uniform_int: + * @uniform_no: the uniform to set. + * @size: Size of int vector. + * @count: Size of array of uniforms. + * @value: the new value of the uniform. + * + * Changes the value of a int vector uniform, or uniform array in the + * currently used (see cogl_program_use()) shader program. + */ +void cogl_program_uniform_int (COGLint uniform_no, + gint size, + gint count, + const COGLint *value); + +/** + * cogl_program_uniform_matrix: + * @uniform_no: the uniform to set. + * @size: Size of matrix. + * @count: Size of array of uniforms. + * @transpose: Whether to transpose the matrix when setting the uniform. + * @value: the new value of the uniform. + * + * Changes the value of a matrix uniform, or uniform array in the + * currently used (see cogl_program_use()) shader program. The @size + * parameter is used to determine the square size of the matrix. + */ +void cogl_program_uniform_matrix (COGLint uniform_no, + gint size, + gint count, + gboolean transpose, + const GLfloat *value); + +G_END_DECLS + +#endif /* __COGL_SHADER_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/cogl-texture.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/cogl-texture.h --- clutter-0.8.4/clutter/cogl/cogl-texture.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/cogl-texture.h 2009-01-28 16:45:24.000000000 +0000 @@ -0,0 +1,509 @@ +/* cogl-texture.h: Texture objects + * This file is part of Clutter + * + * Copyright (C) 2008 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 . + */ + +#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __COGL_TEXTURE_H__ +#define __COGL_TEXTURE_H__ + +G_BEGIN_DECLS + +#include + +/** + * SECTION:cogl-texture + * @short_description: Fuctions for creating and manipulating textures + * + * COGL allows creating and manipulating GL textures using a uniform + * API that tries to hide all the various complexities of creating, + * loading and manipulating textures. + */ + +/** + * cogl_texture_new_with_size: + * @width: width of texture in pixels. + * @height: height of texture in pixels. + * @max_waste: maximum extra horizontal and|or vertical margin pixels + * to make the texture fit GPU limitations + * @flags: Optional flags for the texture, or %COGL_TEXTURE_NONE + * @internal_format: the #CoglPixelFormat to use for the GPU storage of the + * texture. + * + * Creates a new COGL texture with the specified dimensions and pixel format. + * + * Return value: a #CoglHandle to the newly created texture or + * %COGL_INVALID_HANDLE on failure + * + * Since: 0.8 + */ +CoglHandle cogl_texture_new_with_size (guint width, + guint height, + gint max_waste, + CoglTextureFlags flags, + CoglPixelFormat internal_format); + +/** + * cogl_texture_new_from_file: + * @filename: the file to load + * @max_waste: maximum extra horizontal and|or vertical margin pixels + * to make the texture fit GPU limitations + * @flags: Optional flags for the texture, or %COGL_TEXTURE_NONE + * @internal_format: the #CoglPixelFormat to use for the GPU storage of the + * texture + * @error: return location for a #GError or %NULL + * + * Creates a COGL texture from an image file. + * + * Return value: a #CoglHandle to the newly created texture or + * %COGL_INVALID_HANDLE on failure + * + * Since: 0.8 + */ +CoglHandle cogl_texture_new_from_file (const gchar *filename, + gint max_waste, + CoglTextureFlags flags, + CoglPixelFormat internal_format, + GError **error); + +/** + * cogl_texture_new_from_data: + * @width: width of texture in pixels + * @height: height of texture in pixels + * @max_waste: maximum extra horizontal and|or vertical margin pixels + * to make the texture fit GPU limitations + * @flags: Optional flags for the texture, or %COGL_TEXTURE_NONE + * @format: the #CoglPixelFormat the buffer is stored in in RAM + * @internal_format: the #CoglPixelFormat that will be used for storing + * the buffer on the GPU + * @rowstride: the memory offset in bytes between the starts of + * scanlines in @data + * @data: pointer the memory region where the source buffer resides + * + * Creates a new COGL texture based on data residing in memory. + * + * Return value: a #CoglHandle to the newly created texture or + * %COGL_INVALID_HANDLE on failure + * + * Since: 0.8 + */ +CoglHandle cogl_texture_new_from_data (guint width, + guint height, + gint max_waste, + CoglTextureFlags flags, + CoglPixelFormat format, + CoglPixelFormat internal_format, + guint rowstride, + const guchar *data); + +/** + * cogl_texture_new_from_foreign: + * @gl_handle: opengl target type of foreign texture + * @gl_target: opengl handle of foreign texture. + * @width: width of foreign texture + * @height: height of foreign texture. + * @x_pot_waste: maximum horizontal waste. + * @y_pot_waste: maximum vertical waste. + * @format: format of the foreign texture. + * + * Creates a COGL texture based on an existing OpenGL texture; the + * width, height and format are passed along since it is not possible + * to query this from a handle with GLES 1.0. + * + * Return value: a #CoglHandle to the newly created texture or + * %COGL_INVALID_HANDLE on failure + * + * Since: 0.8 + */ +CoglHandle cogl_texture_new_from_foreign (GLuint gl_handle, + GLenum gl_target, + GLuint width, + GLuint height, + GLuint x_pot_waste, + GLuint y_pot_waste, + CoglPixelFormat format); + +/** + * cogl_texture_new_from_bitmap: + * @bitmap: a #CoglBitmap + * @max_waste: maximum extra horizontal and|or vertical margin pixels + * to make the texture fit GPU limitations + * @flags: Optional flags for the texture, or %COGL_TEXTURE_NONE + * @internal_format: the #CoglPixelFormat to use for the GPU storage of the + * texture + * + * Creates a COGL texture from a #CoglBitmap. + * + * Return value: a #CoglHandle to the newly created texture or + * %COGL_INVALID_HANDLE on failure + * + * Since: 1.0 + */ +CoglHandle cogl_texture_new_from_bitmap (CoglBitmap *bitmap, + gint max_waste, + CoglTextureFlags flags, + CoglPixelFormat internal_format); + +/** + * cogl_is_texture: + * @handle: A CoglHandle + * + * Gets whether the given handle references an existing texture object. + * + * Returns: %TRUE if the handle references a texture, + * %FALSE otherwise + */ +gboolean cogl_is_texture (CoglHandle handle); + +/** + * cogl_texture_get_width: + * @handle: a #CoglHandle for a texture. + * + * Query the width of a cogl texture. + * + * Returns: the width of the GPU side texture in pixels: + */ +guint cogl_texture_get_width (CoglHandle handle); + +/** + * cogl_texture_get_height: + * @handle: a #CoglHandle for a texture. + * + * Query the height of a cogl texture. + * + * Returns: the height of the GPU side texture in pixels: + */ +guint cogl_texture_get_height (CoglHandle handle); + +/** + * cogl_texture_get_format: + * @handle: a #CoglHandle for a texture. + * + * Query the #CoglPixelFormat of a cogl texture. + * + * Returns: the #CoglPixelFormat of the GPU side texture. + */ +CoglPixelFormat cogl_texture_get_format (CoglHandle handle); + + +/** + * cogl_texture_get_rowstride: + * @handle: a #CoglHandle for a texture. + * + * Query the rowstride of a cogl texture. + * + * Returns: the offset in bytes between each consequetive row of pixels. + */ +guint cogl_texture_get_rowstride (CoglHandle handle); + +/** + * cogl_texture_get_max_waste: + * @handle: a #CoglHandle for a texture. + * + * Query the maximum wasted (unused) pixels in one dimension of a GPU side + * texture. + * + * Returns: the maximum waste. + */ +gint cogl_texture_get_max_waste (CoglHandle handle); + +/** + * cogl_texture_get_min_filter: + * @handle: a #CoglHandle for a texture. + * + * Query the currently set downscaling filter for a cogl texture. + * + * Returns: the current downscaling filter for a cogl texture. + */ +COGLenum cogl_texture_get_min_filter (CoglHandle handle); + +/** + * cogl_texture_get_mag_filter: + * @handle: a #CoglHandle for a texture. + * + * Query the currently set downscaling filter for a cogl texture. + * + * Returns: the current downscaling filter for a cogl texture. + */ +COGLenum cogl_texture_get_mag_filter (CoglHandle handle); + +/** + * cogl_texture_is_sliced: + * @handle: a #CoglHandle for a texture. + * + * Query if a texture is sliced (stored as multiple GPU side tecture + * objects). + * + * Returns: %TRUE if the texture is sliced, %FALSE if the texture + * is stored as a single GPU texture. + */ +gboolean cogl_texture_is_sliced (CoglHandle handle); + +/** + * cogl_texture_get_gl_texture: + * @handle: a #CoglHandle for a texture. + * @out_gl_handle: pointer to return location for the textures GL handle, or + * NULL. + * @out_gl_target: pointer to return location for the GL target type, or NULL. + * + * Query the GL handles for a GPU side texture through it's #CoglHandle, + * if the texture is spliced the data for the first sub texture will be + * queried. + * + * Returns: %TRUE if the handle was successfully retrieved %FALSE + * if the handle was invalid. + */ +gboolean cogl_texture_get_gl_texture (CoglHandle handle, + GLuint *out_gl_handle, + GLenum *out_gl_target); + +/** + * cogl_texture_get_data: + * @handle: a #CoglHandle for a texture. + * @format: the #CoglPixelFormat to store the texture as. + * @rowstride: the rowstride of @data or retrieved from texture if none is + * specified. + * @data: memory location to write contents of buffer, or %NULL if we're + * only querying the data size through the return value. + * + * Copy the pixel data from a cogl texture to system memory. + * + * Returns: the size of the texture data in bytes (or 0 if the texture + * is not valid.) + */ +gint cogl_texture_get_data (CoglHandle handle, + CoglPixelFormat format, + guint rowstride, + guchar *data); + +/** + * cogl_texture_set_filters: + * @handle: a #CoglHandle. + * @min_filter: the filter used when scaling the texture down. + * @mag_filter: the filter used when magnifying the texture. + * + * Changes the decimation and interpolation filters used when the texture is + * drawn at other scales than 100%. + */ +void cogl_texture_set_filters (CoglHandle handle, + COGLenum min_filter, + COGLenum mag_filter); + + +/** + * cogl_texture_set_region: + * @handle: a #CoglHandle. + * @src_x: upper left coordinate to use from source data. + * @src_y: upper left coordinate to use from source data. + * @dst_x: upper left destination horizontal coordinate. + * @dst_y: upper left destination vertical coordinate. + * @dst_width: width of destination region to write. + * @dst_height: height of destination region to write. + * @width: width of source data buffer. + * @height: height of source data buffer. + * @format: the #CoglPixelFormat used in the source buffer. + * @rowstride: rowstride of source buffer (computed from width if none + * specified) + * @data: the actual pixel data. + * + * Sets the pixels in a rectangular subregion of @handle from an in-memory + * buffer containing pixel data. + * + * Returns: %TRUE if the subregion upload was successful, otherwise %FALSE. + */ +gboolean cogl_texture_set_region (CoglHandle handle, + gint src_x, + gint src_y, + gint dst_x, + gint dst_y, + guint dst_width, + guint dst_height, + gint width, + gint height, + CoglPixelFormat format, + guint rowstride, + const guchar *data); + +/** + * cogl_texture_ref: + * @handle: a @CoglHandle. + * + * Increment the reference count for a cogl texture. + * + * Returns: the @handle. + */ +CoglHandle cogl_texture_ref (CoglHandle handle); + +/** + * cogl_texture_unref: + * @handle: a @CoglHandle. + * + * Deccrement the reference count for a cogl texture. + */ +void cogl_texture_unref (CoglHandle handle); + +/** + * cogl_bitmap_new_from_file: + * @filename: the file to load. + * @error: a #GError or %NULL. + * + * Load an image file from disk. This function can be safely called from + * within a thread. + * + * Returns: A #CoglBitmap to the new loaded image data, or %NULL if loading + * the image failed. + * + * Since: 1.0 + */ +CoglBitmap * cogl_bitmap_new_from_file (const gchar *filename, + GError **error); + +/** + * cogl_bitmap_get_size_from_file: + * @filename: the file to check + * @width: return location for the bitmap width + * @height: return location for the bitmap height + * + * Parses an image file enough to extract the width and height + * of the bitmap. + * + * Since: 1.0 + */ +gboolean cogl_bitmap_get_size_from_file (const gchar *filename, + gint *width, + gint *height); + +/** + * cogl_bitmap_free: + * @bmp: a #CoglBitmap. + * + * Frees a #CoglBitmap. + */ +void cogl_bitmap_free (CoglBitmap *bmp); + +/** + * cogl_rectangle_with_texture_coords: + * @x1: x coordinate upper left on screen. + * @y1: y coordinate upper left on screen. + * @x2: x coordinate lower right on screen. + * @y2: y coordinate lower right on screen. + * @tx1: x part of texture coordinate to use for upper left pixel + * @ty1: y part of texture coordinate to use for upper left pixel + * @tx2: x part of texture coordinate to use for lower right pixel + * @ty2: y part of texture coordinate to use for left pixel + * + * Draw a rectangle using the current material and supply texture coordinates + * to be used for the first texture layer of the material. To draw the entire + * texture pass in @tx1=0.0 @ty1=0.0 @tx2=1.0 @ty2=1.0. + * + * Since 1.0 + */ +void cogl_rectangle_with_texture_coords (float x1, + float y1, + float x2, + float y2, + float tx1, + float ty1, + float tx2, + float ty2); + +/** + * cogl_rectangle_with_multitexture_coords: + * @x1: x coordinate upper left on screen. + * @y1: y coordinate upper left on screen. + * @x2: x coordinate lower right on screen. + * @y2: y coordinate lower right on screen. + * @tex_coords: An array containing groups of 4 float values: + * [tx1, ty1, tx2, ty2] that are interpreted as two texture coordinates; one + * for the upper left texel, and one for the lower right texel. Each value + * should be between 0.0 and 1.0, where the coordinate (0.0, 0.0) represents + * the top left of the texture, and (1.0, 1.0) the bottom right. + * @tex_coords_len: The length of the tex_coords array. (e.g. for one layer + * and one group of texture coordinates, this would be 4) + * + * This function draws a rectangle using the current source material to + * texture or fill with. As a material may contain multiple texture layers + * this interface lets you supply texture coordinates for each layer of the + * material. + * + * The first pair of coordinates are for the first layer (with the smallest + * layer index) and if you supply less texture coordinates than there are + * layers in the current source material then default texture coordinates + * (0.0, 0.0, 1.0, 1.0) are generated. + * + * Since 1.0 + */ +void cogl_rectangle_with_multitexture_coords (float x1, + float y1, + float x2, + float y2, + const float *tex_coords, + gint tex_coords_len); + +/** + * cogl_rectangles_with_texture_coords: + * @verts: an array of vertices + * @n_rects: number of rectangles to draw + * + * Draws a series of rectangles in the same way that + * cogl_rectangle_with_texture_coords() does. In some situations it can give a + * significant performance boost to use this function rather than + * calling cogl_rectangle_with_texture_coords() separately for each rectangle. + * + * @verts should point to an array of #floats with + * @n_rects * 8 elements. Each group of 8 values corresponds to the + * parameters x1, y1, x2, y2, tx1, ty1, tx2 and ty2 and have the same + * meaning as in cogl_rectangle_with_texture_coords(). + * + * Since: 0.8.6 + */ +void cogl_rectangles_with_texture_coords (const float *verts, + guint n_rects); + +/** + * cogl_polygon: + * @vertices: An array of #CoglTextureVertex structs + * @n_vertices: The length of the vertices array + * @use_color: %TRUE if the color member of #CoglTextureVertex should be used + * + * Draws a convex polygon using the current source material to fill / texture + * with according to the texture coordinates passed. + * + * If @use_color is %TRUE then the color will be changed for each vertex using + * the value specified in the color member of #CoglTextureVertex. This can be + * used for example to make the texture fade out by setting the alpha value of + * the color. + * + * All of the texture coordinates must be in the range [0,1] and repeating the + * texture is not supported. + * + * Because of the way this function is implemented it will currently only work + * if either the texture is not sliced or the backend is not OpenGL ES and the + * minifying and magnifying functions are both set to CGL_NEAREST. + * + * Since 1.0 + */ +void cogl_polygon (CoglTextureVertex *vertices, + guint n_vertices, + gboolean use_color); + +G_END_DECLS + +#endif /* __COGL_TEXTURE_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/cogl-types.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/cogl-types.h --- clutter-0.8.4/clutter/cogl/cogl-types.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/cogl-types.h 2009-01-28 16:45:24.000000000 +0000 @@ -0,0 +1,295 @@ +/* cogl-types.h: Shared COGL types + * This file is part of Clutter + * + * Copyright (C) 2008 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 . + */ + +#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __COGL_TYPES_H__ +#define __COGL_TYPES_H__ + +#include + +G_BEGIN_DECLS + +/** + * CoglBitmap: + * + * Type used for storing image data. + */ +typedef struct _CoglBitmap CoglBitmap; + +/** + * CoglHandle: + * + * Type used for storing references to cogl objects, the CoglHandle is + * a fully opaque type without any public data members. + */ +typedef gpointer CoglHandle; + +/** + * COGL_INVALID_HANDLE: + * + * A COGL handle that is not valid, used for unitialized handles as well as + * error conditions. + */ +#define COGL_INVALID_HANDLE NULL + +/** + * CoglFuncPtr: + * + * The type used by cogl for function pointers, note that this type + * is used as a generic catch-all cast for function pointers and the + * actual arguments and return type may be different. + */ +typedef void (* CoglFuncPtr) (void); + +/** + * CoglFixed: + * + * Fixed point number using a (16.16) notation. + */ +typedef gint32 CoglFixed; + +/** + * CoglAngle: + * + * Integer representation of an angle such that 1024 corresponds to + * full circle (i.e., 2 * pi). + * + * Since: 1.0 + */ +typedef gint32 CoglAngle; + +typedef struct _CoglColor CoglColor; +typedef struct _CoglTextureVertex CoglTextureVertex; + +/* Enum declarations */ + +#define COGL_PIXEL_FORMAT_24 2 +#define COGL_PIXEL_FORMAT_32 3 +#define COGL_A_BIT (1 << 4) +#define COGL_BGR_BIT (1 << 5) +#define COGL_AFIRST_BIT (1 << 6) +#define COGL_PREMULT_BIT (1 << 7) +#define COGL_UNORDERED_MASK 0x0F +#define COGL_UNPREMULT_MASK 0x7F + +/** + * CoglPixelFormat: + * @COGL_PIXEL_FORMAT_ANY: Any format + * @COGL_PIXEL_FORMAT_A_8: 8 bits alpha mask + * @COGL_PIXEL_FORMAT_RGB_565: RGB, 16 bits + * @COGL_PIXEL_FORMAT_RGBA_4444: RGBA, 16 bits + * @COGL_PIXEL_FORMAT_RGBA_5551: RGBA, 16 bits + * @COGL_PIXEL_FORMAT_YUV: FIXME + * @COGL_PIXEL_FORMAT_G_8: FIXME + * @COGL_PIXEL_FORMAT_RGB_888: RGB, 24 bits + * @COGL_PIXEL_FORMAT_BGR_888: BGR, 24 bits + * @COGL_PIXEL_FORMAT_RGBA_8888: RGBA, 32 bits + * @COGL_PIXEL_FORMAT_BGRA_8888: BGRA, 32 bits + * @COGL_PIXEL_FORMAT_ARGB_8888: ARGB, 32 bits + * @COGL_PIXEL_FORMAT_ABGR_8888: ABGR, 32 bits + * @COGL_PIXEL_FORMAT_RGBA_8888_PRE: Premultiplied RGBA, 32 bits + * @COGL_PIXEL_FORMAT_BGRA_8888_PRE: Premultiplied BGRA, 32 bits + * @COGL_PIXEL_FORMAT_ARGB_8888_PRE: Premultiplied ARGB, 32 bits + * @COGL_PIXEL_FORMAT_ABGR_8888_PRE: Premultiplied ABGR, 32 bits + * @COGL_PIXEL_FORMAT_RGBA_4444_PRE: Premultiplied RGBA, 16 bits + * @COGL_PIXEL_FORMAT_RGBA_5551_PRE: Premultiplied RGBA, 16 bits + * + * Pixel formats used by COGL. + * + * Since: 0.8 + */ +typedef enum +{ + COGL_PIXEL_FORMAT_ANY = 0, + COGL_PIXEL_FORMAT_A_8 = 1 | COGL_A_BIT, + + COGL_PIXEL_FORMAT_RGB_565 = 4, + COGL_PIXEL_FORMAT_RGBA_4444 = 5 | COGL_A_BIT, + COGL_PIXEL_FORMAT_RGBA_5551 = 6 | COGL_A_BIT, + COGL_PIXEL_FORMAT_YUV = 7, + COGL_PIXEL_FORMAT_G_8 = 8, + + COGL_PIXEL_FORMAT_RGB_888 = COGL_PIXEL_FORMAT_24, + + COGL_PIXEL_FORMAT_BGR_888 = (COGL_PIXEL_FORMAT_24 | + COGL_BGR_BIT), + + COGL_PIXEL_FORMAT_RGBA_8888 = COGL_PIXEL_FORMAT_32 | + COGL_A_BIT, + + COGL_PIXEL_FORMAT_BGRA_8888 = (COGL_PIXEL_FORMAT_32 | + COGL_A_BIT | + COGL_BGR_BIT), + + COGL_PIXEL_FORMAT_ARGB_8888 = (COGL_PIXEL_FORMAT_32 | + COGL_A_BIT | + COGL_AFIRST_BIT), + + COGL_PIXEL_FORMAT_ABGR_8888 = (COGL_PIXEL_FORMAT_32 | + COGL_A_BIT | + COGL_BGR_BIT | + COGL_AFIRST_BIT), + + COGL_PIXEL_FORMAT_RGBA_8888_PRE = (COGL_PIXEL_FORMAT_32 | + COGL_A_BIT | + COGL_PREMULT_BIT), + + COGL_PIXEL_FORMAT_BGRA_8888_PRE = (COGL_PIXEL_FORMAT_32 | + COGL_A_BIT | + COGL_PREMULT_BIT | + COGL_BGR_BIT), + + COGL_PIXEL_FORMAT_ARGB_8888_PRE = (COGL_PIXEL_FORMAT_32 | + COGL_A_BIT | + COGL_PREMULT_BIT | + COGL_AFIRST_BIT), + + COGL_PIXEL_FORMAT_ABGR_8888_PRE = (COGL_PIXEL_FORMAT_32 | + COGL_A_BIT | + COGL_PREMULT_BIT | + COGL_BGR_BIT | + COGL_AFIRST_BIT), + + COGL_PIXEL_FORMAT_RGBA_4444_PRE = (COGL_PIXEL_FORMAT_RGBA_4444 | + COGL_A_BIT | + COGL_PREMULT_BIT), + + COGL_PIXEL_FORMAT_RGBA_5551_PRE = (COGL_PIXEL_FORMAT_RGBA_5551 | + COGL_A_BIT | + COGL_PREMULT_BIT), + + +} CoglPixelFormat; + +/** + * CoglFeatureFlags: + * @COGL_FEATURE_TEXTURE_RECTANGLE: ARB_texture_rectangle support + * @COGL_FEATURE_TEXTURE_NPOT: ARB_texture_non_power_of_two support + * @COGL_FEATURE_TEXTURE_YUV: ycbcr conversion support + * @COGL_FEATURE_TEXTURE_READ_PIXELS: glReadPixels() support + * @COGL_FEATURE_SHADERS_GLSL: GLSL support + * @COGL_FEATURE_OFFSCREEN: FBO support + * @COGL_FEATURE_OFFSCREEN_MULTISAMPLE: Multisample support on FBOs + * @COGL_FEATURE_OFFSCREEN_BLIT: Blit support on FBOs + * @COGL_FEATURE_FOUR_CLIP_PLANES: At least 4 clip planes available + * @COGL_FEATURE_STENCIL_BUFFER: Stencil buffer support + * @COGL_FEATURE_VBOS: VBO support + * + * Flags for the supported features. + * + * Since: 0.8 + */ +typedef enum +{ + COGL_FEATURE_TEXTURE_RECTANGLE = (1 << 1), + COGL_FEATURE_TEXTURE_NPOT = (1 << 2), + COGL_FEATURE_TEXTURE_YUV = (1 << 3), + COGL_FEATURE_TEXTURE_READ_PIXELS = (1 << 4), + COGL_FEATURE_SHADERS_GLSL = (1 << 5), + COGL_FEATURE_OFFSCREEN = (1 << 6), + COGL_FEATURE_OFFSCREEN_MULTISAMPLE = (1 << 7), + COGL_FEATURE_OFFSCREEN_BLIT = (1 << 8), + COGL_FEATURE_FOUR_CLIP_PLANES = (1 << 9), + COGL_FEATURE_STENCIL_BUFFER = (1 << 10), + COGL_FEATURE_VBOS = (1 << 11) +} CoglFeatureFlags; + +/** + * CoglBufferTarget: + * @COGL_WINDOW_BUFFER: FIXME + * @COGL_MASK_BUFFER: FIXME + * @COGL_OFFSCREEN_BUFFER: FIXME + * + * Target flags for FBOs. + * + * Since: 0.8 + */ +typedef enum +{ + COGL_WINDOW_BUFFER = (1 << 1), + COGL_MASK_BUFFER = (1 << 2), + COGL_OFFSCREEN_BUFFER = (1 << 3) + +} CoglBufferTarget; + +/** + * CoglColor: + * + * A structure for holding a color definition. The contents of + * the CoglColor structure are private and should never by accessed + * directly. + * + * Since: 1.0 + */ +struct _CoglColor +{ + /*< private >*/ + guint8 red; + guint8 green; + guint8 blue; + + guint8 alpha; + + /* padding in case we want to change to floats at + * some point */ + guint32 padding0; + guint32 padding1; + guint32 padding2; +}; + +/** + * CoglTextureVertex: + * @x: Model x-coordinate + * @y: Model y-coordinate + * @z: Model z-coordinate + * @tx: Texture x-coordinate + * @ty: Texture y-coordinate + * @color: The color to use at this vertex. This is ignored if + * @use_color is %FALSE when calling cogl_texture_polygon(). + * + * Used to specify vertex information when calling cogl_texture_polygon(). + */ +struct _CoglTextureVertex +{ + float x, y, z; + float tx, ty; + CoglColor color; +}; + +/** + * CoglTextureFlags: + * @COGL_TEXTURE_NONE: No flags specified + * @COGL_TEXTURE_AUTO_MIPMAP: Enables the automatic generation of the + * mipmap pyramid from the base level image whenever it is updated + * + * Flags to pass to the cogl_texture_new_* family of functions. + * + * Since: 1.0 + */ +typedef enum { + COGL_TEXTURE_NONE = 0, + COGL_TEXTURE_AUTO_MIPMAP = 1 << 0 +} CoglTextureFlags; + +G_END_DECLS + +#endif /* __COGL_TYPES_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/cogl-vertex-buffer.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/cogl-vertex-buffer.h --- clutter-0.8.4/clutter/cogl/cogl-vertex-buffer.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/cogl-vertex-buffer.h 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,308 @@ +/* + * Cogl. + * + * An OpenGL/GLES Abstraction/Utility Layer + * + * Vertex Buffer API: Handle extensible arrays of vertex attributes + * + * Copyright (C) 2008 Intel Corporation. + * + * Authored by: Robert Bragg + * + * 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 . + */ + +#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __COGL_VERTEX_BUFFER_H__ +#define __COGL_VERTEX_BUFFER_H__ + +#include +#include + +G_BEGIN_DECLS + +/** + * SECTION:cogl-vertex-buffer + * @short_description: An API for submitting extensible arrays of vertex + * attributes to OpenGL in a way that aims to minimise + * copying or reformatting of the original data. + * + * The Attributes Buffer API is designed to be a fairly raw mechanism for + * developers to be able to submit geometry to Cogl in a format that can be + * directly consumed by an OpenGL driver and with awareness of the specific + * hardware being used then costly format conversion can also be avoided. + * + * They are designed to work on top of buffer objects and developers should + * understand that attribute buffers are not that cheap to create but once they + * have been submitted they can be stored in GPU addressable memory and can + * be quickly reused. + * + * Although this API does allow you to modify attribute buffers after they have + * been submitted to the GPU you must note that modification is also not that + * cheap, so if at all possible think of tricks that let you reuse a static + * buffer. To help with this, it is possible to enable and disable individual + * attributes cheaply. + * + * Take for example attributes representing an elipse. If you were to submit + * color attributes, texture coordinates and normals, then you would be able + * to draw an elipses in the following different ways without modifying + * the vertex buffer, only by changing your source material. + * + * Flat colored elipse + * Textured elipse + * Smoothly lit textured elipse blended with the color. + * + * + * Another trick that can be used is submitting highly detailed vertices and + * then using cogl_vertex_buffer_draw_range_elements to sample sub-sets of + * the geometry or lower resolution geometry out from a fixed buffer. + * + * The API doesn't currently give you any control over the actual OpenGL buffer + * objects that are created, but you can expect that when you first submit + * your attributes they start off in one or more GL_STATIC_DRAW buffers. + * If you then update some of your attributes; then these attributes will + * normally be moved into new GL_DYNAMIC_DRAW draw buffers. + */ + +/** + * cogl_vertex_buffer_new: + * @n_vertices: The number of vertices that your attributes will correspond to. + * + * This creates a Cogl handle for a new vertex buffer that you can then start + * to add attributes too. + */ +CoglHandle +cogl_vertex_buffer_new (guint n_vertices); + +/** + * cogl_vertex_buffer_add: + * @handle: A vertex buffer handle + * @attribute_name: The name of your attribute. It should be a valid GLSL + * variable name and standard attribute types must use one + * of following built-in names: (Note: they correspond to the + * built-in names in GLSL) + * + * "gl_Color" + * "gl_Normal" + * "gl_MultiTexCoord0, gl_MultiTexCoord1, ..." + * "gl_Vertex" + * + * To support adding multiple variations of the same attribute + * the name can have a detail component, E.g. + * "gl_Color::active" or "gl_Color::inactive" + * @n_components: The number of components per attribute and must be 1,2,3 or 4 + * @gl_type: Specifies the data type of each component (GL_BYTE, GL_UNSIGNED_BYTE, + * GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT or + * GL_DOUBLE) + * @normalized: If GL_TRUE, this specifies that values stored in an integer + * format should be mapped into the range [-1.0, 1.0] or [0.1, 1.0] + * for unsigned values. If GL_FALSE they are converted to floats + * directly. + * @stride: This specifies the number of bytes from the start of one attribute + * value to the start of the next value (for the same attribute). So + * for example with a position interleved with color like this: + * XYRGBAXYRGBAXYRGBA, then if each letter represents a byte, the + * stride for both attributes is 6. The special value 0 means the + * values are stored sequentially in memory. + * @pointer: This addresses the first attribute in the vertex array. (This + * must remain valid until you call cogl_vertex_buffer_submit) + * + * This function lets you add an attribute to a buffer. You either use one + * of the built-in names to add standard attributes, like positions, colors + * and normals or you can add custom attributes for use in shaders. + * + * Note: The number of vertices declared when first creating the vertex + * buffer is used to determine how many attribute values will be read from the + * supplied pointer. + * + * Note: the data supplied here isn't copied anywhere until you call + * cogl_vertex_buffer_submit, so the supplied pointer must remain valid + * until then. + * (This is an important optimisation since we can't create the underlying + * OpenGL buffer object until we know about all the attributes, and repeatedly + * copying large buffers of vertex data may be very costly) If you add + * attributes after submitting then you will need to re-call + * cogl_vertex_buffer_submit to commit the changes to the GPU. (Be carefull + * to minimize the number of calls to cogl_vertex_buffer_submit though) + * + * Note: If you are interleving attributes it is assumed that that each + * interleaved attribute starts no farther than +- stride bytes from the other + * attributes it is interleved with. I.e. this is ok: + * |-0-0-0-0-0-0-0-0-0-0| + * This is not ok: + * |- - - - -0-0-0-0-0-0 0 0 0 0| + * (Though you can have multiple groups of interleved attributes) + */ +void +cogl_vertex_buffer_add (CoglHandle handle, + const char *attribute_name, + guint8 n_components, + GLenum gl_type, + gboolean normalized, + guint16 stride, + const void *pointer); + +/** + * cogl_vertex_buffer_delete: + * @handle: A vertex buffer handle + * @attribute_name: The name of a previously added attribute + * + * This function deletes an attribute from a buffer. You will need to + * call cogl_vertex_buffer_submit to commit this change to the GPU. + */ +void +cogl_vertex_buffer_delete (CoglHandle handle, + const char *attribute_name); + +/** + * cogl_vertex_buffer_enable: + * @handle: A vertex buffer handle + * @attribute_name: The name of the attribute you want to enable + * + * This function enables a previosuly added attribute + * + * Since it can be costly to add and remove new attributes to buffers; to make + * individual buffers more reuseable it is possible to enable and disable + * attributes before using a buffer for drawing. + * + * Note: You don't need to call cogl_vertex_buffer_submit after using this + * function + */ +void +cogl_vertex_buffer_enable (CoglHandle handle, + const char *attribute_name); + +/** + * cogl_vertex_buffer_submit: + * @handle: A vertex buffer handle + * + * This function copies all the user added attributes into buffer objects + * managed by the OpenGL driver. + * + * You should aim to minimize calls to this function. + */ +void +cogl_vertex_buffer_submit (CoglHandle handle); + +/** + * cogl_vertex_buffer_disable: + * @handle: A vertex buffer handle + * @attribute_name: The name of the attribute you want to disable + * + * This function disables a previosuly added attribute + * + * Since it can be costly to add and remove new attributes to buffers; to make + * individual buffers more reuseable it is possible to enable and disable + * attributes before using a buffer for drawing. + * + * Note: You don't need to call cogl_vertex_buffer_submit after using this + * function + */ +void +cogl_vertex_buffer_disable (CoglHandle handle, + const char *attribute_name); + +/** + * cogl_vertex_buffer_draw: + * @handle: A vertex buffer handle + * @mode: Specifies how the vertices should be interpreted, and should be + * a valid GL primitive type: + * + * GL_POINTS + * GL_LINE_STRIP + * GL_LINE_LOOP + * GL_LINES + * GL_TRIANGLE_STRIP + * GL_TRIANGLE_FAN + * GL_TRIANGLES + * + * (Note: only types available in GLES are listed) + * @first: Specifies the index of the first vertex you want to draw with + * @count: Specifies the number of vertices you want to draw. + * + * This function lets you draw geometry using all or a subset of the + * vertices in a vertex buffer. + */ +void +cogl_vertex_buffer_draw (CoglHandle handle, + GLenum mode, + GLint first, + GLsizei count); + +/** + * cogl_vertex_buffer_draw_range_elements: + * @handle: A vertex buffer handle + * @mode: Specifies how the vertices should be interpreted, and should be + * a valid GL primitive type: + * + * GL_POINTS + * GL_LINE_STRIP + * GL_LINE_LOOP + * GL_LINES + * GL_TRIANGLE_STRIP + * GL_TRIANGLE_FAN + * GL_TRIANGLES + * + * (Note: only types available in GLES are listed) + * @min_index: Specifies the minimum vertex index contained in indices + * @max_index: Specifies the maximum vertex index contained in indices + * @count: Specifies the number of vertices you want to draw. + * @indices_type: Specifies the data type used for the indices, and must be + * one of: + * + * GL_UNSIGNED_BYTE + * GL_UNSIGNED_SHORT + * GL_UNSIGNED_INT + * + * @indices: Specifies the address of your array of indices + * + * This function lets you use an array of indices to specify the vertices + * within your vertex buffer that you want to draw. + */ +void +cogl_vertex_buffer_draw_range_elements (CoglHandle handle, + GLenum mode, + GLuint min_index, + GLuint max_index, + GLsizei count, + GLenum indices_type, + const GLvoid *indices); + +/** + * cogl_vertex_buffer_ref: + * @handle: a @CoglHandle. + * + * Increment the reference count for a vertex buffer + * + * Returns: the @handle. + */ +CoglHandle +cogl_vertex_buffer_ref (CoglHandle handle); + +/** + * cogl_vertex_buffer_unref: + * @handle: a @CoglHandle. + * + * Decrement the reference count for a vertex buffer + */ +void +cogl_vertex_buffer_unref (CoglHandle handle); + + +G_END_DECLS + +#endif /* __COGL_VERTEX_BUFFER_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/common/cogl-bitmap.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/common/cogl-bitmap.c --- clutter-0.8.4/clutter/cogl/common/cogl-bitmap.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/common/cogl-bitmap.c 2009-01-28 08:12:46.000000000 +0000 @@ -148,3 +148,42 @@ dstdata += dst->rowstride; } } + +gboolean +cogl_bitmap_get_size_from_file (const gchar *filename, + gint *width, + gint *height) +{ + return _cogl_bitmap_get_size_from_file (filename, width, height); +} + +CoglBitmap * +cogl_bitmap_new_from_file (const gchar *filename, + GError **error) +{ + CoglBitmap bmp; + + g_return_val_if_fail (error == NULL || *error == NULL, COGL_INVALID_HANDLE); + + /* Try loading with imaging backend */ + if (!_cogl_bitmap_from_file (&bmp, filename, error)) + { + /* Try fallback */ + if (!_cogl_bitmap_fallback_from_file (&bmp, filename)) + return NULL; + else if (error && *error) + { + g_error_free (*error); + *error = NULL; + } + } + + return (CoglBitmap *) g_memdup (&bmp, sizeof (CoglBitmap)); +} + +void +cogl_bitmap_free (CoglBitmap *bmp) +{ + g_free (bmp->data); + g_free (bmp); +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/common/cogl-bitmap.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/common/cogl-bitmap.h --- clutter-0.8.4/clutter/cogl/common/cogl-bitmap.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/common/cogl-bitmap.h 2009-01-28 08:12:46.000000000 +0000 @@ -28,8 +28,6 @@ #include -typedef struct _CoglBitmap CoglBitmap; - struct _CoglBitmap { guchar *data; @@ -92,4 +90,9 @@ gint width, gint height); +gboolean +_cogl_bitmap_get_size_from_file (const gchar *filename, + gint *width, + gint *height); + #endif /* __COGL_BITMAP_H */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/common/cogl-bitmap-pixbuf.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/common/cogl-bitmap-pixbuf.c --- clutter-0.8.4/clutter/cogl/common/cogl-bitmap-pixbuf.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/common/cogl-bitmap-pixbuf.c 2009-01-28 08:12:46.000000000 +0000 @@ -84,6 +84,20 @@ return g_quark_from_static_string ("cogl-bitmap-error-quark"); } +gboolean +_cogl_bitmap_get_size_from_file (const gchar *filename, + gint *width, + gint *height) +{ + if (width) + *width = 0; + + if (height) + *height = 0; + + return TRUE; +} + /* the error does not contain the filename as the caller already has it */ gboolean _cogl_bitmap_from_file (CoglBitmap *bmp, @@ -177,9 +191,22 @@ #elif defined(USE_GDKPIXBUF) gboolean -_cogl_bitmap_from_file (CoglBitmap *bmp, - const gchar *filename, - GError **error) +_cogl_bitmap_get_size_from_file (const gchar *filename, + gint *width, + gint *height) +{ + g_return_val_if_fail (filename != NULL, FALSE); + + if (gdk_pixbuf_get_file_info (filename, width, height) != NULL) + return TRUE; + + return FALSE; +} + +gboolean +_cogl_bitmap_from_file (CoglBitmap *bmp, + const gchar *filename, + GError **error) { GdkPixbuf *pixbuf; gboolean has_alpha; @@ -198,11 +225,13 @@ g_return_val_if_fail (error == NULL || *error == NULL, FALSE); - if (bmp == NULL) return FALSE; - + if (bmp == NULL) + return FALSE; + /* Load from file using GdkPixbuf */ pixbuf = gdk_pixbuf_new_from_file (filename, error); - if (pixbuf == NULL) return FALSE; + if (pixbuf == NULL) + return FALSE; /* Get pixbuf properties */ has_alpha = gdk_pixbuf_get_has_alpha (pixbuf); @@ -279,6 +308,20 @@ #include "stb_image.c" gboolean +_cogl_bitmap_get_size_from_file (const gchar *filename, + gint *width, + gint *height) +{ + if (width) + *width = 0; + + if (height) + *height = 0; + + return TRUE; +} + +gboolean _cogl_bitmap_from_file (CoglBitmap *bmp, const gchar *filename, GError **error) @@ -290,11 +333,15 @@ g_return_val_if_fail (error == NULL || *error == NULL, FALSE); - if (bmp == NULL) return FALSE; + if (bmp == NULL) + return FALSE; /* Load from file using stb */ - pixels = stbi_load (filename, &width, &height, &stb_pixel_format, STBI_rgb_alpha); - if (pixels == NULL) return FALSE; + pixels = stbi_load (filename, + &width, &height, &stb_pixel_format, + STBI_rgb_alpha); + if (pixels == NULL) + return FALSE; /* Store bitmap info */ bmp->data = g_memdup (pixels, height * width * 4); diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/common/cogl-clip-stack.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/common/cogl-clip-stack.c --- clutter-0.8.4/clutter/cogl/common/cogl-clip-stack.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/common/cogl-clip-stack.c 2009-01-28 08:12:46.000000000 +0000 @@ -27,78 +27,94 @@ #include "config.h" #endif +#include #include "cogl.h" #include "cogl-clip-stack.h" +#include "cogl-primitives.h" +#include "cogl-context.h" /* These are defined in the particular backend (float in GL vs fixed in GL ES) */ -void _cogl_set_clip_planes (ClutterFixed x, - ClutterFixed y, - ClutterFixed width, - ClutterFixed height); -void _cogl_init_stencil_buffer (void); -void _cogl_add_stencil_clip (ClutterFixed x, - ClutterFixed y, - ClutterFixed width, - ClutterFixed height, +void _cogl_set_clip_planes (float x, + float y, + float width, + float height); +void _cogl_add_stencil_clip (float x, + float y, + float width, + float height, gboolean first); +void _cogl_add_path_to_stencil_buffer (floatVec2 nodes_min, + floatVec2 nodes_max, + guint path_size, + CoglPathNode *path, + gboolean merge); +void _cogl_enable_clip_planes (void); void _cogl_disable_clip_planes (void); void _cogl_disable_stencil_buffer (void); -void _cogl_set_matrix (const ClutterFixed *matrix); +void _cogl_set_matrix (const float *matrix); -typedef struct _CoglClipStackEntry CoglClipStackEntry; +typedef struct _CoglClipStack CoglClipStack; -struct _CoglClipStackEntry +typedef struct _CoglClipStackEntryRect CoglClipStackEntryRect; +typedef struct _CoglClipStackEntryPath CoglClipStackEntryPath; + +typedef enum + { + COGL_CLIP_STACK_RECT, + COGL_CLIP_STACK_PATH + } CoglClipStackEntryType; + +struct _CoglClipStack +{ + GList *stack_top; +}; + +struct _CoglClipStackEntryRect { - /* If this is set then this entry clears the clip stack. This is - used to clear the stack when drawing an FBO put to keep the - entries so they can be restored when the FBO drawing is - completed */ - gboolean clear; + CoglClipStackEntryType type; /* The rectangle for this clip */ - ClutterFixed x_offset; - ClutterFixed y_offset; - ClutterFixed width; - ClutterFixed height; + float x_offset; + float y_offset; + float width; + float height; /* The matrix that was current when the clip was set */ - ClutterFixed matrix[16]; + float matrix[16]; }; -static GList *cogl_clip_stack_top = NULL; -static int cogl_clip_stack_depth = 0; - -static void -_cogl_clip_stack_add (const CoglClipStackEntry *entry, int depth) +struct _CoglClipStackEntryPath { - int has_clip_planes = cogl_features_available (COGL_FEATURE_FOUR_CLIP_PLANES); + CoglClipStackEntryType type; - /* If this is the first entry and we support clip planes then use - that instead */ - if (depth == 1 && has_clip_planes) - _cogl_set_clip_planes (entry->x_offset, - entry->y_offset, - entry->width, - entry->height); - else - _cogl_add_stencil_clip (entry->x_offset, - entry->y_offset, - entry->width, - entry->height, - depth == (has_clip_planes ? 2 : 1)); -} + /* The matrix that was current when the clip was set */ + float matrix[16]; + + floatVec2 path_nodes_min; + floatVec2 path_nodes_max; + + guint path_size; + CoglPathNode path[1]; +}; void -cogl_clip_set (ClutterFixed x_offset, - ClutterFixed y_offset, - ClutterFixed width, - ClutterFixed height) +cogl_clip_set (float x_offset, + float y_offset, + float width, + float height) { - CoglClipStackEntry *entry = g_slice_new (CoglClipStackEntry); + CoglClipStackEntryRect *entry; + CoglClipStack *stack; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + stack = (CoglClipStack *) ctx->clip.stacks->data; + + entry = g_slice_new (CoglClipStackEntryRect); /* Make a new entry */ - entry->clear = FALSE; + entry->type = COGL_CLIP_STACK_RECT; entry->x_offset = x_offset; entry->y_offset = y_offset; entry->width = width; @@ -106,127 +122,231 @@ cogl_get_modelview_matrix (entry->matrix); - /* Add the entry to the current clip */ - _cogl_clip_stack_add (entry, ++cogl_clip_stack_depth); + /* Store it in the stack */ + stack->stack_top = g_list_prepend (stack->stack_top, entry); + + ctx->clip.stack_dirty = TRUE; +} + +void +cogl_clip_set_from_path_preserve (void) +{ + CoglClipStackEntryPath *entry; + CoglClipStack *stack; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + stack = (CoglClipStack *) ctx->clip.stacks->data; + + entry = g_malloc (sizeof (CoglClipStackEntryPath) + + sizeof (CoglPathNode) * (ctx->path_nodes->len - 1)); + + entry->type = COGL_CLIP_STACK_PATH; + entry->path_nodes_min = ctx->path_nodes_min; + entry->path_nodes_max = ctx->path_nodes_max; + entry->path_size = ctx->path_nodes->len; + memcpy (entry->path, ctx->path_nodes->data, + sizeof (CoglPathNode) * ctx->path_nodes->len); + + cogl_get_modelview_matrix (entry->matrix); /* Store it in the stack */ - cogl_clip_stack_top = g_list_prepend (cogl_clip_stack_top, entry); + stack->stack_top = g_list_prepend (stack->stack_top, entry); + + ctx->clip.stack_dirty = TRUE; +} + +void +cogl_clip_set_from_path (void) +{ + cogl_clip_set_from_path_preserve (); + + cogl_path_new (); } void cogl_clip_unset (void) { - g_return_if_fail (cogl_clip_stack_top != NULL); + gpointer entry; + CoglClipStack *stack; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + stack = (CoglClipStack *) ctx->clip.stacks->data; + + g_return_if_fail (stack->stack_top != NULL); + + entry = stack->stack_top->data; /* Remove the top entry from the stack */ - g_slice_free (CoglClipStackEntry, cogl_clip_stack_top->data); - cogl_clip_stack_top = g_list_delete_link (cogl_clip_stack_top, - cogl_clip_stack_top); - cogl_clip_stack_depth--; + if (*(CoglClipStackEntryType *) entry == COGL_CLIP_STACK_RECT) + g_slice_free (CoglClipStackEntryRect, entry); + else + g_free (entry); + + stack->stack_top = g_list_delete_link (stack->stack_top, + stack->stack_top); - /* Rebuild the clip */ - _cogl_clip_stack_rebuild (FALSE); + ctx->clip.stack_dirty = TRUE; } void -_cogl_clip_stack_rebuild (gboolean just_stencil) +_cogl_clip_stack_rebuild (void) { int has_clip_planes = cogl_features_available (COGL_FEATURE_FOUR_CLIP_PLANES); + gboolean using_clip_planes = FALSE; + gboolean using_stencil_buffer = FALSE; GList *node; - int depth = 0; + CoglClipStack *stack; - /* Disable clip planes if the stack is empty */ - if (has_clip_planes && cogl_clip_stack_depth < 1) - _cogl_disable_clip_planes (); - - /* Disable the stencil buffer if there isn't enough entries */ - if (cogl_clip_stack_depth < (has_clip_planes ? 2 : 1)) - _cogl_disable_stencil_buffer (); + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + stack = (CoglClipStack *) ctx->clip.stacks->data; + + ctx->clip.stack_dirty = FALSE; + ctx->clip.stencil_used = FALSE; + + _cogl_disable_clip_planes (); + _cogl_disable_stencil_buffer (); + + /* If the stack is empty then there's nothing else to do */ + if (stack->stack_top == NULL) + return; /* Find the bottom of the stack */ - for (node = cogl_clip_stack_top; depth < cogl_clip_stack_depth - 1; - node = node->next) - depth++; + for (node = stack->stack_top; node->next; node = node->next); /* Re-add every entry from the bottom of the stack up */ - depth = 1; - for (; depth <= cogl_clip_stack_depth; node = node->prev, depth++) - if (!just_stencil || !has_clip_planes || depth > 1) - { - const CoglClipStackEntry *entry = (CoglClipStackEntry *) node->data; - cogl_push_matrix (); - _cogl_set_matrix (entry->matrix); - _cogl_clip_stack_add (entry, depth); - cogl_pop_matrix (); - } -} - -void -_cogl_clip_stack_merge (void) -{ - GList *node = cogl_clip_stack_top; - int i; - - /* Merge the current clip stack on top of whatever is in the stencil - buffer */ - if (cogl_clip_stack_depth) + for (; node; node = node->prev) { - for (i = 0; i < cogl_clip_stack_depth - 1; i++) - node = node->next; + gpointer entry = node->data; - /* Skip the first entry if we have clipping planes */ - if (cogl_features_available (COGL_FEATURE_FOUR_CLIP_PLANES)) - node = node->prev; - - while (node) - { - const CoglClipStackEntry *entry = (CoglClipStackEntry *) node->data; - cogl_push_matrix (); - _cogl_set_matrix (entry->matrix); - _cogl_clip_stack_add (entry, 3); - cogl_pop_matrix (); + if (*(CoglClipStackEntryType *) entry == COGL_CLIP_STACK_PATH) + { + CoglClipStackEntryPath *path = (CoglClipStackEntryPath *) entry; + + cogl_push_matrix (); + _cogl_set_matrix (path->matrix); + + _cogl_add_path_to_stencil_buffer (path->path_nodes_min, + path->path_nodes_max, + path->path_size, + path->path, + using_stencil_buffer); + + cogl_pop_matrix (); + + using_stencil_buffer = TRUE; + + /* We can't use clip planes any more */ + has_clip_planes = FALSE; + } + else + { + CoglClipStackEntryRect *rect = (CoglClipStackEntryRect *) entry; + + cogl_push_matrix (); + _cogl_set_matrix (rect->matrix); + + /* If this is the first entry and we support clip planes then use + that instead */ + if (has_clip_planes) + { + _cogl_set_clip_planes (rect->x_offset, + rect->y_offset, + rect->width, + rect->height); + using_clip_planes = TRUE; + /* We can't use clip planes a second time */ + has_clip_planes = FALSE; + } + else + { + _cogl_add_stencil_clip (rect->x_offset, + rect->y_offset, + rect->width, + rect->height, + !using_stencil_buffer); + using_stencil_buffer = TRUE; + } - node = node->prev; - } + cogl_pop_matrix (); + } } + + /* Enabling clip planes is delayed to now so that they won't affect + setting up the stencil buffer */ + if (using_clip_planes) + _cogl_enable_clip_planes (); + + ctx->clip.stencil_used = using_stencil_buffer; +} + +void +cogl_clip_ensure (void) +{ + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + if (ctx->clip.stack_dirty) + _cogl_clip_stack_rebuild (); } void cogl_clip_stack_save (void) { - CoglClipStackEntry *entry = g_slice_new (CoglClipStackEntry); + CoglClipStack *stack; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); - /* Push an entry into the stack to mark that it should be cleared */ - entry->clear = TRUE; - cogl_clip_stack_top = g_list_prepend (cogl_clip_stack_top, entry); + stack = g_slice_new (CoglClipStack); + stack->stack_top = NULL; - /* Reset the depth to zero */ - cogl_clip_stack_depth = 0; + ctx->clip.stacks = g_slist_prepend (ctx->clip.stacks, stack); - /* Rebuilding the stack will now disabling all clipping */ - _cogl_clip_stack_rebuild (FALSE); + ctx->clip.stack_dirty = TRUE; } void cogl_clip_stack_restore (void) { - GList *node; + CoglClipStack *stack; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + g_return_if_fail (ctx->clip.stacks != NULL); - /* The top of the stack should be a clear marker */ - g_assert (cogl_clip_stack_top); - g_assert (((CoglClipStackEntry *) cogl_clip_stack_top->data)->clear); - - /* Remove the top entry */ - g_slice_free (CoglClipStackEntry, cogl_clip_stack_top->data); - cogl_clip_stack_top = g_list_delete_link (cogl_clip_stack_top, - cogl_clip_stack_top); - - /* Recalculate the depth of the stack */ - cogl_clip_stack_depth = 0; - for (node = cogl_clip_stack_top; - node && !((CoglClipStackEntry *) node->data)->clear; - node = node->next) - cogl_clip_stack_depth++; + stack = (CoglClipStack *) ctx->clip.stacks->data; + + /* Empty the current stack */ + while (stack->stack_top) + cogl_clip_unset (); + + /* Revert to an old stack */ + g_slice_free (CoglClipStack, stack); + ctx->clip.stacks = g_slist_delete_link (ctx->clip.stacks, + ctx->clip.stacks); + + ctx->clip.stack_dirty = TRUE; +} + +void +_cogl_clip_stack_state_init (void) +{ + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + ctx->clip.stacks = NULL; + ctx->clip.stack_dirty = TRUE; + + /* Add an intial stack */ + cogl_clip_stack_save (); +} + +void +_cogl_clip_stack_state_destroy (void) +{ + _COGL_GET_CONTEXT (ctx, NO_RETVAL); - _cogl_clip_stack_rebuild (FALSE); + /* Destroy all of the stacks */ + while (ctx->clip.stacks) + cogl_clip_stack_restore (); } diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/common/cogl-clip-stack.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/common/cogl-clip-stack.h --- clutter-0.8.4/clutter/cogl/common/cogl-clip-stack.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/common/cogl-clip-stack.h 2009-01-28 08:12:46.000000000 +0000 @@ -26,7 +26,20 @@ #ifndef __COGL_CLIP_STACK_H #define __COGL_CLIP_STACK_H -void _cogl_clip_stack_rebuild (gboolean just_stencil); +typedef struct _CoglClipStackState CoglClipStackState; + +struct _CoglClipStackState +{ + /* Stack of stacks */ + GSList *stacks; + + gboolean stack_dirty; + gboolean stencil_used; +}; + +void _cogl_clip_stack_state_init (void); +void _cogl_clip_stack_state_destroy (void); +void _cogl_clip_stack_rebuild (void); void _cogl_clip_stack_merge (void); #endif /* __COGL_CLIP_STACK_H */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/common/cogl-color.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/common/cogl-color.c --- clutter-0.8.4/clutter/cogl/common/cogl-color.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/common/cogl-color.c 2009-01-29 08:31:37.000000000 +0000 @@ -0,0 +1,154 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "cogl-color.h" +#include "cogl-fixed.h" + +CoglColor * +cogl_color_new (void) +{ + return g_slice_new (CoglColor); +} + +CoglColor * +cogl_color_copy (const CoglColor *color) +{ + if (G_LIKELY (color)) + return g_slice_dup (CoglColor, color); + + return NULL; +} + +void +cogl_color_free (CoglColor *color) +{ + if (G_LIKELY (color)) + g_slice_free (CoglColor, color); +} + +void +cogl_color_set_from_4ub (CoglColor *dest, + guint8 red, + guint8 green, + guint8 blue, + guint8 alpha) +{ + g_return_if_fail (dest != NULL); + + dest->red = red; + dest->green = green; + dest->blue = blue; + dest->alpha = alpha; +} + +void +cogl_color_set_from_4f (CoglColor *dest, + float red, + float green, + float blue, + float alpha) +{ + g_return_if_fail (dest != NULL); + + dest->red = (red * 255); + dest->green = (green * 255); + dest->blue = (blue * 255); + dest->alpha = (alpha * 255); +} + +unsigned char +cogl_color_get_red_byte (const CoglColor *color) +{ + return color->red; +} + +float +cogl_color_get_red_float (const CoglColor *color) +{ + return (float) color->red / 255.0; +} + +float +cogl_color_get_red (const CoglColor *color) +{ + return ((float) color->red / 255.0); +} + +unsigned char +cogl_color_get_green_byte (const CoglColor *color) +{ + return color->green; +} + +float +cogl_color_get_green_float (const CoglColor *color) +{ + return (float) color->green / 255.0; +} + +float +cogl_color_get_green (const CoglColor *color) +{ + return ((float) color->green / 255.0); +} + +unsigned char +cogl_color_get_blue_byte (const CoglColor *color) +{ + return color->blue; +} + +float +cogl_color_get_blue_float (const CoglColor *color) +{ + return (float) color->blue / 255.0; +} + +float +cogl_color_get_blue (const CoglColor *color) +{ + return ((float) color->blue / 255.0); +} + +unsigned char +cogl_color_get_alpha_byte (const CoglColor *color) +{ + return color->alpha; +} + +float +cogl_color_get_alpha_float (const CoglColor *color) +{ + return (float) color->alpha / 255.0; +} + +float +cogl_color_get_alpha (const CoglColor *color) +{ + return ((float) color->alpha / 255.0); +} + +void +cogl_set_source_color4ub (guint8 red, + guint8 green, + guint8 blue, + guint8 alpha) +{ + CoglColor c = { 0, }; + + cogl_color_set_from_4ub (&c, red, green, blue, alpha); + cogl_set_source_color (&c); +} + +void +cogl_set_source_color4f (float red, + float green, + float blue, + float alpha) +{ + CoglColor c = { 0, }; + + cogl_color_set_from_4f (&c, red, green, blue, alpha); + cogl_set_source_color (&c); +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/common/cogl-fixed.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/common/cogl-fixed.c --- clutter-0.8.4/clutter/cogl/common/cogl-fixed.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/common/cogl-fixed.c 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,927 @@ +#define G_IMPLEMENT_INLINES + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "cogl-fixed.h" + +/* pre-computed sin table for 1st quadrant + * + * Currently contains 257 entries. + * + * The current maximum absolute error is about 1.9e-0.5 + * and is greatest around pi/2 where the second derivative + * of sin(x) is greatest. If greater accuracy is needed, + * modestly increasing the table size, or maybe using + * quadratic interpolation would drop the interpolation + * error below the precision limits of CoglFixed. + */ +static const CoglFixed sin_tbl[] = +{ + 0x00000000L, 0x00000192L, 0x00000324L, 0x000004B6L, + 0x00000648L, 0x000007DAL, 0x0000096CL, 0x00000AFEL, + 0x00000C90L, 0x00000E21L, 0x00000FB3L, 0x00001144L, + 0x000012D5L, 0x00001466L, 0x000015F7L, 0x00001787L, + 0x00001918L, 0x00001AA8L, 0x00001C38L, 0x00001DC7L, + 0x00001F56L, 0x000020E5L, 0x00002274L, 0x00002402L, + 0x00002590L, 0x0000271EL, 0x000028ABL, 0x00002A38L, + 0x00002BC4L, 0x00002D50L, 0x00002EDCL, 0x00003067L, + 0x000031F1L, 0x0000337CL, 0x00003505L, 0x0000368EL, + 0x00003817L, 0x0000399FL, 0x00003B27L, 0x00003CAEL, + 0x00003E34L, 0x00003FBAL, 0x0000413FL, 0x000042C3L, + 0x00004447L, 0x000045CBL, 0x0000474DL, 0x000048CFL, + 0x00004A50L, 0x00004BD1L, 0x00004D50L, 0x00004ECFL, + 0x0000504DL, 0x000051CBL, 0x00005348L, 0x000054C3L, + 0x0000563EL, 0x000057B9L, 0x00005932L, 0x00005AAAL, + 0x00005C22L, 0x00005D99L, 0x00005F0FL, 0x00006084L, + 0x000061F8L, 0x0000636BL, 0x000064DDL, 0x0000664EL, + 0x000067BEL, 0x0000692DL, 0x00006A9BL, 0x00006C08L, + 0x00006D74L, 0x00006EDFL, 0x00007049L, 0x000071B2L, + 0x0000731AL, 0x00007480L, 0x000075E6L, 0x0000774AL, + 0x000078ADL, 0x00007A10L, 0x00007B70L, 0x00007CD0L, + 0x00007E2FL, 0x00007F8CL, 0x000080E8L, 0x00008243L, + 0x0000839CL, 0x000084F5L, 0x0000864CL, 0x000087A1L, + 0x000088F6L, 0x00008A49L, 0x00008B9AL, 0x00008CEBL, + 0x00008E3AL, 0x00008F88L, 0x000090D4L, 0x0000921FL, + 0x00009368L, 0x000094B0L, 0x000095F7L, 0x0000973CL, + 0x00009880L, 0x000099C2L, 0x00009B03L, 0x00009C42L, + 0x00009D80L, 0x00009EBCL, 0x00009FF7L, 0x0000A130L, + 0x0000A268L, 0x0000A39EL, 0x0000A4D2L, 0x0000A605L, + 0x0000A736L, 0x0000A866L, 0x0000A994L, 0x0000AAC1L, + 0x0000ABEBL, 0x0000AD14L, 0x0000AE3CL, 0x0000AF62L, + 0x0000B086L, 0x0000B1A8L, 0x0000B2C9L, 0x0000B3E8L, + 0x0000B505L, 0x0000B620L, 0x0000B73AL, 0x0000B852L, + 0x0000B968L, 0x0000BA7DL, 0x0000BB8FL, 0x0000BCA0L, + 0x0000BDAFL, 0x0000BEBCL, 0x0000BFC7L, 0x0000C0D1L, + 0x0000C1D8L, 0x0000C2DEL, 0x0000C3E2L, 0x0000C4E4L, + 0x0000C5E4L, 0x0000C6E2L, 0x0000C7DEL, 0x0000C8D9L, + 0x0000C9D1L, 0x0000CAC7L, 0x0000CBBCL, 0x0000CCAEL, + 0x0000CD9FL, 0x0000CE8EL, 0x0000CF7AL, 0x0000D065L, + 0x0000D14DL, 0x0000D234L, 0x0000D318L, 0x0000D3FBL, + 0x0000D4DBL, 0x0000D5BAL, 0x0000D696L, 0x0000D770L, + 0x0000D848L, 0x0000D91EL, 0x0000D9F2L, 0x0000DAC4L, + 0x0000DB94L, 0x0000DC62L, 0x0000DD2DL, 0x0000DDF7L, + 0x0000DEBEL, 0x0000DF83L, 0x0000E046L, 0x0000E107L, + 0x0000E1C6L, 0x0000E282L, 0x0000E33CL, 0x0000E3F4L, + 0x0000E4AAL, 0x0000E55EL, 0x0000E610L, 0x0000E6BFL, + 0x0000E76CL, 0x0000E817L, 0x0000E8BFL, 0x0000E966L, + 0x0000EA0AL, 0x0000EAABL, 0x0000EB4BL, 0x0000EBE8L, + 0x0000EC83L, 0x0000ED1CL, 0x0000EDB3L, 0x0000EE47L, + 0x0000EED9L, 0x0000EF68L, 0x0000EFF5L, 0x0000F080L, + 0x0000F109L, 0x0000F18FL, 0x0000F213L, 0x0000F295L, + 0x0000F314L, 0x0000F391L, 0x0000F40CL, 0x0000F484L, + 0x0000F4FAL, 0x0000F56EL, 0x0000F5DFL, 0x0000F64EL, + 0x0000F6BAL, 0x0000F724L, 0x0000F78CL, 0x0000F7F1L, + 0x0000F854L, 0x0000F8B4L, 0x0000F913L, 0x0000F96EL, + 0x0000F9C8L, 0x0000FA1FL, 0x0000FA73L, 0x0000FAC5L, + 0x0000FB15L, 0x0000FB62L, 0x0000FBADL, 0x0000FBF5L, + 0x0000FC3BL, 0x0000FC7FL, 0x0000FCC0L, 0x0000FCFEL, + 0x0000FD3BL, 0x0000FD74L, 0x0000FDACL, 0x0000FDE1L, + 0x0000FE13L, 0x0000FE43L, 0x0000FE71L, 0x0000FE9CL, + 0x0000FEC4L, 0x0000FEEBL, 0x0000FF0EL, 0x0000FF30L, + 0x0000FF4EL, 0x0000FF6BL, 0x0000FF85L, 0x0000FF9CL, + 0x0000FFB1L, 0x0000FFC4L, 0x0000FFD4L, 0x0000FFE1L, + 0x0000FFECL, 0x0000FFF5L, 0x0000FFFBL, 0x0000FFFFL, + 0x00010000L, +}; + +/* pre-computed tan table for 1st quadrant */ +static const CoglFixed tan_tbl[] = +{ + 0x00000000L, 0x00000192L, 0x00000324L, 0x000004b7L, + 0x00000649L, 0x000007dbL, 0x0000096eL, 0x00000b01L, + 0x00000c94L, 0x00000e27L, 0x00000fbaL, 0x0000114eL, + 0x000012e2L, 0x00001477L, 0x0000160cL, 0x000017a1L, + 0x00001937L, 0x00001acdL, 0x00001c64L, 0x00001dfbL, + 0x00001f93L, 0x0000212cL, 0x000022c5L, 0x0000245fL, + 0x000025f9L, 0x00002795L, 0x00002931L, 0x00002aceL, + 0x00002c6cL, 0x00002e0aL, 0x00002faaL, 0x0000314aL, + 0x000032ecL, 0x0000348eL, 0x00003632L, 0x000037d7L, + 0x0000397dL, 0x00003b24L, 0x00003cccL, 0x00003e75L, + 0x00004020L, 0x000041ccL, 0x00004379L, 0x00004528L, + 0x000046d8L, 0x0000488aL, 0x00004a3dL, 0x00004bf2L, + 0x00004da8L, 0x00004f60L, 0x0000511aL, 0x000052d5L, + 0x00005492L, 0x00005651L, 0x00005812L, 0x000059d5L, + 0x00005b99L, 0x00005d60L, 0x00005f28L, 0x000060f3L, + 0x000062c0L, 0x0000648fL, 0x00006660L, 0x00006834L, + 0x00006a0aL, 0x00006be2L, 0x00006dbdL, 0x00006f9aL, + 0x0000717aL, 0x0000735dL, 0x00007542L, 0x0000772aL, + 0x00007914L, 0x00007b02L, 0x00007cf2L, 0x00007ee6L, + 0x000080dcL, 0x000082d6L, 0x000084d2L, 0x000086d2L, + 0x000088d6L, 0x00008adcL, 0x00008ce7L, 0x00008ef4L, + 0x00009106L, 0x0000931bL, 0x00009534L, 0x00009750L, + 0x00009971L, 0x00009b95L, 0x00009dbeL, 0x00009febL, + 0x0000a21cL, 0x0000a452L, 0x0000a68cL, 0x0000a8caL, + 0x0000ab0eL, 0x0000ad56L, 0x0000afa3L, 0x0000b1f5L, + 0x0000b44cL, 0x0000b6a8L, 0x0000b909L, 0x0000bb70L, + 0x0000bdddL, 0x0000c04fL, 0x0000c2c7L, 0x0000c545L, + 0x0000c7c9L, 0x0000ca53L, 0x0000cce3L, 0x0000cf7aL, + 0x0000d218L, 0x0000d4bcL, 0x0000d768L, 0x0000da1aL, + 0x0000dcd4L, 0x0000df95L, 0x0000e25eL, 0x0000e52eL, + 0x0000e806L, 0x0000eae7L, 0x0000edd0L, 0x0000f0c1L, + 0x0000f3bbL, 0x0000f6bfL, 0x0000f9cbL, 0x0000fce1L, + 0x00010000L, 0x00010329L, 0x0001065dL, 0x0001099aL, + 0x00010ce3L, 0x00011036L, 0x00011394L, 0x000116feL, + 0x00011a74L, 0x00011df6L, 0x00012184L, 0x0001251fL, + 0x000128c6L, 0x00012c7cL, 0x0001303fL, 0x00013410L, + 0x000137f0L, 0x00013bdfL, 0x00013fddL, 0x000143ebL, + 0x00014809L, 0x00014c37L, 0x00015077L, 0x000154c9L, + 0x0001592dL, 0x00015da4L, 0x0001622eL, 0x000166ccL, + 0x00016b7eL, 0x00017045L, 0x00017523L, 0x00017a17L, + 0x00017f22L, 0x00018444L, 0x00018980L, 0x00018ed5L, + 0x00019445L, 0x000199cfL, 0x00019f76L, 0x0001a53aL, + 0x0001ab1cL, 0x0001b11dL, 0x0001b73fL, 0x0001bd82L, + 0x0001c3e7L, 0x0001ca71L, 0x0001d11fL, 0x0001d7f4L, + 0x0001def1L, 0x0001e618L, 0x0001ed6aL, 0x0001f4e8L, + 0x0001fc96L, 0x00020473L, 0x00020c84L, 0x000214c9L, + 0x00021d44L, 0x000225f9L, 0x00022ee9L, 0x00023818L, + 0x00024187L, 0x00024b3aL, 0x00025534L, 0x00025f78L, + 0x00026a0aL, 0x000274edL, 0x00028026L, 0x00028bb8L, + 0x000297a8L, 0x0002a3fbL, 0x0002b0b5L, 0x0002bdddL, + 0x0002cb79L, 0x0002d98eL, 0x0002e823L, 0x0002f740L, + 0x000306ecL, 0x00031730L, 0x00032816L, 0x000339a6L, + 0x00034bebL, 0x00035ef2L, 0x000372c6L, 0x00038776L, + 0x00039d11L, 0x0003b3a6L, 0x0003cb48L, 0x0003e40aL, + 0x0003fe02L, 0x00041949L, 0x000435f7L, 0x0004542bL, + 0x00047405L, 0x000495a9L, 0x0004b940L, 0x0004def6L, + 0x00050700L, 0x00053196L, 0x00055ef9L, 0x00058f75L, + 0x0005c35dL, 0x0005fb14L, 0x00063709L, 0x000677c0L, + 0x0006bdd0L, 0x000709ecL, 0x00075ce6L, 0x0007b7bbL, + 0x00081b98L, 0x000889e9L, 0x0009046eL, 0x00098d4dL, + 0x000a2736L, 0x000ad593L, 0x000b9cc6L, 0x000c828aL, + 0x000d8e82L, 0x000ecb1bL, 0x001046eaL, 0x00121703L, + 0x00145b00L, 0x0017448dL, 0x001b2672L, 0x002095afL, + 0x0028bc49L, 0x0036519aL, 0x00517bb6L, 0x00a2f8fdL, + 0x46d3eab2L, +}; + +/* 257-value table of atan. + * + * atan_tbl[0] is atan(0.0) and atan_tbl[256] is atan(1). + * The angles are radians in CoglFixed truncated to 16-bit (they're + * all less than one) + */ +static const guint16 atan_tbl[] = +{ + 0x0000, 0x00FF, 0x01FF, 0x02FF, 0x03FF, 0x04FF, 0x05FF, 0x06FF, + 0x07FF, 0x08FF, 0x09FE, 0x0AFE, 0x0BFD, 0x0CFD, 0x0DFC, 0x0EFB, + 0x0FFA, 0x10F9, 0x11F8, 0x12F7, 0x13F5, 0x14F3, 0x15F2, 0x16F0, + 0x17EE, 0x18EB, 0x19E9, 0x1AE6, 0x1BE3, 0x1CE0, 0x1DDD, 0x1ED9, + 0x1FD5, 0x20D1, 0x21CD, 0x22C8, 0x23C3, 0x24BE, 0x25B9, 0x26B3, + 0x27AD, 0x28A7, 0x29A1, 0x2A9A, 0x2B93, 0x2C8B, 0x2D83, 0x2E7B, + 0x2F72, 0x306A, 0x3160, 0x3257, 0x334D, 0x3442, 0x3538, 0x362D, + 0x3721, 0x3815, 0x3909, 0x39FC, 0x3AEF, 0x3BE2, 0x3CD4, 0x3DC5, + 0x3EB6, 0x3FA7, 0x4097, 0x4187, 0x4277, 0x4365, 0x4454, 0x4542, + 0x462F, 0x471C, 0x4809, 0x48F5, 0x49E0, 0x4ACB, 0x4BB6, 0x4CA0, + 0x4D89, 0x4E72, 0x4F5B, 0x5043, 0x512A, 0x5211, 0x52F7, 0x53DD, + 0x54C2, 0x55A7, 0x568B, 0x576F, 0x5852, 0x5934, 0x5A16, 0x5AF7, + 0x5BD8, 0x5CB8, 0x5D98, 0x5E77, 0x5F55, 0x6033, 0x6110, 0x61ED, + 0x62C9, 0x63A4, 0x647F, 0x6559, 0x6633, 0x670C, 0x67E4, 0x68BC, + 0x6993, 0x6A6A, 0x6B40, 0x6C15, 0x6CEA, 0x6DBE, 0x6E91, 0x6F64, + 0x7036, 0x7108, 0x71D9, 0x72A9, 0x7379, 0x7448, 0x7516, 0x75E4, + 0x76B1, 0x777E, 0x7849, 0x7915, 0x79DF, 0x7AA9, 0x7B72, 0x7C3B, + 0x7D03, 0x7DCA, 0x7E91, 0x7F57, 0x801C, 0x80E1, 0x81A5, 0x8269, + 0x832B, 0x83EE, 0x84AF, 0x8570, 0x8630, 0x86F0, 0x87AF, 0x886D, + 0x892A, 0x89E7, 0x8AA4, 0x8B5F, 0x8C1A, 0x8CD5, 0x8D8E, 0x8E47, + 0x8F00, 0x8FB8, 0x906F, 0x9125, 0x91DB, 0x9290, 0x9345, 0x93F9, + 0x94AC, 0x955F, 0x9611, 0x96C2, 0x9773, 0x9823, 0x98D2, 0x9981, + 0x9A2F, 0x9ADD, 0x9B89, 0x9C36, 0x9CE1, 0x9D8C, 0x9E37, 0x9EE0, + 0x9F89, 0xA032, 0xA0DA, 0xA181, 0xA228, 0xA2CE, 0xA373, 0xA418, + 0xA4BC, 0xA560, 0xA602, 0xA6A5, 0xA746, 0xA7E8, 0xA888, 0xA928, + 0xA9C7, 0xAA66, 0xAB04, 0xABA1, 0xAC3E, 0xACDB, 0xAD76, 0xAE11, + 0xAEAC, 0xAF46, 0xAFDF, 0xB078, 0xB110, 0xB1A7, 0xB23E, 0xB2D5, + 0xB36B, 0xB400, 0xB495, 0xB529, 0xB5BC, 0xB64F, 0xB6E2, 0xB773, + 0xB805, 0xB895, 0xB926, 0xB9B5, 0xBA44, 0xBAD3, 0xBB61, 0xBBEE, + 0xBC7B, 0xBD07, 0xBD93, 0xBE1E, 0xBEA9, 0xBF33, 0xBFBC, 0xC046, + 0xC0CE, 0xC156, 0xC1DD, 0xC264, 0xC2EB, 0xC371, 0xC3F6, 0xC47B, + 0xC4FF, 0xC583, 0xC606, 0xC689, 0xC70B, 0xC78D, 0xC80E, 0xC88F, + 0xC90F +}; + +/* look up table for square root */ +static const CoglFixed sqrt_tbl[] = +{ + 0x00000000L, 0x00010000L, 0x00016A0AL, 0x0001BB68L, + 0x00020000L, 0x00023C6FL, 0x00027312L, 0x0002A550L, + 0x0002D414L, 0x00030000L, 0x0003298BL, 0x0003510EL, + 0x000376CFL, 0x00039B05L, 0x0003BDDDL, 0x0003DF7CL, + 0x00040000L, 0x00041F84L, 0x00043E1EL, 0x00045BE1L, + 0x000478DEL, 0x00049524L, 0x0004B0BFL, 0x0004CBBCL, + 0x0004E624L, 0x00050000L, 0x00051959L, 0x00053237L, + 0x00054AA0L, 0x0005629AL, 0x00057A2BL, 0x00059159L, + 0x0005A828L, 0x0005BE9CL, 0x0005D4B9L, 0x0005EA84L, + 0x00060000L, 0x00061530L, 0x00062A17L, 0x00063EB8L, + 0x00065316L, 0x00066733L, 0x00067B12L, 0x00068EB4L, + 0x0006A21DL, 0x0006B54DL, 0x0006C847L, 0x0006DB0CL, + 0x0006ED9FL, 0x00070000L, 0x00071232L, 0x00072435L, + 0x0007360BL, 0x000747B5L, 0x00075935L, 0x00076A8CL, + 0x00077BBBL, 0x00078CC2L, 0x00079DA3L, 0x0007AE60L, + 0x0007BEF8L, 0x0007CF6DL, 0x0007DFBFL, 0x0007EFF0L, + 0x00080000L, 0x00080FF0L, 0x00081FC1L, 0x00082F73L, + 0x00083F08L, 0x00084E7FL, 0x00085DDAL, 0x00086D18L, + 0x00087C3BL, 0x00088B44L, 0x00089A32L, 0x0008A906L, + 0x0008B7C2L, 0x0008C664L, 0x0008D4EEL, 0x0008E361L, + 0x0008F1BCL, 0x00090000L, 0x00090E2EL, 0x00091C45L, + 0x00092A47L, 0x00093834L, 0x0009460CL, 0x000953CFL, + 0x0009617EL, 0x00096F19L, 0x00097CA1L, 0x00098A16L, + 0x00099777L, 0x0009A4C6L, 0x0009B203L, 0x0009BF2EL, + 0x0009CC47L, 0x0009D94FL, 0x0009E645L, 0x0009F32BL, + 0x000A0000L, 0x000A0CC5L, 0x000A1979L, 0x000A261EL, + 0x000A32B3L, 0x000A3F38L, 0x000A4BAEL, 0x000A5816L, + 0x000A646EL, 0x000A70B8L, 0x000A7CF3L, 0x000A8921L, + 0x000A9540L, 0x000AA151L, 0x000AAD55L, 0x000AB94BL, + 0x000AC534L, 0x000AD110L, 0x000ADCDFL, 0x000AE8A1L, + 0x000AF457L, 0x000B0000L, 0x000B0B9DL, 0x000B172DL, + 0x000B22B2L, 0x000B2E2BL, 0x000B3998L, 0x000B44F9L, + 0x000B504FL, 0x000B5B9AL, 0x000B66D9L, 0x000B720EL, + 0x000B7D37L, 0x000B8856L, 0x000B936AL, 0x000B9E74L, + 0x000BA973L, 0x000BB467L, 0x000BBF52L, 0x000BCA32L, + 0x000BD508L, 0x000BDFD5L, 0x000BEA98L, 0x000BF551L, + 0x000C0000L, 0x000C0AA6L, 0x000C1543L, 0x000C1FD6L, + 0x000C2A60L, 0x000C34E1L, 0x000C3F59L, 0x000C49C8L, + 0x000C542EL, 0x000C5E8CL, 0x000C68E0L, 0x000C732DL, + 0x000C7D70L, 0x000C87ACL, 0x000C91DFL, 0x000C9C0AL, + 0x000CA62CL, 0x000CB047L, 0x000CBA59L, 0x000CC464L, + 0x000CCE66L, 0x000CD861L, 0x000CE254L, 0x000CEC40L, + 0x000CF624L, 0x000D0000L, 0x000D09D5L, 0x000D13A2L, + 0x000D1D69L, 0x000D2727L, 0x000D30DFL, 0x000D3A90L, + 0x000D4439L, 0x000D4DDCL, 0x000D5777L, 0x000D610CL, + 0x000D6A9AL, 0x000D7421L, 0x000D7DA1L, 0x000D871BL, + 0x000D908EL, 0x000D99FAL, 0x000DA360L, 0x000DACBFL, + 0x000DB618L, 0x000DBF6BL, 0x000DC8B7L, 0x000DD1FEL, + 0x000DDB3DL, 0x000DE477L, 0x000DEDABL, 0x000DF6D8L, + 0x000E0000L, 0x000E0922L, 0x000E123DL, 0x000E1B53L, + 0x000E2463L, 0x000E2D6DL, 0x000E3672L, 0x000E3F70L, + 0x000E4869L, 0x000E515DL, 0x000E5A4BL, 0x000E6333L, + 0x000E6C16L, 0x000E74F3L, 0x000E7DCBL, 0x000E869DL, + 0x000E8F6BL, 0x000E9832L, 0x000EA0F5L, 0x000EA9B2L, + 0x000EB26BL, 0x000EBB1EL, 0x000EC3CBL, 0x000ECC74L, + 0x000ED518L, 0x000EDDB7L, 0x000EE650L, 0x000EEEE5L, + 0x000EF775L, 0x000F0000L, 0x000F0886L, 0x000F1107L, + 0x000F1984L, 0x000F21FCL, 0x000F2A6FL, 0x000F32DDL, + 0x000F3B47L, 0x000F43ACL, 0x000F4C0CL, 0x000F5468L, + 0x000F5CBFL, 0x000F6512L, 0x000F6D60L, 0x000F75AAL, + 0x000F7DEFL, 0x000F8630L, 0x000F8E6DL, 0x000F96A5L, + 0x000F9ED9L, 0x000FA709L, 0x000FAF34L, 0x000FB75BL, + 0x000FBF7EL, 0x000FC79DL, 0x000FCFB7L, 0x000FD7CEL, + 0x000FDFE0L, 0x000FE7EEL, 0x000FEFF8L, 0x000FF7FEL, + 0x00100000L, +}; + +/* the difference of the angle for two adjacent values in the + * sin_tbl table, expressed as CoglFixed number + */ +static const gint sin_tbl_size = G_N_ELEMENTS (sin_tbl) - 1; + +static const double _magic = 68719476736.0 * 1.5; + +/* Where in the 64 bits of double is the mantissa. + * + * FIXME - this should go inside the configure.ac + */ +#if (__FLOAT_WORD_ORDER == 1234) +#define _COGL_MAN 0 +#elif (__FLOAT_WORD_ORDER == 4321) +#define _COGL_MAN 1 +#else +#define COGL_NO_FAST_CONVERSIONS +#endif + +/* + * cogl_double_to_fixed : + * @value: value to be converted + * + * A fast conversion from double precision floating to fixed point + * + * Return value: Fixed point representation of the value + */ +CoglFixed +cogl_double_to_fixed (double val) +{ +#ifdef COGL_NO_FAST_CONVERSIONS + return (CoglFixed) (val * (double) COGL_FIXED_1); +#else + union { + double d; + unsigned int i[2]; + } dbl; + + dbl.d = val; + dbl.d = dbl.d + _magic; + + return dbl.i[_COGL_MAN]; +#endif +} + +/* + * cogl_double_to_int : + * @value: value to be converted + * + * A fast conversion from doulbe precision floatint point to int; + * used this instead of casting double/float to int. + * + * Return value: Integer part of the double + */ +gint +cogl_double_to_int (double val) +{ +#ifdef COGL_NO_FAST_CONVERSIONS + return (gint) (val); +#else + union { + double d; + unsigned int i[2]; + } dbl; + + dbl.d = val; + dbl.d = dbl.d + _magic; + + return ((int) dbl.i[_COGL_MAN]) >> 16; +#endif +} + +guint +cogl_double_to_uint (double val) +{ +#ifdef COGL_NO_FAST_CONVERSIONS + return (guint)(val); +#else + union { + double d; + unsigned int i[2]; + } dbl; + + dbl.d = val; + dbl.d = dbl.d + _magic; + + return (dbl.i[_COGL_MAN]) >> 16; +#endif +} + +#undef _COGL_MAN + +CoglFixed +cogl_fixed_sin (CoglFixed angle) +{ + int sign = 1, indx1, indx2; + CoglFixed low, high; + CoglFixed p1, p2; + CoglFixed d1, d2; + + /* convert negative angle to positive + sign */ + if ((int) angle < 0) + { + sign = -sign; + angle = -angle; + } + + /* reduce to <0, 2*pi) */ + angle = angle % COGL_FIXED_2_PI; + + /* reduce to first quadrant and sign */ + if (angle > COGL_FIXED_PI) + { + sign = -sign; + + if (angle > COGL_FIXED_PI + COGL_FIXED_PI_2) + { + /* fourth qudrant */ + angle = COGL_FIXED_2_PI - angle; + } + else + { + /* third quadrant */ + angle -= COGL_FIXED_PI; + } + } + else + { + if (angle > COGL_FIXED_PI_2) + { + /* second quadrant */ + angle = COGL_FIXED_PI - angle; + } + } + + /* Calculate indices of the two nearest values in our table + * and return weighted average. + * + * We multiple first than divide to preserve precision. Since + * angle is in the first quadrant, angle * SIN_TBL_SIZE (=256) + * can't overflow. + * + * Handle the end of the table gracefully + */ + indx1 = (angle * sin_tbl_size) / COGL_FIXED_PI_2; + + if (indx1 == sin_tbl_size) + { + indx2 = indx1; + indx1 = indx2 - 1; + } + else + { + indx2 = indx1 + 1; + } + + low = sin_tbl[indx1]; + high = sin_tbl[indx2]; + + /* Again multiply the divide; no danger of overflow */ + p1 = (indx1 * COGL_FIXED_PI_2) / sin_tbl_size; + p2 = (indx2 * COGL_FIXED_PI_2) / sin_tbl_size; + d1 = angle - p1; + d2 = p2 - angle; + + angle = ((low * d2 + high * d1) / (p2 - p1)); + + if (sign < 0) + angle = -angle; + + return angle; +} + +CoglFixed +cogl_angle_sin (CoglAngle angle) +{ + int sign = 1; + CoglFixed result; + + /* reduce negative angle to positive + sign */ + if (angle < 0) + { + sign = -sign; + angle = -angle; + } + + /* reduce to <0, 2*pi) */ + angle &= 0x3ff; + + /* reduce to first quadrant and sign */ + if (angle > 512) + { + sign = -sign; + + if (angle > 768) + { + /* fourth qudrant */ + angle = 1024 - angle; + } + else + { + /* third quadrant */ + angle -= 512; + } + } + else + { + if (angle > 256) + { + /* second quadrant */ + angle = 512 - angle; + } + } + + result = sin_tbl[angle]; + + if (sign < 0) + result = -result; + + return result; +} + +CoglFixed +cogl_fixed_tan (CoglFixed angle) +{ + return cogl_angle_tan (COGL_ANGLE_FROM_DEGX (angle)); +} + +CoglFixed +cogl_angle_tan (CoglAngle angle) +{ + int sign = 1; + CoglFixed result; + + /* reduce negative angle to positive + sign */ + if (angle < 0) + { + sign = -sign; + angle = -angle; + } + + /* reduce to <0, pi) */ + angle &= 0x1ff; + + /* reduce to first quadrant and sign */ + if (angle > 256) + { + sign = -sign; + angle = 512 - angle; + } + + result = tan_tbl[angle]; + + if (sign < 0) + result = -result; + + return result; +} + +CoglFixed +cogl_fixed_atan (CoglFixed x) +{ + gboolean negative = FALSE; + CoglFixed angle; + + if (x < 0) + { + negative = TRUE; + x = -x; + } + + if (x > COGL_FIXED_1) + { + /* if x > 1 then atan(x) = pi/2 - atan(1/x) */ + angle = COGL_FIXED_PI / 2 + - atan_tbl[COGL_FIXED_DIV (COGL_FIXED_1, x) >> 8]; + } + else + angle = atan_tbl[x >> 8]; + + return negative ? -angle : angle; +} + +CoglFixed +cogl_fixed_atan2 (CoglFixed y, CoglFixed x) +{ + CoglFixed angle; + + if (x == 0) + angle = y >= 0 ? COGL_FIXED_PI_2 : -COGL_FIXED_PI_2; + else + { + angle = cogl_fixed_atan (COGL_FIXED_DIV (y, x)); + + if (x < 0) + angle += y >= 0 ? COGL_FIXED_PI : -COGL_FIXED_PI; + } + + return angle; +} + +CoglFixed +cogl_fixed_sqrt (CoglFixed x) +{ + /* The idea for this comes from the Alegro library, exploiting the + * fact that, + * sqrt (x) = sqrt (x/d) * sqrt (d); + * + * For d == 2^(n): + * + * sqrt (x) = sqrt (x/2^(2n)) * 2^n + * + * By locating suitable n for given x such that x >> 2n is in <0,255> + * we can use a LUT of precomputed values. + * + * This algorithm provides both good performance and precision; + * on ARM this function is about 5 times faster than c-lib sqrt, + * whilst producing errors < 1%. + */ + int t = 0; + int sh = 0; + unsigned int mask = 0x40000000; + unsigned fract = x & 0x0000ffff; + unsigned int d1, d2; + CoglFixed v1, v2; + + if (x <= 0) + return 0; + + if (x > COGL_FIXED_255 || x < COGL_FIXED_1) + { + /* + * Find the highest bit set + */ +#if __arm__ + /* This actually requires at least arm v5, but gcc does not seem + * to set the architecture defines correctly, and it is I think + * very unlikely that anyone will want to use clutter on anything + * less than v5. + */ + int bit; + __asm__ ("clz %0, %1\n" + "rsb %0, %0, #31\n" + :"=r"(bit) + :"r" (x)); + + /* make even (2n) */ + bit &= 0xfffffffe; +#else + /* TODO -- add i386 branch using bshr + * + * NB: it's been said that the bshr instruction is poorly implemented + * and that it is possible to write a faster code in C using binary + * search -- at some point we should explore this + */ + int bit = 30; + while (bit >= 0) + { + if (x & mask) + break; + + mask = (mask >> 1 | mask >> 2); + bit -= 2; + } +#endif + + /* now bit indicates the highest bit set; there are two scenarios + * + * 1) bit < 23: Our number is smaller so we shift it left to maximase + * precision (< 16 really, since <16,23> never goes + * through here. + * + * 2) bit > 23: our number is above the table, so we shift right + */ + + sh = ((bit - 22) >> 1); + if (bit >= 8) + t = (x >> (16 - 22 + bit)); + else + t = (x << (22 - 16 - bit)); + } + else + { + t = COGL_FIXED_TO_INT (x); + } + + /* Do a weighted average of the two nearest values */ + v1 = sqrt_tbl[t]; + v2 = sqrt_tbl[t+1]; + + /* + * 12 is fairly arbitrary -- we want integer that is not too big to cost + * us precision + */ + d1 = (unsigned)(fract) >> 12; + d2 = ((unsigned)COGL_FIXED_1 >> 12) - d1; + + x = ((v1*d2) + (v2*d1))/(COGL_FIXED_1 >> 12); + + if (sh > 0) + x = x << sh; + else if (sh < 0) + x = x >> -sh; + + return x; +} + +/** + * cogl_sqrti: + * @x: integer value + * + * Very fast fixed point implementation of square root for integers. + * + * This function is at least 6x faster than clib sqrt() on x86, and (this is + * not a typo!) about 500x faster on ARM without FPU. It's error is < 5% + * for arguments < #COGL_SQRTI_ARG_5_PERCENT and < 10% for arguments < + * #COGL_SQRTI_ARG_10_PERCENT. The maximum argument that can be passed to + * this function is COGL_SQRTI_ARG_MAX. + * + * Return value: integer square root. + * + * + * Since: 0.2 + */ +gint +cogl_sqrti (gint number) +{ +#if defined __SSE2__ + /* The GCC built-in with SSE2 (sqrtsd) is up to twice as fast as + * the pure integer code below. It is also more accurate. + */ + return __builtin_sqrt (number); +#else + /* This is a fixed point implementation of the Quake III sqrt algorithm, + * described, for example, at + * http://www.codemaestro.com/reviews/review00000105.html + * + * While the original QIII is extremely fast, the use of floating division + * and multiplication makes it perform very on arm processors without FPU. + * + * The key to successfully replacing the floating point operations with + * fixed point is in the choice of the fixed point format. The QIII + * algorithm does not calculate the square root, but its reciprocal ('y' + * below), which is only at the end turned to the inverse value. In order + * for the algorithm to produce satisfactory results, the reciprocal value + * must be represented with sufficient precission; the 16.16 we use + * elsewhere in clutter is not good enough, and 10.22 is used instead. + */ + CoglFixed x; + guint32 y_1; /* 10.22 fixed point */ + guint32 f = 0x600000; /* '1.5' as 10.22 fixed */ + + union + { + float f; + guint32 i; + } flt, flt2; + + flt.f = number; + + x = COGL_FIXED_FROM_INT (number) / 2; + + /* The QIII initial estimate */ + flt.i = 0x5f3759df - ( flt.i >> 1 ); + + /* Now, we convert the float to 10.22 fixed. We exploit the mechanism + * described at http://www.d6.com/users/checker/pdfs/gdmfp.pdf. + * + * We want 22 bit fraction; a single precission float uses 23 bit + * mantisa, so we only need to add 2^(23-22) (no need for the 1.5 + * multiplier as we are only dealing with positive numbers). + * + * Note: we have to use two separate variables here -- for some reason, + * if we try to use just the flt variable, gcc on ARM optimises the whole + * addition out, and it all goes pear shape, since without it, the bits + * in the float will not be correctly aligned. + */ + flt2.f = flt.f + 2.0; + flt2.i &= 0x7FFFFF; + + /* Now we correct the estimate */ + y_1 = (flt2.i >> 11) * (flt2.i >> 11); + y_1 = (y_1 >> 8) * (x >> 8); + + y_1 = f - y_1; + flt2.i = (flt2.i >> 11) * (y_1 >> 11); + + /* If the original argument is less than 342, we do another + * iteration to improve precission (for arguments >= 342, the single + * iteration produces generally better results). + */ + if (x < 171) + { + y_1 = (flt2.i >> 11) * (flt2.i >> 11); + y_1 = (y_1 >> 8) * (x >> 8); + + y_1 = f - y_1; + flt2.i = (flt2.i >> 11) * (y_1 >> 11); + } + + /* Invert, round and convert from 10.22 to an integer + * 0x1e3c68 is a magical rounding constant that produces slightly + * better results than 0x200000. + */ + return (number * flt2.i + 0x1e3c68) >> 22; +#endif +} + +CoglFixed +cogl_fixed_mul (CoglFixed a, + CoglFixed b) +{ +#ifdef __arm__ + /* This provides about 12% speedeup on the gcc -O2 optimised + * C version + * + * Based on code found in the following thread: + * http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2006-August/014405.html + */ + int res_low, res_hi; + + __asm__ ("smull %0, %1, %2, %3 \n" + "mov %0, %0, lsr %4 \n" + "add %1, %0, %1, lsl %5 \n" + : "=r"(res_hi), "=r"(res_low) \ + : "r"(a), "r"(b), "i"(COGL_FIXED_Q), "i"(32 - COGL_FIXED_Q)); + + return (CoglFixed) res_low; +#else + gint64 r = (gint64) a * (gint64) b; + + return (CoglFixed) (r >> COGL_FIXED_Q); +#endif +} + +CoglFixed +cogl_fixed_div (CoglFixed a, + CoglFixed b) +{ + return (CoglFixed) ((((gint64) a) << COGL_FIXED_Q) / b); +} + +CoglFixed +cogl_fixed_mul_div (CoglFixed a, + CoglFixed b, + CoglFixed c) +{ + CoglFixed ab = cogl_fixed_mul (a, b); + CoglFixed quo = cogl_fixed_div (ab, c); + + return quo; +} + +/* + * The log2x() and pow2x() functions + * + * The implementation of the log2x() and pow2x() exploits the + * well-documented fact that the exponent part of IEEE floating + * number provides a good estimate of log2 of that number, while + * the mantissa serves as a good error-correction. + * + * The implementation here uses a quadratic error correction as + * described by Ian Stephenson at: + * http://www.dctsystems.co.uk/Software/power.html. + */ + +CoglFixed +cogl_fixed_log2 (guint x) +{ + /* Note: we could easily have a version for CoglFixed x, but the int + * precision is enough for the current purposes. + */ + union + { + float f; + CoglFixed i; + } flt; + + CoglFixed magic = 0x58bb; + CoglFixed y; + + /* + * Convert x to float, then extract exponent. + * + * We want the result to be 16.16 fixed, so we shift (23-16) bits only + */ + flt.f = x; + flt.i >>= 7; + flt.i -= COGL_FIXED_FROM_INT (127); + + y = COGL_FIXED_FRACTION (flt.i); + + y = COGL_FIXED_MUL ((y - COGL_FIXED_MUL (y, y)), magic); + + return flt.i + y; +} + +guint +cogl_fixed_pow2 (CoglFixed x) +{ + /* Note: we could easily have a version that produces CoglFixed result, + * but the the range would be limited to x < 15, and the int precision + * is enough for the current purposes. + */ + + union + { + float f; + guint32 i; + } flt; + + CoglFixed magic = 0x56f7; + CoglFixed y; + + flt.i = x; + + /* + * Reverse of the log2x function -- convert the fixed value to a suitable + * floating point exponent, and mantisa adjusted with quadratic error + * correction y. + */ + y = COGL_FIXED_FRACTION (x); + y = COGL_FIXED_MUL ((y - COGL_FIXED_MUL (y, y)), magic); + + /* Shift the exponent into it's position in the floating point + * representation; as our number is not int but 16.16 fixed, shift only + * by (23 - 16) + */ + flt.i += (COGL_FIXED_FROM_INT (127) - y); + flt.i <<= 7; + + return COGL_FLOAT_TO_UINT (flt.f); +} + +guint +cogl_fixed_pow (guint x, + CoglFixed y) +{ + return cogl_fixed_pow2 (COGL_FIXED_MUL (y, cogl_fixed_log2 (x))); +} + +CoglFixed +cogl_angle_cos (CoglAngle angle) +{ + CoglAngle a = angle + 256; + + return cogl_angle_sin (a); +} + +CoglFixed +cogl_fixed_cos (CoglFixed angle) +{ + CoglFixed a = angle + COGL_FIXED_PI_2; + + return cogl_fixed_sin (a); +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/common/cogl-material.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/common/cogl-material.c --- clutter-0.8.4/clutter/cogl/common/cogl-material.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/common/cogl-material.c 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,1151 @@ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "cogl.h" +#include "cogl-internal.h" +#include "cogl-context.h" +#include "cogl-handle.h" + +#include "cogl-material-private.h" + +#include +#include + +/* + * GL/GLES compatability defines for material thingies: + */ + +#ifdef HAVE_COGL_GLES2 +#define glAlphaFunc cogl_wrap_glAlphaFunc +#endif + +static void _cogl_material_free (CoglMaterial *tex); +static void _cogl_material_layer_free (CoglMaterialLayer *layer); + +COGL_HANDLE_DEFINE (Material, material, material_handles); +COGL_HANDLE_DEFINE (MaterialLayer, + material_layer, + material_layer_handles); + +CoglHandle +cogl_material_new (void) +{ + /* Create new - blank - material */ + CoglMaterial *material = g_new0 (CoglMaterial, 1); + GLfloat *unlit = material->unlit; + GLfloat *ambient = material->ambient; + GLfloat *diffuse = material->diffuse; + GLfloat *specular = material->specular; + GLfloat *emission = material->emission; + + material->ref_count = 1; + COGL_HANDLE_DEBUG_NEW (material, material); + + /* Use the same defaults as the GL spec... */ + unlit[0] = 1.0; unlit[1] = 1.0; unlit[2] = 1.0; unlit[3] = 1.0; + material->flags |= COGL_MATERIAL_FLAG_DEFAULT_COLOR; + + /* Use the same defaults as the GL spec... */ + ambient[0] = 0.2; ambient[1] = 0.2; ambient[2] = 0.2; ambient[3] = 1.0; + diffuse[0] = 0.8; diffuse[1] = 0.8; diffuse[2] = 0.8; diffuse[3] = 1.0; + specular[0] = 0; specular[1] = 0; specular[2] = 0; specular[3] = 1.0; + emission[0] = 0; emission[1] = 0; emission[2] = 0; emission[3] = 1.0; + material->flags |= COGL_MATERIAL_FLAG_DEFAULT_GL_MATERIAL; + + /* Use the same defaults as the GL spec... */ + material->alpha_func = COGL_MATERIAL_ALPHA_FUNC_ALWAYS; + material->alpha_func_reference = 0.0; + material->flags |= COGL_MATERIAL_FLAG_DEFAULT_ALPHA_FUNC; + + /* Not the same as the GL default, but seems saner... */ + material->blend_src_factor = COGL_MATERIAL_BLEND_FACTOR_SRC_ALPHA; + material->blend_dst_factor = COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA; + material->flags |= COGL_MATERIAL_FLAG_DEFAULT_BLEND_FUNC; + + material->layers = NULL; + + return _cogl_material_handle_new (material); +} + +static void +_cogl_material_free (CoglMaterial *material) +{ + /* Frees material resources but its handle is not + released! Do that separately before this! */ + + g_list_foreach (material->layers, + (GFunc)cogl_material_layer_unref, NULL); + g_free (material); +} + +void +cogl_material_get_color (CoglHandle handle, + CoglColor *color) +{ + CoglMaterial *material; + + g_return_if_fail (cogl_is_material (handle)); + + material = _cogl_material_pointer_from_handle (handle); + + cogl_color_set_from_4f (color, + material->unlit[0], + material->unlit[1], + material->unlit[2], + material->unlit[3]); +} + +void +cogl_material_set_color (CoglHandle handle, + const CoglColor *unlit_color) +{ + CoglMaterial *material; + GLfloat unlit[4]; + + g_return_if_fail (cogl_is_material (handle)); + + material = _cogl_material_pointer_from_handle (handle); + + unlit[0] = cogl_color_get_red_float (unlit_color); + unlit[1] = cogl_color_get_green_float (unlit_color); + unlit[2] = cogl_color_get_blue_float (unlit_color); + unlit[3] = cogl_color_get_alpha_float (unlit_color); + if (memcmp (unlit, material->unlit, sizeof (unlit)) == 0) + return; + + memcpy (material->unlit, unlit, sizeof (unlit)); + + if (unlit[0] == 1.0 && + unlit[1] == 1.0 && + unlit[2] == 1.0 && + unlit[3] == 1.0) + material->flags |= COGL_MATERIAL_FLAG_DEFAULT_COLOR; + + if (unlit[3] != 1.0) + material->flags |= COGL_MATERIAL_FLAG_ENABLE_BLEND; + + material->flags |= COGL_MATERIAL_FLAG_DIRTY; + material->flags &= ~COGL_MATERIAL_FLAG_DEFAULT_COLOR; +} + +void +cogl_material_set_color4ub (CoglHandle handle, + guint8 red, + guint8 green, + guint8 blue, + guint8 alpha) +{ + CoglColor color; + cogl_color_set_from_4ub (&color, red, green, blue, alpha); + cogl_material_set_color (handle, &color); +} + +void +cogl_material_get_ambient (CoglHandle handle, + CoglColor *ambient) +{ + CoglMaterial *material; + + g_return_if_fail (cogl_is_material (handle)); + + material = _cogl_material_pointer_from_handle (handle); + + cogl_color_set_from_4f (ambient, + material->ambient[0], + material->ambient[1], + material->ambient[2], + material->ambient[3]); +} + +void +cogl_material_set_ambient (CoglHandle handle, + const CoglColor *ambient_color) +{ + CoglMaterial *material; + GLfloat *ambient; + + g_return_if_fail (cogl_is_material (handle)); + + material = _cogl_material_pointer_from_handle (handle); + + ambient = material->ambient; + ambient[0] = cogl_color_get_red_float (ambient_color); + ambient[1] = cogl_color_get_green_float (ambient_color); + ambient[2] = cogl_color_get_blue_float (ambient_color); + ambient[3] = cogl_color_get_alpha_float (ambient_color); + + material->flags |= COGL_MATERIAL_FLAG_DIRTY; + material->flags &= ~COGL_MATERIAL_FLAG_DEFAULT_GL_MATERIAL; +} + +void +cogl_material_get_diffuse (CoglHandle handle, + CoglColor *diffuse) +{ + CoglMaterial *material; + + g_return_if_fail (cogl_is_material (handle)); + + material = _cogl_material_pointer_from_handle (handle); + + cogl_color_set_from_4f (diffuse, + material->diffuse[0], + material->diffuse[1], + material->diffuse[2], + material->diffuse[3]); +} + +void +cogl_material_set_diffuse (CoglHandle handle, + const CoglColor *diffuse_color) +{ + CoglMaterial *material; + GLfloat *diffuse; + + g_return_if_fail (cogl_is_material (handle)); + + material = _cogl_material_pointer_from_handle (handle); + + diffuse = material->diffuse; + diffuse[0] = cogl_color_get_red_float (diffuse_color); + diffuse[1] = cogl_color_get_green_float (diffuse_color); + diffuse[2] = cogl_color_get_blue_float (diffuse_color); + diffuse[3] = cogl_color_get_alpha_float (diffuse_color); + + material->flags |= COGL_MATERIAL_FLAG_DIRTY; + material->flags &= ~COGL_MATERIAL_FLAG_DEFAULT_GL_MATERIAL; +} + +void +cogl_material_set_ambient_and_diffuse (CoglHandle handle, + const CoglColor *color) +{ + cogl_material_set_ambient (handle, color); + cogl_material_set_diffuse (handle, color); +} + +void +cogl_material_get_specular (CoglHandle handle, + CoglColor *specular) +{ + CoglMaterial *material; + + g_return_if_fail (cogl_is_material (handle)); + + material = _cogl_material_pointer_from_handle (handle); + + cogl_color_set_from_4f (specular, + material->specular[0], + material->specular[1], + material->specular[2], + material->specular[3]); +} + +void +cogl_material_set_specular (CoglHandle handle, + const CoglColor *specular_color) +{ + CoglMaterial *material; + GLfloat *specular; + + g_return_if_fail (cogl_is_material (handle)); + + material = _cogl_material_pointer_from_handle (handle); + + specular = material->specular; + specular[0] = cogl_color_get_red_float (specular_color); + specular[1] = cogl_color_get_green_float (specular_color); + specular[2] = cogl_color_get_blue_float (specular_color); + specular[3] = cogl_color_get_alpha_float (specular_color); + + material->flags |= COGL_MATERIAL_FLAG_DIRTY; + material->flags &= ~COGL_MATERIAL_FLAG_DEFAULT_GL_MATERIAL; +} + +float +cogl_material_get_shininess (CoglHandle handle) +{ + CoglMaterial *material; + + g_return_val_if_fail (cogl_is_material (handle), 0); + + material = _cogl_material_pointer_from_handle (handle); + + return material->shininess; +} + +void +cogl_material_set_shininess (CoglHandle handle, + float shininess) +{ + CoglMaterial *material; + + g_return_if_fail (cogl_is_material (handle)); + + if (shininess < 0.0 || shininess > 1.0) + g_warning ("Out of range shininess %f supplied for material\n", + shininess); + + material = _cogl_material_pointer_from_handle (handle); + + material->shininess = (GLfloat)shininess * 128.0; + + material->flags |= COGL_MATERIAL_FLAG_DIRTY; + material->flags &= ~COGL_MATERIAL_FLAG_DEFAULT_GL_MATERIAL; +} + +void +cogl_material_get_emission (CoglHandle handle, + CoglColor *emission) +{ + CoglMaterial *material; + + g_return_if_fail (cogl_is_material (handle)); + + material = _cogl_material_pointer_from_handle (handle); + + cogl_color_set_from_4f (emission, + material->emission[0], + material->emission[1], + material->emission[2], + material->emission[3]); +} + +void +cogl_material_set_emission (CoglHandle handle, + const CoglColor *emission_color) +{ + CoglMaterial *material; + GLfloat *emission; + + g_return_if_fail (cogl_is_material (handle)); + + material = _cogl_material_pointer_from_handle (handle); + + emission = material->emission; + emission[0] = cogl_color_get_red_float (emission_color); + emission[1] = cogl_color_get_green_float (emission_color); + emission[2] = cogl_color_get_blue_float (emission_color); + emission[3] = cogl_color_get_alpha_float (emission_color); + + material->flags |= COGL_MATERIAL_FLAG_DIRTY; + material->flags &= ~COGL_MATERIAL_FLAG_DEFAULT_GL_MATERIAL; +} + +void +cogl_material_set_alpha_test_function (CoglHandle handle, + CoglMaterialAlphaFunc alpha_func, + float alpha_reference) +{ + CoglMaterial *material; + + g_return_if_fail (cogl_is_material (handle)); + + material = _cogl_material_pointer_from_handle (handle); + material->alpha_func = alpha_func; + material->alpha_func_reference = (GLfloat)alpha_reference; + + material->flags |= COGL_MATERIAL_FLAG_DIRTY; + material->flags &= ~COGL_MATERIAL_FLAG_DEFAULT_ALPHA_FUNC; +} + +void +cogl_material_set_blend_factors (CoglHandle handle, + CoglMaterialBlendFactor src_factor, + CoglMaterialBlendFactor dst_factor) +{ + CoglMaterial *material; + + g_return_if_fail (cogl_is_material (handle)); + + material = _cogl_material_pointer_from_handle (handle); + material->blend_src_factor = src_factor; + material->blend_dst_factor = dst_factor; + + material->flags |= COGL_MATERIAL_FLAG_DIRTY; + material->flags &= ~COGL_MATERIAL_FLAG_DEFAULT_BLEND_FUNC; +} + +/* Asserts that a layer corresponding to the given index exists. If no + * match is found, then a new empty layer is added. + */ +static CoglMaterialLayer * +_cogl_material_get_layer (CoglMaterial *material, + gint index_, + gboolean create_if_not_found) +{ + CoglMaterialLayer *layer; + GList *tmp; + CoglHandle layer_handle; + + for (tmp = material->layers; tmp != NULL; tmp = tmp->next) + { + layer = + _cogl_material_layer_pointer_from_handle ((CoglHandle)tmp->data); + if (layer->index == index_) + return layer; + + /* The layers are always sorted, so at this point we know this layer + * doesn't exist */ + if (layer->index > index_) + break; + } + /* NB: if we now insert a new layer before tmp, that will maintain order. + */ + + if (!create_if_not_found) + return NULL; + + layer = g_new0 (CoglMaterialLayer, 1); + + layer->ref_count = 1; + layer->index = index_; + layer->flags = COGL_MATERIAL_LAYER_FLAG_DEFAULT_COMBINE; + layer->texture = COGL_INVALID_HANDLE; + + /* Choose the same default combine mode as OpenGL: + * MODULATE(PREVIOUS[RGBA],TEXTURE[RGBA]) */ + layer->texture_combine_rgb_func = COGL_MATERIAL_LAYER_COMBINE_FUNC_MODULATE; + layer->texture_combine_rgb_src[0] = COGL_MATERIAL_LAYER_COMBINE_SRC_PREVIOUS; + layer->texture_combine_rgb_src[1] = COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE; + layer->texture_combine_rgb_op[0] = COGL_MATERIAL_LAYER_COMBINE_OP_SRC_COLOR; + layer->texture_combine_rgb_op[1] = COGL_MATERIAL_LAYER_COMBINE_OP_SRC_COLOR; + layer->texture_combine_alpha_func = + COGL_MATERIAL_LAYER_COMBINE_FUNC_MODULATE; + layer->texture_combine_alpha_src[0] = + COGL_MATERIAL_LAYER_COMBINE_SRC_PREVIOUS; + layer->texture_combine_alpha_src[1] = + COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE; + layer->texture_combine_alpha_op[0] = + COGL_MATERIAL_LAYER_COMBINE_OP_SRC_ALPHA; + layer->texture_combine_alpha_op[1] = + COGL_MATERIAL_LAYER_COMBINE_OP_SRC_ALPHA; + + cogl_matrix_init_identity (&layer->matrix); + + layer_handle = _cogl_material_layer_handle_new (layer); + /* Note: see comment after for() loop above */ + material->layers = + g_list_insert_before (material->layers, tmp, layer_handle); + + return layer; +} + +void +cogl_material_set_layer (CoglHandle material_handle, + gint layer_index, + CoglHandle texture_handle) +{ + CoglMaterial *material; + CoglMaterialLayer *layer; + int n_layers; + + g_return_if_fail (cogl_is_material (material_handle)); + g_return_if_fail (cogl_is_texture (texture_handle)); + + material = _cogl_material_pointer_from_handle (material_handle); + layer = _cogl_material_get_layer (material_handle, layer_index, TRUE); + + /* XXX: If we expose manual control over ENABLE_BLEND, we'll add + * a flag to know when it's user configured, so we don't trash it */ + if (cogl_texture_get_format (texture_handle) & COGL_A_BIT) + material->flags |= COGL_MATERIAL_FLAG_ENABLE_BLEND; + + n_layers = g_list_length (material->layers); + if (n_layers >= CGL_MAX_COMBINED_TEXTURE_IMAGE_UNITS) + { + if (!(material->flags & COGL_MATERIAL_FLAG_SHOWN_SAMPLER_WARNING)) + { + g_warning ("Your hardware does not have enough texture samplers" + "to handle this many texture layers"); + material->flags |= COGL_MATERIAL_FLAG_SHOWN_SAMPLER_WARNING; + } + /* Note: We always make a best effort attempt to display as many + * layers as possible, so this isn't an _error_ */ + /* Note: in the future we may support enabling/disabling layers + * too, so it may become valid to add more than + * MAX_COMBINED_TEXTURE_IMAGE_UNITS layers. */ + } + + cogl_texture_ref (texture_handle); + + if (layer->texture) + cogl_texture_unref (layer->texture); + + layer->texture = texture_handle; + layer->flags |= COGL_MATERIAL_LAYER_FLAG_DIRTY; + material->flags |= COGL_MATERIAL_FLAG_LAYERS_DIRTY; +} + +void +cogl_material_set_layer_combine_function ( + CoglHandle handle, + gint layer_index, + CoglMaterialLayerCombineChannels channels, + CoglMaterialLayerCombineFunc func) +{ + CoglMaterial *material; + CoglMaterialLayer *layer; + gboolean set_alpha_func = FALSE; + gboolean set_rgb_func = FALSE; + + g_return_if_fail (cogl_is_material (handle)); + + material = _cogl_material_pointer_from_handle (handle); + layer = _cogl_material_get_layer (material, layer_index, TRUE); + + if (channels == COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA) + set_alpha_func = set_rgb_func = TRUE; + else if (channels == COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGB) + set_rgb_func = TRUE; + else if (channels == COGL_MATERIAL_LAYER_COMBINE_CHANNELS_ALPHA) + set_alpha_func = TRUE; + + if (set_rgb_func) + layer->texture_combine_rgb_func = func; + if (set_alpha_func) + layer->texture_combine_alpha_func = func; + + material->flags |= COGL_MATERIAL_FLAG_LAYERS_DIRTY; + layer->flags |= COGL_MATERIAL_LAYER_FLAG_DIRTY; + layer->flags &= ~COGL_MATERIAL_LAYER_FLAG_DEFAULT_COMBINE; +} + +void +cogl_material_set_layer_combine_arg_src ( + CoglHandle handle, + gint layer_index, + gint argument, + CoglMaterialLayerCombineChannels channels, + CoglMaterialLayerCombineSrc src) +{ + CoglMaterial *material; + CoglMaterialLayer *layer; + gboolean set_arg_alpha_src = FALSE; + gboolean set_arg_rgb_src = FALSE; + + g_return_if_fail (cogl_is_material (handle)); + g_return_if_fail (argument >=0 && argument <= 3); + + material = _cogl_material_pointer_from_handle (handle); + layer = _cogl_material_get_layer (material, layer_index, TRUE); + + if (channels == COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA) + set_arg_alpha_src = set_arg_rgb_src = TRUE; + else if (channels == COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGB) + set_arg_rgb_src = TRUE; + else if (channels == COGL_MATERIAL_LAYER_COMBINE_CHANNELS_ALPHA) + set_arg_alpha_src = TRUE; + + if (set_arg_rgb_src) + layer->texture_combine_rgb_src[argument] = src; + if (set_arg_alpha_src) + layer->texture_combine_alpha_src[argument] = src; + + material->flags |= COGL_MATERIAL_FLAG_LAYERS_DIRTY; + layer->flags |= COGL_MATERIAL_LAYER_FLAG_DIRTY; + layer->flags &= ~COGL_MATERIAL_LAYER_FLAG_DEFAULT_COMBINE; +} + +void +cogl_material_set_layer_combine_arg_op ( + CoglHandle material_handle, + gint layer_index, + gint argument, + CoglMaterialLayerCombineChannels channels, + CoglMaterialLayerCombineOp op) +{ + CoglMaterial *material; + CoglMaterialLayer *layer; + gboolean set_arg_alpha_op = FALSE; + gboolean set_arg_rgb_op = FALSE; + + g_return_if_fail (cogl_is_material (material_handle)); + g_return_if_fail (argument >=0 && argument <= 3); + + material = _cogl_material_pointer_from_handle (material_handle); + layer = _cogl_material_get_layer (material, layer_index, TRUE); + + if (channels == COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA) + set_arg_alpha_op = set_arg_rgb_op = TRUE; + else if (channels == COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGB) + set_arg_rgb_op = TRUE; + else if (channels == COGL_MATERIAL_LAYER_COMBINE_CHANNELS_ALPHA) + set_arg_alpha_op = TRUE; + + if (set_arg_rgb_op) + layer->texture_combine_rgb_op[argument] = op; + if (set_arg_alpha_op) + layer->texture_combine_alpha_op[argument] = op; + + material->flags |= COGL_MATERIAL_FLAG_LAYERS_DIRTY; + layer->flags |= COGL_MATERIAL_LAYER_FLAG_DIRTY; + layer->flags &= ~COGL_MATERIAL_LAYER_FLAG_DEFAULT_COMBINE; +} + +void +cogl_material_set_layer_matrix (CoglHandle material_handle, + gint layer_index, + CoglMatrix *matrix) +{ + CoglMaterial *material; + CoglMaterialLayer *layer; + + g_return_if_fail (cogl_is_material (material_handle)); + + material = _cogl_material_pointer_from_handle (material_handle); + layer = _cogl_material_get_layer (material, layer_index, TRUE); + + layer->matrix = *matrix; + + material->flags |= COGL_MATERIAL_FLAG_LAYERS_DIRTY; + layer->flags |= COGL_MATERIAL_LAYER_FLAG_DIRTY; + layer->flags |= COGL_MATERIAL_LAYER_FLAG_HAS_USER_MATRIX; + layer->flags &= ~COGL_MATERIAL_LAYER_FLAG_DEFAULT_COMBINE; +} + +static void +_cogl_material_layer_free (CoglMaterialLayer *layer) +{ + cogl_texture_unref (layer->texture); + g_free (layer); +} + +void +cogl_material_remove_layer (CoglHandle material_handle, + gint layer_index) +{ + CoglMaterial *material; + CoglMaterialLayer *layer; + GList *tmp; + + g_return_if_fail (cogl_is_material (material_handle)); + + material = _cogl_material_pointer_from_handle (material_handle); + material->flags &= ~COGL_MATERIAL_FLAG_ENABLE_BLEND; + for (tmp = material->layers; tmp != NULL; tmp = tmp->next) + { + layer = tmp->data; + if (layer->index == layer_index) + { + CoglHandle handle = (CoglHandle) layer; + cogl_material_layer_unref (handle); + material->layers = g_list_remove (material->layers, layer); + continue; + } + + /* XXX: If we expose manual control over ENABLE_BLEND, we'll add + * a flag to know when it's user configured, so we don't trash it */ + if (cogl_texture_get_format (layer->texture) & COGL_A_BIT) + material->flags |= COGL_MATERIAL_FLAG_ENABLE_BLEND; + } + + if (material->unlit[3] != 1.0) + material->flags |= COGL_MATERIAL_FLAG_ENABLE_BLEND; + material->flags |= COGL_MATERIAL_FLAG_LAYERS_DIRTY; +} + +/* XXX: This API is hopfully just a stop-gap solution. Ideally cogl_enable + * will be replaced. */ +gulong +cogl_material_get_cogl_enable_flags (CoglHandle material_handle) +{ + CoglMaterial *material; + gulong enable_flags = 0; + + _COGL_GET_CONTEXT (ctx, 0); + + g_return_val_if_fail (cogl_is_material (material_handle), 0); + + material = _cogl_material_pointer_from_handle (material_handle); + + /* Enable blending if the geometry has an associated alpha color, + * or the material wants blending enabled. */ + if (material->flags & COGL_MATERIAL_FLAG_ENABLE_BLEND + || ctx->color_alpha < 255) + enable_flags |= COGL_ENABLE_BLEND; + + return enable_flags; +} + +/* It's a bit out of the ordinary to return a const GList *, but it's + * probably sensible to try and avoid list manipulation for every + * primitive emitted in a scene, every frame. + * + * Alternativly; we could either add a _foreach function, or maybe + * a function that gets a passed a buffer (that may be stack allocated) + * by the caller. + */ +const GList * +cogl_material_get_layers (CoglHandle material_handle) +{ + CoglMaterial *material; + + g_return_val_if_fail (cogl_is_material (material_handle), NULL); + + material = _cogl_material_pointer_from_handle (material_handle); + + return material->layers; +} + +CoglMaterialLayerType +cogl_material_layer_get_type (CoglHandle layer_handle) +{ + return COGL_MATERIAL_LAYER_TYPE_TEXTURE; +} + +CoglHandle +cogl_material_layer_get_texture (CoglHandle layer_handle) +{ + CoglMaterialLayer *layer; + + g_return_val_if_fail (cogl_is_material_layer (layer_handle), + COGL_INVALID_HANDLE); + + layer = _cogl_material_layer_pointer_from_handle (layer_handle); + return layer->texture; +} + +gulong +cogl_material_layer_get_flags (CoglHandle layer_handle) +{ + CoglMaterialLayer *layer; + + g_return_val_if_fail (cogl_is_material_layer (layer_handle), 0); + + layer = _cogl_material_layer_pointer_from_handle (layer_handle); + + return layer->flags & COGL_MATERIAL_LAYER_FLAG_HAS_USER_MATRIX; +} + +static guint +get_n_args_for_combine_func (CoglMaterialLayerCombineFunc func) +{ + switch (func) + { + case COGL_MATERIAL_LAYER_COMBINE_FUNC_REPLACE: + return 1; + case COGL_MATERIAL_LAYER_COMBINE_FUNC_MODULATE: + case COGL_MATERIAL_LAYER_COMBINE_FUNC_ADD: + case COGL_MATERIAL_LAYER_COMBINE_FUNC_ADD_SIGNED: + case COGL_MATERIAL_LAYER_COMBINE_FUNC_SUBTRACT: + case COGL_MATERIAL_LAYER_COMBINE_FUNC_DOT3_RGB: + case COGL_MATERIAL_LAYER_COMBINE_FUNC_DOT3_RGBA: + return 2; + case COGL_MATERIAL_LAYER_COMBINE_FUNC_INTERPOLATE: + return 3; + } + return 0; +} + +static void +_cogl_material_layer_flush_gl_sampler_state (CoglMaterialLayer *layer, + CoglLayerInfo *gl_layer_info) +{ + int n_rgb_func_args; + int n_alpha_func_args; + + if (!(gl_layer_info && + gl_layer_info->flags & COGL_MATERIAL_LAYER_FLAG_DEFAULT_COMBINE && + layer->flags & COGL_MATERIAL_LAYER_FLAG_DEFAULT_COMBINE)) + { + GE (glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE)); + + /* Set the combiner functions... */ + GE (glTexEnvi (GL_TEXTURE_ENV, + GL_COMBINE_RGB, + layer->texture_combine_rgb_func)); + GE (glTexEnvi (GL_TEXTURE_ENV, + GL_COMBINE_ALPHA, + layer->texture_combine_alpha_func)); + + /* + * Setup the function arguments... + */ + + /* For the RGB components... */ + n_rgb_func_args = + get_n_args_for_combine_func (layer->texture_combine_rgb_func); + + GE (glTexEnvi (GL_TEXTURE_ENV, GL_SRC0_RGB, + layer->texture_combine_rgb_src[0])); + GE (glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND0_RGB, + layer->texture_combine_rgb_op[0])); + if (n_rgb_func_args > 1) + { + GE (glTexEnvi (GL_TEXTURE_ENV, GL_SRC1_RGB, + layer->texture_combine_rgb_src[1])); + GE (glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND1_RGB, + layer->texture_combine_rgb_op[1])); + } + if (n_rgb_func_args > 2) + { + GE (glTexEnvi (GL_TEXTURE_ENV, GL_SRC2_RGB, + layer->texture_combine_rgb_src[2])); + GE (glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND2_RGB, + layer->texture_combine_rgb_op[2])); + } + + /* For the Alpha component */ + n_alpha_func_args = + get_n_args_for_combine_func (layer->texture_combine_alpha_func); + + GE (glTexEnvi (GL_TEXTURE_ENV, GL_SRC0_ALPHA, + layer->texture_combine_alpha_src[0])); + GE (glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, + layer->texture_combine_alpha_op[0])); + if (n_alpha_func_args > 1) + { + GE (glTexEnvi (GL_TEXTURE_ENV, GL_SRC1_ALPHA, + layer->texture_combine_alpha_src[1])); + GE (glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, + layer->texture_combine_alpha_op[1])); + } + if (n_alpha_func_args > 2) + { + GE (glTexEnvi (GL_TEXTURE_ENV, GL_SRC2_ALPHA, + layer->texture_combine_alpha_src[2])); + GE (glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND2_ALPHA, + layer->texture_combine_alpha_op[2])); + } + } + + if (gl_layer_info && + (gl_layer_info->flags & COGL_MATERIAL_LAYER_FLAG_HAS_USER_MATRIX || + layer->flags & COGL_MATERIAL_LAYER_FLAG_HAS_USER_MATRIX)) + { + GE (glMatrixMode (GL_TEXTURE)); + GE (glLoadMatrixf ((GLfloat *)&layer->matrix)); + GE (glMatrixMode (GL_MODELVIEW)); + } +} + +/* + * _cogl_material_flush_layers_gl_state: + * @fallback_mask: is a bitmask of the material layers that need to be + * replaced with the default, fallback textures. The fallback textures are + * fully transparent textures so they hopefully wont contribute to the + * texture combining. + * + * The intention of fallbacks is to try and preserve + * the number of layers the user is expecting so that texture coordinates + * they gave will mostly still correspond to the textures they intended, and + * have a fighting chance of looking close to their originally intended + * result. + * + * @disable_mask: is a bitmask of the material layers that will simply have + * texturing disabled. It's only really intended for disabling all layers + * > X; i.e. we'd expect to see a contiguous run of 0 starting from the LSB + * and at some point the remaining bits flip to 1. It might work to disable + * arbitrary layers; though I'm not sure a.t.m how OpenGL would take to + * that. + * + * The intention of the disable_mask is for emitting geometry when the user + * hasn't supplied enough texture coordinates for all the layers and it's + * not possible to auto generate default texture coordinates for those + * layers. + * + * @layer0_override_texture: forcibly tells us to bind this GL texture name for + * layer 0 instead of plucking the gl_texture from the CoglTexture of layer + * 0. + * + * The intention of this is for any geometry that supports sliced textures. + * The code will can iterate each of the slices and re-flush the material + * forcing the GL texture of each slice in turn. + * + * XXX: It might also help if we could specify a texture matrix for code + * dealing with slicing that would be multiplied with the users own matrix. + * + * Normaly texture coords in the range [0, 1] refer to the extents of the + * texture, but when your GL texture represents a slice of the real texture + * (from the users POV) then a texture matrix would be a neat way of + * transforming the mapping for each slice. + * + * Currently for textured rectangles we manually calculate the texture + * coords for each slice based on the users given coords, but this solution + * isn't ideal, and can't be used with CoglVertexBuffers. + */ +static void +_cogl_material_flush_layers_gl_state (CoglMaterial *material, + guint32 fallback_mask, + guint32 disable_mask, + GLuint layer0_override_texture) +{ + GList *tmp; + int i; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + for (tmp = material->layers, i = 0; tmp != NULL; tmp = tmp->next, i++) + { + CoglHandle layer_handle = (CoglHandle)tmp->data; + CoglMaterialLayer *layer = + _cogl_material_layer_pointer_from_handle (layer_handle); + CoglLayerInfo *gl_layer_info = NULL; + CoglLayerInfo new_gl_layer_info; + CoglHandle tex_handle; + GLuint gl_texture; + GLenum gl_target; +#ifdef HAVE_COGL_GLES2 + GLenum gl_internal_format; +#endif + + new_gl_layer_info.layer0_overridden = + layer0_override_texture ? TRUE : FALSE; + new_gl_layer_info.fallback = + (fallback_mask & (1<current_layers->len) + { + gl_layer_info = + &g_array_index (ctx->current_layers, CoglLayerInfo, i); + + if (gl_layer_info->handle == layer_handle && + !(layer->flags & COGL_MATERIAL_LAYER_FLAG_DIRTY) && + (gl_layer_info->layer0_overridden + == new_gl_layer_info.layer0_overridden) && + (gl_layer_info->fallback + == new_gl_layer_info.fallback) && + (gl_layer_info->disabled + == new_gl_layer_info.disabled)) + continue; + } + + tex_handle = layer->texture; + cogl_texture_get_gl_texture (tex_handle, &gl_texture, &gl_target); + + if (new_gl_layer_info.layer0_overridden) + gl_texture = layer0_override_texture; + else if (new_gl_layer_info.fallback) + { + if (gl_target == GL_TEXTURE_2D) + tex_handle = ctx->default_gl_texture_2d_tex; +#ifdef HAVE_COGL_GL + else if (gl_target == GL_TEXTURE_RECTANGLE_ARB) + tex_handle = ctx->default_gl_texture_rect_tex; +#endif + else + { + g_warning ("We don't have a default texture we can use to fill " + "in for an invalid material layer, since it was " + "using an unsupported texture target "); + /* might get away with this... */ + tex_handle = ctx->default_gl_texture_2d_tex; + } + cogl_texture_get_gl_texture (tex_handle, &gl_texture, NULL); + } + +#ifdef HAVE_COGL_GLES2 + { + CoglTexture *tex = + _cogl_texture_pointer_from_handle (tex_handle); + gl_internal_format = tex->gl_intformat; + } +#endif + + GE (glActiveTexture (GL_TEXTURE0 + i)); + + if (!gl_layer_info + || gl_layer_info->gl_target != gl_target + || gl_layer_info->gl_texture != gl_texture) + { +#ifdef HAVE_COGL_GLES2 + cogl_gles2_wrapper_bind_texture (gl_target, + gl_texture, + gl_internal_format); +#else + GE (glBindTexture (gl_target, gl_texture)); +#endif + } + + /* Disable the previous target if it was different */ + if (gl_layer_info && + gl_layer_info->gl_target != gl_target && + !gl_layer_info->disabled) + GE (glDisable (gl_layer_info->gl_target)); + + /* Enable/Disable the new target */ + if (!new_gl_layer_info.disabled) + { + if (!(gl_layer_info && + gl_layer_info->gl_target == gl_target && + !gl_layer_info->disabled)) + GE (glEnable (gl_target)); + } + else + { + if (!(gl_layer_info && + gl_layer_info->gl_target == gl_target && + gl_layer_info->disabled)) + GE (glDisable (gl_target)); + } + + _cogl_material_layer_flush_gl_sampler_state (layer, gl_layer_info); + + new_gl_layer_info.handle = layer_handle; + new_gl_layer_info.flags = layer->flags; + new_gl_layer_info.gl_target = gl_target; + new_gl_layer_info.gl_texture = gl_texture; + + if (i < ctx->current_layers->len) + *gl_layer_info = new_gl_layer_info; + else + g_array_append_val (ctx->current_layers, new_gl_layer_info); + + layer->flags &= ~COGL_MATERIAL_LAYER_FLAG_DIRTY; + + if ((i+1) >= CGL_MAX_COMBINED_TEXTURE_IMAGE_UNITS) + break; + } + + /* Disable additional texture units that may have previously been in use.. */ + for (; i < ctx->current_layers->len; i++) + { + CoglLayerInfo *gl_layer_info = + &g_array_index (ctx->current_layers, CoglLayerInfo, i); + + if (!gl_layer_info->disabled) + { + GE (glActiveTexture (GL_TEXTURE0 + i)); + GE (glDisable (gl_layer_info->gl_target)); + gl_layer_info->disabled = TRUE; + } + } + + material->flags &= ~COGL_MATERIAL_FLAG_DIRTY; +} + +static void +_cogl_material_flush_base_gl_state (CoglMaterial *material) +{ + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + if (!(ctx->current_material_flags & COGL_MATERIAL_FLAG_DEFAULT_COLOR + && material->flags & COGL_MATERIAL_FLAG_DEFAULT_COLOR)) + { + /* GLES doesn't have glColor4fv... */ + GE (glColor4f (material->unlit[0], + material->unlit[1], + material->unlit[2], + material->unlit[3])); + } + + if (!(ctx->current_material_flags & COGL_MATERIAL_FLAG_DEFAULT_GL_MATERIAL + && material->flags & COGL_MATERIAL_FLAG_DEFAULT_GL_MATERIAL)) + { + /* FIXME - we only need to set these if lighting is enabled... */ + GE (glMaterialfv (GL_FRONT_AND_BACK, GL_AMBIENT, material->ambient)); + GE (glMaterialfv (GL_FRONT_AND_BACK, GL_DIFFUSE, material->diffuse)); + GE (glMaterialfv (GL_FRONT_AND_BACK, GL_SPECULAR, material->specular)); + GE (glMaterialfv (GL_FRONT_AND_BACK, GL_EMISSION, material->emission)); + GE (glMaterialfv (GL_FRONT_AND_BACK, GL_SHININESS, &material->shininess)); + } + + if (!(ctx->current_material_flags & COGL_MATERIAL_FLAG_DEFAULT_ALPHA_FUNC + && material->flags & COGL_MATERIAL_FLAG_DEFAULT_ALPHA_FUNC)) + { + /* NB: Currently the Cogl defines are compatible with the GL ones: */ + GE (glAlphaFunc (material->alpha_func, material->alpha_func_reference)); + } + + if (!(ctx->current_material_flags & COGL_MATERIAL_FLAG_DEFAULT_BLEND_FUNC + && material->flags & COGL_MATERIAL_FLAG_DEFAULT_BLEND_FUNC)) + { + GE (glBlendFunc (material->blend_src_factor, material->blend_dst_factor)); + } +} + +void +cogl_material_flush_gl_state (CoglHandle handle, ...) +{ + CoglMaterial *material; + va_list ap; + CoglMaterialFlushOption option; + guint32 fallback_layers = 0; + guint32 disable_layers = 0; + GLuint layer0_override_texture = 0; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + material = _cogl_material_pointer_from_handle (handle); + + if (ctx->current_material == material && + !(material->flags & COGL_MATERIAL_FLAG_DIRTY) && + !(material->flags & COGL_MATERIAL_FLAG_LAYERS_DIRTY)) + return; + + if (ctx->current_material != material || + material->flags & COGL_MATERIAL_FLAG_DIRTY) + _cogl_material_flush_base_gl_state (material); + + if (ctx->current_material != material || + material->flags & COGL_MATERIAL_FLAG_LAYERS_DIRTY) + { + va_start (ap, handle); + while ((option = va_arg (ap, CoglMaterialFlushOption))) + { + if (option == COGL_MATERIAL_FLUSH_FALLBACK_MASK) + fallback_layers = va_arg (ap, guint32); + else if (option == COGL_MATERIAL_FLUSH_DISABLE_MASK) + disable_layers = va_arg (ap, guint32); + else if (option == COGL_MATERIAL_FLUSH_LAYER0_OVERRIDE) + layer0_override_texture = va_arg (ap, GLuint); + } + va_end (ap); + + _cogl_material_flush_layers_gl_state (material, + fallback_layers, + disable_layers, + layer0_override_texture); + } + + /* NB: we have to take a reference so that next time + * cogl_material_flush_gl_state is called, we can compare the incomming + * material pointer with ctx->current_material + */ + cogl_material_ref (handle); + cogl_material_unref (ctx->current_material); + + ctx->current_material = handle; + ctx->current_material_flags = material->flags; +} + + + +/* TODO: Should go in cogl.c, but that implies duplication which is also + * not ideal. */ +void +cogl_set_source (CoglHandle material_handle) +{ + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + g_return_if_fail (cogl_is_material (material_handle)); + + if (ctx->source_material == material_handle) + return; + + cogl_material_ref (material_handle); + + if (ctx->source_material) + cogl_material_unref (ctx->source_material); + + ctx->source_material = material_handle; +} +/* TODO: add cogl_set_front_source (), and cogl_set_back_source () */ + +void +cogl_set_source_texture (CoglHandle texture_handle) +{ + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + CoglColor white; + + cogl_material_set_layer (ctx->default_material, 0, texture_handle); + cogl_color_set_from_4ub (&white, 0xff, 0xff, 0xff, 0xff); + cogl_material_set_color (ctx->default_material, &white); + cogl_set_source (ctx->default_material); +} + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/common/cogl-material-private.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/common/cogl-material-private.h --- clutter-0.8.4/clutter/cogl/common/cogl-material-private.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/common/cogl-material-private.h 2009-01-28 16:45:24.000000000 +0000 @@ -0,0 +1,99 @@ +#ifndef __COGL_MATERIAL_PRIVATE_H +#define __COGL_MATERIAL_PRIVATE_H + +#include "cogl-material.h" +#include "cogl-matrix.h" + +#include + +typedef struct _CoglMaterial CoglMaterial; +typedef struct _CoglMaterialLayer CoglMaterialLayer; + +/* XXX: I don't think gtk-doc supports having private enums so these aren't + * bundled in with CoglMaterialLayerFlags */ +typedef enum _CoglMaterialLayerPrivFlags +{ + /* Ref: CoglMaterialLayerFlags + COGL_MATERIAL_LAYER_FLAG_HAS_USER_MATRIX = 1L<<0 + */ + COGL_MATERIAL_LAYER_FLAG_DIRTY = 1L<<1, + COGL_MATERIAL_LAYER_FLAG_DEFAULT_COMBINE = 1L<<2 +} CoglMaterialLayerPrivFlags; + +/* For tracking the state of a layer that's been flushed to OpenGL */ +typedef struct _CoglLayerInfo +{ + CoglHandle handle; + gulong flags; + GLenum gl_target; + GLuint gl_texture; + gboolean fallback; + gboolean disabled; + gboolean layer0_overridden; +} CoglLayerInfo; + +struct _CoglMaterialLayer +{ + guint ref_count; + guint index; /*!< lowest index is blended first then others + on top */ + gulong flags; + CoglHandle texture; /*!< The texture for this layer, or COGL_INVALID_HANDLE + for an empty layer */ + + /* Determines how the color of individual texture fragments + * are calculated. */ + CoglMaterialLayerCombineFunc texture_combine_rgb_func; + CoglMaterialLayerCombineSrc texture_combine_rgb_src[3]; + CoglMaterialLayerCombineOp texture_combine_rgb_op[3]; + + CoglMaterialLayerCombineFunc texture_combine_alpha_func; + CoglMaterialLayerCombineSrc texture_combine_alpha_src[3]; + CoglMaterialLayerCombineOp texture_combine_alpha_op[3]; + + /* TODO: Support purely GLSL based material layers */ + + CoglMatrix matrix; +}; + +typedef enum _CoglMaterialFlags +{ + COGL_MATERIAL_FLAG_ENABLE_BLEND = 1L<<0, + COGL_MATERIAL_FLAG_SHOWN_SAMPLER_WARNING = 1L<<1, + COGL_MATERIAL_FLAG_DIRTY = 1L<<2, + COGL_MATERIAL_FLAG_LAYERS_DIRTY = 1L<<3, + COGL_MATERIAL_FLAG_DEFAULT_COLOR = 1L<<4, + COGL_MATERIAL_FLAG_DEFAULT_GL_MATERIAL = 1L<<5, + COGL_MATERIAL_FLAG_DEFAULT_ALPHA_FUNC = 1L<<6, + COGL_MATERIAL_FLAG_DEFAULT_BLEND_FUNC = 1L<<7 +} CoglMaterialFlags; + +struct _CoglMaterial +{ + guint ref_count; + + gulong flags; + + /* If no lighting is enabled; this is the basic material color */ + GLfloat unlit[4]; + + /* Standard OpenGL lighting model attributes */ + GLfloat ambient[4]; + GLfloat diffuse[4]; + GLfloat specular[4]; + GLfloat emission[4]; + GLfloat shininess; + + /* Determines what fragments are discarded based on their alpha */ + CoglMaterialAlphaFunc alpha_func; + GLfloat alpha_func_reference; + + /* Determines how this material is blended with other primitives */ + CoglMaterialBlendFactor blend_src_factor; + CoglMaterialBlendFactor blend_dst_factor; + + GList *layers; +}; + +#endif /* __COGL_MATERIAL_PRIVATE_H */ + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/common/cogl-matrix.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/common/cogl-matrix.c --- clutter-0.8.4/clutter/cogl/common/cogl-matrix.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/common/cogl-matrix.c 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,140 @@ +#include + +#include +#include + +void +cogl_matrix_init_identity (CoglMatrix *matrix) +{ + matrix->xx = 1; matrix->xy = 0; matrix->xz = 0; matrix->xw = 0; + matrix->yx = 0; matrix->yy = 1; matrix->yz = 0; matrix->yw = 0; + matrix->zx = 0; matrix->zy = 0; matrix->zz = 1; matrix->zw = 0; + matrix->wx = 0; matrix->wy = 0; matrix->wz = 0; matrix->ww = 1; +} + +void +cogl_matrix_multiply (CoglMatrix *result, + const CoglMatrix *a, + const CoglMatrix *b) +{ + CoglMatrix r; + + /* row 0 */ + r.xx = a->xx * b->xx + a->xy * b->yx + a->xz * b->zx + a->xw * b->wx; + r.xy = a->xx * b->xy + a->xy * b->yy + a->xz * b->zy + a->xw * b->wy; + r.xz = a->xx * b->xz + a->xy * b->yz + a->xz * b->zz + a->xw * b->wz; + r.xw = a->xx * b->xw + a->xy * b->yw + a->xz * b->zw + a->xw * b->ww; + + /* row 1 */ + r.yx = a->yx * b->xx + a->yy * b->yx + a->yz * b->zx + a->yw * b->wx; + r.yy = a->yx * b->xy + a->yy * b->yy + a->yz * b->zy + a->yw * b->wy; + r.yz = a->yx * b->xz + a->yy * b->yz + a->yz * b->zz + a->yw * b->wz; + r.yw = a->yx * b->xw + a->yy * b->yw + a->yz * b->zw + a->yw * b->ww; + + /* row 2 */ + r.zx = a->zx * b->xx + a->zy * b->yx + a->zz * b->zx + a->zw * b->wx; + r.zy = a->zx * b->xy + a->zy * b->yy + a->zz * b->zy + a->zw * b->wy; + r.zz = a->zx * b->xz + a->zy * b->yz + a->zz * b->zz + a->zw * b->wz; + r.zw = a->zx * b->xw + a->zy * b->yw + a->zz * b->zw + a->zw * b->ww; + + /* row 3 */ + r.wx = a->wx * b->xx + a->wy * b->yx + a->wz * b->zx + a->ww * b->wx; + r.wy = a->wx * b->xy + a->wy * b->yy + a->wz * b->zy + a->ww * b->wy; + r.wz = a->wx * b->xz + a->wy * b->yz + a->wz * b->zz + a->ww * b->wz; + r.ww = a->wx * b->xw + a->wy * b->yw + a->wz * b->zw + a->ww * b->ww; + + /* The idea was that having this unrolled; it might be easier for the + * compiler to vectorize, but that's probably not true. Mesa does it + * using a single for (i=0; i<4; i++) approach, may that's better... + */ + + *result = r; +} + +/** + * cogl_3dmatrix_rotate: + * @matrix: A 3D Affine transformation matrix + * @angle: The angle in degrees you want to rotate by + * @x: The X component of your rotation vector + * @y: The Y component of your rotation vector + * @z: The Z component of your rotation vector + * + * The matrix is multiplied with a rotation matrix representing a rotation + * of angle degress around the vector (x,y,z) + * + * Since: 1.0 + */ +void +cogl_matrix_rotate (CoglMatrix *matrix, + float angle, + float x, + float y, + float z) +{ + CoglMatrix rotation; + CoglMatrix result; + angle *= G_PI / 180.0f; + float c = cosf (angle); + float s = sinf (angle); + + rotation.xx = x * x * (1.0f - c) + c; + rotation.yx = y * x * (1.0f - c) + z * s; + rotation.zx = x * z * (1.0f - c) - y * s; + rotation.wx = 0.0f; + + rotation.xy = x * y * (1.0f - c) - z * s; + rotation.yy = y * y * (1.0f - c) + c; + rotation.zy = y * z * (1.0f - c) + x * s; + rotation.wy = 0.0f; + + rotation.xz = x * z * (1.0f - c) + y * s; + rotation.yz = y * z * (1.0f - c) - x * s; + rotation.zz = z * z * (1.0f - c) + c; + rotation.wz = 0.0f; + + rotation.xw = 0.0f; + rotation.yw = 0.0f; + rotation.zw = 0.0f; + rotation.ww = 1.0f; + + cogl_matrix_multiply (&result, matrix, &rotation); + *matrix = result; +} + +void +cogl_matrix_translate (CoglMatrix *matrix, + float x, + float y, + float z) +{ + matrix->xw = matrix->xx * x + matrix->xy * y + matrix->xz * z + matrix->xw; + matrix->yw = matrix->yx * x + matrix->yy * y + matrix->yz * z + matrix->yw; + matrix->zw = matrix->zx * x + matrix->zy * y + matrix->zz * z + matrix->zw; + matrix->ww = matrix->wx * x + matrix->wy * y + matrix->wz * z + matrix->ww; +} + +void +cogl_matrix_scale (CoglMatrix *matrix, + float sx, + float sy, + float sz) +{ + matrix->xx *= sx; matrix->xy *= sy; matrix->xz *= sz; + matrix->yx *= sx; matrix->yy *= sy; matrix->yz *= sz; + matrix->zx *= sx; matrix->zy *= sy; matrix->zz *= sz; + matrix->wx *= sx; matrix->wy *= sy; matrix->wz *= sz; +} + +#if 0 +gboolean +cogl_matrix_invert (CoglMatrix *matrix) +{ + /* TODO */ + /* Note: It might be nice to also use the flag based tricks that mesa does + * to alow it to track the type of transformations a matrix represents + * so it can use various assumptions to optimise the inversion. + */ +} +#endif + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/common/cogl-primitives.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/common/cogl-primitives.c --- clutter-0.8.4/clutter/cogl/common/cogl-primitives.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/common/cogl-primitives.c 2009-01-29 13:31:51.000000000 +0000 @@ -33,77 +33,79 @@ #include #include +#include #define _COGL_MAX_BEZ_RECURSE_DEPTH 16 /* these are defined in the particular backend(float in gl vs fixed in gles)*/ -void _cogl_path_clear_nodes (); -void _cogl_path_add_node (ClutterFixed x, - ClutterFixed y); +void _cogl_path_add_node (gboolean new_sub_path, + float x, + float y); void _cogl_path_fill_nodes (); void _cogl_path_stroke_nodes (); -void _cogl_rectangle (gint x, - gint y, - guint width, - guint height); -void _cogl_rectanglex (ClutterFixed x, - ClutterFixed y, - ClutterFixed width, - ClutterFixed height); -void -cogl_rectangle (gint x, - gint y, - guint width, - guint height) -{ - _cogl_rectangle (x, y, width, height); + +void +cogl_rectangle (float x_1, + float y_1, + float x_2, + float y_2) +{ + cogl_rectangle_with_multitexture_coords (x_1, y_1, + x_2, y_2, + NULL, 0); } void -cogl_rectanglex (ClutterFixed x, - ClutterFixed y, - ClutterFixed width, - ClutterFixed height) +cogl_path_fill (void) { - _cogl_rectanglex (x, y, width, height); -} + cogl_path_fill_preserve (); + cogl_path_new (); +} void -cogl_path_fill (void) +cogl_path_fill_preserve (void) { _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + cogl_clip_ensure (); - if (ctx->path_nodes_size == 0) - return; - - _cogl_path_fill_nodes(); + if (ctx->path_nodes->len == 0) + return; + + _cogl_path_fill_nodes (); } void cogl_path_stroke (void) { + cogl_path_stroke_preserve (); + + cogl_path_new (); +} + +void +cogl_path_stroke_preserve (void) +{ _COGL_GET_CONTEXT (ctx, NO_RETVAL); - if (ctx->path_nodes_size == 0) + cogl_clip_ensure (); + + if (ctx->path_nodes->len == 0) return; _cogl_path_stroke_nodes(); } void -cogl_path_move_to (ClutterFixed x, - ClutterFixed y) +cogl_path_move_to (float x, + float y) { _COGL_GET_CONTEXT (ctx, NO_RETVAL); /* FIXME: handle multiple contours maybe? */ - /* at the moment, a move_to is an implicit instruction to create - * a new path. - */ - _cogl_path_clear_nodes (); - _cogl_path_add_node (x, y); + _cogl_path_add_node (TRUE, x, y); ctx->path_start.x = x; ctx->path_start.y = y; @@ -112,8 +114,8 @@ } void -cogl_path_rel_move_to (ClutterFixed x, - ClutterFixed y) +cogl_path_rel_move_to (float x, + float y) { _COGL_GET_CONTEXT (ctx, NO_RETVAL); @@ -122,20 +124,20 @@ } void -cogl_path_line_to (ClutterFixed x, - ClutterFixed y) +cogl_path_line_to (float x, + float y) { _COGL_GET_CONTEXT (ctx, NO_RETVAL); - _cogl_path_add_node (x, y); + _cogl_path_add_node (FALSE, x, y); ctx->path_pen.x = x; ctx->path_pen.y = y; } void -cogl_path_rel_line_to (ClutterFixed x, - ClutterFixed y) +cogl_path_rel_line_to (float x, + float y) { _COGL_GET_CONTEXT (ctx, NO_RETVAL); @@ -148,23 +150,30 @@ { _COGL_GET_CONTEXT (ctx, NO_RETVAL); - _cogl_path_add_node (ctx->path_start.x, ctx->path_start.y); + _cogl_path_add_node (FALSE, ctx->path_start.x, ctx->path_start.y); ctx->path_pen = ctx->path_start; } +void +cogl_path_new (void) +{ + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + g_array_set_size (ctx->path_nodes, 0); +} void -cogl_path_line (ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2) +cogl_path_line (float x_1, + float y_1, + float x_2, + float y_2) { - cogl_path_move_to (x1, y1); - cogl_path_line_to (x2, y2); + cogl_path_move_to (x_1, y_1); + cogl_path_line_to (x_2, y_2); } void -cogl_path_polyline (ClutterFixed *coords, +cogl_path_polyline (float *coords, gint num_points) { gint c = 0; @@ -176,7 +185,7 @@ } void -cogl_path_polygon (ClutterFixed *coords, +cogl_path_polygon (float *coords, gint num_points) { cogl_path_polyline (coords, num_points); @@ -184,10 +193,10 @@ } void -cogl_path_rectangle (ClutterFixed x, - ClutterFixed y, - ClutterFixed width, - ClutterFixed height) +cogl_path_rectangle (float x, + float y, + float width, + float height) { cogl_path_move_to (x, y); cogl_path_line_to (x + width, y); @@ -197,20 +206,20 @@ } static void -_cogl_path_arc (ClutterFixed center_x, - ClutterFixed center_y, - ClutterFixed radius_x, - ClutterFixed radius_y, - ClutterAngle angle_1, - ClutterAngle angle_2, - ClutterAngle angle_step, +_cogl_path_arc (float center_x, + float center_y, + float radius_x, + float radius_y, + float angle_1, + float angle_2, + float angle_step, guint move_first) { - ClutterAngle a = 0x0; - ClutterFixed cosa = 0x0; - ClutterFixed sina = 0x0; - ClutterFixed px = 0x0; - ClutterFixed py = 0x0; + float a = 0x0; + float cosa = 0x0; + float sina = 0x0; + float px = 0x0; + float py = 0x0; /* Fix invalid angles */ @@ -225,11 +234,11 @@ a = angle_1; while (a != angle_2) { - cosa = clutter_cosi (a); - sina = clutter_sini (a); + cosa = cosf (a * (G_PI/180.0)); + sina = sinf (a * (G_PI/180.0)); - px = center_x + CFX_MUL (cosa, radius_x); - py = center_y + CFX_MUL (sina, radius_y); + px = center_x + (cosa * radius_x); + py = center_y + (sina * radius_y); if (a == angle_1 && move_first) cogl_path_move_to (px, py); @@ -252,24 +261,24 @@ /* Make sure the final point is drawn */ - cosa = clutter_cosi (angle_2); - sina = clutter_sini (angle_2); + cosa = cosf (angle_2 * (G_PI/180.0)); + sina = sinf (angle_2 * (G_PI/180.0)); - px = center_x + CFX_MUL (cosa, radius_x); - py = center_y + CFX_MUL (sina, radius_y); + px = center_x + (cosa * radius_x); + py = center_y + (sina * radius_y); cogl_path_line_to (px, py); } void -cogl_path_arc (ClutterFixed center_x, - ClutterFixed center_y, - ClutterFixed radius_x, - ClutterFixed radius_y, - ClutterAngle angle_1, - ClutterAngle angle_2) +cogl_path_arc (float center_x, + float center_y, + float radius_x, + float radius_y, + float angle_1, + float angle_2) { - ClutterAngle angle_step = 10; + float angle_step = 10; /* it is documented that a move to is needed to create a freestanding * arc */ @@ -281,13 +290,13 @@ void -cogl_path_arc_rel (ClutterFixed center_x, - ClutterFixed center_y, - ClutterFixed radius_x, - ClutterFixed radius_y, - ClutterAngle angle_1, - ClutterAngle angle_2, - ClutterAngle angle_step) +cogl_path_arc_rel (float center_x, + float center_y, + float radius_x, + float radius_y, + float angle_1, + float angle_2, + float angle_step) { _COGL_GET_CONTEXT (ctx, NO_RETVAL); @@ -299,50 +308,50 @@ } void -cogl_path_ellipse (ClutterFixed center_x, - ClutterFixed center_y, - ClutterFixed radius_x, - ClutterFixed radius_y) +cogl_path_ellipse (float center_x, + float center_y, + float radius_x, + float radius_y) { - ClutterAngle angle_step = 10; + float angle_step = 10; /* FIXME: if shows to be slow might be optimized * by mirroring just a quarter of it */ _cogl_path_arc (center_x, center_y, radius_x, radius_y, - 0, CLUTTER_ANGLE_FROM_DEG(360), + 0, 360, angle_step, 1 /* move first */); cogl_path_close(); } void -cogl_path_round_rectangle (ClutterFixed x, - ClutterFixed y, - ClutterFixed width, - ClutterFixed height, - ClutterFixed radius, - ClutterAngle arc_step) +cogl_path_round_rectangle (float x, + float y, + float width, + float height, + float radius, + float arc_step) { - ClutterFixed inner_width = width - (radius << 1); - ClutterFixed inner_height = height - (radius << 1); + float inner_width = width - (radius * 2); + float inner_height = height - (radius * 2); _COGL_GET_CONTEXT (ctx, NO_RETVAL); cogl_path_move_to (x, y + radius); cogl_path_arc_rel (radius, 0, radius, radius, - CLUTTER_ANGLE_FROM_DEG (180), - CLUTTER_ANGLE_FROM_DEG (270), + 180, + 270, arc_step); cogl_path_line_to (ctx->path_pen.x + inner_width, ctx->path_pen.y); cogl_path_arc_rel (0, radius, radius, radius, - CLUTTER_ANGLE_FROM_DEG (-90), - CLUTTER_ANGLE_FROM_DEG (0), + -90, + 0, arc_step); cogl_path_line_to (ctx->path_pen.x, @@ -350,16 +359,16 @@ cogl_path_arc_rel (-radius, 0, radius, radius, - CLUTTER_ANGLE_FROM_DEG (0), - CLUTTER_ANGLE_FROM_DEG (90), + 0, + 90, arc_step); cogl_path_line_to (ctx->path_pen.x - inner_width, ctx->path_pen.y); cogl_path_arc_rel (0, -radius, radius, radius, - CLUTTER_ANGLE_FROM_DEG (90), - CLUTTER_ANGLE_FROM_DEG (180), + 90, + 180, arc_step); cogl_path_close (); @@ -373,14 +382,14 @@ CoglBezCubic *cleft; CoglBezCubic *cright; CoglBezCubic *c; - CoglFixedVec2 dif1; - CoglFixedVec2 dif2; - CoglFixedVec2 mm; - CoglFixedVec2 c1; - CoglFixedVec2 c2; - CoglFixedVec2 c3; - CoglFixedVec2 c4; - CoglFixedVec2 c5; + floatVec2 dif1; + floatVec2 dif2; + floatVec2 mm; + floatVec2 c1; + floatVec2 c2; + floatVec2 c3; + floatVec2 c4; + floatVec2 c5; gint cindex; /* Put first curve on stack */ @@ -391,57 +400,61 @@ { c = &cubics[cindex]; -#define CFX_MUL2(x) ((x) << 1) -#define CFX_MUL3(x) (((x) << 1) + (x)) -#define CFX_SQ(x) CFX_MUL (x, x) /* Calculate distance of control points from their * counterparts on the line between end points */ - dif1.x = CFX_MUL3 (c->p2.x) - CFX_MUL2 (c->p1.x) - c->p4.x; - dif1.y = CFX_MUL3 (c->p2.y) - CFX_MUL2 (c->p1.y) - c->p4.y; - dif2.x = CFX_MUL3 (c->p3.x) - CFX_MUL2 (c->p4.x) - c->p1.x; - dif2.y = CFX_MUL3 (c->p3.y) - CFX_MUL2 (c->p4.y) - c->p1.y; - if (dif1.x < 0) dif1.x = -dif1.x; - if (dif1.y < 0) dif1.y = -dif1.y; - if (dif2.x < 0) dif2.x = -dif2.x; - if (dif2.y < 0) dif2.y = -dif2.y; - -#undef CFX_MUL2 -#undef CFX_MUL3 -#undef CFX_SQ + dif1.x = (c->p2.x * 3) - (c->p1.x * 2) - c->p4.x; + dif1.y = (c->p2.y * 3) - (c->p1.y * 2) - c->p4.y; + dif2.x = (c->p3.x * 3) - (c->p4.x * 2) - c->p1.x; + dif2.y = (c->p3.y * 3) - (c->p4.y * 2) - c->p1.y; + + if (dif1.x < 0) + dif1.x = -dif1.x; + if (dif1.y < 0) + dif1.y = -dif1.y; + if (dif2.x < 0) + dif2.x = -dif2.x; + if (dif2.y < 0) + dif2.y = -dif2.y; + /* Pick the greatest of two distances */ if (dif1.x < dif2.x) dif1.x = dif2.x; if (dif1.y < dif2.y) dif1.y = dif2.y; /* Cancel if the curve is flat enough */ - if (dif1.x + dif1.y <= CFX_ONE - || cindex == _COGL_MAX_BEZ_RECURSE_DEPTH-1) + if (dif1.x + dif1.y <= 1.0 || + cindex == _COGL_MAX_BEZ_RECURSE_DEPTH-1) { /* Add subdivision point (skip last) */ - if (cindex == 0) return; - _cogl_path_add_node (c->p4.x, c->p4.y); - --cindex; continue; + if (cindex == 0) + return; + + _cogl_path_add_node (FALSE, c->p4.x, c->p4.y); + + --cindex; + + continue; } /* Left recursion goes on top of stack! */ cright = c; cleft = &cubics[++cindex]; /* Subdivide into 2 sub-curves */ - c1.x = ((c->p1.x + c->p2.x) >> 1); - c1.y = ((c->p1.y + c->p2.y) >> 1); - mm.x = ((c->p2.x + c->p3.x) >> 1); - mm.y = ((c->p2.y + c->p3.y) >> 1); - c5.x = ((c->p3.x + c->p4.x) >> 1); - c5.y = ((c->p3.y + c->p4.y) >> 1); - - c2.x = ((c1.x + mm.x) >> 1); - c2.y = ((c1.y + mm.y) >> 1); - c4.x = ((mm.x + c5.x) >> 1); - c4.y = ((mm.y + c5.y) >> 1); + c1.x = ((c->p1.x + c->p2.x) / 2); + c1.y = ((c->p1.y + c->p2.y) / 2); + mm.x = ((c->p2.x + c->p3.x) / 2); + mm.y = ((c->p2.y + c->p3.y) / 2); + c5.x = ((c->p3.x + c->p4.x) / 2); + c5.y = ((c->p3.y + c->p4.y) / 2); + + c2.x = ((c1.x + mm.x) / 2); + c2.y = ((c1.y + mm.y) / 2); + c4.x = ((mm.x + c5.x) / 2); + c4.y = ((mm.y + c5.y) / 2); - c3.x = ((c2.x + c4.x) >> 1); - c3.y = ((c2.y + c4.y) >> 1); + c3.x = ((c2.x + c4.x) / 2); + c3.y = ((c2.y + c4.y) / 2); /* Add left recursion to stack */ cleft->p1 = c->p1; @@ -458,12 +471,12 @@ } void -cogl_path_curve_to (ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2, - ClutterFixed x3, - ClutterFixed y3) +cogl_path_curve_to (float x_1, + float y_1, + float x_2, + float y_2, + float x_3, + float y_3) { CoglBezCubic cubic; @@ -471,37 +484,37 @@ /* Prepare cubic curve */ cubic.p1 = ctx->path_pen; - cubic.p2.x = x1; - cubic.p2.y = y1; - cubic.p3.x = x2; - cubic.p3.y = y2; - cubic.p4.x = x3; - cubic.p4.y = y3; + cubic.p2.x = x_1; + cubic.p2.y = y_1; + cubic.p3.x = x_2; + cubic.p3.y = y_2; + cubic.p4.x = x_3; + cubic.p4.y = y_3; /* Run subdivision */ _cogl_path_bezier3_sub (&cubic); /* Add last point */ - _cogl_path_add_node (cubic.p4.x, cubic.p4.y); + _cogl_path_add_node (FALSE, cubic.p4.x, cubic.p4.y); ctx->path_pen = cubic.p4; } void -cogl_path_rel_curve_to (ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2, - ClutterFixed x3, - ClutterFixed y3) +cogl_path_rel_curve_to (float x_1, + float y_1, + float x_2, + float y_2, + float x_3, + float y_3) { _COGL_GET_CONTEXT (ctx, NO_RETVAL); - cogl_path_curve_to (ctx->path_pen.x + x1, - ctx->path_pen.y + y1, - ctx->path_pen.x + x2, - ctx->path_pen.y + y2, - ctx->path_pen.x + x3, - ctx->path_pen.y + y3); + cogl_path_curve_to (ctx->path_pen.x + x_1, + ctx->path_pen.y + y_1, + ctx->path_pen.x + x_2, + ctx->path_pen.y + y_2, + ctx->path_pen.x + x_3, + ctx->path_pen.y + y_3); } @@ -517,11 +530,11 @@ CoglBezQuad *qleft; CoglBezQuad *qright; CoglBezQuad *q; - CoglFixedVec2 mid; - CoglFixedVec2 dif; - CoglFixedVec2 c1; - CoglFixedVec2 c2; - CoglFixedVec2 c3; + floatVec2 mid; + floatVec2 dif; + floatVec2 c1; + floatVec2 c2; + floatVec2 c3; gint qindex; /* Put first curve on stack */ @@ -536,20 +549,20 @@ /* Calculate distance of control point from its * counterpart on the line between end points */ - mid.x = ((q->p1.x + q->p3.x) >> 1); - mid.y = ((q->p1.y + q->p3.y) >> 1); + mid.x = ((q->p1.x + q->p3.x) / 2); + mid.y = ((q->p1.y + q->p3.y) / 2); dif.x = (q->p2.x - mid.x); dif.y = (q->p2.y - mid.y); if (dif.x < 0) dif.x = -dif.x; if (dif.y < 0) dif.y = -dif.y; /* Cancel if the curve is flat enough */ - if (dif.x + dif.y <= CFX_ONE - || qindex == _COGL_MAX_BEZ_RECURSE_DEPTH - 1) + if (dif.x + dif.y <= 1.0 || + qindex == _COGL_MAX_BEZ_RECURSE_DEPTH - 1) { /* Add subdivision point (skip last) */ if (qindex == 0) return; - _cogl_path_add_node (q->p3.x, q->p3.y); + _cogl_path_add_node (FALSE, q->p3.x, q->p3.y); --qindex; continue; } @@ -557,12 +570,12 @@ qright = q; qleft = &quads[++qindex]; /* Subdivide into 2 sub-curves */ - c1.x = ((q->p1.x + q->p2.x) >> 1); - c1.y = ((q->p1.y + q->p2.y) >> 1); - c3.x = ((q->p2.x + q->p3.x) >> 1); - c3.y = ((q->p2.y + q->p3.y) >> 1); - c2.x = ((c1.x + c3.x) >> 1); - c2.y = ((c1.y + c3.y) >> 1); + c1.x = ((q->p1.x + q->p2.x) / 2); + c1.y = ((q->p1.y + q->p2.y) / 2); + c3.x = ((q->p2.x + q->p3.x) / 2); + c3.y = ((q->p2.y + q->p3.y) / 2); + c2.x = ((c1.x + c3.x) / 2); + c2.y = ((c1.y + c3.y) / 2); /* Add left recursion onto stack */ qleft->p1 = q->p1; @@ -577,41 +590,41 @@ } void -cogl_path_curve2_to (ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2) +cogl_path_curve2_to (float x_1, + float y_1, + float x_2, + float y_2) { _COGL_GET_CONTEXT (ctx, NO_RETVAL); - + CoglBezQuad quad; - + /* Prepare quadratic curve */ quad.p1 = ctx->path_pen; - quad.p2.x = x1; - quad.p2.y = y1; - quad.p3.x = x2; - quad.p3.y = y2; - + quad.p2.x = x_1; + quad.p2.y = y_1; + quad.p3.x = x_2; + quad.p3.y = y_2; + /* Run subdivision */ _cogl_path_bezier2_sub (&quad); /* Add last point */ - _cogl_path_add_node (quad.p3.x, quad.p3.y); + _cogl_path_add_node (FALSE, quad.p3.x, quad.p3.y); ctx->path_pen = quad.p3; } void -cogl_rel_curve2_to (ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2) +cogl_rel_curve2_to (float x_1, + float y_1, + float x_2, + float y_2) { _COGL_GET_CONTEXT (ctx, NO_RETVAL); - - cogl_path_curve2_to (ctx->path_pen.x + x1, - ctx->path_pen.y + y2, - ctx->path_pen.x + x2, - ctx->path_pen.y + y2); + + cogl_path_curve2_to (ctx->path_pen.x + x_1, + ctx->path_pen.y + y_1, + ctx->path_pen.x + x_2, + ctx->path_pen.y + y_2); } #endif diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/common/cogl-primitives.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/common/cogl-primitives.h --- clutter-0.8.4/clutter/cogl/common/cogl-primitives.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/common/cogl-primitives.h 2009-01-28 16:45:25.000000000 +0000 @@ -26,38 +26,37 @@ #ifndef __COGL_PRIMITIVES_H #define __COGL_PRIMITIVES_H -typedef struct _CoglFixedVec2 CoglFixedVec2; +typedef struct _floatVec2 floatVec2; typedef struct _CoglBezQuad CoglBezQuad; typedef struct _CoglBezCubic CoglBezCubic; +typedef struct _CoglPathNode CoglPathNode; -struct _CoglFixedVec2 +struct _floatVec2 { - ClutterFixed x; - ClutterFixed y; + float x; + float y; }; -#ifdef CLUTTER_COGL_HAS_GL -typedef struct _CoglFloatVec2 CoglFloatVec2; -struct _CoglFloatVec2 +struct _CoglPathNode { GLfloat x; GLfloat y; + guint path_size; }; -#endif struct _CoglBezQuad { - CoglFixedVec2 p1; - CoglFixedVec2 p2; - CoglFixedVec2 p3; + floatVec2 p1; + floatVec2 p2; + floatVec2 p3; }; struct _CoglBezCubic { - CoglFixedVec2 p1; - CoglFixedVec2 p2; - CoglFixedVec2 p3; - CoglFixedVec2 p4; + floatVec2 p1; + floatVec2 p2; + floatVec2 p3; + floatVec2 p4; }; #endif /* __COGL_PRIMITIVES_H */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/common/cogl-vertex-buffer.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/common/cogl-vertex-buffer.c --- clutter-0.8.4/clutter/cogl/common/cogl-vertex-buffer.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/common/cogl-vertex-buffer.c 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,1679 @@ +/* + * Cogl. + * + * An OpenGL/GLES Abstraction/Utility Layer + * + * Vertex Buffer API: Handle extensible arrays of vertex attributes + * + * Copyright (C) 2008 Intel Corporation. + * + * Authored by: Robert Bragg + * + * 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 . + */ + +/* XXX: For an overview of the functionality implemented here, please + * see cogl-vertex-buffer.h, which contains the gtk-doc section overview + * for the Vertex Buffers API. + */ + +/* + * TODO: We need to do a better job of minimizing when we call glVertexPointer + * and pals in enable_state_for_drawing_attributes_buffer + * + * We should have an internal 2-tuple cache of (VBO, offset) for each of them + * so we can avoid some GL calls. We could have cogl wrappers for the + * gl*Pointer funcs that look like this: + * + * cogl_vertex_pointer (n_components, gl_type, stride, vbo, offset); + * cogl_color_pointer (n_components, gl_type, stride, vbo, offset); + * + * They would also accept NULL for the VBO handle to support old style vertex + * arrays. + * + * TODO: + * Actually hook this up to the cogl shaders infrastructure. The vertex + * buffer API has been designed to allow adding of arbitrary attributes for use + * with shaders, but this has yet to be actually plumbed together and tested. + * The bits we are missing: + * - cogl_program_use doesn't currently record within ctx-> which program + * is currently in use so a.t.m only Clutter knows the current shader. + * - We don't query the current shader program for the generic vertex indices + * (using glGetAttribLocation) so that we can call glEnableVertexAttribArray + * with those indices. + * (currently we just make up consecutive indices) + * - some dirty flag mechanims to know when the shader program has changed + * so we don't need to re-query it each time we draw a buffer. + * + * TODO: + * There is currently no API for querying back info about a buffer, E.g.: + * cogl_vertex_buffer_get_n_vertices (buffer_handle); + * cogl_vertex_buffer_get_n_components (buffer_handle, "attrib_name"); + * cogl_vertex_buffer_get_stride (buffer_handle, "attrib_name"); + * cogl_vertex_buffer_get_normalized (buffer_handle, "attrib_name"); + * cogl_vertex_buffer_map (buffer_handle, "attrib_name"); + * cogl_vertex_buffer_unmap (buffer_handle, "attrib_name"); + * (Realistically I wouldn't expect anyone to use such an API to examine the + * contents of a buffer for modification, since you'd need to handle too many + * possibilities, but never the less there might be other value in these.) + + * TODO: + * It may be worth exposing the underlying VBOs for some advanced use + * cases, e.g.: + * handle = cogl_vbo_new (COGL_VBO_FLAG_STATIC); + * pointer = cogl_vbo_map (handle, COGL_VBO_FLAG_WRITEONLY); + * cogl_vbo_unmap (handle); + * cogl_vbo_set_data (handle, size, data); + * cogl_vbo_set_sub_data (handle, offset, size, data); + * cogl_vbo_set_usage_hint (COGL_VBO_FLAG_DYNAMIC); + * + * TODO: + * Experiment with wider use of the vertex buffers API internally to Cogl. + * - There is potential, I think, for this API to become a work-horse API + * within COGL for submitting geometry to the GPU, and could unify some of + * the GL/GLES code paths. + * E.g.: + * - Try creating a per-context vertex buffer cache for cogl_texture_rectangle + * to sit on top of. + * - Try saving the tesselation of paths/polygons into vertex buffers + * internally. + * + * TODO + * Expose API that lets developers get back a buffer handle for a particular + * polygon so they may add custom attributes to them. + * - It should be possible to query/modify attributes efficiently, in place, + * avoiding copies. It would not be acceptable to simply require that + * developers must query back the n_vertices of a buffer and then the + * n_components, type and stride etc of each attribute since there + * would be too many combinations to realistically handle. + * + * - In practice, some cases might be best solved with a higher level + * EditableMesh API, (see futher below) but for many cases I think an + * API like this might be appropriate: + * + * cogl_vertex_buffer_foreach_vertex (buffer_handle, + * (AttributesBufferIteratorFunc)callback, + * "gl_Vertex", "gl_Color", NULL); + * static void callback (CoglVertexBufferVertex *vert) + * { + * GLfloat *pos = vert->attrib[0]; + * GLubyte *color = vert->attrib[1]; + * GLfloat *new_attrib = buf[vert->index]; + * + * new_attrib = pos*color; + * } + * + * TODO + * Think about a higher level Mesh API for building/modifying attribute buffers + * - E.g. look at Blender for inspiration here. They can build a mesh from + * "MVert", "MFace" and "MEdge" primitives. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#include "cogl.h" +#include "cogl-internal.h" +#include "cogl-util.h" +#include "cogl-context.h" +#include "cogl-handle.h" +#include "cogl-vertex-buffer-private.h" +#include "cogl-texture-private.h" + +#define PAD_FOR_ALIGNMENT(VAR, TYPE_SIZE) \ + (VAR = TYPE_SIZE + ((VAR - 1) & ~(TYPE_SIZE - 1))) + + +/* + * GL/GLES compatability defines for VBO thingies: + */ + +#if defined (HAVE_COGL_GL) + +#define glGenBuffers ctx->pf_glGenBuffersARB +#define glBindBuffer ctx->pf_glBindBufferARB +#define glBufferData ctx->pf_glBufferDataARB +#define glBufferSubData ctx->pf_glBufferSubDataARB +#define glDeleteBuffers ctx->pf_glDeleteBuffersARB +#define glMapBuffer ctx->pf_glMapBufferARB +#define glUnmapBuffer ctx->pf_glUnmapBufferARB +#ifndef GL_ARRAY_BUFFER +#define GL_ARRAY_BUFFER GL_ARRAY_BUFFER_ARB +#endif + +#elif defined (HAVE_COGL_GLES2) + +#define glVertexPointer cogl_wrap_glVertexPointer +#define glNormalPointer cogl_wrap_glNormalPointer +#define glTexCoordPointer cogl_wrap_glTexCoordPointer +#define glColorPointer cogl_wrap_glColorPointer +#define glDrawArrays cogl_wrap_glDrawArrays + +#define glEnableClientState cogl_wrap_glEnableClientState +#define glDisableClientState cogl_wrap_glDisableClientState + +#endif + +/* + * GL/GLES compatability defines for shader things: + */ + +#if defined (HAVE_COGL_GL) + +#define glVertexAttribPointer ctx->pf_glVertexAttribPointerARB +#define glEnableVertexAttribArray ctx->pf_glEnableVertexAttribArrayARB +#define glDisableVertexAttribArray ctx->pf_glEnableVertexAttribArrayARB +#define MAY_HAVE_PROGRAMABLE_GL + +#elif defined (HAVE_COGL_GLES2) + +/* NB: GLES2 had shaders in core since day one so again we don't need + * defines in this case: */ +#define MAY_HAVE_PROGRAMABLE_GL + +#endif + +#ifndef HAVE_COGL_GL + +/* GLES doesn't have glDrawRangeElements, so we simply pretend it does + * but that it makes no use of the start, end constraints: */ +#define glDrawRangeElements(mode, start, end, count, type, indices) \ + glDrawElements (mode, count, type, indices) + +#else /* HAVE_COGL_GL */ + +#define glDrawRangeElements(mode, start, end, count, type, indices) \ + ctx->pf_glDrawRangeElements (mode, start, end, count, type, indices) + +#endif /* HAVE_COGL_GL */ + +static void _cogl_vertex_buffer_free (CoglVertexBuffer *buffer); + +COGL_HANDLE_DEFINE (VertexBuffer, + vertex_buffer, + vertex_buffer_handles); + +CoglHandle +cogl_vertex_buffer_new (guint n_vertices) +{ + CoglVertexBuffer *buffer = g_slice_alloc (sizeof (CoglVertexBuffer)); + + buffer->ref_count = 1; + COGL_HANDLE_DEBUG_NEW (CoglVertexBuffer, buffer); + + buffer->n_vertices = n_vertices; + + buffer->submitted_vbos = NULL; + buffer->new_attributes = NULL; + + /* return COGL_INVALID_HANDLE; */ + return _cogl_vertex_buffer_handle_new (buffer); +} + +/* There are a number of standard OpenGL attributes that we deal with + * specially. These attributes are all namespaced with a "gl_" prefix + * so we should catch any typos instead of silently adding a custom + * attribute. + */ +static CoglVertexBufferAttribFlags +validate_gl_attribute (const char *gl_attribute, + guint8 *n_components, + guint8 *texture_unit) +{ + CoglVertexBufferAttribFlags type; + char *detail_seperator = NULL; + int name_len; + + detail_seperator = strstr (gl_attribute, "::"); + if (detail_seperator) + name_len = detail_seperator - gl_attribute; + else + name_len = strlen (gl_attribute); + + if (strncmp (gl_attribute, "Vertex", name_len) == 0) + { + type = COGL_VERTEX_BUFFER_ATTRIB_FLAG_VERTEX_ARRAY; + } + else if (strncmp (gl_attribute, "Color", name_len) == 0) + { + type = COGL_VERTEX_BUFFER_ATTRIB_FLAG_COLOR_ARRAY; + } + else if (strncmp (gl_attribute, + "MultiTexCoord", + strlen ("MultiTexCoord")) == 0) + { + unsigned int unit; + + if (sscanf (gl_attribute, "MultiTexCoord%u", &unit) != 1) + { + g_warning ("gl_MultiTexCoord attributes should include a\n" + "texture unit number, E.g. gl_MultiTexCoord0\n"); + unit = 0; + } + /* FIXME: validate any '::' delimiter for this case */ + *texture_unit = unit; + type = COGL_VERTEX_BUFFER_ATTRIB_FLAG_TEXTURE_COORD_ARRAY; + } + else if (strncmp (gl_attribute, "Normal", name_len) == 0) + { + *n_components = 1; + type = COGL_VERTEX_BUFFER_ATTRIB_FLAG_NORMAL_ARRAY; + } + else + { + g_warning ("Unknown gl_* attribute name gl_%s\n", gl_attribute); + type = COGL_VERTEX_BUFFER_ATTRIB_FLAG_INVALID; + } + + return type; +} + +/* This validates that a custom attribute name is a valid GLSL variable name + * + * NB: attribute names may have a detail component delimited using '::' E.g. + * custom_attrib::foo or custom_attrib::bar + * + * maybe I should hang a compiled regex somewhere to handle this + */ +static gboolean +validate_custom_attribute_name (const char *attribute_name) +{ + char *detail_seperator = NULL; + int name_len; + int i; + + detail_seperator = strstr (attribute_name, "::"); + if (detail_seperator) + name_len = detail_seperator - attribute_name; + else + name_len = strlen (attribute_name); + + if (name_len == 0 + || !g_ascii_isalpha (attribute_name[0]) + || attribute_name[0] != '_') + return FALSE; + + for (i = 1; i < name_len; i++) + if (!g_ascii_isalnum (attribute_name[i]) || attribute_name[i] != '_') + return FALSE; + + return TRUE; +} + +/* Iterates the CoglVertexBufferVBOs of a buffer and creates a flat list + * of all the submitted attributes + * + * Note: The CoglVertexBufferAttrib structs are deep copied. + */ +static GList * +copy_submitted_attributes_list (CoglVertexBuffer *buffer) +{ + GList *tmp; + GList *submitted_attributes = NULL; + + for (tmp = buffer->submitted_vbos; tmp != NULL; tmp = tmp->next) + { + CoglVertexBufferVBO *cogl_vbo = tmp->data; + GList *tmp2; + + for (tmp2 = cogl_vbo->attributes; tmp2 != NULL; tmp2 = tmp2->next) + { + CoglVertexBufferAttrib *attribute = tmp2->data; + CoglVertexBufferAttrib *copy = + g_slice_alloc (sizeof (CoglVertexBufferAttrib)); + *copy = *attribute; + submitted_attributes = g_list_prepend (submitted_attributes, copy); + } + } + return submitted_attributes; +} + +static CoglVertexBufferAttribFlags +get_attribute_gl_type_flag_from_gl_type (GLenum gl_type) +{ + switch (gl_type) + { + case GL_BYTE: + return COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_BYTE; + case GL_UNSIGNED_BYTE: + return COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_BYTE; + case GL_SHORT: + return COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_SHORT; + case GL_UNSIGNED_SHORT: + return COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_SHORT; + case GL_FLOAT: + return COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_FLOAT; +#if HAVE_COGL_GL + case GL_INT: + return COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_INT; + case GL_UNSIGNED_INT: + return COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_INT; + case GL_DOUBLE: + return COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_DOUBLE; +#endif + default: + g_warning ("Attribute Buffers API: " + "Unrecognised OpenGL type enum 0x%08x\n", gl_type); + return 0; + } +} + +static gsize +get_gl_type_size (CoglVertexBufferAttribFlags flags) +{ + CoglVertexBufferAttribFlags gl_type = + flags & COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_MASK; + + switch (gl_type) + { + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_BYTE: + return sizeof (GLbyte); + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_BYTE: + return sizeof (GLubyte); + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_SHORT: + return sizeof (GLshort); + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_SHORT: + return sizeof (GLushort); + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_FLOAT: + return sizeof (GLfloat); +#if HAVE_COGL_GL + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_INT: + return sizeof (GLint); + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_INT: + return sizeof (GLuint); + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_DOUBLE: + return sizeof (GLdouble); +#endif + default: + g_warning ("Mesh API: Unrecognised OpenGL type enum 0x%08x\n", gl_type); + return 0; + } +} + +void +cogl_vertex_buffer_add (CoglHandle handle, + const char *attribute_name, + guint8 n_components, + GLenum gl_type, + gboolean normalized, + guint16 stride, + const void *pointer) +{ + CoglVertexBuffer *buffer; + GQuark name_quark = g_quark_from_string (attribute_name); + gboolean modifying_an_attrib = FALSE; + CoglVertexBufferAttrib *attribute; + CoglVertexBufferAttribFlags flags = 0; + guint8 texture_unit = 0; + GList *tmp; + + if (!cogl_is_vertex_buffer (handle)) + return; + + buffer = _cogl_vertex_buffer_pointer_from_handle (handle); + + /* The submit function works by diffing between submitted_attributes + * and new_attributes to minimize the upload bandwidth + cost of + * allocating new VBOs, so if there isn't already a list of new_attributes + * we create one: */ + if (!buffer->new_attributes) + buffer->new_attributes = copy_submitted_attributes_list (buffer); + + /* Note: we first look for an existing attribute that we are modifying + * so we may skip needing to validate the name */ + for (tmp = buffer->new_attributes; tmp != NULL; tmp = tmp->next) + { + CoglVertexBufferAttrib *submitted_attribute = tmp->data; + if (submitted_attribute->name == name_quark) + { + modifying_an_attrib = TRUE; + + attribute = submitted_attribute; + + /* since we will skip validate_gl_attribute in this case, we need + * to pluck out the attribute type before overwriting the flags: */ + flags |= + attribute->flags & COGL_VERTEX_BUFFER_ATTRIB_FLAG_TYPE_MASK; + break; + } + } + + if (!modifying_an_attrib) + { + /* Validate the attribute name, is suitable as a variable name */ + if (strncmp (attribute_name, "gl_", 3) == 0) + { + flags |= validate_gl_attribute (attribute_name + 3, + &n_components, + &texture_unit); + if (flags & COGL_VERTEX_BUFFER_ATTRIB_FLAG_INVALID) + return; + } + else + { + flags |= COGL_VERTEX_BUFFER_ATTRIB_FLAG_CUSTOM_ARRAY; + if (validate_custom_attribute_name (attribute_name)) + return; + } + + attribute = g_slice_alloc (sizeof (CoglVertexBufferAttrib)); + } + + attribute->name = g_quark_from_string (attribute_name); + attribute->n_components = n_components; + attribute->stride = buffer->n_vertices > 1 ? stride : 0; + attribute->u.pointer = pointer; + attribute->texture_unit = texture_unit; + + flags |= get_attribute_gl_type_flag_from_gl_type (gl_type); + flags |= COGL_VERTEX_BUFFER_ATTRIB_FLAG_ENABLED; + + /* Note: We currently just assume, if an attribute is *ever* updated + * then it should be taged as frequently changing. */ + if (modifying_an_attrib) + flags |= COGL_VERTEX_BUFFER_ATTRIB_FLAG_FREQUENT_RESUBMIT; + else + flags |= COGL_VERTEX_BUFFER_ATTRIB_FLAG_INFREQUENT_RESUBMIT; + + if (normalized) + flags |= COGL_VERTEX_BUFFER_ATTRIB_FLAG_NORMALIZED; + attribute->flags = flags; + + /* NB: get_gl_type_size must be called after setting the type + * flags, above. */ + if (attribute->stride) + attribute->span_bytes = buffer->n_vertices * attribute->stride; + else + attribute->span_bytes = buffer->n_vertices + * attribute->n_components + * get_gl_type_size (attribute->flags); + + if (!modifying_an_attrib) + buffer->new_attributes = + g_list_prepend (buffer->new_attributes, attribute); +} + +void +cogl_vertex_buffer_delete (CoglHandle handle, + const char *attribute_name) +{ + CoglVertexBuffer *buffer; + GQuark name = g_quark_from_string (attribute_name); + GList *tmp; + + if (!cogl_is_vertex_buffer (handle)) + return; + + buffer = _cogl_vertex_buffer_pointer_from_handle (handle); + + /* The submit function works by diffing between submitted_attributes + * and new_attributes to minimize the upload bandwidth + cost of + * allocating new VBOs, so if there isn't already a list of new_attributes + * we create one: */ + if (!buffer->new_attributes) + buffer->new_attributes = copy_submitted_attributes_list (buffer); + + for (tmp = buffer->new_attributes; tmp != NULL; tmp = tmp->next) + { + CoglVertexBufferAttrib *submitted_attribute = tmp->data; + if (submitted_attribute->name == name) + { + buffer->new_attributes = + g_list_delete_link (buffer->new_attributes, tmp); + g_slice_free (CoglVertexBufferAttrib, submitted_attribute); + return; + } + } + + g_warning ("Failed to find an attribute named %s to delete\n", + attribute_name); +} + +static void +set_attribute_enable (CoglHandle handle, + const char *attribute_name, + gboolean state) +{ + CoglVertexBuffer *buffer; + GQuark name_quark = g_quark_from_string (attribute_name); + GList *tmp; + + if (!cogl_is_vertex_buffer (handle)) + return; + + buffer = _cogl_vertex_buffer_pointer_from_handle (handle); + + /* NB: If a buffer is currently being edited, then there can be two seperate + * lists of attributes; those that are currently submitted and a new list yet + * to be submitted, we need to modify both. */ + + for (tmp = buffer->new_attributes; tmp != NULL; tmp = tmp->next) + { + CoglVertexBufferAttrib *attribute = tmp->data; + if (attribute->name == name_quark) + { + if (state) + attribute->flags |= COGL_VERTEX_BUFFER_ATTRIB_FLAG_ENABLED; + else + attribute->flags &= ~COGL_VERTEX_BUFFER_ATTRIB_FLAG_ENABLED; + break; + } + } + + for (tmp = buffer->submitted_vbos; tmp != NULL; tmp = tmp->next) + { + CoglVertexBufferVBO *cogl_vbo = tmp->data; + GList *tmp2; + + for (tmp2 = cogl_vbo->attributes; tmp2 != NULL; tmp2 = tmp2->next) + { + CoglVertexBufferAttrib *attribute = tmp2->data; + if (attribute->name == name_quark) + { + if (state) + attribute->flags |= COGL_VERTEX_BUFFER_ATTRIB_FLAG_ENABLED; + else + attribute->flags &= ~COGL_VERTEX_BUFFER_ATTRIB_FLAG_ENABLED; + return; + } + } + } + + g_warning ("Failed to find an attribute named %s to %s\n", + attribute_name, + state == TRUE ? "enable" : "disable"); +} + +void +cogl_vertex_buffer_enable (CoglHandle handle, + const char *attribute_name) +{ + set_attribute_enable (handle, attribute_name, TRUE); +} + +void +cogl_vertex_buffer_disable (CoglHandle handle, + const char *attribute_name) +{ + set_attribute_enable (handle, attribute_name, FALSE); +} + +static void +cogl_vertex_buffer_attribute_free (CoglVertexBufferAttrib *attribute) +{ + g_slice_free (CoglVertexBufferAttrib, attribute); +} + +/* Given an attribute that we know has already been submitted before, this + * function looks for the existing VBO that contains it. + * + * Note: It will free redundant attribute struct once the corresponding + * VBO has been found. + */ +static void +filter_already_submitted_attribute (CoglVertexBufferAttrib *attribute, + GList **reuse_vbos, + GList **submitted_vbos) +{ + GList *tmp; + + /* First check the cogl_vbos we already know are being reused since we + * are more likley to get a match here */ + for (tmp = *reuse_vbos; tmp != NULL; tmp = tmp->next) + { + CoglVertexBufferVBO *cogl_vbo = tmp->data; + GList *tmp2; + + for (tmp2 = cogl_vbo->attributes; tmp2 != NULL; tmp2 = tmp2->next) + { + CoglVertexBufferAttrib *vbo_attribute = tmp2->data; + + if (vbo_attribute->name == attribute->name) + { + vbo_attribute->flags &= + ~COGL_VERTEX_BUFFER_ATTRIB_FLAG_UNUSED; + /* Note: we don't free the redundant attribute here, since it + * will be freed after all filtering in + * cogl_vertex_buffer_submit */ + return; + } + } + } + + for (tmp = *submitted_vbos; tmp != NULL; tmp = tmp->next) + { + CoglVertexBufferVBO *cogl_vbo = tmp->data; + CoglVertexBufferAttrib *reuse_attribute = NULL; + GList *tmp2; + + for (tmp2 = cogl_vbo->attributes; tmp2 != NULL; tmp2 = tmp2->next) + { + CoglVertexBufferAttrib *vbo_attribute = tmp2->data; + if (vbo_attribute->name == attribute->name) + { + reuse_attribute = vbo_attribute; + /* Note: we don't free the redundant attribute here, since it + * will be freed after all filtering in + * cogl_vertex_buffer_submit */ + + *submitted_vbos = g_list_remove_link (*submitted_vbos, tmp); + tmp->next = *reuse_vbos; + *reuse_vbos = tmp; + break; + } + } + + if (!reuse_attribute) + continue; + + /* Mark all but the matched attribute as UNUSED, so that when we + * finish filtering all our attributes any attrributes still + * marked as UNUSED can be removed from the their cogl_vbo */ + for (tmp2 = cogl_vbo->attributes; tmp2 != NULL; tmp2 = tmp2->next) + { + CoglVertexBufferAttrib *vbo_attribute = tmp2->data; + if (vbo_attribute != reuse_attribute) + vbo_attribute->flags |= COGL_VERTEX_BUFFER_ATTRIB_FLAG_UNUSED; + } + + return; + } + + g_critical ("Failed to find the cogl vbo that corresponds to an\n" + "attribute that had apparently already been submitted!"); +} + +/* When we first mark a CoglVertexBufferVBO to be reused, we mark the + * attributes as unsed, so that when filtering of attributes into VBOs is done + * we can then prune the now unsed attributes. */ +static void +remove_unused_attributes (CoglVertexBufferVBO *cogl_vbo) +{ + GList *tmp; + GList *next; + + for (tmp = cogl_vbo->attributes; tmp != NULL; tmp = next) + { + CoglVertexBufferAttrib *attribute = tmp->data; + next = tmp->next; + + if (attribute->flags & COGL_VERTEX_BUFFER_ATTRIB_FLAG_UNUSED) + { + cogl_vbo->attributes = + g_list_delete_link (cogl_vbo->attributes, tmp); + g_slice_free (CoglVertexBufferAttrib, attribute); + } + } +} + +/* Give a newly added, strided, attribute, this function looks for a + * CoglVertexBufferVBO that the attribute is interleved with. If it can't + * find one then a new CoglVertexBufferVBO is allocated and added to the + * list of new_strided_vbos. + */ +static void +filter_strided_attribute (CoglVertexBufferAttrib *attribute, + GList **new_vbos) +{ + GList *tmp; + CoglVertexBufferVBO *new_cogl_vbo; + + for (tmp = *new_vbos; tmp != NULL; tmp = tmp->next) + { + CoglVertexBufferVBO *cogl_vbo = tmp->data; + GList *tmp2; + + if (!cogl_vbo->flags & COGL_VERTEX_BUFFER_VBO_FLAG_STRIDED) + continue; + + for (tmp2 = cogl_vbo->attributes; tmp2 != NULL; tmp2 = tmp2->next) + { + CoglVertexBufferAttrib *vbo_attribute = tmp2->data; + const char *attribute_start = attribute->u.pointer; + const char *vbo_attribute_start = vbo_attribute->u.pointer; + + /* NB: All attributes have buffer->n_vertices values which + * simplifies determining which attributes are interleved + * since we assume they will start no farther than +- a + * stride away from each other: + */ + if (attribute_start <= (vbo_attribute_start - vbo_attribute->stride) + || attribute_start + >= (vbo_attribute_start + vbo_attribute->stride)) + continue; /* Not interleved */ + + cogl_vbo->attributes = + g_list_prepend (cogl_vbo->attributes, attribute); + + if (attribute->flags & + COGL_VERTEX_BUFFER_ATTRIB_FLAG_FREQUENT_RESUBMIT) + { + cogl_vbo->flags &= + ~COGL_VERTEX_BUFFER_VBO_FLAG_INFREQUENT_RESUBMIT; + cogl_vbo->flags |= + COGL_VERTEX_BUFFER_VBO_FLAG_FREQUENT_RESUBMIT; + } + return; + } + } + new_cogl_vbo = g_slice_alloc (sizeof (CoglVertexBufferVBO)); + new_cogl_vbo->vbo_name = 0; + new_cogl_vbo->attributes = NULL; + new_cogl_vbo->attributes = + g_list_prepend (new_cogl_vbo->attributes, attribute); + /* Any one of the interleved attributes will have the same span_bytes */ + new_cogl_vbo->vbo_bytes = attribute->span_bytes; + new_cogl_vbo->flags = COGL_VERTEX_BUFFER_VBO_FLAG_STRIDED; + + if (attribute->flags & COGL_VERTEX_BUFFER_ATTRIB_FLAG_INFREQUENT_RESUBMIT) + new_cogl_vbo->flags |= COGL_VERTEX_BUFFER_VBO_FLAG_INFREQUENT_RESUBMIT; + else + new_cogl_vbo->flags |= COGL_VERTEX_BUFFER_VBO_FLAG_FREQUENT_RESUBMIT; + + *new_vbos = g_list_prepend (*new_vbos, new_cogl_vbo); + return; +} + +/* This iterates through the list of submitted VBOs looking for one that + * contains attribute. If found the list *link* is removed and returned */ +static GList * +unlink_submitted_vbo_containing_attribute (GList **submitted_vbos, + CoglVertexBufferAttrib *attribute) +{ + GList *tmp; + GList *next = NULL; + + for (tmp = *submitted_vbos; tmp != NULL; tmp = next) + { + CoglVertexBufferVBO *submitted_vbo = tmp->data; + GList *tmp2; + + next = tmp->next; + + for (tmp2 = submitted_vbo->attributes; tmp2 != NULL; tmp2 = tmp2->next) + { + CoglVertexBufferAttrib *submitted_attribute = tmp2->data; + + if (submitted_attribute->name == attribute->name) + { + *submitted_vbos = g_list_remove_link (*submitted_vbos, tmp); + return tmp; + } + } + } + + return NULL; +} + +/* Unlinks all the submitted VBOs that conflict with the new cogl_vbo and + * returns them as a list. */ +static GList * +get_submitted_vbo_conflicts (GList **submitted_vbos, + CoglVertexBufferVBO *cogl_vbo) +{ + GList *tmp; + GList *conflicts = NULL; + + for (tmp = cogl_vbo->attributes; tmp != NULL; tmp = tmp->next) + { + GList *link = + unlink_submitted_vbo_containing_attribute (submitted_vbos, + tmp->data); + if (link) + { + /* prepend the link to the list of conflicts: */ + link->next = conflicts; + conflicts = link; + } + } + return conflicts; +} + +/* Any attributes in cogl_vbo gets removed from conflict_vbo */ +static void +disassociate_conflicting_attributes (CoglVertexBufferVBO *conflict_vbo, + CoglVertexBufferVBO *cogl_vbo) +{ + GList *tmp; + + /* NB: The attributes list in conflict_vbo will be shrinking so + * we iterate those in the inner loop. */ + + for (tmp = cogl_vbo->attributes; tmp != NULL; tmp = tmp->next) + { + CoglVertexBufferAttrib *attribute = tmp->data; + GList *tmp2; + for (tmp2 = conflict_vbo->attributes; tmp2 != NULL; tmp2 = tmp2->next) + { + CoglVertexBufferAttrib *conflict_attribute = tmp2->data; + + if (conflict_attribute->name == attribute->name) + { + cogl_vertex_buffer_attribute_free (conflict_attribute); + conflict_vbo->attributes = + g_list_delete_link (conflict_vbo->attributes, tmp2); + break; + } + } + } +} + +static void +cogl_vertex_buffer_vbo_free (CoglVertexBufferVBO *cogl_vbo, + gboolean delete_gl_vbo) +{ + GList *tmp; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + for (tmp = cogl_vbo->attributes; tmp != NULL; tmp = tmp->next) + { + cogl_vertex_buffer_attribute_free (tmp->data); + } + g_list_free (cogl_vbo->attributes); + + if (delete_gl_vbo && cogl_vbo->flags & + COGL_VERTEX_BUFFER_VBO_FLAG_SUBMITTED) + GE (glDeleteBuffers (1, &cogl_vbo->vbo_name)); + + g_slice_free (CoglVertexBufferVBO, cogl_vbo); +} + +/* This figures out the lowest attribute client pointer. (This pointer is used + * to upload all the interleved attributes). + * + * In the process it also replaces the client pointer with the attributes + * offset, and marks the attribute as submitted. + */ +static const void * +prep_strided_vbo_for_upload (CoglVertexBufferVBO *cogl_vbo) +{ + GList *tmp; + const char *lowest_pointer = NULL; + + for (tmp = cogl_vbo->attributes; tmp != NULL; tmp = tmp->next) + { + CoglVertexBufferAttrib *attribute = tmp->data; + const char *client_pointer = attribute->u.pointer; + + if (!lowest_pointer || client_pointer < lowest_pointer) + lowest_pointer = client_pointer; + } + + for (tmp = cogl_vbo->attributes; tmp != NULL; tmp = tmp->next) + { + CoglVertexBufferAttrib *attribute = tmp->data; + const char *client_pointer = attribute->u.pointer; + attribute->u.vbo_offset = client_pointer - lowest_pointer; + attribute->flags |= COGL_VERTEX_BUFFER_ATTRIB_FLAG_SUBMITTED; + } + + return lowest_pointer; +} + +static gboolean +upload_multipack_vbo_via_map_buffer (CoglVertexBufferVBO *cogl_vbo) +{ +#if HAVE_COGL_GL + GList *tmp; + guint offset = 0; + char *buf; + + _COGL_GET_CONTEXT (ctx, FALSE); + + buf = glMapBuffer (GL_ARRAY_BUFFER, GL_WRITE_ONLY); + glGetError(); + if (!buf) + return FALSE; + + for (tmp = cogl_vbo->attributes; tmp != NULL; tmp = tmp->next) + { + CoglVertexBufferAttrib *attribute = tmp->data; + gsize attribute_size = attribute->span_bytes; + gsize gl_type_size = get_gl_type_size (attribute->flags); + + PAD_FOR_ALIGNMENT (offset, gl_type_size); + + memcpy (buf + offset, attribute->u.pointer, attribute_size); + + attribute->u.vbo_offset = offset; + attribute->flags |= COGL_VERTEX_BUFFER_ATTRIB_FLAG_SUBMITTED; + offset += attribute_size; + } + glUnmapBuffer (GL_ARRAY_BUFFER); + + return TRUE; +#else + return FALSE; +#endif +} + +static void +upload_multipack_vbo_via_buffer_sub_data (CoglVertexBufferVBO *cogl_vbo) +{ + GList *tmp; + guint offset = 0; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + for (tmp = cogl_vbo->attributes; tmp != NULL; tmp = tmp->next) + { + CoglVertexBufferAttrib *attribute = tmp->data; + gsize attribute_size = attribute->span_bytes; + gsize gl_type_size = get_gl_type_size (attribute->flags); + + PAD_FOR_ALIGNMENT (offset, gl_type_size); + + GE (glBufferSubData (GL_ARRAY_BUFFER, + offset, + attribute_size, + attribute->u.pointer)); + attribute->u.vbo_offset = offset; + attribute->flags |= COGL_VERTEX_BUFFER_ATTRIB_FLAG_SUBMITTED; + offset += attribute_size; + } +} + +static void +upload_gl_vbo (CoglVertexBufferVBO *cogl_vbo) +{ + GLenum usage; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + g_return_if_fail (cogl_vbo->vbo_name != 0); + + if (cogl_vbo->flags & COGL_VERTEX_BUFFER_VBO_FLAG_FREQUENT_RESUBMIT) + usage = GL_DYNAMIC_DRAW; + else + usage = GL_STATIC_DRAW; + + GE (glBindBuffer (GL_ARRAY_BUFFER, cogl_vbo->vbo_name)); + + if (cogl_vbo->flags & COGL_VERTEX_BUFFER_VBO_FLAG_STRIDED) + { + const void *pointer = + prep_strided_vbo_for_upload (cogl_vbo); + GE (glBufferData (GL_ARRAY_BUFFER, + cogl_vbo->vbo_bytes, + pointer, + usage)); + } + else if (cogl_vbo->flags & COGL_VERTEX_BUFFER_VBO_FLAG_MULTIPACK) + { + /* First we make it obvious to the driver that we want to update the + * whole buffer (without this, the driver is more likley to block + * if the GPU is busy using the buffer) */ + GE (glBufferData (GL_ARRAY_BUFFER, + cogl_vbo->vbo_bytes, + NULL, + usage)); + + /* I think it might depend on the specific driver/HW whether its better + * to use glMapBuffer here or glBufferSubData here. There is even a good + * thread about this topic here: + * http://www.mail-archive.com/dri-devel@lists.sourceforge.net/msg35004.html + * For now I have gone with glMapBuffer, but the jury is still out. + */ + + if (!upload_multipack_vbo_via_map_buffer (cogl_vbo)) + upload_multipack_vbo_via_buffer_sub_data (cogl_vbo); + } + else + { + CoglVertexBufferAttrib *attribute = cogl_vbo->attributes->data; + GE (glBufferData (GL_ARRAY_BUFFER, + cogl_vbo->vbo_bytes, + attribute->u.pointer, + usage)); + /* We forget this pointer now since the client will be free + * to re-use this memory */ + attribute->u.pointer = NULL; + attribute->flags |= COGL_VERTEX_BUFFER_ATTRIB_FLAG_SUBMITTED; + } + + cogl_vbo->flags |= COGL_VERTEX_BUFFER_VBO_FLAG_SUBMITTED; + + GE (glBindBuffer (GL_ARRAY_BUFFER, 0)); +} + +/* Note: although there ends up being quite a few inner loops involved with + * resolving buffers, the number of attributes will be low so I don't expect + * them to cause a problem. */ +static void +cogl_vertex_buffer_vbo_resolve (CoglVertexBuffer *buffer, + CoglVertexBufferVBO *new_cogl_vbo, + GList **final_vbos) +{ + GList *conflicts; + GList *tmp; + GList *next; + gboolean found_target_vbo = FALSE; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + conflicts = + get_submitted_vbo_conflicts (&buffer->submitted_vbos, new_cogl_vbo); + + for (tmp = conflicts; tmp != NULL; tmp = next) + { + CoglVertexBufferVBO *conflict_vbo = tmp->data; + + next = tmp->next; + + disassociate_conflicting_attributes (conflict_vbo, new_cogl_vbo); + + if (!conflict_vbo->attributes) + { + /* See if we can re-use this now empty VBO: */ + + if (!found_target_vbo + && conflict_vbo->vbo_bytes == new_cogl_vbo->vbo_bytes) + { + found_target_vbo = TRUE; + new_cogl_vbo->vbo_name = conflict_vbo->vbo_name; + cogl_vertex_buffer_vbo_free (conflict_vbo, FALSE); + + upload_gl_vbo (new_cogl_vbo); + + *final_vbos = g_list_prepend (*final_vbos, new_cogl_vbo); + } + else + cogl_vertex_buffer_vbo_free (conflict_vbo, TRUE); + } + else + { + /* Relink the VBO back into buffer->submitted_vbos since it may + * be involved in other conflicts later */ + tmp->next = buffer->submitted_vbos; + tmp->prev = NULL; + buffer->submitted_vbos = tmp; + } + } + + if (!found_target_vbo) + { + GE (glGenBuffers (1, &new_cogl_vbo->vbo_name)); + /* FIXME: debug */ + g_assert (glGetError() == GL_NO_ERROR); + + upload_gl_vbo (new_cogl_vbo); + *final_vbos = g_list_prepend (*final_vbos, new_cogl_vbo); + } +} + +void +cogl_vertex_buffer_submit (CoglHandle handle) +{ + CoglVertexBuffer *buffer; + GList *tmp; + CoglVertexBufferVBO *new_multipack_vbo; + GList *new_multipack_vbo_link; + GList *new_vbos = NULL; + GList *reuse_vbos = NULL; + GList *final_vbos = NULL; + + if (!cogl_is_vertex_buffer (handle)) + return; + + buffer = _cogl_vertex_buffer_pointer_from_handle (handle); + + /* The objective now is to copy the attribute data supplied by the client + * into buffer objects, but it's important to minimize the number of + * redundant data uploads. + * + * We obviously aim to group together the attributes that are interleved so + * that they can be delivered in one go to the driver. + * All BOs for interleved data are created as STATIC_DRAW_ARB. + * + * Non interleved attributes tagged as INFREQUENT_RESUBMIT will be grouped + * together back to back in a single BO created as STATIC_DRAW_ARB + * + * Non interleved attributes tagged as FREQUENT_RESUBMIT will be copied into + * individual buffer objects, and the BO itself created DYNAMIC_DRAW_ARB + * + * If we are modifying a previously submitted CoglVertexBuffer then we are + * carefull not to needlesly delete OpenGL buffer objects and replace with + * new ones, instead we upload new data to the existing buffers. + */ + + /* NB: We must forget attribute->pointer after submitting since the user + * is free to re-use that memory for other purposes now. */ + + /* Pseudo code: + * + * Broadly speaking we start with a list of unsorted attributes, and filter + * those into 'new' and 're-use' CoglVertexBufferVBO (CBO) lists. We then + * take the list of new CBO structs and compare with the CBOs that have + * already been submitted to the GPU (but ignoring those we already know will + * be re-used) to determine what other CBOs can be re-used, due to being + * superseded, and what new GL VBOs need to be created. + * + * We have three kinds of CBOs: + * - Unstrided CBOs + * These contain a single tightly packed attribute + * These are currently the only ones ever marked as FREQUENT_SUBMIT + * - Strided CBOs + * These typically contain multiple interleved sets of attributes, + * though they can contain just one attribute with a stride + * - Multi Pack CBOs + * These contain multiple attributes tightly packed back to back) + * + * First create a new-CBOs entry "new-multipack-CBO" + * Tag "new-multipack-CBO" as MULTIPACK + INFREQUENT_RESUBMIT + * For each unsorted attrib: + * if already marked as submitted: + * iterate reuse-CBOs: + * if we find one that contains this attribute: + * free redundant unsorted attrib struct + * remove the UNUSED flag from the attrib found in the reuse-CBO + * continue to next unsorted attrib + * iterate submitted VBOs: + * if we find one that contains this attribute: + * free redundant unsorted attrib struct + * unlink the vbo and move it to the list of reuse-CBOs + * mark all attributes except the one just matched as UNUSED + * assert (found) + * continue to next unsorted attrib + * if strided: + * iterate the new, strided, CBOs, to see if the attribute is + * interleved with one of them, if found: + * add to the matched CBO + * else if not found: + * create a new-CBOs entry tagged STRIDED + INFREQUENT_RESUBMIT + * else if unstrided && tagged with FREQUENT_RESUBMIT: + * create a new-CBOs entry tagged UNSTRIDED + FREQUENT_RESUBMIT + * else + * add to the new-multipack-CBO + * free list of unsorted-attribs + * + * Next compare the new list of CBOs with the submitted set and try to + * minimize the memory bandwidth required to upload the attributes and the + * overhead of creating new GL-BOs. + * + * We deal with four sets of CBOs: + * - The "new" CBOs + * (as determined above during filtering) + * - The "re-use" CBOs + * (as determined above during filtering) + * - The "submitted" CBOs + * (I.e. ones currently submitted to the GPU) + * - The "final" CBOs + * (The result of resolving the differences between the above sets) + * + * The re-use CBOs are dealt with first, and we simply delete any remaining + * attributes in these that are still marked as UNUSED, and move them + * to the list of final CBOs. + * + * Next we iterate through the "new" CBOs, searching for conflicts + * with the "submitted" CBOs and commit our decision to the "final" CBOs + * + * When searching for submitted entries we always unlink items from the + * submitted list once we make matches (before we make descisions + * based on the matches). If the CBO node is superseded it is freed, + * if it is modified but may be needed for more descisions later it is + * relinked back into the submitted list and if it's identical to a new + * CBO it will be linked into the final list. + * + * At the end the list of submitted CBOs represents the attributes that were + * deleted from the buffer. + * + * Iterate re-use-CBOs: + * Iterate attribs for each: + * if attrib UNUSED: + * remove the attrib from the CBO + free + * |Note: we could potentially mark this as a re-useable gap + * |if needs be later. + * add re-use CBO to the final-CBOs + * Iterate new-CBOs: + * List submitted CBOs conflicting with the this CBO (Unlinked items) + * found-target-BO=FALSE + * Iterate conflicting CBOs: + * Disassociate conflicting attribs from conflicting CBO struct + * If no attribs remain: + * If found-target-BO!=TRUE + * _AND_ If the total size of the conflicting CBO is compatible: + * |Note: We don't currently consider re-using oversized buffers + * found-target-BO=TRUE + * upload replacement data + * free submitted CBO struct + * add new CBO struct to final-CBOs + * else: + * delete conflict GL-BO + * delete conflict CBO struct + * else: + * relink CBO back into submitted-CBOs + * + * if found-target-BO == FALSE: + * create a new GL-BO + * upload data + * add new CBO struct to final-BOs + * + * Iterate through the remaining "submitted" CBOs: + * delete the submitted GL-BO + * free the submitted CBO struct + */ + + new_multipack_vbo = g_slice_alloc (sizeof (CoglVertexBufferVBO)); + new_multipack_vbo->vbo_name = 0; + new_multipack_vbo->flags = + COGL_VERTEX_BUFFER_VBO_FLAG_MULTIPACK + | COGL_VERTEX_BUFFER_VBO_FLAG_INFREQUENT_RESUBMIT; + new_multipack_vbo->vbo_bytes = 0; + new_multipack_vbo->attributes = NULL; + new_vbos = g_list_prepend (new_vbos, new_multipack_vbo); + /* We save the link pointer here, just so we can do a fast removal later if + * no attributes get added to this vbo. */ + new_multipack_vbo_link = new_vbos; + + /* Start with a list of unsorted attributes, and filter those into + * potential new Cogl BO structs + */ + for (tmp = buffer->new_attributes; tmp != NULL; tmp = tmp->next) + { + CoglVertexBufferAttrib *attribute = tmp->data; + + if (attribute->flags & COGL_VERTEX_BUFFER_ATTRIB_FLAG_SUBMITTED) + { + /* If the attribute is already marked as submitted, then we need + * to find the existing VBO that contains it so we dont delete it. + * + * NB: this also frees the attribute struct since it's implicitly + * redundant in this case. + */ + filter_already_submitted_attribute (attribute, + &reuse_vbos, + &buffer->submitted_vbos); + } + else if (attribute->stride) + { + /* look for a CoglVertexBufferVBO that the attribute is + * interleved with. If one can't be found then a new + * CoglVertexBufferVBO is allocated and added to the list of + * new_vbos: */ + filter_strided_attribute (attribute, &new_vbos); + } + else if (attribute->flags & + COGL_VERTEX_BUFFER_ATTRIB_FLAG_FREQUENT_RESUBMIT) + { + CoglVertexBufferVBO *cogl_vbo = + g_slice_alloc (sizeof (CoglVertexBufferVBO)); + + /* attributes we expect will be frequently resubmitted are placed + * in their own VBO so that updates don't impact other attributes + */ + + cogl_vbo->vbo_name = 0; + cogl_vbo->flags = + COGL_VERTEX_BUFFER_VBO_FLAG_UNSTRIDED + | COGL_VERTEX_BUFFER_VBO_FLAG_FREQUENT_RESUBMIT; + cogl_vbo->attributes = NULL; + cogl_vbo->attributes = g_list_prepend (cogl_vbo->attributes, + attribute); + cogl_vbo->vbo_bytes = attribute->span_bytes; + new_vbos = g_list_prepend (new_vbos, cogl_vbo); + } + else + { + gsize gl_type_size = get_gl_type_size (attribute->flags); + + /* Infrequently updated attributes just get packed back to back + * in a single VBO: */ + new_multipack_vbo->attributes = + g_list_prepend (new_multipack_vbo->attributes, + attribute); + + /* Note: we have to ensure that each run of attributes is + * naturally aligned according to its data type, which may + * require some padding bytes: */ + + /* XXX: We also have to be sure that the attributes aren't + * reorderd before being uploaded because the alignment padding + * is based on the adjacent attribute. + */ + + PAD_FOR_ALIGNMENT (new_multipack_vbo->vbo_bytes, gl_type_size); + + new_multipack_vbo->vbo_bytes += attribute->span_bytes; + } + } + + /* At this point all buffer->new_attributes have been filtered into + * CoglVertexBufferVBOs... */ + g_list_free (buffer->new_attributes); + buffer->new_attributes = NULL; + + /* If the multipack vbo wasn't needed: */ + if (new_multipack_vbo->attributes == NULL) + { + new_vbos = g_list_delete_link (new_vbos, new_multipack_vbo_link); + g_slice_free (CoglVertexBufferVBO, new_multipack_vbo); + } + + for (tmp = reuse_vbos; tmp != NULL; tmp = tmp->next) + remove_unused_attributes (tmp->data); + final_vbos = g_list_concat (final_vbos, reuse_vbos); + + for (tmp = new_vbos; tmp != NULL; tmp = tmp->next) + cogl_vertex_buffer_vbo_resolve (buffer, tmp->data, &final_vbos); + + /* Anything left corresponds to deleted attributes: */ + for (tmp = buffer->submitted_vbos; tmp != NULL; tmp = tmp->next) + cogl_vertex_buffer_vbo_free (tmp->data, TRUE); + g_list_free (buffer->submitted_vbos); + + buffer->submitted_vbos = final_vbos; +} + +static GLenum +get_gl_type_from_attribute_flags (CoglVertexBufferAttribFlags flags) +{ + CoglVertexBufferAttribFlags gl_type = + flags & COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_MASK; + + switch (gl_type) + { + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_BYTE: + return GL_BYTE; + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_BYTE: + return GL_UNSIGNED_BYTE; + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_SHORT: + return GL_SHORT; + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_SHORT: + return GL_UNSIGNED_SHORT; + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_FLOAT: + return GL_FLOAT; +#if HAVE_COGL_GL + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_INT: + return GL_INT; + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_INT: + return GL_UNSIGNED_INT; + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_DOUBLE: + return GL_DOUBLE; +#endif + default: + g_warning ("Couldn't convert from attribute flags (0x%08x) " + "to gl type enum\n", flags); + return 0; + } +} + +static void +enable_state_for_drawing_attributes_buffer (CoglVertexBuffer *buffer) +{ + GList *tmp; + GLenum gl_type; + GLuint generic_index = 0; + gulong enable_flags = 0; + guint max_texcoord_attrib_unit = 0; + const GList *layers; + guint32 fallback_mask = 0; + guint32 disable_mask = ~0; + int i; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + for (tmp = buffer->submitted_vbos; tmp != NULL; tmp = tmp->next) + { + CoglVertexBufferVBO *cogl_vbo = tmp->data; + GList *tmp2; + + GE (glBindBuffer (GL_ARRAY_BUFFER, cogl_vbo->vbo_name)); + + for (tmp2 = cogl_vbo->attributes; tmp2 != NULL; tmp2 = tmp2->next) + { + CoglVertexBufferAttrib *attribute = tmp2->data; + CoglVertexBufferAttribFlags type = + attribute->flags & COGL_VERTEX_BUFFER_ATTRIB_FLAG_TYPE_MASK; + + if (!(attribute->flags & COGL_VERTEX_BUFFER_ATTRIB_FLAG_ENABLED)) + continue; + + gl_type = get_gl_type_from_attribute_flags (attribute->flags); + switch (type) + { + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_COLOR_ARRAY: + /* FIXME: go through cogl cache to enable color array */ + GE (glEnableClientState (GL_COLOR_ARRAY)); + GE (glColorPointer (attribute->n_components, + gl_type, + attribute->stride, + (const GLvoid *)attribute->u.vbo_offset)); + break; + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_NORMAL_ARRAY: + /* FIXME: go through cogl cache to enable normal array */ + GE (glEnableClientState (GL_NORMAL_ARRAY)); + GE (glNormalPointer (gl_type, + attribute->stride, + (const GLvoid *)attribute->u.vbo_offset)); + break; + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_TEXTURE_COORD_ARRAY: + GE (glClientActiveTexture (GL_TEXTURE0 + + attribute->texture_unit)); + GE (glEnableClientState (GL_TEXTURE_COORD_ARRAY)); + GE (glTexCoordPointer (attribute->n_components, + gl_type, + attribute->stride, + (const GLvoid *)attribute->u.vbo_offset)); + if (attribute->texture_unit > max_texcoord_attrib_unit) + max_texcoord_attrib_unit = attribute->texture_unit; + disable_mask &= ~(1 << attribute->texture_unit); + break; + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_VERTEX_ARRAY: + enable_flags |= COGL_ENABLE_VERTEX_ARRAY; + /* GE (glEnableClientState (GL_VERTEX_ARRAY)); */ + GE (glVertexPointer (attribute->n_components, + gl_type, + attribute->stride, + (const GLvoid *)attribute->u.vbo_offset)); + break; + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_CUSTOM_ARRAY: + { +#ifdef MAY_HAVE_PROGRAMABLE_GL + GLboolean normalized = GL_FALSE; + if (attribute->flags & + COGL_VERTEX_BUFFER_ATTRIB_FLAG_NORMALIZED) + normalized = GL_TRUE; + /* FIXME: go through cogl cache to enable generic array */ + GE (glEnableVertexAttribArray (generic_index++)); + GE (glVertexAttribPointer (generic_index, + attribute->n_components, + gl_type, + normalized, + attribute->stride, + (const GLvoid *) + attribute->u.vbo_offset)); +#endif + } + break; + default: + g_warning ("Unrecognised attribute type 0x%08x", type); + } + } + } + + layers = cogl_material_get_layers (ctx->source_material); + for (tmp = (GList *)layers, i = 0; + tmp != NULL && i <= max_texcoord_attrib_unit; + tmp = tmp->next, i++) + { + CoglHandle layer = (CoglHandle)tmp->data; + CoglHandle tex_handle = cogl_material_layer_get_texture (layer); + CoglTexture *texture = + _cogl_texture_pointer_from_handle (tex_handle); + + if (cogl_texture_is_sliced (tex_handle) + || _cogl_texture_span_has_waste (texture, 0, 0)) + { + g_warning ("Disabling layer %d of the current source material, " + "because texturing with the vertex buffer API is not " + "currently supported using sliced textures, or textures " + "with waste\n", i); + + /* XXX: maybe we can add a mechanism for users to forcibly use + * textures with waste where it would be their responsability to use + * texture coords in the range [0,1] such that sampling outside isn't + * required. We can then use a texture matrix (or a modification of + * the users own matrix) to map 1 to the edge of the texture data. + * + * Potentially, given the same guarantee as above we could also + * support a single sliced layer too. We would have to redraw the + * vertices once for each layer, each time with a fiddled texture + * matrix. + */ + fallback_mask |= (1 << i); + } + else if (!(disable_mask & (1 << i))) + fallback_mask |= (1 << i); + } + + cogl_material_flush_gl_state (ctx->source_material, + COGL_MATERIAL_FLUSH_FALLBACK_MASK, + fallback_mask, + COGL_MATERIAL_FLUSH_DISABLE_MASK, + disable_mask, + NULL); + + enable_flags |= cogl_material_get_cogl_enable_flags (ctx->source_material); + + cogl_enable (enable_flags); +} + +static void +disable_state_for_drawing_buffer (CoglVertexBuffer *buffer) +{ + GList *tmp; + GLenum gl_type; + GLuint generic_index = 0; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + /* Disable all the client state that cogl doesn't currently know + * about: + */ + GE (glBindBuffer (GL_ARRAY_BUFFER, 0)); + + generic_index = 0; + for (tmp = buffer->submitted_vbos; tmp != NULL; tmp = tmp->next) + { + CoglVertexBufferVBO *cogl_vbo = tmp->data; + GList *tmp2; + + for (tmp2 = cogl_vbo->attributes; tmp2 != NULL; tmp2 = tmp2->next) + { + CoglVertexBufferAttrib *attribute = tmp2->data; + CoglVertexBufferAttribFlags type = + attribute->flags & COGL_VERTEX_BUFFER_ATTRIB_FLAG_TYPE_MASK; + + if (!(attribute->flags & COGL_VERTEX_BUFFER_ATTRIB_FLAG_ENABLED)) + continue; + + gl_type = get_gl_type_from_attribute_flags(attribute->flags); + switch (type) + { + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_COLOR_ARRAY: + /* FIXME: go through cogl cache to enable color array */ + GE (glDisableClientState (GL_COLOR_ARRAY)); + break; + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_NORMAL_ARRAY: + /* FIXME: go through cogl cache to enable normal array */ + GE (glDisableClientState (GL_NORMAL_ARRAY)); + break; + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_TEXTURE_COORD_ARRAY: + GE (glClientActiveTexture (GL_TEXTURE0 + + attribute->texture_unit)); + GE (glDisableClientState (GL_TEXTURE_COORD_ARRAY)); + break; + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_VERTEX_ARRAY: + /* GE (glDisableClientState (GL_VERTEX_ARRAY)); */ + break; + case COGL_VERTEX_BUFFER_ATTRIB_FLAG_CUSTOM_ARRAY: +#ifdef MAY_HAVE_PROGRAMABLE_GL + /* FIXME: go through cogl cache to enable generic array */ + GE (glDisableVertexAttribArray (generic_index++)); +#endif + break; + default: + g_warning ("Unrecognised attribute type 0x%08x", type); + } + } + } +} + +void +cogl_vertex_buffer_draw (CoglHandle handle, + GLenum mode, + GLint first, + GLsizei count) +{ + CoglVertexBuffer *buffer; + + if (!cogl_is_vertex_buffer (handle)) + return; + + buffer = _cogl_vertex_buffer_pointer_from_handle (handle); + + enable_state_for_drawing_attributes_buffer (buffer); + + /* FIXME: flush cogl cache */ + GE (glDrawArrays (mode, first, count)); + + disable_state_for_drawing_buffer (buffer); +} + +void +cogl_vertex_buffer_draw_elements (CoglHandle handle, + GLenum mode, + GLuint min_index, + GLuint max_index, + GLsizei count, + GLenum indices_type, + const GLvoid *indices) +{ + CoglVertexBuffer *buffer; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + if (!cogl_is_vertex_buffer (handle)) + return; + + buffer = _cogl_vertex_buffer_pointer_from_handle (handle); + + enable_state_for_drawing_attributes_buffer (buffer); + + /* FIXME: flush cogl cache */ + GE (glDrawRangeElements (mode, min_index, max_index, + count, indices_type, indices)); + + disable_state_for_drawing_buffer (buffer); +} + +static void +_cogl_vertex_buffer_free (CoglVertexBuffer *buffer) +{ + GList *tmp; + + for (tmp = buffer->submitted_vbos; tmp != NULL; tmp = tmp->next) + cogl_vertex_buffer_vbo_free (tmp->data, TRUE); + for (tmp = buffer->new_attributes; tmp != NULL; tmp = tmp->next) + cogl_vertex_buffer_attribute_free (tmp->data); + + g_slice_free (CoglVertexBuffer, buffer); +} + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/common/cogl-vertex-buffer-private.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/common/cogl-vertex-buffer-private.h --- clutter-0.8.4/clutter/cogl/common/cogl-vertex-buffer-private.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/common/cogl-vertex-buffer-private.h 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,142 @@ +/* + * Cogl. + * + * An OpenGL/GLES Abstraction/Utility Layer + * + * Copyright (C) 2008 Intel Corporation. + * + * Authored By: Robert Bragg + * + * 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 . + */ + +#ifndef __COGL_VERTEX_BUFFER_H +#define __COGL_VERTEX_BUFFER_H + +/* Note we put quite a bit into the flags here to help keep + * the down size of the CoglVertexBufferAttrib struct below. */ +typedef enum _CoglVertexBufferAttribFlags +{ + /* Types */ + /* NB: update the _TYPE_MASK below if these are changed */ + COGL_VERTEX_BUFFER_ATTRIB_FLAG_COLOR_ARRAY = 1<<0, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_NORMAL_ARRAY = 1<<1, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_TEXTURE_COORD_ARRAY = 1<<2, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_VERTEX_ARRAY = 1<<3, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_CUSTOM_ARRAY = 1<<4, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_INVALID = 1<<5, + + COGL_VERTEX_BUFFER_ATTRIB_FLAG_NORMALIZED = 1<<6, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_ENABLED = 1<<7, + + /* Usage hints */ + /* FIXME - flatten into one flag, since its used as a boolean */ + COGL_VERTEX_BUFFER_ATTRIB_FLAG_INFREQUENT_RESUBMIT = 1<<8, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_FREQUENT_RESUBMIT = 1<<9, + + /* GL Data types */ + /* NB: Update the _GL_TYPE_MASK below if these are changed */ + COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_BYTE = 1<<10, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_BYTE = 1<<11, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_SHORT = 1<<12, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_SHORT = 1<<13, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_INT = 1<<14, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_INT = 1<<15, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_FLOAT = 1<<16, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_DOUBLE = 1<<17, + + COGL_VERTEX_BUFFER_ATTRIB_FLAG_SUBMITTED = 1<<18, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_UNUSED = 1<<19 + + /* XXX NB: If we need > 24 bits then look at changing the layout + * of struct _CoglVertexBufferAttrib below */ +} CoglVertexBufferAttribFlags; + +#define COGL_VERTEX_BUFFER_ATTRIB_FLAG_TYPE_MASK \ + (COGL_VERTEX_BUFFER_ATTRIB_FLAG_COLOR_ARRAY \ + | COGL_VERTEX_BUFFER_ATTRIB_FLAG_NORMAL_ARRAY \ + | COGL_VERTEX_BUFFER_ATTRIB_FLAG_TEXTURE_COORD_ARRAY \ + | COGL_VERTEX_BUFFER_ATTRIB_FLAG_VERTEX_ARRAY \ + | COGL_VERTEX_BUFFER_ATTRIB_FLAG_CUSTOM_ARRAY \ + | COGL_VERTEX_BUFFER_ATTRIB_FLAG_INVALID) + +#define COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_MASK \ + (COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_BYTE \ + | COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_BYTE \ + | COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_SHORT \ + | COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_SHORT \ + | COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_INT \ + | COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_INT \ + | COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_FLOAT \ + | COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_DOUBLE) + + +typedef struct _CoglVertexBufferAttrib +{ + /* TODO: look at breaking up the flags into seperate + * bitfields and seperate enums */ + CoglVertexBufferAttribFlags flags:24; + guint8 id; + GQuark name; + union _u + { + const void *pointer; + gsize vbo_offset; + } u; + gsize span_bytes; + guint16 stride; + guint8 n_components; + guint8 texture_unit; + +} CoglVertexBufferAttrib; + +typedef enum _CoglVertexBufferVBOFlags +{ + COGL_VERTEX_BUFFER_VBO_FLAG_UNSTRIDED = 1<<0, + COGL_VERTEX_BUFFER_VBO_FLAG_STRIDED = 1<<1, + COGL_VERTEX_BUFFER_VBO_FLAG_MULTIPACK = 1<<2, + + /* FIXME - flatten into one flag, since its used as a boolean */ + COGL_VERTEX_BUFFER_VBO_FLAG_INFREQUENT_RESUBMIT = 1<<3, + COGL_VERTEX_BUFFER_VBO_FLAG_FREQUENT_RESUBMIT = 1<<4, + + COGL_VERTEX_BUFFER_VBO_FLAG_SUBMITTED = 1<<5 +} CoglVertexBufferVBOFlags; + +/* + * A CoglVertexBufferVBO represents one or more attributes in a single + * buffer object + */ +typedef struct _CoglVertexBufferVBO +{ + CoglVertexBufferVBOFlags flags; + GLuint vbo_name; /*!< The name of the corresponding buffer object */ + gsize vbo_bytes; /*!< The lengh of the allocated buffer object in bytes */ + GList *attributes; +} CoglVertexBufferVBO; + + +typedef struct _CoglVertexBuffer +{ + guint ref_count; + guint n_vertices; /*!< The number of vertices in the buffer */ + GList *submitted_vbos; /* The VBOs currently submitted to the GPU */ + + /* Note: new_attributes is normally NULL and only valid while + * modifying a buffer. */ + GList *new_attributes; /*!< attributes pending submission */ +} CoglVertexBuffer; + +#endif /* __COGL_VERTEX_BUFFER_H */ + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/common/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/common/Makefile.am --- clutter-0.8.4/clutter/cogl/common/Makefile.am 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/common/Makefile.am 2009-01-29 15:53:03.000000000 +0000 @@ -5,8 +5,11 @@ -I$(top_srcdir)/clutter/cogl/$(CLUTTER_COGL) \ -I$(top_builddir)/clutter \ -I$(top_builddir)/clutter/cogl \ + -DG_LOG_DOMAIN=\"Cogl-Common\" \ + -DCLUTTER_COMPILATION \ $(CLUTTER_CFLAGS) \ $(CLUTTER_DEBUG_CFLAGS) \ + $(MAINTAINER_CFLAGS) \ $(GCC_FLAGS) LDADD = $(CLUTTER_LIBS) @@ -25,4 +28,11 @@ cogl-primitives.c \ cogl-bitmap-pixbuf.c \ cogl-clip-stack.h \ - cogl-clip-stack.c + cogl-clip-stack.c \ + cogl-fixed.c \ + cogl-color.c \ + cogl-vertex-buffer-private.h \ + cogl-vertex-buffer.c \ + cogl-matrix.c \ + cogl-material.c \ + cogl-material-private.h diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/common/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/common/Makefile.in --- clutter-0.8.4/clutter/cogl/common/Makefile.in 2008-11-28 18:22:47.000000000 +0000 +++ clutter-0.9.0/clutter/cogl/common/Makefile.in 2009-01-29 15:53:07.000000000 +0000 @@ -45,7 +45,9 @@ libclutter_cogl_common_la_LIBADD = am_libclutter_cogl_common_la_OBJECTS = cogl-util.lo cogl-bitmap.lo \ cogl-bitmap-fallback.lo cogl-primitives.lo \ - cogl-bitmap-pixbuf.lo cogl-clip-stack.lo + cogl-bitmap-pixbuf.lo cogl-clip-stack.lo cogl-fixed.lo \ + cogl-color.lo cogl-vertex-buffer.lo cogl-matrix.lo \ + cogl-material.lo libclutter_cogl_common_la_OBJECTS = \ $(am_libclutter_cogl_common_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) @@ -115,7 +117,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -140,6 +141,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -238,8 +240,11 @@ -I$(top_srcdir)/clutter/cogl/$(CLUTTER_COGL) \ -I$(top_builddir)/clutter \ -I$(top_builddir)/clutter/cogl \ + -DG_LOG_DOMAIN=\"Cogl-Common\" \ + -DCLUTTER_COMPILATION \ $(CLUTTER_CFLAGS) \ $(CLUTTER_DEBUG_CFLAGS) \ + $(MAINTAINER_CFLAGS) \ $(GCC_FLAGS) LDADD = $(CLUTTER_LIBS) @@ -256,7 +261,14 @@ cogl-primitives.c \ cogl-bitmap-pixbuf.c \ cogl-clip-stack.h \ - cogl-clip-stack.c + cogl-clip-stack.c \ + cogl-fixed.c \ + cogl-color.c \ + cogl-vertex-buffer-private.h \ + cogl-vertex-buffer.c \ + cogl-matrix.c \ + cogl-material.c \ + cogl-material-private.h all: all-am @@ -313,8 +325,13 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cogl-bitmap-pixbuf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cogl-bitmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cogl-clip-stack.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cogl-color.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cogl-fixed.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cogl-material.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cogl-matrix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cogl-primitives.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cogl-util.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cogl-vertex-buffer.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gl/cogl.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gl/cogl.c --- clutter-0.8.4/clutter/cogl/gl/cogl.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gl/cogl.c 2009-01-29 13:31:50.000000000 +0000 @@ -45,6 +45,10 @@ #include "cogl-util.h" #include "cogl-context.h" +#if defined (HAVE_COGL_GLES2) || defined (HAVE_COGL_GLES) +#include "cogl-gles2-wrapper.h" +#endif + /* GL error to string conversion */ #if COGL_DEBUG struct token_string @@ -169,27 +173,31 @@ } void -cogl_paint_init (const ClutterColor *color) +cogl_paint_init (const CoglColor *color) { - GE( glClearColor (((float) color->red / 0xff * 1.0), - ((float) color->green / 0xff * 1.0), - ((float) color->blue / 0xff * 1.0), - 0.0) ); +#if COGL_DEBUG + fprintf(stderr, "\n ============== Paint Start ================ \n"); +#endif + + GE( glClearColor (cogl_color_get_red_float (color), + cogl_color_get_green_float (color), + cogl_color_get_blue_float (color), + 0.0) ); glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); glDisable (GL_LIGHTING); glDisable (GL_FOG); - /* + /* * Disable the depth test for now as has some strange side effects, - * mainly on x/y axis rotation with multiple layers at same depth - * (eg rotating text on a bg has very strange effect). Seems no clean - * 100% effective way to fix without other odd issues.. So for now + * mainly on x/y axis rotation with multiple layers at same depth + * (eg rotating text on a bg has very strange effect). Seems no clean + * 100% effective way to fix without other odd issues.. So for now * move to application to handle and add cogl_enable_depth_test() * as for custom actors (i.e groups) to enable if need be. * - * glEnable (GL_DEPTH_TEST); - * glEnable (GL_ALPHA_TEST) + * glEnable (GL_DEPTH_TEST); + * glEnable (GL_ALPHA_TEST) * glDepthFunc (GL_LEQUAL); * glAlphaFunc (GL_GREATER, 0.1); */ @@ -199,50 +207,31 @@ void cogl_push_matrix (void) { - glPushMatrix(); + GE( glPushMatrix() ); } void cogl_pop_matrix (void) { - glPopMatrix(); -} - -void -cogl_scale (ClutterFixed x, ClutterFixed y) -{ - glScaled (CLUTTER_FIXED_TO_DOUBLE (x), - CLUTTER_FIXED_TO_DOUBLE (y), - 1.0); + GE( glPopMatrix() ); } void -cogl_translatex (ClutterFixed x, ClutterFixed y, ClutterFixed z) +cogl_scale (float x, float y, float z) { - glTranslated (CLUTTER_FIXED_TO_DOUBLE (x), - CLUTTER_FIXED_TO_DOUBLE (y), - CLUTTER_FIXED_TO_DOUBLE (z)); + GE( glScalef (x, y, z) ); } void -cogl_translate (gint x, gint y, gint z) +cogl_translate (float x, float y, float z) { - glTranslatef ((float)x, (float)y, (float)z); + GE( glTranslatef (x, y, z) ); } void -cogl_rotatex (ClutterFixed angle, gint x, gint y, gint z) +cogl_rotate (float angle, float x, float y, float z) { - glRotated (CLUTTER_FIXED_TO_DOUBLE (angle), - CLUTTER_FIXED_TO_DOUBLE (x), - CLUTTER_FIXED_TO_DOUBLE (y), - CLUTTER_FIXED_TO_DOUBLE (z)); -} - -void -cogl_rotate (gint angle, gint x, gint y, gint z) -{ - glRotatef ((float)angle, (float)x, (float)y, (float)z); + GE( glRotatef (angle, x, y, z) ); } static inline gboolean @@ -268,7 +257,7 @@ GE( glDisable (gl_flag) ); ctx->enable_flags &= ~flag; } - + return FALSE; } @@ -295,7 +284,7 @@ GE( glDisableClientState (gl_flag) ); ctx->enable_flags &= ~flag; } - + return FALSE; } @@ -306,48 +295,30 @@ * hope of lessening number GL traffic. */ _COGL_GET_CONTEXT (ctx, NO_RETVAL); - + cogl_toggle_flag (ctx, flags, COGL_ENABLE_BLEND, GL_BLEND); - + cogl_toggle_flag (ctx, flags, - COGL_ENABLE_TEXTURE_2D, - GL_TEXTURE_2D); - + COGL_ENABLE_BACKFACE_CULLING, + GL_CULL_FACE); + cogl_toggle_client_flag (ctx, flags, COGL_ENABLE_VERTEX_ARRAY, GL_VERTEX_ARRAY); - + cogl_toggle_client_flag (ctx, flags, - COGL_ENABLE_TEXCOORD_ARRAY, - GL_TEXTURE_COORD_ARRAY); - + COGL_ENABLE_COLOR_ARRAY, + GL_COLOR_ARRAY); } gulong cogl_get_enable () { _COGL_GET_CONTEXT (ctx, 0); - - return ctx->enable_flags; -} -void -cogl_blend_func (COGLenum src_factor, COGLenum dst_factor) -{ - /* This function caches the blending setup in the - * hope of lessening GL traffic. - */ - _COGL_GET_CONTEXT (ctx, NO_RETVAL); - - if (ctx->blend_src_factor != src_factor || - ctx->blend_dst_factor != dst_factor) - { - glBlendFunc (src_factor, dst_factor); - ctx->blend_src_factor = src_factor; - ctx->blend_dst_factor = dst_factor; - } + return ctx->enable_flags; } void @@ -355,37 +326,43 @@ { if (setting) { - glEnable (GL_DEPTH_TEST); + glEnable (GL_DEPTH_TEST); glEnable (GL_ALPHA_TEST); glDepthFunc (GL_LEQUAL); glAlphaFunc (GL_GREATER, 0.1); } else { - glDisable (GL_DEPTH_TEST); + glDisable (GL_DEPTH_TEST); glDisable (GL_ALPHA_TEST); } } void -cogl_color (const ClutterColor *color) +cogl_enable_backface_culling (gboolean setting) { _COGL_GET_CONTEXT (ctx, NO_RETVAL); - - glColor4ub (color->red, - color->green, - color->blue, - color->alpha); - - /* Store alpha for proper blending enables */ - ctx->color_alpha = color->alpha; + + ctx->enable_backface_culling = setting; +} + +void +cogl_set_source_color (const CoglColor *color) +{ + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + /* In case cogl_set_source_texture was previously used... */ + cogl_material_remove_layer (ctx->default_material, 0); + + cogl_material_set_color (ctx->default_material, color); + cogl_set_source (ctx->default_material); } static void -apply_matrix (const GLfloat *matrix, GLfloat *vertex) +apply_matrix (const float *matrix, float *vertex) { int x, y; - GLfloat vertex_out[4] = { 0 }; + float vertex_out[4] = { 0 }; for (y = 0; y < 4; y++) for (x = 0; x < 4; x++) @@ -395,7 +372,9 @@ } static void -project_vertex (GLfloat *modelview, GLfloat *project, GLfloat *vertex) +project_vertex (float *modelview, + float *project, + float *vertex) { int i; @@ -410,24 +389,28 @@ static void set_clip_plane (GLint plane_num, - const GLfloat *vertex_a, - const GLfloat *vertex_b) + const float *vertex_a, + const float *vertex_b) { +#if defined (HAVE_COGL_GLES2) || defined (HAVE_COGL_GLES) + GLfloat plane[4]; +#else GLdouble plane[4]; +#endif GLfloat angle; _COGL_GET_CONTEXT (ctx, NO_RETVAL); /* Calculate the angle between the axes and the line crossing the two points */ - angle = atan2f ((vertex_b[1] - vertex_a[1]), - (vertex_b[0] - vertex_a[0])) * 180.0f / G_PI; + angle = atan2f (vertex_b[1] - vertex_a[1], + vertex_b[0] - vertex_a[0]) * (180.0/G_PI); GE( glPushMatrix () ); /* Load the identity matrix and multiply by the reverse of the projection matrix so we can specify the plane in screen coordinates */ GE( glLoadIdentity () ); - GE( glMultMatrixf (ctx->inverse_projection) ); + GE( glMultMatrixf ((GLfloat *) ctx->inverse_projection) ); /* Rotate about point a */ GE( glTranslatef (vertex_a[0], vertex_a[1], vertex_a[2]) ); /* Rotate the plane by the calculated angle so that it will connect @@ -435,37 +418,32 @@ GE( glRotatef (angle, 0.0f, 0.0f, 1.0f) ); GE( glTranslatef (-vertex_a[0], -vertex_a[1], -vertex_a[2]) ); - plane[0] = 0.0f; - plane[1] = -1.0f; - plane[2] = 0.0f; + plane[0] = 0; + plane[1] = -1.0; + plane[2] = 0; plane[3] = vertex_a[1]; +#if defined (HAVE_COGL_GLES2) || defined (HAVE_COGL_GLES) + GE( glClipPlanef (plane_num, plane) ); +#else GE( glClipPlane (plane_num, plane) ); +#endif GE( glPopMatrix () ); - - GE( glEnable (plane_num) ); } void -_cogl_set_clip_planes (ClutterFixed x_offset, - ClutterFixed y_offset, - ClutterFixed width, - ClutterFixed height) +_cogl_set_clip_planes (float x_offset, + float y_offset, + float width, + float height) { GLfloat modelview[16], projection[16]; - GLfloat vertex_tl[4] = { CLUTTER_FIXED_TO_FLOAT (x_offset), - CLUTTER_FIXED_TO_FLOAT (y_offset), - 0.0f, 1.0f }; - GLfloat vertex_tr[4] = { CLUTTER_FIXED_TO_FLOAT (x_offset + width), - CLUTTER_FIXED_TO_FLOAT (y_offset), - 0.0f, 1.0f }; - GLfloat vertex_bl[4] = { CLUTTER_FIXED_TO_FLOAT (x_offset), - CLUTTER_FIXED_TO_FLOAT (y_offset + height), - 0.0f, 1.0f }; - GLfloat vertex_br[4] = { CLUTTER_FIXED_TO_FLOAT (x_offset + width), - CLUTTER_FIXED_TO_FLOAT (y_offset + height), - 0.0f, 1.0f }; + float vertex_tl[4] = { x_offset, y_offset, 0, 1.0 }; + float vertex_tr[4] = { x_offset + width, y_offset, 0, 1.0 }; + float vertex_bl[4] = { x_offset, y_offset + height, 0, 1.0 }; + float vertex_br[4] = { x_offset + width, y_offset + height, + 0, 1.0 }; GE( glGetFloatv (GL_MODELVIEW_MATRIX, modelview) ); GE( glGetFloatv (GL_PROJECTION_MATRIX, projection) ); @@ -483,7 +461,7 @@ if ((vertex_tl[0] < vertex_tr[0] ? 1 : 0) != (vertex_bl[1] < vertex_tl[1] ? 1 : 0)) { - GLfloat temp[4]; + float temp[4]; memcpy (temp, vertex_tl, sizeof (temp)); memcpy (vertex_tl, vertex_tr, sizeof (temp)); memcpy (vertex_tr, temp, sizeof (temp)); @@ -498,39 +476,21 @@ set_clip_plane (GL_CLIP_PLANE3, vertex_bl, vertex_tl); } -static int -compare_y_coordinate (const void *a, const void *b) -{ - GLfloat ay = ((const GLfloat *) a)[1]; - GLfloat by = ((const GLfloat *) b)[1]; - - return ay < by ? -1 : ay > by ? 1 : 0; -} - void -_cogl_add_stencil_clip (ClutterFixed x_offset, - ClutterFixed y_offset, - ClutterFixed width, - ClutterFixed height, +_cogl_add_stencil_clip (float x_offset, + float y_offset, + float width, + float height, gboolean first) { - gboolean has_clip_planes - = cogl_features_available (COGL_FEATURE_FOUR_CLIP_PLANES); - _COGL_GET_CONTEXT (ctx, NO_RETVAL); - if (has_clip_planes) - { - GE( glDisable (GL_CLIP_PLANE3) ); - GE( glDisable (GL_CLIP_PLANE2) ); - GE( glDisable (GL_CLIP_PLANE1) ); - GE( glDisable (GL_CLIP_PLANE0) ); - } + cogl_material_flush_gl_state (ctx->stencil_material, NULL); if (first) { GE( glEnable (GL_STENCIL_TEST) ); - + /* Initially disallow everything */ GE( glClearStencil (0) ); GE( glClear (GL_STENCIL_BUFFER_BIT) ); @@ -538,21 +498,18 @@ /* Punch out a hole to allow the rectangle */ GE( glStencilFunc (GL_NEVER, 0x1, 0x1) ); GE( glStencilOp (GL_REPLACE, GL_REPLACE, GL_REPLACE) ); - GE( glRectf (CLUTTER_FIXED_TO_FLOAT (x_offset), - CLUTTER_FIXED_TO_FLOAT (y_offset), - CLUTTER_FIXED_TO_FLOAT (x_offset + width), - CLUTTER_FIXED_TO_FLOAT (y_offset + height)) ); + + cogl_rectangle (x_offset, y_offset, + x_offset + width, y_offset + height); } - else if (ctx->num_stencil_bits > 1) + else { /* Add one to every pixel of the stencil buffer in the rectangle */ GE( glStencilFunc (GL_NEVER, 0x1, 0x3) ); GE( glStencilOp (GL_INCR, GL_INCR, GL_INCR) ); - GE( glRectf (CLUTTER_FIXED_TO_FLOAT (x_offset), - CLUTTER_FIXED_TO_FLOAT (y_offset), - CLUTTER_FIXED_TO_FLOAT (x_offset + width), - CLUTTER_FIXED_TO_FLOAT (y_offset + height)) ); + cogl_rectangle (x_offset, y_offset, + x_offset + width, y_offset + height); /* Subtract one from all pixels in the stencil buffer so that only pixels where both the original stencil buffer and the @@ -563,132 +520,11 @@ GE( glMatrixMode (GL_PROJECTION) ); GE( glPushMatrix () ); GE( glLoadIdentity () ); - GE( glRecti (-1, 1, 1, -1) ); + cogl_rectangle (-1.0, -1.0, 1.0, 1.0); GE( glPopMatrix () ); GE( glMatrixMode (GL_MODELVIEW) ); GE( glPopMatrix () ); } - else - { - /* Slower fallback if there is exactly one stencil bit. This - tries to draw enough triangles to tessalate around the - rectangle so that it can subtract from the stencil buffer for - every pixel in the screen except those in the rectangle */ - GLfloat modelview[16], projection[16]; - GLfloat temp_point[4]; - GLfloat left_edge, right_edge, bottom_edge, top_edge; - int i; - GLfloat points[16] = - { - CLUTTER_FIXED_TO_FLOAT (x_offset), - CLUTTER_FIXED_TO_FLOAT (y_offset), - 0, 1, - CLUTTER_FIXED_TO_FLOAT (x_offset + width), - CLUTTER_FIXED_TO_FLOAT (y_offset), - 0, 1, - CLUTTER_FIXED_TO_FLOAT (x_offset), - CLUTTER_FIXED_TO_FLOAT (y_offset + height), - 0, 1, - CLUTTER_FIXED_TO_FLOAT (x_offset + width), - CLUTTER_FIXED_TO_FLOAT (y_offset + height), - 0, 1 - }; - - GE( glGetFloatv (GL_MODELVIEW_MATRIX, modelview) ); - GE( glGetFloatv (GL_PROJECTION_MATRIX, projection) ); - - /* Project all of the vertices into screen coordinates */ - for (i = 0; i < 4; i++) - project_vertex (modelview, projection, points + i * 4); - - /* Sort the points by y coordinate */ - qsort (points, 4, sizeof (GLfloat) * 4, compare_y_coordinate); - - /* Put the bottom two pairs and the top two pairs in - left-right order */ - if (points[0] > points[4]) - { - memcpy (temp_point, points, sizeof (GLfloat) * 4); - memcpy (points, points + 4, sizeof (GLfloat) * 4); - memcpy (points + 4, temp_point, sizeof (GLfloat) * 4); - } - if (points[8] > points[12]) - { - memcpy (temp_point, points + 8, sizeof (GLfloat) * 4); - memcpy (points + 8, points + 12, sizeof (GLfloat) * 4); - memcpy (points + 12, temp_point, sizeof (GLfloat) * 4); - } - - /* If the clip rect goes outside of the screen then use the - extents of the rect instead */ - left_edge = MIN (-1.0f, MIN (points[0], points[8])); - right_edge = MAX ( 1.0f, MAX (points[4], points[12])); - bottom_edge = MIN (-1.0f, MIN (points[1], points[5])); - top_edge = MAX ( 1.0f, MAX (points[9], points[13])); - - /* Using the identity matrix for the projection and - modelview matrix, draw the triangles around the inner - rectangle */ - GE( glStencilFunc (GL_NEVER, 0x1, 0x1) ); - GE( glStencilOp (GL_ZERO, GL_ZERO, GL_ZERO) ); - GE( glPushMatrix () ); - GE( glLoadIdentity () ); - GE( glMatrixMode (GL_PROJECTION) ); - GE( glPushMatrix () ); - GE( glLoadIdentity () ); - - /* Clear the left side */ - glBegin (GL_TRIANGLE_STRIP); - glVertex2f (left_edge, bottom_edge); - glVertex2fv (points); - glVertex2f (left_edge, points[1]); - glVertex2fv (points + 8); - glVertex2f (left_edge, points[9]); - glVertex2f (left_edge, top_edge); - glEnd (); - - /* Clear the right side */ - glBegin (GL_TRIANGLE_STRIP); - glVertex2f (right_edge, top_edge); - glVertex2fv (points + 12); - glVertex2f (right_edge, points[13]); - glVertex2fv (points + 4); - glVertex2f (right_edge, points[5]); - glVertex2f (right_edge, bottom_edge); - glEnd (); - - /* Clear the top side */ - glBegin (GL_TRIANGLE_STRIP); - glVertex2f (left_edge, top_edge); - glVertex2fv (points + 8); - glVertex2f (points[8], top_edge); - glVertex2fv (points + 12); - glVertex2f (points[12], top_edge); - glVertex2f (right_edge, top_edge); - glEnd (); - - /* Clear the bottom side */ - glBegin (GL_TRIANGLE_STRIP); - glVertex2f (left_edge, bottom_edge); - glVertex2fv (points); - glVertex2f (points[0], bottom_edge); - glVertex2fv (points + 4); - glVertex2f (points[4], bottom_edge); - glVertex2f (right_edge, bottom_edge); - glEnd (); - - GE( glPopMatrix () ); - GE( glMatrixMode (GL_MODELVIEW) ); - GE( glPopMatrix () ); - } - - if (has_clip_planes) - { - GE( glEnable (GL_CLIP_PLANE0) ); - GE( glEnable (GL_CLIP_PLANE1) ); - GE( glEnable (GL_CLIP_PLANE2) ); - GE( glEnable (GL_CLIP_PLANE3) ); - } /* Restore the stencil mode */ GE( glStencilFunc (GL_EQUAL, 0x1, 0x1) ); @@ -696,16 +532,10 @@ } void -_cogl_set_matrix (const ClutterFixed *matrix) +_cogl_set_matrix (const float *matrix) { - float float_matrix[16]; - int i; - - for (i = 0; i < 16; i++) - float_matrix[i] = CLUTTER_FIXED_TO_FLOAT (matrix[i]); - GE( glLoadIdentity () ); - GE( glMultMatrixf (float_matrix) ); + GE( glMultMatrixf (matrix) ); } void @@ -715,6 +545,15 @@ } void +_cogl_enable_clip_planes (void) +{ + GE( glEnable (GL_CLIP_PLANE0) ); + GE( glEnable (GL_CLIP_PLANE1) ); + GE( glEnable (GL_CLIP_PLANE2) ); + GE( glEnable (GL_CLIP_PLANE3) ); +} + +void _cogl_disable_clip_planes (void) { GE( glDisable (GL_CLIP_PLANE3) ); @@ -724,21 +563,14 @@ } void -cogl_alpha_func (COGLenum func, - ClutterFixed ref) -{ - GE( glAlphaFunc (func, CLUTTER_FIXED_TO_FLOAT(ref)) ); -} - -void -cogl_perspective (ClutterFixed fovy, - ClutterFixed aspect, - ClutterFixed zNear, - ClutterFixed zFar) -{ - ClutterFixed xmax, ymax; - ClutterFixed x, y, c, d; - ClutterFixed fovy_rad_half = CLUTTER_FIXED_MUL (fovy, CFX_PI) / 360; +cogl_perspective (float fovy, + float aspect, + float zNear, + float zFar) +{ + float xmax, ymax; + float x, y, c, d; + float fovy_rad_half = (fovy * G_PI) / 360; GLfloat m[16]; @@ -756,84 +588,78 @@ * same true for y, hence: a == 0 && b == 0; * * 2) When working with small numbers, we are loosing significant - * precision, hence we use clutter_qmulx() here, not the fast macro. + * precision */ - ymax = clutter_qmulx (zNear, CLUTTER_FIXED_DIV (clutter_sinx (fovy_rad_half), - clutter_cosx (fovy_rad_half))); - xmax = clutter_qmulx (ymax, aspect); - - x = CLUTTER_FIXED_DIV (zNear, xmax); - y = CLUTTER_FIXED_DIV (zNear, ymax); - c = CLUTTER_FIXED_DIV (-(zFar + zNear), ( zFar - zNear)); - d = CLUTTER_FIXED_DIV (-(clutter_qmulx (2*zFar, zNear)), (zFar - zNear)); + ymax = (zNear * (sinf (fovy_rad_half) / cosf (fovy_rad_half))); + xmax = (ymax * aspect); + + x = (zNear / xmax); + y = (zNear / ymax); + c = (-(zFar + zNear) / ( zFar - zNear)); + d = (-(2 * zFar) * zNear) / (zFar - zNear); #define M(row,col) m[col*4+row] - M(0,0) = CLUTTER_FIXED_TO_FLOAT (x); - M(1,1) = CLUTTER_FIXED_TO_FLOAT (y); - M(2,2) = CLUTTER_FIXED_TO_FLOAT (c); - M(2,3) = CLUTTER_FIXED_TO_FLOAT (d); - M(3,2) = -1.0F; + M(0,0) = x; + M(1,1) = y; + M(2,2) = c; + M(2,3) = d; + M(3,2) = -1.0; GE( glMultMatrixf (m) ); GE( glMatrixMode (GL_MODELVIEW) ); /* Calculate and store the inverse of the matrix */ - memset (ctx->inverse_projection, 0, sizeof (GLfloat) * 16); + memset (ctx->inverse_projection, 0, sizeof (float) * 16); #define m ctx->inverse_projection - M(0, 0) = 1.0f / CLUTTER_FIXED_TO_FLOAT (x); - M(1, 1) = 1.0f / CLUTTER_FIXED_TO_FLOAT (y); - M(2, 3) = -1.0f; - M(3, 2) = 1.0f / CLUTTER_FIXED_TO_FLOAT (d); - M(3, 3) = CLUTTER_FIXED_TO_FLOAT (c) / CLUTTER_FIXED_TO_FLOAT (d); + M(0, 0) = (1.0 / x); + M(1, 1) = (1.0 / y); + M(2, 3) = -1.0; + M(3, 2) = (1.0 / d); + M(3, 3) = (c / d); #undef m + #undef M } void -cogl_frustum (ClutterFixed left, - ClutterFixed right, - ClutterFixed bottom, - ClutterFixed top, - ClutterFixed z_near, - ClutterFixed z_far) +cogl_frustum (float left, + float right, + float bottom, + float top, + float z_near, + float z_far) { - GLfloat c, d; + float c, d; _COGL_GET_CONTEXT (ctx, NO_RETVAL); GE( glMatrixMode (GL_PROJECTION) ); GE( glLoadIdentity () ); - GE( glFrustum (CLUTTER_FIXED_TO_DOUBLE (left), - CLUTTER_FIXED_TO_DOUBLE (right), - CLUTTER_FIXED_TO_DOUBLE (bottom), - CLUTTER_FIXED_TO_DOUBLE (top), - CLUTTER_FIXED_TO_DOUBLE (z_near), - CLUTTER_FIXED_TO_DOUBLE (z_far)) ); + GE( glFrustum ((GLdouble)(left), + (GLdouble)(right), + (GLdouble)(bottom), + (GLdouble)(top), + (GLdouble)(z_near), + (GLdouble)(z_far)) ); GE( glMatrixMode (GL_MODELVIEW) ); /* Calculate and store the inverse of the matrix */ - memset (ctx->inverse_projection, 0, sizeof (GLfloat) * 16); + memset (ctx->inverse_projection, 0, sizeof (float) * 16); - c = -CLUTTER_FIXED_TO_FLOAT (z_far + z_near) - / CLUTTER_FIXED_TO_FLOAT (z_far - z_near); - d = -CLUTTER_FIXED_TO_FLOAT (2 * CFX_QMUL (z_far, z_near)) - / CLUTTER_FIXED_TO_FLOAT (z_far - z_near); + c = - (z_far + z_near) / (z_far - z_near); + d = - (2 * (z_far * z_near)) / (z_far - z_near); #define M(row,col) ctx->inverse_projection[col*4+row] - M(0,0) = CLUTTER_FIXED_TO_FLOAT (right - left) - / CLUTTER_FIXED_TO_FLOAT (2 * z_near); - M(0,3) = CLUTTER_FIXED_TO_FLOAT (right + left) - / CLUTTER_FIXED_TO_FLOAT (2 * z_near); - M(1,1) = CLUTTER_FIXED_TO_FLOAT (top - bottom) - / CLUTTER_FIXED_TO_FLOAT (2 * z_near); - M(1,3) = CLUTTER_FIXED_TO_FLOAT (top + bottom) - / CLUTTER_FIXED_TO_FLOAT (2 * z_near); - M(2,3) = -1.0f; - M(3,2) = 1.0f / d; + M(0,0) = (right - left) / (2 * z_near); + M(0,3) = (right + left) / (2 * z_near); + M(1,1) = (top - bottom) / (2 * z_near); + M(1,3) = (top + bottom) / (2 * z_near); + M(2,3) = -1.0; + M(3,2) = 1.0 / d; M(3,3) = c / d; #undef M } @@ -846,52 +672,70 @@ } void -cogl_setup_viewport (guint width, - guint height, - ClutterFixed fovy, - ClutterFixed aspect, - ClutterFixed z_near, - ClutterFixed z_far) +cogl_setup_viewport (guint width, + guint height, + float fovy, + float aspect, + float z_near, + float z_far) { - GLfloat z_camera; + float z_camera; + float projection_matrix[16]; GE( glViewport (0, 0, width, height) ); - cogl_perspective (fovy, aspect, z_near, z_far); + /* For Ortho projection. + * glOrthof (0, width << 16, 0, height << 16, -1 << 16, 1 << 16); + */ - GE( glLoadIdentity () ); + cogl_perspective (fovy, aspect, z_near, z_far); /* - * camera distance from screen, 0.5 * tan (FOV) + * In theory, we can compute the camera distance from screen as: + * + * 0.5 * tan (FOV) + * + * However, it's better to compute the z_camera from our projection + * matrix so that we get a 1:1 mapping at the screen distance. Consider + * the upper-left corner of the screen. It has object coordinates + * (0,0,0), so by the transform below, ends up with eye coordinate + * + * x_eye = x_object / width - 0.5 = - 0.5 + * y_eye = (height - y_object) / width - 0.5 = 0.5 + * z_eye = z_object / width - z_camera = - z_camera * - * We have been having some problems with this; the theoretically correct - * value of 0.866025404f for the default 60 deg fovy angle happens to be - * touch to small in reality, which on full-screen stage with an actor of - * the same size results in about 1px on the left and top edges of the - * actor being offscreen. Perhaps more significantly, it also causes - * hinting artifacts when rendering text. + * From cogl_perspective(), we know that the projection matrix has + * the form: * - * So for the default 60 deg angle we worked out that the value of 0.869 - * is giving correct stretch and no noticeable artifacts on text. Seems - * good on all drivers too. + * (x, 0, 0, 0) + * (0, y, 0, 0) + * (0, 0, c, d) + * (0, 0, -1, 0) + * + * Applied to the above, we get clip coordinates of + * + * x_clip = x * (- 0.5) + * y_clip = y * 0.5 + * w_clip = - 1 * (- z_camera) = z_camera + * + * Dividing through by w to get normalized device coordinates, we + * have, x_nd = x * 0.5 / z_camera, y_nd = - y * 0.5 / z_camera. + * The upper left corner of the screen has normalized device coordinates, + * (-1, 1), so to have the correct 1:1 mapping, we have to have: + * + * z_camera = 0.5 * x = 0.5 * y + * + * If x != y, then we have a non-uniform aspect ration, and a 1:1 mapping + * doesn't make sense. */ -#define DEFAULT_Z_CAMERA 0.869f - z_camera = DEFAULT_Z_CAMERA; + cogl_get_projection_matrix (projection_matrix); + z_camera = 0.5 * projection_matrix[0]; - if (fovy != CFX_60) - { - ClutterFixed fovy_rad = CFX_MUL (fovy, CFX_PI) / 180; - - z_camera = - CLUTTER_FIXED_TO_FLOAT (CFX_DIV (clutter_sinx (fovy_rad), - clutter_cosx (fovy_rad)) >> 1); - } + GE( glLoadIdentity () ); GE( glTranslatef (-0.5f, -0.5f, -z_camera) ); - GE( glScalef ( 1.0f / width, - -1.0f / height, - 1.0f / width) ); + GE( glScalef (1.0f / width, -1.0f / height, 1.0f / width) ); GE( glTranslatef (0.0f, -1.0 * height, 0.0f) ); } @@ -924,12 +768,13 @@ static void _cogl_features_init () { - ClutterFeatureFlags flags = 0; - const gchar *gl_extensions; - GLint max_clip_planes = 0; + CoglFeatureFlags flags = 0; + const gchar *gl_extensions; + GLint max_clip_planes = 0; + GLint num_stencil_bits = 0; _COGL_GET_CONTEXT (ctx, NO_RETVAL); - + flags = COGL_FEATURE_TEXTURE_READ_PIXELS; gl_extensions = (const gchar*) glGetString (GL_EXTENSIONS); @@ -941,7 +786,7 @@ #endif flags |= COGL_FEATURE_TEXTURE_NPOT; } - + #ifdef GL_YCBCR_MESA if (cogl_check_extension ("GL_MESA_ycbcr_texture", gl_extensions)) { @@ -956,51 +801,135 @@ ctx->pf_glCreateProgramObjectARB = (COGL_PFNGLCREATEPROGRAMOBJECTARBPROC) cogl_get_proc_address ("glCreateProgramObjectARB"); - + ctx->pf_glCreateShaderObjectARB = (COGL_PFNGLCREATESHADEROBJECTARBPROC) cogl_get_proc_address ("glCreateShaderObjectARB"); - + ctx->pf_glShaderSourceARB = (COGL_PFNGLSHADERSOURCEARBPROC) cogl_get_proc_address ("glShaderSourceARB"); - + ctx->pf_glCompileShaderARB = (COGL_PFNGLCOMPILESHADERARBPROC) cogl_get_proc_address ("glCompileShaderARB"); - + ctx->pf_glAttachObjectARB = (COGL_PFNGLATTACHOBJECTARBPROC) cogl_get_proc_address ("glAttachObjectARB"); - + ctx->pf_glLinkProgramARB = (COGL_PFNGLLINKPROGRAMARBPROC) cogl_get_proc_address ("glLinkProgramARB"); - + ctx->pf_glUseProgramObjectARB = (COGL_PFNGLUSEPROGRAMOBJECTARBPROC) cogl_get_proc_address ("glUseProgramObjectARB"); - + ctx->pf_glGetUniformLocationARB = (COGL_PFNGLGETUNIFORMLOCATIONARBPROC) cogl_get_proc_address ("glGetUniformLocationARB"); - + ctx->pf_glDeleteObjectARB = (COGL_PFNGLDELETEOBJECTARBPROC) cogl_get_proc_address ("glDeleteObjectARB"); - + ctx->pf_glGetInfoLogARB = (COGL_PFNGLGETINFOLOGARBPROC) cogl_get_proc_address ("glGetInfoLogARB"); - + ctx->pf_glGetObjectParameterivARB = (COGL_PFNGLGETOBJECTPARAMETERIVARBPROC) cogl_get_proc_address ("glGetObjectParameterivARB"); - + ctx->pf_glUniform1fARB = (COGL_PFNGLUNIFORM1FARBPROC) cogl_get_proc_address ("glUniform1fARB"); - + + ctx->pf_glVertexAttribPointerARB = + (COGL_PFNGLVERTEXATTRIBPOINTERARBPROC) + cogl_get_proc_address ("glVertexAttribPointerARB"); + + ctx->pf_glEnableVertexAttribArrayARB = + (COGL_PFNGLENABLEVERTEXATTRIBARRAYARBPROC) + cogl_get_proc_address ("glEnableVertexAttribArrayARB"); + + ctx->pf_glDisableVertexAttribArrayARB = + (COGL_PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) + cogl_get_proc_address ("glDisableVertexAttribArrayARB"); + + ctx->pf_glUniform2fARB = + (COGL_PFNGLUNIFORM2FARBPROC) + cogl_get_proc_address ("glUniform2fARB"); + + ctx->pf_glUniform3fARB = + (COGL_PFNGLUNIFORM3FARBPROC) + cogl_get_proc_address ("glUniform3fARB"); + + ctx->pf_glUniform4fARB = + (COGL_PFNGLUNIFORM4FARBPROC) + cogl_get_proc_address ("glUniform4fARB"); + + ctx->pf_glUniform1fvARB = + (COGL_PFNGLUNIFORM1FVARBPROC) + cogl_get_proc_address ("glUniform1fvARB"); + + ctx->pf_glUniform2fvARB = + (COGL_PFNGLUNIFORM2FVARBPROC) + cogl_get_proc_address ("glUniform2fvARB"); + + ctx->pf_glUniform3fvARB = + (COGL_PFNGLUNIFORM3FVARBPROC) + cogl_get_proc_address ("glUniform3fvARB"); + + ctx->pf_glUniform4fvARB = + (COGL_PFNGLUNIFORM4FVARBPROC) + cogl_get_proc_address ("glUniform4fvARB"); + + ctx->pf_glUniform1iARB = + (COGL_PFNGLUNIFORM1IARBPROC) + cogl_get_proc_address ("glUniform1iARB"); + + ctx->pf_glUniform2iARB = + (COGL_PFNGLUNIFORM2IARBPROC) + cogl_get_proc_address ("glUniform2iARB"); + + ctx->pf_glUniform3iARB = + (COGL_PFNGLUNIFORM3IARBPROC) + cogl_get_proc_address ("glUniform3iARB"); + + ctx->pf_glUniform4iARB = + (COGL_PFNGLUNIFORM4IARBPROC) + cogl_get_proc_address ("glUniform4iARB"); + + ctx->pf_glUniform1ivARB = + (COGL_PFNGLUNIFORM1IVARBPROC) + cogl_get_proc_address ("glUniform1ivARB"); + + ctx->pf_glUniform2ivARB = + (COGL_PFNGLUNIFORM2IVARBPROC) + cogl_get_proc_address ("glUniform2ivARB"); + + ctx->pf_glUniform3ivARB = + (COGL_PFNGLUNIFORM3IVARBPROC) + cogl_get_proc_address ("glUniform3ivARB"); + + ctx->pf_glUniform4ivARB = + (COGL_PFNGLUNIFORM4IVARBPROC) + cogl_get_proc_address ("glUniform4ivARB"); + + ctx->pf_glUniformMatrix2fvARB = + (COGL_PFNGLUNIFORMMATRIX2FVARBPROC) + cogl_get_proc_address ("glUniformMatrix2fvARB"); + + ctx->pf_glUniformMatrix3fvARB = + (COGL_PFNGLUNIFORMMATRIX3FVARBPROC) + cogl_get_proc_address ("glUniformMatrix3fvARB"); + + ctx->pf_glUniformMatrix4fvARB = + (COGL_PFNGLUNIFORMMATRIX4FVARBPROC) + cogl_get_proc_address ("glUniformMatrix4fvARB"); + if (ctx->pf_glCreateProgramObjectARB && ctx->pf_glCreateShaderObjectARB && ctx->pf_glShaderSourceARB && @@ -1012,54 +941,74 @@ ctx->pf_glDeleteObjectARB && ctx->pf_glGetInfoLogARB && ctx->pf_glGetObjectParameterivARB && - ctx->pf_glUniform1fARB) + ctx->pf_glUniform1fARB && + ctx->pf_glUniform2fARB && + ctx->pf_glUniform3fARB && + ctx->pf_glUniform4fARB && + ctx->pf_glUniform1fvARB && + ctx->pf_glUniform2fvARB && + ctx->pf_glUniform3fvARB && + ctx->pf_glUniform4fvARB && + ctx->pf_glUniform1iARB && + ctx->pf_glUniform2iARB && + ctx->pf_glUniform3iARB && + ctx->pf_glUniform4iARB && + ctx->pf_glUniform1ivARB && + ctx->pf_glUniform2ivARB && + ctx->pf_glUniform3ivARB && + ctx->pf_glUniform4ivARB && + ctx->pf_glUniformMatrix2fvARB && + ctx->pf_glUniformMatrix3fvARB && + ctx->pf_glUniformMatrix4fvARB && + ctx->pf_glVertexAttribPointerARB && + ctx->pf_glEnableVertexAttribArrayARB && + ctx->pf_glDisableVertexAttribArrayARB) flags |= COGL_FEATURE_SHADERS_GLSL; } - if (cogl_check_extension ("GL_EXT_framebuffer_object", gl_extensions) || cogl_check_extension ("GL_ARB_framebuffer_object", gl_extensions)) - { + { ctx->pf_glGenRenderbuffersEXT = (COGL_PFNGLGENRENDERBUFFERSEXTPROC) cogl_get_proc_address ("glGenRenderbuffersEXT"); - + ctx->pf_glDeleteRenderbuffersEXT = (COGL_PFNGLDELETERENDERBUFFERSEXTPROC) cogl_get_proc_address ("glDeleteRenderbuffersEXT"); - + ctx->pf_glBindRenderbufferEXT = (COGL_PFNGLBINDRENDERBUFFEREXTPROC) cogl_get_proc_address ("glBindRenderbufferEXT"); - + ctx->pf_glRenderbufferStorageEXT = (COGL_PFNGLRENDERBUFFERSTORAGEEXTPROC) cogl_get_proc_address ("glRenderbufferStorageEXT"); - + ctx->pf_glGenFramebuffersEXT = (COGL_PFNGLGENFRAMEBUFFERSEXTPROC) cogl_get_proc_address ("glGenFramebuffersEXT"); - + ctx->pf_glBindFramebufferEXT = (COGL_PFNGLBINDFRAMEBUFFEREXTPROC) cogl_get_proc_address ("glBindFramebufferEXT"); - + ctx->pf_glFramebufferTexture2DEXT = (COGL_PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) cogl_get_proc_address ("glFramebufferTexture2DEXT"); - + ctx->pf_glFramebufferRenderbufferEXT = (COGL_PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) cogl_get_proc_address ("glFramebufferRenderbufferEXT"); - + ctx->pf_glCheckFramebufferStatusEXT = (COGL_PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) cogl_get_proc_address ("glCheckFramebufferStatusEXT"); - + ctx->pf_glDeleteFramebuffersEXT = (COGL_PFNGLDELETEFRAMEBUFFERSEXTPROC) cogl_get_proc_address ("glDeleteFramebuffersEXT"); - + if (ctx->pf_glGenRenderbuffersEXT && ctx->pf_glBindRenderbufferEXT && ctx->pf_glRenderbufferStorageEXT && @@ -1071,49 +1020,89 @@ ctx->pf_glDeleteFramebuffersEXT) flags |= COGL_FEATURE_OFFSCREEN; } - + if (cogl_check_extension ("GL_EXT_framebuffer_blit", gl_extensions)) { ctx->pf_glBlitFramebufferEXT = (COGL_PFNGLBLITFRAMEBUFFEREXTPROC) cogl_get_proc_address ("glBlitFramebufferEXT"); - + if (ctx->pf_glBlitFramebufferEXT) flags |= COGL_FEATURE_OFFSCREEN_BLIT; } - + if (cogl_check_extension ("GL_EXT_framebuffer_multisample", gl_extensions)) { ctx->pf_glRenderbufferStorageMultisampleEXT = (COGL_PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) cogl_get_proc_address ("glRenderbufferStorageMultisampleEXT"); - + if (ctx->pf_glRenderbufferStorageMultisampleEXT) flags |= COGL_FEATURE_OFFSCREEN_MULTISAMPLE; } - ctx->num_stencil_bits = 0; - GE( glGetIntegerv (GL_STENCIL_BITS, &ctx->num_stencil_bits) ); - if (ctx->num_stencil_bits > 0) + GE( glGetIntegerv (GL_STENCIL_BITS, &num_stencil_bits) ); + /* We need at least three stencil bits to combine clips */ + if (num_stencil_bits > 2) flags |= COGL_FEATURE_STENCIL_BUFFER; GE( glGetIntegerv (GL_MAX_CLIP_PLANES, &max_clip_planes) ); if (max_clip_planes >= 4) flags |= COGL_FEATURE_FOUR_CLIP_PLANES; + if (cogl_check_extension ("GL_ARB_vertex_buffer_object", gl_extensions)) + { + ctx->pf_glGenBuffersARB = + (COGL_PFNGLGENBUFFERSARBPROC) + cogl_get_proc_address ("glGenBuffersARB"); + ctx->pf_glBindBufferARB = + (COGL_PFNGLBINDBUFFERARBPROC) + cogl_get_proc_address ("glBindBufferARB"); + ctx->pf_glBufferDataARB = + (COGL_PFNGLBUFFERDATAARBPROC) + cogl_get_proc_address ("glBufferDataARB"); + ctx->pf_glBufferSubDataARB = + (COGL_PFNGLBUFFERSUBDATAARBPROC) + cogl_get_proc_address ("glBufferSubDataARB"); + ctx->pf_glDeleteBuffersARB = + (COGL_PFNGLDELETEBUFFERSARBPROC) + cogl_get_proc_address ("glDeleteBuffersARB"); + ctx->pf_glMapBufferARB = + (COGL_PFNGLMAPBUFFERARBPROC) + cogl_get_proc_address ("glMapBufferARB"); + ctx->pf_glUnmapBufferARB = + (COGL_PFNGLUNMAPBUFFERARBPROC) + cogl_get_proc_address ("glUnmapBufferARB"); + if (ctx->pf_glGenBuffersARB + && ctx->pf_glBindBufferARB + && ctx->pf_glBufferDataARB + && ctx->pf_glBufferSubDataARB + && ctx->pf_glDeleteBuffersARB + && ctx->pf_glMapBufferARB + && ctx->pf_glUnmapBufferARB) + flags |= COGL_FEATURE_VBOS; + } + + /* This should always be available because it is defined in GL 1.2, + but we can't call it directly because under Windows functions > + 1.1 aren't exported */ + ctx->pf_glDrawRangeElements = + (COGL_PFNGLDRAWRANGEELEMENTSPROC) + cogl_get_proc_address ("glDrawRangeElements"); + /* Cache features */ ctx->feature_flags = flags; ctx->features_cached = TRUE; } -ClutterFeatureFlags +CoglFeatureFlags cogl_get_features () { _COGL_GET_CONTEXT (ctx, 0); - + if (!ctx->features_cached) _cogl_features_init (); - + return ctx->feature_flags; } @@ -1121,83 +1110,40 @@ cogl_features_available (CoglFeatureFlags features) { _COGL_GET_CONTEXT (ctx, 0); - + if (!ctx->features_cached) _cogl_features_init (); - + return (ctx->feature_flags & features) == features; } void -cogl_get_modelview_matrix (ClutterFixed m[16]) +cogl_get_modelview_matrix (float m[16]) { - GLdouble md[16]; - - glGetDoublev(GL_MODELVIEW_MATRIX, &md[0]); - -#define M(m,row,col) m[col*4+row] - M(m,0,0) = CLUTTER_FLOAT_TO_FIXED (M(md,0,0)); - M(m,0,1) = CLUTTER_FLOAT_TO_FIXED (M(md,0,1)); - M(m,0,2) = CLUTTER_FLOAT_TO_FIXED (M(md,0,2)); - M(m,0,3) = CLUTTER_FLOAT_TO_FIXED (M(md,0,3)); - - M(m,1,0) = CLUTTER_FLOAT_TO_FIXED (M(md,1,0)); - M(m,1,1) = CLUTTER_FLOAT_TO_FIXED (M(md,1,1)); - M(m,1,2) = CLUTTER_FLOAT_TO_FIXED (M(md,1,2)); - M(m,1,3) = CLUTTER_FLOAT_TO_FIXED (M(md,1,3)); - - M(m,2,0) = CLUTTER_FLOAT_TO_FIXED (M(md,2,0)); - M(m,2,1) = CLUTTER_FLOAT_TO_FIXED (M(md,2,1)); - M(m,2,2) = CLUTTER_FLOAT_TO_FIXED (M(md,2,2)); - M(m,2,3) = CLUTTER_FLOAT_TO_FIXED (M(md,2,3)); - - M(m,3,0) = CLUTTER_FLOAT_TO_FIXED (M(md,3,0)); - M(m,3,1) = CLUTTER_FLOAT_TO_FIXED (M(md,3,1)); - M(m,3,2) = CLUTTER_FLOAT_TO_FIXED (M(md,3,2)); - M(m,3,3) = CLUTTER_FLOAT_TO_FIXED (M(md,3,3)); -#undef M + glGetFloatv (GL_MODELVIEW_MATRIX, m); } void -cogl_get_projection_matrix (ClutterFixed m[16]) +cogl_get_projection_matrix (float m[16]) { - GLdouble md[16]; - - glGetDoublev(GL_PROJECTION_MATRIX, &md[0]); - -#define M(m,row,col) m[col*4+row] - M(m,0,0) = CLUTTER_FLOAT_TO_FIXED (M(md,0,0)); - M(m,0,1) = CLUTTER_FLOAT_TO_FIXED (M(md,0,1)); - M(m,0,2) = CLUTTER_FLOAT_TO_FIXED (M(md,0,2)); - M(m,0,3) = CLUTTER_FLOAT_TO_FIXED (M(md,0,3)); - - M(m,1,0) = CLUTTER_FLOAT_TO_FIXED (M(md,1,0)); - M(m,1,1) = CLUTTER_FLOAT_TO_FIXED (M(md,1,1)); - M(m,1,2) = CLUTTER_FLOAT_TO_FIXED (M(md,1,2)); - M(m,1,3) = CLUTTER_FLOAT_TO_FIXED (M(md,1,3)); - - M(m,2,0) = CLUTTER_FLOAT_TO_FIXED (M(md,2,0)); - M(m,2,1) = CLUTTER_FLOAT_TO_FIXED (M(md,2,1)); - M(m,2,2) = CLUTTER_FLOAT_TO_FIXED (M(md,2,2)); - M(m,2,3) = CLUTTER_FLOAT_TO_FIXED (M(md,2,3)); - - M(m,3,0) = CLUTTER_FLOAT_TO_FIXED (M(md,3,0)); - M(m,3,1) = CLUTTER_FLOAT_TO_FIXED (M(md,3,1)); - M(m,3,2) = CLUTTER_FLOAT_TO_FIXED (M(md,3,2)); - M(m,3,3) = CLUTTER_FLOAT_TO_FIXED (M(md,3,3)); -#undef M + glGetFloatv (GL_PROJECTION_MATRIX, m); } void -cogl_get_viewport (ClutterFixed v[4]) +cogl_get_viewport (float v[4]) { - GLdouble vd[4]; - glGetDoublev(GL_VIEWPORT, &vd[0]); + /* FIXME: cogl_get_viewport should return a gint vec */ +#if defined (HAVE_COGL_GLES2) || defined (HAVE_COGL_GLES) + GLint viewport[4]; + int i; - v[0] = CLUTTER_FLOAT_TO_FIXED (vd[0]); - v[1] = CLUTTER_FLOAT_TO_FIXED (vd[1]); - v[2] = CLUTTER_FLOAT_TO_FIXED (vd[2]); - v[3] = CLUTTER_FLOAT_TO_FIXED (vd[3]); + glGetIntegerv (GL_VIEWPORT, viewport); + + for (i = 0; i < 4; i++) + v[i] = (float)(viewport[i]); +#else + glGetFloatv (GL_VIEWPORT, v); +#endif } void @@ -1227,26 +1173,28 @@ } void -cogl_fog_set (const ClutterColor *fog_color, - ClutterFixed density, - ClutterFixed start, - ClutterFixed stop) +cogl_fog_set (const CoglColor *fog_color, + float density, + float z_near, + float z_far) { GLfloat fogColor[4]; - fogColor[0] = ((float) fog_color->red / 0xff * 1.0); - fogColor[1] = ((float) fog_color->green / 0xff * 1.0); - fogColor[2] = ((float) fog_color->blue / 0xff * 1.0); - fogColor[3] = ((float) fog_color->alpha / 0xff * 1.0); + fogColor[0] = cogl_color_get_red_float (fog_color); + fogColor[1] = cogl_color_get_green_float (fog_color); + fogColor[2] = cogl_color_get_blue_float (fog_color); + fogColor[3] = cogl_color_get_alpha_float (fog_color); glEnable (GL_FOG); glFogfv (GL_FOG_COLOR, fogColor); - glFogi (GL_FOG_MODE, GL_LINEAR); + /* NB: GLES doesn't have glFogi */ + glFogf (GL_FOG_MODE, GL_LINEAR); glHint (GL_FOG_HINT, GL_NICEST); - glFogf (GL_FOG_DENSITY, CLUTTER_FIXED_TO_FLOAT (density)); - glFogf (GL_FOG_START, CLUTTER_FIXED_TO_FLOAT (start)); - glFogf (GL_FOG_END, CLUTTER_FIXED_TO_FLOAT (stop)); + glFogf (GL_FOG_DENSITY, (GLfloat) density); + glFogf (GL_FOG_START, (GLfloat) z_near); + glFogf (GL_FOG_END, (GLfloat) z_far); } + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gl/cogl-context.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gl/cogl-context.c --- clutter-0.8.4/clutter/cogl/gl/cogl-context.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gl/cogl-context.c 2009-01-28 16:45:25.000000000 +0000 @@ -31,6 +31,8 @@ #include "cogl-internal.h" #include "cogl-util.h" #include "cogl-context.h" +#include "cogl-texture-private.h" +#include "cogl-material-private.h" #include @@ -39,35 +41,56 @@ gboolean cogl_create_context () { + GLubyte default_texture_data[] = { 0xff, 0xff, 0xff, 0x0 }; + gulong enable_flags = 0; + if (_context != NULL) return FALSE; - + /* Allocate context memory */ _context = (CoglContext*) g_malloc (sizeof (CoglContext)); - + /* Init default values */ _context->feature_flags = 0; _context->features_cached = FALSE; - + _context->enable_flags = 0; _context->color_alpha = 255; - - _context->path_nodes = NULL; - _context->path_nodes_cap = 0; - _context->path_nodes_size = 0; - + + _context->material_handles = NULL; + _context->material_layer_handles = NULL; + _context->default_material = cogl_material_new (); + _context->source_material = NULL; + _context->texture_handles = NULL; - + _context->default_gl_texture_2d_tex = COGL_INVALID_HANDLE; + _context->default_gl_texture_rect_tex = COGL_INVALID_HANDLE; + + _context->journal = g_array_new (FALSE, FALSE, sizeof (CoglJournalEntry)); + _context->logged_vertices = g_array_new (FALSE, FALSE, sizeof (GLfloat)); + _context->static_indices = g_array_new (FALSE, FALSE, sizeof (GLushort)); + _context->polygon_vertices = g_array_new (FALSE, FALSE, + sizeof (CoglTextureGLVertex)); + + _context->current_material = NULL; + _context->current_material_flags = 0; + _context->current_layers = g_array_new (FALSE, FALSE, + sizeof (CoglLayerInfo)); + _context->n_texcoord_arrays_enabled = 0; + _context->fbo_handles = NULL; _context->draw_buffer = COGL_WINDOW_BUFFER; - - _context->blend_src_factor = CGL_SRC_ALPHA; - _context->blend_dst_factor = CGL_ONE_MINUS_SRC_ALPHA; _context->shader_handles = NULL; _context->program_handles = NULL; - + + _context->vertex_buffer_handles = NULL; + + _context->path_nodes = g_array_new (FALSE, FALSE, sizeof (CoglPathNode)); + _context->last_path = 0; + _context->stencil_material = cogl_material_new (); + _context->pf_glGenRenderbuffersEXT = NULL; _context->pf_glBindRenderbufferEXT = NULL; _context->pf_glRenderbufferStorageEXT = NULL; @@ -79,7 +102,7 @@ _context->pf_glDeleteFramebuffersEXT = NULL; _context->pf_glBlitFramebufferEXT = NULL; _context->pf_glRenderbufferStorageMultisampleEXT = NULL; - + _context->pf_glCreateProgramObjectARB = NULL; _context->pf_glCreateShaderObjectARB = NULL; _context->pf_glShaderSourceARB = NULL; @@ -92,13 +115,58 @@ _context->pf_glGetInfoLogARB = NULL; _context->pf_glGetObjectParameterivARB = NULL; _context->pf_glUniform1fARB = NULL; - - /* Init OpenGL state */ - GE( glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE) ); - GE( glColorMask (TRUE, TRUE, TRUE, FALSE) ); - GE( glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) ); - cogl_enable (0); - + _context->pf_glUniform2fARB = NULL; + _context->pf_glUniform3fARB = NULL; + _context->pf_glUniform4fARB = NULL; + _context->pf_glUniform1fvARB = NULL; + _context->pf_glUniform2fvARB = NULL; + _context->pf_glUniform3fvARB = NULL; + _context->pf_glUniform4fvARB = NULL; + _context->pf_glUniform1iARB = NULL; + _context->pf_glUniform2iARB = NULL; + _context->pf_glUniform3iARB = NULL; + _context->pf_glUniform4iARB = NULL; + _context->pf_glUniform1ivARB = NULL; + _context->pf_glUniform2ivARB = NULL; + _context->pf_glUniform3ivARB = NULL; + _context->pf_glUniform4ivARB = NULL; + _context->pf_glUniformMatrix2fvARB = NULL; + _context->pf_glUniformMatrix3fvARB = NULL; + _context->pf_glUniformMatrix4fvARB = NULL; + + _context->pf_glDrawRangeElements = NULL; + + /* Initialise the clip stack */ + _cogl_clip_stack_state_init (); + + /* Create default textures used for fall backs */ + _context->default_gl_texture_2d_tex = + cogl_texture_new_from_data (1, /* width */ + 1, /* height */ + -1, /* max waste */ + COGL_TEXTURE_NONE, /* flags */ + COGL_PIXEL_FORMAT_RGBA_8888, /* data format */ + /* internal format */ + COGL_PIXEL_FORMAT_RGBA_8888, + 0, /* auto calc row stride */ + default_texture_data); + _context->default_gl_texture_rect_tex = + cogl_texture_new_from_data (1, /* width */ + 1, /* height */ + -1, /* max waste */ + COGL_TEXTURE_NONE, /* flags */ + COGL_PIXEL_FORMAT_RGBA_8888, /* data format */ + /* internal format */ + COGL_PIXEL_FORMAT_RGBA_8888, + 0, /* auto calc row stride */ + default_texture_data); + + cogl_set_source (_context->default_material); + cogl_material_flush_gl_state (_context->source_material, NULL); + enable_flags = + cogl_material_get_cogl_enable_flags (_context->source_material); + cogl_enable (enable_flags); + return TRUE; } @@ -108,6 +176,11 @@ if (_context == NULL) return; + _cogl_clip_stack_state_destroy (); + + if (_context->path_nodes) + g_array_free (_context->path_nodes, TRUE); + if (_context->texture_handles) g_array_free (_context->texture_handles, TRUE); if (_context->fbo_handles) @@ -116,7 +189,27 @@ g_array_free (_context->shader_handles, TRUE); if (_context->program_handles) g_array_free (_context->program_handles, TRUE); - + + if (_context->default_gl_texture_2d_tex) + cogl_texture_unref (_context->default_gl_texture_2d_tex); + if (_context->default_gl_texture_rect_tex) + cogl_texture_unref (_context->default_gl_texture_rect_tex); + + if (_context->default_material) + cogl_material_unref (_context->default_material); + + if (_context->journal) + g_array_free (_context->journal, TRUE); + if (_context->logged_vertices) + g_array_free (_context->logged_vertices, TRUE); + + if (_context->static_indices) + g_array_free (_context->static_indices, TRUE); + if (_context->polygon_vertices) + g_array_free (_context->polygon_vertices, TRUE); + if (_context->current_layers) + g_array_free (_context->current_layers, TRUE); + g_free (_context); } @@ -126,6 +219,6 @@ /* Create if doesn't exist yet */ if (_context == NULL) cogl_create_context (); - + return _context; } diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gl/cogl-context.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gl/cogl-context.h --- clutter-0.8.4/clutter/cogl/gl/cogl-context.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gl/cogl-context.h 2009-01-29 08:31:37.000000000 +0000 @@ -27,35 +27,57 @@ #define __COGL_CONTEXT_H #include "cogl-primitives.h" +#include "cogl-clip-stack.h" + +typedef struct +{ + GLfloat v[3]; + GLfloat t[2]; + GLubyte c[4]; +} CoglTextureGLVertex; typedef struct { /* Features cache */ CoglFeatureFlags feature_flags; gboolean features_cached; - GLint num_stencil_bits; - + /* Enable cache */ gulong enable_flags; guint8 color_alpha; - COGLenum blend_src_factor; - COGLenum blend_dst_factor; - - /* Primitives */ - CoglFixedVec2 path_start; - CoglFixedVec2 path_pen; - CoglFloatVec2 *path_nodes; - guint path_nodes_cap; - guint path_nodes_size; - CoglFixedVec2 path_nodes_min; - CoglFixedVec2 path_nodes_max; + + gboolean enable_backface_culling; /* Cache of inverse projection matrix */ - GLfloat inverse_projection[16]; - + float inverse_projection[16]; + + /* Materials */ + GArray *material_handles; + GArray *material_layer_handles; + CoglHandle default_material; + CoglHandle source_material; + /* Textures */ - GArray *texture_handles; - + GArray *texture_handles; + CoglHandle default_gl_texture_2d_tex; + CoglHandle default_gl_texture_rect_tex; + + + /* Batching geometry... */ + /* We journal the texture rectangles we want to submit to OpenGL so + * we have an oppertunity to optimise the final order so that we + * can batch things together. */ + GArray *journal; + GArray *logged_vertices; + GArray *static_indices; + GArray *polygon_vertices; + + /* Some simple caching, to minimize state changes... */ + CoglHandle current_material; + gulong current_material_flags; + GArray *current_layers; + guint n_texcoord_arrays_enabled; + /* Framebuffer objects */ GArray *fbo_handles; CoglBufferTarget draw_buffer; @@ -65,7 +87,22 @@ /* Programs */ GArray *program_handles; - + + /* Clip stack */ + CoglClipStackState clip; + + /* Vertex buffers */ + GArray *vertex_buffer_handles; + + /* Primitives */ + floatVec2 path_start; + floatVec2 path_pen; + GArray *path_nodes; + guint last_path; + floatVec2 path_nodes_min; + floatVec2 path_nodes_max; + CoglHandle stencil_material; + /* Relying on glext.h to define these */ COGL_PFNGLGENRENDERBUFFERSEXTPROC pf_glGenRenderbuffersEXT; COGL_PFNGLDELETERENDERBUFFERSEXTPROC pf_glDeleteRenderbuffersEXT; @@ -79,7 +116,7 @@ COGL_PFNGLDELETEFRAMEBUFFERSEXTPROC pf_glDeleteFramebuffersEXT; COGL_PFNGLBLITFRAMEBUFFEREXTPROC pf_glBlitFramebufferEXT; COGL_PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC pf_glRenderbufferStorageMultisampleEXT; - + COGL_PFNGLCREATEPROGRAMOBJECTARBPROC pf_glCreateProgramObjectARB; COGL_PFNGLCREATESHADEROBJECTARBPROC pf_glCreateShaderObjectARB; COGL_PFNGLSHADERSOURCEARBPROC pf_glShaderSourceARB; @@ -91,8 +128,40 @@ COGL_PFNGLDELETEOBJECTARBPROC pf_glDeleteObjectARB; COGL_PFNGLGETINFOLOGARBPROC pf_glGetInfoLogARB; COGL_PFNGLGETOBJECTPARAMETERIVARBPROC pf_glGetObjectParameterivARB; + + COGL_PFNGLVERTEXATTRIBPOINTERARBPROC pf_glVertexAttribPointerARB; + COGL_PFNGLENABLEVERTEXATTRIBARRAYARBPROC pf_glEnableVertexAttribArrayARB; + COGL_PFNGLDISABLEVERTEXATTRIBARRAYARBPROC pf_glDisableVertexAttribArrayARB; + + COGL_PFNGLGENBUFFERSARBPROC pf_glGenBuffersARB; + COGL_PFNGLBINDBUFFERARBPROC pf_glBindBufferARB; + COGL_PFNGLBUFFERDATAARBPROC pf_glBufferDataARB; + COGL_PFNGLBUFFERSUBDATAARBPROC pf_glBufferSubDataARB; + COGL_PFNGLMAPBUFFERARBPROC pf_glMapBufferARB; + COGL_PFNGLUNMAPBUFFERARBPROC pf_glUnmapBufferARB; + COGL_PFNGLDELETEBUFFERSARBPROC pf_glDeleteBuffersARB; + COGL_PFNGLUNIFORM1FARBPROC pf_glUniform1fARB; - + COGL_PFNGLUNIFORM2FARBPROC pf_glUniform2fARB; + COGL_PFNGLUNIFORM3FARBPROC pf_glUniform3fARB; + COGL_PFNGLUNIFORM4FARBPROC pf_glUniform4fARB; + COGL_PFNGLUNIFORM1FVARBPROC pf_glUniform1fvARB; + COGL_PFNGLUNIFORM2FVARBPROC pf_glUniform2fvARB; + COGL_PFNGLUNIFORM3FVARBPROC pf_glUniform3fvARB; + COGL_PFNGLUNIFORM4FVARBPROC pf_glUniform4fvARB; + COGL_PFNGLUNIFORM1IARBPROC pf_glUniform1iARB; + COGL_PFNGLUNIFORM2IARBPROC pf_glUniform2iARB; + COGL_PFNGLUNIFORM3IARBPROC pf_glUniform3iARB; + COGL_PFNGLUNIFORM4IARBPROC pf_glUniform4iARB; + COGL_PFNGLUNIFORM1IVARBPROC pf_glUniform1ivARB; + COGL_PFNGLUNIFORM2IVARBPROC pf_glUniform2ivARB; + COGL_PFNGLUNIFORM3IVARBPROC pf_glUniform3ivARB; + COGL_PFNGLUNIFORM4IVARBPROC pf_glUniform4ivARB; + COGL_PFNGLUNIFORMMATRIX2FVARBPROC pf_glUniformMatrix2fvARB; + COGL_PFNGLUNIFORMMATRIX3FVARBPROC pf_glUniformMatrix3fvARB; + COGL_PFNGLUNIFORMMATRIX4FVARBPROC pf_glUniformMatrix4fvARB; + + COGL_PFNGLDRAWRANGEELEMENTSPROC pf_glDrawRangeElements; } CoglContext; CoglContext * @@ -103,6 +172,6 @@ CoglContext *ctxvar = _cogl_context_get_default (); \ if (ctxvar == NULL) return retval; -#define NO_RETVAL +#define NO_RETVAL #endif /* __COGL_CONTEXT_H */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gl/cogl-defines.h.in /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gl/cogl-defines.h.in --- clutter-0.8.4/clutter/cogl/gl/cogl-defines.h.in 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gl/cogl-defines.h.in 2009-01-28 16:45:25.000000000 +0000 @@ -309,6 +309,7 @@ #define CGL_MAX_TEXTURE_STACK_DEPTH GL_MAX_TEXTURE_STACK_DEPTH #define CGL_MAX_VIEWPORT_DIMS GL_MAX_VIEWPORT_DIMS #define CGL_MAX_CLIENT_ATTRIB_STACK_DEPTH GL_MAX_CLIENT_ATTRIB_STACK_DEPTH +#define CGL_MAX_COMBINED_TEXTURE_IMAGE_UNITS GL_MAX_TEXTURE_UNITS #define CGL_ATTRIB_STACK_DEPTH GL_ATTRIB_STACK_DEPTH #define CGL_CLIENT_ATTRIB_STACK_DEPTH GL_CLIENT_ATTRIB_STACK_DEPTH #define CGL_COLOR_CLEAR_VALUE GL_COLOR_CLEAR_VALUE @@ -838,10 +839,190 @@ GLint *params); typedef void + (APIENTRYP COGL_PFNGLVERTEXATTRIBPOINTERARBPROC) + (GLuint index, + GLint size, + GLenum type, + GLboolean normalized, + GLsizei stride, + const GLvoid *pointer); + +typedef void + (APIENTRYP COGL_PFNGLENABLEVERTEXATTRIBARRAYARBPROC) + (GLuint index); + +typedef void + (APIENTRYP COGL_PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) + (GLuint index); + +typedef void + (APIENTRYP COGL_PFNGLGENBUFFERSARBPROC) + (GLuint n, + GLuint *buffers); + +typedef void + (APIENTRYP COGL_PFNGLBINDBUFFERARBPROC) + (GLenum target, + GLuint buffer); + +typedef void + (APIENTRYP COGL_PFNGLBUFFERDATAARBPROC) + (GLenum target, + GLsizeiptr size, + const GLvoid *data, + GLenum usage); + +typedef void + (APIENTRYP COGL_PFNGLBUFFERSUBDATAARBPROC) + (GLenum target, + GLintptr offset, + GLsizeiptr size, + const GLvoid *data); + +typedef void * + (APIENTRYP COGL_PFNGLMAPBUFFERARBPROC) + (GLenum target, + GLenum access); + +typedef GLboolean + (APIENTRYP COGL_PFNGLUNMAPBUFFERARBPROC) + (GLenum target); + +typedef void + (APIENTRYP COGL_PFNGLDELETEBUFFERSARBPROC) + (GLsizei n, + const GLuint *buffers); + +typedef void (APIENTRYP COGL_PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void + (APIENTRYP COGL_PFNGLUNIFORM2FARBPROC) + (GLint location, + GLfloat v0, + GLfloat v1); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM3FARBPROC) + (GLint location, + GLfloat v0, + GLfloat v1, + GLfloat v2); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM4FARBPROC) + (GLint location, + GLfloat v0, + GLfloat v1, + GLfloat v2, + GLfloat v3); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM1FVARBPROC) + (GLint location, + GLsizei count, + const GLfloat * value); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM2FVARBPROC) + (GLint location, + GLsizei count, + const GLfloat * value); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM3FVARBPROC) + (GLint location, + GLsizei count, + const GLfloat * value); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM4FVARBPROC) + (GLint location, + GLsizei count, + const GLfloat * value); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM1IARBPROC) + (GLint location, + GLint v0); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM2IARBPROC) + (GLint location, + GLint v0, + GLint v1); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM3IARBPROC) + (GLint location, + GLint v0, + GLint v1, + GLint v2); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM4IARBPROC) + (GLint location, + GLint v0, + GLint v1, + GLint v2, + GLint v3); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM1IVARBPROC) + (GLint location, + GLsizei count, + const GLint * value); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM2IVARBPROC) + (GLint location, + GLsizei count, + const GLint * value); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM3IVARBPROC) + (GLint location, + GLsizei count, + const GLint * value); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORM4IVARBPROC) + (GLint location, + GLsizei count, + const GLint * value); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORMMATRIX2FVARBPROC) + (GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORMMATRIX3FVARBPROC) + (GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value); + +typedef void + (APIENTRYP COGL_PFNGLUNIFORMMATRIX4FVARBPROC) + (GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value); + +typedef void + (APIENTRYP COGL_PFNGLDRAWRANGEELEMENTSPROC) + (GLenum mode, + GLuint start, + GLuint end, + GLsizei count, + GLenum type, + const GLvoid *indices); + G_END_DECLS #endif diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gl/cogl-fbo.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gl/cogl-fbo.c --- clutter-0.8.4/clutter/cogl/gl/cogl-fbo.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gl/cogl-fbo.c 2009-01-28 08:12:46.000000000 +0000 @@ -30,7 +30,7 @@ #include "cogl.h" #include "cogl-internal.h" #include "cogl-util.h" -#include "cogl-texture.h" +#include "cogl-texture-private.h" #include "cogl-fbo.h" #include "cogl-context.h" #include "cogl-handle.h" diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gl/cogl-internal.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gl/cogl-internal.h --- clutter-0.8.4/clutter/cogl/gl/cogl-internal.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gl/cogl-internal.h 2009-01-28 16:45:25.000000000 +0000 @@ -46,16 +46,15 @@ #else /* COGL_DEBUG */ -#define GE(x) (x); +#define GE(x) (x) #endif /* COGL_DEBUG */ #define COGL_ENABLE_BLEND (1<<1) -#define COGL_ENABLE_TEXTURE_2D (1<<2) -#define COGL_ENABLE_ALPHA_TEST (1<<3) -#define COGL_ENABLE_TEXTURE_RECT (1<<4) -#define COGL_ENABLE_VERTEX_ARRAY (1<<5) -#define COGL_ENABLE_TEXCOORD_ARRAY (1<<6) +#define COGL_ENABLE_ALPHA_TEST (1<<2) +#define COGL_ENABLE_VERTEX_ARRAY (1<<3) +#define COGL_ENABLE_COLOR_ARRAY (1<<4) +#define COGL_ENABLE_BACKFACE_CULLING (1<<5) gint _cogl_get_format_bpp (CoglPixelFormat format); diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gl/cogl-primitives.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gl/cogl-primitives.c --- clutter-0.8.4/clutter/cogl/gl/cogl-primitives.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gl/cogl-primitives.c 2009-01-29 08:31:37.000000000 +0000 @@ -34,79 +34,31 @@ #include #include +#include #define _COGL_MAX_BEZ_RECURSE_DEPTH 16 void -_cogl_rectangle (gint x, - gint y, - guint width, - guint height) +_cogl_path_add_node (gboolean new_sub_path, + float x, + float y) { + CoglPathNode new_node; + _COGL_GET_CONTEXT (ctx, NO_RETVAL); - - cogl_enable (ctx->color_alpha < 255 - ? COGL_ENABLE_BLEND : 0); - - GE( glRecti (x, y, x + width, y + height) ); -} + new_node.x = x; + new_node.y = y; + new_node.path_size = 0; -void -_cogl_rectanglex (ClutterFixed x, - ClutterFixed y, - ClutterFixed width, - ClutterFixed height) -{ - _COGL_GET_CONTEXT (ctx, NO_RETVAL); - - cogl_enable (ctx->color_alpha < 255 - ? COGL_ENABLE_BLEND : 0); - - GE( glRectf (CLUTTER_FIXED_TO_FLOAT (x), - CLUTTER_FIXED_TO_FLOAT (y), - CLUTTER_FIXED_TO_FLOAT (x + width), - CLUTTER_FIXED_TO_FLOAT (y + height)) ); -} + if (new_sub_path || ctx->path_nodes->len == 0) + ctx->last_path = ctx->path_nodes->len; -void -_cogl_path_clear_nodes () -{ - _COGL_GET_CONTEXT (ctx, NO_RETVAL); - - if (ctx->path_nodes) - g_free(ctx->path_nodes); - - ctx->path_nodes = (CoglFloatVec2*) g_malloc (2 * sizeof(CoglFloatVec2)); - ctx->path_nodes_size = 0; - ctx->path_nodes_cap = 2; -} + g_array_append_val (ctx->path_nodes, new_node); -void -_cogl_path_add_node (ClutterFixed x, - ClutterFixed y) -{ - CoglFloatVec2 *new_nodes = NULL; - - _COGL_GET_CONTEXT (ctx, NO_RETVAL); - - if (ctx->path_nodes_size == ctx->path_nodes_cap) - { - new_nodes = g_realloc (ctx->path_nodes, - 2 * ctx->path_nodes_cap - * sizeof (CoglFloatVec2)); - - if (new_nodes == NULL) return; - - ctx->path_nodes = new_nodes; - ctx->path_nodes_cap *= 2; - } - - ctx->path_nodes [ctx->path_nodes_size] .x = CLUTTER_FIXED_TO_FLOAT (x); - ctx->path_nodes [ctx->path_nodes_size] .y = CLUTTER_FIXED_TO_FLOAT (y); - ctx->path_nodes_size++; - - if (ctx->path_nodes_size == 1) + g_array_index (ctx->path_nodes, CoglPathNode, ctx->last_path).path_size++; + + if (ctx->path_nodes->len == 1) { ctx->path_nodes_min.x = ctx->path_nodes_max.x = x; ctx->path_nodes_min.y = ctx->path_nodes_max.y = y; @@ -123,55 +75,171 @@ void _cogl_path_stroke_nodes () { + guint path_start = 0; + gulong enable_flags = COGL_ENABLE_VERTEX_ARRAY; + _COGL_GET_CONTEXT (ctx, NO_RETVAL); - - cogl_enable (COGL_ENABLE_VERTEX_ARRAY - | (ctx->color_alpha < 255 - ? COGL_ENABLE_BLEND : 0)); - - GE( glVertexPointer (2, GL_FLOAT, 0, ctx->path_nodes) ); - GE( glDrawArrays (GL_LINE_STRIP, 0, ctx->path_nodes_size) ); + + enable_flags |= cogl_material_get_cogl_enable_flags (ctx->source_material); + cogl_enable (enable_flags); + + cogl_material_flush_gl_state (ctx->source_material, + COGL_MATERIAL_FLUSH_DISABLE_MASK, + (guint32)~0, /* disable all texture layers */ + NULL); + + while (path_start < ctx->path_nodes->len) + { + CoglPathNode *path = &g_array_index (ctx->path_nodes, CoglPathNode, + path_start); + + GE( glVertexPointer (2, GL_FLOAT, sizeof (CoglPathNode), + (guchar *) path + + G_STRUCT_OFFSET (CoglPathNode, x)) ); + GE( glDrawArrays (GL_LINE_STRIP, 0, path->path_size) ); + + path_start += path->path_size; + } +} + +static void +_cogl_path_get_bounds (floatVec2 nodes_min, + floatVec2 nodes_max, + float *bounds_x, + float *bounds_y, + float *bounds_w, + float *bounds_h) +{ + *bounds_x = nodes_min.x; + *bounds_y = nodes_min.y; + *bounds_w = nodes_max.x - *bounds_x; + *bounds_h = nodes_max.y - *bounds_y; } void -_cogl_path_fill_nodes () +_cogl_add_path_to_stencil_buffer (floatVec2 nodes_min, + floatVec2 nodes_max, + guint path_size, + CoglPathNode *path, + gboolean merge) { - guint bounds_x; - guint bounds_y; - guint bounds_w; - guint bounds_h; - + guint path_start = 0; + guint sub_path_num = 0; + float bounds_x; + float bounds_y; + float bounds_w; + float bounds_h; + gulong enable_flags = COGL_ENABLE_VERTEX_ARRAY; + _COGL_GET_CONTEXT (ctx, NO_RETVAL); - - GE( glClear (GL_STENCIL_BUFFER_BIT) ); + + /* Just setup a simple material that doesn't use texturing... */ + cogl_material_flush_gl_state (ctx->stencil_material, NULL); + + enable_flags |= + cogl_material_get_cogl_enable_flags (ctx->source_material); + cogl_enable (enable_flags); + + _cogl_path_get_bounds (nodes_min, nodes_max, + &bounds_x, &bounds_y, &bounds_w, &bounds_h); + + if (merge) + { + GE( glStencilMask (2) ); + GE( glStencilFunc (GL_LEQUAL, 0x2, 0x6) ); + } + else + { + GE( glClear (GL_STENCIL_BUFFER_BIT) ); + GE( glStencilMask (1) ); + GE( glStencilFunc (GL_LEQUAL, 0x1, 0x3) ); + } GE( glEnable (GL_STENCIL_TEST) ); - GE( glStencilFunc (GL_NEVER, 0x0, 0x1) ); GE( glStencilOp (GL_INVERT, GL_INVERT, GL_INVERT) ); - GE( glStencilMask (1) ); - - cogl_enable (COGL_ENABLE_VERTEX_ARRAY - | (ctx->color_alpha < 255 ? COGL_ENABLE_BLEND : 0)); - - GE( glVertexPointer (2, GL_FLOAT, 0, ctx->path_nodes) ); - GE( glDrawArrays (GL_TRIANGLE_FAN, 0, ctx->path_nodes_size) ); - + GE( glColorMask (FALSE, FALSE, FALSE, FALSE) ); + GE( glDepthMask (FALSE) ); + + while (path_start < path_size) + { + GE( glVertexPointer (2, GL_FLOAT, sizeof (CoglPathNode), + (guchar *) path + + G_STRUCT_OFFSET (CoglPathNode, x)) ); + GE( glDrawArrays (GL_TRIANGLE_FAN, 0, path->path_size) ); + + if (sub_path_num > 0) + { + /* Union the two stencil buffers bits into the least + significant bit */ + GE( glStencilMask (merge ? 6 : 3) ); + GE( glStencilOp (GL_ZERO, GL_REPLACE, GL_REPLACE) ); + cogl_rectangle (bounds_x, bounds_y, + bounds_x + bounds_w, bounds_y + bounds_h); + + GE( glStencilOp (GL_INVERT, GL_INVERT, GL_INVERT) ); + } + + GE( glStencilMask (merge ? 4 : 2) ); + + path_start += path->path_size; + path += path->path_size; + sub_path_num++; + } + + if (merge) + { + /* Now we have the new stencil buffer in bit 1 and the old + stencil buffer in bit 0 so we need to intersect them */ + GE( glStencilMask (3) ); + GE( glStencilFunc (GL_NEVER, 0x2, 0x3) ); + GE( glStencilOp (GL_DECR, GL_DECR, GL_DECR) ); + /* Decrement all of the bits twice so that only pixels where the + value is 3 will remain */ + GE( glPushMatrix () ); + GE( glLoadIdentity () ); + GE( glMatrixMode (GL_PROJECTION) ); + GE( glPushMatrix () ); + GE( glLoadIdentity () ); + cogl_rectangle (-1.0, -1.0, 1.0, 1.0); + cogl_rectangle (-1.0, -1.0, 1.0, 1.0); + GE( glPopMatrix () ); + GE( glMatrixMode (GL_MODELVIEW) ); + GE( glPopMatrix () ); + } + GE( glStencilMask (~(GLuint) 0) ); - - /* Merge the stencil buffer with any clipping rectangles */ - _cogl_clip_stack_merge (); - + GE( glDepthMask (TRUE) ); + GE( glColorMask (TRUE, TRUE, TRUE, TRUE) ); + GE( glStencilFunc (GL_EQUAL, 0x1, 0x1) ); GE( glStencilOp (GL_KEEP, GL_KEEP, GL_KEEP) ); +} + +void +_cogl_path_fill_nodes () +{ + float bounds_x; + float bounds_y; + float bounds_w; + float bounds_h; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + _cogl_path_get_bounds (ctx->path_nodes_min, ctx->path_nodes_max, + &bounds_x, &bounds_y, &bounds_w, &bounds_h); + + _cogl_add_path_to_stencil_buffer (ctx->path_nodes_min, + ctx->path_nodes_max, + ctx->path_nodes->len, + &g_array_index (ctx->path_nodes, + CoglPathNode, 0), + ctx->clip.stencil_used); + + cogl_rectangle (bounds_x, bounds_y, + bounds_x + bounds_w, bounds_y + bounds_h); - bounds_x = CLUTTER_FIXED_FLOOR (ctx->path_nodes_min.x); - bounds_y = CLUTTER_FIXED_FLOOR (ctx->path_nodes_min.y); - bounds_w = CLUTTER_FIXED_CEIL (ctx->path_nodes_max.x - ctx->path_nodes_min.x); - bounds_h = CLUTTER_FIXED_CEIL (ctx->path_nodes_max.y - ctx->path_nodes_min.y); - - cogl_rectangle (bounds_x, bounds_y, bounds_w, bounds_h); - - /* Rebuild the stencil clip */ - _cogl_clip_stack_rebuild (TRUE); + /* The stencil buffer now contains garbage so the clip area needs to + be rebuilt */ + ctx->clip.stack_dirty = TRUE; } diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gl/cogl-program.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gl/cogl-program.c --- clutter-0.8.4/clutter/cogl/gl/cogl-program.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gl/cogl-program.c 2009-01-28 08:12:46.000000000 +0000 @@ -29,7 +29,7 @@ #include "cogl.h" #include "cogl-program.h" -#include "cogl-shader.h" +#include "cogl-shader-private.h" #include "cogl-internal.h" #include "cogl-handle.h" #include "cogl-context.h" @@ -43,6 +43,24 @@ #define glLinkProgramARB ctx->pf_glLinkProgramARB #define glGetUniformLocationARB ctx->pf_glGetUniformLocationARB #define glUniform1fARB ctx->pf_glUniform1fARB +#define glUniform2fARB ctx->pf_glUniform2fARB +#define glUniform3fARB ctx->pf_glUniform3fARB +#define glUniform4fARB ctx->pf_glUniform4fARB +#define glUniform1fvARB ctx->pf_glUniform1fvARB +#define glUniform2fvARB ctx->pf_glUniform2fvARB +#define glUniform3fvARB ctx->pf_glUniform3fvARB +#define glUniform4fvARB ctx->pf_glUniform4fvARB +#define glUniform1iARB ctx->pf_glUniform1iARB +#define glUniform2iARB ctx->pf_glUniform2iARB +#define glUniform3iARB ctx->pf_glUniform3iARB +#define glUniform4iARB ctx->pf_glUniform4iARB +#define glUniform1ivARB ctx->pf_glUniform1ivARB +#define glUniform2ivARB ctx->pf_glUniform2ivARB +#define glUniform3ivARB ctx->pf_glUniform3ivARB +#define glUniform4ivARB ctx->pf_glUniform4ivARB +#define glUniformMatrix2fvARB ctx->pf_glUniformMatrix2fvARB +#define glUniformMatrix3fvARB ctx->pf_glUniformMatrix3fvARB +#define glUniformMatrix4fvARB ctx->pf_glUniformMatrix4fvARB #define glDeleteObjectARB ctx->pf_glDeleteObjectARB static void _cogl_program_free (CoglProgram *program); @@ -121,7 +139,7 @@ { program = _cogl_program_pointer_from_handle (handle); gl_handle = program->gl_handle; - } + } glUseProgramObjectARB (gl_handle); } @@ -148,3 +166,90 @@ _COGL_GET_CONTEXT (ctx, NO_RETVAL); glUniform1fARB (uniform_no, value); } + +void +cogl_program_uniform_1i (COGLint uniform_no, + gint value) +{ + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + glUniform1iARB (uniform_no, value); +} + +void +cogl_program_uniform_float (COGLint uniform_no, + gint size, + gint count, + const GLfloat *value) +{ + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + switch (size) + { + case 1: + glUniform1fvARB (uniform_no, count, value); + break; + case 2: + glUniform2fvARB (uniform_no, count, value); + break; + case 3: + glUniform3fvARB (uniform_no, count, value); + break; + case 4: + glUniform4fvARB (uniform_no, count, value); + break; + default: + g_warning ("%s called with invalid size parameter", G_STRFUNC); + } +} + +void +cogl_program_uniform_int (COGLint uniform_no, + gint size, + gint count, + const COGLint *value) +{ + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + switch (size) + { + case 1: + glUniform1ivARB (uniform_no, count, value); + break; + case 2: + glUniform2ivARB (uniform_no, count, value); + break; + case 3: + glUniform3ivARB (uniform_no, count, value); + break; + case 4: + glUniform4ivARB (uniform_no, count, value); + break; + default: + g_warning ("%s called with invalid size parameter", G_STRFUNC); + } +} + +void +cogl_program_uniform_matrix (COGLint uniform_no, + gint size, + gint count, + gboolean transpose, + const GLfloat *value) +{ + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + switch (size) + { + case 2 : + glUniformMatrix2fvARB (uniform_no, count, transpose, value); + break; + case 3 : + glUniformMatrix3fvARB (uniform_no, count, transpose, value); + break; + case 4 : + glUniformMatrix4fvARB (uniform_no, count, transpose, value); + break; + default : + g_warning ("%s called with invalid size parameter", G_STRFUNC); + } +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gl/cogl-shader.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gl/cogl-shader.c --- clutter-0.8.4/clutter/cogl/gl/cogl-shader.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gl/cogl-shader.c 2009-01-28 08:12:46.000000000 +0000 @@ -28,7 +28,7 @@ #endif #include "cogl.h" -#include "cogl-shader.h" +#include "cogl-shader-private.h" #include "cogl-internal.h" #include "cogl-context.h" #include "cogl-handle.h" diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gl/cogl-shader.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gl/cogl-shader.h --- clutter-0.8.4/clutter/cogl/gl/cogl-shader.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gl/cogl-shader.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,39 +0,0 @@ -/* - * Clutter COGL - * - * A basic GL/GLES Abstraction/Utility Layer - * - * Authored By Matthew Allum - * - * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __COGL_SHADER_H -#define __COGL_SHADER_H - -typedef struct _CoglShader CoglShader; - -struct _CoglShader -{ - guint ref_count; - GLhandleARB gl_handle; -}; - -CoglShader *_cogl_shader_pointer_from_handle (CoglHandle handle); - -#endif /* __COGL_SHADER_H */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gl/cogl-shader-private.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gl/cogl-shader-private.h --- clutter-0.8.4/clutter/cogl/gl/cogl-shader-private.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gl/cogl-shader-private.h 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,39 @@ +/* + * Clutter COGL + * + * A basic GL/GLES Abstraction/Utility Layer + * + * Authored By Matthew Allum + * + * 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, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __COGL_SHADER_H +#define __COGL_SHADER_H + +typedef struct _CoglShader CoglShader; + +struct _CoglShader +{ + guint ref_count; + GLhandleARB gl_handle; +}; + +CoglShader *_cogl_shader_pointer_from_handle (CoglHandle handle); + +#endif /* __COGL_SHADER_H */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gl/cogl-texture.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gl/cogl-texture.c --- clutter-0.8.4/clutter/cogl/gl/cogl-texture.c 2008-11-26 16:45:15.000000000 +0000 +++ clutter-0.9.0/clutter/cogl/gl/cogl-texture.c 2009-01-29 08:31:37.000000000 +0000 @@ -31,12 +31,14 @@ #include "cogl-internal.h" #include "cogl-util.h" #include "cogl-bitmap.h" -#include "cogl-texture.h" +#include "cogl-texture-private.h" +#include "cogl-material.h" #include "cogl-context.h" #include "cogl-handle.h" #include #include +#include /* #define COGL_DEBUG 1 @@ -49,6 +51,21 @@ printf("err: 0x%x\n", err); \ } */ +#ifdef HAVE_COGL_GL + +#define glDrawRangeElements ctx->pf_glDrawRangeElements + +#else + +/* GLES doesn't have glDrawRangeElements, so we simply pretend it does + * but that it makes no use of the start, end constraints: */ +#define glDrawRangeElements(mode, start, end, count, type, indices) \ + glDrawElements (mode, count, type, indices) + +#endif + +static void _cogl_journal_flush (void); + static void _cogl_texture_free (CoglTexture *tex); COGL_HANDLE_DEFINE (Texture, texture, texture_handles); @@ -58,15 +75,15 @@ gint index; GArray *array; CoglTexSliceSpan *span; - ClutterFixed pos; - ClutterFixed next_pos; - ClutterFixed origin; - ClutterFixed cover_start; - ClutterFixed cover_end; - ClutterFixed intersect_start; - ClutterFixed intersect_end; - ClutterFixed intersect_start_local; - ClutterFixed intersect_end_local; + float pos; + float next_pos; + float origin; + float cover_start; + float cover_end; + float intersect_start; + float intersect_end; + float intersect_start_local; + float intersect_end_local; gboolean intersects; }; @@ -75,7 +92,7 @@ { if (tex->bitmap.data != NULL && tex->bitmap_owner) g_free (tex->bitmap.data); - + tex->bitmap.data = NULL; tex->bitmap_owner = FALSE; } @@ -86,7 +103,7 @@ { if (tex->bitmap.data != NULL && tex->bitmap_owner) g_free (tex->bitmap.data); - + tex->bitmap = *new_bitmap; tex->bitmap_owner = TRUE; } @@ -98,11 +115,11 @@ iter->span = &g_array_index (iter->array, CoglTexSliceSpan, iter->index); - + /* Offset next position by span size */ iter->next_pos = iter->pos + - CLUTTER_INT_TO_FIXED (iter->span->size - iter->span->waste); - + (float)(iter->span->size - iter->span->waste); + /* Check if span intersects the area to cover */ if (iter->next_pos <= iter->cover_start || iter->pos >= iter->cover_end) @@ -111,15 +128,15 @@ iter->intersects = FALSE; return; } - + iter->intersects = TRUE; - + /* Clip start position to coverage area */ if (iter->pos < iter->cover_start) iter->intersect_start = iter->cover_start; else iter->intersect_start = iter->pos; - + /* Clip end position to coverage area */ if (iter->next_pos > iter->cover_end) iter->intersect_end = iter->cover_end; @@ -130,9 +147,9 @@ static void _cogl_span_iter_begin (CoglSpanIter *iter, GArray *array, - ClutterFixed origin, - ClutterFixed cover_start, - ClutterFixed cover_end) + float origin, + float cover_start, + float cover_end) { /* Copy info */ iter->index = 0; @@ -142,7 +159,7 @@ iter->cover_start = cover_start; iter->cover_end = cover_end; iter->pos = iter->origin; - + /* Update intersection */ _cogl_span_iter_update (iter); } @@ -152,10 +169,10 @@ { /* Move current position */ iter->pos = iter->next_pos; - + /* Pick next slice (wrap when last reached) */ iter->index = (iter->index + 1) % iter->array->len; - + /* Update intersection */ _cogl_span_iter_update (iter); } @@ -168,48 +185,37 @@ } static void -_cogl_subregion_gl_store_rules (gint bmp_rowstride, - gint bmp_width, - gint bmp_bpp, - gint src_x, - gint src_y, - gboolean pack) -{ - const GLenum ALIGNMENT = pack ? - GL_PACK_ALIGNMENT : GL_UNPACK_ALIGNMENT; - - const GLenum ROW_LENGTH = pack ? - GL_PACK_ROW_LENGTH : GL_UNPACK_ROW_LENGTH; - - const GLenum SKIP_ROWS = pack ? - GL_PACK_SKIP_ROWS : GL_UNPACK_SKIP_ROWS; - - const GLenum SKIP_PIXELS = pack ? - GL_PACK_SKIP_PIXELS : GL_UNPACK_SKIP_PIXELS; - - /* Encode the part of the rowstride that is a multiple of bmp_bpp in - ROW_LENGTH and the remainder in ALIGNMENT */ - GE( glPixelStorei (ROW_LENGTH, bmp_rowstride / bmp_bpp) ); +prep_for_gl_pixels_upload (gint pixels_rowstride, + gint pixels_src_x, + gint pixels_src_y, + gint pixels_bpp) +{ + GE( glPixelStorei (GL_UNPACK_ROW_LENGTH, pixels_rowstride / pixels_bpp) ); + + GE( glPixelStorei (GL_UNPACK_SKIP_PIXELS, pixels_src_x) ); + GE( glPixelStorei (GL_UNPACK_SKIP_ROWS, pixels_src_y) ); + + if (!(pixels_rowstride & 0x7)) + GE( glPixelStorei (GL_UNPACK_ALIGNMENT, 8) ); + else if (!(pixels_rowstride & 0x3)) + GE( glPixelStorei (GL_UNPACK_ALIGNMENT, 4) ); + else if (!(pixels_rowstride & 0x1)) + GE( glPixelStorei (GL_UNPACK_ALIGNMENT, 2) ); + else + GE( glPixelStorei (GL_UNPACK_ALIGNMENT, 1) ); +} - if (bmp_rowstride == bmp_width * bmp_bpp) - { - GE( glPixelStorei (ALIGNMENT, 1) ); - } +static void +prep_for_gl_pixels_download (gint pixels_rowstride) +{ + if (!(pixels_rowstride & 0x7)) + GE( glPixelStorei (GL_PACK_ALIGNMENT, 8) ); + else if (!(pixels_rowstride & 0x3)) + GE( glPixelStorei (GL_PACK_ALIGNMENT, 4) ); + else if (!(pixels_rowstride & 0x1)) + GE( glPixelStorei (GL_PACK_ALIGNMENT, 2) ); else - { - if ((bmp_rowstride % 4) == 0) - { - GE( glPixelStorei (ALIGNMENT, 4) ); - } - else - { - if ((bmp_rowstride % 2) == 0) - GE( glPixelStorei (ALIGNMENT, 2) ); - } - } - - GE( glPixelStorei (SKIP_ROWS, src_y) ); - GE( glPixelStorei (SKIP_PIXELS, src_x) ); + GE( glPixelStorei (GL_PACK_ALIGNMENT, 1) ); } static guchar * @@ -250,7 +256,7 @@ gint bpp; gint x,y; guchar *waste_buf; - + bpp = _cogl_get_format_bpp (tex->bitmap.format); waste_buf = _cogl_texture_allocate_waste_buffer (tex); @@ -259,28 +265,28 @@ for (y = 0; y < tex->slice_y_spans->len; ++y) { y_span = &g_array_index (tex->slice_y_spans, CoglTexSliceSpan, y); - + /* Iterate horizontal slices */ for (x = 0; x < tex->slice_x_spans->len; ++x) { x_span = &g_array_index (tex->slice_x_spans, CoglTexSliceSpan, x); - + /* Pick the gl texture object handle */ gl_handle = g_array_index (tex->slice_gl_handles, GLuint, y * tex->slice_x_spans->len + x); - + /* Setup gl alignment to match rowstride and top-left corner */ - _cogl_subregion_gl_store_rules (tex->bitmap.rowstride, - tex->bitmap.width, - bpp, - x_span->start, - y_span->start, - FALSE); - + prep_for_gl_pixels_upload (tex->bitmap.rowstride, + x_span->start, + y_span->start, + bpp); + /* Upload new image data */ GE( glBindTexture (tex->gl_target, gl_handle) ); - - GE( glTexSubImage2D (tex->gl_target, 0, 0, 0, + + GE( glTexSubImage2D (tex->gl_target, 0, + 0, + 0, x_span->size - x_span->waste, y_span->size - y_span->waste, tex->gl_format, tex->gl_type, @@ -305,13 +311,14 @@ src += tex->bitmap.rowstride; } - _cogl_subregion_gl_store_rules (x_span->waste * bpp, - x_span->waste, - bpp, - 0, 0, FALSE); + prep_for_gl_pixels_upload (x_span->waste * bpp, + 0, /* src x */ + 0, /* src y */ + bpp); GE( glTexSubImage2D (tex->gl_target, 0, - x_span->size - x_span->waste, 0, + x_span->size - x_span->waste, + 0, x_span->waste, y_span->size - y_span->waste, tex->gl_format, tex->gl_type, @@ -339,13 +346,14 @@ } } - _cogl_subregion_gl_store_rules (x_span->size * bpp, - x_span->size, - bpp, - 0, 0, FALSE); + prep_for_gl_pixels_upload (x_span->size * bpp, + 0, /* src x */ + 0, /* src y */ + bpp); GE( glTexSubImage2D (tex->gl_target, 0, - 0, y_span->size - y_span->waste, + 0, + y_span->size - y_span->waste, x_span->size, y_span->waste, tex->gl_format, tex->gl_type, @@ -372,27 +380,27 @@ gint bpp; gint x,y; CoglBitmap slice_bmp; - + bpp = _cogl_get_format_bpp (target_bmp->format); - + /* Iterate vertical slices */ for (y = 0; y < tex->slice_y_spans->len; ++y) { y_span = &g_array_index (tex->slice_y_spans, CoglTexSliceSpan, y); - + /* Iterate horizontal slices */ for (x = 0; x < tex->slice_x_spans->len; ++x) { /*if (x != 0 || y != 1) continue;*/ x_span = &g_array_index (tex->slice_x_spans, CoglTexSliceSpan, x); - + /* Pick the gl texture object handle */ gl_handle = g_array_index (tex->slice_gl_handles, GLuint, y * tex->slice_x_spans->len + x); - + /* If there's any waste we need to copy manually (no glGetTexSubImage) */ - + if (y_span->waste != 0 || x_span->waste != 0) { /* Setup temp bitmap for slice subregion */ @@ -401,21 +409,20 @@ slice_bmp.height = y_span->size; slice_bmp.rowstride = bpp * slice_bmp.width; slice_bmp.data = (guchar*) g_malloc (slice_bmp.rowstride * - slice_bmp.height); - + slice_bmp.height); + /* Setup gl alignment to 0,0 top-left corner */ - _cogl_subregion_gl_store_rules (slice_bmp.rowstride, - slice_bmp.width, - bpp, 0, 0, TRUE); - + prep_for_gl_pixels_download (slice_bmp.rowstride); + /* Download slice image data into temp bmp */ GE( glBindTexture (tex->gl_target, gl_handle) ); - - GE (glGetTexImage (tex->gl_target, 0, + + GE (glGetTexImage (tex->gl_target, + 0, /* level */ target_gl_format, target_gl_type, slice_bmp.data) ); - + /* Copy portion of slice from temp to target bmp */ _cogl_bitmap_copy_subregion (&slice_bmp, target_bmp, @@ -428,38 +435,25 @@ g_free (slice_bmp.data); } else - { - /* Setup gl alignment to match rowstride and top-left corner */ - - /* FIXME: for some strange reason any value other than 0 - * for GL_PACK_SKIP_PIXELS or GL_PACK_SKIP_ROWS corrupts the - * memory. As a workaround we offset data pointer manually - - _cogl_subregion_gl_store_rules (target_bmp->rowstride, - target_bmp->width, - bpp, - x_span->start, - y_span->start, - TRUE);*/ - _cogl_subregion_gl_store_rules (target_bmp->rowstride, - target_bmp->width, - bpp, - 0, 0, - TRUE); - + { + GLvoid *dst = target_bmp->data + + x_span->start * bpp + + y_span->start * target_bmp->rowstride; + + prep_for_gl_pixels_download (target_bmp->rowstride); + /* Download slice image data */ GE( glBindTexture (tex->gl_target, gl_handle) ); - - GE( glGetTexImage (tex->gl_target, 0, + + GE( glGetTexImage (tex->gl_target, + 0, /* level */ target_gl_format, target_gl_type, - target_bmp->data + - x_span->start * bpp + - y_span->start * target_bmp->rowstride) ); + dst) ); } } } - + return TRUE; } @@ -485,19 +479,19 @@ gint inter_w = 0, inter_h = 0; gint local_x = 0, local_y = 0; guchar *waste_buf; - + bpp = _cogl_get_format_bpp (source_bmp->format); - + waste_buf = _cogl_texture_allocate_waste_buffer (tex); /* Iterate vertical spans */ for (source_y = src_y, _cogl_span_iter_begin (&y_iter, tex->slice_y_spans, - 0, CLUTTER_INT_TO_FIXED (dst_y), - CLUTTER_INT_TO_FIXED (dst_y + height)); - + 0, (float)(dst_y), + (float)(dst_y + height)); + !_cogl_span_iter_end (&y_iter); - + _cogl_span_iter_next (&y_iter), source_y += inter_h ) { @@ -514,11 +508,11 @@ /* Iterate horizontal spans */ for (source_x = src_x, _cogl_span_iter_begin (&x_iter, tex->slice_x_spans, - 0, CLUTTER_INT_TO_FIXED (dst_x), - CLUTTER_INT_TO_FIXED (dst_x + width)); - + 0, (float)(dst_x), + (float)(dst_x + width)); + !_cogl_span_iter_end (&x_iter); - + _cogl_span_iter_next (&x_iter), source_x += inter_w ) { @@ -533,34 +527,31 @@ x_iter.index); /* Pick intersection width and height */ - inter_w = CLUTTER_FIXED_TO_INT (x_iter.intersect_end - - x_iter.intersect_start); - inter_h = CLUTTER_FIXED_TO_INT (y_iter.intersect_end - - y_iter.intersect_start); - + inter_w = (x_iter.intersect_end - + x_iter.intersect_start); + inter_h = (y_iter.intersect_end - + y_iter.intersect_start); + /* Localize intersection top-left corner to slice*/ - local_x = CLUTTER_FIXED_TO_INT (x_iter.intersect_start - - x_iter.pos); - local_y = CLUTTER_FIXED_TO_INT (y_iter.intersect_start - - y_iter.pos); - + local_x = (x_iter.intersect_start - + x_iter.pos); + local_y = (y_iter.intersect_start - + y_iter.pos); + /* Pick slice GL handle */ gl_handle = g_array_index (tex->slice_gl_handles, GLuint, y_iter.index * tex->slice_x_spans->len + x_iter.index); - + /* Setup gl alignment to match rowstride and top-left corner */ - - _cogl_subregion_gl_store_rules (source_bmp->rowstride, - source_bmp->width, - bpp, - source_x, - source_y, - FALSE); - + prep_for_gl_pixels_upload (source_bmp->rowstride, + source_x, + source_y, + bpp); + /* Upload new image data */ GE( glBindTexture (tex->gl_target, gl_handle) ); - + GE( glTexSubImage2D (tex->gl_target, 0, local_x, local_y, inter_w, inter_h, @@ -575,14 +566,20 @@ && local_x < x_span->size - x_span->waste && local_x + inter_w >= x_span->size - x_span->waste) { - const guchar *src = source_bmp->data - + (src_y + CLUTTER_FIXED_TO_INT (y_iter.intersect_start) - - dst_y) * source_bmp->rowstride - + (src_x + x_span->start + x_span->size - x_span->waste - - dst_x - 1) * bpp; - guchar *dst = waste_buf; + const guchar *src; + guchar *dst; guint wx, wy; + src = source_bmp->data + + (src_y + ((int)y_iter.intersect_start) + - dst_y) + * source_bmp->rowstride + + (src_x + x_span->start + x_span->size - x_span->waste + - dst_x - 1) + * bpp; + + dst = waste_buf; + for (wy = 0; wy < inter_h; wy++) { for (wx = 0; wx < x_span->waste; wx++) @@ -593,13 +590,14 @@ src += source_bmp->rowstride; } - _cogl_subregion_gl_store_rules (x_span->waste * bpp, - x_span->waste, - bpp, - 0, 0, FALSE); + prep_for_gl_pixels_upload (x_span->waste * bpp, + 0, /* src x */ + 0, /* src y */ + bpp); GE( glTexSubImage2D (tex->gl_target, 0, - x_span->size - x_span->waste, local_y, + x_span->size - x_span->waste, + local_y, x_span->waste, inter_h, source_gl_format, @@ -612,15 +610,21 @@ && local_y < y_span->size - y_span->waste && local_y + inter_h >= y_span->size - y_span->waste) { - const guchar *src = source_bmp->data - + (src_x + CLUTTER_FIXED_TO_INT (x_iter.intersect_start) - - dst_x) * bpp - + (src_y + y_span->start + y_span->size - y_span->waste - - dst_y - 1) * source_bmp->rowstride; - guchar *dst = waste_buf; + const guchar *src; + guchar *dst; guint wy, wx; guint copy_width; + src = source_bmp->data + + (src_x + ((int)x_iter.intersect_start) + - dst_x) + * bpp + + (src_y + y_span->start + y_span->size - y_span->waste + - dst_y - 1) + * source_bmp->rowstride; + + dst = waste_buf; + if (local_x + inter_w >= x_span->size - x_span->waste) copy_width = x_span->size - local_x; else @@ -638,13 +642,14 @@ } } - _cogl_subregion_gl_store_rules (copy_width * bpp, - copy_width, - bpp, - 0, 0, FALSE); + prep_for_gl_pixels_upload (copy_width * bpp, + 0, /* src x */ + 0, /* src y */ + bpp); GE( glTexSubImage2D (tex->gl_target, 0, - local_x, y_span->size - y_span->waste, + local_x, + y_span->size - y_span->waste, copy_width, y_span->waste, source_gl_format, @@ -668,12 +673,12 @@ { gint n_spans = 0; CoglTexSliceSpan span; - + /* Init first slice span */ span.start = 0; span.size = max_span_size; span.waste = 0; - + /* Repeat until whole area covered */ while (size_to_fill >= span.size) { @@ -683,7 +688,7 @@ size_to_fill -= span.size; n_spans++; } - + /* Add one last smaller slice span */ if (size_to_fill > 0) { @@ -691,7 +696,7 @@ if (out_spans) g_array_append_val (out_spans, span); n_spans++; } - + return n_spans; } @@ -703,15 +708,15 @@ { gint n_spans = 0; CoglTexSliceSpan span; - + /* Init first slice span */ span.start = 0; span.size = max_span_size; span.waste = 0; - + /* Fix invalid max_waste */ if (max_waste < 0) max_waste = 0; - + while (TRUE) { /* Is the whole area covered? */ @@ -740,7 +745,7 @@ } } } - + /* Can't get here */ return 0; } @@ -752,10 +757,10 @@ int width, int height) { -if (gl_target == GL_TEXTURE_2D) + if (gl_target == GL_TEXTURE_2D) { /* Proxy texture allows for a quick check for supported size */ - + GLint new_width = 0; GE( glTexImage2D (GL_PROXY_TEXTURE_2D, 0, GL_RGBA, @@ -774,9 +779,36 @@ } } +static void +_cogl_texture_set_wrap_mode_parameter (CoglTexture *tex, + GLenum wrap_mode) +{ + /* Only set the wrap mode if it's different from the current + value to avoid too many GL calls */ + if (tex->wrap_mode != wrap_mode) + { + int i; + + /* Any queued texture rectangles may be depending on the previous + * wrap mode... */ + _cogl_journal_flush (); + + for (i = 0; i < tex->slice_gl_handles->len; i++) + { + GLuint texnum = g_array_index (tex->slice_gl_handles, GLuint, i); + + GE( glBindTexture (tex->gl_target, texnum) ); + GE( glTexParameteri (tex->gl_target, GL_TEXTURE_WRAP_S, wrap_mode) ); + GE( glTexParameteri (tex->gl_target, GL_TEXTURE_WRAP_T, wrap_mode) ); + } + + tex->wrap_mode = wrap_mode; + } +} + static gboolean _cogl_texture_slices_create (CoglTexture *tex) -{ +{ gint bpp; gint max_width; gint max_height; @@ -788,12 +820,12 @@ CoglTexSliceSpan *x_span; CoglTexSliceSpan *y_span; const GLfloat transparent_color[4] = { 0x00, 0x00, 0x00, 0x00 }; - + gint (*slices_for_size) (gint, gint, gint, GArray*); - + bpp = _cogl_get_format_bpp (tex->bitmap.format); - - /* Initialize size of largest slice according to supported features*/ + + /* Initialize size of largest slice according to supported features */ if (cogl_features_available (COGL_FEATURE_TEXTURE_NPOT)) { max_width = tex->bitmap.width; @@ -808,12 +840,12 @@ tex->gl_target = GL_TEXTURE_2D; slices_for_size = _cogl_pot_slices_for_size; } - + /* Negative number means no slicing forced by the user */ if (tex->max_waste <= -1) { CoglTexSliceSpan span; - + /* Check if size supported else bail out */ if (!_cogl_texture_size_supported (tex->gl_target, tex->gl_format, @@ -823,25 +855,25 @@ { return FALSE; } - + n_x_slices = 1; n_y_slices = 1; - - /* Init span arrays */ + + /* Init span arrays */ tex->slice_x_spans = g_array_sized_new (FALSE, FALSE, sizeof (CoglTexSliceSpan), 1); - + tex->slice_y_spans = g_array_sized_new (FALSE, FALSE, sizeof (CoglTexSliceSpan), 1); - + /* Add a single span for width and height */ span.start = 0; span.size = max_width; span.waste = max_width - tex->bitmap.width; g_array_append_val (tex->slice_x_spans, span); - + span.size = max_height; span.waste = max_height - tex->bitmap.height; g_array_append_val (tex->slice_y_spans, span); @@ -860,73 +892,68 @@ max_width /= 2; else max_height /= 2; - + if (max_width == 0 || max_height == 0) return FALSE; } - + /* Determine the slices required to cover the bitmap area */ n_x_slices = slices_for_size (tex->bitmap.width, max_width, tex->max_waste, NULL); - + n_y_slices = slices_for_size (tex->bitmap.height, max_height, tex->max_waste, NULL); - + /* Init span arrays with reserved size */ tex->slice_x_spans = g_array_sized_new (FALSE, FALSE, sizeof (CoglTexSliceSpan), n_x_slices); - + tex->slice_y_spans = g_array_sized_new (FALSE, FALSE, sizeof (CoglTexSliceSpan), n_y_slices); - + /* Fill span arrays with info */ slices_for_size (tex->bitmap.width, max_width, tex->max_waste, tex->slice_x_spans); - + slices_for_size (tex->bitmap.height, max_height, tex->max_waste, tex->slice_y_spans); } - + /* Init and resize GL handle array */ n_slices = n_x_slices * n_y_slices; - + tex->slice_gl_handles = g_array_sized_new (FALSE, FALSE, sizeof (GLuint), n_slices); - + g_array_set_size (tex->slice_gl_handles, n_slices); - - - /* Hardware repeated tiling if supported, else tile in software*/ - if (cogl_features_available (COGL_FEATURE_TEXTURE_NPOT) - && n_slices == 1) - tex->wrap_mode = GL_REPEAT; - else - tex->wrap_mode = GL_CLAMP_TO_EDGE; - + + /* Wrap mode not yet set */ + tex->wrap_mode = GL_FALSE; + /* Generate a "working set" of GL texture objects * (some implementations might supported faster * re-binding between textures inside a set) */ gl_handles = (GLuint*) tex->slice_gl_handles->data; - + GE( glGenTextures (n_slices, gl_handles) ); - - + + /* Init each GL texture object */ for (y = 0; y < n_y_slices; ++y) { y_span = &g_array_index (tex->slice_y_spans, CoglTexSliceSpan, y); - + for (x = 0; x < n_x_slices; ++x) { x_span = &g_array_index (tex->slice_x_spans, CoglTexSliceSpan, x); - + #if COGL_DEBUG printf ("CREATE SLICE (%d,%d)\n", x,y); printf ("size: (%d x %d)\n", @@ -934,18 +961,17 @@ y_span->size - y_span->waste); #endif /* Setup texture parameters */ - GE( glBindTexture (tex->gl_target, gl_handles[y * n_x_slices + x]) ); - GE( glTexParameteri (tex->gl_target, GL_TEXTURE_MAG_FILTER, tex->mag_filter) ); - GE( glTexParameteri (tex->gl_target, GL_TEXTURE_MIN_FILTER, tex->min_filter) ); - - GE( glTexParameteri (tex->gl_target, GL_TEXTURE_WRAP_S, - tex->wrap_mode) ); - GE( glTexParameteri (tex->gl_target, GL_TEXTURE_WRAP_T, - tex->wrap_mode) ); - + GE( glBindTexture (tex->gl_target, + gl_handles[y * n_x_slices + x]) ); + GE( glTexParameteri (tex->gl_target, GL_TEXTURE_MAG_FILTER, + tex->mag_filter) ); + GE( glTexParameteri (tex->gl_target, GL_TEXTURE_MIN_FILTER, + tex->min_filter) ); + if (tex->auto_mipmap) - GE( glTexParameteri (tex->gl_target, GL_GENERATE_MIPMAP, GL_TRUE) ); - + GE( glTexParameteri (tex->gl_target, GL_GENERATE_MIPMAP, + GL_TRUE) ); + /* Use a transparent border color so that we can leave the color buffer alone when using texture co-ordinates outside of the texture */ @@ -958,19 +984,19 @@ tex->gl_format, tex->gl_type, 0) ); } } - + return TRUE; } static void _cogl_texture_slices_free (CoglTexture *tex) -{ +{ if (tex->slice_x_spans != NULL) g_array_free (tex->slice_x_spans, TRUE); - + if (tex->slice_y_spans != NULL) g_array_free (tex->slice_y_spans, TRUE); - + if (tex->slice_gl_handles != NULL) { if (tex->is_foreign == FALSE) @@ -978,11 +1004,25 @@ GE( glDeleteTextures (tex->slice_gl_handles->len, (GLuint*) tex->slice_gl_handles->data) ); } - + g_array_free (tex->slice_gl_handles, TRUE); } } +gboolean +_cogl_texture_span_has_waste (CoglTexture *tex, + gint x_span_index, + gint y_span_index) +{ + CoglTexSliceSpan *x_span; + CoglTexSliceSpan *y_span; + + x_span = &g_array_index (tex->slice_x_spans, CoglTexSliceSpan, x_span_index); + y_span = &g_array_index (tex->slice_y_spans, CoglTexSliceSpan, y_span_index); + + return (x_span->waste || y_span->waste) ? TRUE : FALSE; +} + static gboolean _cogl_pixel_format_from_gl_internal (GLenum gl_int_format, CoglPixelFormat *out_format) @@ -992,34 +1032,34 @@ is re-matched against cogl when getting or setting texture image data. */ - + switch (gl_int_format) { case GL_ALPHA: case GL_ALPHA4: case GL_ALPHA8: case GL_ALPHA12: case GL_ALPHA16: - + *out_format = COGL_PIXEL_FORMAT_A_8; return TRUE; - + case GL_LUMINANCE: case GL_LUMINANCE4: case GL_LUMINANCE8: case GL_LUMINANCE12: case GL_LUMINANCE16: - + *out_format = COGL_PIXEL_FORMAT_G_8; return TRUE; - + case GL_RGB: case GL_RGB4: case GL_RGB5: case GL_RGB8: case GL_RGB10: case GL_RGB12: case GL_RGB16: case GL_R3_G3_B2: - + *out_format = COGL_PIXEL_FORMAT_RGB_888; return TRUE; - + case GL_RGBA: case GL_RGBA2: case GL_RGBA4: case GL_RGB5_A1: case GL_RGBA8: case GL_RGB10_A2: case GL_RGBA12: case GL_RGBA16: - + *out_format = COGL_PIXEL_FORMAT_RGBA_8888; return TRUE; } - + return FALSE; } @@ -1033,17 +1073,17 @@ GLenum glintformat = 0; GLenum glformat = 0; GLenum gltype = 0; - + /* No premultiplied formats accepted by GL * (FIXME: latest hardware?) */ - + if (format & COGL_PREMULT_BIT) format = (format & COGL_UNPREMULT_MASK); - + /* Everything else accepted * (FIXME: check YUV support) */ required_format = format; - + /* Find GL equivalents */ switch (format) { @@ -1057,7 +1097,7 @@ glformat = GL_LUMINANCE; gltype = GL_UNSIGNED_BYTE; break; - + case COGL_PIXEL_FORMAT_RGB_888: glintformat = GL_RGB; glformat = GL_RGB; @@ -1078,7 +1118,7 @@ glformat = GL_BGRA; gltype = GL_UNSIGNED_BYTE; break; - + /* The following two types of channel ordering * have no GL equivalent unless defined using * system word byte ordering */ @@ -1091,7 +1131,7 @@ gltype = GL_UNSIGNED_INT_8_8_8_8_REV; #endif break; - + case COGL_PIXEL_FORMAT_ABGR_8888: glintformat = GL_RGBA; glformat = GL_RGBA; @@ -1101,7 +1141,7 @@ gltype = GL_UNSIGNED_INT_8_8_8_8_REV; #endif break; - + /* The following three types of channel ordering * are always defined using system word byte * ordering (even according to GLES spec) */ @@ -1120,19 +1160,19 @@ glformat = GL_RGBA; gltype = GL_UNSIGNED_SHORT_5_5_5_1; break; - + /* FIXME: check extensions for YUV support */ default: break; } - + if (out_glintformat != NULL) *out_glintformat = glintformat; if (out_glformat != NULL) *out_glformat = glformat; if (out_gltype != NULL) *out_gltype = gltype; - + return required_format; } @@ -1143,7 +1183,7 @@ CoglBitmap new_bitmap; CoglPixelFormat new_data_format; gboolean success; - + /* Was there any internal conversion requested? */ if (internal_format == COGL_PIXEL_FORMAT_ANY) internal_format = tex->bitmap.format; @@ -1153,21 +1193,21 @@ &tex->gl_intformat, &tex->gl_format, &tex->gl_type); - + /* Convert to internal format */ if (new_data_format != tex->bitmap.format) { success = _cogl_bitmap_convert_and_premult (&tex->bitmap, &new_bitmap, new_data_format); - + if (!success) return FALSE; - + /* Update texture with new data */ _cogl_texture_bitmap_swap (tex, &new_bitmap); } - + return TRUE; } @@ -1182,24 +1222,24 @@ } CoglHandle -cogl_texture_new_with_size (guint width, - guint height, - gint max_waste, - gboolean auto_mipmap, - CoglPixelFormat internal_format) +cogl_texture_new_with_size (guint width, + guint height, + gint max_waste, + CoglTextureFlags flags, + CoglPixelFormat internal_format) { CoglTexture *tex; gint bpp; gint rowstride; - + /* Since no data, we need some internal format */ if (internal_format == COGL_PIXEL_FORMAT_ANY) return COGL_INVALID_HANDLE; - + /* Rowstride from width */ bpp = _cogl_get_format_bpp (internal_format); rowstride = width * bpp; - + /* Init texture with empty bitmap */ tex = (CoglTexture*) g_malloc (sizeof (CoglTexture)); @@ -1207,160 +1247,144 @@ COGL_HANDLE_DEBUG_NEW (texture, tex); tex->is_foreign = FALSE; - tex->auto_mipmap = auto_mipmap; - + tex->auto_mipmap = ((flags & COGL_TEXTURE_AUTO_MIPMAP) != 0); + tex->bitmap.width = width; tex->bitmap.height = height; tex->bitmap.format = internal_format; tex->bitmap.rowstride = rowstride; tex->bitmap.data = NULL; tex->bitmap_owner = FALSE; - + tex->slice_x_spans = NULL; tex->slice_y_spans = NULL; tex->slice_gl_handles = NULL; - + tex->max_waste = max_waste; tex->min_filter = CGL_NEAREST; tex->mag_filter = CGL_NEAREST; - + /* Find closest GL format match */ tex->bitmap.format = _cogl_pixel_format_to_gl (internal_format, &tex->gl_intformat, &tex->gl_format, &tex->gl_type); - + /* Create slices for the given format and size */ if (!_cogl_texture_slices_create (tex)) { _cogl_texture_free (tex); return COGL_INVALID_HANDLE; } - + return _cogl_texture_handle_new (tex); } CoglHandle -cogl_texture_new_from_data (guint width, - guint height, - gint max_waste, - gboolean auto_mipmap, - CoglPixelFormat format, - CoglPixelFormat internal_format, - guint rowstride, - const guchar *data) +cogl_texture_new_from_data (guint width, + guint height, + gint max_waste, + CoglTextureFlags flags, + CoglPixelFormat format, + CoglPixelFormat internal_format, + guint rowstride, + const guchar *data) { CoglTexture *tex; gint bpp; - + if (format == COGL_PIXEL_FORMAT_ANY) return COGL_INVALID_HANDLE; - + if (data == NULL) return COGL_INVALID_HANDLE; - + /* Rowstride from width if not given */ bpp = _cogl_get_format_bpp (format); if (rowstride == 0) rowstride = width * bpp; - + /* Create new texture and fill with given data */ tex = (CoglTexture*) g_malloc (sizeof (CoglTexture)); - + tex->ref_count = 1; COGL_HANDLE_DEBUG_NEW (texture, tex); tex->is_foreign = FALSE; - tex->auto_mipmap = auto_mipmap; - + tex->auto_mipmap = ((flags & COGL_TEXTURE_AUTO_MIPMAP) != 0); + tex->bitmap.width = width; tex->bitmap.height = height; tex->bitmap.data = (guchar*)data; tex->bitmap.format = format; tex->bitmap.rowstride = rowstride; tex->bitmap_owner = FALSE; - + tex->slice_x_spans = NULL; tex->slice_y_spans = NULL; tex->slice_gl_handles = NULL; - + tex->max_waste = max_waste; tex->min_filter = CGL_NEAREST; tex->mag_filter = CGL_NEAREST; - + /* FIXME: If upload fails we should set some kind of * error flag but still return texture handle (this * is to keep the behavior equal to _new_from_file; * see below) */ - + if (!_cogl_texture_bitmap_prepare (tex, internal_format)) { _cogl_texture_free (tex); return COGL_INVALID_HANDLE; } - + if (!_cogl_texture_slices_create (tex)) { _cogl_texture_free (tex); return COGL_INVALID_HANDLE; } - + if (!_cogl_texture_upload_to_gl (tex)) { _cogl_texture_free (tex); return COGL_INVALID_HANDLE; } - + _cogl_texture_bitmap_free (tex); - + return _cogl_texture_handle_new (tex); } CoglHandle -cogl_texture_new_from_file (const gchar *filename, - gint max_waste, - gboolean auto_mipmap, - CoglPixelFormat internal_format, - GError **error) +cogl_texture_new_from_bitmap (CoglBitmap *bmp, + gint max_waste, + CoglTextureFlags flags, + CoglPixelFormat internal_format) { - CoglBitmap bmp; CoglTexture *tex; - - g_return_val_if_fail (error == NULL || *error == NULL, COGL_INVALID_HANDLE); - /* Try loading with imaging backend */ - if (!_cogl_bitmap_from_file (&bmp, filename, error)) - { - /* Try fallback */ - if (!_cogl_bitmap_fallback_from_file (&bmp, filename)) - return COGL_INVALID_HANDLE; - else if (error && *error) - { - g_error_free (*error); - *error = NULL; - } - } - /* Create new texture and fill with loaded data */ tex = (CoglTexture*) g_malloc ( sizeof (CoglTexture)); - + tex->ref_count = 1; COGL_HANDLE_DEBUG_NEW (texture, tex); - + tex->is_foreign = FALSE; - tex->auto_mipmap = auto_mipmap; - - tex->bitmap = bmp; + tex->auto_mipmap = ((flags & COGL_TEXTURE_AUTO_MIPMAP) != 0); + + tex->bitmap = *bmp; tex->bitmap_owner = TRUE; - + bmp->data = NULL; + tex->slice_x_spans = NULL; tex->slice_y_spans = NULL; tex->slice_gl_handles = NULL; - + tex->max_waste = max_waste; tex->min_filter = CGL_NEAREST; tex->mag_filter = CGL_NEAREST; - + /* FIXME: If upload fails we should set some kind of * error flag but still return texture handle if the * user decides to destroy another texture and upload @@ -1368,31 +1392,55 @@ * in that case). As a rule then, everytime a valid * CoglHandle is returned, it should also be destroyed * with cogl_texture_unref at some point! */ - + if (!_cogl_texture_bitmap_prepare (tex, internal_format)) { _cogl_texture_free (tex); return COGL_INVALID_HANDLE; } - + if (!_cogl_texture_slices_create (tex)) { _cogl_texture_free (tex); return COGL_INVALID_HANDLE; } - + if (!_cogl_texture_upload_to_gl (tex)) { _cogl_texture_free (tex); return COGL_INVALID_HANDLE; } - + _cogl_texture_bitmap_free (tex); - + return _cogl_texture_handle_new (tex); } CoglHandle +cogl_texture_new_from_file (const gchar *filename, + gint max_waste, + CoglTextureFlags flags, + CoglPixelFormat internal_format, + GError **error) +{ + CoglBitmap *bmp; + CoglHandle handle; + + g_return_val_if_fail (error == NULL || *error == NULL, COGL_INVALID_HANDLE); + + if (!(bmp = cogl_bitmap_new_from_file (filename, error))) + return COGL_INVALID_HANDLE; + + handle = cogl_texture_new_from_bitmap (bmp, + max_waste, + flags, + internal_format); + cogl_bitmap_free (bmp); + + return handle; +} + +CoglHandle cogl_texture_new_from_foreign (GLuint gl_handle, GLenum gl_target, GLuint width, @@ -1402,12 +1450,12 @@ CoglPixelFormat format) { /* NOTE: width, height and internal format are not queriable - in GLES, hence such a function prototype. However, here - they are still queried from the texture for improved - robustness and for completeness in case GLES 1.0 gets - unsupported in favor of a new version and cleaner api + in GLES, hence such a function prototype. However, for + OpenGL they are still queried from the texture for improved + robustness and for completeness in case one day GLES gains + support for them. */ - + GLenum gl_error = 0; GLboolean gl_istexture; GLint gl_compressed = GL_FALSE; @@ -1421,144 +1469,135 @@ CoglTexture *tex; CoglTexSliceSpan x_span; CoglTexSliceSpan y_span; - - /* Allow 2-dimensional textures only */ - if (gl_target != GL_TEXTURE_2D) + + /* GL_ARB_texture_rectangle textures are supported if they are + created from foreign because some chipsets have trouble with + GL_ARB_texture_non_power_of_two. There is no Cogl call to create + them directly to emphasize the fact that they don't work fully + (for example, no mipmapping and complicated shader support) */ + + /* Allow 2-dimensional or rectangle textures only */ + if (gl_target != GL_TEXTURE_2D && gl_target != CGL_TEXTURE_RECTANGLE_ARB) return COGL_INVALID_HANDLE; - + /* Make sure it is a valid GL texture object */ gl_istexture = glIsTexture (gl_handle); if (gl_istexture == GL_FALSE) return COGL_INVALID_HANDLE; - + /* Make sure binding succeeds */ gl_error = glGetError (); glBindTexture (gl_target, gl_handle); if (glGetError () != GL_NO_ERROR) return COGL_INVALID_HANDLE; - + /* Obtain texture parameters (only level 0 we are interested in) */ - + GE( glGetTexLevelParameteriv (gl_target, 0, GL_TEXTURE_COMPRESSED, &gl_compressed) ); - + GE( glGetTexLevelParameteriv (gl_target, 0, GL_TEXTURE_INTERNAL_FORMAT, &gl_int_format) ); - + GE( glGetTexLevelParameteriv (gl_target, 0, GL_TEXTURE_WIDTH, &gl_width) ); - + GE( glGetTexLevelParameteriv (gl_target, 0, GL_TEXTURE_HEIGHT, &gl_height) ); - + GE( glGetTexParameteriv (gl_target, GL_TEXTURE_MIN_FILTER, &gl_min_filter) ); - + GE( glGetTexParameteriv (gl_target, GL_TEXTURE_MAG_FILTER, &gl_mag_filter) ); - + GE( glGetTexParameteriv (gl_target, GL_GENERATE_MIPMAP, &gl_gen_mipmap) ); - + /* Validate width and height */ if (gl_width <= 0 || gl_height <= 0) return COGL_INVALID_HANDLE; - + /* Validate pot waste */ if (x_pot_waste < 0 || x_pot_waste >= gl_width || y_pot_waste < 0 || y_pot_waste >= gl_height) return COGL_INVALID_HANDLE; - + /* Compressed texture images not supported */ if (gl_compressed == GL_TRUE) return COGL_INVALID_HANDLE; - + /* Try and match to a cogl format */ if (!_cogl_pixel_format_from_gl_internal (gl_int_format, &format)) { return COGL_INVALID_HANDLE; } - - bpp = _cogl_get_format_bpp (format); - + /* Create new texture */ tex = (CoglTexture*) g_malloc ( sizeof (CoglTexture)); - + tex->ref_count = 1; COGL_HANDLE_DEBUG_NEW (texture, tex); - + /* Setup bitmap info */ tex->is_foreign = TRUE; tex->auto_mipmap = (gl_gen_mipmap == GL_TRUE) ? TRUE : FALSE; - + + bpp = _cogl_get_format_bpp (format); tex->bitmap.format = format; tex->bitmap.width = gl_width - x_pot_waste; tex->bitmap.height = gl_height - y_pot_waste; tex->bitmap.rowstride = tex->bitmap.width * bpp; tex->bitmap_owner = FALSE; - + tex->gl_target = gl_target; tex->gl_intformat = gl_int_format; tex->gl_format = gl_int_format; tex->gl_type = GL_UNSIGNED_BYTE; - + tex->min_filter = gl_min_filter; tex->mag_filter = gl_mag_filter; tex->max_waste = 0; - + + /* Wrap mode not yet set */ + tex->wrap_mode = GL_FALSE; + /* Create slice arrays */ tex->slice_x_spans = g_array_sized_new (FALSE, FALSE, sizeof (CoglTexSliceSpan), 1); - + tex->slice_y_spans = g_array_sized_new (FALSE, FALSE, sizeof (CoglTexSliceSpan), 1); - + tex->slice_gl_handles = g_array_sized_new (FALSE, FALSE, sizeof (GLuint), 1); - + /* Store info for a single slice */ x_span.start = 0; x_span.size = gl_width; x_span.waste = x_pot_waste; g_array_append_val (tex->slice_x_spans, x_span); - + y_span.start = 0; y_span.size = gl_height; y_span.waste = y_pot_waste; g_array_append_val (tex->slice_y_spans, y_span); - + g_array_append_val (tex->slice_gl_handles, gl_handle); - - /* Force appropriate wrap parameter */ - if (cogl_features_available (COGL_FEATURE_TEXTURE_NPOT) && - gl_target == GL_TEXTURE_2D) - { - /* Hardware repeated tiling */ - tex->wrap_mode = GL_REPEAT; - GE( glTexParameteri (tex->gl_target, GL_TEXTURE_WRAP_S, GL_REPEAT) ); - GE( glTexParameteri (tex->gl_target, GL_TEXTURE_WRAP_T, GL_REPEAT) ); - } - else - { - /* Any tiling will be done in software */ - tex->wrap_mode = GL_CLAMP_TO_EDGE; - GE( glTexParameteri (tex->gl_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE) ); - GE( glTexParameteri (tex->gl_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE) ); - } - + return _cogl_texture_handle_new (tex); } @@ -1566,12 +1605,12 @@ cogl_texture_get_width (CoglHandle handle) { CoglTexture *tex; - + if (!cogl_is_texture (handle)) return 0; - + tex = _cogl_texture_pointer_from_handle (handle); - + return tex->bitmap.width; } @@ -1579,12 +1618,12 @@ cogl_texture_get_height (CoglHandle handle) { CoglTexture *tex; - + if (!cogl_is_texture (handle)) return 0; - + tex = _cogl_texture_pointer_from_handle (handle); - + return tex->bitmap.height; } @@ -1592,12 +1631,12 @@ cogl_texture_get_format (CoglHandle handle) { CoglTexture *tex; - + if (!cogl_is_texture (handle)) return COGL_PIXEL_FORMAT_ANY; - + tex = _cogl_texture_pointer_from_handle (handle); - + return tex->bitmap.format; } @@ -1605,12 +1644,12 @@ cogl_texture_get_rowstride (CoglHandle handle) { CoglTexture *tex; - + if (!cogl_is_texture (handle)) return 0; - + tex = _cogl_texture_pointer_from_handle (handle); - + return tex->bitmap.rowstride; } @@ -1618,12 +1657,12 @@ cogl_texture_get_max_waste (CoglHandle handle) { CoglTexture *tex; - + if (!cogl_is_texture (handle)) return 0; - + tex = _cogl_texture_pointer_from_handle (handle); - + return tex->max_waste; } @@ -1631,18 +1670,18 @@ cogl_texture_is_sliced (CoglHandle handle) { CoglTexture *tex; - + if (!cogl_is_texture (handle)) return FALSE; - + tex = _cogl_texture_pointer_from_handle (handle); - + if (tex->slice_gl_handles == NULL) return FALSE; - + if (tex->slice_gl_handles->len <= 1) return FALSE; - + return TRUE; } @@ -1652,24 +1691,24 @@ GLenum *out_gl_target) { CoglTexture *tex; - + if (!cogl_is_texture (handle)) return FALSE; - + tex = _cogl_texture_pointer_from_handle (handle); - + if (tex->slice_gl_handles == NULL) return FALSE; - + if (tex->slice_gl_handles->len < 1) return FALSE; - + if (out_gl_handle != NULL) *out_gl_handle = g_array_index (tex->slice_gl_handles, GLuint, 0); - + if (out_gl_target != NULL) *out_gl_target = tex->gl_target; - + return TRUE; } @@ -1677,12 +1716,12 @@ cogl_texture_get_min_filter (CoglHandle handle) { CoglTexture *tex; - + if (!cogl_is_texture (handle)) return 0; - + tex = _cogl_texture_pointer_from_handle (handle); - + return tex->min_filter; } @@ -1690,12 +1729,12 @@ cogl_texture_get_mag_filter (CoglHandle handle) { CoglTexture *tex; - + if (!cogl_is_texture (handle)) return 0; - + tex = _cogl_texture_pointer_from_handle (handle); - + return tex->mag_filter; } @@ -1707,27 +1746,29 @@ CoglTexture *tex; GLuint gl_handle; int i; - + if (!cogl_is_texture (handle)) return; - + tex = _cogl_texture_pointer_from_handle (handle); - + /* Store new values */ tex->min_filter = min_filter; tex->mag_filter = mag_filter; - + /* Make sure slices were created */ if (tex->slice_gl_handles == NULL) return; - + /* Apply new filters to every slice */ for (i=0; islice_gl_handles->len; ++i) { gl_handle = g_array_index (tex->slice_gl_handles, GLuint, i); - GE( glBindTexture (tex->gl_target, gl_handle) ); - GE( glTexParameteri (tex->gl_target, GL_TEXTURE_MAG_FILTER, tex->mag_filter) ); - GE( glTexParameteri (tex->gl_target, GL_TEXTURE_MIN_FILTER, tex->min_filter) ); + GE( glBindTexture (tex->gl_target, gl_handle) ); + GE( glTexParameteri (tex->gl_target, GL_TEXTURE_MAG_FILTER, + tex->mag_filter) ); + GE( glTexParameteri (tex->gl_target, GL_TEXTURE_MIN_FILTER, + tex->min_filter) ); } } @@ -1754,37 +1795,37 @@ GLenum closest_gl_format; GLenum closest_gl_type; gboolean success; - + /* Check if valid texture handle */ if (!cogl_is_texture (handle)) return FALSE; - + tex = _cogl_texture_pointer_from_handle (handle); - + /* Check for valid format */ if (format == COGL_PIXEL_FORMAT_ANY) return FALSE; - + /* Shortcut out early if the image is empty */ if (width == 0 || height == 0) return TRUE; - + /* Init source bitmap */ source_bmp.width = width; source_bmp.height = height; source_bmp.format = format; source_bmp.data = (guchar*)data; - + /* Rowstride from width if none specified */ bpp = _cogl_get_format_bpp (format); source_bmp.rowstride = (rowstride == 0) ? width * bpp : rowstride; - + /* Find closest format to internal that's supported by GL */ closest_format = _cogl_pixel_format_to_gl (tex->bitmap.format, NULL, /* don't need */ &closest_gl_format, &closest_gl_type); - + /* If no direct match, convert */ if (closest_format != format) { @@ -1792,13 +1833,13 @@ success = _cogl_bitmap_convert_and_premult (&source_bmp, &temp_bmp, closest_format); - + /* Swap bitmaps if succeeded */ if (!success) return FALSE; source_bmp = temp_bmp; source_bmp_owner = TRUE; } - + /* Send data to GL */ _cogl_texture_upload_subregion_to_gl (tex, src_x, src_y, @@ -1807,11 +1848,11 @@ &source_bmp, closest_gl_format, closest_gl_type); - + /* Free data if owner */ if (source_bmp_owner) g_free (source_bmp.data); - + return TRUE; } @@ -1834,33 +1875,33 @@ guchar *src; guchar *dst; gint y; - + /* Check if valid texture handle */ if (!cogl_is_texture (handle)) return 0; - + tex = _cogl_texture_pointer_from_handle (handle); - + /* Default to internal format if none specified */ if (format == COGL_PIXEL_FORMAT_ANY) format = tex->bitmap.format; - + /* Rowstride from texture width if none specified */ bpp = _cogl_get_format_bpp (format); if (rowstride == 0) rowstride = tex->bitmap.width * bpp; - + /* Return byte size if only that requested */ byte_size = tex->bitmap.height * rowstride; if (data == NULL) return byte_size; - + /* Find closest format that's supported by GL */ closest_format = _cogl_pixel_format_to_gl (format, NULL, /* don't need */ &closest_gl_format, &closest_gl_type); - + closest_bpp = _cogl_get_format_bpp (closest_format); - + /* Is the requested format supported? */ if (closest_format == format) { @@ -1879,12 +1920,12 @@ target_bmp.data = (guchar*) g_malloc (target_bmp.height * target_bmp.rowstride); } - + /* Retrieve data from slices */ _cogl_texture_download_from_gl (tex, &target_bmp, closest_gl_format, closest_gl_type); - + /* Was intermediate used? */ if (closest_format != format) { @@ -1892,11 +1933,11 @@ success = _cogl_bitmap_convert_and_premult (&target_bmp, &new_bmp, format); - + /* Free intermediate data and return if failed */ g_free (target_bmp.data); if (!success) return 0; - + /* Copy to user buffer */ for (y = 0; y < new_bmp.height; ++y) { @@ -1904,365 +1945,906 @@ dst = data + y * rowstride; memcpy (dst, src, new_bmp.width); } - + /* Free converted data */ g_free (new_bmp.data); } - + return byte_size; } + +/****************************************************************************** + * XXX: Here ends the code that strictly implements "CoglTextures". + * + * The following consists of code for rendering rectangles and polygons. It + * might be neater to move this code somewhere else. I think everything below + * here should be implementable without access to CoglTexture internals, but + * that will at least mean exposing the cogl_span_iter_* funcs. + */ + static void -_cogl_texture_quad_sw (CoglTexture *tex, - ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2, - ClutterFixed tx1, - ClutterFixed ty1, - ClutterFixed tx2, - ClutterFixed ty2) -{ - CoglSpanIter iter_x , iter_y; - ClutterFixed tw , th; - ClutterFixed tqx , tqy; - ClutterFixed first_tx , first_ty; - ClutterFixed first_qx , first_qy; - ClutterFixed slice_tx1 , slice_ty1; - ClutterFixed slice_tx2 , slice_ty2; - ClutterFixed slice_qx1 , slice_qy1; - ClutterFixed slice_qx2 , slice_qy2; - GLuint gl_handle; - gulong enable_flags = 0; - +_cogl_journal_flush_quad_batch (CoglJournalEntry *batch_start, + gint batch_len, + GLfloat *vertex_pointer) +{ + int needed_indices; + gsize stride; + int i; + gulong enable_flags = 0; + guint32 disable_mask; + int prev_n_texcoord_arrays_enabled; + _COGL_GET_CONTEXT (ctx, NO_RETVAL); - -#if COGL_DEBUG - printf("=== Drawing Tex Quad (Software Tiling Mode) ===\n"); -#endif - - /* Prepare GL state */ - enable_flags |= COGL_ENABLE_TEXTURE_2D; - - if (ctx->color_alpha < 255 - || tex->bitmap.format & COGL_A_BIT) - { - enable_flags |= COGL_ENABLE_BLEND; + + /* The indices are always the same sequence regardless of the vertices so we + * only need to change it if there are more vertices than ever before. */ + needed_indices = batch_len * 6; + if (needed_indices > ctx->static_indices->len) + { + int old_len = ctx->static_indices->len; + int vert_num = old_len / 6 * 4; + GLushort *q; + + /* Add two triangles for each quad to the list of + indices. That makes six new indices but two of the + vertices in the triangles are shared. */ + g_array_set_size (ctx->static_indices, needed_indices); + q = &g_array_index (ctx->static_indices, GLushort, old_len); + + for (i = old_len; + i < ctx->static_indices->len; + i += 6, vert_num += 4) + { + *(q++) = vert_num + 0; + *(q++) = vert_num + 1; + *(q++) = vert_num + 3; + + *(q++) = vert_num + 1; + *(q++) = vert_num + 2; + *(q++) = vert_num + 3; + } } - + + /* XXX NB: + * Our vertex data is arranged as follows: + * 4 vertices per quad: 2 GLfloats per position, + * 2 GLfloats per tex coord * n_layers + */ + stride = 2 + 2 * batch_start->n_layers; + stride *= sizeof (GLfloat); + + disable_mask = (1 << batch_start->n_layers) - 1; + disable_mask = ~disable_mask; + + cogl_material_flush_gl_state (ctx->source_material, + COGL_MATERIAL_FLUSH_FALLBACK_MASK, + batch_start->fallback_mask, + COGL_MATERIAL_FLUSH_DISABLE_MASK, + disable_mask, + /* Redundant when dealing with unsliced + * textures but does no harm... */ + COGL_MATERIAL_FLUSH_LAYER0_OVERRIDE, + batch_start->layer0_override_texture, + NULL); + + for (i = 0; i < batch_start->n_layers; i++) + { + GE (glClientActiveTexture (GL_TEXTURE0 + i)); + GE (glEnableClientState (GL_TEXTURE_COORD_ARRAY)); + GE (glTexCoordPointer (2, GL_FLOAT, stride, vertex_pointer + 2 + 2 * i)); + } + prev_n_texcoord_arrays_enabled = + ctx->n_texcoord_arrays_enabled; + ctx->n_texcoord_arrays_enabled = i + 1; + for (; i < prev_n_texcoord_arrays_enabled; i++) + { + GE (glClientActiveTexture (GL_TEXTURE0 + i)); + GE (glDisableClientState (GL_TEXTURE_COORD_ARRAY)); + } + + /* FIXME: This api is a bit yukky, ideally it will be removed if we + * re-work the cogl_enable mechanism */ + enable_flags |= cogl_material_get_cogl_enable_flags (ctx->source_material); + + if (ctx->enable_backface_culling) + enable_flags |= COGL_ENABLE_BACKFACE_CULLING; + + enable_flags |= COGL_ENABLE_VERTEX_ARRAY; cogl_enable (enable_flags); - + + GE (glVertexPointer (2, GL_FLOAT, stride, vertex_pointer)); + + GE (glDrawRangeElements (GL_TRIANGLES, + 0, ctx->static_indices->len - 1, + 6 * batch_len, + GL_UNSIGNED_SHORT, + ctx->static_indices->data)); + + + /* DEBUGGING CODE XXX: + * Uncommenting this will cause all rectangles to be drawn with a red, green + * or blue outline with no blending. This may e.g. help with debugging + * texture slicing issues or blending issues, plus it looks quite cool. + */ +#if 0 + { + static CoglHandle outline = COGL_INVALID_HANDLE; + static int color = 0; + if (outline == COGL_INVALID_HANDLE) + outline = cogl_material_new (); + + cogl_enable (COGL_ENABLE_VERTEX_ARRAY); + for (i = 0; i < batch_len; i++, color = (++color) % 3) + { + cogl_material_set_color4ub (outline, + color == 0 ? 0xff : 0x00, + color == 1 ? 0xff : 0x00, + color == 2 ? 0xff : 0x00, + 0xff); + cogl_material_flush_gl_state (outline, NULL); + GE( glDrawArrays (GL_LINE_LOOP, 4 * i, 4) ); + } + } +#endif +} + +static void +_cogl_journal_flush (void) +{ + GLfloat *current_vertex_pointer; + GLfloat *batch_vertex_pointer; + CoglJournalEntry *batch_start; + guint batch_len; + int i; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + if (ctx->journal->len == 0) + return; + + /* Current non-variables / constraints: + * + * - We don't have to worry about much GL state changing between journal + * entries since currently the journal never out lasts a single call to + * _cogl_multitexture_multiple_rectangles. So the user doesn't get the + * chance to fiddle with anything. (XXX: later this will be extended at + * which point we can start logging certain state changes) + * + * - Implied from above: all entries will refer to the same material. + * + * - Although _cogl_multitexture_multiple_rectangles can cause the wrap mode + * of textures to be modified, the journal is flushed if a wrap mode is + * changed so we don't currently have to log wrap mode changes. + * + * - XXX - others? + */ + + /* TODO: "compile" the journal to find ways of batching draw calls and vertex + * data. + * + * Simple E.g. given current constraints... + * pass 0 - load all data into a single CoglVertexBuffer + * pass 1 - batch gl draw calls according to entries that use the same + * textures. + * + * We will be able to do cooler stuff here when we extend the life of + * journals beyond _cogl_multitexture_multiple_rectangles. + */ + + batch_vertex_pointer = (GLfloat *)ctx->logged_vertices->data; + batch_start = (CoglJournalEntry *)ctx->journal->data; + batch_len = 1; + + current_vertex_pointer = batch_vertex_pointer; + + for (i = 1; i < ctx->journal->len; i++) + { + CoglJournalEntry *prev_entry = + &g_array_index (ctx->journal, CoglJournalEntry, i - 1); + CoglJournalEntry *current_entry = prev_entry + 1; + gsize stride; + + /* Progress the vertex pointer */ + stride = 2 + current_entry->n_layers * 2; + current_vertex_pointer += stride; + + /* batch rectangles using the same textures */ + if (current_entry->material == prev_entry->material && + current_entry->n_layers == prev_entry->n_layers && + current_entry->fallback_mask == prev_entry->fallback_mask && + current_entry->layer0_override_texture + == prev_entry->layer0_override_texture) + { + batch_len++; + continue; + } + + _cogl_journal_flush_quad_batch (batch_start, + batch_len, + batch_vertex_pointer); + + batch_start = current_entry; + batch_len = 1; + batch_vertex_pointer = current_vertex_pointer; + } + + /* The last batch... */ + _cogl_journal_flush_quad_batch (batch_start, + batch_len, + batch_vertex_pointer); + + + g_array_set_size (ctx->journal, 0); + g_array_set_size (ctx->logged_vertices, 0); +} + +static void +_cogl_journal_log_quad (float x_1, + float y_1, + float x_2, + float y_2, + CoglHandle material, + gint n_layers, + guint32 fallback_mask, + GLuint layer0_override_texture, + float *tex_coords, + guint tex_coords_len) +{ + int stride; + int next_vert; + GLfloat *v; + int i; + int next_entry; + CoglJournalEntry *entry; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + /* The vertex data is logged into a seperate array in a layout that can be + * directly passed to OpenGL + */ + + /* We pack the vertex data as 2 (x,y) GLfloats folowed by 2 (tx,ty) GLfloats + * for each texture being used, E.g.: + * [X, Y, TX0, TY0, TX1, TY1, X, Y, TX0, TY0, X, Y, ...] + */ + stride = 2 + n_layers * 2; + + next_vert = ctx->logged_vertices->len; + g_array_set_size (ctx->logged_vertices, next_vert + 4 * stride); + v = &g_array_index (ctx->logged_vertices, GLfloat, next_vert); + + /* XXX: All the jumping around to fill in this strided buffer doesn't + * seem ideal. */ + + /* XXX: we could defer expanding the vertex data for GL until we come + * to flushing the journal. */ + + v[0] = x_1; v[1] = y_1; + v += stride; + v[0] = x_1; v[1] = y_2; + v += stride; + v[0] = x_2; v[1] = y_2; + v += stride; + v[0] = x_2; v[1] = y_1; + + for (i = 0; i < n_layers; i++) + { + GLfloat *t = + &g_array_index (ctx->logged_vertices, GLfloat, next_vert + 2 + 2 * i); + + t[0] = tex_coords[0]; t[1] = tex_coords[1]; + t += stride; + t[0] = tex_coords[0]; t[1] = tex_coords[3]; + t += stride; + t[0] = tex_coords[2]; t[1] = tex_coords[3]; + t += stride; + t[0] = tex_coords[2]; t[1] = tex_coords[1]; + } + + next_entry = ctx->journal->len; + g_array_set_size (ctx->journal, next_entry + 1); + entry = &g_array_index (ctx->journal, CoglJournalEntry, next_entry); + + entry->material = material; + entry->n_layers = n_layers; + entry->fallback_mask = fallback_mask; + entry->layer0_override_texture = layer0_override_texture; +} + +static void +_cogl_texture_sliced_quad (CoglTexture *tex, + CoglHandle material, + float x_1, + float y_1, + float x_2, + float y_2, + float tx_1, + float ty_1, + float tx_2, + float ty_2) +{ + CoglSpanIter iter_x , iter_y; + float tw , th; + float tqx , tqy; + float first_tx , first_ty; + float first_qx , first_qy; + float slice_tx1 , slice_ty1; + float slice_tx2 , slice_ty2; + float slice_qx1 , slice_qy1; + float slice_qx2 , slice_qy2; + GLuint gl_handle; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + +#if COGL_DEBUG + printf("=== Drawing Tex Quad (Sliced Mode) ===\n"); +#endif + + /* We can't use hardware repeat so we need to set clamp to edge + otherwise it might pull in edge pixels from the other side */ + _cogl_texture_set_wrap_mode_parameter (tex, GL_CLAMP_TO_EDGE); + /* If the texture coordinates are backwards then swap both the geometry and texture coordinates so that the texture will be flipped but we can still use the same algorithm to iterate the slices */ - if (tx2 < tx1) + if (tx_2 < tx_1) { - ClutterFixed temp = x1; - x1 = x2; - x2 = temp; - temp = tx1; - tx1 = tx2; - tx2 = temp; - } - if (ty2 < ty1) - { - ClutterFixed temp = y1; - y1 = y2; - y2 = temp; - temp = ty1; - ty1 = ty2; - ty2 = temp; + float temp = x_1; + x_1 = x_2; + x_2 = temp; + temp = tx_1; + tx_1 = tx_2; + tx_2 = temp; + } + if (ty_2 < ty_1) + { + float temp = y_1; + y_1 = y_2; + y_2 = temp; + temp = ty_1; + ty_1 = ty_2; + ty_2 = temp; } - + /* Scale ratio from texture to quad widths */ - tw = CLUTTER_INT_TO_FIXED (tex->bitmap.width); - th = CLUTTER_INT_TO_FIXED (tex->bitmap.height); - - tqx = CFX_QDIV (x2-x1, CFX_QMUL (tw, (tx2 - tx1))); - tqy = CFX_QDIV (y2-y1, CFX_QMUL (th, (ty2 - ty1))); + tw = (float)(tex->bitmap.width); + th = (float)(tex->bitmap.height); + + tqx = (x_2 - x_1) / (tw * (tx_2 - tx_1)); + tqy = (y_2 - y_1) / (th * (ty_2 - ty_1)); /* Integral texture coordinate for first tile */ - first_tx = CLUTTER_INT_TO_FIXED (CLUTTER_FIXED_FLOOR (tx1)); - first_ty = CLUTTER_INT_TO_FIXED (CLUTTER_FIXED_FLOOR (ty1)); - + first_tx = (float)(floorf (tx_1)); + first_ty = (float)(floorf (ty_1)); + /* Denormalize texture coordinates */ - first_tx = CFX_QMUL (first_tx, tw); - first_ty = CFX_QMUL (first_ty, th); - tx1 = CFX_QMUL (tx1, tw); - ty1 = CFX_QMUL (ty1, th); - tx2 = CFX_QMUL (tx2, tw); - ty2 = CFX_QMUL (ty2, th); + first_tx = (first_tx * tw); + first_ty = (first_ty * th); + tx_1 = (tx_1 * tw); + ty_1 = (ty_1 * th); + tx_2 = (tx_2 * tw); + ty_2 = (ty_2 * th); /* Quad coordinate of the first tile */ - first_qx = x1 - CFX_QMUL (tx1 - first_tx, tqx); - first_qy = y1 - CFX_QMUL (ty1 - first_ty, tqy); - - + first_qx = x_1 - (tx_1 - first_tx) * tqx; + first_qy = y_1 - (ty_1 - first_ty) * tqy; + + /* Iterate until whole quad height covered */ for (_cogl_span_iter_begin (&iter_y, tex->slice_y_spans, - first_ty, ty1, ty2) ; + first_ty, ty_1, ty_2) ; !_cogl_span_iter_end (&iter_y) ; _cogl_span_iter_next (&iter_y) ) - { + { + float tex_coords[4]; + /* Discard slices out of quad early */ if (!iter_y.intersects) continue; - + /* Span-quad intersection in quad coordinates */ - slice_qy1 = first_qy + - CFX_QMUL (iter_y.intersect_start - first_ty, tqy); - - slice_qy2 = first_qy + - CFX_QMUL (iter_y.intersect_end - first_ty, tqy); - + slice_qy1 = first_qy + (iter_y.intersect_start - first_ty) * tqy; + + slice_qy2 = first_qy + (iter_y.intersect_end - first_ty) * tqy; + /* Localize slice texture coordinates */ slice_ty1 = iter_y.intersect_start - iter_y.pos; slice_ty2 = iter_y.intersect_end - iter_y.pos; - + /* Normalize texture coordinates to current slice (rectangle texture targets take denormalized) */ - slice_ty1 /= iter_y.span->size; - slice_ty2 /= iter_y.span->size; - - + if (tex->gl_target != CGL_TEXTURE_RECTANGLE_ARB) + { + slice_ty1 /= iter_y.span->size; + slice_ty2 /= iter_y.span->size; + } + /* Iterate until whole quad width covered */ for (_cogl_span_iter_begin (&iter_x, tex->slice_x_spans, - first_tx, tx1, tx2) ; + first_tx, tx_1, tx_2) ; !_cogl_span_iter_end (&iter_x) ; _cogl_span_iter_next (&iter_x) ) { /* Discard slices out of quad early */ if (!iter_x.intersects) continue; - + /* Span-quad intersection in quad coordinates */ - slice_qx1 = first_qx + - CFX_QMUL (iter_x.intersect_start - first_tx, tqx); - - slice_qx2 = first_qx + - CFX_QMUL (iter_x.intersect_end - first_tx, tqx); - + slice_qx1 = first_qx + (iter_x.intersect_start - first_tx) * tqx; + + slice_qx2 = first_qx + (iter_x.intersect_end - first_tx) * tqx; + /* Localize slice texture coordinates */ slice_tx1 = iter_x.intersect_start - iter_x.pos; slice_tx2 = iter_x.intersect_end - iter_x.pos; - + /* Normalize texture coordinates to current slice (rectangle texture targets take denormalized) */ - slice_tx1 /= iter_x.span->size; - slice_tx2 /= iter_x.span->size; - + if (tex->gl_target != CGL_TEXTURE_RECTANGLE_ARB) + { + slice_tx1 /= iter_x.span->size; + slice_tx2 /= iter_x.span->size; + } + #if COGL_DEBUG printf("~~~~~ slice (%d,%d)\n", iter_x.index, iter_y.index); - printf("qx1: %f\n", CLUTTER_FIXED_TO_FLOAT (slice_qx1)); - printf("qy1: %f\n", CLUTTER_FIXED_TO_FLOAT (slice_qy1)); - printf("qx2: %f\n", CLUTTER_FIXED_TO_FLOAT (slice_qx2)); - printf("qy2: %f\n", CLUTTER_FIXED_TO_FLOAT (slice_qy2)); - printf("tx1: %f\n", CLUTTER_FIXED_TO_FLOAT (slice_tx1)); - printf("ty1: %f\n", CLUTTER_FIXED_TO_FLOAT (slice_ty1)); - printf("tx2: %f\n", CLUTTER_FIXED_TO_FLOAT (slice_tx2)); - printf("ty2: %f\n", CLUTTER_FIXED_TO_FLOAT (slice_ty2)); + printf("qx1: %f\n", (slice_qx1)); + printf("qy1: %f\n", (slice_qy1)); + printf("qx2: %f\n", (slice_qx2)); + printf("qy2: %f\n", (slice_qy2)); + printf("tx1: %f\n", (slice_tx1)); + printf("ty1: %f\n", (slice_ty1)); + printf("tx2: %f\n", (slice_tx2)); + printf("ty2: %f\n", (slice_ty2)); #endif - + /* Pick and bind opengl texture object */ gl_handle = g_array_index (tex->slice_gl_handles, GLuint, iter_y.index * iter_x.array->len + iter_x.index); - - GE( glBindTexture (tex->gl_target, gl_handle) ); - -#define CFX_F CLUTTER_FIXED_TO_FLOAT - - /* Draw textured quad */ - glBegin (GL_QUADS); - - glTexCoord2f (CFX_F(slice_tx1), CFX_F(slice_ty1)); - glVertex2f (CFX_F(slice_qx1), CFX_F(slice_qy1)); - - glTexCoord2f (CFX_F(slice_tx2), CFX_F(slice_ty1)); - glVertex2f (CFX_F(slice_qx2), CFX_F(slice_qy1)); - - glTexCoord2f (CFX_F(slice_tx2), CFX_F(slice_ty2)); - glVertex2f (CFX_F(slice_qx2), CFX_F(slice_qy2)); - - glTexCoord2f (CFX_F(slice_tx1), CFX_F(slice_ty2)); - glVertex2f (CFX_F(slice_qx1), CFX_F(slice_qy2)); - - GE( glEnd () ); - -#undef CFX_F + + tex_coords[0] = slice_tx1; + tex_coords[1] = slice_ty1; + tex_coords[2] = slice_tx2; + tex_coords[3] = slice_ty2; + _cogl_journal_log_quad (slice_qx1, + slice_qy1, + slice_qx2, + slice_qy2, + material, + 1, /* one layer */ + 0, /* don't need to use fallbacks */ + gl_handle, /* replace the layer0 texture */ + tex_coords, + 4); } } } -static void -_cogl_texture_quad_hw (CoglTexture *tex, - ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2, - ClutterFixed tx1, - ClutterFixed ty1, - ClutterFixed tx2, - ClutterFixed ty2) -{ - CoglTexSliceSpan *x_span; - CoglTexSliceSpan *y_span; - GLuint gl_handle; - gulong enable_flags = 0; - -#if COGL_DEBUG - printf("=== Drawing Tex Quad (Hardware Tiling Mode) ===\n"); -#endif - - _COGL_GET_CONTEXT (ctx, NO_RETVAL); - - /* Prepare GL state */ - enable_flags |= COGL_ENABLE_TEXTURE_2D; - - if (ctx->color_alpha < 255 - || tex->bitmap.format & COGL_A_BIT) - { - enable_flags |= COGL_ENABLE_BLEND; +static gboolean +_cogl_multitexture_unsliced_quad (float x_1, + float y_1, + float x_2, + float y_2, + CoglHandle material, + gint n_layers, + guint32 fallback_mask, + const float *user_tex_coords, + gint user_tex_coords_len) +{ + float *final_tex_coords = alloca (sizeof (float) * 4 * n_layers); + const GList *layers; + GList *tmp; + int i; + + _COGL_GET_CONTEXT (ctx, FALSE); + + /* + * Validate the texture coordinates for this rectangle. + */ + layers = cogl_material_get_layers (material); + for (tmp = (GList *)layers, i = 0; tmp != NULL; tmp = tmp->next, i++) + { + CoglHandle layer = (CoglHandle)tmp->data; + /* CoglLayerInfo *layer_info; */ + CoglHandle tex_handle; + CoglTexture *tex; + const float *in_tex_coords; + float *out_tex_coords; + CoglTexSliceSpan *x_span; + CoglTexSliceSpan *y_span; + + /* layer_info = &layers[i]; */ + + /* FIXME - we shouldn't be checking this stuff if layer_info->gl_texture + * already == 0 */ + + tex_handle = cogl_material_layer_get_texture (layer); + tex = _cogl_texture_pointer_from_handle (tex_handle); + + in_tex_coords = &user_tex_coords[i * 4]; + out_tex_coords = &final_tex_coords[i * 4]; + + + /* If the texture has waste or we are using GL_TEXTURE_RECT we + * can't handle texture repeating so we check that the texture + * coords lie in the range [0,1]. + * + * NB: We already know that no texture matrix is being used + * if the texture has waste since we validated that early on. + * TODO: check for a texture matrix in the GL_TEXTURE_RECT + * case. + */ + if ((tex->gl_target == GL_TEXTURE_RECTANGLE_ARB + || _cogl_texture_span_has_waste (tex, 0, 0)) + && i < user_tex_coords_len / 4 + && (in_tex_coords[0] < 0 || in_tex_coords[0] > 1.0 + || in_tex_coords[1] < 0 || in_tex_coords[1] > 1.0 + || in_tex_coords[2] < 0 || in_tex_coords[2] > 1.0 + || in_tex_coords[3] < 0 || in_tex_coords[3] > 1.0)) + { + if (i == 0) + { + if (n_layers > 1) + { + g_warning ("Skipping layers 1..n of your material since the " + "first layer has waste and you supplied texture " + "coordinates outside the range [0,1]. We don't " + "currently support any multi-texturing using " + "textures with waste when repeating is " + "necissary so we are falling back to sliced " + "textures assuming layer 0 is the most " + "important one keep"); + } + return FALSE; + } + else + { + g_warning ("Skipping layer %d of your material " + "consisting of a texture with waste since " + "you have supplied texture coords outside " + "the range [0,1] (unsupported when " + "multi-texturing)", i); + + /* NB: marking for fallback will replace the layer with + * a default transparent texture */ + fallback_mask |= (1 << i); + } + } + + + /* + * Setup the texture unit... + */ + + /* NB: The user might not have supplied texture coordinates for all + * layers... */ + if (i < (user_tex_coords_len / 4)) + { + GLenum wrap_mode; + + /* If the texture coords are all in the range [0,1] then we want to + clamp the coords to the edge otherwise it can pull in edge pixels + from the wrong side when scaled */ + if (in_tex_coords[0] >= 0 && in_tex_coords[0] <= 1.0 + && in_tex_coords[1] >= 0 && in_tex_coords[1] <= 1.0 + && in_tex_coords[2] >= 0 && in_tex_coords[2] <= 1.0 + && in_tex_coords[3] >= 0 && in_tex_coords[3] <= 1.0) + wrap_mode = GL_CLAMP_TO_EDGE; + else + wrap_mode = GL_REPEAT; + + memcpy (out_tex_coords, in_tex_coords, sizeof (GLfloat) * 4); + + _cogl_texture_set_wrap_mode_parameter (tex, wrap_mode); + } + else + { + out_tex_coords[0] = 0; /* tx_1 */ + out_tex_coords[1] = 0; /* ty_1 */ + out_tex_coords[2] = 1.0; /* tx_2 */ + out_tex_coords[3] = 1.0; /* ty_2 */ + + _cogl_texture_set_wrap_mode_parameter (tex, GL_CLAMP_TO_EDGE); + } + + /* Don't include the waste in the texture coordinates */ + x_span = &g_array_index (tex->slice_x_spans, CoglTexSliceSpan, 0); + y_span = &g_array_index (tex->slice_y_spans, CoglTexSliceSpan, 0); + + out_tex_coords[0] = + out_tex_coords[0] * (x_span->size - x_span->waste) / x_span->size; + out_tex_coords[1] = + out_tex_coords[1] * (y_span->size - y_span->waste) / y_span->size; + out_tex_coords[2] = + out_tex_coords[2] * (x_span->size - x_span->waste) / x_span->size; + out_tex_coords[3] = + out_tex_coords[3] * (y_span->size - y_span->waste) / y_span->size; + + /* Denormalize texture coordinates for rectangle textures */ + if (tex->gl_target == GL_TEXTURE_RECTANGLE_ARB) + { + out_tex_coords[0] *= x_span->size; + out_tex_coords[1] *= x_span->size; + out_tex_coords[2] *= y_span->size; + out_tex_coords[3] *= y_span->size; + } } - - cogl_enable (enable_flags); - - /* Pick and bind opengl texture object */ - gl_handle = g_array_index (tex->slice_gl_handles, GLuint, 0); - GE( glBindTexture (tex->gl_target, gl_handle) ); - - x_span = &g_array_index (tex->slice_x_spans, CoglTexSliceSpan, 0); - y_span = &g_array_index (tex->slice_y_spans, CoglTexSliceSpan, 0); - - /* Don't include the waste in the texture coordinates */ - tx1 = tx1 * (x_span->size - x_span->waste) / x_span->size; - tx2 = tx2 * (x_span->size - x_span->waste) / x_span->size; - ty1 = ty1 * (y_span->size - y_span->waste) / y_span->size; - ty2 = ty2 * (y_span->size - y_span->waste) / y_span->size; - -#define CFX_F(x) CLUTTER_FIXED_TO_FLOAT(x) - - /* Draw textured quad */ - glBegin (GL_QUADS); - - glTexCoord2f (CFX_F(tx1), CFX_F(ty1)); - glVertex2f (CFX_F(x1), CFX_F(y1)); - - glTexCoord2f (CFX_F(tx2), CFX_F(ty1)); - glVertex2f (CFX_F(x2), CFX_F(y1)); - - glTexCoord2f (CFX_F(tx2), CFX_F(ty2)); - glVertex2f (CFX_F(x2), CFX_F(y2)); - - glTexCoord2f (CFX_F(tx1), CFX_F(ty2)); - glVertex2f (CFX_F(x1), CFX_F(y2)); - - GE( glEnd () ); - -#undef CFX_F -} -void -cogl_texture_rectangle (CoglHandle handle, - ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2, - ClutterFixed tx1, - ClutterFixed ty1, - ClutterFixed tx2, - ClutterFixed ty2) -{ - CoglTexture *tex; - - /* Check if valid texture */ - if (!cogl_is_texture (handle)) - return; - - tex = _cogl_texture_pointer_from_handle (handle); - - /* Make sure we got stuff to draw */ - if (tex->slice_gl_handles == NULL) - return; - - if (tex->slice_gl_handles->len == 0) - return; - - if (tx1 == tx2 || ty1 == ty2) - return; - - /* If there is only one GL texture and either the texture is NPOT - (no waste) or all of the coordinates are in the range [0,1] then - we can use hardware tiling */ - if (tex->slice_gl_handles->len == 1 - && (cogl_features_available (COGL_FEATURE_TEXTURE_NPOT) - || (tx1 >= 0 && tx1 <= CFX_ONE - && tx2 >= 0 && tx2 <= CFX_ONE - && ty1 >= 0 && ty1 <= CFX_ONE - && ty2 >= 0 && ty2 <= CFX_ONE))) - _cogl_texture_quad_hw (tex, x1,y1, x2,y2, tx1,ty1, tx2,ty2); - else - _cogl_texture_quad_sw (tex, x1,y1, x2,y2, tx1,ty1, tx2,ty2); + _cogl_journal_log_quad (x_1, + y_1, + x_2, + y_2, + material, + n_layers, + fallback_mask, + 0, /* don't replace the layer0 texture */ + final_tex_coords, + n_layers * 4); + + return TRUE; } -void -cogl_texture_polygon (CoglHandle handle, - guint n_vertices, - CoglTextureVertex *vertices, - gboolean use_color) +struct _CoglMutiTexturedRect { - CoglTexture *tex; - int i, x, y, vnum; - GLuint gl_handle; - CoglTexSliceSpan *y_span, *x_span; + float x_1; + float y_1; + float x_2; + float y_2; + const float *tex_coords; + gint tex_coords_len; +}; - /* Check if valid texture */ - if (!cogl_is_texture (handle)) - return; +static void +_cogl_rectangles_with_multitexture_coords ( + struct _CoglMutiTexturedRect *rects, + gint n_rects) +{ + CoglHandle material; + const GList *layers; + int n_layers; + const GList *tmp; + guint32 fallback_mask = 0; + gboolean all_use_sliced_quad_fallback = FALSE; + int i; - tex = _cogl_texture_pointer_from_handle (handle); - - /* The polygon will have artifacts where the slices join if the wrap - mode is GL_LINEAR because the filtering will pull in pixels from - the transparent border. To make it clear that the function - shouldn't be used in these circumstances we just bail out and - draw nothing */ - if (tex->slice_gl_handles->len != 1 - && (tex->min_filter != GL_NEAREST || tex->mag_filter != GL_NEAREST)) - { - static gboolean shown_warning = FALSE; + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + cogl_clip_ensure (); + + material = ctx->source_material; - if (!shown_warning) + layers = cogl_material_get_layers (material); + n_layers = g_list_length ((GList *)layers); + + /* + * Validate all the layers of the current source material... + */ + + for (tmp = layers, i = 0; tmp != NULL; tmp = tmp->next, i++) + { + CoglHandle layer = tmp->data; + CoglHandle tex_handle = cogl_material_layer_get_texture (layer); + CoglTexture *texture = _cogl_texture_pointer_from_handle (tex_handle); + gulong flags; + + if (cogl_material_layer_get_type (layer) + != COGL_MATERIAL_LAYER_TYPE_TEXTURE) + continue; + + /* XXX: + * For now, if the first layer is sliced then all other layers are + * ignored since we currently don't support multi-texturing with + * sliced textures. If the first layer is not sliced then any other + * layers found to be sliced will be skipped. (with a warning) + * + * TODO: Add support for multi-texturing rectangles with sliced + * textures if no texture matrices are in use. + */ + if (cogl_texture_is_sliced (tex_handle)) { - g_warning ("cogl_texture_polygon does not work for sliced textures " - "when the minification and magnification filters are not " - "CGL_NEAREST"); - shown_warning = TRUE; + if (i == 0) + { + fallback_mask = ~1; /* fallback all except the first layer */ + all_use_sliced_quad_fallback = TRUE; + if (tmp->next) + { + g_warning ("Skipping layers 1..n of your material since the " + "first layer is sliced. We don't currently " + "support any multi-texturing with sliced " + "textures but assume layer 0 is the most " + "important to keep"); + } + break; + } + else + { + g_warning ("Skipping layer %d of your material consisting of a " + "sliced texture (unsuported for multi texturing)", + i); + + /* NB: marking for fallback will replace the layer with + * a default transparent texture */ + fallback_mask |= (1 << i); + continue; + } } - return; + + /* We don't support multi texturing using textures with any waste if the + * user has supplied a custom texture matrix, since we don't know if + * the result will end up trying to texture from the waste area. */ + flags = cogl_material_layer_get_flags (layer); + if (flags & COGL_MATERIAL_LAYER_FLAG_HAS_USER_MATRIX + && _cogl_texture_span_has_waste (texture, 0, 0)) + { + g_warning ("Skipping layer %d of your material consisting of a " + "texture with waste since you have supplied a custom " + "texture matrix and the result may try to sample from " + "the waste area of your texture.", i); + + /* NB: marking for fallback will replace the layer with + * a default transparent texture */ + fallback_mask |= (1 << i); + continue; + } } - tex = _cogl_texture_pointer_from_handle (handle); - - /* Prepare GL state */ - cogl_enable (COGL_ENABLE_TEXTURE_2D | COGL_ENABLE_BLEND); + /* + * Emit geometry for each of the rectangles... + */ + + for (i = 0; i < n_rects; i++) + { + if (all_use_sliced_quad_fallback + || !_cogl_multitexture_unsliced_quad (rects[i].x_1, rects[i].y_1, + rects[i].x_2, rects[i].y_2, + material, + n_layers, + fallback_mask, + rects[i].tex_coords, + rects[i].tex_coords_len)) + { + CoglHandle first_layer, tex_handle; + CoglTexture *texture; + + first_layer = layers->data; + tex_handle = cogl_material_layer_get_texture (first_layer); + texture = _cogl_texture_pointer_from_handle (tex_handle); + if (rects[i].tex_coords) + _cogl_texture_sliced_quad (texture, + material, + rects[i].x_1, rects[i].y_1, + rects[i].x_2, rects[i].y_2, + rects[i].tex_coords[0], + rects[i].tex_coords[1], + rects[i].tex_coords[2], + rects[i].tex_coords[3]); + else + _cogl_texture_sliced_quad (texture, + material, + rects[i].x_1, rects[i].y_1, + rects[i].x_2, rects[i].y_2, + 0.0f, 0.0f, 1.0f, 1.0f); + } + } + + _cogl_journal_flush (); +} - /* Temporarily change the wrapping mode on all of the slices to use - a transparent border */ - for (i = 0; i < tex->slice_gl_handles->len; i++) +void +cogl_rectangles_with_texture_coords (const float *verts, + guint n_rects) +{ + struct _CoglMutiTexturedRect rects[n_rects]; + int i; + + for (i = 0; i < n_rects; i++) { - GE( glBindTexture (tex->gl_target, - g_array_index (tex->slice_gl_handles, GLuint, i)) ); - GE( glTexParameteri (tex->gl_target, GL_TEXTURE_WRAP_S, - GL_CLAMP_TO_BORDER) ); - GE( glTexParameteri (tex->gl_target, GL_TEXTURE_WRAP_T, - GL_CLAMP_TO_BORDER) ); + rects[i].x_1 = verts[i * 8]; + rects[i].y_1 = verts[i * 8 + 1]; + rects[i].x_2 = verts[i * 8 + 2]; + rects[i].y_2 = verts[i * 8 + 3]; + /* FIXME: rect should be defined to have a const float *geom; + * instead, to avoid this copy + * rect[i].geom = &verts[n_rects * 8]; */ + rects[i].tex_coords = &verts[i * 8 + 4]; + rects[i].tex_coords_len = 4; } - i = 0; + _cogl_rectangles_with_multitexture_coords (rects, n_rects); +} + +void +cogl_rectangle_with_texture_coords (float x_1, + float y_1, + float x_2, + float y_2, + float tx_1, + float ty_1, + float tx_2, + float ty_2) +{ + float verts[8]; + + verts[0] = x_1; + verts[1] = y_1; + verts[2] = x_2; + verts[3] = y_2; + verts[4] = tx_1; + verts[5] = ty_1; + verts[6] = tx_2; + verts[7] = ty_2; + + cogl_rectangles_with_texture_coords (verts, 1); +} + +void +cogl_rectangle_with_multitexture_coords (float x_1, + float y_1, + float x_2, + float y_2, + const float *user_tex_coords, + gint user_tex_coords_len) +{ + struct _CoglMutiTexturedRect rect; + + rect.x_1 = x_1; + rect.y_1 = y_1; + rect.x_2 = x_2; + rect.y_2 = y_2; + rect.tex_coords = user_tex_coords; + rect.tex_coords_len = user_tex_coords_len; + + _cogl_rectangles_with_multitexture_coords (&rect, 1); +} + +static void +_cogl_texture_sliced_polygon (CoglTextureVertex *vertices, + guint n_vertices, + guint stride, + gboolean use_color) +{ + const GList *layers; + CoglHandle layer0; + CoglHandle tex_handle; + CoglTexture *tex; + CoglTexSliceSpan *y_span, *x_span; + int x, y, tex_num, i; + GLuint gl_handle; + GLfloat *v; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + /* We can assume in this case that we have at least one layer in the + * material that corresponds to a sliced cogl texture */ + layers = cogl_material_get_layers (ctx->source_material); + layer0 = (CoglHandle)layers->data; + tex_handle = cogl_material_layer_get_texture (layer0); + tex = _cogl_texture_pointer_from_handle (tex_handle); + + v = (GLfloat *)ctx->logged_vertices->data; + for (i = 0; i < n_vertices; i++) + { + GLfloat *c; + + v[0] = vertices[i].x; + v[1] = vertices[i].y; + v[2] = vertices[i].z; + + /* NB: [X,Y,Z,TX,TY,R,G,B,A,...] */ + c = v + 5; + c[0] = cogl_color_get_red_byte (&vertices[i].color); + c[1] = cogl_color_get_green_byte (&vertices[i].color); + c[2] = cogl_color_get_blue_byte (&vertices[i].color); + c[3] = cogl_color_get_alpha_byte (&vertices[i].color); + + v += stride; + } /* Render all of the slices with the full geometry but use a transparent border color so that any part of the texture not covered by the slice will be ignored */ + tex_num = 0; for (y = 0; y < tex->slice_y_spans->len; y++) { y_span = &g_array_index (tex->slice_y_spans, CoglTexSliceSpan, y); @@ -2271,45 +2853,298 @@ { x_span = &g_array_index (tex->slice_x_spans, CoglTexSliceSpan, x); - gl_handle = g_array_index (tex->slice_gl_handles, GLuint, i++); + gl_handle = g_array_index (tex->slice_gl_handles, GLuint, tex_num++); - GE( glBindTexture (tex->gl_target, gl_handle) ); + /* Convert the vertices into an array of GLfloats ready to pass to + OpenGL */ + v = (GLfloat *)ctx->logged_vertices->data; + for (i = 0; i < n_vertices; i++) + { + GLfloat *t; + float tx, ty; - glBegin (GL_TRIANGLE_FAN); + tx = ((vertices[i].tx + - ((float)(x_span->start) + / tex->bitmap.width)) + * tex->bitmap.width / x_span->size); + ty = ((vertices[i].ty + - ((float)(y_span->start) + / tex->bitmap.height)) + * tex->bitmap.height / y_span->size); - for (vnum = 0; vnum < n_vertices; vnum++) - { - GLfloat tx, ty; + /* Scale the coordinates up for rectangle textures */ + if (tex->gl_target == CGL_TEXTURE_RECTANGLE_ARB) + { + tx *= x_span->size; + ty *= y_span->size; + } - if (use_color) - cogl_color (&vertices[vnum].color); + /* NB: [X,Y,Z,TX,TY,R,G,B,A,...] */ + t = v + 3; + t[0] = tx; + t[1] = ty; - /* Transform the texture co-ordinates so they are - relative to the slice */ - tx = (CLUTTER_FIXED_TO_FLOAT (vertices[vnum].tx) - - x_span->start / (GLfloat) tex->bitmap.width) - * tex->bitmap.width / x_span->size; - ty = (CLUTTER_FIXED_TO_FLOAT (vertices[vnum].ty) - - y_span->start / (GLfloat) tex->bitmap.height) - * tex->bitmap.height / y_span->size; - - glTexCoord2f (tx, ty); - - glVertex3f (CLUTTER_FIXED_TO_FLOAT (vertices[vnum].x), - CLUTTER_FIXED_TO_FLOAT (vertices[vnum].y), - CLUTTER_FIXED_TO_FLOAT (vertices[vnum].z)); + v += stride; } - GE( glEnd () ); + cogl_material_flush_gl_state (ctx->source_material, + COGL_MATERIAL_FLUSH_DISABLE_MASK, + (guint32)~1, /* disable all except the + first layer */ + COGL_MATERIAL_FLUSH_LAYER0_OVERRIDE, + gl_handle, + NULL); + + GE( glDrawArrays (GL_TRIANGLE_FAN, 0, n_vertices) ); } } - - /* Restore the wrapping mode */ - for (i = 0; i < tex->slice_gl_handles->len; i++) - { - GE( glBindTexture (tex->gl_target, - g_array_index (tex->slice_gl_handles, GLuint, i)) ); - GE( glTexParameteri (tex->gl_target, GL_TEXTURE_WRAP_S, tex->wrap_mode) ); - GE( glTexParameteri (tex->gl_target, GL_TEXTURE_WRAP_T, tex->wrap_mode) ); +} + + +static void +_cogl_multitexture_unsliced_polygon (CoglTextureVertex *vertices, + guint n_vertices, + guint n_layers, + guint stride, + gboolean use_color, + guint32 fallback_mask) +{ + CoglHandle material; + const GList *layers; + int i; + GList *tmp; + CoglTexSliceSpan *y_span, *x_span; + GLfloat *v; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + + material = ctx->source_material; + layers = cogl_material_get_layers (material); + + /* Convert the vertices into an array of GLfloats ready to pass to + OpenGL */ + for (v = (GLfloat *)ctx->logged_vertices->data, i = 0; + i < n_vertices; + v += stride, i++) + { + GLfloat *c; + int j; + + /* NB: [X,Y,Z,TX,TY...,R,G,B,A,...] */ + v[0] = vertices[i].x; + v[1] = vertices[i].y; + v[2] = vertices[i].z; + + for (tmp = (GList *)layers, j = 0; tmp != NULL; tmp = tmp->next, j++) + { + CoglHandle layer = (CoglHandle)tmp->data; + CoglHandle tex_handle; + CoglTexture *tex; + GLfloat *t; + float tx, ty; + + tex_handle = cogl_material_layer_get_texture (layer); + tex = _cogl_texture_pointer_from_handle (tex_handle); + + y_span = &g_array_index (tex->slice_y_spans, CoglTexSliceSpan, 0); + x_span = &g_array_index (tex->slice_x_spans, CoglTexSliceSpan, 0); + + tx = ((vertices[i].tx + - ((float)(x_span->start) + / tex->bitmap.width)) + * tex->bitmap.width / x_span->size); + ty = ((vertices[i].ty + - ((float)(y_span->start) + / tex->bitmap.height)) + * tex->bitmap.height / y_span->size); + + /* Scale the coordinates up for rectangle textures */ + if (tex->gl_target == CGL_TEXTURE_RECTANGLE_ARB) + { + tx *= x_span->size; + ty *= y_span->size; + } + + /* NB: [X,Y,Z,TX,TY...,R,G,B,A,...] */ + t = v + 3 + 2 * j; + t[0] = tx; + t[1] = ty; + } + + /* NB: [X,Y,Z,TX,TY...,R,G,B,A,...] */ + c = v + 3 + 2 * n_layers; + c[0] = cogl_color_get_red_float (&vertices[i].color); + c[1] = cogl_color_get_green_float (&vertices[i].color); + c[2] = cogl_color_get_blue_float (&vertices[i].color); + c[3] = cogl_color_get_alpha_float (&vertices[i].color); } + + cogl_material_flush_gl_state (ctx->source_material, + COGL_MATERIAL_FLUSH_FALLBACK_MASK, + fallback_mask, + NULL); + + GE (glDrawArrays (GL_TRIANGLE_FAN, 0, n_vertices)); } + +void +cogl_polygon (CoglTextureVertex *vertices, + guint n_vertices, + gboolean use_color) +{ + CoglHandle material; + const GList *layers; + int n_layers; + GList *tmp; + gboolean use_sliced_polygon_fallback = FALSE; + guint32 fallback_mask = 0; + int i; + gulong enable_flags; + guint stride; + gsize stride_bytes; + GLfloat *v; + int prev_n_texcoord_arrays_enabled; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + cogl_clip_ensure (); + + material = ctx->source_material; + layers = cogl_material_get_layers (ctx->source_material); + n_layers = g_list_length ((GList *)layers); + + for (tmp = (GList *)layers, i = 0; tmp != NULL; tmp = tmp->next, i++) + { + CoglHandle layer = (CoglHandle)tmp->data; + CoglHandle tex_handle = cogl_material_layer_get_texture (layer); + CoglTexture *tex = _cogl_texture_pointer_from_handle (tex_handle); + + if (i == 0 && cogl_texture_is_sliced (tex_handle)) + { +#if defined (HAVE_COGL_GLES) || defined (HAVE_COGL_GLES2) + { + static gboolean shown_gles_slicing_warning = FALSE; + if (!shown_gles_slicing_warning) + g_warning ("cogl_polygon does not work for sliced textures " + "on GL ES"); + shown_gles_slicing_warning = TRUE; + return; + } +#endif + if (n_layers > 1) + { + static gboolean shown_slicing_warning = FALSE; + if (!shown_slicing_warning) + { + g_warning ("Disabling layers 1..n since multi-texturing with " + "cogl_polygon isn't supported when using sliced " + "textures\n"); + shown_slicing_warning = TRUE; + } + } + use_sliced_polygon_fallback = TRUE; + n_layers = 1; + + if (tex->min_filter != GL_NEAREST || tex->mag_filter != GL_NEAREST) + { + static gboolean shown_filter_warning = FALSE; + if (!shown_filter_warning) + { + g_warning ("cogl_texture_polygon does not work for sliced textures " + "when the minification and magnification filters are not " + "CGL_NEAREST"); + shown_filter_warning = TRUE; + } + return; + } + +#ifdef HAVE_COGL_GL + /* Temporarily change the wrapping mode on all of the slices to use + * a transparent border + * XXX: it's doesn't look like we save/restore this, like the comment + * implies? */ + _cogl_texture_set_wrap_mode_parameter (tex, GL_CLAMP_TO_BORDER); +#endif + break; + } + + if (cogl_texture_is_sliced (tex_handle)) + { + g_warning ("Disabling layer %d of the current source material, " + "because texturing with the vertex buffer API is not " + "currently supported using sliced textures, or textures " + "with waste\n", i); + + fallback_mask |= (1 << i); + continue; + } + } + + /* Our data is arranged like: + * [X, Y, Z, TX0, TY0, TX1, TY1..., R, G, B, A,...] */ + stride = 3 + (2 * n_layers) + (use_color ? 4 : 0); + stride_bytes = stride * sizeof (GLfloat); + + /* Make sure there is enough space in the global vertex + array. This is used so we can render the polygon with a single + call to OpenGL but still support any number of vertices */ + g_array_set_size (ctx->logged_vertices, n_vertices * stride); + v = (GLfloat *)ctx->logged_vertices->data; + + /* Prepare GL state */ + enable_flags = COGL_ENABLE_VERTEX_ARRAY; + enable_flags |= cogl_material_get_cogl_enable_flags (ctx->source_material); + + if (ctx->enable_backface_culling) + enable_flags |= COGL_ENABLE_BACKFACE_CULLING; + + if (use_color) + { + enable_flags |= COGL_ENABLE_COLOR_ARRAY; + GE( glColorPointer (4, GL_FLOAT, + stride_bytes, + /* NB: [X,Y,Z,TX,TY...,R,G,B,A,...] */ + v + 3 + 2 * n_layers) ); + } + + cogl_enable (enable_flags); + + GE (glVertexPointer (3, GL_FLOAT, stride_bytes, v)); + + for (i = 0; i < n_layers; i++) + { + GE (glClientActiveTexture (GL_TEXTURE0 + i)); + GE (glEnableClientState (GL_TEXTURE_COORD_ARRAY)); + GE (glTexCoordPointer (2, GL_FLOAT, + stride_bytes, + /* NB: [X,Y,Z,TX,TY...,R,G,B,A,...] */ + v + 3 + 2 * i)); + } + prev_n_texcoord_arrays_enabled = + ctx->n_texcoord_arrays_enabled; + ctx->n_texcoord_arrays_enabled = i + 1; + for (; i < prev_n_texcoord_arrays_enabled; i++) + { + GE (glClientActiveTexture (GL_TEXTURE0 + i)); + GE (glDisableClientState (GL_TEXTURE_COORD_ARRAY)); + } + + if (use_sliced_polygon_fallback) + _cogl_texture_sliced_polygon (vertices, + n_vertices, + stride, + use_color); + else + _cogl_multitexture_unsliced_polygon (vertices, + n_vertices, + n_layers, + stride, + use_color, + fallback_mask); + + /* Reset the size of the logged vertex array because rendering + rectangles expects it to start at 0 */ + g_array_set_size (ctx->logged_vertices, 0); +} + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gl/cogl-texture.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gl/cogl-texture.h --- clutter-0.8.4/clutter/cogl/gl/cogl-texture.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gl/cogl-texture.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,65 +0,0 @@ -/* - * Clutter COGL - * - * A basic GL/GLES Abstraction/Utility Layer - * - * Authored By Matthew Allum - * - * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __COGL_TEXTURE_H -#define __COGL_TEXTURE_H - -#include "cogl-bitmap.h" - -typedef struct _CoglTexture CoglTexture; -typedef struct _CoglTexSliceSpan CoglTexSliceSpan; -typedef struct _CoglSpanIter CoglSpanIter; - -struct _CoglTexSliceSpan -{ - gint start; - gint size; - gint waste; -}; - -struct _CoglTexture -{ - guint ref_count; - CoglBitmap bitmap; - gboolean bitmap_owner; - GLenum gl_target; - GLenum gl_intformat; - GLenum gl_format; - GLenum gl_type; - GArray *slice_x_spans; - GArray *slice_y_spans; - GArray *slice_gl_handles; - gint max_waste; - COGLenum min_filter; - COGLenum mag_filter; - gboolean is_foreign; - GLint wrap_mode; - gboolean auto_mipmap; -}; - -CoglTexture* -_cogl_texture_pointer_from_handle (CoglHandle handle); - -#endif /* __COGL_TEXTURE_H */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gl/cogl-texture-private.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gl/cogl-texture-private.h --- clutter-0.8.4/clutter/cogl/gl/cogl-texture-private.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gl/cogl-texture-private.h 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,81 @@ +/* + * Clutter COGL + * + * A basic GL/GLES Abstraction/Utility Layer + * + * Authored By Matthew Allum + * + * 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, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __COGL_TEXTURE_H +#define __COGL_TEXTURE_H + +#include "cogl-bitmap.h" + +typedef struct _CoglTexture CoglTexture; +typedef struct _CoglTexSliceSpan CoglTexSliceSpan; +typedef struct _CoglSpanIter CoglSpanIter; + +struct _CoglTexSliceSpan +{ + gint start; + gint size; + gint waste; +}; + +struct _CoglTexture +{ + guint ref_count; + CoglBitmap bitmap; + gboolean bitmap_owner; + GLenum gl_target; + GLenum gl_intformat; + GLenum gl_format; + GLenum gl_type; + GArray *slice_x_spans; + GArray *slice_y_spans; + GArray *slice_gl_handles; + gint max_waste; + COGLenum min_filter; + COGLenum mag_filter; + gboolean is_foreign; + GLint wrap_mode; + gboolean auto_mipmap; +}; + +/* To improve batching of geometry when submitting vertices to OpenGL we + * log the texture rectangles we want to draw to a journal, so when we + * later flush the journal we aim to batch data, and gl draw calls. */ +typedef struct _CoglJournalEntry +{ + CoglHandle material; + gint n_layers; + guint32 fallback_mask; + GLuint layer0_override_texture; +} CoglJournalEntry; + +CoglTexture* +_cogl_texture_pointer_from_handle (CoglHandle handle); + +gboolean +_cogl_texture_span_has_waste (CoglTexture *tex, + gint x_span_index, + gint y_span_index); + +#endif /* __COGL_TEXTURE_H */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gl/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gl/Makefile.am --- clutter-0.8.4/clutter/cogl/gl/Makefile.am 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gl/Makefile.am 2009-01-28 16:45:25.000000000 +0000 @@ -1,6 +1,18 @@ libclutterincludedir = $(includedir)/clutter-@CLUTTER_API_VERSION@/cogl -libclutterinclude_HEADERS = $(top_builddir)/clutter/cogl/cogl.h \ - $(top_builddir)/clutter/cogl/cogl-defines-gl.h +libclutterinclude_HEADERS = \ + $(top_builddir)/clutter/cogl/cogl.h \ + $(top_builddir)/clutter/cogl/cogl-defines-gl.h \ + $(top_builddir)/clutter/cogl/cogl-color.h \ + $(top_builddir)/clutter/cogl/cogl-deprecated.h \ + $(top_builddir)/clutter/cogl/cogl-fixed.h \ + $(top_builddir)/clutter/cogl/cogl-offscreen.h \ + $(top_builddir)/clutter/cogl/cogl-path.h \ + $(top_builddir)/clutter/cogl/cogl-shader.h \ + $(top_builddir)/clutter/cogl/cogl-texture.h \ + $(top_builddir)/clutter/cogl/cogl-types.h \ + $(top_builddir)/clutter/cogl/cogl-vertex-buffer.h \ + $(top_builddir)/clutter/cogl/cogl-material.h \ + $(top_builddir)/clutter/cogl/cogl-matrix.h INCLUDES = \ -I$(top_srcdir) \ @@ -10,8 +22,11 @@ -I$(top_srcdir)/clutter/cogl/$(CLUTTER_COGL) \ -I$(top_builddir)/clutter \ -I$(top_builddir)/clutter/cogl \ + -DG_LOG_DOMAIN=\"Cogl-GL\" \ + -DCLUTTER_COMPILATION \ $(CLUTTER_CFLAGS) \ $(CLUTTER_DEBUG_CFLAGS) \ + $(MAINTAINER_CFLAGS) \ $(GCC_FLAGS) LDADD = $(CLUTTER_LIBS) @@ -21,10 +36,18 @@ libclutter_cogl_la_SOURCES = \ $(top_builddir)/clutter/cogl/cogl.h \ $(top_builddir)/clutter/cogl/cogl-defines-gl.h \ + $(top_builddir)/clutter/cogl/cogl-color.h \ + $(top_builddir)/clutter/cogl/cogl-deprecated.h \ + $(top_builddir)/clutter/cogl/cogl-fixed.h \ + $(top_builddir)/clutter/cogl/cogl-offscreen.h \ + $(top_builddir)/clutter/cogl/cogl-path.h \ + $(top_builddir)/clutter/cogl/cogl-shader.h \ + $(top_builddir)/clutter/cogl/cogl-texture.h \ + $(top_builddir)/clutter/cogl/cogl-types.h \ cogl-internal.h \ - cogl-texture.h \ + cogl-texture-private.h \ cogl-fbo.h \ - cogl-shader.h \ + cogl-shader-private.h \ cogl-program.h \ cogl-context.h \ cogl.c \ @@ -37,4 +60,4 @@ EXTRA_DIST = cogl-defines.h.in -libclutter_cogl_la_LIBADD = $(top_builddir)/clutter/cogl/common/libclutter-cogl-common.la +libclutter_cogl_la_LIBADD = $(top_builddir)/clutter/cogl/common/libclutter-cogl-common.la diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gl/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gl/Makefile.in --- clutter-0.8.4/clutter/cogl/gl/Makefile.in 2008-11-28 18:22:47.000000000 +0000 +++ clutter-0.9.0/clutter/cogl/gl/Makefile.in 2009-01-28 16:48:56.000000000 +0000 @@ -126,7 +126,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -151,6 +150,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -243,8 +243,20 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ libclutterincludedir = $(includedir)/clutter-@CLUTTER_API_VERSION@/cogl -libclutterinclude_HEADERS = $(top_builddir)/clutter/cogl/cogl.h \ - $(top_builddir)/clutter/cogl/cogl-defines-gl.h +libclutterinclude_HEADERS = \ + $(top_builddir)/clutter/cogl/cogl.h \ + $(top_builddir)/clutter/cogl/cogl-defines-gl.h \ + $(top_builddir)/clutter/cogl/cogl-color.h \ + $(top_builddir)/clutter/cogl/cogl-deprecated.h \ + $(top_builddir)/clutter/cogl/cogl-fixed.h \ + $(top_builddir)/clutter/cogl/cogl-offscreen.h \ + $(top_builddir)/clutter/cogl/cogl-path.h \ + $(top_builddir)/clutter/cogl/cogl-shader.h \ + $(top_builddir)/clutter/cogl/cogl-texture.h \ + $(top_builddir)/clutter/cogl/cogl-types.h \ + $(top_builddir)/clutter/cogl/cogl-vertex-buffer.h \ + $(top_builddir)/clutter/cogl/cogl-material.h \ + $(top_builddir)/clutter/cogl/cogl-matrix.h INCLUDES = \ -I$(top_srcdir) \ @@ -254,8 +266,11 @@ -I$(top_srcdir)/clutter/cogl/$(CLUTTER_COGL) \ -I$(top_builddir)/clutter \ -I$(top_builddir)/clutter/cogl \ + -DG_LOG_DOMAIN=\"Cogl-GL\" \ + -DCLUTTER_COMPILATION \ $(CLUTTER_CFLAGS) \ $(CLUTTER_DEBUG_CFLAGS) \ + $(MAINTAINER_CFLAGS) \ $(GCC_FLAGS) LDADD = $(CLUTTER_LIBS) @@ -263,10 +278,18 @@ libclutter_cogl_la_SOURCES = \ $(top_builddir)/clutter/cogl/cogl.h \ $(top_builddir)/clutter/cogl/cogl-defines-gl.h \ + $(top_builddir)/clutter/cogl/cogl-color.h \ + $(top_builddir)/clutter/cogl/cogl-deprecated.h \ + $(top_builddir)/clutter/cogl/cogl-fixed.h \ + $(top_builddir)/clutter/cogl/cogl-offscreen.h \ + $(top_builddir)/clutter/cogl/cogl-path.h \ + $(top_builddir)/clutter/cogl/cogl-shader.h \ + $(top_builddir)/clutter/cogl/cogl-texture.h \ + $(top_builddir)/clutter/cogl/cogl-types.h \ cogl-internal.h \ - cogl-texture.h \ + cogl-texture-private.h \ cogl-fbo.h \ - cogl-shader.h \ + cogl-shader-private.h \ cogl-program.h \ cogl-context.h \ cogl.c \ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl.c --- clutter-0.8.4/clutter/cogl/gles/cogl.c 2008-11-04 16:36:17.000000000 +0000 +++ clutter-0.9.0/clutter/cogl/gles/cogl.c 2009-01-29 13:31:50.000000000 +0000 @@ -30,13 +30,24 @@ #include "cogl.h" #include +#include +#include #include +#ifdef HAVE_CLUTTER_GLX +#include +#include + +typedef CoglFuncPtr (*GLXGetProcAddressProc) (const guint8 *procName); +#endif + #include "cogl-internal.h" #include "cogl-util.h" #include "cogl-context.h" +#if defined (HAVE_COGL_GLES2) || defined (HAVE_COGL_GLES) #include "cogl-gles2-wrapper.h" +#endif /* GL error to string conversion */ #if COGL_DEBUG @@ -72,85 +83,78 @@ } #endif - CoglFuncPtr cogl_get_proc_address (const gchar* name) { return NULL; } -gboolean +gboolean cogl_check_extension (const gchar *name, const gchar *ext) { return FALSE; } void -cogl_paint_init (const ClutterColor *color) +cogl_paint_init (const CoglColor *color) { #if COGL_DEBUG fprintf(stderr, "\n ============== Paint Start ================ \n"); #endif - cogl_wrap_glClearColorx ((color->red << 16) / 0xff, - (color->green << 16) / 0xff, - (color->blue << 16) / 0xff, - 0xff); + GE( glClearColor (cogl_color_get_red_float (color), + cogl_color_get_green_float (color), + cogl_color_get_blue_float (color), + 0.0) ); glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - cogl_wrap_glDisable (GL_LIGHTING); - cogl_wrap_glDisable (GL_FOG); + glDisable (GL_LIGHTING); + glDisable (GL_FOG); + + /* + * Disable the depth test for now as has some strange side effects, + * mainly on x/y axis rotation with multiple layers at same depth + * (eg rotating text on a bg has very strange effect). Seems no clean + * 100% effective way to fix without other odd issues.. So for now + * move to application to handle and add cogl_enable_depth_test() + * as for custom actors (i.e groups) to enable if need be. + * + * glEnable (GL_DEPTH_TEST); + * glEnable (GL_ALPHA_TEST) + * glDepthFunc (GL_LEQUAL); + * glAlphaFunc (GL_GREATER, 0.1); + */ } /* FIXME: inline most of these */ void cogl_push_matrix (void) { - GE( cogl_wrap_glPushMatrix() ); + GE( glPushMatrix() ); } void cogl_pop_matrix (void) { - GE( cogl_wrap_glPopMatrix() ); + GE( glPopMatrix() ); } void -cogl_scale (ClutterFixed x, ClutterFixed y) +cogl_scale (float x, float y, float z) { - GE( cogl_wrap_glScalex (x, y, CFX_ONE) ); + GE( glScalef (x, y, z) ); } void -cogl_translatex (ClutterFixed x, ClutterFixed y, ClutterFixed z) +cogl_translate (float x, float y, float z) { - GE( cogl_wrap_glTranslatex (x, y, z) ); + GE( glTranslatef (x, y, z) ); } void -cogl_translate (gint x, gint y, gint z) +cogl_rotate (float angle, float x, float y, float z) { - GE( cogl_wrap_glTranslatex (CLUTTER_INT_TO_FIXED(x), - CLUTTER_INT_TO_FIXED(y), - CLUTTER_INT_TO_FIXED(z)) ); -} - -void -cogl_rotatex (ClutterFixed angle, - ClutterFixed x, - ClutterFixed y, - ClutterFixed z) -{ - GE( cogl_wrap_glRotatex (angle,x,y,z) ); -} - -void -cogl_rotate (gint angle, gint x, gint y, gint z) -{ - GE( cogl_wrap_glRotatex (CLUTTER_INT_TO_FIXED(angle), - CLUTTER_INT_TO_FIXED(x), - CLUTTER_INT_TO_FIXED(y), - CLUTTER_INT_TO_FIXED(z)) ); + GE( glRotatef (angle, x, y, z) ); } static inline gboolean @@ -166,17 +170,17 @@ { if (!(ctx->enable_flags & flag)) { - GE( cogl_wrap_glEnable (gl_flag) ); + GE( glEnable (gl_flag) ); ctx->enable_flags |= flag; return TRUE; } } else if (ctx->enable_flags & flag) { - GE( cogl_wrap_glDisable (gl_flag) ); + GE( glDisable (gl_flag) ); ctx->enable_flags &= ~flag; } - + return FALSE; } @@ -193,17 +197,17 @@ { if (!(ctx->enable_flags & flag)) { - GE( cogl_wrap_glEnableClientState (gl_flag) ); + GE( glEnableClientState (gl_flag) ); ctx->enable_flags |= flag; return TRUE; } } else if (ctx->enable_flags & flag) { - GE( cogl_wrap_glDisableClientState (gl_flag) ); + GE( glDisableClientState (gl_flag) ); ctx->enable_flags &= ~flag; } - + return FALSE; } @@ -214,22 +218,18 @@ * hope of lessening number GL traffic. */ _COGL_GET_CONTEXT (ctx, NO_RETVAL); - + cogl_toggle_flag (ctx, flags, COGL_ENABLE_BLEND, GL_BLEND); - + cogl_toggle_flag (ctx, flags, - COGL_ENABLE_TEXTURE_2D, - GL_TEXTURE_2D); - + COGL_ENABLE_BACKFACE_CULLING, + GL_CULL_FACE); + cogl_toggle_client_flag (ctx, flags, COGL_ENABLE_VERTEX_ARRAY, GL_VERTEX_ARRAY); - - cogl_toggle_client_flag (ctx, flags, - COGL_ENABLE_TEXCOORD_ARRAY, - GL_TEXTURE_COORD_ARRAY); cogl_toggle_client_flag (ctx, flags, COGL_ENABLE_COLOR_ARRAY, @@ -240,25 +240,8 @@ cogl_get_enable () { _COGL_GET_CONTEXT (ctx, 0); - - return ctx->enable_flags; -} -void -cogl_blend_func (COGLenum src_factor, COGLenum dst_factor) -{ - /* This function caches the blending setup in the - * hope of lessening GL traffic. - */ - _COGL_GET_CONTEXT (ctx, NO_RETVAL); - - if (ctx->blend_src_factor != src_factor || - ctx->blend_dst_factor != dst_factor) - { - glBlendFunc (src_factor, dst_factor); - ctx->blend_src_factor = src_factor; - ctx->blend_dst_factor = dst_factor; - } + return ctx->enable_flags; } void @@ -266,70 +249,55 @@ { if (setting) { - cogl_wrap_glEnable (GL_DEPTH_TEST); - cogl_wrap_glEnable (GL_ALPHA_TEST); + glEnable (GL_DEPTH_TEST); + glEnable (GL_ALPHA_TEST); glDepthFunc (GL_LEQUAL); - cogl_wrap_glAlphaFunc (GL_GREATER, 0.1); + glAlphaFunc (GL_GREATER, 0.1); } else { - cogl_wrap_glDisable (GL_DEPTH_TEST); - cogl_wrap_glDisable (GL_ALPHA_TEST); + glDisable (GL_DEPTH_TEST); + glDisable (GL_ALPHA_TEST); } } void -cogl_color (const ClutterColor *color) +cogl_enable_backface_culling (gboolean setting) { _COGL_GET_CONTEXT (ctx, NO_RETVAL); - -#if 0 /*HAVE_GLES_COLOR4UB*/ - /* NOTE: seems SDK_OGLES-1.1_LINUX_PCEMULATION_2.02.22.0756 has this call - * but is broken - see #857. Therefor disabling. - */ + ctx->enable_backface_culling = setting; +} - /* - * GLES 1.1 does actually have this function, it's in the header file but - * missing in the reference manual (and SDK): - * - * http://www.khronos.org/egl/headers/1_1/gl.h - */ - GE( glColor4ub (color->red, - color->green, - color->blue, - color->alpha) ); +void +cogl_set_source_color (const CoglColor *color) +{ + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + /* In case cogl_set_source_texture was previously used... */ + cogl_material_remove_layer (ctx->default_material, 0); -#else - /* conversion can cause issues with picking on some gles implementations */ - GE( cogl_wrap_glColor4x ((color->red << 16) / 0xff, - (color->green << 16) / 0xff, - (color->blue << 16) / 0xff, - (color->alpha << 16) / 0xff)); -#endif - - /* Store alpha for proper blending enables */ - ctx->color_alpha = color->alpha; + cogl_material_set_color (ctx->default_material, color); + cogl_set_source (ctx->default_material); } static void -apply_matrix (const ClutterFixed *matrix, ClutterFixed *vertex) +apply_matrix (const float *matrix, float *vertex) { int x, y; - ClutterFixed vertex_out[4] = { 0 }; + float vertex_out[4] = { 0 }; for (y = 0; y < 4; y++) for (x = 0; x < 4; x++) - vertex_out[y] += CFX_QMUL (vertex[x], matrix[y + x * 4]); + vertex_out[y] += vertex[x] * matrix[y + x * 4]; memcpy (vertex, vertex_out, sizeof (vertex_out)); } static void -project_vertex (ClutterFixed *modelview, - ClutterFixed *project, - ClutterFixed *vertex) +project_vertex (float *modelview, + float *project, + float *vertex) { int i; @@ -339,79 +307,84 @@ apply_matrix (project, vertex); /* Convert from homogenized coordinates */ for (i = 0; i < 4; i++) - vertex[i] = CFX_QDIV (vertex[i], vertex[3]); + vertex[i] /= vertex[3]; } static void set_clip_plane (GLint plane_num, - const ClutterFixed *vertex_a, - const ClutterFixed *vertex_b) + const float *vertex_a, + const float *vertex_b) { - GLfixed plane[4]; - GLfixed angle; +#if defined (HAVE_COGL_GLES2) || defined (HAVE_COGL_GLES) + GLfloat plane[4]; +#else + GLdouble plane[4]; +#endif + GLfloat angle; _COGL_GET_CONTEXT (ctx, NO_RETVAL); /* Calculate the angle between the axes and the line crossing the two points */ - angle = CFX_QMUL (clutter_atan2i (vertex_b[1] - vertex_a[1], - vertex_b[0] - vertex_a[0]), - CFX_RADIANS_TO_DEGREES); + angle = atan2f (vertex_b[1] - vertex_a[1], + vertex_b[0] - vertex_a[0]) * (180.0/G_PI); - GE( cogl_wrap_glPushMatrix () ); + GE( glPushMatrix () ); /* Load the identity matrix and multiply by the reverse of the projection matrix so we can specify the plane in screen coordinates */ - GE( cogl_wrap_glLoadIdentity () ); - GE( cogl_wrap_glMultMatrixx ((GLfixed *) ctx->inverse_projection) ); + GE( glLoadIdentity () ); + GE( glMultMatrixf ((GLfloat *) ctx->inverse_projection) ); /* Rotate about point a */ - GE( cogl_wrap_glTranslatex (vertex_a[0], vertex_a[1], vertex_a[2]) ); + GE( glTranslatef (vertex_a[0], vertex_a[1], vertex_a[2]) ); /* Rotate the plane by the calculated angle so that it will connect the two points */ - GE( cogl_wrap_glRotatex (angle, 0.0f, 0.0f, 1.0f) ); - GE( cogl_wrap_glTranslatex (-vertex_a[0], -vertex_a[1], -vertex_a[2]) ); + GE( glRotatef (angle, 0.0f, 0.0f, 1.0f) ); + GE( glTranslatef (-vertex_a[0], -vertex_a[1], -vertex_a[2]) ); plane[0] = 0; - plane[1] = -CFX_ONE; + plane[1] = -1.0; plane[2] = 0; plane[3] = vertex_a[1]; - GE( cogl_wrap_glClipPlanex (plane_num, plane) ); - - GE( cogl_wrap_glPopMatrix () ); +#if defined (HAVE_COGL_GLES2) || defined (HAVE_COGL_GLES) + GE( glClipPlanef (plane_num, plane) ); +#else + GE( glClipPlane (plane_num, plane) ); +#endif - GE( cogl_wrap_glEnable (plane_num) ); + GE( glPopMatrix () ); } void -_cogl_set_clip_planes (ClutterFixed x_offset, - ClutterFixed y_offset, - ClutterFixed width, - ClutterFixed height) +_cogl_set_clip_planes (float x_offset, + float y_offset, + float width, + float height) { - GLfixed modelview[16], projection[16]; + GLfloat modelview[16], projection[16]; - ClutterFixed vertex_tl[4] = { x_offset, y_offset, 0, CFX_ONE }; - ClutterFixed vertex_tr[4] = { x_offset + width, y_offset, 0, CFX_ONE }; - ClutterFixed vertex_bl[4] = { x_offset, y_offset + height, 0, CFX_ONE }; - ClutterFixed vertex_br[4] = { x_offset + width, y_offset + height, - 0, CFX_ONE }; + float vertex_tl[4] = { x_offset, y_offset, 0, 1.0 }; + float vertex_tr[4] = { x_offset + width, y_offset, 0, 1.0 }; + float vertex_bl[4] = { x_offset, y_offset + height, 0, 1.0 }; + float vertex_br[4] = { x_offset + width, y_offset + height, + 0, 1.0 }; - GE( cogl_wrap_glGetFixedv (GL_MODELVIEW_MATRIX, modelview) ); - GE( cogl_wrap_glGetFixedv (GL_PROJECTION_MATRIX, projection) ); + GE( glGetFloatv (GL_MODELVIEW_MATRIX, modelview) ); + GE( glGetFloatv (GL_PROJECTION_MATRIX, projection) ); project_vertex (modelview, projection, vertex_tl); project_vertex (modelview, projection, vertex_tr); project_vertex (modelview, projection, vertex_bl); project_vertex (modelview, projection, vertex_br); - /* If the order of the top and bottom lines is different from - the order of the left and right lines then the clip rect must - have been transformed so that the back is visible. We - therefore need to swap one pair of vertices otherwise all of - the planes will be the wrong way around */ + /* If the order of the top and bottom lines is different from the + order of the left and right lines then the clip rect must have + been transformed so that the back is visible. We therefore need + to swap one pair of vertices otherwise all of the planes will be + the wrong way around */ if ((vertex_tl[0] < vertex_tr[0] ? 1 : 0) != (vertex_bl[1] < vertex_tl[1] ? 1 : 0)) { - ClutterFixed temp[4]; + float temp[4]; memcpy (temp, vertex_tl, sizeof (temp)); memcpy (vertex_tl, vertex_tr, sizeof (temp)); memcpy (vertex_tr, temp, sizeof (temp)); @@ -426,39 +399,21 @@ set_clip_plane (GL_CLIP_PLANE3, vertex_bl, vertex_tl); } -static int -compare_y_coordinate (const void *a, const void *b) -{ - GLfixed ay = ((const GLfixed *) a)[1]; - GLfixed by = ((const GLfixed *) b)[1]; - - return ay < by ? -1 : ay > by ? 1 : 0; -} - void -_cogl_add_stencil_clip (ClutterFixed x_offset, - ClutterFixed y_offset, - ClutterFixed width, - ClutterFixed height, +_cogl_add_stencil_clip (float x_offset, + float y_offset, + float width, + float height, gboolean first) { - gboolean has_clip_planes - = cogl_features_available (COGL_FEATURE_FOUR_CLIP_PLANES); - _COGL_GET_CONTEXT (ctx, NO_RETVAL); - if (has_clip_planes) - { - GE( cogl_wrap_glDisable (GL_CLIP_PLANE3) ); - GE( cogl_wrap_glDisable (GL_CLIP_PLANE2) ); - GE( cogl_wrap_glDisable (GL_CLIP_PLANE1) ); - GE( cogl_wrap_glDisable (GL_CLIP_PLANE0) ); - } + cogl_material_flush_gl_state (ctx->stencil_material, NULL); if (first) { - GE( cogl_wrap_glEnable (GL_STENCIL_TEST) ); - + GE( glEnable (GL_STENCIL_TEST) ); + /* Initially disallow everything */ GE( glClearStencil (0) ); GE( glClear (GL_STENCIL_BUFFER_BIT) ); @@ -467,145 +422,31 @@ GE( glStencilFunc (GL_NEVER, 0x1, 0x1) ); GE( glStencilOp (GL_REPLACE, GL_REPLACE, GL_REPLACE) ); - cogl_rectanglex (x_offset, y_offset, width, height); + cogl_rectangle (x_offset, y_offset, + x_offset + width, y_offset + height); } - else if (ctx->num_stencil_bits > 1) + else { /* Add one to every pixel of the stencil buffer in the rectangle */ GE( glStencilFunc (GL_NEVER, 0x1, 0x3) ); GE( glStencilOp (GL_INCR, GL_INCR, GL_INCR) ); - cogl_rectanglex (x_offset, y_offset, width, height); + cogl_rectangle (x_offset, y_offset, + x_offset + width, y_offset + height); /* Subtract one from all pixels in the stencil buffer so that only pixels where both the original stencil buffer and the rectangle are set will be valid */ GE( glStencilOp (GL_DECR, GL_DECR, GL_DECR) ); - GE( cogl_wrap_glPushMatrix () ); - GE( cogl_wrap_glLoadIdentity () ); - GE( cogl_wrap_glMatrixMode (GL_PROJECTION) ); - GE( cogl_wrap_glPushMatrix () ); - GE( cogl_wrap_glLoadIdentity () ); - cogl_rectanglex (-CFX_ONE, -CFX_ONE, - CLUTTER_INT_TO_FIXED (2), - CLUTTER_INT_TO_FIXED (2)); - GE( cogl_wrap_glPopMatrix () ); - GE( cogl_wrap_glMatrixMode (GL_MODELVIEW) ); - GE( cogl_wrap_glPopMatrix () ); - } - else - { - /* Slower fallback if there is exactly one stencil bit. This - tries to draw enough triangles to tessalate around the - rectangle so that it can subtract from the stencil buffer for - every pixel in the screen except those in the rectangle */ - GLfixed modelview[16], projection[16]; - GLfixed temp_point[4]; - GLfixed left_edge, right_edge, bottom_edge, top_edge; - int i; - GLfixed points[16] = - { - x_offset, y_offset, 0, CFX_ONE, - x_offset + width, y_offset, 0, CFX_ONE, - x_offset, y_offset + height, 0, CFX_ONE, - x_offset + width, y_offset + height, 0, CFX_ONE - }; - GLfixed draw_points[12]; - - GE( cogl_wrap_glGetFixedv (GL_MODELVIEW_MATRIX, modelview) ); - GE( cogl_wrap_glGetFixedv (GL_PROJECTION_MATRIX, projection) ); - - /* Project all of the vertices into screen coordinates */ - for (i = 0; i < 4; i++) - project_vertex (modelview, projection, points + i * 4); - - /* Sort the points by y coordinate */ - qsort (points, 4, sizeof (GLfixed) * 4, compare_y_coordinate); - - /* Put the bottom two pairs and the top two pairs in - left-right order */ - if (points[0] > points[4]) - { - memcpy (temp_point, points, sizeof (GLfixed) * 4); - memcpy (points, points + 4, sizeof (GLfixed) * 4); - memcpy (points + 4, temp_point, sizeof (GLfixed) * 4); - } - if (points[8] > points[12]) - { - memcpy (temp_point, points + 8, sizeof (GLfixed) * 4); - memcpy (points + 8, points + 12, sizeof (GLfixed) * 4); - memcpy (points + 12, temp_point, sizeof (GLfixed) * 4); - } - - /* If the clip rect goes outside of the screen then use the - extents of the rect instead */ - left_edge = MIN (-CFX_ONE, MIN (points[0], points[8])); - right_edge = MAX ( CFX_ONE, MAX (points[4], points[12])); - bottom_edge = MIN (-CFX_ONE, MIN (points[1], points[5])); - top_edge = MAX ( CFX_ONE, MAX (points[9], points[13])); - - /* Using the identity matrix for the projection and - modelview matrix, draw the triangles around the inner - rectangle */ - GE( glStencilFunc (GL_NEVER, 0x1, 0x1) ); - GE( glStencilOp (GL_ZERO, GL_ZERO, GL_ZERO) ); - GE( cogl_wrap_glPushMatrix () ); - GE( cogl_wrap_glLoadIdentity () ); - GE( cogl_wrap_glMatrixMode (GL_PROJECTION) ); - GE( cogl_wrap_glPushMatrix () ); - GE( cogl_wrap_glLoadIdentity () ); - - cogl_enable (COGL_ENABLE_VERTEX_ARRAY - | (ctx->color_alpha < 255 ? COGL_ENABLE_BLEND : 0)); - GE( cogl_wrap_glVertexPointer (2, GL_FIXED, 0, draw_points) ); - - /* Clear the left side */ - draw_points[0] = left_edge; draw_points[1] = bottom_edge; - draw_points[2] = points[0]; draw_points[3] = points[1]; - draw_points[4] = left_edge; draw_points[5] = points[1]; - draw_points[6] = points[8]; draw_points[7] = points[9]; - draw_points[8] = left_edge; draw_points[9] = points[9]; - draw_points[10] = left_edge; draw_points[11] = top_edge; - GE( cogl_wrap_glDrawArrays (GL_TRIANGLE_STRIP, 0, 6) ); - - /* Clear the right side */ - draw_points[0] = right_edge; draw_points[1] = top_edge; - draw_points[2] = points[12]; draw_points[3] = points[13]; - draw_points[4] = right_edge; draw_points[5] = points[13]; - draw_points[6] = points[4]; draw_points[7] = points[5]; - draw_points[8] = right_edge; draw_points[9] = points[5]; - draw_points[10] = right_edge; draw_points[11] = bottom_edge; - GE( cogl_wrap_glDrawArrays (GL_TRIANGLE_STRIP, 0, 6) ); - - /* Clear the top side */ - draw_points[0] = left_edge; draw_points[1] = top_edge; - draw_points[2] = points[8]; draw_points[3] = points[9]; - draw_points[4] = points[8]; draw_points[5] = top_edge; - draw_points[6] = points[12]; draw_points[7] = points[13]; - draw_points[8] = points[12]; draw_points[9] = top_edge; - draw_points[10] = right_edge; draw_points[11] = top_edge; - GE( cogl_wrap_glDrawArrays (GL_TRIANGLE_STRIP, 0, 6) ); - - /* Clear the bottom side */ - draw_points[0] = left_edge; draw_points[1] = bottom_edge; - draw_points[2] = points[0]; draw_points[3] = points[1]; - draw_points[4] = points[0]; draw_points[5] = bottom_edge; - draw_points[6] = points[4]; draw_points[7] = points[5]; - draw_points[8] = points[4]; draw_points[9] = bottom_edge; - draw_points[10] = right_edge; draw_points[11] = bottom_edge; - GE( cogl_wrap_glDrawArrays (GL_TRIANGLE_STRIP, 0, 6) ); - - GE( cogl_wrap_glPopMatrix () ); - GE( cogl_wrap_glMatrixMode (GL_MODELVIEW) ); - GE( cogl_wrap_glPopMatrix () ); - } - - if (has_clip_planes) - { - GE( cogl_wrap_glEnable (GL_CLIP_PLANE0) ); - GE( cogl_wrap_glEnable (GL_CLIP_PLANE1) ); - GE( cogl_wrap_glEnable (GL_CLIP_PLANE2) ); - GE( cogl_wrap_glEnable (GL_CLIP_PLANE3) ); + GE( glPushMatrix () ); + GE( glLoadIdentity () ); + GE( glMatrixMode (GL_PROJECTION) ); + GE( glPushMatrix () ); + GE( glLoadIdentity () ); + cogl_rectangle (-1.0, -1.0, 1.0, 1.0); + GE( glPopMatrix () ); + GE( glMatrixMode (GL_MODELVIEW) ); + GE( glPopMatrix () ); } /* Restore the stencil mode */ @@ -614,135 +455,136 @@ } void -_cogl_set_matrix (const ClutterFixed *matrix) +_cogl_set_matrix (const float *matrix) { - GE( cogl_wrap_glLoadIdentity () ); - GE( cogl_wrap_glMultMatrixx (matrix) ); + GE( glLoadIdentity () ); + GE( glMultMatrixf (matrix) ); } void _cogl_disable_stencil_buffer (void) { - GE( cogl_wrap_glDisable (GL_STENCIL_TEST) ); + GE( glDisable (GL_STENCIL_TEST) ); } void -_cogl_disable_clip_planes (void) +_cogl_enable_clip_planes (void) { - GE( cogl_wrap_glDisable (GL_CLIP_PLANE3) ); - GE( cogl_wrap_glDisable (GL_CLIP_PLANE2) ); - GE( cogl_wrap_glDisable (GL_CLIP_PLANE1) ); - GE( cogl_wrap_glDisable (GL_CLIP_PLANE0) ); + GE( glEnable (GL_CLIP_PLANE0) ); + GE( glEnable (GL_CLIP_PLANE1) ); + GE( glEnable (GL_CLIP_PLANE2) ); + GE( glEnable (GL_CLIP_PLANE3) ); } void -cogl_alpha_func (COGLenum func, - ClutterFixed ref) +_cogl_disable_clip_planes (void) { - GE( cogl_wrap_glAlphaFunc (func, CLUTTER_FIXED_TO_FLOAT(ref)) ); + GE( glDisable (GL_CLIP_PLANE3) ); + GE( glDisable (GL_CLIP_PLANE2) ); + GE( glDisable (GL_CLIP_PLANE1) ); + GE( glDisable (GL_CLIP_PLANE0) ); } -/* - * Fixed point implementation of the perspective function - */ void -cogl_perspective (ClutterFixed fovy, - ClutterFixed aspect, - ClutterFixed zNear, - ClutterFixed zFar) +cogl_perspective (float fovy, + float aspect, + float zNear, + float zFar) { - ClutterFixed xmax, ymax; - ClutterFixed x, y, c, d; - ClutterFixed fovy_rad_half = CFX_MUL (fovy, CFX_PI) / 360; + float xmax, ymax; + float x, y, c, d; + float fovy_rad_half = (fovy * G_PI) / 360; + + GLfloat m[16]; - GLfixed m[16]; - _COGL_GET_CONTEXT (ctx, NO_RETVAL); memset (&m[0], 0, sizeof (m)); - GE( cogl_wrap_glMatrixMode (GL_PROJECTION) ); - GE( cogl_wrap_glLoadIdentity () ); + GE( glMatrixMode (GL_PROJECTION) ); + GE( glLoadIdentity () ); - /* + /* * Based on the original algorithm in perspective(): - * + * * 1) xmin = -xmax => xmax + xmin == 0 && xmax - xmin == 2 * xmax * same true for y, hence: a == 0 && b == 0; * - * 2) When working with small numbers, we can are loosing significant - * precision, hence we use clutter_qmulx() here, not the fast macro. + * 2) When working with small numbers, we are loosing significant + * precision */ - ymax = clutter_qmulx (zNear, CFX_DIV (clutter_sinx (fovy_rad_half), - clutter_cosx (fovy_rad_half))); - xmax = clutter_qmulx (ymax, aspect); - - x = CFX_DIV (zNear, xmax); - y = CFX_DIV (zNear, ymax); - c = CFX_DIV (-(zFar + zNear), ( zFar - zNear)); - d = CFX_DIV (-(clutter_qmulx (2*zFar, zNear)), (zFar - zNear)); + ymax = (zNear * (sinf (fovy_rad_half) / cosf (fovy_rad_half))); + xmax = (ymax * aspect); + + x = (zNear / xmax); + y = (zNear / ymax); + c = (-(zFar + zNear) / ( zFar - zNear)); + d = (-(2 * zFar) * zNear) / (zFar - zNear); #define M(row,col) m[col*4+row] M(0,0) = x; M(1,1) = y; M(2,2) = c; M(2,3) = d; - M(3,2) = 1 + ~CFX_ONE; + M(3,2) = -1.0; - GE( cogl_wrap_glMultMatrixx (m) ); + GE( glMultMatrixf (m) ); - GE( cogl_wrap_glMatrixMode (GL_MODELVIEW) ); + GE( glMatrixMode (GL_MODELVIEW) ); /* Calculate and store the inverse of the matrix */ - memset (ctx->inverse_projection, 0, sizeof (ClutterFixed) * 16); + memset (ctx->inverse_projection, 0, sizeof (float) * 16); #define m ctx->inverse_projection - M(0, 0) = CFX_QDIV (CFX_ONE, x); - M(1, 1) = CFX_QDIV (CFX_ONE, y); - M(2, 3) = -CFX_ONE; - M(3, 2) = CFX_QDIV (CFX_ONE, d); - M(3, 3) = CFX_QDIV (c, d); + M(0, 0) = (1.0 / x); + M(1, 1) = (1.0 / y); + M(2, 3) = -1.0; + M(3, 2) = (1.0 / d); + M(3, 3) = (c / d); #undef m #undef M } void -cogl_frustum (ClutterFixed left, - ClutterFixed right, - ClutterFixed bottom, - ClutterFixed top, - ClutterFixed z_near, - ClutterFixed z_far) +cogl_frustum (float left, + float right, + float bottom, + float top, + float z_near, + float z_far) { - ClutterFixed c, d; + float c, d; _COGL_GET_CONTEXT (ctx, NO_RETVAL); - GE( cogl_wrap_glMatrixMode (GL_PROJECTION) ); - GE( cogl_wrap_glLoadIdentity () ); + GE( glMatrixMode (GL_PROJECTION) ); + GE( glLoadIdentity () ); - GE( cogl_wrap_glFrustumx (left, right, - bottom, top, - z_near, z_far) ); + GE( glFrustumf (left, + right, + bottom, + top, + z_near, + z_far) ); - GE( cogl_wrap_glMatrixMode (GL_MODELVIEW) ); + GE( glMatrixMode (GL_MODELVIEW) ); /* Calculate and store the inverse of the matrix */ - memset (ctx->inverse_projection, 0, sizeof (ClutterFixed) * 16); + memset (ctx->inverse_projection, 0, sizeof (float) * 16); - c = -CFX_QDIV (z_far + z_near, z_far - z_near); - d = -CFX_QDIV (2 * CFX_QMUL (z_far, z_near), z_far - z_near); + c = - (z_far + z_near) / (z_far - z_near); + d = - (2 * (z_far * z_near)) / (z_far - z_near); #define M(row,col) ctx->inverse_projection[col*4+row] - M(0,0) = CFX_QDIV (right - left, 2 * z_near); - M(0,3) = CFX_QDIV (right + left, 2 * z_near); - M(1,1) = CFX_QDIV (top - bottom, 2 * z_near); - M(1,3) = CFX_QDIV (top + bottom, 2 * z_near); - M(2,3) = -CFX_ONE; - M(3,2) = CFX_QDIV (CFX_ONE, d); - M(3,3) = CFX_QDIV (c, d); -#undef M + M(0,0) = (right - left) / (2 * z_near); + M(0,3) = (right + left) / (2 * z_near); + M(1,1) = (top - bottom) / (2 * z_near); + M(1,3) = (top + bottom) / (2 * z_near); + M(2,3) = -1.0; + M(3,2) = 1.0 / d; + M(3,3) = c / d; +#undef M } void @@ -753,67 +595,57 @@ } void -cogl_setup_viewport (guint w, - guint h, - ClutterFixed fovy, - ClutterFixed aspect, - ClutterFixed z_near, - ClutterFixed z_far) -{ - gint width = (gint) w; - gint height = (gint) h; - ClutterFixed z_camera; - +cogl_setup_viewport (guint width, + guint height, + float fovy, + float aspect, + float z_near, + float z_far) +{ + float z_camera; + float projection_matrix[16]; + GE( glViewport (0, 0, width, height) ); /* For Ortho projection. - * cogl_wrap_glOrthox (0, width << 16, 0, height << 16, -1 << 16, 1 << 16); + * glOrthof (0, width << 16, 0, height << 16, -1 << 16, 1 << 16); */ cogl_perspective (fovy, aspect, z_near, z_far); - - GE( cogl_wrap_glLoadIdentity () ); /* - * camera distance from screen, 0.5 * tan (FOV) + * camera distance from screen * * See comments in ../gl/cogl.c */ -#define DEFAULT_Z_CAMERA 0.869f - z_camera = CLUTTER_FLOAT_TO_FIXED (DEFAULT_Z_CAMERA); - if (fovy != CFX_60) - { - ClutterFixed fovy_rad = CFX_MUL (fovy, CFX_PI) / 180; - - z_camera = CFX_DIV (clutter_sinx (fovy_rad), - clutter_cosx (fovy_rad)) >> 1; - } - + cogl_get_projection_matrix (projection_matrix); + z_camera = 0.5 * projection_matrix[0]; + + GE( glLoadIdentity () ); - GE( cogl_wrap_glTranslatex (-1 << 15, -1 << 15, -z_camera)); + GE( glTranslatef (-0.5f, -0.5f, -z_camera) ); - GE( cogl_wrap_glScalex ( CFX_ONE / width, - -CFX_ONE / height, - CFX_ONE / width)); + GE( glScalef (1.0f / width, -1.0f / height, 1.0f / width) ); - GE( cogl_wrap_glTranslatex (0, -CFX_ONE * height, 0) ); + GE( glTranslatef (0.0f, -1.0 * height, 0.0f) ); } static void _cogl_features_init () { - ClutterFeatureFlags flags = 0; - int max_clip_planes = 0; + CoglFeatureFlags flags = 0; + int max_clip_planes = 0; + GLint num_stencil_bits = 0; _COGL_GET_CONTEXT (ctx, NO_RETVAL); - ctx->num_stencil_bits = 0; - GE( cogl_wrap_glGetIntegerv (GL_STENCIL_BITS, &ctx->num_stencil_bits) ); - if (ctx->num_stencil_bits > 0) + GE( glGetIntegerv (GL_STENCIL_BITS, &num_stencil_bits) ); + /* We need at least three stencil bits to combine clips */ + if (num_stencil_bits > 2) flags |= COGL_FEATURE_STENCIL_BUFFER; - GE( cogl_wrap_glGetIntegerv (GL_MAX_CLIP_PLANES, &max_clip_planes) ); + GE( glGetIntegerv (GL_MAX_CLIP_PLANES, &max_clip_planes) ); if (max_clip_planes >= 4) flags |= COGL_FEATURE_FOUR_CLIP_PLANES; @@ -821,18 +653,19 @@ flags |= COGL_FEATURE_SHADERS_GLSL | COGL_FEATURE_OFFSCREEN; #endif + /* Cache features */ ctx->feature_flags = flags; ctx->features_cached = TRUE; } -ClutterFeatureFlags +CoglFeatureFlags cogl_get_features () { _COGL_GET_CONTEXT (ctx, 0); - + if (!ctx->features_cached) _cogl_features_init (); - + return ctx->feature_flags; } @@ -840,71 +673,91 @@ cogl_features_available (CoglFeatureFlags features) { _COGL_GET_CONTEXT (ctx, 0); - + if (!ctx->features_cached) _cogl_features_init (); - + return (ctx->feature_flags & features) == features; } void -cogl_get_modelview_matrix (ClutterFixed m[16]) +cogl_get_modelview_matrix (float m[16]) { - cogl_wrap_glGetFixedv(GL_MODELVIEW_MATRIX, &m[0]); + glGetFloatv (GL_MODELVIEW_MATRIX, m); } void -cogl_get_projection_matrix (ClutterFixed m[16]) +cogl_get_projection_matrix (float m[16]) { - cogl_wrap_glGetFixedv(GL_PROJECTION_MATRIX, &m[0]); + glGetFloatv (GL_PROJECTION_MATRIX, m); } void -cogl_get_viewport (ClutterFixed v[4]) +cogl_get_viewport (float v[4]) { + /* FIXME: cogl_get_viewport should return a gint vec */ +#if defined (HAVE_COGL_GLES2) || defined (HAVE_COGL_GLES) GLint viewport[4]; int i; - cogl_wrap_glGetIntegerv (GL_VIEWPORT, viewport); + glGetIntegerv (GL_VIEWPORT, viewport); for (i = 0; i < 4; i++) - v[i] = CLUTTER_INT_TO_FIXED (viewport[i]); + v[i] = (float)(viewport[i]); +#else + glGetFloatv (GL_VIEWPORT, v); +#endif } void cogl_get_bitmasks (gint *red, gint *green, gint *blue, gint *alpha) { + GLint value; if (red) - GE( cogl_wrap_glGetIntegerv(GL_RED_BITS, red) ); + { + GE( glGetIntegerv(GL_RED_BITS, &value) ); + *red = value; + } if (green) - GE( cogl_wrap_glGetIntegerv(GL_GREEN_BITS, green) ); + { + GE( glGetIntegerv(GL_GREEN_BITS, &value) ); + *green = value; + } if (blue) - GE( cogl_wrap_glGetIntegerv(GL_BLUE_BITS, blue) ); + { + GE( glGetIntegerv(GL_BLUE_BITS, &value) ); + *blue = value; + } if (alpha) - GE( cogl_wrap_glGetIntegerv(GL_ALPHA_BITS, alpha ) ); + { + GE( glGetIntegerv(GL_ALPHA_BITS, &value ) ); + *alpha = value; + } } void -cogl_fog_set (const ClutterColor *fog_color, - ClutterFixed density, - ClutterFixed z_near, - ClutterFixed z_far) +cogl_fog_set (const CoglColor *fog_color, + float density, + float z_near, + float z_far) { - GLfixed fogColor[4]; + GLfloat fogColor[4]; - fogColor[0] = (fog_color->red << 16) / 0xff; - fogColor[1] = (fog_color->green << 16) / 0xff; - fogColor[2] = (fog_color->blue << 16) / 0xff; - fogColor[3] = (fog_color->alpha << 16) / 0xff; + fogColor[0] = cogl_color_get_red_float (fog_color); + fogColor[1] = cogl_color_get_green_float (fog_color); + fogColor[2] = cogl_color_get_blue_float (fog_color); + fogColor[3] = cogl_color_get_alpha_float (fog_color); - cogl_wrap_glEnable (GL_FOG); + glEnable (GL_FOG); - cogl_wrap_glFogxv (GL_FOG_COLOR, fogColor); + glFogfv (GL_FOG_COLOR, fogColor); - cogl_wrap_glFogx (GL_FOG_MODE, GL_LINEAR); + /* NB: GLES doesn't have glFogi */ + glFogf (GL_FOG_MODE, GL_LINEAR); glHint (GL_FOG_HINT, GL_NICEST); - cogl_wrap_glFogx (GL_FOG_DENSITY, (GLfixed) density); - cogl_wrap_glFogx (GL_FOG_START, (GLfixed) z_near); - cogl_wrap_glFogx (GL_FOG_END, (GLfixed) z_far); + glFogf (GL_FOG_DENSITY, (GLfloat) density); + glFogf (GL_FOG_START, (GLfloat) z_near); + glFogf (GL_FOG_END, (GLfloat) z_far); } + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl-context.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl-context.c --- clutter-0.8.4/clutter/cogl/gles/cogl-context.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gles/cogl-context.c 2009-01-29 08:31:37.000000000 +0000 @@ -28,60 +28,108 @@ #endif #include "cogl.h" - -#include - #include "cogl-internal.h" #include "cogl-util.h" #include "cogl-context.h" +#include "cogl-texture-private.h" +#include "cogl-material-private.h" #include "cogl-gles2-wrapper.h" +#include + static CoglContext *_context = NULL; gboolean cogl_create_context () { + GLubyte default_texture_data[] = { 0xff, 0xff, 0xff, 0x0 }; + gulong enable_flags = 0; + if (_context != NULL) return FALSE; - + /* Allocate context memory */ _context = (CoglContext*) g_malloc (sizeof (CoglContext)); - + /* Init default values */ _context->feature_flags = 0; _context->features_cached = FALSE; - + _context->enable_flags = 0; _context->color_alpha = 255; - - _context->path_nodes = NULL; - _context->path_nodes_cap = 0; - _context->path_nodes_size = 0; - + + _context->material_handles = NULL; + _context->material_layer_handles = NULL; + _context->default_material = cogl_material_new (); + _context->source_material = NULL; + _context->texture_handles = NULL; - _context->texture_vertices_size = 0; - _context->texture_vertices = NULL; - + _context->default_gl_texture_2d_tex = COGL_INVALID_HANDLE; + _context->default_gl_texture_rect_tex = COGL_INVALID_HANDLE; + _context->texture_download_material = COGL_INVALID_HANDLE; + + _context->journal = g_array_new (FALSE, FALSE, sizeof (CoglJournalEntry)); + _context->logged_vertices = g_array_new (FALSE, FALSE, sizeof (GLfloat)); + _context->static_indices = g_array_new (FALSE, FALSE, sizeof (GLushort)); + _context->polygon_vertices = g_array_new (FALSE, FALSE, + sizeof (CoglTextureGLVertex)); + + _context->current_material = NULL; + _context->current_material_flags = 0; + _context->current_layers = g_array_new (FALSE, FALSE, + sizeof (CoglLayerInfo)); + _context->n_texcoord_arrays_enabled = 0; + _context->fbo_handles = NULL; - _context->program_handles = NULL; - _context->shader_handles = NULL; _context->draw_buffer = COGL_WINDOW_BUFFER; - - _context->blend_src_factor = CGL_SRC_ALPHA; - _context->blend_dst_factor = CGL_ONE_MINUS_SRC_ALPHA; + + _context->shader_handles = NULL; + + _context->program_handles = NULL; + + _context->vertex_buffer_handles = NULL; + + _context->path_nodes = g_array_new (FALSE, FALSE, sizeof (CoglPathNode)); + _context->last_path = 0; + _context->stencil_material = cogl_material_new (); /* Init the GLES2 wrapper */ #ifdef HAVE_COGL_GLES2 cogl_gles2_wrapper_init (&_context->gles2); #endif - - /* Init OpenGL state */ - GE( cogl_wrap_glTexEnvx (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE) ); - GE( glColorMask (TRUE, TRUE, TRUE, FALSE) ); - GE( glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) ); - cogl_enable (0); - + + /* Initialise the clip stack */ + _cogl_clip_stack_state_init (); + + /* Create default textures used for fall backs */ + _context->default_gl_texture_2d_tex = + cogl_texture_new_from_data (1, /* width */ + 1, /* height */ + -1, /* max waste */ + COGL_TEXTURE_NONE, /* flags */ + COGL_PIXEL_FORMAT_RGBA_8888, /* data format */ + /* internal format */ + COGL_PIXEL_FORMAT_RGBA_8888, + 0, /* auto calc row stride */ + default_texture_data); + _context->default_gl_texture_rect_tex = + cogl_texture_new_from_data (1, /* width */ + 1, /* height */ + -1, /* max waste */ + COGL_TEXTURE_NONE, /* flags */ + COGL_PIXEL_FORMAT_RGBA_8888, /* data format */ + /* internal format */ + COGL_PIXEL_FORMAT_RGBA_8888, + 0, /* auto calc row stride */ + default_texture_data); + + cogl_set_source (_context->default_material); + cogl_material_flush_gl_state (_context->source_material, NULL); + enable_flags = + cogl_material_get_cogl_enable_flags (_context->source_material); + cogl_enable (enable_flags); + return TRUE; } @@ -91,13 +139,11 @@ if (_context == NULL) return; -#ifdef HAVE_COGL_GLES2 - cogl_gles2_wrapper_deinit (&_context->gles2); -#endif + _cogl_clip_stack_state_destroy (); + + if (_context->path_nodes) + g_array_free (_context->path_nodes, TRUE); - if (_context->texture_vertices) - g_free (_context->texture_vertices); - if (_context->texture_handles) g_array_free (_context->texture_handles, TRUE); if (_context->fbo_handles) @@ -106,16 +152,36 @@ g_array_free (_context->shader_handles, TRUE); if (_context->program_handles) g_array_free (_context->program_handles, TRUE); - + + if (_context->default_gl_texture_2d_tex) + cogl_texture_unref (_context->default_gl_texture_2d_tex); + if (_context->default_gl_texture_rect_tex) + cogl_texture_unref (_context->default_gl_texture_rect_tex); + + if (_context->default_material) + cogl_material_unref (_context->default_material); + + if (_context->journal) + g_array_free (_context->journal, TRUE); + if (_context->logged_vertices) + g_array_free (_context->logged_vertices, TRUE); + + if (_context->static_indices) + g_array_free (_context->static_indices, TRUE); + if (_context->polygon_vertices) + g_array_free (_context->polygon_vertices, TRUE); + if (_context->current_layers) + g_array_free (_context->current_layers, TRUE); + g_free (_context); } CoglContext * _cogl_context_get_default () { - /* Create if doesn't exists yet */ + /* Create if doesn't exist yet */ if (_context == NULL) cogl_create_context (); - + return _context; } diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl-context.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl-context.h --- clutter-0.8.4/clutter/cogl/gles/cogl-context.h 2008-11-04 16:36:17.000000000 +0000 +++ clutter-0.9.0/clutter/cogl/gles/cogl-context.h 2009-01-28 16:45:25.000000000 +0000 @@ -27,53 +27,83 @@ #define __COGL_CONTEXT_H #include "cogl-primitives.h" +#include "cogl-clip-stack.h" #include "cogl-gles2-wrapper.h" typedef struct { - GLfixed v[3]; - GLfixed t[2]; - GLfixed c[4]; + GLfloat v[3]; + GLfloat t[2]; + GLubyte c[4]; } CoglTextureGLVertex; typedef struct { /* Features cache */ - CoglFeatureFlags feature_flags; - gboolean features_cached; - GLint num_stencil_bits; - + CoglFeatureFlags feature_flags; + gboolean features_cached; + /* Enable cache */ - gulong enable_flags; - guint8 color_alpha; - COGLenum blend_src_factor; - COGLenum blend_dst_factor; - - /* Primitives */ - CoglFixedVec2 path_start; - CoglFixedVec2 path_pen; - CoglFixedVec2 *path_nodes; - guint path_nodes_cap; - guint path_nodes_size; - CoglFixedVec2 path_nodes_min; - CoglFixedVec2 path_nodes_max; - + gulong enable_flags; + guint8 color_alpha; + + gboolean enable_backface_culling; + /* Cache of inverse projection matrix */ - ClutterFixed inverse_projection[16]; + float inverse_projection[16]; + + /* Materials */ + GArray *material_handles; + GArray *material_layer_handles; + CoglHandle default_material; + CoglHandle source_material; /* Textures */ - GArray *texture_handles; - CoglTextureGLVertex *texture_vertices; - gulong texture_vertices_size; - + GArray *texture_handles; + CoglHandle default_gl_texture_2d_tex; + CoglHandle default_gl_texture_rect_tex; + CoglHandle texture_download_material; + + /* Batching geometry... */ + /* We journal the texture rectangles we want to submit to OpenGL so + * we have an oppertunity to optimise the final order so that we + * can batch things together. */ + GArray *journal; + GArray *logged_vertices; + GArray *static_indices; + GArray *polygon_vertices; + + /* Some simple caching, to minimize state changes... */ + CoglHandle current_material; + gulong current_material_flags; + GArray *current_layers; + guint n_texcoord_arrays_enabled; + /* Framebuffer objects */ - GArray *fbo_handles; - CoglBufferTarget draw_buffer; + GArray *fbo_handles; + CoglBufferTarget draw_buffer; /* Shaders */ - GArray *program_handles; - GArray *shader_handles; + GArray *shader_handles; + + /* Programs */ + GArray *program_handles; + + /* Clip stack */ + CoglClipStackState clip; + + /* Vertex buffers */ + GArray *vertex_buffer_handles; + + /* Primitives */ + floatVec2 path_start; + floatVec2 path_pen; + GArray *path_nodes; + guint last_path; + floatVec2 path_nodes_min; + floatVec2 path_nodes_max; + CoglHandle stencil_material; #ifdef HAVE_COGL_GLES2 CoglGles2Wrapper gles2; @@ -82,7 +112,7 @@ supported */ GLint viewport_store[4]; #endif - + } CoglContext; CoglContext * @@ -93,6 +123,6 @@ CoglContext *ctxvar = _cogl_context_get_default (); \ if (ctxvar == NULL) return retval; -#define NO_RETVAL +#define NO_RETVAL #endif /* __COGL_CONTEXT_H */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl-defines.h.in /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl-defines.h.in --- clutter-0.8.4/clutter/cogl/gles/cogl-defines.h.in 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gles/cogl-defines.h.in 2009-01-28 16:45:25.000000000 +0000 @@ -162,7 +162,11 @@ #define CGL_STENCIL_PASS_DEPTH_PASS GL_STENCIL_PASS_DEPTH_PASS #define CGL_STENCIL_REF GL_STENCIL_REF #define CGL_STENCIL_WRITEMASK GL_STENCIL_WRITEMASK +#ifdef HAVE_COGL_GLES2 +#define CGL_MATRIX_MODE 0x0BA0 /* bad style but works for now */ +#else #define CGL_MATRIX_MODE GL_MATRIX_MODE +#endif #define CGL_VIEWPORT GL_VIEWPORT #define CGL_MODELVIEW_STACK_DEPTH GL_MODELVIEW_STACK_DEPTH #define CGL_PROJECTION_STACK_DEPTH GL_PROJECTION_STACK_DEPTH @@ -190,7 +194,11 @@ #define CGL_MAX_VIEWPORT_DIMS GL_MAX_VIEWPORT_DIMS #define CGL_MAX_ELEMENTS_VERTICES GL_MAX_ELEMENTS_VERTICES #define CGL_MAX_ELEMENTS_INDICES GL_MAX_ELEMENTS_INDICES -#define CGL_MAX_TEXTURE_UNITS GL_MAX_TEXTURE_UNITS +#ifdef HAVE_COGL_GLES2 +#define CGL_MAX_COMBINED_TEXTURE_IMAGE_UNITS GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS +#else +#define CGL_MAX_COMBINED_TEXTURE_IMAGE_UNITS GL_MAX_TEXTURE_UNITS +#endif #define CGL_SUBPIXEL_BITS GL_SUBPIXEL_BITS #define CGL_RED_BITS GL_RED_BITS #define CGL_GREEN_BITS GL_GREEN_BITS @@ -315,7 +323,7 @@ /* PixelType */ /* GL_UNSIGNED_BYTE */ -#define CGL_UNSIGNED_SHORT_4_4_4_4 GL_UNSIGNED_SHORT_4_4_4_4 +#define CGL_UNSIGNED_SHORT_4_4_4_4 GL_UNSIGNED_SHORT_4_4_4_4 #define CGL_UNSIGNED_SHORT_5_5_5_1 GL_UNSIGNED_SHORT_5_5_5_1 #define CGL_UNSIGNED_SHORT_5_6_5 CGL_UNSIGNED_SHORT_5_6_5 diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl-fbo.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl-fbo.c --- clutter-0.8.4/clutter/cogl/gles/cogl-fbo.c 2008-11-04 16:36:17.000000000 +0000 +++ clutter-0.9.0/clutter/cogl/gles/cogl-fbo.c 2009-01-28 16:45:25.000000000 +0000 @@ -30,7 +30,7 @@ #include "cogl.h" #include "cogl-internal.h" #include "cogl-util.h" -#include "cogl-texture.h" +#include "cogl-texture-private.h" #include "cogl-fbo.h" #include "cogl-context.h" #include "cogl-handle.h" @@ -206,33 +206,33 @@ from a non-screen buffer */ GE( glGetIntegerv (GL_VIEWPORT, ctx->viewport_store) ); - GE( cogl_wrap_glMatrixMode (GL_PROJECTION) ); - GE( cogl_wrap_glPushMatrix () ); - GE( cogl_wrap_glLoadIdentity () ); - - GE( cogl_wrap_glMatrixMode (GL_MODELVIEW) ); - GE( cogl_wrap_glPushMatrix () ); - GE( cogl_wrap_glLoadIdentity () ); + GE( glMatrixMode (GL_PROJECTION) ); + GE( glPushMatrix () ); + GE( glLoadIdentity () ); + + GE( glMatrixMode (GL_MODELVIEW) ); + GE( glPushMatrix () ); + GE( glLoadIdentity () ); } else { /* Override viewport and matrix setup if redirecting from another offscreen buffer */ - GE( cogl_wrap_glMatrixMode (GL_PROJECTION) ); - GE( cogl_wrap_glLoadIdentity () ); + GE( glMatrixMode (GL_PROJECTION) ); + GE( glLoadIdentity () ); - GE( cogl_wrap_glMatrixMode (GL_MODELVIEW) ); - GE( cogl_wrap_glLoadIdentity () ); + GE( glMatrixMode (GL_MODELVIEW) ); + GE( glLoadIdentity () ); } /* Setup new viewport and matrices */ GE( glViewport (0, 0, fbo->width, fbo->height) ); - GE( cogl_wrap_glTranslatex (-CFX_ONE, -CFX_ONE, 0) ); - GE( cogl_wrap_glScalex (CFX_QDIV (CLUTTER_INT_TO_FIXED (2), - CLUTTER_INT_TO_FIXED (fbo->width)), - CFX_QDIV (CLUTTER_INT_TO_FIXED (2), - CLUTTER_INT_TO_FIXED (fbo->height)), - CFX_ONE) ); + GE( glTranslatef (-1.0, -1.0, 0) ); + GE( glScalef (((float)(2) / + (float)(fbo->width)), + ((float)(2) / + (float)(fbo->height)), + 1.0) ); /* Bind offscreen framebuffer object */ GE( glBindFramebuffer (GL_FRAMEBUFFER, fbo->gl_handle) ); @@ -265,11 +265,11 @@ GE( glViewport (ctx->viewport_store[0], ctx->viewport_store[1], ctx->viewport_store[2], ctx->viewport_store[3]) ); - GE( cogl_wrap_glMatrixMode (GL_PROJECTION) ); - GE( cogl_wrap_glPopMatrix () ); + GE( glMatrixMode (GL_PROJECTION) ); + GE( glPopMatrix () ); - GE( cogl_wrap_glMatrixMode (GL_MODELVIEW) ); - GE( cogl_wrap_glPopMatrix () ); + GE( glMatrixMode (GL_MODELVIEW) ); + GE( glPopMatrix () ); } /* Bind window framebuffer object */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl-fixed-fragment-shader.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl-fixed-fragment-shader.c --- clutter-0.8.4/clutter/cogl/gles/cogl-fixed-fragment-shader.c 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/clutter/cogl/gles/cogl-fixed-fragment-shader.c 2009-01-29 15:51:44.000000000 +0000 @@ -24,19 +24,26 @@ */ ; -const char cogl_fixed_fragment_shader_start[] = +const char cogl_fixed_fragment_shader_variables_start[] = "\n" "/* There is no default precision for floats in fragment shaders in\n" " GLES 2 so we need to define one */\n" - "precision mediump float;\n" + "precision highp float;\n" + "\n" + ; +const char cogl_fixed_fragment_shader_inputs[] = "\n" "/* Inputs from the vertex shader */\n" "varying vec4 frag_color;\n" - "varying vec2 tex_coord;\n" "varying float fog_amount;\n" "\n" + ; +const char cogl_fixed_fragment_shader_texturing_options[] = + "\n" "/* Texturing options */\n" - "uniform sampler2D texture_unit;\n" + "\n" + ; +const char cogl_fixed_fragment_shader_fogging_options[] = "\n" "/* Fogging options */\n" "uniform vec4 fog_color;\n" @@ -44,31 +51,15 @@ "/* Alpha test options */\n" "uniform float alpha_test_ref;\n" "\n" + ; +const char cogl_fixed_fragment_shader_main_declare[] = + "\n" "void\n" "main (void)\n" "{\n" ; -const char cogl_fixed_fragment_shader_texture_alpha_only[] = - "\n" - " /* If the texture only has an alpha channel (eg, with the textures\n" - " from the pango renderer) then the RGB components will be\n" - " black. We want to use the RGB from the current color in that\n" - " case */\n" - " gl_FragColor = frag_color;\n" - " gl_FragColor.a *= texture2D (texture_unit, tex_coord).a;\n" - "\n" - ; -const char cogl_fixed_fragment_shader_texture[] = - "\n" - " /* This pointless extra variable is needed to work around an\n" - " apparent bug in the PowerVR drivers. Without it the alpha\n" - " blending seems to stop working */\n" - " vec4 frag_color_copy = frag_color;\n" - " gl_FragColor = frag_color_copy * texture2D (texture_unit, tex_coord);\n" +const char cogl_fixed_fragment_shader_main_start[] = "\n" - ; -const char cogl_fixed_fragment_shader_solid_color[] = - " gl_FragColor = frag_color;\n" "\n" ; const char cogl_fixed_fragment_shader_fog[] = diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl-fixed-fragment-shader.glsl /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl-fixed-fragment-shader.glsl --- clutter-0.8.4/clutter/cogl/gles/cogl-fixed-fragment-shader.glsl 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gles/cogl-fixed-fragment-shader.glsl 2009-01-28 16:45:25.000000000 +0000 @@ -1,16 +1,20 @@ -/*** cogl_fixed_fragment_shader_start ***/ +/*** cogl_fixed_fragment_shader_variables_start ***/ /* There is no default precision for floats in fragment shaders in GLES 2 so we need to define one */ -precision mediump float; +precision highp float; + +/*** cogl_fixed_fragment_shader_inputs ***/ /* Inputs from the vertex shader */ varying vec4 frag_color; -varying vec2 tex_coord; varying float fog_amount; +/*** cogl_fixed_fragment_shader_texturing_options ***/ + /* Texturing options */ -uniform sampler2D texture_unit; + +/*** cogl_fixed_fragment_shader_fogging_options ***/ /* Fogging options */ uniform vec4 fog_color; @@ -18,28 +22,13 @@ /* Alpha test options */ uniform float alpha_test_ref; +/*** cogl_fixed_fragment_shader_main_declare ***/ + void main (void) { - /*** cogl_fixed_fragment_shader_texture_alpha_only ***/ - - /* If the texture only has an alpha channel (eg, with the textures - from the pango renderer) then the RGB components will be - black. We want to use the RGB from the current color in that - case */ - gl_FragColor = frag_color; - gl_FragColor.a *= texture2D (texture_unit, tex_coord).a; - - /*** cogl_fixed_fragment_shader_texture ***/ - - /* This pointless extra variable is needed to work around an - apparent bug in the PowerVR drivers. Without it the alpha - blending seems to stop working */ - vec4 frag_color_copy = frag_color; - gl_FragColor = frag_color_copy * texture2D (texture_unit, tex_coord); + /*** cogl_fixed_fragment_shader_main_start ***/ - /*** cogl_fixed_fragment_shader_solid_color ***/ - gl_FragColor = frag_color; /*** cogl_fixed_fragment_shader_fog ***/ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl-fixed-fragment-shader.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl-fixed-fragment-shader.h --- clutter-0.8.4/clutter/cogl/gles/cogl-fixed-fragment-shader.h 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/clutter/cogl/gles/cogl-fixed-fragment-shader.h 2009-01-29 15:51:44.000000000 +0000 @@ -26,10 +26,12 @@ #ifndef __COGL_FIXED_FRAGMENT_SHADER_H #define __COGL_FIXED_FRAGMENT_SHADER_H -extern const char cogl_fixed_fragment_shader_start[]; -extern const char cogl_fixed_fragment_shader_texture_alpha_only[]; -extern const char cogl_fixed_fragment_shader_texture[]; -extern const char cogl_fixed_fragment_shader_solid_color[]; +extern const char cogl_fixed_fragment_shader_variables_start[]; +extern const char cogl_fixed_fragment_shader_inputs[]; +extern const char cogl_fixed_fragment_shader_texturing_options[]; +extern const char cogl_fixed_fragment_shader_fogging_options[]; +extern const char cogl_fixed_fragment_shader_main_declare[]; +extern const char cogl_fixed_fragment_shader_main_start[]; extern const char cogl_fixed_fragment_shader_fog[]; extern const char cogl_fixed_fragment_shader_alpha_never[]; extern const char cogl_fixed_fragment_shader_alpha_less[]; diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl-fixed-vertex-shader.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl-fixed-vertex-shader.c --- clutter-0.8.4/clutter/cogl/gles/cogl-fixed-vertex-shader.c 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/clutter/cogl/gles/cogl-fixed-vertex-shader.c 2009-01-29 15:51:44.000000000 +0000 @@ -24,37 +24,49 @@ */ ; -const char cogl_fixed_vertex_shader_start[] = +const char cogl_fixed_vertex_shader_per_vertex_attribs[] = "\n" "/* Per vertex attributes */\n" "attribute vec4 vertex_attrib;\n" - "attribute vec4 tex_coord_attrib;\n" "attribute vec4 color_attrib;\n" "\n" + ; +const char cogl_fixed_vertex_shader_transform_matrices[] = + "\n" "/* Transformation matrices */\n" "uniform mat4 modelview_matrix;\n" "uniform mat4 mvp_matrix; /* combined modelview and projection matrix */\n" - "uniform mat4 texture_matrix;\n" + "\n" + ; +const char cogl_fixed_vertex_shader_output_variables[] = "\n" "/* Outputs to the fragment shader */\n" "varying vec4 frag_color;\n" - "varying vec2 tex_coord;\n" "varying float fog_amount;\n" "\n" + ; +const char cogl_fixed_vertex_shader_fogging_options[] = + "\n" "/* Fogging options */\n" "uniform float fog_density;\n" "uniform float fog_start;\n" "uniform float fog_end;\n" "\n" + ; +const char cogl_fixed_vertex_shader_main_start[] = + "\n" "void\n" "main (void)\n" "{\n" + " vec4 transformed_tex_coord;\n" + "\n" " /* Calculate the transformed position */\n" " gl_Position = mvp_matrix * vertex_attrib;\n" "\n" " /* Calculate the transformed texture coordinate */\n" - " vec4 transformed_tex_coord = texture_matrix * tex_coord_attrib;\n" - " tex_coord = transformed_tex_coord.st / transformed_tex_coord.q;\n" + "\n" + ; +const char cogl_fixed_vertex_shader_frag_color_start[] = "\n" " /* Pass the interpolated vertex color on to the fragment shader */\n" " frag_color = color_attrib;\n" diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl-fixed-vertex-shader.glsl /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl-fixed-vertex-shader.glsl --- clutter-0.8.4/clutter/cogl/gles/cogl-fixed-vertex-shader.glsl 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gles/cogl-fixed-vertex-shader.glsl 2009-01-28 16:45:25.000000000 +0000 @@ -1,34 +1,41 @@ -/*** cogl_fixed_vertex_shader_start ***/ +/*** cogl_fixed_vertex_shader_per_vertex_attribs ***/ /* Per vertex attributes */ attribute vec4 vertex_attrib; -attribute vec4 tex_coord_attrib; attribute vec4 color_attrib; +/*** cogl_fixed_vertex_shader_transform_matrices ***/ + /* Transformation matrices */ uniform mat4 modelview_matrix; uniform mat4 mvp_matrix; /* combined modelview and projection matrix */ -uniform mat4 texture_matrix; + +/*** cogl_fixed_vertex_shader_output_variables ***/ /* Outputs to the fragment shader */ varying vec4 frag_color; -varying vec2 tex_coord; varying float fog_amount; +/*** cogl_fixed_vertex_shader_fogging_options ***/ + /* Fogging options */ uniform float fog_density; uniform float fog_start; uniform float fog_end; +/*** cogl_fixed_vertex_shader_main_start ***/ + void main (void) { + vec4 transformed_tex_coord; + /* Calculate the transformed position */ gl_Position = mvp_matrix * vertex_attrib; /* Calculate the transformed texture coordinate */ - vec4 transformed_tex_coord = texture_matrix * tex_coord_attrib; - tex_coord = transformed_tex_coord.st / transformed_tex_coord.q; + + /*** cogl_fixed_vertex_shader_frag_color_start ***/ /* Pass the interpolated vertex color on to the fragment shader */ frag_color = color_attrib; diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl-fixed-vertex-shader.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl-fixed-vertex-shader.h --- clutter-0.8.4/clutter/cogl/gles/cogl-fixed-vertex-shader.h 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/clutter/cogl/gles/cogl-fixed-vertex-shader.h 2009-01-29 15:51:44.000000000 +0000 @@ -26,7 +26,12 @@ #ifndef __COGL_FIXED_VERTEX_SHADER_H #define __COGL_FIXED_VERTEX_SHADER_H -extern const char cogl_fixed_vertex_shader_start[]; +extern const char cogl_fixed_vertex_shader_per_vertex_attribs[]; +extern const char cogl_fixed_vertex_shader_transform_matrices[]; +extern const char cogl_fixed_vertex_shader_output_variables[]; +extern const char cogl_fixed_vertex_shader_fogging_options[]; +extern const char cogl_fixed_vertex_shader_main_start[]; +extern const char cogl_fixed_vertex_shader_frag_color_start[]; extern const char cogl_fixed_vertex_shader_fog_start[]; extern const char cogl_fixed_vertex_shader_fog_exp[]; extern const char cogl_fixed_vertex_shader_fog_exp2[]; diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl-gles2-wrapper.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl-gles2-wrapper.c --- clutter-0.8.4/clutter/cogl/gles/cogl-gles2-wrapper.c 2008-11-13 14:52:05.000000000 +0000 +++ clutter-0.9.0/clutter/cogl/gles/cogl-gles2-wrapper.c 2009-01-28 16:45:25.000000000 +0000 @@ -36,8 +36,9 @@ #include "cogl-fixed-vertex-shader.h" #include "cogl-fixed-fragment-shader.h" #include "cogl-context.h" -#include "cogl-shader.h" +#include "cogl-shader-private.h" #include "cogl-program.h" +#include "cogl-internal.h" #define _COGL_GET_GLES2_WRAPPER(wvar, retval) \ CoglGles2Wrapper *wvar; \ @@ -66,8 +67,9 @@ while (0) #define COGL_GLES2_WRAPPER_VERTEX_ATTRIB 0 -#define COGL_GLES2_WRAPPER_TEX_COORD_ATTRIB 1 -#define COGL_GLES2_WRAPPER_COLOR_ATTRIB 2 +#define COGL_GLES2_WRAPPER_COLOR_ATTRIB 1 +#define COGL_GLES2_WRAPPER_NORMAL_ATTRIB 2 + static GLuint cogl_gles2_wrapper_create_shader (GLenum type, const char *source) @@ -103,25 +105,31 @@ void cogl_gles2_wrapper_init (CoglGles2Wrapper *wrapper) { - GLfixed default_fog_color[4] = { 0, 0, 0, 0 }; + GLfloat default_fog_color[4] = { 0, 0, 0, 0 }; memset (wrapper, 0, sizeof (CoglGles2Wrapper)); /* Initialize the stacks */ - cogl_wrap_glMatrixMode (GL_TEXTURE); - cogl_wrap_glLoadIdentity (); cogl_wrap_glMatrixMode (GL_PROJECTION); cogl_wrap_glLoadIdentity (); cogl_wrap_glMatrixMode (GL_MODELVIEW); cogl_wrap_glLoadIdentity (); + wrapper->texture_units = + g_array_new (FALSE, FALSE, sizeof (CoglGles2WrapperTextureUnit *)); + + /* The gl*ActiveTexture wrappers will initialise the texture + * stack for the texture unit when it's first activated */ + cogl_wrap_glActiveTexture (GL_TEXTURE0); + cogl_wrap_glClientActiveTexture (GL_TEXTURE0); + /* Initialize the fogging options */ cogl_wrap_glDisable (GL_FOG); - cogl_wrap_glFogx (GL_FOG_MODE, GL_LINEAR); - cogl_wrap_glFogx (GL_FOG_DENSITY, CFX_ONE); - cogl_wrap_glFogx (GL_FOG_START, 0); - cogl_wrap_glFogx (GL_FOG_END, 1); - cogl_wrap_glFogxv (GL_FOG_COLOR, default_fog_color); + cogl_wrap_glFogf (GL_FOG_MODE, GL_LINEAR); + cogl_wrap_glFogf (GL_FOG_DENSITY, 1.0); + cogl_wrap_glFogf (GL_FOG_START, 0); + cogl_wrap_glFogf (GL_FOG_END, 1); + cogl_wrap_glFogfv (GL_FOG_COLOR, default_fog_color); /* Initialize alpha testing */ cogl_wrap_glDisable (GL_ALPHA_TEST); @@ -136,11 +144,14 @@ { if (fragment_tests) { - if (a->texture_2d_enabled != b->texture_2d_enabled) - return FALSE; - - if (a->texture_2d_enabled && a->alpha_only != b->alpha_only) - return FALSE; + int i; + for (i = 0; i < a->n_texture_units; i++) + { + if (a->texture_units[i].enabled != b->texture_units[i].enabled) + return FALSE; + if (a->texture_units[i].alpha_only != b->texture_units[i].alpha_only) + return FALSE; + } if (a->alpha_test_enabled != b->alpha_test_enabled) return FALSE; @@ -164,6 +175,7 @@ GLuint shader_obj; CoglGles2WrapperShader *shader; GSList *node; + int i; _COGL_GET_GLES2_WRAPPER (w, NULL); @@ -176,7 +188,47 @@ return (CoglGles2WrapperShader *) node->data; /* Otherwise create a new shader */ - shader_source = g_string_new (cogl_fixed_vertex_shader_start); + shader_source = g_string_new (cogl_fixed_vertex_shader_per_vertex_attribs); + + for (i = 0; i < settings->n_texture_units; i++) + { + if (!settings->texture_units[i].enabled) + continue; + g_string_append_printf (shader_source, + "attribute vec4 multi_tex_coord_attrib%d;\n", + i); + } + + g_string_append (shader_source, cogl_fixed_vertex_shader_transform_matrices); + g_string_append_printf (shader_source, + "uniform mat4 texture_matrix[%d];\n", + settings->n_texture_units); + + g_string_append (shader_source, cogl_fixed_vertex_shader_output_variables); + g_string_append_printf (shader_source, + "varying vec2 tex_coord[%d];", + settings->n_texture_units); + + g_string_append (shader_source, cogl_fixed_vertex_shader_fogging_options); + g_string_append (shader_source, cogl_fixed_vertex_shader_main_start); + + for (i = 0; i < settings->n_texture_units; i++) + { + if (!settings->texture_units[i].enabled) + continue; + + g_string_append_printf (shader_source, + "transformed_tex_coord = " + "texture_matrix[%d] " + " * multi_tex_coord_attrib%d;\n", + i, i); + g_string_append_printf (shader_source, + "tex_coord[%d] = transformed_tex_coord.st " + " / transformed_tex_coord.q;\n", + i); + } + + g_string_append (shader_source, cogl_fixed_vertex_shader_frag_color_start); if (settings->fog_enabled) { @@ -206,10 +258,10 @@ shader_source->str); g_string_free (shader_source, TRUE); - + if (shader_obj == 0) return NULL; - + shader = g_slice_new (CoglGles2WrapperShader); shader->shader = shader_obj; shader->settings = *settings; @@ -227,6 +279,7 @@ GLuint shader_obj; CoglGles2WrapperShader *shader; GSList *node; + int i; _COGL_GET_GLES2_WRAPPER (w, NULL); @@ -239,18 +292,61 @@ return (CoglGles2WrapperShader *) node->data; /* Otherwise create a new shader */ - shader_source = g_string_new (cogl_fixed_fragment_shader_start); - if (settings->texture_2d_enabled) + shader_source = g_string_new (cogl_fixed_fragment_shader_variables_start); + + g_string_append (shader_source, cogl_fixed_fragment_shader_inputs); + g_string_append_printf (shader_source, + "varying vec2 tex_coord[%d];\n", + settings->n_texture_units); + + g_string_append (shader_source, cogl_fixed_fragment_shader_texturing_options); + g_string_append_printf (shader_source, + "uniform sampler2D texture_unit[%d];\n", + settings->n_texture_units); + + g_string_append (shader_source, cogl_fixed_fragment_shader_fogging_options); + + g_string_append (shader_source, cogl_fixed_fragment_shader_main_declare); + + g_string_append (shader_source, cogl_fixed_fragment_shader_main_start); + + /* This pointless extra variable is needed to work around an + apparent bug in the PowerVR drivers. Without it the alpha + blending seems to stop working */ + /* g_string_append (shader_source, "gl_FragColor = frag_color;\n"); + */ + g_string_append (shader_source, + "vec4 frag_color_copy = frag_color;\n"); + g_string_append (shader_source, "gl_FragColor = frag_color;\n"); + + for (i = 0; i < settings->n_texture_units; i++) { - if (settings->alpha_only) - g_string_append (shader_source, - cogl_fixed_fragment_shader_texture_alpha_only); + if (settings->texture_units[i].alpha_only) + { + /* If the texture only has an alpha channel (eg, with the textures + from the pango renderer) then the RGB components will be + black. We want to use the RGB from the current color in that + case */ + g_string_append_printf ( + shader_source, + "gl_FragColor.a *= " + "texture2D (texture_unit[%d], tex_coord[%d]).a;\n", + i, i); + } else - g_string_append (shader_source, - cogl_fixed_fragment_shader_texture); + { + g_string_append_printf ( + shader_source, + "gl_FragColor *= " + "texture2D (texture_unit[%d], tex_coord[%d]);\n", + i, i); + } } - else - g_string_append (shader_source, cogl_fixed_fragment_shader_solid_color); + /* FIXME */ + g_string_append (shader_source, "gl_FragColor.r = 1.0;\n"); + g_string_append (shader_source, "gl_FragColor.g = 1.0;\n"); + if (i == 0) + g_string_append (shader_source, "gl_FragColor = frag_color;\n"); if (settings->fog_enabled) g_string_append (shader_source, cogl_fixed_fragment_shader_fog); @@ -293,10 +389,10 @@ shader_source->str); g_string_free (shader_source, TRUE); - + if (shader_obj == 0) return NULL; - + shader = g_slice_new (CoglGles2WrapperShader); shader->shader = shader_obj; shader->settings = *settings; @@ -307,6 +403,69 @@ return shader; } +static void +cogl_gles2_wrapper_get_locations (GLuint program, + CoglGles2WrapperSettings *settings, + CoglGles2WrapperUniforms *uniforms, + CoglGles2WrapperAttributes *attribs) +{ + int i; + + uniforms->mvp_matrix_uniform + = glGetUniformLocation (program, "mvp_matrix"); + uniforms->modelview_matrix_uniform + = glGetUniformLocation (program, "modelview_matrix"); + + uniforms->texture_matrix_uniforms = + g_array_new (FALSE, FALSE, sizeof (GLint)); + uniforms->texture_sampler_uniforms = + g_array_new (FALSE, FALSE, sizeof (GLint)); + attribs->multi_texture_coords = + g_array_new (FALSE, FALSE, sizeof (GLint)); + for (i = 0; i < settings->n_texture_units; i++) + { + char *matrix_var_name = g_strdup_printf ("texture_matrix[%d]", i); + char *sampler_var_name = g_strdup_printf ("texture_unit[%d]", i); + char *tex_coord_var_name = + g_strdup_printf ("multi_tex_coord_attrib%d", i); + GLint location; + + location = glGetUniformLocation (program, matrix_var_name); + g_array_append_val (uniforms->texture_matrix_uniforms, location); + location = glGetUniformLocation (program, sampler_var_name); + g_array_append_val (uniforms->texture_sampler_uniforms, location); + location = glGetAttribLocation (program, tex_coord_var_name); + g_array_append_val (attribs->multi_texture_coords, location); + + g_free (tex_coord_var_name); + g_free (sampler_var_name); + g_free (matrix_var_name); + } + + uniforms->fog_density_uniform + = glGetUniformLocation (program, "fog_density"); + uniforms->fog_start_uniform + = glGetUniformLocation (program, "fog_start"); + uniforms->fog_end_uniform + = glGetUniformLocation (program, "fog_end"); + uniforms->fog_color_uniform + = glGetUniformLocation (program, "fog_color"); + + uniforms->alpha_test_ref_uniform + = glGetUniformLocation (program, "alpha_test_ref"); +} + +static void +cogl_gles2_wrapper_bind_attributes (GLuint program) +{ + glBindAttribLocation (program, COGL_GLES2_WRAPPER_VERTEX_ATTRIB, + "vertex_attrib"); + glBindAttribLocation (program, COGL_GLES2_WRAPPER_COLOR_ATTRIB, + "color_attrib"); + glBindAttribLocation (program, COGL_GLES2_WRAPPER_NORMAL_ATTRIB, + "normal_attrib"); +} + static CoglGles2WrapperProgram * cogl_gles2_wrapper_get_program (const CoglGles2WrapperSettings *settings) { @@ -402,63 +561,27 @@ } program->settings = *settings; - - cogl_gles2_wrapper_get_uniforms (program->program, &program->uniforms); + + cogl_gles2_wrapper_get_locations (program->program, + &program->settings, + &program->uniforms, + &program->attributes); /* We haven't tried to get a location for any of the custom uniforms yet */ for (i = 0; i < COGL_GLES2_NUM_CUSTOM_UNIFORMS; i++) program->custom_uniforms[i] = COGL_GLES2_UNBOUND_CUSTOM_UNIFORM; - - w->compiled_programs = g_slist_append (w->compiled_programs, program); - - return program; -} - -void -cogl_gles2_wrapper_bind_attributes (GLuint program) -{ - glBindAttribLocation (program, COGL_GLES2_WRAPPER_VERTEX_ATTRIB, - "vertex_attrib"); - glBindAttribLocation (program, COGL_GLES2_WRAPPER_TEX_COORD_ATTRIB, - "tex_coord_attrib"); - glBindAttribLocation (program, COGL_GLES2_WRAPPER_COLOR_ATTRIB, - "color_attrib"); -} -void -cogl_gles2_wrapper_get_uniforms (GLuint program, - CoglGles2WrapperUniforms *uniforms) -{ - uniforms->mvp_matrix_uniform - = glGetUniformLocation (program, "mvp_matrix"); - uniforms->modelview_matrix_uniform - = glGetUniformLocation (program, "modelview_matrix"); - uniforms->texture_matrix_uniform - = glGetUniformLocation (program, "texture_matrix"); - uniforms->bound_texture_uniform - = glGetUniformLocation (program, "texture_unit"); - - uniforms->fog_density_uniform - = glGetUniformLocation (program, "fog_density"); - uniforms->fog_start_uniform - = glGetUniformLocation (program, "fog_start"); - uniforms->fog_end_uniform - = glGetUniformLocation (program, "fog_end"); - uniforms->fog_color_uniform - = glGetUniformLocation (program, "fog_color"); - - uniforms->alpha_test_ref_uniform - = glGetUniformLocation (program, "alpha_test_ref"); + w->compiled_programs = g_slist_append (w->compiled_programs, program); - uniforms->texture_unit_uniform - = glGetUniformLocation (program, "texture_unit"); + return program; } void cogl_gles2_wrapper_deinit (CoglGles2Wrapper *wrapper) { GSList *node, *next; + int i; for (node = wrapper->compiled_programs; node; node = next) { @@ -483,11 +606,17 @@ g_slist_free1 (node); } wrapper->compiled_fragment_shaders = NULL; + + for (i = 0; i < COGL_GLES2_NUM_CUSTOM_UNIFORMS; i++) + if (wrapper->custom_uniforms[i].count > 1) + g_free (wrapper->custom_uniforms[i].v.array); } -void +static void cogl_gles2_wrapper_update_matrix (CoglGles2Wrapper *wrapper, GLenum matrix_num) { + CoglGles2WrapperTextureUnit *texture_unit; + switch (matrix_num) { default: @@ -501,21 +630,16 @@ break; case GL_TEXTURE: - wrapper->dirty_uniforms |= COGL_GLES2_DIRTY_TEXTURE_MATRIX; + wrapper->dirty_uniforms |= COGL_GLES2_DIRTY_TEXTURE_MATRICES; + texture_unit = g_array_index (wrapper->texture_units, + CoglGles2WrapperTextureUnit *, + wrapper->active_texture_unit); + texture_unit->dirty_matrix = 1; break; } } void -cogl_wrap_glClearColorx (GLclampx r, GLclampx g, GLclampx b, GLclampx a) -{ - glClearColor (CLUTTER_FIXED_TO_FLOAT (r), - CLUTTER_FIXED_TO_FLOAT (g), - CLUTTER_FIXED_TO_FLOAT (b), - CLUTTER_FIXED_TO_FLOAT (a)); -} - -void cogl_wrap_glPushMatrix () { const float *src; @@ -543,11 +667,19 @@ break; case GL_TEXTURE: - src = w->texture_stack + w->texture_stack_pos * 16; - w->texture_stack_pos = (w->texture_stack_pos + 1) - & (COGL_GLES2_TEXTURE_STACK_SIZE - 1); - dst = w->texture_stack + w->texture_stack_pos * 16; - break; + { + CoglGles2WrapperTextureUnit *texture_unit; + texture_unit = g_array_index (w->texture_units, + CoglGles2WrapperTextureUnit *, + w->active_texture_unit); + src = texture_unit->texture_stack + + texture_unit->texture_stack_pos * 16; + texture_unit->texture_stack_pos = (texture_unit->texture_stack_pos + 1) + & (COGL_GLES2_TEXTURE_STACK_SIZE - 1); + dst = texture_unit->texture_stack + + texture_unit->texture_stack_pos * 16; + break; + } } /* Copy the old matrix to the new position */ @@ -557,6 +689,7 @@ void cogl_wrap_glPopMatrix () { + CoglGles2WrapperTextureUnit *texture_unit; _COGL_GET_GLES2_WRAPPER (w, NO_RETVAL); /* Decrement the stack pointer */ @@ -574,7 +707,10 @@ break; case GL_TEXTURE: - w->texture_stack_pos = (w->texture_stack_pos - 1) + texture_unit = g_array_index (w->texture_units, + CoglGles2WrapperTextureUnit *, + w->active_texture_unit); + texture_unit->texture_stack_pos = (texture_unit->texture_stack_pos - 1) & (COGL_GLES2_TEXTURE_STACK_SIZE - 1); break; } @@ -594,6 +730,8 @@ static float * cogl_gles2_get_matrix_stack_top (CoglGles2Wrapper *wrapper) { + CoglGles2WrapperTextureUnit *texture_unit; + switch (wrapper->matrix_mode) { default: @@ -604,7 +742,12 @@ return wrapper->projection_stack + wrapper->projection_stack_pos * 16; case GL_TEXTURE: - return wrapper->texture_stack + wrapper->texture_stack_pos * 16; + + texture_unit = g_array_index (wrapper->texture_units, + CoglGles2WrapperTextureUnit *, + wrapper->active_texture_unit); + return texture_unit->texture_stack + + texture_unit->texture_stack_pos * 16; } } @@ -658,58 +801,58 @@ } void -cogl_wrap_glMultMatrixx (const GLfixed *m) +cogl_wrap_glMultMatrixf (const GLfloat *m) { float new_matrix[16]; int i; for (i = 0; i < 16; i++) - new_matrix[i] = CLUTTER_FIXED_TO_FLOAT (m[i]); + new_matrix[i] = (m[i]); cogl_wrap_glMultMatrix (new_matrix); } void -cogl_wrap_glFrustumx (GLfixed left, GLfixed right, - GLfixed bottom, GLfixed top, - GLfixed z_near, GLfixed z_far) +cogl_wrap_glFrustumf (GLfloat left, GLfloat right, + GLfloat bottom, GLfloat top, + GLfloat z_near, GLfloat z_far) { float matrix[16]; - float two_near = CLUTTER_FIXED_TO_FLOAT (2 * z_near); + float two_near = (2 * z_near); memset (matrix, 0, sizeof (matrix)); - matrix[0] = two_near / CLUTTER_FIXED_TO_FLOAT (right - left); - matrix[5] = two_near / CLUTTER_FIXED_TO_FLOAT (top - bottom); - matrix[8] = CLUTTER_FIXED_TO_FLOAT (right + left) - / CLUTTER_FIXED_TO_FLOAT (right - left); - matrix[9] = CLUTTER_FIXED_TO_FLOAT (top + bottom) - / CLUTTER_FIXED_TO_FLOAT (top - bottom); - matrix[10] = -CLUTTER_FIXED_TO_FLOAT (z_far + z_near) - / CLUTTER_FIXED_TO_FLOAT (z_far - z_near); + matrix[0] = two_near / (right - left); + matrix[5] = two_near / (top - bottom); + matrix[8] = (right + left) + / (right - left); + matrix[9] = (top + bottom) + / (top - bottom); + matrix[10] = - (z_far + z_near) + / (z_far - z_near); matrix[11] = -1.0f; - matrix[14] = -two_near * CLUTTER_FIXED_TO_FLOAT (z_far) - / CLUTTER_FIXED_TO_FLOAT (z_far - z_near); + matrix[14] = -two_near * (z_far) + / (z_far - z_near); cogl_wrap_glMultMatrix (matrix); } void -cogl_wrap_glScalex (GLfixed x, GLfixed y, GLfixed z) +cogl_wrap_glScalef (GLfloat x, GLfloat y, GLfloat z) { float matrix[16]; memset (matrix, 0, sizeof (matrix)); - matrix[0] = CLUTTER_FIXED_TO_FLOAT (x); - matrix[5] = CLUTTER_FIXED_TO_FLOAT (y); - matrix[10] = CLUTTER_FIXED_TO_FLOAT (z); + matrix[0] = (x); + matrix[5] = (y); + matrix[10] = (z); matrix[15] = 1.0f; cogl_wrap_glMultMatrix (matrix); } void -cogl_wrap_glTranslatex (GLfixed x, GLfixed y, GLfixed z) +cogl_wrap_glTranslatef (GLfloat x, GLfloat y, GLfloat z) { float matrix[16]; @@ -717,25 +860,25 @@ matrix[0] = 1.0f; matrix[5] = 1.0f; matrix[10] = 1.0f; - matrix[12] = CLUTTER_FIXED_TO_FLOAT (x); - matrix[13] = CLUTTER_FIXED_TO_FLOAT (y); - matrix[14] = CLUTTER_FIXED_TO_FLOAT (z); + matrix[12] = (x); + matrix[13] = (y); + matrix[14] = (z); matrix[15] = 1.0f; cogl_wrap_glMultMatrix (matrix); } void -cogl_wrap_glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z) +cogl_wrap_glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z) { float matrix[16]; - float xf = CLUTTER_FIXED_TO_FLOAT (x); - float yf = CLUTTER_FIXED_TO_FLOAT (y); - float zf = CLUTTER_FIXED_TO_FLOAT (z); - float anglef = CLUTTER_FIXED_TO_FLOAT (angle) * G_PI / 180.0f; + float xf = (x); + float yf = (y); + float zf = (z); + float anglef = (angle) * G_PI / 180.0f; float c = cosf (anglef); float s = sinf (anglef); - + matrix[0] = xf * xf * (1.0f - c) + c; matrix[1] = yf * xf * (1.0f - c) + zf * s; matrix[2] = xf * zf * (1.0f - c) - yf * s; @@ -760,21 +903,21 @@ } void -cogl_wrap_glOrthox (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, - GLfixed near, GLfixed far) +cogl_wrap_glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, + GLfloat near, GLfloat far) { float matrix[16]; - float xrange = CLUTTER_FIXED_TO_FLOAT (right - left); - float yrange = CLUTTER_FIXED_TO_FLOAT (top - bottom); - float zrange = CLUTTER_FIXED_TO_FLOAT (far - near); + float xrange = (right - left); + float yrange = (top - bottom); + float zrange = (far - near); memset (matrix, 0, sizeof (matrix)); matrix[0] = 2.0f / xrange; matrix[5] = 2.0f / yrange; matrix[10] = 2.0f / zrange; - matrix[12] = CLUTTER_FIXED_TO_FLOAT (right + left) / xrange; - matrix[13] = CLUTTER_FIXED_TO_FLOAT (top + bottom) / yrange; - matrix[14] = CLUTTER_FIXED_TO_FLOAT (far + near) / zrange; + matrix[12] = (right + left) / xrange; + matrix[13] = (top + bottom) / yrange; + matrix[14] = (far + near) / zrange; matrix[15] = 1.0f; cogl_wrap_glMultMatrix (matrix); @@ -792,8 +935,22 @@ cogl_wrap_glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) { - glVertexAttribPointer (COGL_GLES2_WRAPPER_TEX_COORD_ATTRIB, size, type, - GL_FALSE, stride, pointer); + int active_unit; + CoglGles2WrapperTextureUnit *texture_unit; + _COGL_GET_GLES2_WRAPPER (w, NO_RETVAL); + + active_unit = w->active_client_texture_unit; + + texture_unit = g_array_index (w->texture_units, + CoglGles2WrapperTextureUnit *, + active_unit); + texture_unit->texture_coords_size = size; + texture_unit->texture_coords_type = type; + texture_unit->texture_coords_stride = stride; + texture_unit->texture_coords_pointer = pointer; + + w->dirty_attribute_pointers + |= COGL_GLES2_DIRTY_TEX_COORD_VERTEX_ATTRIB; } void @@ -801,11 +958,90 @@ const GLvoid *pointer) { glVertexAttribPointer (COGL_GLES2_WRAPPER_COLOR_ATTRIB, size, type, - GL_FALSE, stride, pointer); + GL_TRUE, stride, pointer); } void -cogl_wrap_glDrawArrays (GLenum mode, GLint first, GLsizei count) +cogl_wrap_glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer) +{ + glVertexAttribPointer (COGL_GLES2_WRAPPER_NORMAL_ATTRIB, 1, type, + GL_FALSE, stride, pointer); +} + +static void +cogl_gles2_do_set_uniform (GLint location, CoglBoxedValue *value) +{ + switch (value->type) + { + case COGL_BOXED_NONE: + break; + + case COGL_BOXED_INT: + { + gint *ptr; + + if (value->count == 1) + ptr = value->v.int_value; + else + ptr = value->v.int_array; + + switch (value->size) + { + case 1: glUniform1iv (location, value->count, ptr); break; + case 2: glUniform2iv (location, value->count, ptr); break; + case 3: glUniform3iv (location, value->count, ptr); break; + case 4: glUniform4iv (location, value->count, ptr); break; + } + } + break; + + case COGL_BOXED_FLOAT: + { + gfloat *ptr; + + if (value->count == 1) + ptr = value->v.float_value; + else + ptr = value->v.float_array; + + switch (value->size) + { + case 1: glUniform1fv (location, value->count, ptr); break; + case 2: glUniform2fv (location, value->count, ptr); break; + case 3: glUniform3fv (location, value->count, ptr); break; + case 4: glUniform4fv (location, value->count, ptr); break; + } + } + break; + + case COGL_BOXED_MATRIX: + { + gfloat *ptr; + + if (value->count == 1) + ptr = value->v.matrix; + else + ptr = value->v.float_array; + + switch (value->size) + { + case 2: + glUniformMatrix2fv (location, value->count, value->transpose, ptr); + break; + case 3: + glUniformMatrix3fv (location, value->count, value->transpose, ptr); + break; + case 4: + glUniformMatrix4fv (location, value->count, value->transpose, ptr); + break; + } + } + break; + } +} + +static void +cogl_wrap_prepare_for_draw (void) { CoglGles2WrapperProgram *program; @@ -848,7 +1084,7 @@ cogl_gles2_wrapper_mult_matrix (mvp_matrix, w->projection_stack + w->projection_stack_pos * 16, - modelview_matrix); + modelview_matrix); if (program->uniforms.mvp_matrix_uniform != -1) glUniformMatrix4fv (program->uniforms.mvp_matrix_uniform, 1, @@ -857,11 +1093,28 @@ glUniformMatrix4fv (program->uniforms.modelview_matrix_uniform, 1, GL_FALSE, modelview_matrix); } - if ((w->dirty_uniforms & COGL_GLES2_DIRTY_TEXTURE_MATRIX) - && program->uniforms.texture_matrix_uniform != -1) - glUniformMatrix4fv (program->uniforms.texture_matrix_uniform, 1, - GL_FALSE, - w->texture_stack + w->texture_stack_pos * 16); + if ((w->dirty_uniforms & COGL_GLES2_DIRTY_TEXTURE_MATRICES)) + { + int i; + + /* TODO - we should probably have a per unit dirty flag too */ + + for (i = 0; i < program->uniforms.texture_matrix_uniforms->len; i++) + { + CoglGles2WrapperTextureUnit *texture_unit; + GLint uniform = + g_array_index (program->uniforms.texture_matrix_uniforms, + GLint, i); + + texture_unit = g_array_index (w->texture_units, + CoglGles2WrapperTextureUnit *, + i); + if (uniform != -1) + glUniformMatrix4fv (uniform, 1, GL_FALSE, + texture_unit->texture_stack + + texture_unit->texture_stack_pos * 16); + } + } if ((w->dirty_uniforms & COGL_GLES2_DIRTY_FOG_DENSITY) && program->uniforms.fog_density_uniform != -1) @@ -878,9 +1131,22 @@ glUniform1f (program->uniforms.alpha_test_ref_uniform, w->alpha_test_ref); - if ((w->dirty_uniforms & COGL_GLES2_DIRTY_TEXTURE_UNIT) - && program->uniforms.texture_unit_uniform != -1) - glUniform1i (program->uniforms.texture_unit_uniform, 0); + if ((w->dirty_uniforms & COGL_GLES2_DIRTY_TEXTURE_UNITS)) + { + int i; + + /* TODO - we should probably have a per unit dirty flag too */ + + for (i = 0; i < program->uniforms.texture_sampler_uniforms->len; i++) + { + GLint uniform = + g_array_index (program->uniforms.texture_sampler_uniforms, + GLint, i); + + if (uniform != -1) + glUniform1i (uniform, i); + } + } w->dirty_uniforms = 0; } @@ -904,18 +1170,94 @@ program->custom_uniforms[i] = glGetUniformLocation (program->program, uniform_name); if (program->custom_uniforms[i] >= 0) - glUniform1f (program->custom_uniforms[i], - w->custom_uniforms[i]); + cogl_gles2_do_set_uniform (program->custom_uniforms[i], + &w->custom_uniforms[i]); } } - + w->dirty_custom_uniforms = 0; } + if (w->dirty_attribute_pointers + & COGL_GLES2_DIRTY_TEX_COORD_VERTEX_ATTRIB) + { + int i; + + /* TODO - coverage test */ + for (i = 0; i < w->settings.n_texture_units; i++) + { + GLint tex_coord_var_index; + CoglGles2WrapperTextureUnit *texture_unit; + + if (!w->settings.texture_units[i].enabled) + continue; + + texture_unit = g_array_index (w->texture_units, + CoglGles2WrapperTextureUnit *, + w->active_texture_unit); + if (!texture_unit->texture_coords_enabled) + continue; + + /* TODO - we should probably have a per unit dirty flag too */ + + /* TODO - coverage test */ + tex_coord_var_index = + g_array_index (program->attributes.multi_texture_coords, + GLint, i); + glVertexAttribPointer (tex_coord_var_index, + texture_unit->texture_coords_size, + texture_unit->texture_coords_type, + GL_FALSE, + texture_unit->texture_coords_stride, + texture_unit->texture_coords_pointer); + } + } + + if (w->dirty_vertex_attrib_enables) + { + int i; + + /* TODO - coverage test */ + + /* TODO - we should probably have a per unit dirty flag too */ + + for (i = 0; i < w->texture_units->len; i++) + { + CoglGles2WrapperTextureUnit *texture_unit = + g_array_index (w->texture_units, + CoglGles2WrapperTextureUnit *, + w->active_texture_unit); + if (texture_unit->texture_coords_enabled) + glEnableVertexAttribArray ( + g_array_index (program->attributes.multi_texture_coords, + GLint, i)); + else + glDisableVertexAttribArray ( + g_array_index (program->attributes.multi_texture_coords, + GLint, i)); + w->dirty_vertex_attrib_enables = 0; + } + } +} + +void +cogl_wrap_glDrawArrays (GLenum mode, GLint first, GLsizei count) +{ + cogl_wrap_prepare_for_draw (); + glDrawArrays (mode, first, count); } void +cogl_wrap_glDrawElements (GLenum mode, GLsizei count, GLenum type, + const GLvoid *indices) +{ + cogl_wrap_prepare_for_draw (); + + glDrawElements (mode, count, type, indices); +} + +void cogl_gles2_wrapper_bind_texture (GLenum target, GLuint texture, GLenum internal_format) { @@ -926,17 +1268,93 @@ /* We need to keep track of whether the texture is alpha-only because the emulation of GL_MODULATE needs to work differently in that case */ - _COGL_GLES2_CHANGE_SETTING (w, alpha_only, internal_format == GL_ALPHA); + _COGL_GLES2_CHANGE_SETTING ( + w, texture_units[w->active_texture_unit].alpha_only, + internal_format == GL_ALPHA); + } void -cogl_wrap_glTexEnvx (GLenum target, GLenum pname, GLfixed param) +cogl_wrap_glTexEnvf (GLenum target, GLenum pname, GLfloat param) { /* This function is only used to set the texture mode once to GL_MODULATE. The shader is hard-coded to modulate the texture so nothing needs to be done here. */ } +static void +realize_texture_units (CoglGles2Wrapper *w, int texture_unit_index) +{ + /* We save the active texture unit since we may need to temporarily + * change this to initialise each new texture unit and we want to + * restore the active unit afterwards */ + int initial_active_unit = w->active_texture_unit; + + if (texture_unit_index >= w->settings.n_texture_units) + { + int n_new_texture_units = + texture_unit_index + 1 - w->settings.n_texture_units; + GLint prev_mode; + int i; + + w->settings.texture_units = + g_realloc (w->settings.texture_units, + texture_unit_index + 1 + * sizeof (CoglGles2WrapperTextureUnitSettings)); + + /* We will need to set the matrix mode to GL_TEXTURE to + * initialise any new texture units, so we save the current + * mode for restoring afterwards */ + GE( cogl_wrap_glGetIntegerv (CGL_MATRIX_MODE, &prev_mode)); + + for (i = 0; i < n_new_texture_units; i++) + { + CoglGles2WrapperTextureUnit *new_unit; + CoglGles2WrapperTextureUnitSettings *new_unit_settings; + + new_unit = g_new0 (CoglGles2WrapperTextureUnit, 1); + g_array_append_val (w->texture_units, new_unit); + + w->active_texture_unit = i; + GE( cogl_wrap_glMatrixMode (GL_TEXTURE)); + GE( cogl_wrap_glLoadIdentity ()); + + new_unit_settings = + &w->settings.texture_units[w->settings.n_texture_units + i]; + new_unit_settings->enabled = FALSE; + new_unit_settings->alpha_only = FALSE; + } + + GE( cogl_wrap_glMatrixMode ((GLenum)prev_mode)); + + w->settings.n_texture_units = w->texture_units->len; + } + + w->active_texture_unit = initial_active_unit; +} + +void +cogl_wrap_glClientActiveTexture (GLenum texture) +{ + int texture_unit_index = texture - GL_TEXTURE0; + _COGL_GET_GLES2_WRAPPER (w, NO_RETVAL); + + w->active_client_texture_unit = texture_unit_index; + + realize_texture_units (w, texture_unit_index); +} + +void +cogl_wrap_glActiveTexture (GLenum texture) +{ + int texture_unit_index = texture - GL_TEXTURE0; + _COGL_GET_GLES2_WRAPPER (w, NO_RETVAL); + + w->active_texture_unit = texture_unit_index; + + realize_texture_units (w, texture_unit_index); +} + void cogl_wrap_glEnable (GLenum cap) { @@ -945,7 +1363,8 @@ switch (cap) { case GL_TEXTURE_2D: - _COGL_GLES2_CHANGE_SETTING (w, texture_2d_enabled, TRUE); + _COGL_GLES2_CHANGE_SETTING ( + w, texture_units[w->active_texture_unit].enabled, TRUE); break; case GL_FOG: @@ -969,7 +1388,8 @@ switch (cap) { case GL_TEXTURE_2D: - _COGL_GLES2_CHANGE_SETTING (w, texture_2d_enabled, FALSE); + _COGL_GLES2_CHANGE_SETTING ( + w, texture_units[w->active_texture_unit].enabled, FALSE); break; case GL_FOG: @@ -988,34 +1408,66 @@ void cogl_wrap_glEnableClientState (GLenum array) { + CoglGles2WrapperTextureUnit *texture_unit; + _COGL_GET_GLES2_WRAPPER (w, NO_RETVAL); + switch (array) { case GL_VERTEX_ARRAY: glEnableVertexAttribArray (COGL_GLES2_WRAPPER_VERTEX_ATTRIB); break; case GL_TEXTURE_COORD_ARRAY: - glEnableVertexAttribArray (COGL_GLES2_WRAPPER_TEX_COORD_ATTRIB); + /* TODO - review if this should be in w->settings? */ + + texture_unit = g_array_index (w->texture_units, + CoglGles2WrapperTextureUnit *, + w->active_texture_unit); + if (texture_unit->texture_coords_enabled != 1) + { + texture_unit->texture_coords_enabled = 1; + w->dirty_vertex_attrib_enables + |= COGL_GLES2_DIRTY_TEX_COORD_ATTRIB_ENABLES; + } break; case GL_COLOR_ARRAY: glEnableVertexAttribArray (COGL_GLES2_WRAPPER_COLOR_ATTRIB); break; + case GL_NORMAL_ARRAY: + glEnableVertexAttribArray (COGL_GLES2_WRAPPER_NORMAL_ATTRIB); + break; } } void cogl_wrap_glDisableClientState (GLenum array) { + CoglGles2WrapperTextureUnit *texture_unit; + _COGL_GET_GLES2_WRAPPER (w, NO_RETVAL); + switch (array) { case GL_VERTEX_ARRAY: glDisableVertexAttribArray (COGL_GLES2_WRAPPER_VERTEX_ATTRIB); break; case GL_TEXTURE_COORD_ARRAY: - glDisableVertexAttribArray (COGL_GLES2_WRAPPER_TEX_COORD_ATTRIB); + + texture_unit = g_array_index (w->texture_units, + CoglGles2WrapperTextureUnit *, + w->active_texture_unit); + /* TODO - review if this should be in w->settings? */ + if (texture_unit->texture_coords_enabled != 0) + { + texture_unit->texture_coords_enabled = 0; + w->dirty_vertex_attrib_enables + |= COGL_GLES2_DIRTY_TEX_COORD_ATTRIB_ENABLES; + } break; case GL_COLOR_ARRAY: glDisableVertexAttribArray (COGL_GLES2_WRAPPER_COLOR_ATTRIB); break; + case GL_NORMAL_ARRAY: + glDisableVertexAttribArray (COGL_GLES2_WRAPPER_NORMAL_ATTRIB); + break; } } @@ -1034,29 +1486,17 @@ } void -cogl_wrap_glColor4x (GLclampx r, GLclampx g, GLclampx b, GLclampx a) +cogl_wrap_glColor4f (GLclampf r, GLclampf g, GLclampf b, GLclampf a) { - glVertexAttrib4f (COGL_GLES2_WRAPPER_COLOR_ATTRIB, - CLUTTER_FIXED_TO_FLOAT (r), - CLUTTER_FIXED_TO_FLOAT (g), - CLUTTER_FIXED_TO_FLOAT (b), - CLUTTER_FIXED_TO_FLOAT (a)); + glVertexAttrib4f (COGL_GLES2_WRAPPER_COLOR_ATTRIB, r, g, b, a); } void -cogl_wrap_glClipPlanex (GLenum plane, GLfixed *equation) +cogl_wrap_glClipPlanef (GLenum plane, GLfloat *equation) { /* FIXME */ } -static void -cogl_gles2_float_array_to_fixed (int size, const GLfloat *floats, - GLfixed *fixeds) -{ - while (size-- > 0) - *(fixeds++) = CLUTTER_FLOAT_TO_FIXED (*(floats++)); -} - void cogl_wrap_glGetIntegerv (GLenum pname, GLint *params) { @@ -1068,6 +1508,10 @@ *params = 0; break; + case CGL_MATRIX_MODE: + *params = w->matrix_mode; + break; + default: glGetIntegerv (pname, params); break; @@ -1075,37 +1519,30 @@ } void -cogl_wrap_glGetFixedv (GLenum pname, GLfixed *params) +cogl_wrap_glGetFloatv (GLenum pname, GLfloat *params) { _COGL_GET_GLES2_WRAPPER (w, NO_RETVAL); switch (pname) { case GL_MODELVIEW_MATRIX: - cogl_gles2_float_array_to_fixed (16, w->modelview_stack - + w->modelview_stack_pos * 16, - params); + memcpy (params, w->modelview_stack + w->modelview_stack_pos * 16, + sizeof (GLfloat) * 16); break; case GL_PROJECTION_MATRIX: - cogl_gles2_float_array_to_fixed (16, w->projection_stack - + w->projection_stack_pos * 16, - params); + memcpy (params, w->projection_stack + w->projection_stack_pos * 16, + sizeof (GLfloat) * 16); break; case GL_VIEWPORT: - { - GLfloat v[4]; - - glGetFloatv (GL_VIEWPORT, v); - cogl_gles2_float_array_to_fixed (4, v, params); - } + glGetFloatv (GL_VIEWPORT, params); break; } } void -cogl_wrap_glFogx (GLenum pname, GLfixed param) +cogl_wrap_glFogf (GLenum pname, GLfloat param) { _COGL_GET_GLES2_WRAPPER (w, NO_RETVAL); @@ -1114,26 +1551,26 @@ case GL_FOG_MODE: _COGL_GLES2_CHANGE_SETTING (w, fog_mode, param); break; - + case GL_FOG_DENSITY: _COGL_GLES2_CHANGE_UNIFORM (w, FOG_DENSITY, fog_density, - CLUTTER_FIXED_TO_FLOAT (param)); + (param)); break; case GL_FOG_START: _COGL_GLES2_CHANGE_UNIFORM (w, FOG_START, fog_start, - CLUTTER_FIXED_TO_FLOAT (param)); + (param)); break; case GL_FOG_END: _COGL_GLES2_CHANGE_UNIFORM (w, FOG_END, fog_end, - CLUTTER_FIXED_TO_FLOAT (param)); + (param)); break; } } void -cogl_wrap_glFogxv (GLenum pname, const GLfixed *params) +cogl_wrap_glFogfv (GLenum pname, const GLfloat *params) { int i; _COGL_GET_GLES2_WRAPPER (w, NO_RETVAL); @@ -1141,7 +1578,8 @@ if (pname == GL_FOG_COLOR) { for (i = 0; i < 4; i++) - w->fog_color[i] = CLUTTER_FIXED_TO_FLOAT (params[i]); + w->fog_color[i] = (params[i]); + w->dirty_uniforms |= COGL_GLES2_DIRTY_FOG_COLOR; } } diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl-gles2-wrapper.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl-gles2-wrapper.h --- clutter-0.8.4/clutter/cogl/gles/cogl-gles2-wrapper.h 2008-11-13 14:52:05.000000000 +0000 +++ clutter-0.9.0/clutter/cogl/gles/cogl-gles2-wrapper.h 2009-01-28 16:45:25.000000000 +0000 @@ -26,15 +26,23 @@ #ifndef __COGL_GLES2_WRAPPER_H__ #define __COGL_GLES2_WRAPPER_H__ +#include "cogl-internal.h" + G_BEGIN_DECLS #ifdef HAVE_COGL_GLES2 -typedef struct _CoglGles2Wrapper CoglGles2Wrapper; -typedef struct _CoglGles2WrapperUniforms CoglGles2WrapperUniforms; -typedef struct _CoglGles2WrapperSettings CoglGles2WrapperSettings; -typedef struct _CoglGles2WrapperProgram CoglGles2WrapperProgram; -typedef struct _CoglGles2WrapperShader CoglGles2WrapperShader; +typedef struct _CoglGles2Wrapper CoglGles2Wrapper; +typedef struct _CoglGles2WrapperTextureUnit + CoglGles2WrapperTextureUnit; + +typedef struct _CoglGles2WrapperAttributes CoglGles2WrapperAttributes; +typedef struct _CoglGles2WrapperUniforms CoglGles2WrapperUniforms; +typedef struct _CoglGles2WrapperTextureUnitSettings + CoglGles2WrapperTextureUnitSettings; +typedef struct _CoglGles2WrapperSettings CoglGles2WrapperSettings; +typedef struct _CoglGles2WrapperProgram CoglGles2WrapperProgram; +typedef struct _CoglGles2WrapperShader CoglGles2WrapperShader; #define COGL_GLES2_NUM_CUSTOM_UNIFORMS 16 #define COGL_GLES2_UNBOUND_CUSTOM_UNIFORM -2 @@ -44,78 +52,129 @@ #define COGL_GLES2_PROJECTION_STACK_SIZE 2 #define COGL_GLES2_TEXTURE_STACK_SIZE 2 +/* Dirty flags for shader uniforms */ enum { COGL_GLES2_DIRTY_MVP_MATRIX = 1 << 0, COGL_GLES2_DIRTY_MODELVIEW_MATRIX = 1 << 1, - COGL_GLES2_DIRTY_TEXTURE_MATRIX = 1 << 2, + COGL_GLES2_DIRTY_TEXTURE_MATRICES = 1 << 2, COGL_GLES2_DIRTY_FOG_DENSITY = 1 << 3, COGL_GLES2_DIRTY_FOG_START = 1 << 4, COGL_GLES2_DIRTY_FOG_END = 1 << 5, COGL_GLES2_DIRTY_FOG_COLOR = 1 << 6, COGL_GLES2_DIRTY_ALPHA_TEST_REF = 1 << 7, - COGL_GLES2_DIRTY_TEXTURE_UNIT = 1 << 8, + COGL_GLES2_DIRTY_TEXTURE_UNITS = 1 << 8, COGL_GLES2_DIRTY_ALL = (1 << 9) - 1 }; +/* Dirty flags for shader vertex attribute pointers */ +enum + { + COGL_GLES2_DIRTY_TEX_COORD_VERTEX_ATTRIB = 1 << 0 + }; + +/* Dirty flags for shader vertex attributes enabled status */ +enum + { + COGL_GLES2_DIRTY_TEX_COORD_ATTRIB_ENABLES = 1 << 0 + }; + +struct _CoglGles2WrapperAttributes +{ + GArray *multi_texture_coords; +}; + struct _CoglGles2WrapperUniforms { - GLint mvp_matrix_uniform; - GLint modelview_matrix_uniform; - GLint texture_matrix_uniform; - GLint bound_texture_uniform; - - GLint fog_density_uniform; - GLint fog_start_uniform; - GLint fog_end_uniform; - GLint fog_color_uniform; + GLint mvp_matrix_uniform; + GLint modelview_matrix_uniform; + GArray *texture_matrix_uniforms; + + GArray *texture_sampler_uniforms; + + GLint fog_density_uniform; + GLint fog_start_uniform; + GLint fog_end_uniform; + GLint fog_color_uniform; - GLint alpha_test_ref_uniform; + GLint alpha_test_ref_uniform; GLint texture_unit_uniform; }; +struct _CoglGles2WrapperTextureUnitSettings +{ + guint enabled:1; + guint alpha_only:1; + /* TODO: blending state */ +}; + +/* NB: We get a copy of this for each fragment/vertex + * program varient we generate so we try to keep it + * fairly lean */ struct _CoglGles2WrapperSettings { - gboolean texture_2d_enabled; - gboolean alpha_only; + CoglGles2WrapperTextureUnitSettings *texture_units; + guint n_texture_units; - gboolean alpha_test_enabled; GLint alpha_test_func; - - gboolean fog_enabled; GLint fog_mode; /* The current in-use user program */ CoglHandle user_program; + + guint alpha_test_enabled:1; + guint fog_enabled:1; +}; + +struct _CoglGles2WrapperTextureUnit +{ + GLfloat texture_stack[COGL_GLES2_TEXTURE_STACK_SIZE * 16]; + GLuint texture_stack_pos; + + GLenum texture_coords_type; + GLint texture_coords_size; + GLsizei texture_coords_stride; + const void *texture_coords_pointer; + + guint texture_coords_enabled:1; + guint dirty_matrix:1; /*!< shader uniform needs updating */ }; struct _CoglGles2Wrapper { - GLuint matrix_mode; - GLfloat modelview_stack[COGL_GLES2_MODELVIEW_STACK_SIZE * 16]; - GLuint modelview_stack_pos; - GLfloat projection_stack[COGL_GLES2_PROJECTION_STACK_SIZE * 16]; - GLuint projection_stack_pos; - GLfloat texture_stack[COGL_GLES2_TEXTURE_STACK_SIZE * 16]; - GLuint texture_stack_pos; + GLuint matrix_mode; + GLfloat modelview_stack[COGL_GLES2_MODELVIEW_STACK_SIZE * 16]; + GLuint modelview_stack_pos; + GLfloat projection_stack[COGL_GLES2_PROJECTION_STACK_SIZE * 16]; + GLuint projection_stack_pos; + GArray *texture_units; + guint active_texture_unit; + guint active_client_texture_unit; /* The combined modelview and projection matrix is only updated at the last minute in glDrawArrays to avoid recalculating it for every change to the modelview matrix */ - GLboolean mvp_uptodate; + GLboolean mvp_uptodate; /* The currently bound program */ CoglGles2WrapperProgram *current_program; - /* The current settings */ + /* The current settings. Effectively these represent anything that + * will require a modified fixed function shader */ CoglGles2WrapperSettings settings; /* Whether the settings have changed since the last draw */ gboolean settings_dirty; /* Uniforms that have changed since the last draw */ int dirty_uniforms, dirty_custom_uniforms; + /* Attribute pointers that have changed since the last draw */ + int dirty_attribute_pointers; + + /* Vertex attribute pointer enables that have changed since the last draw */ + int dirty_vertex_attrib_enables; + /* List of all compiled program combinations */ GSList *compiled_programs; @@ -131,7 +190,7 @@ GLfloat fog_start; GLfloat fog_end; GLfloat fog_color[4]; - GLfloat custom_uniforms[COGL_GLES2_NUM_CUSTOM_UNIFORMS]; + CoglBoxedValue custom_uniforms[COGL_GLES2_NUM_CUSTOM_UNIFORMS]; }; struct _CoglGles2WrapperProgram @@ -141,6 +200,10 @@ /* The settings that were used to generate this combination */ CoglGles2WrapperSettings settings; + /* The attributes for this program that are not bound up-front + * with constant indices */ + CoglGles2WrapperAttributes attributes; + /* The uniforms for this program */ CoglGles2WrapperUniforms uniforms; GLint custom_uniforms[COGL_GLES2_NUM_CUSTOM_UNIFORMS]; @@ -165,6 +228,7 @@ #define GL_VERTEX_ARRAY 0x8074 #define GL_TEXTURE_COORD_ARRAY 0x8078 #define GL_COLOR_ARRAY 0x8076 +#define GL_NORMAL_ARRAY 0x8075 #define GL_LIGHTING 0x0B50 #define GL_ALPHA_TEST 0x0BC0 @@ -200,22 +264,20 @@ void cogl_gles2_wrapper_init (CoglGles2Wrapper *wrapper); void cogl_gles2_wrapper_deinit (CoglGles2Wrapper *wrapper); -void cogl_wrap_glClearColorx (GLclampx r, GLclampx g, GLclampx b, GLclampx a); - void cogl_wrap_glPushMatrix (); void cogl_wrap_glPopMatrix (); void cogl_wrap_glMatrixMode (GLenum mode); void cogl_wrap_glLoadIdentity (); -void cogl_wrap_glMultMatrixx (const GLfixed *m); -void cogl_wrap_glFrustumx (GLfixed left, GLfixed right, - GLfixed bottom, GLfixed top, - GLfixed z_near, GLfixed z_far); -void cogl_wrap_glScalex (GLfixed x, GLfixed y, GLfixed z); -void cogl_wrap_glTranslatex (GLfixed x, GLfixed y, GLfixed z); -void cogl_wrap_glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); -void cogl_wrap_glOrthox (GLfixed left, GLfixed right, - GLfixed bottom, GLfixed top, - GLfixed near, GLfixed far); +void cogl_wrap_glMultMatrixf (const GLfloat *m); +void cogl_wrap_glFrustumf (GLfloat left, GLfloat right, + GLfloat bottom, GLfloat top, + GLfloat z_near, GLfloat z_far); +void cogl_wrap_glScalef (GLfloat x, GLfloat y, GLfloat z); +void cogl_wrap_glTranslatef (GLfloat x, GLfloat y, GLfloat z); +void cogl_wrap_glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +void cogl_wrap_glOrthof (GLfloat left, GLfloat right, + GLfloat bottom, GLfloat top, + GLfloat near, GLfloat far); void cogl_wrap_glEnable (GLenum cap); void cogl_wrap_glDisable (GLenum cap); @@ -226,26 +288,32 @@ const GLvoid *pointer); void cogl_wrap_glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +void cogl_wrap_glNormalPointer (GLenum type, GLsizei stride, + const GLvoid *pointer); + +void cogl_wrap_glTexEnvf (GLenum target, GLenum pname, GLfloat param); -void cogl_wrap_glTexEnvx (GLenum target, GLenum pname, GLfixed param); +void cogl_wrap_glClientActiveTexture (GLenum texture); +void cogl_wrap_glActiveTexture (GLenum texture); void cogl_wrap_glEnableClientState (GLenum array); void cogl_wrap_glDisableClientState (GLenum array); void cogl_wrap_glAlphaFunc (GLenum func, GLclampf ref); -void cogl_wrap_glColor4x (GLclampx r, GLclampx g, GLclampx b, GLclampx a); +void cogl_wrap_glColor4f (GLclampf r, GLclampf g, GLclampf b, GLclampf a); -void cogl_wrap_glClipPlanex (GLenum plane, GLfixed *equation); +void cogl_wrap_glClipPlanef (GLenum plane, GLfloat *equation); void cogl_wrap_glGetIntegerv (GLenum pname, GLint *params); -void cogl_wrap_glGetFixedv (GLenum pname, GLfixed *params); +void cogl_wrap_glGetFloatv (GLenum pname, GLfloat *params); -void cogl_wrap_glFogx (GLenum pname, GLfixed param); -void cogl_wrap_glFogxv (GLenum pname, const GLfixed *params); +void cogl_wrap_glFogf (GLenum pname, GLfloat param); +void cogl_wrap_glFogfv (GLenum pname, const GLfloat *params); void cogl_wrap_glDrawArrays (GLenum mode, GLint first, GLsizei count); - +void cogl_wrap_glDrawElements (GLenum mode, GLsizei count, GLenum type, + const GLvoid *indices); void cogl_wrap_glTexParameteri (GLenum target, GLenum pname, GLfloat param); void cogl_gles2_wrapper_bind_texture (GLenum target, GLuint texture, @@ -254,12 +322,6 @@ /* This function is only available on GLES 2 */ #define cogl_wrap_glGenerateMipmap glGenerateMipmap -void cogl_gles2_wrapper_bind_attributes (GLuint program); -void cogl_gles2_wrapper_get_uniforms (GLuint program, - CoglGles2WrapperUniforms *uniforms); -void cogl_gles2_wrapper_update_matrix (CoglGles2Wrapper *wrapper, - GLenum matrix_num); - void _cogl_gles2_clear_cache_for_program (CoglHandle program); #else /* HAVE_COGL_GLES2 */ @@ -267,33 +329,35 @@ /* If we're not using GL ES 2 then just use the GL functions directly */ -#define cogl_wrap_glClearColorx glClearColorx #define cogl_wrap_glDrawArrays glDrawArrays +#define cogl_wrap_glDrawElements glDrawElements #define cogl_wrap_glPushMatrix glPushMatrix #define cogl_wrap_glPopMatrix glPopMatrix #define cogl_wrap_glMatrixMode glMatrixMode #define cogl_wrap_glLoadIdentity glLoadIdentity -#define cogl_wrap_glMultMatrixx glMultMatrixx -#define cogl_wrap_glFrustumx glFrustumx -#define cogl_wrap_glScalex glScalex -#define cogl_wrap_glTranslatex glTranslatex -#define cogl_wrap_glRotatex glRotatex -#define cogl_wrap_glOrthox glOrthox +#define cogl_wrap_glMultMatrixf glMultMatrixf +#define cogl_wrap_glFrustumf glFrustumf +#define cogl_wrap_glScalef glScalef +#define cogl_wrap_glTranslatef glTranslatef +#define cogl_wrap_glRotatef glRotatef +#define cogl_wrap_glOrthof glOrthof #define cogl_wrap_glEnable glEnable #define cogl_wrap_glDisable glDisable #define cogl_wrap_glTexCoordPointer glTexCoordPointer #define cogl_wrap_glVertexPointer glVertexPointer #define cogl_wrap_glColorPointer glColorPointer -#define cogl_wrap_glTexEnvx glTexEnvx +#define cogl_wrap_glNormalPointer glNormalPointer +#define cogl_wrap_glTexEnvf glTexEnvf +#define cogl_wrap_glActiveTexture glActiveTexture #define cogl_wrap_glEnableClientState glEnableClientState #define cogl_wrap_glDisableClientState glDisableClientState #define cogl_wrap_glAlphaFunc glAlphaFunc -#define cogl_wrap_glColor4x glColor4x -#define cogl_wrap_glClipPlanex glClipPlanex +#define cogl_wrap_glColor4f glColor4f +#define cogl_wrap_glClipPlanef glClipPlanef #define cogl_wrap_glGetIntegerv glGetIntegerv -#define cogl_wrap_glGetFixedv glGetFixedv -#define cogl_wrap_glFogx glFogx -#define cogl_wrap_glFogxv glFogxv +#define cogl_wrap_glGetFloatv glGetFloatv +#define cogl_wrap_glFogf glFogf +#define cogl_wrap_glFogfv glFogfv #define cogl_wrap_glTexParameteri glTexParameteri /* The extra third parameter of the bind texture wrapper isn't needed @@ -305,6 +369,11 @@ glGenerateMipmap doesn't need to do anything */ #define cogl_wrap_glGenerateMipmap(x) ((void) 0) +/* GLES doesn't have glDrawRangeElements, so we simply pretend it does + * but that it makes no use of the start, end constraints: */ +#define glDrawRangeElements(mode, start, end, count, type, indices) \ + glDrawElements (mode, count, type, indices) + #endif /* HAVE_COGL_GLES2 */ G_END_DECLS diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl-internal.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl-internal.h --- clutter-0.8.4/clutter/cogl/gles/cogl-internal.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gles/cogl-internal.h 2009-01-28 16:45:25.000000000 +0000 @@ -26,6 +26,30 @@ #ifndef __COGL_INTERNAL_H #define __COGL_INTERNAL_H +typedef enum { + COGL_BOXED_NONE, + COGL_BOXED_INT, + COGL_BOXED_FLOAT, + COGL_BOXED_MATRIX +} CoglBoxedType; + +typedef struct _CoglBoxedValue +{ + CoglBoxedType type; + int size, count; + gboolean transpose; + + union { + gfloat float_value[4]; + gint int_value[4]; + gfloat matrix[16]; + gfloat *float_array; + gint *int_array; + gpointer array; + } v; +} CoglBoxedValue; + + #define COGL_DEBUG 0 #if COGL_DEBUG @@ -46,17 +70,15 @@ #else /* COGL_DEBUG */ -#define GE(x) (x); +#define GE(x) (x) #endif /* COGL_DEBUG */ #define COGL_ENABLE_BLEND (1<<1) -#define COGL_ENABLE_TEXTURE_2D (1<<2) -#define COGL_ENABLE_ALPHA_TEST (1<<3) -#define COGL_ENABLE_TEXTURE_RECT (1<<4) -#define COGL_ENABLE_VERTEX_ARRAY (1<<5) -#define COGL_ENABLE_TEXCOORD_ARRAY (1<<6) -#define COGL_ENABLE_COLOR_ARRAY (1<<7) +#define COGL_ENABLE_ALPHA_TEST (1<<2) +#define COGL_ENABLE_VERTEX_ARRAY (1<<3) +#define COGL_ENABLE_COLOR_ARRAY (1<<4) +#define COGL_ENABLE_BACKFACE_CULLING (1<<5) gint _cogl_get_format_bpp (CoglPixelFormat format); diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl-primitives.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl-primitives.c --- clutter-0.8.4/clutter/cogl/gles/cogl-primitives.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gles/cogl-primitives.c 2009-01-29 08:31:37.000000000 +0000 @@ -34,98 +34,31 @@ #include #include +#include #define _COGL_MAX_BEZ_RECURSE_DEPTH 16 void -_cogl_rectangle (gint x, - gint y, - guint width, - guint height) +_cogl_path_add_node (gboolean new_sub_path, + float x, + float y) { - /* 32-bit integers are not supported as coord types - in GLES . Fixed type has got 16 bits left of the - point which is equal to short anyway. */ - - GLshort rect_verts[8] = { - (GLshort) x, (GLshort) y, - (GLshort) (x + width), (GLshort) y, - (GLshort) x, (GLshort) (y + height), - (GLshort) (x + width), (GLshort) (y + height) - }; + CoglPathNode new_node; _COGL_GET_CONTEXT (ctx, NO_RETVAL); - - cogl_enable (COGL_ENABLE_VERTEX_ARRAY - | (ctx->color_alpha < 255 ? COGL_ENABLE_BLEND : 0)); - GE ( cogl_wrap_glVertexPointer (2, GL_SHORT, 0, rect_verts ) ); - GE ( cogl_wrap_glDrawArrays (GL_TRIANGLE_STRIP, 0, 4) ); -} - - -void -_cogl_rectanglex (ClutterFixed x, - ClutterFixed y, - ClutterFixed width, - ClutterFixed height) -{ - GLfixed rect_verts[8] = { - x, y, - x + width, y, - x, y + height, - x + width, y + height - }; - - _COGL_GET_CONTEXT (ctx, NO_RETVAL); - - cogl_enable (COGL_ENABLE_VERTEX_ARRAY - | (ctx->color_alpha < 255 - ? COGL_ENABLE_BLEND : 0)); - - GE( cogl_wrap_glVertexPointer (2, GL_FIXED, 0, rect_verts) ); - GE( cogl_wrap_glDrawArrays (GL_TRIANGLE_STRIP, 0, 4) ); -} + new_node.x = x; + new_node.y = y; + new_node.path_size = 0; + if (new_sub_path || ctx->path_nodes->len == 0) + ctx->last_path = ctx->path_nodes->len; -void -_cogl_path_clear_nodes () -{ - _COGL_GET_CONTEXT (ctx, NO_RETVAL); - - if (ctx->path_nodes) - g_free(ctx->path_nodes); - - ctx->path_nodes = (CoglFixedVec2*) g_malloc (2 * sizeof(CoglFixedVec2)); - ctx->path_nodes_size = 0; - ctx->path_nodes_cap = 2; -} + g_array_append_val (ctx->path_nodes, new_node); -void -_cogl_path_add_node (ClutterFixed x, - ClutterFixed y) -{ - CoglFixedVec2 *new_nodes = NULL; - - _COGL_GET_CONTEXT (ctx, NO_RETVAL); - - if (ctx->path_nodes_size == ctx->path_nodes_cap) - { - new_nodes = g_realloc (ctx->path_nodes, - 2 * ctx->path_nodes_cap - * sizeof (CoglFixedVec2)); - - if (new_nodes == NULL) return; + g_array_index (ctx->path_nodes, CoglPathNode, ctx->last_path).path_size++; - ctx->path_nodes = new_nodes; - ctx->path_nodes_cap *= 2; - } - - ctx->path_nodes [ctx->path_nodes_size].x = x; - ctx->path_nodes [ctx->path_nodes_size].y = y; - ctx->path_nodes_size++; - - if (ctx->path_nodes_size == 1) + if (ctx->path_nodes->len == 1) { ctx->path_nodes_min.x = ctx->path_nodes_max.x = x; ctx->path_nodes_min.y = ctx->path_nodes_max.y = y; @@ -142,14 +75,45 @@ void _cogl_path_stroke_nodes () { + guint path_start = 0; + gulong enable_flags = COGL_ENABLE_VERTEX_ARRAY; + _COGL_GET_CONTEXT (ctx, NO_RETVAL); - - cogl_enable (COGL_ENABLE_VERTEX_ARRAY - | (ctx->color_alpha < 255 - ? COGL_ENABLE_BLEND : 0)); - - GE( cogl_wrap_glVertexPointer (2, GL_FIXED, 0, ctx->path_nodes) ); - GE( cogl_wrap_glDrawArrays (GL_LINE_STRIP, 0, ctx->path_nodes_size) ); + + enable_flags |= cogl_material_get_cogl_enable_flags (ctx->source_material); + cogl_enable (enable_flags); + + cogl_material_flush_gl_state (ctx->source_material, + COGL_MATERIAL_FLUSH_DISABLE_MASK, + (guint32)~0, /* disable all texture layers */ + NULL); + + while (path_start < ctx->path_nodes->len) + { + CoglPathNode *path = &g_array_index (ctx->path_nodes, CoglPathNode, + path_start); + + GE( glVertexPointer (2, GL_FLOAT, sizeof (CoglPathNode), + (guchar *) path + + G_STRUCT_OFFSET (CoglPathNode, x)) ); + GE( glDrawArrays (GL_LINE_STRIP, 0, path->path_size) ); + + path_start += path->path_size; + } +} + +static void +_cogl_path_get_bounds (floatVec2 nodes_min, + floatVec2 nodes_max, + float *bounds_x, + float *bounds_y, + float *bounds_w, + float *bounds_h) +{ + *bounds_x = nodes_min.x; + *bounds_y = nodes_min.y; + *bounds_w = nodes_max.x - *bounds_x; + *bounds_h = nodes_max.y - *bounds_y; } static gint compare_ints (gconstpointer a, @@ -159,208 +123,318 @@ } void -_cogl_path_fill_nodes () +_cogl_add_path_to_stencil_buffer (floatVec2 nodes_min, + floatVec2 nodes_max, + guint path_size, + CoglPathNode *path, + gboolean merge) { - guint bounds_x; - guint bounds_y; - guint bounds_w; - guint bounds_h; + guint path_start = 0; + guint sub_path_num = 0; + float bounds_x; + float bounds_y; + float bounds_w; + float bounds_h; + gulong enable_flags = COGL_ENABLE_VERTEX_ARRAY; _COGL_GET_CONTEXT (ctx, NO_RETVAL); - - bounds_x = CLUTTER_FIXED_FLOOR (ctx->path_nodes_min.x); - bounds_y = CLUTTER_FIXED_FLOOR (ctx->path_nodes_min.y); - bounds_w = CLUTTER_FIXED_CEIL (ctx->path_nodes_max.x - ctx->path_nodes_min.x); - bounds_h = CLUTTER_FIXED_CEIL (ctx->path_nodes_max.y - ctx->path_nodes_min.y); - if (cogl_features_available (COGL_FEATURE_STENCIL_BUFFER)) + /* Just setup a simple material that doesn't use texturing... */ + cogl_material_flush_gl_state (ctx->stencil_material, NULL); + + enable_flags |= + cogl_material_get_cogl_enable_flags (ctx->source_material); + cogl_enable (enable_flags); + + _cogl_path_get_bounds (nodes_min, nodes_max, + &bounds_x, &bounds_y, &bounds_w, &bounds_h); + + if (merge) + { + GE( glStencilMask (2) ); + GE( glStencilFunc (GL_LEQUAL, 0x2, 0x6) ); + } + else { GE( glClear (GL_STENCIL_BUFFER_BIT) ); - - GE( cogl_wrap_glEnable (GL_STENCIL_TEST) ); - GE( glStencilFunc (GL_NEVER, 0x0, 0x1) ); - GE( glStencilOp (GL_INVERT, GL_INVERT, GL_INVERT) ); - GE( glStencilMask (1) ); + GE( glStencilFunc (GL_LEQUAL, 0x1, 0x3) ); + } + + GE( glEnable (GL_STENCIL_TEST) ); + GE( glStencilOp (GL_INVERT, GL_INVERT, GL_INVERT) ); - cogl_enable (COGL_ENABLE_VERTEX_ARRAY - | (ctx->color_alpha < 255 ? COGL_ENABLE_BLEND : 0)); - - GE( cogl_wrap_glVertexPointer (2, GL_FIXED, 0, ctx->path_nodes) ); - GE( cogl_wrap_glDrawArrays (GL_TRIANGLE_FAN, 0, ctx->path_nodes_size) ); - - GE( glStencilMask (~(GLuint) 0) ); - - /* Merge the stencil buffer with any clipping rectangles */ - _cogl_clip_stack_merge (); - - GE( glStencilFunc (GL_EQUAL, 0x1, 0x1) ); - GE( glStencilOp (GL_KEEP, GL_KEEP, GL_KEEP) ); - - cogl_rectangle (bounds_x, bounds_y, bounds_w, bounds_h); - - /* Rebuild the stencil clip */ - _cogl_clip_stack_rebuild (TRUE); + GE( glColorMask (FALSE, FALSE, FALSE, FALSE) ); + GE( glDepthMask (FALSE) ); + + while (path_start < path_size) + { + GE( glVertexPointer (2, GL_FLOAT, sizeof (CoglPathNode), + (guchar *) path + + G_STRUCT_OFFSET (CoglPathNode, x)) ); + GE( glDrawArrays (GL_TRIANGLE_FAN, 0, path->path_size) ); + + if (sub_path_num > 0) + { + /* Union the two stencil buffers bits into the least + significant bit */ + GE( glStencilMask (merge ? 6 : 3) ); + GE( glStencilOp (GL_ZERO, GL_REPLACE, GL_REPLACE) ); + cogl_rectangle (bounds_x, bounds_y, + bounds_x + bounds_w, bounds_y + bounds_h); + + GE( glStencilOp (GL_INVERT, GL_INVERT, GL_INVERT) ); + } + + GE( glStencilMask (merge ? 4 : 2) ); + + path_start += path->path_size; + path += path->path_size; + sub_path_num++; } - else + + if (merge) + { + /* Now we have the new stencil buffer in bit 1 and the old + stencil buffer in bit 0 so we need to intersect them */ + GE( glStencilMask (3) ); + GE( glStencilFunc (GL_NEVER, 0x2, 0x3) ); + GE( glStencilOp (GL_DECR, GL_DECR, GL_DECR) ); + /* Decrement all of the bits twice so that only pixels where the + value is 3 will remain */ + GE( glPushMatrix () ); + GE( glLoadIdentity () ); + GE( glMatrixMode (GL_PROJECTION) ); + GE( glPushMatrix () ); + GE( glLoadIdentity () ); + cogl_rectangle (-1.0, -1.0, 1.0, 1.0); + cogl_rectangle (-1.0, -1.0, 1.0, 1.0); + GE( glPopMatrix () ); + GE( glMatrixMode (GL_MODELVIEW) ); + GE( glPopMatrix () ); + } + + GE( glStencilMask (~(GLuint) 0) ); + GE( glDepthMask (TRUE) ); + GE( glColorMask (TRUE, TRUE, TRUE, TRUE) ); + + GE( glStencilFunc (GL_EQUAL, 0x1, 0x1) ); + GE( glStencilOp (GL_KEEP, GL_KEEP, GL_KEEP) ); +} + +static void +_cogl_path_fill_nodes_scanlines (CoglPathNode *path, + guint path_size, + gint bounds_x, + gint bounds_y, + guint bounds_w, + guint bounds_h) +{ + /* This is our edge list it stores intersections between our + * curve and scanlines, it should probably be implemented with a + * data structure that has smaller overhead for inserting the + * curve/scanline intersections. + */ + GSList *scanlines[bounds_h]; + + gint i; + gint prev_x; + gint prev_y; + gint first_x; + gint first_y; + gint lastdir=-2; /* last direction we vere moving */ + gint lastline=-1; /* the previous scanline we added to */ + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + /* clear scanline intersection lists */ + for (i=0; i < bounds_h; i++) + scanlines[i]=NULL; + + first_x = prev_x = (path->x); + first_y = prev_y = (path->y); + + /* create scanline intersection list */ + for (i=1; i < path_size; i++) { - /* This is our edge list it stores intersections between our - * curve and scanlines, it should probably be implemented with a - * data structure that has smaller overhead for inserting the - * curve/scanline intersections. - */ - GSList *scanlines[bounds_h]; - - gint i; - gint prev_x; - gint prev_y; - gint first_x; - gint first_y; - gint lastdir=-2; /* last direction we vere moving */ - gint lastline=-1; /* the previous scanline we added to */ - - /* clear scanline intersection lists */ - for (i=0; i < bounds_h; i++) - scanlines[i]=NULL; - - first_x = prev_x = CLUTTER_FIXED_TO_INT (ctx->path_nodes[0].x); - first_y = prev_y = CLUTTER_FIXED_TO_INT (ctx->path_nodes[0].y); - - /* create scanline intersection list */ - for (i=1; ipath_nodes_size; i++) - { - gint dest_x = CLUTTER_FIXED_TO_INT (ctx->path_nodes[i].x); - gint dest_y = CLUTTER_FIXED_TO_INT (ctx->path_nodes[i].y); - gint ydir; - gint dx; - gint dy; - gint y; - - fill_close: - dx = dest_x - prev_x; - dy = dest_y - prev_y; - - if (dy < 0) - ydir = -1; - else if (dy > 0) - ydir = 1; - else - ydir = 0; - - /* do linear interpolation between vertexes */ - for (y=prev_y; y!= dest_y; y += ydir) - { - - /* only add a point if the scanline has changed and we're - * within bounds. - */ - if (y-bounds_y >= 0 && - y-bounds_y < bounds_h && - lastline != y) - { - gint x = prev_x + (dx * (y-prev_y)) / dy; - - scanlines[ y - bounds_y ]= - g_slist_insert_sorted (scanlines[ y - bounds_y], - GINT_TO_POINTER(x), - compare_ints); - - if (ydir != lastdir && /* add a double entry when changing */ - lastdir!=-2) /* vertical direction */ - scanlines[ y - bounds_y ]= - g_slist_insert_sorted (scanlines[ y - bounds_y], - GINT_TO_POINTER(x), - compare_ints); - lastdir = ydir; - lastline = y; - } - } - - prev_x = dest_x; - prev_y = dest_y; - - /* if we're on the last knot, fake the first vertex being a - next one */ - if (ctx->path_nodes_size == i+1) - { - dest_x = first_x; - dest_y = first_y; - i++; /* to make the loop finally end */ - goto fill_close; - } - } + gint dest_x = (path[i].x); + gint dest_y = (path[i].y); + gint ydir; + gint dx; + gint dy; + gint y; + + fill_close: + dx = dest_x - prev_x; + dy = dest_y - prev_y; + + if (dy < 0) + ydir = -1; + else if (dy > 0) + ydir = 1; + else + ydir = 0; + + /* do linear interpolation between vertexes */ + for (y=prev_y; y!= dest_y; y += ydir) + { + + /* only add a point if the scanline has changed and we're + * within bounds. + */ + if (y-bounds_y >= 0 && + y-bounds_y < bounds_h && + lastline != y) + { + gint x = prev_x + (dx * (y-prev_y)) / dy; + + scanlines[ y - bounds_y ]= + g_slist_insert_sorted (scanlines[ y - bounds_y], + GINT_TO_POINTER(x), + compare_ints); + + if (ydir != lastdir && /* add a double entry when changing */ + lastdir!=-2) /* vertical direction */ + scanlines[ y - bounds_y ]= + g_slist_insert_sorted (scanlines[ y - bounds_y], + GINT_TO_POINTER(x), + compare_ints); + lastdir = ydir; + lastline = y; + } + } + + prev_x = dest_x; + prev_y = dest_y; + + /* if we're on the last knot, fake the first vertex being a + next one */ + if (path_size == i+1) + { + dest_x = first_x; + dest_y = first_y; + i++; /* to make the loop finally end */ + goto fill_close; + } + } + { + gint spans = 0; + gint span_no; + GLfloat *coords; + + /* count number of spans */ + for (i=0; i < bounds_h; i++) { - gint spans = 0; - gint span_no; - GLfixed *coords; - - /* count number of spans */ - for (i=0; i < bounds_h; i++) - { - GSList *iter = scanlines[i]; - while (iter) - { - GSList *next = iter->next; - if (!next) - { - break; - } - /* draw the segments that should be visible */ - spans ++; - iter = next->next; - } - } - coords = g_malloc0 (spans * sizeof (GLfixed) * 3 * 2 * 2); - - span_no = 0; - /* build list of triangles */ - for (i=0; i < bounds_h; i++) - { - GSList *iter = scanlines[i]; - while (iter) - { - GSList *next = iter->next; - GLfixed x0, x1; - GLfixed y0, y1; - if (!next) - break; - - x0 = CLUTTER_INT_TO_FIXED (GPOINTER_TO_INT (iter->data)); - x1 = CLUTTER_INT_TO_FIXED (GPOINTER_TO_INT (next->data)); - y0 = CLUTTER_INT_TO_FIXED (bounds_y + i); - y1 = CLUTTER_INT_TO_FIXED (bounds_y + i + 1) + 2048; - /* render scanlines 1.0625 high to avoid gaps when - transformed */ - - coords[span_no * 12 + 0] = x0; - coords[span_no * 12 + 1] = y0; - coords[span_no * 12 + 2] = x1; - coords[span_no * 12 + 3] = y0; - coords[span_no * 12 + 4] = x1; - coords[span_no * 12 + 5] = y1; - coords[span_no * 12 + 6] = x0; - coords[span_no * 12 + 7] = y0; - coords[span_no * 12 + 8] = x0; - coords[span_no * 12 + 9] = y1; - coords[span_no * 12 + 10] = x1; - coords[span_no * 12 + 11] = y1; - span_no ++; - iter = next->next; - } - } - for (i=0; i < bounds_h; i++) - { - g_slist_free (scanlines[i]); - } - - /* render triangles */ - cogl_enable (COGL_ENABLE_VERTEX_ARRAY - | (ctx->color_alpha < 255 ? COGL_ENABLE_BLEND : 0)); - GE ( cogl_wrap_glVertexPointer (2, GL_FIXED, 0, coords ) ); - GE ( cogl_wrap_glDrawArrays (GL_TRIANGLES, 0, spans * 2 * 3)); - g_free (coords); + GSList *iter = scanlines[i]; + while (iter) + { + GSList *next = iter->next; + if (!next) + { + break; + } + /* draw the segments that should be visible */ + spans ++; + iter = next->next; + } } - } + coords = g_malloc0 (spans * sizeof (GLfloat) * 3 * 2 * 2); + + span_no = 0; + /* build list of triangles */ + for (i=0; i < bounds_h; i++) + { + GSList *iter = scanlines[i]; + while (iter) + { + GSList *next = iter->next; + GLfloat x0, x1; + GLfloat y0, y1; + if (!next) + break; + + x0 = GPOINTER_TO_INT (iter->data); + x1 = GPOINTER_TO_INT (next->data); + y0 = bounds_y + i; + y1 = bounds_y + i + 1.0625f; + /* render scanlines 1.0625 high to avoid gaps when + transformed */ + + coords[span_no * 12 + 0] = x0; + coords[span_no * 12 + 1] = y0; + coords[span_no * 12 + 2] = x1; + coords[span_no * 12 + 3] = y0; + coords[span_no * 12 + 4] = x1; + coords[span_no * 12 + 5] = y1; + coords[span_no * 12 + 6] = x0; + coords[span_no * 12 + 7] = y0; + coords[span_no * 12 + 8] = x0; + coords[span_no * 12 + 9] = y1; + coords[span_no * 12 + 10] = x1; + coords[span_no * 12 + 11] = y1; + span_no ++; + iter = next->next; + } + } + for (i=0; i < bounds_h; i++) + { + g_slist_free (scanlines[i]); + } + + /* render triangles */ + cogl_enable (COGL_ENABLE_VERTEX_ARRAY + | (ctx->color_alpha < 255 ? COGL_ENABLE_BLEND : 0)); + GE ( glVertexPointer (2, GL_FLOAT, 0, coords ) ); + GE ( glDrawArrays (GL_TRIANGLES, 0, spans * 2 * 3)); + g_free (coords); + } } +void +_cogl_path_fill_nodes () +{ + float bounds_x; + float bounds_y; + float bounds_w; + float bounds_h; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + _cogl_path_get_bounds (ctx->path_nodes_min, ctx->path_nodes_max, + &bounds_x, &bounds_y, &bounds_w, &bounds_h); + + if (cogl_features_available (COGL_FEATURE_STENCIL_BUFFER)) + { + _cogl_add_path_to_stencil_buffer (ctx->path_nodes_min, + ctx->path_nodes_max, + ctx->path_nodes->len, + &g_array_index (ctx->path_nodes, + CoglPathNode, 0), + ctx->clip.stencil_used); + + cogl_rectangle (bounds_x, bounds_y, + bounds_x + bounds_w, bounds_y + bounds_h); + + /* The stencil buffer now contains garbage so the clip area needs to + be rebuilt */ + ctx->clip.stack_dirty = TRUE; + } + else + { + guint path_start = 0; + + while (path_start < ctx->path_nodes->len) + { + CoglPathNode *path = &g_array_index (ctx->path_nodes, CoglPathNode, + path_start); + + _cogl_path_fill_nodes_scanlines (path, + path->path_size, + bounds_x, bounds_y, + bounds_w, bounds_h); + + path_start += path->path_size; + } + } +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl-program.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl-program.c --- clutter-0.8.4/clutter/cogl/gles/cogl-program.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gles/cogl-program.c 2009-01-28 08:12:46.000000000 +0000 @@ -37,7 +37,7 @@ #include -#include "cogl-shader.h" +#include "cogl-shader-private.h" #include "cogl-program.h" static void _cogl_program_free (CoglProgram *program); @@ -163,15 +163,101 @@ cogl_program_uniform_1f (COGLint uniform_no, gfloat value) { + cogl_program_uniform_float (uniform_no, 1, 1, &value); +} + +void +cogl_program_uniform_1i (COGLint uniform_no, + gint value) +{ + cogl_program_uniform_int (uniform_no, 1, 1, &value); +} + +static void +cogl_program_uniform_x (COGLint uniform_no, + gint size, + gint count, + CoglBoxedType type, + size_t value_size, + gconstpointer value) +{ _COGL_GET_CONTEXT (ctx, NO_RETVAL); - if (uniform_no >= 0 && uniform_no < COGL_GLES2_NUM_CUSTOM_UNIFORMS) + if (uniform_no >= 0 && uniform_no < COGL_GLES2_NUM_CUSTOM_UNIFORMS + && size >= 1 && size <= 4 && count >= 1) { - ctx->gles2.custom_uniforms[uniform_no] = value; + CoglBoxedValue *bv = ctx->gles2.custom_uniforms + uniform_no; + + if (count == 1) + { + if (bv->count > 1) + g_free (bv->v.array); + + memcpy (bv->v.float_value, value, value_size); + } + else + { + if (bv->count > 1) + { + if (bv->count != count || bv->size != size || bv->type != type) + { + g_free (bv->v.array); + bv->v.array = g_malloc (count * value_size); + } + } + else + bv->v.array = g_malloc (count * value_size); + + memcpy (bv->v.array, value, count * value_size); + } + + bv->type = type; + bv->size = size; + bv->count = count; + ctx->gles2.dirty_custom_uniforms |= 1 << uniform_no; } } +void +cogl_program_uniform_float (COGLint uniform_no, + gint size, + gint count, + const GLfloat *value) +{ + cogl_program_uniform_x (uniform_no, size, count, COGL_BOXED_FLOAT, + sizeof (float) * size, value); +} + +void +cogl_program_uniform_int (COGLint uniform_no, + gint size, + gint count, + const GLint *value) +{ + cogl_program_uniform_x (uniform_no, size, count, COGL_BOXED_INT, + sizeof (gint) * size, value); +} + +void +cogl_program_uniform_matrix (COGLint uniform_no, + gint size, + gint count, + gboolean transpose, + const GLfloat *value) +{ + CoglBoxedValue *bv; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + bv = ctx->gles2.custom_uniforms + uniform_no; + + cogl_program_uniform_x (uniform_no, size, count, COGL_BOXED_MATRIX, + sizeof (float) * size * size, value); + + bv->transpose = transpose; +} + #else /* HAVE_COGL_GLES2 */ /* No support on regular OpenGL 1.1 */ @@ -228,4 +314,30 @@ { } +void +cogl_program_uniform_float (COGLint uniform_no, + gint size, + gint count, + const GLfloat *value) +{ +} + +void +cogl_program_uniform_int (COGLint uniform_no, + gint size, + gint count, + const COGLint *value) +{ +} + +void +cogl_program_uniform_matrix (COGLint uniform_no, + gint size, + gint count, + gboolean transpose, + const GLfloat *value) +{ +} + + #endif /* HAVE_COGL_GLES2 */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl-shader.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl-shader.c --- clutter-0.8.4/clutter/cogl/gles/cogl-shader.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gles/cogl-shader.c 2009-01-28 08:12:46.000000000 +0000 @@ -29,7 +29,7 @@ #include "cogl.h" -#include "cogl-shader.h" +#include "cogl-shader-private.h" #include "cogl-internal.h" #include "cogl-context.h" #include "cogl-handle.h" diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl-shader.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl-shader.h --- clutter-0.8.4/clutter/cogl/gles/cogl-shader.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gles/cogl-shader.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,40 +0,0 @@ -/* - * Clutter COGL - * - * A basic GL/GLES Abstraction/Utility Layer - * - * Authored By Matthew Allum - * - * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __COGL_SHADER_H -#define __COGL_SHADER_H - -typedef struct _CoglShader CoglShader; - -struct _CoglShader -{ - guint ref_count; - GLuint gl_handle; - GLenum type; -}; - -CoglShader *_cogl_shader_pointer_from_handle (CoglHandle handle); - -#endif /* __COGL_SHADER_H */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl-shader-private.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl-shader-private.h --- clutter-0.8.4/clutter/cogl/gles/cogl-shader-private.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gles/cogl-shader-private.h 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,40 @@ +/* + * Clutter COGL + * + * A basic GL/GLES Abstraction/Utility Layer + * + * Authored By Matthew Allum + * + * 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, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __COGL_SHADER_H +#define __COGL_SHADER_H + +typedef struct _CoglShader CoglShader; + +struct _CoglShader +{ + guint ref_count; + GLuint gl_handle; + GLenum type; +}; + +CoglShader *_cogl_shader_pointer_from_handle (CoglHandle handle); + +#endif /* __COGL_SHADER_H */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl-texture.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl-texture.c --- clutter-0.8.4/clutter/cogl/gles/cogl-texture.c 2008-11-13 14:44:32.000000000 +0000 +++ clutter-0.9.0/clutter/cogl/gles/cogl-texture.c 2009-01-29 08:31:37.000000000 +0000 @@ -31,7 +31,8 @@ #include "cogl-internal.h" #include "cogl-util.h" #include "cogl-bitmap.h" -#include "cogl-texture.h" +#include "cogl-texture-private.h" +#include "cogl-material.h" #include "cogl-context.h" #include "cogl-handle.h" @@ -39,6 +40,8 @@ #include #include +#include + /* #define COGL_DEBUG 1 @@ -50,39 +53,48 @@ printf("err: 0x%x\n", err); \ } */ +#ifdef HAVE_COGL_GL + +#define glDrawRangeElements ctx->pf_glDrawRangeElements + +#else + +/* GLES doesn't have glDrawRangeElements, so we simply pretend it does + * but that it makes no use of the start, end constraints: */ +#define glDrawRangeElements(mode, start, end, count, type, indices) \ + glDrawElements (mode, count, type, indices) + +#endif + +static void _cogl_journal_flush (void); + +static void _cogl_texture_free (CoglTexture *tex); + +COGL_HANDLE_DEFINE (Texture, texture, texture_handles); + struct _CoglSpanIter { gint index; GArray *array; CoglTexSliceSpan *span; - ClutterFixed pos; - ClutterFixed next_pos; - ClutterFixed origin; - ClutterFixed cover_start; - ClutterFixed cover_end; - ClutterFixed intersect_start; - ClutterFixed intersect_end; - ClutterFixed intersect_start_local; - ClutterFixed intersect_end_local; + float pos; + float next_pos; + float origin; + float cover_start; + float cover_end; + float intersect_start; + float intersect_end; + float intersect_start_local; + float intersect_end_local; gboolean intersects; }; -static void _cogl_texture_free (CoglTexture *tex); - -COGL_HANDLE_DEFINE (Texture, texture, texture_handles); - -CoglHandle -_cogl_texture_handle_from_pointer (CoglTexture *tex) -{ - return (CoglHandle) tex; -} - static void _cogl_texture_bitmap_free (CoglTexture *tex) { if (tex->bitmap.data != NULL && tex->bitmap_owner) g_free (tex->bitmap.data); - + tex->bitmap.data = NULL; tex->bitmap_owner = FALSE; } @@ -93,7 +105,7 @@ { if (tex->bitmap.data != NULL && tex->bitmap_owner) g_free (tex->bitmap.data); - + tex->bitmap = *new_bitmap; tex->bitmap_owner = TRUE; } @@ -105,11 +117,11 @@ iter->span = &g_array_index (iter->array, CoglTexSliceSpan, iter->index); - + /* Offset next position by span size */ iter->next_pos = iter->pos + - CLUTTER_INT_TO_FIXED (iter->span->size - iter->span->waste); - + (float)(iter->span->size - iter->span->waste); + /* Check if span intersects the area to cover */ if (iter->next_pos <= iter->cover_start || iter->pos >= iter->cover_end) @@ -118,15 +130,15 @@ iter->intersects = FALSE; return; } - + iter->intersects = TRUE; - + /* Clip start position to coverage area */ if (iter->pos < iter->cover_start) iter->intersect_start = iter->cover_start; else iter->intersect_start = iter->pos; - + /* Clip end position to coverage area */ if (iter->next_pos > iter->cover_end) iter->intersect_end = iter->cover_end; @@ -137,9 +149,9 @@ static void _cogl_span_iter_begin (CoglSpanIter *iter, GArray *array, - ClutterFixed origin, - ClutterFixed cover_start, - ClutterFixed cover_end) + float origin, + float cover_start, + float cover_end) { /* Copy info */ iter->index = 0; @@ -149,7 +161,7 @@ iter->cover_start = cover_start; iter->cover_end = cover_end; iter->pos = iter->origin; - + /* Update intersection */ _cogl_span_iter_update (iter); } @@ -159,10 +171,10 @@ { /* Move current position */ iter->pos = iter->next_pos; - + /* Pick next slice (wrap when last reached) */ iter->index = (iter->index + 1) % iter->array->len; - + /* Update intersection */ _cogl_span_iter_update (iter); } @@ -174,6 +186,36 @@ return iter->pos >= iter->cover_end; } +static void +prep_for_gl_pixels_upload (gint pixels_rowstride, + gint pixels_src_x, + gint pixels_src_y, + gint pixels_bpp) +{ + + if (!(pixels_rowstride & 0x7)) + GE( glPixelStorei (GL_UNPACK_ALIGNMENT, 8) ); + else if (!(pixels_rowstride & 0x3)) + GE( glPixelStorei (GL_UNPACK_ALIGNMENT, 4) ); + else if (!(pixels_rowstride & 0x1)) + GE( glPixelStorei (GL_UNPACK_ALIGNMENT, 2) ); + else + GE( glPixelStorei (GL_UNPACK_ALIGNMENT, 1) ); +} + +static void +prep_for_gl_pixels_download (gint pixels_rowstride) +{ + if (!(pixels_rowstride & 0x7)) + GE( glPixelStorei (GL_PACK_ALIGNMENT, 8) ); + else if (!(pixels_rowstride & 0x3)) + GE( glPixelStorei (GL_PACK_ALIGNMENT, 4) ); + else if (!(pixels_rowstride & 0x1)) + GE( glPixelStorei (GL_PACK_ALIGNMENT, 2) ); + else + GE( glPixelStorei (GL_PACK_ALIGNMENT, 1) ); +} + static guchar * _cogl_texture_allocate_waste_buffer (CoglTexture *tex) { @@ -213,37 +255,43 @@ gint x,y; guchar *waste_buf; CoglBitmap slice_bmp; - - /* FIXME: might optimize by not copying to intermediate slice - bitmap when source rowstride = bpp * width and the texture - image is not sliced */ - + bpp = _cogl_get_format_bpp (tex->bitmap.format); - + waste_buf = _cogl_texture_allocate_waste_buffer (tex); /* Iterate vertical slices */ for (y = 0; y < tex->slice_y_spans->len; ++y) { y_span = &g_array_index (tex->slice_y_spans, CoglTexSliceSpan, y); - + /* Iterate horizontal slices */ for (x = 0; x < tex->slice_x_spans->len; ++x) { x_span = &g_array_index (tex->slice_x_spans, CoglTexSliceSpan, x); - + /* Pick the gl texture object handle */ gl_handle = g_array_index (tex->slice_gl_handles, GLuint, y * tex->slice_x_spans->len + x); - + + /* FIXME: might optimize by not copying to intermediate slice + bitmap when source rowstride = bpp * width and the texture + image is not sliced */ + /* Setup temp bitmap for slice subregion */ slice_bmp.format = tex->bitmap.format; slice_bmp.width = x_span->size - x_span->waste; slice_bmp.height = y_span->size - y_span->waste; slice_bmp.rowstride = bpp * slice_bmp.width; slice_bmp.data = (guchar*) g_malloc (slice_bmp.rowstride * - slice_bmp.height); - + slice_bmp.height); + + /* Setup gl alignment to match rowstride and top-left corner */ + prep_for_gl_pixels_upload (tex->bitmap.rowstride, + 0, + 0, + bpp); + /* Copy subregion data */ _cogl_bitmap_copy_subregion (&tex->bitmap, &slice_bmp, @@ -252,14 +300,14 @@ 0, 0, slice_bmp.width, slice_bmp.height); - + /* Upload new image data */ GE( cogl_gles2_wrapper_bind_texture (tex->gl_target, gl_handle, tex->gl_intformat) ); - GE( glPixelStorei (GL_UNPACK_ALIGNMENT, 1) ); - - GE( glTexSubImage2D (tex->gl_target, 0, 0, 0, + GE( glTexSubImage2D (tex->gl_target, 0, + 0, + 0, slice_bmp.width, slice_bmp.height, tex->gl_format, tex->gl_type, @@ -284,8 +332,14 @@ src += tex->bitmap.rowstride; } + prep_for_gl_pixels_upload (x_span->waste * bpp, + 0, /* src x */ + 0, /* src y */ + bpp); + GE( glTexSubImage2D (tex->gl_target, 0, - x_span->size - x_span->waste, 0, + x_span->size - x_span->waste, + 0, x_span->waste, y_span->size - y_span->waste, tex->gl_format, tex->gl_type, @@ -313,8 +367,14 @@ } } + prep_for_gl_pixels_upload (x_span->size * bpp, + 0, /* src x */ + 0, /* src y */ + bpp); + GE( glTexSubImage2D (tex->gl_target, 0, - 0, y_span->size - y_span->waste, + 0, + y_span->size - y_span->waste, x_span->size, y_span->waste, tex->gl_format, tex->gl_type, @@ -323,7 +383,7 @@ if (tex->auto_mipmap) cogl_wrap_glGenerateMipmap (tex->gl_target); - + /* Free temp bitmap */ g_free (slice_bmp.data); } @@ -336,121 +396,83 @@ } static void -_cogl_texture_draw_and_read (CoglTexture *tex, - CoglBitmap *target_bmp, - ClutterColor *back_color, - GLint *viewport) -{ - gint bpp; - ClutterFixed rx1, ry1; - ClutterFixed rx2, ry2; - ClutterFixed tx1, ty1; - ClutterFixed tx2, ty2; - int bw, bh; - CoglBitmap rect_bmp; - CoglHandle handle; - - handle = _cogl_texture_handle_from_pointer (tex); +_cogl_texture_draw_and_read (CoglTexture *tex, + CoglBitmap *target_bmp, + GLint *viewport) +{ + gint bpp; + float rx1, ry1; + float rx2, ry2; + float tx1, ty1; + float tx2, ty2; + int bw, bh; + CoglBitmap rect_bmp; + CoglHandle handle; + + handle = (CoglHandle) tex; bpp = _cogl_get_format_bpp (COGL_PIXEL_FORMAT_RGBA_8888); - - /* If whole image fits into the viewport and target buffer - has got no special rowstride, we can do it in one pass */ - if (tex->bitmap.width < viewport[2] - viewport[0] && - tex->bitmap.height < viewport[3] - viewport[1] && - tex->bitmap.rowstride == bpp * tex->bitmap.width) - { - /* Clear buffer with transparent black, draw with white - for direct copy to framebuffer */ - cogl_paint_init (back_color); - - /* Draw the texture image */ - cogl_texture_rectangle (handle, - 0, 0, - CLUTTER_INT_TO_FIXED (tex->bitmap.width), - CLUTTER_INT_TO_FIXED (tex->bitmap.height), - 0, 0, CFX_ONE, CFX_ONE); - - /* Read into target bitmap */ - GE( glPixelStorei (GL_PACK_ALIGNMENT, 1) ); - GE( glReadPixels (viewport[0], viewport[1], - tex->bitmap.width, - tex->bitmap.height, - GL_RGBA, GL_UNSIGNED_BYTE, - target_bmp->data) ); - } - else + + ry1 = 0; ry2 = 0; + ty1 = 0; ty2 = 0; + + /* Walk Y axis until whole bitmap height consumed */ + for (bh = tex->bitmap.height; bh > 0; bh -= viewport[3]) { - ry1 = 0; ry2 = 0; - ty1 = 0; ty2 = 0; - -#define CFIX CLUTTER_INT_TO_FIXED - - /* Walk Y axis until whole bitmap height consumed */ - for (bh = tex->bitmap.height; bh > 0; bh -= viewport[3]) + /* Rectangle Y coords */ + ry1 = ry2; + ry2 += (bh < viewport[3]) ? bh : viewport[3]; + + /* Normalized texture Y coords */ + ty1 = ty2; + ty2 = (ry2 / (float)tex->bitmap.height); + + rx1 = 0; rx2 = 0; + tx1 = 0; tx2 = 0; + + /* Walk X axis until whole bitmap width consumed */ + for (bw = tex->bitmap.width; bw > 0; bw-=viewport[2]) { - /* Rectangle Y coords */ - ry1 = ry2; - ry2 += (bh < viewport[3]) ? bh : viewport[3]; - - /* Normalized texture Y coords */ - ty1 = ty2; - ty2 = CFX_QDIV (CFIX (ry2), CFIX (tex->bitmap.height)); - - rx1 = 0; rx2 = 0; - tx1 = 0; tx2 = 0; - - /* Walk X axis until whole bitmap width consumed */ - for (bw = tex->bitmap.width; bw > 0; bw-=viewport[2]) - { - /* Rectangle X coords */ - rx1 = rx2; - rx2 += (bw < viewport[2]) ? bw : viewport[2]; - - /* Normalized texture X coords */ - tx1 = tx2; - tx2 = CFX_QDIV (CFIX (rx2), CFIX (tex->bitmap.width)); - - /* Clear buffer with transparent black, draw with white - for direct copy to framebuffer */ - cogl_paint_init (back_color); - - /* Draw a portion of texture */ - cogl_texture_rectangle (handle, - 0, 0, - CFIX (rx2 - rx1), - CFIX (ry2 - ry1), - tx1, ty1, - tx2, ty2); - - /* Read into a temporary bitmap */ - rect_bmp.format = COGL_PIXEL_FORMAT_RGBA_8888; - rect_bmp.width = rx2 - rx1; - rect_bmp.height = ry2 - ry1; - rect_bmp.rowstride = bpp * rect_bmp.width; - rect_bmp.data = (guchar*) g_malloc (rect_bmp.rowstride * - rect_bmp.height); - - GE( glPixelStorei (GL_PACK_ALIGNMENT, 1) ); - GE( glReadPixels (viewport[0], viewport[1], - rect_bmp.width, - rect_bmp.height, - GL_RGBA, GL_UNSIGNED_BYTE, - rect_bmp.data) ); - - /* Copy to target bitmap */ - _cogl_bitmap_copy_subregion (&rect_bmp, - target_bmp, - 0,0, - rx1,ry1, - rect_bmp.width, - rect_bmp.height); - - /* Free temp bitmap */ - g_free (rect_bmp.data); - } + /* Rectangle X coords */ + rx1 = rx2; + rx2 += (bw < viewport[2]) ? bw : viewport[2]; + + /* Normalized texture X coords */ + tx1 = tx2; + tx2 = (rx2 / (float)tex->bitmap.width); + + /* Draw a portion of texture */ + cogl_rectangle_with_texture_coords (0, 0, + rx2 - rx1, + ry2 - ry1, + tx1, ty1, + tx2, ty2); + + /* Read into a temporary bitmap */ + rect_bmp.format = COGL_PIXEL_FORMAT_RGBA_8888; + rect_bmp.width = rx2 - rx1; + rect_bmp.height = ry2 - ry1; + rect_bmp.rowstride = bpp * rect_bmp.width; + rect_bmp.data = (guchar*) g_malloc (rect_bmp.rowstride * + rect_bmp.height); + + prep_for_gl_pixels_download (rect_bmp.rowstride); + GE( glReadPixels (viewport[0], viewport[1], + rect_bmp.width, + rect_bmp.height, + GL_RGBA, GL_UNSIGNED_BYTE, + rect_bmp.data) ); + + /* Copy to target bitmap */ + _cogl_bitmap_copy_subregion (&rect_bmp, + target_bmp, + 0,0, + rx1,ry1, + rect_bmp.width, + rect_bmp.height); + + /* Free temp bitmap */ + g_free (rect_bmp.data); } - -#undef CFIX } } @@ -460,63 +482,83 @@ GLuint target_gl_format, GLuint target_gl_type) { - gint bpp; - GLint viewport[4]; - ClutterColor cwhite = {0xFF, 0xFF, 0xFF, 0xFF}; - CoglBitmap alpha_bmp; - COGLenum old_src_factor; - COGLenum old_dst_factor; - + gint bpp; + GLint viewport[4]; + CoglBitmap alpha_bmp; + _COGL_GET_CONTEXT (ctx, FALSE); - + + bpp = _cogl_get_format_bpp (COGL_PIXEL_FORMAT_RGBA_8888); - + /* Viewport needs to have some size and be inside the window for this */ - GE( cogl_wrap_glGetIntegerv (GL_VIEWPORT, viewport) ); - + GE( glGetIntegerv (GL_VIEWPORT, viewport) ); + if (viewport[0] < 0 || viewport[1] < 0 || viewport[2] <= 0 || viewport[3] <= 0) return FALSE; - + /* Setup orthographic projection into current viewport (0,0 in bottom-left corner to draw the texture upside-down so we match the way glReadPixels works) */ - - GE( cogl_wrap_glMatrixMode (GL_PROJECTION) ); - GE( cogl_wrap_glPushMatrix () ); - GE( cogl_wrap_glLoadIdentity () ); - - GE( cogl_wrap_glOrthox (0, CLUTTER_INT_TO_FIXED (viewport[2]), - 0, CLUTTER_INT_TO_FIXED (viewport[3]), - CLUTTER_INT_TO_FIXED (0), - CLUTTER_INT_TO_FIXED (100)) ); - - GE( cogl_wrap_glMatrixMode (GL_MODELVIEW) ); - GE( cogl_wrap_glPushMatrix () ); - GE( cogl_wrap_glLoadIdentity () ); - + + GE( glMatrixMode (GL_PROJECTION) ); + GE( glPushMatrix () ); + GE( glLoadIdentity () ); + + GE( glOrthof (0, (float)(viewport[2]), + 0, (float)(viewport[3]), + (float)(0), + (float)(100)) ); + + GE( glMatrixMode (GL_MODELVIEW) ); + GE( glPushMatrix () ); + GE( glLoadIdentity () ); + /* Draw to all channels */ cogl_draw_buffer (COGL_WINDOW_BUFFER | COGL_MASK_BUFFER, 0); - - /* Store old blending factors */ - old_src_factor = ctx->blend_src_factor; - old_dst_factor = ctx->blend_dst_factor; - + /* Direct copy operation */ - cogl_color (&cwhite); - cogl_blend_func (CGL_ONE, CGL_ZERO); - _cogl_texture_draw_and_read (tex, target_bmp, - &cwhite, viewport); - + + if (ctx->texture_download_material == COGL_INVALID_HANDLE) + { + ctx->texture_download_material = cogl_material_new (); + cogl_material_set_layer_combine_function ( + ctx->texture_download_material, + 0, /* layer */ + COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGB, + COGL_MATERIAL_LAYER_COMBINE_FUNC_REPLACE); + cogl_material_set_layer_combine_arg_src ( + ctx->texture_download_material, + 0, /* layer */ + 0, /* arg */ + COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGB, + COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE); + cogl_material_set_blend_factors (ctx->texture_download_material, + COGL_MATERIAL_BLEND_FACTOR_ONE, + COGL_MATERIAL_BLEND_FACTOR_ZERO); + } + + cogl_material_set_layer (ctx->texture_download_material, 0, tex); + + cogl_material_set_layer_combine_arg_op ( + ctx->texture_download_material, + 0, /* layer */ + 0, /* arg */ + COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGB, + COGL_MATERIAL_LAYER_COMBINE_OP_SRC_COLOR); + cogl_material_flush_gl_state (ctx->texture_download_material, NULL); + _cogl_texture_draw_and_read (tex, target_bmp, viewport); + /* Check whether texture has alpha and framebuffer not */ /* FIXME: For some reason even if ALPHA_BITS is 8, the framebuffer still doesn't seem to have an alpha buffer. This might be just a PowerVR issue. GLint r_bits, g_bits, b_bits, a_bits; - GE( cogl_wrap_glGetIntegerv (GL_ALPHA_BITS, &a_bits) ); - GE( cogl_wrap_glGetIntegerv (GL_RED_BITS, &r_bits) ); - GE( cogl_wrap_glGetIntegerv (GL_GREEN_BITS, &g_bits) ); - GE( cogl_wrap_glGetIntegerv (GL_BLUE_BITS, &b_bits) ); + GE( glGetIntegerv (GL_ALPHA_BITS, &a_bits) ); + GE( glGetIntegerv (GL_RED_BITS, &r_bits) ); + GE( glGetIntegerv (GL_GREEN_BITS, &g_bits) ); + GE( glGetIntegerv (GL_BLUE_BITS, &b_bits) ); printf ("R bits: %d\n", r_bits); printf ("G bits: %d\n", g_bits); printf ("B bits: %d\n", b_bits); @@ -528,7 +570,7 @@ guchar *srcpixel; guchar *dstpixel; gint x,y; - + /* Create temp bitmap for alpha values */ alpha_bmp.format = COGL_PIXEL_FORMAT_RGBA_8888; alpha_bmp.width = target_bmp->width; @@ -536,16 +578,21 @@ alpha_bmp.rowstride = bpp * alpha_bmp.width; alpha_bmp.data = (guchar*) g_malloc (alpha_bmp.rowstride * alpha_bmp.height); - + /* Draw alpha values into RGB channels */ - cogl_blend_func (CGL_ZERO, CGL_SRC_ALPHA); - _cogl_texture_draw_and_read (tex, &alpha_bmp, - &cwhite, viewport); - + cogl_material_set_layer_combine_arg_op ( + ctx->texture_download_material, + 0, /* layer */ + 0, /* arg */ + COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGB, + COGL_MATERIAL_LAYER_COMBINE_OP_SRC_ALPHA); + cogl_material_flush_gl_state (ctx->texture_download_material, NULL); + _cogl_texture_draw_and_read (tex, &alpha_bmp, viewport); + /* Copy temp R to target A */ srcdata = alpha_bmp.data; dstdata = target_bmp->data; - + for (y=0; yheight; ++y) { for (x=0; xwidth; ++x) @@ -557,19 +604,18 @@ srcdata += alpha_bmp.rowstride; dstdata += target_bmp->rowstride; } - + g_free (alpha_bmp.data); } - + /* Restore old state */ - cogl_wrap_glMatrixMode (GL_PROJECTION); - cogl_wrap_glPopMatrix (); - cogl_wrap_glMatrixMode (GL_MODELVIEW); - cogl_wrap_glPopMatrix (); - + glMatrixMode (GL_PROJECTION); + glPopMatrix (); + glMatrixMode (GL_MODELVIEW); + glPopMatrix (); + cogl_draw_buffer (COGL_WINDOW_BUFFER, 0); - cogl_blend_func (old_src_factor, old_dst_factor); - + return TRUE; } @@ -596,32 +642,28 @@ gint local_x = 0, local_y = 0; guchar *waste_buf; CoglBitmap slice_bmp; - + bpp = _cogl_get_format_bpp (source_bmp->format); waste_buf = _cogl_texture_allocate_waste_buffer (tex); - /* FIXME: might optimize by not copying to intermediate slice - bitmap when source rowstride = bpp * width and the texture - image is not sliced */ - /* Iterate vertical spans */ for (source_y = src_y, _cogl_span_iter_begin (&y_iter, tex->slice_y_spans, - 0, CLUTTER_INT_TO_FIXED (dst_y), - CLUTTER_INT_TO_FIXED (dst_y + height)); - + 0, (float)(dst_y), + (float)(dst_y + height)); + !_cogl_span_iter_end (&y_iter); - + _cogl_span_iter_next (&y_iter), source_y += inter_h ) { - /* Skip non-intersecting ones */ + /* Discard slices out of the subregion early */ if (!y_iter.intersects) - { - inter_h = 0; - continue; - } + { + inter_h = 0; + continue; + } y_span = &g_array_index (tex->slice_y_spans, CoglTexSliceSpan, y_iter.index); @@ -629,41 +671,45 @@ /* Iterate horizontal spans */ for (source_x = src_x, _cogl_span_iter_begin (&x_iter, tex->slice_x_spans, - 0, CLUTTER_INT_TO_FIXED (dst_x), - CLUTTER_INT_TO_FIXED (dst_x + width)); - + 0, (float)(dst_x), + (float)(dst_x + width)); + !_cogl_span_iter_end (&x_iter); - + _cogl_span_iter_next (&x_iter), source_x += inter_w ) { - /* Skip non-intersecting ones */ + /* Discard slices out of the subregion early */ if (!x_iter.intersects) - { - inter_w = 0; - continue; - } + { + inter_w = 0; + continue; + } x_span = &g_array_index (tex->slice_x_spans, CoglTexSliceSpan, x_iter.index); /* Pick intersection width and height */ - inter_w = CLUTTER_FIXED_TO_INT (x_iter.intersect_end - - x_iter.intersect_start); - inter_h = CLUTTER_FIXED_TO_INT (y_iter.intersect_end - - y_iter.intersect_start); - + inter_w = (x_iter.intersect_end - + x_iter.intersect_start); + inter_h = (y_iter.intersect_end - + y_iter.intersect_start); + /* Localize intersection top-left corner to slice*/ - local_x = CLUTTER_FIXED_TO_INT (x_iter.intersect_start - - x_iter.pos); - local_y = CLUTTER_FIXED_TO_INT (y_iter.intersect_start - - y_iter.pos); - + local_x = (x_iter.intersect_start - + x_iter.pos); + local_y = (y_iter.intersect_start - + y_iter.pos); + /* Pick slice GL handle */ gl_handle = g_array_index (tex->slice_gl_handles, GLuint, y_iter.index * tex->slice_x_spans->len + x_iter.index); - + + /* FIXME: might optimize by not copying to intermediate slice + bitmap when source rowstride = bpp * width and the texture + image is not sliced */ + /* Setup temp bitmap for slice subregion */ slice_bmp.format = tex->bitmap.format; slice_bmp.width = inter_w; @@ -671,7 +717,13 @@ slice_bmp.rowstride = bpp * slice_bmp.width; slice_bmp.data = (guchar*) g_malloc (slice_bmp.rowstride * slice_bmp.height); - + + /* Setup gl alignment to match rowstride and top-left corner */ + prep_for_gl_pixels_upload (slice_bmp.rowstride, + 0, /* src x */ + 0, /* src y */ + bpp); + /* Copy subregion data */ _cogl_bitmap_copy_subregion (source_bmp, &slice_bmp, @@ -680,13 +732,11 @@ 0, 0, slice_bmp.width, slice_bmp.height); - + /* Upload new image data */ - GE( glPixelStorei (GL_UNPACK_ALIGNMENT, 1) ); - GE( cogl_gles2_wrapper_bind_texture (tex->gl_target, gl_handle, tex->gl_intformat) ); - + GE( glTexSubImage2D (tex->gl_target, 0, local_x, local_y, inter_w, inter_h, @@ -701,14 +751,20 @@ && local_x < x_span->size - x_span->waste && local_x + inter_w >= x_span->size - x_span->waste) { - const guchar *src = source_bmp->data - + (src_y + CLUTTER_FIXED_TO_INT (y_iter.intersect_start) - - dst_y) * source_bmp->rowstride - + (src_x + x_span->start + x_span->size - x_span->waste - - dst_x - 1) * bpp; - guchar *dst = waste_buf; + const guchar *src; + guchar *dst; guint wx, wy; + src = source_bmp->data + + (src_y + ((int)y_iter.intersect_start) + - dst_y) + * source_bmp->rowstride + + (src_x + x_span->start + x_span->size - x_span->waste + - dst_x - 1) + * bpp; + + dst = waste_buf; + for (wy = 0; wy < inter_h; wy++) { for (wx = 0; wx < x_span->waste; wx++) @@ -719,8 +775,14 @@ src += source_bmp->rowstride; } + prep_for_gl_pixels_upload (x_span->waste * bpp, + 0, /* src x */ + 0, /* src y */ + bpp); + GE( glTexSubImage2D (tex->gl_target, 0, - x_span->size - x_span->waste, local_y, + x_span->size - x_span->waste, + local_y, x_span->waste, inter_h, source_gl_format, @@ -733,15 +795,21 @@ && local_y < y_span->size - y_span->waste && local_y + inter_h >= y_span->size - y_span->waste) { - const guchar *src = source_bmp->data - + (src_x + CLUTTER_FIXED_TO_INT (x_iter.intersect_start) - - dst_x) * bpp - + (src_y + y_span->start + y_span->size - y_span->waste - - dst_y - 1) * source_bmp->rowstride; - guchar *dst = waste_buf; + const guchar *src; + guchar *dst; guint wy, wx; guint copy_width; + src = source_bmp->data + + (src_x + ((int)x_iter.intersect_start) + - dst_x) + * bpp + + (src_y + y_span->start + y_span->size - y_span->waste + - dst_y - 1) + * source_bmp->rowstride; + + dst = waste_buf; + if (local_x + inter_w >= x_span->size - x_span->waste) copy_width = x_span->size - local_x; else @@ -759,8 +827,14 @@ } } + prep_for_gl_pixels_upload (copy_width * bpp, + 0, /* src x */ + 0, /* src y */ + bpp); + GE( glTexSubImage2D (tex->gl_target, 0, - local_x, y_span->size - y_span->waste, + local_x, + y_span->size - y_span->waste, copy_width, y_span->waste, source_gl_format, @@ -783,6 +857,41 @@ } static gint +_cogl_rect_slices_for_size (gint size_to_fill, + gint max_span_size, + gint max_waste, + GArray *out_spans) +{ + gint n_spans = 0; + CoglTexSliceSpan span; + + /* Init first slice span */ + span.start = 0; + span.size = max_span_size; + span.waste = 0; + + /* Repeat until whole area covered */ + while (size_to_fill >= span.size) + { + /* Add another slice span of same size */ + if (out_spans) g_array_append_val (out_spans, span); + span.start += span.size; + size_to_fill -= span.size; + n_spans++; + } + + /* Add one last smaller slice span */ + if (size_to_fill > 0) + { + span.size = size_to_fill; + if (out_spans) g_array_append_val (out_spans, span); + n_spans++; + } + + return n_spans; +} + +static gint _cogl_pot_slices_for_size (gint size_to_fill, gint max_span_size, gint max_waste, @@ -790,15 +899,15 @@ { gint n_spans = 0; CoglTexSliceSpan span; - + /* Init first slice span */ span.start = 0; span.size = max_span_size; span.waste = 0; - + /* Fix invalid max_waste */ if (max_waste < 0) max_waste = 0; - + while (TRUE) { /* Is the whole area covered? */ @@ -827,7 +936,7 @@ } } } - + /* Can't get here */ return 0; } @@ -842,9 +951,36 @@ return TRUE; } +static void +_cogl_texture_set_wrap_mode_parameter (CoglTexture *tex, + GLenum wrap_mode) +{ + /* Only set the wrap mode if it's different from the current + value to avoid too many GL calls */ + if (tex->wrap_mode != wrap_mode) + { + int i; + + /* Any queued texture rectangles may be depending on the previous + * wrap mode... */ + _cogl_journal_flush (); + + for (i = 0; i < tex->slice_gl_handles->len; i++) + { + GLuint texnum = g_array_index (tex->slice_gl_handles, GLuint, i); + + GE( glBindTexture (tex->gl_target, texnum) ); + GE( glTexParameteri (tex->gl_target, GL_TEXTURE_WRAP_S, wrap_mode) ); + GE( glTexParameteri (tex->gl_target, GL_TEXTURE_WRAP_T, wrap_mode) ); + } + + tex->wrap_mode = wrap_mode; + } +} + static gboolean _cogl_texture_slices_create (CoglTexture *tex) -{ +{ gint bpp; gint max_width; gint max_height; @@ -855,22 +991,32 @@ gint x, y; CoglTexSliceSpan *x_span; CoglTexSliceSpan *y_span; - + gint (*slices_for_size) (gint, gint, gint, GArray*); - + bpp = _cogl_get_format_bpp (tex->bitmap.format); - + /* Initialize size of largest slice according to supported features */ - max_width = cogl_util_next_p2 (tex->bitmap.width); - max_height = cogl_util_next_p2 (tex->bitmap.height); - tex->gl_target = GL_TEXTURE_2D; - slices_for_size = _cogl_pot_slices_for_size; - + if (cogl_features_available (COGL_FEATURE_TEXTURE_NPOT)) + { + max_width = tex->bitmap.width; + max_height = tex->bitmap.height; + tex->gl_target = GL_TEXTURE_2D; + slices_for_size = _cogl_rect_slices_for_size; + } + else + { + max_width = cogl_util_next_p2 (tex->bitmap.width); + max_height = cogl_util_next_p2 (tex->bitmap.height); + tex->gl_target = GL_TEXTURE_2D; + slices_for_size = _cogl_pot_slices_for_size; + } + /* Negative number means no slicing forced by the user */ if (tex->max_waste <= -1) { CoglTexSliceSpan span; - + /* Check if size supported else bail out */ if (!_cogl_texture_size_supported (tex->gl_target, tex->gl_format, @@ -880,25 +1026,25 @@ { return FALSE; } - + n_x_slices = 1; n_y_slices = 1; - - /* Init span arrays */ + + /* Init span arrays */ tex->slice_x_spans = g_array_sized_new (FALSE, FALSE, sizeof (CoglTexSliceSpan), 1); - + tex->slice_y_spans = g_array_sized_new (FALSE, FALSE, sizeof (CoglTexSliceSpan), 1); - + /* Add a single span for width and height */ span.start = 0; span.size = max_width; span.waste = max_width - tex->bitmap.width; g_array_append_val (tex->slice_x_spans, span); - + span.size = max_height; span.waste = max_height - tex->bitmap.height; g_array_append_val (tex->slice_y_spans, span); @@ -917,65 +1063,68 @@ max_width /= 2; else max_height /= 2; - + if (max_width == 0 || max_height == 0) return FALSE; } - + /* Determine the slices required to cover the bitmap area */ n_x_slices = slices_for_size (tex->bitmap.width, max_width, tex->max_waste, NULL); - + n_y_slices = slices_for_size (tex->bitmap.height, max_height, tex->max_waste, NULL); - + /* Init span arrays with reserved size */ tex->slice_x_spans = g_array_sized_new (FALSE, FALSE, sizeof (CoglTexSliceSpan), n_x_slices); - + tex->slice_y_spans = g_array_sized_new (FALSE, FALSE, sizeof (CoglTexSliceSpan), n_y_slices); - + /* Fill span arrays with info */ slices_for_size (tex->bitmap.width, max_width, tex->max_waste, tex->slice_x_spans); - + slices_for_size (tex->bitmap.height, max_height, tex->max_waste, tex->slice_y_spans); } - + /* Init and resize GL handle array */ n_slices = n_x_slices * n_y_slices; - + tex->slice_gl_handles = g_array_sized_new (FALSE, FALSE, sizeof (GLuint), n_slices); - + g_array_set_size (tex->slice_gl_handles, n_slices); - + + /* Wrap mode not yet set */ + tex->wrap_mode = GL_FALSE; + /* Generate a "working set" of GL texture objects * (some implementations might supported faster * re-binding between textures inside a set) */ gl_handles = (GLuint*) tex->slice_gl_handles->data; - + GE( glGenTextures (n_slices, gl_handles) ); - - + + /* Init each GL texture object */ for (y = 0; y < n_y_slices; ++y) { y_span = &g_array_index (tex->slice_y_spans, CoglTexSliceSpan, y); - + for (x = 0; x < n_x_slices; ++x) { x_span = &g_array_index (tex->slice_x_spans, CoglTexSliceSpan, x); - + #if COGL_DEBUG printf ("CREATE SLICE (%d,%d)\n", x,y); printf ("size: (%d x %d)\n", @@ -986,39 +1135,39 @@ GE( cogl_gles2_wrapper_bind_texture (tex->gl_target, gl_handles[y * n_x_slices + x], tex->gl_intformat) ); + GE( glTexParameteri (tex->gl_target, GL_TEXTURE_MAG_FILTER, + tex->mag_filter) ); + GE( glTexParameteri (tex->gl_target, GL_TEXTURE_MIN_FILTER, + tex->min_filter) ); + + GE( glTexParameteri (tex->gl_target, GL_TEXTURE_WRAP_S, + tex->wrap_mode) ); + GE( glTexParameteri (tex->gl_target, GL_TEXTURE_WRAP_T, + tex->wrap_mode) ); - GE( cogl_wrap_glTexParameteri (tex->gl_target, GL_TEXTURE_MAG_FILTER, - tex->mag_filter) ); - GE( cogl_wrap_glTexParameteri (tex->gl_target, GL_TEXTURE_MIN_FILTER, - tex->min_filter) ); - GE( cogl_wrap_glTexParameteri (tex->gl_target, GL_TEXTURE_WRAP_S, - GL_CLAMP_TO_EDGE) ); - GE( cogl_wrap_glTexParameteri (tex->gl_target, GL_TEXTURE_WRAP_T, - GL_CLAMP_TO_EDGE) ); - if (tex->auto_mipmap) - GE( cogl_wrap_glTexParameteri (tex->gl_target, GL_GENERATE_MIPMAP, - GL_TRUE) ); - + GE( glTexParameteri (tex->gl_target, GL_GENERATE_MIPMAP, + GL_TRUE) ); + /* Pass NULL data to init size and internal format */ GE( glTexImage2D (tex->gl_target, 0, tex->gl_intformat, x_span->size, y_span->size, 0, tex->gl_format, tex->gl_type, 0) ); } } - + return TRUE; } static void _cogl_texture_slices_free (CoglTexture *tex) -{ +{ if (tex->slice_x_spans != NULL) g_array_free (tex->slice_x_spans, TRUE); - + if (tex->slice_y_spans != NULL) g_array_free (tex->slice_y_spans, TRUE); - + if (tex->slice_gl_handles != NULL) { if (tex->is_foreign == FALSE) @@ -1026,28 +1175,53 @@ GE( glDeleteTextures (tex->slice_gl_handles->len, (GLuint*) tex->slice_gl_handles->data) ); } - + g_array_free (tex->slice_gl_handles, TRUE); } } +gboolean +_cogl_texture_span_has_waste (CoglTexture *tex, + gint x_span_index, + gint y_span_index) +{ + CoglTexSliceSpan *x_span; + CoglTexSliceSpan *y_span; + + x_span = &g_array_index (tex->slice_x_spans, CoglTexSliceSpan, x_span_index); + y_span = &g_array_index (tex->slice_y_spans, CoglTexSliceSpan, y_span_index); + + return (x_span->waste || y_span->waste) ? TRUE : FALSE; +} + +static gboolean +_cogl_pixel_format_from_gl_internal (GLenum gl_int_format, + CoglPixelFormat *out_format) +{ + return TRUE; +} + static CoglPixelFormat _cogl_pixel_format_to_gl (CoglPixelFormat format, GLenum *out_glintformat, GLenum *out_glformat, GLenum *out_gltype) { - CoglPixelFormat required_format = format; + CoglPixelFormat required_format; GLenum glintformat = 0; GLenum glformat = 0; GLenum gltype = 0; - + /* No premultiplied formats accepted by GL * (FIXME: latest hardware?) */ - + if (format & COGL_PREMULT_BIT) format = (format & COGL_UNPREMULT_MASK); - + + /* Everything else accepted + * (FIXME: check YUV support) */ + required_format = format; + /* Find GL equivalents */ switch (format) { @@ -1061,7 +1235,7 @@ glformat = GL_LUMINANCE; gltype = GL_UNSIGNED_BYTE; break; - + /* Just one 24-bit ordering supported */ case COGL_PIXEL_FORMAT_RGB_888: case COGL_PIXEL_FORMAT_BGR_888: @@ -1070,7 +1244,7 @@ gltype = GL_UNSIGNED_BYTE; required_format = COGL_PIXEL_FORMAT_RGB_888; break; - + /* Just one 32-bit ordering supported */ case COGL_PIXEL_FORMAT_RGBA_8888: case COGL_PIXEL_FORMAT_BGRA_8888: @@ -1081,7 +1255,7 @@ gltype = GL_UNSIGNED_BYTE; required_format = COGL_PIXEL_FORMAT_RGBA_8888; break; - + /* The following three types of channel ordering * are always defined using system word byte * ordering (even according to GLES spec) */ @@ -1100,19 +1274,19 @@ glformat = GL_RGBA; gltype = GL_UNSIGNED_SHORT_5_5_5_1; break; - + /* FIXME: check extensions for YUV support */ default: break; } - + if (out_glintformat != NULL) *out_glintformat = glintformat; if (out_glformat != NULL) *out_glformat = glformat; if (out_gltype != NULL) *out_gltype = gltype; - + return required_format; } @@ -1123,7 +1297,7 @@ CoglBitmap new_bitmap; CoglPixelFormat new_data_format; gboolean success; - + /* Was there any internal conversion requested? */ if (internal_format == COGL_PIXEL_FORMAT_ANY) internal_format = tex->bitmap.format; @@ -1133,21 +1307,21 @@ &tex->gl_intformat, &tex->gl_format, &tex->gl_type); - + /* Convert to internal format */ if (new_data_format != tex->bitmap.format) { success = _cogl_bitmap_convert_and_premult (&tex->bitmap, &new_bitmap, new_data_format); - + if (!success) return FALSE; - + /* Update texture with new data */ _cogl_texture_bitmap_swap (tex, &new_bitmap); } - + return TRUE; } @@ -1162,95 +1336,96 @@ } CoglHandle -cogl_texture_new_with_size (guint width, - guint height, - gint max_waste, - gboolean auto_mipmap, - CoglPixelFormat internal_format) +cogl_texture_new_with_size (guint width, + guint height, + gint max_waste, + CoglTextureFlags flags, + CoglPixelFormat internal_format) { CoglTexture *tex; gint bpp; gint rowstride; - + /* Since no data, we need some internal format */ if (internal_format == COGL_PIXEL_FORMAT_ANY) return COGL_INVALID_HANDLE; - + /* Rowstride from width */ bpp = _cogl_get_format_bpp (internal_format); rowstride = width * bpp; - + /* Init texture with empty bitmap */ tex = (CoglTexture*) g_malloc (sizeof (CoglTexture)); tex->ref_count = 1; COGL_HANDLE_DEBUG_NEW (texture, tex); - + tex->is_foreign = FALSE; - tex->auto_mipmap = auto_mipmap; - + tex->auto_mipmap = ((flags & COGL_TEXTURE_AUTO_MIPMAP) != 0); + tex->bitmap.width = width; tex->bitmap.height = height; tex->bitmap.format = internal_format; tex->bitmap.rowstride = rowstride; tex->bitmap.data = NULL; tex->bitmap_owner = FALSE; - + tex->slice_x_spans = NULL; tex->slice_y_spans = NULL; tex->slice_gl_handles = NULL; - + tex->max_waste = max_waste; tex->min_filter = CGL_NEAREST; tex->mag_filter = CGL_NEAREST; - + /* Find closest GL format match */ tex->bitmap.format = _cogl_pixel_format_to_gl (internal_format, &tex->gl_intformat, &tex->gl_format, &tex->gl_type); - + + /* Create slices for the given format and size */ if (!_cogl_texture_slices_create (tex)) { _cogl_texture_free (tex); return COGL_INVALID_HANDLE; } - + return _cogl_texture_handle_new (tex); } CoglHandle -cogl_texture_new_from_data (guint width, - guint height, - gint max_waste, - gboolean auto_mipmap, - CoglPixelFormat format, - CoglPixelFormat internal_format, - guint rowstride, - const guchar *data) +cogl_texture_new_from_data (guint width, + guint height, + gint max_waste, + CoglTextureFlags flags, + CoglPixelFormat format, + CoglPixelFormat internal_format, + guint rowstride, + const guchar *data) { CoglTexture *tex; gint bpp; - + if (format == COGL_PIXEL_FORMAT_ANY) return COGL_INVALID_HANDLE; - + if (data == NULL) return COGL_INVALID_HANDLE; - + /* Rowstride from width if not given */ bpp = _cogl_get_format_bpp (format); if (rowstride == 0) rowstride = width * bpp; - + /* Create new texture and fill with given data */ tex = (CoglTexture*) g_malloc (sizeof (CoglTexture)); - + tex->ref_count = 1; COGL_HANDLE_DEBUG_NEW (texture, tex); - + tex->is_foreign = FALSE; - tex->auto_mipmap = auto_mipmap; + tex->auto_mipmap = ((flags & COGL_TEXTURE_AUTO_MIPMAP) != 0); tex->bitmap.width = width; tex->bitmap.height = height; @@ -1258,88 +1433,72 @@ tex->bitmap.format = format; tex->bitmap.rowstride = rowstride; tex->bitmap_owner = FALSE; - + tex->slice_x_spans = NULL; tex->slice_y_spans = NULL; tex->slice_gl_handles = NULL; - + tex->max_waste = max_waste; tex->min_filter = CGL_NEAREST; tex->mag_filter = CGL_NEAREST; - + /* FIXME: If upload fails we should set some kind of * error flag but still return texture handle (this * is to keep the behavior equal to _new_from_file; * see below) */ - + if (!_cogl_texture_bitmap_prepare (tex, internal_format)) { _cogl_texture_free (tex); return COGL_INVALID_HANDLE; } - + if (!_cogl_texture_slices_create (tex)) { _cogl_texture_free (tex); return COGL_INVALID_HANDLE; } - + if (!_cogl_texture_upload_to_gl (tex)) { _cogl_texture_free (tex); return COGL_INVALID_HANDLE; } - + _cogl_texture_bitmap_free (tex); - - return _cogl_texture_handle_new (tex);; + + return _cogl_texture_handle_new (tex); } CoglHandle -cogl_texture_new_from_file (const gchar *filename, - gint max_waste, - gboolean auto_mipmap, - CoglPixelFormat internal_format, - GError **error) +cogl_texture_new_from_bitmap (CoglBitmap *bmp, + gint max_waste, + CoglTextureFlags flags, + CoglPixelFormat internal_format) { - CoglBitmap bmp; CoglTexture *tex; - - g_return_val_if_fail (error == NULL || *error == NULL, COGL_INVALID_HANDLE); - /* Try loading with imaging backend */ - if (!_cogl_bitmap_from_file (&bmp, filename, error)) - { - /* Try fallback */ - if (!_cogl_bitmap_fallback_from_file (&bmp, filename)) - return COGL_INVALID_HANDLE; - else if (error && *error) - { - g_error_free (*error); - *error = NULL; - } - } - /* Create new texture and fill with loaded data */ tex = (CoglTexture*) g_malloc ( sizeof (CoglTexture)); - + tex->ref_count = 1; COGL_HANDLE_DEBUG_NEW (texture, tex); - + tex->is_foreign = FALSE; - tex->auto_mipmap = auto_mipmap; + tex->auto_mipmap = ((flags & COGL_TEXTURE_AUTO_MIPMAP) != 0); + + tex->bitmap = *bmp; + tex->bitmap_owner = TRUE; + bmp->data = NULL; - tex->bitmap = bmp; - tex->bitmap_owner = TRUE; - tex->slice_x_spans = NULL; tex->slice_y_spans = NULL; tex->slice_gl_handles = NULL; - + tex->max_waste = max_waste; tex->min_filter = CGL_NEAREST; tex->mag_filter = CGL_NEAREST; - + /* FIXME: If upload fails we should set some kind of * error flag but still return texture handle if the * user decides to destroy another texture and upload @@ -1347,31 +1506,55 @@ * in that case). As a rule then, everytime a valid * CoglHandle is returned, it should also be destroyed * with cogl_texture_unref at some point! */ - + if (!_cogl_texture_bitmap_prepare (tex, internal_format)) { _cogl_texture_free (tex); return COGL_INVALID_HANDLE; } - + if (!_cogl_texture_slices_create (tex)) { _cogl_texture_free (tex); return COGL_INVALID_HANDLE; } - + if (!_cogl_texture_upload_to_gl (tex)) { _cogl_texture_free (tex); return COGL_INVALID_HANDLE; } - + _cogl_texture_bitmap_free (tex); - + return _cogl_texture_handle_new (tex); } CoglHandle +cogl_texture_new_from_file (const gchar *filename, + gint max_waste, + CoglTextureFlags flags, + CoglPixelFormat internal_format, + GError **error) +{ + CoglBitmap *bmp; + CoglHandle handle; + + g_return_val_if_fail (error == NULL || *error == NULL, COGL_INVALID_HANDLE); + + if (!(bmp = cogl_bitmap_new_from_file (filename, error))) + return COGL_INVALID_HANDLE; + + handle = cogl_texture_new_from_bitmap (bmp, + max_waste, + flags, + internal_format); + cogl_bitmap_free (bmp); + + return handle; +} + +CoglHandle cogl_texture_new_from_foreign (GLuint gl_handle, GLenum gl_target, GLuint width, @@ -1380,8 +1563,19 @@ GLuint y_pot_waste, CoglPixelFormat format) { + /* NOTE: width, height and internal format are not queriable + in GLES, hence such a function prototype. However, for + OpenGL they are still queried from the texture for improved + robustness and for completeness in case one day GLES gains + support for them. + */ + GLenum gl_error = 0; GLboolean gl_istexture; + GLint gl_compressed = GL_FALSE; + GLint gl_int_format = 0; + GLint gl_width = 0; + GLint gl_height = 0; GLint gl_min_filter; GLint gl_mag_filter; GLint gl_gen_mipmap; @@ -1389,159 +1583,147 @@ CoglTexture *tex; CoglTexSliceSpan x_span; CoglTexSliceSpan y_span; - + /* Allow 2-dimensional textures only */ if (gl_target != GL_TEXTURE_2D) return COGL_INVALID_HANDLE; - + /* Make sure it is a valid GL texture object */ gl_istexture = glIsTexture (gl_handle); if (gl_istexture == GL_FALSE) return COGL_INVALID_HANDLE; - + /* Make sure binding succeeds */ gl_error = glGetError (); glBindTexture (gl_target, gl_handle); if (glGetError () != GL_NO_ERROR) return COGL_INVALID_HANDLE; - + /* Obtain texture parameters (only level 0 we are interested in) */ - - /* These are not queriable in GLES :( + +#if HAVE_COGL_GL GE( glGetTexLevelParameteriv (gl_target, 0, GL_TEXTURE_COMPRESSED, &gl_compressed) ); - + GE( glGetTexLevelParameteriv (gl_target, 0, GL_TEXTURE_INTERNAL_FORMAT, &gl_int_format) ); - */ + + + GE( glGetTexLevelParameteriv (gl_target, 0, + GL_TEXTURE_WIDTH, + &gl_width) ); + + GE( glGetTexLevelParameteriv (gl_target, 0, + GL_TEXTURE_HEIGHT, + &gl_height) ); +#else + gl_width = width + x_pot_waste; + gl_height = height + y_pot_waste; +#endif + GE( glGetTexParameteriv (gl_target, GL_TEXTURE_MIN_FILTER, - &gl_min_filter)); - + &gl_min_filter) ); + GE( glGetTexParameteriv (gl_target, GL_TEXTURE_MAG_FILTER, - &gl_mag_filter)); - + &gl_mag_filter) ); + GE( glGetTexParameteriv (gl_target, GL_GENERATE_MIPMAP, &gl_gen_mipmap) ); - + /* Validate width and height */ - if (width <= 0 || height <= 0) + if (gl_width <= 0 || gl_height <= 0) return COGL_INVALID_HANDLE; - + /* Validate pot waste */ - if (x_pot_waste < 0 || x_pot_waste >= width || - y_pot_waste < 0 || y_pot_waste >= height) + if (x_pot_waste < 0 || x_pot_waste >= gl_width || + y_pot_waste < 0 || y_pot_waste >= gl_height) return COGL_INVALID_HANDLE; - + + /* Compressed texture images not supported */ + if (gl_compressed == GL_TRUE) + return COGL_INVALID_HANDLE; + + /* Try and match to a cogl format */ + if (!_cogl_pixel_format_from_gl_internal (gl_int_format, + &format)) + { + return COGL_INVALID_HANDLE; + } + /* Create new texture */ tex = (CoglTexture*) g_malloc ( sizeof (CoglTexture)); - + tex->ref_count = 1; COGL_HANDLE_DEBUG_NEW (texture, tex); - + /* Setup bitmap info */ tex->is_foreign = TRUE; tex->auto_mipmap = (gl_gen_mipmap == GL_TRUE) ? TRUE : FALSE; - + bpp = _cogl_get_format_bpp (format); tex->bitmap.format = format; - tex->bitmap.width = width; - tex->bitmap.height = height; + tex->bitmap.width = gl_width - x_pot_waste; + tex->bitmap.height = gl_height - y_pot_waste; tex->bitmap.rowstride = tex->bitmap.width * bpp; tex->bitmap_owner = FALSE; - + tex->gl_target = gl_target; - tex->gl_intformat = 0; - tex->gl_format = 0; - tex->gl_type = 0; - + tex->gl_intformat = gl_int_format; + tex->gl_format = gl_int_format; + tex->gl_type = GL_UNSIGNED_BYTE; + tex->min_filter = gl_min_filter; tex->mag_filter = gl_mag_filter; tex->max_waste = 0; - + + /* Wrap mode not yet set */ + tex->wrap_mode = GL_FALSE; + /* Create slice arrays */ tex->slice_x_spans = g_array_sized_new (FALSE, FALSE, sizeof (CoglTexSliceSpan), 1); - + tex->slice_y_spans = g_array_sized_new (FALSE, FALSE, sizeof (CoglTexSliceSpan), 1); - + tex->slice_gl_handles = g_array_sized_new (FALSE, FALSE, sizeof (GLuint), 1); - + /* Store info for a single slice */ x_span.start = 0; - x_span.size = width + x_pot_waste; + x_span.size = gl_width; x_span.waste = x_pot_waste; g_array_append_val (tex->slice_x_spans, x_span); - + y_span.start = 0; - y_span.size = height + x_pot_waste; + y_span.size = gl_height; y_span.waste = y_pot_waste; g_array_append_val (tex->slice_y_spans, y_span); - + g_array_append_val (tex->slice_gl_handles, gl_handle); - - /* Force appropriate wrap parameter */ - GE( cogl_wrap_glTexParameteri (tex->gl_target, GL_TEXTURE_WRAP_S, - GL_CLAMP_TO_EDGE) ); - GE( cogl_wrap_glTexParameteri (tex->gl_target, GL_TEXTURE_WRAP_T, - GL_CLAMP_TO_EDGE) ); - - return _cogl_texture_handle_new (tex); -} -void -cogl_texture_get_properties (CoglHandle handle, - guint *out_width, - guint *out_height, - CoglPixelFormat *out_format, - guint *out_rowstride, - guint *out_max_waste) -{ - CoglTexture *tex; - - /* Check if valid texture handle */ - if (!cogl_is_texture (handle)) - return; - - tex = _cogl_texture_pointer_from_handle (handle); - - /* Output requested properties */ - if (out_width != NULL) - *out_width = tex->bitmap.width; - - if (out_height != NULL) - *out_height = tex->bitmap.height; - - if (out_format != NULL) - *out_format = tex->bitmap.format; - - if (out_rowstride != NULL) - *out_rowstride = tex->bitmap.rowstride; - - if (out_max_waste != NULL) - *out_max_waste = tex->max_waste; + return _cogl_texture_handle_new (tex); } guint cogl_texture_get_width (CoglHandle handle) { CoglTexture *tex; - + if (!cogl_is_texture (handle)) return 0; - + tex = _cogl_texture_pointer_from_handle (handle); - + return tex->bitmap.width; } @@ -1549,12 +1731,12 @@ cogl_texture_get_height (CoglHandle handle) { CoglTexture *tex; - + if (!cogl_is_texture (handle)) return 0; - + tex = _cogl_texture_pointer_from_handle (handle); - + return tex->bitmap.height; } @@ -1562,12 +1744,12 @@ cogl_texture_get_format (CoglHandle handle) { CoglTexture *tex; - + if (!cogl_is_texture (handle)) return COGL_PIXEL_FORMAT_ANY; - + tex = _cogl_texture_pointer_from_handle (handle); - + return tex->bitmap.format; } @@ -1575,12 +1757,12 @@ cogl_texture_get_rowstride (CoglHandle handle) { CoglTexture *tex; - + if (!cogl_is_texture (handle)) return 0; - + tex = _cogl_texture_pointer_from_handle (handle); - + return tex->bitmap.rowstride; } @@ -1588,12 +1770,12 @@ cogl_texture_get_max_waste (CoglHandle handle) { CoglTexture *tex; - + if (!cogl_is_texture (handle)) return 0; - + tex = _cogl_texture_pointer_from_handle (handle); - + return tex->max_waste; } @@ -1601,18 +1783,18 @@ cogl_texture_is_sliced (CoglHandle handle) { CoglTexture *tex; - + if (!cogl_is_texture (handle)) return FALSE; - + tex = _cogl_texture_pointer_from_handle (handle); - + if (tex->slice_gl_handles == NULL) return FALSE; - + if (tex->slice_gl_handles->len <= 1) return FALSE; - + return TRUE; } @@ -1622,24 +1804,24 @@ GLenum *out_gl_target) { CoglTexture *tex; - + if (!cogl_is_texture (handle)) return FALSE; - + tex = _cogl_texture_pointer_from_handle (handle); - + if (tex->slice_gl_handles == NULL) return FALSE; - + if (tex->slice_gl_handles->len < 1) return FALSE; - + if (out_gl_handle != NULL) *out_gl_handle = g_array_index (tex->slice_gl_handles, GLuint, 0); - + if (out_gl_target != NULL) *out_gl_target = tex->gl_target; - + return TRUE; } @@ -1647,12 +1829,12 @@ cogl_texture_get_min_filter (CoglHandle handle) { CoglTexture *tex; - + if (!cogl_is_texture (handle)) return 0; - + tex = _cogl_texture_pointer_from_handle (handle); - + return tex->min_filter; } @@ -1660,12 +1842,12 @@ cogl_texture_get_mag_filter (CoglHandle handle) { CoglTexture *tex; - + if (!cogl_is_texture (handle)) return 0; - + tex = _cogl_texture_pointer_from_handle (handle); - + return tex->mag_filter; } @@ -1677,29 +1859,29 @@ CoglTexture *tex; GLuint gl_handle; int i; - + if (!cogl_is_texture (handle)) return; - + tex = _cogl_texture_pointer_from_handle (handle); - + /* Store new values */ tex->min_filter = min_filter; tex->mag_filter = mag_filter; - + /* Make sure slices were created */ if (tex->slice_gl_handles == NULL) return; - + /* Apply new filters to every slice */ for (i=0; islice_gl_handles->len; ++i) { gl_handle = g_array_index (tex->slice_gl_handles, GLuint, i); GE( glBindTexture (tex->gl_target, gl_handle) ); - GE( cogl_wrap_glTexParameteri (tex->gl_target, GL_TEXTURE_MAG_FILTER, - tex->mag_filter) ); - GE( cogl_wrap_glTexParameteri (tex->gl_target, GL_TEXTURE_MIN_FILTER, - tex->min_filter) ); + GE( glTexParameteri (tex->gl_target, GL_TEXTURE_MAG_FILTER, + tex->mag_filter) ); + GE( glTexParameteri (tex->gl_target, GL_TEXTURE_MIN_FILTER, + tex->min_filter) ); } } @@ -1726,37 +1908,37 @@ GLenum closest_gl_format; GLenum closest_gl_type; gboolean success; - + /* Check if valid texture handle */ if (!cogl_is_texture (handle)) return FALSE; - + tex = _cogl_texture_pointer_from_handle (handle); - + /* Check for valid format */ if (format == COGL_PIXEL_FORMAT_ANY) return FALSE; - + /* Shortcut out early if the image is empty */ if (width == 0 || height == 0) return TRUE; - + /* Init source bitmap */ source_bmp.width = width; source_bmp.height = height; source_bmp.format = format; source_bmp.data = (guchar*)data; - + /* Rowstride from width if none specified */ bpp = _cogl_get_format_bpp (format); source_bmp.rowstride = (rowstride == 0) ? width * bpp : rowstride; - + /* Find closest format to internal that's supported by GL */ closest_format = _cogl_pixel_format_to_gl (tex->bitmap.format, NULL, /* don't need */ &closest_gl_format, &closest_gl_type); - + /* If no direct match, convert */ if (closest_format != format) { @@ -1764,13 +1946,13 @@ success = _cogl_bitmap_convert_and_premult (&source_bmp, &temp_bmp, closest_format); - + /* Swap bitmaps if succeeded */ if (!success) return FALSE; source_bmp = temp_bmp; source_bmp_owner = TRUE; } - + /* Send data to GL */ _cogl_texture_upload_subregion_to_gl (tex, src_x, src_y, @@ -1779,11 +1961,11 @@ &source_bmp, closest_gl_format, closest_gl_type); - + /* Free data if owner */ if (source_bmp_owner) g_free (source_bmp.data); - + return TRUE; } @@ -1806,25 +1988,25 @@ guchar *src; guchar *dst; gint y; - + /* Check if valid texture handle */ if (!cogl_is_texture (handle)) return 0; - + tex = _cogl_texture_pointer_from_handle (handle); - + /* Default to internal format if none specified */ if (format == COGL_PIXEL_FORMAT_ANY) format = tex->bitmap.format; - + /* Rowstride from texture width if none specified */ bpp = _cogl_get_format_bpp (format); if (rowstride == 0) rowstride = tex->bitmap.width * bpp; - + /* Return byte size if only that requested */ byte_size = tex->bitmap.height * rowstride; if (data == NULL) return byte_size; - + /* Find closest format that's supported by GL (Can't use _cogl_pixel_format_to_gl since available formats when reading pixels on GLES are severely limited) */ @@ -1832,7 +2014,7 @@ closest_gl_format = GL_RGBA; closest_gl_type = GL_UNSIGNED_BYTE; closest_bpp = _cogl_get_format_bpp (closest_format); - + /* Is the requested format supported? */ if (closest_format == format) { @@ -1851,12 +2033,12 @@ target_bmp.data = (guchar*) g_malloc (target_bmp.height * target_bmp.rowstride); } - + /* Retrieve data from slices */ _cogl_texture_download_from_gl (tex, &target_bmp, closest_gl_format, closest_gl_type); - + /* Was intermediate used? */ if (closest_format != format) { @@ -1864,11 +2046,11 @@ success = _cogl_bitmap_convert_and_premult (&target_bmp, &new_bmp, format); - + /* Free intermediate data and return if failed */ g_free (target_bmp.data); if (!success) return 0; - + /* Copy to user buffer */ for (y = 0; y < new_bmp.height; ++y) { @@ -1876,420 +2058,1176 @@ dst = data + y * rowstride; memcpy (dst, src, new_bmp.width); } - + /* Free converted data */ g_free (new_bmp.data); } - + return byte_size; } + +/****************************************************************************** + * XXX: Here ends the code that strictly implements "CoglTextures". + * + * The following consists of code for rendering rectangles and polygons. It + * might be neater to move this code somewhere else. I think everything below + * here should be implementable without access to CoglTexture internals, but + * that will at least mean exposing the cogl_span_iter_* funcs. + */ + static void -_cogl_texture_quad_sw (CoglTexture *tex, - ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2, - ClutterFixed tx1, - ClutterFixed ty1, - ClutterFixed tx2, - ClutterFixed ty2) -{ - CoglSpanIter iter_x , iter_y; - ClutterFixed tw , th; - ClutterFixed tqx , tqy; - ClutterFixed first_tx , first_ty; - ClutterFixed first_qx , first_qy; - ClutterFixed slice_tx1 , slice_ty1; - ClutterFixed slice_tx2 , slice_ty2; - ClutterFixed slice_qx1 , slice_qy1; - ClutterFixed slice_qx2 , slice_qy2; - GLfixed tex_coords[8]; - GLfixed quad_coords[8]; - GLuint gl_handle; - gulong enable_flags = (COGL_ENABLE_TEXTURE_2D - | COGL_ENABLE_VERTEX_ARRAY - | COGL_ENABLE_TEXCOORD_ARRAY); - -#if COGL_DEBUG - printf("=== Drawing Tex Quad (Software Tiling Mode) ===\n"); -#endif - +_cogl_journal_flush_quad_batch (CoglJournalEntry *batch_start, + gint batch_len, + GLfloat *vertex_pointer) +{ + int needed_indices; + gsize stride; + int i; + gulong enable_flags = 0; + guint32 disable_mask; + int prev_n_texcoord_arrays_enabled; + _COGL_GET_CONTEXT (ctx, NO_RETVAL); - - /* Prepare GL state */ - if (ctx->color_alpha < 255 - || tex->bitmap.format & COGL_A_BIT) - { - enable_flags |= COGL_ENABLE_BLEND; + + /* The indices are always the same sequence regardless of the vertices so we + * only need to change it if there are more vertices than ever before. */ + needed_indices = batch_len * 6; + if (needed_indices > ctx->static_indices->len) + { + int old_len = ctx->static_indices->len; + int vert_num = old_len / 6 * 4; + GLushort *q; + + /* Add two triangles for each quad to the list of + indices. That makes six new indices but two of the + vertices in the triangles are shared. */ + g_array_set_size (ctx->static_indices, needed_indices); + q = &g_array_index (ctx->static_indices, GLushort, old_len); + + for (i = old_len; + i < ctx->static_indices->len; + i += 6, vert_num += 4) + { + *(q++) = vert_num + 0; + *(q++) = vert_num + 1; + *(q++) = vert_num + 3; + + *(q++) = vert_num + 1; + *(q++) = vert_num + 2; + *(q++) = vert_num + 3; + } } - + + /* XXX NB: + * Our vertex data is arranged as follows: + * 4 vertices per quad: 2 GLfloats per position, + * 2 GLfloats per tex coord * n_layers + */ + stride = 2 + 2 * batch_start->n_layers; + stride *= sizeof (GLfloat); + + disable_mask = (1 << batch_start->n_layers) - 1; + disable_mask = ~disable_mask; + + cogl_material_flush_gl_state (ctx->source_material, + COGL_MATERIAL_FLUSH_FALLBACK_MASK, + batch_start->fallback_mask, + COGL_MATERIAL_FLUSH_DISABLE_MASK, + disable_mask, + /* Redundant when dealing with unsliced + * textures but does no harm... */ + COGL_MATERIAL_FLUSH_LAYER0_OVERRIDE, + batch_start->layer0_override_texture, + NULL); + + for (i = 0; i < batch_start->n_layers; i++) + { + GE (glClientActiveTexture (GL_TEXTURE0 + i)); + GE (glEnableClientState (GL_TEXTURE_COORD_ARRAY)); + GE (glTexCoordPointer (2, GL_FLOAT, stride, vertex_pointer + 2 + 2 * i)); + } + prev_n_texcoord_arrays_enabled = + ctx->n_texcoord_arrays_enabled; + ctx->n_texcoord_arrays_enabled = i + 1; + for (; i < prev_n_texcoord_arrays_enabled; i++) + { + GE (glClientActiveTexture (GL_TEXTURE0 + i)); + GE (glDisableClientState (GL_TEXTURE_COORD_ARRAY)); + } + + /* FIXME: This api is a bit yukky, ideally it will be removed if we + * re-work the cogl_enable mechanism */ + enable_flags |= cogl_material_get_cogl_enable_flags (ctx->source_material); + + if (ctx->enable_backface_culling) + enable_flags |= COGL_ENABLE_BACKFACE_CULLING; + + enable_flags |= COGL_ENABLE_VERTEX_ARRAY; cogl_enable (enable_flags); - + + GE (glVertexPointer (2, GL_FLOAT, stride, vertex_pointer)); + + GE (glDrawRangeElements (GL_TRIANGLES, + 0, ctx->static_indices->len - 1, + 6 * batch_len, + GL_UNSIGNED_SHORT, + ctx->static_indices->data)); + + + /* DEBUGGING CODE XXX: + * Uncommenting this will cause all rectangles to be drawn with a red, green + * or blue outline with no blending. This may e.g. help with debugging + * texture slicing issues or blending issues, plus it looks quite cool. + */ +#if 0 + { + static CoglHandle outline = COGL_INVALID_HANDLE; + static int color = 0; + if (outline == COGL_INVALID_HANDLE) + outline = cogl_material_new (); + + cogl_enable (COGL_ENABLE_VERTEX_ARRAY); + for (i = 0; i < batch_len; i++, color = (++color) % 3) + { + cogl_material_set_color4ub (outline, + color == 0 ? 0xff : 0x00, + color == 1 ? 0xff : 0x00, + color == 2 ? 0xff : 0x00, + 0xff); + cogl_material_flush_gl_state (outline, NULL); + GE( glDrawArrays (GL_LINE_LOOP, 4 * i, 4) ); + } + } +#endif +} + +static void +_cogl_journal_flush (void) +{ + GLfloat *current_vertex_pointer; + GLfloat *batch_vertex_pointer; + CoglJournalEntry *batch_start; + guint batch_len; + int i; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + if (ctx->journal->len == 0) + return; + + /* Current non-variables / constraints: + * + * - We don't have to worry about much GL state changing between journal + * entries since currently the journal never out lasts a single call to + * _cogl_multitexture_multiple_rectangles. So the user doesn't get the + * chance to fiddle with anything. (XXX: later this will be extended at + * which point we can start logging certain state changes) + * + * - Implied from above: all entries will refer to the same material. + * + * - Although _cogl_multitexture_multiple_rectangles can cause the wrap mode + * of textures to be modified, the journal is flushed if a wrap mode is + * changed so we don't currently have to log wrap mode changes. + * + * - XXX - others? + */ + + /* TODO: "compile" the journal to find ways of batching draw calls and vertex + * data. + * + * Simple E.g. given current constraints... + * pass 0 - load all data into a single CoglVertexBuffer + * pass 1 - batch gl draw calls according to entries that use the same + * textures. + * + * We will be able to do cooler stuff here when we extend the life of + * journals beyond _cogl_multitexture_multiple_rectangles. + */ + + batch_vertex_pointer = (GLfloat *)ctx->logged_vertices->data; + batch_start = (CoglJournalEntry *)ctx->journal->data; + batch_len = 1; + + current_vertex_pointer = batch_vertex_pointer; + + for (i = 1; i < ctx->journal->len; i++) + { + CoglJournalEntry *prev_entry = + &g_array_index (ctx->journal, CoglJournalEntry, i - 1); + CoglJournalEntry *current_entry = prev_entry + 1; + gsize stride; + + /* Progress the vertex pointer */ + stride = 2 + current_entry->n_layers * 2; + current_vertex_pointer += stride; + + /* batch rectangles using the same textures */ + if (current_entry->material == prev_entry->material && + current_entry->n_layers == prev_entry->n_layers && + current_entry->fallback_mask == prev_entry->fallback_mask && + current_entry->layer0_override_texture + == prev_entry->layer0_override_texture) + { + batch_len++; + continue; + } + + _cogl_journal_flush_quad_batch (batch_start, + batch_len, + batch_vertex_pointer); + + batch_start = current_entry; + batch_len = 1; + batch_vertex_pointer = current_vertex_pointer; + } + + /* The last batch... */ + _cogl_journal_flush_quad_batch (batch_start, + batch_len, + batch_vertex_pointer); + + + g_array_set_size (ctx->journal, 0); + g_array_set_size (ctx->logged_vertices, 0); +} + +static void +_cogl_journal_log_quad (float x_1, + float y_1, + float x_2, + float y_2, + CoglHandle material, + gint n_layers, + guint32 fallback_mask, + GLuint layer0_override_texture, + float *tex_coords, + guint tex_coords_len) +{ + int stride; + int next_vert; + GLfloat *v; + int i; + int next_entry; + CoglJournalEntry *entry; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + /* The vertex data is logged into a seperate array in a layout that can be + * directly passed to OpenGL + */ + + /* We pack the vertex data as 2 (x,y) GLfloats folowed by 2 (tx,ty) GLfloats + * for each texture being used, E.g.: + * [X, Y, TX0, TY0, TX1, TY1, X, Y, TX0, TY0, X, Y, ...] + */ + stride = 2 + n_layers * 2; + + next_vert = ctx->logged_vertices->len; + g_array_set_size (ctx->logged_vertices, next_vert + 4 * stride); + v = &g_array_index (ctx->logged_vertices, GLfloat, next_vert); + + /* XXX: All the jumping around to fill in this strided buffer doesn't + * seem ideal. */ + + /* XXX: we could defer expanding the vertex data for GL until we come + * to flushing the journal. */ + + v[0] = x_1; v[1] = y_1; + v += stride; + v[0] = x_1; v[1] = y_2; + v += stride; + v[0] = x_2; v[1] = y_2; + v += stride; + v[0] = x_2; v[1] = y_1; + + for (i = 0; i < n_layers; i++) + { + GLfloat *t = + &g_array_index (ctx->logged_vertices, GLfloat, next_vert + 2 + 2 * i); + + t[0] = tex_coords[0]; t[1] = tex_coords[1]; + t += stride; + t[0] = tex_coords[0]; t[1] = tex_coords[3]; + t += stride; + t[0] = tex_coords[2]; t[1] = tex_coords[3]; + t += stride; + t[0] = tex_coords[2]; t[1] = tex_coords[1]; + } + + next_entry = ctx->journal->len; + g_array_set_size (ctx->journal, next_entry + 1); + entry = &g_array_index (ctx->journal, CoglJournalEntry, next_entry); + + entry->material = material; + entry->n_layers = n_layers; + entry->fallback_mask = fallback_mask; + entry->layer0_override_texture = layer0_override_texture; +} + +static void +_cogl_texture_sliced_quad (CoglTexture *tex, + CoglHandle material, + float x_1, + float y_1, + float x_2, + float y_2, + float tx_1, + float ty_1, + float tx_2, + float ty_2) +{ + CoglSpanIter iter_x , iter_y; + float tw , th; + float tqx , tqy; + float first_tx , first_ty; + float first_qx , first_qy; + float slice_tx1 , slice_ty1; + float slice_tx2 , slice_ty2; + float slice_qx1 , slice_qy1; + float slice_qx2 , slice_qy2; + GLuint gl_handle; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + +#if COGL_DEBUG + printf("=== Drawing Tex Quad (Sliced Mode) ===\n"); +#endif + + /* We can't use hardware repeat so we need to set clamp to edge + otherwise it might pull in edge pixels from the other side */ + _cogl_texture_set_wrap_mode_parameter (tex, GL_CLAMP_TO_EDGE); + /* If the texture coordinates are backwards then swap both the geometry and texture coordinates so that the texture will be flipped but we can still use the same algorithm to iterate the slices */ - if (tx2 < tx1) + if (tx_2 < tx_1) { - ClutterFixed temp = x1; - x1 = x2; - x2 = temp; - temp = tx1; - tx1 = tx2; - tx2 = temp; - } - if (ty2 < ty1) - { - ClutterFixed temp = y1; - y1 = y2; - y2 = temp; - temp = ty1; - ty1 = ty2; - ty2 = temp; + float temp = x_1; + x_1 = x_2; + x_2 = temp; + temp = tx_1; + tx_1 = tx_2; + tx_2 = temp; + } + if (ty_2 < ty_1) + { + float temp = y_1; + y_1 = y_2; + y_2 = temp; + temp = ty_1; + ty_1 = ty_2; + ty_2 = temp; } - - GE( cogl_wrap_glTexCoordPointer (2, GL_FIXED, 0, tex_coords) ); - GE( cogl_wrap_glVertexPointer (2, GL_FIXED, 0, quad_coords) ); - + /* Scale ratio from texture to quad widths */ - tw = CLUTTER_INT_TO_FIXED (tex->bitmap.width); - th = CLUTTER_INT_TO_FIXED (tex->bitmap.height); - - tqx = CFX_QDIV (x2-x1, CFX_QMUL (tw, (tx2 - tx1))); - tqy = CFX_QDIV (y2-y1, CFX_QMUL (th, (ty2 - ty1))); + tw = (float)(tex->bitmap.width); + th = (float)(tex->bitmap.height); + + tqx = (x_2 - x_1) / (tw * (tx_2 - tx_1)); + tqy = (y_2 - y_1) / (th * (ty_2 - ty_1)); /* Integral texture coordinate for first tile */ - first_tx = CLUTTER_INT_TO_FIXED (CLUTTER_FIXED_FLOOR (tx1)); - first_ty = CLUTTER_INT_TO_FIXED (CLUTTER_FIXED_FLOOR (ty1)); - + first_tx = (float)(floorf (tx_1)); + first_ty = (float)(floorf (ty_1)); + /* Denormalize texture coordinates */ - first_tx = CFX_QMUL (first_tx, tw); - first_ty = CFX_QMUL (first_ty, th); - tx1 = CFX_QMUL (tx1, tw); - ty1 = CFX_QMUL (ty1, th); - tx2 = CFX_QMUL (tx2, tw); - ty2 = CFX_QMUL (ty2, th); + first_tx = (first_tx * tw); + first_ty = (first_ty * th); + tx_1 = (tx_1 * tw); + ty_1 = (ty_1 * th); + tx_2 = (tx_2 * tw); + ty_2 = (ty_2 * th); /* Quad coordinate of the first tile */ - first_qx = x1 - CFX_QMUL (tx1 - first_tx, tqx); - first_qy = y1 - CFX_QMUL (ty1 - first_ty, tqy); - - + first_qx = x_1 - (tx_1 - first_tx) * tqx; + first_qy = y_1 - (ty_1 - first_ty) * tqy; + + /* Iterate until whole quad height covered */ for (_cogl_span_iter_begin (&iter_y, tex->slice_y_spans, - first_ty, ty1, ty2) ; + first_ty, ty_1, ty_2) ; !_cogl_span_iter_end (&iter_y) ; _cogl_span_iter_next (&iter_y) ) - { + { + float tex_coords[4]; + /* Discard slices out of quad early */ if (!iter_y.intersects) continue; - + /* Span-quad intersection in quad coordinates */ - slice_qy1 = first_qy + - CFX_QMUL (iter_y.intersect_start - first_ty, tqy); - - slice_qy2 = first_qy + - CFX_QMUL (iter_y.intersect_end - first_ty, tqy); - + slice_qy1 = first_qy + (iter_y.intersect_start - first_ty) * tqy; + + slice_qy2 = first_qy + (iter_y.intersect_end - first_ty) * tqy; + /* Localize slice texture coordinates */ slice_ty1 = iter_y.intersect_start - iter_y.pos; slice_ty2 = iter_y.intersect_end - iter_y.pos; - - /* Normalize texture coordinates to current slice */ + slice_ty1 /= iter_y.span->size; slice_ty2 /= iter_y.span->size; - - + /* Iterate until whole quad width covered */ for (_cogl_span_iter_begin (&iter_x, tex->slice_x_spans, - first_tx, tx1, tx2) ; + first_tx, tx_1, tx_2) ; !_cogl_span_iter_end (&iter_x) ; _cogl_span_iter_next (&iter_x) ) { /* Discard slices out of quad early */ if (!iter_x.intersects) continue; - + /* Span-quad intersection in quad coordinates */ - slice_qx1 = first_qx + - CFX_QMUL (iter_x.intersect_start - first_tx, tqx); - - slice_qx2 = first_qx + - CFX_QMUL (iter_x.intersect_end - first_tx, tqx); - + slice_qx1 = first_qx + (iter_x.intersect_start - first_tx) * tqx; + + slice_qx2 = first_qx + (iter_x.intersect_end - first_tx) * tqx; + /* Localize slice texture coordinates */ slice_tx1 = iter_x.intersect_start - iter_x.pos; slice_tx2 = iter_x.intersect_end - iter_x.pos; - - /* Normalize texture coordinates to current slice */ - slice_tx1 /= iter_x.span->size; - slice_tx2 /= iter_x.span->size; - + + /* Normalize texture coordinates to current slice + (rectangle texture targets take denormalized) */ + slice_tx1 /= iter_x.span->size; + slice_tx2 /= iter_x.span->size; + #if COGL_DEBUG printf("~~~~~ slice (%d,%d)\n", iter_x.index, iter_y.index); - printf("qx1: %f\n", CLUTTER_FIXED_TO_FLOAT (slice_qx1)); - printf("qy1: %f\n", CLUTTER_FIXED_TO_FLOAT (slice_qy1)); - printf("qx2: %f\n", CLUTTER_FIXED_TO_FLOAT (slice_qx2)); - printf("qy2: %f\n", CLUTTER_FIXED_TO_FLOAT (slice_qy2)); - printf("tx1: %f\n", CLUTTER_FIXED_TO_FLOAT (slice_tx1)); - printf("ty1: %f\n", CLUTTER_FIXED_TO_FLOAT (slice_ty1)); - printf("tx2: %f\n", CLUTTER_FIXED_TO_FLOAT (slice_tx2)); - printf("ty2: %f\n", CLUTTER_FIXED_TO_FLOAT (slice_ty2)); + printf("qx1: %f\n", (slice_qx1)); + printf("qy1: %f\n", (slice_qy1)); + printf("qx2: %f\n", (slice_qx2)); + printf("qy2: %f\n", (slice_qy2)); + printf("tx1: %f\n", (slice_tx1)); + printf("ty1: %f\n", (slice_ty1)); + printf("tx2: %f\n", (slice_tx2)); + printf("ty2: %f\n", (slice_ty2)); #endif - + /* Pick and bind opengl texture object */ gl_handle = g_array_index (tex->slice_gl_handles, GLuint, iter_y.index * iter_x.array->len + iter_x.index); - - GE( cogl_gles2_wrapper_bind_texture (tex->gl_target, gl_handle, - tex->gl_intformat) ); - - /* Draw textured quad */ - tex_coords[0] = slice_tx1; tex_coords[1] = slice_ty1; - tex_coords[2] = slice_tx2; tex_coords[3] = slice_ty1; - tex_coords[4] = slice_tx1; tex_coords[5] = slice_ty2; - tex_coords[6] = slice_tx2; tex_coords[7] = slice_ty2; - - quad_coords[0] = slice_qx1; quad_coords[1] = slice_qy1; - quad_coords[2] = slice_qx2; quad_coords[3] = slice_qy1; - quad_coords[4] = slice_qx1; quad_coords[5] = slice_qy2; - quad_coords[6] = slice_qx2; quad_coords[7] = slice_qy2; - - GE (cogl_wrap_glDrawArrays (GL_TRIANGLE_STRIP, 0, 4) ); + + tex_coords[0] = slice_tx1; + tex_coords[1] = slice_ty1; + tex_coords[2] = slice_tx2; + tex_coords[3] = slice_ty2; + _cogl_journal_log_quad (slice_qx1, + slice_qy1, + slice_qx2, + slice_qy2, + material, + 1, /* one layer */ + 0, /* don't need to use fallbacks */ + gl_handle, /* replace the layer0 texture */ + tex_coords, + 4); } } } -static void -_cogl_texture_quad_hw (CoglTexture *tex, - ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2, - ClutterFixed tx1, - ClutterFixed ty1, - ClutterFixed tx2, - ClutterFixed ty2) +static gboolean +_cogl_multitexture_unsliced_quad (float x_1, + float y_1, + float x_2, + float y_2, + CoglHandle material, + gint n_layers, + guint32 fallback_mask, + const float *user_tex_coords, + gint user_tex_coords_len) +{ + float *final_tex_coords = alloca (sizeof (float) * 4 * n_layers); + const GList *layers; + GList *tmp; + int i; + + _COGL_GET_CONTEXT (ctx, FALSE); + + /* + * Validate the texture coordinates for this rectangle. + */ + layers = cogl_material_get_layers (material); + for (tmp = (GList *)layers, i = 0; tmp != NULL; tmp = tmp->next, i++) + { + CoglHandle layer = (CoglHandle)tmp->data; + /* CoglLayerInfo *layer_info; */ + CoglHandle tex_handle; + CoglTexture *tex; + const float *in_tex_coords; + float *out_tex_coords; + CoglTexSliceSpan *x_span; + CoglTexSliceSpan *y_span; + + /* layer_info = &layers[i]; */ + + /* FIXME - we shouldn't be checking this stuff if layer_info->gl_texture + * already == 0 */ + + tex_handle = cogl_material_layer_get_texture (layer); + tex = _cogl_texture_pointer_from_handle (tex_handle); + + in_tex_coords = &user_tex_coords[i * 4]; + out_tex_coords = &final_tex_coords[i * 4]; + + + /* If the texture has waste or we are using GL_TEXTURE_RECT we + * can't handle texture repeating so we check that the texture + * coords lie in the range [0,1]. + * + * NB: We already know that no texture matrix is being used + * if the texture has waste since we validated that early on. + * TODO: check for a texture matrix in the GL_TEXTURE_RECT + * case. + */ + if (_cogl_texture_span_has_waste (tex, 0, 0) + && i < user_tex_coords_len / 4 + && (in_tex_coords[0] < 0 || in_tex_coords[0] > 1.0 + || in_tex_coords[1] < 0 || in_tex_coords[1] > 1.0 + || in_tex_coords[2] < 0 || in_tex_coords[2] > 1.0 + || in_tex_coords[3] < 0 || in_tex_coords[3] > 1.0)) + { + if (i == 0) + { + if (n_layers > 1) + { + g_warning ("Skipping layers 1..n of your material since the " + "first layer has waste and you supplied texture " + "coordinates outside the range [0,1]. We don't " + "currently support any multi-texturing using " + "textures with waste when repeating is " + "necissary so we are falling back to sliced " + "textures assuming layer 0 is the most " + "important one keep"); + } + return FALSE; + } + else + { + g_warning ("Skipping layer %d of your material " + "consisting of a texture with waste since " + "you have supplied texture coords outside " + "the range [0,1] (unsupported when " + "multi-texturing)", i); + + /* NB: marking for fallback will replace the layer with + * a default transparent texture */ + fallback_mask |= (1 << i); + } + } + + + /* + * Setup the texture unit... + */ + + /* NB: The user might not have supplied texture coordinates for all + * layers... */ + if (i < (user_tex_coords_len / 4)) + { + GLenum wrap_mode; + + /* If the texture coords are all in the range [0,1] then we want to + clamp the coords to the edge otherwise it can pull in edge pixels + from the wrong side when scaled */ + if (in_tex_coords[0] >= 0 && in_tex_coords[0] <= 1.0 + && in_tex_coords[1] >= 0 && in_tex_coords[1] <= 1.0 + && in_tex_coords[2] >= 0 && in_tex_coords[2] <= 1.0 + && in_tex_coords[3] >= 0 && in_tex_coords[3] <= 1.0) + wrap_mode = GL_CLAMP_TO_EDGE; + else + wrap_mode = GL_REPEAT; + + memcpy (out_tex_coords, in_tex_coords, sizeof (GLfloat) * 4); + + _cogl_texture_set_wrap_mode_parameter (tex, wrap_mode); + } + else + { + out_tex_coords[0] = 0; /* tx_1 */ + out_tex_coords[1] = 0; /* ty_1 */ + out_tex_coords[2] = 1.0; /* tx_2 */ + out_tex_coords[3] = 1.0; /* ty_2 */ + + _cogl_texture_set_wrap_mode_parameter (tex, GL_CLAMP_TO_EDGE); + } + + /* Don't include the waste in the texture coordinates */ + x_span = &g_array_index (tex->slice_x_spans, CoglTexSliceSpan, 0); + y_span = &g_array_index (tex->slice_y_spans, CoglTexSliceSpan, 0); + + out_tex_coords[0] = + out_tex_coords[0] * (x_span->size - x_span->waste) / x_span->size; + out_tex_coords[1] = + out_tex_coords[1] * (y_span->size - y_span->waste) / y_span->size; + out_tex_coords[2] = + out_tex_coords[2] * (x_span->size - x_span->waste) / x_span->size; + out_tex_coords[3] = + out_tex_coords[3] * (y_span->size - y_span->waste) / y_span->size; + } + + _cogl_journal_log_quad (x_1, + y_1, + x_2, + y_2, + material, + n_layers, + fallback_mask, + 0, /* don't replace the layer0 texture */ + final_tex_coords, + n_layers * 4); + + return TRUE; +} + +struct _CoglMutiTexturedRect { - GLfixed tex_coords[8]; - GLfixed quad_coords[8]; - GLuint gl_handle; - CoglTexSliceSpan *x_span; - CoglTexSliceSpan *y_span; - gulong enable_flags = (COGL_ENABLE_TEXTURE_2D - | COGL_ENABLE_VERTEX_ARRAY - | COGL_ENABLE_TEXCOORD_ARRAY); + float x_1; + float y_1; + float x_2; + float y_2; + const float *tex_coords; + gint tex_coords_len; +}; + +static void +_cogl_rectangles_with_multitexture_coords ( + struct _CoglMutiTexturedRect *rects, + gint n_rects) +{ + CoglHandle material; + const GList *layers; + int n_layers; + const GList *tmp; + guint32 fallback_mask = 0; + gboolean all_use_sliced_quad_fallback = FALSE; + int i; -#if COGL_DEBUG - printf("=== Drawing Tex Quad (Hardware Tiling Mode) ===\n"); -#endif - _COGL_GET_CONTEXT (ctx, NO_RETVAL); - - /* Prepare GL state */ - if (ctx->color_alpha < 255 - || tex->bitmap.format & COGL_A_BIT) - { - enable_flags |= COGL_ENABLE_BLEND; + + cogl_clip_ensure (); + + material = ctx->source_material; + + layers = cogl_material_get_layers (material); + n_layers = g_list_length ((GList *)layers); + + /* + * Validate all the layers of the current source material... + */ + + for (tmp = layers, i = 0; tmp != NULL; tmp = tmp->next, i++) + { + CoglHandle layer = tmp->data; + CoglHandle tex_handle = cogl_material_layer_get_texture (layer); + CoglTexture *texture = _cogl_texture_pointer_from_handle (tex_handle); + gulong flags; + + if (cogl_material_layer_get_type (layer) + != COGL_MATERIAL_LAYER_TYPE_TEXTURE) + continue; + + /* XXX: + * For now, if the first layer is sliced then all other layers are + * ignored since we currently don't support multi-texturing with + * sliced textures. If the first layer is not sliced then any other + * layers found to be sliced will be skipped. (with a warning) + * + * TODO: Add support for multi-texturing rectangles with sliced + * textures if no texture matrices are in use. + */ + if (cogl_texture_is_sliced (tex_handle)) + { + if (i == 0) + { + fallback_mask = ~1; /* fallback all except the first layer */ + all_use_sliced_quad_fallback = TRUE; + if (tmp->next) + { + g_warning ("Skipping layers 1..n of your material since the " + "first layer is sliced. We don't currently " + "support any multi-texturing with sliced " + "textures but assume layer 0 is the most " + "important to keep"); + } + break; + } + else + { + g_warning ("Skipping layer %d of your material consisting of a " + "sliced texture (unsuported for multi texturing)", + i); + + /* NB: marking for fallback will replace the layer with + * a default transparent texture */ + fallback_mask |= (1 << i); + continue; + } + } + + /* We don't support multi texturing using textures with any waste if the + * user has supplied a custom texture matrix, since we don't know if + * the result will end up trying to texture from the waste area. */ + flags = cogl_material_layer_get_flags (layer); + if (flags & COGL_MATERIAL_LAYER_FLAG_HAS_USER_MATRIX + && _cogl_texture_span_has_waste (texture, 0, 0)) + { + static gboolean shown_warning = FALSE; + if (!shown_warning) + g_warning ("Skipping layer %d of your material consisting of a " + "texture with waste since you have supplied a custom " + "texture matrix and the result may try to sample from " + "the waste area of your texture.", i); + shown_warning = TRUE; + /* NB: marking for fallback will replace the layer with + * a default transparent texture */ + fallback_mask |= (1 << i); + continue; + } } - - cogl_enable (enable_flags); - - GE( cogl_wrap_glTexCoordPointer (2, GL_FIXED, 0, tex_coords) ); - GE( cogl_wrap_glVertexPointer (2, GL_FIXED, 0, quad_coords) ); - - /* Pick and bind opengl texture object */ - gl_handle = g_array_index (tex->slice_gl_handles, GLuint, 0); - GE( cogl_gles2_wrapper_bind_texture (tex->gl_target, gl_handle, - tex->gl_intformat) ); - - /* Don't include the waste in the texture coordinates */ - x_span = &g_array_index (tex->slice_x_spans, CoglTexSliceSpan, 0); - y_span = &g_array_index (tex->slice_y_spans, CoglTexSliceSpan, 0); - tx1 = tx1 * (x_span->size - x_span->waste) / x_span->size; - tx2 = tx2 * (x_span->size - x_span->waste) / x_span->size; - ty1 = ty1 * (y_span->size - y_span->waste) / y_span->size; - ty2 = ty2 * (y_span->size - y_span->waste) / y_span->size; - - /* Draw textured quad */ - tex_coords[0] = tx1; tex_coords[1] = ty1; - tex_coords[2] = tx2; tex_coords[3] = ty1; - tex_coords[4] = tx1; tex_coords[5] = ty2; - tex_coords[6] = tx2; tex_coords[7] = ty2; - - quad_coords[0] = x1; quad_coords[1] = y1; - quad_coords[2] = x2; quad_coords[3] = y1; - quad_coords[4] = x1; quad_coords[5] = y2; - quad_coords[6] = x2; quad_coords[7] = y2; - - GE (cogl_wrap_glDrawArrays (GL_TRIANGLE_STRIP, 0, 4) ); + + /* + * Emit geometry for each of the rectangles... + */ + + for (i = 0; i < n_rects; i++) + { + if (all_use_sliced_quad_fallback + || !_cogl_multitexture_unsliced_quad (rects[i].x_1, rects[i].y_1, + rects[i].x_2, rects[i].y_2, + material, + n_layers, + fallback_mask, + rects[i].tex_coords, + rects[i].tex_coords_len)) + { + CoglHandle first_layer, tex_handle; + CoglTexture *texture; + + first_layer = layers->data; + tex_handle = cogl_material_layer_get_texture (first_layer); + texture = _cogl_texture_pointer_from_handle (tex_handle); + if (rects[i].tex_coords) + _cogl_texture_sliced_quad (texture, + material, + rects[i].x_1, rects[i].y_1, + rects[i].x_2, rects[i].y_2, + rects[i].tex_coords[0], + rects[i].tex_coords[1], + rects[i].tex_coords[2], + rects[i].tex_coords[3]); + else + _cogl_texture_sliced_quad (texture, + material, + rects[i].x_1, rects[i].y_1, + rects[i].x_2, rects[i].y_2, + 0.0f, 0.0f, 1.0f, 1.0f); + } + } + + _cogl_journal_flush (); } void -cogl_texture_rectangle (CoglHandle handle, - ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2, - ClutterFixed tx1, - ClutterFixed ty1, - ClutterFixed tx2, - ClutterFixed ty2) -{ - CoglTexture *tex; - - /* Check if valid texture */ - if (!cogl_is_texture (handle)) - return; - - tex = _cogl_texture_pointer_from_handle (handle); - - /* Make sure we got stuff to draw */ - if (tex->slice_gl_handles == NULL) - return; - - if (tex->slice_gl_handles->len == 0) - return; - - if (tx1 == tx2 || ty1 == ty2) - return; - - /* Tile textured quads */ - if (tex->slice_gl_handles->len == 1 - && tx1 >= -CFX_ONE && tx2 <= CFX_ONE - && ty1 >= -CFX_ONE && ty2 <= CFX_ONE) - { - _cogl_texture_quad_hw (tex, x1,y1, x2,y2, tx1,ty1, tx2,ty2); - } - else +cogl_rectangles_with_texture_coords (const float *verts, + guint n_rects) +{ + struct _CoglMutiTexturedRect rects[n_rects]; + int i; + + for (i = 0; i < n_rects; i++) { - _cogl_texture_quad_sw (tex, x1,y1, x2,y2, tx1,ty1, tx2,ty2); + rects[i].x_1 = verts[i * 8]; + rects[i].y_1 = verts[i * 8 + 1]; + rects[i].x_2 = verts[i * 8 + 2]; + rects[i].y_2 = verts[i * 8 + 3]; + /* FIXME: rect should be defined to have a const float *geom; + * instead, to avoid this copy + * rect[i].geom = &verts[n_rects * 8]; */ + rects[i].tex_coords = &verts[i * 8 + 4]; + rects[i].tex_coords_len = 4; } + + _cogl_rectangles_with_multitexture_coords (rects, n_rects); } void -cogl_texture_polygon (CoglHandle handle, - guint n_vertices, - CoglTextureVertex *vertices, - gboolean use_color) -{ +cogl_rectangle_with_texture_coords (float x_1, + float y_1, + float x_2, + float y_2, + float tx_1, + float ty_1, + float tx_2, + float ty_2) +{ + float verts[8]; + + verts[0] = x_1; + verts[1] = y_1; + verts[2] = x_2; + verts[3] = y_2; + verts[4] = tx_1; + verts[5] = ty_1; + verts[6] = tx_2; + verts[7] = ty_2; + + cogl_rectangles_with_texture_coords (verts, 1); +} + +void +cogl_rectangle_with_multitexture_coords (float x_1, + float y_1, + float x_2, + float y_2, + const float *user_tex_coords, + gint user_tex_coords_len) +{ + struct _CoglMutiTexturedRect rect; + + rect.x_1 = x_1; + rect.y_1 = y_1; + rect.x_2 = x_2; + rect.y_2 = y_2; + rect.tex_coords = user_tex_coords; + rect.tex_coords_len = user_tex_coords_len; + + _cogl_rectangles_with_multitexture_coords (&rect, 1); +} + +static void +_cogl_texture_sliced_polygon (CoglTextureVertex *vertices, + guint n_vertices, + guint stride, + gboolean use_color) +{ + const GList *layers; + CoglHandle layer0; + CoglHandle tex_handle; CoglTexture *tex; + CoglTexSliceSpan *y_span, *x_span; + int x, y, tex_num, i; GLuint gl_handle; - gulong enable_flags; - int i; - CoglTextureGLVertex *p; - CoglTexSliceSpan *x_span; - CoglTexSliceSpan *y_span; + GLfloat *v; _COGL_GET_CONTEXT (ctx, NO_RETVAL); - - /* Check if valid texture */ - if (!cogl_is_texture (handle)) - return; - tex = _cogl_texture_pointer_from_handle (handle); - - /* GL ES has no GL_CLAMP_TO_BORDER wrap mode so the method used to - render sliced textures in the GL backend will not work. Therefore - cogl_texture_polygon is only supported if the texture is not - sliced */ - if (tex->slice_gl_handles->len != 1) + /* We can assume in this case that we have at least one layer in the + * material that corresponds to a sliced cogl texture */ + layers = cogl_material_get_layers (ctx->source_material); + layer0 = (CoglHandle)layers->data; + tex_handle = cogl_material_layer_get_texture (layer0); + tex = _cogl_texture_pointer_from_handle (tex_handle); + + v = (GLfloat *)ctx->logged_vertices->data; + for (i = 0; i < n_vertices; i++) + { + GLfloat *c; + + v[0] = vertices[i].x; + v[1] = vertices[i].y; + v[2] = vertices[i].z; + + /* NB: [X,Y,Z,TX,TY,R,G,B,A,...] */ + c = v + 5; + c[0] = cogl_color_get_red_byte (&vertices[i].color); + c[1] = cogl_color_get_green_byte (&vertices[i].color); + c[2] = cogl_color_get_blue_byte (&vertices[i].color); + c[3] = cogl_color_get_alpha_byte (&vertices[i].color); + + v += stride; + } + + /* Render all of the slices with the full geometry but use a + transparent border color so that any part of the texture not + covered by the slice will be ignored */ + tex_num = 0; + for (y = 0; y < tex->slice_y_spans->len; y++) { - static gboolean shown_warning = FALSE; + y_span = &g_array_index (tex->slice_y_spans, CoglTexSliceSpan, y); - if (!shown_warning) + for (x = 0; x < tex->slice_x_spans->len; x++) { - g_warning ("cogl_texture_polygon does not work for " - "sliced textures on GL ES"); - shown_warning = TRUE; + x_span = &g_array_index (tex->slice_x_spans, CoglTexSliceSpan, x); + + gl_handle = g_array_index (tex->slice_gl_handles, GLuint, tex_num++); + + /* Convert the vertices into an array of GLfloats ready to pass to + OpenGL */ + v = (GLfloat *)ctx->logged_vertices->data; + for (i = 0; i < n_vertices; i++) + { + GLfloat *t; + float tx, ty; + + tx = ((vertices[i].tx + - ((float)(x_span->start) + / tex->bitmap.width)) + * tex->bitmap.width / x_span->size); + ty = ((vertices[i].ty + - ((float)(y_span->start) + / tex->bitmap.height)) + * tex->bitmap.height / y_span->size); + + /* NB: [X,Y,Z,TX,TY,R,G,B,A,...] */ + t = v + 3; + t[0] = tx; + t[1] = ty; + + v += stride; + } + + cogl_material_flush_gl_state (ctx->source_material, + COGL_MATERIAL_FLUSH_DISABLE_MASK, + (guint32)~1, /* disable all except the + first layer */ + COGL_MATERIAL_FLUSH_LAYER0_OVERRIDE, + gl_handle, + NULL); + + GE( glDrawArrays (GL_TRIANGLE_FAN, 0, n_vertices) ); } - return; } +} - /* Make sure there is enough space in the global texture vertex - array. This is used so we can render the polygon with a single - call to OpenGL but still support any number of vertices */ - if (ctx->texture_vertices_size < n_vertices) + +static void +_cogl_multitexture_unsliced_polygon (CoglTextureVertex *vertices, + guint n_vertices, + guint n_layers, + guint stride, + gboolean use_color, + guint32 fallback_mask) +{ + CoglHandle material; + const GList *layers; + int i; + GList *tmp; + CoglTexSliceSpan *y_span, *x_span; + GLfloat *v; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + + material = ctx->source_material; + layers = cogl_material_get_layers (material); + + /* Convert the vertices into an array of GLfloats ready to pass to + OpenGL */ + for (v = (GLfloat *)ctx->logged_vertices->data, i = 0; + i < n_vertices; + v += stride, i++) + { + GLfloat *c; + int j; + + /* NB: [X,Y,Z,TX,TY...,R,G,B,A,...] */ + v[0] = vertices[i].x; + v[1] = vertices[i].y; + v[2] = vertices[i].z; + + for (tmp = (GList *)layers, j = 0; tmp != NULL; tmp = tmp->next, j++) + { + CoglHandle layer = (CoglHandle)tmp->data; + CoglHandle tex_handle; + CoglTexture *tex; + GLfloat *t; + float tx, ty; + + tex_handle = cogl_material_layer_get_texture (layer); + tex = _cogl_texture_pointer_from_handle (tex_handle); + + y_span = &g_array_index (tex->slice_y_spans, CoglTexSliceSpan, 0); + x_span = &g_array_index (tex->slice_x_spans, CoglTexSliceSpan, 0); + + tx = ((vertices[i].tx + - ((float)(x_span->start) + / tex->bitmap.width)) + * tex->bitmap.width / x_span->size); + ty = ((vertices[i].ty + - ((float)(y_span->start) + / tex->bitmap.height)) + * tex->bitmap.height / y_span->size); + + /* NB: [X,Y,Z,TX,TY...,R,G,B,A,...] */ + t = v + 3 + 2 * j; + t[0] = tx; + t[1] = ty; + } + + /* NB: [X,Y,Z,TX,TY...,R,G,B,A,...] */ + c = v + 3 + 2 * n_layers; + c[0] = cogl_color_get_red_float (&vertices[i].color); + c[1] = cogl_color_get_green_float (&vertices[i].color); + c[2] = cogl_color_get_blue_float (&vertices[i].color); + c[3] = cogl_color_get_alpha_float (&vertices[i].color); + } + + cogl_material_flush_gl_state (ctx->source_material, + COGL_MATERIAL_FLUSH_FALLBACK_MASK, + fallback_mask, + NULL); + + GE (glDrawArrays (GL_TRIANGLE_FAN, 0, n_vertices)); +} + +void +cogl_polygon (CoglTextureVertex *vertices, + guint n_vertices, + gboolean use_color) +{ + CoglHandle material; + const GList *layers; + int n_layers; + GList *tmp; + gboolean use_sliced_polygon_fallback = FALSE; + guint32 fallback_mask = 0; + int i; + gulong enable_flags; + guint stride; + gsize stride_bytes; + GLfloat *v; + int prev_n_texcoord_arrays_enabled; + + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + cogl_clip_ensure (); + + material = ctx->source_material; + layers = cogl_material_get_layers (ctx->source_material); + n_layers = g_list_length ((GList *)layers); + + for (tmp = (GList *)layers, i = 0; tmp != NULL; tmp = tmp->next, i++) { - guint nsize = ctx->texture_vertices_size; - - if (nsize == 0) - nsize = 1; - do - nsize *= 2; - while (nsize < n_vertices); - - ctx->texture_vertices_size = nsize; - - if (ctx->texture_vertices) - ctx->texture_vertices = g_realloc (ctx->texture_vertices, - nsize - * sizeof (CoglTextureGLVertex)); - else - ctx->texture_vertices = g_malloc (nsize - * sizeof (CoglTextureGLVertex)); + CoglHandle layer = (CoglHandle)tmp->data; + CoglHandle tex_handle = cogl_material_layer_get_texture (layer); + CoglTexture *tex = _cogl_texture_pointer_from_handle (tex_handle); + + if (i == 0 && cogl_texture_is_sliced (tex_handle)) + { +#if defined (HAVE_COGL_GLES) || defined (HAVE_COGL_GLES2) + { + static gboolean shown_gles_slicing_warning = FALSE; + if (!shown_gles_slicing_warning) + g_warning ("cogl_polygon does not work for sliced textures " + "on GL ES"); + shown_gles_slicing_warning = TRUE; + return; + } +#endif + if (n_layers > 1) + { + static gboolean shown_slicing_warning = FALSE; + if (!shown_slicing_warning) + { + g_warning ("Disabling layers 1..n since multi-texturing with " + "cogl_polygon isn't supported when using sliced " + "textures\n"); + shown_slicing_warning = TRUE; + } + } + use_sliced_polygon_fallback = TRUE; + n_layers = 1; + + if (tex->min_filter != GL_NEAREST || tex->mag_filter != GL_NEAREST) + { + static gboolean shown_filter_warning = FALSE; + if (!shown_filter_warning) + { + g_warning ("cogl_texture_polygon does not work for sliced textures " + "when the minification and magnification filters are not " + "CGL_NEAREST"); + shown_filter_warning = TRUE; + } + return; + } + +#ifdef HAVE_COGL_GL + /* Temporarily change the wrapping mode on all of the slices to use + * a transparent border + * XXX: it's doesn't look like we save/restore this, like the comment + * implies? */ + _cogl_texture_set_wrap_mode_parameter (tex, GL_CLAMP_TO_BORDER); +#endif + break; + } + + if (cogl_texture_is_sliced (tex_handle)) + { + g_warning ("Disabling layer %d of the current source material, " + "because texturing with the vertex buffer API is not " + "currently supported using sliced textures, or textures " + "with waste\n", i); + + fallback_mask |= (1 << i); + continue; + } } - + + /* Our data is arranged like: + * [X, Y, Z, TX0, TY0, TX1, TY1..., R, G, B, A,...] */ + stride = 3 + (2 * n_layers) + (use_color ? 4 : 0); + stride_bytes = stride * sizeof (GLfloat); + + /* Make sure there is enough space in the global vertex + array. This is used so we can render the polygon with a single + call to OpenGL but still support any number of vertices */ + g_array_set_size (ctx->logged_vertices, n_vertices * stride); + v = (GLfloat *)ctx->logged_vertices->data; + /* Prepare GL state */ - enable_flags = (COGL_ENABLE_TEXTURE_2D - | COGL_ENABLE_VERTEX_ARRAY - | COGL_ENABLE_TEXCOORD_ARRAY); - - if ((tex->bitmap.format & COGL_A_BIT)) - enable_flags |= COGL_ENABLE_BLEND; - else if (use_color) - { - for (i = 0; i < n_vertices; i++) - if (vertices[i].color.alpha < 255) - { - enable_flags |= COGL_ENABLE_BLEND; - break; - } - } - else if (ctx->color_alpha < 255) - enable_flags |= COGL_ENABLE_BLEND; + enable_flags = COGL_ENABLE_VERTEX_ARRAY; + enable_flags |= cogl_material_get_cogl_enable_flags (ctx->source_material); + + if (ctx->enable_backface_culling) + enable_flags |= COGL_ENABLE_BACKFACE_CULLING; if (use_color) { enable_flags |= COGL_ENABLE_COLOR_ARRAY; - GE( cogl_wrap_glColorPointer (4, GL_FIXED, sizeof (CoglTextureGLVertex), - ctx->texture_vertices[0].c) ); + GE( glColorPointer (4, GL_FLOAT, + stride_bytes, + /* NB: [X,Y,Z,TX,TY...,R,G,B,A,...] */ + v + 3 + 2 * n_layers) ); } - - GE( cogl_wrap_glVertexPointer (3, GL_FIXED, sizeof (CoglTextureGLVertex), - ctx->texture_vertices[0].v) ); - GE( cogl_wrap_glTexCoordPointer (2, GL_FIXED, sizeof (CoglTextureGLVertex), - ctx->texture_vertices[0].t) ); cogl_enable (enable_flags); - - gl_handle = g_array_index (tex->slice_gl_handles, GLuint, 0); - x_span = &g_array_index (tex->slice_x_spans, CoglTexSliceSpan, 0); - y_span = &g_array_index (tex->slice_y_spans, CoglTexSliceSpan, 0); - /* Convert the vertices into an array of GLfixeds ready to pass to - OpenGL */ - for (i = 0, p = ctx->texture_vertices; i < n_vertices; i++, p++) + GE (glVertexPointer (3, GL_FLOAT, stride_bytes, v)); + + for (i = 0; i < n_layers; i++) { - p->v[0] = vertices[i].x; - p->v[1] = vertices[i].y; - p->v[2] = vertices[i].z; - p->t[0] = vertices[i].tx * (x_span->size - x_span->waste) / x_span->size; - p->t[1] = vertices[i].ty * (y_span->size - y_span->waste) / y_span->size; - p->c[0] = (vertices[i].color.red << 16) / 0xff; - p->c[1] = (vertices[i].color.green << 16) / 0xff; - p->c[2] = (vertices[i].color.blue << 16) / 0xff; - p->c[3] = (vertices[i].color.alpha << 16) / 0xff; - } - - GE( cogl_gles2_wrapper_bind_texture (tex->gl_target, gl_handle, - tex->gl_intformat) ); - - GE( cogl_wrap_glDrawArrays (GL_TRIANGLE_FAN, 0, n_vertices) ); - - /* Set the last color so that the cache of the alpha value will work - properly */ - if (use_color && n_vertices > 0) - cogl_color (&vertices[n_vertices - 1].color); + GE (glClientActiveTexture (GL_TEXTURE0 + i)); + GE (glEnableClientState (GL_TEXTURE_COORD_ARRAY)); + GE (glTexCoordPointer (2, GL_FLOAT, + stride_bytes, + /* NB: [X,Y,Z,TX,TY...,R,G,B,A,...] */ + v + 3 + 2 * i)); + } + prev_n_texcoord_arrays_enabled = + ctx->n_texcoord_arrays_enabled; + ctx->n_texcoord_arrays_enabled = i + 1; + for (; i < prev_n_texcoord_arrays_enabled; i++) + { + GE (glClientActiveTexture (GL_TEXTURE0 + i)); + GE (glDisableClientState (GL_TEXTURE_COORD_ARRAY)); + } + + if (use_sliced_polygon_fallback) + _cogl_texture_sliced_polygon (vertices, + n_vertices, + stride, + use_color); + else + _cogl_multitexture_unsliced_polygon (vertices, + n_vertices, + n_layers, + stride, + use_color, + fallback_mask); + + /* Reset the size of the logged vertex array because rendering + rectangles expects it to start at 0 */ + g_array_set_size (ctx->logged_vertices, 0); } + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl-texture.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl-texture.h --- clutter-0.8.4/clutter/cogl/gles/cogl-texture.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gles/cogl-texture.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,64 +0,0 @@ -/* - * Clutter COGL - * - * A basic GL/GLES Abstraction/Utility Layer - * - * Authored By Matthew Allum - * - * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __COGL_TEXTURE_H -#define __COGL_TEXTURE_H - -#include "cogl-bitmap.h" - -typedef struct _CoglTexture CoglTexture; -typedef struct _CoglTexSliceSpan CoglTexSliceSpan; -typedef struct _CoglSpanIter CoglSpanIter; - -struct _CoglTexSliceSpan -{ - gint start; - gint size; - gint waste; -}; - -struct _CoglTexture -{ - guint ref_count; - CoglBitmap bitmap; - gboolean bitmap_owner; - GLenum gl_target; - GLenum gl_intformat; - GLenum gl_format; - GLenum gl_type; - GArray *slice_x_spans; - GArray *slice_y_spans; - GArray *slice_gl_handles; - gint max_waste; - COGLenum min_filter; - COGLenum mag_filter; - gboolean is_foreign; - gboolean auto_mipmap; -}; - -CoglTexture* -_cogl_texture_pointer_from_handle (CoglHandle handle); - -#endif /* __COGL_TEXTURE_H */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/cogl-texture-private.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/cogl-texture-private.h --- clutter-0.8.4/clutter/cogl/gles/cogl-texture-private.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gles/cogl-texture-private.h 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,81 @@ +/* + * Clutter COGL + * + * A basic GL/GLES Abstraction/Utility Layer + * + * Authored By Matthew Allum + * + * 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, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __COGL_TEXTURE_H +#define __COGL_TEXTURE_H + +#include "cogl-bitmap.h" + +typedef struct _CoglTexture CoglTexture; +typedef struct _CoglTexSliceSpan CoglTexSliceSpan; +typedef struct _CoglSpanIter CoglSpanIter; + +struct _CoglTexSliceSpan +{ + gint start; + gint size; + gint waste; +}; + +struct _CoglTexture +{ + guint ref_count; + CoglBitmap bitmap; + gboolean bitmap_owner; + GLenum gl_target; + GLenum gl_intformat; + GLenum gl_format; + GLenum gl_type; + GArray *slice_x_spans; + GArray *slice_y_spans; + GArray *slice_gl_handles; + gint max_waste; + COGLenum min_filter; + COGLenum mag_filter; + gboolean is_foreign; + GLint wrap_mode; + gboolean auto_mipmap; +}; + +/* To improve batching of geometry when submitting vertices to OpenGL we + * log the texture rectangles we want to draw to a journal, so when we + * later flush the journal we aim to batch data, and gl draw calls. */ +typedef struct _CoglJournalEntry +{ + CoglHandle material; + gint n_layers; + guint32 fallback_mask; + GLuint layer0_override_texture; +} CoglJournalEntry; + +CoglTexture* +_cogl_texture_pointer_from_handle (CoglHandle handle); + +gboolean +_cogl_texture_span_has_waste (CoglTexture *tex, + gint x_span_index, + gint y_span_index); + +#endif /* __COGL_TEXTURE_H */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/Makefile.am --- clutter-0.8.4/clutter/cogl/gles/Makefile.am 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/cogl/gles/Makefile.am 2009-01-28 16:45:25.000000000 +0000 @@ -1,6 +1,18 @@ libclutterincludedir = $(includedir)/clutter-@CLUTTER_API_VERSION@/cogl -libclutterinclude_HEADERS = $(top_builddir)/clutter/cogl/cogl.h \ - $(top_builddir)/clutter/cogl/cogl-defines-gles.h +libclutterinclude_HEADERS = \ + $(top_builddir)/clutter/cogl/cogl.h \ + $(top_builddir)/clutter/cogl/cogl-defines-gles.h \ + $(top_builddir)/clutter/cogl/cogl-color.h \ + $(top_builddir)/clutter/cogl/cogl-deprecated.h \ + $(top_builddir)/clutter/cogl/cogl-fixed.h \ + $(top_builddir)/clutter/cogl/cogl-offscreen.h \ + $(top_builddir)/clutter/cogl/cogl-path.h \ + $(top_builddir)/clutter/cogl/cogl-shader.h \ + $(top_builddir)/clutter/cogl/cogl-texture.h \ + $(top_builddir)/clutter/cogl/cogl-types.h \ + $(top_builddir)/clutter/cogl/cogl-vertex-buffer.h \ + $(top_builddir)/clutter/cogl/cogl-material.h \ + $(top_builddir)/clutter/cogl/cogl-matrix.h INCLUDES = \ -I$(top_srcdir) \ @@ -10,8 +22,11 @@ -I$(top_srcdir)/clutter/cogl/$(CLUTTER_COGL) \ -I$(top_builddir)/clutter \ -I$(top_builddir)/clutter/cogl \ + -DG_LOG_DOMAIN=\"Cogl-GLES\" \ + -DCLUTTER_COMPILATION \ $(CLUTTER_CFLAGS) \ $(CLUTTER_DEBUG_CFLAGS) \ + $(MAINTAINER_CFLAGS) \ $(GCC_FLAGS) LDADD = $(CLUTTER_LIBS) @@ -21,8 +36,16 @@ libclutter_cogl_la_SOURCES = \ $(top_builddir)/clutter/cogl/cogl.h \ $(top_builddir)/clutter/cogl/cogl-defines-gles.h \ + $(top_builddir)/clutter/cogl/cogl-color.h \ + $(top_builddir)/clutter/cogl/cogl-deprecated.h \ + $(top_builddir)/clutter/cogl/cogl-fixed.h \ + $(top_builddir)/clutter/cogl/cogl-offscreen.h \ + $(top_builddir)/clutter/cogl/cogl-path.h \ + $(top_builddir)/clutter/cogl/cogl-shader.h \ + $(top_builddir)/clutter/cogl/cogl-texture.h \ + $(top_builddir)/clutter/cogl/cogl-types.h \ cogl-internal.h \ - cogl-texture.h \ + cogl-texture-private.h \ cogl-fbo.h \ cogl-context.h \ cogl.c \ @@ -33,7 +56,7 @@ cogl-gles2-wrapper.h \ cogl-program.h \ cogl-program.c \ - cogl-shader.h \ + cogl-shader-private.h \ cogl-shader.c if USE_GLES2_WRAPPER @@ -50,7 +73,7 @@ cogl-fixed-vertex-shader.glsl \ cogl-fixed-fragment-shader.glsl -libclutter_cogl_la_LIBADD = $(top_builddir)/clutter/cogl/common/libclutter-cogl-common.la +libclutter_cogl_la_LIBADD = $(top_builddir)/clutter/cogl/common/libclutter-cogl-common.la .glsl.h : /bin/sh $(top_srcdir)/clutter/cogl/gles/stringify.sh -h $< diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/gles/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/gles/Makefile.in --- clutter-0.8.4/clutter/cogl/gles/Makefile.in 2008-11-28 18:22:47.000000000 +0000 +++ clutter-0.9.0/clutter/cogl/gles/Makefile.in 2009-01-28 16:48:56.000000000 +0000 @@ -56,13 +56,20 @@ am__libclutter_cogl_la_SOURCES_DIST = \ $(top_builddir)/clutter/cogl/cogl.h \ $(top_builddir)/clutter/cogl/cogl-defines-gles.h \ - cogl-internal.h cogl-texture.h cogl-fbo.h cogl-context.h \ - cogl.c cogl-primitives.c cogl-texture.c cogl-fbo.c \ - cogl-context.c cogl-gles2-wrapper.h cogl-program.h \ - cogl-program.c cogl-shader.h cogl-shader.c \ - cogl-gles2-wrapper.c cogl-fixed-vertex-shader.h \ - cogl-fixed-vertex-shader.c cogl-fixed-fragment-shader.h \ - cogl-fixed-fragment-shader.c + $(top_builddir)/clutter/cogl/cogl-color.h \ + $(top_builddir)/clutter/cogl/cogl-deprecated.h \ + $(top_builddir)/clutter/cogl/cogl-fixed.h \ + $(top_builddir)/clutter/cogl/cogl-offscreen.h \ + $(top_builddir)/clutter/cogl/cogl-path.h \ + $(top_builddir)/clutter/cogl/cogl-shader.h \ + $(top_builddir)/clutter/cogl/cogl-texture.h \ + $(top_builddir)/clutter/cogl/cogl-types.h cogl-internal.h \ + cogl-texture-private.h cogl-fbo.h cogl-context.h cogl.c \ + cogl-primitives.c cogl-texture.c cogl-fbo.c cogl-context.c \ + cogl-gles2-wrapper.h cogl-program.h cogl-program.c \ + cogl-shader-private.h cogl-shader.c cogl-gles2-wrapper.c \ + cogl-fixed-vertex-shader.h cogl-fixed-vertex-shader.c \ + cogl-fixed-fragment-shader.h cogl-fixed-fragment-shader.c @USE_GLES2_WRAPPER_TRUE@am__objects_1 = cogl-gles2-wrapper.lo \ @USE_GLES2_WRAPPER_TRUE@ cogl-fixed-vertex-shader.lo \ @USE_GLES2_WRAPPER_TRUE@ cogl-fixed-fragment-shader.lo @@ -146,7 +153,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -171,6 +177,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -263,8 +270,20 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ libclutterincludedir = $(includedir)/clutter-@CLUTTER_API_VERSION@/cogl -libclutterinclude_HEADERS = $(top_builddir)/clutter/cogl/cogl.h \ - $(top_builddir)/clutter/cogl/cogl-defines-gles.h +libclutterinclude_HEADERS = \ + $(top_builddir)/clutter/cogl/cogl.h \ + $(top_builddir)/clutter/cogl/cogl-defines-gles.h \ + $(top_builddir)/clutter/cogl/cogl-color.h \ + $(top_builddir)/clutter/cogl/cogl-deprecated.h \ + $(top_builddir)/clutter/cogl/cogl-fixed.h \ + $(top_builddir)/clutter/cogl/cogl-offscreen.h \ + $(top_builddir)/clutter/cogl/cogl-path.h \ + $(top_builddir)/clutter/cogl/cogl-shader.h \ + $(top_builddir)/clutter/cogl/cogl-texture.h \ + $(top_builddir)/clutter/cogl/cogl-types.h \ + $(top_builddir)/clutter/cogl/cogl-vertex-buffer.h \ + $(top_builddir)/clutter/cogl/cogl-material.h \ + $(top_builddir)/clutter/cogl/cogl-matrix.h INCLUDES = \ -I$(top_srcdir) \ @@ -274,18 +293,29 @@ -I$(top_srcdir)/clutter/cogl/$(CLUTTER_COGL) \ -I$(top_builddir)/clutter \ -I$(top_builddir)/clutter/cogl \ + -DG_LOG_DOMAIN=\"Cogl-GLES\" \ + -DCLUTTER_COMPILATION \ $(CLUTTER_CFLAGS) \ $(CLUTTER_DEBUG_CFLAGS) \ + $(MAINTAINER_CFLAGS) \ $(GCC_FLAGS) LDADD = $(CLUTTER_LIBS) noinst_LTLIBRARIES = libclutter-cogl.la libclutter_cogl_la_SOURCES = $(top_builddir)/clutter/cogl/cogl.h \ $(top_builddir)/clutter/cogl/cogl-defines-gles.h \ - cogl-internal.h cogl-texture.h cogl-fbo.h cogl-context.h \ - cogl.c cogl-primitives.c cogl-texture.c cogl-fbo.c \ - cogl-context.c cogl-gles2-wrapper.h cogl-program.h \ - cogl-program.c cogl-shader.h cogl-shader.c $(am__append_1) + $(top_builddir)/clutter/cogl/cogl-color.h \ + $(top_builddir)/clutter/cogl/cogl-deprecated.h \ + $(top_builddir)/clutter/cogl/cogl-fixed.h \ + $(top_builddir)/clutter/cogl/cogl-offscreen.h \ + $(top_builddir)/clutter/cogl/cogl-path.h \ + $(top_builddir)/clutter/cogl/cogl-shader.h \ + $(top_builddir)/clutter/cogl/cogl-texture.h \ + $(top_builddir)/clutter/cogl/cogl-types.h cogl-internal.h \ + cogl-texture-private.h cogl-fbo.h cogl-context.h cogl.c \ + cogl-primitives.c cogl-texture.c cogl-fbo.c cogl-context.c \ + cogl-gles2-wrapper.h cogl-program.h cogl-program.c \ + cogl-shader-private.h cogl-shader.c $(am__append_1) EXTRA_DIST = cogl-defines.h.in \ stringify.sh \ cogl-fixed-vertex-shader.glsl \ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/cogl/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/clutter/cogl/Makefile.in --- clutter-0.8.4/clutter/cogl/Makefile.in 2008-11-28 18:22:47.000000000 +0000 +++ clutter-0.9.0/clutter/cogl/Makefile.in 2009-01-28 16:48:56.000000000 +0000 @@ -107,7 +107,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -132,6 +131,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/eglnative/clutter-stage-egl.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/eglnative/clutter-stage-egl.c --- clutter-0.8.4/clutter/eglnative/clutter-stage-egl.c 2008-09-29 15:16:24.000000000 +0100 +++ clutter-0.9.0/clutter/eglnative/clutter-stage-egl.c 2009-01-28 08:12:46.000000000 +0000 @@ -199,6 +199,12 @@ CLUTTER_ACTOR_UNSET_FLAGS (actor, CLUTTER_ACTOR_REALIZED); return; } + + /* since we only have one size and it cannot change, we + * just need to update the GL viewport now that we have + * been realized + */ + CLUTTER_SET_PRIVATE_FLAGS (actor, CLUTTER_ACTOR_SYNC_MATRICES); } else { diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/eglnative/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/clutter/eglnative/Makefile.am --- clutter-0.8.4/clutter/eglnative/Makefile.am 2008-09-29 15:16:24.000000000 +0100 +++ clutter-0.9.0/clutter/eglnative/Makefile.am 2009-01-28 08:12:46.000000000 +0000 @@ -3,6 +3,7 @@ INCLUDES = \ -DG_LOG_DOMAIN=\"ClutterEGL\" \ + -DCLUTTER_COMPILATION \ -I$(top_srcdir) \ $(CLUTTER_CFLAGS) \ $(CLUTTER_DEBUG_CFLAGS) \ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/eglnative/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/clutter/eglnative/Makefile.in --- clutter-0.8.4/clutter/eglnative/Makefile.in 2008-11-28 18:22:47.000000000 +0000 +++ clutter-0.9.0/clutter/eglnative/Makefile.in 2009-01-28 16:48:56.000000000 +0000 @@ -125,7 +125,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -150,6 +149,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -245,6 +245,7 @@ libclutterinclude_HEADERS = clutter-egl.h INCLUDES = \ -DG_LOG_DOMAIN=\"ClutterEGL\" \ + -DCLUTTER_COMPILATION \ -I$(top_srcdir) \ $(CLUTTER_CFLAGS) \ $(CLUTTER_DEBUG_CFLAGS) \ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/eglx/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/clutter/eglx/Makefile.am --- clutter-0.8.4/clutter/eglx/Makefile.am 2008-09-29 15:16:24.000000000 +0100 +++ clutter-0.9.0/clutter/eglx/Makefile.am 2009-01-28 08:12:46.000000000 +0000 @@ -3,6 +3,7 @@ INCLUDES = \ -DG_LOG_DOMAIN=\"ClutterEGL\" \ + -DCLUTTER_COMPILATION \ -I$(top_srcdir) \ -I$(top_srcdir)/clutter \ -I$(top_srcdir)/clutter/x11 \ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/eglx/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/clutter/eglx/Makefile.in --- clutter-0.8.4/clutter/eglx/Makefile.in 2008-11-28 18:22:47.000000000 +0000 +++ clutter-0.9.0/clutter/eglx/Makefile.in 2009-01-28 16:48:57.000000000 +0000 @@ -124,7 +124,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -149,6 +148,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -244,6 +244,7 @@ libclutterinclude_HEADERS = clutter-eglx.h INCLUDES = \ -DG_LOG_DOMAIN=\"ClutterEGL\" \ + -DCLUTTER_COMPILATION \ -I$(top_srcdir) \ -I$(top_srcdir)/clutter \ -I$(top_srcdir)/clutter/x11 \ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/fruity/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/clutter/fruity/Makefile.am --- clutter-0.8.4/clutter/fruity/Makefile.am 2008-09-29 15:16:23.000000000 +0100 +++ clutter-0.9.0/clutter/fruity/Makefile.am 2009-01-28 08:12:46.000000000 +0000 @@ -2,6 +2,7 @@ INCLUDES = \ -DG_LOG_DOMAIN=\"ClutterFruity\" \ + -DCLUTTER_COMPILATION \ -I$(top_srcdir) \ -I$(top_srcdir)/clutter \ $(CLUTTER_CFLAGS) \ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/fruity/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/clutter/fruity/Makefile.in --- clutter-0.8.4/clutter/fruity/Makefile.in 2008-11-28 18:22:47.000000000 +0000 +++ clutter-0.9.0/clutter/fruity/Makefile.in 2009-01-28 16:48:57.000000000 +0000 @@ -113,7 +113,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -138,6 +137,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -232,6 +232,7 @@ libclutterincludedir = $(includedir)/clutter-@CLUTTER_MAJORMINOR@/clutter INCLUDES = \ -DG_LOG_DOMAIN=\"ClutterFruity\" \ + -DCLUTTER_COMPILATION \ -I$(top_srcdir) \ -I$(top_srcdir)/clutter \ $(CLUTTER_CFLAGS) \ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/glx/clutter-backend-glx.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/glx/clutter-backend-glx.c --- clutter-0.8.4/clutter/glx/clutter-backend-glx.c 2008-11-04 16:36:16.000000000 +0000 +++ clutter-0.9.0/clutter/glx/clutter-backend-glx.c 2009-01-28 08:12:46.000000000 +0000 @@ -29,6 +29,8 @@ #include #endif +#include + #include #include #include @@ -150,7 +152,7 @@ { "vblank", 0, 0, G_OPTION_ARG_STRING, &clutter_vblank_name, - "VBlank method to be used (none, dri or glx)", "METHOD" + N_("VBlank method to be used (none, dri or glx)"), "METHOD" }, { NULL } }; diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/glx/clutter-glx.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/glx/clutter-glx.h --- clutter-0.8.4/clutter/glx/clutter-glx.h 2008-09-29 15:16:24.000000000 +0100 +++ clutter-0.9.0/clutter/glx/clutter-glx.h 2009-01-28 08:12:46.000000000 +0000 @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include G_BEGIN_DECLS diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/glx/clutter-glx-texture-pixmap.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/glx/clutter-glx-texture-pixmap.c --- clutter-0.8.4/clutter/glx/clutter-glx-texture-pixmap.c 2008-11-13 14:44:32.000000000 +0000 +++ clutter-0.9.0/clutter/glx/clutter-glx-texture-pixmap.c 2009-01-28 08:12:46.000000000 +0000 @@ -40,6 +40,13 @@ * * The class requires the GLX_EXT_texture_from_pixmap OpenGL extension * (http://people.freedesktop.org/~davidr/GLX_EXT_texture_from_pixmap.txt) + * + * The GL_ARB_texture_non_power_of_two extension will be used if it is + * available. Otherwise it will try to use the + * GL_ARB_texture_rectangle extension. If both are available you can + * force it to prefer the rectangle extension by setting the + * CLUTTER_PIXMAP_TEXTURE_RECTANGLE to 'force'. To prevent it ever + * using the rectangle extension you can set it to 'disable'. */ @@ -48,6 +55,8 @@ #include "config.h" #endif +#include + #include "../x11/clutter-x11-texture-pixmap.h" #include "clutter-glx-texture-pixmap.h" #include "clutter-glx.h" @@ -68,12 +77,20 @@ typedef void (*GenerateMipmap) (GLenum target); +typedef enum +{ + CLUTTER_GLX_RECTANGLE_DISALLOW, + CLUTTER_GLX_RECTANGLE_ALLOW, + CLUTTER_GLX_RECTANGLE_FORCE +} RectangleState; static BindTexImage _gl_bind_tex_image = NULL; static ReleaseTexImage _gl_release_tex_image = NULL; static GenerateMipmap _gl_generate_mipmap = NULL; static gboolean _have_tex_from_pixmap_ext = FALSE; static gboolean _ext_check_done = FALSE; +static gboolean _have_tex_rectangle = FALSE; +static RectangleState _rectangle_state = CLUTTER_GLX_RECTANGLE_ALLOW; struct _ClutterGLXTexturePixmapPrivate { @@ -86,6 +103,8 @@ gboolean bound; gint can_mipmap; gint mipmap_generate_queued; + + gboolean using_rectangle; }; static void @@ -170,7 +189,9 @@ if (_ext_check_done == FALSE) { + const char *gl_extensions = NULL; const gchar *glx_extensions = NULL; + const char *rect_env; glx_extensions = glXQueryExtensionsString (clutter_x11_get_default_display (), @@ -191,16 +212,59 @@ _gl_generate_mipmap = (GenerateMipmap)cogl_get_proc_address ("glGenerateMipmapEXT"); + gl_extensions = (char *) glGetString (GL_EXTENSIONS); + _have_tex_rectangle = cogl_check_extension ("GL_ARB_texture_rectangle", + gl_extensions); + + if ((rect_env = g_getenv ("CLUTTER_PIXMAP_TEXTURE_RECTANGLE"))) + { + if (strcasecmp (rect_env, "force") == 0) + _rectangle_state = CLUTTER_GLX_RECTANGLE_FORCE; + else if (strcasecmp (rect_env, "disable") == 0) + _rectangle_state = CLUTTER_GLX_RECTANGLE_DISALLOW; + else if (rect_env[0]) + g_warning ("Unknown value for CLUTTER_PIXMAP_TEXTURE_RECTANGLE, " + "should be 'force' or 'disable'"); + } + _ext_check_done = TRUE; } } static void +clutter_glx_texture_pixmap_free_rectangle (ClutterGLXTexturePixmap *texture) +{ + ClutterGLXTexturePixmapPrivate *priv = texture->priv; + CoglHandle cogl_tex; + + /* Cogl won't free the GL texture resource if it was created with + new_from_foreign so we need to free it manually */ + if (priv->using_rectangle) + { + cogl_tex = clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (texture)); + + if (cogl_tex != COGL_INVALID_HANDLE) + { + GLuint gl_handle; + GLenum gl_target; + + cogl_texture_get_gl_texture (cogl_tex, &gl_handle, &gl_target); + + if (gl_target == CGL_TEXTURE_RECTANGLE_ARB) + glDeleteTextures (1, &gl_handle); + } + + priv->using_rectangle = FALSE; + } +} + +static void clutter_glx_texture_pixmap_dispose (GObject *object) { - ClutterGLXTexturePixmapPrivate *priv; + ClutterGLXTexturePixmap *texture = CLUTTER_GLX_TEXTURE_PIXMAP (object); + ClutterGLXTexturePixmapPrivate *priv = texture->priv; - priv = CLUTTER_GLX_TEXTURE_PIXMAP (object)->priv; + clutter_glx_texture_pixmap_free_rectangle (texture); if (priv->glx_pixmap != None) { @@ -229,19 +293,85 @@ } static gboolean +should_use_rectangle (void) +{ + /* Use the rectangle only if it is available and either: + + the CLUTTER_PIXMAP_TEXTURE_RECTANGLE environment variable is + set to 'force' + + *or* + + the env var is set to 'allow' (which is the default) and NPOTs + textures are not available */ + return _have_tex_rectangle + && ((_rectangle_state == CLUTTER_GLX_RECTANGLE_ALLOW + && !clutter_feature_available (CLUTTER_FEATURE_TEXTURE_NPOT)) + || _rectangle_state == CLUTTER_GLX_RECTANGLE_FORCE); +} + +static gboolean create_cogl_texture (ClutterTexture *texture, guint width, guint height) { - CoglHandle handle; + ClutterGLXTexturePixmap *texture_glx = CLUTTER_GLX_TEXTURE_PIXMAP (texture); + ClutterGLXTexturePixmapPrivate *priv = texture_glx->priv; + CoglHandle handle; + gboolean using_rectangle; + GLint gl_format; + CoglPixelFormat cogl_format = COGL_PIXEL_FORMAT_RGBA_8888; + guint depth; + + g_object_get (G_OBJECT (texture_glx), "pixmap-depth", &depth, NULL); + if (depth == 32) + { + gl_format = GL_RGBA; + cogl_format = COGL_PIXEL_FORMAT_RGBA_8888; + } + else if (depth == 24) + { + gl_format = GL_RGB; + cogl_format = COGL_PIXEL_FORMAT_RGB_888; + } + else + g_critical ("Can't create a TFP cogl texture for pixmap with depth < 24"); - handle - = cogl_texture_new_with_size (width, height, - -1, FALSE, - COGL_PIXEL_FORMAT_RGBA_8888|COGL_BGR_BIT); + /* We want to use the GL_ARB_texture_rectangle extension on some + chipsets because GL_ARB_texture_non_power_of_two is not always + supported or might be buggy */ + if (should_use_rectangle ()) + { + GLuint tex = 0; + + using_rectangle = TRUE; + + glGenTextures (1, &tex); + glBindTexture (CGL_TEXTURE_RECTANGLE_ARB, tex); + glTexImage2D (CGL_TEXTURE_RECTANGLE_ARB, 0, + GL_RGB, width, height, + 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); + + handle = cogl_texture_new_from_foreign (tex, CGL_TEXTURE_RECTANGLE_ARB, + width, height, + 0, 0, + cogl_format | COGL_BGR_BIT); + } + else + { + handle + = cogl_texture_new_with_size (width, height, + -1, FALSE, + cogl_format | COGL_BGR_BIT); + + using_rectangle = FALSE; + } if (handle) { + clutter_glx_texture_pixmap_free_rectangle (texture_glx); + priv->using_rectangle = using_rectangle; + clutter_texture_set_cogl_texture (texture, handle); CLUTTER_ACTOR_SET_FLAGS (texture, CLUTTER_ACTOR_REALIZED); @@ -301,12 +431,14 @@ static void clutter_glx_texture_pixmap_unrealize (ClutterActor *actor) { - ClutterGLXTexturePixmapPrivate *priv; + ClutterGLXTexturePixmap *texture = CLUTTER_GLX_TEXTURE_PIXMAP (actor); + ClutterGLXTexturePixmapPrivate *priv = texture->priv; Display *dpy; - priv = CLUTTER_GLX_TEXTURE_PIXMAP (actor)->priv; dpy = clutter_x11_get_default_display(); + clutter_glx_texture_pixmap_free_rectangle (texture); + if (!_have_tex_from_pixmap_ext) { CLUTTER_ACTOR_CLASS (clutter_glx_texture_pixmap_parent_class)-> @@ -524,8 +656,7 @@ dpy = clutter_x11_get_default_display (); - if (priv->use_fallback == TRUE - || !clutter_glx_texture_pixmap_using_extension (texture)) + if (!clutter_glx_texture_pixmap_using_extension (texture)) goto cleanup; priv->use_fallback = FALSE; @@ -576,10 +707,18 @@ attribs[i++] = GLX_TEXTURE_TARGET_EXT; - attribs[i++] = GLX_TEXTURE_2D_EXT; + attribs[i++] = (should_use_rectangle () + ? GLX_TEXTURE_RECTANGLE_EXT : GLX_TEXTURE_2D_EXT); attribs[i++] = None; + /* Note: some drivers (e.g. Nvidia) get upset if you effectivly create a glx + * pixmap for the same server side object, even though you might have unique + * client side names, we currently avoid hitting this problem by destroying + * the current glx pixmap first */ + if (priv->glx_pixmap) + clutter_glx_texture_pixmap_free_glx_pixmap (texture); + clutter_x11_trap_x_errors (); glx_pixmap = glXCreatePixmap (dpy, *fbconfig, @@ -638,13 +777,12 @@ gint width, gint height) { - ClutterGLXTexturePixmapPrivate *priv; + ClutterGLXTexturePixmap *texture_glx = CLUTTER_GLX_TEXTURE_PIXMAP (texture); + ClutterGLXTexturePixmapPrivate *priv = texture_glx->priv; Display *dpy; - CLUTTER_NOTE (TEXTURE, "Updating texture pixmap"); - priv = CLUTTER_GLX_TEXTURE_PIXMAP (texture)->priv; dpy = clutter_x11_get_default_display(); if (!CLUTTER_ACTOR_IS_REALIZED (texture)) @@ -653,6 +791,9 @@ if (priv->use_fallback) { CLUTTER_NOTE (TEXTURE, "Falling back to X11"); + + clutter_glx_texture_pixmap_free_rectangle (texture_glx); + parent_class->update_area (texture, x, y, width, height); @@ -744,7 +885,7 @@ priv = CLUTTER_GLX_TEXTURE_PIXMAP (texture)->priv; - return (_have_tex_from_pixmap_ext); + return (_have_tex_from_pixmap_ext && !priv->use_fallback); /* Assume NPOT TFP's are supported even if regular NPOT isn't advertised * but tfp is. Seemingly some Intel drivers do this ? */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/glx/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/clutter/glx/Makefile.am --- clutter-0.8.4/clutter/glx/Makefile.am 2008-09-29 15:16:24.000000000 +0100 +++ clutter-0.9.0/clutter/glx/Makefile.am 2009-01-28 08:12:46.000000000 +0000 @@ -7,6 +7,7 @@ -I$(top_srcdir)/clutter \ -I$(top_srcdir)/clutter/x11 \ -I$(top_builddir)/clutter \ + -DCLUTTER_COMPILATION \ $(CLUTTER_CFLAGS) \ $(CLUTTER_DEBUG_CFLAGS) \ $(GCC_FLAGS) diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/glx/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/clutter/glx/Makefile.in --- clutter-0.8.4/clutter/glx/Makefile.in 2008-11-28 18:22:48.000000000 +0000 +++ clutter-0.9.0/clutter/glx/Makefile.in 2009-01-28 16:48:57.000000000 +0000 @@ -124,7 +124,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -149,6 +148,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -248,6 +248,7 @@ -I$(top_srcdir)/clutter \ -I$(top_srcdir)/clutter/x11 \ -I$(top_builddir)/clutter \ + -DCLUTTER_COMPILATION \ $(CLUTTER_CFLAGS) \ $(CLUTTER_DEBUG_CFLAGS) \ $(GCC_FLAGS) diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/json/json-parser.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/json/json-parser.c --- clutter-0.8.4/clutter/json/json-parser.c 2008-11-28 16:29:51.000000000 +0000 +++ clutter-0.9.0/clutter/json/json-parser.c 2009-01-28 08:12:46.000000000 +0000 @@ -51,9 +51,6 @@ GScanner *scanner; GError *last_error; - - guint is_filename : 1; - gchar *filename; }; static const GScannerConfig json_scanner_config = @@ -159,16 +156,6 @@ } static void -json_parser_finalize (GObject *gobject) -{ - JsonParserPrivate *priv = JSON_PARSER_GET_PRIVATE (gobject); - - g_free (priv->filename); - - G_OBJECT_CLASS (json_parser_parent_class)->finalize (gobject); -} - -static void json_parser_class_init (JsonParserClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); @@ -176,7 +163,6 @@ g_type_class_add_private (klass, sizeof (JsonParserPrivate)); gobject_class->dispose = json_parser_dispose; - gobject_class->finalize = json_parser_finalize; /** * JsonParser::parse-start: @@ -340,9 +326,6 @@ priv->root = NULL; priv->current_node = NULL; - - priv->is_filename = FALSE; - priv->filename = NULL; } static guint @@ -799,7 +782,6 @@ gboolean is_error) { JsonParser *parser = scanner->user_data; - JsonParserPrivate *priv = parser->priv; if (is_error) { @@ -807,8 +789,7 @@ g_set_error (&error, JSON_PARSER_ERROR, JSON_PARSER_ERROR_PARSE, - "%s:%d: Parse error: %s", - priv->is_filename ? priv->filename : "", + "Parse error on line %d: %s", scanner->line, message); @@ -816,10 +797,7 @@ g_signal_emit (parser, parser_signals[ERROR], 0, error); } else - g_warning ("%s:%d: Parse error: %s", - priv->is_filename ? priv->filename : "", - scanner->line, - message); + g_warning ("Line %d: %s", scanner->line, message); } static GScanner * @@ -850,22 +828,84 @@ return g_object_new (JSON_TYPE_PARSER, NULL); } -static gboolean -json_parser_load (JsonParser *parser, - const gchar *data, - gsize length, - GError **error) +/** + * json_parser_load_from_file: + * @parser: a #JsonParser + * @filename: the path for the file to parse + * @error: return location for a #GError, or %NULL + * + * Loads a JSON stream from the content of @filename and parses it. See + * json_parser_load_from_data(). + * + * Return value: %TRUE if the file was successfully loaded and parsed. + * In case of error, @error is set accordingly and %FALSE is returned + */ +gboolean +json_parser_load_from_file (JsonParser *parser, + const gchar *filename, + GError **error) +{ + GError *internal_error; + gchar *data; + gsize length; + gboolean retval = TRUE; + + g_return_val_if_fail (JSON_IS_PARSER (parser), FALSE); + g_return_val_if_fail (filename != NULL, FALSE); + + internal_error = NULL; + if (!g_file_get_contents (filename, &data, &length, &internal_error)) + { + g_propagate_error (error, internal_error); + return FALSE; + } + + if (!json_parser_load_from_data (parser, data, length, &internal_error)) + { + g_propagate_error (error, internal_error); + retval = FALSE; + } + + g_free (data); + + return retval; +} + +/** + * json_parser_load_from_data: + * @parser: a #JsonParser + * @data: the buffer to parse + * @length: the length of the buffer, or -1 + * @error: return location for a #GError, or %NULL + * + * Loads a JSON stream from a buffer and parses it. You can call this function + * multiple times with the same #JsonParser object, but the contents of the + * parser will be destroyed each time. + * + * Return value: %TRUE if the buffer was succesfully parser. In case + * of error, @error is set accordingly and %FALSE is returned + */ +gboolean +json_parser_load_from_data (JsonParser *parser, + const gchar *data, + gssize length, + GError **error) { - JsonParserPrivate *priv = parser->priv; GScanner *scanner; gboolean done; gboolean retval = TRUE; gint i; - if (priv->root) + g_return_val_if_fail (JSON_IS_PARSER (parser), FALSE); + g_return_val_if_fail (data != NULL, FALSE); + + if (length < 0) + length = strlen (data); + + if (parser->priv->root) { - json_node_free (priv->root); - priv->root = NULL; + json_node_free (parser->priv->root); + parser->priv->root = NULL; } scanner = json_scanner_new (parser); @@ -931,12 +971,21 @@ symbol_name, msg, TRUE); - if (priv->last_error) + if (parser->priv->last_error) { - g_propagate_error (error, priv->last_error); - priv->last_error = NULL; + g_propagate_error (error, parser->priv->last_error); + parser->priv->last_error = NULL; } - +#if 0 + /* we set a generic error here; the message from + * GScanner is relayed in the ::error signal + */ + g_set_error (error, JSON_PARSER_ERROR, + JSON_PARSER_ERROR_PARSE, + "Invalid token `%s' found: expecting %s", + symbol_name ? symbol_name : "???", + msg ? msg : "unknown"); +#endif retval = FALSE; g_free (msg); @@ -946,8 +995,8 @@ } g_scanner_destroy (scanner); - priv->scanner = NULL; - priv->current_node = NULL; + parser->priv->scanner = NULL; + parser->priv->current_node = NULL; g_signal_emit (parser, parser_signals[PARSE_END], 0); @@ -955,102 +1004,6 @@ } /** - * json_parser_load_from_file: - * @parser: a #JsonParser - * @filename: the path for the file to parse - * @error: return location for a #GError, or %NULL - * - * Loads a JSON stream from the content of @filename and parses it. See - * json_parser_load_from_data(). - * - * Return value: %TRUE if the file was successfully loaded and parsed. - * In case of error, @error is set accordingly and %FALSE is returned - */ -gboolean -json_parser_load_from_file (JsonParser *parser, - const gchar *filename, - GError **error) -{ - JsonParserPrivate *priv; - GError *internal_error; - gchar *data; - gsize length; - gboolean retval = TRUE; - - g_return_val_if_fail (JSON_IS_PARSER (parser), FALSE); - g_return_val_if_fail (filename != NULL, FALSE); - - priv = parser->priv; - - g_free (priv->filename); - - internal_error = NULL; - if (!g_file_get_contents (filename, &data, &length, &internal_error)) - { - g_propagate_error (error, internal_error); - return FALSE; - } - - priv->is_filename = TRUE; - priv->filename = g_strdup (filename); - - if (!json_parser_load (parser, data, length, &internal_error)) - { - g_propagate_error (error, internal_error); - retval = FALSE; - } - - g_free (data); - - return retval; -} - -/** - * json_parser_load_from_data: - * @parser: a #JsonParser - * @data: the buffer to parse - * @length: the length of the buffer, or -1 - * @error: return location for a #GError, or %NULL - * - * Loads a JSON stream from a buffer and parses it. You can call this function - * multiple times with the same #JsonParser object, but the contents of the - * parser will be destroyed each time. - * - * Return value: %TRUE if the buffer was succesfully parser. In case - * of error, @error is set accordingly and %FALSE is returned - */ -gboolean -json_parser_load_from_data (JsonParser *parser, - const gchar *data, - gssize length, - GError **error) -{ - JsonParserPrivate *priv; - gboolean retval = TRUE; - GError *internal_error; - - g_return_val_if_fail (JSON_IS_PARSER (parser), FALSE); - g_return_val_if_fail (data != NULL, FALSE); - - priv = parser->priv; - - if (length < 0) - length = strlen (data); - - priv->is_filename = FALSE; - g_free (priv->filename); - - internal_error = NULL; - if (!json_parser_load (parser, data, length, &internal_error)) - { - g_propagate_error (error, internal_error); - retval = FALSE; - } - - return retval; -} - -/** * json_parser_get_root: * @parser: a #JsonParser * diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/json/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/clutter/json/Makefile.in --- clutter-0.8.4/clutter/json/Makefile.in 2008-11-28 18:22:48.000000000 +0000 +++ clutter-0.9.0/clutter/json/Makefile.in 2009-01-28 16:48:57.000000000 +0000 @@ -126,7 +126,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -151,6 +150,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/clutter/Makefile.am --- clutter-0.8.4/clutter/Makefile.am 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/clutter/Makefile.am 2009-01-28 16:45:24.000000000 +0000 @@ -32,6 +32,7 @@ $(GCC_FLAGS) \ $(CLUTTER_CFLAGS) \ $(CLUTTER_DEBUG_CFLAGS) \ + $(MAINTAINER_CFLAGS) \ $(NULL) LDADD = \ @@ -47,41 +48,45 @@ source_h = \ $(srcdir)/clutter-actor.h \ $(srcdir)/clutter-alpha.h \ + $(srcdir)/clutter-animatable.h \ + $(srcdir)/clutter-animation.h \ $(srcdir)/clutter-backend.h \ $(srcdir)/clutter-behaviour.h \ - $(srcdir)/clutter-behaviour-bspline.h \ $(srcdir)/clutter-behaviour-depth.h \ $(srcdir)/clutter-behaviour-ellipse.h \ $(srcdir)/clutter-behaviour-opacity.h \ $(srcdir)/clutter-behaviour-path.h \ $(srcdir)/clutter-behaviour-rotate.h \ $(srcdir)/clutter-behaviour-scale.h \ + $(srcdir)/clutter-binding-pool.h \ + $(srcdir)/clutter-cairo-texture.h \ $(srcdir)/clutter-child-meta.h \ - $(srcdir)/clutter-clone-texture.h \ + $(srcdir)/clutter-clone.h \ $(srcdir)/clutter-color.h \ $(srcdir)/clutter-container.h \ $(srcdir)/clutter-deprecated.h \ - $(srcdir)/clutter-effect.h \ - $(srcdir)/clutter-entry.h \ $(srcdir)/clutter-event.h \ $(srcdir)/clutter-feature.h \ $(srcdir)/clutter-fixed.h \ $(srcdir)/clutter-frame-source.h \ $(srcdir)/clutter-group.h \ + $(srcdir)/clutter-interval.h \ $(srcdir)/clutter-keysyms.h \ - $(srcdir)/clutter-label.h \ $(srcdir)/clutter-list-model.h \ $(srcdir)/clutter-main.h \ $(srcdir)/clutter-media.h \ $(srcdir)/clutter-model.h \ + $(srcdir)/clutter-path.h \ $(srcdir)/clutter-rectangle.h \ $(srcdir)/clutter-score.h \ $(srcdir)/clutter-script.h \ $(srcdir)/clutter-scriptable.h \ $(srcdir)/clutter-shader.h \ + $(srcdir)/clutter-shader-types.h \ $(srcdir)/clutter-stage.h \ $(srcdir)/clutter-stage-manager.h \ $(srcdir)/clutter-texture.h \ + $(srcdir)/clutter-text.h \ $(srcdir)/clutter-timeline.h \ $(srcdir)/clutter-timeout-pool.h \ $(srcdir)/clutter-types.h \ @@ -133,21 +138,23 @@ source_c = \ clutter-actor.c \ clutter-alpha.c \ + clutter-animatable.c \ + clutter-animation.c \ clutter-backend.c \ clutter-behaviour.c \ - clutter-behaviour-bspline.c \ clutter-behaviour-depth.c \ clutter-behaviour-ellipse.c \ clutter-behaviour-opacity.c \ clutter-behaviour-path.c \ clutter-behaviour-rotate.c \ clutter-behaviour-scale.c \ + clutter-bezier.c \ + clutter-binding-pool.c \ + clutter-cairo-texture.c \ clutter-child-meta.c \ - clutter-clone-texture.c \ + clutter-clone.c \ clutter-color.c \ clutter-container.c \ - clutter-effect.c \ - clutter-entry.c \ clutter-enum-types.c \ clutter-event.c \ clutter-feature.c \ @@ -155,22 +162,25 @@ clutter-frame-source.c \ clutter-group.c \ clutter-id-pool.c \ - clutter-label.c \ + clutter-interval.c \ clutter-list-model.c \ clutter-main.c \ clutter-marshal.c \ clutter-media.c \ clutter-model.c \ + clutter-path.c \ clutter-rectangle.c \ clutter-score.c \ clutter-script.c \ clutter-script-parser.c \ clutter-scriptable.c \ clutter-shader.c \ + clutter-shader-types.c \ clutter-stage.c \ clutter-stage-manager.c \ clutter-stage-window.c \ clutter-texture.c \ + clutter-text.c \ clutter-timeline.c \ clutter-timeout-pool.c \ clutter-units.c \ @@ -178,6 +188,7 @@ $(NULL) source_h_priv = \ + clutter-bezier.h \ clutter-debug.h \ clutter-keysyms-table.h \ clutter-model-private.h \ @@ -189,14 +200,14 @@ libclutter_@CLUTTER_FLAVOUR@_@CLUTTER_API_VERSION@_la_LIBADD = \ $(CLUTTER_LIBS) \ - $(top_builddir)/clutter/pango/libpangoclutter.la \ + $(top_builddir)/clutter/pango/libcoglpango.la \ $(top_builddir)/clutter/$(CLUTTER_FLAVOUR)/libclutter-$(CLUTTER_FLAVOUR).la \ $(top_builddir)/clutter/cogl/$(CLUTTER_COGL)/libclutter-cogl.la \ $(clutter_json_libadd) \ $(backendextralib) libclutter_@CLUTTER_FLAVOUR@_@CLUTTER_API_VERSION@_la_DEPENDENCIES = \ - pango/libpangoclutter.la \ + pango/libcoglpango.la \ $(CLUTTER_FLAVOUR)/libclutter-$(CLUTTER_FLAVOUR).la \ cogl/$(CLUTTER_COGL)/libclutter-cogl.la \ $(clutter_json_dep) \ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/clutter/Makefile.in --- clutter-0.8.4/clutter/Makefile.in 2008-11-28 18:22:47.000000000 +0000 +++ clutter-0.9.0/clutter/Makefile.in 2009-01-28 16:48:56.000000000 +0000 @@ -56,23 +56,26 @@ LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = am__objects_1 = -am__objects_2 = clutter-actor.lo clutter-alpha.lo clutter-backend.lo \ - clutter-behaviour.lo clutter-behaviour-bspline.lo \ - clutter-behaviour-depth.lo clutter-behaviour-ellipse.lo \ - clutter-behaviour-opacity.lo clutter-behaviour-path.lo \ - clutter-behaviour-rotate.lo clutter-behaviour-scale.lo \ - clutter-child-meta.lo clutter-clone-texture.lo \ - clutter-color.lo clutter-container.lo clutter-effect.lo \ - clutter-entry.lo clutter-enum-types.lo clutter-event.lo \ +am__objects_2 = clutter-actor.lo clutter-alpha.lo \ + clutter-animatable.lo clutter-animation.lo clutter-backend.lo \ + clutter-behaviour.lo clutter-behaviour-depth.lo \ + clutter-behaviour-ellipse.lo clutter-behaviour-opacity.lo \ + clutter-behaviour-path.lo clutter-behaviour-rotate.lo \ + clutter-behaviour-scale.lo clutter-bezier.lo \ + clutter-binding-pool.lo clutter-cairo-texture.lo \ + clutter-child-meta.lo clutter-clone.lo clutter-color.lo \ + clutter-container.lo clutter-enum-types.lo clutter-event.lo \ clutter-feature.lo clutter-fixed.lo clutter-frame-source.lo \ - clutter-group.lo clutter-id-pool.lo clutter-label.lo \ + clutter-group.lo clutter-id-pool.lo clutter-interval.lo \ clutter-list-model.lo clutter-main.lo clutter-marshal.lo \ - clutter-media.lo clutter-model.lo clutter-rectangle.lo \ - clutter-score.lo clutter-script.lo clutter-script-parser.lo \ - clutter-scriptable.lo clutter-shader.lo clutter-stage.lo \ + clutter-media.lo clutter-model.lo clutter-path.lo \ + clutter-rectangle.lo clutter-score.lo clutter-script.lo \ + clutter-script-parser.lo clutter-scriptable.lo \ + clutter-shader.lo clutter-shader-types.lo clutter-stage.lo \ clutter-stage-manager.lo clutter-stage-window.lo \ - clutter-texture.lo clutter-timeline.lo clutter-timeout-pool.lo \ - clutter-units.lo clutter-util.lo $(am__objects_1) + clutter-texture.lo clutter-text.lo clutter-timeline.lo \ + clutter-timeout-pool.lo clutter-units.lo clutter-util.lo \ + $(am__objects_1) am__objects_3 = $(am__objects_1) am_libclutter_@CLUTTER_FLAVOUR@_@CLUTTER_API_VERSION@_la_OBJECTS = \ $(am__objects_2) $(am__objects_3) $(am__objects_3) @@ -160,7 +163,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -185,6 +187,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -301,6 +304,7 @@ $(GCC_FLAGS) \ $(CLUTTER_CFLAGS) \ $(CLUTTER_DEBUG_CFLAGS) \ + $(MAINTAINER_CFLAGS) \ $(NULL) LDADD = \ @@ -316,41 +320,45 @@ source_h = \ $(srcdir)/clutter-actor.h \ $(srcdir)/clutter-alpha.h \ + $(srcdir)/clutter-animatable.h \ + $(srcdir)/clutter-animation.h \ $(srcdir)/clutter-backend.h \ $(srcdir)/clutter-behaviour.h \ - $(srcdir)/clutter-behaviour-bspline.h \ $(srcdir)/clutter-behaviour-depth.h \ $(srcdir)/clutter-behaviour-ellipse.h \ $(srcdir)/clutter-behaviour-opacity.h \ $(srcdir)/clutter-behaviour-path.h \ $(srcdir)/clutter-behaviour-rotate.h \ $(srcdir)/clutter-behaviour-scale.h \ + $(srcdir)/clutter-binding-pool.h \ + $(srcdir)/clutter-cairo-texture.h \ $(srcdir)/clutter-child-meta.h \ - $(srcdir)/clutter-clone-texture.h \ + $(srcdir)/clutter-clone.h \ $(srcdir)/clutter-color.h \ $(srcdir)/clutter-container.h \ $(srcdir)/clutter-deprecated.h \ - $(srcdir)/clutter-effect.h \ - $(srcdir)/clutter-entry.h \ $(srcdir)/clutter-event.h \ $(srcdir)/clutter-feature.h \ $(srcdir)/clutter-fixed.h \ $(srcdir)/clutter-frame-source.h \ $(srcdir)/clutter-group.h \ + $(srcdir)/clutter-interval.h \ $(srcdir)/clutter-keysyms.h \ - $(srcdir)/clutter-label.h \ $(srcdir)/clutter-list-model.h \ $(srcdir)/clutter-main.h \ $(srcdir)/clutter-media.h \ $(srcdir)/clutter-model.h \ + $(srcdir)/clutter-path.h \ $(srcdir)/clutter-rectangle.h \ $(srcdir)/clutter-score.h \ $(srcdir)/clutter-script.h \ $(srcdir)/clutter-scriptable.h \ $(srcdir)/clutter-shader.h \ + $(srcdir)/clutter-shader-types.h \ $(srcdir)/clutter-stage.h \ $(srcdir)/clutter-stage-manager.h \ $(srcdir)/clutter-texture.h \ + $(srcdir)/clutter-text.h \ $(srcdir)/clutter-timeline.h \ $(srcdir)/clutter-timeout-pool.h \ $(srcdir)/clutter-types.h \ @@ -365,21 +373,23 @@ source_c = \ clutter-actor.c \ clutter-alpha.c \ + clutter-animatable.c \ + clutter-animation.c \ clutter-backend.c \ clutter-behaviour.c \ - clutter-behaviour-bspline.c \ clutter-behaviour-depth.c \ clutter-behaviour-ellipse.c \ clutter-behaviour-opacity.c \ clutter-behaviour-path.c \ clutter-behaviour-rotate.c \ clutter-behaviour-scale.c \ + clutter-bezier.c \ + clutter-binding-pool.c \ + clutter-cairo-texture.c \ clutter-child-meta.c \ - clutter-clone-texture.c \ + clutter-clone.c \ clutter-color.c \ clutter-container.c \ - clutter-effect.c \ - clutter-entry.c \ clutter-enum-types.c \ clutter-event.c \ clutter-feature.c \ @@ -387,22 +397,25 @@ clutter-frame-source.c \ clutter-group.c \ clutter-id-pool.c \ - clutter-label.c \ + clutter-interval.c \ clutter-list-model.c \ clutter-main.c \ clutter-marshal.c \ clutter-media.c \ clutter-model.c \ + clutter-path.c \ clutter-rectangle.c \ clutter-score.c \ clutter-script.c \ clutter-script-parser.c \ clutter-scriptable.c \ clutter-shader.c \ + clutter-shader-types.c \ clutter-stage.c \ clutter-stage-manager.c \ clutter-stage-window.c \ clutter-texture.c \ + clutter-text.c \ clutter-timeline.c \ clutter-timeout-pool.c \ clutter-units.c \ @@ -410,6 +423,7 @@ $(NULL) source_h_priv = \ + clutter-bezier.h \ clutter-debug.h \ clutter-keysyms-table.h \ clutter-model-private.h \ @@ -421,14 +435,14 @@ libclutter_@CLUTTER_FLAVOUR@_@CLUTTER_API_VERSION@_la_LIBADD = \ $(CLUTTER_LIBS) \ - $(top_builddir)/clutter/pango/libpangoclutter.la \ + $(top_builddir)/clutter/pango/libcoglpango.la \ $(top_builddir)/clutter/$(CLUTTER_FLAVOUR)/libclutter-$(CLUTTER_FLAVOUR).la \ $(top_builddir)/clutter/cogl/$(CLUTTER_COGL)/libclutter-cogl.la \ $(clutter_json_libadd) \ $(backendextralib) libclutter_@CLUTTER_FLAVOUR@_@CLUTTER_API_VERSION@_la_DEPENDENCIES = \ - pango/libpangoclutter.la \ + pango/libcoglpango.la \ $(CLUTTER_FLAVOUR)/libclutter-$(CLUTTER_FLAVOUR).la \ cogl/$(CLUTTER_COGL)/libclutter-cogl.la \ $(clutter_json_dep) \ @@ -539,8 +553,9 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-actor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-alpha.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-animatable.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-animation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-backend.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-behaviour-bspline.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-behaviour-depth.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-behaviour-ellipse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-behaviour-opacity.Plo@am__quote@ @@ -548,12 +563,13 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-behaviour-rotate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-behaviour-scale.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-behaviour.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-bezier.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-binding-pool.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-cairo-texture.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-child-meta.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-clone-texture.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-clone.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-color.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-container.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-effect.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-entry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-enum-types.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-event.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-feature.Plo@am__quote@ @@ -561,21 +577,24 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-frame-source.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-group.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-id-pool.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-label.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-interval.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-list-model.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-main.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-marshal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-media.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-model.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-path.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-rectangle.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-score.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-script-parser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-script.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-scriptable.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-shader-types.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-shader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-stage-manager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-stage-window.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-stage.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-texture.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-timeline.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clutter-timeout-pool.Plo@am__quote@ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/osx/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/clutter/osx/Makefile.am --- clutter-0.8.4/clutter/osx/Makefile.am 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/osx/Makefile.am 2009-01-28 08:12:46.000000000 +0000 @@ -3,6 +3,7 @@ INCLUDES = \ -DG_LOG_DOMAIN=\"ClutterOSX\" \ + -DCLUTTER_COMPILATION \ -I$(top_srcdir) \ -I$(top_srcdir)/clutter \ -I$(top_builddir)/clutter \ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/osx/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/clutter/osx/Makefile.in --- clutter-0.8.4/clutter/osx/Makefile.in 2008-11-28 18:22:48.000000000 +0000 +++ clutter-0.9.0/clutter/osx/Makefile.in 2009-01-28 16:48:57.000000000 +0000 @@ -124,7 +124,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -149,6 +148,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -244,6 +244,7 @@ libclutterinclude_HEADERS = clutter-osx.h INCLUDES = \ -DG_LOG_DOMAIN=\"ClutterOSX\" \ + -DCLUTTER_COMPILATION \ -I$(top_srcdir) \ -I$(top_srcdir)/clutter \ -I$(top_builddir)/clutter \ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/pango/cogl-pango-fontmap.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/pango/cogl-pango-fontmap.c --- clutter-0.8.4/clutter/pango/cogl-pango-fontmap.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/pango/cogl-pango-fontmap.c 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,209 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Authored By Matthew Allum + * + * 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 . + */ + +/** + * SECTION:cogl-pango + * @short_description: COGL-based text rendering using Pango + * + * FIXME + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +/* This is needed to get the Pango headers to export stuff needed to + subclass */ +#ifndef PANGO_ENABLE_BACKEND +#define PANGO_ENABLE_BACKEND 1 +#endif + +#include +#include +#include + +#include "cogl-pango.h" +#include "cogl-pango-private.h" + +static GQuark cogl_pango_font_map_get_renderer_key (void) G_GNUC_CONST; + +/** + * cogl_pango_font_map_new: + * + * Creates a new font map. + * + * Return value: the newly created #PangoFontMap + * + * Since: 1.0 + */ +PangoFontMap * +cogl_pango_font_map_new (void) +{ + return pango_cairo_font_map_new (); +} + +/** + * cogl_pango_font_map_create_context: + * @fm: a #CoglPangoFontMap + * + * Creates a new #PangoContext from the passed font map. + * + * Return value: the newly created #PangoContext + * + * Since: 1.0 + */ +PangoContext * +cogl_pango_font_map_create_context (CoglPangoFontMap *fm) +{ + g_return_val_if_fail (COGL_PANGO_IS_FONT_MAP (fm), NULL); + + /* We can just directly use the pango context from the Cairo font + map */ + return pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fm)); +} + +/** + * cogl_pango_font_map_get_renderer: + * @fm: a #CoglPangoFontMap + * + * Retrieves the #CoglPangoRenderer for the passed font map. + * + * Return value: a #PangoRenderer + * + * Since: 1.0 + */ +PangoRenderer * +cogl_pango_font_map_get_renderer (CoglPangoFontMap *fm) +{ + PangoRenderer *renderer; + + g_return_val_if_fail (COGL_PANGO_IS_FONT_MAP (fm), NULL); + + /* We want to keep a cached pointer to the renderer from the font + map instance but as we don't have a proper subclass we have to + store it in the object data instead */ + + renderer = g_object_get_qdata (G_OBJECT (fm), + cogl_pango_font_map_get_renderer_key ()); + + if (G_UNLIKELY (renderer == NULL)) + { + renderer = g_object_new (COGL_PANGO_TYPE_RENDERER, NULL); + g_object_set_qdata_full (G_OBJECT (fm), + cogl_pango_font_map_get_renderer_key (), + renderer, + g_object_unref); + } + + return renderer; +} + +/** + * cogl_pango_font_map_set_resolution: + * @font_map: a #CoglPangoFontMap + * @dpi: DPI to set + * + * Sets the resolution to be used by @font_map at @dpi. + * + * Since: 1.0 + */ +void +cogl_pango_font_map_set_resolution (CoglPangoFontMap *font_map, + double dpi) +{ + g_return_if_fail (COGL_PANGO_IS_FONT_MAP (font_map)); + + pango_cairo_font_map_set_resolution (PANGO_CAIRO_FONT_MAP (font_map), dpi); +} + +/** + * cogl_pango_font_map_clear_glyph_cache: + * @fm: a #CoglPangoFontMap + * + * Clears the glyph cache for @fm. + * + * Since: 1.0 + */ +void +cogl_pango_font_map_clear_glyph_cache (CoglPangoFontMap *fm) +{ + PangoRenderer *renderer; + + renderer = cogl_pango_font_map_get_renderer (fm); + + _cogl_pango_renderer_clear_glyph_cache (COGL_PANGO_RENDERER (renderer)); +} + +/** + * cogl_pango_font_map_set_use_mipmapping: + * @fm: a #CoglPangoFontMap + * @value: %TRUE to enable the use of mipmapping + * + * Sets whether the renderer for the passed font map should use + * mipmapping when rendering a #PangoLayout. + * + * Since: 1.0 + */ +void +cogl_pango_font_map_set_use_mipmapping (CoglPangoFontMap *fm, + gboolean value) +{ + CoglPangoRenderer *renderer; + + renderer = COGL_PANGO_RENDERER (cogl_pango_font_map_get_renderer (fm)); + + _cogl_pango_renderer_set_use_mipmapping (renderer, value); +} + +/** + * cogl_pango_font_map_get_use_mipmapping: + * @fm: a #CoglPangoFontMap + * + * Retrieves whether the #CoglPangoRenderer used by @fm will + * use mipmapping when rendering the glyphs. + * + * Return value: %TRUE if mipmapping is used, %FALSE otherwise. + * + * Since: 1.0 + */ +gboolean +cogl_pango_font_map_get_use_mipmapping (CoglPangoFontMap *fm) +{ + CoglPangoRenderer *renderer; + + renderer = COGL_PANGO_RENDERER (cogl_pango_font_map_get_renderer (fm)); + + return _cogl_pango_renderer_get_use_mipmapping (renderer); +} + +static GQuark +cogl_pango_font_map_get_renderer_key (void) +{ + static GQuark renderer_key = 0; + + if (G_UNLIKELY (renderer_key == 0)) + renderer_key = g_quark_from_static_string ("CoglPangoFontMap"); + + return renderer_key; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/pango/cogl-pango-glyph-cache.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/pango/cogl-pango-glyph-cache.c --- clutter-0.8.4/clutter/pango/cogl-pango-glyph-cache.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/pango/cogl-pango-glyph-cache.c 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,370 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Authored By Matthew Allum + * + * 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 . + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include "cogl-pango-glyph-cache.h" +#include "cogl-pango-private.h" + +/* Minimum width/height for each texture */ +#define MIN_TEXTURE_SIZE 256 +/* All glyph with heights within this margin from each other can be + put in the same band */ +#define BAND_HEIGHT_ROUND 4 + +typedef struct _CoglPangoGlyphCacheKey CoglPangoGlyphCacheKey; +typedef struct _CoglPangoGlyphCacheTexture CoglPangoGlyphCacheTexture; +typedef struct _CoglPangoGlyphCacheBand CoglPangoGlyphCacheBand; + +struct _CoglPangoGlyphCache +{ + /* Hash table to quickly check whether a particular glyph in a + particular font is already cached */ + GHashTable *hash_table; + + /* List of textures */ + CoglPangoGlyphCacheTexture *textures; + + /* List of horizontal bands of glyphs */ + CoglPangoGlyphCacheBand *bands; + + /* If TRUE all of the textures will be created with automatic mipmap + generation enabled */ + gboolean use_mipmapping; +}; + +struct _CoglPangoGlyphCacheKey +{ + PangoFont *font; + PangoGlyph glyph; +}; + +/* Represents one texture that will be used to store glyphs. The + texture is divided into horizontal bands which all contain glyphs + of approximatly the same height */ +struct _CoglPangoGlyphCacheTexture +{ + /* The width and height of the texture which should always be a + power of two. This can vary so that glyphs larger than + MIN_TEXTURE_SIZE can use a bigger texture */ + int texture_size; + + /* The remaining vertical space not taken up by any bands */ + int space_remaining; + + /* The actual texture */ + CoglHandle texture; + + CoglPangoGlyphCacheTexture *next; +}; + +/* Represents one horizontal band of a texture. Each band contains + glyphs of a similar height */ +struct _CoglPangoGlyphCacheBand +{ + /* The y position of the top of the band */ + int top; + + /* The height of the band */ + int height; + + /* The remaining horizontal space not taken up by any glyphs */ + int space_remaining; + + /* The size of the texture. Needed to calculate texture + coordinates */ + int texture_size; + + /* The texture containing this band */ + CoglHandle texture; + + CoglPangoGlyphCacheBand *next; +}; + +static void +cogl_pango_glyph_cache_value_free (CoglPangoGlyphCacheValue *value) +{ + cogl_texture_unref (value->texture); + g_slice_free (CoglPangoGlyphCacheValue, value); +} + +static void +cogl_pango_glyph_cache_key_free (CoglPangoGlyphCacheKey *key) +{ + g_object_unref (key->font); + g_slice_free (CoglPangoGlyphCacheKey, key); +} + +static guint +cogl_pango_glyph_cache_hash_func (gconstpointer key) +{ + const CoglPangoGlyphCacheKey *cache_key + = (const CoglPangoGlyphCacheKey *) key; + + /* Generate a number affected by both the font and the glyph + number. We can safely directly compare the pointers because the + key holds a reference to the font so it is not possible that a + different font will have the same memory address */ + return (guint) cache_key->font ^ cache_key->glyph; +} + +static gboolean +cogl_pango_glyph_cache_equal_func (gconstpointer a, + gconstpointer b) +{ + const CoglPangoGlyphCacheKey *key_a + = (const CoglPangoGlyphCacheKey *) a; + const CoglPangoGlyphCacheKey *key_b + = (const CoglPangoGlyphCacheKey *) b; + + /* We can safely directly compare the pointers for the fonts because + the key holds a reference to the font so it is not possible that + a different font will have the same memory address */ + return key_a->font == key_b->font + && key_a->glyph == key_b->glyph; +} + +static void +cogl_pango_glyph_cache_free_textures (CoglPangoGlyphCacheTexture *node) +{ + CoglPangoGlyphCacheTexture *next; + + while (node) + { + next = node->next; + cogl_texture_unref (node->texture); + g_slice_free (CoglPangoGlyphCacheTexture, node); + node = next; + } +} + +static void +cogl_pango_glyph_cache_free_bands (CoglPangoGlyphCacheBand *node) +{ + CoglPangoGlyphCacheBand *next; + + while (node) + { + next = node->next; + cogl_texture_unref (node->texture); + g_slice_free (CoglPangoGlyphCacheBand, node); + node = next; + } +} + +CoglPangoGlyphCache * +cogl_pango_glyph_cache_new (gboolean use_mipmapping) +{ + CoglPangoGlyphCache *cache; + + cache = g_malloc (sizeof (CoglPangoGlyphCache)); + + cache->hash_table = g_hash_table_new_full + (cogl_pango_glyph_cache_hash_func, + cogl_pango_glyph_cache_equal_func, + (GDestroyNotify) cogl_pango_glyph_cache_key_free, + (GDestroyNotify) cogl_pango_glyph_cache_value_free); + + cache->textures = NULL; + cache->bands = NULL; + cache->use_mipmapping = use_mipmapping; + + return cache; +} + +void +cogl_pango_glyph_cache_clear (CoglPangoGlyphCache *cache) +{ + cogl_pango_glyph_cache_free_textures (cache->textures); + cache->textures = NULL; + cogl_pango_glyph_cache_free_bands (cache->bands); + cache->bands = NULL; + + g_hash_table_remove_all (cache->hash_table); +} + +void +cogl_pango_glyph_cache_free (CoglPangoGlyphCache *cache) +{ + cogl_pango_glyph_cache_clear (cache); + + g_hash_table_unref (cache->hash_table); + + g_free (cache); +} + +CoglPangoGlyphCacheValue * +cogl_pango_glyph_cache_lookup (CoglPangoGlyphCache *cache, + PangoFont *font, + PangoGlyph glyph) +{ + CoglPangoGlyphCacheKey key; + + key.font = font; + key.glyph = glyph; + + return (CoglPangoGlyphCacheValue *) + g_hash_table_lookup (cache->hash_table, &key); +} + +CoglPangoGlyphCacheValue * +cogl_pango_glyph_cache_set (CoglPangoGlyphCache *cache, + PangoFont *font, + PangoGlyph glyph, + gconstpointer pixels, + int width, + int height, + int stride, + int draw_x, + int draw_y) +{ + int band_height; + CoglPangoGlyphCacheBand *band; + CoglPangoGlyphCacheKey *key; + CoglPangoGlyphCacheValue *value; + + /* Reserve an extra pixel gap around the glyph so that it can pull + in blank pixels when linear filtering is enabled */ + width++; + height++; + + /* Round the height up to the nearest multiple of + BAND_HEIGHT_ROUND */ + band_height = (height + BAND_HEIGHT_ROUND - 1) & ~(BAND_HEIGHT_ROUND - 1); + + /* Look for a band with the same height and enough width available */ + for (band = cache->bands; + band && (band->height != band_height || band->space_remaining < width); + band = band->next); + if (band == NULL) + { + CoglPangoGlyphCacheTexture *texture; + + /* Look for a texture with enough vertical space left for a band + with this height */ + for (texture = cache->textures; + texture && (texture->space_remaining < band_height + || texture->texture_size < width); + texture = texture->next); + if (texture == NULL) + { + CoglTextureFlags flags = COGL_TEXTURE_NONE; + guchar *clear_data; + + /* Allocate a new texture that is the nearest power of two + greater than the band height or the minimum size, + whichever is lower */ + texture = g_slice_new (CoglPangoGlyphCacheTexture); + + texture->texture_size = MIN_TEXTURE_SIZE; + while (texture->texture_size < band_height || + texture->texture_size < width) + { + texture->texture_size *= 2; + } + + /* Allocate an empty buffer to clear the texture */ + clear_data = + g_malloc0 (texture->texture_size * texture->texture_size); + + if (cache->use_mipmapping) + flags |= COGL_TEXTURE_AUTO_MIPMAP; + + texture->texture = + cogl_texture_new_from_data (texture->texture_size, + texture->texture_size, + 32, flags, + COGL_PIXEL_FORMAT_A_8, + COGL_PIXEL_FORMAT_A_8, + texture->texture_size, + clear_data); + + g_free (clear_data); + + texture->space_remaining = texture->texture_size; + texture->next = cache->textures; + cache->textures = texture; + + if (cache->use_mipmapping) + cogl_texture_set_filters (texture->texture, + CGL_LINEAR_MIPMAP_LINEAR, + CGL_LINEAR); + else + cogl_texture_set_filters (texture->texture, + CGL_LINEAR, + CGL_LINEAR); + } + + band = g_slice_new (CoglPangoGlyphCacheBand); + band->top = texture->texture_size - texture->space_remaining; + band->height = band_height; + band->space_remaining = texture->texture_size; + band->texture = cogl_texture_ref (texture->texture); + band->texture_size = texture->texture_size; + band->next = cache->bands; + cache->bands = band; + texture->space_remaining -= band_height; + } + + band->space_remaining -= width; + + width--; + height--; + + cogl_texture_set_region (band->texture, + 0, 0, + band->space_remaining, + band->top, + width, height, + width, height, + COGL_PIXEL_FORMAT_A_8, + stride, + pixels); + + key = g_slice_new (CoglPangoGlyphCacheKey); + key->font = g_object_ref (font); + key->glyph = glyph; + + value = g_slice_new (CoglPangoGlyphCacheValue); + value->texture = cogl_texture_ref (band->texture); + value->tx1 = (float)(band->space_remaining) + / band->texture_size; + value->tx2 = (float)(band->space_remaining + width) + / band->texture_size; + value->ty1 = (float)(band->top) + / band->texture_size; + value->ty2 = (float)(band->top + height) + / band->texture_size; + value->draw_x = draw_x; + value->draw_y = draw_y; + value->draw_width = width; + value->draw_height = height; + + g_hash_table_insert (cache->hash_table, key, value); + + return value; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/pango/cogl-pango-glyph-cache.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/pango/cogl-pango-glyph-cache.h --- clutter-0.8.4/clutter/pango/cogl-pango-glyph-cache.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/pango/cogl-pango-glyph-cache.h 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,78 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Authored By Matthew Allum + * + * 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 . + */ + +#ifndef __COGL_PANGO_GLYPH_CACHE_H__ +#define __COGL_PANGO_GLYPH_CACHE_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +typedef struct _CoglPangoGlyphCache CoglPangoGlyphCache; +typedef struct _CoglPangoGlyphCacheValue CoglPangoGlyphCacheValue; + +struct _CoglPangoGlyphCacheValue +{ + CoglHandle texture; + + float tx1; + float ty1; + float tx2; + float ty2; + + int draw_x; + int draw_y; + int draw_width; + int draw_height; +}; + +CoglPangoGlyphCache * +cogl_pango_glyph_cache_new (gboolean use_mipmapping); + +void +cogl_pango_glyph_cache_free (CoglPangoGlyphCache *cache); + +CoglPangoGlyphCacheValue * +cogl_pango_glyph_cache_lookup (CoglPangoGlyphCache *cache, + PangoFont *font, + PangoGlyph glyph); + +CoglPangoGlyphCacheValue * +cogl_pango_glyph_cache_set (CoglPangoGlyphCache *cache, + PangoFont *font, + PangoGlyph glyph, + gconstpointer pixels, + int width, + int height, + int stride, + int draw_x, + int draw_y); + +void +cogl_pango_glyph_cache_clear (CoglPangoGlyphCache *cache); + +G_END_DECLS + +#endif /* __COGL_PANGO_GLYPH_CACHE_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/pango/cogl-pango.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/pango/cogl-pango.h --- clutter-0.8.4/clutter/pango/cogl-pango.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/pango/cogl-pango.h 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,85 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Authored By Matthew Allum + * + * 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 . + */ + +#ifndef __PANGO_CLUTTER_H__ +#define __PANGO_CLUTTER_H__ + +#include +#include +#include +#include + +G_BEGIN_DECLS + +/* It's too difficult to actually subclass the pango cairo font + * map. Instead we just make a fake set of macros that actually just + * directly use the original type + */ +#define COGL_PANGO_TYPE_FONT_MAP PANGO_TYPE_CAIRO_FONT_MAP +#define COGL_PANGO_FONT_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), COGL_PANGO_TYPE_FONT_MAP, CoglPangoFontMap)) +#define COGL_PANGO_IS_FONT_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), COGL_PANGO_TYPE_FONT_MAP)) + +typedef PangoCairoFontMap CoglPangoFontMap; + +PangoFontMap * cogl_pango_font_map_new (void); +PangoContext * cogl_pango_font_map_create_context (CoglPangoFontMap *fm); +void cogl_pango_font_map_set_resolution (CoglPangoFontMap *font_map, + double dpi); +void cogl_pango_font_map_clear_glyph_cache (CoglPangoFontMap *fm); +void cogl_pango_ensure_glyph_cache_for_layout (PangoLayout *layout); +void cogl_pango_font_map_set_use_mipmapping (CoglPangoFontMap *fm, + gboolean value); +gboolean cogl_pango_font_map_get_use_mipmapping (CoglPangoFontMap *fm); +PangoRenderer *cogl_pango_font_map_get_renderer (CoglPangoFontMap *fm); + +#define COGL_PANGO_TYPE_RENDERER (cogl_pango_renderer_get_type ()) +#define COGL_PANGO_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), COGL_PANGO_TYPE_RENDERER, CoglPangoRenderer)) +#define COGL_PANGO_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), COGL_PANGO_TYPE_RENDERER, CoglPangoRendererClass)) +#define COGL_PANGO_IS_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), COGL_PANGO_TYPE_RENDERER)) +#define COGL_PANGO_IS_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), COGL_PANGO_TYPE_RENDERER)) +#define COGL_PANGO_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), COGL_PANGO_TYPE_RENDERER, CoglPangoRendererClass)) + +/* opaque types */ +typedef struct _CoglPangoRenderer CoglPangoRenderer; +typedef struct _CoglPangoRendererClass CoglPangoRendererClass; + +GType cogl_pango_renderer_get_type (void) G_GNUC_CONST; + +void cogl_pango_render_layout_subpixel (PangoLayout *layout, + int x, + int y, + const CoglColor *color, + int flags); +void cogl_pango_render_layout (PangoLayout *layout, + int x, + int y, + const CoglColor *color, + int flags); +void cogl_pango_render_layout_line (PangoLayoutLine *line, + int x, + int y, + const CoglColor *color); + +G_END_DECLS + +#endif /* __PANGO_CLUTTER_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/pango/cogl-pango-private.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/pango/cogl-pango-private.h --- clutter-0.8.4/clutter/pango/cogl-pango-private.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/pango/cogl-pango-private.h 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Authored By Matthew Allum + * + * 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 . + */ + +#ifndef __COGL_PANGO_PRIVATE_H__ +#define __COGL_PANGO_PRIVATE_H__ + +#include "cogl-pango.h" + +G_BEGIN_DECLS + +void _cogl_pango_renderer_clear_glyph_cache (CoglPangoRenderer *renderer); +void _cogl_pango_renderer_set_use_mipmapping (CoglPangoRenderer *renderer, + gboolean value); +gboolean _cogl_pango_renderer_get_use_mipmapping (CoglPangoRenderer *renderer); + +G_END_DECLS + +#endif /* __COGL_PANGO_PRIVATE_H__ */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/pango/cogl-pango-render.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/pango/cogl-pango-render.c --- clutter-0.8.4/clutter/pango/cogl-pango-render.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/clutter/pango/cogl-pango-render.c 2009-01-29 08:31:37.000000000 +0000 @@ -0,0 +1,637 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Authored By Matthew Allum + * + * 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 . + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifndef PANGO_ENABLE_BACKEND +#define PANGO_ENABLE_BACKEND 1 +#endif + +#include +#include +#include +#include + +#include "cogl-pango-private.h" +#include "cogl-pango-glyph-cache.h" +#include "../clutter-debug.h" + +struct _CoglPangoRenderer +{ + PangoRenderer parent_instance; + + /* The material used to texture from the glyph cache with */ + CoglHandle glyph_material; + /* The material used for solid fills. (boxes, rectangles + trapezoids) */ + CoglHandle solid_material; + + /* Two caches of glyphs as textures, one with mipmapped textures and + one without */ + CoglPangoGlyphCache *glyph_cache; + CoglPangoGlyphCache *mipmapped_glyph_cache; + + gboolean use_mipmapping; + + /* Array of rectangles to draw from the current texture */ + GArray *glyph_rectangles; + CoglHandle glyph_texture; +}; + +struct _CoglPangoRendererClass +{ + PangoRendererClass class_instance; +}; + +static void +cogl_pango_renderer_glyphs_end (CoglPangoRenderer *priv) +{ + if (priv->glyph_rectangles->len > 0) + { + float *rectangles = (float *) priv->glyph_rectangles->data; + cogl_material_set_layer (priv->glyph_material, 0, priv->glyph_texture); + cogl_set_source (priv->glyph_material); + cogl_rectangles_with_texture_coords (rectangles, + priv->glyph_rectangles->len / 8); + g_array_set_size (priv->glyph_rectangles, 0); + } +} + +static void +cogl_pango_renderer_draw_glyph (CoglPangoRenderer *priv, + CoglPangoGlyphCacheValue *cache_value, + float x1, + float y1) +{ + float x2, y2; + float *p; + + if (priv->glyph_rectangles->len > 0 + && priv->glyph_texture != cache_value->texture) + cogl_pango_renderer_glyphs_end (priv); + + priv->glyph_texture = cache_value->texture; + + x2 = x1 + CLUTTER_INT_TO_FIXED (cache_value->draw_width); + y2 = y1 + CLUTTER_INT_TO_FIXED (cache_value->draw_height); + + g_array_set_size (priv->glyph_rectangles, priv->glyph_rectangles->len + 8); + p = &g_array_index (priv->glyph_rectangles, float, + priv->glyph_rectangles->len - 8); + + *(p++) = x1; *(p++) = y1; + *(p++) = x2; *(p++) = y2; + *(p++) = cache_value->tx1; *(p++) = cache_value->ty1; + *(p++) = cache_value->tx2; *(p++) = cache_value->ty2; +} + +static void cogl_pango_renderer_finalize (GObject *object); +static void cogl_pango_renderer_draw_glyphs (PangoRenderer *renderer, + PangoFont *font, + PangoGlyphString *glyphs, + int x, + int y); +static void cogl_pango_renderer_draw_rectangle (PangoRenderer *renderer, + PangoRenderPart part, + int x, + int y, + int width, + int height); +static void cogl_pango_renderer_draw_trapezoid (PangoRenderer *renderer, + PangoRenderPart part, + double y1, + double x11, + double x21, + double y2, + double x12, + double x22); + +G_DEFINE_TYPE (CoglPangoRenderer, cogl_pango_renderer, PANGO_TYPE_RENDERER); + +static void +cogl_pango_renderer_init (CoglPangoRenderer *priv) +{ + priv->glyph_material = cogl_material_new (); + + /* The default combine mode of materials is to modulate (A x B) the texture + * RGBA channels with the RGBA channels of the previous layer (which in our + * case is just the solid font color) + * + * Since our glyph cache textures are component alpha textures, and so the + * RGB channels are defined as (0, 0, 0) we don't want to modulate the RGB + * channels, instead we want to simply replace them with our solid font + * color... + * + * XXX: we could really do with a neat string based way for describing + * combine modes, like: "REPLACE(PREVIOUS[RGB])" + * XXX: potentially materials could have a fuzzy default combine mode + * such that they default to this for component alpha textures? This would + * give the same semantics as the old-style GL_MODULATE mode but sounds a + * bit hacky. + */ + cogl_material_set_layer_combine_function ( + priv->glyph_material, + 0, /* layer */ + COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGB, + COGL_MATERIAL_LAYER_COMBINE_FUNC_REPLACE); + cogl_material_set_layer_combine_arg_src ( + priv->glyph_material, + 0, /* layer */ + 0, /* arg */ + COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGB, + COGL_MATERIAL_LAYER_COMBINE_SRC_PREVIOUS); + + priv->solid_material = cogl_material_new (); + + priv->glyph_cache = cogl_pango_glyph_cache_new (FALSE); + priv->mipmapped_glyph_cache = cogl_pango_glyph_cache_new (TRUE); + priv->use_mipmapping = FALSE; + priv->glyph_rectangles = g_array_new (FALSE, FALSE, sizeof (float)); +} + +static void +cogl_pango_renderer_class_init (CoglPangoRendererClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + PangoRendererClass *renderer_class = PANGO_RENDERER_CLASS (klass); + + object_class->finalize = cogl_pango_renderer_finalize; + + renderer_class->draw_glyphs = cogl_pango_renderer_draw_glyphs; + renderer_class->draw_rectangle = cogl_pango_renderer_draw_rectangle; + renderer_class->draw_trapezoid = cogl_pango_renderer_draw_trapezoid; +} + +static void +cogl_pango_renderer_finalize (GObject *object) +{ + CoglPangoRenderer *priv = COGL_PANGO_RENDERER (object); + + cogl_pango_glyph_cache_free (priv->mipmapped_glyph_cache); + cogl_pango_glyph_cache_free (priv->glyph_cache); + g_array_free (priv->glyph_rectangles, TRUE); + + G_OBJECT_CLASS (cogl_pango_renderer_parent_class)->finalize (object); +} + +static CoglPangoRenderer * +cogl_pango_get_renderer_from_context (PangoContext *context) +{ + PangoFontMap *font_map; + PangoRenderer *renderer; + CoglPangoFontMap *font_map_priv; + + font_map = pango_context_get_font_map (context); + g_return_val_if_fail (COGL_PANGO_IS_FONT_MAP (font_map), NULL); + + font_map_priv = COGL_PANGO_FONT_MAP (font_map); + renderer = cogl_pango_font_map_get_renderer (font_map_priv); + g_return_val_if_fail (COGL_PANGO_IS_RENDERER (renderer), NULL); + + return COGL_PANGO_RENDERER (renderer); +} + +/** + * cogl_pango_render_layout_subpixel: + * @layout: a #PangoLayout + * @x: FIXME + * @y: FIXME + * @color: color to use when rendering the layout + * @flags: flags to pass to the renderer + * + * FIXME + * + * Since: 1.0 + */ +void +cogl_pango_render_layout_subpixel (PangoLayout *layout, + int x, + int y, + const CoglColor *color, + int flags) +{ + PangoContext *context; + CoglPangoRenderer *priv; + + context = pango_layout_get_context (layout); + priv = cogl_pango_get_renderer_from_context (context); + if (G_UNLIKELY (!priv)) + return; + + cogl_material_set_color (priv->glyph_material, color); + cogl_material_set_color (priv->solid_material, color); + + pango_renderer_draw_layout (PANGO_RENDERER (priv), layout, x, y); +} + +/** + * cogl_pango_render_layout: + * @layout: a #PangoLayout + * @x: X coordinate to render the layout at + * @y: Y coordinate to render the layout at + * @color: color to use when rendering the layout + * @flags: flags to pass to the renderer + * + * Renders @layout. + * + * Since: 1.0 + */ +void +cogl_pango_render_layout (PangoLayout *layout, + int x, + int y, + const CoglColor *color, + int flags) +{ + cogl_pango_render_layout_subpixel (layout, + x * PANGO_SCALE, + y * PANGO_SCALE, + color, + flags); +} + +/** + * cogl_pango_render_layout_line: + * @line: a #PangoLayoutLine + * @x: X coordinate to render the line at + * @y: Y coordinate to render the line at + * @color: color to use when rendering the line + * + * Renders @line at the given coordinates using the given color. + * + * Since: 1.0 + */ +void +cogl_pango_render_layout_line (PangoLayoutLine *line, + int x, + int y, + const CoglColor *color) +{ + PangoContext *context; + CoglPangoRenderer *priv; + + context = pango_layout_get_context (line->layout); + priv = cogl_pango_get_renderer_from_context (context); + if (G_UNLIKELY (!priv)) + return; + + cogl_material_set_color (priv->glyph_material, color); + cogl_material_set_color (priv->solid_material, color); + + pango_renderer_draw_layout_line (PANGO_RENDERER (priv), line, x, y); +} + +void +_cogl_pango_renderer_clear_glyph_cache (CoglPangoRenderer *renderer) +{ + cogl_pango_glyph_cache_clear (renderer->glyph_cache); + cogl_pango_glyph_cache_clear (renderer->mipmapped_glyph_cache); +} + +void +_cogl_pango_renderer_set_use_mipmapping (CoglPangoRenderer *renderer, + gboolean value) +{ + renderer->use_mipmapping = value; +} + +gboolean +_cogl_pango_renderer_get_use_mipmapping (CoglPangoRenderer *renderer) +{ + return renderer->use_mipmapping; +} + +static CoglPangoGlyphCacheValue * +cogl_pango_renderer_get_cached_glyph (PangoRenderer *renderer, + PangoFont *font, + PangoGlyph glyph) +{ + CoglPangoRenderer *priv = COGL_PANGO_RENDERER (renderer); + CoglPangoGlyphCacheValue *value; + CoglPangoGlyphCache *glyph_cache; + + glyph_cache = priv->use_mipmapping ? priv->mipmapped_glyph_cache + : priv->glyph_cache; + + value = cogl_pango_glyph_cache_lookup (glyph_cache, font, glyph); + if (value == NULL) + { + cairo_surface_t *surface; + cairo_t *cr; + cairo_scaled_font_t *scaled_font; + PangoRectangle ink_rect; + cairo_glyph_t cairo_glyph; + + pango_font_get_glyph_extents (font, glyph, &ink_rect, NULL); + pango_extents_to_pixels (&ink_rect, NULL); + + surface = cairo_image_surface_create (CAIRO_FORMAT_A8, + ink_rect.width, + ink_rect.height); + cr = cairo_create (surface); + + scaled_font = pango_cairo_font_get_scaled_font (PANGO_CAIRO_FONT (font)); + cairo_set_scaled_font (cr, scaled_font); + + cairo_glyph.x = -ink_rect.x; + cairo_glyph.y = -ink_rect.y; + /* The PangoCairo glyph numbers directly map to Cairo glyph + numbers */ + cairo_glyph.index = glyph; + cairo_show_glyphs (cr, &cairo_glyph, 1); + + cairo_destroy (cr); + cairo_surface_flush (surface); + + /* Copy the glyph to the cache */ + value = + cogl_pango_glyph_cache_set (glyph_cache, font, glyph, + cairo_image_surface_get_data (surface), + cairo_image_surface_get_width (surface), + cairo_image_surface_get_height (surface), + cairo_image_surface_get_stride (surface), + ink_rect.x, ink_rect.y); + + cairo_surface_destroy (surface); + + CLUTTER_NOTE (PANGO, "cache fail %i", glyph); + } + else + CLUTTER_NOTE (PANGO, "cache success %i", glyph); + + return value; +} + +void +cogl_pango_ensure_glyph_cache_for_layout (PangoLayout *layout) +{ + PangoContext *context; + PangoRenderer *renderer; + PangoLayoutIter *iter; + + g_return_if_fail (PANGO_IS_LAYOUT (layout)); + + if ((iter = pango_layout_get_iter (layout)) == NULL) + return; + + context = pango_layout_get_context (layout); + renderer = + PANGO_RENDERER (cogl_pango_get_renderer_from_context (context)); + + do + { + PangoLayoutLine *line; + GSList *l; + + line = pango_layout_iter_get_line_readonly (iter); + + for (l = line->runs; l; l = l->next) + { + PangoLayoutRun *run = l->data; + PangoGlyphString *glyphs = run->glyphs; + int i; + + for (i = 0; i < glyphs->num_glyphs; i++) + { + PangoGlyphInfo *gi = &glyphs->glyphs[i]; + + cogl_pango_renderer_get_cached_glyph (renderer, + run->item->analysis.font, + gi->glyph); + } + } + } + while (pango_layout_iter_next_line (iter)); + + pango_layout_iter_free (iter); +} + +static void +cogl_pango_renderer_set_color_for_part (PangoRenderer *renderer, + PangoRenderPart part) +{ + PangoColor *pango_color = pango_renderer_get_color (renderer, part); + CoglPangoRenderer *priv = COGL_PANGO_RENDERER (renderer); + + if (pango_color) + { + CoglColor color; + guint8 red = pango_color->red >> 8; + guint8 green = pango_color->green >> 8; + guint8 blue = pango_color->blue >> 8; + guint8 alpha; + + cogl_material_get_color (priv->solid_material, &color); + alpha = cogl_color_get_alpha_byte (&color); + + cogl_material_set_color4ub (priv->solid_material, + red, green, blue, alpha); + cogl_material_set_color4ub (priv->glyph_material, + red, green, blue, alpha); + } +} + +static void +cogl_pango_renderer_draw_box (PangoRenderer *renderer, + int x, + int y, + int width, + int height) +{ + CoglPangoRenderer *priv = COGL_PANGO_RENDERER (renderer); + + cogl_set_source (priv->solid_material); + cogl_path_rectangle ((float)(x), + (float)(y - height), + (float)(width), + (float)(height)); + cogl_path_stroke (); +} + +static void +cogl_pango_renderer_get_device_units (PangoRenderer *renderer, + int xin, + int yin, + float *xout, + float *yout) +{ + const PangoMatrix *matrix; + + if ((matrix = pango_renderer_get_matrix (renderer))) + { + /* Convert user-space coords to device coords */ + *xout = ((xin * matrix->xx + yin * matrix->xy) + / PANGO_SCALE + matrix->x0); + *yout = ((yin * matrix->yy + xin * matrix->yx) + / PANGO_SCALE + matrix->y0); + } + else + { + *xout = PANGO_PIXELS (xin); + *yout = PANGO_PIXELS (yin); + } +} + +static void +cogl_pango_renderer_draw_rectangle (PangoRenderer *renderer, + PangoRenderPart part, + int x, + int y, + int width, + int height) +{ + CoglPangoRenderer *priv = COGL_PANGO_RENDERER (renderer); + float x1, x2, y1, y2; + + cogl_pango_renderer_set_color_for_part (renderer, part); + + cogl_pango_renderer_get_device_units (renderer, + x, y, + &x1, &y1); + cogl_pango_renderer_get_device_units (renderer, + x + width, y + height, + &x2, &y2); + + cogl_set_source (priv->solid_material); + cogl_rectangle (x1, y1, x2, y2); +} + +static void +cogl_pango_renderer_draw_trapezoid (PangoRenderer *renderer, + PangoRenderPart part, + double y1, + double x11, + double x21, + double y2, + double x12, + double x22) +{ + CoglPangoRenderer *priv = COGL_PANGO_RENDERER (renderer); + float points[8]; + + points[0] = (x11); + points[1] = (y1); + points[2] = (x12); + points[3] = (y2); + points[4] = (x22); + points[5] = points[3]; + points[6] = (x21); + points[7] = points[1]; + + cogl_pango_renderer_set_color_for_part (renderer, part); + + cogl_set_source (priv->solid_material); + cogl_path_polygon (points, 4); + cogl_path_fill (); +} + +static void +cogl_pango_renderer_draw_glyphs (PangoRenderer *renderer, + PangoFont *font, + PangoGlyphString *glyphs, + int xi, + int yi) +{ + CoglPangoRenderer *priv = (CoglPangoRenderer *) renderer; + CoglPangoGlyphCacheValue *cache_value; + int i; + + cogl_pango_renderer_set_color_for_part (renderer, + PANGO_RENDER_PART_FOREGROUND); + + for (i = 0; i < glyphs->num_glyphs; i++) + { + PangoGlyphInfo *gi = glyphs->glyphs + i; + float x, y; + + cogl_pango_renderer_get_device_units (renderer, + xi + gi->geometry.x_offset, + yi + gi->geometry.y_offset, + &x, &y); + + if ((gi->glyph & PANGO_GLYPH_UNKNOWN_FLAG)) + { + PangoFontMetrics *metrics; + + cogl_pango_renderer_glyphs_end (priv); + + if (font == NULL || + (metrics = pango_font_get_metrics (font, NULL)) == NULL) + { + cogl_pango_renderer_draw_box (renderer, + x, + y, + PANGO_UNKNOWN_GLYPH_WIDTH, + PANGO_UNKNOWN_GLYPH_HEIGHT); + } + else + { + cogl_pango_renderer_draw_box (renderer, + x, + y, + metrics->approximate_char_width + / PANGO_SCALE, + metrics->ascent / PANGO_SCALE); + + pango_font_metrics_unref (metrics); + } + } + else + { + /* Get the texture containing the glyph. This will create + the cache entry if there isn't already one */ + cache_value = + cogl_pango_renderer_get_cached_glyph (renderer, + font, + gi->glyph); + + if (cache_value == NULL) + { + cogl_pango_renderer_glyphs_end (priv); + + cogl_pango_renderer_draw_box (renderer, + x, + y, + PANGO_UNKNOWN_GLYPH_WIDTH, + PANGO_UNKNOWN_GLYPH_HEIGHT); + } + else + { + float width, height; + + x += (float)(cache_value->draw_x); + y += (float)(cache_value->draw_y); + + width = x + (float)(cache_value->draw_width); + height = y + (float)(cache_value->draw_height); + + cogl_pango_renderer_draw_glyph (priv, cache_value, x, y); + } + } + + xi += gi->geometry.width; + } + + cogl_pango_renderer_glyphs_end (priv); +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/pango/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/clutter/pango/Makefile.am --- clutter-0.8.4/clutter/pango/Makefile.am 2008-09-29 15:16:24.000000000 +0100 +++ clutter-0.9.0/clutter/pango/Makefile.am 2009-01-28 08:12:46.000000000 +0000 @@ -1,24 +1,31 @@ -source_c = pangoclutter-fontmap.c \ - pangoclutter-render.c \ - pangoclutter-glyph-cache.c - -source_h = pangoclutter.h - -source_h_priv = pangoclutter-private.h \ - pangoclutter-glyph-cache.h - -noinst_LTLIBRARIES = libpangoclutter.la - -libpangoclutter_la_SOURCES = $(source_c) \ - $(source_h) \ - $(source_h_priv) +source_c = \ + cogl-pango-fontmap.c \ + cogl-pango-render.c \ + cogl-pango-glyph-cache.c + +source_h = cogl-pango.h + +source_h_priv = \ + cogl-pango-private.h \ + cogl-pango-glyph-cache.h + +noinst_LTLIBRARIES = libcoglpango.la + +libcoglpango_la_SOURCES = \ + $(source_c) \ + $(source_h) \ + $(source_h_priv) INCLUDES = \ @GCC_FLAGS@ @CLUTTER_CFLAGS@ \ $(CLUTTER_DEBUG_CFLAGS) \ - -I$(top_srcdir) \ + $(MAINTAINER_CFLAGS) \ + -DCLUTTER_COMPILATION \ + -I$(top_srcdir) \ -I$(top_srcdir)/clutter \ - -I$(top_builddir)/clutter + -I$(top_srcdir)/clutter/cogl \ + -I$(top_builddir)/clutter \ + -I$(top_builddir)/clutter/cogl -pangoclutterheadersdir = $(includedir)/clutter-@CLUTTER_MAJORMINOR@/clutter -pangoclutterheaders_HEADERS = $(source_h) +coglpangoheadersdir = $(includedir)/clutter-@CLUTTER_MAJORMINOR@/cogl +coglpangoheaders_HEADERS = $(source_h) diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/pango/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/clutter/pango/Makefile.in --- clutter-0.8.4/clutter/pango/Makefile.in 2008-11-28 18:22:48.000000000 +0000 +++ clutter-0.9.0/clutter/pango/Makefile.in 2009-01-28 16:48:57.000000000 +0000 @@ -34,7 +34,7 @@ build_triplet = @build@ host_triplet = @host@ subdir = clutter/pango -DIST_COMMON = $(pangoclutterheaders_HEADERS) $(srcdir)/Makefile.am \ +DIST_COMMON = $(coglpangoheaders_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac @@ -44,13 +44,13 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) -libpangoclutter_la_LIBADD = -am__objects_1 = pangoclutter-fontmap.lo pangoclutter-render.lo \ - pangoclutter-glyph-cache.lo +libcoglpango_la_LIBADD = +am__objects_1 = cogl-pango-fontmap.lo cogl-pango-render.lo \ + cogl-pango-glyph-cache.lo am__objects_2 = -am_libpangoclutter_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ +am_libcoglpango_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ $(am__objects_2) -libpangoclutter_la_OBJECTS = $(am_libpangoclutter_la_OBJECTS) +libcoglpango_la_OBJECTS = $(am_libcoglpango_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -63,17 +63,17 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(libpangoclutter_la_SOURCES) -DIST_SOURCES = $(libpangoclutter_la_SOURCES) +SOURCES = $(libcoglpango_la_SOURCES) +DIST_SOURCES = $(libcoglpango_la_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(pangoclutterheadersdir)" -pangoclutterheadersHEADERS_INSTALL = $(INSTALL_HEADER) -HEADERS = $(pangoclutterheaders_HEADERS) +am__installdirs = "$(DESTDIR)$(coglpangoheadersdir)" +coglpangoheadersHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(coglpangoheaders_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -127,7 +127,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -152,6 +151,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -243,28 +243,35 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -source_c = pangoclutter-fontmap.c \ - pangoclutter-render.c \ - pangoclutter-glyph-cache.c - -source_h = pangoclutter.h -source_h_priv = pangoclutter-private.h \ - pangoclutter-glyph-cache.h - -noinst_LTLIBRARIES = libpangoclutter.la -libpangoclutter_la_SOURCES = $(source_c) \ - $(source_h) \ - $(source_h_priv) +source_c = \ + cogl-pango-fontmap.c \ + cogl-pango-render.c \ + cogl-pango-glyph-cache.c + +source_h = cogl-pango.h +source_h_priv = \ + cogl-pango-private.h \ + cogl-pango-glyph-cache.h + +noinst_LTLIBRARIES = libcoglpango.la +libcoglpango_la_SOURCES = \ + $(source_c) \ + $(source_h) \ + $(source_h_priv) INCLUDES = \ @GCC_FLAGS@ @CLUTTER_CFLAGS@ \ $(CLUTTER_DEBUG_CFLAGS) \ - -I$(top_srcdir) \ + $(MAINTAINER_CFLAGS) \ + -DCLUTTER_COMPILATION \ + -I$(top_srcdir) \ -I$(top_srcdir)/clutter \ - -I$(top_builddir)/clutter + -I$(top_srcdir)/clutter/cogl \ + -I$(top_builddir)/clutter \ + -I$(top_builddir)/clutter/cogl -pangoclutterheadersdir = $(includedir)/clutter-@CLUTTER_MAJORMINOR@/clutter -pangoclutterheaders_HEADERS = $(source_h) +coglpangoheadersdir = $(includedir)/clutter-@CLUTTER_MAJORMINOR@/cogl +coglpangoheaders_HEADERS = $(source_h) all: all-am .SUFFIXES: @@ -307,8 +314,8 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libpangoclutter.la: $(libpangoclutter_la_OBJECTS) $(libpangoclutter_la_DEPENDENCIES) - $(LINK) $(libpangoclutter_la_OBJECTS) $(libpangoclutter_la_LIBADD) $(LIBS) +libcoglpango.la: $(libcoglpango_la_OBJECTS) $(libcoglpango_la_DEPENDENCIES) + $(LINK) $(libcoglpango_la_OBJECTS) $(libcoglpango_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -316,9 +323,9 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangoclutter-fontmap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangoclutter-glyph-cache.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pangoclutter-render.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cogl-pango-fontmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cogl-pango-glyph-cache.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cogl-pango-render.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -346,22 +353,22 @@ clean-libtool: -rm -rf .libs _libs -install-pangoclutterheadersHEADERS: $(pangoclutterheaders_HEADERS) +install-coglpangoheadersHEADERS: $(coglpangoheaders_HEADERS) @$(NORMAL_INSTALL) - test -z "$(pangoclutterheadersdir)" || $(MKDIR_P) "$(DESTDIR)$(pangoclutterheadersdir)" - @list='$(pangoclutterheaders_HEADERS)'; for p in $$list; do \ + test -z "$(coglpangoheadersdir)" || $(MKDIR_P) "$(DESTDIR)$(coglpangoheadersdir)" + @list='$(coglpangoheaders_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ - echo " $(pangoclutterheadersHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pangoclutterheadersdir)/$$f'"; \ - $(pangoclutterheadersHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pangoclutterheadersdir)/$$f"; \ + echo " $(coglpangoheadersHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(coglpangoheadersdir)/$$f'"; \ + $(coglpangoheadersHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(coglpangoheadersdir)/$$f"; \ done -uninstall-pangoclutterheadersHEADERS: +uninstall-coglpangoheadersHEADERS: @$(NORMAL_UNINSTALL) - @list='$(pangoclutterheaders_HEADERS)'; for p in $$list; do \ + @list='$(coglpangoheaders_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(pangoclutterheadersdir)/$$f'"; \ - rm -f "$(DESTDIR)$(pangoclutterheadersdir)/$$f"; \ + echo " rm -f '$(DESTDIR)$(coglpangoheadersdir)/$$f'"; \ + rm -f "$(DESTDIR)$(coglpangoheadersdir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -441,7 +448,7 @@ check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: - for dir in "$(DESTDIR)$(pangoclutterheadersdir)"; do \ + for dir in "$(DESTDIR)$(coglpangoheadersdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -489,7 +496,7 @@ info-am: -install-data-am: install-pangoclutterheadersHEADERS +install-data-am: install-coglpangoheadersHEADERS install-dvi: install-dvi-am @@ -525,7 +532,7 @@ ps-am: -uninstall-am: uninstall-pangoclutterheadersHEADERS +uninstall-am: uninstall-coglpangoheadersHEADERS .MAKE: install-am install-strip @@ -533,16 +540,15 @@ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pangoclutterheadersHEADERS install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ + install install-am install-coglpangoheadersHEADERS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am \ - uninstall-pangoclutterheadersHEADERS + tags uninstall uninstall-am uninstall-coglpangoheadersHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/pango/pangoclutter-fontmap.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/pango/pangoclutter-fontmap.c --- clutter-0.8.4/clutter/pango/pangoclutter-fontmap.c 2008-09-29 15:16:24.000000000 +0100 +++ clutter-0.9.0/clutter/pango/pangoclutter-fontmap.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,134 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -/* This is needed to get the Pango headers to export stuff needed to - subclass */ -#ifndef PANGO_ENABLE_BACKEND -#define PANGO_ENABLE_BACKEND 1 -#endif - -#include -#include -#include - -#include "pangoclutter.h" -#include "pangoclutter-private.h" - -static GQuark pango_clutter_font_map_get_renderer_key (void) G_GNUC_CONST; - -PangoFontMap * -pango_clutter_font_map_new (void) -{ - return pango_cairo_font_map_new (); -} - -PangoContext * -pango_clutter_font_map_create_context (PangoClutterFontMap *fm) -{ - g_return_val_if_fail (PANGO_CLUTTER_IS_FONT_MAP (fm), NULL); - - /* We can just directly use the pango context from the Cairo font - map */ - return pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fm)); -} - -PangoRenderer * -_pango_clutter_font_map_get_renderer (PangoClutterFontMap *fm) -{ - PangoRenderer *renderer; - - /* We want to keep a cached pointer to the renderer from the font - map instance but as we don't have a proper subclass we have to - store it in the object data instead */ - - renderer = g_object_get_qdata (G_OBJECT (fm), - pango_clutter_font_map_get_renderer_key ()); - - if (G_UNLIKELY (renderer == NULL)) - { - renderer = g_object_new (PANGO_CLUTTER_TYPE_RENDERER, NULL); - g_object_set_qdata_full (G_OBJECT (fm), - pango_clutter_font_map_get_renderer_key (), - renderer, - g_object_unref); - } - - return renderer; -} - -void -pango_clutter_font_map_set_resolution (PangoClutterFontMap *font_map, - double dpi) -{ - g_return_if_fail (PANGO_CLUTTER_IS_FONT_MAP (font_map)); - - pango_cairo_font_map_set_resolution (PANGO_CAIRO_FONT_MAP (font_map), dpi); -} - -void -pango_clutter_font_map_clear_glyph_cache (PangoClutterFontMap *fm) -{ - PangoRenderer *renderer; - - renderer = _pango_clutter_font_map_get_renderer (fm); - - _pango_clutter_renderer_clear_glyph_cache (PANGO_CLUTTER_RENDERER (renderer)); -} - -void -pango_clutter_font_map_set_use_mipmapping (PangoClutterFontMap *fm, - gboolean value) -{ - PangoClutterRenderer *renderer; - - renderer = PANGO_CLUTTER_RENDERER (_pango_clutter_font_map_get_renderer (fm)); - - _pango_clutter_renderer_set_use_mipmapping (renderer, value); -} - -gboolean -pango_clutter_font_map_get_use_mipmapping (PangoClutterFontMap *fm) -{ - PangoClutterRenderer *renderer; - - renderer = PANGO_CLUTTER_RENDERER (_pango_clutter_font_map_get_renderer (fm)); - - return _pango_clutter_renderer_get_use_mipmapping (renderer); -} - -static GQuark -pango_clutter_font_map_get_renderer_key (void) -{ - static GQuark renderer_key = 0; - - if (G_UNLIKELY (renderer_key == 0)) - renderer_key = g_quark_from_static_string ("PangoClutterFontMap"); - - return renderer_key; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/pango/pangoclutter-glyph-cache.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/pango/pangoclutter-glyph-cache.c --- clutter-0.8.4/clutter/pango/pangoclutter-glyph-cache.c 2008-09-29 15:16:24.000000000 +0100 +++ clutter-0.9.0/clutter/pango/pangoclutter-glyph-cache.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,362 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include "pangoclutter-glyph-cache.h" -#include "cogl/cogl.h" - -/* Minimum width/height for each texture */ -#define MIN_TEXTURE_SIZE 256 -/* All glyph with heights within this margin from each other can be - put in the same band */ -#define BAND_HEIGHT_ROUND 4 - -typedef struct _PangoClutterGlyphCacheKey PangoClutterGlyphCacheKey; -typedef struct _PangoClutterGlyphCacheTexture PangoClutterGlyphCacheTexture; -typedef struct _PangoClutterGlyphCacheBand PangoClutterGlyphCacheBand; - -struct _PangoClutterGlyphCache -{ - /* Hash table to quickly check whether a particular glyph in a - particular font is already cached */ - GHashTable *hash_table; - - /* List of textures */ - PangoClutterGlyphCacheTexture *textures; - - /* List of horizontal bands of glyphs */ - PangoClutterGlyphCacheBand *bands; - - /* If TRUE all of the textures will be created with automatic mipmap - generation enabled */ - gboolean use_mipmapping; -}; - -struct _PangoClutterGlyphCacheKey -{ - PangoFont *font; - PangoGlyph glyph; -}; - -/* Represents one texture that will be used to store glyphs. The - texture is divided into horizontal bands which all contain glyphs - of approximatly the same height */ -struct _PangoClutterGlyphCacheTexture -{ - /* The width and height of the texture which should always be a - power of two. This can vary so that glyphs larger than - MIN_TEXTURE_SIZE can use a bigger texture */ - int texture_size; - - /* The remaining vertical space not taken up by any bands */ - int space_remaining; - - /* The actual texture */ - CoglHandle texture; - - PangoClutterGlyphCacheTexture *next; -}; - -/* Represents one horizontal band of a texture. Each band contains - glyphs of a similar height */ -struct _PangoClutterGlyphCacheBand -{ - /* The y position of the top of the band */ - int top; - - /* The height of the band */ - int height; - - /* The remaining horizontal space not taken up by any glyphs */ - int space_remaining; - - /* The size of the texture. Needed to calculate texture - coordinates */ - int texture_size; - - /* The texture containing this band */ - CoglHandle texture; - - PangoClutterGlyphCacheBand *next; -}; - -static void -pango_clutter_glyph_cache_value_free (PangoClutterGlyphCacheValue *value) -{ - cogl_texture_unref (value->texture); - g_slice_free (PangoClutterGlyphCacheValue, value); -} - -static void -pango_clutter_glyph_cache_key_free (PangoClutterGlyphCacheKey *key) -{ - g_object_unref (key->font); - g_slice_free (PangoClutterGlyphCacheKey, key); -} - -static guint -pango_clutter_glyph_cache_hash_func (gconstpointer key) -{ - const PangoClutterGlyphCacheKey *cache_key - = (const PangoClutterGlyphCacheKey *) key; - - /* Generate a number affected by both the font and the glyph - number. We can safely directly compare the pointers because the - key holds a reference to the font so it is not possible that a - different font will have the same memory address */ - return (guint) cache_key->font ^ cache_key->glyph; -} - -static gboolean -pango_clutter_glyph_cache_equal_func (gconstpointer a, - gconstpointer b) -{ - const PangoClutterGlyphCacheKey *key_a - = (const PangoClutterGlyphCacheKey *) a; - const PangoClutterGlyphCacheKey *key_b - = (const PangoClutterGlyphCacheKey *) b; - - /* We can safely directly compare the pointers for the fonts because - the key holds a reference to the font so it is not possible that - a different font will have the same memory address */ - return key_a->font == key_b->font - && key_a->glyph == key_b->glyph; -} - -static void -pango_clutter_glyph_cache_free_textures (PangoClutterGlyphCacheTexture *node) -{ - PangoClutterGlyphCacheTexture *next; - - while (node) - { - next = node->next; - cogl_texture_unref (node->texture); - g_slice_free (PangoClutterGlyphCacheTexture, node); - node = next; - } -} - -static void -pango_clutter_glyph_cache_free_bands (PangoClutterGlyphCacheBand *node) -{ - PangoClutterGlyphCacheBand *next; - - while (node) - { - next = node->next; - cogl_texture_unref (node->texture); - g_slice_free (PangoClutterGlyphCacheBand, node); - node = next; - } -} - -PangoClutterGlyphCache * -pango_clutter_glyph_cache_new (gboolean use_mipmapping) -{ - PangoClutterGlyphCache *cache; - - cache = g_malloc (sizeof (PangoClutterGlyphCache)); - - cache->hash_table = g_hash_table_new_full - (pango_clutter_glyph_cache_hash_func, - pango_clutter_glyph_cache_equal_func, - (GDestroyNotify) pango_clutter_glyph_cache_key_free, - (GDestroyNotify) pango_clutter_glyph_cache_value_free); - - cache->textures = NULL; - cache->bands = NULL; - cache->use_mipmapping = use_mipmapping; - - return cache; -} - -void -pango_clutter_glyph_cache_clear (PangoClutterGlyphCache *cache) -{ - pango_clutter_glyph_cache_free_textures (cache->textures); - cache->textures = NULL; - pango_clutter_glyph_cache_free_bands (cache->bands); - cache->bands = NULL; - - g_hash_table_remove_all (cache->hash_table); -} - -void -pango_clutter_glyph_cache_free (PangoClutterGlyphCache *cache) -{ - pango_clutter_glyph_cache_clear (cache); - - g_hash_table_unref (cache->hash_table); - - g_free (cache); -} - -PangoClutterGlyphCacheValue * -pango_clutter_glyph_cache_lookup (PangoClutterGlyphCache *cache, - PangoFont *font, - PangoGlyph glyph) -{ - PangoClutterGlyphCacheKey key; - - key.font = font; - key.glyph = glyph; - - return (PangoClutterGlyphCacheValue *) - g_hash_table_lookup (cache->hash_table, &key); -} - -PangoClutterGlyphCacheValue * -pango_clutter_glyph_cache_set (PangoClutterGlyphCache *cache, - PangoFont *font, - PangoGlyph glyph, - gconstpointer pixels, - int width, - int height, - int stride, - int draw_x, - int draw_y) -{ - int band_height; - PangoClutterGlyphCacheBand *band; - PangoClutterGlyphCacheKey *key; - PangoClutterGlyphCacheValue *value; - - /* Reserve an extra pixel gap around the glyph so that it can pull - in blank pixels when linear filtering is enabled */ - width++; - height++; - - /* Round the height up to the nearest multiple of - BAND_HEIGHT_ROUND */ - band_height = (height + BAND_HEIGHT_ROUND - 1) & ~(BAND_HEIGHT_ROUND - 1); - - /* Look for a band with the same height and enough width available */ - for (band = cache->bands; - band && (band->height != band_height || band->space_remaining < width); - band = band->next); - if (band == NULL) - { - PangoClutterGlyphCacheTexture *texture; - - /* Look for a texture with enough vertical space left for a band - with this height */ - for (texture = cache->textures; - texture && (texture->space_remaining < band_height - || texture->texture_size < width); - texture = texture->next); - if (texture == NULL) - { - guchar *clear_data; - - /* Allocate a new texture that is the nearest power of two - greater than the band height or the minimum size, - whichever is lower */ - texture = g_slice_new (PangoClutterGlyphCacheTexture); - - texture->texture_size = MIN_TEXTURE_SIZE; - while (texture->texture_size < band_height - || texture->texture_size < width) - texture->texture_size *= 2; - - /* Allocate an empty buffer to clear the texture */ - clear_data = g_malloc0 (texture->texture_size - * texture->texture_size); - - texture->texture = cogl_texture_new_from_data - (texture->texture_size, texture->texture_size, - 32, cache->use_mipmapping, - COGL_PIXEL_FORMAT_A_8, COGL_PIXEL_FORMAT_A_8, - texture->texture_size, clear_data); - - g_free (clear_data); - - texture->space_remaining = texture->texture_size; - texture->next = cache->textures; - cache->textures = texture; - - if (cache->use_mipmapping) - cogl_texture_set_filters (texture->texture, - CGL_LINEAR_MIPMAP_LINEAR, - CGL_LINEAR); - else - cogl_texture_set_filters (texture->texture, - CGL_LINEAR, - CGL_LINEAR); - } - - band = g_slice_new (PangoClutterGlyphCacheBand); - band->top = texture->texture_size - texture->space_remaining; - band->height = band_height; - band->space_remaining = texture->texture_size; - band->texture = cogl_texture_ref (texture->texture); - band->texture_size = texture->texture_size; - band->next = cache->bands; - cache->bands = band; - texture->space_remaining -= band_height; - } - - band->space_remaining -= width; - - width--; - height--; - - cogl_texture_set_region (band->texture, - 0, 0, - band->space_remaining, - band->top, - width, height, - width, height, - COGL_PIXEL_FORMAT_A_8, - stride, - pixels); - - key = g_slice_new (PangoClutterGlyphCacheKey); - key->font = g_object_ref (font); - key->glyph = glyph; - - value = g_slice_new (PangoClutterGlyphCacheValue); - value->texture = cogl_texture_ref (band->texture); - value->tx1 = CLUTTER_INT_TO_FIXED (band->space_remaining) - / band->texture_size; - value->tx2 = CLUTTER_INT_TO_FIXED (band->space_remaining + width) - / band->texture_size; - value->ty1 = CLUTTER_INT_TO_FIXED (band->top) / band->texture_size; - value->ty2 = CLUTTER_INT_TO_FIXED (band->top + height) - / band->texture_size; - value->draw_x = draw_x; - value->draw_y = draw_y; - value->draw_width = width; - value->draw_height = height; - - g_hash_table_insert (cache->hash_table, key, value); - - return value; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/pango/pangoclutter-glyph-cache.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/pango/pangoclutter-glyph-cache.h --- clutter-0.8.4/clutter/pango/pangoclutter-glyph-cache.h 2008-09-29 15:16:24.000000000 +0100 +++ clutter-0.9.0/clutter/pango/pangoclutter-glyph-cache.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,69 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef _HAVE_PANGO_CLUTTER_GLYPH_CACHE_H -#define _HAVE_PANGO_CLUTTER_GLYPH_CACHE_H - -#include -#include -#include - -G_BEGIN_DECLS - -typedef struct _PangoClutterGlyphCache PangoClutterGlyphCache; -typedef struct _PangoClutterGlyphCacheValue PangoClutterGlyphCacheValue; - -struct _PangoClutterGlyphCacheValue -{ - CoglHandle texture; - ClutterFixed tx1, ty1, tx2, ty2; - int draw_x, draw_y, draw_width, draw_height; -}; - -PangoClutterGlyphCache *pango_clutter_glyph_cache_new (gboolean use_mipmapping); - -void pango_clutter_glyph_cache_free (PangoClutterGlyphCache *cache); - -PangoClutterGlyphCacheValue * -pango_clutter_glyph_cache_lookup (PangoClutterGlyphCache *cache, - PangoFont *font, - PangoGlyph glyph); - -PangoClutterGlyphCacheValue * -pango_clutter_glyph_cache_set (PangoClutterGlyphCache *cache, - PangoFont *font, - PangoGlyph glyph, - gconstpointer pixels, - int width, - int height, - int stride, - int draw_x, - int draw_y); - -void pango_clutter_glyph_cache_clear (PangoClutterGlyphCache *cache); - -G_END_DECLS - -#endif /* _HAVE_PANGO_CLUTTER_GLYPH_CACHE_H */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/pango/pangoclutter.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/pango/pangoclutter.h --- clutter-0.8.4/clutter/pango/pangoclutter.h 2008-09-29 15:16:24.000000000 +0100 +++ clutter-0.9.0/clutter/pango/pangoclutter.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,110 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef _HAVE_PANGO_CLUTTER_H -#define _HAVE_PANGO_CLUTTER_H - -#include -#include -#include - -G_BEGIN_DECLS - -/* It's too difficult to actually subclass the pango cairo font - map. Instead we just make a fake set of macros that actually just - directly use the original type */ -#define PANGO_CLUTTER_TYPE_FONT_MAP PANGO_TYPE_CAIRO_FONT_MAP - -#define PANGO_CLUTTER_FONT_MAP(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - PANGO_CLUTTER_TYPE_FONT_MAP, \ - PangoClutterFontMap)) -#define PANGO_CLUTTER_IS_FONT_MAP(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - PANGO_CLUTTER_TYPE_FONT_MAP)) - -typedef PangoCairoFontMap PangoClutterFontMap; - -PangoFontMap *pango_clutter_font_map_new (void); - -PangoContext *pango_clutter_font_map_create_context (PangoClutterFontMap *fm); - -void pango_clutter_font_map_set_resolution (PangoClutterFontMap *font_map, - double dpi); - -void pango_clutter_font_map_clear_glyph_cache (PangoClutterFontMap *fm); - -void pango_clutter_font_map_set_use_mipmapping (PangoClutterFontMap *fm, - gboolean value); -gboolean pango_clutter_font_map_get_use_mipmapping (PangoClutterFontMap *fm); - -void pango_clutter_ensure_glyph_cache_for_layout (PangoLayout *layout); - -#define PANGO_CLUTTER_TYPE_RENDERER (pango_clutter_renderer_get_type ()) - -#define PANGO_CLUTTER_RENDERER(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - PANGO_CLUTTER_TYPE_RENDERER, \ - PangoClutterRenderer)) -#define PANGO_CLUTTER_RENDERER_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - PANGO_CLUTTER_TYPE_RENDERER, \ - PangoClutterRendererClass)) -#define PANGO_CLUTTER_IS_RENDERER(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - PANGO_CLUTTER_TYPE_RENDERER)) -#define PANGO_CLUTTER_IS_RENDERER_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - PANGO_CLUTTER_TYPE_RENDERER)) -#define PANGO_CLUTTER_RENDERER_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - PANGO_CLUTTER_TYPE_RENDERER, \ - PangoClutterRendererClass)) - -typedef struct _PangoClutterRenderer PangoClutterRenderer; -typedef struct _PangoClutterRendererClass PangoClutterRendererClass; - -GType pango_clutter_renderer_get_type (void) G_GNUC_CONST; - -void pango_clutter_render_layout_subpixel (PangoLayout *layout, - int x, - int y, - ClutterColor *color, - int flags); - -void pango_clutter_render_layout (PangoLayout *layout, - int x, - int y, - ClutterColor *color, - int flags); - -void pango_clutter_render_layout_line (PangoLayoutLine *line, - int x, - int y, - ClutterColor *color); - -G_END_DECLS - -#endif /* _HAVE_PANGO_CLUTTER_H */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/pango/pangoclutter-private.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/pango/pangoclutter-private.h --- clutter-0.8.4/clutter/pango/pangoclutter-private.h 2008-09-29 15:16:24.000000000 +0100 +++ clutter-0.9.0/clutter/pango/pangoclutter-private.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,43 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef _HAVE_PANGO_CLUTTER_PRIVATE_H -#define _HAVE_PANGO_CLUTTER_PRIVATE_H - -#include "pangoclutter.h" - -G_BEGIN_DECLS - -PangoRenderer *_pango_clutter_font_map_get_renderer (PangoClutterFontMap *fm); - -void _pango_clutter_renderer_clear_glyph_cache (PangoClutterRenderer *renderer); - -void _pango_clutter_renderer_set_use_mipmapping (PangoClutterRenderer *renderer, - gboolean value); -gboolean _pango_clutter_renderer_get_use_mipmapping (PangoClutterRenderer *renderer); - -G_END_DECLS - -#endif /* _HAVE_PANGO_CLUTTER_H */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/pango/pangoclutter-render.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/pango/pangoclutter-render.c --- clutter-0.8.4/clutter/pango/pangoclutter-render.c 2008-11-04 16:36:16.000000000 +0000 +++ clutter-0.9.0/clutter/pango/pangoclutter-render.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,494 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Matthew Allum - * - * 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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifndef PANGO_ENABLE_BACKEND -#define PANGO_ENABLE_BACKEND 1 -#endif - -#include -#include -#include -#include - -#include "pangoclutter.h" -#include "pangoclutter-private.h" -#include "pangoclutter-glyph-cache.h" -#include "../clutter-debug.h" -#include "cogl/cogl.h" - -struct _PangoClutterRenderer -{ - PangoRenderer parent_instance; - - /* The color to draw the glyphs with */ - ClutterColor color; - - /* Two caches of glyphs as textures, one with mipmapped textures and - one without */ - PangoClutterGlyphCache *glyph_cache; - PangoClutterGlyphCache *mipmapped_glyph_cache; - - gboolean use_mipmapping; -}; - -struct _PangoClutterRendererClass -{ - PangoRendererClass class_instance; -}; - -#define CLUTTER_PANGO_UNIT_TO_FIXED(x) ((x) << (CFX_Q - 10)) - -static void pango_clutter_renderer_finalize (GObject *object); -static void pango_clutter_renderer_draw_glyphs (PangoRenderer *renderer, - PangoFont *font, - PangoGlyphString *glyphs, - int x, - int y); -static void pango_clutter_renderer_draw_rectangle (PangoRenderer *renderer, - PangoRenderPart part, - int x, - int y, - int width, - int height); -static void pango_clutter_renderer_draw_trapezoid (PangoRenderer *renderer, - PangoRenderPart part, - double y1, - double x11, - double x21, - double y2, - double x12, - double x22); - -static GObjectClass *parent_class = NULL; - -G_DEFINE_TYPE (PangoClutterRenderer, pango_clutter_renderer, - PANGO_TYPE_RENDERER); - -static void -pango_clutter_renderer_init (PangoClutterRenderer *priv) -{ - priv->glyph_cache = pango_clutter_glyph_cache_new (FALSE); - priv->mipmapped_glyph_cache = pango_clutter_glyph_cache_new (TRUE); - priv->use_mipmapping = FALSE; -} - -static void -pango_clutter_renderer_class_init (PangoClutterRendererClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - PangoRendererClass *renderer_class = PANGO_RENDERER_CLASS (klass); - - parent_class = g_type_class_peek_parent (klass); - - object_class->finalize = pango_clutter_renderer_finalize; - - renderer_class->draw_glyphs = pango_clutter_renderer_draw_glyphs; - renderer_class->draw_rectangle = pango_clutter_renderer_draw_rectangle; - renderer_class->draw_trapezoid = pango_clutter_renderer_draw_trapezoid; -} - -static void -pango_clutter_renderer_finalize (GObject *object) -{ - PangoClutterRenderer *priv = PANGO_CLUTTER_RENDERER (object); - - pango_clutter_glyph_cache_free (priv->mipmapped_glyph_cache); - pango_clutter_glyph_cache_free (priv->glyph_cache); - - G_OBJECT_CLASS (parent_class)->finalize (object); -} - -void -pango_clutter_render_layout_subpixel (PangoLayout *layout, - int x, - int y, - ClutterColor *color, - int flags) -{ - PangoContext *context; - PangoFontMap *font_map; - PangoRenderer *renderer; - PangoClutterRenderer *priv; - - context = pango_layout_get_context (layout); - font_map = pango_context_get_font_map (context); - g_return_if_fail (PANGO_CLUTTER_IS_FONT_MAP (font_map)); - renderer = _pango_clutter_font_map_get_renderer - (PANGO_CLUTTER_FONT_MAP (font_map)); - priv = PANGO_CLUTTER_RENDERER (renderer); - - priv->color = *color; - - pango_renderer_draw_layout (renderer, layout, x, y); -} - -void -pango_clutter_render_layout (PangoLayout *layout, - int x, - int y, - ClutterColor *color, - int flags) -{ - pango_clutter_render_layout_subpixel (layout, - x * PANGO_SCALE, - y * PANGO_SCALE, - color, - flags); -} - -void -pango_clutter_render_layout_line (PangoLayoutLine *line, - int x, - int y, - ClutterColor *color) -{ - PangoContext *context; - PangoFontMap *font_map; - PangoRenderer *renderer; - PangoClutterRenderer *priv; - - context = pango_layout_get_context (line->layout); - font_map = pango_context_get_font_map (context); - g_return_if_fail (PANGO_CLUTTER_IS_FONT_MAP (font_map)); - renderer = _pango_clutter_font_map_get_renderer - (PANGO_CLUTTER_FONT_MAP (font_map)); - priv = PANGO_CLUTTER_RENDERER (renderer); - - priv->color = *color; - - pango_renderer_draw_layout_line (renderer, line, x, y); -} - -void -_pango_clutter_renderer_clear_glyph_cache (PangoClutterRenderer *renderer) -{ - pango_clutter_glyph_cache_clear (renderer->glyph_cache); - pango_clutter_glyph_cache_clear (renderer->mipmapped_glyph_cache); -} - -void -_pango_clutter_renderer_set_use_mipmapping (PangoClutterRenderer *renderer, - gboolean value) -{ - renderer->use_mipmapping = value; -} - -gboolean -_pango_clutter_renderer_get_use_mipmapping (PangoClutterRenderer *renderer) -{ - return renderer->use_mipmapping; -} - -static PangoClutterGlyphCacheValue * -pango_clutter_renderer_get_cached_glyph (PangoRenderer *renderer, - PangoFont *font, - PangoGlyph glyph) -{ - PangoClutterRenderer *priv = PANGO_CLUTTER_RENDERER (renderer); - PangoClutterGlyphCacheValue *value; - PangoClutterGlyphCache *glyph_cache; - - glyph_cache = priv->use_mipmapping - ? priv->mipmapped_glyph_cache : priv->glyph_cache; - - if ((value = pango_clutter_glyph_cache_lookup (glyph_cache, - font, - glyph)) == NULL) - { - cairo_surface_t *surface; - cairo_t *cr; - cairo_scaled_font_t *scaled_font; - PangoRectangle ink_rect; - cairo_glyph_t cairo_glyph; - - pango_font_get_glyph_extents (font, glyph, &ink_rect, NULL); - pango_extents_to_pixels (&ink_rect, NULL); - - surface = cairo_image_surface_create (CAIRO_FORMAT_A8, - ink_rect.width, - ink_rect.height); - cr = cairo_create (surface); - - scaled_font = pango_cairo_font_get_scaled_font (PANGO_CAIRO_FONT (font)); - cairo_set_scaled_font (cr, scaled_font); - - cairo_glyph.x = -ink_rect.x; - cairo_glyph.y = -ink_rect.y; - /* The PangoCairo glyph numbers directly map to Cairo glyph - numbers */ - cairo_glyph.index = glyph; - cairo_show_glyphs (cr, &cairo_glyph, 1); - - cairo_destroy (cr); - cairo_surface_flush (surface); - - /* Copy the glyph to the cache */ - value = pango_clutter_glyph_cache_set - (glyph_cache, font, glyph, - cairo_image_surface_get_data (surface), - cairo_image_surface_get_width (surface), - cairo_image_surface_get_height (surface), - cairo_image_surface_get_stride (surface), - ink_rect.x, ink_rect.y); - - cairo_surface_destroy (surface); - - CLUTTER_NOTE (PANGO, "cache fail %i", glyph); - } - else - CLUTTER_NOTE (PANGO, "cache success %i", glyph); - - return value; -} - -void -pango_clutter_ensure_glyph_cache_for_layout (PangoLayout *layout) -{ - PangoContext *context; - PangoFontMap *fontmap; - PangoRenderer *renderer; - PangoLayoutIter *iter; - - g_return_if_fail (PANGO_IS_LAYOUT (layout)); - - context = pango_layout_get_context (layout); - fontmap = pango_context_get_font_map (context); - g_return_if_fail (PANGO_CLUTTER_IS_FONT_MAP (fontmap)); - renderer = _pango_clutter_font_map_get_renderer - (PANGO_CLUTTER_FONT_MAP (fontmap)); - - if ((iter = pango_layout_get_iter (layout)) == NULL) - return; - - do - { - PangoLayoutLine *line; - GSList *l; - - line = pango_layout_iter_get_line_readonly (iter); - - for (l = line->runs; l; l = l->next) - { - PangoLayoutRun *run = l->data; - PangoGlyphString *glyphs = run->glyphs; - int i; - - for (i = 0; i < glyphs->num_glyphs; i++) - { - PangoGlyphInfo *gi = &glyphs->glyphs[i]; - - pango_clutter_renderer_get_cached_glyph (renderer, - run->item->analysis.font, - gi->glyph); - } - } - } - while (pango_layout_iter_next_line (iter)); - - pango_layout_iter_free (iter); -} - -static void -pango_clutter_renderer_set_color_for_part (PangoRenderer *renderer, - PangoRenderPart part) -{ - PangoColor *pango_color = pango_renderer_get_color (renderer, part); - PangoClutterRenderer *priv = PANGO_CLUTTER_RENDERER (renderer); - ClutterColor clutter_color; - - if (pango_color) - { - clutter_color.red = pango_color->red >> 8; - clutter_color.green = pango_color->green >> 8; - clutter_color.blue = pango_color->blue >> 8; - clutter_color.alpha = priv->color.alpha; - } - else - clutter_color = priv->color; - - cogl_color (&clutter_color); -} - -static void -pango_clutter_renderer_draw_box (int x, int y, - int width, int height) -{ - cogl_path_rectangle (CLUTTER_INT_TO_FIXED (x), - CLUTTER_INT_TO_FIXED (y - height), - CLUTTER_INT_TO_FIXED (width), - CLUTTER_INT_TO_FIXED (height)); - cogl_path_stroke (); -} - -static void -pango_clutter_renderer_get_device_units (PangoRenderer *renderer, - int xin, - int yin, - ClutterFixed *xout, - ClutterFixed *yout) -{ - const PangoMatrix *matrix; - - if ((matrix = pango_renderer_get_matrix (renderer))) - { - /* Convert user-space coords to device coords */ - *xout = CLUTTER_FLOAT_TO_FIXED ((xin * matrix->xx + yin * matrix->xy) - / PANGO_SCALE + matrix->x0); - *yout = CLUTTER_FLOAT_TO_FIXED ((yin * matrix->yy + xin * matrix->yx) - / PANGO_SCALE + matrix->y0); - } - else - { - *xout = CLUTTER_PANGO_UNIT_TO_FIXED (xin); - *yout = CLUTTER_PANGO_UNIT_TO_FIXED (yin); - } -} - -static void -pango_clutter_renderer_draw_rectangle (PangoRenderer *renderer, - PangoRenderPart part, - int x, - int y, - int width, - int height) -{ - ClutterFixed x1, x2, y1, y2; - - pango_clutter_renderer_set_color_for_part (renderer, part); - - pango_clutter_renderer_get_device_units (renderer, x, y, - &x1, &y1); - pango_clutter_renderer_get_device_units (renderer, x + width, y + height, - &x2, &y2); - - cogl_rectanglex (x1, y1, x2 - x1, y2 - y1); -} - -static void -pango_clutter_renderer_draw_trapezoid (PangoRenderer *renderer, - PangoRenderPart part, - double y1, - double x11, - double x21, - double y2, - double x12, - double x22) -{ - ClutterFixed points[8]; - - points[0] = CLUTTER_FLOAT_TO_FIXED (x11); - points[1] = CLUTTER_FLOAT_TO_FIXED (y1); - points[2] = CLUTTER_FLOAT_TO_FIXED (x12); - points[3] = CLUTTER_FLOAT_TO_FIXED (y2); - points[4] = CLUTTER_FLOAT_TO_FIXED (x22); - points[5] = points[3]; - points[6] = CLUTTER_FLOAT_TO_FIXED (x21); - points[7] = points[1]; - - pango_clutter_renderer_set_color_for_part (renderer, part); - cogl_path_polygon (points, 4); - cogl_path_fill (); -} - -static void -pango_clutter_renderer_draw_glyphs (PangoRenderer *renderer, - PangoFont *font, - PangoGlyphString *glyphs, - int xi, - int yi) -{ - PangoClutterGlyphCacheValue *cache_value; - int i; - - pango_clutter_renderer_set_color_for_part (renderer, - PANGO_RENDER_PART_FOREGROUND); - - for (i = 0; i < glyphs->num_glyphs; i++) - { - PangoGlyphInfo *gi = glyphs->glyphs + i; - ClutterFixed x, y; - - pango_clutter_renderer_get_device_units (renderer, - xi + gi->geometry.x_offset, - yi + gi->geometry.y_offset, - &x, &y); - - if ((gi->glyph & PANGO_GLYPH_UNKNOWN_FLAG)) - { - PangoFontMetrics *metrics; - - if (font == NULL - || (metrics = pango_font_get_metrics (font, NULL)) == NULL) - pango_clutter_renderer_draw_box (CLUTTER_FIXED_TO_INT (x), - CLUTTER_FIXED_TO_INT (y), - PANGO_UNKNOWN_GLYPH_WIDTH, - PANGO_UNKNOWN_GLYPH_HEIGHT); - else - { - pango_clutter_renderer_draw_box (CLUTTER_FIXED_TO_INT (x), - CLUTTER_FIXED_TO_INT (y), - metrics->approximate_char_width - / PANGO_SCALE, - metrics->ascent / PANGO_SCALE); - - pango_font_metrics_unref (metrics); - } - } - else - { - /* Get the texture containing the glyph. This will create - the cache entry if there isn't already one */ - cache_value - = pango_clutter_renderer_get_cached_glyph (renderer, font, - gi->glyph); - - if (cache_value == NULL) - pango_clutter_renderer_draw_box (CLUTTER_FIXED_TO_INT (x), - CLUTTER_FIXED_TO_INT (y), - PANGO_UNKNOWN_GLYPH_WIDTH, - PANGO_UNKNOWN_GLYPH_HEIGHT); - else - { - x += CLUTTER_INT_TO_FIXED (cache_value->draw_x); - y += CLUTTER_INT_TO_FIXED (cache_value->draw_y); - - /* Render the glyph from the texture */ - cogl_texture_rectangle (cache_value->texture, x, y, - x + CLUTTER_INT_TO_FIXED (cache_value - ->draw_width), - y + CLUTTER_INT_TO_FIXED (cache_value - ->draw_height), - cache_value->tx1, cache_value->ty1, - cache_value->tx2, cache_value->ty2); - } - } - - xi += gi->geometry.width; - } -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/sdl/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/clutter/sdl/Makefile.am --- clutter-0.8.4/clutter/sdl/Makefile.am 2008-09-29 15:16:24.000000000 +0100 +++ clutter-0.9.0/clutter/sdl/Makefile.am 2009-01-28 08:12:46.000000000 +0000 @@ -3,6 +3,7 @@ INCLUDES = \ -DG_LOG_DOMAIN=\"ClutterSDL\" \ + -DCLUTTER_COMPILATION \ -I$(top_srcdir) \ -I$(top_srcdir)/clutter/ \ -I$(top_builddir)/clutter/ \ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/sdl/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/clutter/sdl/Makefile.in --- clutter-0.8.4/clutter/sdl/Makefile.in 2008-11-28 18:22:48.000000000 +0000 +++ clutter-0.9.0/clutter/sdl/Makefile.in 2009-01-28 16:48:57.000000000 +0000 @@ -124,7 +124,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -149,6 +148,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -244,6 +244,7 @@ libclutterinclude_HEADERS = clutter-sdl.h INCLUDES = \ -DG_LOG_DOMAIN=\"ClutterSDL\" \ + -DCLUTTER_COMPILATION \ -I$(top_srcdir) \ -I$(top_srcdir)/clutter/ \ -I$(top_builddir)/clutter/ \ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/win32/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/clutter/win32/Makefile.am --- clutter-0.8.4/clutter/win32/Makefile.am 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/win32/Makefile.am 2009-01-28 08:12:46.000000000 +0000 @@ -9,6 +9,7 @@ INCLUDES = \ -DG_LOG_DOMAIN=\"ClutterWin32\" \ + -DCLUTTER_COMPILATION \ -I$(top_srcdir) \ -I$(top_srcdir)/clutter \ -I$(top_builddir)/clutter \ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/win32/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/clutter/win32/Makefile.in --- clutter-0.8.4/clutter/win32/Makefile.in 2008-11-28 18:22:48.000000000 +0000 +++ clutter-0.9.0/clutter/win32/Makefile.in 2009-01-28 16:48:57.000000000 +0000 @@ -128,7 +128,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -153,6 +152,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -250,6 +250,7 @@ pkgconfigdir = $(libdir)/pkgconfig INCLUDES = \ -DG_LOG_DOMAIN=\"ClutterWin32\" \ + -DCLUTTER_COMPILATION \ -I$(top_srcdir) \ -I$(top_srcdir)/clutter \ -I$(top_builddir)/clutter \ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/x11/clutter-backend-x11.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/x11/clutter-backend-x11.c --- clutter-0.8.4/clutter/x11/clutter-backend-x11.c 2008-11-04 16:36:17.000000000 +0000 +++ clutter-0.9.0/clutter/x11/clutter-backend-x11.c 2009-01-28 08:12:46.000000000 +0000 @@ -23,6 +23,8 @@ #include "config.h" #endif +#include + #include #include #ifdef HAVE_UNISTD_H @@ -235,18 +237,18 @@ "display", 0, G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_STRING, &clutter_display_name, - "X display to use", "DISPLAY" + N_("X display to use"), "DISPLAY" }, { "screen", 0, G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_INT, &clutter_screen, - "X screen to use", "SCREEN" + N_("X screen to use"), "SCREEN" }, { "synch", 0, 0, G_OPTION_ARG_NONE, &clutter_synchronise, - "Make X calls synchronous", NULL, + N_("Make X calls synchronous"), NULL, }, { NULL } }; diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/x11/clutter-event-x11.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/x11/clutter-event-x11.c --- clutter-0.8.4/clutter/x11/clutter-event-x11.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/x11/clutter-event-x11.c 2009-01-28 08:12:46.000000000 +0000 @@ -427,17 +427,21 @@ case ConfigureNotify: if (!stage_x11->is_foreign_xwin) { - /* Set a flag so that the stage will know the actor is being - resized in response to the window size changing as - opposed to a request from the application. This prevents - it from trying to resize the window again */ - stage_x11->handling_configure = TRUE; + CLUTTER_NOTE (BACKEND, "%s: ConfigureNotify[%x] (%d, %d)", + G_STRLOC, + (unsigned int) stage_x11->xwin, + xevent->xconfigure.width, + xevent->xconfigure.height); clutter_actor_set_size (CLUTTER_ACTOR (stage), xevent->xconfigure.width, xevent->xconfigure.height); - stage_x11->handling_configure = FALSE; + /* the resize process is complete, so we can ask the stage + * to set up the GL viewport with the new size + */ + CLUTTER_SET_PRIVATE_FLAGS (CLUTTER_ACTOR (stage_x11->wrapper), + CLUTTER_ACTOR_SYNC_MATRICES); } res = FALSE; break; @@ -843,8 +847,13 @@ * This function processes a single X event; it can be used to hook * into external X event retrieval (for example that done by GDK). * - * Return value: #ClutterX11FilterReturn indicating what the caller - * should do with the original event. + * Return value: #ClutterX11FilterReturn. %CLUTTER_X11_FILTER_REMOVE + * indicates that Clutter has internally handled the event and the + * caller should do no further processing. %CLUTTER_X11_FILTER_CONTINUE + * indicates that Clutter is either not interested in the event, + * or has used the event to update internal state without taking + * any exclusive action. %CLUTTER_X11_FILTER_TRANSLATE will not + * occur. * * Since: 0.8 */ @@ -854,6 +863,18 @@ ClutterBackend *backend; ClutterEvent *event; ClutterMainContext *clutter_context; + ClutterX11FilterReturn result; + + /* The return values here are someone approximate; we return + * CLUTTER_X11_FILTER_REMOVE if and only if a clutter event is + * generated for the event. This mostly, but not entirely, + * corresponds to whether other event processing should be + * excluded. As long as the stage window is not shared with another + * toolkit it should be safe, and never return + * %CLUTTER_X11_FILTER_REMOVE when more processing is needed. + */ + + result = CLUTTER_X11_FILTER_CONTINUE; clutter_threads_enter (); @@ -865,11 +886,13 @@ if (event_translate (backend, event, xevent)) { /* push directly here to avoid copy of queue_put */ + result = CLUTTER_X11_FILTER_REMOVE; g_queue_push_head (clutter_context->events_queue, event); } else { clutter_event_free (event); + goto out; } event = clutter_event_get (); @@ -881,9 +904,10 @@ clutter_event_free (event); } + out: clutter_threads_leave (); - return CLUTTER_X11_FILTER_CONTINUE; + return result; } static gboolean diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/x11/clutter-stage-x11.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/x11/clutter-stage-x11.c --- clutter-0.8.4/clutter/x11/clutter-stage-x11.c 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/x11/clutter-stage-x11.c 2009-01-28 08:12:46.000000000 +0000 @@ -270,25 +270,20 @@ stage_x11->xwin_width = new_width; stage_x11->xwin_height = new_height; - /* The 'handling_configure' flag below is used to prevent the - window from being resized again in response to a - ConfigureNotify event. Normally this will not be a problem - because the window will be resized to xwin_width and - xwin_height so the above test will prevent it from resizing - the window a second time. However if the stage is resized - multiple times without the events being processed in between - (eg, when calling g_object_set to set both width and height) - then there will be multiple ConfigureNotify events in the - queue. Handling the first event will undo the work of setting - the second property which will cause it to keep generating - events in an infinite loop. See bug #810 */ - if (stage_x11->xwin != None - && !stage_x11->is_foreign_xwin - && !stage_x11->handling_configure) - XResizeWindow (stage_x11->xdpy, - stage_x11->xwin, - stage_x11->xwin_width, - stage_x11->xwin_height); + if (stage_x11->xwin != None && + !stage_x11->is_foreign_xwin) + { + CLUTTER_NOTE (BACKEND, "%s: XResizeWindow[%x] (%d, %d)", + G_STRLOC, + (unsigned int) stage_x11->xwin, + stage_x11->xwin_width, + stage_x11->xwin_height); + + XResizeWindow (stage_x11->xdpy, + stage_x11->xwin, + stage_x11->xwin_width, + stage_x11->xwin_height); + } clutter_stage_x11_fix_window_size (stage_x11); @@ -298,9 +293,6 @@ clutter_actor_unrealize (self); clutter_actor_realize (self); } - - CLUTTER_SET_PRIVATE_FLAGS (CLUTTER_ACTOR (stage_x11->wrapper), - CLUTTER_ACTOR_SYNC_MATRICES); } /* chain up to fill in actor->priv->allocation */ @@ -397,6 +389,8 @@ if (!stage) return; + CLUTTER_SET_PRIVATE_FLAGS (stage, CLUTTER_ACTOR_SYNC_MATRICES); + if (is_fullscreen) { int width, height; @@ -479,8 +473,6 @@ stage_x11->fullscreen_on_map = FALSE; } } - - CLUTTER_SET_PRIVATE_FLAGS (stage, CLUTTER_ACTOR_SYNC_MATRICES); } static void @@ -572,7 +564,6 @@ stage->is_foreign_xwin = FALSE; stage->fullscreen_on_map = FALSE; - stage->handling_configure = FALSE; stage->is_cursor_visible = TRUE; stage->title = NULL; @@ -740,6 +731,8 @@ clutter_actor_set_geometry (actor, &geom); clutter_actor_realize (actor); + CLUTTER_SET_PRIVATE_FLAGS (actor, CLUTTER_ACTOR_SYNC_MATRICES); + return TRUE; } @@ -769,4 +762,3 @@ CLUTTER_ACTOR_UNSET_FLAGS (stage_x11, CLUTTER_ACTOR_MAPPED); CLUTTER_ACTOR_UNSET_FLAGS (stage_x11->wrapper, CLUTTER_ACTOR_MAPPED); } - diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/x11/clutter-stage-x11.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/x11/clutter-stage-x11.h --- clutter-0.8.4/clutter/x11/clutter-stage-x11.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/x11/clutter-stage-x11.h 2009-01-28 08:12:46.000000000 +0000 @@ -47,7 +47,6 @@ guint is_foreign_xwin : 1; guint fullscreen_on_map : 1; - guint handling_configure : 1; guint is_cursor_visible : 1; Display *xdpy; diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/x11/clutter-x11.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/x11/clutter-x11.h --- clutter-0.8.4/clutter/x11/clutter-x11.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/x11/clutter-x11.h 2009-01-28 08:12:46.000000000 +0000 @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/x11/clutter-x11-texture-pixmap.c /tmp/VXszleoOf1/clutter-0.9.0/clutter/x11/clutter-x11-texture-pixmap.c --- clutter-0.8.4/clutter/x11/clutter-x11-texture-pixmap.c 2008-11-13 14:44:32.000000000 +0000 +++ clutter-0.9.0/clutter/x11/clutter-x11-texture-pixmap.c 2009-01-20 21:13:24.000000000 +0000 @@ -440,7 +440,7 @@ { case PROP_PIXMAP: clutter_x11_texture_pixmap_set_pixmap (texture, - g_value_get_uint (value)); + g_value_get_ulong (value)); break; case PROP_AUTO: clutter_x11_texture_pixmap_set_automatic (texture, @@ -481,7 +481,7 @@ switch (prop_id) { case PROP_PIXMAP: - g_value_set_uint (value, priv->pixmap); + g_value_set_ulong (value, priv->pixmap); break; case PROP_PIXMAP_WIDTH: g_value_set_uint (value, priv->pixmap_width); @@ -557,12 +557,12 @@ klass->update_area = clutter_x11_texture_pixmap_update_area_real; - pspec = g_param_spec_uint ("pixmap", - "Pixmap", - "The X11 Pixmap to be bound", - 0, G_MAXINT, - None, - G_PARAM_READWRITE); + pspec = g_param_spec_ulong ("pixmap", + "Pixmap", + "The X11 Pixmap to be bound", + 0, G_MAXULONG, + None, + G_PARAM_READWRITE); g_object_class_install_property (object_class, PROP_PIXMAP, pspec); @@ -605,12 +605,12 @@ g_object_class_install_property (object_class, PROP_AUTO, pspec); - pspec = g_param_spec_uint ("window", - "Window", - "The X11 Window to be bound", - 0, G_MAXINT, - None, - G_PARAM_READWRITE); + pspec = g_param_spec_ulong ("window", + "Window", + "The X11 Window to be bound", + 0, G_MAXULONG, + None, + G_PARAM_READWRITE); g_object_class_install_property (object_class, PROP_WINDOW, pspec); diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/x11/clutter-x11-texture-pixmap.h /tmp/VXszleoOf1/clutter-0.9.0/clutter/x11/clutter-x11-texture-pixmap.h --- clutter-0.8.4/clutter/x11/clutter-x11-texture-pixmap.h 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/x11/clutter-x11-texture-pixmap.h 2009-01-28 08:12:46.000000000 +0000 @@ -28,9 +28,7 @@ #include #include - - -#include +#include #include G_BEGIN_DECLS diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/x11/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/clutter/x11/Makefile.am --- clutter-0.8.4/clutter/x11/Makefile.am 2008-09-29 15:16:25.000000000 +0100 +++ clutter-0.9.0/clutter/x11/Makefile.am 2009-01-28 08:12:46.000000000 +0000 @@ -1,10 +1,11 @@ INCLUDES = \ - -DG_LOG_DOMAIN=\"ClutterX11\" \ - -I$(top_srcdir) \ + -DG_LOG_DOMAIN=\"ClutterX11\" \ + -DCLUTTER_COMPILATION \ + -I$(top_srcdir) \ -I$(top_srcdir)/clutter \ -I$(top_builddir)/clutter \ - $(CLUTTER_CFLAGS) \ - $(CLUTTER_DEBUG_CFLAGS) \ + $(CLUTTER_CFLAGS) \ + $(CLUTTER_DEBUG_CFLAGS) \ $(GCC_FLAGS) LDADD = $(CLUTTER_LIBS) diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/clutter/x11/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/clutter/x11/Makefile.in --- clutter-0.8.4/clutter/x11/Makefile.in 2008-11-28 18:22:48.000000000 +0000 +++ clutter-0.9.0/clutter/x11/Makefile.in 2009-01-28 16:48:57.000000000 +0000 @@ -129,7 +129,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -154,6 +153,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -246,12 +246,13 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ - -DG_LOG_DOMAIN=\"ClutterX11\" \ - -I$(top_srcdir) \ + -DG_LOG_DOMAIN=\"ClutterX11\" \ + -DCLUTTER_COMPILATION \ + -I$(top_srcdir) \ -I$(top_srcdir)/clutter \ -I$(top_builddir)/clutter \ - $(CLUTTER_CFLAGS) \ - $(CLUTTER_DEBUG_CFLAGS) \ + $(CLUTTER_CFLAGS) \ + $(CLUTTER_DEBUG_CFLAGS) \ $(GCC_FLAGS) LDADD = $(CLUTTER_LIBS) diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/CODING_STYLE /tmp/VXszleoOf1/clutter-0.9.0/CODING_STYLE --- clutter-0.8.4/CODING_STYLE 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/CODING_STYLE 2009-01-28 08:12:44.000000000 +0000 @@ -0,0 +1,379 @@ +Clutter Coding Style +-------------------- + +This document is intended to be a short description of the preferred +coding style to be used for the Clutter source code. + +Coding style is a matter of consistency, readability and maintainance; +coding style is also completely arbitrary and a matter of taste. This +document will use examples at the very least to provide authoritative +and consistent answers to common questions regarding the coding style, +and will also try to identify the allowed exceptions. + +The examples will show the preferred coding style; the negative examples +will be clearly identified. Please, don't submit code to Clutter that +looks like any of these. + +Part of the rationales for these coding style rules are available either +in the kernel CodingStyle document or in Cairo's CODING_STYLE one. + +When in doubt, check the surrounding code and try to imitate it. + ++ Line width + +The maximum line width is 80 characters, whenever possible. + +Longer lines are usually an indication that you either need a function +or a pre-processor macro. + ++ Indentation + +Each new level is indented 2 or more spaces than the previous level: + + if (condition) + single_statement (); + +This can only be achieved using space characters. It may not be achieved +using tab characters alone, or using a combination of spaces and tabs. + +Do not change the editor's configuration to change the meaning of a +tab character (see below); code using tabs to indent will not be accepted +into Clutter. + +Even if two spaces for each indentation level allows deeper nesting than +8 spaces, Clutter favours self-documenting function names that can take +quite some space. For this reason you should avoid deeply nested code. + ++ Tab characters + +The tab character must always be expanded to spaces. If a literal +tab must be used inside the source, the tab must always be interpreted +according to its traditional meaning: + + Advance to the next column which is a multiple of 8. + ++ Braces + +Curly braces should not be used for single statement blocks: + + if (condition) + single_statement (); + else + another_single_statement (arg1); + +In case of multiple statements, curly braces should be put on another +indentation level: + + if (condition) + { + statement_1 (); + statement_2 (); + statement_3 (); + } + +If the condition or the arguments of the single statement need to be +split on multiple lines, like: + + if (condition_1 && + (condition_2 || condition_3)) + { + single_statement (); + } + else + { + another_single_statement (very_long_argument_1, + argument_2, + &return_argument_1, + &return_argument_2); + } + +In general, new blocks should be placed on a new indentation level, +like: + + int retval = 0; + + statement_1 (); + statement_2 (); + + { + int var1 = 42; + gboolean res = FALSE; + + res = statement_3 (var1); + + retval = res == TRUE ? -1 : 1; + } + +While curly braces for function definitions should rest on a new line +they should not add an indentation level: + + /* valid */ + static void + my_function (int argument) + { + do_my_things (); + } + + /* invalid */ + static void + my_function (int argument) { + do_my_things (); + } + + /* invalid */ + static void + my_function (int argument) + { + do_my_things (); + } + +Curly braces must not be placed on the same line as a condition: + + if (condition) { + statement_1 (); + statement_2 (); + } + ++ Functions + +Functions should be declared by placing the returned value on a separate +line from the function name: + + void + my_function (void) + { + } + +The arguments list must be broken into a new line for each argument, +with the argument names right aligned, taking into account pointers: + + void + my_function (some_type_t type, + another_type_t *a_pointer, + final_type_t another_type) + { + } + +The alignment also holds when invoking a function without breaking the +80 characters limit: + + align_function_arguments (first_argument, + second_argument, + third_argument); + +To respect the 80 characters limit do not break the function name from +the arguments: + + /* invalid */ + a_very_long_function_name_with_long_parameters + (argument_the_first, argument_the_second); + + /* valid */ + first_a = argument_the_first; + second_a = argument_the_second; + a_very_long_function_name_with_long_parameters (first_a, second_a); + ++ Whitespace + +Always put a space before a parenthesis but never after: + + /* valid */ + if (condition) + do_my_things (); + + /* valid */ + switch (condition) + { + } + + /* invalid */ + if(condition) + do_my_things(); + + /* invalid */ + if ( condition ) + do_my_things ( ); + +A switch() should open a block on a new indentation level, and each case +should start on the same indentation level as the curly braces, with the +case block on a new indentation level: + + /* valid */ + switch (condition) + { + case FOO: + do_foo (); + break; + + case BAR: + do_bar (); + break; + } + + /* invalid */ + switch (condition) { + case FOO: do_foo (); break; + case BAR: do_bar (); break; + } + +If a case block needs to declare new variables, the same rules as the +inner blocks (see above) apply; the break statement should be placed +outside of the inner block: + + switch (condition) + { + case FOO: + { + int foo; + + foo = do_foo (); + } + break; + + ... + } + +When declaring a structure type use newlines to separate logical sections +of the structure: + + struct _ClutterActorPrivate + { + /* fixed position */ + ClutterUnit fixed_x; + ClutterUnit fixed_y; + + ClutterRequestMode request_mode; + + /* requisition sizes */ + ClutterUnit request_width_for_height; + ClutterUnit request_min_width; + ClutterUnit request_natural_width; + ClutterUnit request_height_for_width; + ClutterUnit request_min_height; + ClutterUnit request_natural_height; + + ClutterActorBox allocation; + + ... + }; + +Do not eliminate whitespace and newlines just because something would +fit on 80 characters: + + /* invalid */ + if (condition) foo (); else bar (); + +Do eliminate trailing whitespace on any line, preferably as a separate +patch or commit. Never use empty lines at the beginning or at the end of +a file. + +Do enable the default git pre-commit hook that detect trailing +whitespace for you and help you to avoid corrupting Clutter's tree with +it. Do that as follows: + + chmod a+x .git/hooks/pre-commit + +You might also find the git-stripspace utility helpful which acts as a +filter to remove trailing whitespace as well as initial, final, and +duplicate blank lines. + ++ Headers + +Headers are special, for Clutter, in that they don't have to obey the +80 characters limit. The only major rule for headers is that the functions +definition should be vertically aligned in three columns: + + return value function_name (type argument, + type argument, + type argument); + +The maximum width of each column is given by the longest element in the +column: + + void clutter_type_set_property (ClutterType *type, + const gchar *value, + GError **error); + G_CONST_RETURN gchar *clutter_type_get_property (ClutterType *type); + +Public headers should never be included directly: + + #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) + #error "Only can be included directly." + #endif + +Public headers should also have inclusion guards (for internal usage) +and C++ guards: + + #ifndef __CLUTTER_HEADER_H__ + #define __CLUTTER_HEADER_H__ + + #include + + G_BEGIN_DECLS + + ... + + G_END_DECLS + + #endif /* __CLUTTER_HEADER_H__ */ + ++ GObject + +GObject classes definition and implementation require some additional +coding style notices. + +Typedef declarations should be places at the beginning of the file: + + typedef struct _ClutterActor ClutterActor; + typedef struct _ClutterActorPrivate ClutterActorPrivate; + typedef struct _ClutterActorClass ClutterActorClass; + +This includes enumeration types: + + typedef enum + { + CLUTTER_REQUEST_WIDTH_FOR_HEIGHT, + CLUTTER_REQUEST_HEIGHT_FOR_WIDTH + } ClutterRequestMode; + +And callback types: + + typedef void (* ClutterCallback) (ClutterActor *actor, + gpointer user_data); + +Instance structures should only contain the parent type and a pointer to a +private data structure: + + struct _ClutterRectangle + { + ClutterActor parent_instance; + + ClutterRectanglePrivate *priv; + }; + +All the properties should be stored inside the private data structure, which +is defined inside the source file. + +The private data structure should only be accessed internally using the +pointer inside the instance structure, and never using the +G_TYPE_INSTANCE_GET_PRIVATE() macro or the g_type_instance_get_private() +function. + +Always use the G_DEFINE_TYPE(), G_DEFINE_TYPE_WITH_CODE() macros, or +their abstract variants G_DEFINE_ABSTRACT_TYPE() and +G_DEFINE_ABSTRACT_TYPE_WITH_CODE(). + ++ Memory allocation + +When dynamically allocating data on the heap either use g_new() or, +if allocating multiple small data structures, g_slice_new(). + +Public structure types should always be returned after being zero-ed, +either explicitly, or by using g_new0() or g_slice_new0(). + ++ Macros + +Try to avoid macros unless strictly necessary. Remember to #undef them +at the end of a block or a series of functions needing them. + +Inline functions are usually preferable to macros. diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/compile /tmp/VXszleoOf1/clutter-0.9.0/compile --- clutter-0.8.4/compile 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/compile 2008-12-10 22:52:12.000000000 +0000 @@ -0,0 +1,142 @@ +#! /bin/sh +# Wrapper for compilers which do not understand `-c -o'. + +scriptversion=2005-05-14.22 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; +esac + +ofile= +cfile= +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/config.h.in /tmp/VXszleoOf1/clutter-0.9.0/config.h.in --- clutter-0.8.4/config.h.in 2008-11-28 18:24:51.000000000 +0000 +++ clutter-0.9.0/config.h.in 2009-01-28 16:49:31.000000000 +0000 @@ -127,6 +127,12 @@ /* Define to 1 if we have the XFIXES X extension */ #undef HAVE_XFIXES +/* Define the location where the catalogs will be installed */ +#undef LOCALEDIR + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +#undef NO_MINUS_C_MINUS_O + /* Name of package */ #undef PACKAGE diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/configure /tmp/VXszleoOf1/clutter-0.9.0/configure --- clutter-0.8.4/configure 2008-11-28 18:22:45.000000000 +0000 +++ clutter-0.9.0/configure 2009-01-28 16:48:54.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for clutter 0.8.4. +# Generated by GNU Autoconf 2.61 for clutter 0.9.0. # # Report bugs to . # @@ -728,8 +728,8 @@ # Identity of this package. PACKAGE_NAME='clutter' PACKAGE_TARNAME='clutter' -PACKAGE_VERSION='0.8.4' -PACKAGE_STRING='clutter 0.8.4' +PACKAGE_VERSION='0.9.0' +PACKAGE_STRING='clutter 0.9.0' PACKAGE_BUGREPORT='http://bugzilla.o-hand.com/enter_bug.cgi?product=Clutter' ac_unique_file="clutter/clutter.h" @@ -890,6 +890,8 @@ X11_TESTS_FALSE XINPUT_CFLAGS XINPUT_LIBS +HAVE_LIBDL_TRUE +HAVE_LIBDL_FALSE USE_GLES2_WRAPPER_TRUE USE_GLES2_WRAPPER_FALSE SDL_CONFIG @@ -912,8 +914,8 @@ CLUTTER_REQUIRES GLIB_PREFIX PANGO_PREFIX -GDKPIXBUF_PREFIX CLUTTER_DEBUG_CFLAGS +MAINTAINER_CFLAGS HTML_DIR GTKDOC_CHECK ENABLE_GTK_DOC_TRUE @@ -1473,7 +1475,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures clutter 0.8.4 to adapt to many kinds of systems. +\`configure' configures clutter 0.9.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1547,7 +1549,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of clutter 0.8.4:";; + short | recursive ) echo "Configuration of clutter 0.9.0:";; esac cat <<\_ACEOF @@ -1567,7 +1569,7 @@ runtime clutter verbose messages. minimum; Just glib cast checks and runtime clutter verbose messagaes. no; No glib asserts or checks and no runtime clutter - verbose messages. [default=minimum] + verbose messages. [default=yes] --enable-maintainer-flags=[no/yes] Use strict compiler flags [default=no] @@ -1684,7 +1686,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -clutter configure 0.8.4 +clutter configure 0.9.0 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1698,7 +1700,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by clutter $as_me 0.8.4, which was +It was created by clutter $as_me 0.9.0, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2392,7 +2394,7 @@ # Define the identity of the package. PACKAGE='clutter' - VERSION='0.8.4' + VERSION='0.9.0' cat >>confdefs.h <<_ACEOF @@ -2540,11 +2542,11 @@ CLUTTER_MAJOR_VERSION=0 -CLUTTER_MINOR_VERSION=8 -CLUTTER_MICRO_VERSION=4 -CLUTTER_VERSION=0.8.4 -CLUTTER_API_VERSION=0.8 -CLUTTER_MAJORMINOR=0.8 +CLUTTER_MINOR_VERSION=9 +CLUTTER_MICRO_VERSION=0 +CLUTTER_VERSION=0.9.0 +CLUTTER_API_VERSION=0.9 +CLUTTER_MAJORMINOR=0.9 @@ -2555,9 +2557,9 @@ -CLUTTER_LT_CURRENT=804 +CLUTTER_LT_CURRENT=900 CLUTTER_LT_REV=0 -CLUTTER_LT_AGE=804 +CLUTTER_LT_AGE=900 CLUTTER_LT_VERSION="$CLUTTER_LT_CURRENT:$CLUTTER_LT_REV:$CLUTTER_LT_AGE" CLUTTER_LT_LDFLAGS="-version-info $CLUTTER_LT_VERSION" @@ -2566,6 +2568,68 @@ # Checks for programs. +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +{ echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3484,68 +3548,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo done -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 -echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi -fi - - -{ echo "$as_me:$LINENO: result: $_am_result" >&5 -echo "${ECHO_T}$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - depcc="$CC" am_compiler_list= @@ -3655,6 +3657,132 @@ fi +if test "x$CC" != xcc; then + { echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 +echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6; } +else + { echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 +echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6; } +fi +set dummy $CC; ac_cc=`echo $2 | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + test -f conftest2.$ac_objext && { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + test -f conftest2.$ac_objext && { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f core conftest* + +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define NO_MINUS_C_MINUS_O 1 +_ACEOF + +fi + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + + #_AM_DEPENDENCIES([OBJC]) #AC_PROG_OBJC # Check whether --enable-static was given. @@ -4466,7 +4594,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4469 "configure"' > conftest.$ac_ext + echo '#line 4597 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7523,11 +7651,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7526: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7654: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7530: \$? = $ac_status" >&5 + echo "$as_me:7658: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7813,11 +7941,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7816: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7944: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7820: \$? = $ac_status" >&5 + echo "$as_me:7948: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7917,11 +8045,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7920: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8048: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7924: \$? = $ac_status" >&5 + echo "$as_me:8052: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10294,7 +10422,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:12926: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12802: \$? = $ac_status" >&5 + echo "$as_me:12930: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12899,11 +13027,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12902: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13030: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12906: \$? = $ac_status" >&5 + echo "$as_me:13034: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14497,11 +14625,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14500: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14628: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14504: \$? = $ac_status" >&5 + echo "$as_me:14632: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14601,11 +14729,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14604: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14732: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14608: \$? = $ac_status" >&5 + echo "$as_me:14736: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16821,11 +16949,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16824: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16952: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16828: \$? = $ac_status" >&5 + echo "$as_me:16956: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -17111,11 +17239,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17114: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17242: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:17118: \$? = $ac_status" >&5 + echo "$as_me:17246: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -17215,11 +17343,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17218: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17346: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:17222: \$? = $ac_status" >&5 + echo "$as_me:17350: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -21666,6 +21794,7 @@ echo "${ECHO_T}found" >&6; } fi else + BACKEND_PC_FILES="$BACKEND_PC_FILES x11" { echo "$as_me:$LINENO: result: found" >&5 echo "${ECHO_T}found" >&6; } fi @@ -21689,6 +21818,7 @@ _ACEOF X11_LIBS="$X11_LIBS -lXfixes" + BACKEND_PC_FILES="$BACKEND_PC_FILES xfixes" { echo "$as_me:$LINENO: result: found" >&5 echo "${ECHO_T}found" >&6; } else @@ -21715,6 +21845,7 @@ _ACEOF X11_LIBS="$X11_LIBS -lXdamage" + BACKEND_PC_FILES="$BACKEND_PC_FILES xdamage" { echo "$as_me:$LINENO: result: found" >&5 echo "${ECHO_T}found" >&6; } else @@ -21741,6 +21872,7 @@ _ACEOF X11_LIBS="$X11_LIBS -lXcomposite" + BACKEND_PC_FILES="$BACKEND_PC_FILES xcomposite" { echo "$as_me:$LINENO: result: found" >&5 echo "${ECHO_T}found" >&6; } else @@ -21862,8 +21994,85 @@ _ACEOF X11_LIBS="$X11_LIBS -lXi" + BACKEND_PC_FILES="$BACKEND_PC_FILES xi" fi +{ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dl_dlopen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } +if test $ac_cv_lib_dl_dlopen = yes; then + HAVE_LIBDL=yes +else + HAVE_LIBDL=no +fi + + if test "x$HAVE_LIBDL" != "xno"; then + HAVE_LIBDL_TRUE= + HAVE_LIBDL_FALSE='#' +else + HAVE_LIBDL_TRUE='#' + HAVE_LIBDL_FALSE= +fi + + clutter_gl_header="" use_gles2_wrapper="no" @@ -23361,6 +23570,17 @@ _ACEOF + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gl\"") >&5 + ($PKG_CONFIG --exists --print-errors "gl") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + have_gl_pc=yes +else + have_gl_pc=no +fi + CLUTTER_COGL="gl" cat >>confdefs.h <<\_ACEOF @@ -23745,6 +23965,11 @@ GLX_CFLAGS="$X11_CFLAGS" backendextra=x11 backendextralib="x11/libclutter-x11.la" + + # Mesa 7.3 added a GL pkg-config file, finally + if test "x$have_gl_pc" = "xyes"; then + BACKEND_PC_FILES="$BACKEND_PC_FILES gl" + fi ;; eglx) @@ -24302,10 +24527,10 @@ fi -CLUTTER_REQUIRES="pangocairo >= 1.18 glib-2.0 >= 2.14 gobject-2.0 gthread-2.0 gmodule-no-export-2.0 $BACKEND_PC_FILES $JSON_GLIB_PC" +CLUTTER_REQUIRES="cairo >= 1.4 pangocairo >= 1.18 gobject-2.0 >= 2.16 gthread-2.0 gmodule-no-export-2.0 $BACKEND_PC_FILES $JSON_GLIB_PC" if test "x$imagebackend" = "xgdk-pixbuf"; then - CLUTTER_REQUIRES="$CLUTTER_REQUIRES gdk-pixbuf-2.0" + CLUTTER_REQUIRES="$CLUTTER_REQUIRES gdk-pixbuf-2.0" fi @@ -24425,8 +24650,6 @@ # prefixes for fixing gtk-doc references GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`" PANGO_PREFIX="`$PKG_CONFIG --variable=prefix pango`" -GDKPIXBUF_PREFIX="`$PKG_CONFIG --variable=prefix gdk-pixbuf-2.0`" - @@ -24442,7 +24665,7 @@ if test "${enable_debug+set}" = set; then enableval=$enable_debug; else - enable_debug=minimum + enable_debug=yes fi @@ -24473,13 +24696,14 @@ if test "x$enable_maintainer_flags" = "xyes"; then - CPPFLAGS="$CPPFLAGS -Werror -Wall -Wshadow -Wcast-align -Wno-uninitialized" + MAINTAINER_CFLAGS="-Werror -Wall -Wshadow -Wcast-align -Wno-uninitialized -Wempty-body -Wformat-security -Winit-self" fi + # Check whether --with-html-dir was given. if test "${with_html_dir+set}" = set; then withval=$with_html_dir; @@ -26257,8 +26481,28 @@ sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES +glib_save_prefix="$prefix" +glib_save_exec_prefix="$exec_prefix" +glib_save_datarootdir="$datarootdir" +test "x$prefix" = xNONE && prefix=$ac_default_prefix +test "x$exec_prefix" = xNONE && exec_prefix=$prefix +datarootdir=`eval echo "${datarootdir}"` +if test "x$CATOBJEXT" = "x.mo" ; then + localedir=`eval echo "${libdir}/locale"` +else + localedir=`eval echo "${datadir}/locale"` +fi +prefix="$glib_save_prefix" +exec_prefix="$glib_save_exec_prefix" +datarootdir="$glib_save_datarootdir" + +cat >>confdefs.h <<_ACEOF +#define LOCALEDIR "$localedir" +_ACEOF + + -ac_config_files="$ac_config_files Makefile clutter/Makefile clutter/clutter-version.h clutter/clutter-json.h clutter/x11/Makefile clutter/x11/clutter-x11.pc clutter/glx/Makefile clutter/eglx/Makefile clutter/eglnative/Makefile clutter/fruity/Makefile clutter/osx/Makefile clutter/win32/Makefile clutter/win32/clutter-win32.pc clutter/sdl/Makefile clutter/cogl/Makefile clutter/cogl/common/Makefile clutter/cogl/cogl.h clutter/cogl/cogl-defines-gl.h:clutter/cogl/gl/cogl-defines.h.in clutter/cogl/cogl-defines-gles.h:clutter/cogl/gles/cogl-defines.h.in clutter/cogl/gl/Makefile clutter/cogl/gles/Makefile clutter/json/Makefile clutter/pango/Makefile tests/Makefile doc/Makefile doc/reference/Makefile doc/reference/clutter/Makefile doc/reference/clutter/version.xml doc/reference/cogl/Makefile doc/reference/cogl/version.xml doc/manual/clutter-manual.xml doc/manual/Makefile po/Makefile.in clutter.pc" +ac_config_files="$ac_config_files Makefile clutter/Makefile clutter/clutter-version.h clutter/clutter-json.h clutter/x11/Makefile clutter/x11/clutter-x11.pc clutter/glx/Makefile clutter/eglx/Makefile clutter/eglnative/Makefile clutter/fruity/Makefile clutter/osx/Makefile clutter/win32/Makefile clutter/win32/clutter-win32.pc clutter/sdl/Makefile clutter/cogl/Makefile clutter/cogl/common/Makefile clutter/cogl/cogl.h clutter/cogl/cogl-defines-gl.h:clutter/cogl/gl/cogl-defines.h.in clutter/cogl/cogl-defines-gles.h:clutter/cogl/gles/cogl-defines.h.in clutter/cogl/gl/Makefile clutter/cogl/gles/Makefile clutter/json/Makefile clutter/pango/Makefile tests/Makefile tests/conform/Makefile tests/data/Makefile tests/interactive/Makefile tests/micro-bench/Makefile tests/tools/Makefile doc/Makefile doc/reference/Makefile doc/reference/clutter/Makefile doc/reference/clutter/version.xml doc/reference/cogl/Makefile doc/reference/cogl/version.xml doc/manual/clutter-manual.xml doc/manual/Makefile po/Makefile.in clutter.pc" cat >confcache <<\_ACEOF @@ -26385,6 +26629,13 @@ Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${HAVE_LIBDL_TRUE}" && test -z "${HAVE_LIBDL_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"HAVE_LIBDL\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"HAVE_LIBDL\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi if test -z "${USE_GLES2_WRAPPER_TRUE}" && test -z "${USE_GLES2_WRAPPER_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_GLES2_WRAPPER\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -26727,7 +26978,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by clutter $as_me 0.8.4, which was +This file was extended by clutter $as_me 0.9.0, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -26780,7 +27031,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -clutter config.status 0.8.4 +clutter config.status 0.9.0 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -26922,6 +27173,11 @@ "clutter/json/Makefile") CONFIG_FILES="$CONFIG_FILES clutter/json/Makefile" ;; "clutter/pango/Makefile") CONFIG_FILES="$CONFIG_FILES clutter/pango/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "tests/conform/Makefile") CONFIG_FILES="$CONFIG_FILES tests/conform/Makefile" ;; + "tests/data/Makefile") CONFIG_FILES="$CONFIG_FILES tests/data/Makefile" ;; + "tests/interactive/Makefile") CONFIG_FILES="$CONFIG_FILES tests/interactive/Makefile" ;; + "tests/micro-bench/Makefile") CONFIG_FILES="$CONFIG_FILES tests/micro-bench/Makefile" ;; + "tests/tools/Makefile") CONFIG_FILES="$CONFIG_FILES tests/tools/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/reference/Makefile") CONFIG_FILES="$CONFIG_FILES doc/reference/Makefile" ;; "doc/reference/clutter/Makefile") CONFIG_FILES="$CONFIG_FILES doc/reference/clutter/Makefile" ;; @@ -27156,6 +27412,8 @@ X11_TESTS_FALSE!$X11_TESTS_FALSE$ac_delim XINPUT_CFLAGS!$XINPUT_CFLAGS$ac_delim XINPUT_LIBS!$XINPUT_LIBS$ac_delim +HAVE_LIBDL_TRUE!$HAVE_LIBDL_TRUE$ac_delim +HAVE_LIBDL_FALSE!$HAVE_LIBDL_FALSE$ac_delim USE_GLES2_WRAPPER_TRUE!$USE_GLES2_WRAPPER_TRUE$ac_delim USE_GLES2_WRAPPER_FALSE!$USE_GLES2_WRAPPER_FALSE$ac_delim SDL_CONFIG!$SDL_CONFIG$ac_delim @@ -27178,8 +27436,8 @@ CLUTTER_REQUIRES!$CLUTTER_REQUIRES$ac_delim GLIB_PREFIX!$GLIB_PREFIX$ac_delim PANGO_PREFIX!$PANGO_PREFIX$ac_delim -GDKPIXBUF_PREFIX!$GDKPIXBUF_PREFIX$ac_delim CLUTTER_DEBUG_CFLAGS!$CLUTTER_DEBUG_CFLAGS$ac_delim +MAINTAINER_CFLAGS!$MAINTAINER_CFLAGS$ac_delim HTML_DIR!$HTML_DIR$ac_delim GTKDOC_CHECK!$GTKDOC_CHECK$ac_delim ENABLE_GTK_DOC_TRUE!$ENABLE_GTK_DOC_TRUE$ac_delim @@ -27215,7 +27473,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 81; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 83; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 @@ -27833,7 +28091,7 @@ echo " Image backend: ${imagebackend}" echo " Target library: ${clutterbackendlib}" echo " Debug level: ${enable_debug}" -echo " Compiler flags: ${CPPFLAGS}" +echo " Compiler flags: ${CPPFLAGS} ${MAINTAINER_CFLAGS}" echo " Build API Documentation: ${enable_gtk_doc}" echo " Build Manual Documentation: ${enable_manual}" echo "" diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/configure.ac /tmp/VXszleoOf1/clutter-0.9.0/configure.ac --- clutter-0.8.4/configure.ac 2008-11-28 18:17:34.000000000 +0000 +++ clutter-0.9.0/configure.ac 2009-01-28 16:47:15.000000000 +0000 @@ -2,8 +2,8 @@ # An odd micro number indicates in-progress development, (eg. from CVS) # An even micro number indicates a released version. m4_define([clutter_major_version], [0]) -m4_define([clutter_minor_version], [8]) -m4_define([clutter_micro_version], [4]) +m4_define([clutter_minor_version], [9]) +m4_define([clutter_micro_version], [0]) m4_define([clutter_version], [clutter_major_version.clutter_minor_version.clutter_micro_version]) @@ -56,7 +56,7 @@ dnl ======================================================================== # Checks for programs. -AC_PROG_CC +AM_PROG_CC_C_O #_AM_DEPENDENCIES([OBJC]) #AC_PROG_OBJC AC_DISABLE_STATIC @@ -177,6 +177,7 @@ AC_MSG_RESULT([found]) fi else + BACKEND_PC_FILES="$BACKEND_PC_FILES x11" AC_MSG_RESULT([found]) fi @@ -185,6 +186,7 @@ if test "x$have_xfixes" = "xyes"; then AC_DEFINE(HAVE_XFIXES, 1, [Define to 1 if we have the XFIXES X extension]) X11_LIBS="$X11_LIBS -lXfixes" + BACKEND_PC_FILES="$BACKEND_PC_FILES xfixes" AC_MSG_RESULT([found]) else AC_MSG_RESULT([not found]) @@ -195,6 +197,7 @@ if test "x$have_xdamage" = "xyes"; then AC_DEFINE(HAVE_XDAMAGE, 1, [Define to 1 if we have the XDAMAGE X extension]) X11_LIBS="$X11_LIBS -lXdamage" + BACKEND_PC_FILES="$BACKEND_PC_FILES xdamage" AC_MSG_RESULT([found]) else AC_MSG_RESULT([not found]) @@ -205,6 +208,7 @@ if test "x$have_xcomposite" = "xyes"; then AC_DEFINE(HAVE_XCOMPOSITE, 1, [Define to 1 if we have the XCOMPOSITE X extension]) X11_LIBS="$X11_LIBS -lXcomposite" + BACKEND_PC_FILES="$BACKEND_PC_FILES xcomposite" AC_MSG_RESULT([found]) else AC_MSG_RESULT([not found]) @@ -240,8 +244,14 @@ if test "x$xinput" = "xyes"; then AC_DEFINE(USE_XINPUT, 1, Use the XINPUT X extension) X11_LIBS="$X11_LIBS -lXi" + BACKEND_PC_FILES="$BACKEND_PC_FILES xi" fi +dnl This is only used to decide whether to build +dnl tests/tools/disable-npots.la +AC_CHECK_LIB(dl, dlopen, HAVE_LIBDL=yes, HAVE_LIBDL=no) +AM_CONDITIONAL(HAVE_LIBDL, test "x$HAVE_LIBDL" != "xno") + clutter_gl_header="" use_gles2_wrapper="no" @@ -365,6 +375,8 @@ CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_GLX" AC_DEFINE([HAVE_CLUTTER_GLX], 1, [Have the GLX backend]) + PKG_CHECK_EXISTS([gl], [have_gl_pc=yes], [have_gl_pc=no]) + CLUTTER_COGL="gl" AC_DEFINE([HAVE_COGL_GL], 1, [Have GL for rendering]) @@ -383,6 +395,11 @@ GLX_CFLAGS="$X11_CFLAGS" backendextra=x11 backendextralib="x11/libclutter-x11.la" + + # Mesa 7.3 added a GL pkg-config file, finally + if test "x$have_gl_pc" = "xyes"; then + BACKEND_PC_FILES="$BACKEND_PC_FILES gl" + fi ;; eglx) @@ -515,10 +532,10 @@ AC_SUBST(JSON_PREFIX) AM_CONDITIONAL(LOCAL_JSON_GLIB, test "x$have_json" = "xno") -CLUTTER_REQUIRES="pangocairo >= 1.18 glib-2.0 >= 2.14 gobject-2.0 gthread-2.0 gmodule-no-export-2.0 $BACKEND_PC_FILES $JSON_GLIB_PC" +CLUTTER_REQUIRES="cairo >= 1.4 pangocairo >= 1.18 gobject-2.0 >= 2.16 gthread-2.0 gmodule-no-export-2.0 $BACKEND_PC_FILES $JSON_GLIB_PC" if test "x$imagebackend" = "xgdk-pixbuf"; then - CLUTTER_REQUIRES="$CLUTTER_REQUIRES gdk-pixbuf-2.0" + CLUTTER_REQUIRES="$CLUTTER_REQUIRES gdk-pixbuf-2.0" fi PKG_CHECK_MODULES(CLUTTER_DEPS, [$CLUTTER_REQUIRES]) @@ -528,10 +545,8 @@ # prefixes for fixing gtk-doc references GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`" PANGO_PREFIX="`$PKG_CONFIG --variable=prefix pango`" -GDKPIXBUF_PREFIX="`$PKG_CONFIG --variable=prefix gdk-pixbuf-2.0`" AC_SUBST(GLIB_PREFIX) AC_SUBST(PANGO_PREFIX) -AC_SUBST(GDKPIXBUF_PREFIX) dnl ======================================================================== @@ -575,8 +590,9 @@ enable_maintainer_flags=maintainer_flags_default) if test "x$enable_maintainer_flags" = "xyes"; then - CPPFLAGS="$CPPFLAGS -Werror -Wall -Wshadow -Wcast-align -Wno-uninitialized" + MAINTAINER_CFLAGS="-Werror -Wall -Wshadow -Wcast-align -Wno-uninitialized -Wempty-body -Wformat-security -Winit-self" fi +AC_SUBST(MAINTAINER_CFLAGS) dnl = GTK Doc check ======================================================== @@ -632,6 +648,7 @@ ALL_LINGUAS="" AM_GLIB_GNU_GETTEXT +GLIB_DEFINE_LOCALEDIR(LOCALEDIR) AC_CONFIG_FILES([ Makefile @@ -658,6 +675,11 @@ clutter/json/Makefile clutter/pango/Makefile tests/Makefile + tests/conform/Makefile + tests/data/Makefile + tests/interactive/Makefile + tests/micro-bench/Makefile + tests/tools/Makefile doc/Makefile doc/reference/Makefile doc/reference/clutter/Makefile @@ -688,7 +710,7 @@ echo " Image backend: ${imagebackend}" echo " Target library: ${clutterbackendlib}" echo " Debug level: ${enable_debug}" -echo " Compiler flags: ${CPPFLAGS}" +echo " Compiler flags: ${CPPFLAGS} ${MAINTAINER_CFLAGS}" echo " Build API Documentation: ${enable_gtk_doc}" echo " Build Manual Documentation: ${enable_manual}" echo "" diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/debian/changelog /tmp/VXszleoOf1/clutter-0.9.0/debian/changelog --- clutter-0.8.4/debian/changelog 2009-02-09 09:12:07.000000000 +0000 +++ clutter-0.9.0/debian/changelog 2009-02-09 09:12:08.000000000 +0000 @@ -1,3 +1,9 @@ +clutter (0.9.0-0ubuntu1~ppa1) jaunty; urgency=low + + * New upstream release + + -- Michael Vogt Mon, 09 Feb 2009 09:30:05 +0100 + clutter (0.8.4-1ubuntu1) jaunty; urgency=low * Merge from debian unstable, remaining changes: (LP: #305089) diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/debian/control /tmp/VXszleoOf1/clutter-0.9.0/debian/control --- clutter-0.8.4/debian/control 2009-02-09 09:12:07.000000000 +0000 +++ clutter-0.9.0/debian/control 2009-02-09 09:12:08.000000000 +0000 @@ -7,7 +7,7 @@ Build-Depends: debhelper (>= 5), cdbs, libgl1-mesa-dev|libgl-dev, libgtk2.0-dev, gtk-doc-tools Standards-Version: 3.7.2 -Package: libclutter-0.8-0 +Package: libclutter-0.9-0 Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} @@ -16,10 +16,10 @@ fast, mainly 2D single window applications such as media box UIs, presentations, kiosk style applications and so on. -Package: libclutter-0.8-dev +Package: libclutter-0.9-dev Section: libdevel Architecture: any -Depends: libclutter-0.8-0 (= ${binary:Version}), pkg-config, libgtk2.0-dev, libgl1-mesa-dev|libgl-dev, ${misc:Depends} +Depends: libclutter-0.9-0 (= ${binary:Version}), pkg-config, libgtk2.0-dev, libgl1-mesa-dev|libgl-dev, ${misc:Depends} Suggests: libclutter-doc Description: Open GL based interactive canvas library (development files) Clutter is an Open GL based interactive canvas library, designed for creating @@ -28,11 +28,11 @@ . This package contains the development files. -Package: libclutter-0.8-dbg +Package: libclutter-0.9-dbg Section: libdevel Priority: extra Architecture: any -Depends: libclutter-0.8-0 (= ${binary:Version}) +Depends: libclutter-0.9-0 (= ${binary:Version}) Description: Open GL based interactive canvas library (debug files) Clutter is an Open GL based interactive canvas library, designed for creating fast, mainly 2D single window applications such as media box UIs, diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/debian/libclutter-0.8-0.install /tmp/VXszleoOf1/clutter-0.9.0/debian/libclutter-0.8-0.install --- clutter-0.8.4/debian/libclutter-0.8-0.install 2009-02-09 09:12:07.000000000 +0000 +++ clutter-0.9.0/debian/libclutter-0.8-0.install 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -debian/tmp/usr/lib/*.so.* diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/debian/libclutter-0.8-dev.examples /tmp/VXszleoOf1/clutter-0.9.0/debian/libclutter-0.8-dev.examples --- clutter-0.8.4/debian/libclutter-0.8-dev.examples 2009-02-09 09:12:07.000000000 +0000 +++ clutter-0.9.0/debian/libclutter-0.8-dev.examples 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -tests/*.c -tests/*.png diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/debian/libclutter-0.8-dev.install /tmp/VXszleoOf1/clutter-0.9.0/debian/libclutter-0.8-dev.install --- clutter-0.8.4/debian/libclutter-0.8-dev.install 2009-02-09 09:12:07.000000000 +0000 +++ clutter-0.9.0/debian/libclutter-0.8-dev.install 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -debian/tmp/usr/lib/*.so -debian/tmp/usr/lib/pkgconfig/ -debian/tmp/usr/include/ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/debian/libclutter-0.9-0.install /tmp/VXszleoOf1/clutter-0.9.0/debian/libclutter-0.9-0.install --- clutter-0.8.4/debian/libclutter-0.9-0.install 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/debian/libclutter-0.9-0.install 2009-02-09 09:12:08.000000000 +0000 @@ -0,0 +1 @@ +debian/tmp/usr/lib/*.so.* diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/debian/libclutter-0.9-dev.examples /tmp/VXszleoOf1/clutter-0.9.0/debian/libclutter-0.9-dev.examples --- clutter-0.8.4/debian/libclutter-0.9-dev.examples 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/debian/libclutter-0.9-dev.examples 2009-02-09 09:12:08.000000000 +0000 @@ -0,0 +1,2 @@ +tests/*.c +tests/*.png diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/debian/libclutter-0.9-dev.install /tmp/VXszleoOf1/clutter-0.9.0/debian/libclutter-0.9-dev.install --- clutter-0.8.4/debian/libclutter-0.9-dev.install 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/debian/libclutter-0.9-dev.install 2009-02-09 09:12:08.000000000 +0000 @@ -0,0 +1,3 @@ +debian/tmp/usr/lib/*.so +debian/tmp/usr/lib/pkgconfig/ +debian/tmp/usr/include/ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/doc/Makefile.in --- clutter-0.8.4/doc/Makefile.in 2008-11-28 18:22:48.000000000 +0000 +++ clutter-0.9.0/doc/Makefile.in 2009-01-28 16:48:57.000000000 +0000 @@ -105,7 +105,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -130,6 +129,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/manual/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/doc/manual/Makefile.in --- clutter-0.8.4/doc/manual/Makefile.in 2008-11-28 18:22:48.000000000 +0000 +++ clutter-0.9.0/doc/manual/Makefile.in 2009-01-28 16:48:58.000000000 +0000 @@ -94,7 +94,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -119,6 +118,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/ChangeLog /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/ChangeLog --- clutter-0.8.4/doc/reference/ChangeLog 2008-11-13 14:44:33.000000000 +0000 +++ clutter-0.9.0/doc/reference/ChangeLog 2009-01-28 08:12:46.000000000 +0000 @@ -1,6 +1,14 @@ -2008-11-04 Thomas Wood +2008-12-08 Emmanuele Bassi - Merge from trunk: + * clutter/clutter-docs.xml: + * clutter/clutter-sections.txt: Add ClutterBindingPool + section and link. + +2008-11-12 Emmanuele Bassi + + * clutter/clutter-sections.txt: Add new symbols. + +2008-10-17 Emmanuele Bassi * clutter/clutter-sections.txt: Add the new ClutterColor symbols. Binary files /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/alpha-func.png and /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/alpha-func.png differ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/clutter-animation-tutorial.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/clutter-animation-tutorial.xml --- clutter-0.8.4/doc/reference/clutter/clutter-animation-tutorial.xml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/clutter-animation-tutorial.xml 2009-01-28 16:47:41.000000000 +0000 @@ -0,0 +1,558 @@ + + + + Matthew + Allum + +
+ mallum@openedhand.com +
+
+
+
+ + Creating Animations with Clutter + + + + With Clutter using hardware accelration for graphics rendering, + complex and fast animations are possible. This chapter describes basic + techniques and the utilities Clutter provides in aiding animation + creation. + + + +
+ Basic Animations + + + + The most basic way to create animations with Clutter is via the use of + g_timeout_add(). This enables a callback function to be called at a + defined interval. The callback function can then modify actors visual + properties as to produce an animation. + + + + + + Simple Rotation... + + +struct RotationClosure { + ClutterActor *actor; + ClutterFixed final_angle; + ClutterFixed current_angle; +}; + +static gboolean +rotate_actor (gpointer data) +{ + RotationClosure *clos = data; + + clutter_actor_set_rotationx (clos->actor, clos->current_angle, 0, 0, 0); + + /* add one degree */ + clos->current_angle += COGL_FIXED_ONE; + + if (clos->current_angle == clos->final_angle) + return FALSE; + + return TRUE; +} + +static void +rotate_actor_cleanup (gpointer data) +{ + RotationClosure *clos = data; + + g_object_unref (clos->actor); + g_free (clos); +} + +... + RotationClosure *clos = NULL; + + clos = g_new (RotationClosure, 1); + clos->actor = g_object_ref (an_actor); + clos->final_angle = CLUTTER_FLOAT_TO_FIXED (360.0); + clos->current_angle = 0; + + g_timeout_add_full (1000 / 360, /* fps to interval in milliseconds */ + rotate_actor, + clos, + rotate_actor_cleanup); + + + + Priorities + + + %G_PRIORITY_DEFAULT should always be used as the timeouts priority + (in case of g_timeout_add_full()) as not to intefere with Clutter's + scheduling of repaints and input event handling. + + + + +
+
+ Timelines + + #ClutterTimelines abstract a set period of time with a set frame + rate at which to call a provided callback. + + + + #ClutterTimelines also extend the timeout sources functionality + further by: + + + + Having a set duration (in milliseconds) and a set + 'frame rate' - that is, the rate at which the callback is + called + Passing current progress information to the + callback + Handling 'dropped frames' and guarenteeing the set + duration by skipping over frames if the callback cannot keep up with + the set frame rate + Querying the number of milliseconds elapsed between + the current and previous callback. + Allowing the timeline to be modified on the fly as + well as being stopped, started, looped, rewound and + reversed + Using a #ClutterTimeoutPool to more efficiently + schedule multiple timeout sources without incurring in potential + starvation of the main loop slices + + + + A Timeline is created with; + + + +clutter_timeline_new (n_frames, frames_per_seconds); + + + + Taking a number of frames and a frames per second, or by; + + + +clutter_timeline_new_for_duration (msecs); + + + + Which takes the duration of the timeline in milliseconds with a + default frame rate (See clutter_get_default_frame_rate()). + + + + + The speed, duration and number of frames of the timeline then be + modifed via the objects properties and API calls. The timeline can + be made to loop by setting its "loop" property to %TRUE. + + + + + The timelines is started via clutter_timeline_start() and its + playback further manipulated by the clutter_timeline_pause(), + clutter_timeline_stop(), clutter_timeline_rewind() and + clutter_timeline_skip() calls. + + + + + By attaching a handler to the timeline's #ClutterTimeline::new-frame + signal a timeline can then be used to drive an animation by altering + an actor's visual properties in this callback. The callback looks like: + + + +void +on_new_frame (ClutterTimeline *timeline, + gint frame_num, + gpointer user_data) +{ +} + + + + The frame_num parameter is set to the timeline's + current frame number (which is between 1 and the "num-frames" property). + This value can be used to compute the state of a particular animation + that is dependant on the frame numer. The clutter_timeline_get_progress() + function can also be used to get a normalised value of the timeline's + current position between 0 and 1. + + + + + Timelines can also be played in reverse by setting the direction using + clutter_timeline_set_direction(), and can also have a one-time delay set + before they begin playing by using clutter_timeline_set_delay(). + + + + + Timelines can also control a pyshical simulation; the + clutter_timeline_get_delta() function allows retrieving the number of + frames and milliseconds elapsed since the previous callback to ensure + the physics engine to be able to take the actual time elapsed between + iterations into account. + + + + + + The following example demonstrates rotating an actor with a timeline. + + +#include <clutter/clutter.h> + +void +on_new_frame (ClutterTimeline *timeline, + gint frame_num, + gpointer data) +{ + ClutterActor *actor = CLUTTER_ACTOR(data); + + clutter_actor_set_rotation (actor, CLUTTER_Z_AXIS, + (gdouble) frame_num, + clutter_actor_get_width (actor) / 2, + clutter_actor_get_height (actor) / 2, + 0); +} + +int +main (int argc, char *argv[]) +{ + ClutterTimeline *timeline; + + ClutterActor *stage, *actor; + GdkPixbuf *pixbuf; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + + pixbuf = gdk_pixbuf_new_from_file ("an-image.png", NULL); + + actor = clutter_texture_new_from_pixbuf (pixbuf); + + clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor); + + clutter_actor_set_position (actor, 100, 100); + + timeline = clutter_timeline_new_for (360, 60); /* one degree per frame */ + clutter_timeline_set_loop (timeline, TRUE); + + g_signal_connect (timeline, "new-frame", G_CALLBACK (on_new_frame), actor); + + clutter_actor_show_all (stage); + + clutter_timeline_start (timeline); + + clutter_main(); + + return 0; +} + + + + + Multiple timelines can be sequenced in order by means of the + #ClutterScore. See the #ClutterScore documentation for more details on + using this. + + +
+
+ Behaviours + + + With a large application containing many animations, the use of just + timelines can become unwieldy and difficult to manage with much code + duplication in the new-frame handlers that can require over complex + code changes for minor animation modifications. To ease these + problems the #ClutterAlpha and #ClutterBehaviour classes were created. + + + + + #ClutterAlpha and #ClutterBehaviour attempt to generalise the + new-frame function by defining common actions or behaviours that can + be quickly modified, applied to multiple actors or mixed on a single + actor. + + + + + A ClutterAlpha is simply a 'function of time' (not a pixel alpha channel!). + It is created by referencing a source timeline and an "easing mode" which + produces a value between -1 and 2 depending on the progress of the + timeline. Clutter provides various easing modes, as described by + the #ClutterAnimationMode enumeration. It is also possible to register + a new animation mode using clutter_alpha_register_func() or to provide + a custom #ClutterAlphaFunc for a specific #ClutterAlpha instance. + + + + + A Behaviour is created with a #ClutterAlpha and a set of limits for + whatever the behaviour modifies in an actor. The current #ClutterAlpha + value is then mapped to a value between these limits and this value + set on any applied actors. With the #ClutterAlpha's underlying + timeline playing the produced value will change and the behaviour + will animate the actor. + + + + + A #ClutterBehaviour is effectively 'driven' by a supplied #ClutterAlpha + and when then applied to an actor it will modify a visual property or + feature of the actor dependant on the Alpha's value. For example a + path based behaviour applied to an actor will alter its position + along the path dependant on the current alpha value over time. The + actual motion will depend on the chosen "easing mode". + + + + + Multiple behaviours can of course be applied to an actor as well as + a single behaviour being applied to multiple actors. The separation + of timelines, alphas and behaviours allows for a single timeline to + drive many behaviours each potentially using different alpha + functions. Behaviour parameters can also be changed on the fly. + + + + + +
+ Effects of alpha functions on a path + +
+ The actors position between the path's end points directly correlates + to the #ClutterAlpha's current alpha value driving the behaviour. With + the #ClutterAlpha's animation mode set to %CLUTTER_LINEAR the actor + will follow the path at a constant velocity, but when changing to + %CLUTTER_EASE_SINE_IN_OUT the actor initially accelerates before quickly + decelerating. +
+
+ +
+ + + The behaviours included in Clutter are + + + + + + + #ClutterBehaviourDepth + Changes the depth of actors + + + #ClutterBehaviourEllipse + Moves actors along an ellipsis + + + #ClutterBehaviourOpacity + Changes the opacity of actors + + + #ClutterBehaviourPath + Moves actors along a path + + + #ClutterBehaviourRotate + Rotates actors along an axis + + + #ClutterBehaviourScale + Changes the scaling factors of + actors + + + + + + + + The following example demonstrates an ellipse behaviour in action. + + +#include <clutter/clutter.h> + +int +main (int argc, char *argv[]) +{ + ClutterTimeline *timeline; + ClutterBehaviour *behave; + ClutterAlpha *alpha; + ClutterActor *stage, *actor; + GdkPixbuf *pixbuf; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + + pixbuf = gdk_pixbuf_new_from_file ("ohpowers.png", NULL); + + actor = clutter_texture_new_from_pixbuf (pixbuf); + + clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor); + + timeline = clutter_timeline_new_for_duration (4000); /* milliseconds */ + clutter_timeline_set_loop (timeline, TRUE); + + /* Set an alpha func to power the behaviour */ + alpha = clutter_alpha_new_full (timeline, CLUTTER_EASE_SINE_IN_OUT); + + behave = clutter_behaviour_ellipse_new (alpha, + 200, /* center x */ + 200, /* center y */ + 400, /* width */ + 300, /* height */ + CLUTTER_ROTATE_CW, /* direction */ + 0.0, /* initial angle */ + 360.0); /* final angle */ + + clutter_behaviour_apply (behave, actor); + + clutter_actor_show_all (stage); + + clutter_timeline_start (timeline); + + clutter_main(); + + /* clean up */ + g_object_unref (behave); + g_object_unref (timeline); + + return 0; +} + + + + + Behaviour parameters can be changed whilst a animation is running + + + There can be many #ClutterAlpha's attached to a single timeline. There + can be many behaviours for a #ClutterAlpha. There can be many behaviours + applied to an actor. A #ClutterScore can be used to chain many behaviour + together. + + + Combining behaviours that effect the same actor properties + (i.e two separate paths) will cause unexpected results. The values + will not be merged in any way with only the last applied behaviour taking + precedence. + + + Tips for implementing a new behaviour can be found here. + + +
+
+ Implicit Animations + + Using behaviours for simple animations of a single actor may + be too complicated, in terms of memory management and bookkeeping + of the object instances. For this reason, Clutter also provides a + simple animation API for implicit animations using properties of + an actor: clutter_actor_animate(). + + The clutter_actor_animate() family of functions will create + and use an implicit #ClutterAnimation instance, which will then + handle the animation of one or more #ClutterActor properties between + a range of values. + + + + The following example demonstrates how to use the + clutter_actor_animate() method to tween an actor + between the current position and a new set of coordinates. + The animation takes 200 milliseconds to complete and + uses a linear speed. + + + clutter_actor_animate (actor, CLUTTER_LINEAR, 200 + "x", 200, + "y", 200, + NULL); + + + + The clutter_actor_animate() method returns a #ClutterAnimation + instance that can be used to start, stop and modify the animation + while it's running. The #ClutterAnimation::completed signal will + be emitted when the animation has been completed. + + When the animation is complete it will be automatically + unreferenced, and disposed if nothing else is holding a reference + on it. + + Calling clutter_actor_animate() multiple times on an + actor which is being animated will cause the animation to be updated + with the new values. + + + + The following example demonstrates how to animate an actor + inside the signal handler for a button press event. If the + user presses the button on a new position while the animation + is running, the animation will be restarted with the new + final values updated. + + + static gboolean + on_button_press (ClutterActor *actor, + ClutterButtonEvent *event, + gpointer user_data) + { + clutter_actor_animate (actor, CLUTTER_EASE_SINE_OUT, 500, + "x", event->x, + "y", event->y, + NULL); + return TRUE; + } + + + +
+ +
+ Conclusion + + + Clutter provides a number of utility classes to aid animations and + complex animations can be produced by combining the various features + provided. + + + + + Of course animations can becreated outside of the Clutter animation + framework, as the framework is not expected to cover every kind of + possible animation scenario. + + + + + The animation functionality in Clutter is primarily suited to + building animations with a set or finite running time - i.e transitions + and the like. For animations involving variable input (such as touchscreen + handling) physical simulations may be more suited. + + + +
+
diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/clutter-animation.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/clutter-animation.xml --- clutter-0.8.4/doc/reference/clutter/clutter-animation.xml 2008-09-29 15:16:27.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/clutter-animation.xml 1970-01-01 01:00:00.000000000 +0100 @@ -1,600 +0,0 @@ - - - - Matthew - Allum - -
- mallum@openedhand.com -
-
-
-
- - Creating Animations with Clutter - - - - With Clutter using hardware accelration for graphics rendering, - complex and fast animations are possible. This chapter describes basic - techniques and the utilities Clutter provides in aiding animation - creation. - - - -
- Basic Animations - - - - The most basic way to create animations with Clutter is via the use of - g_timeout_add(). This enables a callback function to be called at a - defined interval. The callback function can then modify actors visual - properties as to produce an animation. - - - - - - Simple Rotation... - - -struct RotationClosure { - ClutterActor *actor; - ClutterFixed final_angle; - ClutterFixed current_angle; -}; - -static gboolean -rotate_actor (gpointer data) -{ - RotationClosure *clos = data; - - clutter_actor_set_rotationx (clos->actor, clos->current_angle, 0, 0, 0); - - clos->current_angle += CFX_ONE; - - if (clos->current_angle == clos->final_angle) - return FALSE; - - return TRUE; -} - -... - RotationClosure clos = { NULL, } - - clos.actor = an_actor; - clos.final_angle = CLUTTER_FLOAT_TO_FIXED (360.0); - clos.current_angle = 0; - - g_timeout_add (1000 / 360, /* fps to interval in milliseconds */ - rotate_actor, - &clos); - - - - Priorities - - - %G_PRIORITY_DEFAULT should always be used as the timeouts priority - (in case of g_timeout_add_full()) as not to intefere with Clutter's - scheduling of repaints and input event handling. - - - - -
-
- Timelines - - #ClutterTimelines abstract a set period of time with a set frame - rate at which to call a provided callback. - - - - #ClutterTimelines also extend the timeout sources functionality - further by: - - - - Having a set duration (in milliseconds) and a set - 'frame rate' - that is, the rate at which the callback is - called - Passing current progress information to the - callback - Handling 'dropped frames' and guarenteeing the set - duration by skipping over frames if the callback cannot keep up with - the set frame rate - Querying the number of milliseconds elapsed between - the current and previous callback. - Allowing the timeline to be modified on the fly as - well as being stopped, started, looped, rewound and - reversed - Using a #ClutterTimeoutPool to more efficiently - schedule multiple timeout sources without incurring in potential - starvation of the main loop slices - - - - A Timeline is created with; - - - -clutter_timeline_new (n_frames, frames_per_seconds); - - - - Taking a number of frames and a frames per second, or by; - - - -clutter_timeline_new_for_duration (msecs); - - - - Which takes the duration of the timeline in milliseconds with a - default frame rate (See clutter_get_default_frame_rate()). - - - - - The speed, duration and number of frames of the timeline then be - modifed via the objects properties and API calls. The timeline can - be made to loop by settings it "loop" property to %TRUE. - - - - - The timelines is started via clutter_timeline_start() and its - playback further manipulated by the clutter_timeline_pause(), - clutter_timeline_stop(), clutter_timeline_rewind() and - clutter_timeline_skip() calls. - - - - - By attaching a handler to the timeline's ClutterTimeline::new-frame - signal a timeline can then be used to drive an animation by altering - an actor's visual properties in this callback. The callback looks like: - - - -void -on_new_frame (ClutterTimeline *timeline, - gint frame_num, - gpointer user_data) -{ - -} - - - - The frame_num parameter is set to the timeline's - current frame number (which is between 0 and the "num-frames" property). - This value can be used to compute the state of a particular animation - that is dependant on the frame numer. The clutter_timeline_get_progress() - function can also be used to get a normalised value of the timeline's - current position between 0 and 1. - - - - - Timelines can also be played in reverse by setting the direction using - clutter_timeline_set_direction(), and can also have a one-time delay set - before they begin playing by using clutter_timeline_set_delay(). - - - - - Timelines can also control a pyshical simulation; the - clutter_timeline_get_delta() function allows retrieving the number of - frames and milliseconds elapsed since the previous callback to ensure - the physics engine to be able to take the actual time elapsed between - iterations into account. - - - - - - The following example demonstrates rotating an actor with a timeline. - - -#include <clutter/clutter.h> - -void -on_new_frame (ClutterTimeline *timeline, - gint frame_num, - gpointer data) -{ - ClutterActor *actor = CLUTTER_ACTOR(data); - - clutter_actor_set_rotation (actor, CLUTTER_Z_AXIS, - (gdouble) frame_num, - clutter_actor_get_width (actor) / 2, - clutter_actor_get_height (actor) / 2, - 0); -} - -int -main (int argc, char *argv[]) -{ - ClutterTimeline *timeline; - - ClutterActor *stage, *actor; - GdkPixbuf *pixbuf; - - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - - pixbuf = gdk_pixbuf_new_from_file ("an-image.png", NULL); - - actor = clutter_texture_new_from_pixbuf (pixbuf); - - clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor); - - clutter_actor_set_position (actor, 100, 100); - - timeline = clutter_timeline_new_for (360, 60); /* a degree per frame */ - clutter_timeline_set_loop (timeline, TRUE); - - g_signal_connect (timeline, "new-frame", G_CALLBACK (on_new_frame), actor); - - clutter_actor_show_all (stage); - - clutter_timeline_start (timeline); - - clutter_main(); - - return 0; -} - - - - - Multiple timelines can be sequenced in order by means of the - #ClutterScore. See the #ClutterScore documentation for more details on - using this. - - -
-
- Behaviours - - - With a large application containing many animations, the use of just - timelines can become unweldy and difficult to manage with much code - duplication in the new-frame handlers that can require over complex - code changes for minor animation modifications. To ease these - problems the #ClutterAlpha and #ClutterBehaviour classes were created. - - - - - #ClutterAlpha and #ClutterBehaviour attempt to generalise the - new-frame function by defining common actions or behaviours that can - be quickly modified, applied to multiple actors or mixed on a single - actor. - - - - - A ClutterAlpha is simply a 'function of time' (not pixel alpha!). It - is created by referencing a source timeline and a function which - produces a value between 0 and %CLUTTER_ALPHA_MAX dependant on the - timeline position. Various prebuilt alpha functions are included - with Clutter these include - - - - - - - %CLUTTER_ALPHA_RAMP_INC - Increasing ramp function - - - %CLUTTER_ALPHA_RAMP_DEC - Decreasing ramp function - - - %CLUTTER_ALPHA_RAMP - Full ramp function - - - %CLUTTER_ALPHA_SINE_INC - Increasing sine function - - - %CLUTTER_ALPHA_SINE_DEC - Decreasing sine function - - - %CLUTTER_ALPHA_SINE_HALF - Half sine function - - - %CLUTTER_ALPHA_SINE - Full sine function - - - %CLUTTER_ALPHA_SQUARE - Square waveform ("step") function - - - %CLUTTER_ALPHA_SMOOTHSTEP_INC - Increasing smooth transition step - function - - - %CLUTTER_ALPHA_SMOOTHSTEP_DEC - Decreasing smooth transition step - function - - - %CLUTTER_ALPHA_EXP_INC - Increasing exponential function - - - %CLUTTER_ALPHA_EXP_DEC - Decreasing exponential function - - - - - - A Behaviour is created with a #ClutterAlpha and a set of limits for - whatever the behaviour modifys actor wise. The current #ClutterAlpha - value is then mapped to a value between these limits and this value - set on any applied actors. With the #ClutterAlpha's underlying - timeline playing the produced value will change and the behaviour - will animate the actor. - - - - - A #ClutterBehaviour is effectively 'driven' by a supplied #ClutterAlpha and - when then applied to an actor it will modify a visual property or - feature of the actor dependant on the Alpha's value. For example a - path based behaviour applied to an actor will alter its position - along the path dependant on the current alpha value over time. The - actual motion will depend on the chosen #ClutterAlphaFunc - a - #CLUTTER_ALPHA_RAMP_INC making it to move at constant speed along the - path, a #CLUTTER_ALPHA_SINE making it alternate from one end of the - path to the other with non constant speed. - - - - - Multiple behaviours can of course be applied to an actor as well as - a single behaviour being applied to multiple actors. The separation - of timelines, alphas and behaviours allows for a single timeline to - drive many behaviours each potentially using different alpha - functions. Behaviour parameters can also be changed on the fly. - - - - - -
- Effects of alpha functions on a path - -
- The actors position between the path's end points directly correlates - to the #ClutterAlpha's current alpha value driving the behaviour. With - the #ClutterAlpha's function set to %CLUTTER_ALPHA_RAMP_INC the actor - will follow the path at a constant velocity, but when changing to - %CLUTTER_ALPHA_SINE_INC the actor initially accelerates before quickly - decelerating. -
-
- -
- - - The behaviours included in Clutter are - - - - - - - #ClutterBehaviourBspline - Moves actors along a B-spline path - - - #ClutterBehaviourDepth - Changes the depth of actors - - - #ClutterBehaviourEllipse - Moves actors along an ellipsis - - - #ClutterBehaviourOpacity - Changes the opacity of actors - - - #ClutterBehaviourPath - Moves actors along a path - - - #ClutterBehaviourRotate - Rotates actors along an axis - - - #ClutterBehaviourScale - Changes the scaling factors of - actors - - - - - - - - The following example demonstrates an ellipse behaviour in action. - - -#include <clutter/clutter.h> - -int -main (int argc, char *argv[]) -{ - ClutterTimeline *timeline; - ClutterBehaviour *behave; - ClutterAlpha *alpha; - ClutterActor *stage, *actor; - GdkPixbuf *pixbuf; - - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - - pixbuf = gdk_pixbuf_new_from_file ("ohpowers.png", NULL); - - actor = clutter_texture_new_from_pixbuf (pixbuf); - - clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor); - - timeline = clutter_timeline_new_for_duration (4000); /* milliseconds */ - clutter_timeline_set_loop (timeline, TRUE); - - /* Set an alpha func to power the behaviour */ - alpha = clutter_alpha_new_full (timeline, - CLUTTER_ALPHA_SINE, - NULL, NULL); - - behave = clutter_behaviour_ellipse_new (alpha, - 200, /* center x */ - 200, /* center y */ - 400, /* width */ - 300, /* height */ - CLUTTER_ROTATE_CW, /* direction */ - 0.0, /* initial angle */ - 360.0); /* final angle */ - - clutter_behaviour_apply (behave, actor); - - clutter_actor_show_all (stage); - - clutter_timeline_start (timeline); - - clutter_main(); - - /* clean up */ - g_object_unref (behave); - g_object_unref (timeline); - - return 0; -} - - - - - Behaviour parameters can be changed whilst a animation is running - - - There can be many #ClutterAlpha's attached to a single timeline. There - can be many behaviours for a #ClutterAlpha. There can be many behaviours - applied to an actor. A #ClutterScore can be used to chain many behaviour - together. - - - Combining behaviours that effect the same actor properties - (i.e two separate paths) will cause unexpected results. The values - will not be merged in any way with essentially a the last applied - behaviour taking precedence. - - - Tips for implementing a new behaviour can be found here. - - -
-
- Effects - - - - Clutter effects API provide a simplified abstraction for firing simple - transitions from code. Clutter effects are created from a - #ClutterEffectTemplate which is an abstraction of a timeline and - an alpha function. An effect template can be created with: - - - -ClutterEffectTemplate *etemplate = - clutter_effect_template_new_for_duration (2000, CLUTTER_ALPHA_RAMP_INC); - - - - This will create an effect template lasting 2000 milliseconds (2 - seconds) and use an alpha function of %CLUTTER_ALPHA_RAMP_INC, there - are other more advanced forms for creating effect templates from - existing timelines, as well as attaching a callback to be called - with user_data when the effect template is destroyed. - - - - - When we have an effect template we can create a temporary behaviour - animating an actor simply by issuing: - - - -clutter_effect_move (etemplate, actor, 23, 42, NULL, NULL); - - -and the actor will move from its current position to the coordinates -(23, 42) in 2 seconds. Effects can also be stacked, so calling: - - -clutter_effect_move (etemplate, actor, 23, 42, NULL, NULL); -clutter_effect_fade (etemplate, actor, 0, NULL, NULL); - - -The actor will move and fade out at the same time. - - - - Since effects return a #ClutterTimeline, you can stop an effect from - immediatly happening by calling clutter_timeline_stop () on the - returned timeline. - - - - - The timeline and all the effect infrastructure is unreferenced as soon - as the timeline emits the ClutterTimeline::completed signal. - - -
- -
- Conclusion - - - Clutter provides a number of utility classes to aid animations and - complex animations can be produced by combining the various features - provided. - - - - - Of course animations can be created outside of Clutter Utilities, - they are not expected to cover every kind of possible animation - scenario. - - - - - The animation functionality in Clutter is primarily suited to - building animations with a set or finite running time - i.e transitions - and the like. For animations involving variable input (such as touchscreen - handling) physical simulations may be more suited. - - - -
-
diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/clutter-docs.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/clutter-docs.sgml --- clutter-0.8.4/doc/reference/clutter/clutter-docs.sgml 2008-09-29 15:16:27.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/clutter-docs.sgml 1970-01-01 01:00:00.000000000 +0100 @@ -1,231 +0,0 @@ - - -]> - - - - Clutter &version; Reference Manual - Version &version; - - - 2008 - OpenedHand LTD - - - - - Permission is granted to copy, distribute and/or modify this - document under the terms of the GNU Free - Documentation License, Version 1.1 or any later - version published by the Free Software Foundation with no - Invariant Sections, no Front-Cover Texts, and no Back-Cover - Texts. You may obtain a copy of the GNU Free - Documentation License from the Free Software - Foundation by visiting their Web site or by writing - to: - -
- The Free Software Foundation, Inc., - 59 Temple Place - Suite 330, - Boston, MA 02111-1307, - USA -
-
-
-
- - - - - - - Clutter Core Reference - - - Abstract classes and interfaces - - - - - - - - Base actors - - - - - - - - - Container actors - - - - - - - - - Clutter Animation Framework - - - Clutter has a fully extensible animation framework - providing support for explicit and implicit animations of - single actors as well as groups of actors. - - - - Base classes - - - - - - - - - Behaviours - - - - - - - - - - - - Simple effects API - - - - - - - - Clutter Tools - - - General purpose API - - - - - - - - - - - - - User interface definition - - - - - - - Generic list model - - - - - - - - - Clutter Backends - - - Clutter is usually compiled against a specific drawing backend. - All backends have a common API for querying the underlying platform, - and some of them might have specific API exposed by Clutter. - - - - - - - - - Additional Documentation - - - This section contains additional useful documentation for - developing with Clutter. - - - - - - - - - - - - Index - - - - Index of deprecated symbols - - - - Index of new symbols in 0.2 - - - - Index of new symbols in 0.4 - - - - Index of new symbols in 0.6 - - - - Index of new symbols in 0.8 - - - - License - - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library 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 Library General Public License for - more details. - - - - You may obtain a copy of the GNU Library General - Public License from the Free Software Foundation by - visiting their Web - site or by writing to: - -
- Free Software Foundation, Inc. - 59 Temple Place - Suite 330 - Boston, MA 02111-1307 - USA -
-
-
- -
diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/clutter-docs.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/clutter-docs.xml --- clutter-0.8.4/doc/reference/clutter/clutter-docs.xml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/clutter-docs.xml 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,239 @@ + + +]> + + + + Clutter &version; Reference Manual + Version &version; + + + 2006,2007,2008 + OpenedHand LTD + + + + 2009 + Intel Corporation + + + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free + Documentation License, Version 1.1 or any later + version published by the Free Software Foundation with no + Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. You may obtain a copy of the GNU Free + Documentation License from the Free Software + Foundation by visiting their Web site or by writing + to: + +
+ The Free Software Foundation, Inc., + 59 Temple Place - Suite 330, + Boston, MA 02111-1307, + USA +
+
+
+
+ + + + + + + Clutter Core Reference + + + Abstract classes and interfaces + + + + + + + + Base actors + + + + + + + + + Container actors + + + + + + + + + Clutter Animation Framework + + + Clutter has a fully extensible animation framework + providing support for explicit and implicit animations of + single actors as well as groups of actors. + + + + Base classes + + + + + + + + + Behaviours + + + + + + + + + + + + High Level API + + + + + + + + + + Clutter Tools + + + General purpose API + + + + + + + + + + + + + + User interface definition + + + + + + + Generic list model + + + + + + + + + Clutter Backends + + + Clutter is usually compiled against a specific drawing backend. + All backends have a common API for querying the underlying platform, + and some of them might have specific API exposed by Clutter. + + + + + + + + + Additional Documentation + + + This section contains additional useful documentation for + developing with Clutter. + + + + + + + + + + + + Index + + + + Index of deprecated symbols + + + + Index of new symbols in 0.2 + + + + Index of new symbols in 0.4 + + + + Index of new symbols in 0.6 + + + + Index of new symbols in 0.8 + + + + License + + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library 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 Library General Public License for + more details. + + + + You may obtain a copy of the GNU Library General + Public License from the Free Software Foundation by + visiting their Web + site or by writing to: + +
+ Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307 + USA +
+
+
+ +
diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/clutter-sections.txt /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/clutter-sections.txt --- clutter-0.8.4/doc/reference/clutter/clutter-sections.txt 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/clutter-sections.txt 2009-01-30 12:41:02.000000000 +0000 @@ -2,17 +2,17 @@ clutter-media ClutterMedia ClutterMedia -ClutterMediaInterface +ClutterMediaIface clutter_media_set_uri clutter_media_get_uri clutter_media_set_playing clutter_media_get_playing -clutter_media_set_position -clutter_media_get_position -clutter_media_set_volume -clutter_media_get_volume +clutter_media_set_progress +clutter_media_get_progress +clutter_media_set_audio_volume +clutter_media_get_audio_volume clutter_media_get_can_seek -clutter_media_get_buffer_percent +clutter_media_get_buffer_fill clutter_media_get_duration clutter_media_set_filename @@ -28,26 +28,25 @@ clutter-units Unit conversion ClutterUnit -CLUTTER_UNITS_FROM_DEVICE -CLUTTER_UNITS_TO_DEVICE -CLUTTER_UNITS_FROM_FIXED -CLUTTER_UNITS_TO_FIXED +CLUTTER_UNITS_FORMAT CLUTTER_UNITS_FROM_FLOAT CLUTTER_UNITS_TO_FLOAT CLUTTER_UNITS_FROM_INT CLUTTER_UNITS_TO_INT + + +CLUTTER_UNITS_FROM_DEVICE +CLUTTER_UNITS_TO_DEVICE +CLUTTER_UNITS_FROM_FIXED +CLUTTER_UNITS_TO_FIXED CLUTTER_UNITS_FROM_PANGO_UNIT CLUTTER_UNITS_TO_PANGO_UNIT -CLUTTER_UNITS_TMP_FROM_DEVICE -CLUTTER_UNITS_TMP_TO_DEVICE -CLUTTER_UNITS_FROM_STAGE_WIDTH_PERCENTAGE -CLUTTER_UNITS_FROM_STAGE_HEIGHT_PERCENTAGE -CLUTTER_UNITS_FROM_PARENT_WIDTH_PERCENTAGE -CLUTTER_UNITS_FROM_PARENT_HEIGHT_PERCENTAGE CLUTTER_UNITS_FROM_MM -CLUTTER_UNITS_FROM_MMX CLUTTER_UNITS_FROM_POINTS -CLUTTER_UNITS_FROM_POINTSX +CLUTTER_UNITS_FROM_EM +clutter_units_mm +clutter_units_pt +clutter_units_em CLUTTER_MAXUNIT @@ -67,48 +66,6 @@
-clutter-label -ClutterLabel -ClutterLabel -ClutterLabelClass -clutter_label_new -clutter_label_new_with_text -clutter_label_new_full -clutter_label_set_text -clutter_label_get_text -clutter_label_set_font_name -clutter_label_get_font_name -clutter_label_set_color -clutter_label_get_color -clutter_label_set_ellipsize -clutter_label_get_ellipsize -clutter_label_set_line_wrap -clutter_label_get_line_wrap -clutter_label_set_line_wrap_mode -clutter_label_get_line_wrap_mode -clutter_label_get_layout -clutter_label_set_attributes -clutter_label_get_attributes -clutter_label_set_use_markup -clutter_label_get_use_markup -clutter_label_set_alignment -clutter_label_get_alignment -clutter_label_get_justify -clutter_label_set_justify - - -CLUTTER_LABEL -CLUTTER_IS_LABEL -CLUTTER_TYPE_LABEL -CLUTTER_LABEL_CLASS -CLUTTER_IS_LABEL_CLASS -CLUTTER_LABEL_GET_CLASS - -ClutterLabelPrivate -clutter_label_get_type -
- -
clutter-behaviour ClutterBehaviour ClutterBehaviour @@ -141,39 +98,24 @@ ClutterAlpha ClutterAlpha ClutterAlphaClass +ClutterAlphaFunc clutter_alpha_new clutter_alpha_new_full +clutter_alpha_new_with_func +clutter_alpha_set_timeline +clutter_alpha_get_timeline +clutter_alpha_set_mode +clutter_alpha_get_mode clutter_alpha_get_alpha -CLUTTER_ALPHA_MAX_ALPHA -ClutterAlphaFunc + + clutter_alpha_set_func clutter_alpha_set_closure -clutter_alpha_set_timeline -clutter_alpha_get_timeline -CLUTTER_ALPHA_RAMP_INC -clutter_ramp_inc_func -CLUTTER_ALPHA_RAMP_DEC -clutter_ramp_dec_func -CLUTTER_ALPHA_RAMP -clutter_ramp_func -CLUTTER_ALPHA_SINE -clutter_sine_func -CLUTTER_ALPHA_SINE_INC -clutter_sine_inc_func -CLUTTER_ALPHA_SINE_DEC -clutter_sine_dec_func -CLUTTER_ALPHA_SINE_HALF -clutter_sine_half_func -CLUTTER_ALPHA_SQUARE -clutter_square_func -CLUTTER_ALPHA_SMOOTHSTEP_INC -clutter_smoothstep_inc_func -CLUTTER_ALPHA_SMOOTHSTEP_DEC -clutter_smoothstep_dec_func -CLUTTER_ALPHA_EXP_INC -clutter_exp_inc_func -CLUTTER_ALPHA_EXP_DEC -clutter_exp_dec_func + + +clutter_alpha_register_closure +clutter_alpha_register_func + CLUTTER_ALPHA CLUTTER_IS_ALPHA @@ -181,29 +123,59 @@ CLUTTER_ALPHA_CLASS CLUTTER_IS_ALPHA_CLASS CLUTTER_ALPHA_GET_CLASS + ClutterAlphaPrivate clutter_alpha_get_type
-clutter-clone-texture -ClutterCloneTexture -ClutterCloneTexture -ClutterCloneTextureClass -clutter_clone_texture_new -clutter_clone_texture_get_parent_texture -clutter_clone_texture_set_parent_texture - -CLUTTER_CLONE_TEXTURE -CLUTTER_IS_CLONE_TEXTURE -CLUTTER_TYPE_CLONE_TEXTURE -CLUTTER_CLONE_TEXTURE_CLASS -CLUTTER_IS_CLONE_TEXTURE_CLASS -CLUTTER_CLONE_TEXTURE_GET_CLASS +clutter-clone +ClutterClone +ClutterClone +ClutterCloneClass +clutter_clone_new +clutter_clone_set_source +clutter_clone_get_source + +CLUTTER_CLONE +CLUTTER_IS_CLONE +CLUTTER_TYPE_CLONE +CLUTTER_CLONE_CLASS +CLUTTER_IS_CLONE_CLASS +CLUTTER_CLONE_GET_CLASS + +ClutterClonePrivate +clutter_clone_get_type +
+ +
+clutter-cairo-texture +ClutterCairoTexture +ClutterCairoTexture +ClutterCairoTextureClass +clutter_cairo_texture_new +clutter_cairo_texture_set_surface_size +clutter_cairo_texture_get_surface_size + + +clutter_cairo_texture_create +clutter_cairo_texture_create_region + + +clutter_cairo_set_source_color + + +CLUTTER_TYPE_CAIRO_TEXTURE +CLUTTER_CAIRO_TEXTURE +CLUTTER_IS_CAIRO_TEXTURE +CLUTTER_CAIRO_TEXTURE_CLASS +CLUTTER_IS_CAIRO_TEXTURE_CLASS +CLUTTER_CAIRO_TEXTURE_GET_CLASS + -ClutterCloneTexturePrivate -clutter_clone_texture_get_type +ClutterCairoTexturePrivate +clutter_cairo_texture_get_type
@@ -380,7 +352,9 @@ clutter_actor_get_y clutter_actor_move_by clutter_actor_set_rotation +clutter_actor_set_z_rotation_from_gravity clutter_actor_get_rotation +clutter_actor_get_z_rotation_gravity clutter_actor_is_rotated clutter_actor_set_opacity clutter_actor_get_opacity @@ -409,7 +383,11 @@ clutter_actor_set_depth clutter_actor_get_depth clutter_actor_set_scale +clutter_actor_set_scale_full +clutter_actor_set_scale_with_gravity clutter_actor_get_scale +clutter_actor_get_scale_center +clutter_actor_get_scale_gravity clutter_actor_is_scaled clutter_actor_apply_transform_to_point clutter_actor_transform_stage_point @@ -417,6 +395,7 @@ clutter_actor_get_transformed_position clutter_actor_get_transformed_size clutter_actor_get_paint_opacity +clutter_actor_get_paint_visibility clutter_actor_get_abs_allocation_vertices @@ -427,6 +406,7 @@ clutter_actor_set_anchor_point clutter_actor_get_anchor_point clutter_actor_set_anchor_point_from_gravity +clutter_actor_get_anchor_point_gravity clutter_actor_move_anchor_point clutter_actor_move_anchor_point_from_gravity @@ -436,6 +416,8 @@ clutter_actor_set_shader clutter_actor_get_shader clutter_actor_set_shader_param +clutter_actor_set_shader_param_float +clutter_actor_set_shader_param_int clutter_actor_set_depthu @@ -452,6 +434,8 @@ clutter_actor_get_positionu clutter_actor_set_sizeu clutter_actor_get_sizeu +clutter_actor_set_scale_fullu +clutter_actor_get_scale_centeru clutter_actor_set_anchor_pointu clutter_actor_get_anchor_pointu clutter_actor_move_anchor_pointu @@ -464,10 +448,9 @@ clutter_actor_get_transformed_sizeu -clutter_actor_set_scalex -clutter_actor_get_scalex -clutter_actor_set_rotationx -clutter_actor_get_rotationx +clutter_actor_grab_key_focus +clutter_actor_get_pango_context +clutter_actor_create_pango_context CLUTTER_TYPE_GEOMETRY @@ -510,6 +493,8 @@ clutter_texture_set_max_tile_waste clutter_texture_get_cogl_texture clutter_texture_set_cogl_texture +clutter_texture_get_cogl_material +clutter_texture_set_cogl_material CLUTTER_TEXTURE @@ -519,12 +504,14 @@ CLUTTER_IS_TEXTURE_CLASS CLUTTER_TEXTURE_GET_CLASS CLUTTER_TYPE_TEXTURE_HANDLE +CLUTTER_TYPE_MATERIAL_HANDLE ClutterTexturePrivate clutter_texture_error_quark clutter_texture_get_type clutter_texture_handle_get_type +clutter_material_handle_get_type
@@ -547,12 +534,11 @@ clutter_stage_hide_cursor clutter_stage_get_actor_at_pos clutter_stage_ensure_current +clutter_stage_ensure_viewport clutter_stage_queue_redraw clutter_stage_event clutter_stage_set_key_focus clutter_stage_get_key_focus -clutter_stage_get_resolution -clutter_stage_get_resolutionx clutter_stage_read_pixels @@ -658,13 +644,10 @@ ClutterBehaviourPath ClutterBehaviourPathClass clutter_behaviour_path_new -clutter_behaviour_path_get_knots -clutter_behaviour_path_append_knot -clutter_behaviour_path_append_knots -clutter_behaviour_path_insert_knot -clutter_behaviour_path_remove_knot -clutter_behaviour_path_clear - +clutter_behaviour_path_new_with_description +clutter_behaviour_path_new_with_knots +clutter_behaviour_path_set_path +clutter_behaviour_path_get_path ClutterKnot clutter_knot_copy @@ -686,6 +669,65 @@
+clutter-path +ClutterPath +ClutterPath +ClutterPathClass +ClutterPathCallback +ClutterPathNodeType +clutter_path_new +clutter_path_new_with_description + + +clutter_path_add_move_to +clutter_path_add_rel_move_to +clutter_path_add_line_to +clutter_path_add_rel_line_to +clutter_path_add_curve_to +clutter_path_add_rel_curve_to +clutter_path_add_close +clutter_path_add_string +clutter_path_add_node +clutter_path_add_cairo_path + + +clutter_path_get_n_nodes +clutter_path_get_node +clutter_path_get_nodes +clutter_path_foreach +clutter_path_insert_node +clutter_path_remove_node +clutter_path_replace_node +clutter_path_get_description +clutter_path_set_description +clutter_path_to_cairo_path +clutter_path_clear +clutter_path_get_position +clutter_path_get_length + + +ClutterPathNode +clutter_path_node_copy +clutter_path_node_free +clutter_path_node_equal + + +CLUTTER_TYPE_PATH +CLUTTER_TYPE_PATH_NODE +CLUTTER_PATH +CLUTTER_PATH_CLASS +CLUTTER_IS_PATH +CLUTTER_IS_PATH_CLASS +CLUTTER_PATH_GET_CLASS +CLUTTER_PATH_RELATIVE + + +ClutterPathPrivate +clutter_path_get_type +clutter_path_node_get_type +
+ +
clutter-behaviour-opacity ClutterBehaviourOpacity ClutterBehaviourOpacity @@ -761,33 +803,6 @@
-clutter-behaviour-bspline -ClutterBehaviourBspline -ClutterBehaviourBspline -ClutterBehaviourBsplineClass -clutter_behaviour_bspline_new -clutter_behaviour_bspline_append_knot -clutter_behaviour_bspline_append_knots -clutter_behaviour_bspline_truncate -clutter_behaviour_bspline_join -clutter_behaviour_bspline_split -clutter_behaviour_bspline_clear -clutter_behaviour_bspline_adjust -clutter_behaviour_bspline_set_origin -clutter_behaviour_bspline_get_origin - -CLUTTER_TYPE_BEHAVIOUR_BSPLINE -CLUTTER_BEHAVIOUR_BSPLINE -CLUTTER_BEHAVIOUR_BSPLINE_CLASS -CLUTTER_IS_BEHAVIOUR_BSPLINE -CLUTTER_IS_BEHAVIOUR_BSPLINE_CLASS -CLUTTER_BEHAVIOUR_BSPLINE_GET_CLASS - -ClutterBehaviourBsplinePrivate -clutter_behaviour_bspline_get_type -
- -
clutter-behaviour-ellipse ClutterBehaviourEllipse ClutterBehaviourEllipse @@ -835,14 +850,16 @@ clutter-backend ClutterBackend clutter_get_default_backend -clutter_backend_get_resolution clutter_backend_set_resolution -clutter_backend_get_double_click_time +clutter_backend_get_resolution clutter_backend_set_double_click_time -clutter_backend_get_double_click_distance +clutter_backend_get_double_click_time clutter_backend_set_double_click_distance +clutter_backend_get_double_click_distance clutter_backend_set_font_options clutter_backend_get_font_options +clutter_backend_set_font_name +clutter_backend_get_font_name CLUTTER_BACKEND CLUTTER_IS_BACKEND @@ -887,7 +904,6 @@ clutter-fixed Fixed Point Support ClutterFixed -CFX_Q CFX_ONE CFX_HALF CFX_MAX @@ -909,7 +925,6 @@ CLUTTER_FLOAT_TO_INT CLUTTER_FLOAT_TO_UINT CLUTTER_INT_TO_FIXED -CLUTTER_FIXED_INT CLUTTER_FIXED_FRACTION CLUTTER_FIXED_FLOOR CLUTTER_FIXED_CEIL @@ -917,30 +932,18 @@ CLUTTER_FIXED_DIV ClutterAngle CLUTTER_ANGLE_FROM_DEG -CLUTTER_ANGLE_FROM_DEGF CLUTTER_ANGLE_FROM_DEGX -CLUTTER_ANGLE_TO_DEGF CLUTTER_ANGLE_TO_DEG CLUTTER_ANGLE_TO_DEGX CLUTTER_ANGLE_MAX_DEG CFX_RADIANS_TO_DEGREES -clutter_cosi clutter_cosx -clutter_sini clutter_sinx -CLUTTER_SQRTI_ARG_10_PERCENT -CLUTTER_SQRTI_ARG_5_PERCENT -CLUTTER_SQRTI_ARG_MAX -clutter_sqrti -clutter_sqrtx -clutter_log2x -clutter_pow2x -clutter_powx +clutter_tanx +clutter_atanx +clutter_atan2x clutter_qmulx clutter_qdivx -clutter_tani -clutter_atani -clutter_atan2i CLUTTER_MAXFIXED @@ -952,14 +955,6 @@ clutter_value_get_fixed -CFX_DIV -CFX_INT -CFX_MUL -CFX_QMUL -CFX_QDIV -clutter_double_to_fixed -clutter_double_to_int -clutter_double_to_unit CLUTTER_TYPE_FIXED CLUTTER_TYPE_PARAM_FIXED CLUTTER_PARAM_SPEC_FIXED @@ -1101,8 +1096,10 @@ clutter_set_motion_events_frequency clutter_get_motion_events_frequency clutter_clear_glyph_cache -clutter_set_use_mipmapped_text -clutter_get_use_mipmapped_text +ClutterFontFlags +clutter_set_font_flags +clutter_get_font_flags +clutter_get_font_map clutter_threads_set_lock_functions @@ -1196,83 +1193,6 @@
-clutter-entry -ClutterEntry -ClutterEntry -ClutterEntryClass -clutter_entry_new -clutter_entry_new_with_text -clutter_entry_new_full -clutter_entry_set_text -clutter_entry_get_text -clutter_entry_set_font_name -clutter_entry_get_font_name -clutter_entry_set_color -clutter_entry_get_color -clutter_entry_get_layout -clutter_entry_set_alignment -clutter_entry_get_alignment -clutter_entry_set_cursor_position -clutter_entry_get_cursor_position -clutter_entry_handle_key_event -clutter_entry_insert_unichar -clutter_entry_delete_chars -clutter_entry_insert_text -clutter_entry_delete_text -clutter_entry_set_visible_cursor -clutter_entry_get_visible_cursor -clutter_entry_set_visibility -clutter_entry_get_visibility -clutter_entry_set_invisible_char -clutter_entry_get_invisible_char -clutter_entry_set_max_length -clutter_entry_get_max_length - -CLUTTER_ENTRY -CLUTTER_IS_ENTRY -CLUTTER_TYPE_ENTRY -CLUTTER_ENTRY_CLASS -CLUTTER_IS_ENTRY_CLASS -CLUTTER_ENTRY_GET_CLASS - -ClutterEntryPrivate -clutter_entry_get_type -
- -
-clutter-effect -Clutter Effects -ClutterEffectTemplate -ClutterEffectTemplateClass -clutter_effect_template_new -clutter_effect_template_new_full -clutter_effect_template_new_for_duration -clutter_effect_template_construct -clutter_effect_template_get_timeline_clone -clutter_effect_template_set_timeline_clone - - -ClutterEffectCompleteFunc -clutter_effect_fade -clutter_effect_move -clutter_effect_path -clutter_effect_scale -clutter_effect_depth -clutter_effect_rotate - - -CLUTTER_TYPE_EFFECT_TEMPLATE -CLUTTER_EFFECT_TEMPLATE -CLUTTER_IS_EFFECT_TEMPLATE -CLUTTER_EFFECT_TEMPLATE_CLASS -CLUTTER_IS_EFFECT_TEMPLATE_CLASS -CLUTTER_EFFECT_TEMPLATE_GET_CLASS - -ClutterEffectTemplatePrivate -clutter_effect_template_get_type -
- -
clutter-behaviour-depth ClutterBehaviourDepth ClutterBehaviourDepth @@ -1349,7 +1269,6 @@ CLUTTER_IS_SCRIPTABLE CLUTTER_SCRIPTABLE_GET_IFACE -ClutterScriptable clutter_scriptable_get_type
@@ -1510,8 +1429,28 @@ clutter_shader_is_compiled clutter_shader_set_is_enabled clutter_shader_get_is_enabled + + +clutter_shader_set_uniform +clutter_shader_get_cogl_program +clutter_shader_get_cogl_fragment_shader +clutter_shader_get_cogl_vertex_shader clutter_shader_set_uniform_1f + +ClutterShaderFloat +CLUTTER_VALUE_HOLDS_SHADER_FLOAT +clutter_value_set_shader_float +clutter_value_get_shader_float +ClutterShaderInt +CLUTTER_VALUE_HOLDS_SHADER_INT +clutter_value_set_shader_int +clutter_value_get_shader_int +ClutterShaderMatrix +CLUTTER_VALUE_HOLDS_SHADER_MATRIX +clutter_value_set_shader_matrix +clutter_value_get_shader_matrix + CLUTTER_IS_SHADER CLUTTER_IS_SHADER_CLASS @@ -1520,8 +1459,257 @@ CLUTTER_SHADER_ERROR CLUTTER_SHADER_GET_CLASS CLUTTER_TYPE_SHADER +CLUTTER_TYPE_SHADER_FLOAT +CLUTTER_TYPE_SHADER_INT +CLUTTER_TYPE_SHADER_MATRIX + ClutterShaderPrivate clutter_shader_get_type +clutter_shader_float_get_type +clutter_shader_int_get_type +clutter_shader_matrix_get_type clutter_shader_error_quark + +
+Implicit Animations +clutter-animation +ClutterAnimation +ClutterAnimationClass +ClutterAnimationMode +clutter_animation_new +clutter_animation_set_object +clutter_animation_get_object +clutter_animation_set_mode +clutter_animation_get_mode +clutter_animation_set_duration +clutter_animation_get_duration +clutter_animation_set_loop +clutter_animation_get_loop +clutter_animation_set_timeline +clutter_animation_get_timeline +clutter_animation_set_alpha +clutter_animation_get_alpha + + +clutter_animation_bind_property +clutter_animation_update_property +clutter_animation_has_property +clutter_animation_unbind_property +clutter_animation_get_interval + + +clutter_actor_animate +clutter_actor_animate_with_timeline +clutter_actor_animate_with_alpha + + +CLUTTER_TYPE_ANIMATION +CLUTTER_ANIMATION +CLUTTER_ANIMATION_CLASS +CLUTTER_IS_ANIMATION +CLUTTER_IS_ANIMATION_CLASS +CLUTTER_ANIMATION_GET_CLASS + + +ClutterAnimationPrivate +clutter_animation_get_type +
+ +
+Value intervals +clutter-interval +ClutterInterval +ClutterIntervalClass +clutter_interval_new +clutter_interval_new_with_values +clutter_interval_clone +clutter_interval_get_value_type +clutter_interval_set_initial_value +clutter_interval_get_initial_value +clutter_interval_peek_initial_value +clutter_interval_set_final_value +clutter_interval_get_final_value +clutter_interval_peek_final_value +clutter_interval_set_interval +clutter_interval_get_interval + + +clutter_interval_compute_value +clutter_interval_validate + + +ClutterProgressFunc +clutter_interval_register_progress_func + + +CLUTTER_TYPE_INTERVAL +CLUTTER_INTERVAL +CLUTTER_INTERVAL_CLASS +CLUTTER_IS_INTERVAL +CLUTTER_IS_INTERVAL_CLASS +CLUTTER_INTERVAL_GET_CLASS + + +ClutterIntervalPrivate +clutter_interval_get_type +
+ +
+clutter-cairo-texture +ClutterCairoTexture +ClutterCairoTexture +ClutterCairoTextureClass +clutter_cairo_texture_new +clutter_cairo_texture_set_surface_size +clutter_cairo_texture_get_surface_size + + +clutter_cairo_texture_create +clutter_cairo_texture_create_region + + +clutter_cairo_set_source_color + + +CLUTTER_TYPE_CAIRO_TEXTURE +CLUTTER_CAIRO_TEXTURE +CLUTTER_IS_CAIRO_TEXTURE +CLUTTER_CAIRO_TEXTURE_CLASS +CLUTTER_IS_CAIRO_TEXTURE_CLASS +CLUTTER_CAIRO_TEXTURE_GET_CLASS + + +ClutterCairoTexturePrivate +clutter_cairo_texture_get_type +
+ +
+ClutterText +clutter-text +ClutterText +ClutterTextClass +clutter_text_new +clutter_text_new_full +clutter_text_new_with_text + + +clutter_text_set_text +clutter_text_get_text +clutter_text_set_activatable +clutter_text_get_activatable +clutter_text_set_alignment +clutter_text_get_alignment +clutter_text_set_attributes +clutter_text_get_attributes +clutter_text_set_color +clutter_text_get_color +clutter_text_set_ellipsize +clutter_text_get_ellipsize +clutter_text_set_font_name +clutter_text_get_font_name +clutter_text_set_password_char +clutter_text_get_password_char +clutter_text_set_justify +clutter_text_get_justify +clutter_text_get_layout +clutter_text_set_line_wrap +clutter_text_get_line_wrap +clutter_text_set_line_wrap_mode +clutter_text_get_line_wrap_mode +clutter_text_set_max_length +clutter_text_get_max_length +clutter_text_set_selectable +clutter_text_get_selectable +clutter_text_set_selection +clutter_text_get_selection +clutter_text_set_selection_bound +clutter_text_get_selection_bound +clutter_text_set_single_line_mode +clutter_text_get_single_line_mode +clutter_text_set_use_markup +clutter_text_get_use_markup + + +clutter_text_set_editable +clutter_text_get_editable +clutter_text_insert_text +clutter_text_insert_unichar +clutter_text_delete_chars +clutter_text_delete_text +clutter_text_get_chars +clutter_text_set_cursor_color +clutter_text_get_cursor_color +clutter_text_set_cursor_position +clutter_text_get_cursor_position +clutter_text_set_cursor_visible +clutter_text_get_cursor_visible +clutter_text_set_cursor_size +clutter_text_get_cursor_size + + +clutter_text_activate + + +CLUTTER_IS_TEXT +CLUTTER_IS_TEXT_CLASS +CLUTTER_TEXT +CLUTTER_TEXT_CLASS +CLUTTER_TEXT_GET_CLASS +CLUTTER_TYPE_TEXT + + +ClutterTextPrivate +clutter_text_get_type +
+ +
+clutter-animatable +ClutterAnimatable +ClutterAnimatable +ClutterAnimatableIface +clutter_animatable_animate_property + + +CLUTTER_TYPE_ANIMATABLE +CLUTTER_ANIMATABLE +CLUTTER_IS_ANIMATABLE +CLUTTER_ANIMATABLE_GET_IFACE + + +clutter_animatable_get_type +
+ +
+Key Bindings +clutter-binding-pool +ClutterBindingPool +ClutterBindingActionFunc + + +clutter_binding_pool_new +clutter_binding_pool_get_for_class +clutter_binding_pool_find + + +clutter_binding_pool_install_action +clutter_binding_pool_install_closure +clutter_binding_pool_override_action +clutter_binding_pool_override_closure +clutter_binding_pool_find_action +clutter_binding_pool_remove_action +clutter_binding_pool_block_action +clutter_binding_pool_unblock_action + + +clutter_binding_pool_activate + + +CLUTTER_BINDING_POOL +CLUTTER_IS_BINDING_POOL +CLUTTER_TYPE_BINDING_POOL + + +clutter_binding_pool_get_type +
diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/clutter.types /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/clutter.types --- clutter-0.8.4/doc/reference/clutter/clutter.types 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/clutter.types 2009-01-30 12:41:02.000000000 +0000 @@ -5,21 +5,19 @@ clutter_stage_get_type clutter_rectangle_get_type clutter_texture_get_type -clutter_clone_texture_get_type -clutter_label_get_type +clutter_clone_get_type clutter_timeline_get_type clutter_media_get_type clutter_behaviour_get_type clutter_alpha_get_type -clutter_behaviour_bspline_get_type clutter_behaviour_depth_get_type clutter_behaviour_ellipse_get_type clutter_behaviour_opacity_get_type clutter_behaviour_path_get_type +clutter_path_get_type clutter_behaviour_rotate_get_type clutter_behaviour_scale_get_type clutter_backend_get_type -clutter_entry_get_type clutter_script_get_type clutter_scriptable_get_type clutter_model_get_type @@ -28,3 +26,6 @@ clutter_score_get_type clutter_shader_get_type clutter_child_meta_get_type +clutter_cairo_texture_get_type +clutter_text_get_type +clutter_animatable_get_type Binary files /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/easing-modes.png and /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/easing-modes.png differ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/easing-modes.svg /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/easing-modes.svg --- clutter-0.8.4/doc/reference/clutter/easing-modes.svg 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/easing-modes.svg 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,920 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Binary files /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/alpha-func.png and /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/alpha-func.png differ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/building-clutter.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/building-clutter.html --- clutter-0.8.4/doc/reference/clutter/html/building-clutter.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/building-clutter.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,8 +4,8 @@ Part II. Building Clutter - - + + @@ -19,7 +19,7 @@ - + @@ -42,7 +42,7 @@ Prev   Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next
diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ch01.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ch01.html --- clutter-0.8.4/doc/reference/clutter/html/ch01.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ch01.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ Abstract classes and interfaces - + @@ -19,7 +19,7 @@ - + @@ -42,12 +42,12 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next

-Abstract classes and interfaces

+Abstract classes and interfaces
ClutterActor — Base abstract class for all visual stage actors. @@ -59,7 +59,7 @@ ClutterChildMeta — Wrapper for actors inside a container
-ClutterMedia — An interface for controlling playback of media data. +ClutterMedia — An interface for controlling playback of media data
diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ch02.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ch02.html --- clutter-0.8.4/doc/reference/clutter/html/ch02.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ch02.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ Base actors - + @@ -19,7 +19,7 @@ - + @@ -42,12 +42,12 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next

-Base actors

+Base actors
ClutterRectangle — An actor that displays a simple rectangle. @@ -56,14 +56,13 @@ ClutterTexture — An actor for displaying and manipulating images.
-ClutterCloneTexture — Actor for cloning existing textures in an -efficient way. +ClutterClone
-ClutterLabel — Actor for displaying text +ClutterText — An actor for displaying and editing text
-ClutterEntry — A single line text entry actor +ClutterCairoTexture — Texture with Cairo integration
diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ch03.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ch03.html --- clutter-0.8.4/doc/reference/clutter/html/ch03.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ch03.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,9 +4,9 @@ Container actors - + - + @@ -19,7 +19,7 @@ - + @@ -39,15 +39,15 @@ - + - +

-Container actors

+Container actors
ClutterGroup — Actor class containing multiple children. diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ch04.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ch04.html --- clutter-0.8.4/doc/reference/clutter/html/ch04.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ch04.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ Base classes - + @@ -19,7 +19,7 @@ - + @@ -42,12 +42,12 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next

-Base classes

+Base classes
ClutterTimeline — A class for time-based events diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ch05.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ch05.html --- clutter-0.8.4/doc/reference/clutter/html/ch05.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ch05.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,10 +4,10 @@ Behaviours - + - + @@ -19,7 +19,7 @@ - + @@ -42,17 +42,14 @@ Prev Up Home -Clutter 0.8.4 Reference Manual -Next +Clutter 0.9.0 Reference Manual +Next

-Behaviours

+Behaviours
-ClutterBehaviourBspline — A behaviour interpolating position along a B-Spline -
-
ClutterBehaviourDepth — A behaviour controlling the Z position
@@ -62,7 +59,11 @@ ClutterBehaviourOpacity — Behaviour controlling the opacity
-ClutterBehaviourPath — A behaviour interpolating position along a path +ClutterBehaviourPath — A behaviour for moving actors along a ClutterPath +
+
+ClutterPath — An object describing a path with straight lines +and bezier curves.
ClutterBehaviourRotate — A behaviour controlling rotation diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ch06.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ch06.html --- clutter-0.8.4/doc/reference/clutter/html/ch06.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ch06.html 2009-01-30 12:41:02.000000000 +0000 @@ -2,12 +2,12 @@ -Simple effects API +High Level API - + - + @@ -19,7 +19,7 @@ - + @@ -42,15 +42,23 @@ Prev Up Home -Clutter 0.8.4 Reference Manual -Next +Clutter 0.9.0 Reference Manual +Next

-Simple effects API

-
-Clutter Effects — Utility Class for basic visual effects -
+High Level API
+
+
+Value intervals — An object holding an interval of two values +
+
+Implicit Animations — Simple implicit animations +
+
+ClutterAnimatable — Interface for animatable classes +
+
Colors — Color management and manipulation.
+Key Bindings — Pool for key bindings +
+
Events — User and window system events
diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ch08.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ch08.html --- clutter-0.8.4/doc/reference/clutter/html/ch08.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ch08.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ User interface definition - + @@ -19,7 +19,7 @@ - + @@ -42,18 +42,18 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next

-User interface definition

+User interface definition
ClutterScript — Loads a scene from UI definition data
-ClutterScriptable — Override the UI definition parsing +ClutterScriptable — Override the UI definition parsing
diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ch09.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ch09.html --- clutter-0.8.4/doc/reference/clutter/html/ch09.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ch09.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,9 +4,9 @@ Generic list model - + - + @@ -19,7 +19,7 @@ - + @@ -39,15 +39,15 @@ - + - +

-Generic list model

+Generic list model
ClutterModel — A generic model implementation diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterActor.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterActor.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterActor.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterActor.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ ClutterActor - + @@ -19,7 +19,7 @@ - + @@ -43,7 +43,7 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next Top @@ -247,6 +247,12 @@ gint z); +void clutter_actor_set_z_rotation_from_gravity + (ClutterActor *self, + gdouble angle, + ClutterGravity gravity); gdouble clutter_actor_get_rotation (ClutterActor *self, @@ -260,6 +266,8 @@ gint *z); +ClutterGravity clutter_actor_get_z_rotation_gravity + (ClutterActor *self); gboolean clutter_actor_is_rotated (ClutterActor *self); @@ -340,6 +348,24 @@ gdouble scale_y); +void clutter_actor_set_scale_full (ClutterActor *self, + gdouble scale_x, + gdouble scale_y, + int center_x, + int center_y); +void clutter_actor_set_scale_with_gravity + (ClutterActor *self, + gdouble scale_x, + gdouble scale_y, + ClutterGravity gravity); void clutter_actor_get_scale (ClutterActor *self, gdouble *scale_y); +void clutter_actor_get_scale_center (ClutterActor *self, + gint *center_x, + gint *center_y); +ClutterGravity clutter_actor_get_scale_gravity (ClutterActor *self); gboolean clutter_actor_is_scaled (ClutterActor *self); void clutter_actor_apply_transform_to_point (ClutterActor *self, - ClutterVertex *point, + const ClutterVertex *point, ClutterVertex *vertex); clutter_actor_apply_relative_transform_to_point (ClutterActor *self, ClutterActor *ancestor, - ClutterVertex *point, + const ClutterVertex *point, ClutterVertex *vertex); void clutter_actor_get_transformed_position (ClutterActor *self, @@ -384,6 +418,9 @@ guint8 clutter_actor_get_paint_opacity (ClutterActor *self); +gboolean clutter_actor_get_paint_visibility (ClutterActor *self); void clutter_actor_get_abs_allocation_vertices (ClutterActor *self, ClutterVertex verts[4]); @@ -409,6 +446,8 @@ void clutter_actor_set_anchor_point_from_gravity (ClutterActor *self, ClutterGravity gravity); +ClutterGravity clutter_actor_get_anchor_point_gravity + (ClutterActor *self); void clutter_actor_move_anchor_point (ClutterActor *self, gchar *param, + const GValue *value); +void clutter_actor_set_shader_param_float + (ClutterActor *self, + const gchar *param, gfloat value); +void clutter_actor_set_shader_param_int (ClutterActor *self, + const gchar *param, + gint value); void clutter_actor_set_depthu (ClutterActor *self, ClutterUnit depth); @@ -467,6 +521,18 @@ void clutter_actor_get_sizeu (ClutterActor *self, ClutterUnit *width, ClutterUnit *height); +void clutter_actor_set_scale_fullu (ClutterActor *self, + gdouble scale_x, + gdouble scale_y, + ClutterUnit center_x, + ClutterUnit center_y); +void clutter_actor_get_scale_centeru (ClutterActor *self, + ClutterUnit *center_x, + ClutterUnit *center_y); void clutter_actor_set_anchor_pointu (ClutterActor *self, ClutterUnit anchor_x, ClutterUnit anchor_y); @@ -512,35 +578,13 @@ ClutterUnit *width, ClutterUnit *height); -void clutter_actor_set_scalex (ClutterActor *self, - ClutterFixed scale_x, - ClutterFixed scale_y); -void clutter_actor_get_scalex (ClutterActor *self, - ClutterFixed *scale_x, - ClutterFixed *scale_y); -void clutter_actor_set_rotationx (ClutterActor *self, - ClutterRotateAxis axis, - ClutterFixed angle, - gint x, - gint y, - gint z); -ClutterFixed clutter_actor_get_rotationx (ClutterActor *self, - ClutterRotateAxis axis, - gint *x, - gint *y, - gint *z); +void clutter_actor_grab_key_focus (ClutterActor *self); +PangoContext* clutter_actor_get_pango_context (ClutterActor *self); +PangoContext* clutter_actor_create_pango_context (ClutterActor *self);
@@ -556,21 +600,21 @@ +----ClutterGroup +----ClutterRectangle +----ClutterTexture - +----ClutterCloneTexture - +----ClutterLabel - +----ClutterEntry + +----ClutterClone + +----ClutterText

Implemented Interfaces

ClutterActor implements -

+ ClutterScriptable.

Properties

   "allocation"               ClutterActorBox*      : Read
+  "anchor-gravity"           ClutterGravity        : Read / Write
   "anchor-x"                 gint                  : Read / Write
@@ -630,6 +674,14 @@
   "rotation-center-x"        ClutterVertex*        : Read / Write
   "rotation-center-y"        ClutterVertex*        : Read / Write
   "rotation-center-z"        ClutterVertex*        : Read / Write
+  "rotation-center-z-gravity" ClutterGravity        : Read / Write
+  "scale-center-x"           gint                  : Read / Write
+  "scale-center-y"           gint                  : Read / Write
+  "scale-gravity"            ClutterGravity        : Read / Write
   "scale-x"                  gdouble               : Read / Write
@@ -671,6 +723,7 @@
   "motion-event"                                   : Run Last
   "paint"                                          : Run Last
   "parent-set"                                     : Run Last
+  "pick"                                           : Run Last
   "realize"                                        : Run Last
   "scroll-event"                                   : Run Last
   "show"                                           : Run First
@@ -718,13 +771,13 @@
 

  1. Translation by actor x, y coords,

  2. +
  3. Translation by actor depth (z),

  4. Scaling by scale_x, scale_y,

  5. -
  6. Negative translation by anchor point x, - y,

  7. Rotation around z axis,

  8. Rotation around y axis,

  9. Rotation around x axis,

  10. -
  11. Translation by actor depth (z),

  12. +
  13. Negative translation by anchor point x, + y,

  14. Rectangular Clip is applied (this is not an operation on the matrix as such, but it is done as part of the transform set up).

  15. @@ -869,7 +922,7 @@

    CLUTTER_ACTOR_IS_MAPPED()

    -
    #define CLUTTER_ACTOR_IS_MAPPED(e)      (((ClutterActor*)(e))->flags & CLUTTER_ACTOR_MAPPED)
    +
    #define CLUTTER_ACTOR_IS_MAPPED(e)      ((((ClutterActor*)(e))->flags & CLUTTER_ACTOR_MAPPED) != FALSE)
     

    Evaluates to

    CLUTTER_ACTOR_IS_REALIZED()

    -
    #define CLUTTER_ACTOR_IS_REALIZED(e)    (((ClutterActor*)(e))->flags & CLUTTER_ACTOR_REALIZED)
    +
    #define CLUTTER_ACTOR_IS_REALIZED(e)    ((((ClutterActor*)(e))->flags & CLUTTER_ACTOR_REALIZED) != FALSE)
     

    Evaluates to

    CLUTTER_ACTOR_IS_REACTIVE()

    -
    #define CLUTTER_ACTOR_IS_REACTIVE(e)    (((ClutterActor*)(e))->flags & CLUTTER_ACTOR_REACTIVE)
    +
    #define CLUTTER_ACTOR_IS_REACTIVE(e)    ((((ClutterActor*)(e))->flags & CLUTTER_ACTOR_REACTIVE) != FALSE)
     

    Evaluates to

    This function should not be called directly by applications. -Call clutter_actor_queue_redraw() to queue paints, instead.

    +Call clutter_actor_queue_redraw() to queue paints, instead. +

    +

    +This function will emit the "paint" signal.

    @@ -1568,7 +1624,11 @@

    Applications rarely need to call this, as redraws are handled -automatically by modification functions.

    +automatically by modification functions. +

    +

    +This function will not do anything if self is not visible, or +if the actor is inside an invisible part of the scenegraph.

    @@ -1704,7 +1764,7 @@ each child.

    -Since 0.4

    +This function will emit the "pick" signal.

    @@ -1723,6 +1783,8 @@
    +

    Since 0.4 +


    @@ -2005,10 +2067,10 @@ the ClutterActorBox coordinates as follows:

      -
    • v[0] contains (x1, y1)

    • -
    • v[1] contains (x2, y1)

    • -
    • v[2] contains (x1, y2)

    • -
    • v[3] contains (x2, y2)

    • +
    • verts[0] contains (x1, y1)

    • +
    • verts[1] contains (x2, y1)

    • +
    • verts[2] contains (x1, y2)

    • +
    • verts[3] contains (x2, y2)

    @@ -2977,6 +3039,47 @@

    +

    clutter_actor_set_z_rotation_from_gravity ()

    +
    void                clutter_actor_set_z_rotation_from_gravity
    +                                                        (ClutterActor *self,
    +                                                         gdouble angle,
    +                                                         ClutterGravity gravity);
    +

    +Sets the rotation angle of self around the Z axis using the center +point specified as a compass point. For example to rotate such that +the center of the actor remains static you can use +CLUTTER_GRAVITY_CENTER. If the actor changes size the center point +will move accordingly.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    self :

    a ClutterActor +

    angle :

    the angle of rotation +

    gravity :

    the center point of the rotation +
    +

    Since 1.0 +

    +
    +
    +

    clutter_actor_get_rotation ()

    
     
    +

    clutter_actor_get_z_rotation_gravity ()

    +
    ClutterGravity      clutter_actor_get_z_rotation_gravity
    +                                                        (ClutterActor *self);
    +

    +Retrieves the center for the rotation around the Z axis as a +compass direction. If the center was specified in pixels or units +this will return CLUTTER_GRAVITY_NONE.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    A ClutterActor +

    Returns :

    the Z rotation center + +
    +

    Since 1.0 +

    +
    +
    +

    clutter_actor_is_rotated ()

    gdouble scale_y);

    -Scales an actor with the given factors. The scaling is always -relative to the anchor point.

    +Scales an actor with the given factors. The scaling is relative to +the scale center and the anchor point. The scale center is +unchanged by this function and defaults to 0,0.

    @@ -3734,16 +3869,20 @@

    -

    clutter_actor_get_scale ()

    -
    void                clutter_actor_get_scale             (ClutterActor *self,
    +

    clutter_actor_set_scale_full ()

    +
    void                clutter_actor_set_scale_full        (ClutterActor *self,
                                                              gdouble *scale_x,
    +>gdouble scale_x,
                                                              gdouble *scale_y);
    -

    -Retrieves an actors scale in floating point.

    +>gdouble scale_y, + int center_x, + int center_y);
    +

    +Scales an actor with the given factors around the given center +point. The center point is specified in pixels relative to the +anchor point (usually the top left corner of the actor).

    @@ -3757,31 +3896,47 @@

    scale_x :

    - Location to store horizonal float scale factor, or NULL. + double factor to scale actor by horizontally.

    scale_y :

    - Location to store vertical float scale factor, or NULL. + double factor to scale actor by vertically. + + + +

    center_x :

    + X coordinate of the center of the scale. + + + +

    center_y :

    + Y coordinate of the center of the scale
    -

    Since 0.2 +

    Since 1.0


    -

    clutter_actor_is_scaled ()

    -
    gboolean            clutter_actor_is_scaled             (ClutterActor *self);
    +

    clutter_actor_set_scale_with_gravity ()

    +
    void                clutter_actor_set_scale_with_gravity
    +                                                        (ClutterActor *self,
    +                                                         gdouble scale_x,
    +                                                         gdouble scale_y,
    +                                                         ClutterGravity gravity);

    -Checks whether the actor is scaled in either dimension.

    +Scales an actor with the given factors around the given +center point. The center point is specified as one of the compass +directions in ClutterGravity. For example, setting it to north +will cause the top of the actor to remain unchanged and the rest of +the actor to expand left, right and downwards.

    @@ -3790,33 +3945,42 @@

    self :

    - a ClutterActor + A ClutterActor -

    Returns :

    - TRUE if the actor is scaled. - +

    scale_x :

    + double factor to scale actor by horizontally. + + + +

    scale_y :

    + double factor to scale actor by vertically. + + + +

    gravity :

    + the location of the scale center expressed as a compass +direction.
    -

    Since 0.6 +

    Since 1.0


    -

    clutter_actor_apply_transform_to_point ()

    -
    void                clutter_actor_apply_transform_to_point
    -                                                        (ClutterActor *self,
    -                                                         ClutterVertex *point,
    -                                                         ClutterVertex *vertex);
    +

    clutter_actor_get_scale ()

    +
    void                clutter_actor_get_scale             (ClutterActor *self,
    +                                                         gdouble *scale_x,
    +                                                         gdouble *scale_y);

    -Transforms point in coordinates relative to the actor -into screen-relative coordinates with the current actor -transformation (i.e. scale, rotation, etc)

    +Retrieves an actors scale in floating point.

    @@ -3829,49 +3993,39 @@ -

    point :

    - A point as ClutterVertex +

    scale_x :

    + Location to store horizonal float scale factor, or NULL. -

    vertex :

    - The translated ClutterVertex +

    scale_y :

    + Location to store vertical float scale factor, or NULL.
    -

    Since 0.4 +

    Since 0.2


-

clutter_actor_transform_stage_point ()

-
gboolean            clutter_actor_transform_stage_point (ClutterActor *self,
-                                                         ClutterUnit x,
-                                                         ClutterUnit y,
-                                                         ClutterUnit *x_out,
-                                                         ClutterUnit *y_out);
-

-This function translates screen coordinates (x, y) to -coordinates relative to the actor. For example, it can be used to translate -screen events from global screen coordinates into actor-local coordinates. -

-

-The conversion can fail, notably if the transform stack results in the -actor being projected on the screen as a mere line. -

-

-The conversion should not be expected to be pixel-perfect due to the -nature of the operation. In general the error grows when the skewing -of the actor rectangle on screen increases. -

-

-Note: This function is fairly computationally intensive. -

+

clutter_actor_get_scale_center ()

+
void                clutter_actor_get_scale_center      (ClutterActor *self,
+                                                         gint *center_x,
+                                                         gint *center_y);

-Note: This function only works when the allocation is up-to-date, i.e. inside of paint()

+Retrieves the scale center coordinate in pixels relative to the top +left corner of the actor. If the scale center was specified using a +ClutterGravity this will calculate the pixel offset using the +current size of the actor.

@@ -3884,8 +4038,166 @@ -

x :

- x screen coordinate of the point to unproject, in ClutterUnits +

center_x :

+ Location to store the X position of the scale center, or NULL. + + + +

center_y :

+ Location to store the Y position of the scale center, or NULL. + + + +
+

Since 1.0 +

+
+
+
+

clutter_actor_get_scale_gravity ()

+
ClutterGravity      clutter_actor_get_scale_gravity     (ClutterActor *self);
+

+Retrieves the scale center as a compass direction. If the scale +center was specified in pixels or units this will return +CLUTTER_GRAVITY_NONE.

+

+ +

+
++ + + + + + + + + + +

self :

A ClutterActor +

Returns :

the scale gravity + +
+

Since 1.0 +

+
+
+
+

clutter_actor_is_scaled ()

+
gboolean            clutter_actor_is_scaled             (ClutterActor *self);
+

+Checks whether the actor is scaled in either dimension.

+

+ +

+
++ + + + + + + + + + +

self :

a ClutterActor +

Returns :

TRUE if the actor is scaled. + +
+

Since 0.6 +

+
+
+
+

clutter_actor_apply_transform_to_point ()

+
void                clutter_actor_apply_transform_to_point
+                                                        (ClutterActor *self,
+                                                         const ClutterVertex *point,
+                                                         ClutterVertex *vertex);
+

+Transforms point in coordinates relative to the actor +into screen-relative coordinates with the current actor +transformation (i.e. scale, rotation, etc)

+

+ +

+
++ + + + + + + + + + + + + + +

self :

A ClutterActor +

point :

A point as ClutterVertex +

vertex :

The translated ClutterVertex +
+

Since 0.4 +

+
+
+
+

clutter_actor_transform_stage_point ()

+
gboolean            clutter_actor_transform_stage_point (ClutterActor *self,
+                                                         ClutterUnit x,
+                                                         ClutterUnit y,
+                                                         ClutterUnit *x_out,
+                                                         ClutterUnit *y_out);
+

+This function translates screen coordinates (x, y) to +coordinates relative to the actor. For example, it can be used to translate +screen events from global screen coordinates into actor-local coordinates. +

+

+The conversion can fail, notably if the transform stack results in the +actor being projected on the screen as a mere line. +

+

+The conversion should not be expected to be pixel-perfect due to the +nature of the operation. In general the error grows when the skewing +of the actor rectangle on screen increases. +

+

+Note: This function is fairly computationally intensive. +

+

+Note: This function only works when the allocation is up-to-date, i.e. inside of paint()

+

+ +

+
++ + + + + + + + @@ -3924,7 +4236,7 @@
void                clutter_actor_apply_relative_transform_to_point
                                                         (ClutterActor *self,
                                                          ClutterActor *ancestor,
-                                                         ClutterVertex *point,
+                                                         const ClutterVertex *point,
                                                          ClutterVertex *vertex);

Transforms point in coordinates relative to the actor into @@ -4099,6 +4411,37 @@


+

clutter_actor_get_paint_visibility ()

+
gboolean            clutter_actor_get_paint_visibility  (ClutterActor *self);
+

+Retrieves the 'paint' visibility of an actor recursively checking for non +visible parents.

+

+ +

+

self :

A ClutterActor +

x :

x screen coordinate of the point to unproject, in ClutterUnits
++ + + + + + + + + + +

self :

A ClutterActor +

Returns :

TRUE if the actor is visibile and will be painted. + +
+

Since 0.8.4 +

+
+
+

clutter_actor_get_abs_allocation_vertices ()

void                clutter_actor_get_abs_allocation_vertices
                                                         (ClutterActor *self,
@@ -4273,7 +4616,7 @@
 
 
 

anchor_y :

- return location for the y coordinate of the anchor point + return location for the Y coordinate of the anchor point @@ -4292,11 +4635,11 @@ convenience function wrapping clutter_actor_set_anchor_point()).

-Note that the anchor is still stored as a point and the gravity -value is forgotten. For example, if you set the anchor point to -CLUTTER_GRAVITY_SOUTH_EAST and later double the size of the actor, -the anchor point will not move to the bottom right and will now be -in the center of the actor.

+Since version 1.0 the anchor point will be stored as a gravity so +that if the actor changes size then the anchor point will move. For +example, if you set the anchor point to CLUTTER_GRAVITY_SOUTH_EAST +and later double the size of the actor, the anchor point will move +to the bottom right.

@@ -4320,6 +4663,38 @@

+

clutter_actor_get_anchor_point_gravity ()

+
ClutterGravity      clutter_actor_get_anchor_point_gravity
+                                                        (ClutterActor *self);
+

+Retrieves the anchor position expressed as a ClutterGravity. If +the anchor point was specified using pixels or units this will +return CLUTTER_GRAVITY_NONE.

+

+ +

+
++ + + + + + + + + + +

self :

a ClutterActor +

Returns :

+ + +
+

Since 1.0 +

+
+
+

clutter_actor_move_anchor_point ()

void                clutter_actor_move_anchor_point     (ClutterActor *self,
                                                          
 

-Note that the anchor is still stored as a point and the gravity -value is forgotten. For example, if you set the anchor point to -CLUTTER_GRAVITY_SOUTH_EAST and later double the size of the actor, -the anchor point will not move to the bottom right and will now be -in the center of the actor.

+Since version 1.0 the anchor point will be stored as a gravity so +that if the actor changes size then the anchor point will move. For +example, if you set the anchor point to CLUTTER_GRAVITY_SOUTH_EAST +and later double the size of the actor, the anchor point will move +to the bottom right.

@@ -4540,11 +4915,51 @@ const gchar *param, + const GValue *value);
+

+Sets the value for a named parameter of the shader applied +to actor.

+

+ +

+
++ + + + + + + + + + + + + + +

self :

a ClutterActor +

param :

the name of the parameter +

value :

the value of the parameter +
+

Since 1.0 +

+
+
+
+

clutter_actor_set_shader_param_float ()

+
void                clutter_actor_set_shader_param_float
+                                                        (ClutterActor *self,
+                                                         const gchar *param,
                                                          gfloat value);

-Sets the value for a named parameter of the shader applied +Sets the value for a named float parameter of the shader applied to actor.

@@ -4569,7 +4984,46 @@

-

Since 0.6 +

Since 0.8 +

+ +
+
+

clutter_actor_set_shader_param_int ()

+
void                clutter_actor_set_shader_param_int  (ClutterActor *self,
+                                                         const gchar *param,
+                                                         gint value);
+

+Sets the value for a named int parameter of the shader applied to +actor.

+

+ +

+
++ + + + + + + + + + + + + + +

self :

a ClutterActor +

param :

the name of the parameter +

value :

the value of the parameter +
+

Since 0.8


@@ -5117,6 +5571,106 @@
+

clutter_actor_set_scale_fullu ()

+
void                clutter_actor_set_scale_fullu       (ClutterActor *self,
+                                                         gdouble scale_x,
+                                                         gdouble scale_y,
+                                                         ClutterUnit center_x,
+                                                         ClutterUnit center_y);
+

+ClutterUnit version of clutter_actor_set_scale_full(). +

+

+Scales an actor with the given factors around the given center +point. The center point is specified in +ClutterUnits relative to the anchor point (usually +the top left corner of the actor).

+

+ +

+
++ + + + + + + + + + + + + + + + + + + + + + +

self :

A ClutterActor +

scale_x :

double factor to scale actor by horizontally. +

scale_y :

double factor to scale actor by vertically. +

center_x :

X coordinate of the center of the scale. +

center_y :

Y coordinate of the center of the scale +
+

Since 1.0 +

+
+
+
+

clutter_actor_get_scale_centeru ()

+
void                clutter_actor_get_scale_centeru     (ClutterActor *self,
+                                                         ClutterUnit *center_x,
+                                                         ClutterUnit *center_y);
+

+ClutterUnits version of clutter_actor_get_scale_center(). +

+

+Retrieves the scale center coordinate in units relative to the top +left corner of the actor. If the scale center was specified using a +ClutterGravity this will calculate the unit offset using the +current size of the actor.

+

+ +

+
++ + + + + + + + + + + + + + +

self :

A ClutterActor +

center_x :

Location to store the X position of the scale center, or NULL. +

center_y :

Location to store the Y position of the scale center, or NULL. +
+

Since 1.0 +

+
+
+

clutter_actor_set_anchor_pointu ()

void                clutter_actor_set_anchor_pointu     (ClutterActor *self,
                                                          ClutterUnit anchor_x,
@@ -5173,12 +5727,12 @@
 
 
 

anchor_x :

- return location for the X coordinace of the anchor point + return location for the X coordinate of the anchor point

anchor_y :

- return location for the X coordinace of the anchor point + return location for the Y coordinate of the anchor point @@ -5552,53 +6106,11 @@ X or Y axis, it no longer appears as on the stage as a rectangle, but as a generic quadrangle; in that case this function returns the size of the smallest rectangle that encapsulates the entire quad. Please -note that in this case no assumptions can be made about the relative -position of this envelope to the absolute position of the actor, as -returned by clutter_actor_get_transformed_position(); if you need this -information, you need to use clutter_actor_get_abs_allocation_vertices() -to get the coords of the actual quadrangle.
-

- -

-
-- - - - - - - - - - - - - - -

self :

A ClutterActor -

width :

return location for the width, or NULL -

height :

return location for the height, or NULL -
-

Since 0.8 -

- -
-
-

clutter_actor_set_scalex ()

-
void                clutter_actor_set_scalex            (ClutterActor *self,
-                                                         ClutterFixed scale_x,
-                                                         ClutterFixed scale_y);
-

-Fixed point version of clutter_actor_set_scale(). -

-

-Scales an actor with the given factors. The scaling is always -relative to the anchor point.

+note that in this case no assumptions can be made about the relative +position of this envelope to the absolute position of the actor, as +returned by clutter_actor_get_transformed_position(); if you need this +information, you need to use clutter_actor_get_abs_allocation_vertices() +to get the coords of the actual quadrangle.

@@ -5611,79 +6123,73 @@ -

scale_x :

- ClutterFixed factor to scale actor by horizontally. +

width :

+ return location for the width, or NULL -

scale_y :

- ClutterFixed factor to scale actor by vertically. +

height :

+ return location for the height, or NULL +

Since 0.8 +


-

clutter_actor_get_scalex ()

-
void                clutter_actor_get_scalex            (ClutterActor *self,
-                                                         ClutterFixed *scale_x,
-                                                         ClutterFixed *scale_y);
-

-Fixed point version of clutter_actor_get_scale(). -

+

clutter_actor_grab_key_focus ()

+
void                clutter_actor_grab_key_focus        (ClutterActor *self);

-Retrieves the scale factors of an actor.

+Sets the key focus of the ClutterStage including self +to this ClutterActor.

- - + - - - - - - - - - - - +

self :

A ClutterActor -

scale_x :

Location to store horizonal scale factor, or NULL. -

scale_y :

Location to store vertical scale factor, or NULL. + a ClutterActor
-

Since 0.2 +

Since 1.0


-

clutter_actor_set_rotationx ()

-
void                clutter_actor_set_rotationx         (ClutterActor *self,
-                                                         ClutterRotateAxis axis,
-                                                         ClutterFixed angle,
-                                                         gint x,
-                                                         gint y,
-                                                         gint z);
-

-Sets the rotation angle of self around the given axis. -

+

clutter_actor_get_pango_context ()

+
PangoContext*       clutter_actor_get_pango_context     (ClutterActor *self);

-This function is the fixed point variant of clutter_actor_set_rotation().

+Retrieves the PangoContext for self. The actor's PangoContext +is already configured using the appropriate font map, resolution +and font options. +

+

+Unlike clutter_actor_create_pango_context(), this context is owend +by the ClutterActor and it will be updated each time the options +stored by the ClutterBackend change. +

+

+You can use the returned PangoContext to create a PangoLayout +and render text using cogl_pango_render_layout() to reuse the +glyphs cache also used by Clutter.

@@ -5696,55 +6202,39 @@ -

axis :

- the axis of rotation - - - -

angle :

- the angle of rotation - - - -

x :

- X coordinate of the rotation center - - - -

y :

- Y coordinate of the rotation center - - - -

z :

- Z coordinate of the rotation center +

Returns :

+ the PangoContext for a ClutterActor. The returned + PangoContext is owned by the actor and should not be unreferenced + by the application code +
-

Since 0.6 +

Since 1.0


-

clutter_actor_get_rotationx ()

-
ClutterFixed        clutter_actor_get_rotationx         (ClutterActor *self,
-                                                         ClutterRotateAxis axis,
-                                                         gint *x,
-                                                         gint *y,
-                                                         gint *z);
+

clutter_actor_create_pango_context ()

+
PangoContext*       clutter_actor_create_pango_context  (ClutterActor *self);

-Retrieves the angle and center of rotation on the given axis, -set using clutter_actor_set_rotation(). +Creates a PangoContext for the given actor. The PangoContext +is already configured using the appropriate font map, resolution +and font options.

-This function is the fixed point variant of clutter_actor_get_rotation().

+See also clutter_actor_get_pango_context().

@@ -5757,34 +6247,19 @@ -

axis :

- the axis of rotation - - - -

x :

- return value for the X coordinate of the center of rotation - - - -

y :

- return value for the Y coordinate of the center of rotation - - - -

z :

- return value for the Z coordinate of the center of rotation - - -

Returns :

- the angle of rotation as a fixed point value. + the newly created PangoContext. Use g_object_ref() + on the returned value to deallocate its resources
-

Since 0.6 +

Since 1.0

@@ -5805,13 +6280,33 @@
+

The "anchor-gravity" property

+
  "anchor-gravity"           ClutterGravity        : Read / Write
+

+The anchor point expressed as a ClutterGravity.

+

+ +

+

Default value: CLUTTER_GRAVITY_NONE

+

Since 1.0 +

+
+
+

The "anchor-x" property

  "anchor-x"                 gint                  : Read / Write
-

X coordinate of the anchor point.

+

+The X coordinate of an actor's anchor point, relative to +the actor coordinate space, in pixels.

+

+ +

Allowed values: >= -2147483647

Default value: 0

+

Since 0.8 +


@@ -5819,9 +6314,16 @@
  "anchor-y"                 gint                  : Read / Write
-

Y coordinate of the anchor point.

+

+The Y coordinate of an actor's anchor point, relative to +the actor coordinate space, in pixels.

+

+ +

Allowed values: >= -2147483647

Default value: 0

+

Since 0.8 +


@@ -6151,9 +6653,15 @@
  "rotation-angle-x"         gdouble               : Read / Write
-

The rotation angle on the X axis.

+

+The rotation angle on the X axis.

+

+ +

Allowed values: >= 0

Default value: 0

+

Since 0.6 +


@@ -6161,9 +6669,15 @@
  "rotation-angle-y"         gdouble               : Read / Write
-

The rotation angle on the Y axis.

+

+The rotation angle on the Y axis.

+

+ +

Allowed values: >= 0

Default value: 0

+

Since 0.6 +


@@ -6171,27 +6685,107 @@
  "rotation-angle-z"         gdouble               : Read / Write
-

The rotation angle on the Z axis.

+

+The rotation angle on the Z axis.

+

+ +

Allowed values: >= 0

Default value: 0

+

Since 0.6 +


The "rotation-center-x" property

  "rotation-center-x"        ClutterVertex*        : Read / Write
-

The rotation center on the X axis.

+

+The rotation center on the X axis.

+

+ +

+

Since 0.6 +


The "rotation-center-y" property

  "rotation-center-y"        ClutterVertex*        : Read / Write
-

The rotation center on the Y axis.

+

+The rotation center on the Y axis.

+

+ +

+

Since 0.6 +


The "rotation-center-z" property

  "rotation-center-z"        ClutterVertex*        : Read / Write
-

The rotation center on the Z axis.

+

+The rotation center on the Z axis.

+

+ +

+

Since 0.6 +

+
+
+
+

The "rotation-center-z-gravity" property

+
  "rotation-center-z-gravity" ClutterGravity        : Read / Write
+

+The rotation center on the Z axis expressed as a ClutterGravity.

+

+ +

+

Default value: CLUTTER_GRAVITY_NONE

+

Since 1.0 +

+
+
+
+

The "scale-center-x" property

+
  "scale-center-x"           gint                  : Read / Write
+

+The horizontal center point for scaling

+

+ +

+

Default value: 0

+

Since 1.0 +

+
+
+
+

The "scale-center-y" property

+
  "scale-center-y"           gint                  : Read / Write
+

+The vertical center point for scaling

+

+ +

+

Default value: 0

+

Since 1.0 +

+
+
+
+

The "scale-gravity" property

+
  "scale-gravity"            ClutterGravity        : Read / Write
+

+The center point for scaling expressed as a ClutterGravity

+

+ +

+

Default value: CLUTTER_GRAVITY_NONE

+

Since 1.0 +


@@ -6199,9 +6793,15 @@
  "scale-x"                  gdouble               : Read / Write
-

Scale factor on the X axis.

+

+The horizontal scale of the actor

+

+ +

Allowed values: >= 0

Default value: 1

+

Since 0.6 +


@@ -6209,9 +6809,15 @@
  "scale-y"                  gdouble               : Read / Write
-

Scale factor on the Y axis.

+

+The vertical scale of the actor

+

+ +

Allowed values: >= 0

Default value: 1

+

Since 0.6 +


@@ -6941,6 +7547,52 @@

+

The "pick" signal

+
void                user_function                      (ClutterActor *actor,
+                                                        ClutterColor *color,
+                                                        gpointer      user_data)      : Run Last
+

+The ::pick signal is emitted each time an actor is being painted +in "pick mode". The pick mode is used to identify the actor during +the event handling phase, or by clutter_stage_get_actor_at_pos(). +The actor should paint its shape using the passed pick_color. +

+

+Subclasses of ClutterActor should override the class signal handler +and paint themselves in that function. +

+

+It is possible to connect a handler to the ::pick signal in order +to set up some custom aspect of a paint in pick mode.

+

+ +

+
++ + + + + + + + + + + + + + +

actor :

the ClutterActor that received the signal +

color :

the ClutterColor to be used when picking +

user_data :

user data set when the signal handler was connected.
+

Since 1.0 +

+
+
+

The "realize" signal

void                user_function                      (ClutterActor *actor,
                                                         
 ClutterAlpha
 
-
+
 
 
 
@@ -19,7 +19,7 @@
 
 
 
-
+
 
 
 
@@ -43,7 +43,7 @@
 Prev
 Up
 Home
-Clutter 0.8.4 Reference Manual
+Clutter 0.9.0 Reference Manual
 Next
 
 Top
@@ -69,8 +69,18 @@
 
                     ClutterAlpha;
                     ClutterAlphaClass;
+gdouble             (*ClutterAlphaFunc)                 (ClutterAlpha *alpha,
+                                                         gpointer user_data);
 ClutterAlpha*       clutter_alpha_new                   (void);
 ClutterAlpha*       clutter_alpha_new_full              (ClutterTimeline *timeline,
+                                                         gulong mode);
+ClutterAlpha*       clutter_alpha_new_with_func         (ClutterTimeline *timeline,
                                                          ClutterAlphaFunc func,
                                                          GDestroyNotify destroy);
+void                clutter_alpha_set_timeline          (ClutterAlpha *alpha,
+                                                         ClutterTimeline *timeline);
+ClutterTimeline*    clutter_alpha_get_timeline          (ClutterAlpha *alpha);
+void                clutter_alpha_set_mode              (ClutterAlpha *alpha,
+                                                         gulong mode);
 guint32             clutter_alpha_get_alpha             (ClutterAlpha *alpha);
-#define             CLUTTER_ALPHA_MAX_ALPHA
+href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gulong"
+>gulong              clutter_alpha_get_mode              (ClutterAlpha *alpha);
 guint32             (*ClutterAlphaFunc)                 (ClutterAlpha *alpha,
-                                                         gpointer user_data);
+href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"
+>gdouble             clutter_alpha_get_alpha             (ClutterAlpha *alpha);
+
 void                clutter_alpha_set_func              (ClutterAlpha *alpha,
                                                          ClutterAlphaFunc func,
                                                          GClosure *closure);
-void                clutter_alpha_set_timeline          (ClutterAlpha *alpha,
-                                                         ClutterTimeline *timeline);
-ClutterTimeline*    clutter_alpha_get_timeline          (ClutterAlpha *alpha);
-#define             CLUTTER_ALPHA_RAMP_INC
-guint32             clutter_ramp_inc_func               (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-#define             CLUTTER_ALPHA_RAMP_DEC
-guint32             clutter_ramp_dec_func               (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-#define             CLUTTER_ALPHA_RAMP
-guint32             clutter_ramp_func                   (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-#define             CLUTTER_ALPHA_SINE
-guint32             clutter_sine_func                   (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-#define             CLUTTER_ALPHA_SINE_INC
-guint32             clutter_sine_inc_func               (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-#define             CLUTTER_ALPHA_SINE_DEC
-guint32             clutter_sine_dec_func               (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-#define             CLUTTER_ALPHA_SINE_HALF
-guint32             clutter_sine_half_func              (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-#define             CLUTTER_ALPHA_SQUARE
-guint32             clutter_square_func                 (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-#define             CLUTTER_ALPHA_SMOOTHSTEP_INC
-guint32             clutter_smoothstep_inc_func         (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-#define             CLUTTER_ALPHA_SMOOTHSTEP_DEC
-guint32             clutter_smoothstep_dec_func         (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-#define             CLUTTER_ALPHA_EXP_INC
+
 guint32             clutter_exp_inc_func                (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-#define             CLUTTER_ALPHA_EXP_DEC
+href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gulong"
+>gulong              clutter_alpha_register_closure      (GClosure *closure);
 guint32             clutter_exp_dec_func                (ClutterAlpha *alpha,
+href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gulong"
+>gulong              clutter_alpha_register_func         (ClutterAlphaFunc func,
                                                          gpointer dummy);
+>gpointer data);
 
@@ -205,32 +144,54 @@

Properties

   "alpha"                    guint                 : Read
+href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"
+>gdouble               : Read
+  "mode"                     gulong                : Read / Write / Construct
   "timeline"                 ClutterTimeline*      : Read / Write
 

Description

-ClutterAlpha is a class for calculating an integer value between -0 and CLUTTER_ALPHA_MAX_ALPHA as a function of time. You should -provide a ClutterTimeline and bind it to the ClutterAlpha object; -you should also provide a function returning the alpha value depending -on the position inside the timeline; this function will be executed -each time a new frame in the ClutterTimeline is reached. Since the -alpha function is controlled by the timeline instance, you can pause -or stop the ClutterAlpha from calling the alpha function by controlling -the ClutterTimeline object. +ClutterAlpha is a class for calculating an floating point value +dependent only on the position of a ClutterTimeline. +

+

+A ClutterAlpha binds a ClutterTimeline to a progress function which +translates the time T into an adimensional factor alpha. The factor can +then be used to drive a ClutterBehaviour, which will translate the +alpha value into something meaningful for a ClutterActor. +

+

+You should provide a ClutterTimeline and bind it to the ClutterAlpha +instance using clutter_alpha_set_timeline(). You should also set an +"animation mode", either by using the ClutterAnimatioMode values that +Clutter itself provides or by registering custom functions using +clutter_alpha_register_func(). +

+

+Instead of a ClutterAnimationMode you may provide a function returning +the alpha value depending on the progress of the timeline, using +clutter_alpha_set_func() or clutter_alpha_set_closure(). The alpha +function will be executed each time a new frame in the ClutterTimeline +is reached. +

+

+Since the alpha function is controlled by the timeline instance, you can +pause, stop or resume the ClutterAlpha from calling the alpha function by +using the appropriate functions of the ClutterTimeline object.

-ClutterAlpha is used to "drive" a ClutterBehaviour instance. +ClutterAlpha is used to "drive" a ClutterBehaviour instance, and it +is internally used by the ClutterAnimation API.

-

Figure 3. Graphic representation of some alpha functions

-
Graphic representation of some alpha functions
+

Figure 3. Easing modes provided by Clutter

+
Easing modes provided by Clutter


@@ -268,6 +229,45 @@


+

ClutterAlphaFunc ()

+
gdouble             (*ClutterAlphaFunc)                 (ClutterAlpha *alpha,
+                                                         gpointer user_data);
+

+A function returning a value depending on the position of +the ClutterTimeline bound to alpha.

+

+ +

+
++ + + + + + + + + + + + + + +

alpha :

a ClutterAlpha +

user_data :

user data passed to the function +

Returns :

a floating point value + +
+

Since 0.2 +

+
+
+

clutter_alpha_new ()

ClutterAlpha*       clutter_alpha_new                   (void);

@@ -298,6 +298,46 @@

clutter_alpha_new_full ()

ClutterAlpha*       clutter_alpha_new_full              (ClutterTimeline *timeline,
+                                                         gulong mode);
+

+Creates a new ClutterAlpha instance and sets the timeline +and animation mode. +

+

+See also clutter_alpha_set_timeline() and clutter_alpha_set_mode().

+

+ +

+
++ + + + + + + + + + + + + + +

timeline :

ClutterTimeline timeline +

mode :

animation mode +

Returns :

the newly created ClutterAlpha + +
+

Since 1.0 +

+
+
+
+

clutter_alpha_new_with_func ()

+
ClutterAlpha*       clutter_alpha_new_with_func         (ClutterTimeline *timeline,
                                                          ClutterAlphaFunc func,
                                                          GDestroyNotify destroy);

-Creates a new ClutterAlpha instance and sets the timeline -and alpha function.

+Creates a new ClutterAlpha instances and sets the timeline +and the alpha function. +

+

+This function will not register func as a global alpha function. +

+

+See also clutter_alpha_set_timeline() and clutter_alpha_set_func().

@@ -316,22 +362,26 @@

timeline :

- ClutterTimeline timeline + a ClutterTimeline

func :

- ClutterAlphaFunc alpha function + a ClutterAlphaFunc

data :

- data to be passed to the alpha function + data to pass to the function, or NULL

destroy :

- notify to be called when removing the alpha function + function to call when removing the alpha function, or NULL @@ -342,17 +392,43 @@
+

Since 1.0 +

+
+
+
+

clutter_alpha_set_timeline ()

+
void                clutter_alpha_set_timeline          (ClutterAlpha *alpha,
+                                                         ClutterTimeline *timeline);
+

+Binds alpha to timeline.

+

+ +

+
++ + + + + + + + + + +

alpha :

A ClutterAlpha +

timeline :

A ClutterTimeline +

Since 0.2


-

clutter_alpha_get_alpha ()

-
guint32             clutter_alpha_get_alpha             (ClutterAlpha *alpha);
+

clutter_alpha_get_timeline ()

+
ClutterTimeline*    clutter_alpha_get_timeline          (ClutterAlpha *alpha);

-Query the current alpha value.

+Gets the ClutterTimeline bound to alpha.

@@ -366,7 +442,7 @@

Returns :

- The current alpha value for the alpha + a ClutterTimeline instance @@ -377,29 +453,44 @@

-

CLUTTER_ALPHA_MAX_ALPHA

-
#define CLUTTER_ALPHA_MAX_ALPHA 0xffff
-
+

clutter_alpha_set_mode ()

+
void                clutter_alpha_set_mode              (ClutterAlpha *alpha,
+                                                         gulong mode);

-Maximum value returned by ClutterAlphaFunc

+Sets the progress function of alpha using the symbolic value +of mode, as taken by the ClutterAnimationMode enumeration or +using the value returned by clutter_alpha_register_func().

-

Since 0.2 +

++ + + + + + + + + + +

alpha :

a ClutterAlpha +

mode :

a ClutterAnimationMode +
+

Since 1.0


-

ClutterAlphaFunc ()

+

clutter_alpha_get_mode ()

guint32             (*ClutterAlphaFunc)                 (ClutterAlpha *alpha,
-                                                         gpointer user_data);
+href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gulong" +>gulong clutter_alpha_get_mode (ClutterAlpha *alpha);

-A function of time, which returns a value between 0 and -CLUTTER_ALPHA_MAX_ALPHA.

+Retrieves the ClutterAnimatioMode used by alpha.

@@ -412,14 +503,38 @@ -

user_data :

- user data passed to the function +

Returns :

+ the animation mode + + + + +
+

Since 1.0 +

+ +
+
+

clutter_alpha_get_alpha ()

+
gdouble             clutter_alpha_get_alpha             (ClutterAlpha *alpha);
+

+Query the current alpha value.

+

+ +

+
++ + + + - @@ -442,7 +557,10 @@

Sets the ClutterAlphaFunc function used to compute the alpha value at each frame of the ClutterTimeline -bound to alpha.

+bound to alpha. +

+

+This function will not register func as a global alpha function.

@@ -456,7 +574,7 @@ - @@ -486,9 +604,8 @@

Sets the GClosure used to compute -the alpha value at each frame of the ClutterTimeline -bound to alpha.

+>GClosure used to compute the alpha value at each +frame of the ClutterTimeline bound to alpha.

@@ -514,11 +631,23 @@
-

clutter_alpha_set_timeline ()

-
void                clutter_alpha_set_timeline          (ClutterAlpha *alpha,
-                                                         ClutterTimeline *timeline);
+

clutter_alpha_register_closure ()

+
gulong              clutter_alpha_register_closure      (GClosure *closure);

-Binds alpha to timeline.

+GClosure variant of clutter_alpha_register_func(). +

+

+Registers a global alpha function and returns its logical id +to be used by clutter_alpha_set_mode() or by ClutterAnimation. +

+

+The logical id is always greater than CLUTTER_ANIMATION_LAST.

@@ -526,26 +655,38 @@
- - + - - +

alpha :

A ClutterAlpha

Returns :

an unsigned integer value, between 0 and -CLUTTER_ALPHA_MAX_ALPHA. + The current alpha value for the alpha

func :

A ClutterAlphaAlphaFunc + A ClutterAlphaFunc

alpha :

A ClutterAlpha +

closure :

a GClosure

timeline :

A ClutterTimeline +

Returns :

the logical id of the alpha function +
-

Since 0.2 +

Since 1.0


-

clutter_alpha_get_timeline ()

-
ClutterTimeline*    clutter_alpha_get_timeline          (ClutterAlpha *alpha);
+

clutter_alpha_register_func ()

+
gulong              clutter_alpha_register_func         (ClutterAlphaFunc func,
+                                                         gpointer data);

-Gets the ClutterTimeline bound to alpha.

+Registers a global alpha function and returns its logical id +to be used by clutter_alpha_set_mode() or by ClutterAnimation. +

+

+The logical id is always greater than CLUTTER_ANIMATION_LAST.

@@ -553,665 +694,67 @@ -

alpha :

- A ClutterAlpha +

func :

+ a ClutterAlphaFunc -

Returns :

- a ClutterTimeline instance - - - - -
-

Since 0.2 -

- -
-
-

CLUTTER_ALPHA_RAMP_INC

-
#define CLUTTER_ALPHA_RAMP_INC       clutter_ramp_inc_func
-
-

-Convenience symbol for clutter_ramp_inc_func().

-

- -

-

Since 0.2 -

-
-
-
-

clutter_ramp_inc_func ()

-
guint32             clutter_ramp_inc_func               (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-

-Convenience alpha function for a monotonic increasing ramp. You -can use this function as the alpha function for clutter_alpha_set_func().

-

- -

-
-- - - - - - - - - - - - - - -

alpha :

a ClutterAlpha -

dummy :

unused argument -

Returns :

an alpha value. - -
-

Since 0.2 -

-
-
-
-

CLUTTER_ALPHA_RAMP_DEC

-
#define CLUTTER_ALPHA_RAMP_DEC       clutter_ramp_dec_func
-
-

-Convenience symbol for clutter_ramp_dec_func().

-

- -

-

Since 0.2 -

-
-
-
-

clutter_ramp_dec_func ()

-
guint32             clutter_ramp_dec_func               (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-

-Convenience alpha function for a monotonic decreasing ramp. You -can use this function as the alpha function for clutter_alpha_set_func().

-

- -

-
-- - - - - - - - - - - - - - -

alpha :

a ClutterAlpha -

dummy :

unused argument -

Returns :

an alpha value. - -
-

Since 0.2 -

-
-
-
-

CLUTTER_ALPHA_RAMP

-
#define CLUTTER_ALPHA_RAMP           clutter_ramp_func
-
-

-Convenience symbol for clutter_ramp_func().

-

- -

-

Since 0.2 -

-
-
-
-

clutter_ramp_func ()

-
guint32             clutter_ramp_func                   (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-

-Convenience alpha function for a full ramp function (increase for -half the time, decrease for the remaining half). You can use this -function as the alpha function for clutter_alpha_set_func().

-

- -

-
-- - - - - - - - - - - - - - -

alpha :

a ClutterAlpha -

dummy :

unused argument -

Returns :

an alpha value. - -
-

Since 0.2 -

-
-
-
-

CLUTTER_ALPHA_SINE

-
#define CLUTTER_ALPHA_SINE           clutter_sine_func
-
-

-Convenience symbol for clutter_sine_func().

-

- -

-

Since 0.2 -

-
-
-
-

clutter_sine_func ()

-
guint32             clutter_sine_func                   (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-

-Convenience alpha function for a sine wave. You can use this -function as the alpha function for clutter_alpha_set_func().

-

- -

-
-- - - - - - - - - - - - - - -

alpha :

a ClutterAlpha -

dummy :

unused argument -

Returns :

an alpha value. - -
-

Since 0.2 -

-
-
-
-

CLUTTER_ALPHA_SINE_INC

-
#define CLUTTER_ALPHA_SINE_INC       clutter_sine_inc_func
-
-

-Convenience symbol for clutter_sine_inc_func().

-

- -

-

Since 0.2 -

-
-
-
-

clutter_sine_inc_func ()

-
guint32             clutter_sine_inc_func               (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-

-Convenience alpha function for a sine wave over interval [0, pi / 2]. -You can use this function as the alpha function for -clutter_alpha_set_func().

-

- -

-
-- - - - - - - - - - - - - - -

alpha :

a ClutterAlpha -

dummy :

unused argument -

Returns :

an alpha value. - -
-

Since 0.2 -

-
-
-
-

CLUTTER_ALPHA_SINE_DEC

-
#define CLUTTER_ALPHA_SINE_DEC       clutter_sine_dec_func
-
-

-Convenience symbol for clutter_sine_dec_func().

-

- -

-

Since 0.2 -

-
-
-
-

clutter_sine_dec_func ()

-
guint32             clutter_sine_dec_func               (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-

-Convenience alpha function for a sine wave over interval [pi / 2, pi]. -You can use this function as the alpha function for -clutter_alpha_set_func().

-

- -

-
-- - - - - - - - - - - - - - -

alpha :

a ClutterAlpha -

dummy :

unused argument -

Returns :

an alpha value. - -
-

Since 0.4 -

-
-
-
-

CLUTTER_ALPHA_SINE_HALF

-
#define CLUTTER_ALPHA_SINE_HALF      clutter_sine_half_func
-
-

-Convenience symbol for clutter_sine_half_func().

-

- -

-

Since 0.4 -

-
-
-
-

clutter_sine_half_func ()

-
guint32             clutter_sine_half_func              (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-

-Convenience alpha function for a sine wave over interval [0, pi]. -You can use this function as the alpha function for -clutter_alpha_set_func().

-

- -

-
-- - - - - - - - - - - - - - -

alpha :

a ClutterAlpha -

dummy :

unused argument -

Returns :

an alpha value. - -
-

Since 0.4 -

-
-
-
-

CLUTTER_ALPHA_SQUARE

-
#define CLUTTER_ALPHA_SQUARE         clutter_square_func
-
-

-Convenience symbol for clutter_square_func().

-

- -

-

Since 0.4 -

-
-
-
-

clutter_square_func ()

-
guint32             clutter_square_func                 (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-

-Convenience alpha function for a square wave. You can use this -function as the alpha function for clutter_alpha_set_func().

-

- -

-
-- - - - - - - - - - - - - - -

alpha :

a ClutterAlpha -

dummy :

unused argument -

Returns :

an alpha value - -
-

Since 0.4 -

-
-
-
-

CLUTTER_ALPHA_SMOOTHSTEP_INC

-
#define CLUTTER_ALPHA_SMOOTHSTEP_INC clutter_smoothstep_inc_func
-
-

-Convenience symbol for clutter_smoothstep_inc_func().

-

- -

-

Since 0.4 -

-
-
-
-

clutter_smoothstep_inc_func ()

-
guint32             clutter_smoothstep_inc_func         (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-

-Convenience alpha function for a smoothstep curve. You can use this -function as the alpha function for clutter_alpha_set_func().

-

- -

-
-- - - - - - - - - - - - - - -

alpha :

a ClutterAlpha -

dummy :

unused -

Returns :

an alpha value - -
-

Since 0.4 -

-
-
-
-

CLUTTER_ALPHA_SMOOTHSTEP_DEC

-
#define CLUTTER_ALPHA_SMOOTHSTEP_DEC clutter_smoothstep_dec_func
-
-

-Convenience symbol for clutter_smoothstep_dec_func().

-

- -

-

Since 0.4 -

-
-
-
-

clutter_smoothstep_dec_func ()

-
guint32             clutter_smoothstep_dec_func         (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-

-Convenience alpha function for a downward smoothstep curve. You can use -this function as the alpha function for clutter_alpha_set_func().

-

- -

-
-- - - - - - - - + -

alpha :

a ClutterAlpha -

dummy :

unused +

data :

user data to pass to func, or NULL

Returns :

an alpha value + the logical id of the alpha function
-

Since 0.4 +

Since 1.0

-
-
-

CLUTTER_ALPHA_EXP_INC

-
#define CLUTTER_ALPHA_EXP_INC        clutter_exp_inc_func
-
-

-Convenience symbol for clutter_exp_inc_func()

-

- -

-

Since 0.4 -

-
-
-
-

clutter_exp_inc_func ()

-
guint32             clutter_exp_inc_func                (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-

-Convenience alpha function for a 2^x curve. You can use this function as the -alpha function for clutter_alpha_set_func().

-

- -

-
-- - - - - - - - - - - - - - -

alpha :

a ClutterAlpha -

dummy :

unused argument -

Returns :

an alpha value. - -
-

Since 0.4 -

-
+
+

Property Details

-

CLUTTER_ALPHA_EXP_DEC

-
#define CLUTTER_ALPHA_EXP_DEC        clutter_exp_dec_func
-
+

The "alpha" property

+
  "alpha"                    gdouble               : Read

-Convenience symbold for clutter_exp_dec_func().

+The alpha value as computed by the alpha function. The linear +interval is 0.0 to 1.0, but the Alpha allows overshooting by +one unit in each direction, so the valid interval is -1.0 to 2.0.

-

Since 0.4 +

Allowed values: [-1,2]

+

Default value: 0

+

Since 0.2


-

clutter_exp_dec_func ()

-
guint32             clutter_exp_dec_func                (ClutterAlpha *alpha,
-                                                         gpointer dummy);
-

-Convenience alpha function for a decreasing 2^x curve. You can use this -function as the alpha function for clutter_alpha_set_func().

+

The "mode" property

+
  "mode"                     gulong                : Read / Write / Construct

- +The progress function logical id - either a value from the +ClutterAnimationMode enumeration or a value returned by +clutter_alpha_register_func().

-
-- - - - - - - - - - - - - - -

alpha :

a ClutterAlpha -

dummy :

unused argument -

Returns :

an alpha value. - -
-

Since 0.4 -

-
-
-
-

Property Details

-
-

The "alpha" property

-
  "alpha"                    guint                 : Read

-The alpha value as computed by the alpha function.

+If CLUTTER_CUSTOM_MODE is used then the function set using +clutter_alpha_set_closure() or clutter_alpha_set_func() +will be used.

-

Allowed values: <= 65535

-

Default value: 0

-

Since 0.2 +

Since 1.0


diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterAnimatable.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterAnimatable.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterAnimatable.html 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterAnimatable.html 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,250 @@ + + + + +ClutterAnimatable + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

ClutterAnimatable

+

ClutterAnimatable — Interface for animatable classes

+
+
+

Synopsis

+
+                    ClutterAnimatable;
+                    ClutterAnimatableIface;
+void                clutter_animatable_animate_property (ClutterAnimatable *animatable,
+                                                         ClutterAnimation *animation,
+                                                         const gchar *property_name,
+                                                         const GValue *initial_value,
+                                                         const GValue *final_value,
+                                                         gdouble progress,
+                                                         GValue *value);
+
+
+
+

Object Hierarchy

+
+  GInterface
+   +----ClutterAnimatable
+
+
+
+

Description

+

+ClutterAnimatable is an interface that allows a GObject class +to control how a ClutterAnimation will animate a property. +

+

+Each ClutterAnimatable should implement the animate_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. +

+

+If a ClutterAnimatable is animated by a ClutterAnimation +instance, the ClutterAnimation will call +clutter_animatable_animate_property() passing the name of the +currently animated property; the initial and final values of +the animation interval; the progress factor. The ClutterAnimatable +implementation should return the computed value for the animated +property. +

+

+ClutterAnimatable is available since Clutter 1.0

+

+ +

+
+
+

Details

+
+

ClutterAnimatable

+
typedef struct _ClutterAnimatable ClutterAnimatable;
+

+ +

+
+
+
+

ClutterAnimatableIface

+
typedef struct {
+  void (* animate_property) (ClutterAnimatable *animatable,
+                             ClutterAnimation  *animation,
+                             const gchar       *property_name,
+                             const GValue      *initial_value,
+                             const GValue      *final_value,
+                             gdouble            progress,
+                             GValue            *value);
+} ClutterAnimatableIface;
+
+

+Base interface for GObjects that can be animated by a +a ClutterAnimation.

+

+ +

+
++ + + + +

animate_property ()

virtual function for animating a property +
+

Since 1.0 +

+
+
+
+

clutter_animatable_animate_property ()

+
void                clutter_animatable_animate_property (ClutterAnimatable *animatable,
+                                                         ClutterAnimation *animation,
+                                                         const gchar *property_name,
+                                                         const GValue *initial_value,
+                                                         const GValue *final_value,
+                                                         gdouble progress,
+                                                         GValue *value);
+

+Calls the animate_property() virtual function for animatable. +

+

+The initial_value and final_value GValues must contain +the same type; value must have been initialized to the same +type of initial_value and final_value. +

+

+All implementation of the ClutterAnimatable interface must +implement this function.

+

+ +

+
++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

animatable :

a ClutterAnimatable +

animation :

a ClutterAnimation +

property_name :

the name of the animated property +

initial_value :

the initial value of the animation interval +

final_value :

the final value of the animation interval +

progress :

the progress factor +

value :

return location for the animation value +
+

Since 1.0 +

+
+
+
+ + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/clutter-animation-behaviours.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/clutter-animation-behaviours.html --- clutter-0.8.4/doc/reference/clutter/html/clutter-animation-behaviours.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/clutter-animation-behaviours.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,10 +4,10 @@ Behaviours - + - + @@ -19,7 +19,7 @@ - + @@ -42,8 +42,8 @@ Prev Up Home -Clutter 0.8.4 Reference Manual -Next +Clutter 0.9.0 Reference Manual +Next

@@ -51,7 +51,7 @@

With a large application containing many animations, the use of just - timelines can become unweldy and difficult to manage with much code + timelines can become unwieldy and difficult to manage with much code duplication in the new-frame handlers that can require over complex code changes for minor animation modifications. To ease these problems the #ClutterAlpha and #ClutterBehaviour classes were created. @@ -67,77 +67,19 @@

- A ClutterAlpha is simply a 'function of time' (not pixel alpha!). It - is created by referencing a source timeline and a function which - produces a value between 0 and %CLUTTER_ALPHA_MAX dependant on the - timeline position. Various prebuilt alpha functions are included - with Clutter these include + A ClutterAlpha is simply a 'function of time' (not a pixel alpha channel!). + It is created by referencing a source timeline and an "easing mode" which + produces a value between -1 and 2 depending on the progress of the + timeline. Clutter provides various easing modes, as described by + the #ClutterAnimationMode enumeration. It is also possible to register + a new animation mode using clutter_alpha_register_func() or to provide + a custom #ClutterAlphaFunc for a specific #ClutterAlpha instance.

-

-
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

%CLUTTER_ALPHA_RAMP_INC

Increasing ramp function

%CLUTTER_ALPHA_RAMP_DEC

Decreasing ramp function

%CLUTTER_ALPHA_RAMP

Full ramp function

%CLUTTER_ALPHA_SINE_INC

Increasing sine function

%CLUTTER_ALPHA_SINE_DEC

Decreasing sine function

%CLUTTER_ALPHA_SINE_HALF

Half sine function

%CLUTTER_ALPHA_SINE

Full sine function

%CLUTTER_ALPHA_SQUARE

Square waveform ("step") function

%CLUTTER_ALPHA_SMOOTHSTEP_INC

Increasing smooth transition step - function

%CLUTTER_ALPHA_SMOOTHSTEP_DEC

Decreasing smooth transition step - function

%CLUTTER_ALPHA_EXP_INC

Increasing exponential function

%CLUTTER_ALPHA_EXP_DEC

Decreasing exponential function
-

-

-

- A Behaviour is created with a #ClutterAlpha and a set of limits for - whatever the behaviour modifys actor wise. The current #ClutterAlpha + whatever the behaviour modifies in an actor. The current #ClutterAlpha value is then mapped to a value between these limits and this value set on any applied actors. With the #ClutterAlpha's underlying timeline playing the produced value will change and the behaviour @@ -146,15 +88,12 @@

- A #ClutterBehaviour is effectively 'driven' by a supplied #ClutterAlpha and - when then applied to an actor it will modify a visual property or + A #ClutterBehaviour is effectively 'driven' by a supplied #ClutterAlpha + and when then applied to an actor it will modify a visual property or feature of the actor dependant on the Alpha's value. For example a path based behaviour applied to an actor will alter its position along the path dependant on the current alpha value over time. The - actual motion will depend on the chosen #ClutterAlphaFunc - a - #CLUTTER_ALPHA_RAMP_INC making it to move at constant speed along the - path, a #CLUTTER_ALPHA_SINE making it alternate from one end of the - path to the other with non constant speed. + actual motion will depend on the chosen "easing mode".

@@ -176,9 +115,9 @@

The actors position between the path's end points directly correlates to the #ClutterAlpha's current alpha value driving the behaviour. With - the #ClutterAlpha's function set to %CLUTTER_ALPHA_RAMP_INC the actor + the #ClutterAlpha's animation mode set to %CLUTTER_LINEAR the actor will follow the path at a constant velocity, but when changing to - %CLUTTER_ALPHA_SINE_INC the actor initially accelerates before quickly + %CLUTTER_EASE_SINE_IN_OUT the actor initially accelerates before quickly decelerating.

@@ -198,10 +137,6 @@ -

#ClutterBehaviourBspline

-Moves actors along a B-spline path - -

#ClutterBehaviourDepth

Changes the depth of actors @@ -232,7 +167,7 @@

-

Example 10. 

+

Example 10. 

The following example demonstrates an ellipse behaviour in action. @@ -263,9 +198,7 @@ clutter_timeline_set_loop (timeline, TRUE); /* Set an alpha func to power the behaviour */ - alpha = clutter_alpha_new_full (timeline, - CLUTTER_ALPHA_SINE, - NULL, NULL); + alpha = clutter_alpha_new_full (timeline, CLUTTER_EASE_SINE_IN_OUT); behave = clutter_behaviour_ellipse_new (alpha, 200, /* center x */ @@ -306,12 +239,12 @@

Warning

Combining behaviours that effect the same actor properties (i.e two separate paths) will cause unexpected results. The values - will not be merged in any way with essentially a the last applied - behaviour taking precedence.

+ will not be merged in any way with only the last applied behaviour taking + precedence.

- Tips for implementing a new behaviour can be found here. -

+ Tips for implementing a new behaviour can be found here. +

diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/clutter-animation-timelines.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/clutter-animation-timelines.html --- clutter-0.8.4/doc/reference/clutter/html/clutter-animation-timelines.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/clutter-animation-timelines.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ Timelines - + @@ -19,7 +19,7 @@ - + @@ -42,7 +42,7 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next
@@ -94,7 +94,7 @@ The speed, duration and number of frames of the timeline then be modifed via the objects properties and API calls. The timeline can - be made to loop by settings it "loop" property to %TRUE. + be made to loop by setting its "loop" property to %TRUE.

@@ -107,7 +107,7 @@

- By attaching a handler to the timeline's ClutterTimeline::new-frame + By attaching a handler to the timeline's #ClutterTimeline::new-frame signal a timeline can then be used to drive an animation by altering an actor's visual properties in this callback. The callback looks like: @@ -118,13 +118,12 @@ gint frame_num, gpointer user_data) { - }

The frame_num parameter is set to the timeline's - current frame number (which is between 0 and the "num-frames" property). + current frame number (which is between 1 and the "num-frames" property). This value can be used to compute the state of a particular animation that is dependant on the frame numer. The clutter_timeline_get_progress() function can also be used to get a normalised value of the timeline's @@ -190,7 +189,7 @@ clutter_actor_set_position (actor, 100, 100); - timeline = clutter_timeline_new_for (360, 60); /* a degree per frame */ + timeline = clutter_timeline_new_for (360, 60); /* one degree per frame */ clutter_timeline_set_loop (timeline, TRUE); g_signal_connect (timeline, "new-frame", G_CALLBACK (on_new_frame), actor); diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/clutterbase.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/clutterbase.html --- clutter-0.8.4/doc/reference/clutter/html/clutterbase.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/clutterbase.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,8 +4,8 @@ Part III. Clutter Core Reference - - + + @@ -19,7 +19,7 @@ - + @@ -42,7 +42,7 @@ Prev   Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next

@@ -63,7 +63,7 @@ ClutterChildMeta — Wrapper for actors inside a container
-ClutterMedia — An interface for controlling playback of media data. +ClutterMedia — An interface for controlling playback of media data
Base actors
@@ -75,14 +75,13 @@ ClutterTexture — An actor for displaying and manipulating images.
-ClutterCloneTexture — Actor for cloning existing textures in an -efficient way. +ClutterClone
-ClutterLabel — Actor for displaying text +ClutterText — An actor for displaying and editing text
-ClutterEntry — A single line text entry actor +ClutterCairoTexture — Texture with Cairo integration
Container actors
diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterBehaviourBspline.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterBehaviourBspline.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterBehaviourBspline.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterBehaviourBspline.html 1970-01-01 01:00:00.000000000 +0100 @@ -1,573 +0,0 @@ - - - - -ClutterBehaviourBspline - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - -
-

ClutterBehaviourBspline

-

ClutterBehaviourBspline — A behaviour interpolating position along a B-Spline

-
- -
-

Object Hierarchy

-
-  GObject
-   +----ClutterBehaviour
-         +----ClutterBehaviourBspline
-
-
-
-

Implemented Interfaces

-

-ClutterBehaviourBspline implements -

-
-
-

Signals

-
-  "knot-reached"                                   : Run Last
-
-
-
-

Description

-

-ClutterBehaviourBspline interpolates actors along a defined B-Spline path. -

-

-A bezier spline is a set of cubic bezier curves defined by a sequence of -control points given when creating a new ClutterBehaviourBspline instance. -

-

-Additional bezier curves can be added to the end of the bspline using -clutter_behaviour_bspline_append_* family of functions, control points can -be moved using clutter_behaviour_bspline_adjust(). The bspline can be split -into two with clutter_behaviour_bspline_split(), and bsplines can be -concatenated using clutter_behaviour_bspline_join(). -

-

-Each time the behaviour reaches a point on the path, the "knot-reached" -signal is emitted.

-

- -

-
-
-

Details

-
-

ClutterBehaviourBspline

-
typedef struct _ClutterBehaviourBspline ClutterBehaviourBspline;
-

-ClutterBehaviourBspline contains only private data and -should be accessed using the functions below.

-

- -

-

Since 0.2 -

-
-
-
-

ClutterBehaviourBsplineClass

-
typedef struct {
-  void (*knot_reached) (ClutterBehaviourBspline *bsplineb,
-                        const ClutterKnot       *knot);
-} ClutterBehaviourBsplineClass;
-
-

-ClutterBehaviourBsplineClass contains only private data -and should be accessed using the functions below.

-

- -

-
-- - - - -

knot_reached ()

class handler for the "knot-reached" - signal -
-

Since 0.2 -

-
-
-
-

clutter_behaviour_bspline_new ()

-
ClutterBehaviour*   clutter_behaviour_bspline_new       (ClutterAlpha *alpha,
-                                                         const ClutterKnot *knots,
-                                                         guint n_knots);
-

-Creates a new bezier spline behaviour. You can use this behaviour to drive -actors along the bezier spline, described by the knots control points. -

-

-Bspline is defined by 3n + 1 points, n >=1; any trailing points passed -into this function are stored internally and used during any subsequent -clutter_behaviour_bspline_append_* operations.

-

- -

-
-- - - - - - - - - - - - - - - - - - -

alpha :

a ClutterAlpha, or NULL -

knots :

a list of ClutterKnots representing individual control points -

n_knots :

the number of control points -

Returns :

a ClutterBehaviour - -
-

Since 0.4 -

-
-
-
-

clutter_behaviour_bspline_append_knot ()

-
void                clutter_behaviour_bspline_append_knot
-                                                        (ClutterBehaviourBspline *bs,
-                                                         const ClutterKnot *knot);
-

-Appends a ClutterKnot control point to the bezier spline bs. Note, that -since a bezier is defined by 4 control points, the point gets stored in -a temporary chache, and only when there are enough control points to -create a new bezier curve will the bspline extended.

-

- -

-
-- - - - - - - - - - -

bs :

a ClutterBehaviourBspline -

knot :

a ClutterKnot control point to append. -
-

Since 0.4 -

-
-
-
-

clutter_behaviour_bspline_append_knots ()

-
void                clutter_behaviour_bspline_append_knots
-                                                        (ClutterBehaviourBspline *bs,
-                                                         const ClutterKnot *first_knot,
-                                                         ...);
-

-Appends a bezier spline defined by the last control point of bezier spline -bs and the array of ClutterKnot control points to the orginal bezier spline -bs.

-

- -

-
-- - - - - - - - - - - - - - -

bs :

a ClutterBehaviourBspline -

first_knot :

first ClutterKnot -

... :

a NULL-terminated array of ClutterKnot control points. -
-

Since 0.6 -

-
-
-
-

clutter_behaviour_bspline_truncate ()

-
void                clutter_behaviour_bspline_truncate  (ClutterBehaviourBspline *bs,
-                                                         guint offset);
-

-Truncates the bezier spline at the control point; if the control point at -offset is not one of the on-curve points, the bspline will be -truncated at the nearest preceeding on-curve point.

-

- -

-
-- - - - - - - - - - -

bs :

a ClutterBehaviourBspline -

offset :

offset of control where the bspline should be truncated -
-

Since 0.4 -

-
-
-
-

clutter_behaviour_bspline_join ()

-
void                clutter_behaviour_bspline_join      (ClutterBehaviourBspline *bs1,
-                                                         ClutterBehaviourBspline *bs2);
-

-Joins a copy of bezier spline bs2 onto the end of bezier spline bs1; bs2 is -not modified.

-

- -

-
-- - - - - - - - - - -

bs1 :

a ClutterBehaviourBspline -

bs2 :

a ClutterBehaviourBspline -
-

Since 0.4 -

-
-
-
-

clutter_behaviour_bspline_split ()

-
ClutterBehaviour*   clutter_behaviour_bspline_split     (ClutterBehaviourBspline *bs,
-                                                         guint offset);
-

-Splits a bezier spline into two at the control point at offset; if the -control point at offset is not one of the on-curve bezier points, the -bspline will be split at the nearest on-curve point before the offset. -The original bspline is shortened appropriately.

-

- -

-
-- - - - - - - - - - - - - - -

bs :

a ClutterBehaviourBspline -

offset :

an offset of the control point at which to split the spline. -

Returns :

new ClutterBehaviourBspline. - -
-

Since 0.4 -

-
-
-
-

clutter_behaviour_bspline_clear ()

-
void                clutter_behaviour_bspline_clear     (ClutterBehaviourBspline *bs);
-

-Empties a bspline.

-

- -

-
-- - - - -

bs :

a ClutterBehaviourBspline -
-

Since 0.4 -

-
-
-
-

clutter_behaviour_bspline_adjust ()

-
void                clutter_behaviour_bspline_adjust    (ClutterBehaviourBspline *bs,
-                                                         guint offset,
-                                                         ClutterKnot *knot);
-

-Change the coordinaces of control point at index to those represented by -the knot.

-

- -

-
-- - - - - - - - - - - - - - -

bs :

a ClutterBehaviourBspline -

offset :

an index of control point to ajdust -

knot :

a ClutterKnot with new coordinances for the control point. -
-

Since 0.4 -

-
-
-
-

clutter_behaviour_bspline_set_origin ()

-
void                clutter_behaviour_bspline_set_origin
-                                                        (ClutterBehaviourBspline *bs,
-                                                         ClutterKnot *knot);
-

-Sets the origin of the bezier to the point represented by knot. (Initially -the origin of a bspline is given by the position of the first control point -of the first bezier curve.)

-

- -

-
-- - - - - - - - - - -

bs :

a ClutterBehaviourBspline -

knot :

a ClutterKnot origin for the bezier -
-

Since 0.4 -

-
-
-
-

clutter_behaviour_bspline_get_origin ()

-
void                clutter_behaviour_bspline_get_origin
-                                                        (ClutterBehaviourBspline *bs,
-                                                         ClutterKnot *knot);
-

-Gets the origin of the bezier.

-

- -

-
-- - - - - - - - - - -

bs :

a ClutterBehaviourBspline -

knot :

a ClutterKnot where to store the origin of the bezier -
-

Since 0.4 -

-
-
-
-

Signal Details

-
-

The "knot-reached" signal

-
void                user_function                      (ClutterBehaviourBspline *pathb,
-                                                        ClutterKnot             *knot,
-                                                        gpointer                 user_data)      : Run Last
-

-This signal is emitted at the end of each frame.

-

- -

-
-- - - - - - - - - - - - - - -

pathb :

the object which received the signal -

knot :

the ClutterKnot reached -

user_data :

user data set when the signal handler was connected.
-

Since 0.2 -

-
-
-
- - - diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterBehaviourDepth.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterBehaviourDepth.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterBehaviourDepth.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterBehaviourDepth.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,9 +4,9 @@ ClutterBehaviourDepth - + - + @@ -19,7 +19,7 @@ - + @@ -40,10 +40,10 @@ - + - + - + - + - + - - + + - - + - - - - - - + + + + + -
-

Since 0.2 +

Since 1.0


-

clutter_behaviour_path_append_knot ()

-
void                clutter_behaviour_path_append_knot  (ClutterBehaviourPath *pathb,
-                                                         const ClutterKnot *knot);
+

clutter_behaviour_path_new_with_knots ()

+
ClutterBehaviour*   clutter_behaviour_path_new_with_knots
+                                                        (ClutterAlpha *alpha,
+                                                         const ClutterKnot *knots,
+                                                         guint n_knots);
+

+Creates a new path behaviour that will make the actors visit all of +the given knots in order with straight lines in between. +

-Appends a ClutterKnot to the path

+A path will be created where the first knot is used in a +CLUTTER_PATH_MOVE_TO and the subsequent knots are used in +CLUTTER_PATH_LINE_TOs.

@@ -290,67 +309,40 @@ -

pathb :

- a ClutterBehvaiourPath - - - -

knot :

- a ClutterKnot to append. +

alpha :

+ a ClutterAlpha - -
-

Since 0.2 -

-
-
-
-

clutter_behaviour_path_append_knots ()

-
void                clutter_behaviour_path_append_knots (ClutterBehaviourPath *pathb,
-                                                         const ClutterKnot *first_knot,
-                                                         ...);
-

-Adds a NULL-terminated list of knots to a path. This function is -equivalent to calling clutter_behaviour_path_append_knot() for each -member of the list.

-

- -

-
-- - - + - - + - - +

pathb :

a ClutterBehvaiourPath +

knots :

an array of ClutterKnots

first_knot :

the ClutterKnot knot to add to the path +

n_knots :

number of entries in knots

... :

additional knots to add to the path +

Returns :

a ClutterBehaviour +
-

Since 0.2 +

Since 1.0


-

clutter_behaviour_path_insert_knot ()

-
void                clutter_behaviour_path_insert_knot  (ClutterBehaviourPath *pathb,
-                                                         guint offset,
-                                                         const ClutterKnot *knot);
+

clutter_behaviour_path_set_path ()

+
void                clutter_behaviour_path_set_path     (ClutterBehaviourPath *pathb,
+                                                         ClutterPath *path);

-Inserts a ClutterKnot in the path at specified position. Values greater -than total number of knots will append the knot at the end of path.

+Change the path that the actors will follow. This will take the +floating reference on the ClutterPath so you do not need to unref +it.

@@ -359,33 +351,25 @@

pathb :

- a ClutterBehvaiourPath - - - -

offset :

- position in path to insert knot. + the path behaviour -

knot :

- a ClutterKnot to append. +

path :

+ the new path to follow
-

Since 0.2 +

Since 1.0


-

clutter_behaviour_path_remove_knot ()

-
void                clutter_behaviour_path_remove_knot  (ClutterBehaviourPath *pathb,
-                                                         guint offset);
+

clutter_behaviour_path_get_path ()

+
ClutterPath*        clutter_behaviour_path_get_path     (ClutterBehaviourPath *pathb);

-Removes a ClutterKnot in the path at specified offset.

+Get the current path of the behaviour

@@ -394,37 +378,18 @@

pathb :

- a ClutterBehvaiourPath + a ClutterBehaviourPath instance -

offset :

- position in path to remove knot. +

Returns :

+ the path +
-

Since 0.2 -

-
-
-
-

clutter_behaviour_path_clear ()

-
void                clutter_behaviour_path_clear        (ClutterBehaviourPath *pathb);
-

-Removes all knots from a path

-

- -

-
-- - - - -

pathb :

a ClutterBehvaiourPath -
-

Since 0.2 +

Since 1.0


@@ -552,15 +517,9 @@

Property Details

-

The "knot" property

-
  "knot"                     ClutterKnot*          : Write
-

-This property can be used to append a new knot to the path.

-

- -

-

Since 0.2 -

+

The "path" property

+
  "path"                     ClutterPath*          : Read / Write
+

The ClutterPath object representing the path to animate along.

@@ -568,7 +527,9 @@

The "knot-reached" signal

void                user_function                      (ClutterBehaviourPath *pathb,
-                                                        ClutterKnot          *knot,
+                                                        guint                 knot_num,
                                                         gpointer              user_data)      : Run Last
@@ -587,8 +548,8 @@ -

knot :

- the ClutterKnot reached +

knot_num :

+ the index of the ClutterPathKnot reached diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterBehaviourRotate.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterBehaviourRotate.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterBehaviourRotate.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterBehaviourRotate.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,9 +4,9 @@ ClutterBehaviourRotate - + - + @@ -19,7 +19,7 @@ - + @@ -40,10 +40,10 @@ - + - + - + - + - + @@ -136,38 +144,6 @@
-

clutter_backend_get_resolution ()

-
gdouble             clutter_backend_get_resolution      (ClutterBackend *backend);
-

-Gets the resolution for font handling on the screen; see -clutter_backend_set_resolution() for full details.

-

- -

-
-- - - - - - - - - - -

backend :

a ClutterBackend -

Returns :

the current resolution, or -1 if no resolution - has been set. - -
-

Since 0.4 -

-
-
-

clutter_backend_set_resolution ()

void                clutter_backend_set_resolution      (ClutterBackend *backend,
                                                          
 
-

clutter_backend_get_double_click_time ()

+

clutter_backend_get_resolution ()

guint               clutter_backend_get_double_click_time
-                                                        (ClutterBackend *backend);
+href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble" +>gdouble clutter_backend_get_resolution (ClutterBackend *backend);

-Gets the maximum time between two button press events, as set -by clutter_backend_set_double_click_time().

+Gets the resolution for font handling on the screen; see +clutter_backend_set_resolution() for full details.

@@ -228,7 +203,8 @@

Returns :

- a time in milliseconds + the current resolution, or -1 if no resolution + has been set. @@ -271,13 +247,14 @@

-

clutter_backend_get_double_click_distance ()

+

clutter_backend_get_double_click_time ()

guint               clutter_backend_get_double_click_distance
+>guint               clutter_backend_get_double_click_time
                                                         (ClutterBackend *backend);

-Retrieves the distance used to verify a double click event

+Gets the maximum time between two button press events, as set +by clutter_backend_set_double_click_time().

@@ -291,7 +268,7 @@

Returns :

- a distance, in pixels. + a time in milliseconds @@ -333,6 +310,37 @@

+

clutter_backend_get_double_click_distance ()

+
guint               clutter_backend_get_double_click_distance
+                                                        (ClutterBackend *backend);
+

+Retrieves the distance used to verify a double click event

+

+ +

+
++ + + + + + + + + + +

backend :

a ClutterBackend +

Returns :

a distance, in pixels. + +
+

Since 0.4 +

+
+
+

clutter_backend_set_font_options ()

void                clutter_backend_set_font_options    (ClutterBackend *backend,
                                                          cairo_font_options_t *options);
@@ -397,6 +405,75 @@

Since 0.8

+
+
+

clutter_backend_set_font_name ()

+
void                clutter_backend_set_font_name       (ClutterBackend *backend,
+                                                         const gchar *font_name);
+

+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.

+

+ +

+
++ + + + + + + + + + +

backend :

a ClutterBackend +

font_name :

the name of the font +
+

Since 1.0 +

+
+
+
+

clutter_backend_get_font_name ()

+
const gchar*        clutter_backend_get_font_name       (ClutterBackend *backend);
+

+Retrieves the default font name as set by +clutter_backend_set_font_name().

+

+ +

+
++ + + + + + + + + + +

backend :

a ClutterBackend +

Returns :

the font name for the backend. The returned string is + owned by the ClutterBackend and should never be modified or freed + +
+

Since 1.0 +

+

+

clutter_color_new ()

+
ClutterColor*       clutter_color_new                   (guint8 red,
+                                                         guint8 green,
+                                                         guint8 blue,
+                                                         guint8 alpha);
+

+Creates a new ClutterColor with the given values.

+

+ +

+
++ + + + + + + + + + + + + + + + + + + + + + +

red :

red component of the color, between 0 and 255 +

green :

green component of the color, between 0 and 255 +

blue :

blue component of the color, between 0 and 255 +

alpha :

alpha component of the color, between 0 and 255 +

Returns :

the newly allocated color. Use clutter_color_free() + when done + +
+

Since 0.8.4 +

+
+
+

clutter_color_copy ()

ClutterColor*       clutter_color_copy                  (const ClutterColor *color);

@@ -840,7 +907,10 @@ } ClutterParamSpecColor;

-

+A GParamSpec subclass for defining properties holding +a ClutterColor.

@@ -852,6 +922,8 @@
+

Since 1.0 +


@@ -950,7 +1022,7 @@
void                clutter_value_set_color             (GValue *value,
-                                                         ClutterColor *color);
+ const ClutterColor *color);

Sets value to color.

diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterContainer.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterContainer.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterContainer.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterContainer.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ ClutterContainer - + @@ -19,7 +19,7 @@ - + @@ -43,7 +43,7 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next Top @@ -218,6 +218,8 @@ void (* foreach) (ClutterContainer *container, ClutterCallback callback, gpointer user_data); + + /* child stacking */ void (* raise) (ClutterContainer *container, ClutterActor *actor, ClutterActor *sibling); @@ -227,7 +229,6 @@ void (* sort_depth_order) (ClutterContainer *container); /* ClutterChildMeta management */ - GType child_meta_type; void (* create_child_meta) (ClutterContainer *container, ClutterActor *actor); @@ -248,7 +249,9 @@ } ClutterContainerIface;

-Base interface for container actors.

+Base interface for container actors. The add, remove and foreach +virtual functions must be provided by any implementation; the other +virtual functions are optional.

@@ -257,17 +260,20 @@

add ()

- virtual function for adding an actor to the container + virtual function for adding an actor to the container. The + implementation of this virtual function is required.

remove ()

- virtual function for removing an actor from the container + virtual function for removing an actor from the container. The + implementation of this virtual function is required.

foreach ()

- virtual function for iterating over the container's children + virtual function for iterating over the container's children. + The implementation of this virtual function is required. diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/clutter.devhelp /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/clutter.devhelp --- clutter-0.8.4/doc/reference/clutter/html/clutter.devhelp 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/clutter.devhelp 2009-01-30 12:41:02.000000000 +0000 @@ -1,6 +1,6 @@ - + @@ -14,9 +14,9 @@ - - - + + + @@ -31,21 +31,24 @@ - + - - + + + + + @@ -56,7 +59,7 @@ - + @@ -75,7 +78,7 @@ - + @@ -143,7 +146,9 @@ + + @@ -166,7 +171,11 @@ + + + + @@ -174,12 +183,14 @@ + + @@ -187,6 +198,8 @@ + + @@ -201,6 +214,8 @@ + + @@ -211,11 +226,11 @@ - - - - + + + + @@ -243,6 +258,10 @@ + + + + @@ -265,6 +284,7 @@ + @@ -297,26 +317,26 @@ - + - - - - + + + + - + - + + - + - @@ -353,104 +373,119 @@ + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -480,12 +515,11 @@ + - - @@ -514,6 +548,7 @@ + @@ -585,40 +620,21 @@ + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -636,19 +652,6 @@ - - - - - - - - - - - - - @@ -703,18 +706,51 @@ - - - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -751,22 +787,53 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -789,6 +856,20 @@ + + + + + + + + + + + + + + @@ -825,7 +906,6 @@ - @@ -847,7 +927,6 @@ - @@ -855,30 +934,18 @@ - - - - - - - - - - - - - - - - - - + + + + + + @@ -907,8 +974,10 @@ - - + + + + @@ -941,32 +1010,45 @@ + + + + + + + + + + + + + + + + - - - - + + + + + - - - - - - - - + + + + @@ -1010,12 +1092,12 @@ - - - - - - + + + + + + @@ -1072,14 +1154,16 @@ - - + - + + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/clutter.devhelp2 /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/clutter.devhelp2 --- clutter-0.8.4/doc/reference/clutter/html/clutter.devhelp2 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/clutter.devhelp2 2009-01-30 12:41:02.000000000 +0000 @@ -1,6 +1,6 @@ - + @@ -14,9 +14,9 @@ - - - + + + @@ -31,21 +31,24 @@ - + - - + + + + + @@ -56,7 +59,7 @@ - + @@ -75,7 +78,7 @@ - + @@ -114,7 +117,7 @@ - + @@ -143,7 +146,9 @@ + + @@ -166,7 +171,11 @@ + + + + @@ -174,19 +183,23 @@ + + - + + + @@ -201,6 +214,8 @@ + + @@ -211,11 +226,11 @@ - - - - + + + + @@ -243,6 +258,10 @@ + + + + @@ -265,6 +284,7 @@ + @@ -297,26 +317,26 @@ - + - - - - + + + + - + - + + - + - @@ -344,8 +364,8 @@ - - + + @@ -353,104 +373,119 @@ + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -480,19 +515,18 @@ + - - - + @@ -514,12 +548,13 @@ + - + @@ -585,40 +620,21 @@ + - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -636,19 +652,6 @@ - - - - - - - - - - - - - @@ -703,18 +706,51 @@ - - - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -751,22 +787,53 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -784,11 +851,25 @@ - + + + + + + + + + + + + + + + @@ -825,7 +906,6 @@ - @@ -847,7 +927,6 @@ - @@ -855,30 +934,18 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + @@ -907,8 +974,10 @@ - - + + + + @@ -941,32 +1010,45 @@ - + + + + + + + + + + + + + + + + + - - - - + + + + + - - - - - - - - + + + + @@ -1010,12 +1092,12 @@ - - - - - - + + + + + + @@ -1072,14 +1154,16 @@ - - + - + + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterEntry.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterEntry.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterEntry.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterEntry.html 1970-01-01 01:00:00.000000000 +0100 @@ -1,1472 +0,0 @@ - - - - -ClutterEntry - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - -
-

ClutterEntry

-

ClutterEntry — A single line text entry actor

-
-
-

Synopsis

-
-                    ClutterEntry;
-                    ClutterEntryClass;
-ClutterActor*       clutter_entry_new                   (void);
-ClutterActor*       clutter_entry_new_with_text         (const gchar *font_name,
-                                                         const gchar *text);
-ClutterActor*       clutter_entry_new_full              (const gchar *font_name,
-                                                         const gchar *text,
-                                                         const ClutterColor *color);
-void                clutter_entry_set_text              (ClutterEntry *entry,
-                                                         const gchar *text);
-const gchar*        clutter_entry_get_text              (ClutterEntry *entry);
-void                clutter_entry_set_font_name         (ClutterEntry *entry,
-                                                         const gchar *font_name);
-const gchar*        clutter_entry_get_font_name         (ClutterEntry *entry);
-void                clutter_entry_set_color             (ClutterEntry *entry,
-                                                         const ClutterColor *color);
-void                clutter_entry_get_color             (ClutterEntry *entry,
-                                                         ClutterColor *color);
-PangoLayout*        clutter_entry_get_layout            (ClutterEntry *entry);
-void                clutter_entry_set_alignment         (ClutterEntry *entry,
-                                                         PangoAlignment alignment);
-PangoAlignment      clutter_entry_get_alignment         (ClutterEntry *entry);
-void                clutter_entry_set_cursor_position   (ClutterEntry *entry,
-                                                         gint position);
-gint                clutter_entry_get_cursor_position   (ClutterEntry *entry);
-void                clutter_entry_handle_key_event      (ClutterEntry *entry,
-                                                         ClutterKeyEvent *kev);
-void                clutter_entry_insert_unichar        (ClutterEntry *entry,
-                                                         gunichar wc);
-void                clutter_entry_delete_chars          (ClutterEntry *entry,
-                                                         guint len);
-void                clutter_entry_insert_text           (ClutterEntry *entry,
-                                                         const gchar *text,
-                                                         gssize position);
-void                clutter_entry_delete_text           (ClutterEntry *entry,
-                                                         gssize start_pos,
-                                                         gssize end_pos);
-void                clutter_entry_set_visible_cursor    (ClutterEntry *entry,
-                                                         gboolean visible);
-gboolean            clutter_entry_get_visible_cursor    (ClutterEntry *entry);
-void                clutter_entry_set_visibility        (ClutterEntry *entry,
-                                                         gboolean visible);
-gboolean            clutter_entry_get_visibility        (ClutterEntry *entry);
-void                clutter_entry_set_invisible_char    (ClutterEntry *entry,
-                                                         gunichar wc);
-gunichar            clutter_entry_get_invisible_char    (ClutterEntry *entry);
-void                clutter_entry_set_max_length        (ClutterEntry *entry,
-                                                         gint max);
-gint                clutter_entry_get_max_length        (ClutterEntry *entry);
-
-
-
-

Object Hierarchy

-
-  GObject
-   +----GInitiallyUnowned
-         +----ClutterActor
-               +----ClutterEntry
-
-
-
-

Implemented Interfaces

-

-ClutterEntry implements -

-
-
-

Properties

-
-  "alignment"                PangoAlignment        : Read / Write
-  "color"                    ClutterColor*         : Read / Write
-  "cursor-visible"           gboolean              : Read / Write
-  "entry-padding"            guint                 : Read / Write
-  "font-name"                gchar*                : Read / Write
-  "max-length"               gint                  : Read / Write
-  "position"                 gint                  : Read / Write
-  "text"                     gchar*                : Read / Write
-  "text-visible"             gboolean              : Read / Write
-  "x-align"                  gdouble               : Read / Write
-
-
-
-

Signals

-
-  "activate"                                       : Run Last
-  "cursor-event"                                   : Run Last
-  "text-changed"                                   : Run Last
-
-
-
-

Description

-

-ClutterEntry is a ClutterTexture that allows single line text entry. -

-

-ClutterEntry is available since Clutter 0.4.

-

- -

-
-
-

Details

-
-

ClutterEntry

-
typedef struct _ClutterEntry ClutterEntry;
-

- -

-
-
-
-

ClutterEntryClass

-
typedef struct {
-  /* vfuncs, not signals */
-  void (* paint_cursor) (ClutterEntry    *entry);
-  
-  /* signals */
-  void (* text_changed) (ClutterEntry    *entry);
-  void (* cursor_event) (ClutterEntry    *entry,
-                         ClutterGeometry *geometry);
-  void (* activate)     (ClutterEntry    *entry);
-} ClutterEntryClass;
-
-

-Class fo entry actors.

-

- -

-
-- - - - - - - - - - - - - - - - - - -

paint_cursor ()

virtual function for subclasses to use to draw a custom - cursor instead of the default one -

text_changed ()

signal class handler for ClutterEntry::text-changed -

cursor_event ()

signal class handler for ClutterEntry::cursor-event -

activate ()

signal class handler for ClutterEntry::activate -
-

Since 0.4 -

-
-
-
-

clutter_entry_new ()

-
ClutterActor*       clutter_entry_new                   (void);
-

-Creates a new, empty ClutterEntry.

-

- -

-
-- - - - -

Returns :

the newly created ClutterEntry -
-
-
-
-

clutter_entry_new_with_text ()

-
ClutterActor*       clutter_entry_new_with_text         (const gchar *font_name,
-                                                         const gchar *text);
-

-Creates a new ClutterEntry displaying text using font_name.

-

- -

-
-- - - - - - - - - - - - - - -

font_name :

the name (and size) of the font to be used -

text :

the text to be displayed -

Returns :

the newly created ClutterEntry - -
-

Since 0.4 -

-
-
-
-

clutter_entry_new_full ()

-
ClutterActor*       clutter_entry_new_full              (const gchar *font_name,
-                                                         const gchar *text,
-                                                         const ClutterColor *color);
-

-Creates a new ClutterEntry displaying text with color -using font_name.

-

- -

-
-- - - - - - - - - - - - - - - - - - -

font_name :

the name (and size) of the font to be used -

text :

the text to be displayed -

color :

ClutterColor for text -

Returns :

the newly created ClutterEntry - -
-

Since 0.4 -

-
-
-
-

clutter_entry_set_text ()

-
void                clutter_entry_set_text              (ClutterEntry *entry,
-                                                         const gchar *text);
-

-Sets text as the text to be displayed by entry. The -ClutterEntry::text-changed signal is emitted.

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

text :

the text to be displayed -
-

Since 0.4 -

-
-
-
-

clutter_entry_get_text ()

-
const gchar*        clutter_entry_get_text              (ClutterEntry *entry);
-

-Retrieves the text displayed by entry.

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

Returns :

the text of the entry. The returned string is - owned by ClutterEntry and should not be modified or freed. - -
-

Since 0.4 -

-
-
-
-

clutter_entry_set_font_name ()

-
void                clutter_entry_set_font_name         (ClutterEntry *entry,
-                                                         const gchar *font_name);
-

-Sets font_name as the font used by entry. -

-

-font_name must be a string containing the font name and its -size, similarly to what you would feed to the -pango_font_description_from_string() function.

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

font_name :

a font name and size, or NULL for the default font -
-

Since 0.4 -

-
-
-
-

clutter_entry_get_font_name ()

-
const gchar*        clutter_entry_get_font_name         (ClutterEntry *entry);
-

-Retrieves the font used by entry.

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

Returns :

a string containing the font name, in a format - understandable by pango_font_description_from_string(). The - string is owned by ClutterEntry and should not be modified - or freed. - -
-

Since 0.4 -

-
-
-
-

clutter_entry_set_color ()

-
void                clutter_entry_set_color             (ClutterEntry *entry,
-                                                         const ClutterColor *color);
-

-Sets the color of entry.

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

color :

a ClutterColor -
-

Since 0.4 -

-
-
-
-

clutter_entry_get_color ()

-
void                clutter_entry_get_color             (ClutterEntry *entry,
-                                                         ClutterColor *color);
-

-Retrieves the color of entry.

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

color :

return location for a ClutterColor -
-

Since 0.4 -

-
-
-
-

clutter_entry_get_layout ()

-
PangoLayout*        clutter_entry_get_layout            (ClutterEntry *entry);
-

-Gets the PangoLayout used to display the entry. -The layout is useful to e.g. convert text positions to -pixel positions. -The returned layout is owned by the entry so need not be -freed by the caller.

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

Returns :

the PangoLayout for this entry - -
-

Since 0.4 -

-
-
-
-

clutter_entry_set_alignment ()

-
void                clutter_entry_set_alignment         (ClutterEntry *entry,
-                                                         PangoAlignment alignment);
-

-Sets text alignment of the entry.

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

alignment :

A PangoAlignment -
-

Since 0.4 -

-
-
-
-

clutter_entry_get_alignment ()

-
PangoAlignment      clutter_entry_get_alignment         (ClutterEntry *entry);
-

-Returns the entry's text alignment

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

Returns :

The entry's PangoAlignment - -Since 0.4 -
-
-
-
-

clutter_entry_set_cursor_position ()

-
void                clutter_entry_set_cursor_position   (ClutterEntry *entry,
-                                                         gint position);
-

-Sets the position of the cursor. The position must be less than or -equal to the number of characters in the entry. A value of -1 indicates -that the position should be set after the last character in the entry. -Note that this position is in characters, not in bytes.

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

position :

the position of the cursor. -
-

Since 0.6 -

-
-
-
-

clutter_entry_get_cursor_position ()

-
gint                clutter_entry_get_cursor_position   (ClutterEntry *entry);
-

-Gets the position, in characters, of the cursor in entry.

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

Returns :

the position of the cursor. - -
-

Since 0.6 -

-
-
-
-

clutter_entry_handle_key_event ()

-
void                clutter_entry_handle_key_event      (ClutterEntry *entry,
-                                                         ClutterKeyEvent *kev);
-
-

Warning

-

clutter_entry_handle_key_event has been deprecated since version 0.8 and should not be used in newly-written code. The key events will automatically be handled when - giving the key focus to an entry using clutter_stage_set_key_focus().

-
-

-This function will handle a ClutterKeyEvent, like those returned in a -key-press/release-event, and will translate it for the entry. This includes -non-alphanumeric keys, such as the arrows keys, which will move the -input cursor. You should use this function inside a handler for the -ClutterStage::key-press-event or ClutterStage::key-release-event.

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

kev :

a ClutterKeyEvent -
-

Since 0.4 - -

-
-
-
-

clutter_entry_insert_unichar ()

-
void                clutter_entry_insert_unichar        (ClutterEntry *entry,
-                                                         gunichar wc);
-

-Insert a character to the right of the current position of the cursor, -and updates the position of the cursor.

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

wc :

a Unicode character -
-

Since 0.4 -

-
-
-
-

clutter_entry_delete_chars ()

-
void                clutter_entry_delete_chars          (ClutterEntry *entry,
-                                                         guint len);
-

-Characters are removed from before the current postion of the cursor.

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

len :

the number of characters to remove. -
-

Since 0.4 -

-
-
-
-

clutter_entry_insert_text ()

-
void                clutter_entry_insert_text           (ClutterEntry *entry,
-                                                         const gchar *text,
-                                                         gssize position);
-

-Insert text at a specifc position. -

-

-A value of 0 indicates that the text will be inserted before the first -character in the entry's text, and a value of -1 indicates that the text -will be inserted after the last character in the entry's text.

-

- -

-
-- - - - - - - - - - - - - - -

entry :

a ClutterEntry -

text :

the text to insert -

position :

the position at which to insert the text. -
-

Since 0.4 -

-
-
-
-

clutter_entry_delete_text ()

-
void                clutter_entry_delete_text           (ClutterEntry *entry,
-                                                         gssize start_pos,
-                                                         gssize end_pos);
-

-Deletes a sequence of characters. The characters that are deleted are -those characters at positions from start_pos up to, but not including, -end_pos. If end_pos is negative, then the characters deleted will be -those characters from start_pos to the end of the text.

-

- -

-
-- - - - - - - - - - - - - - -

entry :

a ClutterEntry -

start_pos :

the starting position. -

end_pos :

the end position. -
-

Since 0.4 -

-
-
-
-

clutter_entry_set_visible_cursor ()

-
void                clutter_entry_set_visible_cursor    (ClutterEntry *entry,
-                                                         gboolean visible);
-

-Sets the visibility of the input cursor.

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

visible :

whether the input cursor should be visible -
-

Since 0.4 -

-
-
-
-

clutter_entry_get_visible_cursor ()

-
gboolean            clutter_entry_get_visible_cursor    (ClutterEntry *entry);
-

-Returns the input cursor's visibility

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

Returns :

whether the input cursor is visible - -
-

Since 0.4 -

-
-
-
-

clutter_entry_set_visibility ()

-
void                clutter_entry_set_visibility        (ClutterEntry *entry,
-                                                         gboolean visible);
-

-Sets whether the contents of the entry are visible or not. When visibility -is set to FALSE, characters are displayed as the invisible char, and will -also appear that way when the text in the entry widget is copied elsewhere. -

-

-The default invisible char is the asterisk '*', but it can be changed with -clutter_entry_set_invisible_char().

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

visible :

TRUE if the contents of the entry are displayed as plaintext. -
-

Since 0.4 -

-
-
-
-

clutter_entry_get_visibility ()

-
gboolean            clutter_entry_get_visibility        (ClutterEntry *entry);
-

-Returns the entry text visibility.

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

Returns :

TRUE if the contents of the entry are displayed as plaintext. - -
-

Since 0.4 -

-
-
-
-

clutter_entry_set_invisible_char ()

-
void                clutter_entry_set_invisible_char    (ClutterEntry *entry,
-                                                         gunichar wc);
-

-Sets the character to use in place of the actual text when -clutter_entry_set_visibility() has been called to set text visibility -to FALSE. i.e. this is the character used in "password mode" to show the -user how many characters have been typed. The default invisible char is an -asterisk ('*'). If you set the invisible char to 0, then the user will get -no feedback at all; there will be no text on the screen as they type.

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

wc :

a Unicode character -
-

Since 0.4 -

-
-
-
-

clutter_entry_get_invisible_char ()

-
gunichar            clutter_entry_get_invisible_char    (ClutterEntry *entry);
-

-Returns the character to use in place of the actual text when text-visibility -is set to FALSE

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

Returns :

a Unicode character - -
-
-
-
-

clutter_entry_set_max_length ()

-
void                clutter_entry_set_max_length        (ClutterEntry *entry,
-                                                         gint max);
-

-Sets the maximum allowed length of the contents of the actor. If the -current contents are longer than the given length, then they will be -truncated to fit.

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

max :

the maximum number of characters allowed in the entry; 0 - to disable or -1 to set the length of the current string -
-

Since 0.4 -

-
-
-
-

clutter_entry_get_max_length ()

-
gint                clutter_entry_get_max_length        (ClutterEntry *entry);
-

-Gets the maximum length of text that can be set into entry. -See clutter_entry_set_max_length().

-

- -

-
-- - - - - - - - - - -

entry :

a ClutterEntry -

Returns :

the maximum number of characters. - -
-

Since 0.4 -

-
-
-
-

Property Details

-
-

The "alignment" property

-
  "alignment"                PangoAlignment        : Read / Write
-

-The preferred alignment for the string.

-

- -

-

Default value: PANGO_ALIGN_LEFT

-

Since 0.4 -

-
-
-
-

The "color" property

-
  "color"                    ClutterColor*         : Read / Write
-

-The color of the text inside the entry.

-

- -

-

Since 0.4 -

-
-
-
-

The "cursor-visible" property

-
  "cursor-visible"           gboolean              : Read / Write
-

-Whether the input cursor is visible or not.

-

- -

-

Default value: TRUE

-

Since 0.4 -

-
-
-
-

The "entry-padding" property

-
  "entry-padding"            guint                 : Read / Write
-

-The padding space between the text and the entry right and left borders.

-

- -

-

Default value: 5

-

Since 0.4 -

-
-
-
-

The "font-name" property

-
  "font-name"                gchar*                : Read / Write
-

-The font to be used by the entry, expressed in a string that -can be parsed by pango_font_description_from_string().

-

- -

-

Default value: NULL

-

Since 0.4 -

-
-
-
-

The "max-length" property

-
  "max-length"               gint                  : Read / Write
-

-The maximum length of the entry text.

-

- -

-

Allowed values: >= 0

-

Default value: 0

-

Since 0.4 -

-
-
-
-

The "position" property

-
  "position"                 gint                  : Read / Write
-

-The current input cursor position. -1 is taken to be the end of the text

-

- -

-

Allowed values: >= -1

-

Default value: -1

-

Since 0.4 -

-
-
-
-

The "text" property

-
  "text"                     gchar*                : Read / Write
-

-The text inside the entry.

-

- -

-

Default value: NULL

-

Since 0.4 -

-
-
-
-

The "text-visible" property

-
  "text-visible"             gboolean              : Read / Write
-

-Whether the text is visible in plain form, or replaced by the -character set by clutter_entry_set_invisible_char().

-

- -

-

Default value: TRUE

-

Since 0.4 -

-
-
-
-

The "x-align" property

-
  "x-align"                  gdouble               : Read / Write
-

-Horizontal alignment to be used for the text (0.0 for left alignment, -1.0 for right alignment).

-

- -

-

Allowed values: [0,1]

-

Default value: 0

-

Since 0.6 -

-
-
-
-

Signal Details

-
-

The "activate" signal

-
void                user_function                      (ClutterEntry *entry,
-                                                        gpointer      user_data)      : Run Last
-

-The ::activate signal is emitted each time the entry is 'activated' -by the user, normally by pressing the 'Enter' key.

-

- -

-
-- - - - - - - - - - -

entry :

the actor which received the event -

user_data :

user data set when the signal handler was connected.
-

Since 0.4 -

-
-
-
-

The "cursor-event" signal

-
void                user_function                      (ClutterEntry    *entry,
-                                                        ClutterGeometry *geometry,
-                                                        gpointer         user_data)      : Run Last
-

-The ::cursor-event signal is emitted each time the input cursor's geometry -changes, this could be a positional or size change. If you would like to -implement your own input cursor, set the cursor-visible property to FALSE, -and connect to this signal to position and size your own cursor.

-

- -

-
-- - - - - - - - - - - - - - -

entry :

the actor which received the event -

geometry :

a ClutterGeometry -

user_data :

user data set when the signal handler was connected.
-

Since 0.4 -

-
-
-
-

The "text-changed" signal

-
void                user_function                      (ClutterEntry *entry,
-                                                        gpointer      user_data)      : Run Last
-

-The ::text-changed signal is emitted after entry's text changes

-

- -

-
-- - - - - - - - - - -

entry :

the actor which received the event -

user_data :

user data set when the signal handler was connected.
-
-
-
- - - diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/clutter-Events.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/clutter-Events.html --- clutter-0.8.4/doc/reference/clutter/html/clutter-Events.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/clutter-Events.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,9 +4,9 @@ Events - + - + @@ -19,7 +19,7 @@ - + @@ -40,10 +40,10 @@ - + - + + + + + + + + + + + + + + + + + + + + +

Since 0.4 @@ -508,7 +543,12 @@ } ClutterButtonEvent;

-Button event

+Button event. +

+

+The event coordinates are relative to the stage that received the +event, and can be transformed into actor-relative coordinates by +using clutter_actor_transform_stage_point().

@@ -546,14 +586,14 @@

gint x;

- event X coordinate + event X coordinate, relative to the stage

gint y;

- event Y coordinate + event Y coordinate, relative to the stage @@ -1383,7 +1423,7 @@ href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" >guint clutter_key_event_symbol (ClutterKeyEvent *keyev);

-Retrieves the value of the key that caused keyev.

+Retrieves the symbol of the key that caused keyev.

@@ -1397,7 +1437,7 @@

Returns :

- The keysym representing the key + The key symbol representing the key @@ -1476,7 +1516,7 @@

keyval :

- a clutter key symbol + a key symbol diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/clutter-Fixed-Point-Support.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/clutter-Fixed-Point-Support.html --- clutter-0.8.4/doc/reference/clutter/html/clutter-Fixed-Point-Support.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/clutter-Fixed-Point-Support.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ Fixed Point Support - + @@ -19,7 +19,7 @@ - + @@ -43,7 +43,7 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next
Top @@ -63,7 +63,6 @@

Synopsis

 typedef             ClutterFixed;
-#define             CFX_Q
 #define             CFX_ONE
 #define             CFX_HALF
 #define             CFX_MAX
@@ -85,7 +84,6 @@
 #define             CLUTTER_FLOAT_TO_INT                (x)
 #define             CLUTTER_FLOAT_TO_UINT               (x)
 #define             CLUTTER_INT_TO_FIXED                (x)
-#define             CLUTTER_FIXED_INT                   (x)
 #define             CLUTTER_FIXED_FRACTION              (x)
 #define             CLUTTER_FIXED_FLOOR                 (x)
 #define             CLUTTER_FIXED_CEIL                  (x)
@@ -93,46 +91,18 @@
 #define             CLUTTER_FIXED_DIV                   (x,y)
 typedef             ClutterAngle;
 #define             CLUTTER_ANGLE_FROM_DEG              (x)
-#define             CLUTTER_ANGLE_FROM_DEGF             (x)
 #define             CLUTTER_ANGLE_FROM_DEGX             (x)
-#define             CLUTTER_ANGLE_TO_DEGF               (x)
 #define             CLUTTER_ANGLE_TO_DEG                (x)
 #define             CLUTTER_ANGLE_TO_DEGX               (x)
 #define             CLUTTER_ANGLE_MAX_DEG
 #define             CFX_RADIANS_TO_DEGREES
-#define             clutter_cosi                        (angle)
-#define             clutter_cosx                        (angle)
-ClutterFixed        clutter_sini                        (ClutterAngle angle);
-ClutterFixed        clutter_sinx                        (ClutterFixed angle);
-#define             CLUTTER_SQRTI_ARG_10_PERCENT
-#define             CLUTTER_SQRTI_ARG_5_PERCENT
-#define             CLUTTER_SQRTI_ARG_MAX
-gint                clutter_sqrti                       (gint x);
-ClutterFixed        clutter_sqrtx                       (ClutterFixed x);
-ClutterFixed        clutter_log2x                       (guint x);
-guint               clutter_pow2x                       (ClutterFixed x);
-guint               clutter_powx                        (guint x,
-                                                         ClutterFixed y);
-ClutterFixed        clutter_qmulx                       (ClutterFixed op1,
-                                                         ClutterFixed op2);
-ClutterFixed        clutter_qdivx                       (ClutterFixed op1,
-                                                         ClutterFixed op2);
-ClutterFixed        clutter_tani                        (ClutterAngle angle);
-ClutterFixed        clutter_atani                       (ClutterFixed x);
-ClutterFixed        clutter_atan2i                      (ClutterFixed y,
-                                                         ClutterFixed x);
+#define             clutter_cosx                        (a)
+#define             clutter_sinx                        (a)
+#define             clutter_tanx                        (a)
+#define             clutter_atanx                       (a)
+#define             clutter_atan2x                      (x,y)
+#define             clutter_qmulx                       (x,y)
+#define             clutter_qdivx                       (x,y)
 
 #define             CLUTTER_MAXFIXED
 #define             CLUTTER_MINFIXED
@@ -190,7 +160,7 @@
 
  • A fixed point number can be directly multiplied or divided by an integer.

  • Two fixed point numbers can only be multiplied and divided by the - provided CLUTTER_FIXED_MUL and CLUTTER_FIXED_DIV macros.

  • + provided CLUTTER_FIXED_MUL and CLUTTER_FIXED_DIV macros.

    @@ -200,7 +170,7 @@

    Details

    ClutterFixed

    -
    typedef gint32 ClutterFixed;
    +
    typedef float ClutterFixed;
     

    Fixed point number (16.16)

    @@ -210,19 +180,8 @@

    -

    CFX_Q

    -
    #define CFX_Q      16		/* Decimal part size in bits */
    -
    -

    -Size in bits of decimal part of floating point value.

    -

    - -

    -
    -
    -

    CFX_ONE

    -
    #define CFX_ONE    (1 << CFX_Q)	/* 1 */
    +
    #define CFX_ONE         1.0
     

    1.0 represented as a fixed point value.

    @@ -233,7 +192,7 @@

    CFX_HALF

    -
    #define CFX_HALF   32768
    +
    #define CFX_HALF        0.5
     

    0.5 represented as a fixed point value.

    @@ -244,7 +203,7 @@

    CFX_MAX

    -
    #define CFX_MAX    0x7fffffff
    +
    #define CFX_MAX         G_MAXFLOAT
     

    Maximum fixed point value.

    @@ -255,7 +214,7 @@

    CFX_MIN

    -
    #define CFX_MIN    0x80000000
    +
    #define CFX_MIN         (-G_MAXFLOAT)
     

    Minimum fixed point value.

    @@ -266,7 +225,7 @@

    CFX_PI

    -
    #define CFX_PI     0x0003243f
    +
    #define CFX_PI          G_PI
     

    Fixed point representation of Pi

    @@ -277,7 +236,7 @@

    CFX_2PI

    -
    #define CFX_2PI    0x0006487f
    +
    #define CFX_2PI         (G_PI * 2)
     

    Fixed point representation of Pi*2

    @@ -288,7 +247,7 @@

    CFX_PI_2

    -
    #define CFX_PI_2   0x00019220   /* pi/2 */
    +
    #define CFX_PI_2        (G_PI / 2)
     

    Fixed point representation of Pi/2

    @@ -299,7 +258,7 @@

    CFX_PI_4

    -
    #define CFX_PI_4   0x0000c910   /* pi/4 */
    +
    #define CFX_PI_4        (G_PI / 4)
     

    Fixed point representation of Pi/4

    @@ -310,7 +269,7 @@

    CFX_120

    -
    #define CFX_120 CLUTTER_INT_TO_FIXED (120)
    +
    #define CFX_120         120.0
     

    Fixed point representation of the number 120

    @@ -321,7 +280,7 @@

    CFX_180

    -
    #define CFX_180 CLUTTER_INT_TO_FIXED (180)
    +
    #define CFX_180         180.0
     

    Fixed point representation of the number 180

    @@ -332,7 +291,7 @@

    CFX_240

    -
    #define CFX_240 CLUTTER_INT_TO_FIXED (240)
    +
    #define CFX_240         240.0
     

    Fixed point representation of the number 240

    @@ -343,7 +302,7 @@

    CFX_360

    -
    #define CFX_360 CLUTTER_INT_TO_FIXED (360)
    +
    #define CFX_360         360.0
     

    Fixed point representation of the number 360

    @@ -354,7 +313,7 @@

    CFX_60

    -
    #define CFX_60  CLUTTER_INT_TO_FIXED (60)
    +
    #define CFX_60          60.0
     

    Fixed point representation of the number 60

    @@ -365,7 +324,7 @@

    CFX_255

    -
    #define CFX_255 CLUTTER_INT_TO_FIXED (255)
    +
    #define CFX_255         255.0
     

    Fixed point representation of the number 255

    @@ -376,7 +335,7 @@

    CLUTTER_FIXED_TO_INT()

    -
    #define CLUTTER_FIXED_TO_INT(x)         ((x) >> CFX_Q)
    +
    #define CLUTTER_FIXED_TO_INT(x)         ((int)(x))
     

    Converts a fixed point value to integer (removing the decimal part).

    @@ -397,7 +356,7 @@

    CLUTTER_FIXED_TO_FLOAT()

    -
    #define CLUTTER_FIXED_TO_FLOAT(x)       ((float) ((int)(x) / 65536.0))
    +
    #define CLUTTER_FIXED_TO_FLOAT(x)       (x)
     

    Convert a fixed point value to float.

    @@ -416,7 +375,7 @@

    CLUTTER_FIXED_TO_DOUBLE()

    -
    #define CLUTTER_FIXED_TO_DOUBLE(x)      ((double) ((int)(x) / 65536.0))
    +
    #define CLUTTER_FIXED_TO_DOUBLE(x)      ((double)(x))
     

    Convert a fixed point value to double.

    @@ -435,7 +394,7 @@

    CLUTTER_FLOAT_TO_FIXED()

    -
    #define CLUTTER_FLOAT_TO_FIXED(x)       (clutter_double_to_fixed ((x)))
    +
    #define CLUTTER_FLOAT_TO_FIXED(x)       ((x))
     

    Convert a float value to fixed.

    @@ -454,7 +413,7 @@

    CLUTTER_FLOAT_TO_INT()

    -
    #define CLUTTER_FLOAT_TO_INT(x)         (clutter_double_to_int ((x)))
    +
    #define CLUTTER_FLOAT_TO_INT(x)         ((int)(x))
     

    Convert a float value to int.

    @@ -473,7 +432,7 @@

    CLUTTER_FLOAT_TO_UINT()

    -
    #define CLUTTER_FLOAT_TO_UINT(x)         (clutter_double_to_uint ((x)))
    +
    #define CLUTTER_FLOAT_TO_UINT(x)        ((unsigned int)(x))
     

    Convert a float value to unsigned int.

    @@ -492,7 +451,7 @@

    CLUTTER_INT_TO_FIXED()

    -
    #define CLUTTER_INT_TO_FIXED(x)         ((x) << CFX_Q)
    +
    #define CLUTTER_INT_TO_FIXED(x)         ((float)(x))
     

    Convert an integer value to fixed point.

    @@ -510,31 +469,8 @@

    -

    CLUTTER_FIXED_INT()

    -
    #define CLUTTER_FIXED_INT(x)            CLUTTER_FIXED_TO_INT((x))
    -
    -
    -

    Warning

    -

    CLUTTER_FIXED_INT has been deprecated since version 0.6 and should not be used in newly-written code. Use CLUTTER_FIXED_TO_INT instead

    -
    -

    -Convert a fixed point value to integer (removing decimal part).

    -

    - -

    -
    -- - - - -

    x :

    a fixed point value -
    -
    -
    -

    CLUTTER_FIXED_FRACTION()

    -
    #define CLUTTER_FIXED_FRACTION(x)       ((x) & ((1 << CFX_Q) - 1))
    +
    #define CLUTTER_FIXED_FRACTION(x)       ((x)-floorf (x))
     

    Retrieves the fractionary part of a fixed point value

    @@ -553,7 +489,8 @@

    CLUTTER_FIXED_FLOOR()

    -
    #define             CLUTTER_FIXED_FLOOR(x)
    +
    #define CLUTTER_FIXED_FLOOR(x)          (floorf (x))
    +

    Round down a fixed point value to an integer.

    @@ -571,7 +508,7 @@


    CLUTTER_FIXED_CEIL()

    -
    #define CLUTTER_FIXED_CEIL(x)           (CLUTTER_FIXED_FLOOR (x + 0xffff))
    +
    #define CLUTTER_FIXED_CEIL(x)           (ceilf (x))
     

    Round up a fixed point value to an integer.

    @@ -590,7 +527,7 @@

    CLUTTER_FIXED_MUL()

    -
    #define CLUTTER_FIXED_MUL(x,y) ((x) >> 8) * ((y) >> 8)
    +
    #define CLUTTER_FIXED_MUL(x,y)          ((x) * (y))
     

    Multiply two fixed point values

    @@ -616,7 +553,7 @@

    CLUTTER_FIXED_DIV()

    -
    #define CLUTTER_FIXED_DIV(x,y) ((((x) << 8)/(y)) << 8)
    +
    #define CLUTTER_FIXED_DIV(x,y)          ((x) / (y))
     

    Divide two fixed point values

    @@ -642,11 +579,10 @@

    ClutterAngle

    -
    typedef gint32 ClutterAngle;    /* angle such that 1024 == 2*PI */
    +
    typedef float ClutterAngle;
     

    -Integer representation of an angle such that 1024 corresponds to -full circle (i.e., 2*Pi).

    +An abstract representation of an angle.

    @@ -654,26 +590,7 @@

    CLUTTER_ANGLE_FROM_DEG()

    -
    #define CLUTTER_ANGLE_FROM_DEG(x)  (CLUTTER_FLOAT_TO_INT (((x) * 1024.0) / 360.0))
    -
    -

    - -

    -
    -- - - - -

    x :

    - - -
    -
    -
    -
    -

    CLUTTER_ANGLE_FROM_DEGF()

    -
    #define CLUTTER_ANGLE_FROM_DEGF(x) (CLUTTER_FLOAT_TO_INT (((float)(x) * 1024.0f) / 360.0f))
    +
    #define CLUTTER_ANGLE_FROM_DEG(x)  ((float)(x))
     

    @@ -692,26 +609,7 @@


    CLUTTER_ANGLE_FROM_DEGX()

    -
    #define CLUTTER_ANGLE_FROM_DEGX(x) (CFX_INT((((x)/360)*1024) + CFX_HALF))
    -
    -

    - -

    -
    -- - - - -

    x :

    - - -
    -
    -
    -
    -

    CLUTTER_ANGLE_TO_DEGF()

    -
    #define CLUTTER_ANGLE_TO_DEGF(x)   (((float)(x) * 360.0)/ 1024.0)
    +
    #define CLUTTER_ANGLE_FROM_DEGX(x) (CLUTTER_FIXED_TO_FLOAT (x))
     

    @@ -730,7 +628,7 @@


    CLUTTER_ANGLE_TO_DEG()

    -
    #define CLUTTER_ANGLE_TO_DEG(x)    (((x) * 360.0)/ 1024.0)
    +
    #define CLUTTER_ANGLE_TO_DEG(x)    ((float)(x))
     

    @@ -749,7 +647,7 @@


    CLUTTER_ANGLE_TO_DEGX()

    -
    #define CLUTTER_ANGLE_TO_DEGX(x)   (CLUTTER_INT_TO_FIXED((x) * 45)/128)
    +
    #define CLUTTER_ANGLE_TO_DEGX(x)   (CLUTTER_FLOAT_TO_FIXED (x))
     

    @@ -777,7 +675,7 @@


    CFX_RADIANS_TO_DEGREES

    -
    #define CFX_RADIANS_TO_DEGREES 0x394bb8
    +
    #define CFX_RADIANS_TO_DEGREES  (180.0 / G_PI)
     

    Fixed point representation of the number 180 / pi

    @@ -787,165 +685,28 @@

    -

    clutter_cosi()

    -
    #define clutter_cosi(angle) (clutter_sini ((angle) + 256))
    -
    -

    -Very fast fixed point implementation of cosine function. -

    -

    -ClutterAngle is an integer such that 1024 represents -full circle.

    -

    - -

    -
    -- - - - -

    angle :

    a ClutterAngle angle -
    -

    Since 0.2 -

    -
    -
    -

    clutter_cosx()

    -
    #define clutter_cosx(angle) (clutter_sinx((angle) + CFX_PI_2))
    +
    #define clutter_cosx(a)                 cosf (a * (G_PI/180.0))
     

    -Fixed point cosine function

    -

    - - - -

    angle :

    a ClutterFixed angle in radians -
    -

    Since 0.2 -

    -
    -
    -
    -

    clutter_sini ()

    -
    ClutterFixed        clutter_sini                        (ClutterAngle angle);
    -

    -Very fast fixed point implementation of sine function. -

    -

    -ClutterAngle is an integer such that 1024 represents -full circle.

    -

    +

    a :

    + -

    -
    -- - - - - - - - - - -

    angle :

    a ClutterAngle -

    Returns :

    ClutterFixed sine value.
    -

    Since 0.2 -

    -
    -
    -
    -

    clutter_sinx ()

    -
    ClutterFixed        clutter_sinx                        (ClutterFixed angle);
    -

    -Fixed point implementation of sine function

    -

    - -

    -
    -- - - - - - - - - - +

    angle :

    a ClutterFixed angle in radians -

    Returns :

    ClutterFixed sine value. - -
    -

    Since 0.2 -

    -
    -
    -
    -

    CLUTTER_SQRTI_ARG_10_PERCENT

    -
    #define             CLUTTER_SQRTI_ARG_10_PERCENT
    -

    -Maximum argument that can be passed to clutter_sqrti for which the -resulting error is < 10%

    -

    - -

    -

    Since 0.6 -


    -

    CLUTTER_SQRTI_ARG_5_PERCENT

    -
    #define             CLUTTER_SQRTI_ARG_5_PERCENT
    -

    -Maximum argument that can be passed to clutter_sqrti for which the -resulting error is < 5%

    -

    - -

    -

    Since 0.6 -

    -
    -
    -
    -

    CLUTTER_SQRTI_ARG_MAX

    -
    #define             CLUTTER_SQRTI_ARG_MAX
    -

    -Maximum argument that can be passed to clutter_sqrti function.

    -

    - -

    -

    Since 0.6 -

    -
    -
    -
    -

    clutter_sqrti ()

    -
    gint                clutter_sqrti                       (gint x);
    -

    -Very fast fixed point implementation of square root for integers. -

    -

    -This function is at least 6x faster than clib sqrt() on x86, and (this is -not a typo!) about 500x faster on ARM without FPU. It's error is < 5% -for arguments < CLUTTER_SQRTI_ARG_5_PERCENT and < 10% for arguments < -CLUTTER_SQRTI_ARG_10_PERCENT. The maximum argument that can be passed to -this function is CLUTTER_SQRTI_ARG_MAX.

    +

    clutter_sinx()

    +
    #define clutter_sinx(a)                 sinf (a * (G_PI/180.0))
    +

    @@ -953,130 +714,63 @@ -

    x :

    - integer value +

    a :

    +

    Returns :

    - integer square root. +
    -

    Since 0.2 -


    -

    clutter_sqrtx ()

    -
    ClutterFixed        clutter_sqrtx                       (ClutterFixed x);
    -

    -A fixed point implementation of squre root

    +

    clutter_tanx()

    +
    #define clutter_tanx(a)                 tanf (a * (G_PI/180.0))
    +

    - - - - - - - - + + - - -

    x :

    a ClutterFixed -

    Returns :

    ClutterFixed square root. +

    a :

    -
    -

    Since 0.2 -

    -
    -
    -
    -

    clutter_log2x ()

    -
    ClutterFixed        clutter_log2x                       (guint x);
    -

    -Calculates base 2 logarithm. -

    -

    -This function is some 2.5 times faster on x86, and over 12 times faster on -fpu-less arm, than using libc log().

    -

    -

    -
    -- - - - - - - - - - +

    x :

    value to calculate base 2 logarithm from

    Returns :

    base 2 logarithm. - -
    -

    Since 0.4 -


    -

    clutter_pow2x ()

    -
    guint               clutter_pow2x                       (ClutterFixed x);
    -

    -Calculates 2 to x power. -

    -

    -This function is around 11 times faster on x86, and around 22 times faster -on fpu-less arm than libc pow(2, x).

    +

    clutter_atanx()

    +
    #define clutter_atanx(a)                atanf (a * (G_PI/180.0))
    +

    - - - - - - - - + + - - +

    x :

    exponent -

    Returns :

    2 in x power. +

    a :

    +
    -

    Since 0.4 -


    -

    clutter_powx ()

    -
    guint               clutter_powx                        (guint x,
    -                                                         ClutterFixed y);
    -

    -Calculates x to y power. (Note, if x is a constant it will be faster to -calculate the power as clutter_pow2x (CLUTTER_FIXED_MUL(y, log2 (x)))

    +

    clutter_atan2x()

    +
    #define clutter_atan2x(x,y)             atan2f (x, y)
    +

    @@ -1085,71 +779,24 @@

    x :

    - base +

    y :

    - ClutterFixed exponent - - - -

    Returns :

    - x in y power. - - - - -
    -

    Since 0.4 -

    -
    -
    -
    -

    clutter_qmulx ()

    -
    ClutterFixed        clutter_qmulx                       (ClutterFixed op1,
    -                                                         ClutterFixed op2);
    -

    -Multiplies two fixed values using 64bit arithmetic; this provides -significantly better precission than the CLUTTER_FIXED_MUL macro, -but at performance cost (about 2.7 times slowdown on ARMv5e, and 2 times -on x86).

    -

    + -

    -
    -- - - - - - - - - - - -

    op1 :

    ClutterFixed -

    op2 :

    ClutterFixed -

    Returns :

    the result of the operation
    -

    Since 0.4 -


    -

    clutter_qdivx ()

    -
    ClutterFixed        clutter_qdivx                       (ClutterFixed op1,
    -                                                         ClutterFixed op2);
    -

    -Divides two fixed values using 64bit arithmetic; this provides -significantly better precission than the CLUTTER_FIXED_DIV macro, -but at performance cost.

    +

    clutter_qmulx()

    +
    #define clutter_qmulx(x,y)              ((x) * (y))
    +

    @@ -1157,64 +804,30 @@ -

    op1 :

    - ClutterFixed +

    x :

    + -

    op2 :

    - ClutterFixed +

    y :

    +

    Returns :

    - ClutterFixed - - - - -
    -

    Since 0.4 -

    -
    -
    -
    -

    clutter_tani ()

    -
    ClutterFixed        clutter_tani                        (ClutterAngle angle);
    -

    -Very fast fixed point implementation of tan function. -

    -

    -ClutterAngle is an integer such that 1024 represents -full circle.

    -

    + -

    -
    -- - - - - - - -

    angle :

    a ClutterAngle -

    Returns :

    ClutterFixed sine value.
    -

    Since 0.3 -


    -

    clutter_atani ()

    -
    ClutterFixed        clutter_atani                       (ClutterFixed x);
    -

    -Fast fixed-point version of the arctangent function.

    +

    clutter_qdivx()

    +
    #define clutter_qdivx(x,y)              ((x) / (y))
    +

    @@ -1223,45 +836,19 @@

    x :

    - The tangent to calculate the angle for - - - -

    Returns :

    - The angle in radians represented as a ClutterFixed -for which the tangent is x. + - -
    -
    -
    -
    -

    clutter_atan2i ()

    -
    ClutterFixed        clutter_atan2i                      (ClutterFixed y,
    -                                                         ClutterFixed x);
    -

    -Calculates the arctangent of y / x but uses the sign of both -arguments to return the angle in right quadrant.

    -

    - -

    -
    -- - - - - - - @@ -1270,7 +857,7 @@

    CLUTTER_MAXFIXED

    -
    #define CLUTTER_MAXFIXED        CFX_MAX
    +
    #define CLUTTER_MAXFIXED        G_MAXFLOAT
     

    Higher boundary for ClutterFixed

    @@ -1283,7 +870,7 @@

    CLUTTER_MINFIXED

    -
    #define CLUTTER_MINFIXED        CFX_MIN
    +
    #define CLUTTER_MINFIXED        (-G_MAXFLOAT)
     

    Lower boundary for ClutterFixed

    diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/clutter-General.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/clutter-General.html --- clutter-0.8.4/doc/reference/clutter/html/clutter-General.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/clutter-General.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ General - + @@ -19,7 +19,7 @@ - + @@ -43,7 +43,7 @@
    - + -

    y :

    Numerator of tangent -

    x :

    Denominator of tangent +

    Returns :

    The arctangent of y / x + + +
    Prev Up HomeClutter 0.8.4 Reference ManualClutter 0.9.0 Reference Manual Next
    Top @@ -123,12 +123,12 @@ href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" >guint clutter_get_motion_events_frequency (void); void clutter_clear_glyph_cache (void); -void clutter_set_use_mipmapped_text (gboolean value); +enum ClutterFontFlags; +void clutter_set_font_flags (ClutterFontFlags flags); +ClutterFontFlags clutter_get_font_flags (void); gboolean clutter_get_use_mipmapped_text (void); +href="/usr/share/gtk-doc/html/pango/pango-Fonts.html#PangoFontMap" +>PangoFontMap* clutter_get_font_map (void); void clutter_threads_set_lock_functions (
    -

    clutter_set_use_mipmapped_text ()

    -
    void                clutter_set_use_mipmapped_text      (gboolean value);
    +

    enum ClutterFontFlags

    +
    typedef enum
    +{
    +  CLUTTER_FONT_MIPMAPPING = (1 << 0),
    +  CLUTTER_FONT_HINTING    = (1 << 1),
    +} ClutterFontFlags;
    +
    +

    +Runtime flags to change the font quality. To be used with +clutter_set_font_flags().

    +

    + +

    +
    ++ + + + + + + + + + +

    CLUTTER_FONT_MIPMAPPING

    Set to use mipmaps for the glyph cache textures. +

    CLUTTER_FONT_HINTING

    Set to enable hinting on the glyphs. +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_set_font_flags ()

    +
    void                clutter_set_font_flags              (ClutterFontFlags flags);
    +

    +Sets the font quality options for subsequent text rendering +operations. +

    -Sets whether subsequent text rendering operations will use -mipmapped textures or not. Using mipmapped textures will improve -the quality for scaled down text but will use more texture memory.

    +Using mipmapped textures will improve the quality for scaled down +text but will use more texture memory. +

    +

    +Enabling hinting improves text quality for static text but may +introduce some artifacts if the text is animated.

    - - +

    value :

    TRUE to enable mipmapping or FALSE to disable. +

    flags :

    The new flags
    -

    Since 0.8 +

    Since 1.0 +

    +
    +
    +
    +

    clutter_get_font_flags ()

    +
    ClutterFontFlags    clutter_get_font_flags              (void);
    +

    +Gets the current font flags for rendering text. See +clutter_set_font_flags().

    +

    + +

    +
    ++ + + + +

    Returns :

    The font flags + +
    +

    Since 1.0


    -

    clutter_get_use_mipmapped_text ()

    +

    clutter_get_font_map ()

    gboolean            clutter_get_use_mipmapped_text      (void);
    +href="/usr/share/gtk-doc/html/pango/pango-Fonts.html#PangoFontMap" +>PangoFontMap* clutter_get_font_map (void);

    -Gets whether mipmapped textures are used in text operations. -See clutter_set_use_mipmapped_text().

    +Retrieves the PangoFontMap instance used by Clutter. +You can use the global font map object with the COGL +Pango API.

    @@ -932,15 +991,16 @@

    Returns :

    TRUE if text operations should use mipmapped - textures + the PangoFontMap instance. The returned + value is owned by Clutter and it should never be + unreferenced.
    -

    Since 0.8 +

    Since 1.0


    diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterGroup.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterGroup.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterGroup.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterGroup.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ ClutterGroup - + @@ -19,7 +19,7 @@ - + @@ -43,7 +43,7 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next Top @@ -115,7 +115,7 @@

    Implemented Interfaces

    ClutterGroup implements - ClutterContainer.

    + ClutterScriptable and ClutterContainer.

    Signals

    diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/clutter-Implicit-Animations.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/clutter-Implicit-Animations.html --- clutter-0.8.4/doc/reference/clutter/html/clutter-Implicit-Animations.html 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/html/clutter-Implicit-Animations.html 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,1370 @@ + + + + +Implicit Animations + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +

    Implicit Animations

    +

    Implicit Animations — Simple implicit animations

    +
    +
    +

    Synopsis

    +
    +                    ClutterAnimation;
    +                    ClutterAnimationClass;
    +enum                ClutterAnimationMode;
    +ClutterAnimation*   clutter_animation_new               (void);
    +void                clutter_animation_set_object        (ClutterAnimation *animation,
    +                                                         GObject *object);
    +GObject*            clutter_animation_get_object        (ClutterAnimation *animation);
    +void                clutter_animation_set_mode          (ClutterAnimation *animation,
    +                                                         gulong mode);
    +gulong              clutter_animation_get_mode          (ClutterAnimation *animation);
    +void                clutter_animation_set_duration      (ClutterAnimation *animation,
    +                                                         gint msecs);
    +guint               clutter_animation_get_duration      (ClutterAnimation *animation);
    +void                clutter_animation_set_loop          (ClutterAnimation *animation,
    +                                                         gboolean loop);
    +gboolean            clutter_animation_get_loop          (ClutterAnimation *animation);
    +void                clutter_animation_set_timeline      (ClutterAnimation *animation,
    +                                                         ClutterTimeline *timeline);
    +ClutterTimeline*    clutter_animation_get_timeline      (ClutterAnimation *animation);
    +void                clutter_animation_set_alpha         (ClutterAnimation *animation,
    +                                                         ClutterAlpha *alpha);
    +ClutterAlpha*       clutter_animation_get_alpha         (ClutterAnimation *animation);
    +
    +void                clutter_animation_bind_property     (ClutterAnimation *animation,
    +                                                         const gchar *property_name,
    +                                                         ClutterInterval *interval);
    +void                clutter_animation_update_property   (ClutterAnimation *animation,
    +                                                         const gchar *property_name,
    +                                                         ClutterInterval *interval);
    +gboolean            clutter_animation_has_property      (ClutterAnimation *animation,
    +                                                         const gchar *property_name);
    +void                clutter_animation_unbind_property   (ClutterAnimation *animation,
    +                                                         const gchar *property_name);
    +ClutterInterval*    clutter_animation_get_interval      (ClutterAnimation *animation,
    +                                                         const gchar *property_name);
    +
    +ClutterAnimation*   clutter_actor_animate               (ClutterActor *actor,
    +                                                         gulong mode,
    +                                                         guint duration,
    +                                                         const gchar *first_property_name,
    +                                                         ...);
    +ClutterAnimation*   clutter_actor_animate_with_timeline (ClutterActor *actor,
    +                                                         gulong mode,
    +                                                         ClutterTimeline *timeline,
    +                                                         const gchar *first_property_name,
    +                                                         ...);
    +ClutterAnimation*   clutter_actor_animate_with_alpha    (ClutterActor *actor,
    +                                                         ClutterAlpha *alpha,
    +                                                         const gchar *first_property_name,
    +                                                         ...);
    +
    +
    +
    +

    Description

    +

    +ClutterAnimation is an object providing simple, implicit animations +for GObjects. +

    +

    +ClutterAnimation instances will bind a GObject property belonging +to a GObject to a ClutterInterval, and will then use a ClutterTimeline +to interpolate the property between the initial and final values of the +interval. +

    +

    +For convenience, it is possible to use the clutter_actor_animate() +function call which will take care of setting up and tearing down +a ClutterAnimation instance and animate an actor between its current +state and the specified final state. +

    +

    +ClutterAnimation is available since Clutter 1.0

    +

    + +

    +
    +
    +

    Details

    +
    +

    ClutterAnimation

    +
    typedef struct {
    +} ClutterAnimation;
    +
    +

    +The ClutterAnimation structure contains only private data and should +be accessed using the provided functions.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    ClutterAnimationClass

    +
    typedef struct {
    +  void (* completed) (ClutterAnimation *animation);
    +} ClutterAnimationClass;
    +
    +

    +The ClutterAnimationClass structure contains only private data and +should be accessed using the provided functions.

    +

    + +

    +
    ++ + + + +

    completed ()

    class handler for the "completed" signal +
    +

    Since 1.0 +

    +
    +
    +
    +

    enum ClutterAnimationMode

    +
    typedef enum {
    +  CLUTTER_CUSTOM_MODE = 0,
    +
    +  /* linear */
    +  CLUTTER_LINEAR,
    +
    +  /* quadratic */
    +  CLUTTER_EASE_IN_QUAD,
    +  CLUTTER_EASE_OUT_QUAD,
    +  CLUTTER_EASE_IN_OUT_QUAD,
    +
    +  /* cubic */
    +  CLUTTER_EASE_IN_CUBIC,
    +  CLUTTER_EASE_OUT_CUBIC,
    +  CLUTTER_EASE_IN_OUT_CUBIC,
    +
    +  /* quartic */
    +  CLUTTER_EASE_IN_QUART,
    +  CLUTTER_EASE_OUT_QUART,
    +  CLUTTER_EASE_IN_OUT_QUART,
    +
    +  /* quintic */
    +  CLUTTER_EASE_IN_QUINT,
    +  CLUTTER_EASE_OUT_QUINT,
    +  CLUTTER_EASE_IN_OUT_QUINT,
    +
    +  /* sinusoidal */
    +  CLUTTER_EASE_IN_SINE,
    +  CLUTTER_EASE_OUT_SINE,
    +  CLUTTER_EASE_IN_OUT_SINE,
    +
    +  /* exponential */
    +  CLUTTER_EASE_IN_EXPO,
    +  CLUTTER_EASE_OUT_EXPO,
    +  CLUTTER_EASE_IN_OUT_EXPO,
    +
    +  /* circular */
    +  CLUTTER_EASE_IN_CIRC,
    +  CLUTTER_EASE_OUT_CIRC,
    +  CLUTTER_EASE_IN_OUT_CIRC,
    +
    +  /* elastic */
    +  CLUTTER_EASE_IN_ELASTIC,
    +  CLUTTER_EASE_OUT_ELASTIC,
    +  CLUTTER_EASE_IN_OUT_ELASTIC,
    +
    +  /* overshooting cubic */
    +  CLUTTER_EASE_IN_BACK,
    +  CLUTTER_EASE_OUT_BACK,
    +  CLUTTER_EASE_IN_OUT_BACK,
    +
    +  /* exponentially decaying parabolic */
    +  CLUTTER_EASE_IN_BOUNCE,
    +  CLUTTER_EASE_OUT_BOUNCE,
    +  CLUTTER_EASE_IN_OUT_BOUNCE,
    +
    +  /* guard, before registered alpha functions */
    +  CLUTTER_ANIMATION_LAST
    +} ClutterAnimationMode;
    +
    +

    +The animation modes used by ClutterAlpha and ClutterAnimation. This +enumeration can be expanded in later versions of Clutter. See the +ClutterAlpha documentation for a graph of all the animation modes. +

    +

    +Every global alpha function registered using clutter_alpha_register_func() +or clutter_alpha_register_closure() will have a logical id greater than +CLUTTER_ANIMATION_LAST.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    CLUTTER_CUSTOM_MODE

    custom progress function +

    CLUTTER_LINEAR

    linear tweening +

    CLUTTER_EASE_IN_QUAD

    quadratic tweening +

    CLUTTER_EASE_OUT_QUAD

    quadratic tweening, inverse of + CLUTTER_EASE_IN_QUAD +

    CLUTTER_EASE_IN_OUT_QUAD

    quadratic tweening, combininig + CLUTTER_EASE_IN_QUAD and CLUTTER_EASE_OUT_QUAD +

    CLUTTER_EASE_IN_CUBIC

    cubic tweening +

    CLUTTER_EASE_OUT_CUBIC

    cubic tweening, invers of + CLUTTER_EASE_IN_CUBIC +

    CLUTTER_EASE_IN_OUT_CUBIC

    cubic tweening, combining + CLUTTER_EASE_IN_CUBIC and CLUTTER_EASE_OUT_CUBIC +

    CLUTTER_EASE_IN_QUART

    quartic tweening +

    CLUTTER_EASE_OUT_QUART

    quartic tweening, inverse of + CLUTTER_EASE_IN_QUART +

    CLUTTER_EASE_IN_OUT_QUART

    quartic tweening, combining + CLUTTER_EASE_IN_QUART and CLUTTER_EASE_OUT_QUART +

    CLUTTER_EASE_IN_QUINT

    quintic tweening +

    CLUTTER_EASE_OUT_QUINT

    quintic tweening, inverse of + CLUTTER_EASE_IN_QUINT +

    CLUTTER_EASE_IN_OUT_QUINT

    fifth power tweening, combining + CLUTTER_EASE_IN_QUINT and CLUTTER_EASE_OUT_QUINT +

    CLUTTER_EASE_IN_SINE

    sinusoidal tweening +

    CLUTTER_EASE_OUT_SINE

    sinusoidal tweening, inverse of + CLUTTER_EASE_IN_SINE +

    CLUTTER_EASE_IN_OUT_SINE

    sine wave tweening, combining + CLUTTER_EASE_IN_SINE and CLUTTER_EASE_OUT_SINE +

    CLUTTER_EASE_IN_EXPO

    exponential tweening +

    CLUTTER_EASE_OUT_EXPO

    exponential tweening, inverse of + CLUTTER_EASE_IN_EXPO +

    CLUTTER_EASE_IN_OUT_EXPO

    exponential tweening, combining + CLUTTER_EASE_IN_EXPO and CLUTTER_EASE_OUT_EXPO +

    CLUTTER_EASE_IN_CIRC

    circular tweening +

    CLUTTER_EASE_OUT_CIRC

    circular tweening, inverse of + CLUTTER_EASE_IN_CIRC +

    CLUTTER_EASE_IN_OUT_CIRC

    circular tweening, combining + CLUTTER_EASE_IN_CIRC and CLUTTER_EASE_OUT_CIRC +

    CLUTTER_EASE_IN_ELASTIC

    elastic tweening, with offshoot on start +

    CLUTTER_EASE_OUT_ELASTIC

    elastic tweening, with offshoot on end +

    CLUTTER_EASE_IN_OUT_ELASTIC

    elastic tweening with offshoot on both ends +

    CLUTTER_EASE_IN_BACK

    overshooting cubic tweening, with + backtracking on start +

    CLUTTER_EASE_OUT_BACK

    overshooting cubic tweening, with + backtracking on end +

    CLUTTER_EASE_IN_OUT_BACK

    overshooting cubic tweening, with + backtracking on both ends +

    CLUTTER_EASE_IN_BOUNCE

    exponentially decaying parabolic (bounce) + tweening, with bounce on start +

    CLUTTER_EASE_OUT_BOUNCE

    exponentially decaying parabolic (bounce) + tweening, with bounce on end +

    CLUTTER_EASE_IN_OUT_BOUNCE

    exponentially decaying parabolic (bounce) + tweening, with bounce on both ends +

    CLUTTER_ANIMATION_LAST

    last animation mode, used as a guard for + registered global alpha functions +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_animation_new ()

    +
    ClutterAnimation*   clutter_animation_new               (void);
    +

    + +

    +
    ++ + + + +

    Returns :

    + + +
    +
    +
    +
    +

    clutter_animation_set_object ()

    +
    void                clutter_animation_set_object        (ClutterAnimation *animation,
    +                                                         GObject *object);
    +

    +Attaches animation to object. The ClutterAnimation will take a +reference on object.

    +

    + +

    +
    ++ + + + + + + + + + +

    animation :

    a ClutterAnimation +

    object :

    a GObject +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_animation_get_object ()

    +
    GObject*            clutter_animation_get_object        (ClutterAnimation *animation);
    +

    +Retrieves the GObject attached to animation.

    +

    + +

    +
    ++ + + + + + + + + + +

    animation :

    a ClutterAnimation +

    Returns :

    a GObject + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_animation_set_mode ()

    +
    void                clutter_animation_set_mode          (ClutterAnimation *animation,
    +                                                         gulong mode);
    +

    +Sets the animation mode of animation. The animation mode is +a logical id, either coming from the ClutterAnimationMode enumeration +or the return value of clutter_alpha_register_func().

    +

    + +

    +
    ++ + + + + + + + + + +

    animation :

    a ClutterAnimation +

    mode :

    an animation mode logical id +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_animation_get_mode ()

    +
    gulong              clutter_animation_get_mode          (ClutterAnimation *animation);
    +

    +Retrieves the animation mode of animation, as set by +clutter_animation_set_mode().

    +

    + +

    +
    ++ + + + + + + + + + +

    animation :

    a ClutterAnimation +

    Returns :

    the mode for the animation + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_animation_set_duration ()

    +
    void                clutter_animation_set_duration      (ClutterAnimation *animation,
    +                                                         gint msecs);
    +

    +Sets the duration of animation in milliseconds.

    +

    + +

    +
    ++ + + + + + + + + + +

    animation :

    a ClutterAnimation +

    msecs :

    the duration in milliseconds +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_animation_get_duration ()

    +
    guint               clutter_animation_get_duration      (ClutterAnimation *animation);
    +

    +Retrieves the duration of animation, in milliseconds.

    +

    + +

    +
    ++ + + + + + + + + + +

    animation :

    a ClutterAnimation +

    Returns :

    the duration of the animation + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_animation_set_loop ()

    +
    void                clutter_animation_set_loop          (ClutterAnimation *animation,
    +                                                         gboolean loop);
    +

    +Sets whether animation should loop over itself once finished. +

    +

    +A looping ClutterAnimation will not emit the "completed" +signal when finished.

    +

    + +

    +
    ++ + + + + + + + + + +

    animation :

    a ClutterAnimation +

    loop :

    TRUE if the animation should loop +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_animation_get_loop ()

    +
    gboolean            clutter_animation_get_loop          (ClutterAnimation *animation);
    +

    +Retrieves whether animation is looping.

    +

    + +

    +
    ++ + + + + + + + + + +

    animation :

    a ClutterAnimation +

    Returns :

    TRUE if the animation is looping + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_animation_set_timeline ()

    +
    void                clutter_animation_set_timeline      (ClutterAnimation *animation,
    +                                                         ClutterTimeline *timeline);
    +

    +Sets the ClutterTimeline used by animation. +

    +

    +The "duration" and "loop" properties +will be set using the corresponding ClutterTimeline properties as a +side effect. +

    +

    +If timeline is NULL a new ClutterTimeline will be constructed +using the current values of the "duration" and +"loop" properties.

    +

    + +

    +
    ++ + + + + + + + + + +

    animation :

    a ClutterAnimation +

    timeline :

    a ClutterTimeline or NULL +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_animation_get_timeline ()

    +
    ClutterTimeline*    clutter_animation_get_timeline      (ClutterAnimation *animation);
    +

    +Retrieves the ClutterTimeline used by animation

    +

    + +

    +
    ++ + + + + + + + + + +

    animation :

    a ClutterAnimation +

    Returns :

    the timeline used by the animation + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_animation_set_alpha ()

    +
    void                clutter_animation_set_alpha         (ClutterAnimation *animation,
    +                                                         ClutterAlpha *alpha);
    +

    +Sets alpha as the ClutterAlpha used by animation. +

    +

    +If alpha is NULL, a new ClutterAlpha will be constructed from +the current values of the "mode" and +"timeline" properties.

    +

    + +

    +
    ++ + + + + + + + + + +

    animation :

    a ClutterAnimation +

    alpha :

    a ClutterAlpha, or NULL +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_animation_get_alpha ()

    +
    ClutterAlpha*       clutter_animation_get_alpha         (ClutterAnimation *animation);
    +

    +Retrieves the ClutterAlpha used by animation.

    +

    + +

    +
    ++ + + + + + + + + + +

    animation :

    a ClutterAnimation +

    Returns :

    the alpha object used by the animation + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_animation_bind_property ()

    +
    void                clutter_animation_bind_property     (ClutterAnimation *animation,
    +                                                         const gchar *property_name,
    +                                                         ClutterInterval *interval);
    +

    +Binds interval to the property_name of the GObject +attached to animation. The ClutterAnimation will take +ownership of the passed ClutterInterval. +

    +

    +If you need to update the interval instance use +clutter_animation_update_property() instead.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    animation :

    a ClutterAnimation +

    property_name :

    the property to control +

    interval :

    a ClutterInterval +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_animation_update_property ()

    +
    void                clutter_animation_update_property   (ClutterAnimation *animation,
    +                                                         const gchar *property_name,
    +                                                         ClutterInterval *interval);
    +

    +Changes the interval for property_name. The ClutterAnimation +will take ownership of the passed ClutterInterval.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    animation :

    a ClutterAnimation +

    property_name :

    name of the property +

    interval :

    a ClutterInterval +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_animation_has_property ()

    +
    gboolean            clutter_animation_has_property      (ClutterAnimation *animation,
    +                                                         const gchar *property_name);
    +

    +Checks whether animation is controlling property_name.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    animation :

    a ClutterAnimation +

    property_name :

    name of the property +

    Returns :

    TRUE if the property is animated by the + ClutterAnimation, FALSE otherwise + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_animation_unbind_property ()

    +
    void                clutter_animation_unbind_property   (ClutterAnimation *animation,
    +                                                         const gchar *property_name);
    +

    +Removes property_name from the list of animated properties.

    +

    + +

    +
    ++ + + + + + + + + + +

    animation :

    a ClutterAnimation +

    property_name :

    name of the property +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_animation_get_interval ()

    +
    ClutterInterval*    clutter_animation_get_interval      (ClutterAnimation *animation,
    +                                                         const gchar *property_name);
    +

    +Retrieves the ClutterInterval associated to property_name +inside animation.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    animation :

    a ClutterAnimation +

    property_name :

    name of the property +

    Returns :

    a ClutterInterval or NULL if no property with + the same name was found. The returned interval is owned by + the ClutterAnimation and should not be unreferenced + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_actor_animate ()

    +
    ClutterAnimation*   clutter_actor_animate               (ClutterActor *actor,
    +                                                         gulong mode,
    +                                                         guint duration,
    +                                                         const gchar *first_property_name,
    +                                                         ...);
    +

    +Animates the given list of properties of actor between the current +value for each property and a new final value. The animation has a +definite duration and a speed given by the mode. +

    +

    +For example, this: +

    +

    +

    +
    +  clutter_actor_animate (rectangle, CLUTTER_LINEAR, 250,
    +                         "width", 100,
    +                         "height", 100,
    +                         NULL);
    +
    +

    +

    +

    +will make width and height properties of the ClutterActor "rectangle" +grow linearly between the current value and 100 pixels, in 250 milliseconds. +

    +

    +The animation mode is a logical id, either from the ClutterAnimationMode +enumeration of from clutter_alpha_register_func(). +

    +

    +All the properties specified will be animated between the current value +and the final value. If a property should be set at the beginning of +the animation but not updated during the animation, it should be prefixed +by the "fixed::" string, for instance: +

    +

    +

    +
    +  clutter_actor_animate (actor, CLUTTER_EASE_IN, 100,
    +                         "rotation-angle-z", 360,
    +                         "fixed::rotation-center-x", 100,
    +                         "fixed::rotation-center-y", 100,
    +                         NULL);
    +
    +

    +

    +

    +Will animate the "rotation-angle-z" property between the current value +and 360 degrees, and set the "rotation-center-x" and "rotation-center-y" +to the fixed value of 100 pixels. +

    +

    +This function will implicitly create a ClutterAnimation object which +will be assigned to the actor and will be returned to the developer +to control the animation or to know when the animation has been +completed. +

    +

    +Calling this function on an actor that is already being animated +will cause the current animation to change with the new final value. +

    +

    +

    +
    +

    Note

    Unless the animation is looping, it will become invalid as soon +as it is complete. To avoid this, you should keep a reference on the +returned value using g_object_ref().
    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + +

    actor :

    a ClutterActor +

    mode :

    an animation mode logical id +

    duration :

    duration of the animation, in milliseconds +

    first_property_name :

    the name of a property +

    ... :

    a NULL terminated list of property names and + property values +

    Returns :

    a ClutterAnimation object. The object is owned by the + ClutterActor and should not be unreferenced with g_object_unref() + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_actor_animate_with_timeline ()

    +
    ClutterAnimation*   clutter_actor_animate_with_timeline (ClutterActor *actor,
    +                                                         gulong mode,
    +                                                         ClutterTimeline *timeline,
    +                                                         const gchar *first_property_name,
    +                                                         ...);
    +

    +Animates the given list of properties of actor between the current +value for each property and a new final value. The animation has a +definite duration given by timeline and a speed given by the mode. +

    +

    +See clutter_actor_animate() for further details. +

    +

    +This function is useful if you want to use an existing timeline +to animate actor.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + +

    actor :

    a ClutterActor +

    mode :

    an animation mode logical id +

    timeline :

    a ClutterTimeline +

    first_property_name :

    the name of a property +

    ... :

    a NULL terminated list of property names and + property values +

    Returns :

    a ClutterAnimation object. The object is owned by the + ClutterActor and should not be unreferenced with g_object_unref() + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_actor_animate_with_alpha ()

    +
    ClutterAnimation*   clutter_actor_animate_with_alpha    (ClutterActor *actor,
    +                                                         ClutterAlpha *alpha,
    +                                                         const gchar *first_property_name,
    +                                                         ...);
    +

    +Animates the given list of properties of actor between the current +value for each property and a new final value. The animation has a +definite behaviour given by the passed alpha. +

    +

    +See clutter_actor_animate() for further details. +

    +

    +This function is useful if you want to use an existing ClutterAlpha +to animate actor.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + +

    actor :

    a ClutterActor +

    alpha :

    a ClutterAlpha +

    first_property_name :

    the name of a property +

    ... :

    a NULL terminated list of property names and + property values +

    Returns :

    a ClutterAnimation object. The object is owned by the + ClutterActor and should not be unreferenced with g_object_unref() + +
    +

    Since 1.0 +

    +
    +
    +
    + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/clutter-Key-Bindings.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/clutter-Key-Bindings.html --- clutter-0.8.4/doc/reference/clutter/html/clutter-Key-Bindings.html 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/html/clutter-Key-Bindings.html 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,1006 @@ + + + + +Key Bindings + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +

    Key Bindings

    +

    Key Bindings — Pool for key bindings

    +
    +
    +

    Synopsis

    +
    +                    ClutterBindingPool;
    +gboolean            (*ClutterBindingActionFunc)         (GObject *gobject,
    +                                                         const gchar *action_name,
    +                                                         guint key_val,
    +                                                         ClutterModifierType modifiers);
    +
    +ClutterBindingPool* clutter_binding_pool_new            (const gchar *name);
    +ClutterBindingPool* clutter_binding_pool_get_for_class  (gpointer klass);
    +ClutterBindingPool* clutter_binding_pool_find           (const gchar *name);
    +
    +void                clutter_binding_pool_install_action (ClutterBindingPool *pool,
    +                                                         const gchar *action_name,
    +                                                         guint key_val,
    +                                                         ClutterModifierType modifiers,
    +                                                         GCallback callback,
    +                                                         gpointer data,
    +                                                         GDestroyNotify notify);
    +void                clutter_binding_pool_install_closure
    +                                                        (ClutterBindingPool *pool,
    +                                                         const gchar *action_name,
    +                                                         guint key_val,
    +                                                         ClutterModifierType modifiers,
    +                                                         GClosure *closure);
    +void                clutter_binding_pool_override_action
    +                                                        (ClutterBindingPool *pool,
    +                                                         guint key_val,
    +                                                         ClutterModifierType modifiers,
    +                                                         GCallback callback,
    +                                                         gpointer data,
    +                                                         GDestroyNotify notify);
    +void                clutter_binding_pool_override_closure
    +                                                        (ClutterBindingPool *pool,
    +                                                         guint key_val,
    +                                                         ClutterModifierType modifiers,
    +                                                         GClosure *closure);
    +const gchar*        clutter_binding_pool_find_action    (ClutterBindingPool *pool,
    +                                                         guint key_val,
    +                                                         ClutterModifierType modifiers);
    +void                clutter_binding_pool_remove_action  (ClutterBindingPool *pool,
    +                                                         guint key_val,
    +                                                         ClutterModifierType modifiers);
    +void                clutter_binding_pool_block_action   (ClutterBindingPool *pool,
    +                                                         const gchar *action_name);
    +void                clutter_binding_pool_unblock_action (ClutterBindingPool *pool,
    +                                                         const gchar *action_name);
    +
    +gboolean            clutter_binding_pool_activate       (ClutterBindingPool *pool,
    +                                                         guint key_val,
    +                                                         ClutterModifierType modifiers,
    +                                                         GObject *gobject);
    +
    +
    +
    +

    Object Hierarchy

    +
    +  GObject
    +   +----ClutterBindingPool
    +
    +
    +
    +

    Description

    +

    +ClutterBindingPool is a data structure holding a set of key bindings. +Each key binding associates a key symbol (eventually with modifiers) +to an action. A callback function is associated to each action. +

    +

    +For a given key symbol and modifier mask combination there can be only one +action; for each action there can be only one callback. There can be +multiple actions with the same name, and the same callback can be used +to handle multiple key bindings. +

    +

    +Actors requiring key bindings should create a new ClutterBindingPool +inside their class initialization function and then install actions +like this: +

    +

    +

    +
    +static void
    +foo_class_init (FooClass *klass)
    +{
    +  ClutterBindingPool *binding_pool;
    +
    +  binding_pool = clutter_binding_pool_get_for_class (klass);
    +
    +  clutter_binding_pool_install_action (binding_pool, "move-up",
    +                                       CLUTTER_Up, 0,
    +                                       G_CALLBACK (foo_action_move_up),
    +                                       NULL, NULL);
    +  clutter_binding_pool_install_action (binding_pool, "move-up",
    +                                       CLUTTER_KP_Up, 0,
    +                                       G_CALLBACK (foo_action_move_up),
    +                                       NULL, NULL);
    +}
    +
    +

    +

    +

    +The callback has a signature of: +

    +

    +

    +
    +   gboolean (* callback) (GObject             *instance,
    +                          const gchar         *action_name,
    +                          guint                key_val,
    +                          ClutterModifierType  modifiers,
    +                          gpointer             user_data);
    +
    +

    +

    +

    +The actor should then override the "key-press-event" and +use clutter_binding_pool_activate() to match a ClutterKeyEvent structure +to one of the actions: +

    +

    +

    +
    +  ClutterBindingPool *pool;
    +
    +  /* retrieve the binding pool for the type of the actor */
    +  pool = clutter_binding_pool_find (G_OBJECT_TYPE_NAME (actor));
    +
    +  /* activate any callback matching the key symbol and modifiers
    +   * mask of the key event. the returned value can be directly
    +   * used to signal that the actor has handled the event.
    +   */
    +  return clutter_binding_pool_activate (pool, G_OBJECT (actor),
    +                                        key_event->keyval,
    +                                        key_event->modifier_state);
    +
    +

    +

    +

    +The clutter_binding_pool_activate() function will return FALSE if +no action for the given key binding was found, if the action was +blocked (using clutter_binding_pool_block_action()) or if the +key binding handler returned FALSE. +

    +

    +ClutterBindingPool is available since Clutter 1.0

    +

    + +

    +
    +
    +

    Details

    +
    +

    ClutterBindingPool

    +
    typedef struct _ClutterBindingPool ClutterBindingPool;
    +

    +Container of key bindings. The ClutterBindingPool struct is +private.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    ClutterBindingActionFunc ()

    +
    gboolean            (*ClutterBindingActionFunc)         (GObject *gobject,
    +                                                         const gchar *action_name,
    +                                                         guint key_val,
    +                                                         ClutterModifierType modifiers);
    +

    +The prototype for the callback function registered with +clutter_binding_pool_install_action() and invoked by +clutter_binding_pool_activate().

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + +

    gobject :

    a GObject +

    action_name :

    the name of the action +

    key_val :

    the key symbol +

    modifiers :

    bitmask of the modifier flags +

    Returns :

    the function should return TRUE if the key + binding has been handled, and return FALSE otherwise + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_binding_pool_new ()

    +
    ClutterBindingPool* clutter_binding_pool_new            (const gchar *name);
    +

    +Creates a new ClutterBindingPool that can be used to store +key bindings for an actor. The name must be a unique identifier +for the binding pool, so that clutter_binding_pool_find() will +be able to return the correct binding pool.

    +

    + +

    +
    ++ + + + + + + + + + +

    name :

    the name of the binding pool +

    Returns :

    the newly created binding pool with the given + name. Use g_object_unref() when done. + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_binding_pool_get_for_class ()

    +
    ClutterBindingPool* clutter_binding_pool_get_for_class  (gpointer klass);
    +

    +Retrieves the ClutterBindingPool for the given GObject class +and, eventually, creates it. This function is a wrapper around +clutter_binding_pool_new() and uses the class type name as the +unique name for the binding pool. +

    +

    +Calling this function multiple times will return the same +ClutterBindingPool. +

    +

    +A binding pool for a class can also be retrieved using +clutter_binding_pool_find() with the class type name: +

    +

    +

    +
    +  pool = clutter_binding_pool_find (G_OBJECT_TYPE_NAME (instance));
    +
    +

    + +

    +
    ++ + + + + + + + + + +

    klass :

    a GObjectClass pointer +

    Returns :

    the binding pool for the given class. The returned + ClutterBindingPool is owned by Clutter and should not be freed + directly + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_binding_pool_find ()

    +
    ClutterBindingPool* clutter_binding_pool_find           (const gchar *name);
    +

    +Finds the ClutterBindingPool with name.

    +

    + +

    +
    ++ + + + + + + + + + +

    name :

    the name of the binding pool to find +

    Returns :

    a pointer to the ClutterBindingPool, or NULL + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_binding_pool_install_action ()

    +
    void                clutter_binding_pool_install_action (ClutterBindingPool *pool,
    +                                                         const gchar *action_name,
    +                                                         guint key_val,
    +                                                         ClutterModifierType modifiers,
    +                                                         GCallback callback,
    +                                                         gpointer data,
    +                                                         GDestroyNotify notify);
    +

    +Installs a new action inside a ClutterBindingPool. The action +is bound to key_val and modifiers. +

    +

    +The same action name can be used for multiple key_val, modifiers +pairs. +

    +

    +When an action has been activated using clutter_binding_pool_activate() +the passed callback will be invoked (with data). +

    +

    +Actions can be blocked with clutter_binding_pool_block_action() +and then unblocked using clutter_binding_pool_unblock_action().

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    pool :

    a ClutterBindingPool +

    action_name :

    the name of the action +

    key_val :

    key symbol +

    modifiers :

    bitmask of modifiers +

    callback :

    function to be called when the action is activated +

    data :

    data to be passed to callback +

    notify :

    function to be called when the action is removed + from the pool +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_binding_pool_install_closure ()

    +
    void                clutter_binding_pool_install_closure
    +                                                        (ClutterBindingPool *pool,
    +                                                         const gchar *action_name,
    +                                                         guint key_val,
    +                                                         ClutterModifierType modifiers,
    +                                                         GClosure *closure);
    +

    +A GClosure variant of clutter_binding_pool_install_action(). +

    +

    +Installs a new action inside a ClutterBindingPool. The action +is bound to key_val and modifiers. +

    +

    +The same action name can be used for multiple key_val, modifiers +pairs. +

    +

    +When an action has been activated using clutter_binding_pool_activate() +the passed closure will be invoked. +

    +

    +Actions can be blocked with clutter_binding_pool_block_action() +and then unblocked using clutter_binding_pool_unblock_action().

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + +

    pool :

    a ClutterBindingPool +

    action_name :

    the name of the action +

    key_val :

    key symbol +

    modifiers :

    bitmask of modifiers +

    closure :

    a GClosure +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_binding_pool_override_action ()

    +
    void                clutter_binding_pool_override_action
    +                                                        (ClutterBindingPool *pool,
    +                                                         guint key_val,
    +                                                         ClutterModifierType modifiers,
    +                                                         GCallback callback,
    +                                                         gpointer data,
    +                                                         GDestroyNotify notify);
    +

    +Allows overriding the action for key_val and modifiers inside a +ClutterBindingPool. See clutter_binding_pool_install_action(). +

    +

    +When an action has been activated using clutter_binding_pool_activate() +the passed callback will be invoked (with data). +

    +

    +Actions can be blocked with clutter_binding_pool_block_action() +and then unblocked using clutter_binding_pool_unblock_action().

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + +

    pool :

    a ClutterBindingPool +

    key_val :

    key symbol +

    modifiers :

    bitmask of modifiers +

    callback :

    function to be called when the action is activated +

    data :

    data to be passed to callback +

    notify :

    function to be called when the action is removed + from the pool +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_binding_pool_override_closure ()

    +
    void                clutter_binding_pool_override_closure
    +                                                        (ClutterBindingPool *pool,
    +                                                         guint key_val,
    +                                                         ClutterModifierType modifiers,
    +                                                         GClosure *closure);
    +

    +A GClosure variant of clutter_binding_pool_override_action(). +

    +

    +Allows overriding the action for key_val and modifiers inside a +ClutterBindingPool. See clutter_binding_pool_install_closure(). +

    +

    +When an action has been activated using clutter_binding_pool_activate() +the passed callback will be invoked (with data). +

    +

    +Actions can be blocked with clutter_binding_pool_block_action() +and then unblocked using clutter_binding_pool_unblock_action().

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + +

    pool :

    a ClutterBindingPool +

    key_val :

    key symbol +

    modifiers :

    bitmask of modifiers +

    closure :

    a GClosure +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_binding_pool_find_action ()

    +
    const gchar*        clutter_binding_pool_find_action    (ClutterBindingPool *pool,
    +                                                         guint key_val,
    +                                                         ClutterModifierType modifiers);
    +

    +Retrieves the name of the action matching the given key symbol +and modifiers bitmask.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + +

    pool :

    a ClutterBindingPool +

    key_val :

    a key symbol +

    modifiers :

    a bitmask for the modifiers +

    Returns :

    the name of the action, if found, or NULL. The + returned string is owned by the binding pool and should never + be modified or freed + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_binding_pool_remove_action ()

    +
    void                clutter_binding_pool_remove_action  (ClutterBindingPool *pool,
    +                                                         guint key_val,
    +                                                         ClutterModifierType modifiers);
    +

    +Removes the action matching the given key_val, modifiers pair, +if any exists.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    pool :

    a ClutterBindingPool +

    key_val :

    a key symbol +

    modifiers :

    a bitmask for the modifiers +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_binding_pool_block_action ()

    +
    void                clutter_binding_pool_block_action   (ClutterBindingPool *pool,
    +                                                         const gchar *action_name);
    +

    +Blocks all the actions with name action_name inside pool.

    +

    + +

    +
    ++ + + + + + + + + + +

    pool :

    a ClutterBindingPool +

    action_name :

    an action name +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_binding_pool_unblock_action ()

    +
    void                clutter_binding_pool_unblock_action (ClutterBindingPool *pool,
    +                                                         const gchar *action_name);
    +

    +Unblockes all the actions with name action_name inside pool. +

    +

    +Unblocking an action does not cause the callback bound to it to +be invoked in case clutter_binding_pool_activate() was called on +an action previously blocked with clutter_binding_pool_block_action().

    +

    + +

    +
    ++ + + + + + + + + + +

    pool :

    a ClutterBindingPool +

    action_name :

    an action name +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_binding_pool_activate ()

    +
    gboolean            clutter_binding_pool_activate       (ClutterBindingPool *pool,
    +                                                         guint key_val,
    +                                                         ClutterModifierType modifiers,
    +                                                         GObject *gobject);
    +

    +Activates the callback associated to the action that is +bound to the key_val and modifiers pair. +

    +

    +The callback has the following signature: +

    +

    +

    +
    +  void (* callback) (GObject             *gobject,
    +                     const gchar         *action_name,
    +                     guint                key_val,
    +                     ClutterModifierType  modifiers,
    +                     gpointer             user_data);
    +
    +

    +

    +

    +Where the GObject instance is gobject and the user data +is the one passed when installing the action with +clutter_binding_pool_install_action(). +

    +

    +If the action bound to the key_val, modifiers pair has been +blocked using clutter_binding_pool_block_action(), the callback +will not be invoked, and this function will return FALSE.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + +

    pool :

    a ClutterBindingPool +

    key_val :

    the key symbol +

    modifiers :

    bitmask for the modifiers +

    gobject :

    a GObject +

    Returns :

    TRUE if an action was found and was activated + +
    +

    Since 1.0 +

    +
    +
    +
    + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterLabel.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterLabel.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterLabel.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterLabel.html 1970-01-01 01:00:00.000000000 +0100 @@ -1,1122 +0,0 @@ - - - - -ClutterLabel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - - -
    -

    ClutterLabel

    -

    ClutterLabel — Actor for displaying text

    -
    -
    -

    Synopsis

    -
    -                    ClutterLabel;
    -                    ClutterLabelClass;
    -ClutterActor*       clutter_label_new                   (void);
    -ClutterActor*       clutter_label_new_with_text         (const gchar *font_name,
    -                                                         const gchar *text);
    -ClutterActor*       clutter_label_new_full              (const gchar *font_name,
    -                                                         const gchar *text,
    -                                                         const ClutterColor *color);
    -void                clutter_label_set_text              (ClutterLabel *label,
    -                                                         const gchar *text);
    -const gchar*        clutter_label_get_text              (ClutterLabel *label);
    -void                clutter_label_set_font_name         (ClutterLabel *label,
    -                                                         const gchar *font_name);
    -const gchar*        clutter_label_get_font_name         (ClutterLabel *label);
    -void                clutter_label_set_color             (ClutterLabel *label,
    -                                                         const ClutterColor *color);
    -void                clutter_label_get_color             (ClutterLabel *label,
    -                                                         ClutterColor *color);
    -void                clutter_label_set_ellipsize         (ClutterLabel *label,
    -                                                         PangoEllipsizeMode mode);
    -PangoEllipsizeMode  clutter_label_get_ellipsize         (ClutterLabel *label);
    -void                clutter_label_set_line_wrap         (ClutterLabel *label,
    -                                                         gboolean wrap);
    -gboolean            clutter_label_get_line_wrap         (ClutterLabel *label);
    -void                clutter_label_set_line_wrap_mode    (ClutterLabel *label,
    -                                                         PangoWrapMode wrap_mode);
    -PangoWrapMode       clutter_label_get_line_wrap_mode    (ClutterLabel *label);
    -PangoLayout*        clutter_label_get_layout            (ClutterLabel *label);
    -void                clutter_label_set_attributes        (ClutterLabel *label,
    -                                                         PangoAttrList *attrs);
    -PangoAttrList*      clutter_label_get_attributes        (ClutterLabel *label);
    -void                clutter_label_set_use_markup        (ClutterLabel *label,
    -                                                         gboolean setting);
    -gboolean            clutter_label_get_use_markup        (ClutterLabel *label);
    -void                clutter_label_set_alignment         (ClutterLabel *label,
    -                                                         PangoAlignment alignment);
    -PangoAlignment      clutter_label_get_alignment         (ClutterLabel *label);
    -gboolean            clutter_label_get_justify           (ClutterLabel *label);
    -void                clutter_label_set_justify           (ClutterLabel *label,
    -                                                         gboolean justify);
    -
    -
    -
    -

    Object Hierarchy

    -
    -  GObject
    -   +----GInitiallyUnowned
    -         +----ClutterActor
    -               +----ClutterLabel
    -
    -
    -
    -

    Implemented Interfaces

    -

    -ClutterLabel implements -

    -
    -
    -

    Properties

    -
    -  "alignment"                PangoAlignment        : Read / Write
    -  "attributes"               PangoAttrList*        : Read / Write
    -  "color"                    ClutterColor*         : Read / Write
    -  "ellipsize"                PangoEllipsizeMode    : Read / Write
    -  "font-name"                gchar*                : Read / Write
    -  "justify"                  gboolean              : Read / Write
    -  "text"                     gchar*                : Read / Write
    -  "use-markup"               gboolean              : Read / Write
    -  "wrap"                     gboolean              : Read / Write
    -  "wrap-mode"                PangoWrapMode         : Read / Write
    -
    -
    -
    -

    Description

    -

    -ClutterLabel is a ClutterActor that displays text using Pango.

    -

    - -

    -
    -
    -

    Details

    -
    -

    ClutterLabel

    -
    typedef struct _ClutterLabel ClutterLabel;
    -

    - -

    -
    -
    -
    -

    ClutterLabelClass

    -
    typedef struct {
    -} ClutterLabelClass;
    -
    -

    - -

    -
    -
    -
    -

    clutter_label_new ()

    -
    ClutterActor*       clutter_label_new                   (void);
    -

    -Creates a new, empty ClutterLabel.

    -

    - -

    -
    -- - - - -

    Returns :

    the newly created ClutterLabel -
    -
    -
    -
    -

    clutter_label_new_with_text ()

    -
    ClutterActor*       clutter_label_new_with_text         (const gchar *font_name,
    -                                                         const gchar *text);
    -

    -Creates a new ClutterLabel displaying text using font_name.

    -

    - -

    -
    -- - - - - - - - - - - - - - -

    font_name :

    the name (and size) of the font to be used -

    text :

    the text to be displayed -

    Returns :

    a ClutterLabel -
    -
    -
    -
    -

    clutter_label_new_full ()

    -
    ClutterActor*       clutter_label_new_full              (const gchar *font_name,
    -                                                         const gchar *text,
    -                                                         const ClutterColor *color);
    -

    -Creates a new ClutterLabel displaying text with color -using font_name.

    -

    - -

    -
    -- - - - - - - - - - - - - - - - - - -

    font_name :

    the name (and size) of the font to be used -

    text :

    the text to be displayed -

    color :

    ClutterColor for text -

    Returns :

    a ClutterLabel -
    -
    -
    -
    -

    clutter_label_set_text ()

    -
    void                clutter_label_set_text              (ClutterLabel *label,
    -                                                         const gchar *text);
    -

    -Sets text as the text to be displayed by label.

    -

    - -

    -
    -- - - - - - - - - - -

    label :

    a ClutterLabel -

    text :

    the text to be displayed -
    -
    -
    -
    -

    clutter_label_get_text ()

    -
    const gchar*        clutter_label_get_text              (ClutterLabel *label);
    -

    -Retrieves the text displayed by label

    -

    - -

    -
    -- - - - - - - - - - -

    label :

    a ClutterLabel -

    Returns :

    the text of the label. The returned string is -owned by ClutterLabel and should not be modified or freed. -
    -
    -
    -
    -

    clutter_label_set_font_name ()

    -
    void                clutter_label_set_font_name         (ClutterLabel *label,
    -                                                         const gchar *font_name);
    -

    -Sets font_name as the font used by label. -

    -

    -font_name must be a string containing the font name and its -size, similarly to what you would feed to the -pango_font_description_from_string() function.

    -

    - -

    -
    -- - - - - - - - - - -

    label :

    a ClutterLabel -

    font_name :

    a font name and size, or NULL for the default font -
    -
    -
    -
    -

    clutter_label_get_font_name ()

    -
    const gchar*        clutter_label_get_font_name         (ClutterLabel *label);
    -

    -Retrieves the font used by label.

    -

    - -

    -
    -- - - - - - - - - - -

    label :

    a ClutterLabel -

    Returns :

    a string containing the font name, in a format - understandable by pango_font_description_from_string(). The - string is owned by label and should not be modified - or freed. -
    -
    -
    -
    -

    clutter_label_set_color ()

    -
    void                clutter_label_set_color             (ClutterLabel *label,
    -                                                         const ClutterColor *color);
    -

    -Sets the color of label.

    -

    - -

    -
    -- - - - - - - - - - -

    label :

    a ClutterLabel -

    color :

    a ClutterColor -
    -
    -
    -
    -

    clutter_label_get_color ()

    -
    void                clutter_label_get_color             (ClutterLabel *label,
    -                                                         ClutterColor *color);
    -

    -Retrieves the color of label.

    -

    - -

    -
    -- - - - - - - - - - -

    label :

    a ClutterLabel -

    color :

    return location for a ClutterColor -
    -
    -
    -
    -

    clutter_label_set_ellipsize ()

    -
    void                clutter_label_set_ellipsize         (ClutterLabel *label,
    -                                                         PangoEllipsizeMode mode);
    -

    -Sets the mode used to ellipsize (add an ellipsis: "...") to the text -if there is not enough space to render the entire string.

    -

    - -

    -
    -- - - - - - - - - - -

    label :

    a ClutterLabel -

    mode :

    a PangoEllipsizeMode -
    -

    Since 0.2 -

    -
    -
    -
    -

    clutter_label_get_ellipsize ()

    -
    PangoEllipsizeMode  clutter_label_get_ellipsize         (ClutterLabel *label);
    -

    -Returns the ellipsizing position of the label. -See clutter_label_set_ellipsize().

    -

    - -

    -
    -- - - - - - - - - - -

    label :

    a ClutterLabel -

    Returns :

    PangoEllipsizeMode - -
    -

    Since 0.2 -

    -
    -
    -
    -

    clutter_label_set_line_wrap ()

    -
    void                clutter_label_set_line_wrap         (ClutterLabel *label,
    -                                                         gboolean wrap);
    -

    -Toggles line wrapping within the ClutterLabel widget. TRUE makes -it break lines if text exceeds the widget's size. FALSE lets the -text get cut off by the edge of the widget if it exceeds the widget -size.

    -

    - -

    -
    -- - - - - - - - - - -

    label :

    a ClutterLabel -

    wrap :

    the setting -
    -

    Since 0.2 -

    -
    -
    -
    -

    clutter_label_get_line_wrap ()

    -
    gboolean            clutter_label_get_line_wrap         (ClutterLabel *label);
    -

    -Returns whether lines in the label are automatically wrapped. -See clutter_label_set_line_wrap().

    -

    - -

    -
    -- - - - - - - - - - -

    label :

    a ClutterLabel -

    Returns :

    TRUE if the lines of the label are automatically wrapped. - -
    -

    Since 0.2 -

    -
    -
    -
    -

    clutter_label_set_line_wrap_mode ()

    -
    void                clutter_label_set_line_wrap_mode    (ClutterLabel *label,
    -                                                         PangoWrapMode wrap_mode);
    -

    -If line wrapping is on (see clutter_label_set_line_wrap()) this controls how -the line wrapping is done. The default is PANGO_WRAP_WORD which means -wrap on word boundaries.

    -

    - -

    -
    -- - - - - - - - - - -

    label :

    a ClutterLabel -

    wrap_mode :

    the line wrapping mode -
    -

    Since 0.2 -

    -
    -
    -
    -

    clutter_label_get_line_wrap_mode ()

    -
    PangoWrapMode       clutter_label_get_line_wrap_mode    (ClutterLabel *label);
    -

    -Returns line wrap mode used by the label. -See clutter_label_set_line_wrap_mode().

    -

    - -

    -
    -- - - - - - - - - - -

    label :

    a ClutterLabel -

    Returns :

    TRUE if the lines of the label are automatically wrapped. - -
    -

    Since 0.2 -

    -
    -
    -
    -

    clutter_label_get_layout ()

    -
    PangoLayout*        clutter_label_get_layout            (ClutterLabel *label);
    -

    -Gets the PangoLayout used to display the label. -The layout is useful to e.g. convert text positions to -pixel positions. -The returned layout is owned by the label so need not be -freed by the caller.

    -

    - -

    -
    -- - - - - - - - - - -

    label :

    a ClutterLabel -

    Returns :

    the PangoLayout for this label - -
    -

    Since 0.2 -

    -
    -
    -
    -

    clutter_label_set_attributes ()

    -
    void                clutter_label_set_attributes        (ClutterLabel *label,
    -                                                         PangoAttrList *attrs);
    -

    -Sets a PangoAttrList; the attributes in the list are applied to the -label text. The attributes set with this function will be ignored -if the "use_markup" property -is TRUE.

    -

    - -

    -
    -- - - - - - - - - - -

    label :

    a ClutterLabel -

    attrs :

    a PangoAttrList -
    -

    Since 0.2 -

    -
    -
    -
    -

    clutter_label_get_attributes ()

    -
    PangoAttrList*      clutter_label_get_attributes        (ClutterLabel *label);
    -

    -Gets the attribute list that was set on the label using -clutter_label_set_attributes(), if any.

    -

    - -

    -
    -- - - - - - - - - - -

    label :

    a ClutterLabel -

    Returns :

    the attribute list, or NULL if none was set. - -
    -

    Since 0.2 -

    -
    -
    -
    -

    clutter_label_set_use_markup ()

    -
    void                clutter_label_set_use_markup        (ClutterLabel *label,
    -                                                         gboolean setting);
    -

    -Sets whether the text of the label contains markup in Pango's text markup -language.

    -

    - -

    -
    -- - - - - - - - - - -

    label :

    a ClutterLabel -

    setting :

    TRUE if the label's text should be parsed for markup. -
    -
    -
    -
    -

    clutter_label_get_use_markup ()

    -
    gboolean            clutter_label_get_use_markup        (ClutterLabel *label);
    -

    -Returns whether the label's text is interpreted as marked up with -the Pango text markup -language. See clutter_label_set_use_markup().

    -

    - -

    -
    -- - - - - - - - - - -

    label :

    a ClutterLabel -

    Returns :

    TRUE if the label's text will be parsed for markup. -
    -
    -
    -
    -

    clutter_label_set_alignment ()

    -
    void                clutter_label_set_alignment         (ClutterLabel *label,
    -                                                         PangoAlignment alignment);
    -

    -Sets text alignment of the label. -

    -

    -The alignment will only be used when the contents of the -label are enough to wrap, and the "wrap" -property is set to TRUE.

    -

    - -

    -
    -- - - - - - - - - - -

    label :

    a ClutterLabel -

    alignment :

    A PangoAlignment -
    -
    -
    -
    -

    clutter_label_get_alignment ()

    -
    PangoAlignment      clutter_label_get_alignment         (ClutterLabel *label);
    -

    -Returns the label's text alignment

    -

    - -

    -
    -- - - - - - - - - - -

    label :

    a ClutterLabel -

    Returns :

    The label's PangoAlignment - -Since 0.2 -
    -
    -
    -
    -

    clutter_label_get_justify ()

    -
    gboolean            clutter_label_get_justify           (ClutterLabel *label);
    -

    -Retrieves whether the label should justify the text on both margins.

    -

    - -

    -
    -- - - - - - - - - - -

    label :

    a ClutterLabel -

    Returns :

    TRUE if the text should be justified - -
    -

    Since 0.6 -

    -
    -
    -
    -

    clutter_label_set_justify ()

    -
    void                clutter_label_set_justify           (ClutterLabel *label,
    -                                                         gboolean justify);
    -

    -Sets whether the text of the label actor should be justified -on both margins. This setting is ignored if Clutter is compiled -against Pango < 1.18.

    -

    - -

    -
    -- - - - - - - - - - -

    label :

    a ClutterLabel -

    justify :

    whether the text should be justified -
    -

    Since 0.6 -

    -
    -
    -
    -

    Property Details

    -
    -

    The "alignment" property

    -
      "alignment"                PangoAlignment        : Read / Write
    -

    The preferred alignment for the string.

    -

    Default value: PANGO_ALIGN_LEFT

    -
    -
    -
    -

    The "attributes" property

    -
      "attributes"               PangoAttrList*        : Read / Write
    -

    A list of style attributes to apply to the text of the label.

    -
    -
    -
    -

    The "color" property

    -
      "color"                    ClutterColor*         : Read / Write
    -

    Font Colour.

    -
    -
    -
    -

    The "ellipsize" property

    -
      "ellipsize"                PangoEllipsizeMode    : Read / Write
    -

    The preferred place to ellipsize the string, if the label does not have enough room to display the entire string.

    -

    Default value: PANGO_ELLIPSIZE_NONE

    -
    -
    -
    -

    The "font-name" property

    -
      "font-name"                gchar*                : Read / Write
    -

    Pango font description.

    -

    Default value: NULL

    -
    -
    -
    -

    The "justify" property

    -
      "justify"                  gboolean              : Read / Write
    -

    -Whether the contents of the label should be justified on both -margins.

    -

    - -

    -

    Default value: FALSE

    -

    Since 0.6 -

    -
    -
    -
    -

    The "text" property

    -
      "text"                     gchar*                : Read / Write
    -

    Text to render.

    -

    Default value: NULL

    -
    -
    -
    -

    The "use-markup" property

    -
      "use-markup"               gboolean              : Read / Write
    -

    The text of the label includes XML markup. See pango_parse_markup().

    -

    Default value: FALSE

    -
    -
    -
    -

    The "wrap" property

    -
      "wrap"                     gboolean              : Read / Write
    -

    If set, wrap lines if the text becomes too wide.

    -

    Default value: FALSE

    -
    -
    -
    -

    The "wrap-mode" property

    -
      "wrap-mode"                PangoWrapMode         : Read / Write
    -

    If wrap is set, controls how line-wrapping is done.

    -

    Default value: PANGO_WRAP_WORD

    -
    -
    -
    - - - diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterListModel.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterListModel.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterListModel.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterListModel.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ ClutterListModel - + @@ -19,7 +19,7 @@ - + @@ -43,7 +43,7 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next
    Top diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterMedia.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterMedia.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterMedia.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterMedia.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ ClutterMedia - + @@ -19,7 +19,7 @@ - + @@ -43,7 +43,7 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next Top @@ -61,7 +61,7 @@

    ClutterMedia

    -

    ClutterMedia — An interface for controlling playback of media data.

    +

    ClutterMedia — An interface for controlling playback of media data

    @@ -69,10 +69,14 @@

    Synopsis

                         ClutterMedia;
    -                    ClutterMediaInterface;
    +                    ClutterMediaIface;
     void                clutter_media_set_uri               (ClutterMedia *media,
    -                                                         const char *uri);
    -const char*         clutter_media_get_uri               (ClutterMedia *media);
    +                                                         const gchar *uri);
    +gchar*              clutter_media_get_uri               (ClutterMedia *media);
     void                clutter_media_set_playing           (ClutterMedia *media,
                                                              gboolean            clutter_media_get_playing           (ClutterMedia *media);
    -void                clutter_media_set_position          (ClutterMedia *media,
    -                                                         int position);
    -int                 clutter_media_get_position          (ClutterMedia *media);
    -void                clutter_media_set_volume            (ClutterMedia *media,
    -                                                         double volume);
    -double              clutter_media_get_volume            (ClutterMedia *media);
    +void                clutter_media_set_progress          (ClutterMedia *media,
    +                                                         gdouble progress);
    +gdouble             clutter_media_get_progress          (ClutterMedia *media);
    +void                clutter_media_set_audio_volume      (ClutterMedia *media,
    +                                                         gdouble volume);
    +gdouble             clutter_media_get_audio_volume      (ClutterMedia *media);
     gboolean            clutter_media_get_can_seek          (ClutterMedia *media);
    -int                 clutter_media_get_buffer_percent    (ClutterMedia *media);
    -int                 clutter_media_get_duration          (ClutterMedia *media);
    +gdouble             clutter_media_get_buffer_fill       (ClutterMedia *media);
    +guint               clutter_media_get_duration          (ClutterMedia *media);
     void                clutter_media_set_filename          (ClutterMedia *media,
                                                              const 
     

    Properties

    -  "buffer-percent"           gint                  : Read
    +  "audio-volume"             gdouble               : Read / Write
    +  "buffer-fill"              gdouble               : Read
       "can-seek"                 gboolean              : Read
       "duration"                 gint                  : Read
    +href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
    +>guint                 : Read
       "playing"                  gboolean              : Read / Write
    -  "position"                 gint                  : Read / Write
    +  "progress"                 gdouble               : Read / Write
       "uri"                      gchar*                : Read / Write
    -  "volume"                   gdouble               : Read / Write
     
    @@ -143,12 +159,12 @@ ClutterMedia is an interface for controlling playback of media sources.

    -It is not implemented inside Clutter, but other integration libraries -like Clutter-GStreamer, implement it to offer a uniform API for -applications. +Clutter core does not provide an implementation of this interface, but +other integration libraries like Clutter-GStreamer implement it to offer +a uniform API for applications.

    -ClutterMedia is available since Clutter 0.2

    +ClutterMedia is available since Clutter 0.2

    @@ -164,30 +180,9 @@

    -

    ClutterMediaInterface

    +

    ClutterMediaIface

    typedef struct {
    -  GTypeInterface	    base_iface;
    -  void (*set_uri)           (ClutterMedia *media,
    -			     const char   *uri);
    -  const char *(*get_uri)    (ClutterMedia *media);
    -  void (*set_playing)       (ClutterMedia *media,
    -			     gboolean      playing);
    -  gboolean (*get_playing)   (ClutterMedia *media);
    -  void (*set_position)      (ClutterMedia *media,
    -			     int           position);
    -  int (*get_position)       (ClutterMedia *media);
    -  void (*set_volume)        (ClutterMedia *media,
    -			     double        volume);
    -  double (*get_volume)      (ClutterMedia *media);
    -  gboolean (*can_seek)      (ClutterMedia *media);
    -  int (*get_buffer_percent) (ClutterMedia *media);
    -  int (*get_duration)       (ClutterMedia *media);
    -
    -  /* signals */
    -  void (* eos)                (ClutterMedia *media);
    -  void (* error)              (ClutterMedia *media,
    -			       GError       *error);
    -} ClutterMediaInterface;
    +} ClutterMediaIface;
     

    @@ -197,7 +192,9 @@

    clutter_media_set_uri ()

    void                clutter_media_set_uri               (ClutterMedia *media,
    -                                                         const char *uri);
    + const gchar *uri);

    Sets the URI of media to uri.

    @@ -208,12 +205,12 @@

    media :

    - ClutterMedia object + a ClutterMedia

    uri :

    - URI + the URI of the media stream @@ -224,7 +221,9 @@

    clutter_media_get_uri ()

    -
    const char*         clutter_media_get_uri               (ClutterMedia *media);
    +
    gchar*              clutter_media_get_uri               (ClutterMedia *media);

    Retrieves the URI from media.

    @@ -235,12 +234,15 @@

    media :

    - A ClutterMedia object + a ClutterMedia

    Returns :

    - The URI as a string. + the URI of the media stream. Use g_free() + to free the returned string @@ -257,7 +259,7 @@ href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean" >gboolean playing);

    -Starts or stops media playing.

    +Starts or stops playing of media.

    @@ -266,12 +268,14 @@

    media :

    - A ClutterMedia object + a ClutterMedia

    playing :

    - TRUE to start playing, FALSE to stop. + TRUE to start playing @@ -315,11 +319,14 @@

    -

    clutter_media_set_position ()

    -
    void                clutter_media_set_position          (ClutterMedia *media,
    -                                                         int position);
    +

    clutter_media_set_progress ()

    +
    void                clutter_media_set_progress          (ClutterMedia *media,
    +                                                         gdouble progress);

    -Sets the playback position of media to position.

    +Sets the playback progress of media. The progress is +a normalized value between 0.0 (begin) and 1.0 (end).

    @@ -328,25 +335,27 @@

    media :

    - A ClutterMedia object + a ClutterMedia -

    position :

    - The desired position. +

    progress :

    + the progress of the playback, between 0.0 and 1.0
    -

    Since 0.2 +

    Since 1.0


    -

    clutter_media_get_position ()

    -
    int                 clutter_media_get_position          (ClutterMedia *media);
    +

    clutter_media_get_progress ()

    +
    gdouble             clutter_media_get_progress          (ClutterMedia *media);

    -Retrieves the position of media.

    +Retrieves the playback progress of media.

    @@ -355,25 +364,27 @@

    media :

    - A ClutterMedia object + a ClutterMedia

    Returns :

    - The playback position. + the playback progress, between 0.0 and 1.0
    -

    Since 0.2 +

    Since 1.0


    -

    clutter_media_set_volume ()

    -
    void                clutter_media_set_volume            (ClutterMedia *media,
    -                                                         double volume);
    +

    clutter_media_set_audio_volume ()

    +
    void                clutter_media_set_audio_volume      (ClutterMedia *media,
    +                                                         gdouble volume);

    Sets the playback volume of media to volume.

    @@ -384,23 +395,25 @@

    media :

    - A ClutterMedia object + a ClutterMedia

    volume :

    - The volume as a double between 0.0 and 1.0 + the volume as a double between 0.0 and 1.0
    -

    Since 0.2 +

    Since 1.0


    -

    clutter_media_get_volume ()

    -
    double              clutter_media_get_volume            (ClutterMedia *media);
    +

    clutter_media_get_audio_volume ()

    +
    gdouble             clutter_media_get_audio_volume      (ClutterMedia *media);

    Retrieves the playback volume of media.

    @@ -411,7 +424,7 @@

    media :

    - A ClutterMedia object + a ClutterMedia @@ -422,7 +435,7 @@
    -

    Since 0.2 +

    Since 1.0


    @@ -441,7 +454,7 @@

    media :

    - A ClutterMedia object + a ClutterMedia @@ -461,8 +474,10 @@

    -

    clutter_media_get_buffer_percent ()

    -
    int                 clutter_media_get_buffer_percent    (ClutterMedia *media);
    +

    clutter_media_get_buffer_fill ()

    +
    gdouble             clutter_media_get_buffer_fill       (ClutterMedia *media);

    Retrieves the amount of the stream that is buffered.

    @@ -473,24 +488,26 @@

    media :

    - A ClutterMedia object + a ClutterMedia

    Returns :

    - percentage value + the fill level, between 0.0 and 1.0
    -

    Since 0.2 +

    Since 1.0


    clutter_media_get_duration ()

    -
    int                 clutter_media_get_duration          (ClutterMedia *media);
    +
    guint               clutter_media_get_duration          (ClutterMedia *media);

    Retrieves the duration of the media stream that media represents.

    @@ -501,12 +518,12 @@

    media :

    - A ClutterMedia object + a ClutterMedia

    Returns :

    - The length of the media stream. + the duration of the media stream, in seconds @@ -523,7 +540,7 @@ href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" >gchar *filename);

    -Sets the filename of the media source.

    +Sets the source of media using a file path.

    @@ -532,12 +549,12 @@

    media :

    - A ClutterMedia object + a ClutterMedia

    filename :

    - A filename to media file. + A filename @@ -549,13 +566,37 @@

    Property Details

    -

    The "buffer-percent" property

    -
      "buffer-percent"           gint                  : Read
    -

    The percentage the current stream buffer is filled.

    -

    Allowed values: [0,100]

    +

    The "audio-volume" property

    +
      "audio-volume"             gdouble               : Read / Write
    +

    +The volume of the audio, as a normalized value between +0.0 and 1.0.

    +

    + +

    +

    Allowed values: [0,1]

    +

    Default value: 0.5

    +

    Since 1.0 +

    +
    +
    +
    +

    The "buffer-fill" property

    +
      "buffer-fill"              gdouble               : Read
    +

    +The fill level of the buffer for the current stream, +as a value between 0.0 and 1.0.

    +

    + +

    +

    Allowed values: [0,1]

    Default value: 0

    +

    Since 1.0 +


    @@ -563,18 +604,29 @@
      "can-seek"                 gboolean              : Read
    -

    TRUE if the current stream is seekable.

    +

    +Whether the current stream is seekable.

    +

    + +

    Default value: FALSE

    +

    Since 0.2 +


    The "duration" property

      "duration"                 gint                  : Read
    -

    The duration of the current stream in seconds.

    -

    Allowed values: >= 0

    +href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" +>guint : Read
    +

    +The duration of the current stream, in seconds

    +

    + +

    Default value: 0

    +

    Since 0.2 +


    @@ -582,18 +634,31 @@
      "playing"                  gboolean              : Read / Write
    -

    TRUE if playing.

    +

    +Whether the ClutterMedia actor is playing.

    +

    + +

    Default value: FALSE

    +

    Since 0.2 +


    -

    The "position" property

    -
      "position"                 gint                  : Read / Write
    -

    The position in the current stream in seconds.

    -

    Allowed values: >= 0

    +

    The "progress" property

    +
      "progress"                 gdouble               : Read / Write
    +

    +The current progress of the playback, as a normalized +value between 0.0 and 1.0.

    +

    + +

    +

    Allowed values: [0,1]

    Default value: 0

    +

    Since 1.0 +


    @@ -601,18 +666,14 @@
      "uri"                      gchar*                : Read / Write
    -

    The loaded URI.

    +

    +The location of a media file, expressed as a valid URI.

    +

    + +

    Default value: NULL

    -
    -
    -
    -

    The "volume" property

    -
      "volume"                   gdouble               : Read / Write
    -

    The audio volume.

    -

    Allowed values: [0,100]

    -

    Default value: 50

    +

    Since 0.2 +

    diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterModel.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterModel.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterModel.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterModel.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ ClutterModel - + @@ -19,7 +19,7 @@ - + @@ -43,7 +43,7 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next Top diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterModelIter.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterModelIter.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterModelIter.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterModelIter.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ ClutterModelIter - + @@ -19,7 +19,7 @@ - + @@ -43,7 +43,7 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next Top diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/clutter-overview.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/clutter-overview.html --- clutter-0.8.4/doc/reference/clutter/html/clutter-overview.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/clutter-overview.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,9 +4,9 @@ Part I. Overview - - - + + + @@ -19,7 +19,7 @@ - + @@ -42,7 +42,7 @@ Prev   Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next
    @@ -70,7 +70,11 @@ opacity. Tranforms applied to a parent actor also apply to any children. Actors are also able to receive events.

    Subclasses of ClutterActor include ClutterStage, ClutterTexture, - ClutterLabel, ClutterRectangle, ClutterEntry and + ClutterLabel, ClutterRectangle, ClutterEntry and ClutterGroup. ClutterActors are added to a parent, transformed and then made visible.

    ClutterStage is the top level ClutterActor - it's the diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterPath.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterPath.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterPath.html 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterPath.html 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,1583 @@ + + + + +ClutterPath + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +
    +
    + + +
    +

    ClutterPath

    +

    ClutterPath — An object describing a path with straight lines +and bezier curves.

    +
    +
    +

    Synopsis

    +
    +                    ClutterPath;
    +                    ClutterPathClass;
    +void                (*ClutterPathCallback)              (const ClutterPathNode *node,
    +                                                         gpointer data);
    +enum                ClutterPathNodeType;
    +ClutterPath*        clutter_path_new                    (void);
    +ClutterPath*        clutter_path_new_with_description   (const gchar *desc);
    +
    +void                clutter_path_add_move_to            (ClutterPath *path,
    +                                                         gint x,
    +                                                         gint y);
    +void                clutter_path_add_rel_move_to        (ClutterPath *path,
    +                                                         gint x,
    +                                                         gint y);
    +void                clutter_path_add_line_to            (ClutterPath *path,
    +                                                         gint x,
    +                                                         gint y);
    +void                clutter_path_add_rel_line_to        (ClutterPath *path,
    +                                                         gint x,
    +                                                         gint y);
    +void                clutter_path_add_curve_to           (ClutterPath *path,
    +                                                         gint x_1,
    +                                                         gint y_1,
    +                                                         gint x_2,
    +                                                         gint y_2,
    +                                                         gint x_3,
    +                                                         gint y_3);
    +void                clutter_path_add_rel_curve_to       (ClutterPath *path,
    +                                                         gint x_1,
    +                                                         gint y_1,
    +                                                         gint x_2,
    +                                                         gint y_2,
    +                                                         gint x_3,
    +                                                         gint y_3);
    +void                clutter_path_add_close              (ClutterPath *path);
    +gboolean            clutter_path_add_string             (ClutterPath *path,
    +                                                         const gchar *str);
    +void                clutter_path_add_node               (ClutterPath *path,
    +                                                         const ClutterPathNode *node);
    +void                clutter_path_add_cairo_path         (ClutterPath *path,
    +                                                         const cairo_path_t *cpath);
    +
    +guint               clutter_path_get_n_nodes            (ClutterPath *path);
    +void                clutter_path_get_node               (ClutterPath *path,
    +                                                         guint index_,
    +                                                         ClutterPathNode *node);
    +GSList*             clutter_path_get_nodes              (ClutterPath *path);
    +void                clutter_path_foreach                (ClutterPath *path,
    +                                                         ClutterPathCallback callback,
    +                                                         gpointer user_data);
    +void                clutter_path_insert_node            (ClutterPath *path,
    +                                                         gint index_,
    +                                                         const ClutterPathNode *node);
    +void                clutter_path_remove_node            (ClutterPath *path,
    +                                                         guint index_);
    +void                clutter_path_replace_node           (ClutterPath *path,
    +                                                         guint index_,
    +                                                         const ClutterPathNode *node);
    +gchar*              clutter_path_get_description        (ClutterPath *path);
    +gboolean            clutter_path_set_description        (ClutterPath *path,
    +                                                         const gchar *str);
    +void                clutter_path_to_cairo_path          (ClutterPath *path,
    +                                                         cairo_t *cr);
    +void                clutter_path_clear                  (ClutterPath *path);
    +guint               clutter_path_get_position           (ClutterPath *path,
    +                                                         gdouble progress,
    +                                                         ClutterKnot *position);
    +guint               clutter_path_get_length             (ClutterPath *path);
    +
    +                    ClutterPathNode;
    +ClutterPathNode*    clutter_path_node_copy              (const ClutterPathNode *node);
    +void                clutter_path_node_free              (ClutterPathNode *node);
    +gboolean            clutter_path_node_equal             (const ClutterPathNode *node_a,
    +                                                         const ClutterPathNode *node_b);
    +
    +
    +
    +

    Object Hierarchy

    +
    +  GObject
    +   +----GInitiallyUnowned
    +         +----ClutterPath
    +
    +
    +
    +

    Properties

    +
    +  "description"              gchar*                : Read / Write
    +  "length"                   guint                 : Read
    +
    +
    +
    +

    Description

    +

    +A ClutterPath contains a description of a path consisting of +straight lines and bezier curves. This can be used in a +ClutterBehaviourPath to animate an actor moving along the path. +

    +

    +The path consists of a series of nodes. Each node is one of the +following four types: +

    +

    +

    +
    ++ + + + + + + + + + + + + + + + + + +

    CLUTTER_PATH_MOVE_TO

    +Changes the position of the path to the given pair of +coordinates. This is usually used as the first node of a path to +mark the start position. If it is used in the middle of a path then +the path will be disjoint and the actor will appear to jump to the +new position when animated. +

    CLUTTER_PATH_LINE_TO

    +Creates a straight line from the previous point to the given point. +

    CLUTTER_PATH_CURVE_TO

    +Creates a bezier curve. The end of the last node is used as the +first control point and the three subsequent coordinates given in +the node as used as the other three. +

    CLUTTER_PATH_CLOSE

    +Creates a straight line from the last node to the last +CLUTTER_PATH_MOVE_TO node. This can be used to close a path so +that it will appear as a loop when animated. +

    +

    +

    +

    +The first three types have the corresponding relative versions +CLUTTER_PATH_REL_MOVE_TO, CLUTTER_PATH_REL_LINE_TO and +CLUTTER_PATH_REL_CURVE_TO. These are exactly the same except the +coordinates are given relative to the previous node instead of as +direct screen positions. +

    +

    +You can build a path using the node adding functions such as +clutter_path_add_line_to(). Alternatively the path can be described +in a string using a subset of the SVG path syntax. See +clutter_path_add_string() for details. +

    +

    +ClutterPath is available since Clutter 1.0

    +

    + +

    +
    +
    +

    Details

    +
    +

    ClutterPath

    +
    typedef struct _ClutterPath ClutterPath;
    +

    +The ClutterPath struct contains only private data and should +be accessed with the functions below.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    ClutterPathClass

    +
    typedef struct {
    +} ClutterPathClass;
    +
    +

    +The ClutterPathClass struct contains only private data.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    ClutterPathCallback ()

    +
    void                (*ClutterPathCallback)              (const ClutterPathNode *node,
    +                                                         gpointer data);
    +

    +This function is passed to clutter_path_foreach() and will be +called for each node contained in the path.

    +

    + +

    +
    ++ + + + + + + + + + +

    node :

    the node +

    data :

    optional data passed to the function +
    +

    Since 1.0 +

    +
    +
    +
    +

    enum ClutterPathNodeType

    +
    typedef enum {
    +  CLUTTER_PATH_MOVE_TO      = 0,
    +  CLUTTER_PATH_LINE_TO      = 1,
    +  CLUTTER_PATH_CURVE_TO     = 2,
    +  CLUTTER_PATH_CLOSE        = 3,
    +
    +  CLUTTER_PATH_REL_MOVE_TO  = CLUTTER_PATH_MOVE_TO | CLUTTER_PATH_RELATIVE,
    +  CLUTTER_PATH_REL_LINE_TO  = CLUTTER_PATH_LINE_TO | CLUTTER_PATH_RELATIVE,
    +  CLUTTER_PATH_REL_CURVE_TO = CLUTTER_PATH_CURVE_TO | CLUTTER_PATH_RELATIVE
    +} ClutterPathNodeType;
    +
    +

    +Types of nodes in a ClutterPath.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    CLUTTER_PATH_MOVE_TO

    jump to the given position +

    CLUTTER_PATH_LINE_TO

    create a line from the last node to the + given position +

    CLUTTER_PATH_CURVE_TO

    bezier curve using the last position and + three control points. +

    CLUTTER_PATH_CLOSE

    create a line from the last node to the last + CLUTTER_PATH_MOVE_TO node. +

    CLUTTER_PATH_REL_MOVE_TO

    same as CLUTTER_PATH_MOVE_TO but with + coordinates relative to the last node. +

    CLUTTER_PATH_REL_LINE_TO

    same as CLUTTER_PATH_LINE_TO but with + coordinates relative to the last node. +

    CLUTTER_PATH_REL_CURVE_TO

    same as CLUTTER_PATH_CURVE_TO but with + coordinates relative to the last node. +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_new ()

    +
    ClutterPath*        clutter_path_new                    (void);
    +

    +Creates a new ClutterPath instance with no nodes. +

    +

    +The object has a floating reference so if you add it to a +ClutterBehaviourPath then you do not need to unref it.

    +

    + +

    +
    ++ + + + +

    Returns :

    the newly created ClutterPath + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_new_with_description ()

    +
    ClutterPath*        clutter_path_new_with_description   (const gchar *desc);
    +

    +Creates a new ClutterPath instance with the nodes described in +desc. See clutter_path_add_string() for details of the format of +the string. +

    +

    +The object has a floating reference so if you add it to a +ClutterBehaviourPath then you do not need to unref it.

    +

    + +

    +
    ++ + + + + + + + + + +

    desc :

    a string describing the path +

    Returns :

    the newly created ClutterPath + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_add_move_to ()

    +
    void                clutter_path_add_move_to            (ClutterPath *path,
    +                                                         gint x,
    +                                                         gint y);
    +

    +Adds a CLUTTER_PATH_MOVE_TO type node to the path. This is usually +used as the first node in a path. It can also be used in the middle +of the path to cause the actor to jump to the new coordinate.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    path :

    a ClutterPath +

    x :

    the x coordinate +

    y :

    the y coordinate +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_add_rel_move_to ()

    +
    void                clutter_path_add_rel_move_to        (ClutterPath *path,
    +                                                         gint x,
    +                                                         gint y);
    +

    +Same as clutter_path_add_move_to() except the coordinates are +relative to the previous node.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    path :

    a ClutterPath +

    x :

    the x coordinate +

    y :

    the y coordinate +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_add_line_to ()

    +
    void                clutter_path_add_line_to            (ClutterPath *path,
    +                                                         gint x,
    +                                                         gint y);
    +

    +Adds a CLUTTER_PATH_LINE_TO type node to the path. This causes the +actor to move to the new coordinates in a straight line.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    path :

    a ClutterPath +

    x :

    the x coordinate +

    y :

    the y coordinate +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_add_rel_line_to ()

    +
    void                clutter_path_add_rel_line_to        (ClutterPath *path,
    +                                                         gint x,
    +                                                         gint y);
    +

    +Same as clutter_path_add_line_to() except the coordinates are +relative to the previous node.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    path :

    a ClutterPath +

    x :

    the x coordinate +

    y :

    the y coordinate +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_add_curve_to ()

    +
    void                clutter_path_add_curve_to           (ClutterPath *path,
    +                                                         gint x_1,
    +                                                         gint y_1,
    +                                                         gint x_2,
    +                                                         gint y_2,
    +                                                         gint x_3,
    +                                                         gint y_3);
    +

    +Adds a CLUTTER_PATH_CURVE_TO type node to the path. This causes +the actor to follow a bezier from the last node to (x_3, y_3) using +(x_1, y_1) and (x_2,y_2) as control points.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    path :

    a ClutterPath +

    x_1 :

    the x coordinate of the first control point +

    y_1 :

    the y coordinate of the first control point +

    x_2 :

    the x coordinate of the second control point +

    y_2 :

    the y coordinate of the second control point +

    x_3 :

    the x coordinate of the third control point +

    y_3 :

    the y coordinate of the third control point +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_add_rel_curve_to ()

    +
    void                clutter_path_add_rel_curve_to       (ClutterPath *path,
    +                                                         gint x_1,
    +                                                         gint y_1,
    +                                                         gint x_2,
    +                                                         gint y_2,
    +                                                         gint x_3,
    +                                                         gint y_3);
    +

    +Same as clutter_path_add_curve_to() except the coordinates are +relative to the previous node.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    path :

    a ClutterPath +

    x_1 :

    the x coordinate of the first control point +

    y_1 :

    the y coordinate of the first control point +

    x_2 :

    the x coordinate of the second control point +

    y_2 :

    the y coordinate of the second control point +

    x_3 :

    the x coordinate of the third control point +

    y_3 :

    the y coordinate of the third control point +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_add_close ()

    +
    void                clutter_path_add_close              (ClutterPath *path);
    +

    +Adds a CLUTTER_PATH_CLOSE type node to the path. This creates a +straight line from the last node to the last CLUTTER_PATH_MOVE_TO +type node.

    +

    + +

    +
    ++ + + + +

    path :

    a ClutterPath +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_add_string ()

    +
    gboolean            clutter_path_add_string             (ClutterPath *path,
    +                                                         const gchar *str);
    +

    +Adds new nodes to the end of the path as described in str. The +format is a subset of the SVG path format. Each node is represented +by a letter and is followed by zero, one or three pairs of +coordinates. The coordinates can be separated by spaces or a +comma. The types are: +

    +

    +

    +
    ++ + + + + + + + + + + + + + + + + + +

    M

    +Adds a CLUTTER_PATH_MOVE_TO node. Takes one pair of coordinates. +

    L

    +Adds a CLUTTER_PATH_LINE_TO node. Takes one pair of coordinates. +

    C

    +Adds a CLUTTER_PATH_CURVE_TO node. Takes three pairs of coordinates. +

    z

    +Adds a CLUTTER_PATH_CLOSE node. No coordinates are needed. +

    +

    +

    +

    +The M, L and C commands can also be specified in lower case which +means the coordinates are relative to the previous node. +

    +

    +For example, to move an actor in a 100 by 100 pixel square centered +on the point 300,300 you could use the following path: +

    +

    +

    +
    +  M 250,350 l 0 -100 L 350,250 l 0 100 z
    + 
    +

    +

    +

    +If the path description isn't valid FALSE will be returned and no +nodes will be added.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    path :

    a ClutterPath +

    str :

    a string describing the new nodes +

    Returns :

    TRUE is the path description was valid or FALSE +otherwise. + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_add_node ()

    +
    void                clutter_path_add_node               (ClutterPath *path,
    +                                                         const ClutterPathNode *node);
    +

    +Adds node to the end of the path.

    +

    + +

    +
    ++ + + + + + + + + + +

    path :

    a ClutterPath +

    node :

    a ClutterPathNode +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_add_cairo_path ()

    +
    void                clutter_path_add_cairo_path         (ClutterPath *path,
    +                                                         const cairo_path_t *cpath);
    +

    +Add the nodes of the Cairo path to the end of path.

    +

    + +

    +
    ++ + + + + + + + + + +

    path :

    a ClutterPath +

    cpath :

    a Cairo path +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_get_n_nodes ()

    +
    guint               clutter_path_get_n_nodes            (ClutterPath *path);
    +

    +Retrieves the number of nodes in the path.

    +

    + +

    +
    ++ + + + + + + + + + +

    path :

    a ClutterPath +

    Returns :

    the number of nodes. + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_get_node ()

    +
    void                clutter_path_get_node               (ClutterPath *path,
    +                                                         guint index_,
    +                                                         ClutterPathNode *node);
    +

    +Retrieves the node of the path indexed by index.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    path :

    a ClutterPath +

    index_ :

    the node number to retrieve +

    node :

    a location to store a copy of the node +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_get_nodes ()

    +
    GSList*             clutter_path_get_nodes              (ClutterPath *path);
    +

    +Returns a GSList of ClutterPathNodes. The list should be +freed with g_slist_free(). The nodes are owned by the path and +should not be freed. Altering the path may cause the nodes in the +list to become invalid so you should copy them if you want to keep +the list.

    +

    + +

    +
    ++ + + + + + + + + + +

    path :

    a ClutterPath +

    Returns :

    a list of nodes in the path. + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_foreach ()

    +
    void                clutter_path_foreach                (ClutterPath *path,
    +                                                         ClutterPathCallback callback,
    +                                                         gpointer user_data);
    +

    +Calls a function for each node of the path.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    path :

    a ClutterPath +

    callback :

    the function to call with each node +

    user_data :

    user data to pass to the function +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_insert_node ()

    +
    void                clutter_path_insert_node            (ClutterPath *path,
    +                                                         gint index_,
    +                                                         const ClutterPathNode *node);
    +

    +Inserts node into the path before the node at the given offset. If +index_ is negative it will append the node to the end of the path.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    path :

    a ClutterPath +

    index_ :

    offset of where to insert the node +

    node :

    the node to insert +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_remove_node ()

    +
    void                clutter_path_remove_node            (ClutterPath *path,
    +                                                         guint index_);
    +

    +Removes the node at the given offset from the path.

    +

    + +

    +
    ++ + + + + + + + + + +

    path :

    a ClutterPath +

    index_ :

    index of the node to remove +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_replace_node ()

    +
    void                clutter_path_replace_node           (ClutterPath *path,
    +                                                         guint index_,
    +                                                         const ClutterPathNode *node);
    +

    +Replaces the node at offset index_ with node.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    path :

    a ClutterPath +

    index_ :

    index to the existing node +

    node :

    the replacement node +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_get_description ()

    +
    gchar*              clutter_path_get_description        (ClutterPath *path);
    +

    +Returns a newly allocated string describing the path in the same +format as used by clutter_path_add_string().

    +

    + +

    +
    ++ + + + + + + + + + +

    path :

    a ClutterPath +

    Returns :

    a string description of the path. Free with g_free(). + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_set_description ()

    +
    gboolean            clutter_path_set_description        (ClutterPath *path,
    +                                                         const gchar *str);
    +

    +Replaces all of the nodes in the path with nodes described by +str. See clutter_path_add_string() for details of the format. +

    +

    +If the string is invalid then FALSE is returned and the path is +unaltered.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    path :

    a ClutterPath +

    str :

    a string describing the path +

    Returns :

    TRUE is the path was valid, FALSE otherwise. + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_to_cairo_path ()

    +
    void                clutter_path_to_cairo_path          (ClutterPath *path,
    +                                                         cairo_t *cr);
    +

    +Add the nodes of the ClutterPath to the path in the Cairo context.

    +

    + +

    +
    ++ + + + + + + + + + +

    path :

    a ClutterPath +

    cr :

    a Cairo context +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_clear ()

    +
    void                clutter_path_clear                  (ClutterPath *path);
    +

    +Removes all nodes from the path.

    +

    + +

    +
    ++ + + + +

    path :

    a ClutterPath +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_get_position ()

    +
    guint               clutter_path_get_position           (ClutterPath *path,
    +                                                         gdouble progress,
    +                                                         ClutterKnot *position);
    +

    +The value in progress represents a position along the path where +0.0 is the beginning and 1.0 is the end of the path. An +interpolated position is then stored in position.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + +

    path :

    a ClutterPath +

    progress :

    a position along the path as a fraction of its length +

    position :

    location to store the position +

    Returns :

    index of the node used to calculate the position. + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_get_length ()

    +
    guint               clutter_path_get_length             (ClutterPath *path);
    +

    +Retrieves an approximation of the total length of the path.

    +

    + +

    +
    ++ + + + + + + + + + +

    path :

    a ClutterPath +

    Returns :

    the length of the path. + +
    +

    Since 1.0 +

    +
    +
    +
    +

    ClutterPathNode

    +
    typedef struct {
    +  ClutterPathNodeType type;
    +
    +  ClutterKnot points[3];
    +} ClutterPathNode;
    +
    +

    +Represents a single node of a ClutterPath. +

    +

    +Some of the coordinates in points may be unused for some node +types. CLUTTER_PATH_MOVE_TO and CLUTTER_PATH_LINE_TO use only two +pairs of coordinates, CLUTTER_PATH_CURVE_TO uses all three and +CLUTTER_PATH_CLOSE uses none.

    +

    + +

    +
    ++ + + + + + + + + + +

    ClutterPathNodeType type;

    the node's type +

    ClutterKnot points[3];

    the coordinates of the node +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_node_copy ()

    +
    ClutterPathNode*    clutter_path_node_copy              (const ClutterPathNode *node);
    +

    +Makes an allocated copy of a node.

    +

    + +

    +
    ++ + + + + + + + + + +

    node :

    a ClutterPathNode +

    Returns :

    the copied node. + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_node_free ()

    +
    void                clutter_path_node_free              (ClutterPathNode *node);
    +

    +Frees the memory of an allocated node.

    +

    + +

    +
    ++ + + + +

    node :

    a ClutterPathNode +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_path_node_equal ()

    +
    gboolean            clutter_path_node_equal             (const ClutterPathNode *node_a,
    +                                                         const ClutterPathNode *node_b);
    +

    +Compares two nodes and checks if they are the same type with the +same coordinates.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    node_a :

    First node +

    node_b :

    Second node +

    Returns :

    TRUE if the nodes are the same. + +
    +

    Since 1.0 +

    +
    +
    +
    +

    Property Details

    +
    +

    The "description" property

    +
      "description"              gchar*                : Read / Write
    +

    SVG-style description of the path.

    +

    Default value: ""

    +
    +
    +
    +

    The "length" property

    +
      "length"                   guint                 : Read
    +

    An approximation of the total length of the path.

    +

    Default value: 0

    +
    +
    +
    + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterRectangle.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterRectangle.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterRectangle.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterRectangle.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ ClutterRectangle - + @@ -19,7 +19,7 @@ - + @@ -43,7 +43,7 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next
    Top @@ -106,7 +106,7 @@

    Implemented Interfaces

    ClutterRectangle implements -

    + ClutterScriptable.

    Properties

    @@ -142,13 +142,6 @@

    ClutterRectangleClass

    typedef struct {
    -  ClutterActorClass parent_class;
    -
    -  /* padding for future expansion */
    -  void (*_clutter_rectangle1) (void);
    -  void (*_clutter_rectangle2) (void);
    -  void (*_clutter_rectangle3) (void);
    -  void (*_clutter_rectangle4) (void);
     } ClutterRectangleClass;
     

    diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterScore.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterScore.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterScore.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterScore.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ ClutterScore - + @@ -19,7 +19,7 @@ - + @@ -43,7 +43,7 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next Top diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterScriptable.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterScriptable.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterScriptable.html 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterScriptable.html 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,383 @@ + + + + +ClutterScriptable + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +
    +
    + + +
    +

    ClutterScriptable

    +

    ClutterScriptable — Override the UI definition parsing

    +
    +
    +

    Synopsis

    +
    +                    ClutterScriptable;
    +                    ClutterScriptableIface;
    +void                clutter_scriptable_set_id           (ClutterScriptable *scriptable,
    +                                                         const gchar *id);
    +const gchar*        clutter_scriptable_get_id           (ClutterScriptable *scriptable);
    +gboolean            clutter_scriptable_parse_custom_node
    +                                                        (ClutterScriptable *scriptable,
    +                                                         ClutterScript *script,
    +                                                         GValue *value,
    +                                                         const gchar *name,
    +                                                         JsonNode *node);
    +void                clutter_scriptable_set_custom_property
    +                                                        (ClutterScriptable *scriptable,
    +                                                         ClutterScript *script,
    +                                                         const gchar *name,
    +                                                         const GValue *value);
    +
    +
    +
    +

    Object Hierarchy

    +
    +  GInterface
    +   +----ClutterScriptable
    +
    +
    +
    +

    Known Implementations

    +

    +ClutterScriptable is implemented by + ClutterTexture, ClutterStage, ClutterText, ClutterRectangle, ClutterGroup, ClutterBehaviourPath, ClutterCairoTexture, ClutterActor and ClutterClone.

    +
    +
    +

    Description

    +

    +The ClutterScriptableIface interface exposes the UI definition parsing +process to external classes. By implementing this interface, a class can +override the UI definition parsing and transform complex data types into +GObject properties, or allow custom properties. +

    +

    +ClutterScriptable is available since Clutter 0.6

    +

    + +

    +
    +
    +

    Details

    +
    +

    ClutterScriptable

    +
    typedef struct _ClutterScriptable ClutterScriptable;
    +

    + +

    +
    +
    +
    +

    ClutterScriptableIface

    +
    typedef struct {
    +  void         (* set_id)              (ClutterScriptable *scriptable,
    +                                        const gchar       *name);
    +  const gchar *(* get_id)              (ClutterScriptable *scriptable);
    +
    +  gboolean     (* parse_custom_node)   (ClutterScriptable *scriptable,
    +                                        ClutterScript     *script,
    +                                        GValue            *value,
    +                                        const gchar       *name,
    +                                        JsonNode          *node);
    +  void         (* set_custom_property) (ClutterScriptable *scriptable,
    +                                        ClutterScript     *script,
    +                                        const gchar       *name,
    +                                        const GValue      *value);
    +} ClutterScriptableIface;
    +
    +

    +Interface for implementing "scriptable" objects. An object implementing +this interface can override the parsing and properties setting sequence +when loading a UI definition data with ClutterScript

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + +

    set_id ()

    virtual function for setting the id of a scriptable object +

    get_id ()

    virtual function for getting the id of a scriptable object +

    parse_custom_node ()

    virtual function for parsing complex data containers + into GObject properties +

    set_custom_property ()

    virtual function for setting a custom property +
    +

    Since 0.6 +

    +
    +
    +
    +

    clutter_scriptable_set_id ()

    +
    void                clutter_scriptable_set_id           (ClutterScriptable *scriptable,
    +                                                         const gchar *id);
    +

    +Sets id as the unique Clutter script it for this instance of +ClutterScriptableIface. +

    +

    +This name can be used by user interface designer applications to +define a unique name for an object constructable using the UI +definition language parsed by ClutterScript.

    +

    + +

    +
    ++ + + + + + + + + + +

    scriptable :

    a ClutterScriptable +

    id :

    the ClutterScript id of the object +
    +

    Since 0.6 +

    +
    +
    +
    +

    clutter_scriptable_get_id ()

    +
    const gchar*        clutter_scriptable_get_id           (ClutterScriptable *scriptable);
    +

    +Retrieves the id of scriptable set using clutter_scriptable_set_id().

    +

    + +

    +
    ++ + + + + + + + + + +

    scriptable :

    a ClutterScriptable +

    Returns :

    the id of the object. The returned string is owned by + the scriptable object and should never be modified of freed + +
    +

    Since 0.6 +

    +
    +
    +
    +

    clutter_scriptable_parse_custom_node ()

    +
    gboolean            clutter_scriptable_parse_custom_node
    +                                                        (ClutterScriptable *scriptable,
    +                                                         ClutterScript *script,
    +                                                         GValue *value,
    +                                                         const gchar *name,
    +                                                         JsonNode *node);
    +

    +Parses the passed JSON node. The implementation must set the type +of the passed GValue pointer using g_value_init().

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + +

    scriptable :

    a ClutterScriptable +

    script :

    the ClutterScript creating the scriptable instance +

    value :

    the generic value to be set +

    name :

    the name of the node +

    node :

    the JSON node to be parsed +

    Returns :

    TRUE if the node was successfully parsed, FALSE otherwise. + +
    +

    Since 0.6 +

    +
    +
    +
    +

    clutter_scriptable_set_custom_property ()

    +
    void                clutter_scriptable_set_custom_property
    +                                                        (ClutterScriptable *scriptable,
    +                                                         ClutterScript *script,
    +                                                         const gchar *name,
    +                                                         const GValue *value);
    +

    +Overrides the common properties setting. The underlying virtual +function should be used when implementing custom properties.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + +

    scriptable :

    a ClutterScriptable +

    script :

    the ClutterScript creating the scriptable instance +

    name :

    the name of the property +

    value :

    the value of the property +
    +

    Since 0.6 +

    +
    +
    +
    + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterScript.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterScript.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterScript.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterScript.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,10 +4,10 @@ ClutterScript - + - + @@ -19,7 +19,7 @@ - + @@ -43,8 +43,8 @@ Prev Up Home -Clutter 0.8.4 Reference Manual -Next +Clutter 0.9.0 Reference Manual +Next Top  |  diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterShader.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterShader.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterShader.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterShader.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ ClutterShader - + @@ -19,7 +19,7 @@ - + @@ -43,7 +43,7 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next Top @@ -107,6 +107,25 @@ gboolean clutter_shader_get_is_enabled (ClutterShader *shader); + +void clutter_shader_set_uniform (ClutterShader *shader, + const gchar *name, + const GValue *value); +CoglHandle clutter_shader_get_cogl_program (ClutterShader *shader); +CoglHandle clutter_shader_get_cogl_fragment_shader + (ClutterShader *shader); +CoglHandle clutter_shader_get_cogl_vertex_shader + (ClutterShader *shader); void clutter_shader_set_uniform_1f (ClutterShader *shader, const gfloat value); + + ClutterShaderFloat; +#define CLUTTER_VALUE_HOLDS_SHADER_FLOAT (x) +void clutter_value_set_shader_float (GValue *value, + gint size, + const gfloat *floats); +const gfloat* clutter_value_get_shader_float (const GValue *value, + gsize *length); + ClutterShaderInt; +#define CLUTTER_VALUE_HOLDS_SHADER_INT (x) +void clutter_value_set_shader_int (GValue *value, + gint size, + const gint *ints); +const COGLint* clutter_value_get_shader_int (const GValue *value, + gsize *length); + ClutterShaderMatrix; +#define CLUTTER_VALUE_HOLDS_SHADER_MATRIX (x) +void clutter_value_set_shader_matrix (GValue *value, + gint size, + const gfloat *matrix); +const GLfloat* clutter_value_get_shader_matrix (const GValue *value, + gsize *length);
    @@ -549,6 +622,158 @@

    +

    clutter_shader_set_uniform ()

    +
    void                clutter_shader_set_uniform          (ClutterShader *shader,
    +                                                         const gchar *name,
    +                                                         const GValue *value);
    +

    +Sets a user configurable variable in the GLSL shader programs attached to +a ClutterShader.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    shader :

    a ClutterShader. +

    name :

    name of uniform in GLSL shader program to set. +

    value :

    a ClutterShaderFloat, ClutterShaderInt or ClutterShaderMatrix + GValue. +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_shader_get_cogl_program ()

    +
    CoglHandle          clutter_shader_get_cogl_program     (ClutterShader *shader);
    +

    +Retrieves the underlying CoglHandle for the shader program.

    +

    + +

    +
    ++ + + + + + + + + + +

    shader :

    a ClutterShader +

    Returns :

    A CoglHandle for the shader program, or NULL + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_shader_get_cogl_fragment_shader ()

    +
    CoglHandle          clutter_shader_get_cogl_fragment_shader
    +                                                        (ClutterShader *shader);
    +

    +Retrieves the underlying CoglHandle for the fragment shader.

    +

    + +

    +
    ++ + + + + + + + + + +

    shader :

    a ClutterShader +

    Returns :

    A CoglHandle for the fragment shader, or NULL + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_shader_get_cogl_vertex_shader ()

    +
    CoglHandle          clutter_shader_get_cogl_vertex_shader
    +                                                        (ClutterShader *shader);
    +

    +Retrieves the underlying CoglHandle for the vertex shader.

    +

    + +

    +
    ++ + + + + + + + + + +

    shader :

    a ClutterShader +

    Returns :

    A CoglHandle for the vertex shader, or NULL + +
    +

    Since 1.0 +

    +
    +
    +

    clutter_shader_set_uniform_1f ()

    void                clutter_shader_set_uniform_1f       (ClutterShader *shader,
                                                              const gfloat value);
    +
    +

    Warning

    +

    clutter_shader_set_uniform_1f is deprecated and should not be used in newly-written code.

    +

    Sets a user configurable variable in the shader programs attached to a ClutterShader.

    @@ -586,6 +815,395 @@

    Since 0.6

    +
    +
    +

    ClutterShaderFloat

    +
    typedef struct _ClutterShaderFloat ClutterShaderFloat;
    +

    + +

    +
    +
    +
    +

    CLUTTER_VALUE_HOLDS_SHADER_FLOAT()

    +
    #define CLUTTER_VALUE_HOLDS_SHADER_FLOAT(x) (G_VALUE_HOLDS ((x), CLUTTER_TYPE_SHADER_FLOAT))
    +
    +

    +Evaluates to TRUE if x holds a ClutterShaderFloat.

    +

    + +

    +
    ++ + + + +

    x :

    a GValue +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_value_set_shader_float ()

    +
    void                clutter_value_set_shader_float      (GValue *value,
    +                                                         gint size,
    +                                                         const gfloat *floats);
    +

    +Sets floats as the contents of value. The passed GValue +must have been initialized using CLUTTER_TYPE_SHADER_FLOAT.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    value :

    a GValue +

    size :

    number of floating point values in floats +

    floats :

    an array of floating point values +
    +

    Since 0.8 +

    +
    +
    +
    +

    clutter_value_get_shader_float ()

    +
    const gfloat*       clutter_value_get_shader_float      (const GValue *value,
    +                                                         gsize *length);
    +

    +Retrieves the list of floating point values stored inside +the passed GValue. value must have been initialized with +CLUTTER_TYPE_SHADER_FLOAT.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    value :

    a GValue +

    length :

    return location for the number of returned floating + point values, or NULL +

    Returns :

    the pointer to a list of floating point values. + The returned value is owned by the GValue and should never + be modified or freed. + +
    +

    Since 0.8 +

    +
    +
    +
    +

    ClutterShaderInt

    +
    typedef struct _ClutterShaderInt ClutterShaderInt;
    +

    + +

    +
    +
    +
    +

    CLUTTER_VALUE_HOLDS_SHADER_INT()

    +
    #define CLUTTER_VALUE_HOLDS_SHADER_INT(x) (G_VALUE_HOLDS ((x), CLUTTER_TYPE_SHADER_INT))
    +
    +

    +Evaluates to TRUE if x holds a ClutterShaderInt.

    +

    + +

    +
    ++ + + + +

    x :

    a GValue +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_value_set_shader_int ()

    +
    void                clutter_value_set_shader_int        (GValue *value,
    +                                                         gint size,
    +                                                         const gint *ints);
    +

    +Sets ints as the contents of value. The passed GValue +must have been initialized using CLUTTER_TYPE_SHADER_INT.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    value :

    a GValue +

    size :

    number of integer values in ints +

    ints :

    an array of integer values +
    +

    Since 0.8 +

    +
    +
    +
    +

    clutter_value_get_shader_int ()

    +
    const COGLint*      clutter_value_get_shader_int        (const GValue *value,
    +                                                         gsize *length);
    +

    +Retrieves the list of integer values stored inside the passed +GValue. value must have been initialized with +CLUTTER_TYPE_SHADER_INT.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    value :

    a GValue +

    length :

    return location for the number of returned integer + values, or NULL +

    Returns :

    the pointer to a list of integer values. + The returned value is owned by the GValue and should never + be modified or freed. + +
    +

    Since 0.8 +

    +
    +
    +
    +

    ClutterShaderMatrix

    +
    typedef struct _ClutterShaderMatrix ClutterShaderMatrix;
    +

    + +

    +
    +
    +
    +

    CLUTTER_VALUE_HOLDS_SHADER_MATRIX()

    +
    #define CLUTTER_VALUE_HOLDS_SHADER_MATRIX(x) (G_VALUE_HOLDS ((x), CLUTTER_TYPE_SHADER_MATRIX))
    +
    +

    +Evaluates to TRUE if x holds a ClutterShaderMatrix.

    +

    + +

    +
    ++ + + + +

    x :

    a GValue +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_value_set_shader_matrix ()

    +
    void                clutter_value_set_shader_matrix     (GValue *value,
    +                                                         gint size,
    +                                                         const gfloat *matrix);
    +

    +Sets matrix as the contents of value. The passed GValue +must have been initialized using CLUTTER_TYPE_SHADER_MATRIX.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    value :

    a GValue +

    size :

    number of floating point values in floats +

    matrix :

    a matrix of floating point values +
    +

    Since 0.8 +

    +
    +
    +
    +

    clutter_value_get_shader_matrix ()

    +
    const GLfloat*      clutter_value_get_shader_matrix     (const GValue *value,
    +                                                         gsize *length);
    +

    +Retrieves a matrix of floating point values stored inside +the passed GValue. value must have been initialized with +CLUTTER_TYPE_SHADER_MATRIX.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    value :

    a GValue +

    length :

    return location for the number of returned floating + point values, or NULL +

    Returns :

    the pointer to a matrix of floating point values. + The returned value is owned by the GValue and should never + be modified or freed. + +
    +

    Since 0.8 +

    +

    Property Details

    diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterStage.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterStage.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterStage.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterStage.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ ClutterStage - + @@ -19,7 +19,7 @@ - + @@ -43,7 +43,7 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next
    Top @@ -96,6 +96,7 @@ href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint" >gint y); void clutter_stage_ensure_current (ClutterStage *stage); +void clutter_stage_ensure_viewport (ClutterStage *stage); void clutter_stage_queue_redraw (ClutterStage *stage); ClutterActor *actor); ClutterActor* clutter_stage_get_key_focus (ClutterStage *stage); gdouble clutter_stage_get_resolution (ClutterStage *stage); -ClutterFixed clutter_stage_get_resolutionx (ClutterStage *stage); -guchar* clutter_stage_read_pixels (ClutterStage *stage,

    Implemented Interfaces

    ClutterStage implements - ClutterContainer.

    + ClutterScriptable and ClutterContainer.

    Properties

    @@ -256,6 +253,7 @@ "activate" : Run Last "deactivate" : Run Last "fullscreen" : Run First + "queue-redraw" : Run Last "unfullscreen" : Run Last
    @@ -307,6 +305,8 @@ void (* unfullscreen) (ClutterStage *stage); void (* activate) (ClutterStage *stage); void (* deactivate) (ClutterStage *stage); + + void (* queue_redraw) (ClutterStage *stage); } ClutterStageClass;

    @@ -318,7 +318,7 @@

    CLUTTER_STAGE_WIDTH()

    #define             CLUTTER_STAGE_WIDTH()

    -Macro that evaluates to the current stage width

    +Macro that evaluates to the width of the default stage

    @@ -330,7 +330,7 @@

    CLUTTER_STAGE_HEIGHT()

    #define             CLUTTER_STAGE_HEIGHT()

    -Macro that evaluates to the current stage height

    +Macro that evaluates to the height of the default stage

    @@ -629,6 +629,35 @@

    +

    clutter_stage_ensure_viewport ()

    +
    void                clutter_stage_ensure_viewport       (ClutterStage *stage);
    +

    +Ensures that the GL viewport is updated with the current +stage window size. +

    +

    +This function will queue a redraw of stage. +

    +

    +This function should not be called by applications; it is used +when embedding a ClutterStage into a toolkit with another +windowing system, like GTK+.

    +

    + +

    +
    ++ + + + +

    stage :

    a ClutterStage +
    +

    Since 1.0 +

    +
    +
    +

    clutter_stage_queue_redraw ()

    void                clutter_stage_queue_redraw          (ClutterStage *stage);

    @@ -757,65 +786,6 @@


    -

    clutter_stage_get_resolution ()

    -
    gdouble             clutter_stage_get_resolution        (ClutterStage *stage);
    -

    -Retrieves the resolution (in DPI) of the stage from the default -backend.

    -

    - -

    -
    -- - - - - - - - - - -

    stage :

    the ClutterStage -

    Returns :

    the resolution of the stage - -
    -

    Since 0.6 -

    -
    -
    -
    -

    clutter_stage_get_resolutionx ()

    -
    ClutterFixed        clutter_stage_get_resolutionx       (ClutterStage *stage);
    -

    -Fixed point version of clutter_stage_get_resolution().

    -

    - -

    -
    -- - - - - - - - - - -

    stage :

    the ClutterStage -

    Returns :

    the resolution of the stage - -
    -

    Since 0.6 -

    -
    -
    -

    clutter_stage_read_pixels ()

    gchar *title);

    -Sets the stage title. -

    -

    -Since 0.4

    +Sets the stage title.

    @@ -1138,6 +1105,8 @@
    +

    Since 0.4 +


    @@ -1709,6 +1678,79 @@

    +

    The "queue-redraw" signal

    +
    void                user_function                      (ClutterStage *stage,
    +                                                        gpointer      user_data)      : Run Last
    +

    +The ::queue-redraw signal is emitted each time a ClutterStage +has been queued for a redraw. You can use this signal to know +when clutter_stage_queue_redraw() has been called. +

    +

    +Toolkits embedding a ClutterStage which require a redraw and +relayout cycle can stop the emission of this signal using the +GSignal API, redraw the UI and then call clutter_redraw() +themselves, like: +

    +

    +

    +
    +  static void
    +  on_redraw_complete (void)
    +  {
    +    /* execute the Clutter drawing pipeline */
    +    clutter_redraw ();
    +  }
    +
    +  static void
    +  on_stage_queue_redraw (ClutterStage *stage)
    +  {
    +    /* this prevents the default handler to run */
    +    g_signal_stop_emission_by_name (stage, "queue-redraw");
    +
    +    /* queue a redraw with the host toolkit and call
    +     * a function when the redraw has been completed
    +     */
    +    queue_a_redraw (G_CALLBACK (on_redraw_complete));
    +  }
    +
    +

    +

    +

    +

    +
    +

    Note

    +

    This signal is emitted before the Clutter paint +pipeline is run. If you want to know when the pipeline has been +completed you should connect to the ::paint signal on the Stage +with g_signal_connect_after().

    +
    +

    + +

    +
    ++ + + + + + + + + + +

    stage :

    the stage which was queued for redraw +

    user_data :

    user data set when the signal handler was connected.
    +

    Since 1.0 +

    +
    +
    +

    The "unfullscreen" signal

    void                user_function                      (ClutterStage *stage,
                                                             
     Implementing a new actor
     
    -
    +
     
     
     
    @@ -19,7 +19,7 @@
     
     
     
    -
    +
     
     
     
    @@ -42,7 +42,7 @@
     Prev
     Up
     Home
    -Clutter 0.8.4 Reference Manual
    +Clutter 0.9.0 Reference Manual
     Next
     
     
    @@ -389,23 +389,20 @@ foo_actor_paint (ClutterActor *actor) { FooActor *foo_actor = FOO_ACTOR (actor); - ClutterColor color = { 0, }; ClutterUnit w, h, r; - /* FooActor has a specific background color */ - color.red = foo_actor->bg_color.red; - color.green = foo_actor->bg_color.green; - color.blue = foo_actor->bg_color.blue; - /* the alpha component must take into account the absolute + /* FooActor has a specific background color + * + * the alpha component must take into account the absolute * opacity of the actor on the screen at this point in the * scenegraph; this value is obtained by calling * clutter_actor_get_paint_opacity(). */ - color.alpha = clutter_actor_get_paint_opacity (actor); - - /* set the color of the pen */ - cogl_color (&color); + cogl_set_source_color4ub (priv->fgcol.red, + priv->fgcol.green, + priv->fgcol.blue, + clutter_actor_get_paint_opacity (actor)); /* get the size of the actor with sub-pixel precision */ w = CLUTTER_UNITS_TO_FIXED (clutter_actor_get_widthu (actor)); @@ -481,7 +478,8 @@ const ClutterColor *pick_color) { FooActor *foo_actor = FOO_ACTOR (actor); - ClutterUnit w, h, r; + ClutterUnit width, height; + ClutterFixed radius; /* it is possible to avoid a costly paint by checking whether the * actor should really be painted in pick mode @@ -489,17 +487,19 @@ if (!clutter_actor_should_pick_paint (actor)) return; - w = CLUTTER_UNITS_TO_FIXED (clutter_actor_get_widthu (actor)); - h = CLUTTER_UNITS_TO_FIXED (clutter_actor_get_heightu (actor)); + clutter_actor_get_sizeu (actor, &width, &height); /* this is the arc radius for the rounded rectangle corners */ - r = CLUTTER_UNITS_TO_FIXED (foo_actor->radius); + radius = CLUTTER_UNITS_TO_FIXED (foo_actor-&radius); /* use the passed color to paint ourselves */ - cogl_color (pick_color); + cogl_set_source_color4ub (pick_color->red, + pick_color->green, + pick_color->blue, + pick_color->alpha); /* paint a round rectangle */ - cogl_round_rectangle (0, 0, w, h, r, 5); + cogl_round_rectangle (0, 0, width, height, radius, 5); /* and fill it with the current color */ cogl_fill (); diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterText.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterText.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterText.html 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterText.html 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,2843 @@ + + + + +ClutterText + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +

    ClutterText

    +

    ClutterText — An actor for displaying and editing text

    +
    +
    +

    Synopsis

    +
    +                    ClutterText;
    +                    ClutterTextClass;
    +ClutterActor*       clutter_text_new                    (void);
    +ClutterActor*       clutter_text_new_full               (const gchar *font_name,
    +                                                         const gchar *text,
    +                                                         const ClutterColor *color);
    +ClutterActor*       clutter_text_new_with_text          (const gchar *font_name,
    +                                                         const gchar *text);
    +
    +void                clutter_text_set_text               (ClutterText *self,
    +                                                         const gchar *text);
    +const gchar*        clutter_text_get_text               (ClutterText *self);
    +void                clutter_text_set_activatable        (ClutterText *self,
    +                                                         gboolean activatable);
    +gboolean            clutter_text_get_activatable        (ClutterText *self);
    +void                clutter_text_set_alignment          (ClutterText *self,
    +                                                         PangoAlignment alignment);
    +PangoAlignment      clutter_text_get_alignment          (ClutterText *self);
    +void                clutter_text_set_attributes         (ClutterText *self,
    +                                                         PangoAttrList *attrs);
    +PangoAttrList*      clutter_text_get_attributes         (ClutterText *self);
    +void                clutter_text_set_color              (ClutterText *self,
    +                                                         const ClutterColor *color);
    +void                clutter_text_get_color              (ClutterText *self,
    +                                                         ClutterColor *color);
    +void                clutter_text_set_ellipsize          (ClutterText *self,
    +                                                         PangoEllipsizeMode mode);
    +PangoEllipsizeMode  clutter_text_get_ellipsize          (ClutterText *self);
    +void                clutter_text_set_font_name          (ClutterText *self,
    +                                                         const gchar *font_name);
    +const gchar*        clutter_text_get_font_name          (ClutterText *self);
    +void                clutter_text_set_password_char      (ClutterText *self,
    +                                                         gunichar wc);
    +gunichar            clutter_text_get_password_char      (ClutterText *self);
    +void                clutter_text_set_justify            (ClutterText *self,
    +                                                         gboolean justify);
    +gboolean            clutter_text_get_justify            (ClutterText *self);
    +PangoLayout*        clutter_text_get_layout             (ClutterText *self);
    +void                clutter_text_set_line_wrap          (ClutterText *self,
    +                                                         gboolean line_wrap);
    +gboolean            clutter_text_get_line_wrap          (ClutterText *self);
    +void                clutter_text_set_line_wrap_mode     (ClutterText *self,
    +                                                         PangoWrapMode wrap_mode);
    +PangoWrapMode       clutter_text_get_line_wrap_mode     (ClutterText *self);
    +void                clutter_text_set_max_length         (ClutterText *self,
    +                                                         gint max);
    +gint                clutter_text_get_max_length         (ClutterText *self);
    +void                clutter_text_set_selectable         (ClutterText *self,
    +                                                         gboolean selectable);
    +gboolean            clutter_text_get_selectable         (ClutterText *self);
    +void                clutter_text_set_selection          (ClutterText *self,
    +                                                         gssize start_pos,
    +                                                         gssize end_pos);
    +gchar*              clutter_text_get_selection          (ClutterText *self);
    +void                clutter_text_set_selection_bound    (ClutterText *self,
    +                                                         gint selection_bound);
    +gint                clutter_text_get_selection_bound    (ClutterText *self);
    +void                clutter_text_set_single_line_mode   (ClutterText *self,
    +                                                         gboolean single_line);
    +gboolean            clutter_text_get_single_line_mode   (ClutterText *self);
    +void                clutter_text_set_use_markup         (ClutterText *self,
    +                                                         gboolean setting);
    +gboolean            clutter_text_get_use_markup         (ClutterText *self);
    +
    +void                clutter_text_set_editable           (ClutterText *self,
    +                                                         gboolean editable);
    +gboolean            clutter_text_get_editable           (ClutterText *self);
    +void                clutter_text_insert_text            (ClutterText *self,
    +                                                         const gchar *text,
    +                                                         gssize position);
    +void                clutter_text_insert_unichar         (ClutterText *self,
    +                                                         gunichar wc);
    +void                clutter_text_delete_chars           (ClutterText *self,
    +                                                         guint n_chars);
    +void                clutter_text_delete_text            (ClutterText *self,
    +                                                         gssize start_pos,
    +                                                         gssize end_pos);
    +gchar*              clutter_text_get_chars              (ClutterText *self,
    +                                                         gssize start_pos,
    +                                                         gssize end_pos);
    +void                clutter_text_set_cursor_color       (ClutterText *self,
    +                                                         const ClutterColor *color);
    +void                clutter_text_get_cursor_color       (ClutterText *self,
    +                                                         ClutterColor *color);
    +void                clutter_text_set_cursor_position    (ClutterText *self,
    +                                                         gint position);
    +gint                clutter_text_get_cursor_position    (ClutterText *self);
    +void                clutter_text_set_cursor_visible     (ClutterText *self,
    +                                                         gboolean cursor_visible);
    +gboolean            clutter_text_get_cursor_visible     (ClutterText *self);
    +void                clutter_text_set_cursor_size        (ClutterText *self,
    +                                                         gint size);
    +guint               clutter_text_get_cursor_size        (ClutterText *self);
    +
    +gboolean            clutter_text_activate               (ClutterText *self);
    +
    +
    +
    +

    Object Hierarchy

    +
    +  GObject
    +   +----GInitiallyUnowned
    +         +----ClutterActor
    +               +----ClutterText
    +
    +
    +
    +

    Implemented Interfaces

    +

    +ClutterText implements + ClutterScriptable.

    +
    +
    +

    Properties

    +
    +  "activatable"              gboolean              : Read / Write
    +  "alignment"                PangoAlignment        : Read / Write
    +  "attributes"               PangoAttrList*        : Read / Write
    +  "color"                    ClutterColor*         : Read / Write
    +  "cursor-color"             ClutterColor*         : Read / Write
    +  "cursor-color-set"         gboolean              : Read
    +  "cursor-size"              gint                  : Read / Write
    +  "cursor-visible"           gboolean              : Read / Write
    +  "editable"                 gboolean              : Read / Write
    +  "ellipsize"                PangoEllipsizeMode    : Read / Write
    +  "font-name"                gchar*                : Read / Write
    +  "justify"                  gboolean              : Read / Write
    +  "line-wrap"                gboolean              : Read / Write
    +  "line-wrap-mode"           PangoWrapMode         : Read / Write
    +  "max-length"               gint                  : Read / Write
    +  "password-char"            guint                 : Read / Write
    +  "position"                 gint                  : Read / Write
    +  "selectable"               gboolean              : Read / Write
    +  "selection-bound"          gint                  : Read / Write
    +  "single-line-mode"         gboolean              : Read / Write
    +  "text"                     gchar*                : Read / Write
    +  "use-markup"               gboolean              : Read / Write
    +
    +
    +
    +

    Signals

    +
    +  "activate"                                       : Run Last
    +  "cursor-event"                                   : Run Last
    +  "text-changed"                                   : Run Last
    +
    +
    +
    +

    Description

    +

    +ClutterText is an actor that displays custom text using Pango +as the text rendering engine. +

    +

    +ClutterText also allows inline editing of the text if the +actor is set editable using clutter_text_set_editable(). +

    +

    +Selection using keyboard or pointers can be enabled using +clutter_text_set_selectable(). +

    +

    +ClutterText is available since Clutter 1.0

    +

    + +

    +
    +
    +

    Details

    +
    +

    ClutterText

    +
    typedef struct _ClutterText ClutterText;
    +

    +The ClutterText struct contains only private data.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    ClutterTextClass

    +
    typedef struct {
    +  /* signals, not vfuncs */
    +  void (* text_changed) (ClutterText           *self);
    +  void (* activate)     (ClutterText           *self);
    +  void (* cursor_event) (ClutterText           *self,
    +                         const ClutterGeometry *geometry);
    +} ClutterTextClass;
    +
    +

    +The ClutterTextClass struct contains only private data.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    text_changed ()

    class handler for the "text-changed" signal +

    activate ()

    class handler for the "activate" signal +

    cursor_event ()

    class handler for the "cursor_event" signal +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_new ()

    +
    ClutterActor*       clutter_text_new                    (void);
    +

    +Creates a new ClutterText actor. This actor can be used to +display and edit text.

    +

    + +

    +
    ++ + + + +

    Returns :

    the newly created ClutterText actor + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_new_full ()

    +
    ClutterActor*       clutter_text_new_full               (const gchar *font_name,
    +                                                         const gchar *text,
    +                                                         const ClutterColor *color);
    +

    +Creates a new ClutterText actor, using font_name as the font +description; text will be used to set the contents of the actor; +and color will be used as the color to render text. +

    +

    +This function is equivalent to calling clutter_text_new(), +clutter_text_set_font_name(), clutter_text_set_text() and +clutter_text_set_color().

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + +

    font_name :

    a string with a font description +

    text :

    the contents of the actor +

    color :

    the color to be used to render text +

    Returns :

    the newly created ClutterText actor + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_new_with_text ()

    +
    ClutterActor*       clutter_text_new_with_text          (const gchar *font_name,
    +                                                         const gchar *text);
    +

    +Creates a new ClutterText actor, using font_name as the font +description; text will be used to set the contents of the actor. +

    +

    +This function is equivalent to calling clutter_text_new(), +clutter_text_set_font_name(), and clutter_text_set_text().

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    font_name :

    a string with a font description +

    text :

    the contents of the actor +

    Returns :

    the newly created ClutterText actor + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_set_text ()

    +
    void                clutter_text_set_text               (ClutterText *self,
    +                                                         const gchar *text);
    +

    +Sets the contents of a ClutterText actor. The text string +must not be NULL; to unset the current contents of the +ClutterText actor simply pass "" (an empty string).

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    text :

    the text to set +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_text ()

    +
    const gchar*        clutter_text_get_text               (ClutterText *self);
    +

    +Retrieves a pointer to the current contents of a ClutterText +actor. +

    +

    +If you need a copy of the contents for manipulating, either +use g_strdup() on the returned string, or use: +

    +

    +

    +
    +   copy = clutter_text_get_chars (text, 0, -1);
    +
    +

    +

    +

    +Which will return a newly allocated string.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    the contents of the actor. The returned string + is owned by the ClutterText actor and should never be + modified or freed + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_set_activatable ()

    +
    void                clutter_text_set_activatable        (ClutterText *self,
    +                                                         gboolean activatable);
    +

    +Sets whether a ClutterText actor should be activatable. +

    +

    +An activatable ClutterText actor will emit the "activate" +signal whenever the 'Enter' (or 'Return') key is pressed; if it is not +activatable, a new line will be appended to the current content. +

    +

    +An activatable ClutterText must also be set as editable using +clutter_text_set_editable().

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    activatable :

    whether the ClutterText actor should be activatable +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_activatable ()

    +
    gboolean            clutter_text_get_activatable        (ClutterText *self);
    +

    +Retrieves whether a ClutterText is activatable or not.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    TRUE if the actor is activatable + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_set_alignment ()

    +
    void                clutter_text_set_alignment          (ClutterText *self,
    +                                                         PangoAlignment alignment);
    +

    +Sets text alignment of the ClutterText actor. +

    +

    +The alignment will only be used when the contents of the +ClutterText actor are enough to wrap, and the "line-wrap" +property is set to TRUE.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    alignment :

    A PangoAlignment +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_alignment ()

    +
    PangoAlignment      clutter_text_get_alignment          (ClutterText *self);
    +

    +Retrieves the alignment of self.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    a PangoAlignment + +Since 1.0 +
    +
    +
    +
    +

    clutter_text_set_attributes ()

    +
    void                clutter_text_set_attributes         (ClutterText *self,
    +                                                         PangoAttrList *attrs);
    +

    +Sets the attributes list that are going to be applied to the +ClutterText contents. The attributes set with this function +will be ignored if the "use_markup" property is +set to TRUE. +

    +

    +The ClutterText actor will take a reference on the PangoAttrList +passed to this function.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    attrs :

    a PangoAttrList or NULL to unset the attributes +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_attributes ()

    +
    PangoAttrList*      clutter_text_get_attributes         (ClutterText *self);
    +

    +Gets the attribute list that was set on the ClutterText actor +clutter_text_set_attributes(), if any.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    the attribute list, or NULL if none was set. The + returned value is owned by the ClutterText and should not be + unreferenced. + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_set_color ()

    +
    void                clutter_text_set_color              (ClutterText *self,
    +                                                         const ClutterColor *color);
    +

    +Sets the color of the contents of a ClutterText actor. +

    +

    +The overall opacity of the ClutterText actor will be the +result of the alpha value of color and the composited +opacity of the actor itself on the scenegraph, as returned +by clutter_actor_get_paint_opacity().

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    color :

    a ClutterColor +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_color ()

    +
    void                clutter_text_get_color              (ClutterText *self,
    +                                                         ClutterColor *color);
    +

    +Retrieves the text color as set by clutter_text_get_color().

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    color :

    return location for a ClutterColor +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_set_ellipsize ()

    +
    void                clutter_text_set_ellipsize          (ClutterText *self,
    +                                                         PangoEllipsizeMode mode);
    +

    +Sets the mode used to ellipsize (add an ellipsis: "...") to the +text if there is not enough space to render the entire contents +of a ClutterText actor

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    mode :

    a PangoEllipsizeMode +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_ellipsize ()

    +
    PangoEllipsizeMode  clutter_text_get_ellipsize          (ClutterText *self);
    +

    +Returns the ellipsizing position of a ClutterText actor, as +set by clutter_text_set_ellipsize().

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    PangoEllipsizeMode + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_set_font_name ()

    +
    void                clutter_text_set_font_name          (ClutterText *self,
    +                                                         const gchar *font_name);
    +

    +Sets the font used by a ClutterText. 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, +like: +

    +

    +

    +
    +  clutter_text_set_font_name (text, "Sans 10pt");
    +  clutter_text_set_font_name (text, "Serif 16px");
    +  clutter_text_set_font_name (text, "Helvetica 10");
    +
    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    font_name :

    a font name, or NULL to set the default font name +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_font_name ()

    +
    const gchar*        clutter_text_get_font_name          (ClutterText *self);
    +

    +Retrieves the font name as set by clutter_text_set_font_name().

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    a string containing the font name. The returned + string is owned by the ClutterText actor and should not be + modified or freed + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_set_password_char ()

    +
    void                clutter_text_set_password_char      (ClutterText *self,
    +                                                         gunichar wc);
    +

    +Sets the character to use in place of the actual text in a +password text actor. +

    +

    +If wc is 0 the text will be displayed as it is entered in the +ClutterText actor.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    wc :

    a Unicode character, or 0 to unset the password character +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_password_char ()

    +
    gunichar            clutter_text_get_password_char      (ClutterText *self);
    +

    +Retrieves the character to use in place of the actual text +as set by clutter_text_set_password_char().

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    a Unicode character or 0 if the password + character is not set + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_set_justify ()

    +
    void                clutter_text_set_justify            (ClutterText *self,
    +                                                         gboolean justify);
    +

    +Sets whether the text of the ClutterText actor should be justified +on both margins. This setting is ignored if Clutter is compiled +against Pango < 1.18.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    justify :

    whether the text should be justified +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_justify ()

    +
    gboolean            clutter_text_get_justify            (ClutterText *self);
    +

    +Retrieves whether the ClutterText actor should justify its contents +on both margins.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    TRUE if the text should be justified + +
    +

    Since 0.6 +

    +
    +
    +
    +

    clutter_text_get_layout ()

    +
    PangoLayout*        clutter_text_get_layout             (ClutterText *self);
    +

    +Retrieves the current PangoLayout used by a ClutterText actor.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    a PangoLayout. The returned object is owned by + the ClutterText actor and should not be modified or freed + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_set_line_wrap ()

    +
    void                clutter_text_set_line_wrap          (ClutterText *self,
    +                                                         gboolean line_wrap);
    +

    +Sets whether the contents of a ClutterText actor should wrap, +if they don't fit the size assigned to the actor.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    line_wrap :

    whether the contents should wrap +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_line_wrap ()

    +
    gboolean            clutter_text_get_line_wrap          (ClutterText *self);
    +

    +Retrieves the value set using clutter_text_set_line_wrap().

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    TRUE if the ClutterText actor should wrap + its contents + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_set_line_wrap_mode ()

    +
    void                clutter_text_set_line_wrap_mode     (ClutterText *self,
    +                                                         PangoWrapMode wrap_mode);
    +

    +If line wrapping is enabled (see clutter_text_set_line_wrap()) this +function controls how the line wrapping is performed. The default is +PANGO_WRAP_WORD which means wrap on word boundaries.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    wrap_mode :

    the line wrapping mode +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_line_wrap_mode ()

    +
    PangoWrapMode       clutter_text_get_line_wrap_mode     (ClutterText *self);
    +

    +Retrieves the line wrap mode used by the ClutterText actor. +

    +

    +See clutter_text_set_line_wrap_mode().

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    the wrap mode used by the ClutterText + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_set_max_length ()

    +
    void                clutter_text_set_max_length         (ClutterText *self,
    +                                                         gint max);
    +

    +Sets the maximum allowed length of the contents of the actor. If the +current contents are longer than the given length, then they will be +truncated to fit.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    max :

    the maximum number of characters allowed in the text actor; 0 + to disable or -1 to set the length of the current string +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_max_length ()

    +
    gint                clutter_text_get_max_length         (ClutterText *self);
    +

    +Gets the maximum length of text that can be set into a text actor. +

    +

    +See clutter_text_set_max_length().

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    the maximum number of characters. + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_set_selectable ()

    +
    void                clutter_text_set_selectable         (ClutterText *self,
    +                                                         gboolean selectable);
    +

    +Sets whether a ClutterText actor should be selectable. +

    +

    +A selectable ClutterText will allow selecting its contents using +the pointer or the keyboard.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    selectable :

    whether the ClutterText actor should be selectable +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_selectable ()

    +
    gboolean            clutter_text_get_selectable         (ClutterText *self);
    +

    +Retrieves whether a ClutterText is selectable or not.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    TRUE if the actor is selectable + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_set_selection ()

    +
    void                clutter_text_set_selection          (ClutterText *self,
    +                                                         gssize start_pos,
    +                                                         gssize end_pos);
    +

    +Selects the region of text between start_pos and end_pos. +

    +

    +This function changes the position of the cursor to match +start_pos and the selection bound to match end_pos.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    self :

    a ClutterText +

    start_pos :

    start of the selection, in characters +

    end_pos :

    end of the selection, in characters +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_selection ()

    +
    gchar*              clutter_text_get_selection          (ClutterText *self);
    +

    +Retrieves the currently selected text.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    a newly allocated string containing the currently + selected text, or NULL. Use g_free() to free the returned + string. + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_set_selection_bound ()

    +
    void                clutter_text_set_selection_bound    (ClutterText *self,
    +                                                         gint selection_bound);
    +

    +Sets the other end of the selection, starting from the current +cursor position. +

    +

    +If selection_bound is -1, the selection unset.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    selection_bound :

    the position of the end of the selection, in characters +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_selection_bound ()

    +
    gint                clutter_text_get_selection_bound    (ClutterText *self);
    +

    +Retrieves the other end of the selection of a ClutterText actor, +in characters from the current cursor position.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    the position of the other end of the selection + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_set_single_line_mode ()

    +
    void                clutter_text_set_single_line_mode   (ClutterText *self,
    +                                                         gboolean single_line);
    +

    +Sets whether a ClutterText actor should be in single line mode +or not. +

    +

    +A text actor in single line mode will not wrap text and will clip +the the visible area to the predefined size. The contents of the +text actor will scroll to display the end of the text if its length +is bigger than the allocated width. +

    +

    +When setting the single line mode the "activatable" +property is also set as a side effect. Instead of entering a new +line character, the text actor will emit the "activate" +signal.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    single_line :

    whether to enable single line mode +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_single_line_mode ()

    +
    gboolean            clutter_text_get_single_line_mode   (ClutterText *self);
    +

    +Retrieves whether the ClutterText actor is in single line mode.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    TRUE if the ClutterText actor is in single line mode + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_set_use_markup ()

    +
    void                clutter_text_set_use_markup         (ClutterText *self,
    +                                                         gboolean setting);
    +

    +Sets whether the contents of the ClutterText actor contains markup +in Pango's text markup language. +

    +

    +Calling this function on an editable ClutterText will not cause +the actor to parse any markup.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    setting :

    TRUE if the text should be parsed for markup. +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_use_markup ()

    +
    gboolean            clutter_text_get_use_markup         (ClutterText *self);
    +

    +Retrieves whether the contents of the ClutterText actor should be +parsed for the Pango text markup.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    TRUE if the contents will be parsed for markup + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_set_editable ()

    +
    void                clutter_text_set_editable           (ClutterText *self,
    +                                                         gboolean editable);
    +

    +Sets whether the ClutterText actor should be editable. +

    +

    +An editable ClutterText with key focus set using +clutter_actor_grab_key_focus() or clutter_stage_take_key_focus() +will receive key events and will update its contents accordingly.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    editable :

    whether the ClutterText should be editable +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_editable ()

    +
    gboolean            clutter_text_get_editable           (ClutterText *self);
    +

    +Retrieves whether a ClutterText is editable or not.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    TRUE if the actor is editable + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_insert_text ()

    +
    void                clutter_text_insert_text            (ClutterText *self,
    +                                                         const gchar *text,
    +                                                         gssize position);
    +

    +Inserts text into a ClutterActor at the given position. +

    +

    +If position is a negative number, the text will be appended +at the end of the current contents of the ClutterText. +

    +

    +The position is expressed in characters, not in bytes.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    self :

    a ClutterText +

    text :

    the text to be inserted +

    position :

    the position of the insertion, or -1 +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_insert_unichar ()

    +
    void                clutter_text_insert_unichar         (ClutterText *self,
    +                                                         gunichar wc);
    +

    +Inserts wc at the current cursor position of a +ClutterText actor.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    wc :

    a Unicode character +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_delete_chars ()

    +
    void                clutter_text_delete_chars           (ClutterText *self,
    +                                                         guint n_chars);
    +

    +Deletes n_chars inside a ClutterText actor, starting from the +current cursor position.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    n_chars :

    the number of characters to delete +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_delete_text ()

    +
    void                clutter_text_delete_text            (ClutterText *self,
    +                                                         gssize start_pos,
    +                                                         gssize end_pos);
    +

    +Deletes the text inside a ClutterText actor between start_pos +and end_pos. +

    +

    +The starting and ending positions are expressed in characters, +not in bytes.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    self :

    a ClutterText +

    start_pos :

    starting position +

    end_pos :

    ending position +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_chars ()

    +
    gchar*              clutter_text_get_chars              (ClutterText *self,
    +                                                         gssize start_pos,
    +                                                         gssize end_pos);
    +

    +Retrieves the contents of the ClutterText actor between +start_pos and end_pos. +

    +

    +The positions are specified in characters, not in bytes.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + +

    self :

    a ClutterText +

    start_pos :

    start of text, in characters +

    end_pos :

    end of text, in characters +

    Returns :

    a newly allocated string with the contents of + the text actor between the specified positions. Use g_free() + to free the resources when done + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_set_cursor_color ()

    +
    void                clutter_text_set_cursor_color       (ClutterText *self,
    +                                                         const ClutterColor *color);
    +

    +Sets the color of the cursor of a ClutterText actor. +

    +

    +If color is NULL, the cursor color will be the same as the +text color.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    color :

    the color of the cursor, or NULL to unset it +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_cursor_color ()

    +
    void                clutter_text_get_cursor_color       (ClutterText *self,
    +                                                         ClutterColor *color);
    +

    +Retrieves the color of the cursor of a ClutterText actor.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    color :

    return location for a ClutterColor +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_set_cursor_position ()

    +
    void                clutter_text_set_cursor_position    (ClutterText *self,
    +                                                         gint position);
    +

    +Sets the cursor of a ClutterText actor at position. +

    +

    +The position is expressed in characters, not in bytes.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    position :

    the new cursor position, in characters +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_cursor_position ()

    +
    gint                clutter_text_get_cursor_position    (ClutterText *self);
    +

    +Retrieves the cursor position.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    the cursor position, in characters + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_set_cursor_visible ()

    +
    void                clutter_text_set_cursor_visible     (ClutterText *self,
    +                                                         gboolean cursor_visible);
    +

    +Sets whether the cursor of a ClutterText actor should be +visible or not. +

    +

    +The color of the cursor will be the same as the text color +unless clutter_text_set_cursor_color() has been called. +

    +

    +The size of the cursor can be set using clutter_text_set_cursor_size(). +

    +

    +The position of the cursor can be changed programmatically using +clutter_text_set_cursor_position().

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    cursor_visible :

    whether the cursor should be visible +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_cursor_visible ()

    +
    gboolean            clutter_text_get_cursor_visible     (ClutterText *self);
    +

    +Retrieves whether the cursor of a ClutterText actor is visible.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    TRUE if the cursor is visible + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_set_cursor_size ()

    +
    void                clutter_text_set_cursor_size        (ClutterText *self,
    +                                                         gint size);
    +

    +Sets the size of the cursor of a ClutterText. The cursor +will only be visible if the "cursor-visible" property +is set to TRUE.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    size :

    the size of the cursor, in pixels, or -1 to use the + default value +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_get_cursor_size ()

    +
    guint               clutter_text_get_cursor_size        (ClutterText *self);
    +

    +Retrieves the size of the cursor of a ClutterText actor.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    the size of the cursor, in pixels + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_text_activate ()

    +
    gboolean            clutter_text_activate               (ClutterText *self);
    +

    +Emits the "activate" signal, if self has been set +as activatable using clutter_text_set_activatable(). +

    +

    +This function can be used to emit the ::activate signal inside +a "captured-event" or "key-press-event" +signal handlers before the default signal handler for the +ClutterText is invoked.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    a ClutterText +

    Returns :

    TRUE if the ::activate signal has been emitted, + and FALSE otherwise + +
    +

    Since 1.0 +

    +
    +
    +
    +

    Property Details

    +
    +

    The "activatable" property

    +
      "activatable"              gboolean              : Read / Write
    +

    +Toggles whether return invokes the activate signal or not.

    +

    + +

    +

    Default value: TRUE

    +

    Since 1.0 +

    +
    +
    +
    +

    The "alignment" property

    +
      "alignment"                PangoAlignment        : Read / Write
    +

    +The preferred alignment for the text. This property controls +the alignment of multi-line paragraphs.

    +

    + +

    +

    Default value: PANGO_ALIGN_LEFT

    +

    Since 1.0 +

    +
    +
    +
    +

    The "attributes" property

    +
      "attributes"               PangoAttrList*        : Read / Write
    +

    +A list of PangoStyleAttributes to be applied to the +contents of the ClutterText actor.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    The "color" property

    +
      "color"                    ClutterColor*         : Read / Write
    +

    +The color used to render the text.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    The "cursor-color" property

    +
      "cursor-color"             ClutterColor*         : Read / Write
    +

    +The color of the cursor.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    The "cursor-color-set" property

    +
      "cursor-color-set"         gboolean              : Read
    +

    +Will be set to TRUE if "cursor-color" has been set.

    +

    + +

    +

    Default value: FALSE

    +

    Since 1.0 +

    +
    +
    +
    +

    The "cursor-size" property

    +
      "cursor-size"              gint                  : Read / Write
    +

    +The size of the cursor, in pixels. If set to -1 the size used will +be the default cursor size of 2 pixels.

    +

    + +

    +

    Allowed values: >= -1

    +

    Default value: 2

    +

    Since 1.0 +

    +
    +
    +
    +

    The "cursor-visible" property

    +
      "cursor-visible"           gboolean              : Read / Write
    +

    +Whether the input cursor is visible or not, it will only be visible +if both "cursor-visible" and "editable" are +set to TRUE.

    +

    + +

    +

    Default value: TRUE

    +

    Since 1.0 +

    +
    +
    +
    +

    The "editable" property

    +
      "editable"                 gboolean              : Read / Write
    +

    +Whether key events delivered to the actor causes editing.

    +

    + +

    +

    Default value: TRUE

    +

    Since 1.0 +

    +
    +
    +
    +

    The "ellipsize" property

    +
      "ellipsize"                PangoEllipsizeMode    : Read / Write
    +

    +The preferred place to ellipsize the contents of the ClutterText actor

    +

    + +

    +

    Default value: PANGO_ELLIPSIZE_NONE

    +

    Since 1.0 +

    +
    +
    +
    +

    The "font-name" property

    +
      "font-name"                gchar*                : Read / Write
    +

    +The font to be used by the ClutterText, as a string +that can be parsed by pango_font_description_from_string().

    +

    + +

    +

    Default value: NULL

    +

    Since 1.0 +

    +
    +
    +
    +

    The "justify" property

    +
      "justify"                  gboolean              : Read / Write
    +

    +Whether the contents of the ClutterText should be justified +on both margins.

    +

    + +

    +

    Default value: FALSE

    +

    Since 1.0 +

    +
    +
    +
    +

    The "line-wrap" property

    +
      "line-wrap"                gboolean              : Read / Write
    +

    +Whether to wrap the lines of "text" if the contents +exceed the available allocation. The wrapping strategy is +controlled by the "line-wrap-mode" property.

    +

    + +

    +

    Default value: FALSE

    +

    Since 1.0 +

    +
    +
    +
    +

    The "line-wrap-mode" property

    +
      "line-wrap-mode"           PangoWrapMode         : Read / Write
    +

    +If "line-wrap" is set to TRUE, this property will +control how the text is wrapped.

    +

    + +

    +

    Default value: PANGO_WRAP_WORD

    +

    Since 1.0 +

    +
    +
    +
    +

    The "max-length" property

    +
      "max-length"               gint                  : Read / Write
    +

    +The maximum length of the contents of the ClutterText actor.

    +

    + +

    +

    Allowed values: >= -1

    +

    Default value: 0

    +

    Since 1.0 +

    +
    +
    +
    +

    The "password-char" property

    +
      "password-char"            guint                 : Read / Write
    +

    +If non-zero, the character that should be used in place of +the actual text in a password text actor.

    +

    + +

    +

    Default value: 0

    +

    Since 1.0 +

    +
    +
    +
    +

    The "position" property

    +
      "position"                 gint                  : Read / Write
    +

    +The current input cursor position. -1 is taken to be the end of the text

    +

    + +

    +

    Allowed values: >= -1

    +

    Default value: -1

    +

    Since 1.0 +

    +
    +
    +
    +

    The "selectable" property

    +
      "selectable"               gboolean              : Read / Write
    +

    +Whether it is possible to select text, either using the pointer +or the keyboard.

    +

    + +

    +

    Default value: TRUE

    +

    Since 1.0 +

    +
    +
    +
    +

    The "selection-bound" property

    +
      "selection-bound"          gint                  : Read / Write
    +

    +The current input cursor position. -1 is taken to be the end of the text

    +

    + +

    +

    Allowed values: >= -1

    +

    Default value: -1

    +

    Since 1.0 +

    +
    +
    +
    +

    The "single-line-mode" property

    +
      "single-line-mode"         gboolean              : Read / Write
    +

    +Whether the ClutterText actor should be in single line mode +or not. A single line ClutterText actor will only contain a +single line of text, scrolling it in case its length is bigger +than the allocated size. +

    +

    +Setting this property will also set the "activatable" +property as a side-effect.

    +

    + +

    +

    Default value: FALSE

    +

    Since 1.0 +

    +
    +
    +
    +

    The "text" property

    +
      "text"                     gchar*                : Read / Write
    +

    +The text to render inside the actor.

    +

    + +

    +

    Default value: ""

    +

    Since 1.0 +

    +
    +
    +
    +

    The "use-markup" property

    +
      "use-markup"               gboolean              : Read / Write
    +

    +Whether the text includes Pango markup. See pango_layout_set_markup() +in the Pango documentation.

    +

    + +

    +

    Default value: FALSE

    +

    Since 1.0 +

    +
    +
    +
    +

    Signal Details

    +
    +

    The "activate" signal

    +
    void                user_function                      (ClutterText *self,
    +                                                        gpointer     user_data)      : Run Last
    +

    +The ::activate signal is emitted each time the actor is 'activated' +by the user, normally by pressing the 'Enter' key. The signal is +emitted only if "activatable" is set to TRUE.

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    the ClutterText that emitted the signal +

    user_data :

    user data set when the signal handler was connected.
    +

    Since 1.0 +

    +
    +
    +
    +

    The "cursor-event" signal

    +
    void                user_function                      (ClutterText     *self,
    +                                                        ClutterGeometry *geometry,
    +                                                        gpointer         user_data)      : Run Last
    +

    +The ::cursor-event signal is emitted whenever the cursor position +changes inside a ClutterText actor. Inside geometry it is stored +the current position and size of the cursor, relative to the actor +itself.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    self :

    the ClutterText that emitted the signal +

    geometry :

    the coordinates of the cursor +

    user_data :

    user data set when the signal handler was connected.
    +

    Since 1.0 +

    +
    +
    +
    +

    The "text-changed" signal

    +
    void                user_function                      (ClutterText *self,
    +                                                        gpointer     user_data)      : Run Last
    +

    +The ::text-changed signal is emitted after actor's text changes

    +

    + +

    +
    ++ + + + + + + + + + +

    self :

    the ClutterText that emitted the signal +

    user_data :

    user data set when the signal handler was connected.
    +

    Since 1.0 +

    +
    +
    +
    + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ClutterTexture.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ClutterTexture.html --- clutter-0.8.4/doc/reference/clutter/html/ClutterTexture.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ClutterTexture.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,10 +4,10 @@ ClutterTexture - + - + @@ -19,7 +19,7 @@ - + @@ -43,8 +43,8 @@ Prev Up Home -Clutter 0.8.4 Reference Manual -Next +Clutter 0.9.0 Reference Manual +Next
    Top  |  @@ -191,6 +191,13 @@ CoglHandle cogl_tex); +CoglHandle clutter_texture_get_cogl_material (ClutterTexture *texture); +void clutter_texture_set_cogl_material (ClutterTexture *texture, + CoglHandle cogl_material);
    @@ -204,13 +211,14 @@ >GInitiallyUnowned +----ClutterActor +----ClutterTexture + +----ClutterCairoTexture

    Implemented Interfaces

    ClutterTexture implements -

    + ClutterScriptable.

    Properties

    @@ -226,6 +234,9 @@ "keep-aspect-ratio" gboolean : Read / Write + "load-async" gboolean : Read / Write "pixel-format" gint : Read @@ -246,6 +257,7 @@

    Signals

    +  "load-finished"                                  : Run Last
       "pixbuf-change"                                  : Run Last
       "size-change"                                    : Run Last
     
    @@ -292,10 +304,12 @@
    typedef struct {
       ClutterActorClass parent_class;
     
    -  void (*size_change)   (ClutterTexture *texture, 
    -		         gint            width, 
    +  void (*size_change)   (ClutterTexture *texture,
    +		         gint            width,
     		         gint            height);
       void (*pixbuf_change) (ClutterTexture *texture);
    +  void (*load_finished) (ClutterTexture *texture,
    +                         GError         *error);
     } ClutterTextureClass;
     

    @@ -453,7 +467,7 @@

    Note this function is intented as a utility call for uniformly applying shaders to groups and other potential visual effects. It requires that -the CLUTTER_FEATURE_OFFSCREEN feature is supported by the current backend +the CLUTTER_FEATURE_OFFSCREEN feature is supported by the current backend and the target system.

    @@ -593,7 +607,16 @@ Sets the ClutterTexture image data from an image file. In case of failure, FALSE is returned and error is set.

    +>FALSE is returned and error is set. +

    +

    +If "load-async" is set to TRUE, this function +will return as soon as possible, and the actual image loading +from disk will be performed asynchronously. "load-finished" +will be emitted when the image has been loaded or if an error +occurred.

    @@ -703,7 +726,7 @@

    bpp :

    - bytes per pixel (Currently only 3 and 4 supported, + bytes per pixel (Currently only 3 and 4 supported, depending on has_alpha) @@ -809,11 +832,12 @@ href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS" >TRUE if the texture was successfully updated -Since 0.4.
    +

    Since 0.4 +


    @@ -900,7 +924,7 @@

    bpp :

    - bytes per pixel (Currently only 3 and 4 supported, + bytes per pixel (Currently only 3 and 4 supported, depending on has_alpha) @@ -926,11 +950,12 @@ href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS" >FALSE on failure. -Since 0.6.
    +

    Since 0.6 +


    @@ -1165,6 +1190,71 @@

    Since 0.8

    +
    +
    +

    clutter_texture_get_cogl_material ()

    +
    CoglHandle          clutter_texture_get_cogl_material   (ClutterTexture *texture);
    +

    +Returns a handle to the underlying COGL material used for drawing +the actor. No extra reference is taken so if you need to keep the +handle then you should call cogl_material_ref on it.

    +

    + +

    +
    ++ + + + + + + + + + +

    texture :

    A ClutterTexture +

    Returns :

    COGL material handle +
    +

    Since 1.0 + +

    +
    +
    +
    +

    clutter_texture_set_cogl_material ()

    +
    void                clutter_texture_set_cogl_material   (ClutterTexture *texture,
    +                                                         CoglHandle cogl_material);
    +

    +Replaces the underlying COGL texture drawn by this actor with +cogl_tex. A reference to the texture is taken so if the handle is +no longer needed it should be deref'd with cogl_texture_unref.

    +

    + +

    +
    ++ + + + + + + + + + +

    texture :

    A ClutterTexture +

    cogl_material :

    A CoglHandle for a material +
    +

    Since 0.8 + +

    +

    Property Details

    @@ -1209,6 +1299,31 @@

    +

    The "load-async" property

    +
      "load-async"               gboolean              : Read / Write
    +

    +Tries to load a texture from a filename by using a local thread +to perform the read operations. Threading is only enabled if +g_thread_init() has been called prior to clutter_init(), otherwise +ClutterTexture will use the main loop to load the image. +

    +

    +The upload of the texture data on the GL pipeline is not +asynchronous, as it must be performed from within the same +thread that called clutter_main().

    +

    + +

    +

    Default value: FALSE

    +

    Since 1.0 +

    +
    +
    +

    The "pixel-format" property

      "pixel-format"             gint                  : Read / Write / Construct Only

    Max wastage dimension of a texture when using sliced textures or -1 to disable slicing. Bigger values use less textures, smaller values less texture memory.

    Allowed values: >= -1

    -

    Default value: 64

    +

    Default value: 63

    Signal Details

    +

    The "load-finished" signal

    +
    void                user_function                      (ClutterTexture *texture,
    +                                                        gpointer        error,
    +                                                        gpointer        user_data)      : Run Last
    +

    +The ::load-finished signal is emitted when a texture load has +completed. If there was an error during loading, error will +be set, otherwise it will be NULL

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    texture :

    the texture which received the signal +

    error :

    A set error, or NULL +

    user_data :

    user data set when the signal handler was connected.
    +

    Since 1.0 +

    +
    +
    +

    The "pixbuf-change" signal

    void                user_function                      (ClutterTexture *texture,
                                                             
     ClutterTimeline
     
    -
    +
     
     
     
    @@ -19,7 +19,7 @@
     
     
     
    -
    +
     
     
     
    @@ -43,7 +43,7 @@
     Prev
     Up
     Home
    -Clutter 0.8.4 Reference Manual
    +Clutter 0.9.0 Reference Manual
     Next
     
     Top
    @@ -249,38 +249,40 @@
     

    One way to visualise a timeline is as a path with marks along its length. -When creating a timeline of n_frames via clutter_timeline_new(), then the -number of frames can be seen as the paths length, and each unit of length -(each frame) is delimited by a mark. +When creating a timeline of N frames via clutter_timeline_new(), then the +number of frames can be seen as the paths length, and each unit of +length (each frame) is delimited by a mark.

    -For a non looping timeline there will be (n_frames + 1) marks along its +For a non looping timeline there will be (N frames + 1) marks along its length. For a looping timeline, the two ends are joined with one mark. Technically this mark represents two discrete frame numbers, but for a looping timeline the start and end frame numbers are considered equivalent.

    -When you create a timeline it starts with -clutter_timeline_get_current_frame() == 0. +When you create a timeline it will be initialized so that the current +frame, as returned by clutter_timeline_get_current_frame(), will be 0.

    -After starting a timeline, the first timeout is for current_frame_num == 1 -(Notably it isn't 0 since there is a delay before the first timeout signals -so re-asserting the starting frame (0) wouldn't make sense.) -Notably, this implies that actors you intend to be affected by the -timeline's progress, should be manually primed/positioned for frame 0 which -will be displayed before the first timeout. (If you are not careful about +After starting a timeline, the first timeout is for frame number +one (notably it isn't zero since there is a delay before the first +"new-frame" signal, so re-asserting the frame number +zero wouldn't make sense). +

    +

    +This implies that actors you intend to be affected by the timeline's +progress should be manually primed or positioned for frame zero which +will be displayed before the first timeout (if you are not careful about this point you will likely see flashes of incorrect actor state in your -program) +program).

    -For a non looping timeline the last timeout would be for -current_frame_num == n_frames +For a non looping timeline the last timeout would be for the number +of frames in the timeline, as returned by clutter_timeline_get_n_frames().

    -For a looping timeline the timeout for current_frame_num == n_frames would -be followed by a timeout for current_frame_num == 1 (remember frame 0 is -considered == frame (n_frames)). +For a looping timeline the timeout for the last frame would be followed +by a timeout for frame number 1.

    There may be times when a system is not able to meet the frame rate @@ -289,8 +291,8 @@ the time that the timeline was started, not from the time of the last timeout, so a given timeline should basically elapse in the same - real world - time on any given system. An invariable here though is that -current_frame_num == n_frames will always be signaled, but notably frame 1 -can be interpolated past and so never signaled.

    +the last frame will always be signaled, but notably frame number 1 can +be interpolated past and thus never signaled.

    @@ -415,11 +417,12 @@

    Returns :

    a new ClutterTimeline, cloned from timeline -Since 0.4
    +

    Since 0.4 +


    @@ -429,7 +432,7 @@ href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" >guint fps);

    -Set the speed in frames per second of the timeline.

    +Sets the speed of timeline in frames per second.

    @@ -443,7 +446,8 @@

    fps :

    - New speed of timeline as frames per second + New speed of timeline as frames per second, + between 1 and 1000 @@ -646,7 +650,7 @@

    Returns :

    - Number of frames for this ClutterTimeline. + the number of frames @@ -861,8 +865,8 @@
    void                clutter_timeline_rewind             (ClutterTimeline *timeline);

    Rewinds ClutterTimeline to the first frame if its direction is -CLUTTER_TIMELINE_FORWARD and the last frame if it is -CLUTTER_TIMELINE_BACKWARD.

    +CLUTTER_TIMELINE_FORWARD and the last frame if it is +CLUTTER_TIMELINE_BACKWARD.

    @@ -883,7 +887,7 @@ href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" >guint n_frames);

    -Advance timeline by requested number of frames.

    +Advance timeline by the requested number of frames.

    @@ -911,7 +915,17 @@ href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" >guint frame_num);

    -Advance timeline to requested frame number

    +Advance timeline to the requested frame number. +

    +

    +

    +
    +

    Note

    +

    The timeline will not emit the "new-frame" +signal for frame_num. The first ::new-frame signal after the call to +clutter_timeline_advance() will be emitted for a frame following +frame_num.

    +

    @@ -1070,7 +1084,7 @@ href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean" >gboolean clutter_timeline_is_playing (ClutterTimeline *timeline);

    -Query state of a ClutterTimeline instance.

    +Queries state of a ClutterTimeline.

    @@ -1084,7 +1098,9 @@

    Returns :

    - TRUE if timeline is currently playing, FALSE if not. + TRUE if timeline is currently playing @@ -1309,7 +1325,17 @@ href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" >gchar *marker_name);

    -Advances timeline to the frame of the given marker_name.

    +Advances timeline to the frame of the given marker_name. +

    +

    +

    +
    +

    Note

    +

    Like clutter_timeline_advance(), this function will not +emit the "new-frame" for the frame where marker_name +is set, nor it will emit "marker-reached" for +marker_name.

    +

    @@ -1386,8 +1412,12 @@ href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" >guint : Read / Write

    -Timeline frames per second. Because of the nature of the main -loop used by Clutter this is to be considered a best approximation.

    +Number of frames per second. Because of the nature of the main +loop used by Clutter, we can only accept a granularity of one +frame per millisecond. +

    +

    +This value is to be considered a best approximation.

    diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/clutter-Unit-conversion.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/clutter-Unit-conversion.html --- clutter-0.8.4/doc/reference/clutter/html/clutter-Unit-conversion.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/clutter-Unit-conversion.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ Unit conversion - + @@ -19,7 +19,7 @@ - + @@ -43,7 +43,7 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next
    Top @@ -63,26 +63,30 @@

    Synopsis

     typedef             ClutterUnit;
    -#define             CLUTTER_UNITS_FROM_DEVICE           (x)
    -#define             CLUTTER_UNITS_TO_DEVICE             (x)
    -#define             CLUTTER_UNITS_FROM_FIXED            (x)
    -#define             CLUTTER_UNITS_TO_FIXED              (x)
    +#define             CLUTTER_UNITS_FORMAT
     #define             CLUTTER_UNITS_FROM_FLOAT            (x)
     #define             CLUTTER_UNITS_TO_FLOAT              (x)
     #define             CLUTTER_UNITS_FROM_INT              (x)
     #define             CLUTTER_UNITS_TO_INT                (x)
    +
    +#define             CLUTTER_UNITS_FROM_DEVICE           (x)
    +#define             CLUTTER_UNITS_TO_DEVICE             (x)
    +#define             CLUTTER_UNITS_FROM_FIXED            (x)
    +#define             CLUTTER_UNITS_TO_FIXED              (x)
     #define             CLUTTER_UNITS_FROM_PANGO_UNIT       (x)
     #define             CLUTTER_UNITS_TO_PANGO_UNIT         (x)
    -#define             CLUTTER_UNITS_TMP_FROM_DEVICE       (x)
    -#define             CLUTTER_UNITS_TMP_TO_DEVICE         (x)
    -#define             CLUTTER_UNITS_FROM_STAGE_WIDTH_PERCENTAGE(x)
    -#define             CLUTTER_UNITS_FROM_STAGE_HEIGHT_PERCENTAGE(x)
    -#define             CLUTTER_UNITS_FROM_PARENT_WIDTH_PERCENTAGE(a, x)
    -#define             CLUTTER_UNITS_FROM_PARENT_HEIGHT_PERCENTAGE(a, x)
     #define             CLUTTER_UNITS_FROM_MM               (x)
    -#define             CLUTTER_UNITS_FROM_MMX              (x)
     #define             CLUTTER_UNITS_FROM_POINTS           (x)
    -#define             CLUTTER_UNITS_FROM_POINTSX          (x)
    +#define             CLUTTER_UNITS_FROM_EM               (x)
    +ClutterUnit         clutter_units_mm                    (gdouble mm);
    +ClutterUnit         clutter_units_pt                    (gdouble pt);
    +ClutterUnit         clutter_units_em                    (gdouble em);
     
     #define             CLUTTER_MAXUNIT
     #define             CLUTTER_MINUNIT
    @@ -207,7 +211,7 @@
     

    Details

    ClutterUnit

    -
    typedef gint32 ClutterUnit;
    +
    typedef float ClutterUnit;
     

    Device independent unit used by Clutter. The value held can be transformed @@ -220,11 +224,31 @@


    -

    CLUTTER_UNITS_FROM_DEVICE()

    -
    #define CLUTTER_UNITS_FROM_DEVICE(x)     CLUTTER_UNITS_FROM_INT ((x))
    +

    CLUTTER_UNITS_FORMAT

    +
    #define CLUTTER_UNITS_FORMAT             "f"
     

    -Converts x from pixels to ClutterUnits

    +Format string that should be used for scanning and printing units. +It is a string literal, but it does not include the percent sign to +allow precision and length modifiers between the percent sign and +the format: +

    +

    +

    +
    +  g_print ("%" CLUTTER_UNITS_FORMAT, units);
    +
    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    CLUTTER_UNITS_FROM_FLOAT()

    +
    #define CLUTTER_UNITS_FROM_FLOAT(x)      (x)
    +

    @@ -232,38 +256,36 @@

    x :

    - value in pixels + + +
    -

    Since 0.6 -


    -

    CLUTTER_UNITS_TO_DEVICE()

    -
    #define CLUTTER_UNITS_TO_DEVICE(x)       CLUTTER_UNITS_TO_INT ((x))
    +

    CLUTTER_UNITS_TO_FLOAT()

    +
    #define CLUTTER_UNITS_TO_FLOAT(x)        (x)
     

    -Converts x from ClutterUnits to pixels

    -

    -

    x :

    value in ClutterUnits + + +
    -

    Since 0.6 -


    -

    CLUTTER_UNITS_FROM_FIXED()

    -
    #define CLUTTER_UNITS_FROM_FIXED(x)      (x)
    +

    CLUTTER_UNITS_FROM_INT()

    +
    #define CLUTTER_UNITS_FROM_INT(x)        ((float)(x))
     

    @@ -281,8 +303,8 @@


    -

    CLUTTER_UNITS_TO_FIXED()

    -
    #define CLUTTER_UNITS_TO_FIXED(x)        (x)
    +

    CLUTTER_UNITS_TO_INT()

    +
    #define CLUTTER_UNITS_TO_INT(x)          ((int)(x))
     

    @@ -300,46 +322,50 @@


    -

    CLUTTER_UNITS_FROM_FLOAT()

    -
    #define CLUTTER_UNITS_FROM_FLOAT(x)      CLUTTER_FLOAT_TO_FIXED ((x))
    +

    CLUTTER_UNITS_FROM_DEVICE()

    +
    #define CLUTTER_UNITS_FROM_DEVICE(x)     CLUTTER_UNITS_FROM_INT ((x))
     

    +Converts x from pixels to ClutterUnits

    +

    -

    x :

    - - + value in pixels
    +

    Since 0.6 +


    -

    CLUTTER_UNITS_TO_FLOAT()

    -
    #define CLUTTER_UNITS_TO_FLOAT(x)        CLUTTER_FIXED_TO_FLOAT ((x))
    +

    CLUTTER_UNITS_TO_DEVICE()

    +
    #define CLUTTER_UNITS_TO_DEVICE(x)       CLUTTER_UNITS_TO_INT ((x))
     

    +Converts x from ClutterUnits to pixels

    +

    -

    x :

    - - + value in ClutterUnits
    +

    Since 0.6 +


    -

    CLUTTER_UNITS_FROM_INT()

    -
    #define CLUTTER_UNITS_FROM_INT(x)        CLUTTER_INT_TO_FIXED ((x))
    +

    CLUTTER_UNITS_FROM_FIXED()

    +
    #define CLUTTER_UNITS_FROM_FIXED(x)      (x)
     

    @@ -357,8 +383,8 @@


    -

    CLUTTER_UNITS_TO_INT()

    -
    #define CLUTTER_UNITS_TO_INT(x)          CLUTTER_FIXED_TO_INT ((x))
    +

    CLUTTER_UNITS_TO_FIXED()

    +
    #define CLUTTER_UNITS_TO_FIXED(x)        (x)
     

    @@ -377,7 +403,7 @@


    CLUTTER_UNITS_FROM_PANGO_UNIT()

    -
    #define CLUTTER_UNITS_FROM_PANGO_UNIT(x) ((x) << 6)
    +
    #define CLUTTER_UNITS_FROM_PANGO_UNIT(x) ((float)((x) / 1024))
     

    Converts a value in Pango units to ClutterUnits

    @@ -398,7 +424,7 @@

    CLUTTER_UNITS_TO_PANGO_UNIT()

    -
    #define CLUTTER_UNITS_TO_PANGO_UNIT(x)   ((x) >> 6)
    +
    #define CLUTTER_UNITS_TO_PANGO_UNIT(x)   ((int)((x) * 1024))
     

    Converts a value in ClutterUnits to Pango units

    @@ -418,46 +444,32 @@

    -

    CLUTTER_UNITS_TMP_FROM_DEVICE()

    -
    #define CLUTTER_UNITS_TMP_FROM_DEVICE(x) (x)
    +

    CLUTTER_UNITS_FROM_MM()

    +
    #define CLUTTER_UNITS_FROM_MM(x)        (clutter_units_mm (x))
     

    +Converts a value in millimeters into ClutterUnits

    +

    -

    x :

    - - + a value in millimeters
    +

    Since 0.6 +


    -

    CLUTTER_UNITS_TMP_TO_DEVICE()

    -
    #define CLUTTER_UNITS_TMP_TO_DEVICE(x)   (x)
    +

    CLUTTER_UNITS_FROM_POINTS()

    +
    #define CLUTTER_UNITS_FROM_POINTS(x)    (clutter_units_pt (x))
     

    - -

    -
    -- - - - -

    x :

    - - -
    -
    -
    -
    -

    CLUTTER_UNITS_FROM_STAGE_WIDTH_PERCENTAGE()

    -
    #define             CLUTTER_UNITS_FROM_STAGE_WIDTH_PERCENTAGE(x)
    +Converts a value in typographic points into ClutterUnits

    @@ -465,17 +477,20 @@

    x :

    - - - + a value in typographic points
    +

    Since 0.6 +


    -

    CLUTTER_UNITS_FROM_STAGE_HEIGHT_PERCENTAGE()

    -
    #define             CLUTTER_UNITS_FROM_STAGE_HEIGHT_PERCENTAGE(x)
    +

    CLUTTER_UNITS_FROM_EM()

    +
    #define CLUTTER_UNITS_FROM_EM(x)        (clutter_units_em (x))
    +
    +

    +Converts a value in em into ClutterUnits

    @@ -483,17 +498,22 @@

    x :

    - - - + a value in em
    +

    Since 1.0 +


    -

    CLUTTER_UNITS_FROM_PARENT_WIDTH_PERCENTAGE()

    -
    #define             CLUTTER_UNITS_FROM_PARENT_WIDTH_PERCENTAGE(a, x)
    +

    clutter_units_mm ()

    +
    ClutterUnit         clutter_units_mm                    (gdouble mm);
    +

    +Converts a value in millimeters to ClutterUnits at +the current DPI.

    @@ -501,24 +521,30 @@ -

    a :

    - +

    mm :

    + millimeters to convert -

    x :

    - - +

    Returns :

    + the value in units
    +

    Since 1.0 +


    -

    CLUTTER_UNITS_FROM_PARENT_HEIGHT_PERCENTAGE()

    -
    #define             CLUTTER_UNITS_FROM_PARENT_HEIGHT_PERCENTAGE(a, x)
    +

    clutter_units_pt ()

    +
    ClutterUnit         clutter_units_pt                    (gdouble pt);
    +

    +Converts a value in typographic points to ClutterUnits +at the current DPI.

    @@ -526,100 +552,56 @@ -

    a :

    - +

    pt :

    + typographic points to convert -

    x :

    - - +

    Returns :

    + the value in units
    - -
    -
    -

    CLUTTER_UNITS_FROM_MM()

    -
    #define             CLUTTER_UNITS_FROM_MM(x)
    -

    -Converts a value in millimeters into ClutterUnits

    -

    - -

    -
    -- - - - -

    x :

    a value in millimeters -
    -

    Since 0.6 -

    -
    -
    -
    -

    CLUTTER_UNITS_FROM_MMX()

    -
    #define             CLUTTER_UNITS_FROM_MMX(x)
    -

    - +

    Since 1.0

    -
    -- - - - -

    x :

    - - -

    -

    CLUTTER_UNITS_FROM_POINTS()

    -
    #define             CLUTTER_UNITS_FROM_POINTS(x)
    +

    clutter_units_em ()

    +
    ClutterUnit         clutter_units_em                    (gdouble em);

    -Converts a value in typographic points into ClutterUnits

    +Converts a value in em to ClutterUnits at the +current DPI.

    - - - + + + - -

    x :

    a value in typographic points +

    em :

    em to convert
    -

    Since 0.6 -

    -
    -
    -
    -

    CLUTTER_UNITS_FROM_POINTSX()

    -
    #define             CLUTTER_UNITS_FROM_POINTSX(x)
    -

    - -

    -
    -- - - + + + - + +

    x :

    - +

    Returns :

    the value in units
    +

    Since 1.0 +


    CLUTTER_MAXUNIT

    -
    #define CLUTTER_MAXUNIT         (0x7fffffff)
    +
    #define CLUTTER_MAXUNIT         (G_MAXFLOAT)
     

    Higher boundary for a ClutterUnit

    @@ -632,7 +614,7 @@

    CLUTTER_MINUNIT

    -
    #define CLUTTER_MINUNIT         (0x80000000)
    +
    #define CLUTTER_MINUNIT         (-G_MAXFLOAT)
     

    Lower boundary for a ClutterUnit

    diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/clutter-Utilities.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/clutter-Utilities.html --- clutter-0.8.4/doc/reference/clutter/html/clutter-Utilities.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/clutter-Utilities.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ Utilities - + @@ -19,7 +19,7 @@ - + @@ -43,7 +43,7 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next
    Top diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/clutter-Value-intervals.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/clutter-Value-intervals.html --- clutter-0.8.4/doc/reference/clutter/html/clutter-Value-intervals.html 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/html/clutter-Value-intervals.html 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,959 @@ + + + + +Value intervals + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +

    Value intervals

    +

    Value intervals — An object holding an interval of two values

    +
    + +
    +

    Description

    +

    +ClutterInterval is a simple object that can hold two values +defining an interval. ClutterInterval can hold any value that +can be enclosed inside a GValue. +

    +

    +Once a ClutterInterval for a specific GType has been instantiated +the "value-type" property cannot be changed anymore. +

    +

    +ClutterInterval starts with a floating reference; this means that +any object taking a reference on a ClutterInterval instance should +also take ownership of the interval by using g_object_ref_sink(). +

    +

    +ClutterInterval is used by ClutterAnimation to define the +interval of values that an implicit animation should tween over. +

    +

    +ClutterInterval can be subclassed to override the validation +and value computation. +

    +

    +ClutterInterval is available since Clutter 1.0

    +

    + +

    +
    +
    +

    Details

    +
    +

    ClutterInterval

    +
    typedef struct {
    +} ClutterInterval;
    +
    +

    +The ClutterInterval structure contains only private data and should +be accessed using the provided functions.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    ClutterIntervalClass

    +
    typedef struct {
    +  gboolean (* validate)      (ClutterInterval *interval,
    +                              GParamSpec      *pspec);
    +  gboolean (* compute_value) (ClutterInterval *interval,
    +                              gdouble          factor,
    +                              GValue          *value);
    +} ClutterIntervalClass;
    +
    +

    +The ClutterIntervalClass contains only private data.

    +

    + +

    +
    ++ + + + + + + + + + +

    validate ()

    virtual function for validating an interval + using a GParamSpec +

    compute_value ()

    virtual function for computing the value + inside an interval using an adimensional factor between 0 and 1 +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_interval_new ()

    +
    ClutterInterval*    clutter_interval_new                (GType gtype,
    +                                                         ...);
    +

    +Creates a new ClutterInterval holding values of type gtype. +

    +

    +This function avoids using a GValue for the initial and final values +of the interval: +

    +

    +

    +
    +  interval = clutter_interval_new (G_TYPE_FLOAT, 0.0, 1.0);
    +  interval = clutter_interval_new (G_TYPE_BOOLEAN, FALSE, TRUE);
    +  interval = clutter_interval_new (G_TYPE_INT, 0, 360);
    +
    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    gtype :

    the type of the values in the interval +

    ... :

    the initial value and the final value of the interval +

    Returns :

    the newly created ClutterInterval + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_interval_new_with_values ()

    +
    ClutterInterval*    clutter_interval_new_with_values    (GType gtype,
    +                                                         const GValue *initial,
    +                                                         const GValue *final);
    +

    +Creates a new ClutterInterval of type gtype, between initial +and final. +

    +

    +This function is useful for language bindings.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + +

    gtype :

    the type of the values in the interval +

    initial :

    a GValue holding the initial value of the interval +

    final :

    a GValue holding the final value of the interval +

    Returns :

    the newly created ClutterInterval + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_interval_clone ()

    +
    ClutterInterval*    clutter_interval_clone              (ClutterInterval *interval);
    +

    +Creates a copy of interval.

    +

    + +

    +
    ++ + + + + + + + + + +

    interval :

    a ClutterInterval +

    Returns :

    the newly created ClutterInterval + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_interval_get_value_type ()

    +
    GType               clutter_interval_get_value_type     (ClutterInterval *interval);
    +

    +Retrieves the GType of the values inside interval.

    +

    + +

    +
    ++ + + + + + + + + + +

    interval :

    a ClutterInterval +

    Returns :

    the type of the value, or G_TYPE_INVALID + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_interval_set_initial_value ()

    +
    void                clutter_interval_set_initial_value  (ClutterInterval *interval,
    +                                                         const GValue *value);
    +

    +Sets the initial value of interval to value. The value is copied +inside the ClutterInterval.

    +

    + +

    +
    ++ + + + + + + + + + +

    interval :

    a ClutterInterval +

    value :

    a GValue +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_interval_get_initial_value ()

    +
    void                clutter_interval_get_initial_value  (ClutterInterval *interval,
    +                                                         GValue *value);
    +

    +Retrieves the initial value of interval and copies +it into value. +

    +

    +The passed GValue must be initialized to the value held by +the ClutterInterval.

    +

    + +

    +
    ++ + + + + + + + + + +

    interval :

    a ClutterInterval +

    value :

    a GValue +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_interval_peek_initial_value ()

    +
    GValue*             clutter_interval_peek_initial_value (ClutterInterval *interval);
    +

    +Gets the pointer to the initial value of interval

    +

    + +

    +
    ++ + + + + + + + + + +

    interval :

    a ClutterInterval +

    Returns :

    the initial value of the interval. The value + is owned by the ClutterInterval and it should not be + modified or freed + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_interval_set_final_value ()

    +
    void                clutter_interval_set_final_value    (ClutterInterval *interval,
    +                                                         const GValue *value);
    +

    +Sets the final value of interval to value. The value is +copied inside the ClutterInterval.

    +

    + +

    +
    ++ + + + + + + + + + +

    interval :

    a ClutterInterval +

    value :

    a GValue +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_interval_get_final_value ()

    +
    void                clutter_interval_get_final_value    (ClutterInterval *interval,
    +                                                         GValue *value);
    +

    +Retrieves the final value of interval and copies +it into value. +

    +

    +The passed GValue must be initialized to the value held by +the ClutterInterval.

    +

    + +

    +
    ++ + + + + + + + + + +

    interval :

    a ClutterInterval +

    value :

    a GValue +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_interval_peek_final_value ()

    +
    GValue*             clutter_interval_peek_final_value   (ClutterInterval *interval);
    +

    +Gets the pointer to the final value of interval

    +

    + +

    +
    ++ + + + + + + + + + +

    interval :

    a ClutterInterval +

    Returns :

    the final value of the interval. The value + is owned by the ClutterInterval and it should not be + modified or freed + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_interval_set_interval ()

    +
    void                clutter_interval_set_interval       (ClutterInterval *interval,
    +                                                         ...);
    +

    +Variable arguments wrapper for clutter_interval_set_initial_value() +and clutter_interval_set_final_value() that avoids using the +GValue arguments: +

    +

    +

    +
    +  clutter_interval_set_interval (interval, 0, 50);
    +  clutter_interval_set_interval (interval, 1.0, 0.0);
    +  clutter_interval_set_interval (interval, FALSE, TRUE);
    +
    +

    +

    +

    +This function is meant for the convenience of the C API; bindings +should reimplement this function using the GValue-based API.

    +

    + +

    +
    ++ + + + + + + + + + +

    interval :

    a ClutterInterval +

    ... :

    the initial and final values of the interval +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_interval_get_interval ()

    +
    void                clutter_interval_get_interval       (ClutterInterval *interval,
    +                                                         ...);
    +

    +Variable arguments wrapper for clutter_interval_get_initial_value() +and clutter_interval_get_final_value() that avoids using the +GValue arguments: +

    +

    +

    +
    +  gint a = 0, b = 0;
    +  clutter_interval_get_interval (interval, &a, &b);
    +
    +

    +

    +

    +This function is meant for the convenience of the C API; bindings +should reimplement this function using the GValue-based API.

    +

    + +

    +
    ++ + + + + + + + + + +

    interval :

    a ClutterInterval +

    ... :

    return locations for the initial and final values of + the interval +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_interval_compute_value ()

    +
    gboolean            clutter_interval_compute_value      (ClutterInterval *interval,
    +                                                         gdouble factor,
    +                                                         GValue *value);
    +

    +Computes the value between the interval boundaries given the +progress factor and puts it into value.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + +

    interval :

    a ClutterInterval +

    factor :

    the progress factor, between 0 and 1 +

    value :

    return location for an initialized GValue +

    Returns :

    TRUE if the operation was successful + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_interval_validate ()

    +
    gboolean            clutter_interval_validate           (ClutterInterval *interval,
    +                                                         GParamSpec *pspec);
    +

    +Validates the initial and final values of interval against +a GParamSpec.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    interval :

    a ClutterInterval +

    pspec :

    a GParamSpec +

    Returns :

    TRUE if the ClutterInterval is valid, FALSE otherwise + +
    +

    Since 1.0 +

    +
    +
    +
    +

    ClutterProgressFunc ()

    +
    gboolean            (*ClutterProgressFunc)              (const GValue *a,
    +                                                         const GValue *b,
    +                                                         gdouble progress,
    +                                                         GValue *retval);
    +

    +Prototype of the progress function used to compute the value +between the two ends a and b of an interval depending on +the value of progress. +

    +

    +The GValue in retval is already initialized with the same +type as a and b. +

    +

    +This function will be called by ClutterInterval if the +type of the values of the interval was registered using +clutter_interval_register_progress_func().

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + +

    a :

    the initial value of an interval +

    b :

    the final value of an interval +

    progress :

    the progress factor, between 0 and 1 +

    retval :

    the value used to store the progress +

    Returns :

    TRUE if the function successfully computed + the value and stored it inside retval + +
    +

    Since 1.0 +

    +
    +
    +
    +

    clutter_interval_register_progress_func ()

    +
    void                clutter_interval_register_progress_func
    +                                                        (GType value_type,
    +                                                         ClutterProgressFunc func);
    +

    +Sets the progress function for a given value_type, like: +

    +

    +

    +
    +  clutter_interval_register_progress_func (MY_TYPE_FOO,
    +                                           my_foo_progress);
    +
    +

    +

    +

    +Whenever a ClutterInterval instance using the default +"compute_value" implementation is set as an +interval between two GValue of type value_type, it will call +func to establish the value depending on the given progress, +for instance: +

    +

    +

    +
    +  static gboolean
    +  my_int_progress (const GValue *a,
    +                   const GValue *b,
    +                   gdouble       progress,
    +                   GValue       *retval)
    +  {
    +    gint ia = g_value_get_int (a);
    +    gint ib = g_value_get_int (b);
    +    gint res = factor * (ib - ia) + ia;
    +
    +    g_value_set_int (retval, res);
    +
    +    return TRUE;
    +  }
    +
    +  clutter_interval_register_progress_func (G_TYPE_INT, my_int_progress);
    +
    +

    +

    +

    +To unset a previously set progress function of a GType, pass NULL +for func.

    +

    + +

    +
    ++ + + + + + + + + + +

    value_type :

    a GType +

    func :

    a ClutterProgressFunc, or NULL to unset a previously + set progress function +
    +

    Since 1.0 +

    +
    +
    +
    + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/clutter-Versioning-Macros.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/clutter-Versioning-Macros.html --- clutter-0.8.4/doc/reference/clutter/html/clutter-Versioning-Macros.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/clutter-Versioning-Macros.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ Versioning Macros - + @@ -19,7 +19,7 @@ - + @@ -43,7 +43,7 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next
    Top @@ -98,7 +98,7 @@

    CLUTTER_MINOR_VERSION

    -
    #define CLUTTER_MINOR_VERSION   (8)
    +
    #define CLUTTER_MINOR_VERSION   (9)
     

    The minor version of the Clutter library (2, if CLUTTER_VERSION is 1.2.3)

    @@ -109,7 +109,7 @@

    CLUTTER_MICRO_VERSION

    -
    #define CLUTTER_MICRO_VERSION   (4)
    +
    #define CLUTTER_MICRO_VERSION   (0)
     

    The micro version of the Clutter library (3, if CLUTTER_VERSION is 1.2.3)

    @@ -120,7 +120,7 @@

    CLUTTER_VERSION

    -
    #define CLUTTER_VERSION         0.8.4
    +
    #define CLUTTER_VERSION         0.9.0
     

    The full version of the Clutter library, like 1.2.3

    @@ -131,7 +131,7 @@

    CLUTTER_VERSION_S

    -
    #define CLUTTER_VERSION_S       "0.8.4"
    +
    #define CLUTTER_VERSION_S       "0.9.0"
     

    The full version of the Clutter library, in string form (suited for diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/clutter-Win32-Specific-Support.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/clutter-Win32-Specific-Support.html --- clutter-0.8.4/doc/reference/clutter/html/clutter-Win32-Specific-Support.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/clutter-Win32-Specific-Support.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ Win32 Specific Support - + @@ -19,7 +19,7 @@ - + @@ -43,7 +43,7 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next Top diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/clutter-X11-Specific-Support.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/clutter-X11-Specific-Support.html --- clutter-0.8.4/doc/reference/clutter/html/clutter-X11-Specific-Support.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/clutter-X11-Specific-Support.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ X11 Specific Support - + @@ -19,7 +19,7 @@ - + @@ -43,7 +43,7 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next Top @@ -250,8 +250,13 @@

    Returns :

    - ClutterX11FilterReturn indicating what the caller - should do with the original event. + ClutterX11FilterReturn. CLUTTER_X11_FILTER_REMOVE + indicates that Clutter has internally handled the event and the + caller should do no further processing. CLUTTER_X11_FILTER_CONTINUE + indicates that Clutter is either not interested in the event, + or has used the event to update internal state without taking + any exclusive action. CLUTTER_X11_FILTER_TRANSLATE will not + occur. diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/creating-your-own-behaviours.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/creating-your-own-behaviours.html --- clutter-0.8.4/doc/reference/clutter/html/creating-your-own-behaviours.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/creating-your-own-behaviours.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ Creating You Own Behaviours - + @@ -19,7 +19,7 @@ - + @@ -42,7 +42,7 @@ Prev Up Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next
    @@ -77,7 +77,7 @@

    -

    Example 11. 

    +

    Example 13. 

    This example demonstrates a behaviour that produces a vertical 'wipe' like affect by modifying the actors clip region

    Binary files /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/easing-modes.png and /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/easing-modes.png differ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/index.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/index.html --- clutter-0.8.4/doc/reference/clutter/html/index.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/index.html 2009-01-30 12:41:02.000000000 +0000 @@ -2,9 +2,9 @@ -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual - + @@ -17,7 +17,7 @@ - + @@ -39,11 +39,12 @@
    -
    -

    Version 0.8.4

    -
    +
    +

    Version 0.9.0

    +
    +
    -

    +

    Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later @@ -84,7 +85,7 @@ ClutterChildMeta — Wrapper for actors inside a container

    -ClutterMedia — An interface for controlling playback of media data. +ClutterMedia — An interface for controlling playback of media data
    Base actors
    @@ -96,14 +97,13 @@ ClutterTexture — An actor for displaying and manipulating images.
    -ClutterCloneTexture — Actor for cloning existing textures in an -efficient way. +ClutterClone
    -ClutterLabel — Actor for displaying text +ClutterText — An actor for displaying and editing text
    -ClutterEntry — A single line text entry actor +ClutterCairoTexture — Texture with Cairo integration
    Container actors
    @@ -138,9 +138,6 @@
    Behaviours
    -ClutterBehaviourBspline — A behaviour interpolating position along a B-Spline -
    -
    ClutterBehaviourDepth — A behaviour controlling the Z position
    @@ -150,7 +147,11 @@ ClutterBehaviourOpacity — Behaviour controlling the opacity
    -ClutterBehaviourPath — A behaviour interpolating position along a path +ClutterBehaviourPath — A behaviour for moving actors along a ClutterPath +
    +
    +ClutterPath — An object describing a path with straight lines +and bezier curves.
    ClutterBehaviourRotate — A behaviour controlling rotation @@ -159,10 +160,18 @@ ClutterBehaviourScale — A behaviour controlling scale
    -
    Simple effects API
    -
    -Clutter Effects — Utility Class for basic visual effects -
    +
    High Level API
    +
    +
    +Value intervals — An object holding an interval of two values +
    +
    +Implicit Animations — Simple implicit animations +
    +
    +ClutterAnimatable — Interface for animatable classes +
    +
    V. Clutter Tools
    @@ -172,6 +181,9 @@ Colors — Color management and manipulation.
    +Key Bindings — Pool for key bindings +
    +
    Events — User and window system events
    @@ -199,7 +211,7 @@ ClutterScript — Loads a scene from UI definition data
    -ClutterScriptable — Override the UI definition parsing +ClutterScriptable — Override the UI definition parsing
    Generic list model
    @@ -235,7 +247,7 @@
    Basic Animations
    Timelines
    Behaviours
    -
    Effects
    +
    Implicit Animations
    Conclusion
    Creating You Own Behaviours
    diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/index.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/index.sgml --- clutter-0.8.4/doc/reference/clutter/html/index.sgml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/index.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -60,7 +60,9 @@ + + @@ -83,7 +85,11 @@ + + + + @@ -91,12 +97,14 @@ + + @@ -104,6 +112,8 @@ + + @@ -118,6 +128,8 @@ + + @@ -128,12 +140,12 @@ - - - - + + + + @@ -161,6 +173,10 @@ + + + + @@ -184,6 +200,7 @@ + @@ -237,27 +254,27 @@ - + - - - - + + + + - + - + + - + - @@ -311,132 +328,147 @@ + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -482,12 +514,11 @@ + - - @@ -518,6 +549,7 @@ + @@ -613,41 +645,22 @@ + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -674,27 +687,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -778,20 +770,60 @@ - - - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -842,30 +874,70 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -888,6 +960,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -932,7 +1024,6 @@ - @@ -954,7 +1045,6 @@ - @@ -962,30 +1052,18 @@ - - - - - - - - - - - - + + + - - - @@ -1018,8 +1096,10 @@ - - + + + + @@ -1058,7 +1138,23 @@ + + + + + + + + + + + + + + + + @@ -1069,26 +1165,23 @@ - - - - + + + + + - - - - - - - - + + + + @@ -1147,16 +1240,18 @@ - - - - - - - - - - + + + + + + + + + + + + @@ -1236,14 +1331,16 @@ - - + - + + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ix01.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ix01.html --- clutter-0.8.4/doc/reference/clutter/html/ix01.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ix01.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,8 +4,8 @@ Index - - + + @@ -19,7 +19,7 @@ - + @@ -42,12 +42,12 @@ Prev   Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next

    -Index

    +Index

    C

    @@ -79,8 +79,6 @@
    CFX_PI_4, CFX_PI_4
    -
    CFX_Q, CFX_Q -
    CFX_RADIANS_TO_DEGREES, CFX_RADIANS_TO_DEGREES
    ClutterActor, ClutterActor @@ -115,6 +113,8 @@
    ClutterActor::parent-set, The "parent-set" signal
    +
    ClutterActor::pick, The "pick" signal +
    ClutterActor::realize, The "realize" signal
    ClutterActor::scroll-event, The "scroll-event" signal @@ -125,6 +125,8 @@
    ClutterActor:allocation, The "allocation" property
    +
    ClutterActor:anchor-gravity, The "anchor-gravity" property +
    ClutterActor:anchor-x, The "anchor-x" property
    ClutterActor:anchor-y, The "anchor-y" property @@ -179,6 +181,14 @@
    ClutterActor:rotation-center-z, The "rotation-center-z" property
    +
    ClutterActor:rotation-center-z-gravity, The "rotation-center-z-gravity" property +
    +
    ClutterActor:scale-center-x, The "scale-center-x" property +
    +
    ClutterActor:scale-center-y, The "scale-center-y" property +
    +
    ClutterActor:scale-gravity, The "scale-gravity" property +
    ClutterActor:scale-x, The "scale-x" property
    ClutterActor:scale-y, The "scale-y" property @@ -203,6 +213,8 @@
    ClutterAlpha:alpha, The "alpha" property
    +
    ClutterAlpha:mode, The "mode" property +
    ClutterAlpha:timeline, The "timeline" property
    ClutterAlphaClass, ClutterAlphaClass @@ -211,6 +223,16 @@
    ClutterAngle, ClutterAngle
    +
    ClutterAnimatable, ClutterAnimatable +
    +
    ClutterAnimatableIface, ClutterAnimatableIface +
    +
    ClutterAnimation, ClutterAnimation +
    +
    ClutterAnimationClass, ClutterAnimationClass +
    +
    ClutterAnimationMode, enum ClutterAnimationMode +
    ClutterBehaviour, ClutterBehaviour
    ClutterBehaviour::applied, The "applied" signal @@ -219,12 +241,6 @@
    ClutterBehaviour:alpha, The "alpha" property
    -
    ClutterBehaviourBspline, ClutterBehaviourBspline -
    -
    ClutterBehaviourBspline::knot-reached, The "knot-reached" signal -
    -
    ClutterBehaviourBsplineClass, ClutterBehaviourBsplineClass -
    ClutterBehaviourClass, ClutterBehaviourClass
    ClutterBehaviourDepth, ClutterBehaviourDepth @@ -271,7 +287,7 @@
    ClutterBehaviourPath::knot-reached, The "knot-reached" signal
    -
    ClutterBehaviourPath:knot, The "knot" property +
    ClutterBehaviourPath:path, The "path" property
    ClutterBehaviourPathClass, ClutterBehaviourPathClass
    @@ -305,8 +321,20 @@
    ClutterBehaviourScaleClass, ClutterBehaviourScaleClass
    +
    ClutterBindingActionFunc, ClutterBindingActionFunc () +
    +
    ClutterBindingPool, ClutterBindingPool +
    ClutterButtonEvent, ClutterButtonEvent
    +
    ClutterCairoTexture, ClutterCairoTexture +
    +
    ClutterCairoTexture:surface-height, The "surface-height" property +
    +
    ClutterCairoTexture:surface-width, The "surface-width" property +
    +
    ClutterCairoTextureClass, ClutterCairoTextureClass +
    ClutterCallback, ClutterCallback ()
    ClutterChildMeta, ClutterChildMeta @@ -317,15 +345,11 @@
    ClutterChildMetaClass, ClutterChildMetaClass
    -
    ClutterCloneTexture, ClutterCloneTexture -
    -
    ClutterCloneTexture:parent-texture, The "parent-texture" property -
    -
    ClutterCloneTexture:repeat-x, The "repeat-x" property +
    ClutterClone, ClutterClone
    -
    ClutterCloneTexture:repeat-y, The "repeat-y" property +
    ClutterClone:source, The "source" property
    -
    ClutterCloneTextureClass, ClutterCloneTextureClass +
    ClutterCloneClass, ClutterCloneClass
    ClutterColor, ClutterColor
    @@ -335,42 +359,6 @@
    ClutterCrossingEvent, ClutterCrossingEvent
    -
    ClutterEffectCompleteFunc, ClutterEffectCompleteFunc () -
    -
    ClutterEffectTemplate, ClutterEffectTemplate -
    -
    ClutterEffectTemplateClass, ClutterEffectTemplateClass -
    -
    ClutterEntry, ClutterEntry -
    -
    ClutterEntry::activate, The "activate" signal -
    -
    ClutterEntry::cursor-event, The "cursor-event" signal -
    -
    ClutterEntry::text-changed, The "text-changed" signal -
    -
    ClutterEntry:alignment, The "alignment" property -
    -
    ClutterEntry:color, The "color" property -
    -
    ClutterEntry:cursor-visible, The "cursor-visible" property -
    -
    ClutterEntry:entry-padding, The "entry-padding" property -
    -
    ClutterEntry:font-name, The "font-name" property -
    -
    ClutterEntry:max-length, The "max-length" property -
    -
    ClutterEntry:position, The "position" property -
    -
    ClutterEntry:text, The "text" property -
    -
    ClutterEntry:text-visible, The "text-visible" property -
    -
    ClutterEntry:x-align, The "x-align" property -
    -
    ClutterEntryClass, ClutterEntryClass -
    ClutterEvent, union ClutterEvent
    ClutterEventFlags, enum ClutterEventFlags @@ -381,6 +369,8 @@
    ClutterFog, ClutterFog
    +
    ClutterFontFlags, enum ClutterFontFlags +
    ClutterGeometry, ClutterGeometry
    ClutterGravity, enum ClutterGravity @@ -397,33 +387,13 @@
    ClutterInputDevice, ClutterInputDevice
    -
    ClutterKeyEvent, ClutterKeyEvent -
    -
    ClutterKnot, ClutterKnot -
    -
    ClutterLabel, ClutterLabel -
    -
    ClutterLabel:alignment, The "alignment" property +
    ClutterInterval, ClutterInterval
    -
    ClutterLabel:attributes, The "attributes" property +
    ClutterIntervalClass, ClutterIntervalClass
    -
    ClutterLabel:color, The "color" property -
    -
    ClutterLabel:ellipsize, The "ellipsize" property -
    -
    ClutterLabel:font-name, The "font-name" property -
    -
    ClutterLabel:justify, The "justify" property -
    -
    ClutterLabel:text, The "text" property -
    -
    ClutterLabel:use-markup, The "use-markup" property -
    -
    ClutterLabel:wrap, The "wrap" property -
    -
    ClutterLabel:wrap-mode, The "wrap-mode" property +
    ClutterKeyEvent, ClutterKeyEvent
    -
    ClutterLabelClass, ClutterLabelClass +
    ClutterKnot, ClutterKnot
    ClutterListModel, ClutterListModel
    @@ -433,7 +403,9 @@
    ClutterMedia::error, The "error" signal
    -
    ClutterMedia:buffer-percent, The "buffer-percent" property +
    ClutterMedia:audio-volume, The "audio-volume" property +
    +
    ClutterMedia:buffer-fill, The "buffer-fill" property
    ClutterMedia:can-seek, The "can-seek" property
    @@ -441,13 +413,11 @@
    ClutterMedia:playing, The "playing" property
    -
    ClutterMedia:position, The "position" property +
    ClutterMedia:progress, The "progress" property
    ClutterMedia:uri, The "uri" property
    -
    ClutterMedia:volume, The "volume" property -
    -
    ClutterMediaInterface, ClutterMediaInterface +
    ClutterMediaIface, ClutterMediaIface
    ClutterModel, ClutterModel
    @@ -487,8 +457,24 @@
    ClutterParamSpecUnit, ClutterParamSpecUnit
    +
    ClutterPath, ClutterPath +
    +
    ClutterPath:description, The "description" property +
    +
    ClutterPath:length, The "length" property +
    +
    ClutterPathCallback, ClutterPathCallback () +
    +
    ClutterPathClass, ClutterPathClass +
    +
    ClutterPathNode, ClutterPathNode +
    +
    ClutterPathNodeType, enum ClutterPathNodeType +
    ClutterPerspective, ClutterPerspective
    +
    ClutterProgressFunc, ClutterProgressFunc () +
    ClutterRectangle, ClutterRectangle
    ClutterRectangle:border-color, The "border-color" property @@ -529,9 +515,9 @@
    ClutterScript:filename-set, The "filename-set" property
    -
    ClutterScriptable, ClutterScriptable +
    ClutterScriptable, ClutterScriptable
    -
    ClutterScriptableIface, ClutterScriptableIface +
    ClutterScriptableIface, ClutterScriptableIface
    ClutterScriptClass, ClutterScriptClass
    @@ -557,6 +543,12 @@
    ClutterShaderError, enum ClutterShaderError
    +
    ClutterShaderFloat, ClutterShaderFloat +
    +
    ClutterShaderInt, ClutterShaderInt +
    +
    ClutterShaderMatrix, ClutterShaderMatrix +
    ClutterStage, ClutterStage
    ClutterStage::activate, The "activate" signal @@ -565,6 +557,8 @@
    ClutterStage::fullscreen, The "fullscreen" signal
    +
    ClutterStage::queue-redraw, The "queue-redraw" signal +
    ClutterStage::unfullscreen, The "unfullscreen" signal
    ClutterStage:color, The "color" property @@ -589,8 +583,64 @@
    ClutterStageStateEvent, ClutterStageStateEvent
    +
    ClutterText, ClutterText +
    +
    ClutterText::activate, The "activate" signal +
    +
    ClutterText::cursor-event, The "cursor-event" signal +
    +
    ClutterText::text-changed, The "text-changed" signal +
    +
    ClutterText:activatable, The "activatable" property +
    +
    ClutterText:alignment, The "alignment" property +
    +
    ClutterText:attributes, The "attributes" property +
    +
    ClutterText:color, The "color" property +
    +
    ClutterText:cursor-color, The "cursor-color" property +
    +
    ClutterText:cursor-color-set, The "cursor-color-set" property +
    +
    ClutterText:cursor-size, The "cursor-size" property +
    +
    ClutterText:cursor-visible, The "cursor-visible" property +
    +
    ClutterText:editable, The "editable" property +
    +
    ClutterText:ellipsize, The "ellipsize" property +
    +
    ClutterText:font-name, The "font-name" property +
    +
    ClutterText:justify, The "justify" property +
    +
    ClutterText:line-wrap, The "line-wrap" property +
    +
    ClutterText:line-wrap-mode, The "line-wrap-mode" property +
    +
    ClutterText:max-length, The "max-length" property +
    +
    ClutterText:password-char, The "password-char" property +
    +
    ClutterText:position, The "position" property +
    +
    ClutterText:selectable, The "selectable" property +
    +
    ClutterText:selection-bound, The "selection-bound" property +
    +
    ClutterText:single-line-mode, The "single-line-mode" property +
    +
    ClutterText:text, The "text" property +
    +
    ClutterText:use-markup, The "use-markup" property +
    +
    ClutterTextClass, ClutterTextClass +
    ClutterTexture, ClutterTexture
    +
    ClutterTexture::load-finished, The "load-finished" signal +
    ClutterTexture::pixbuf-change, The "pixbuf-change" signal
    ClutterTexture::size-change, The "size-change" signal @@ -605,6 +655,8 @@
    ClutterTexture:keep-aspect-ratio, The "keep-aspect-ratio" property
    +
    ClutterTexture:load-async, The "load-async" property +
    ClutterTexture:pixel-format, The "pixel-format" property
    ClutterTexture:repeat-x, The "repeat-x" property @@ -669,12 +721,20 @@
    clutter_actor_allocate_preferred_size, clutter_actor_allocate_preferred_size ()
    +
    clutter_actor_animate, clutter_actor_animate () +
    +
    clutter_actor_animate_with_alpha, clutter_actor_animate_with_alpha () +
    +
    clutter_actor_animate_with_timeline, clutter_actor_animate_with_timeline () +
    clutter_actor_apply_relative_transform_to_point, clutter_actor_apply_relative_transform_to_point ()
    clutter_actor_apply_transform_to_point, clutter_actor_apply_transform_to_point ()
    clutter_actor_box_get_from_vertices, clutter_actor_box_get_from_vertices ()
    +
    clutter_actor_create_pango_context, clutter_actor_create_pango_context () +
    clutter_actor_destroy, clutter_actor_destroy ()
    clutter_actor_event, clutter_actor_event () @@ -693,6 +753,8 @@
    clutter_actor_get_anchor_pointu, clutter_actor_get_anchor_pointu ()
    +
    clutter_actor_get_anchor_point_gravity, clutter_actor_get_anchor_point_gravity () +
    clutter_actor_get_clip, clutter_actor_get_clip ()
    clutter_actor_get_clipu, clutter_actor_get_clipu () @@ -717,6 +779,10 @@
    clutter_actor_get_paint_opacity, clutter_actor_get_paint_opacity ()
    +
    clutter_actor_get_paint_visibility, clutter_actor_get_paint_visibility () +
    +
    clutter_actor_get_pango_context, clutter_actor_get_pango_context () +
    clutter_actor_get_parent, clutter_actor_get_parent ()
    clutter_actor_get_position, clutter_actor_get_position () @@ -735,11 +801,13 @@
    clutter_actor_get_rotationu, clutter_actor_get_rotationu ()
    -
    clutter_actor_get_rotationx, clutter_actor_get_rotationx () -
    clutter_actor_get_scale, clutter_actor_get_scale ()
    -
    clutter_actor_get_scalex, clutter_actor_get_scalex () +
    clutter_actor_get_scale_center, clutter_actor_get_scale_center () +
    +
    clutter_actor_get_scale_centeru, clutter_actor_get_scale_centeru () +
    +
    clutter_actor_get_scale_gravity, clutter_actor_get_scale_gravity ()
    clutter_actor_get_shader, clutter_actor_get_shader ()
    @@ -769,6 +837,10 @@
    clutter_actor_get_yu, clutter_actor_get_yu ()
    +
    clutter_actor_get_z_rotation_gravity, clutter_actor_get_z_rotation_gravity () +
    +
    clutter_actor_grab_key_focus, clutter_actor_grab_key_focus () +
    clutter_actor_has_clip, clutter_actor_has_clip ()
    clutter_actor_hide, clutter_actor_hide () @@ -859,16 +931,22 @@
    clutter_actor_set_rotationu, clutter_actor_set_rotationu ()
    -
    clutter_actor_set_rotationx, clutter_actor_set_rotationx () -
    clutter_actor_set_scale, clutter_actor_set_scale ()
    -
    clutter_actor_set_scalex, clutter_actor_set_scalex () +
    clutter_actor_set_scale_full, clutter_actor_set_scale_full () +
    +
    clutter_actor_set_scale_fullu, clutter_actor_set_scale_fullu () +
    +
    clutter_actor_set_scale_with_gravity, clutter_actor_set_scale_with_gravity ()
    clutter_actor_set_shader, clutter_actor_set_shader ()
    clutter_actor_set_shader_param, clutter_actor_set_shader_param ()
    +
    clutter_actor_set_shader_param_float, clutter_actor_set_shader_param_float () +
    +
    clutter_actor_set_shader_param_int, clutter_actor_set_shader_param_int () +
    clutter_actor_set_size, clutter_actor_set_size ()
    clutter_actor_set_sizeu, clutter_actor_set_sizeu () @@ -885,6 +963,8 @@
    clutter_actor_set_yu, clutter_actor_set_yu ()
    +
    clutter_actor_set_z_rotation_from_gravity, clutter_actor_set_z_rotation_from_gravity () +
    clutter_actor_should_pick_paint, clutter_actor_should_pick_paint ()
    clutter_actor_show, clutter_actor_show () @@ -899,103 +979,105 @@
    CLUTTER_ACTOR_UNSET_FLAGS, CLUTTER_ACTOR_UNSET_FLAGS()
    -
    CLUTTER_ALPHA_EXP_DEC, CLUTTER_ALPHA_EXP_DEC -
    -
    CLUTTER_ALPHA_EXP_INC, CLUTTER_ALPHA_EXP_INC -
    clutter_alpha_get_alpha, clutter_alpha_get_alpha ()
    -
    clutter_alpha_get_timeline, clutter_alpha_get_timeline () +
    clutter_alpha_get_mode, clutter_alpha_get_mode ()
    -
    CLUTTER_ALPHA_MAX_ALPHA, CLUTTER_ALPHA_MAX_ALPHA +
    clutter_alpha_get_timeline, clutter_alpha_get_timeline ()
    clutter_alpha_new, clutter_alpha_new ()
    clutter_alpha_new_full, clutter_alpha_new_full ()
    -
    CLUTTER_ALPHA_RAMP, CLUTTER_ALPHA_RAMP +
    clutter_alpha_new_with_func, clutter_alpha_new_with_func ()
    -
    CLUTTER_ALPHA_RAMP_DEC, CLUTTER_ALPHA_RAMP_DEC +
    clutter_alpha_register_closure, clutter_alpha_register_closure ()
    -
    CLUTTER_ALPHA_RAMP_INC, CLUTTER_ALPHA_RAMP_INC +
    clutter_alpha_register_func, clutter_alpha_register_func ()
    clutter_alpha_set_closure, clutter_alpha_set_closure ()
    clutter_alpha_set_func, clutter_alpha_set_func ()
    +
    clutter_alpha_set_mode, clutter_alpha_set_mode () +
    clutter_alpha_set_timeline, clutter_alpha_set_timeline ()
    -
    CLUTTER_ALPHA_SINE, CLUTTER_ALPHA_SINE +
    CLUTTER_ANGLE_FROM_DEG, CLUTTER_ANGLE_FROM_DEG()
    -
    CLUTTER_ALPHA_SINE_DEC, CLUTTER_ALPHA_SINE_DEC +
    CLUTTER_ANGLE_FROM_DEGX, CLUTTER_ANGLE_FROM_DEGX()
    -
    CLUTTER_ALPHA_SINE_HALF, CLUTTER_ALPHA_SINE_HALF +
    CLUTTER_ANGLE_MAX_DEG, CLUTTER_ANGLE_MAX_DEG
    -
    CLUTTER_ALPHA_SINE_INC, CLUTTER_ALPHA_SINE_INC +
    CLUTTER_ANGLE_TO_DEG, CLUTTER_ANGLE_TO_DEG()
    -
    CLUTTER_ALPHA_SMOOTHSTEP_DEC, CLUTTER_ALPHA_SMOOTHSTEP_DEC +
    CLUTTER_ANGLE_TO_DEGX, CLUTTER_ANGLE_TO_DEGX()
    -
    CLUTTER_ALPHA_SMOOTHSTEP_INC, CLUTTER_ALPHA_SMOOTHSTEP_INC +
    clutter_animatable_animate_property, clutter_animatable_animate_property ()
    -
    CLUTTER_ALPHA_SQUARE, CLUTTER_ALPHA_SQUARE +
    clutter_animation_bind_property, clutter_animation_bind_property ()
    -
    CLUTTER_ANGLE_FROM_DEG, CLUTTER_ANGLE_FROM_DEG() +
    clutter_animation_get_alpha, clutter_animation_get_alpha ()
    -
    CLUTTER_ANGLE_FROM_DEGF, CLUTTER_ANGLE_FROM_DEGF() +
    clutter_animation_get_duration, clutter_animation_get_duration ()
    -
    CLUTTER_ANGLE_FROM_DEGX, CLUTTER_ANGLE_FROM_DEGX() +
    clutter_animation_get_interval, clutter_animation_get_interval ()
    -
    CLUTTER_ANGLE_MAX_DEG, CLUTTER_ANGLE_MAX_DEG +
    clutter_animation_get_loop, clutter_animation_get_loop ()
    -
    CLUTTER_ANGLE_TO_DEG, CLUTTER_ANGLE_TO_DEG() +
    clutter_animation_get_mode, clutter_animation_get_mode ()
    -
    CLUTTER_ANGLE_TO_DEGF, CLUTTER_ANGLE_TO_DEGF() +
    clutter_animation_get_object, clutter_animation_get_object ()
    -
    CLUTTER_ANGLE_TO_DEGX, CLUTTER_ANGLE_TO_DEGX() +
    clutter_animation_get_timeline, clutter_animation_get_timeline ()
    -
    clutter_atan2i, clutter_atan2i () +
    clutter_animation_has_property, clutter_animation_has_property ()
    -
    clutter_atani, clutter_atani () +
    clutter_animation_new, clutter_animation_new ()
    -
    clutter_backend_get_double_click_distance, clutter_backend_get_double_click_distance () +
    clutter_animation_set_alpha, clutter_animation_set_alpha ()
    -
    clutter_backend_get_double_click_time, clutter_backend_get_double_click_time () +
    clutter_animation_set_duration, clutter_animation_set_duration ()
    -
    clutter_backend_get_font_options, clutter_backend_get_font_options () +
    clutter_animation_set_loop, clutter_animation_set_loop ()
    -
    clutter_backend_get_resolution, clutter_backend_get_resolution () +
    clutter_animation_set_mode, clutter_animation_set_mode ()
    -
    clutter_backend_set_double_click_distance, clutter_backend_set_double_click_distance () +
    clutter_animation_set_object, clutter_animation_set_object ()
    -
    clutter_backend_set_double_click_time, clutter_backend_set_double_click_time () +
    clutter_animation_set_timeline, clutter_animation_set_timeline ()
    -
    clutter_backend_set_font_options, clutter_backend_set_font_options () +
    clutter_animation_unbind_property, clutter_animation_unbind_property ()
    -
    clutter_backend_set_resolution, clutter_backend_set_resolution () +
    clutter_animation_update_property, clutter_animation_update_property ()
    -
    clutter_behaviour_actors_foreach, clutter_behaviour_actors_foreach () +
    clutter_atan2x, clutter_atan2x()
    -
    clutter_behaviour_apply, clutter_behaviour_apply () +
    clutter_atanx, clutter_atanx() +
    +
    clutter_backend_get_double_click_distance, clutter_backend_get_double_click_distance ()
    -
    clutter_behaviour_bspline_adjust, clutter_behaviour_bspline_adjust () +
    clutter_backend_get_double_click_time, clutter_backend_get_double_click_time () +
    +
    clutter_backend_get_font_name, clutter_backend_get_font_name ()
    -
    clutter_behaviour_bspline_append_knot, clutter_behaviour_bspline_append_knot () +
    clutter_backend_get_font_options, clutter_backend_get_font_options ()
    -
    clutter_behaviour_bspline_append_knots, clutter_behaviour_bspline_append_knots () +
    clutter_backend_get_resolution, clutter_backend_get_resolution ()
    -
    clutter_behaviour_bspline_clear, clutter_behaviour_bspline_clear () +
    clutter_backend_set_double_click_distance, clutter_backend_set_double_click_distance ()
    -
    clutter_behaviour_bspline_get_origin, clutter_behaviour_bspline_get_origin () +
    clutter_backend_set_double_click_time, clutter_backend_set_double_click_time ()
    -
    clutter_behaviour_bspline_join, clutter_behaviour_bspline_join () +
    clutter_backend_set_font_name, clutter_backend_set_font_name ()
    -
    clutter_behaviour_bspline_new, clutter_behaviour_bspline_new () +
    clutter_backend_set_font_options, clutter_backend_set_font_options ()
    -
    clutter_behaviour_bspline_set_origin, clutter_behaviour_bspline_set_origin () +
    clutter_backend_set_resolution, clutter_backend_set_resolution ()
    -
    clutter_behaviour_bspline_split, clutter_behaviour_bspline_split () +
    clutter_behaviour_actors_foreach, clutter_behaviour_actors_foreach ()
    -
    clutter_behaviour_bspline_truncate, clutter_behaviour_bspline_truncate () +
    clutter_behaviour_apply, clutter_behaviour_apply ()
    clutter_behaviour_depth_get_bounds, clutter_behaviour_depth_get_bounds ()
    @@ -1071,19 +1153,15 @@
    clutter_behaviour_opacity_set_bounds, clutter_behaviour_opacity_set_bounds ()
    -
    clutter_behaviour_path_append_knot, clutter_behaviour_path_append_knot () -
    -
    clutter_behaviour_path_append_knots, clutter_behaviour_path_append_knots () -
    -
    clutter_behaviour_path_clear, clutter_behaviour_path_clear () +
    clutter_behaviour_path_get_path, clutter_behaviour_path_get_path ()
    -
    clutter_behaviour_path_get_knots, clutter_behaviour_path_get_knots () +
    clutter_behaviour_path_new, clutter_behaviour_path_new ()
    -
    clutter_behaviour_path_insert_knot, clutter_behaviour_path_insert_knot () +
    clutter_behaviour_path_new_with_description, clutter_behaviour_path_new_with_description ()
    -
    clutter_behaviour_path_new, clutter_behaviour_path_new () +
    clutter_behaviour_path_new_with_knots, clutter_behaviour_path_new_with_knots ()
    -
    clutter_behaviour_path_remove_knot, clutter_behaviour_path_remove_knot () +
    clutter_behaviour_path_set_path, clutter_behaviour_path_set_path ()
    clutter_behaviour_remove, clutter_behaviour_remove ()
    @@ -1127,8 +1205,44 @@
    clutter_behaviour_set_alpha, clutter_behaviour_set_alpha ()
    +
    clutter_binding_pool_activate, clutter_binding_pool_activate () +
    +
    clutter_binding_pool_block_action, clutter_binding_pool_block_action () +
    +
    clutter_binding_pool_find, clutter_binding_pool_find () +
    +
    clutter_binding_pool_find_action, clutter_binding_pool_find_action () +
    +
    clutter_binding_pool_get_for_class, clutter_binding_pool_get_for_class () +
    +
    clutter_binding_pool_install_action, clutter_binding_pool_install_action () +
    +
    clutter_binding_pool_install_closure, clutter_binding_pool_install_closure () +
    +
    clutter_binding_pool_new, clutter_binding_pool_new () +
    +
    clutter_binding_pool_override_action, clutter_binding_pool_override_action () +
    +
    clutter_binding_pool_override_closure, clutter_binding_pool_override_closure () +
    +
    clutter_binding_pool_remove_action, clutter_binding_pool_remove_action () +
    +
    clutter_binding_pool_unblock_action, clutter_binding_pool_unblock_action () +
    clutter_button_event_button, clutter_button_event_button ()
    +
    clutter_cairo_set_source_color, clutter_cairo_set_source_color () +
    +
    clutter_cairo_texture_create, clutter_cairo_texture_create () +
    +
    clutter_cairo_texture_create_region, clutter_cairo_texture_create_region () +
    +
    clutter_cairo_texture_get_surface_size, clutter_cairo_texture_get_surface_size () +
    +
    clutter_cairo_texture_new, clutter_cairo_texture_new () +
    +
    clutter_cairo_texture_set_surface_size, clutter_cairo_texture_set_surface_size () +
    CLUTTER_CALLBACK, CLUTTER_CALLBACK()
    CLUTTER_CHECK_VERSION, CLUTTER_CHECK_VERSION() @@ -1139,11 +1253,11 @@
    clutter_clear_glyph_cache, clutter_clear_glyph_cache ()
    -
    clutter_clone_texture_get_parent_texture, clutter_clone_texture_get_parent_texture () +
    clutter_clone_get_source, clutter_clone_get_source ()
    -
    clutter_clone_texture_new, clutter_clone_texture_new () +
    clutter_clone_new, clutter_clone_new ()
    -
    clutter_clone_texture_set_parent_texture, clutter_clone_texture_set_parent_texture () +
    clutter_clone_set_source, clutter_clone_set_source ()
    CLUTTER_COGL, CLUTTER_COGL
    @@ -1165,6 +1279,8 @@
    clutter_color_lighten, clutter_color_lighten ()
    +
    clutter_color_new, clutter_color_new () +
    clutter_color_parse, clutter_color_parse ()
    clutter_color_shade, clutter_color_shade () @@ -1219,92 +1335,12 @@
    clutter_container_sort_depth_order, clutter_container_sort_depth_order ()
    -
    clutter_cosi, clutter_cosi() -
    clutter_cosx, clutter_cosx()
    CLUTTER_CURRENT_TIME, CLUTTER_CURRENT_TIME
    clutter_do_event, clutter_do_event ()
    -
    clutter_effect_depth, clutter_effect_depth () -
    -
    clutter_effect_fade, clutter_effect_fade () -
    -
    clutter_effect_move, clutter_effect_move () -
    -
    clutter_effect_path, clutter_effect_path () -
    -
    clutter_effect_rotate, clutter_effect_rotate () -
    -
    clutter_effect_scale, clutter_effect_scale () -
    -
    clutter_effect_template_construct, clutter_effect_template_construct () -
    -
    clutter_effect_template_get_timeline_clone, clutter_effect_template_get_timeline_clone () -
    -
    clutter_effect_template_new, clutter_effect_template_new () -
    -
    clutter_effect_template_new_for_duration, clutter_effect_template_new_for_duration () -
    -
    clutter_effect_template_new_full, clutter_effect_template_new_full () -
    -
    clutter_effect_template_set_timeline_clone, clutter_effect_template_set_timeline_clone () -
    -
    clutter_entry_delete_chars, clutter_entry_delete_chars () -
    -
    clutter_entry_delete_text, clutter_entry_delete_text () -
    -
    clutter_entry_get_alignment, clutter_entry_get_alignment () -
    -
    clutter_entry_get_color, clutter_entry_get_color () -
    -
    clutter_entry_get_cursor_position, clutter_entry_get_cursor_position () -
    -
    clutter_entry_get_font_name, clutter_entry_get_font_name () -
    -
    clutter_entry_get_invisible_char, clutter_entry_get_invisible_char () -
    -
    clutter_entry_get_layout, clutter_entry_get_layout () -
    -
    clutter_entry_get_max_length, clutter_entry_get_max_length () -
    -
    clutter_entry_get_text, clutter_entry_get_text () -
    -
    clutter_entry_get_visibility, clutter_entry_get_visibility () -
    -
    clutter_entry_get_visible_cursor, clutter_entry_get_visible_cursor () -
    -
    clutter_entry_handle_key_event, clutter_entry_handle_key_event () -
    -
    clutter_entry_insert_text, clutter_entry_insert_text () -
    -
    clutter_entry_insert_unichar, clutter_entry_insert_unichar () -
    -
    clutter_entry_new, clutter_entry_new () -
    -
    clutter_entry_new_full, clutter_entry_new_full () -
    -
    clutter_entry_new_with_text, clutter_entry_new_with_text () -
    -
    clutter_entry_set_alignment, clutter_entry_set_alignment () -
    -
    clutter_entry_set_color, clutter_entry_set_color () -
    -
    clutter_entry_set_cursor_position, clutter_entry_set_cursor_position () -
    -
    clutter_entry_set_font_name, clutter_entry_set_font_name () -
    -
    clutter_entry_set_invisible_char, clutter_entry_set_invisible_char () -
    -
    clutter_entry_set_max_length, clutter_entry_set_max_length () -
    -
    clutter_entry_set_text, clutter_entry_set_text () -
    -
    clutter_entry_set_visibility, clutter_entry_set_visibility () -
    -
    clutter_entry_set_visible_cursor, clutter_entry_set_visible_cursor () -
    clutter_events_pending, clutter_events_pending ()
    clutter_event_copy, clutter_event_copy () @@ -1333,10 +1369,6 @@
    clutter_event_type, clutter_event_type ()
    -
    clutter_exp_dec_func, clutter_exp_dec_func () -
    -
    clutter_exp_inc_func, clutter_exp_inc_func () -
    CLUTTER_FIXED_CEIL, CLUTTER_FIXED_CEIL()
    CLUTTER_FIXED_DIV, CLUTTER_FIXED_DIV() @@ -1345,8 +1377,6 @@
    CLUTTER_FIXED_FRACTION, CLUTTER_FIXED_FRACTION()
    -
    CLUTTER_FIXED_INT, CLUTTER_FIXED_INT() -
    CLUTTER_FIXED_MUL, CLUTTER_FIXED_MUL()
    CLUTTER_FIXED_TO_DOUBLE, CLUTTER_FIXED_TO_DOUBLE() @@ -1375,6 +1405,10 @@
    clutter_get_default_frame_rate, clutter_get_default_frame_rate ()
    +
    clutter_get_font_flags, clutter_get_font_flags () +
    +
    clutter_get_font_map, clutter_get_font_map () +
    clutter_get_input_device_for_id, clutter_get_input_device_for_id ()
    clutter_get_keyboard_grab, clutter_get_keyboard_grab () @@ -1395,8 +1429,6 @@
    clutter_get_timestamp, clutter_get_timestamp ()
    -
    clutter_get_use_mipmapped_text, clutter_get_use_mipmapped_text () -
    clutter_grab_keyboard, clutter_grab_keyboard ()
    clutter_grab_pointer, clutter_grab_pointer () @@ -1427,76 +1459,56 @@
    clutter_init_with_args, clutter_init_with_args ()
    -
    CLUTTER_INT_TO_FIXED, CLUTTER_INT_TO_FIXED() -
    -
    clutter_keysym_to_unicode, clutter_keysym_to_unicode () -
    -
    clutter_key_event_code, clutter_key_event_code () -
    -
    clutter_key_event_symbol, clutter_key_event_symbol () -
    -
    clutter_key_event_unicode, clutter_key_event_unicode () -
    -
    clutter_knot_copy, clutter_knot_copy () -
    -
    clutter_knot_equal, clutter_knot_equal () -
    -
    clutter_knot_free, clutter_knot_free () +
    clutter_interval_clone, clutter_interval_clone ()
    -
    clutter_label_get_alignment, clutter_label_get_alignment () +
    clutter_interval_compute_value, clutter_interval_compute_value ()
    -
    clutter_label_get_attributes, clutter_label_get_attributes () +
    clutter_interval_get_final_value, clutter_interval_get_final_value ()
    -
    clutter_label_get_color, clutter_label_get_color () +
    clutter_interval_get_initial_value, clutter_interval_get_initial_value ()
    -
    clutter_label_get_ellipsize, clutter_label_get_ellipsize () +
    clutter_interval_get_interval, clutter_interval_get_interval ()
    -
    clutter_label_get_font_name, clutter_label_get_font_name () +
    clutter_interval_get_value_type, clutter_interval_get_value_type ()
    -
    clutter_label_get_justify, clutter_label_get_justify () +
    clutter_interval_new, clutter_interval_new ()
    -
    clutter_label_get_layout, clutter_label_get_layout () +
    clutter_interval_new_with_values, clutter_interval_new_with_values ()
    -
    clutter_label_get_line_wrap, clutter_label_get_line_wrap () +
    clutter_interval_peek_final_value, clutter_interval_peek_final_value ()
    -
    clutter_label_get_line_wrap_mode, clutter_label_get_line_wrap_mode () +
    clutter_interval_peek_initial_value, clutter_interval_peek_initial_value ()
    -
    clutter_label_get_text, clutter_label_get_text () +
    clutter_interval_register_progress_func, clutter_interval_register_progress_func ()
    -
    clutter_label_get_use_markup, clutter_label_get_use_markup () +
    clutter_interval_set_final_value, clutter_interval_set_final_value ()
    -
    clutter_label_new, clutter_label_new () +
    clutter_interval_set_initial_value, clutter_interval_set_initial_value ()
    -
    clutter_label_new_full, clutter_label_new_full () +
    clutter_interval_set_interval, clutter_interval_set_interval ()
    -
    clutter_label_new_with_text, clutter_label_new_with_text () +
    clutter_interval_validate, clutter_interval_validate ()
    -
    clutter_label_set_alignment, clutter_label_set_alignment () -
    -
    clutter_label_set_attributes, clutter_label_set_attributes () -
    -
    clutter_label_set_color, clutter_label_set_color () +
    CLUTTER_INT_TO_FIXED, CLUTTER_INT_TO_FIXED()
    -
    clutter_label_set_ellipsize, clutter_label_set_ellipsize () +
    clutter_keysym_to_unicode, clutter_keysym_to_unicode ()
    -
    clutter_label_set_font_name, clutter_label_set_font_name () +
    clutter_key_event_code, clutter_key_event_code ()
    -
    clutter_label_set_justify, clutter_label_set_justify () +
    clutter_key_event_symbol, clutter_key_event_symbol ()
    -
    clutter_label_set_line_wrap, clutter_label_set_line_wrap () +
    clutter_key_event_unicode, clutter_key_event_unicode ()
    -
    clutter_label_set_line_wrap_mode, clutter_label_set_line_wrap_mode () +
    clutter_knot_copy, clutter_knot_copy ()
    -
    clutter_label_set_text, clutter_label_set_text () +
    clutter_knot_equal, clutter_knot_equal ()
    -
    clutter_label_set_use_markup, clutter_label_set_use_markup () +
    clutter_knot_free, clutter_knot_free ()
    clutter_list_model_new, clutter_list_model_new ()
    clutter_list_model_newv, clutter_list_model_newv ()
    -
    clutter_log2x, clutter_log2x () -
    clutter_main, clutter_main ()
    clutter_main_level, clutter_main_level () @@ -1509,7 +1521,9 @@
    CLUTTER_MAXUNIT, CLUTTER_MAXUNIT
    -
    clutter_media_get_buffer_percent, clutter_media_get_buffer_percent () +
    clutter_media_get_audio_volume, clutter_media_get_audio_volume () +
    +
    clutter_media_get_buffer_fill, clutter_media_get_buffer_fill ()
    clutter_media_get_can_seek, clutter_media_get_can_seek ()
    @@ -1517,22 +1531,20 @@
    clutter_media_get_playing, clutter_media_get_playing ()
    -
    clutter_media_get_position, clutter_media_get_position () +
    clutter_media_get_progress, clutter_media_get_progress ()
    clutter_media_get_uri, clutter_media_get_uri ()
    -
    clutter_media_get_volume, clutter_media_get_volume () +
    clutter_media_set_audio_volume, clutter_media_set_audio_volume ()
    clutter_media_set_filename, clutter_media_set_filename ()
    clutter_media_set_playing, clutter_media_set_playing ()
    -
    clutter_media_set_position, clutter_media_set_position () +
    clutter_media_set_progress, clutter_media_set_progress ()
    clutter_media_set_uri, clutter_media_set_uri ()
    -
    clutter_media_set_volume, clutter_media_set_volume () -
    CLUTTER_MICRO_VERSION, CLUTTER_MICRO_VERSION
    CLUTTER_MINFIXED, CLUTTER_MINFIXED @@ -1625,25 +1637,71 @@
    clutter_param_spec_unit, clutter_param_spec_unit ()
    -
    clutter_pow2x, clutter_pow2x () +
    clutter_path_add_cairo_path, clutter_path_add_cairo_path ()
    -
    clutter_powx, clutter_powx () +
    clutter_path_add_close, clutter_path_add_close ()
    -
    CLUTTER_PRIORITY_EVENTS, CLUTTER_PRIORITY_EVENTS +
    clutter_path_add_curve_to, clutter_path_add_curve_to ()
    -
    CLUTTER_PRIORITY_REDRAW, CLUTTER_PRIORITY_REDRAW +
    clutter_path_add_line_to, clutter_path_add_line_to ()
    -
    CLUTTER_PRIORITY_TIMELINE, CLUTTER_PRIORITY_TIMELINE +
    clutter_path_add_move_to, clutter_path_add_move_to () +
    +
    clutter_path_add_node, clutter_path_add_node () +
    +
    clutter_path_add_rel_curve_to, clutter_path_add_rel_curve_to () +
    +
    clutter_path_add_rel_line_to, clutter_path_add_rel_line_to () +
    +
    clutter_path_add_rel_move_to, clutter_path_add_rel_move_to () +
    +
    clutter_path_add_string, clutter_path_add_string ()
    -
    clutter_qdivx, clutter_qdivx () +
    clutter_path_clear, clutter_path_clear ()
    -
    clutter_qmulx, clutter_qmulx () +
    clutter_path_foreach, clutter_path_foreach ()
    -
    clutter_ramp_dec_func, clutter_ramp_dec_func () +
    clutter_path_get_description, clutter_path_get_description ()
    -
    clutter_ramp_func, clutter_ramp_func () +
    clutter_path_get_length, clutter_path_get_length ()
    -
    clutter_ramp_inc_func, clutter_ramp_inc_func () +
    clutter_path_get_node, clutter_path_get_node () +
    +
    clutter_path_get_nodes, clutter_path_get_nodes () +
    +
    clutter_path_get_n_nodes, clutter_path_get_n_nodes () +
    +
    clutter_path_get_position, clutter_path_get_position () +
    +
    clutter_path_insert_node, clutter_path_insert_node () +
    +
    clutter_path_new, clutter_path_new () +
    +
    clutter_path_new_with_description, clutter_path_new_with_description () +
    +
    clutter_path_node_copy, clutter_path_node_copy () +
    +
    clutter_path_node_equal, clutter_path_node_equal () +
    +
    clutter_path_node_free, clutter_path_node_free () +
    +
    clutter_path_remove_node, clutter_path_remove_node () +
    +
    clutter_path_replace_node, clutter_path_replace_node () +
    +
    clutter_path_set_description, clutter_path_set_description () +
    +
    clutter_path_to_cairo_path, clutter_path_to_cairo_path () +
    +
    CLUTTER_PRIORITY_EVENTS, CLUTTER_PRIORITY_EVENTS +
    +
    CLUTTER_PRIORITY_REDRAW, CLUTTER_PRIORITY_REDRAW +
    +
    CLUTTER_PRIORITY_TIMELINE, CLUTTER_PRIORITY_TIMELINE +
    +
    clutter_qdivx, clutter_qdivx() +
    +
    clutter_qmulx, clutter_qmulx()
    clutter_rectangle_get_border_color, clutter_rectangle_get_border_color ()
    @@ -1689,13 +1747,13 @@
    clutter_score_stop, clutter_score_stop ()
    -
    clutter_scriptable_get_id, clutter_scriptable_get_id () +
    clutter_scriptable_get_id, clutter_scriptable_get_id ()
    -
    clutter_scriptable_parse_custom_node, clutter_scriptable_parse_custom_node () +
    clutter_scriptable_parse_custom_node, clutter_scriptable_parse_custom_node ()
    -
    clutter_scriptable_set_custom_property, clutter_scriptable_set_custom_property () +
    clutter_scriptable_set_custom_property, clutter_scriptable_set_custom_property ()
    -
    clutter_scriptable_set_id, clutter_scriptable_set_id () +
    clutter_scriptable_set_id, clutter_scriptable_set_id ()
    clutter_script_add_search_paths, clutter_script_add_search_paths ()
    @@ -1725,14 +1783,20 @@
    clutter_set_default_frame_rate, clutter_set_default_frame_rate ()
    +
    clutter_set_font_flags, clutter_set_font_flags () +
    clutter_set_motion_events_enabled, clutter_set_motion_events_enabled ()
    clutter_set_motion_events_frequency, clutter_set_motion_events_frequency ()
    -
    clutter_set_use_mipmapped_text, clutter_set_use_mipmapped_text () -
    clutter_shader_compile, clutter_shader_compile ()
    +
    clutter_shader_get_cogl_fragment_shader, clutter_shader_get_cogl_fragment_shader () +
    +
    clutter_shader_get_cogl_program, clutter_shader_get_cogl_program () +
    +
    clutter_shader_get_cogl_vertex_shader, clutter_shader_get_cogl_vertex_shader () +
    clutter_shader_get_fragment_source, clutter_shader_get_fragment_source ()
    clutter_shader_get_is_enabled, clutter_shader_get_is_enabled () @@ -1749,40 +1813,18 @@
    clutter_shader_set_is_enabled, clutter_shader_set_is_enabled ()
    +
    clutter_shader_set_uniform, clutter_shader_set_uniform () +
    clutter_shader_set_uniform_1f, clutter_shader_set_uniform_1f ()
    clutter_shader_set_vertex_source, clutter_shader_set_vertex_source ()
    -
    clutter_sine_dec_func, clutter_sine_dec_func () -
    -
    clutter_sine_func, clutter_sine_func () -
    -
    clutter_sine_half_func, clutter_sine_half_func () -
    -
    clutter_sine_inc_func, clutter_sine_inc_func () -
    -
    clutter_sini, clutter_sini () -
    -
    clutter_sinx, clutter_sinx () -
    -
    clutter_smoothstep_dec_func, clutter_smoothstep_dec_func () -
    -
    clutter_smoothstep_inc_func, clutter_smoothstep_inc_func () -
    -
    clutter_sqrti, clutter_sqrti () -
    -
    CLUTTER_SQRTI_ARG_10_PERCENT, CLUTTER_SQRTI_ARG_10_PERCENT -
    -
    CLUTTER_SQRTI_ARG_5_PERCENT, CLUTTER_SQRTI_ARG_5_PERCENT -
    -
    CLUTTER_SQRTI_ARG_MAX, CLUTTER_SQRTI_ARG_MAX -
    -
    clutter_sqrtx, clutter_sqrtx () -
    -
    clutter_square_func, clutter_square_func () +
    clutter_sinx, clutter_sinx()
    clutter_stage_ensure_current, clutter_stage_ensure_current ()
    +
    clutter_stage_ensure_viewport, clutter_stage_ensure_viewport () +
    clutter_stage_event, clutter_stage_event ()
    clutter_stage_fullscreen, clutter_stage_fullscreen () @@ -1803,10 +1845,6 @@
    clutter_stage_get_perspectivex, clutter_stage_get_perspectivex ()
    -
    clutter_stage_get_resolution, clutter_stage_get_resolution () -
    -
    clutter_stage_get_resolutionx, clutter_stage_get_resolutionx () -
    clutter_stage_get_title, clutter_stage_get_title ()
    clutter_stage_get_user_resizable, clutter_stage_get_user_resizable () @@ -1849,12 +1887,14 @@
    CLUTTER_STAGE_WIDTH, CLUTTER_STAGE_WIDTH()
    -
    clutter_tani, clutter_tani () +
    clutter_tanx, clutter_tanx()
    CLUTTER_TEXTURE_ERROR, CLUTTER_TEXTURE_ERROR
    clutter_texture_get_base_size, clutter_texture_get_base_size ()
    +
    clutter_texture_get_cogl_material, clutter_texture_get_cogl_material () +
    clutter_texture_get_cogl_texture, clutter_texture_get_cogl_texture ()
    clutter_texture_get_filter_quality, clutter_texture_get_filter_quality () @@ -1869,6 +1909,8 @@
    clutter_texture_set_area_from_rgb_data, clutter_texture_set_area_from_rgb_data ()
    +
    clutter_texture_set_cogl_material, clutter_texture_set_cogl_material () +
    clutter_texture_set_cogl_texture, clutter_texture_set_cogl_texture ()
    clutter_texture_set_filter_quality, clutter_texture_set_filter_quality () @@ -1881,6 +1923,114 @@
    clutter_texture_set_max_tile_waste, clutter_texture_set_max_tile_waste ()
    +
    clutter_text_activate, clutter_text_activate () +
    +
    clutter_text_delete_chars, clutter_text_delete_chars () +
    +
    clutter_text_delete_text, clutter_text_delete_text () +
    +
    clutter_text_get_activatable, clutter_text_get_activatable () +
    +
    clutter_text_get_alignment, clutter_text_get_alignment () +
    +
    clutter_text_get_attributes, clutter_text_get_attributes () +
    +
    clutter_text_get_chars, clutter_text_get_chars () +
    +
    clutter_text_get_color, clutter_text_get_color () +
    +
    clutter_text_get_cursor_color, clutter_text_get_cursor_color () +
    +
    clutter_text_get_cursor_position, clutter_text_get_cursor_position () +
    +
    clutter_text_get_cursor_size, clutter_text_get_cursor_size () +
    +
    clutter_text_get_cursor_visible, clutter_text_get_cursor_visible () +
    +
    clutter_text_get_editable, clutter_text_get_editable () +
    +
    clutter_text_get_ellipsize, clutter_text_get_ellipsize () +
    +
    clutter_text_get_font_name, clutter_text_get_font_name () +
    +
    clutter_text_get_justify, clutter_text_get_justify () +
    +
    clutter_text_get_layout, clutter_text_get_layout () +
    +
    clutter_text_get_line_wrap, clutter_text_get_line_wrap () +
    +
    clutter_text_get_line_wrap_mode, clutter_text_get_line_wrap_mode () +
    +
    clutter_text_get_max_length, clutter_text_get_max_length () +
    +
    clutter_text_get_password_char, clutter_text_get_password_char () +
    +
    clutter_text_get_selectable, clutter_text_get_selectable () +
    +
    clutter_text_get_selection, clutter_text_get_selection () +
    +
    clutter_text_get_selection_bound, clutter_text_get_selection_bound () +
    +
    clutter_text_get_single_line_mode, clutter_text_get_single_line_mode () +
    +
    clutter_text_get_text, clutter_text_get_text () +
    +
    clutter_text_get_use_markup, clutter_text_get_use_markup () +
    +
    clutter_text_insert_text, clutter_text_insert_text () +
    +
    clutter_text_insert_unichar, clutter_text_insert_unichar () +
    +
    clutter_text_new, clutter_text_new () +
    +
    clutter_text_new_full, clutter_text_new_full () +
    +
    clutter_text_new_with_text, clutter_text_new_with_text () +
    +
    clutter_text_set_activatable, clutter_text_set_activatable () +
    +
    clutter_text_set_alignment, clutter_text_set_alignment () +
    +
    clutter_text_set_attributes, clutter_text_set_attributes () +
    +
    clutter_text_set_color, clutter_text_set_color () +
    +
    clutter_text_set_cursor_color, clutter_text_set_cursor_color () +
    +
    clutter_text_set_cursor_position, clutter_text_set_cursor_position () +
    +
    clutter_text_set_cursor_size, clutter_text_set_cursor_size () +
    +
    clutter_text_set_cursor_visible, clutter_text_set_cursor_visible () +
    +
    clutter_text_set_editable, clutter_text_set_editable () +
    +
    clutter_text_set_ellipsize, clutter_text_set_ellipsize () +
    +
    clutter_text_set_font_name, clutter_text_set_font_name () +
    +
    clutter_text_set_justify, clutter_text_set_justify () +
    +
    clutter_text_set_line_wrap, clutter_text_set_line_wrap () +
    +
    clutter_text_set_line_wrap_mode, clutter_text_set_line_wrap_mode () +
    +
    clutter_text_set_max_length, clutter_text_set_max_length () +
    +
    clutter_text_set_password_char, clutter_text_set_password_char () +
    +
    clutter_text_set_selectable, clutter_text_set_selectable () +
    +
    clutter_text_set_selection, clutter_text_set_selection () +
    +
    clutter_text_set_selection_bound, clutter_text_set_selection_bound () +
    +
    clutter_text_set_single_line_mode, clutter_text_set_single_line_mode () +
    +
    clutter_text_set_text, clutter_text_set_text () +
    +
    clutter_text_set_use_markup, clutter_text_set_use_markup () +
    clutter_threads_add_frame_source, clutter_threads_add_frame_source ()
    clutter_threads_add_frame_source_full, clutter_threads_add_frame_source_full () @@ -1977,8 +2127,14 @@
    clutter_ungrab_pointer_for_device, clutter_ungrab_pointer_for_device ()
    +
    clutter_units_em, clutter_units_em () +
    +
    CLUTTER_UNITS_FORMAT, CLUTTER_UNITS_FORMAT +
    CLUTTER_UNITS_FROM_DEVICE, CLUTTER_UNITS_FROM_DEVICE()
    +
    CLUTTER_UNITS_FROM_EM, CLUTTER_UNITS_FROM_EM() +
    CLUTTER_UNITS_FROM_FIXED, CLUTTER_UNITS_FROM_FIXED()
    CLUTTER_UNITS_FROM_FLOAT, CLUTTER_UNITS_FROM_FLOAT() @@ -1987,25 +2143,13 @@
    CLUTTER_UNITS_FROM_MM, CLUTTER_UNITS_FROM_MM()
    -
    CLUTTER_UNITS_FROM_MMX, CLUTTER_UNITS_FROM_MMX() -
    CLUTTER_UNITS_FROM_PANGO_UNIT, CLUTTER_UNITS_FROM_PANGO_UNIT()
    -
    CLUTTER_UNITS_FROM_PARENT_HEIGHT_PERCENTAGE, CLUTTER_UNITS_FROM_PARENT_HEIGHT_PERCENTAGE() -
    -
    CLUTTER_UNITS_FROM_PARENT_WIDTH_PERCENTAGE, CLUTTER_UNITS_FROM_PARENT_WIDTH_PERCENTAGE() -
    CLUTTER_UNITS_FROM_POINTS, CLUTTER_UNITS_FROM_POINTS()
    -
    CLUTTER_UNITS_FROM_POINTSX, CLUTTER_UNITS_FROM_POINTSX() -
    -
    CLUTTER_UNITS_FROM_STAGE_HEIGHT_PERCENTAGE, CLUTTER_UNITS_FROM_STAGE_HEIGHT_PERCENTAGE() +
    clutter_units_mm, clutter_units_mm ()
    -
    CLUTTER_UNITS_FROM_STAGE_WIDTH_PERCENTAGE, CLUTTER_UNITS_FROM_STAGE_WIDTH_PERCENTAGE() -
    -
    CLUTTER_UNITS_TMP_FROM_DEVICE, CLUTTER_UNITS_TMP_FROM_DEVICE() -
    -
    CLUTTER_UNITS_TMP_TO_DEVICE, CLUTTER_UNITS_TMP_TO_DEVICE() +
    clutter_units_pt, clutter_units_pt ()
    CLUTTER_UNITS_TO_DEVICE, CLUTTER_UNITS_TO_DEVICE()
    @@ -2023,18 +2167,36 @@
    clutter_value_get_fixed, clutter_value_get_fixed ()
    +
    clutter_value_get_shader_float, clutter_value_get_shader_float () +
    +
    clutter_value_get_shader_int, clutter_value_get_shader_int () +
    +
    clutter_value_get_shader_matrix, clutter_value_get_shader_matrix () +
    clutter_value_get_unit, clutter_value_get_unit ()
    CLUTTER_VALUE_HOLDS_COLOR, CLUTTER_VALUE_HOLDS_COLOR()
    CLUTTER_VALUE_HOLDS_FIXED, CLUTTER_VALUE_HOLDS_FIXED()
    +
    CLUTTER_VALUE_HOLDS_SHADER_FLOAT, CLUTTER_VALUE_HOLDS_SHADER_FLOAT() +
    +
    CLUTTER_VALUE_HOLDS_SHADER_INT, CLUTTER_VALUE_HOLDS_SHADER_INT() +
    +
    CLUTTER_VALUE_HOLDS_SHADER_MATRIX, CLUTTER_VALUE_HOLDS_SHADER_MATRIX() +
    CLUTTER_VALUE_HOLDS_UNIT, CLUTTER_VALUE_HOLDS_UNIT()
    clutter_value_set_color, clutter_value_set_color ()
    clutter_value_set_fixed, clutter_value_set_fixed ()
    +
    clutter_value_set_shader_float, clutter_value_set_shader_float () +
    +
    clutter_value_set_shader_int, clutter_value_set_shader_int () +
    +
    clutter_value_set_shader_matrix, clutter_value_set_shader_matrix () +
    clutter_value_set_unit, clutter_value_set_unit ()
    CLUTTER_VERSION, CLUTTER_VERSION diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ix02.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ix02.html --- clutter-0.8.4/doc/reference/clutter/html/ix02.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ix02.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,8 +4,8 @@ Index of deprecated symbols - - + + @@ -19,7 +19,7 @@ - + @@ -42,19 +42,15 @@ Prev   Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next

    -Index of deprecated symbols

    +Index of deprecated symbols

    C

    -
    clutter_entry_handle_key_event, clutter_entry_handle_key_event () -
    -
    CLUTTER_FIXED_INT, CLUTTER_FIXED_INT() -
    clutter_group_add_many, clutter_group_add_many ()
    clutter_group_add_many_valist, clutter_group_add_many_valist () @@ -67,6 +63,8 @@
    clutter_group_sort_depth_order, clutter_group_sort_depth_order ()
    +
    clutter_shader_set_uniform_1f, clutter_shader_set_uniform_1f () +
    diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ix03.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ix03.html --- clutter-0.8.4/doc/reference/clutter/html/ix03.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ix03.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,8 +4,8 @@ Index of new symbols in 0.2 - - + + @@ -19,7 +19,7 @@ - + @@ -42,12 +42,12 @@ Prev   Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next

    -Index of new symbols in 0.2

    +Index of new symbols in 0.2

    C

    @@ -75,12 +75,6 @@
    ClutterBehaviour:alpha, The "alpha" property
    -
    ClutterBehaviourBspline, ClutterBehaviourBspline -
    -
    ClutterBehaviourBspline::knot-reached, The "knot-reached" signal -
    -
    ClutterBehaviourBsplineClass, ClutterBehaviourBsplineClass -
    ClutterBehaviourClass, ClutterBehaviourClass
    ClutterBehaviourForeachFunc, ClutterBehaviourForeachFunc () @@ -91,8 +85,6 @@
    ClutterBehaviourPath::knot-reached, The "knot-reached" signal
    -
    ClutterBehaviourPath:knot, The "knot" property -
    ClutterButtonEvent, ClutterButtonEvent
    ClutterCrossingEvent, ClutterCrossingEvent @@ -111,6 +103,14 @@
    ClutterMedia::error, The "error" signal
    +
    ClutterMedia:can-seek, The "can-seek" property +
    +
    ClutterMedia:duration, The "duration" property +
    +
    ClutterMedia:playing, The "playing" property +
    +
    ClutterMedia:uri, The "uri" property +
    ClutterMotionEvent, ClutterMotionEvent
    ClutterRectangle:border-color, The "border-color" property @@ -125,8 +125,6 @@
    clutter_actor_get_scale, clutter_actor_get_scale ()
    -
    clutter_actor_get_scalex, clutter_actor_get_scalex () -
    clutter_actor_get_size, clutter_actor_get_size ()
    clutter_actor_hide_all, clutter_actor_hide_all () @@ -153,28 +151,12 @@
    clutter_alpha_get_timeline, clutter_alpha_get_timeline ()
    -
    CLUTTER_ALPHA_MAX_ALPHA, CLUTTER_ALPHA_MAX_ALPHA -
    clutter_alpha_new, clutter_alpha_new ()
    -
    clutter_alpha_new_full, clutter_alpha_new_full () -
    -
    CLUTTER_ALPHA_RAMP, CLUTTER_ALPHA_RAMP -
    -
    CLUTTER_ALPHA_RAMP_DEC, CLUTTER_ALPHA_RAMP_DEC -
    -
    CLUTTER_ALPHA_RAMP_INC, CLUTTER_ALPHA_RAMP_INC -
    clutter_alpha_set_func, clutter_alpha_set_func ()
    clutter_alpha_set_timeline, clutter_alpha_set_timeline ()
    -
    CLUTTER_ALPHA_SINE, CLUTTER_ALPHA_SINE -
    -
    CLUTTER_ALPHA_SINE_DEC, CLUTTER_ALPHA_SINE_DEC -
    -
    CLUTTER_ALPHA_SINE_INC, CLUTTER_ALPHA_SINE_INC -
    clutter_behaviour_actors_foreach, clutter_behaviour_actors_foreach ()
    clutter_behaviour_apply, clutter_behaviour_apply () @@ -189,20 +171,8 @@
    clutter_behaviour_opacity_new, clutter_behaviour_opacity_new ()
    -
    clutter_behaviour_path_append_knot, clutter_behaviour_path_append_knot () -
    -
    clutter_behaviour_path_append_knots, clutter_behaviour_path_append_knots () -
    -
    clutter_behaviour_path_clear, clutter_behaviour_path_clear () -
    -
    clutter_behaviour_path_get_knots, clutter_behaviour_path_get_knots () -
    -
    clutter_behaviour_path_insert_knot, clutter_behaviour_path_insert_knot () -
    clutter_behaviour_path_new, clutter_behaviour_path_new ()
    -
    clutter_behaviour_path_remove_knot, clutter_behaviour_path_remove_knot () -
    clutter_behaviour_remove, clutter_behaviour_remove ()
    clutter_behaviour_scale_new, clutter_behaviour_scale_new () @@ -211,10 +181,6 @@
    clutter_behaviour_set_alpha, clutter_behaviour_set_alpha ()
    -
    clutter_clone_texture_get_parent_texture, clutter_clone_texture_get_parent_texture () -
    -
    clutter_clone_texture_set_parent_texture, clutter_clone_texture_set_parent_texture () -
    clutter_color_copy, clutter_color_copy ()
    clutter_color_equal, clutter_color_equal () @@ -227,10 +193,6 @@
    clutter_color_to_string, clutter_color_to_string ()
    -
    clutter_cosi, clutter_cosi() -
    -
    clutter_cosx, clutter_cosx() -
    clutter_get_option_group, clutter_get_option_group ()
    clutter_group_get_nth_child, clutter_group_get_nth_child () @@ -245,72 +207,26 @@
    clutter_knot_free, clutter_knot_free ()
    -
    clutter_label_get_attributes, clutter_label_get_attributes () -
    -
    clutter_label_get_ellipsize, clutter_label_get_ellipsize () -
    -
    clutter_label_get_layout, clutter_label_get_layout () -
    -
    clutter_label_get_line_wrap, clutter_label_get_line_wrap () -
    -
    clutter_label_get_line_wrap_mode, clutter_label_get_line_wrap_mode () -
    -
    clutter_label_set_attributes, clutter_label_set_attributes () -
    -
    clutter_label_set_ellipsize, clutter_label_set_ellipsize () -
    -
    clutter_label_set_line_wrap, clutter_label_set_line_wrap () -
    -
    clutter_label_set_line_wrap_mode, clutter_label_set_line_wrap_mode () -
    -
    clutter_media_get_buffer_percent, clutter_media_get_buffer_percent () -
    clutter_media_get_can_seek, clutter_media_get_can_seek ()
    clutter_media_get_duration, clutter_media_get_duration ()
    clutter_media_get_playing, clutter_media_get_playing ()
    -
    clutter_media_get_position, clutter_media_get_position () -
    clutter_media_get_uri, clutter_media_get_uri ()
    -
    clutter_media_get_volume, clutter_media_get_volume () -
    clutter_media_set_filename, clutter_media_set_filename ()
    clutter_media_set_playing, clutter_media_set_playing ()
    -
    clutter_media_set_position, clutter_media_set_position () -
    clutter_media_set_uri, clutter_media_set_uri ()
    -
    clutter_media_set_volume, clutter_media_set_volume () -
    -
    clutter_ramp_dec_func, clutter_ramp_dec_func () -
    -
    clutter_ramp_func, clutter_ramp_func () -
    -
    clutter_ramp_inc_func, clutter_ramp_inc_func () -
    clutter_rectangle_get_border_color, clutter_rectangle_get_border_color ()
    clutter_rectangle_get_border_width, clutter_rectangle_get_border_width ()
    clutter_rectangle_set_border_width, clutter_rectangle_set_border_width ()
    -
    clutter_sine_func, clutter_sine_func () -
    -
    clutter_sine_inc_func, clutter_sine_inc_func () -
    -
    clutter_sini, clutter_sini () -
    -
    clutter_sinx, clutter_sinx () -
    -
    clutter_sqrti, clutter_sqrti () -
    -
    clutter_sqrtx, clutter_sqrtx () -
    CLUTTER_STAGE_HEIGHT, CLUTTER_STAGE_HEIGHT()
    CLUTTER_STAGE_WIDTH, CLUTTER_STAGE_WIDTH() diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ix04.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ix04.html --- clutter-0.8.4/doc/reference/clutter/html/ix04.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ix04.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,8 +4,8 @@ Index of new symbols in 0.4 - - + + @@ -19,7 +19,7 @@ - + @@ -42,12 +42,12 @@ Prev   Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next

    -Index of new symbols in 0.4

    +Index of new symbols in 0.4

    C

    @@ -93,32 +93,6 @@
    ClutterContainerIface, ClutterContainerIface
    -
    ClutterEffectCompleteFunc, ClutterEffectCompleteFunc () -
    -
    ClutterEntry::activate, The "activate" signal -
    -
    ClutterEntry::cursor-event, The "cursor-event" signal -
    -
    ClutterEntry:alignment, The "alignment" property -
    -
    ClutterEntry:color, The "color" property -
    -
    ClutterEntry:cursor-visible, The "cursor-visible" property -
    -
    ClutterEntry:entry-padding, The "entry-padding" property -
    -
    ClutterEntry:font-name, The "font-name" property -
    -
    ClutterEntry:max-length, The "max-length" property -
    -
    ClutterEntry:position, The "position" property -
    -
    ClutterEntry:text, The "text" property -
    -
    ClutterEntry:text-visible, The "text-visible" property -
    -
    ClutterEntryClass, ClutterEntryClass -
    ClutterEventType, enum ClutterEventType
    ClutterModifierType, enum ClutterModifierType @@ -151,17 +125,7 @@
    clutter_actor_get_abs_allocation_vertices, clutter_actor_get_abs_allocation_vertices ()
    -
    CLUTTER_ALPHA_EXP_DEC, CLUTTER_ALPHA_EXP_DEC -
    -
    CLUTTER_ALPHA_EXP_INC, CLUTTER_ALPHA_EXP_INC -
    -
    CLUTTER_ALPHA_SINE_HALF, CLUTTER_ALPHA_SINE_HALF -
    -
    CLUTTER_ALPHA_SMOOTHSTEP_DEC, CLUTTER_ALPHA_SMOOTHSTEP_DEC -
    -
    CLUTTER_ALPHA_SMOOTHSTEP_INC, CLUTTER_ALPHA_SMOOTHSTEP_INC -
    -
    CLUTTER_ALPHA_SQUARE, CLUTTER_ALPHA_SQUARE +
    clutter_actor_pick, clutter_actor_pick ()
    clutter_backend_get_double_click_distance, clutter_backend_get_double_click_distance ()
    @@ -175,24 +139,6 @@
    clutter_backend_set_resolution, clutter_backend_set_resolution ()
    -
    clutter_behaviour_bspline_adjust, clutter_behaviour_bspline_adjust () -
    -
    clutter_behaviour_bspline_append_knot, clutter_behaviour_bspline_append_knot () -
    -
    clutter_behaviour_bspline_clear, clutter_behaviour_bspline_clear () -
    -
    clutter_behaviour_bspline_get_origin, clutter_behaviour_bspline_get_origin () -
    -
    clutter_behaviour_bspline_join, clutter_behaviour_bspline_join () -
    -
    clutter_behaviour_bspline_new, clutter_behaviour_bspline_new () -
    -
    clutter_behaviour_bspline_set_origin, clutter_behaviour_bspline_set_origin () -
    -
    clutter_behaviour_bspline_split, clutter_behaviour_bspline_split () -
    -
    clutter_behaviour_bspline_truncate, clutter_behaviour_bspline_truncate () -
    clutter_behaviour_depth_new, clutter_behaviour_depth_new ()
    clutter_behaviour_ellipse_get_angle_end, clutter_behaviour_ellipse_get_angle_end () @@ -295,54 +241,6 @@
    clutter_do_event, clutter_do_event ()
    -
    clutter_effect_template_new, clutter_effect_template_new () -
    -
    clutter_effect_template_new_full, clutter_effect_template_new_full () -
    -
    clutter_entry_delete_chars, clutter_entry_delete_chars () -
    -
    clutter_entry_delete_text, clutter_entry_delete_text () -
    -
    clutter_entry_get_color, clutter_entry_get_color () -
    -
    clutter_entry_get_font_name, clutter_entry_get_font_name () -
    -
    clutter_entry_get_layout, clutter_entry_get_layout () -
    -
    clutter_entry_get_max_length, clutter_entry_get_max_length () -
    -
    clutter_entry_get_text, clutter_entry_get_text () -
    -
    clutter_entry_get_visibility, clutter_entry_get_visibility () -
    -
    clutter_entry_get_visible_cursor, clutter_entry_get_visible_cursor () -
    -
    clutter_entry_handle_key_event, clutter_entry_handle_key_event () -
    -
    clutter_entry_insert_text, clutter_entry_insert_text () -
    -
    clutter_entry_insert_unichar, clutter_entry_insert_unichar () -
    -
    clutter_entry_new_full, clutter_entry_new_full () -
    -
    clutter_entry_new_with_text, clutter_entry_new_with_text () -
    -
    clutter_entry_set_alignment, clutter_entry_set_alignment () -
    -
    clutter_entry_set_color, clutter_entry_set_color () -
    -
    clutter_entry_set_font_name, clutter_entry_set_font_name () -
    -
    clutter_entry_set_invisible_char, clutter_entry_set_invisible_char () -
    -
    clutter_entry_set_max_length, clutter_entry_set_max_length () -
    -
    clutter_entry_set_text, clutter_entry_set_text () -
    -
    clutter_entry_set_visibility, clutter_entry_set_visibility () -
    -
    clutter_entry_set_visible_cursor, clutter_entry_set_visible_cursor () -
    clutter_events_pending, clutter_events_pending ()
    clutter_event_get, clutter_event_get () @@ -355,38 +253,14 @@
    clutter_event_peek, clutter_event_peek ()
    -
    clutter_exp_dec_func, clutter_exp_dec_func () -
    -
    clutter_exp_inc_func, clutter_exp_inc_func () -
    CLUTTER_FLAVOUR, CLUTTER_FLAVOUR
    clutter_get_default_backend, clutter_get_default_backend ()
    clutter_get_show_fps, clutter_get_show_fps ()
    -
    clutter_log2x, clutter_log2x () -
    -
    clutter_pow2x, clutter_pow2x () -
    -
    clutter_powx, clutter_powx () -
    CLUTTER_PRIORITY_EVENTS, CLUTTER_PRIORITY_EVENTS
    -
    clutter_qdivx, clutter_qdivx () -
    -
    clutter_qmulx, clutter_qmulx () -
    -
    clutter_sine_dec_func, clutter_sine_dec_func () -
    -
    clutter_sine_half_func, clutter_sine_half_func () -
    -
    clutter_smoothstep_dec_func, clutter_smoothstep_dec_func () -
    -
    clutter_smoothstep_inc_func, clutter_smoothstep_inc_func () -
    -
    clutter_square_func, clutter_square_func () -
    clutter_stage_event, clutter_stage_event ()
    clutter_stage_get_perspective, clutter_stage_get_perspective () @@ -399,8 +273,12 @@
    clutter_stage_set_perspective, clutter_stage_set_perspective ()
    +
    clutter_stage_set_title, clutter_stage_set_title () +
    clutter_stage_set_user_resizable, clutter_stage_set_user_resizable ()
    +
    clutter_texture_set_from_yuv_data, clutter_texture_set_from_yuv_data () +
    clutter_threads_add_idle, clutter_threads_add_idle ()
    clutter_threads_add_idle_full, clutter_threads_add_idle_full () @@ -417,6 +295,8 @@
    clutter_threads_set_lock_functions, clutter_threads_set_lock_functions ()
    +
    clutter_timeline_clone, clutter_timeline_clone () +
    clutter_timeline_get_delay, clutter_timeline_get_delay ()
    clutter_timeline_set_delay, clutter_timeline_set_delay () diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ix05.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ix05.html --- clutter-0.8.4/doc/reference/clutter/html/ix05.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ix05.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,8 +4,8 @@ Index of new symbols in 0.6 - - + + @@ -19,7 +19,7 @@ - + @@ -42,12 +42,12 @@ Prev   Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next

    -Index of new symbols in 0.6

    +Index of new symbols in 0.6

    C

    @@ -79,6 +79,22 @@
    ClutterActor:reactive, The "reactive" property
    +
    ClutterActor:rotation-angle-x, The "rotation-angle-x" property +
    +
    ClutterActor:rotation-angle-y, The "rotation-angle-y" property +
    +
    ClutterActor:rotation-angle-z, The "rotation-angle-z" property +
    +
    ClutterActor:rotation-center-x, The "rotation-center-x" property +
    +
    ClutterActor:rotation-center-y, The "rotation-center-y" property +
    +
    ClutterActor:rotation-center-z, The "rotation-center-z" property +
    +
    ClutterActor:scale-x, The "scale-x" property +
    +
    ClutterActor:scale-y, The "scale-y" property +
    ClutterBehaviourScale:x-scale-end, The "x-scale-end" property
    ClutterBehaviourScale:x-scale-start, The "x-scale-start" property @@ -87,14 +103,10 @@
    ClutterBehaviourScale:y-scale-start, The "y-scale-start" property
    -
    ClutterEntry:x-align, The "x-align" property -
    ClutterEventFlags, enum ClutterEventFlags
    ClutterFog, ClutterFog
    -
    ClutterLabel:justify, The "justify" property -
    ClutterModel, ClutterModel
    ClutterModel::filter-changed, The "filter-changed" signal @@ -139,7 +151,7 @@
    ClutterScript:filename-set, The "filename-set" property
    -
    ClutterScriptableIface, ClutterScriptableIface +
    ClutterScriptableIface, ClutterScriptableIface
    ClutterScriptConnectFunc, ClutterScriptConnectFunc ()
    @@ -203,8 +215,6 @@
    clutter_actor_get_rotation, clutter_actor_get_rotation ()
    -
    clutter_actor_get_rotationx, clutter_actor_get_rotationx () -
    clutter_actor_get_shader, clutter_actor_get_shader ()
    clutter_actor_get_sizeu, clutter_actor_get_sizeu () @@ -245,12 +255,8 @@
    clutter_actor_set_rotation, clutter_actor_set_rotation ()
    -
    clutter_actor_set_rotationx, clutter_actor_set_rotationx () -
    clutter_actor_set_shader, clutter_actor_set_shader ()
    -
    clutter_actor_set_shader_param, clutter_actor_set_shader_param () -
    clutter_actor_set_sizeu, clutter_actor_set_sizeu ()
    clutter_actor_set_widthu, clutter_actor_set_widthu () @@ -265,8 +271,6 @@
    clutter_actor_transform_stage_point, clutter_actor_transform_stage_point ()
    -
    clutter_behaviour_bspline_append_knots, clutter_behaviour_bspline_append_knots () -
    clutter_behaviour_depth_get_bounds, clutter_behaviour_depth_get_bounds ()
    clutter_behaviour_depth_set_bounds, clutter_behaviour_depth_set_bounds () @@ -295,30 +299,6 @@
    clutter_container_sort_depth_order, clutter_container_sort_depth_order ()
    -
    clutter_effect_depth, clutter_effect_depth () -
    -
    clutter_effect_fade, clutter_effect_fade () -
    -
    clutter_effect_move, clutter_effect_move () -
    -
    clutter_effect_path, clutter_effect_path () -
    -
    clutter_effect_rotate, clutter_effect_rotate () -
    -
    clutter_effect_scale, clutter_effect_scale () -
    -
    clutter_effect_template_construct, clutter_effect_template_construct () -
    -
    clutter_effect_template_get_timeline_clone, clutter_effect_template_get_timeline_clone () -
    -
    clutter_effect_template_new_for_duration, clutter_effect_template_new_for_duration () -
    -
    clutter_effect_template_set_timeline_clone, clutter_effect_template_set_timeline_clone () -
    -
    clutter_entry_get_cursor_position, clutter_entry_get_cursor_position () -
    -
    clutter_entry_set_cursor_position, clutter_entry_set_cursor_position () -
    clutter_event_get_source, clutter_event_get_source ()
    clutter_event_put, clutter_event_put () @@ -343,10 +323,6 @@
    clutter_grab_pointer, clutter_grab_pointer ()
    -
    clutter_label_get_justify, clutter_label_get_justify () -
    -
    clutter_label_set_justify, clutter_label_set_justify () -
    clutter_list_model_new, clutter_list_model_new ()
    clutter_list_model_newv, clutter_list_model_newv () @@ -451,13 +427,13 @@
    clutter_score_stop, clutter_score_stop ()
    -
    clutter_scriptable_get_id, clutter_scriptable_get_id () +
    clutter_scriptable_get_id, clutter_scriptable_get_id ()
    -
    clutter_scriptable_parse_custom_node, clutter_scriptable_parse_custom_node () +
    clutter_scriptable_parse_custom_node, clutter_scriptable_parse_custom_node ()
    -
    clutter_scriptable_set_custom_property, clutter_scriptable_set_custom_property () +
    clutter_scriptable_set_custom_property, clutter_scriptable_set_custom_property ()
    -
    clutter_scriptable_set_id, clutter_scriptable_set_id () +
    clutter_scriptable_set_id, clutter_scriptable_set_id ()
    clutter_script_connect_signals, clutter_script_connect_signals ()
    @@ -503,22 +479,12 @@
    clutter_shader_set_vertex_source, clutter_shader_set_vertex_source ()
    -
    CLUTTER_SQRTI_ARG_10_PERCENT, CLUTTER_SQRTI_ARG_10_PERCENT -
    -
    CLUTTER_SQRTI_ARG_5_PERCENT, CLUTTER_SQRTI_ARG_5_PERCENT -
    -
    CLUTTER_SQRTI_ARG_MAX, CLUTTER_SQRTI_ARG_MAX -
    clutter_stage_get_fog, clutter_stage_get_fog ()
    clutter_stage_get_fogx, clutter_stage_get_fogx ()
    clutter_stage_get_key_focus, clutter_stage_get_key_focus ()
    -
    clutter_stage_get_resolution, clutter_stage_get_resolution () -
    -
    clutter_stage_get_resolutionx, clutter_stage_get_resolutionx () -
    clutter_stage_get_use_fog, clutter_stage_get_use_fog ()
    clutter_stage_set_fog, clutter_stage_set_fog () @@ -531,6 +497,10 @@
    clutter_texture_new_from_actor, clutter_texture_new_from_actor ()
    +
    clutter_texture_set_area_from_rgb_data, clutter_texture_set_area_from_rgb_data () +
    +
    clutter_text_get_justify, clutter_text_get_justify () +
    clutter_timeline_get_delta, clutter_timeline_get_delta ()
    clutter_timeline_get_direction, clutter_timeline_get_direction () diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/ix06.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/ix06.html --- clutter-0.8.4/doc/reference/clutter/html/ix06.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/ix06.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,8 +4,8 @@ Index of new symbols in 0.8 - - + + @@ -19,7 +19,7 @@ - + @@ -42,12 +42,12 @@ Prev   Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next

    -Index of new symbols in 0.8

    +Index of new symbols in 0.8

    C

    @@ -59,6 +59,10 @@
    ClutterActor:allocation, The "allocation" property
    +
    ClutterActor:anchor-x, The "anchor-x" property +
    +
    ClutterActor:anchor-y, The "anchor-y" property +
    ClutterActor:fixed-position-set, The "fixed-position-set" property
    ClutterActor:fixed-x, The "fixed-x" property @@ -141,6 +145,10 @@
    clutter_actor_set_rotationu, clutter_actor_set_rotationu ()
    +
    clutter_actor_set_shader_param_float, clutter_actor_set_shader_param_float () +
    +
    clutter_actor_set_shader_param_int, clutter_actor_set_shader_param_int () +
    clutter_alpha_set_closure, clutter_alpha_set_closure ()
    clutter_backend_get_font_options, clutter_backend_get_font_options () @@ -175,8 +183,6 @@
    clutter_get_input_device_for_id, clutter_get_input_device_for_id ()
    -
    clutter_get_use_mipmapped_text, clutter_get_use_mipmapped_text () -
    clutter_grab_pointer_for_device, clutter_grab_pointer_for_device ()
    CLUTTER_MAXFIXED, CLUTTER_MAXFIXED @@ -203,8 +209,6 @@
    clutter_script_lookup_filename, clutter_script_lookup_filename ()
    -
    clutter_set_use_mipmapped_text, clutter_set_use_mipmapped_text () -
    clutter_shader_compile, clutter_shader_compile ()
    clutter_shader_is_compiled, clutter_shader_is_compiled () @@ -225,6 +229,8 @@
    clutter_texture_new_from_file, clutter_texture_new_from_file ()
    +
    clutter_texture_set_cogl_material, clutter_texture_set_cogl_material () +
    clutter_texture_set_cogl_texture, clutter_texture_set_cogl_texture ()
    clutter_texture_set_filter_quality, clutter_texture_set_filter_quality () @@ -253,6 +259,12 @@
    clutter_value_get_fixed, clutter_value_get_fixed ()
    +
    clutter_value_get_shader_float, clutter_value_get_shader_float () +
    +
    clutter_value_get_shader_int, clutter_value_get_shader_int () +
    +
    clutter_value_get_shader_matrix, clutter_value_get_shader_matrix () +
    clutter_value_get_unit, clutter_value_get_unit ()
    CLUTTER_VALUE_HOLDS_FIXED, CLUTTER_VALUE_HOLDS_FIXED() @@ -261,6 +273,12 @@
    clutter_value_set_fixed, clutter_value_set_fixed ()
    +
    clutter_value_set_shader_float, clutter_value_set_shader_float () +
    +
    clutter_value_set_shader_int, clutter_value_set_shader_int () +
    +
    clutter_value_set_shader_matrix, clutter_value_set_shader_matrix () +
    clutter_value_set_unit, clutter_value_set_unit ()
    clutter_win32_disable_event_retrieval, clutter_win32_disable_event_retrieval () diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/license.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/license.html --- clutter-0.8.4/doc/reference/clutter/html/license.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/license.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,8 +4,8 @@ Appendix A. License - - + + @@ -18,7 +18,7 @@ - + @@ -41,7 +41,7 @@ Prev   Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual  
    diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/pt05.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/pt05.html --- clutter-0.8.4/doc/reference/clutter/html/pt05.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/pt05.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,9 +4,9 @@ Part V. Clutter Tools - - - + + + @@ -19,7 +19,7 @@ - + @@ -39,15 +39,15 @@ - + - +

    -Part V. Clutter Tools

    +Part V. Clutter Tools

    Table of Contents

    @@ -57,6 +57,9 @@ Colors — Color management and manipulation.
    +Key Bindings — Pool for key bindings +
    +
    Events — User and window system events
    @@ -84,7 +87,7 @@ ClutterScript — Loads a scene from UI definition data
    -ClutterScriptable — Override the UI definition parsing +ClutterScriptable — Override the UI definition parsing
    Generic list model
    diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/pt06.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/pt06.html --- clutter-0.8.4/doc/reference/clutter/html/pt06.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/pt06.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,8 +4,8 @@ Part VI. Clutter Backends - - + + @@ -19,7 +19,7 @@ - + @@ -42,12 +42,12 @@ Prev   Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next

    -Part VI. Clutter Backends

    +Part VI. Clutter Backends

    Clutter is usually compiled against a specific drawing backend. diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/html/pt07.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/html/pt07.html --- clutter-0.8.4/doc/reference/clutter/html/pt07.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/html/pt07.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,8 +4,8 @@ Part VII. Additional Documentation - - + + @@ -19,7 +19,7 @@ - + @@ -42,12 +42,12 @@ Prev   Home -Clutter 0.8.4 Reference Manual +Clutter 0.9.0 Reference Manual Next

    -Part VII. Additional Documentation

    +Part VII. Additional Documentation

    This section contains additional useful documentation for @@ -61,7 +61,7 @@

    Basic Animations
    Timelines
    Behaviours
    -
    Effects
    +
    Implicit Animations
    Conclusion
    Creating You Own Behaviours
    diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/Makefile.am --- clutter-0.8.4/doc/reference/clutter/Makefile.am 2008-09-29 15:16:27.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/Makefile.am 2009-01-28 08:12:46.000000000 +0000 @@ -12,7 +12,7 @@ DOC_MODULE=clutter # The top-level SGML file. You can change this if you want to. -DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml +DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml # The directory containing the source code. Relative to $(srcdir). # gtk-doc will search all .c & .h files beneath here for inline comments @@ -55,6 +55,7 @@ # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES=\ clutter.h \ + clutter-bezier.h \ clutter-debug.h \ clutter-deprecated.h \ clutter-enum-types.h \ @@ -90,7 +91,7 @@ # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES=\ actor-box.png \ - alpha-func.png \ + easing-modes.png \ event-flow.png \ path-alpha-func.png @@ -99,7 +100,7 @@ content_files= \ version.xml \ subclassing-ClutterActor.xml \ - clutter-animation.xml \ + clutter-animation-tutorial.xml \ creating-behaviours.xml \ clutter-overview.xml \ building-clutter.xml @@ -109,7 +110,7 @@ # e.g. expand_content_files=running.sgml expand_content_files= \ subclassing-ClutterActor.xml \ - clutter-animation.xml \ + clutter-animation-tutorial.xml \ creating-behaviours.xml \ clutter-overview.xml \ building-clutter.xml @@ -131,6 +132,7 @@ EXTRA_DIST += \ version.xml.in \ actor-box.png \ - alpha-func.png \ + easing-modes.png \ + easing-modes.svg \ event-flow.png \ path-alpha-func.png diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/Makefile.in --- clutter-0.8.4/doc/reference/clutter/Makefile.in 2008-11-28 18:22:49.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/Makefile.in 2009-01-28 16:48:58.000000000 +0000 @@ -100,7 +100,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -125,6 +124,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -229,7 +229,7 @@ DOC_MODULE = clutter # The top-level SGML file. You can change this if you want to. -DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.sgml +DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.xml # The directory containing the source code. Relative to $(srcdir). # gtk-doc will search all .c & .h files beneath here for inline comments @@ -274,6 +274,7 @@ # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES = \ clutter.h \ + clutter-bezier.h \ clutter-debug.h \ clutter-deprecated.h \ clutter-enum-types.h \ @@ -310,7 +311,7 @@ # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES = \ actor-box.png \ - alpha-func.png \ + easing-modes.png \ event-flow.png \ path-alpha-func.png @@ -320,7 +321,7 @@ content_files = \ version.xml \ subclassing-ClutterActor.xml \ - clutter-animation.xml \ + clutter-animation-tutorial.xml \ creating-behaviours.xml \ clutter-overview.xml \ building-clutter.xml @@ -331,7 +332,7 @@ # e.g. expand_content_files=running.sgml expand_content_files = \ subclassing-ClutterActor.xml \ - clutter-animation.xml \ + clutter-animation-tutorial.xml \ creating-behaviours.xml \ clutter-overview.xml \ building-clutter.xml @@ -363,8 +364,8 @@ # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST = $(content_files) $(HTML_IMAGES) $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt \ - version.xml.in actor-box.png alpha-func.png event-flow.png \ - path-alpha-func.png + version.xml.in actor-box.png easing-modes.png easing-modes.svg \ + event-flow.png path-alpha-func.png DOC_STAMPS = scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/subclassing-ClutterActor.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/subclassing-ClutterActor.xml --- clutter-0.8.4/doc/reference/clutter/subclassing-ClutterActor.xml 2008-09-29 15:16:27.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/subclassing-ClutterActor.xml 2009-01-28 08:12:46.000000000 +0000 @@ -349,23 +349,20 @@ foo_actor_paint (ClutterActor *actor) { FooActor *foo_actor = FOO_ACTOR (actor); - ClutterColor color = { 0, }; ClutterUnit w, h, r; - /* FooActor has a specific background color */ - color.red = foo_actor->bg_color.red; - color.green = foo_actor->bg_color.green; - color.blue = foo_actor->bg_color.blue; - /* the alpha component must take into account the absolute + /* FooActor has a specific background color + * + * the alpha component must take into account the absolute * opacity of the actor on the screen at this point in the * scenegraph; this value is obtained by calling * clutter_actor_get_paint_opacity(). */ - color.alpha = clutter_actor_get_paint_opacity (actor); - - /* set the color of the pen */ - cogl_color (&color); + cogl_set_source_color4ub (priv->fgcol.red, + priv->fgcol.green, + priv->fgcol.blue, + clutter_actor_get_paint_opacity (actor)); /* get the size of the actor with sub-pixel precision */ w = CLUTTER_UNITS_TO_FIXED (clutter_actor_get_widthu (actor)); @@ -439,7 +436,8 @@ const ClutterColor *pick_color) { FooActor *foo_actor = FOO_ACTOR (actor); - ClutterUnit w, h, r; + ClutterUnit width, height; + ClutterFixed radius; /* it is possible to avoid a costly paint by checking whether the * actor should really be painted in pick mode @@ -447,17 +445,19 @@ if (!clutter_actor_should_pick_paint (actor)) return; - w = CLUTTER_UNITS_TO_FIXED (clutter_actor_get_widthu (actor)); - h = CLUTTER_UNITS_TO_FIXED (clutter_actor_get_heightu (actor)); + clutter_actor_get_sizeu (actor, &width, &height); /* this is the arc radius for the rounded rectangle corners */ - r = CLUTTER_UNITS_TO_FIXED (foo_actor->radius); + radius = CLUTTER_UNITS_TO_FIXED (foo_actor-&radius); /* use the passed color to paint ourselves */ - cogl_color (pick_color); + cogl_set_source_color4ub (pick_color->red, + pick_color->green, + pick_color->blue, + pick_color->alpha); /* paint a round rectangle */ - cogl_round_rectangle (0, 0, w, h, r, 5); + cogl_round_rectangle (0, 0, width, height, radius, 5); /* and fill it with the current color */ cogl_fill (); diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-actor.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-actor.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-actor.sgml 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-actor.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -252,6 +252,14 @@ @clutteractor: the object which received the signal. @arg1: + + + + + +@clutteractor: the object which received the signal. +@arg1: + @@ -287,6 +295,11 @@ + + + + + @@ -422,6 +435,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -861,6 +894,16 @@ @z: + + + + + +@self: +@angle: +@gravity: + + @@ -874,6 +917,15 @@ @Returns: + + + + + +@self: +@Returns: + + @@ -1075,6 +1127,29 @@ @scale_y: + + + + + +@self: +@scale_x: +@scale_y: +@center_x: +@center_y: + + + + + + + +@self: +@scale_x: +@scale_y: +@gravity: + + @@ -1085,6 +1160,25 @@ @scale_y: + + + + + +@self: +@center_x: +@center_y: + + + + + + + +@self: +@Returns: + + @@ -1157,6 +1251,15 @@ @Returns: + + + + + +@self: +@Returns: + + @@ -1213,6 +1316,15 @@ @gravity: + + + + + +@self: +@Returns: + + @@ -1279,6 +1391,26 @@ @value: + + + + + +@self: +@param: +@value: + + + + + + + +@self: +@param: +@value: + + @@ -1409,6 +1541,28 @@ @height: + + + + + +@self: +@scale_x: +@scale_y: +@center_x: +@center_y: + + + + + + + +@self: +@center_x: +@center_y: + + @@ -1519,49 +1673,29 @@ @height: - + @self: -@scale_x: -@scale_y: - + @self: -@scale_x: -@scale_y: - - - - - - - -@self: -@axis: -@angle: -@x: -@y: -@z: +@Returns: - + @self: -@axis: -@x: -@y: -@z: @Returns: diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-alpha.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-alpha.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-alpha.sgml 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-alpha.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -28,81 +28,60 @@ - - - - - - + - - + -@Returns: - - - + -@timeline: -@func: -@data: -@destroy: -@Returns: - - + @alpha: +@user_data: @Returns: - + +@Returns: - + -@alpha: -@user_data: +@timeline: +@mode: @Returns: - + -@alpha: +@timeline: @func: @data: @destroy: - - - - - - - -@alpha: -@closure: +@Returns: @@ -123,207 +102,69 @@ @Returns: - - - - - - - - - - - - -@alpha: -@dummy: -@Returns: - - - - - - - - - - - - - - -@alpha: -@dummy: -@Returns: - - - - - - - - - - - - - - -@alpha: -@dummy: -@Returns: - - - - - - - - - - + @alpha: -@dummy: -@Returns: - - - - - - - +@mode: - + @alpha: -@dummy: @Returns: - - - - - - - - - - - - -@alpha: -@dummy: -@Returns: - - - - - - - - - - - - - - -@alpha: -@dummy: -@Returns: - - - - - - - - - - + @alpha: -@dummy: @Returns: - - - - - - - - + @alpha: -@dummy: -@Returns: - - - - - - - +@func: +@data: +@destroy: - + @alpha: -@dummy: -@Returns: - - - - - - - +@closure: - + -@alpha: -@dummy: +@closure: @Returns: - - - - - - - - + -@alpha: -@dummy: +@func: +@data: @Returns: diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-animatable.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-animatable.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-animatable.sgml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-animatable.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,46 @@ + +ClutterAnimatable + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@animate_property: + + + + + + +@animatable: +@animation: +@property_name: +@initial_value: +@final_value: +@progress: +@value: + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-animation.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-animation.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-animation.sgml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-animation.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,274 @@ + +Implicit Animations + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@completed: + + + + + + +@CLUTTER_CUSTOM_MODE: +@CLUTTER_LINEAR: +@CLUTTER_EASE_IN_QUAD: +@CLUTTER_EASE_OUT_QUAD: +@CLUTTER_EASE_IN_OUT_QUAD: +@CLUTTER_EASE_IN_CUBIC: +@CLUTTER_EASE_OUT_CUBIC: +@CLUTTER_EASE_IN_OUT_CUBIC: +@CLUTTER_EASE_IN_QUART: +@CLUTTER_EASE_OUT_QUART: +@CLUTTER_EASE_IN_OUT_QUART: +@CLUTTER_EASE_IN_QUINT: +@CLUTTER_EASE_OUT_QUINT: +@CLUTTER_EASE_IN_OUT_QUINT: +@CLUTTER_EASE_IN_SINE: +@CLUTTER_EASE_OUT_SINE: +@CLUTTER_EASE_IN_OUT_SINE: +@CLUTTER_EASE_IN_EXPO: +@CLUTTER_EASE_OUT_EXPO: +@CLUTTER_EASE_IN_OUT_EXPO: +@CLUTTER_EASE_IN_CIRC: +@CLUTTER_EASE_OUT_CIRC: +@CLUTTER_EASE_IN_OUT_CIRC: +@CLUTTER_EASE_IN_ELASTIC: +@CLUTTER_EASE_OUT_ELASTIC: +@CLUTTER_EASE_IN_OUT_ELASTIC: +@CLUTTER_EASE_IN_BACK: +@CLUTTER_EASE_OUT_BACK: +@CLUTTER_EASE_IN_OUT_BACK: +@CLUTTER_EASE_IN_BOUNCE: +@CLUTTER_EASE_OUT_BOUNCE: +@CLUTTER_EASE_IN_OUT_BOUNCE: +@CLUTTER_ANIMATION_LAST: + + + + + + +@Returns: + + + + + + + +@animation: +@object: + + + + + + + +@animation: +@Returns: + + + + + + + +@animation: +@mode: + + + + + + + +@animation: +@Returns: + + + + + + + +@animation: +@msecs: + + + + + + + +@animation: +@Returns: + + + + + + + +@animation: +@loop: + + + + + + + +@animation: +@Returns: + + + + + + + +@animation: +@timeline: + + + + + + + +@animation: +@Returns: + + + + + + + +@animation: +@alpha: + + + + + + + +@animation: +@Returns: + + + + + + + +@animation: +@property_name: +@interval: + + + + + + + +@animation: +@property_name: +@interval: + + + + + + + +@animation: +@property_name: +@Returns: + + + + + + + +@animation: +@property_name: + + + + + + + +@animation: +@property_name: +@Returns: + + + + + + + +@actor: +@mode: +@duration: +@first_property_name: +@Varargs: +@Returns: + + + + + + + +@actor: +@mode: +@timeline: +@first_property_name: +@Varargs: +@Returns: + + + + + + + +@actor: +@alpha: +@first_property_name: +@Varargs: +@Returns: + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-backend.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-backend.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-backend.sgml 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-backend.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -25,6 +25,15 @@ @Returns: + + + + + +@backend: +@dpi: + + @@ -34,13 +43,13 @@ @Returns: - + @backend: -@dpi: +@msec: @@ -52,13 +61,13 @@ @Returns: - + @backend: -@msec: +@distance: @@ -70,25 +79,34 @@ @Returns: - + @backend: -@distance: +@options: - + @backend: -@options: +@Returns: - + + + + + +@backend: +@font_name: + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-behaviour-path.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-behaviour-path.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-behaviour-path.sgml 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-behaviour-path.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -31,7 +31,7 @@ @clutterbehaviourpath: the object which received the signal. @arg1: - + @@ -49,64 +49,47 @@ @alpha: -@knots: -@n_knots: +@path: @Returns: - + -@pathb: +@alpha: +@desc: @Returns: - - - - - -@pathb: -@knot: - - - - - - - -@pathb: -@first_knot: -@Varargs: - - - + -@pathb: -@offset: -@knot: +@alpha: +@knots: +@n_knots: +@Returns: - + @pathb: -@offset: +@path: - + @pathb: +@Returns: diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-binding-pool.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-binding-pool.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-binding-pool.sgml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-binding-pool.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,165 @@ + +Key Bindings + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@gobject: +@action_name: +@key_val: +@modifiers: +@Returns: + + + + + + + +@name: +@Returns: + + + + + + + +@klass: +@Returns: + + + + + + + +@name: +@Returns: + + + + + + + +@pool: +@action_name: +@key_val: +@modifiers: +@callback: +@data: +@notify: + + + + + + + +@pool: +@action_name: +@key_val: +@modifiers: +@closure: + + + + + + + +@pool: +@key_val: +@modifiers: +@callback: +@data: +@notify: + + + + + + + +@pool: +@key_val: +@modifiers: +@closure: + + + + + + + +@pool: +@key_val: +@modifiers: +@Returns: + + + + + + + +@pool: +@key_val: +@modifiers: + + + + + + + +@pool: +@action_name: + + + + + + + +@pool: +@action_name: + + + + + + + +@pool: +@key_val: +@modifiers: +@gobject: +@Returns: + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-cairo-texture.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-cairo-texture.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-cairo-texture.sgml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-cairo-texture.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,104 @@ + +ClutterCairoTexture + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@width: +@height: +@Returns: + + + + + + + +@self: +@width: +@height: + + + + + + + +@self: +@width: +@height: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@x_offset: +@y_offset: +@width: +@height: +@Returns: + + + + + + + +@cr: +@color: + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-clone.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-clone.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-clone.sgml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-clone.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,63 @@ + +ClutterClone + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@source: +@Returns: + + + + + + + +@clone: +@source: + + + + + + + +@clone: +@Returns: + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-clone-texture.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-clone-texture.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-clone-texture.sgml 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-clone-texture.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -43,11 +43,6 @@ -@parent_class: -@_clutter_clone_1: -@_clutter_clone_2: -@_clutter_clone_3: -@_clutter_clone_4: diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-color.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-color.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-color.sgml 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-color.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -27,6 +27,18 @@ @blue: @alpha: + + + + + +@red: +@green: +@blue: +@alpha: +@Returns: + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-event.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-event.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-event.sgml 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-event.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -49,6 +49,11 @@ @CLUTTER_BUTTON3_MASK: @CLUTTER_BUTTON4_MASK: @CLUTTER_BUTTON5_MASK: +@CLUTTER_SUPER_MASK: +@CLUTTER_HYPER_MASK: +@CLUTTER_META_MASK: +@CLUTTER_RELEASE_MASK: +@CLUTTER_MODIFIER_MASK: diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-fixed.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-fixed.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-fixed.sgml 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-fixed.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -23,13 +23,6 @@ - - - - - - - @@ -184,14 +177,6 @@ @x: - - - - - -@x: - - @@ -248,14 +233,6 @@ @x: - - - - - -@x: - - @@ -264,14 +241,6 @@ @x: - - - - - -@x: - - @@ -302,98 +271,49 @@ - - - - - -@angle: - - -@angle: +@a: - + -@angle: +@a: @Returns: - + -@angle: -@Returns: +@a: - + +@a: - - - - - - - - - - - - - - - + @x: -@Returns: - - - - - - - -@x: -@Returns: - - - - - - - -@x: -@Returns: - - - - - - - -@x: -@Returns: +@y: - + @@ -403,51 +323,13 @@ @Returns: - - - - - -@op1: -@op2: -@Returns: - - - - - - - -@op1: -@op2: -@Returns: - - - - - - - -@angle: -@Returns: - - - + @x: -@Returns: - - - - - - - @y: -@x: @Returns: diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-interval.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-interval.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-interval.sgml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-interval.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,186 @@ + +Value intervals + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@validate: +@compute_value: + + + + + + +@gtype: +@Varargs: +@Returns: + + + + + + + +@gtype: +@initial: +@final: +@Returns: + + + + + + + +@interval: +@Returns: + + + + + + + +@interval: +@Returns: + + + + + + + +@interval: +@value: + + + + + + + +@interval: +@value: + + + + + + + +@interval: +@Returns: + + + + + + + +@interval: +@value: + + + + + + + +@interval: +@value: + + + + + + + +@interval: +@Returns: + + + + + + + +@interval: +@Varargs: + + + + + + + +@interval: +@Varargs: + + + + + + + +@interval: +@factor: +@value: +@Returns: + + + + + + + +@interval: +@pspec: +@Returns: + + + + + + + +@a: +@b: +@progress: +@retval: +@Returns: + + + + + + + +@value_type: +@func: + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-main.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-main.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-main.sgml 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-main.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -192,15 +192,31 @@ - + -@value: +@CLUTTER_FONT_MIPMAPPING: +@CLUTTER_FONT_HINTING: + + + + + + +@flags: + + + + + + + +@Returns: - + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-media.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-media.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-media.sgml 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-media.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -38,60 +38,46 @@ @cluttermedia: the object which received the signal. @arg1: - + - + - + - + - + - + - + - + -@base_iface: -@set_uri: -@get_uri: -@set_playing: -@get_playing: -@set_position: -@get_position: -@set_volume: -@get_volume: -@can_seek: -@get_buffer_percent: -@get_duration: -@eos: -@error: @@ -129,16 +115,16 @@ @Returns: - + @media: -@position: +@progress: - + @@ -147,7 +133,7 @@ @Returns: - + @@ -156,7 +142,7 @@ @volume: - + @@ -174,7 +160,7 @@ @Returns: - + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-path.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-path.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-path.sgml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-path.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,342 @@ + +ClutterPath + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@node: +@data: + + + + + + + +@CLUTTER_PATH_MOVE_TO: +@CLUTTER_PATH_LINE_TO: +@CLUTTER_PATH_CURVE_TO: +@CLUTTER_PATH_CLOSE: +@CLUTTER_PATH_REL_MOVE_TO: +@CLUTTER_PATH_REL_LINE_TO: +@CLUTTER_PATH_REL_CURVE_TO: + + + + + + +@Returns: + + + + + + + +@desc: +@Returns: + + + + + + + +@path: +@x: +@y: + + + + + + + +@path: +@x: +@y: + + + + + + + +@path: +@x: +@y: + + + + + + + +@path: +@x: +@y: + + + + + + + +@path: +@x_1: +@y_1: +@x_2: +@y_2: +@x_3: +@y_3: + + + + + + + +@path: +@x_1: +@y_1: +@x_2: +@y_2: +@x_3: +@y_3: + + + + + + + +@path: + + + + + + + +@path: +@str: +@Returns: + + + + + + + +@path: +@node: + + + + + + + +@path: +@cpath: + + + + + + + +@path: +@Returns: + + + + + + + +@path: +@index_: +@node: + + + + + + + +@path: +@Returns: + + + + + + + +@path: +@callback: +@user_data: + + + + + + + +@path: +@index_: +@node: + + + + + + + +@path: +@index_: + + + + + + + +@path: +@index_: +@node: + + + + + + + +@path: +@Returns: + + + + + + + +@path: +@str: +@Returns: + + + + + + + +@path: +@cr: + + + + + + + +@path: + + + + + + + +@path: +@progress: +@position: +@Returns: + + + + + + + +@path: +@Returns: + + + + + + + +@type: +@points: + + + + + + +@node: +@Returns: + + + + + + + +@node: + + + + + + + +@node_a: +@node_b: +@Returns: + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-rectangle.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-rectangle.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-rectangle.sgml 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-rectangle.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -48,11 +48,6 @@ -@parent_class: -@_clutter_rectangle1: -@_clutter_rectangle2: -@_clutter_rectangle3: -@_clutter_rectangle4: diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-shader.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-shader.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-shader.sgml 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-shader.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -149,6 +149,43 @@ @Returns: + + + + + +@shader: +@name: +@value: + + + + + + + +@shader: +@Returns: + + + + + + + +@shader: +@Returns: + + + + + + + +@shader: +@Returns: + + @@ -159,3 +196,105 @@ @value: + + + + + + + + + + + +@x: + + + + + + + +@value: +@size: +@floats: + + + + + + + +@value: +@length: +@Returns: + + + + + + + + + + + + + +@x: + + + + + + + +@value: +@size: +@ints: + + + + + + + +@value: +@length: +@Returns: + + + + + + + + + + + + + +@x: + + + + + + + +@value: +@size: +@matrix: + + + + + + + +@value: +@length: +@Returns: + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-stage.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-stage.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-stage.sgml 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-stage.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -44,6 +44,13 @@ @clutterstage: the object which received the signal. + + + + + +@clutterstage: the object which received the signal. + @@ -100,6 +107,7 @@ @unfullscreen: @activate: @deactivate: +@queue_redraw: @@ -209,7 +217,7 @@ @stage: - + @@ -217,44 +225,34 @@ @stage: - - - - - -@stage: -@event: -@Returns: - - - + @stage: -@actor: - + @stage: +@event: @Returns: - + @stage: -@Returns: +@actor: - + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-text.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-text.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-text.sgml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-text.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,659 @@ + +ClutterText + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@cluttertext: the object which received the signal. + + + + + + +@cluttertext: the object which received the signal. +@arg1: + + + + + + +@cluttertext: the object which received the signal. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@text_changed: +@activate: +@cursor_event: + + + + + + +@Returns: + + + + + + + +@font_name: +@text: +@color: +@Returns: + + + + + + + +@font_name: +@text: +@Returns: + + + + + + + +@self: +@text: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@activatable: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@alignment: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@attrs: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@color: + + + + + + + +@self: +@color: + + + + + + + +@self: +@mode: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@font_name: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@wc: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@justify: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@line_wrap: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@wrap_mode: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@max: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@selectable: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@start_pos: +@end_pos: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@selection_bound: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@single_line: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@setting: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@editable: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@text: +@position: + + + + + + + +@self: +@wc: + + + + + + + +@self: +@n_chars: + + + + + + + +@self: +@start_pos: +@end_pos: + + + + + + + +@self: +@start_pos: +@end_pos: +@Returns: + + + + + + + +@self: +@color: + + + + + + + +@self: +@color: + + + + + + + +@self: +@position: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@cursor_visible: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@size: + + + + + + + +@self: +@Returns: + + + + + + + +@self: +@Returns: + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-texture.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-texture.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-texture.sgml 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-texture.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -23,6 +23,14 @@ + + + + + +@cluttertexture: the object which received the signal. +@arg1: + @@ -64,6 +72,11 @@ + + + + + @@ -97,6 +110,7 @@ @parent_class: @size_change: @pixbuf_change: +@load_finished: @@ -284,3 +298,21 @@ @cogl_tex: + + + + + +@texture: +@Returns: + + + + + + + +@texture: +@cogl_material: + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-units.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-units.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-units.sgml 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-units.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -23,36 +23,11 @@ - - - - - -@x: - - - - - - - -@x: - - - - - - - -@x: - - - + -@x: @@ -87,7 +62,7 @@ @x: - + @@ -95,7 +70,7 @@ @x: - + @@ -103,7 +78,7 @@ @x: - + @@ -111,7 +86,7 @@ @x: - + @@ -119,7 +94,7 @@ @x: - + @@ -127,7 +102,7 @@ @x: - + @@ -135,25 +110,23 @@ @x: - + -@a: @x: - + -@a: @x: - + @@ -161,28 +134,31 @@ @x: - + -@x: +@mm: +@Returns: - + -@x: +@pt: +@Returns: - + -@x: +@em: +@Returns: diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/tmpl/clutter-unused.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/tmpl/clutter-unused.sgml --- clutter-0.8.4/doc/reference/clutter/tmpl/clutter-unused.sgml 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/tmpl/clutter-unused.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,1698 @@ + + + + + + + + + + + + + + + + + + + + + +ClutterBehaviourBspline + + + + + + + + + + + + + + + + + + + + + + + +ClutterCloneTexture + + + + + + + + + + + + + + + + + + + + + + + +Clutter Effects + + + + + + + + + + + + + + + + + + + + + + + +ClutterEntry + + + + + + + + + + + + + + + + + + + + + + + +ClutterLabel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@x: + + + + + + +@x: + + + + + + +@x: + + + + + + + + + + + + + + + + + + + + + + + + +@x: + + + + + + +@a: +@x: + + + + + + +@a: +@x: + + + + + + +@x: + + + + + + +@x: + + + + + + +@x: + + + + + + +@x: + + + + + + +@x: + + + + + + + + + + + + +@clutterbehaviourbspline: the object which received the signal. +@arg1: + + + + + + +@knot_reached: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@actor: +@user_data: + + + + + + + + + + + + + + + + + + + + + + + + +@clutterentry: the object which received the signal. + + + + + + +@clutterentry: the object which received the signal. +@arg1: + + + + + + +@clutterentry: the object which received the signal. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@paint_cursor: +@text_changed: +@cursor_event: +@activate: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@set_uri: +@get_uri: +@set_playing: +@get_playing: +@set_position: +@get_position: +@set_volume: +@get_volume: +@can_seek: +@get_buffer_percent: +@get_duration: +@eos: +@error: + + + + + + +@self: +@axis: +@x: +@y: +@z: +@Returns: + + + + + + +@self: +@scale_x: +@scale_y: + + + + + + +@self: +@axis: +@angle: +@x: +@y: +@z: + + + + + + +@self: +@scale_x: +@scale_y: + + + + + + +@mode: +@Returns: + + + + + + +@animation: +@Returns: + + + + + + +@animation: +@actor: + + + + + + +@x: +@y: +@Returns: + + + + + + +@a: +@Returns: + + + + + + +@bs: +@offset: +@knot: + + + + + + +@bs: +@knot: + + + + + + +@bs: +@first_knot: +@Varargs: + + + + + + +@bs: + + + + + + +@bs: +@knot: + + + + + + +@bs1: +@bs2: + + + + + + +@alpha: +@knots: +@n_knots: +@Returns: + + + + + + +@bs: +@knot: + + + + + + +@bs: +@offset: +@Returns: + + + + + + +@bs: +@offset: + + + + + + +@pathb: +@knot: + + + + + + +@pathb: +@first_knot: +@Varargs: + + + + + + +@pathb: + + + + + + +@pathb: +@Returns: + + + + + + +@pathb: +@offset: +@knot: + + + + + + +@pathb: +@offset: + + + + + + +@clone: +@Returns: + + + + + + +@texture: +@Returns: + + + + + + +@clone: +@texture: + + + + + + +@a: + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + +@template_: +@actor: +@depth_end: +@func: +@data: +@Returns: + + + + + + +@template_: +@actor: +@opacity_end: +@func: +@data: +@Returns: + + + + + + +@template_: +@actor: +@x: +@y: +@func: +@data: +@Returns: + + + + + + +@template_: +@actor: +@knots: +@n_knots: +@func: +@data: +@Returns: + + + + + + +@template_: +@actor: +@axis: +@angle: +@center_x: +@center_y: +@center_z: +@direction: +@func: +@data: +@Returns: + + + + + + +@template_: +@actor: +@x_scale_end: +@y_scale_end: +@func: +@data: +@Returns: + + + + + + +@template_: +@timeline: +@alpha_func: +@user_data: +@notify: + + + + + + +@template_: +@Returns: + + + + + + +@timeline: +@alpha_func: +@Returns: + + + + + + +@msecs: +@alpha_func: +@Returns: + + + + + + +@timeline: +@alpha_func: +@user_data: +@notify: +@Returns: + + + + + + +@template_: +@setting: + + + + + + +@entry: +@len: + + + + + + +@entry: +@start_pos: +@end_pos: + + + + + + +@entry: +@Returns: + + + + + + +@entry: +@color: + + + + + + +@entry: +@Returns: + + + + + + +@entry: +@Returns: + + + + + + +@entry: +@Returns: + + + + + + +@entry: +@Returns: + + + + + + +@entry: +@Returns: + + + + + + +@entry: +@Returns: + + + + + + +@entry: +@Returns: + + + + + + +@entry: +@Returns: + + + + + + +@entry: +@kev: + + + + + + +@entry: +@text: +@position: + + + + + + +@entry: +@wc: + + + + + + +@Returns: + + + + + + +@font_name: +@text: +@color: +@Returns: + + + + + + +@font_name: +@text: +@Returns: + + + + + + +@entry: +@alignment: + + + + + + +@entry: +@color: + + + + + + +@entry: +@position: + + + + + + +@entry: +@font_name: + + + + + + +@entry: +@wc: + + + + + + +@entry: +@max: + + + + + + +@entry: +@text: + + + + + + +@entry: +@visible: + + + + + + +@entry: +@visible: + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + +@Returns: + + + + + + +@label: +@Returns: + + + + + + +@label: +@Returns: + + + + + + +@label: +@color: + + + + + + +@label: +@Returns: + + + + + + +@label: +@Returns: + + + + + + +@label: +@Returns: + + + + + + +@label: +@Returns: + + + + + + +@label: +@Returns: + + + + + + +@label: +@Returns: + + + + + + +@label: +@Returns: + + + + + + +@label: +@Returns: + + + + + + +@Returns: + + + + + + +@font_name: +@text: +@color: +@Returns: + + + + + + +@font_name: +@text: +@Returns: + + + + + + +@label: +@alignment: + + + + + + +@label: +@attrs: + + + + + + +@label: +@color: + + + + + + +@label: +@mode: + + + + + + +@label: +@font_name: + + + + + + +@label: +@justify: + + + + + + +@label: +@wrap: + + + + + + +@label: +@wrap_mode: + + + + + + +@label: +@text: + + + + + + +@label: +@setting: + + + + + + +@x: +@Returns: + + + + + + +@media: +@Returns: + + + + + + +@media: +@Returns: + + + + + + +@media: +@Returns: + + + + + + +@media: +@position: + + + + + + +@media: +@volume: + + + + + + +@x: +@Returns: + + + + + + +@x: +@y: +@Returns: + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + +@value: + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + +@a: +@Returns: + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + +@x: +@Returns: + + + + + + +@x: +@Returns: + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + +@stage: +@Returns: + + + + + + +@stage: +@Returns: + + + + + + +@a: +@Returns: + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/version.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/version.xml --- clutter-0.8.4/doc/reference/clutter/version.xml 2008-12-01 11:36:55.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/version.xml 2009-01-30 12:31:31.000000000 +0000 @@ -1 +1 @@ -0.8.4 \ No newline at end of file +0.9.0 \ No newline at end of file diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-actor.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-actor.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-actor.xml 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-actor.xml 2009-01-30 12:41:02.000000000 +0000 @@ -130,11 +130,17 @@ gint x, gint y, gint z); +void clutter_actor_set_z_rotation_from_gravity + (ClutterActor *self, + gdouble angle, + ClutterGravity gravity); gdouble clutter_actor_get_rotation (ClutterActor *self, ClutterRotateAxis axis, gint *x, gint *y, gint *z); +ClutterGravity clutter_actor_get_z_rotation_gravity + (ClutterActor *self); gboolean clutter_actor_is_rotated (ClutterActor *self); void clutter_actor_set_opacity (ClutterActor *self, guint8 opacity); @@ -177,13 +183,27 @@ void clutter_actor_set_scale (ClutterActor *self, gdouble scale_x, gdouble scale_y); +void clutter_actor_set_scale_full (ClutterActor *self, + gdouble scale_x, + gdouble scale_y, + int center_x, + int center_y); +void clutter_actor_set_scale_with_gravity + (ClutterActor *self, + gdouble scale_x, + gdouble scale_y, + ClutterGravity gravity); void clutter_actor_get_scale (ClutterActor *self, gdouble *scale_x, gdouble *scale_y); +void clutter_actor_get_scale_center (ClutterActor *self, + gint *center_x, + gint *center_y); +ClutterGravity clutter_actor_get_scale_gravity (ClutterActor *self); gboolean clutter_actor_is_scaled (ClutterActor *self); void clutter_actor_apply_transform_to_point (ClutterActor *self, - ClutterVertex *point, + const ClutterVertex *point, ClutterVertex *vertex); gboolean clutter_actor_transform_stage_point (ClutterActor *self, ClutterUnit x, @@ -193,7 +213,7 @@ void clutter_actor_apply_relative_transform_to_point (ClutterActor *self, ClutterActor *ancestor, - ClutterVertex *point, + const ClutterVertex *point, ClutterVertex *vertex); void clutter_actor_get_transformed_position (ClutterActor *self, @@ -203,6 +223,7 @@ guint *width, guint *height); guint8 clutter_actor_get_paint_opacity (ClutterActor *self); +gboolean clutter_actor_get_paint_visibility (ClutterActor *self); void clutter_actor_get_abs_allocation_vertices (ClutterActor *self, ClutterVertex verts[4]); @@ -220,6 +241,8 @@ void clutter_actor_set_anchor_point_from_gravity (ClutterActor *self, ClutterGravity gravity); +ClutterGravity clutter_actor_get_anchor_point_gravity + (ClutterActor *self); void clutter_actor_move_anchor_point (ClutterActor *self, gint anchor_x, gint anchor_y); @@ -235,7 +258,14 @@ ClutterShader* clutter_actor_get_shader (ClutterActor *self); void clutter_actor_set_shader_param (ClutterActor *self, const gchar *param, + const GValue *value); +void clutter_actor_set_shader_param_float + (ClutterActor *self, + const gchar *param, gfloat value); +void clutter_actor_set_shader_param_int (ClutterActor *self, + const gchar *param, + gint value); void clutter_actor_set_depthu (ClutterActor *self, ClutterUnit depth); @@ -264,6 +294,14 @@ void clutter_actor_get_sizeu (ClutterActor *self, ClutterUnit *width, ClutterUnit *height); +void clutter_actor_set_scale_fullu (ClutterActor *self, + gdouble scale_x, + gdouble scale_y, + ClutterUnit center_x, + ClutterUnit center_y); +void clutter_actor_get_scale_centeru (ClutterActor *self, + ClutterUnit *center_x, + ClutterUnit *center_y); void clutter_actor_set_anchor_pointu (ClutterActor *self, ClutterUnit anchor_x, ClutterUnit anchor_y); @@ -305,23 +343,9 @@ ClutterUnit *width, ClutterUnit *height); -void clutter_actor_set_scalex (ClutterActor *self, - ClutterFixed scale_x, - ClutterFixed scale_y); -void clutter_actor_get_scalex (ClutterActor *self, - ClutterFixed *scale_x, - ClutterFixed *scale_y); -void clutter_actor_set_rotationx (ClutterActor *self, - ClutterRotateAxis axis, - ClutterFixed angle, - gint x, - gint y, - gint z); -ClutterFixed clutter_actor_get_rotationx (ClutterActor *self, - ClutterRotateAxis axis, - gint *x, - gint *y, - gint *z); +void clutter_actor_grab_key_focus (ClutterActor *self); +PangoContext* clutter_actor_get_pango_context (ClutterActor *self); +PangoContext* clutter_actor_create_pango_context (ClutterActor *self); @@ -334,9 +358,8 @@ +----ClutterGroup +----ClutterRectangle +----ClutterTexture - +----ClutterCloneTexture - +----ClutterLabel - +----ClutterEntry + +----ClutterClone + +----ClutterText @@ -347,7 +370,7 @@ Implemented Interfaces ClutterActor implements - + ClutterScriptable. @@ -356,6 +379,7 @@ Properties "allocation" ClutterActorBox* : Read + "anchor-gravity" ClutterGravity : Read / Write "anchor-x" gint : Read / Write "anchor-y" gint : Read / Write "clip" ClutterGeometry* : Read / Write @@ -383,6 +407,10 @@ "rotation-center-x" ClutterVertex* : Read / Write "rotation-center-y" ClutterVertex* : Read / Write "rotation-center-z" ClutterVertex* : Read / Write + "rotation-center-z-gravity" ClutterGravity : Read / Write + "scale-center-x" gint : Read / Write + "scale-center-y" gint : Read / Write + "scale-gravity" ClutterGravity : Read / Write "scale-x" gdouble : Read / Write "scale-y" gdouble : Read / Write "show-on-set-parent" gboolean : Read / Write @@ -411,6 +439,7 @@ "motion-event" : Run Last "paint" : Run Last "parent-set" : Run Last + "pick" : Run Last "realize" : Run Last "scroll-event" : Run Last "show" : Run First @@ -457,13 +486,13 @@ the actor settings by the following order of operations: Translation by actor x, y coords, + Translation by actor depth (z), Scaling by scale_x, scale_y, - Negative translation by anchor point x, - y, Rotation around z axis, Rotation around y axis, Rotation around x axis, - Translation by actor depth (z), + Negative translation by anchor point x, + y, Rectangular Clip is applied (this is not an operation on the matrix as such, but it is done as part of the transform set up). @@ -577,7 +606,7 @@ CLUTTER_ACTOR_IS_MAPPED() -CLUTTER_ACTOR_IS_MAPPED#define CLUTTER_ACTOR_IS_MAPPED(e) (((ClutterActor*)(e))->flags & CLUTTER_ACTOR_MAPPED) +CLUTTER_ACTOR_IS_MAPPED#define CLUTTER_ACTOR_IS_MAPPED(e) ((((ClutterActor*)(e))->flags & CLUTTER_ACTOR_MAPPED) != FALSE) Evaluates to TRUE if the CLUTTER_ACTOR_MAPPED flag is set. @@ -591,7 +620,7 @@ CLUTTER_ACTOR_IS_REALIZED() -CLUTTER_ACTOR_IS_REALIZED#define CLUTTER_ACTOR_IS_REALIZED(e) (((ClutterActor*)(e))->flags & CLUTTER_ACTOR_REALIZED) +CLUTTER_ACTOR_IS_REALIZED#define CLUTTER_ACTOR_IS_REALIZED(e) ((((ClutterActor*)(e))->flags & CLUTTER_ACTOR_REALIZED) != FALSE) Evaluates to TRUE if the CLUTTER_ACTOR_REALIZED flag is set. @@ -619,7 +648,7 @@ CLUTTER_ACTOR_IS_REACTIVE() -CLUTTER_ACTOR_IS_REACTIVE#define CLUTTER_ACTOR_IS_REACTIVE(e) (((ClutterActor*)(e))->flags & CLUTTER_ACTOR_REACTIVE) +CLUTTER_ACTOR_IS_REACTIVE#define CLUTTER_ACTOR_IS_REACTIVE(e) ((((ClutterActor*)(e))->flags & CLUTTER_ACTOR_REACTIVE) != FALSE) Evaluates to TRUE if the CLUTTER_ACTOR_REACTIVE flag is set. @@ -1111,7 +1140,10 @@ This function should not be called directly by applications. -Call clutter_actor_queue_redraw() to queue paints, instead. +Call clutter_actor_queue_redraw() to queue paints, instead. + + +This function will emit the "paint" signal. @@ -1129,7 +1161,11 @@ Applications rarely need to call this, as redraws are handled -automatically by modification functions. +automatically by modification functions. + + +This function will not do anything if self is not visible, or +if the actor is inside an invisible part of the scenegraph. @@ -1204,9 +1240,9 @@ Since 0.6 - + clutter_actor_pick () -clutter_actor_pickvoid clutter_actor_pick (ClutterActor *self, +clutter_actor_pickvoid clutter_actor_pick (ClutterActor *self, const ClutterColor *color); Renders a silhouette of the actor using the supplied color. Used @@ -1222,7 +1258,7 @@ each child. -Since 0.4 +This function will emit the "pick" signal. @@ -1232,7 +1268,8 @@ color : A ClutterColor - +Since 0.4 + clutter_actor_should_pick_paint () clutter_actor_should_pick_paintgboolean clutter_actor_should_pick_paint (ClutterActor *self); @@ -1418,10 +1455,10 @@ actor in the plane of ancestor. The returned vertices relate to the ClutterActorBox coordinates as follows: - v[0] contains (x1, y1) - v[1] contains (x2, y1) - v[2] contains (x1, y2) - v[3] contains (x2, y2) + verts[0] contains (x1, y1) + verts[1] contains (x2, y1) + verts[2] contains (x1, y2) + verts[3] contains (x2, y2) @@ -2035,6 +2072,32 @@ Since 0.6 + +clutter_actor_set_z_rotation_from_gravity () +clutter_actor_set_z_rotation_from_gravityvoid clutter_actor_set_z_rotation_from_gravity + (ClutterActor *self, + gdouble angle, + ClutterGravity gravity); + +Sets the rotation angle of self around the Z axis using the center +point specified as a compass point. For example to rotate such that +the center of the actor remains static you can use +CLUTTER_GRAVITY_CENTER. If the actor changes size the center point +will move accordingly. + + + +self : + a ClutterActor + +angle : + the angle of rotation + +gravity : + the center point of the rotation + +Since 1.0 + clutter_actor_get_rotation () clutter_actor_get_rotationgdouble clutter_actor_get_rotation (ClutterActor *self, @@ -2072,6 +2135,25 @@ Since 0.6 + +clutter_actor_get_z_rotation_gravity () +clutter_actor_get_z_rotation_gravityClutterGravity clutter_actor_get_z_rotation_gravity + (ClutterActor *self); + +Retrieves the center for the rotation around the Z axis as a +compass direction. If the center was specified in pixels or units +this will return CLUTTER_GRAVITY_NONE. + + + +self : + A ClutterActor + +Returns : the Z rotation center + + +Since 1.0 + clutter_actor_is_rotated () clutter_actor_is_rotatedgboolean clutter_actor_is_rotated (ClutterActor *self); @@ -2458,8 +2540,9 @@ gdouble scale_x, gdouble scale_y); -Scales an actor with the given factors. The scaling is always -relative to the anchor point. +Scales an actor with the given factors. The scaling is relative to +the scale center and the anchor point. The scale center is +unchanged by this function and defaults to 0,0. @@ -2474,6 +2557,68 @@ Since 0.2 + +clutter_actor_set_scale_full () +clutter_actor_set_scale_fullvoid clutter_actor_set_scale_full (ClutterActor *self, + gdouble scale_x, + gdouble scale_y, + int center_x, + int center_y); + +Scales an actor with the given factors around the given center +point. The center point is specified in pixels relative to the +anchor point (usually the top left corner of the actor). + + + +self : + A ClutterActor + +scale_x : + double factor to scale actor by horizontally. + +scale_y : + double factor to scale actor by vertically. + +center_x : + X coordinate of the center of the scale. + +center_y : + Y coordinate of the center of the scale + +Since 1.0 + + +clutter_actor_set_scale_with_gravity () +clutter_actor_set_scale_with_gravityvoid clutter_actor_set_scale_with_gravity + (ClutterActor *self, + gdouble scale_x, + gdouble scale_y, + ClutterGravity gravity); + +Scales an actor with the given factors around the given +center point. The center point is specified as one of the compass +directions in ClutterGravity. For example, setting it to north +will cause the top of the actor to remain unchanged and the rest of +the actor to expand left, right and downwards. + + + +self : + A ClutterActor + +scale_x : + double factor to scale actor by horizontally. + +scale_y : + double factor to scale actor by vertically. + +gravity : + the location of the scale center expressed as a compass +direction. + +Since 1.0 + clutter_actor_get_scale () clutter_actor_get_scalevoid clutter_actor_get_scale (ClutterActor *self, @@ -2495,6 +2640,48 @@ Since 0.2 + +clutter_actor_get_scale_center () +clutter_actor_get_scale_centervoid clutter_actor_get_scale_center (ClutterActor *self, + gint *center_x, + gint *center_y); + +Retrieves the scale center coordinate in pixels relative to the top +left corner of the actor. If the scale center was specified using a +ClutterGravity this will calculate the pixel offset using the +current size of the actor. + + + +self : + A ClutterActor + +center_x : + Location to store the X position of the scale center, or NULL. + +center_y : + Location to store the Y position of the scale center, or NULL. + +Since 1.0 + + +clutter_actor_get_scale_gravity () +clutter_actor_get_scale_gravityClutterGravity clutter_actor_get_scale_gravity (ClutterActor *self); + +Retrieves the scale center as a compass direction. If the scale +center was specified in pixels or units this will return +CLUTTER_GRAVITY_NONE. + + + +self : + A ClutterActor + +Returns : the scale gravity + + +Since 1.0 + clutter_actor_is_scaled () clutter_actor_is_scaledgboolean clutter_actor_is_scaled (ClutterActor *self); @@ -2515,7 +2702,7 @@ clutter_actor_apply_transform_to_point () clutter_actor_apply_transform_to_pointvoid clutter_actor_apply_transform_to_point (ClutterActor *self, - ClutterVertex *point, + const ClutterVertex *point, ClutterVertex *vertex); Transforms point in coordinates relative to the actor @@ -2591,7 +2778,7 @@ clutter_actor_apply_relative_transform_to_pointvoid clutter_actor_apply_relative_transform_to_point (ClutterActor *self, ClutterActor *ancestor, - ClutterVertex *point, + const ClutterVertex *point, ClutterVertex *vertex); Transforms point in coordinates relative to the actor into @@ -2690,6 +2877,23 @@ Since 0.8 + +clutter_actor_get_paint_visibility () +clutter_actor_get_paint_visibilitygboolean clutter_actor_get_paint_visibility (ClutterActor *self); + +Retrieves the 'paint' visibility of an actor recursively checking for non +visible parents. + + + +self : + A ClutterActor + +Returns : TRUE if the actor is visibile and will be painted. + + +Since 0.8.4 + clutter_actor_get_abs_allocation_vertices () clutter_actor_get_abs_allocation_verticesvoid clutter_actor_get_abs_allocation_vertices @@ -2806,7 +3010,7 @@ return location for the X coordinate of the anchor point anchor_y : - return location for the y coordinate of the anchor point + return location for the Y coordinate of the anchor point Since 0.6 @@ -2820,11 +3024,11 @@ convenience function wrapping clutter_actor_set_anchor_point()). -Note that the anchor is still stored as a point and the gravity -value is forgotten. For example, if you set the anchor point to -CLUTTER_GRAVITY_SOUTH_EAST and later double the size of the actor, -the anchor point will not move to the bottom right and will now be -in the center of the actor. +Since version 1.0 the anchor point will be stored as a gravity so +that if the actor changes size then the anchor point will move. For +example, if you set the anchor point to CLUTTER_GRAVITY_SOUTH_EAST +and later double the size of the actor, the anchor point will move +to the bottom right. @@ -2836,6 +3040,26 @@ Since 0.6 + +clutter_actor_get_anchor_point_gravity () +clutter_actor_get_anchor_point_gravityClutterGravity clutter_actor_get_anchor_point_gravity + (ClutterActor *self); + +Retrieves the anchor position expressed as a ClutterGravity. If +the anchor point was specified using pixels or units this will +return CLUTTER_GRAVITY_NONE. + + + +self : + a ClutterActor + +Returns : + + + +Since 1.0 + clutter_actor_move_anchor_point () clutter_actor_move_anchor_pointvoid clutter_actor_move_anchor_point (ClutterActor *self, @@ -2870,11 +3094,11 @@ unchanged. -Note that the anchor is still stored as a point and the gravity -value is forgotten. For example, if you set the anchor point to -CLUTTER_GRAVITY_SOUTH_EAST and later double the size of the actor, -the anchor point will not move to the bottom right and will now be -in the center of the actor. +Since version 1.0 the anchor point will be stored as a gravity so +that if the actor changes size then the anchor point will move. For +example, if you set the anchor point to CLUTTER_GRAVITY_SOUTH_EAST +and later double the size of the actor, the anchor point will move +to the bottom right. @@ -2958,11 +3182,11 @@ Since 0.6 - + clutter_actor_set_shader_param () -clutter_actor_set_shader_paramvoid clutter_actor_set_shader_param (ClutterActor *self, +clutter_actor_set_shader_paramvoid clutter_actor_set_shader_param (ClutterActor *self, const gchar *param, - gfloat value); + const GValue *value); Sets the value for a named parameter of the shader applied to actor. @@ -2978,7 +3202,52 @@ value : the value of the parameter -Since 0.6 +Since 1.0 + + +clutter_actor_set_shader_param_float () +clutter_actor_set_shader_param_floatvoid clutter_actor_set_shader_param_float + (ClutterActor *self, + const gchar *param, + gfloat value); + +Sets the value for a named float parameter of the shader applied +to actor. + + + +self : + a ClutterActor + +param : + the name of the parameter + +value : + the value of the parameter + +Since 0.8 + + +clutter_actor_set_shader_param_int () +clutter_actor_set_shader_param_intvoid clutter_actor_set_shader_param_int (ClutterActor *self, + const gchar *param, + gint value); + +Sets the value for a named int parameter of the shader applied to +actor. + + + +self : + a ClutterActor + +param : + the name of the parameter + +value : + the value of the parameter + +Since 0.8 clutter_actor_set_depthu () @@ -3349,6 +3618,68 @@ Since 0.6 + +clutter_actor_set_scale_fullu () +clutter_actor_set_scale_fulluvoid clutter_actor_set_scale_fullu (ClutterActor *self, + gdouble scale_x, + gdouble scale_y, + ClutterUnit center_x, + ClutterUnit center_y); + +ClutterUnit version of clutter_actor_set_scale_full(). + + +Scales an actor with the given factors around the given center +point. The center point is specified in +ClutterUnits relative to the anchor point (usually +the top left corner of the actor). + + + +self : + A ClutterActor + +scale_x : + double factor to scale actor by horizontally. + +scale_y : + double factor to scale actor by vertically. + +center_x : + X coordinate of the center of the scale. + +center_y : + Y coordinate of the center of the scale + +Since 1.0 + + +clutter_actor_get_scale_centeru () +clutter_actor_get_scale_centeruvoid clutter_actor_get_scale_centeru (ClutterActor *self, + ClutterUnit *center_x, + ClutterUnit *center_y); + +ClutterUnits version of clutter_actor_get_scale_center(). + + +Retrieves the scale center coordinate in units relative to the top +left corner of the actor. If the scale center was specified using a +ClutterGravity this will calculate the unit offset using the +current size of the actor. + + + +self : + A ClutterActor + +center_x : + Location to store the X position of the scale center, or NULL. + +center_y : + Location to store the Y position of the scale center, or NULL. + +Since 1.0 + clutter_actor_set_anchor_pointu () clutter_actor_set_anchor_pointuvoid clutter_actor_set_anchor_pointu (ClutterActor *self, @@ -3387,10 +3718,10 @@ a ClutterActor anchor_x : - return location for the X coordinace of the anchor point + return location for the X coordinate of the anchor point anchor_y : - return location for the X coordinace of the anchor point + return location for the Y coordinate of the anchor point Since 0.6 @@ -3648,125 +3979,71 @@ Since 0.8 - -clutter_actor_set_scalex () -clutter_actor_set_scalexvoid clutter_actor_set_scalex (ClutterActor *self, - ClutterFixed scale_x, - ClutterFixed scale_y); + +clutter_actor_grab_key_focus () +clutter_actor_grab_key_focusvoid clutter_actor_grab_key_focus (ClutterActor *self); -Fixed point version of clutter_actor_set_scale(). - - -Scales an actor with the given factors. The scaling is always -relative to the anchor point. +Sets the key focus of the ClutterStage including self +to this ClutterActor. self : - A ClutterActor - -scale_x : - ClutterFixed factor to scale actor by horizontally. - -scale_y : - ClutterFixed factor to scale actor by vertically. + a ClutterActor - - -clutter_actor_get_scalex () -clutter_actor_get_scalexvoid clutter_actor_get_scalex (ClutterActor *self, - ClutterFixed *scale_x, - ClutterFixed *scale_y); +Since 1.0 + + +clutter_actor_get_pango_context () +clutter_actor_get_pango_contextPangoContext* clutter_actor_get_pango_context (ClutterActor *self); -Fixed point version of clutter_actor_get_scale(). +Retrieves the PangoContext for self. The actor's PangoContext +is already configured using the appropriate font map, resolution +and font options. -Retrieves the scale factors of an actor. - - - -self : - A ClutterActor - -scale_x : - Location to store horizonal scale factor, or NULL. - -scale_y : - Location to store vertical scale factor, or NULL. - -Since 0.2 - - -clutter_actor_set_rotationx () -clutter_actor_set_rotationxvoid clutter_actor_set_rotationx (ClutterActor *self, - ClutterRotateAxis axis, - ClutterFixed angle, - gint x, - gint y, - gint z); - -Sets the rotation angle of self around the given axis. +Unlike clutter_actor_create_pango_context(), this context is owend +by the ClutterActor and it will be updated each time the options +stored by the ClutterBackend change. -This function is the fixed point variant of clutter_actor_set_rotation(). +You can use the returned PangoContext to create a PangoLayout +and render text using cogl_pango_render_layout() to reuse the +glyphs cache also used by Clutter. self : a ClutterActor -axis : - the axis of rotation - -angle : - the angle of rotation - -x : - X coordinate of the rotation center - -y : - Y coordinate of the rotation center - -z : - Z coordinate of the rotation center +Returns : the PangoContext for a ClutterActor. The returned + PangoContext is owned by the actor and should not be unreferenced + by the application code + -Since 0.6 +Since 1.0 - -clutter_actor_get_rotationx () -clutter_actor_get_rotationxClutterFixed clutter_actor_get_rotationx (ClutterActor *self, - ClutterRotateAxis axis, - gint *x, - gint *y, - gint *z); + +clutter_actor_create_pango_context () +clutter_actor_create_pango_contextPangoContext* clutter_actor_create_pango_context (ClutterActor *self); -Retrieves the angle and center of rotation on the given axis, -set using clutter_actor_set_rotation(). +Creates a PangoContext for the given actor. The PangoContext +is already configured using the appropriate font map, resolution +and font options. -This function is the fixed point variant of clutter_actor_get_rotation(). +See also clutter_actor_get_pango_context(). self : a ClutterActor -axis : - the axis of rotation - -x : - return value for the X coordinate of the center of rotation - -y : - return value for the Y coordinate of the center of rotation - -z : - return value for the Z coordinate of the center of rotation - -Returns : the angle of rotation as a fixed point value. +Returns : the newly created PangoContext. Use g_object_ref() + on the returned value to deallocate its resources -Since 0.6 +Since 1.0 @@ -3783,15 +4060,39 @@ Since 0.8 +The <literal>"anchor-gravity"</literal> property +ClutterActor:anchor-gravity "anchor-gravity" ClutterGravity : Read / Write + +The anchor point expressed as a ClutterGravity. + + +Default value: CLUTTER_GRAVITY_NONE +Since 1.0 + + The <literal>"anchor-x"</literal> property -ClutterActor:anchor-x "anchor-x" gint : Read / Write -X coordinate of the anchor point.Allowed values: >= -2147483647 +ClutterActor:anchor-x "anchor-x" gint : Read / Write + +The X coordinate of an actor's anchor point, relative to +the actor coordinate space, in pixels. + + +Allowed values: >= -2147483647 Default value: 0 +Since 0.8 + The <literal>"anchor-y"</literal> property -ClutterActor:anchor-y "anchor-y" gint : Read / Write -Y coordinate of the anchor point.Allowed values: >= -2147483647 +ClutterActor:anchor-y "anchor-y" gint : Read / Write + +The Y coordinate of an actor's anchor point, relative to +the actor coordinate space, in pixels. + + +Allowed values: >= -2147483647 Default value: 0 +Since 0.8 + The <literal>"clip"</literal> property ClutterActor:clip "clip" ClutterGeometry* : Read / Write @@ -4035,38 +4336,126 @@ The <literal>"rotation-angle-x"</literal> property -ClutterActor:rotation-angle-x "rotation-angle-x" gdouble : Read / Write -The rotation angle on the X axis.Allowed values: >= 0 +ClutterActor:rotation-angle-x "rotation-angle-x" gdouble : Read / Write + +The rotation angle on the X axis. + + +Allowed values: >= 0 Default value: 0 +Since 0.6 + The <literal>"rotation-angle-y"</literal> property -ClutterActor:rotation-angle-y "rotation-angle-y" gdouble : Read / Write -The rotation angle on the Y axis.Allowed values: >= 0 +ClutterActor:rotation-angle-y "rotation-angle-y" gdouble : Read / Write + +The rotation angle on the Y axis. + + +Allowed values: >= 0 Default value: 0 +Since 0.6 + The <literal>"rotation-angle-z"</literal> property -ClutterActor:rotation-angle-z "rotation-angle-z" gdouble : Read / Write -The rotation angle on the Z axis.Allowed values: >= 0 +ClutterActor:rotation-angle-z "rotation-angle-z" gdouble : Read / Write + +The rotation angle on the Z axis. + + +Allowed values: >= 0 Default value: 0 +Since 0.6 + The <literal>"rotation-center-x"</literal> property -ClutterActor:rotation-center-x "rotation-center-x" ClutterVertex* : Read / Write -The rotation center on the X axis. +ClutterActor:rotation-center-x "rotation-center-x" ClutterVertex* : Read / Write + +The rotation center on the X axis. + + +Since 0.6 + + The <literal>"rotation-center-y"</literal> property -ClutterActor:rotation-center-y "rotation-center-y" ClutterVertex* : Read / Write -The rotation center on the Y axis. +ClutterActor:rotation-center-y "rotation-center-y" ClutterVertex* : Read / Write + +The rotation center on the Y axis. + + +Since 0.6 + + The <literal>"rotation-center-z"</literal> property -ClutterActor:rotation-center-z "rotation-center-z" ClutterVertex* : Read / Write -The rotation center on the Z axis. +ClutterActor:rotation-center-z "rotation-center-z" ClutterVertex* : Read / Write + +The rotation center on the Z axis. + + +Since 0.6 + + +The <literal>"rotation-center-z-gravity"</literal> property +ClutterActor:rotation-center-z-gravity "rotation-center-z-gravity" ClutterGravity : Read / Write + +The rotation center on the Z axis expressed as a ClutterGravity. + + +Default value: CLUTTER_GRAVITY_NONE +Since 1.0 + + +The <literal>"scale-center-x"</literal> property +ClutterActor:scale-center-x "scale-center-x" gint : Read / Write + +The horizontal center point for scaling + + +Default value: 0 +Since 1.0 + + +The <literal>"scale-center-y"</literal> property +ClutterActor:scale-center-y "scale-center-y" gint : Read / Write + +The vertical center point for scaling + + +Default value: 0 +Since 1.0 + + +The <literal>"scale-gravity"</literal> property +ClutterActor:scale-gravity "scale-gravity" ClutterGravity : Read / Write + +The center point for scaling expressed as a ClutterGravity + + +Default value: CLUTTER_GRAVITY_NONE +Since 1.0 + + The <literal>"scale-x"</literal> property -ClutterActor:scale-x "scale-x" gdouble : Read / Write -Scale factor on the X axis.Allowed values: >= 0 +ClutterActor:scale-x "scale-x" gdouble : Read / Write + +The horizontal scale of the actor + + +Allowed values: >= 0 Default value: 1 +Since 0.6 + The <literal>"scale-y"</literal> property -ClutterActor:scale-y "scale-y" gdouble : Read / Write -Scale factor on the Y axis.Allowed values: >= 0 +ClutterActor:scale-y "scale-y" gdouble : Read / Write + +The vertical scale of the actor + + +Allowed values: >= 0 Default value: 1 +Since 0.6 + The <literal>"show-on-set-parent"</literal> property ClutterActor:show-on-set-parent "show-on-set-parent" gboolean : Read / Write @@ -4440,6 +4829,35 @@ user_data : user data set when the signal handler was connected. Since 0.2 +The <literal>"pick"</literal> signal +ClutterActor::pickvoid user_function (ClutterActor *actor, + ClutterColor *color, + gpointer user_data) : Run Last + +The ::pick signal is emitted each time an actor is being painted +in "pick mode". The pick mode is used to identify the actor during +the event handling phase, or by clutter_stage_get_actor_at_pos(). +The actor should paint its shape using the passed pick_color. + + +Subclasses of ClutterActor should override the class signal handler +and paint themselves in that function. + + +It is possible to connect a handler to the ::pick signal in order +to set up some custom aspect of a paint in pick mode. + + + +actor : + the ClutterActor that received the signal + +color : + the ClutterColor to be used when picking + +user_data : +user data set when the signal handler was connected. +Since 1.0 The <literal>"realize"</literal> signal ClutterActor::realizevoid user_function (ClutterActor *actor, gpointer user_data) : Run Last diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-alpha.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-alpha.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-alpha.xml 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-alpha.xml 2009-01-30 12:41:02.000000000 +0000 @@ -24,60 +24,33 @@ ClutterAlpha; ClutterAlphaClass; +gdouble (*ClutterAlphaFunc) (ClutterAlpha *alpha, + gpointer user_data); ClutterAlpha* clutter_alpha_new (void); ClutterAlpha* clutter_alpha_new_full (ClutterTimeline *timeline, + gulong mode); +ClutterAlpha* clutter_alpha_new_with_func (ClutterTimeline *timeline, ClutterAlphaFunc func, gpointer data, GDestroyNotify destroy); -guint32 clutter_alpha_get_alpha (ClutterAlpha *alpha); -#define CLUTTER_ALPHA_MAX_ALPHA -guint32 (*ClutterAlphaFunc) (ClutterAlpha *alpha, - gpointer user_data); +void clutter_alpha_set_timeline (ClutterAlpha *alpha, + ClutterTimeline *timeline); +ClutterTimeline* clutter_alpha_get_timeline (ClutterAlpha *alpha); +void clutter_alpha_set_mode (ClutterAlpha *alpha, + gulong mode); +gulong clutter_alpha_get_mode (ClutterAlpha *alpha); +gdouble clutter_alpha_get_alpha (ClutterAlpha *alpha); + void clutter_alpha_set_func (ClutterAlpha *alpha, ClutterAlphaFunc func, gpointer data, GDestroyNotify destroy); void clutter_alpha_set_closure (ClutterAlpha *alpha, GClosure *closure); -void clutter_alpha_set_timeline (ClutterAlpha *alpha, - ClutterTimeline *timeline); -ClutterTimeline* clutter_alpha_get_timeline (ClutterAlpha *alpha); -#define CLUTTER_ALPHA_RAMP_INC -guint32 clutter_ramp_inc_func (ClutterAlpha *alpha, - gpointer dummy); -#define CLUTTER_ALPHA_RAMP_DEC -guint32 clutter_ramp_dec_func (ClutterAlpha *alpha, - gpointer dummy); -#define CLUTTER_ALPHA_RAMP -guint32 clutter_ramp_func (ClutterAlpha *alpha, - gpointer dummy); -#define CLUTTER_ALPHA_SINE -guint32 clutter_sine_func (ClutterAlpha *alpha, - gpointer dummy); -#define CLUTTER_ALPHA_SINE_INC -guint32 clutter_sine_inc_func (ClutterAlpha *alpha, - gpointer dummy); -#define CLUTTER_ALPHA_SINE_DEC -guint32 clutter_sine_dec_func (ClutterAlpha *alpha, - gpointer dummy); -#define CLUTTER_ALPHA_SINE_HALF -guint32 clutter_sine_half_func (ClutterAlpha *alpha, - gpointer dummy); -#define CLUTTER_ALPHA_SQUARE -guint32 clutter_square_func (ClutterAlpha *alpha, - gpointer dummy); -#define CLUTTER_ALPHA_SMOOTHSTEP_INC -guint32 clutter_smoothstep_inc_func (ClutterAlpha *alpha, - gpointer dummy); -#define CLUTTER_ALPHA_SMOOTHSTEP_DEC -guint32 clutter_smoothstep_dec_func (ClutterAlpha *alpha, - gpointer dummy); -#define CLUTTER_ALPHA_EXP_INC -guint32 clutter_exp_inc_func (ClutterAlpha *alpha, - gpointer dummy); -#define CLUTTER_ALPHA_EXP_DEC -guint32 clutter_exp_dec_func (ClutterAlpha *alpha, - gpointer dummy); + +gulong clutter_alpha_register_closure (GClosure *closure); +gulong clutter_alpha_register_func (ClutterAlphaFunc func, + gpointer data); @@ -98,7 +71,8 @@ Properties - "alpha" guint : Read + "alpha" gdouble : Read + "mode" gulong : Read / Write / Construct "timeline" ClutterTimeline* : Read / Write @@ -108,23 +82,42 @@ Description -ClutterAlpha is a class for calculating an integer value between -0 and CLUTTER_ALPHA_MAX_ALPHA as a function of time. You should -provide a ClutterTimeline and bind it to the ClutterAlpha object; -you should also provide a function returning the alpha value depending -on the position inside the timeline; this function will be executed -each time a new frame in the ClutterTimeline is reached. Since the -alpha function is controlled by the timeline instance, you can pause -or stop the ClutterAlpha from calling the alpha function by controlling -the ClutterTimeline object. - - -ClutterAlpha is used to "drive" a ClutterBehaviour instance. - - -
    - Graphic representation of some alpha functions - +ClutterAlpha is a class for calculating an floating point value +dependent only on the position of a ClutterTimeline. + + +A ClutterAlpha binds a ClutterTimeline to a progress function which +translates the time T into an adimensional factor alpha. The factor can +then be used to drive a ClutterBehaviour, which will translate the +alpha value into something meaningful for a ClutterActor. + + +You should provide a ClutterTimeline and bind it to the ClutterAlpha +instance using clutter_alpha_set_timeline(). You should also set an +"animation mode", either by using the ClutterAnimatioMode values that +Clutter itself provides or by registering custom functions using +clutter_alpha_register_func(). + + +Instead of a ClutterAnimationMode you may provide a function returning +the alpha value depending on the progress of the timeline, using +clutter_alpha_set_func() or clutter_alpha_set_closure(). The alpha +function will be executed each time a new frame in the ClutterTimeline +is reached. + + +Since the alpha function is controlled by the timeline instance, you can +pause, stop or resume the ClutterAlpha from calling the alpha function by +using the appropriate functions of the ClutterTimeline object. + + +ClutterAlpha is used to "drive" a ClutterBehaviour instance, and it +is internally used by the ClutterAnimation API. + + +
    + Easing modes provided by Clutter +
    @@ -155,6 +148,27 @@ Since 0.2 + +ClutterAlphaFunc () +ClutterAlphaFuncgdouble (*ClutterAlphaFunc) (ClutterAlpha *alpha, + gpointer user_data); + +A function returning a value depending on the position of +the ClutterTimeline bound to alpha. + + + +alpha : + a ClutterAlpha + +user_data : + user data passed to the function + +Returns : a floating point value + + +Since 0.2 + clutter_alpha_new () clutter_alpha_newClutterAlpha* clutter_alpha_new (void); @@ -175,128 +189,64 @@ Since 0.2 - + clutter_alpha_new_full () -clutter_alpha_new_fullClutterAlpha* clutter_alpha_new_full (ClutterTimeline *timeline, - ClutterAlphaFunc func, - gpointer data, - GDestroyNotify destroy); +clutter_alpha_new_fullClutterAlpha* clutter_alpha_new_full (ClutterTimeline *timeline, + gulong mode); Creates a new ClutterAlpha instance and sets the timeline -and alpha function. +and animation mode. + + +See also clutter_alpha_set_timeline() and clutter_alpha_set_mode(). timeline : ClutterTimeline timeline -func : - ClutterAlphaFunc alpha function - -data : - data to be passed to the alpha function - -destroy : - notify to be called when removing the alpha function +mode : + animation mode Returns : the newly created ClutterAlpha -Since 0.2 - - -clutter_alpha_get_alpha () -clutter_alpha_get_alphaguint32 clutter_alpha_get_alpha (ClutterAlpha *alpha); - -Query the current alpha value. - - - -alpha : - A ClutterAlpha - -Returns : The current alpha value for the alpha - - -Since 0.2 - - -CLUTTER_ALPHA_MAX_ALPHA -CLUTTER_ALPHA_MAX_ALPHA#define CLUTTER_ALPHA_MAX_ALPHA 0xffff - - -Maximum value returned by ClutterAlphaFunc - - -Since 0.2 - - -ClutterAlphaFunc () -ClutterAlphaFuncguint32 (*ClutterAlphaFunc) (ClutterAlpha *alpha, - gpointer user_data); - -A function of time, which returns a value between 0 and -CLUTTER_ALPHA_MAX_ALPHA. - - - -alpha : - a ClutterAlpha - -user_data : - user data passed to the function - -Returns : an unsigned integer value, between 0 and -CLUTTER_ALPHA_MAX_ALPHA. - - -Since 0.2 +Since 1.0 - -clutter_alpha_set_func () -clutter_alpha_set_funcvoid clutter_alpha_set_func (ClutterAlpha *alpha, + +clutter_alpha_new_with_func () +clutter_alpha_new_with_funcClutterAlpha* clutter_alpha_new_with_func (ClutterTimeline *timeline, ClutterAlphaFunc func, gpointer data, GDestroyNotify destroy); -Sets the ClutterAlphaFunc function used to compute -the alpha value at each frame of the ClutterTimeline -bound to alpha. +Creates a new ClutterAlpha instances and sets the timeline +and the alpha function. + + +This function will not register func as a global alpha function. + + +See also clutter_alpha_set_timeline() and clutter_alpha_set_func(). -alpha : - A ClutterAlpha +timeline : + a ClutterTimeline func : - A ClutterAlphaAlphaFunc + a ClutterAlphaFunc data : - user data to be passed to the alpha function, or NULL + data to pass to the function, or NULL destroy : - notify function used when disposing the alpha function + function to call when removing the alpha function, or NULL -Since 0.2 - - -clutter_alpha_set_closure () -clutter_alpha_set_closurevoid clutter_alpha_set_closure (ClutterAlpha *alpha, - GClosure *closure); - -Sets the GClosure used to compute -the alpha value at each frame of the ClutterTimeline -bound to alpha. - +Returns : the newly created ClutterAlpha - -alpha : - A ClutterAlpha -closure : - A GClosure - -Since 0.8 +Since 1.0 clutter_alpha_set_timeline () @@ -331,397 +281,185 @@ Since 0.2 - -CLUTTER_ALPHA_RAMP_INC -CLUTTER_ALPHA_RAMP_INC#define CLUTTER_ALPHA_RAMP_INC clutter_ramp_inc_func - + +clutter_alpha_set_mode () +clutter_alpha_set_modevoid clutter_alpha_set_mode (ClutterAlpha *alpha, + gulong mode); -Convenience symbol for clutter_ramp_inc_func(). - - -Since 0.2 - - -clutter_ramp_inc_func () -clutter_ramp_inc_funcguint32 clutter_ramp_inc_func (ClutterAlpha *alpha, - gpointer dummy); - -Convenience alpha function for a monotonic increasing ramp. You -can use this function as the alpha function for clutter_alpha_set_func(). +Sets the progress function of alpha using the symbolic value +of mode, as taken by the ClutterAnimationMode enumeration or +using the value returned by clutter_alpha_register_func(). alpha : a ClutterAlpha -dummy : - unused argument - -Returns : an alpha value. - +mode : + a ClutterAnimationMode -Since 0.2 +Since 1.0 - -CLUTTER_ALPHA_RAMP_DEC -CLUTTER_ALPHA_RAMP_DEC#define CLUTTER_ALPHA_RAMP_DEC clutter_ramp_dec_func - + +clutter_alpha_get_mode () +clutter_alpha_get_modegulong clutter_alpha_get_mode (ClutterAlpha *alpha); -Convenience symbol for clutter_ramp_dec_func(). - - -Since 0.2 - - -clutter_ramp_dec_func () -clutter_ramp_dec_funcguint32 clutter_ramp_dec_func (ClutterAlpha *alpha, - gpointer dummy); - -Convenience alpha function for a monotonic decreasing ramp. You -can use this function as the alpha function for clutter_alpha_set_func(). +Retrieves the ClutterAnimatioMode used by alpha. alpha : a ClutterAlpha -dummy : - unused argument - -Returns : an alpha value. +Returns : the animation mode -Since 0.2 +Since 1.0 - -CLUTTER_ALPHA_RAMP -CLUTTER_ALPHA_RAMP#define CLUTTER_ALPHA_RAMP clutter_ramp_func - - -Convenience symbol for clutter_ramp_func(). + +clutter_alpha_get_alpha () +clutter_alpha_get_alphagdouble clutter_alpha_get_alpha (ClutterAlpha *alpha); - -Since 0.2 - - -clutter_ramp_func () -clutter_ramp_funcguint32 clutter_ramp_func (ClutterAlpha *alpha, - gpointer dummy); - -Convenience alpha function for a full ramp function (increase for -half the time, decrease for the remaining half). You can use this -function as the alpha function for clutter_alpha_set_func(). +Query the current alpha value. alpha : - a ClutterAlpha - -dummy : - unused argument + A ClutterAlpha -Returns : an alpha value. +Returns : The current alpha value for the alpha Since 0.2 - -CLUTTER_ALPHA_SINE -CLUTTER_ALPHA_SINE#define CLUTTER_ALPHA_SINE clutter_sine_func - - -Convenience symbol for clutter_sine_func(). + +clutter_alpha_set_func () +clutter_alpha_set_funcvoid clutter_alpha_set_func (ClutterAlpha *alpha, + ClutterAlphaFunc func, + gpointer data, + GDestroyNotify destroy); - -Since 0.2 - - -clutter_sine_func () -clutter_sine_funcguint32 clutter_sine_func (ClutterAlpha *alpha, - gpointer dummy); +Sets the ClutterAlphaFunc function used to compute +the alpha value at each frame of the ClutterTimeline +bound to alpha. + -Convenience alpha function for a sine wave. You can use this -function as the alpha function for clutter_alpha_set_func(). +This function will not register func as a global alpha function. alpha : - a ClutterAlpha - -dummy : - unused argument - -Returns : an alpha value. - + A ClutterAlpha -Since 0.2 - - -CLUTTER_ALPHA_SINE_INC -CLUTTER_ALPHA_SINE_INC#define CLUTTER_ALPHA_SINE_INC clutter_sine_inc_func - - -Convenience symbol for clutter_sine_inc_func(). - - -Since 0.2 - - -clutter_sine_inc_func () -clutter_sine_inc_funcguint32 clutter_sine_inc_func (ClutterAlpha *alpha, - gpointer dummy); - -Convenience alpha function for a sine wave over interval [0, pi / 2]. -You can use this function as the alpha function for -clutter_alpha_set_func(). - - - -alpha : - a ClutterAlpha +func : + A ClutterAlphaFunc -dummy : - unused argument +data : + user data to be passed to the alpha function, or NULL -Returns : an alpha value. - +destroy : + notify function used when disposing the alpha function Since 0.2 - -CLUTTER_ALPHA_SINE_DEC -CLUTTER_ALPHA_SINE_DEC#define CLUTTER_ALPHA_SINE_DEC clutter_sine_dec_func - - -Convenience symbol for clutter_sine_dec_func(). - - -Since 0.2 - - -clutter_sine_dec_func () -clutter_sine_dec_funcguint32 clutter_sine_dec_func (ClutterAlpha *alpha, - gpointer dummy); - -Convenience alpha function for a sine wave over interval [pi / 2, pi]. -You can use this function as the alpha function for -clutter_alpha_set_func(). - - - -alpha : - a ClutterAlpha - -dummy : - unused argument - -Returns : an alpha value. - - -Since 0.4 - - -CLUTTER_ALPHA_SINE_HALF -CLUTTER_ALPHA_SINE_HALF#define CLUTTER_ALPHA_SINE_HALF clutter_sine_half_func - - -Convenience symbol for clutter_sine_half_func(). - - -Since 0.4 - - -clutter_sine_half_func () -clutter_sine_half_funcguint32 clutter_sine_half_func (ClutterAlpha *alpha, - gpointer dummy); - -Convenience alpha function for a sine wave over interval [0, pi]. -You can use this function as the alpha function for -clutter_alpha_set_func(). - - - -alpha : - a ClutterAlpha - -dummy : - unused argument - -Returns : an alpha value. - - -Since 0.4 - - -CLUTTER_ALPHA_SQUARE -CLUTTER_ALPHA_SQUARE#define CLUTTER_ALPHA_SQUARE clutter_square_func - - -Convenience symbol for clutter_square_func(). - - -Since 0.4 - - -clutter_square_func () -clutter_square_funcguint32 clutter_square_func (ClutterAlpha *alpha, - gpointer dummy); - -Convenience alpha function for a square wave. You can use this -function as the alpha function for clutter_alpha_set_func(). - - - -alpha : - a ClutterAlpha - -dummy : - unused argument - -Returns : an alpha value - - -Since 0.4 - - -CLUTTER_ALPHA_SMOOTHSTEP_INC -CLUTTER_ALPHA_SMOOTHSTEP_INC#define CLUTTER_ALPHA_SMOOTHSTEP_INC clutter_smoothstep_inc_func - - -Convenience symbol for clutter_smoothstep_inc_func(). - - -Since 0.4 - - -clutter_smoothstep_inc_func () -clutter_smoothstep_inc_funcguint32 clutter_smoothstep_inc_func (ClutterAlpha *alpha, - gpointer dummy); - -Convenience alpha function for a smoothstep curve. You can use this -function as the alpha function for clutter_alpha_set_func(). - - - -alpha : - a ClutterAlpha - -dummy : - unused - -Returns : an alpha value - - -Since 0.4 - - -CLUTTER_ALPHA_SMOOTHSTEP_DEC -CLUTTER_ALPHA_SMOOTHSTEP_DEC#define CLUTTER_ALPHA_SMOOTHSTEP_DEC clutter_smoothstep_dec_func - - -Convenience symbol for clutter_smoothstep_dec_func(). - - -Since 0.4 - - -clutter_smoothstep_dec_func () -clutter_smoothstep_dec_funcguint32 clutter_smoothstep_dec_func (ClutterAlpha *alpha, - gpointer dummy); + +clutter_alpha_set_closure () +clutter_alpha_set_closurevoid clutter_alpha_set_closure (ClutterAlpha *alpha, + GClosure *closure); -Convenience alpha function for a downward smoothstep curve. You can use -this function as the alpha function for clutter_alpha_set_func(). +Sets the GClosure used to compute the alpha value at each +frame of the ClutterTimeline bound to alpha. alpha : - a ClutterAlpha - -dummy : - unused + A ClutterAlpha -Returns : an alpha value - +closure : + A GClosure -Since 0.4 +Since 0.8 - -CLUTTER_ALPHA_EXP_INC -CLUTTER_ALPHA_EXP_INC#define CLUTTER_ALPHA_EXP_INC clutter_exp_inc_func - + +clutter_alpha_register_closure () +clutter_alpha_register_closuregulong clutter_alpha_register_closure (GClosure *closure); -Convenience symbol for clutter_exp_inc_func() +GClosure variant of clutter_alpha_register_func(). + - -Since 0.4 - - -clutter_exp_inc_func () -clutter_exp_inc_funcguint32 clutter_exp_inc_func (ClutterAlpha *alpha, - gpointer dummy); +Registers a global alpha function and returns its logical id +to be used by clutter_alpha_set_mode() or by ClutterAnimation. + -Convenience alpha function for a 2^x curve. You can use this function as the -alpha function for clutter_alpha_set_func(). +The logical id is always greater than CLUTTER_ANIMATION_LAST. -alpha : - a ClutterAlpha - -dummy : - unused argument +closure : + a GClosure -Returns : an alpha value. +Returns : the logical id of the alpha function -Since 0.4 +Since 1.0 - -CLUTTER_ALPHA_EXP_DEC -CLUTTER_ALPHA_EXP_DEC#define CLUTTER_ALPHA_EXP_DEC clutter_exp_dec_func - + +clutter_alpha_register_func () +clutter_alpha_register_funcgulong clutter_alpha_register_func (ClutterAlphaFunc func, + gpointer data); -Convenience symbold for clutter_exp_dec_func(). - - -Since 0.4 - - -clutter_exp_dec_func () -clutter_exp_dec_funcguint32 clutter_exp_dec_func (ClutterAlpha *alpha, - gpointer dummy); +Registers a global alpha function and returns its logical id +to be used by clutter_alpha_set_mode() or by ClutterAnimation. + -Convenience alpha function for a decreasing 2^x curve. You can use this -function as the alpha function for clutter_alpha_set_func(). +The logical id is always greater than CLUTTER_ANIMATION_LAST. -alpha : - a ClutterAlpha +func : + a ClutterAlphaFunc -dummy : - unused argument +data : + user data to pass to func, or NULL -Returns : an alpha value. +Returns : the logical id of the alpha function -Since 0.4 +Since 1.0 Property Details The <literal>"alpha"</literal> property -ClutterAlpha:alpha "alpha" guint : Read +ClutterAlpha:alpha "alpha" gdouble : Read -The alpha value as computed by the alpha function. +The alpha value as computed by the alpha function. The linear +interval is 0.0 to 1.0, but the Alpha allows overshooting by +one unit in each direction, so the valid interval is -1.0 to 2.0. -Allowed values: <= 65535 +Allowed values: [-1,2] Default value: 0 Since 0.2 +The <literal>"mode"</literal> property +ClutterAlpha:mode "mode" gulong : Read / Write / Construct + +The progress function logical id - either a value from the +ClutterAnimationMode enumeration or a value returned by +clutter_alpha_register_func(). + + +If CLUTTER_CUSTOM_MODE is used then the function set using +clutter_alpha_set_closure() or clutter_alpha_set_func() +will be used. + + +Since 1.0 + + The <literal>"timeline"</literal> property ClutterAlpha:timeline "timeline" ClutterTimeline* : Read / Write diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-animatable.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-animatable.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-animatable.xml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-animatable.xml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,165 @@ + + +]> + + + +ClutterAnimatable +3 +CLUTTER Library + + + +ClutterAnimatable +Interface for animatable classes + + + + +Synopsis + + + ClutterAnimatable; + ClutterAnimatableIface; +void clutter_animatable_animate_property (ClutterAnimatable *animatable, + ClutterAnimation *animation, + const gchar *property_name, + const GValue *initial_value, + const GValue *final_value, + gdouble progress, + GValue *value); + + + + +Object Hierarchy + + GInterface + +----ClutterAnimatable + + + + + + + + + + + + +Description + +ClutterAnimatable is an interface that allows a GObject class +to control how a ClutterAnimation will animate a property. + + +Each ClutterAnimatable should implement the animate_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. + + +If a ClutterAnimatable is animated by a ClutterAnimation +instance, the ClutterAnimation will call +clutter_animatable_animate_property() passing the name of the +currently animated property; the initial and final values of +the animation interval; the progress factor. The ClutterAnimatable +implementation should return the computed value for the animated +property. + + +ClutterAnimatable is available since Clutter 1.0 + + + + + + +Details + +ClutterAnimatable +ClutterAnimatabletypedef struct _ClutterAnimatable ClutterAnimatable; + + + + +ClutterAnimatableIface +ClutterAnimatableIfacetypedef struct { + void (* animate_property) (ClutterAnimatable *animatable, + ClutterAnimation *animation, + const gchar *property_name, + const GValue *initial_value, + const GValue *final_value, + gdouble progress, + GValue *value); +} ClutterAnimatableIface; + + +Base interface for GObjects that can be animated by a +a ClutterAnimation. + + + + +animate_property () + virtual function for animating a property + + +Since 1.0 + + +clutter_animatable_animate_property () +clutter_animatable_animate_propertyvoid clutter_animatable_animate_property (ClutterAnimatable *animatable, + ClutterAnimation *animation, + const gchar *property_name, + const GValue *initial_value, + const GValue *final_value, + gdouble progress, + GValue *value); + +Calls the animate_property() virtual function for animatable. + + +The initial_value and final_value GValues must contain +the same type; value must have been initialized to the same +type of initial_value and final_value. + + +All implementation of the ClutterAnimatable interface must +implement this function. + + + +animatable : + a ClutterAnimatable + +animation : + a ClutterAnimation + +property_name : + the name of the animated property + +initial_value : + the initial value of the animation interval + +final_value : + the final value of the animation interval + +progress : + the progress factor + +value : + return location for the animation value + +Since 1.0 + + + + + + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-animation-tutorial.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-animation-tutorial.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-animation-tutorial.xml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-animation-tutorial.xml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,558 @@ + + + + Matthew + Allum + +
    + mallumopenedhand.com +
    +
    +
    +
    + + Creating Animations with Clutter + + + + With Clutter using hardware accelration for graphics rendering, + complex and fast animations are possible. This chapter describes basic + techniques and the utilities Clutter provides in aiding animation + creation. + + + +
    + Basic Animations + + + + The most basic way to create animations with Clutter is via the use of + g_timeout_add(). This enables a callback function to be called at a + defined interval. The callback function can then modify actors visual + properties as to produce an animation. + + + + + + Simple Rotation... + + +struct RotationClosure { + ClutterActor *actor; + ClutterFixed final_angle; + ClutterFixed current_angle; +}; + +static gboolean +rotate_actor (gpointer data) +{ + RotationClosure *clos = data; + + clutter_actor_set_rotationx (clos->actor, clos->current_angle, 0, 0, 0); + + /* add one degree */ + clos->current_angle += COGL_FIXED_ONE; + + if (clos->current_angle == clos->final_angle) + return FALSE; + + return TRUE; +} + +static void +rotate_actor_cleanup (gpointer data) +{ + RotationClosure *clos = data; + + g_object_unref (clos->actor); + g_free (clos); +} + +... + RotationClosure *clos = NULL; + + clos = g_new (RotationClosure, 1); + clos->actor = g_object_ref (an_actor); + clos->final_angle = CLUTTER_FLOAT_TO_FIXED (360.0); + clos->current_angle = 0; + + g_timeout_add_full (1000 / 360, /* fps to interval in milliseconds */ + rotate_actor, + clos, + rotate_actor_cleanup); + + + + Priorities + + + G_PRIORITY_DEFAULT should always be used as the timeouts priority + (in case of g_timeout_add_full()) as not to intefere with Clutter's + scheduling of repaints and input event handling. + + + + +
    +
    + Timelines + + ClutterTimelines abstract a set period of time with a set frame + rate at which to call a provided callback. + + + + ClutterTimelines also extend the timeout sources functionality + further by: + + + + Having a set duration (in milliseconds) and a set + 'frame rate' - that is, the rate at which the callback is + called + Passing current progress information to the + callback + Handling 'dropped frames' and guarenteeing the set + duration by skipping over frames if the callback cannot keep up with + the set frame rate + Querying the number of milliseconds elapsed between + the current and previous callback. + Allowing the timeline to be modified on the fly as + well as being stopped, started, looped, rewound and + reversed + Using a ClutterTimeoutPool to more efficiently + schedule multiple timeout sources without incurring in potential + starvation of the main loop slices + + + + A Timeline is created with; + + + +clutter_timeline_new (n_frames, frames_per_seconds); + + + + Taking a number of frames and a frames per second, or by; + + + +clutter_timeline_new_for_duration (msecs); + + + + Which takes the duration of the timeline in milliseconds with a + default frame rate (See clutter_get_default_frame_rate()). + + + + + The speed, duration and number of frames of the timeline then be + modifed via the objects properties and API calls. The timeline can + be made to loop by setting its "loop" property to TRUE. + + + + + The timelines is started via clutter_timeline_start() and its + playback further manipulated by the clutter_timeline_pause(), + clutter_timeline_stop(), clutter_timeline_rewind() and + clutter_timeline_skip() calls. + + + + + By attaching a handler to the timeline's "new-frame" + signal a timeline can then be used to drive an animation by altering + an actor's visual properties in this callback. The callback looks like: + + + +void +on_new_frame (ClutterTimeline *timeline, + gint frame_num, + gpointer user_data) +{ +} + + + + The frame_num parameter is set to the timeline's + current frame number (which is between 1 and the "num-frames" property). + This value can be used to compute the state of a particular animation + that is dependant on the frame numer. The clutter_timeline_get_progress() + function can also be used to get a normalised value of the timeline's + current position between 0 and 1. + + + + + Timelines can also be played in reverse by setting the direction using + clutter_timeline_set_direction(), and can also have a one-time delay set + before they begin playing by using clutter_timeline_set_delay(). + + + + + Timelines can also control a pyshical simulation; the + clutter_timeline_get_delta() function allows retrieving the number of + frames and milliseconds elapsed since the previous callback to ensure + the physics engine to be able to take the actual time elapsed between + iterations into account. + + + + + + The following example demonstrates rotating an actor with a timeline. + + +#include <clutter/clutter.h> + +void +on_new_frame (ClutterTimeline *timeline, + gint frame_num, + gpointer data) +{ + ClutterActor *actor = CLUTTER_ACTOR(data); + + clutter_actor_set_rotation (actor, CLUTTER_Z_AXIS, + (gdouble) frame_num, + clutter_actor_get_width (actor) / 2, + clutter_actor_get_height (actor) / 2, + 0); +} + +int +main (int argc, char *argv[]) +{ + ClutterTimeline *timeline; + + ClutterActor *stage, *actor; + GdkPixbuf *pixbuf; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + + pixbuf = gdk_pixbuf_new_from_file ("an-image.png", NULL); + + actor = clutter_texture_new_from_pixbuf (pixbuf); + + clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor); + + clutter_actor_set_position (actor, 100, 100); + + timeline = clutter_timeline_new_for (360, 60); /* one degree per frame */ + clutter_timeline_set_loop (timeline, TRUE); + + g_signal_connect (timeline, "new-frame", G_CALLBACK (on_new_frame), actor); + + clutter_actor_show_all (stage); + + clutter_timeline_start (timeline); + + clutter_main(); + + return 0; +} + + + + + Multiple timelines can be sequenced in order by means of the + ClutterScore. See the ClutterScore documentation for more details on + using this. + + +
    +
    + Behaviours + + + With a large application containing many animations, the use of just + timelines can become unwieldy and difficult to manage with much code + duplication in the new-frame handlers that can require over complex + code changes for minor animation modifications. To ease these + problems the ClutterAlpha and ClutterBehaviour classes were created. + + + + + ClutterAlpha and ClutterBehaviour attempt to generalise the + new-frame function by defining common actions or behaviours that can + be quickly modified, applied to multiple actors or mixed on a single + actor. + + + + + A ClutterAlpha is simply a 'function of time' (not a pixel alpha channel!). + It is created by referencing a source timeline and an "easing mode" which + produces a value between -1 and 2 depending on the progress of the + timeline. Clutter provides various easing modes, as described by + the ClutterAnimationMode enumeration. It is also possible to register + a new animation mode using clutter_alpha_register_func() or to provide + a custom ClutterAlphaFunc for a specific ClutterAlpha instance. + + + + + A Behaviour is created with a ClutterAlpha and a set of limits for + whatever the behaviour modifies in an actor. The current ClutterAlpha + value is then mapped to a value between these limits and this value + set on any applied actors. With the ClutterAlpha's underlying + timeline playing the produced value will change and the behaviour + will animate the actor. + + + + + A ClutterBehaviour is effectively 'driven' by a supplied ClutterAlpha + and when then applied to an actor it will modify a visual property or + feature of the actor dependant on the Alpha's value. For example a + path based behaviour applied to an actor will alter its position + along the path dependant on the current alpha value over time. The + actual motion will depend on the chosen "easing mode". + + + + + Multiple behaviours can of course be applied to an actor as well as + a single behaviour being applied to multiple actors. The separation + of timelines, alphas and behaviours allows for a single timeline to + drive many behaviours each potentially using different alpha + functions. Behaviour parameters can also be changed on the fly. + + + + + +
    + Effects of alpha functions on a path + +
    + The actors position between the path's end points directly correlates + to the ClutterAlpha's current alpha value driving the behaviour. With + the ClutterAlpha's animation mode set to CLUTTER_LINEAR the actor + will follow the path at a constant velocity, but when changing to + CLUTTER_EASE_SINE_IN_OUT the actor initially accelerates before quickly + decelerating. +
    +
    + +
    + + + The behaviours included in Clutter are + + + + + + + ClutterBehaviourDepth + Changes the depth of actors + + + ClutterBehaviourEllipse + Moves actors along an ellipsis + + + ClutterBehaviourOpacity + Changes the opacity of actors + + + ClutterBehaviourPath + Moves actors along a path + + + ClutterBehaviourRotate + Rotates actors along an axis + + + ClutterBehaviourScale + Changes the scaling factors of + actors + + + + + + + + The following example demonstrates an ellipse behaviour in action. + + +#include <clutter/clutter.h> + +int +main (int argc, char *argv[]) +{ + ClutterTimeline *timeline; + ClutterBehaviour *behave; + ClutterAlpha *alpha; + ClutterActor *stage, *actor; + GdkPixbuf *pixbuf; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + + pixbuf = gdk_pixbuf_new_from_file ("ohpowers.png", NULL); + + actor = clutter_texture_new_from_pixbuf (pixbuf); + + clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor); + + timeline = clutter_timeline_new_for_duration (4000); /* milliseconds */ + clutter_timeline_set_loop (timeline, TRUE); + + /* Set an alpha func to power the behaviour */ + alpha = clutter_alpha_new_full (timeline, CLUTTER_EASE_SINE_IN_OUT); + + behave = clutter_behaviour_ellipse_new (alpha, + 200, /* center x */ + 200, /* center y */ + 400, /* width */ + 300, /* height */ + CLUTTER_ROTATE_CW, /* direction */ + 0.0, /* initial angle */ + 360.0); /* final angle */ + + clutter_behaviour_apply (behave, actor); + + clutter_actor_show_all (stage); + + clutter_timeline_start (timeline); + + clutter_main(); + + /* clean up */ + g_object_unref (behave); + g_object_unref (timeline); + + return 0; +} + + + + + Behaviour parameters can be changed whilst a animation is running + + + There can be many ClutterAlpha's attached to a single timeline. There + can be many behaviours for a ClutterAlpha. There can be many behaviours + applied to an actor. A ClutterScore can be used to chain many behaviour + together. + + + Combining behaviours that effect the same actor properties + (i.e two separate paths) will cause unexpected results. The values + will not be merged in any way with only the last applied behaviour taking + precedence. + + + Tips for implementing a new behaviour can be found here. + + +
    +
    + Implicit Animations + + Using behaviours for simple animations of a single actor may + be too complicated, in terms of memory management and bookkeeping + of the object instances. For this reason, Clutter also provides a + simple animation API for implicit animations using properties of + an actor: clutter_actor_animate(). + + The clutter_actor_animate() family of functions will create + and use an implicit ClutterAnimation instance, which will then + handle the animation of one or more ClutterActor properties between + a range of values. + + + + The following example demonstrates how to use the + clutter_actor_animate() method to tween an actor + between the current position and a new set of coordinates. + The animation takes 200 milliseconds to complete and + uses a linear speed. + + + clutter_actor_animate (actor, CLUTTER_LINEAR, 200 + "x", 200, + "y", 200, + NULL); + + + + The clutter_actor_animate() method returns a ClutterAnimation + instance that can be used to start, stop and modify the animation + while it's running. The "completed" signal will + be emitted when the animation has been completed. + + When the animation is complete it will be automatically + unreferenced, and disposed if nothing else is holding a reference + on it. + + Calling clutter_actor_animate() multiple times on an + actor which is being animated will cause the animation to be updated + with the new values. + + + + The following example demonstrates how to animate an actor + inside the signal handler for a button press event. If the + user presses the button on a new position while the animation + is running, the animation will be restarted with the new + final values updated. + + + static gboolean + on_button_press (ClutterActor *actor, + ClutterButtonEvent *event, + gpointer user_data) + { + clutter_actor_animate (actor, CLUTTER_EASE_SINE_OUT, 500, + "x", event->x, + "y", event->y, + NULL); + return TRUE; + } + + + +
    + +
    + Conclusion + + + Clutter provides a number of utility classes to aid animations and + complex animations can be produced by combining the various features + provided. + + + + + Of course animations can becreated outside of the Clutter animation + framework, as the framework is not expected to cover every kind of + possible animation scenario. + + + + + The animation functionality in Clutter is primarily suited to + building animations with a set or finite running time - i.e transitions + and the like. For animations involving variable input (such as touchscreen + handling) physical simulations may be more suited. + + + +
    +
    diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-animation.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-animation.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-animation.xml 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-animation.xml 2009-01-30 12:41:02.000000000 +0000 @@ -1,600 +1,925 @@ - - - - Matthew - Allum - -
    - mallumopenedhand.com -
    -
    -
    -
    - - Creating Animations with Clutter - - - - With Clutter using hardware accelration for graphics rendering, - complex and fast animations are possible. This chapter describes basic - techniques and the utilities Clutter provides in aiding animation - creation. - - - -
    - Basic Animations - - - - The most basic way to create animations with Clutter is via the use of - g_timeout_add(). This enables a callback function to be called at a - defined interval. The callback function can then modify actors visual - properties as to produce an animation. - - - - - - Simple Rotation... - - -struct RotationClosure { - ClutterActor *actor; - ClutterFixed final_angle; - ClutterFixed current_angle; -}; - -static gboolean -rotate_actor (gpointer data) -{ - RotationClosure *clos = data; - - clutter_actor_set_rotationx (clos->actor, clos->current_angle, 0, 0, 0); - - clos->current_angle += CFX_ONE; - - if (clos->current_angle == clos->final_angle) - return FALSE; - - return TRUE; -} - -... - RotationClosure clos = { NULL, } - - clos.actor = an_actor; - clos.final_angle = CLUTTER_FLOAT_TO_FIXED (360.0); - clos.current_angle = 0; - - g_timeout_add (1000 / 360, /* fps to interval in milliseconds */ - rotate_actor, - &clos); - - - - Priorities - - - G_PRIORITY_DEFAULT should always be used as the timeouts priority - (in case of g_timeout_add_full()) as not to intefere with Clutter's - scheduling of repaints and input event handling. - - - - -
    -
    - Timelines - - ClutterTimelines abstract a set period of time with a set frame - rate at which to call a provided callback. - - - - ClutterTimelines also extend the timeout sources functionality - further by: - - - - Having a set duration (in milliseconds) and a set - 'frame rate' - that is, the rate at which the callback is - called - Passing current progress information to the - callback - Handling 'dropped frames' and guarenteeing the set - duration by skipping over frames if the callback cannot keep up with - the set frame rate - Querying the number of milliseconds elapsed between - the current and previous callback. - Allowing the timeline to be modified on the fly as - well as being stopped, started, looped, rewound and - reversed - Using a ClutterTimeoutPool to more efficiently - schedule multiple timeout sources without incurring in potential - starvation of the main loop slices - - - - A Timeline is created with; - - - -clutter_timeline_new (n_frames, frames_per_seconds); - - - - Taking a number of frames and a frames per second, or by; - - - -clutter_timeline_new_for_duration (msecs); - - - - Which takes the duration of the timeline in milliseconds with a - default frame rate (See clutter_get_default_frame_rate()). - - - - - The speed, duration and number of frames of the timeline then be - modifed via the objects properties and API calls. The timeline can - be made to loop by settings it "loop" property to TRUE. - - - - - The timelines is started via clutter_timeline_start() and its - playback further manipulated by the clutter_timeline_pause(), - clutter_timeline_stop(), clutter_timeline_rewind() and - clutter_timeline_skip() calls. - - - - - By attaching a handler to the timeline's ClutterTimeline::new-frame - signal a timeline can then be used to drive an animation by altering - an actor's visual properties in this callback. The callback looks like: - - - -void -on_new_frame (ClutterTimeline *timeline, - gint frame_num, - gpointer user_data) -{ - -} - - - - The frame_num parameter is set to the timeline's - current frame number (which is between 0 and the "num-frames" property). - This value can be used to compute the state of a particular animation - that is dependant on the frame numer. The clutter_timeline_get_progress() - function can also be used to get a normalised value of the timeline's - current position between 0 and 1. - - - - - Timelines can also be played in reverse by setting the direction using - clutter_timeline_set_direction(), and can also have a one-time delay set - before they begin playing by using clutter_timeline_set_delay(). - - - - - Timelines can also control a pyshical simulation; the - clutter_timeline_get_delta() function allows retrieving the number of - frames and milliseconds elapsed since the previous callback to ensure - the physics engine to be able to take the actual time elapsed between - iterations into account. - - - - - - The following example demonstrates rotating an actor with a timeline. - - -#include <clutter/clutter.h> - -void -on_new_frame (ClutterTimeline *timeline, - gint frame_num, - gpointer data) -{ - ClutterActor *actor = CLUTTER_ACTOR(data); - - clutter_actor_set_rotation (actor, CLUTTER_Z_AXIS, - (gdouble) frame_num, - clutter_actor_get_width (actor) / 2, - clutter_actor_get_height (actor) / 2, - 0); -} - -int -main (int argc, char *argv[]) -{ - ClutterTimeline *timeline; - - ClutterActor *stage, *actor; - GdkPixbuf *pixbuf; - - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - - pixbuf = gdk_pixbuf_new_from_file ("an-image.png", NULL); - - actor = clutter_texture_new_from_pixbuf (pixbuf); - - clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor); - - clutter_actor_set_position (actor, 100, 100); - - timeline = clutter_timeline_new_for (360, 60); /* a degree per frame */ - clutter_timeline_set_loop (timeline, TRUE); - - g_signal_connect (timeline, "new-frame", G_CALLBACK (on_new_frame), actor); - - clutter_actor_show_all (stage); - - clutter_timeline_start (timeline); - - clutter_main(); - - return 0; -} - - - - - Multiple timelines can be sequenced in order by means of the - ClutterScore. See the ClutterScore documentation for more details on - using this. - - -
    -
    - Behaviours - - - With a large application containing many animations, the use of just - timelines can become unweldy and difficult to manage with much code - duplication in the new-frame handlers that can require over complex - code changes for minor animation modifications. To ease these - problems the ClutterAlpha and ClutterBehaviour classes were created. - - - - - ClutterAlpha and ClutterBehaviour attempt to generalise the - new-frame function by defining common actions or behaviours that can - be quickly modified, applied to multiple actors or mixed on a single - actor. - - - - - A ClutterAlpha is simply a 'function of time' (not pixel alpha!). It - is created by referencing a source timeline and a function which - produces a value between 0 and CLUTTER_ALPHA_MAX dependant on the - timeline position. Various prebuilt alpha functions are included - with Clutter these include - - - - - - - CLUTTER_ALPHA_RAMP_INC - Increasing ramp function - - - CLUTTER_ALPHA_RAMP_DEC - Decreasing ramp function - - - CLUTTER_ALPHA_RAMP - Full ramp function - - - CLUTTER_ALPHA_SINE_INC - Increasing sine function - - - CLUTTER_ALPHA_SINE_DEC - Decreasing sine function - - - CLUTTER_ALPHA_SINE_HALF - Half sine function - - - CLUTTER_ALPHA_SINE - Full sine function - - - CLUTTER_ALPHA_SQUARE - Square waveform ("step") function - - - CLUTTER_ALPHA_SMOOTHSTEP_INC - Increasing smooth transition step - function - - - CLUTTER_ALPHA_SMOOTHSTEP_DEC - Decreasing smooth transition step - function - - - CLUTTER_ALPHA_EXP_INC - Increasing exponential function - - - CLUTTER_ALPHA_EXP_DEC - Decreasing exponential function - - - - - - A Behaviour is created with a ClutterAlpha and a set of limits for - whatever the behaviour modifys actor wise. The current ClutterAlpha - value is then mapped to a value between these limits and this value - set on any applied actors. With the ClutterAlpha's underlying - timeline playing the produced value will change and the behaviour - will animate the actor. - - - - - A ClutterBehaviour is effectively 'driven' by a supplied ClutterAlpha and - when then applied to an actor it will modify a visual property or - feature of the actor dependant on the Alpha's value. For example a - path based behaviour applied to an actor will alter its position - along the path dependant on the current alpha value over time. The - actual motion will depend on the chosen ClutterAlphaFunc - a - CLUTTER_ALPHA_RAMP_INC making it to move at constant speed along the - path, a CLUTTER_ALPHA_SINE making it alternate from one end of the - path to the other with non constant speed. - - - - - Multiple behaviours can of course be applied to an actor as well as - a single behaviour being applied to multiple actors. The separation - of timelines, alphas and behaviours allows for a single timeline to - drive many behaviours each potentially using different alpha - functions. Behaviour parameters can also be changed on the fly. - - - - - -
    - Effects of alpha functions on a path - -
    - The actors position between the path's end points directly correlates - to the ClutterAlpha's current alpha value driving the behaviour. With - the ClutterAlpha's function set to CLUTTER_ALPHA_RAMP_INC the actor - will follow the path at a constant velocity, but when changing to - CLUTTER_ALPHA_SINE_INC the actor initially accelerates before quickly - decelerating. -
    -
    - -
    - - - The behaviours included in Clutter are - - - - - - - ClutterBehaviourBspline - Moves actors along a B-spline path - - - ClutterBehaviourDepth - Changes the depth of actors - - - ClutterBehaviourEllipse - Moves actors along an ellipsis - - - ClutterBehaviourOpacity - Changes the opacity of actors - - - ClutterBehaviourPath - Moves actors along a path - - - ClutterBehaviourRotate - Rotates actors along an axis - - - ClutterBehaviourScale - Changes the scaling factors of - actors - - - - - - - - The following example demonstrates an ellipse behaviour in action. - - -#include <clutter/clutter.h> - -int -main (int argc, char *argv[]) -{ - ClutterTimeline *timeline; - ClutterBehaviour *behave; - ClutterAlpha *alpha; - ClutterActor *stage, *actor; - GdkPixbuf *pixbuf; - - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - - pixbuf = gdk_pixbuf_new_from_file ("ohpowers.png", NULL); - - actor = clutter_texture_new_from_pixbuf (pixbuf); - - clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor); - - timeline = clutter_timeline_new_for_duration (4000); /* milliseconds */ - clutter_timeline_set_loop (timeline, TRUE); - - /* Set an alpha func to power the behaviour */ - alpha = clutter_alpha_new_full (timeline, - CLUTTER_ALPHA_SINE, - NULL, NULL); - - behave = clutter_behaviour_ellipse_new (alpha, - 200, /* center x */ - 200, /* center y */ - 400, /* width */ - 300, /* height */ - CLUTTER_ROTATE_CW, /* direction */ - 0.0, /* initial angle */ - 360.0); /* final angle */ - - clutter_behaviour_apply (behave, actor); - - clutter_actor_show_all (stage); - - clutter_timeline_start (timeline); - - clutter_main(); - - /* clean up */ - g_object_unref (behave); - g_object_unref (timeline); - - return 0; -} - - - - - Behaviour parameters can be changed whilst a animation is running - - - There can be many ClutterAlpha's attached to a single timeline. There - can be many behaviours for a ClutterAlpha. There can be many behaviours - applied to an actor. A ClutterScore can be used to chain many behaviour - together. - - - Combining behaviours that effect the same actor properties - (i.e two separate paths) will cause unexpected results. The values - will not be merged in any way with essentially a the last applied - behaviour taking precedence. - - - Tips for implementing a new behaviour can be found here. - - -
    -
    - Effects - - - - Clutter effects API provide a simplified abstraction for firing simple - transitions from code. Clutter effects are created from a - ClutterEffectTemplate which is an abstraction of a timeline and - an alpha function. An effect template can be created with: - - - -ClutterEffectTemplate *etemplate = - clutter_effect_template_new_for_duration (2000, CLUTTER_ALPHA_RAMP_INC); - - - - This will create an effect template lasting 2000 milliseconds (2 - seconds) and use an alpha function of CLUTTER_ALPHA_RAMP_INC, there - are other more advanced forms for creating effect templates from - existing timelines, as well as attaching a callback to be called - with user_data when the effect template is destroyed. - - - - - When we have an effect template we can create a temporary behaviour - animating an actor simply by issuing: - - - -clutter_effect_move (etemplate, actor, 23, 42, NULL, NULL); - - -and the actor will move from its current position to the coordinates -(23, 42) in 2 seconds. Effects can also be stacked, so calling: - - -clutter_effect_move (etemplate, actor, 23, 42, NULL, NULL); -clutter_effect_fade (etemplate, actor, 0, NULL, NULL); - - -The actor will move and fade out at the same time. - - - - Since effects return a ClutterTimeline, you can stop an effect from - immediatly happening by calling clutter_timeline_stop() on the - returned timeline. - - - - - The timeline and all the effect infrastructure is unreferenced as soon - as the timeline emits the ClutterTimeline::completed signal. - - -
    - -
    - Conclusion - - - Clutter provides a number of utility classes to aid animations and - complex animations can be produced by combining the various features - provided. - - - - - Of course animations can be created outside of Clutter Utilities, - they are not expected to cover every kind of possible animation - scenario. - - - - - The animation functionality in Clutter is primarily suited to - building animations with a set or finite running time - i.e transitions - and the like. For animations involving variable input (such as touchscreen - handling) physical simulations may be more suited. - - + + +]> + + + +Implicit Animations +3 +CLUTTER Library + + + +Implicit Animations +Simple implicit animations + + + + +Synopsis + + + ClutterAnimation; + ClutterAnimationClass; +enum ClutterAnimationMode; +ClutterAnimation* clutter_animation_new (void); +void clutter_animation_set_object (ClutterAnimation *animation, + GObject *object); +GObject* clutter_animation_get_object (ClutterAnimation *animation); +void clutter_animation_set_mode (ClutterAnimation *animation, + gulong mode); +gulong clutter_animation_get_mode (ClutterAnimation *animation); +void clutter_animation_set_duration (ClutterAnimation *animation, + gint msecs); +guint clutter_animation_get_duration (ClutterAnimation *animation); +void clutter_animation_set_loop (ClutterAnimation *animation, + gboolean loop); +gboolean clutter_animation_get_loop (ClutterAnimation *animation); +void clutter_animation_set_timeline (ClutterAnimation *animation, + ClutterTimeline *timeline); +ClutterTimeline* clutter_animation_get_timeline (ClutterAnimation *animation); +void clutter_animation_set_alpha (ClutterAnimation *animation, + ClutterAlpha *alpha); +ClutterAlpha* clutter_animation_get_alpha (ClutterAnimation *animation); + +void clutter_animation_bind_property (ClutterAnimation *animation, + const gchar *property_name, + ClutterInterval *interval); +void clutter_animation_update_property (ClutterAnimation *animation, + const gchar *property_name, + ClutterInterval *interval); +gboolean clutter_animation_has_property (ClutterAnimation *animation, + const gchar *property_name); +void clutter_animation_unbind_property (ClutterAnimation *animation, + const gchar *property_name); +ClutterInterval* clutter_animation_get_interval (ClutterAnimation *animation, + const gchar *property_name); + +ClutterAnimation* clutter_actor_animate (ClutterActor *actor, + gulong mode, + guint duration, + const gchar *first_property_name, + ...); +ClutterAnimation* clutter_actor_animate_with_timeline (ClutterActor *actor, + gulong mode, + ClutterTimeline *timeline, + const gchar *first_property_name, + ...); +ClutterAnimation* clutter_actor_animate_with_alpha (ClutterActor *actor, + ClutterAlpha *alpha, + const gchar *first_property_name, + ...); + + -
    -
    + + + + + + + + + +Description + +ClutterAnimation is an object providing simple, implicit animations +for GObjects. + + +ClutterAnimation instances will bind a GObject property belonging +to a GObject to a ClutterInterval, and will then use a ClutterTimeline +to interpolate the property between the initial and final values of the +interval. + + +For convenience, it is possible to use the clutter_actor_animate() +function call which will take care of setting up and tearing down +a ClutterAnimation instance and animate an actor between its current +state and the specified final state. + + +ClutterAnimation is available since Clutter 1.0 + + + + + + +Details + +ClutterAnimation +ClutterAnimationtypedef struct { +} ClutterAnimation; + + +The ClutterAnimation structure contains only private data and should +be accessed using the provided functions. + + +Since 1.0 + + +ClutterAnimationClass +ClutterAnimationClasstypedef struct { + void (* completed) (ClutterAnimation *animation); +} ClutterAnimationClass; + + +The ClutterAnimationClass structure contains only private data and +should be accessed using the provided functions. + + + + +completed () + class handler for the "completed" signal + + +Since 1.0 + + +enum ClutterAnimationMode +ClutterAnimationModetypedef enum { + CLUTTER_CUSTOM_MODE = 0, + + /* linear */ + CLUTTER_LINEAR, + + /* quadratic */ + CLUTTER_EASE_IN_QUAD, + CLUTTER_EASE_OUT_QUAD, + CLUTTER_EASE_IN_OUT_QUAD, + + /* cubic */ + CLUTTER_EASE_IN_CUBIC, + CLUTTER_EASE_OUT_CUBIC, + CLUTTER_EASE_IN_OUT_CUBIC, + + /* quartic */ + CLUTTER_EASE_IN_QUART, + CLUTTER_EASE_OUT_QUART, + CLUTTER_EASE_IN_OUT_QUART, + + /* quintic */ + CLUTTER_EASE_IN_QUINT, + CLUTTER_EASE_OUT_QUINT, + CLUTTER_EASE_IN_OUT_QUINT, + + /* sinusoidal */ + CLUTTER_EASE_IN_SINE, + CLUTTER_EASE_OUT_SINE, + CLUTTER_EASE_IN_OUT_SINE, + + /* exponential */ + CLUTTER_EASE_IN_EXPO, + CLUTTER_EASE_OUT_EXPO, + CLUTTER_EASE_IN_OUT_EXPO, + + /* circular */ + CLUTTER_EASE_IN_CIRC, + CLUTTER_EASE_OUT_CIRC, + CLUTTER_EASE_IN_OUT_CIRC, + + /* elastic */ + CLUTTER_EASE_IN_ELASTIC, + CLUTTER_EASE_OUT_ELASTIC, + CLUTTER_EASE_IN_OUT_ELASTIC, + + /* overshooting cubic */ + CLUTTER_EASE_IN_BACK, + CLUTTER_EASE_OUT_BACK, + CLUTTER_EASE_IN_OUT_BACK, + + /* exponentially decaying parabolic */ + CLUTTER_EASE_IN_BOUNCE, + CLUTTER_EASE_OUT_BOUNCE, + CLUTTER_EASE_IN_OUT_BOUNCE, + + /* guard, before registered alpha functions */ + CLUTTER_ANIMATION_LAST +} ClutterAnimationMode; + + +The animation modes used by ClutterAlpha and ClutterAnimation. This +enumeration can be expanded in later versions of Clutter. See the +ClutterAlpha documentation for a graph of all the animation modes. + + +Every global alpha function registered using clutter_alpha_register_func() +or clutter_alpha_register_closure() will have a logical id greater than +CLUTTER_ANIMATION_LAST. + + + + +CLUTTER_CUSTOM_MODE + custom progress function + + + +CLUTTER_LINEAR + linear tweening + + + +CLUTTER_EASE_IN_QUAD + quadratic tweening + + + +CLUTTER_EASE_OUT_QUAD + quadratic tweening, inverse of + CLUTTER_EASE_IN_QUAD + + + +CLUTTER_EASE_IN_OUT_QUAD + quadratic tweening, combininig + CLUTTER_EASE_IN_QUAD and CLUTTER_EASE_OUT_QUAD + + + +CLUTTER_EASE_IN_CUBIC + cubic tweening + + + +CLUTTER_EASE_OUT_CUBIC + cubic tweening, invers of + CLUTTER_EASE_IN_CUBIC + + + +CLUTTER_EASE_IN_OUT_CUBIC + cubic tweening, combining + CLUTTER_EASE_IN_CUBIC and CLUTTER_EASE_OUT_CUBIC + + + +CLUTTER_EASE_IN_QUART + quartic tweening + + + +CLUTTER_EASE_OUT_QUART + quartic tweening, inverse of + CLUTTER_EASE_IN_QUART + + + +CLUTTER_EASE_IN_OUT_QUART + quartic tweening, combining + CLUTTER_EASE_IN_QUART and CLUTTER_EASE_OUT_QUART + + + +CLUTTER_EASE_IN_QUINT + quintic tweening + + + +CLUTTER_EASE_OUT_QUINT + quintic tweening, inverse of + CLUTTER_EASE_IN_QUINT + + + +CLUTTER_EASE_IN_OUT_QUINT + fifth power tweening, combining + CLUTTER_EASE_IN_QUINT and CLUTTER_EASE_OUT_QUINT + + + +CLUTTER_EASE_IN_SINE + sinusoidal tweening + + + +CLUTTER_EASE_OUT_SINE + sinusoidal tweening, inverse of + CLUTTER_EASE_IN_SINE + + + +CLUTTER_EASE_IN_OUT_SINE + sine wave tweening, combining + CLUTTER_EASE_IN_SINE and CLUTTER_EASE_OUT_SINE + + + +CLUTTER_EASE_IN_EXPO + exponential tweening + + + +CLUTTER_EASE_OUT_EXPO + exponential tweening, inverse of + CLUTTER_EASE_IN_EXPO + + + +CLUTTER_EASE_IN_OUT_EXPO + exponential tweening, combining + CLUTTER_EASE_IN_EXPO and CLUTTER_EASE_OUT_EXPO + + + +CLUTTER_EASE_IN_CIRC + circular tweening + + + +CLUTTER_EASE_OUT_CIRC + circular tweening, inverse of + CLUTTER_EASE_IN_CIRC + + + +CLUTTER_EASE_IN_OUT_CIRC + circular tweening, combining + CLUTTER_EASE_IN_CIRC and CLUTTER_EASE_OUT_CIRC + + + +CLUTTER_EASE_IN_ELASTIC + elastic tweening, with offshoot on start + + + +CLUTTER_EASE_OUT_ELASTIC + elastic tweening, with offshoot on end + + + +CLUTTER_EASE_IN_OUT_ELASTIC + elastic tweening with offshoot on both ends + + + +CLUTTER_EASE_IN_BACK + overshooting cubic tweening, with + backtracking on start + + + +CLUTTER_EASE_OUT_BACK + overshooting cubic tweening, with + backtracking on end + + + +CLUTTER_EASE_IN_OUT_BACK + overshooting cubic tweening, with + backtracking on both ends + + + +CLUTTER_EASE_IN_BOUNCE + exponentially decaying parabolic (bounce) + tweening, with bounce on start + + + +CLUTTER_EASE_OUT_BOUNCE + exponentially decaying parabolic (bounce) + tweening, with bounce on end + + + +CLUTTER_EASE_IN_OUT_BOUNCE + exponentially decaying parabolic (bounce) + tweening, with bounce on both ends + + + +CLUTTER_ANIMATION_LAST + last animation mode, used as a guard for + registered global alpha functions + + +Since 1.0 + + +clutter_animation_new () +clutter_animation_newClutterAnimation* clutter_animation_new (void); + + + +Returns : + + + + + +clutter_animation_set_object () +clutter_animation_set_objectvoid clutter_animation_set_object (ClutterAnimation *animation, + GObject *object); + +Attaches animation to object. The ClutterAnimation will take a +reference on object. + + + +animation : + a ClutterAnimation + +object : + a GObject + +Since 1.0 + + +clutter_animation_get_object () +clutter_animation_get_objectGObject* clutter_animation_get_object (ClutterAnimation *animation); + +Retrieves the GObject attached to animation. + + + +animation : + a ClutterAnimation + +Returns : a GObject + + +Since 1.0 + + +clutter_animation_set_mode () +clutter_animation_set_modevoid clutter_animation_set_mode (ClutterAnimation *animation, + gulong mode); + +Sets the animation mode of animation. The animation mode is +a logical id, either coming from the ClutterAnimationMode enumeration +or the return value of clutter_alpha_register_func(). + + + +animation : + a ClutterAnimation + +mode : + an animation mode logical id + +Since 1.0 + + +clutter_animation_get_mode () +clutter_animation_get_modegulong clutter_animation_get_mode (ClutterAnimation *animation); + +Retrieves the animation mode of animation, as set by +clutter_animation_set_mode(). + + + +animation : + a ClutterAnimation + +Returns : the mode for the animation + + +Since 1.0 + + +clutter_animation_set_duration () +clutter_animation_set_durationvoid clutter_animation_set_duration (ClutterAnimation *animation, + gint msecs); + +Sets the duration of animation in milliseconds. + + + +animation : + a ClutterAnimation + +msecs : + the duration in milliseconds + +Since 1.0 + + +clutter_animation_get_duration () +clutter_animation_get_durationguint clutter_animation_get_duration (ClutterAnimation *animation); + +Retrieves the duration of animation, in milliseconds. + + + +animation : + a ClutterAnimation + +Returns : the duration of the animation + + +Since 1.0 + + +clutter_animation_set_loop () +clutter_animation_set_loopvoid clutter_animation_set_loop (ClutterAnimation *animation, + gboolean loop); + +Sets whether animation should loop over itself once finished. + + +A looping ClutterAnimation will not emit the "completed" +signal when finished. + + + +animation : + a ClutterAnimation + +loop : + TRUE if the animation should loop + +Since 1.0 + + +clutter_animation_get_loop () +clutter_animation_get_loopgboolean clutter_animation_get_loop (ClutterAnimation *animation); + +Retrieves whether animation is looping. + + + +animation : + a ClutterAnimation + +Returns : TRUE if the animation is looping + + +Since 1.0 + + +clutter_animation_set_timeline () +clutter_animation_set_timelinevoid clutter_animation_set_timeline (ClutterAnimation *animation, + ClutterTimeline *timeline); + +Sets the ClutterTimeline used by animation. + + +The "duration" and "loop" properties +will be set using the corresponding ClutterTimeline properties as a +side effect. + + +If timeline is NULL a new ClutterTimeline will be constructed +using the current values of the "duration" and +"loop" properties. + + + +animation : + a ClutterAnimation + +timeline : + a ClutterTimeline or NULL + +Since 1.0 + + +clutter_animation_get_timeline () +clutter_animation_get_timelineClutterTimeline* clutter_animation_get_timeline (ClutterAnimation *animation); + +Retrieves the ClutterTimeline used by animation + + + +animation : + a ClutterAnimation + +Returns : the timeline used by the animation + + +Since 1.0 + + +clutter_animation_set_alpha () +clutter_animation_set_alphavoid clutter_animation_set_alpha (ClutterAnimation *animation, + ClutterAlpha *alpha); + +Sets alpha as the ClutterAlpha used by animation. + + +If alpha is NULL, a new ClutterAlpha will be constructed from +the current values of the "mode" and +"timeline" properties. + + + +animation : + a ClutterAnimation + +alpha : + a ClutterAlpha, or NULL + +Since 1.0 + + +clutter_animation_get_alpha () +clutter_animation_get_alphaClutterAlpha* clutter_animation_get_alpha (ClutterAnimation *animation); + +Retrieves the ClutterAlpha used by animation. + + + +animation : + a ClutterAnimation + +Returns : the alpha object used by the animation + + +Since 1.0 + + +clutter_animation_bind_property () +clutter_animation_bind_propertyvoid clutter_animation_bind_property (ClutterAnimation *animation, + const gchar *property_name, + ClutterInterval *interval); + +Binds interval to the property_name of the GObject +attached to animation. The ClutterAnimation will take +ownership of the passed ClutterInterval. + + +If you need to update the interval instance use +clutter_animation_update_property() instead. + + + +animation : + a ClutterAnimation + +property_name : + the property to control + +interval : + a ClutterInterval + +Since 1.0 + + +clutter_animation_update_property () +clutter_animation_update_propertyvoid clutter_animation_update_property (ClutterAnimation *animation, + const gchar *property_name, + ClutterInterval *interval); + +Changes the interval for property_name. The ClutterAnimation +will take ownership of the passed ClutterInterval. + + + +animation : + a ClutterAnimation + +property_name : + name of the property + +interval : + a ClutterInterval + +Since 1.0 + + +clutter_animation_has_property () +clutter_animation_has_propertygboolean clutter_animation_has_property (ClutterAnimation *animation, + const gchar *property_name); + +Checks whether animation is controlling property_name. + + + +animation : + a ClutterAnimation + +property_name : + name of the property + +Returns : TRUE if the property is animated by the + ClutterAnimation, FALSE otherwise + + +Since 1.0 + + +clutter_animation_unbind_property () +clutter_animation_unbind_propertyvoid clutter_animation_unbind_property (ClutterAnimation *animation, + const gchar *property_name); + +Removes property_name from the list of animated properties. + + + +animation : + a ClutterAnimation + +property_name : + name of the property + +Since 1.0 + + +clutter_animation_get_interval () +clutter_animation_get_intervalClutterInterval* clutter_animation_get_interval (ClutterAnimation *animation, + const gchar *property_name); + +Retrieves the ClutterInterval associated to property_name +inside animation. + + + +animation : + a ClutterAnimation + +property_name : + name of the property + +Returns : a ClutterInterval or NULL if no property with + the same name was found. The returned interval is owned by + the ClutterAnimation and should not be unreferenced + + +Since 1.0 + + +clutter_actor_animate () +clutter_actor_animateClutterAnimation* clutter_actor_animate (ClutterActor *actor, + gulong mode, + guint duration, + const gchar *first_property_name, + ...); + +Animates the given list of properties of actor between the current +value for each property and a new final value. The animation has a +definite duration and a speed given by the mode. + + +For example, this: + + + + clutter_actor_animate (rectangle, CLUTTER_LINEAR, 250, + "width", 100, + "height", 100, + NULL); + + + +will make width and height properties of the ClutterActor "rectangle" +grow linearly between the current value and 100 pixels, in 250 milliseconds. + + +The animation mode is a logical id, either from the ClutterAnimationMode +enumeration of from clutter_alpha_register_func(). + + +All the properties specified will be animated between the current value +and the final value. If a property should be set at the beginning of +the animation but not updated during the animation, it should be prefixed +by the "fixed::" string, for instance: + + + + clutter_actor_animate (actor, CLUTTER_EASE_IN, 100, + "rotation-angle-z", 360, + "fixed::rotation-center-x", 100, + "fixed::rotation-center-y", 100, + NULL); + + + +Will animate the "rotation-angle-z" property between the current value +and 360 degrees, and set the "rotation-center-x" and "rotation-center-y" +to the fixed value of 100 pixels. + + +This function will implicitly create a ClutterAnimation object which +will be assigned to the actor and will be returned to the developer +to control the animation or to know when the animation has been +completed. + + +Calling this function on an actor that is already being animated +will cause the current animation to change with the new final value. + + +Unless the animation is looping, it will become invalid as soon +as it is complete. To avoid this, you should keep a reference on the +returned value using g_object_ref(). + + + +actor : + a ClutterActor + +mode : + an animation mode logical id + +duration : + duration of the animation, in milliseconds + +first_property_name : + the name of a property + +... : + a NULL terminated list of property names and + property values + +Returns : a ClutterAnimation object. The object is owned by the + ClutterActor and should not be unreferenced with g_object_unref() + + +Since 1.0 + + +clutter_actor_animate_with_timeline () +clutter_actor_animate_with_timelineClutterAnimation* clutter_actor_animate_with_timeline (ClutterActor *actor, + gulong mode, + ClutterTimeline *timeline, + const gchar *first_property_name, + ...); + +Animates the given list of properties of actor between the current +value for each property and a new final value. The animation has a +definite duration given by timeline and a speed given by the mode. + + +See clutter_actor_animate() for further details. + + +This function is useful if you want to use an existing timeline +to animate actor. + + + +actor : + a ClutterActor + +mode : + an animation mode logical id + +timeline : + a ClutterTimeline + +first_property_name : + the name of a property + +... : + a NULL terminated list of property names and + property values + +Returns : a ClutterAnimation object. The object is owned by the + ClutterActor and should not be unreferenced with g_object_unref() + + +Since 1.0 + + +clutter_actor_animate_with_alpha () +clutter_actor_animate_with_alphaClutterAnimation* clutter_actor_animate_with_alpha (ClutterActor *actor, + ClutterAlpha *alpha, + const gchar *first_property_name, + ...); + +Animates the given list of properties of actor between the current +value for each property and a new final value. The animation has a +definite behaviour given by the passed alpha. + + +See clutter_actor_animate() for further details. + + +This function is useful if you want to use an existing ClutterAlpha +to animate actor. + + + +actor : + a ClutterActor + +alpha : + a ClutterAlpha + +first_property_name : + the name of a property + +... : + a NULL terminated list of property names and + property values + +Returns : a ClutterAnimation object. The object is owned by the + ClutterActor and should not be unreferenced with g_object_unref() + + +Since 1.0 + + + + + + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-backend.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-backend.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-backend.xml 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-backend.xml 2009-01-30 12:41:02.000000000 +0000 @@ -22,22 +22,25 @@ ClutterBackend* clutter_get_default_backend (void); -gdouble clutter_backend_get_resolution (ClutterBackend *backend); void clutter_backend_set_resolution (ClutterBackend *backend, gdouble dpi); -guint clutter_backend_get_double_click_time - (ClutterBackend *backend); +gdouble clutter_backend_get_resolution (ClutterBackend *backend); void clutter_backend_set_double_click_time (ClutterBackend *backend, guint msec); -guint clutter_backend_get_double_click_distance +guint clutter_backend_get_double_click_time (ClutterBackend *backend); void clutter_backend_set_double_click_distance (ClutterBackend *backend, guint distance); +guint clutter_backend_get_double_click_distance + (ClutterBackend *backend); void clutter_backend_set_font_options (ClutterBackend *backend, cairo_font_options_t *options); cairo_font_options_t* clutter_backend_get_font_options (ClutterBackend *backend); +void clutter_backend_set_font_name (ClutterBackend *backend, + const gchar *font_name); +const gchar* clutter_backend_get_font_name (ClutterBackend *backend); @@ -73,31 +76,14 @@ clutter_get_default_backend () clutter_get_default_backendClutterBackend* clutter_get_default_backend (void); -FIXME +Retrieves the default ClutterBackend used by Clutter. The +ClutterBackend holds backend-specific configuration options.
    Returns : the default backend. You should not ref or -unref the returned object. Applications should not rarely need -to use this. - - -Since 0.4 -
    - -clutter_backend_get_resolution () -clutter_backend_get_resolutiongdouble clutter_backend_get_resolution (ClutterBackend *backend); - -Gets the resolution for font handling on the screen; see -clutter_backend_set_resolution() for full details. - - - -backend : - a ClutterBackend - -Returns : the current resolution, or -1 if no resolution - has been set. + unref the returned object. Applications should rarely need + to use this. Since 0.4 @@ -126,20 +112,20 @@ Since 0.4 - -clutter_backend_get_double_click_time () -clutter_backend_get_double_click_timeguint clutter_backend_get_double_click_time - (ClutterBackend *backend); + +clutter_backend_get_resolution () +clutter_backend_get_resolutiongdouble clutter_backend_get_resolution (ClutterBackend *backend); -Gets the maximum time between two button press events, as set -by clutter_backend_set_double_click_time(). +Gets the resolution for font handling on the screen; see +clutter_backend_set_resolution() for full details. backend : a ClutterBackend -Returns : a time in milliseconds +Returns : the current resolution, or -1 if no resolution + has been set. Since 0.4 @@ -163,19 +149,20 @@ Since 0.4 - -clutter_backend_get_double_click_distance () -clutter_backend_get_double_click_distanceguint clutter_backend_get_double_click_distance + +clutter_backend_get_double_click_time () +clutter_backend_get_double_click_timeguint clutter_backend_get_double_click_time (ClutterBackend *backend); -Retrieves the distance used to verify a double click event +Gets the maximum time between two button press events, as set +by clutter_backend_set_double_click_time(). backend : a ClutterBackend -Returns : a distance, in pixels. +Returns : a time in milliseconds Since 0.4 @@ -198,6 +185,23 @@ Since 0.4 + +clutter_backend_get_double_click_distance () +clutter_backend_get_double_click_distanceguint clutter_backend_get_double_click_distance + (ClutterBackend *backend); + +Retrieves the distance used to verify a double click event + + + +backend : + a ClutterBackend + +Returns : a distance, in pixels. + + +Since 0.4 + clutter_backend_set_font_options () clutter_backend_set_font_optionsvoid clutter_backend_set_font_options (ClutterBackend *backend, @@ -237,6 +241,44 @@ Since 0.8 + +clutter_backend_set_font_name () +clutter_backend_set_font_namevoid clutter_backend_set_font_name (ClutterBackend *backend, + const gchar *font_name); + +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. + + + +backend : + a ClutterBackend + +font_name : + the name of the font + +Since 1.0 + + +clutter_backend_get_font_name () +clutter_backend_get_font_nameconst gchar* clutter_backend_get_font_name (ClutterBackend *backend); + +Retrieves the default font name as set by +clutter_backend_set_font_name(). + + + +backend : + a ClutterBackend + +Returns : the font name for the backend. The returned string is + owned by the ClutterBackend and should never be modified or freed + + +Since 1.0 +
    diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-behaviour-bspline.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-behaviour-bspline.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-behaviour-bspline.xml 2008-12-01 11:57:22.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-behaviour-bspline.xml 1970-01-01 01:00:00.000000000 +0100 @@ -1,378 +0,0 @@ - - -]> - - - -ClutterBehaviourBspline -3 -CLUTTER Library - - - -ClutterBehaviourBspline -A behaviour interpolating position along a B-Spline - - - - -Synopsis - - - ClutterBehaviourBspline; - ClutterBehaviourBsplineClass; -ClutterBehaviour* clutter_behaviour_bspline_new (ClutterAlpha *alpha, - const ClutterKnot *knots, - guint n_knots); -void clutter_behaviour_bspline_append_knot - (ClutterBehaviourBspline *bs, - const ClutterKnot *knot); -void clutter_behaviour_bspline_append_knots - (ClutterBehaviourBspline *bs, - const ClutterKnot *first_knot, - ...); -void clutter_behaviour_bspline_truncate (ClutterBehaviourBspline *bs, - guint offset); -void clutter_behaviour_bspline_join (ClutterBehaviourBspline *bs1, - ClutterBehaviourBspline *bs2); -ClutterBehaviour* clutter_behaviour_bspline_split (ClutterBehaviourBspline *bs, - guint offset); -void clutter_behaviour_bspline_clear (ClutterBehaviourBspline *bs); -void clutter_behaviour_bspline_adjust (ClutterBehaviourBspline *bs, - guint offset, - ClutterKnot *knot); -void clutter_behaviour_bspline_set_origin - (ClutterBehaviourBspline *bs, - ClutterKnot *knot); -void clutter_behaviour_bspline_get_origin - (ClutterBehaviourBspline *bs, - ClutterKnot *knot); - - - - -Object Hierarchy - - GObject - +----ClutterBehaviour - +----ClutterBehaviourBspline - - - - - - - -Implemented Interfaces - -ClutterBehaviourBspline implements - - - - - - - -Signals - - "knot-reached" : Run Last - - - - - -Description - -ClutterBehaviourBspline interpolates actors along a defined B-Spline path. - - -A bezier spline is a set of cubic bezier curves defined by a sequence of -control points given when creating a new ClutterBehaviourBspline instance. - - -Additional bezier curves can be added to the end of the bspline using -clutter_behaviour_bspline_append_* family of functions, control points can -be moved using clutter_behaviour_bspline_adjust(). The bspline can be split -into two with clutter_behaviour_bspline_split(), and bsplines can be -concatenated using clutter_behaviour_bspline_join(). - - -Each time the behaviour reaches a point on the path, the "knot-reached" -signal is emitted. - - - - - - -Details - -ClutterBehaviourBspline -ClutterBehaviourBsplinetypedef struct _ClutterBehaviourBspline ClutterBehaviourBspline; - -ClutterBehaviourBspline contains only private data and -should be accessed using the functions below. - - -Since 0.2 - - -ClutterBehaviourBsplineClass -ClutterBehaviourBsplineClasstypedef struct { - void (*knot_reached) (ClutterBehaviourBspline *bsplineb, - const ClutterKnot *knot); -} ClutterBehaviourBsplineClass; - - -ClutterBehaviourBsplineClass contains only private data -and should be accessed using the functions below. - - - - -knot_reached () - class handler for the "knot-reached" - signal - - -Since 0.2 - - -clutter_behaviour_bspline_new () -clutter_behaviour_bspline_newClutterBehaviour* clutter_behaviour_bspline_new (ClutterAlpha *alpha, - const ClutterKnot *knots, - guint n_knots); - -Creates a new bezier spline behaviour. You can use this behaviour to drive -actors along the bezier spline, described by the knots control points. - - -Bspline is defined by 3n + 1 points, n >=1; any trailing points passed -into this function are stored internally and used during any subsequent -clutter_behaviour_bspline_append_* operations. - - - -alpha : - a ClutterAlpha, or NULL - -knots : - a list of ClutterKnots representing individual control points - -n_knots : - the number of control points - -Returns : a ClutterBehaviour - - -Since 0.4 - - -clutter_behaviour_bspline_append_knot () -clutter_behaviour_bspline_append_knotvoid clutter_behaviour_bspline_append_knot - (ClutterBehaviourBspline *bs, - const ClutterKnot *knot); - -Appends a ClutterKnot control point to the bezier spline bs. Note, that -since a bezier is defined by 4 control points, the point gets stored in -a temporary chache, and only when there are enough control points to -create a new bezier curve will the bspline extended. - - - -bs : - a ClutterBehaviourBspline - -knot : - a ClutterKnot control point to append. - -Since 0.4 - - -clutter_behaviour_bspline_append_knots () -clutter_behaviour_bspline_append_knotsvoid clutter_behaviour_bspline_append_knots - (ClutterBehaviourBspline *bs, - const ClutterKnot *first_knot, - ...); - -Appends a bezier spline defined by the last control point of bezier spline -bs and the array of ClutterKnot control points to the orginal bezier spline -bs. - - - -bs : - a ClutterBehaviourBspline - -first_knot : - first ClutterKnot - -... : - a NULL-terminated array of ClutterKnot control points. - -Since 0.6 - - -clutter_behaviour_bspline_truncate () -clutter_behaviour_bspline_truncatevoid clutter_behaviour_bspline_truncate (ClutterBehaviourBspline *bs, - guint offset); - -Truncates the bezier spline at the control point; if the control point at -offset is not one of the on-curve points, the bspline will be -truncated at the nearest preceeding on-curve point. - - - -bs : - a ClutterBehaviourBspline - -offset : - offset of control where the bspline should be truncated - -Since 0.4 - - -clutter_behaviour_bspline_join () -clutter_behaviour_bspline_joinvoid clutter_behaviour_bspline_join (ClutterBehaviourBspline *bs1, - ClutterBehaviourBspline *bs2); - -Joins a copy of bezier spline bs2 onto the end of bezier spline bs1; bs2 is -not modified. - - - -bs1 : - a ClutterBehaviourBspline - -bs2 : - a ClutterBehaviourBspline - -Since 0.4 - - -clutter_behaviour_bspline_split () -clutter_behaviour_bspline_splitClutterBehaviour* clutter_behaviour_bspline_split (ClutterBehaviourBspline *bs, - guint offset); - -Splits a bezier spline into two at the control point at offset; if the -control point at offset is not one of the on-curve bezier points, the -bspline will be split at the nearest on-curve point before the offset. -The original bspline is shortened appropriately. - - - -bs : - a ClutterBehaviourBspline - -offset : - an offset of the control point at which to split the spline. - -Returns : new ClutterBehaviourBspline. - - -Since 0.4 - - -clutter_behaviour_bspline_clear () -clutter_behaviour_bspline_clearvoid clutter_behaviour_bspline_clear (ClutterBehaviourBspline *bs); - -Empties a bspline. - - - -bs : - a ClutterBehaviourBspline - -Since 0.4 - - -clutter_behaviour_bspline_adjust () -clutter_behaviour_bspline_adjustvoid clutter_behaviour_bspline_adjust (ClutterBehaviourBspline *bs, - guint offset, - ClutterKnot *knot); - -Change the coordinaces of control point at index to those represented by -the knot. - - - -bs : - a ClutterBehaviourBspline - -offset : - an index of control point to ajdust - -knot : - a ClutterKnot with new coordinances for the control point. - -Since 0.4 - - -clutter_behaviour_bspline_set_origin () -clutter_behaviour_bspline_set_originvoid clutter_behaviour_bspline_set_origin - (ClutterBehaviourBspline *bs, - ClutterKnot *knot); - -Sets the origin of the bezier to the point represented by knot. (Initially -the origin of a bspline is given by the position of the first control point -of the first bezier curve.) - - - -bs : - a ClutterBehaviourBspline - -knot : - a ClutterKnot origin for the bezier - -Since 0.4 - - -clutter_behaviour_bspline_get_origin () -clutter_behaviour_bspline_get_originvoid clutter_behaviour_bspline_get_origin - (ClutterBehaviourBspline *bs, - ClutterKnot *knot); - -Gets the origin of the bezier. - - - -bs : - a ClutterBehaviourBspline - -knot : - a ClutterKnot where to store the origin of the bezier - -Since 0.4 - - - - - -Signal Details -The <literal>"knot-reached"</literal> signal -ClutterBehaviourBspline::knot-reachedvoid user_function (ClutterBehaviourBspline *pathb, - ClutterKnot *knot, - gpointer user_data) : Run Last - -This signal is emitted at the end of each frame. - - - -pathb : - the object which received the signal - -knot : - the ClutterKnot reached - -user_data : -user data set when the signal handler was connected. -Since 0.2 - - - - - - diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-behaviour-path.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-behaviour-path.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-behaviour-path.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-behaviour-path.xml 2009-01-30 12:41:02.000000000 +0000 @@ -13,7 +13,7 @@ ClutterBehaviourPath -A behaviour interpolating position along a path +A behaviour for moving actors along a ClutterPath @@ -24,20 +24,17 @@ ClutterBehaviourPath; ClutterBehaviourPathClass; ClutterBehaviour* clutter_behaviour_path_new (ClutterAlpha *alpha, + ClutterPath *path); +ClutterBehaviour* clutter_behaviour_path_new_with_description + (ClutterAlpha *alpha, + const gchar *desc); +ClutterBehaviour* clutter_behaviour_path_new_with_knots + (ClutterAlpha *alpha, const ClutterKnot *knots, guint n_knots); -GSList* clutter_behaviour_path_get_knots (ClutterBehaviourPath *pathb); -void clutter_behaviour_path_append_knot (ClutterBehaviourPath *pathb, - const ClutterKnot *knot); -void clutter_behaviour_path_append_knots (ClutterBehaviourPath *pathb, - const ClutterKnot *first_knot, - ...); -void clutter_behaviour_path_insert_knot (ClutterBehaviourPath *pathb, - guint offset, - const ClutterKnot *knot); -void clutter_behaviour_path_remove_knot (ClutterBehaviourPath *pathb, - guint offset); -void clutter_behaviour_path_clear (ClutterBehaviourPath *pathb); +void clutter_behaviour_path_set_path (ClutterBehaviourPath *pathb, + ClutterPath *path); +ClutterPath* clutter_behaviour_path_get_path (ClutterBehaviourPath *pathb); ClutterKnot; ClutterKnot* clutter_knot_copy (const ClutterKnot *knot); @@ -63,7 +60,7 @@ Implemented Interfaces ClutterBehaviourPath implements - + ClutterScriptable. @@ -71,7 +68,7 @@ Properties - "knot" ClutterKnot* : Write + "path" ClutterPath* : Read / Write @@ -89,17 +86,27 @@ ClutterBehaviourPath interpolates actors along a defined path. -A path is a set of ClutterKnots object given when creating a new -ClutterBehaviourPath instance. Knots can be also added to the path -using clutter_behaviour_path_append_knot(). The whole path can be -cleared using clutter_behaviour_path_clear(). Each time the behaviour -reaches a knot in the path, the "knot-reached" signal is emitted. +A path is described by a ClutterPath object. The path can contain +straight line parts and bezier curves. If the path contains +CLUTTER_PATH_MOVE_TO parts then the actors will jump to those +coordinates. This can be used make disjoint paths. + + +When creating a path behaviour in a ClutterScript, you can specify +the path property directly as a string. For example: -This first knot in the path is reached with the lower bound value -provided by the ClutterAlpha objectused by the behaviour; the last -knot in the path is reached with the upper bound value provided by -the ClutterAlpha object used by the behaviour. + +{ + "id" : "spline-path", + "type" : "ClutterBehaviourPath", + "path" : "M 50 50 L 100 100", + "alpha" : { + "timeline" : "main-timeline", + "function" : "ramp + } +} + If the alpha function is a periodic function, i.e. it returns to @@ -125,7 +132,7 @@ ClutterBehaviourPathClass ClutterBehaviourPathClasstypedef struct { void (*knot_reached) (ClutterBehaviourPath *pathb, - const ClutterKnot *knot); + guint knot_num); } ClutterBehaviourPathClass; @@ -143,135 +150,115 @@ clutter_behaviour_path_new () clutter_behaviour_path_newClutterBehaviour* clutter_behaviour_path_new (ClutterAlpha *alpha, - const ClutterKnot *knots, - guint n_knots); + ClutterPath *path);
    Creates a new path behaviour. You can use this behaviour to drive -actors along the nodes of a path, described by the knots. +actors along the nodes of a path, described by path. + + +This will claim the floating reference on the ClutterPath so you +do not need to unref if it. alpha : a ClutterAlpha, or NULL -knots : - a list of ClutterKnots, or NULL for an empty path - -n_knots : - the number of nodes in the path +path : + a ClutterPath or NULL for an empty path Returns : a ClutterBehaviour Since 0.2
    - -clutter_behaviour_path_get_knots () -clutter_behaviour_path_get_knotsGSList* clutter_behaviour_path_get_knots (ClutterBehaviourPath *pathb); + +clutter_behaviour_path_new_with_description () +clutter_behaviour_path_new_with_descriptionClutterBehaviour* clutter_behaviour_path_new_with_description + (ClutterAlpha *alpha, + const gchar *desc); -Returns a copy of the list of knots contained by pathb +Creates a new path behaviour using the path described by desc. See +clutter_path_add_string() for a description of the format. -pathb : - a ClutterBehvaiourPath +alpha : + a ClutterAlpha + +desc : + a string description of the path -Returns : a GSList of the paths knots. +Returns : a ClutterBehaviour -Since 0.2 +Since 1.0 - -clutter_behaviour_path_append_knot () -clutter_behaviour_path_append_knotvoid clutter_behaviour_path_append_knot (ClutterBehaviourPath *pathb, - const ClutterKnot *knot); + +clutter_behaviour_path_new_with_knots () +clutter_behaviour_path_new_with_knotsClutterBehaviour* clutter_behaviour_path_new_with_knots + (ClutterAlpha *alpha, + const ClutterKnot *knots, + guint n_knots); -Appends a ClutterKnot to the path +Creates a new path behaviour that will make the actors visit all of +the given knots in order with straight lines in between. + - - -pathb : - a ClutterBehvaiourPath - -knot : - a ClutterKnot to append. - -Since 0.2 - - -clutter_behaviour_path_append_knots () -clutter_behaviour_path_append_knotsvoid clutter_behaviour_path_append_knots (ClutterBehaviourPath *pathb, - const ClutterKnot *first_knot, - ...); - -Adds a NULL-terminated list of knots to a path. This function is -equivalent to calling clutter_behaviour_path_append_knot() for each -member of the list. +A path will be created where the first knot is used in a +CLUTTER_PATH_MOVE_TO and the subsequent knots are used in +CLUTTER_PATH_LINE_TOs. -pathb : - a ClutterBehvaiourPath +alpha : + a ClutterAlpha -first_knot : - the ClutterKnot knot to add to the path +knots : + an array of ClutterKnots -... : - additional knots to add to the path +n_knots : + number of entries in knots -Since 0.2 - - -clutter_behaviour_path_insert_knot () -clutter_behaviour_path_insert_knotvoid clutter_behaviour_path_insert_knot (ClutterBehaviourPath *pathb, - guint offset, - const ClutterKnot *knot); - -Inserts a ClutterKnot in the path at specified position. Values greater -than total number of knots will append the knot at the end of path. - +Returns : a ClutterBehaviour - -pathb : - a ClutterBehvaiourPath - -offset : - position in path to insert knot. -knot : - a ClutterKnot to append. - -Since 0.2 +Since 1.0 - -clutter_behaviour_path_remove_knot () -clutter_behaviour_path_remove_knotvoid clutter_behaviour_path_remove_knot (ClutterBehaviourPath *pathb, - guint offset); - -Removes a ClutterKnot in the path at specified offset. + +clutter_behaviour_path_set_path () +clutter_behaviour_path_set_pathvoid clutter_behaviour_path_set_path (ClutterBehaviourPath *pathb, + ClutterPath *path); + +Change the path that the actors will follow. This will take the +floating reference on the ClutterPath so you do not need to unref +it. pathb : - a ClutterBehvaiourPath + the path behaviour -offset : - position in path to remove knot. +path : + the new path to follow -Since 0.2 +Since 1.0 - -clutter_behaviour_path_clear () -clutter_behaviour_path_clearvoid clutter_behaviour_path_clear (ClutterBehaviourPath *pathb); + +clutter_behaviour_path_get_path () +clutter_behaviour_path_get_pathClutterPath* clutter_behaviour_path_get_path (ClutterBehaviourPath *pathb); -Removes all knots from a path +Get the current path of the behaviour pathb : - a ClutterBehvaiourPath + a ClutterBehaviourPath instance -Since 0.2 +Returns : the path + + +Since 1.0 ClutterKnot @@ -350,15 +337,9 @@ Property Details -The <literal>"knot"</literal> property -ClutterBehaviourPath:knot "knot" ClutterKnot* : Write - -This property can be used to append a new knot to the path. - - -Since 0.2 - - +The <literal>"path"</literal> property +ClutterBehaviourPath:path "path" ClutterPath* : Read / Write +The ClutterPath object representing the path to animate along. @@ -366,7 +347,7 @@ Signal Details The <literal>"knot-reached"</literal> signal ClutterBehaviourPath::knot-reachedvoid user_function (ClutterBehaviourPath *pathb, - ClutterKnot *knot, + guint knot_num, gpointer user_data) : Run Last This signal is emitted each time a node defined inside the path @@ -377,8 +358,8 @@ pathb : the object which received the signal -knot : - the ClutterKnot reached +knot_num : + the index of the ClutterPathKnot reached user_data : user data set when the signal handler was connected. diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-behaviour.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-behaviour.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-behaviour.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-behaviour.xml 2009-01-30 12:41:02.000000000 +0000 @@ -51,7 +51,6 @@ GObject +----ClutterBehaviour - +----ClutterBehaviourBspline +----ClutterBehaviourDepth +----ClutterBehaviourEllipse +----ClutterBehaviourOpacity @@ -151,7 +150,7 @@ ClutterBehaviourClasstypedef struct { /* vfunc, not signal */ void (*alpha_notify) (ClutterBehaviour *behave, - guint32 alpha_value); + gdouble alpha_value); /* signals */ void (*applied) (ClutterBehaviour *behave, diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-binding-pool.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-binding-pool.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-binding-pool.xml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-binding-pool.xml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,614 @@ + + +]> + + + +Key Bindings +3 +CLUTTER Library + + + +Key Bindings +Pool for key bindings + + + + +Synopsis + + + ClutterBindingPool; +gboolean (*ClutterBindingActionFunc) (GObject *gobject, + const gchar *action_name, + guint key_val, + ClutterModifierType modifiers); + +ClutterBindingPool* clutter_binding_pool_new (const gchar *name); +ClutterBindingPool* clutter_binding_pool_get_for_class (gpointer klass); +ClutterBindingPool* clutter_binding_pool_find (const gchar *name); + +void clutter_binding_pool_install_action (ClutterBindingPool *pool, + const gchar *action_name, + guint key_val, + ClutterModifierType modifiers, + GCallback callback, + gpointer data, + GDestroyNotify notify); +void clutter_binding_pool_install_closure + (ClutterBindingPool *pool, + const gchar *action_name, + guint key_val, + ClutterModifierType modifiers, + GClosure *closure); +void clutter_binding_pool_override_action + (ClutterBindingPool *pool, + guint key_val, + ClutterModifierType modifiers, + GCallback callback, + gpointer data, + GDestroyNotify notify); +void clutter_binding_pool_override_closure + (ClutterBindingPool *pool, + guint key_val, + ClutterModifierType modifiers, + GClosure *closure); +const gchar* clutter_binding_pool_find_action (ClutterBindingPool *pool, + guint key_val, + ClutterModifierType modifiers); +void clutter_binding_pool_remove_action (ClutterBindingPool *pool, + guint key_val, + ClutterModifierType modifiers); +void clutter_binding_pool_block_action (ClutterBindingPool *pool, + const gchar *action_name); +void clutter_binding_pool_unblock_action (ClutterBindingPool *pool, + const gchar *action_name); + +gboolean clutter_binding_pool_activate (ClutterBindingPool *pool, + guint key_val, + ClutterModifierType modifiers, + GObject *gobject); + + + + +Object Hierarchy + + GObject + +----ClutterBindingPool + + + + + + + + + + + + +Description + +ClutterBindingPool is a data structure holding a set of key bindings. +Each key binding associates a key symbol (eventually with modifiers) +to an action. A callback function is associated to each action. + + +For a given key symbol and modifier mask combination there can be only one +action; for each action there can be only one callback. There can be +multiple actions with the same name, and the same callback can be used +to handle multiple key bindings. + + +Actors requiring key bindings should create a new ClutterBindingPool +inside their class initialization function and then install actions +like this: + + + +static void +foo_class_init (FooClass *klass) +{ + ClutterBindingPool *binding_pool; + + binding_pool = clutter_binding_pool_get_for_class (klass); + + clutter_binding_pool_install_action (binding_pool, "move-up", + CLUTTER_Up, 0, + G_CALLBACK (foo_action_move_up), + NULL, NULL); + clutter_binding_pool_install_action (binding_pool, "move-up", + CLUTTER_KP_Up, 0, + G_CALLBACK (foo_action_move_up), + NULL, NULL); +} + + + +The callback has a signature of: + + + + gboolean (* callback) (GObject *instance, + const gchar *action_name, + guint key_val, + ClutterModifierType modifiers, + gpointer user_data); + + + +The actor should then override the "key-press-event" and +use clutter_binding_pool_activate() to match a ClutterKeyEvent structure +to one of the actions: + + + + ClutterBindingPool *pool; + + /* retrieve the binding pool for the type of the actor */ + pool = clutter_binding_pool_find (G_OBJECT_TYPE_NAME (actor)); + + /* activate any callback matching the key symbol and modifiers + * mask of the key event. the returned value can be directly + * used to signal that the actor has handled the event. + */ + return clutter_binding_pool_activate (pool, G_OBJECT (actor), + key_event->keyval, + key_event->modifier_state); + + + +The clutter_binding_pool_activate() function will return FALSE if +no action for the given key binding was found, if the action was +blocked (using clutter_binding_pool_block_action()) or if the +key binding handler returned FALSE. + + +ClutterBindingPool is available since Clutter 1.0 + + + + + + +Details + +ClutterBindingPool +ClutterBindingPooltypedef struct _ClutterBindingPool ClutterBindingPool; + +Container of key bindings. The ClutterBindingPool struct is +private. + + +Since 1.0 + + +ClutterBindingActionFunc () +ClutterBindingActionFuncgboolean (*ClutterBindingActionFunc) (GObject *gobject, + const gchar *action_name, + guint key_val, + ClutterModifierType modifiers); + +The prototype for the callback function registered with +clutter_binding_pool_install_action() and invoked by +clutter_binding_pool_activate(). + + + +gobject : + a GObject + +action_name : + the name of the action + +key_val : + the key symbol + +modifiers : + bitmask of the modifier flags + +Returns : the function should return TRUE if the key + binding has been handled, and return FALSE otherwise + + +Since 1.0 + + +clutter_binding_pool_new () +clutter_binding_pool_newClutterBindingPool* clutter_binding_pool_new (const gchar *name); + +Creates a new ClutterBindingPool that can be used to store +key bindings for an actor. The name must be a unique identifier +for the binding pool, so that clutter_binding_pool_find() will +be able to return the correct binding pool. + + + +name : + the name of the binding pool + +Returns : the newly created binding pool with the given + name. Use g_object_unref() when done. + + +Since 1.0 + + +clutter_binding_pool_get_for_class () +clutter_binding_pool_get_for_classClutterBindingPool* clutter_binding_pool_get_for_class (gpointer klass); + +Retrieves the ClutterBindingPool for the given GObject class +and, eventually, creates it. This function is a wrapper around +clutter_binding_pool_new() and uses the class type name as the +unique name for the binding pool. + + +Calling this function multiple times will return the same +ClutterBindingPool. + + +A binding pool for a class can also be retrieved using +clutter_binding_pool_find() with the class type name: + + + + pool = clutter_binding_pool_find (G_OBJECT_TYPE_NAME (instance)); + + + + +klass : + a GObjectClass pointer + +Returns : the binding pool for the given class. The returned + ClutterBindingPool is owned by Clutter and should not be freed + directly + + +Since 1.0 + + +clutter_binding_pool_find () +clutter_binding_pool_findClutterBindingPool* clutter_binding_pool_find (const gchar *name); + +Finds the ClutterBindingPool with name. + + + +name : + the name of the binding pool to find + +Returns : a pointer to the ClutterBindingPool, or NULL + + +Since 1.0 + + +clutter_binding_pool_install_action () +clutter_binding_pool_install_actionvoid clutter_binding_pool_install_action (ClutterBindingPool *pool, + const gchar *action_name, + guint key_val, + ClutterModifierType modifiers, + GCallback callback, + gpointer data, + GDestroyNotify notify); + +Installs a new action inside a ClutterBindingPool. The action +is bound to key_val and modifiers. + + +The same action name can be used for multiple key_val, modifiers +pairs. + + +When an action has been activated using clutter_binding_pool_activate() +the passed callback will be invoked (with data). + + +Actions can be blocked with clutter_binding_pool_block_action() +and then unblocked using clutter_binding_pool_unblock_action(). + + + +pool : + a ClutterBindingPool + +action_name : + the name of the action + +key_val : + key symbol + +modifiers : + bitmask of modifiers + +callback : + function to be called when the action is activated + +data : + data to be passed to callback + +notify : + function to be called when the action is removed + from the pool + +Since 1.0 + + +clutter_binding_pool_install_closure () +clutter_binding_pool_install_closurevoid clutter_binding_pool_install_closure + (ClutterBindingPool *pool, + const gchar *action_name, + guint key_val, + ClutterModifierType modifiers, + GClosure *closure); + +A GClosure variant of clutter_binding_pool_install_action(). + + +Installs a new action inside a ClutterBindingPool. The action +is bound to key_val and modifiers. + + +The same action name can be used for multiple key_val, modifiers +pairs. + + +When an action has been activated using clutter_binding_pool_activate() +the passed closure will be invoked. + + +Actions can be blocked with clutter_binding_pool_block_action() +and then unblocked using clutter_binding_pool_unblock_action(). + + + +pool : + a ClutterBindingPool + +action_name : + the name of the action + +key_val : + key symbol + +modifiers : + bitmask of modifiers + +closure : + a GClosure + +Since 1.0 + + +clutter_binding_pool_override_action () +clutter_binding_pool_override_actionvoid clutter_binding_pool_override_action + (ClutterBindingPool *pool, + guint key_val, + ClutterModifierType modifiers, + GCallback callback, + gpointer data, + GDestroyNotify notify); + +Allows overriding the action for key_val and modifiers inside a +ClutterBindingPool. See clutter_binding_pool_install_action(). + + +When an action has been activated using clutter_binding_pool_activate() +the passed callback will be invoked (with data). + + +Actions can be blocked with clutter_binding_pool_block_action() +and then unblocked using clutter_binding_pool_unblock_action(). + + + +pool : + a ClutterBindingPool + +key_val : + key symbol + +modifiers : + bitmask of modifiers + +callback : + function to be called when the action is activated + +data : + data to be passed to callback + +notify : + function to be called when the action is removed + from the pool + +Since 1.0 + + +clutter_binding_pool_override_closure () +clutter_binding_pool_override_closurevoid clutter_binding_pool_override_closure + (ClutterBindingPool *pool, + guint key_val, + ClutterModifierType modifiers, + GClosure *closure); + +A GClosure variant of clutter_binding_pool_override_action(). + + +Allows overriding the action for key_val and modifiers inside a +ClutterBindingPool. See clutter_binding_pool_install_closure(). + + +When an action has been activated using clutter_binding_pool_activate() +the passed callback will be invoked (with data). + + +Actions can be blocked with clutter_binding_pool_block_action() +and then unblocked using clutter_binding_pool_unblock_action(). + + + +pool : + a ClutterBindingPool + +key_val : + key symbol + +modifiers : + bitmask of modifiers + +closure : + a GClosure + +Since 1.0 + + +clutter_binding_pool_find_action () +clutter_binding_pool_find_actionconst gchar* clutter_binding_pool_find_action (ClutterBindingPool *pool, + guint key_val, + ClutterModifierType modifiers); + +Retrieves the name of the action matching the given key symbol +and modifiers bitmask. + + + +pool : + a ClutterBindingPool + +key_val : + a key symbol + +modifiers : + a bitmask for the modifiers + +Returns : the name of the action, if found, or NULL. The + returned string is owned by the binding pool and should never + be modified or freed + + +Since 1.0 + + +clutter_binding_pool_remove_action () +clutter_binding_pool_remove_actionvoid clutter_binding_pool_remove_action (ClutterBindingPool *pool, + guint key_val, + ClutterModifierType modifiers); + +Removes the action matching the given key_val, modifiers pair, +if any exists. + + + +pool : + a ClutterBindingPool + +key_val : + a key symbol + +modifiers : + a bitmask for the modifiers + +Since 1.0 + + +clutter_binding_pool_block_action () +clutter_binding_pool_block_actionvoid clutter_binding_pool_block_action (ClutterBindingPool *pool, + const gchar *action_name); + +Blocks all the actions with name action_name inside pool. + + + +pool : + a ClutterBindingPool + +action_name : + an action name + +Since 1.0 + + +clutter_binding_pool_unblock_action () +clutter_binding_pool_unblock_actionvoid clutter_binding_pool_unblock_action (ClutterBindingPool *pool, + const gchar *action_name); + +Unblockes all the actions with name action_name inside pool. + + +Unblocking an action does not cause the callback bound to it to +be invoked in case clutter_binding_pool_activate() was called on +an action previously blocked with clutter_binding_pool_block_action(). + + + +pool : + a ClutterBindingPool + +action_name : + an action name + +Since 1.0 + + +clutter_binding_pool_activate () +clutter_binding_pool_activategboolean clutter_binding_pool_activate (ClutterBindingPool *pool, + guint key_val, + ClutterModifierType modifiers, + GObject *gobject); + +Activates the callback associated to the action that is +bound to the key_val and modifiers pair. + + +The callback has the following signature: + + + + void (* callback) (GObject *gobject, + const gchar *action_name, + guint key_val, + ClutterModifierType modifiers, + gpointer user_data); + + + +Where the GObject instance is gobject and the user data +is the one passed when installing the action with +clutter_binding_pool_install_action(). + + +If the action bound to the key_val, modifiers pair has been +blocked using clutter_binding_pool_block_action(), the callback +will not be invoked, and this function will return FALSE. + + + +pool : + a ClutterBindingPool + +key_val : + the key symbol + +modifiers : + bitmask for the modifiers + +gobject : + a GObject + +Returns : TRUE if an action was found and was activated + + +Since 1.0 + + + + + + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-cairo-texture.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-cairo-texture.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-cairo-texture.xml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-cairo-texture.xml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,339 @@ + + +]> + + + +ClutterCairoTexture +3 +CLUTTER Library + + + +ClutterCairoTexture +Texture with Cairo integration + + + + +Synopsis + + + ClutterCairoTexture; + ClutterCairoTextureClass; +ClutterActor* clutter_cairo_texture_new (guint width, + guint height); +void clutter_cairo_texture_set_surface_size + (ClutterCairoTexture *self, + guint width, + guint height); +void clutter_cairo_texture_get_surface_size + (ClutterCairoTexture *self, + guint *width, + guint *height); + +cairo_t* clutter_cairo_texture_create (ClutterCairoTexture *self); +cairo_t* clutter_cairo_texture_create_region (ClutterCairoTexture *self, + gint x_offset, + gint y_offset, + gint width, + gint height); + +void clutter_cairo_set_source_color (cairo_t *cr, + const ClutterColor *color); + + + + +Object Hierarchy + + GObject + +----GInitiallyUnowned + +----ClutterActor + +----ClutterTexture + +----ClutterCairoTexture + + + + + + + +Implemented Interfaces + +ClutterCairoTexture implements + ClutterScriptable. + + + + + +Properties + + "surface-height" guint : Read / Write + "surface-width" guint : Read / Write + + + + + + +Description + +ClutterCairoTexture is a ClutterTexture that displays the contents +of a Cairo context. The ClutterCairoTexture actor will create a +Cairo image surface which will then be uploaded to a GL texture when +needed. + + +ClutterCairoTexture will provide a cairo_t context by using the +clutter_cairo_texture_create() and clutter_cairo_texture_create_region() +functions; you can use the Cairo API to draw on the context and then +call cairo_destroy() when done. + + +As soon as the context is destroyed with cairo_destroy(), the contents +of the surface will be uploaded into the ClutterCairoTexture actor: + + + + cairo_t *cr; + + cr = clutter_cairo_texture_create (CLUTTER_CAIRO_TEXTURE (texture)); + + /* draw on the context */ + + cairo_destroy (cr); + + + +Note that you should never use the code above inside the +"paint" or "pick" virtual functions or +signal handlers because it will lead to performance +degradation. + + +Since ClutterCairoTexture uses a Cairo image surface +internally all the drawing operations will be performed in +software and not using hardware acceleration. This can lead to +performance degradation if the contents of the texture change +frequently. + + +ClutterCairoTexture is available since Clutter 1.0. + + + + + + +Details + +ClutterCairoTexture +ClutterCairoTexturetypedef struct _ClutterCairoTexture ClutterCairoTexture; + +The ClutterCairoTexture struct contains only private data. + + +Since 1.0 + + +ClutterCairoTextureClass +ClutterCairoTextureClasstypedef struct { +} ClutterCairoTextureClass; + + +The ClutterCairoTextureClass struct contains only private data. + + +Since 1.0 + + +clutter_cairo_texture_new () +clutter_cairo_texture_newClutterActor* clutter_cairo_texture_new (guint width, + guint height); + +Creates a new ClutterCairoTexture actor, with a surface of width by +height pixels. + + + +width : + + +height : + + +Returns : + + + +Since 1.0 + + +clutter_cairo_texture_set_surface_size () +clutter_cairo_texture_set_surface_sizevoid clutter_cairo_texture_set_surface_size + (ClutterCairoTexture *self, + guint width, + guint height); + +Resizes the Cairo surface used by self to width and height. + + + +self : + + +width : + + +height : + + + + +Since 1.0 + + +clutter_cairo_texture_get_surface_size () +clutter_cairo_texture_get_surface_sizevoid clutter_cairo_texture_get_surface_size + (ClutterCairoTexture *self, + guint *width, + guint *height); + +Retrieves the surface width and height for self. + + + +self : + + +width : + + +height : + + + + +Since 1.0 + + +clutter_cairo_texture_create () +clutter_cairo_texture_createcairo_t* clutter_cairo_texture_create (ClutterCairoTexture *self); + +Creates a new Cairo context for the cairo texture. It is +similar to using clutter_cairo_texture_create_region() with x_offset +and y_offset of 0, width equal to the cairo texture surface width +and height equal to the cairo texture surface height. + + +Do not call this function within the paint virtual +function or from a callback to the "paint" +signal. + + + +self : + + +Returns : + + + +Since 1.0 + + +clutter_cairo_texture_create_region () +clutter_cairo_texture_create_regioncairo_t* clutter_cairo_texture_create_region (ClutterCairoTexture *self, + gint x_offset, + gint y_offset, + gint width, + gint height); + +Creates a new Cairo context that will updat the region defined +by x_offset, y_offset, width and height. + + +Do not call this function within the paint virtual +function or from a callback to the "paint" +signal. + + + +self : + + +x_offset : + + +y_offset : + + +width : + + +height : + + +Returns : + + + +Since 1.0 + + +clutter_cairo_set_source_color () +clutter_cairo_set_source_colorvoid clutter_cairo_set_source_color (cairo_t *cr, + const ClutterColor *color); + +Utility function for setting the source color of cr using +a ClutterColor. + + + +cr : + + +color : + + + + +Since 1.0 + + + + +Property Details +The <literal>"surface-height"</literal> property +ClutterCairoTexture:surface-height "surface-height" guint : Read / Write + +The height of the Cairo surface used by the ClutterCairoTexture +actor, in pixels. + + +Default value: 0 +Since 1.0 + + +The <literal>"surface-width"</literal> property +ClutterCairoTexture:surface-width "surface-width" guint : Read / Write + +The width of the Cairo surface used by the ClutterCairoTexture +actor, in pixels. + + +Default value: 0 +Since 1.0 + + + + + + + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-clone-texture.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-clone-texture.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-clone-texture.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-clone-texture.xml 1970-01-01 01:00:00.000000000 +0100 @@ -1,177 +0,0 @@ - - -]> - - - -ClutterCloneTexture -3 -CLUTTER Library - - - -ClutterCloneTexture -Actor for cloning existing textures in an -efficient way. - - - - -Synopsis - - - ClutterCloneTexture; - ClutterCloneTextureClass; -ClutterActor* clutter_clone_texture_new (ClutterTexture *texture); -ClutterTexture* clutter_clone_texture_get_parent_texture - (ClutterCloneTexture *clone); -void clutter_clone_texture_set_parent_texture - (ClutterCloneTexture *clone, - ClutterTexture *texture); - - - - -Object Hierarchy - - GObject - +----GInitiallyUnowned - +----ClutterActor - +----ClutterCloneTexture - - - - - - - -Implemented Interfaces - -ClutterCloneTexture implements - - - - - - -Properties - - "parent-texture" ClutterTexture* : Read / Write - "repeat-x" gboolean : Read / Write - "repeat-y" gboolean : Read / Write - - - - - - -Description - -ClutterCloneTexture allows the cloning of existing ClutterTexture based -actors whilst saving underlying graphics resources. - - - - - - -Details - -ClutterCloneTexture -ClutterCloneTexturetypedef struct _ClutterCloneTexture ClutterCloneTexture; - - - - -ClutterCloneTextureClass -ClutterCloneTextureClasstypedef struct { - ClutterActorClass parent_class; - - /* padding for future expansion */ - void (*_clutter_clone_1) (void); - void (*_clutter_clone_2) (void); - void (*_clutter_clone_3) (void); - void (*_clutter_clone_4) (void); -} ClutterCloneTextureClass; - - - - - -clutter_clone_texture_new () -clutter_clone_texture_newClutterActor* clutter_clone_texture_new (ClutterTexture *texture); - -Creates an efficient 'clone' of a pre-existing texture with which it -shares the underlying pixbuf data. - - -You can use clutter_clone_texture_set_parent_texture() to change the -cloned texture. - - - -texture : - a ClutterTexture, or NULL - -Returns : the newly created ClutterCloneTexture - - - -clutter_clone_texture_get_parent_texture () -clutter_clone_texture_get_parent_textureClutterTexture* clutter_clone_texture_get_parent_texture - (ClutterCloneTexture *clone); - -Retrieves the parent ClutterTexture used by clone. - - - -clone : - a ClutterCloneTexture - -Returns : a ClutterTexture actor, or NULL - - -Since 0.2 - - -clutter_clone_texture_set_parent_texture () -clutter_clone_texture_set_parent_texturevoid clutter_clone_texture_set_parent_texture - (ClutterCloneTexture *clone, - ClutterTexture *texture); - -Sets the parent texture cloned by the ClutterCloneTexture. - - - -clone : - a ClutterCloneTexture - -texture : - a ClutterTexture or NULL - -Since 0.2 - - - - -Property Details -The <literal>"parent-texture"</literal> property -ClutterCloneTexture:parent-texture "parent-texture" ClutterTexture* : Read / Write -The parent texture to clone. -The <literal>"repeat-x"</literal> property -ClutterCloneTexture:repeat-x "repeat-x" gboolean : Read / Write -Reapeat underlying pixbuf rather than scale in x direction.Default value: FALSE - -The <literal>"repeat-y"</literal> property -ClutterCloneTexture:repeat-y "repeat-y" gboolean : Read / Write -Reapeat underlying pixbuf rather than scale in y direction.Default value: FALSE - - - - - - - - diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-clone.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-clone.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-clone.xml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-clone.xml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,155 @@ + + +]> + + + +ClutterClone +3 +CLUTTER Library + + + +ClutterClone + + + + + +Synopsis + + + ClutterClone; + ClutterCloneClass; +ClutterActor* clutter_clone_new (ClutterActor *source); +void clutter_clone_set_source (ClutterClone *clone, + ClutterActor *source); +ClutterActor* clutter_clone_get_source (ClutterClone *clone); + + + + +Object Hierarchy + + GObject + +----GInitiallyUnowned + +----ClutterActor + +----ClutterClone + + + + + + + +Implemented Interfaces + +ClutterClone implements + ClutterScriptable. + + + + + +Properties + + "source" ClutterActor* : Read / Write / Construct Only + + + + + + +Description + + + + + + +Details + +ClutterClone +ClutterClonetypedef struct _ClutterClone ClutterClone; + + + + +ClutterCloneClass +ClutterCloneClasstypedef struct { +} ClutterCloneClass; + + + + + +clutter_clone_new () +clutter_clone_newClutterActor* clutter_clone_new (ClutterActor *source); + +Creates a new ClutterActor which clones source/ + + + +source : + a ClutterActor, or NULL + +Returns : the newly created ClutterClone + + +Since 1.0 + + +clutter_clone_set_source () +clutter_clone_set_sourcevoid clutter_clone_set_source (ClutterClone *clone, + ClutterActor *source); + +Sets source as the source actor to be cloned by clone. + + + +clone : + a ClutterClone + +source : + a ClutterActor, or NULL + +Since 1.0 + + +clutter_clone_get_source () +clutter_clone_get_sourceClutterActor* clutter_clone_get_source (ClutterClone *clone); + +Retrieves the source ClutterActor being cloned by clone + + + +clone : + a ClutterClone + +Returns : the actor source for the clone + + +Since 1.0 + + + + +Property Details +The <literal>"source"</literal> property +ClutterClone:source "source" ClutterActor* : Read / Write / Construct Only + +This property specifies the source actor being cloned. + + +Since 1.0 + + + + + + + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-color.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-color.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-color.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-color.xml 2009-01-30 12:41:02.000000000 +0000 @@ -22,6 +22,10 @@ ClutterColor; +ClutterColor* clutter_color_new (guint8 red, + guint8 green, + guint8 blue, + guint8 alpha); ClutterColor* clutter_color_copy (const ClutterColor *color); void clutter_color_free (ClutterColor *color); @@ -76,7 +80,7 @@ GParamFlags flags); #define CLUTTER_VALUE_HOLDS_COLOR (x) void clutter_value_set_color (GValue *value, - ClutterColor *color); + const ClutterColor *color); const ClutterColor* clutter_value_get_color (const GValue *value); @@ -136,6 +140,35 @@ + +clutter_color_new () +clutter_color_newClutterColor* clutter_color_new (guint8 red, + guint8 green, + guint8 blue, + guint8 alpha); + +Creates a new ClutterColor with the given values. + + + +red : + red component of the color, between 0 and 255 + +green : + green component of the color, between 0 and 255 + +blue : + blue component of the color, between 0 and 255 + +alpha : + alpha component of the color, between 0 and 255 + +Returns : the newly allocated color. Use clutter_color_free() + when done + + +Since 0.8.4 + clutter_color_copy () clutter_color_copyClutterColor* clutter_color_copy (const ClutterColor *color); @@ -501,14 +534,15 @@ Since 0.2 - + ClutterParamSpecColor -ClutterParamSpecColortypedef struct { +ClutterParamSpecColortypedef struct { ClutterColor *default_value; } ClutterParamSpecColor; - +A GParamSpec subclass for defining properties holding +a ClutterColor. @@ -517,7 +551,8 @@ default color value - +Since 1.0 + clutter_param_spec_color () clutter_param_spec_colorGParamSpec* clutter_param_spec_color (const gchar *name, @@ -567,7 +602,7 @@ clutter_value_set_color () clutter_value_set_colorvoid clutter_value_set_color (GValue *value, - ClutterColor *color); + const ClutterColor *color); Sets value to color. diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-container.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-container.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-container.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-container.xml 2009-01-30 12:41:02.000000000 +0000 @@ -150,6 +150,8 @@ void (* foreach) (ClutterContainer *container, ClutterCallback callback, gpointer user_data); + + /* child stacking */ void (* raise) (ClutterContainer *container, ClutterActor *actor, ClutterActor *sibling); @@ -159,7 +161,6 @@ void (* sort_depth_order) (ClutterContainer *container); /* ClutterChildMeta management */ - GType child_meta_type; void (* create_child_meta) (ClutterContainer *container, ClutterActor *actor); @@ -180,23 +181,28 @@ } ClutterContainerIface; -Base interface for container actors. +Base interface for container actors. The add, remove and foreach +virtual functions must be provided by any implementation; the other +virtual functions are optional. add () - virtual function for adding an actor to the container + virtual function for adding an actor to the container. The + implementation of this virtual function is required. remove () - virtual function for removing an actor from the container + virtual function for removing an actor from the container. The + implementation of this virtual function is required. foreach () - virtual function for iterating over the container's children + virtual function for iterating over the container's children. + The implementation of this virtual function is required. diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-effect.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-effect.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-effect.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-effect.xml 1970-01-01 01:00:00.000000000 +0100 @@ -1,571 +0,0 @@ - - -]> - - - -Clutter Effects -3 -CLUTTER Library - - - -Clutter Effects -Utility Class for basic visual effects - - - - -Synopsis - - - ClutterEffectTemplate; - ClutterEffectTemplateClass; -ClutterEffectTemplate* clutter_effect_template_new (ClutterTimeline *timeline, - ClutterAlphaFunc alpha_func); -ClutterEffectTemplate* clutter_effect_template_new_full (ClutterTimeline *timeline, - ClutterAlphaFunc alpha_func, - gpointer user_data, - GDestroyNotify notify); -ClutterEffectTemplate* clutter_effect_template_new_for_duration - (guint msecs, - ClutterAlphaFunc alpha_func); -void clutter_effect_template_construct (ClutterEffectTemplate *template_, - ClutterTimeline *timeline, - ClutterAlphaFunc alpha_func, - gpointer user_data, - GDestroyNotify notify); -gboolean clutter_effect_template_get_timeline_clone - (ClutterEffectTemplate *template_); -void clutter_effect_template_set_timeline_clone - (ClutterEffectTemplate *template_, - gboolean setting); - -void (*ClutterEffectCompleteFunc) (ClutterActor *actor, - gpointer user_data); -ClutterTimeline* clutter_effect_fade (ClutterEffectTemplate *template_, - ClutterActor *actor, - guint8 opacity_end, - ClutterEffectCompleteFunc func, - gpointer data); -ClutterTimeline* clutter_effect_move (ClutterEffectTemplate *template_, - ClutterActor *actor, - gint x, - gint y, - ClutterEffectCompleteFunc func, - gpointer data); -ClutterTimeline* clutter_effect_path (ClutterEffectTemplate *template_, - ClutterActor *actor, - const ClutterKnot *knots, - guint n_knots, - ClutterEffectCompleteFunc func, - gpointer data); -ClutterTimeline* clutter_effect_scale (ClutterEffectTemplate *template_, - ClutterActor *actor, - gdouble x_scale_end, - gdouble y_scale_end, - ClutterEffectCompleteFunc func, - gpointer data); -ClutterTimeline* clutter_effect_depth (ClutterEffectTemplate *template_, - ClutterActor *actor, - gint depth_end, - ClutterEffectCompleteFunc func, - gpointer data); -ClutterTimeline* clutter_effect_rotate (ClutterEffectTemplate *template_, - ClutterActor *actor, - ClutterRotateAxis axis, - gdouble angle, - gint center_x, - gint center_y, - gint center_z, - ClutterRotateDirection direction, - ClutterEffectCompleteFunc func, - gpointer data); - - - - - - - - - - - - -Description - -The ClutterEffectTemplate class provides a simple API for applying -pre-defined effects to a single actor. It works as a wrapper around -the ClutterBehaviour objects - - - - - - -Details - -ClutterEffectTemplate -ClutterEffectTemplatetypedef struct { -} ClutterEffectTemplate; - - - - - -ClutterEffectTemplateClass -ClutterEffectTemplateClasstypedef struct { -} ClutterEffectTemplateClass; - - - - - -clutter_effect_template_new () -clutter_effect_template_newClutterEffectTemplate* clutter_effect_template_new (ClutterTimeline *timeline, - ClutterAlphaFunc alpha_func); - -Creates a new ClutterEffectTemplate, to be used with the effects API. - - -A ClutterEffectTemplate binds a timeline and an alpha function and can -be used as a template for multiple calls of clutter_effect_fade(), -clutter_effect_move() and clutter_effect_scale(). - - -This API is intended for simple animations involving a single actor; -for more complex animations, you should see ClutterBehaviour and the -derived classes. - - - -timeline : - A ClutterTimeline for the template (will be cloned) - -alpha_func : - An alpha func to use for the template. - -Returns : a ClutterEffectTemplate - - -Since 0.4 - - -clutter_effect_template_new_full () -clutter_effect_template_new_fullClutterEffectTemplate* clutter_effect_template_new_full (ClutterTimeline *timeline, - ClutterAlphaFunc alpha_func, - gpointer user_data, - GDestroyNotify notify); - -Creates a new ClutterEffectTemplate, to be used with the effects API. - - -A ClutterEffectTemplate binds a timeline and an alpha function and can -be used as a template for multiple calls of clutter_effect_fade(), -clutter_effect_move() and clutter_effect_scale(). - - -This API is intended for simple animations involving a single actor; -for more complex animations, you should see ClutterBehaviour and the -derived classes. - - -This function is intended for language bindings only: if notify is -not NULL it will be called to dispose of user_data. - - - -timeline : - a ClutterTimeline - -alpha_func : - an alpha function to use for the template - -user_data : - data to be passed to the alpha function, or NULL - -notify : - function to be called when disposing the alpha function's use - data, or NULL - -Returns : the newly created ClutterEffectTemplate object - - -Since 0.4 - - -clutter_effect_template_new_for_duration () -clutter_effect_template_new_for_durationClutterEffectTemplate* clutter_effect_template_new_for_duration - (guint msecs, - ClutterAlphaFunc alpha_func); - -Creates a new ClutterEffectTemplate, to be used with the effects API. - - -A ClutterEffectTemplate binds a timeline and an alpha function and can -be used as a template for multiple calls of clutter_effect_fade(), -clutter_effect_move() and clutter_effect_scale(). - - -This API is intended for simple animations involving a single actor; -for more complex animations, you should see ClutterBehaviour and the -derived classes. - - -This function creates a ClutterTimeline with a duration of msecs -milliseconds and transfers ownership of the timeline object to the -returned ClutterEffectTemplate. - - - -msecs : - the duration of the effects, in milliseconds - -alpha_func : - an alpha function to use for the template - -Returns : the newly created ClutterEffectTemplate object - - -Since 0.6 - - -clutter_effect_template_construct () -clutter_effect_template_constructvoid clutter_effect_template_construct (ClutterEffectTemplate *template_, - ClutterTimeline *timeline, - ClutterAlphaFunc alpha_func, - gpointer user_data, - GDestroyNotify notify); - -Constructs a ClutterEffectTemplate, to be used with the effects API. - - -This function can only be called once after the creation of template_ -and is only useful for language bindings. - - - -template_ : - a ClutterEffectTemplate - -timeline : - a ClutterTimeline - -alpha_func : - an alpha function to use for the template - -user_data : - data to be passed to the alpha function, or NULL - -notify : - function to be called when disposing the alpha function's use - data, or NULL - -Since 0.6 - - -clutter_effect_template_get_timeline_clone () -clutter_effect_template_get_timeline_clonegboolean clutter_effect_template_get_timeline_clone - (ClutterEffectTemplate *template_); - -Gets whether timelines should be cloned when creating a new -effect or just referenced. - - - -template_ : - A ClutterEffectTemplate - -Returns : TRUE if the templates timeline is to be cloned. - - -Since 0.6 - - -clutter_effect_template_set_timeline_clone () -clutter_effect_template_set_timeline_clonevoid clutter_effect_template_set_timeline_clone - (ClutterEffectTemplate *template_, - gboolean setting); - -Sets if effects using this template should make a copy of the -templates timeline (default) or reference the effects timeline. - - - -template_ : - A ClutterEffectTemplate - -setting : - A boolean indicating if effects should clone the timeline. - -Since 0.6 - - -ClutterEffectCompleteFunc () -ClutterEffectCompleteFuncvoid (*ClutterEffectCompleteFunc) (ClutterActor *actor, - gpointer user_data); - -Callback function invoked when an effect is complete. - - - -actor : - a ClutterActor - -user_data : - user data - -Since 0.4 - - -clutter_effect_fade () -clutter_effect_fadeClutterTimeline* clutter_effect_fade (ClutterEffectTemplate *template_, - ClutterActor *actor, - guint8 opacity_end, - ClutterEffectCompleteFunc func, - gpointer data); - -Simple effect for fading a single ClutterActor. - - - -template_ : - A ClutterEffectTemplate - -actor : - A ClutterActor to apply the effect to. - -opacity_end : - Final opacity value to apply to actor - -func : - A ClutterEffectCompleteFunc to call on effect - completion or NULL - -data : - Data to pass to supplied ClutterEffectCompleteFunc - or NULL - -Returns : a ClutterTimeline for the effect. Will be unrefed by -the effect when completed. - - -Since 0.6 - - -clutter_effect_move () -clutter_effect_moveClutterTimeline* clutter_effect_move (ClutterEffectTemplate *template_, - ClutterActor *actor, - gint x, - gint y, - ClutterEffectCompleteFunc func, - gpointer data); - -Simple effect for moving a single ClutterActor along to a -destination point. - - - -template_ : - A ClutterEffectTemplate - -actor : - A ClutterActor to apply the effect to. - -x : - X coordinate of the destination - -y : - Y coordinate of the destination - -func : - A ClutterEffectCompleteFunc to call on effect - completion or NULL - -data : - Data to pass to supplied ClutterEffectCompleteFunc - or NULL - -Returns : a ClutterTimeline for the effect. Will be unreferenced by - the effect when completed. - - -Since 0.6 - - -clutter_effect_path () -clutter_effect_pathClutterTimeline* clutter_effect_path (ClutterEffectTemplate *template_, - ClutterActor *actor, - const ClutterKnot *knots, - guint n_knots, - ClutterEffectCompleteFunc func, - gpointer data); - -Simple effect for moving a single ClutterActor along a path. - - - -template_ : - A ClutterEffectTemplate - -actor : - A ClutterActor to apply the effect to. - -knots : - An array of ClutterKnots representing path for the actor - -n_knots : - Number of ClutterKnots in passed array. - -func : - A ClutterEffectCompleteFunc to call on effect - completion or NULL - -data : - Data to pass to supplied ClutterEffectCompleteFunc - or NULL - -Returns : a ClutterTimeline for the effect. Will be unreferenced by - the effect when completed. - - -Since 0.6 - - -clutter_effect_scale () -clutter_effect_scaleClutterTimeline* clutter_effect_scale (ClutterEffectTemplate *template_, - ClutterActor *actor, - gdouble x_scale_end, - gdouble y_scale_end, - ClutterEffectCompleteFunc func, - gpointer data); - -Simple effect for scaling a single ClutterActor. - - - -template_ : - A ClutterEffectTemplate - -actor : - A ClutterActor to apply the effect to. - -x_scale_end : - Final X axis scale factor to apply to actor - -y_scale_end : - Final Y axis scale factor to apply to actor - -func : - A ClutterEffectCompleteFunc to call on effect - completion or NULL - -data : - Data to pass to supplied ClutterEffectCompleteFunc - or NULL - -Returns : a ClutterTimeline for the effect. Will be unreferenced by - the effect when completed. - - -Since 0.6 - - -clutter_effect_depth () -clutter_effect_depthClutterTimeline* clutter_effect_depth (ClutterEffectTemplate *template_, - ClutterActor *actor, - gint depth_end, - ClutterEffectCompleteFunc func, - gpointer data); - -Simple effect for changing the depth of a single ClutterActor. - - - -template_ : - A ClutterEffectTemplate - -actor : - A ClutterActor to apply the effect to. - -depth_end : - Final depth value to apply to actor - -func : - A ClutterEffectCompleteFunc to call on effect - completion or NULL - -data : - Data to pass to supplied ClutterEffectCompleteFunc - or NULL - -Returns : a ClutterTimeline for the effect. Will be unrefed by -the effect when completed. - - -Since 0.6 - - -clutter_effect_rotate () -clutter_effect_rotateClutterTimeline* clutter_effect_rotate (ClutterEffectTemplate *template_, - ClutterActor *actor, - ClutterRotateAxis axis, - gdouble angle, - gint center_x, - gint center_y, - gint center_z, - ClutterRotateDirection direction, - ClutterEffectCompleteFunc func, - gpointer data); - -Simple effect for rotating a single ClutterActor. - - - -template_ : - a ClutterEffectTemplate - -actor : - a ClutterActor to apply the effect to. - -axis : - axis of rotation - -angle : - final angle to apply to actor - -center_x : - position on X axis to rotate about. - -center_y : - position on Y axis to rotate about. - -center_z : - position on Z axis to rotate about. - -direction : - a ClutterRotateDirection for the rotation. - -func : - a ClutterEffectCompleteFunc to call on effect - completion or NULL - -data : - user data to pass to supplied func or NULL - -Returns : a ClutterTimeline for the effect. Will be unreferenced by - the effect when completed. - - -Since 0.6 - - - - - - - - diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-entry.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-entry.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-entry.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-entry.xml 1970-01-01 01:00:00.000000000 +0100 @@ -1,864 +0,0 @@ - - -]> - - - -ClutterEntry -3 -CLUTTER Library - - - -ClutterEntry -A single line text entry actor - - - - -Synopsis - - - ClutterEntry; - ClutterEntryClass; -ClutterActor* clutter_entry_new (void); -ClutterActor* clutter_entry_new_with_text (const gchar *font_name, - const gchar *text); -ClutterActor* clutter_entry_new_full (const gchar *font_name, - const gchar *text, - const ClutterColor *color); -void clutter_entry_set_text (ClutterEntry *entry, - const gchar *text); -const gchar* clutter_entry_get_text (ClutterEntry *entry); -void clutter_entry_set_font_name (ClutterEntry *entry, - const gchar *font_name); -const gchar* clutter_entry_get_font_name (ClutterEntry *entry); -void clutter_entry_set_color (ClutterEntry *entry, - const ClutterColor *color); -void clutter_entry_get_color (ClutterEntry *entry, - ClutterColor *color); -PangoLayout* clutter_entry_get_layout (ClutterEntry *entry); -void clutter_entry_set_alignment (ClutterEntry *entry, - PangoAlignment alignment); -PangoAlignment clutter_entry_get_alignment (ClutterEntry *entry); -void clutter_entry_set_cursor_position (ClutterEntry *entry, - gint position); -gint clutter_entry_get_cursor_position (ClutterEntry *entry); -void clutter_entry_handle_key_event (ClutterEntry *entry, - ClutterKeyEvent *kev); -void clutter_entry_insert_unichar (ClutterEntry *entry, - gunichar wc); -void clutter_entry_delete_chars (ClutterEntry *entry, - guint len); -void clutter_entry_insert_text (ClutterEntry *entry, - const gchar *text, - gssize position); -void clutter_entry_delete_text (ClutterEntry *entry, - gssize start_pos, - gssize end_pos); -void clutter_entry_set_visible_cursor (ClutterEntry *entry, - gboolean visible); -gboolean clutter_entry_get_visible_cursor (ClutterEntry *entry); -void clutter_entry_set_visibility (ClutterEntry *entry, - gboolean visible); -gboolean clutter_entry_get_visibility (ClutterEntry *entry); -void clutter_entry_set_invisible_char (ClutterEntry *entry, - gunichar wc); -gunichar clutter_entry_get_invisible_char (ClutterEntry *entry); -void clutter_entry_set_max_length (ClutterEntry *entry, - gint max); -gint clutter_entry_get_max_length (ClutterEntry *entry); - - - - -Object Hierarchy - - GObject - +----GInitiallyUnowned - +----ClutterActor - +----ClutterEntry - - - - - - - -Implemented Interfaces - -ClutterEntry implements - - - - - - -Properties - - "alignment" PangoAlignment : Read / Write - "color" ClutterColor* : Read / Write - "cursor-visible" gboolean : Read / Write - "entry-padding" guint : Read / Write - "font-name" gchar* : Read / Write - "max-length" gint : Read / Write - "position" gint : Read / Write - "text" gchar* : Read / Write - "text-visible" gboolean : Read / Write - "x-align" gdouble : Read / Write - - - - -Signals - - "activate" : Run Last - "cursor-event" : Run Last - "text-changed" : Run Last - - - - - -Description - -ClutterEntry is a ClutterTexture that allows single line text entry. - - -ClutterEntry is available since Clutter 0.4. - - - - - - -Details - -ClutterEntry -ClutterEntrytypedef struct _ClutterEntry ClutterEntry; - - - - -ClutterEntryClass -ClutterEntryClasstypedef struct { - /* vfuncs, not signals */ - void (* paint_cursor) (ClutterEntry *entry); - - /* signals */ - void (* text_changed) (ClutterEntry *entry); - void (* cursor_event) (ClutterEntry *entry, - ClutterGeometry *geometry); - void (* activate) (ClutterEntry *entry); -} ClutterEntryClass; - - -Class fo entry actors. - - - - -paint_cursor () - virtual function for subclasses to use to draw a custom - cursor instead of the default one - - - -text_changed () - signal class handler for ClutterEntry::text-changed - - - -cursor_event () - signal class handler for ClutterEntry::cursor-event - - - -activate () - signal class handler for ClutterEntry::activate - - -Since 0.4 - - -clutter_entry_new () -clutter_entry_newClutterActor* clutter_entry_new (void); - -Creates a new, empty ClutterEntry. - - - -Returns : the newly created ClutterEntry - - - -clutter_entry_new_with_text () -clutter_entry_new_with_textClutterActor* clutter_entry_new_with_text (const gchar *font_name, - const gchar *text); - -Creates a new ClutterEntry displaying text using font_name. - - - -font_name : - the name (and size) of the font to be used - -text : - the text to be displayed - -Returns : the newly created ClutterEntry - - -Since 0.4 - - -clutter_entry_new_full () -clutter_entry_new_fullClutterActor* clutter_entry_new_full (const gchar *font_name, - const gchar *text, - const ClutterColor *color); - -Creates a new ClutterEntry displaying text with color -using font_name. - - - -font_name : - the name (and size) of the font to be used - -text : - the text to be displayed - -color : - ClutterColor for text - -Returns : the newly created ClutterEntry - - -Since 0.4 - - -clutter_entry_set_text () -clutter_entry_set_textvoid clutter_entry_set_text (ClutterEntry *entry, - const gchar *text); - -Sets text as the text to be displayed by entry. The -ClutterEntry::text-changed signal is emitted. - - - -entry : - a ClutterEntry - -text : - the text to be displayed - -Since 0.4 - - -clutter_entry_get_text () -clutter_entry_get_textconst gchar* clutter_entry_get_text (ClutterEntry *entry); - -Retrieves the text displayed by entry. - - - -entry : - a ClutterEntry - -Returns : the text of the entry. The returned string is - owned by ClutterEntry and should not be modified or freed. - - -Since 0.4 - - -clutter_entry_set_font_name () -clutter_entry_set_font_namevoid clutter_entry_set_font_name (ClutterEntry *entry, - const gchar *font_name); - -Sets font_name as the font used by entry. - - -font_name must be a string containing the font name and its -size, similarly to what you would feed to the -pango_font_description_from_string() function. - - - -entry : - a ClutterEntry - -font_name : - a font name and size, or NULL for the default font - -Since 0.4 - - -clutter_entry_get_font_name () -clutter_entry_get_font_nameconst gchar* clutter_entry_get_font_name (ClutterEntry *entry); - -Retrieves the font used by entry. - - - -entry : - a ClutterEntry - -Returns : a string containing the font name, in a format - understandable by pango_font_description_from_string(). The - string is owned by ClutterEntry and should not be modified - or freed. - - -Since 0.4 - - -clutter_entry_set_color () -clutter_entry_set_colorvoid clutter_entry_set_color (ClutterEntry *entry, - const ClutterColor *color); - -Sets the color of entry. - - - -entry : - a ClutterEntry - -color : - a ClutterColor - -Since 0.4 - - -clutter_entry_get_color () -clutter_entry_get_colorvoid clutter_entry_get_color (ClutterEntry *entry, - ClutterColor *color); - -Retrieves the color of entry. - - - -entry : - a ClutterEntry - -color : - return location for a ClutterColor - -Since 0.4 - - -clutter_entry_get_layout () -clutter_entry_get_layoutPangoLayout* clutter_entry_get_layout (ClutterEntry *entry); - -Gets the PangoLayout used to display the entry. -The layout is useful to e.g. convert text positions to -pixel positions. -The returned layout is owned by the entry so need not be -freed by the caller. - - - -entry : - a ClutterEntry - -Returns : the PangoLayout for this entry - - -Since 0.4 - - -clutter_entry_set_alignment () -clutter_entry_set_alignmentvoid clutter_entry_set_alignment (ClutterEntry *entry, - PangoAlignment alignment); - -Sets text alignment of the entry. - - - -entry : - a ClutterEntry - -alignment : - A PangoAlignment - -Since 0.4 - - -clutter_entry_get_alignment () -clutter_entry_get_alignmentPangoAlignment clutter_entry_get_alignment (ClutterEntry *entry); - -Returns the entry's text alignment - - - -entry : - a ClutterEntry - -Returns : The entry's PangoAlignment - -Since 0.4 - - - -clutter_entry_set_cursor_position () -clutter_entry_set_cursor_positionvoid clutter_entry_set_cursor_position (ClutterEntry *entry, - gint position); - -Sets the position of the cursor. The position must be less than or -equal to the number of characters in the entry. A value of -1 indicates -that the position should be set after the last character in the entry. -Note that this position is in characters, not in bytes. - - - -entry : - a ClutterEntry - -position : - the position of the cursor. - -Since 0.6 - - -clutter_entry_get_cursor_position () -clutter_entry_get_cursor_positiongint clutter_entry_get_cursor_position (ClutterEntry *entry); - -Gets the position, in characters, of the cursor in entry. - - - -entry : - a ClutterEntry - -Returns : the position of the cursor. - - -Since 0.6 - - -clutter_entry_handle_key_event () -clutter_entry_handle_key_eventclutter_entry_handle_key_eventvoid clutter_entry_handle_key_event (ClutterEntry *entry, - ClutterKeyEvent *kev); -clutter_entry_handle_key_event has been deprecated since version 0.8 and should not be used in newly-written code. The key events will automatically be handled when - giving the key focus to an entry using clutter_stage_set_key_focus(). - -This function will handle a ClutterKeyEvent, like those returned in a -key-press/release-event, and will translate it for the entry. This includes -non-alphanumeric keys, such as the arrows keys, which will move the -input cursor. You should use this function inside a handler for the -ClutterStage::key-press-event or ClutterStage::key-release-event. - - - -entry : - a ClutterEntry - -kev : - a ClutterKeyEvent - -Since 0.4 - - - -clutter_entry_insert_unichar () -clutter_entry_insert_unicharvoid clutter_entry_insert_unichar (ClutterEntry *entry, - gunichar wc); - -Insert a character to the right of the current position of the cursor, -and updates the position of the cursor. - - - -entry : - a ClutterEntry - -wc : - a Unicode character - -Since 0.4 - - -clutter_entry_delete_chars () -clutter_entry_delete_charsvoid clutter_entry_delete_chars (ClutterEntry *entry, - guint len); - -Characters are removed from before the current postion of the cursor. - - - -entry : - a ClutterEntry - -len : - the number of characters to remove. - -Since 0.4 - - -clutter_entry_insert_text () -clutter_entry_insert_textvoid clutter_entry_insert_text (ClutterEntry *entry, - const gchar *text, - gssize position); - -Insert text at a specifc position. - - -A value of 0 indicates that the text will be inserted before the first -character in the entry's text, and a value of -1 indicates that the text -will be inserted after the last character in the entry's text. - - - -entry : - a ClutterEntry - -text : - the text to insert - -position : - the position at which to insert the text. - -Since 0.4 - - -clutter_entry_delete_text () -clutter_entry_delete_textvoid clutter_entry_delete_text (ClutterEntry *entry, - gssize start_pos, - gssize end_pos); - -Deletes a sequence of characters. The characters that are deleted are -those characters at positions from start_pos up to, but not including, -end_pos. If end_pos is negative, then the characters deleted will be -those characters from start_pos to the end of the text. - - - -entry : - a ClutterEntry - -start_pos : - the starting position. - -end_pos : - the end position. - -Since 0.4 - - -clutter_entry_set_visible_cursor () -clutter_entry_set_visible_cursorvoid clutter_entry_set_visible_cursor (ClutterEntry *entry, - gboolean visible); - -Sets the visibility of the input cursor. - - - -entry : - a ClutterEntry - -visible : - whether the input cursor should be visible - -Since 0.4 - - -clutter_entry_get_visible_cursor () -clutter_entry_get_visible_cursorgboolean clutter_entry_get_visible_cursor (ClutterEntry *entry); - -Returns the input cursor's visibility - - - -entry : - a ClutterEntry - -Returns : whether the input cursor is visible - - -Since 0.4 - - -clutter_entry_set_visibility () -clutter_entry_set_visibilityvoid clutter_entry_set_visibility (ClutterEntry *entry, - gboolean visible); - -Sets whether the contents of the entry are visible or not. When visibility -is set to FALSE, characters are displayed as the invisible char, and will -also appear that way when the text in the entry widget is copied elsewhere. - - -The default invisible char is the asterisk '*', but it can be changed with -clutter_entry_set_invisible_char(). - - - -entry : - a ClutterEntry - -visible : - TRUE if the contents of the entry are displayed as plaintext. - -Since 0.4 - - -clutter_entry_get_visibility () -clutter_entry_get_visibilitygboolean clutter_entry_get_visibility (ClutterEntry *entry); - -Returns the entry text visibility. - - - -entry : - a ClutterEntry - -Returns : TRUE if the contents of the entry are displayed as plaintext. - - -Since 0.4 - - -clutter_entry_set_invisible_char () -clutter_entry_set_invisible_charvoid clutter_entry_set_invisible_char (ClutterEntry *entry, - gunichar wc); - -Sets the character to use in place of the actual text when -clutter_entry_set_visibility() has been called to set text visibility -to FALSE. i.e. this is the character used in "password mode" to show the -user how many characters have been typed. The default invisible char is an -asterisk ('*'). If you set the invisible char to 0, then the user will get -no feedback at all; there will be no text on the screen as they type. - - - -entry : - a ClutterEntry - -wc : - a Unicode character - -Since 0.4 - - -clutter_entry_get_invisible_char () -clutter_entry_get_invisible_chargunichar clutter_entry_get_invisible_char (ClutterEntry *entry); - -Returns the character to use in place of the actual text when text-visibility -is set to FALSE - - - -entry : - a ClutterEntry - -Returns : a Unicode character - - - - -clutter_entry_set_max_length () -clutter_entry_set_max_lengthvoid clutter_entry_set_max_length (ClutterEntry *entry, - gint max); - -Sets the maximum allowed length of the contents of the actor. If the -current contents are longer than the given length, then they will be -truncated to fit. - - - -entry : - a ClutterEntry - -max : - the maximum number of characters allowed in the entry; 0 - to disable or -1 to set the length of the current string - -Since 0.4 - - -clutter_entry_get_max_length () -clutter_entry_get_max_lengthgint clutter_entry_get_max_length (ClutterEntry *entry); - -Gets the maximum length of text that can be set into entry. -See clutter_entry_set_max_length(). - - - -entry : - a ClutterEntry - -Returns : the maximum number of characters. - - -Since 0.4 - - - - -Property Details -The <literal>"alignment"</literal> property -ClutterEntry:alignment "alignment" PangoAlignment : Read / Write - -The preferred alignment for the string. - - -Default value: PANGO_ALIGN_LEFT -Since 0.4 - - -The <literal>"color"</literal> property -ClutterEntry:color "color" ClutterColor* : Read / Write - -The color of the text inside the entry. - - -Since 0.4 - - -The <literal>"cursor-visible"</literal> property -ClutterEntry:cursor-visible "cursor-visible" gboolean : Read / Write - -Whether the input cursor is visible or not. - - -Default value: TRUE -Since 0.4 - - -The <literal>"entry-padding"</literal> property -ClutterEntry:entry-padding "entry-padding" guint : Read / Write - -The padding space between the text and the entry right and left borders. - - -Default value: 5 -Since 0.4 - - -The <literal>"font-name"</literal> property -ClutterEntry:font-name "font-name" gchar* : Read / Write - -The font to be used by the entry, expressed in a string that -can be parsed by pango_font_description_from_string(). - - -Default value: NULL -Since 0.4 - - -The <literal>"max-length"</literal> property -ClutterEntry:max-length "max-length" gint : Read / Write - -The maximum length of the entry text. - - -Allowed values: >= 0 -Default value: 0 -Since 0.4 - - -The <literal>"position"</literal> property -ClutterEntry:position "position" gint : Read / Write - -The current input cursor position. -1 is taken to be the end of the text - - -Allowed values: >= -1 -Default value: -1 -Since 0.4 - - -The <literal>"text"</literal> property -ClutterEntry:text "text" gchar* : Read / Write - -The text inside the entry. - - -Default value: NULL -Since 0.4 - - -The <literal>"text-visible"</literal> property -ClutterEntry:text-visible "text-visible" gboolean : Read / Write - -Whether the text is visible in plain form, or replaced by the -character set by clutter_entry_set_invisible_char(). - - -Default value: TRUE -Since 0.4 - - -The <literal>"x-align"</literal> property -ClutterEntry:x-align "x-align" gdouble : Read / Write - -Horizontal alignment to be used for the text (0.0 for left alignment, -1.0 for right alignment). - - -Allowed values: [0,1] -Default value: 0 -Since 0.6 - - - - - - -Signal Details -The <literal>"activate"</literal> signal -ClutterEntry::activatevoid user_function (ClutterEntry *entry, - gpointer user_data) : Run Last - -The ::activate signal is emitted each time the entry is 'activated' -by the user, normally by pressing the 'Enter' key. - - - -entry : - the actor which received the event - -user_data : -user data set when the signal handler was connected. -Since 0.4 -The <literal>"cursor-event"</literal> signal -ClutterEntry::cursor-eventvoid user_function (ClutterEntry *entry, - ClutterGeometry *geometry, - gpointer user_data) : Run Last - -The ::cursor-event signal is emitted each time the input cursor's geometry -changes, this could be a positional or size change. If you would like to -implement your own input cursor, set the cursor-visible property to FALSE, -and connect to this signal to position and size your own cursor. - - - -entry : - the actor which received the event - -geometry : - a ClutterGeometry - -user_data : -user data set when the signal handler was connected. -Since 0.4 -The <literal>"text-changed"</literal> signal -ClutterEntry::text-changedvoid user_function (ClutterEntry *entry, - gpointer user_data) : Run Last - -The ::text-changed signal is emitted after entry's text changes - - - -entry : - the actor which received the event - -user_data : -user data set when the signal handler was connected. - - - - - - diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-event.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-event.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-event.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-event.xml 2009-01-30 12:41:02.000000000 +0000 @@ -120,7 +120,17 @@ CLUTTER_BUTTON2_MASK = 1 << 9, CLUTTER_BUTTON3_MASK = 1 << 10, CLUTTER_BUTTON4_MASK = 1 << 11, - CLUTTER_BUTTON5_MASK = 1 << 12 + CLUTTER_BUTTON5_MASK = 1 << 12, + + /* bits 15 to 25 are currently unused; bit 29 is used internally */ + + CLUTTER_SUPER_MASK = 1 << 26, + CLUTTER_HYPER_MASK = 1 << 27, + CLUTTER_META_MASK = 1 << 28, + + CLUTTER_RELEASE_MASK = 1 << 30, + + CLUTTER_MODIFIER_MASK = 0x5c001fff } ClutterModifierType; @@ -193,6 +203,31 @@ Mask applied by the fifth pointer button + +CLUTTER_SUPER_MASK + Mask applied by the Super key + + + +CLUTTER_HYPER_MASK + Mask applied by the Hyper key + + + +CLUTTER_META_MASK + Mask applied by the Meta key + + + +CLUTTER_RELEASE_MASK + Mask applied during release + + + +CLUTTER_MODIFIER_MASK + A mask covering all modifier types + + Since 0.4 @@ -411,7 +446,12 @@ } ClutterButtonEvent; -Button event +Button event. + + +The event coordinates are relative to the stage that received the +event, and can be transformed into actor-relative coordinates by +using clutter_actor_transform_stage_point(). @@ -442,12 +482,12 @@ gint x; - event X coordinate + event X coordinate, relative to the stage gint y; - event Y coordinate + event Y coordinate, relative to the stage @@ -1043,14 +1083,14 @@ clutter_key_event_symbol () clutter_key_event_symbolguint clutter_key_event_symbol (ClutterKeyEvent *keyev); -Retrieves the value of the key that caused keyev. +Retrieves the symbol of the key that caused keyev. keyev : A ClutterKeyEvent -Returns : The keysym representing the key +Returns : The key symbol representing the key @@ -1091,7 +1131,7 @@ keyval : - a clutter key symbol + a key symbol Returns : the corresponding unicode character, or 0 if there is no corresponding character. diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-fixed.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-fixed.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-fixed.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-fixed.xml 2009-01-30 12:41:02.000000000 +0000 @@ -22,7 +22,6 @@ typedef ClutterFixed; -#define CFX_Q #define CFX_ONE #define CFX_HALF #define CFX_MAX @@ -44,7 +43,6 @@ #define CLUTTER_FLOAT_TO_INT (x) #define CLUTTER_FLOAT_TO_UINT (x) #define CLUTTER_INT_TO_FIXED (x) -#define CLUTTER_FIXED_INT (x) #define CLUTTER_FIXED_FRACTION (x) #define CLUTTER_FIXED_FLOOR (x) #define CLUTTER_FIXED_CEIL (x) @@ -52,34 +50,18 @@ #define CLUTTER_FIXED_DIV (x,y) typedef ClutterAngle; #define CLUTTER_ANGLE_FROM_DEG (x) -#define CLUTTER_ANGLE_FROM_DEGF (x) #define CLUTTER_ANGLE_FROM_DEGX (x) -#define CLUTTER_ANGLE_TO_DEGF (x) #define CLUTTER_ANGLE_TO_DEG (x) #define CLUTTER_ANGLE_TO_DEGX (x) #define CLUTTER_ANGLE_MAX_DEG #define CFX_RADIANS_TO_DEGREES -#define clutter_cosi (angle) -#define clutter_cosx (angle) -ClutterFixed clutter_sini (ClutterAngle angle); -ClutterFixed clutter_sinx (ClutterFixed angle); -#define CLUTTER_SQRTI_ARG_10_PERCENT -#define CLUTTER_SQRTI_ARG_5_PERCENT -#define CLUTTER_SQRTI_ARG_MAX -gint clutter_sqrti (gint x); -ClutterFixed clutter_sqrtx (ClutterFixed x); -ClutterFixed clutter_log2x (guint x); -guint clutter_pow2x (ClutterFixed x); -guint clutter_powx (guint x, - ClutterFixed y); -ClutterFixed clutter_qmulx (ClutterFixed op1, - ClutterFixed op2); -ClutterFixed clutter_qdivx (ClutterFixed op1, - ClutterFixed op2); -ClutterFixed clutter_tani (ClutterAngle angle); -ClutterFixed clutter_atani (ClutterFixed x); -ClutterFixed clutter_atan2i (ClutterFixed y, - ClutterFixed x); +#define clutter_cosx (a) +#define clutter_sinx (a) +#define clutter_tanx (a) +#define clutter_atanx (a) +#define clutter_atan2x (x,y) +#define clutter_qmulx (x,y) +#define clutter_qdivx (x,y) #define CLUTTER_MAXFIXED #define CLUTTER_MINFIXED @@ -138,7 +120,7 @@ Two fixed point numbers can only be multiplied and divided by the - provided CLUTTER_FIXED_MUL and CLUTTER_FIXED_DIV macros. + provided CLUTTER_FIXED_MUL and CLUTTER_FIXED_DIV macros. @@ -150,25 +132,16 @@ Details ClutterFixed -ClutterFixedtypedef gint32 ClutterFixed; +ClutterFixedtypedef float ClutterFixed; Fixed point number (16.16) - -CFX_Q -CFX_Q#define CFX_Q 16 /* Decimal part size in bits */ - - -Size in bits of decimal part of floating point value. - - - CFX_ONE -CFX_ONE#define CFX_ONE (1 << CFX_Q) /* 1 */ +CFX_ONE#define CFX_ONE 1.0 1.0 represented as a fixed point value. @@ -177,7 +150,7 @@ CFX_HALF -CFX_HALF#define CFX_HALF 32768 +CFX_HALF#define CFX_HALF 0.5 0.5 represented as a fixed point value. @@ -186,7 +159,7 @@ CFX_MAX -CFX_MAX#define CFX_MAX 0x7fffffff +CFX_MAX#define CFX_MAX G_MAXFLOAT Maximum fixed point value. @@ -195,7 +168,7 @@ CFX_MIN -CFX_MIN#define CFX_MIN 0x80000000 +CFX_MIN#define CFX_MIN (-G_MAXFLOAT) Minimum fixed point value. @@ -204,7 +177,7 @@ CFX_PI -CFX_PI#define CFX_PI 0x0003243f +CFX_PI#define CFX_PI G_PI Fixed point representation of Pi @@ -213,7 +186,7 @@ CFX_2PI -CFX_2PI#define CFX_2PI 0x0006487f +CFX_2PI#define CFX_2PI (G_PI * 2) Fixed point representation of Pi*2 @@ -222,7 +195,7 @@ CFX_PI_2 -CFX_PI_2#define CFX_PI_2 0x00019220 /* pi/2 */ +CFX_PI_2#define CFX_PI_2 (G_PI / 2) Fixed point representation of Pi/2 @@ -231,7 +204,7 @@ CFX_PI_4 -CFX_PI_4#define CFX_PI_4 0x0000c910 /* pi/4 */ +CFX_PI_4#define CFX_PI_4 (G_PI / 4) Fixed point representation of Pi/4 @@ -240,7 +213,7 @@ CFX_120 -CFX_120#define CFX_120 CLUTTER_INT_TO_FIXED (120) +CFX_120#define CFX_120 120.0 Fixed point representation of the number 120 @@ -249,7 +222,7 @@ CFX_180 -CFX_180#define CFX_180 CLUTTER_INT_TO_FIXED (180) +CFX_180#define CFX_180 180.0 Fixed point representation of the number 180 @@ -258,7 +231,7 @@ CFX_240 -CFX_240#define CFX_240 CLUTTER_INT_TO_FIXED (240) +CFX_240#define CFX_240 240.0 Fixed point representation of the number 240 @@ -267,7 +240,7 @@ CFX_360 -CFX_360#define CFX_360 CLUTTER_INT_TO_FIXED (360) +CFX_360#define CFX_360 360.0 Fixed point representation of the number 360 @@ -276,7 +249,7 @@ CFX_60 -CFX_60#define CFX_60 CLUTTER_INT_TO_FIXED (60) +CFX_60#define CFX_60 60.0 Fixed point representation of the number 60 @@ -285,7 +258,7 @@ CFX_255 -CFX_255#define CFX_255 CLUTTER_INT_TO_FIXED (255) +CFX_255#define CFX_255 255.0 Fixed point representation of the number 255 @@ -294,7 +267,7 @@ CLUTTER_FIXED_TO_INT() -CLUTTER_FIXED_TO_INT#define CLUTTER_FIXED_TO_INT(x) ((x) >> CFX_Q) +CLUTTER_FIXED_TO_INT#define CLUTTER_FIXED_TO_INT(x) ((int)(x)) Converts a fixed point value to integer (removing the decimal part). @@ -308,7 +281,7 @@ CLUTTER_FIXED_TO_FLOAT() -CLUTTER_FIXED_TO_FLOAT#define CLUTTER_FIXED_TO_FLOAT(x) ((float) ((int)(x) / 65536.0)) +CLUTTER_FIXED_TO_FLOAT#define CLUTTER_FIXED_TO_FLOAT(x) (x) Convert a fixed point value to float. @@ -321,7 +294,7 @@ CLUTTER_FIXED_TO_DOUBLE() -CLUTTER_FIXED_TO_DOUBLE#define CLUTTER_FIXED_TO_DOUBLE(x) ((double) ((int)(x) / 65536.0)) +CLUTTER_FIXED_TO_DOUBLE#define CLUTTER_FIXED_TO_DOUBLE(x) ((double)(x)) Convert a fixed point value to double. @@ -334,7 +307,7 @@ CLUTTER_FLOAT_TO_FIXED() -CLUTTER_FLOAT_TO_FIXED#define CLUTTER_FLOAT_TO_FIXED(x) (clutter_double_to_fixed ((x))) +CLUTTER_FLOAT_TO_FIXED#define CLUTTER_FLOAT_TO_FIXED(x) ((x)) Convert a float value to fixed. @@ -347,7 +320,7 @@ CLUTTER_FLOAT_TO_INT() -CLUTTER_FLOAT_TO_INT#define CLUTTER_FLOAT_TO_INT(x) (clutter_double_to_int ((x))) +CLUTTER_FLOAT_TO_INT#define CLUTTER_FLOAT_TO_INT(x) ((int)(x)) Convert a float value to int. @@ -360,7 +333,7 @@ CLUTTER_FLOAT_TO_UINT() -CLUTTER_FLOAT_TO_UINT#define CLUTTER_FLOAT_TO_UINT(x) (clutter_double_to_uint ((x))) +CLUTTER_FLOAT_TO_UINT#define CLUTTER_FLOAT_TO_UINT(x) ((unsigned int)(x)) Convert a float value to unsigned int. @@ -373,7 +346,7 @@ CLUTTER_INT_TO_FIXED() -CLUTTER_INT_TO_FIXED#define CLUTTER_INT_TO_FIXED(x) ((x) << CFX_Q) +CLUTTER_INT_TO_FIXED#define CLUTTER_INT_TO_FIXED(x) ((float)(x)) Convert an integer value to fixed point. @@ -384,23 +357,9 @@ an integer value - -CLUTTER_FIXED_INT() -CLUTTER_FIXED_INT#define CLUTTER_FIXED_INT(x) CLUTTER_FIXED_TO_INT((x)) - -CLUTTER_FIXED_INT has been deprecated since version 0.6 and should not be used in newly-written code. Use CLUTTER_FIXED_TO_INT instead - -Convert a fixed point value to integer (removing decimal part). - - - -x : - a fixed point value - - CLUTTER_FIXED_FRACTION() -CLUTTER_FIXED_FRACTION#define CLUTTER_FIXED_FRACTION(x) ((x) & ((1 << CFX_Q) - 1)) +CLUTTER_FIXED_FRACTION#define CLUTTER_FIXED_FRACTION(x) ((x)-floorf (x)) Retrieves the fractionary part of a fixed point value @@ -413,7 +372,8 @@ CLUTTER_FIXED_FLOOR() -CLUTTER_FIXED_FLOOR#define CLUTTER_FIXED_FLOOR(x) +CLUTTER_FIXED_FLOOR#define CLUTTER_FIXED_FLOOR(x) (floorf (x)) + Round down a fixed point value to an integer. @@ -425,7 +385,7 @@ CLUTTER_FIXED_CEIL() -CLUTTER_FIXED_CEIL#define CLUTTER_FIXED_CEIL(x) (CLUTTER_FIXED_FLOOR (x + 0xffff)) +CLUTTER_FIXED_CEIL#define CLUTTER_FIXED_CEIL(x) (ceilf (x)) Round up a fixed point value to an integer. @@ -438,7 +398,7 @@ CLUTTER_FIXED_MUL() -CLUTTER_FIXED_MUL#define CLUTTER_FIXED_MUL(x,y) ((x) >> 8) * ((y) >> 8) +CLUTTER_FIXED_MUL#define CLUTTER_FIXED_MUL(x,y) ((x) * (y)) Multiply two fixed point values @@ -454,7 +414,7 @@ CLUTTER_FIXED_DIV() -CLUTTER_FIXED_DIV#define CLUTTER_FIXED_DIV(x,y) ((((x) << 8)/(y)) << 8) +CLUTTER_FIXED_DIV#define CLUTTER_FIXED_DIV(x,y) ((x) / (y)) Divide two fixed point values @@ -470,30 +430,16 @@ ClutterAngle -ClutterAngletypedef gint32 ClutterAngle; /* angle such that 1024 == 2*PI */ +ClutterAngletypedef float ClutterAngle; -Integer representation of an angle such that 1024 corresponds to -full circle (i.e., 2*Pi). +An abstract representation of an angle. CLUTTER_ANGLE_FROM_DEG() -CLUTTER_ANGLE_FROM_DEG#define CLUTTER_ANGLE_FROM_DEG(x) (CLUTTER_FLOAT_TO_INT (((x) * 1024.0) / 360.0)) - - - - -x : - - - - - - -CLUTTER_ANGLE_FROM_DEGF() -CLUTTER_ANGLE_FROM_DEGF#define CLUTTER_ANGLE_FROM_DEGF(x) (CLUTTER_FLOAT_TO_INT (((float)(x) * 1024.0f) / 360.0f)) +CLUTTER_ANGLE_FROM_DEG#define CLUTTER_ANGLE_FROM_DEG(x) ((float)(x)) @@ -506,20 +452,7 @@ CLUTTER_ANGLE_FROM_DEGX() -CLUTTER_ANGLE_FROM_DEGX#define CLUTTER_ANGLE_FROM_DEGX(x) (CFX_INT((((x)/360)*1024) + CFX_HALF)) - - - - -x : - - - - - - -CLUTTER_ANGLE_TO_DEGF() -CLUTTER_ANGLE_TO_DEGF#define CLUTTER_ANGLE_TO_DEGF(x) (((float)(x) * 360.0)/ 1024.0) +CLUTTER_ANGLE_FROM_DEGX#define CLUTTER_ANGLE_FROM_DEGX(x) (CLUTTER_FIXED_TO_FLOAT (x)) @@ -532,7 +465,7 @@ CLUTTER_ANGLE_TO_DEG() -CLUTTER_ANGLE_TO_DEG#define CLUTTER_ANGLE_TO_DEG(x) (((x) * 360.0)/ 1024.0) +CLUTTER_ANGLE_TO_DEG#define CLUTTER_ANGLE_TO_DEG(x) ((float)(x)) @@ -545,7 +478,7 @@ CLUTTER_ANGLE_TO_DEGX() -CLUTTER_ANGLE_TO_DEGX#define CLUTTER_ANGLE_TO_DEGX(x) (CLUTTER_INT_TO_FIXED((x) * 45)/128) +CLUTTER_ANGLE_TO_DEGX#define CLUTTER_ANGLE_TO_DEGX(x) (CLUTTER_FLOAT_TO_FIXED (x)) @@ -565,313 +498,122 @@ CFX_RADIANS_TO_DEGREES -CFX_RADIANS_TO_DEGREES#define CFX_RADIANS_TO_DEGREES 0x394bb8 +CFX_RADIANS_TO_DEGREES#define CFX_RADIANS_TO_DEGREES (180.0 / G_PI) Fixed point representation of the number 180 / pi - -clutter_cosi() -clutter_cosi#define clutter_cosi(angle) (clutter_sini ((angle) + 256)) - - -Very fast fixed point implementation of cosine function. - - -ClutterAngle is an integer such that 1024 represents -full circle. - - - -angle : - a ClutterAngle angle - -Since 0.2 - - + clutter_cosx() -clutter_cosx#define clutter_cosx(angle) (clutter_sinx((angle) + CFX_PI_2)) +clutter_cosx#define clutter_cosx(a) cosf (a * (G_PI/180.0)) -Fixed point cosine function - - - -angle : - a ClutterFixed angle in radians - -Since 0.2 - - -clutter_sini () -clutter_siniClutterFixed clutter_sini (ClutterAngle angle); - -Very fast fixed point implementation of sine function. - - -ClutterAngle is an integer such that 1024 represents -full circle. - -angle : - a ClutterAngle - -Returns : ClutterFixed sine value. +a : + - -Since 0.2 - - -clutter_sinx () -clutter_sinxClutterFixed clutter_sinx (ClutterFixed angle); - -Fixed point implementation of sine function - - -angle : - a ClutterFixed angle in radians -Returns : ClutterFixed sine value. - - -Since 0.2 - - -CLUTTER_SQRTI_ARG_10_PERCENT -CLUTTER_SQRTI_ARG_10_PERCENT#define CLUTTER_SQRTI_ARG_10_PERCENT - -Maximum argument that can be passed to clutter_sqrti for which the -resulting error is < 10% - - -Since 0.6 - - -CLUTTER_SQRTI_ARG_5_PERCENT -CLUTTER_SQRTI_ARG_5_PERCENT#define CLUTTER_SQRTI_ARG_5_PERCENT - -Maximum argument that can be passed to clutter_sqrti for which the -resulting error is < 5% - - -Since 0.6 - - -CLUTTER_SQRTI_ARG_MAX -CLUTTER_SQRTI_ARG_MAX#define CLUTTER_SQRTI_ARG_MAX - -Maximum argument that can be passed to clutter_sqrti function. - - -Since 0.6 - - -clutter_sqrti () -clutter_sqrtigint clutter_sqrti (gint x); - -Very fast fixed point implementation of square root for integers. - - -This function is at least 6x faster than clib sqrt() on x86, and (this is -not a typo!) about 500x faster on ARM without FPU. It's error is < 5% -for arguments < CLUTTER_SQRTI_ARG_5_PERCENT and < 10% for arguments < -CLUTTER_SQRTI_ARG_10_PERCENT. The maximum argument that can be passed to -this function is CLUTTER_SQRTI_ARG_MAX. + + +clutter_sinx() +clutter_sinx#define clutter_sinx(a) sinf (a * (G_PI/180.0)) + -x : - integer value +a : + -Returns : integer square root. +Returns : -Since 0.2 - - -clutter_sqrtx () -clutter_sqrtxClutterFixed clutter_sqrtx (ClutterFixed x); - -A fixed point implementation of squre root + + +clutter_tanx() +clutter_tanx#define clutter_tanx(a) tanf (a * (G_PI/180.0)) + -x : - a ClutterFixed - -Returns : ClutterFixed square root. - - -Since 0.2 - - -clutter_log2x () -clutter_log2xClutterFixed clutter_log2x (guint x); - -Calculates base 2 logarithm. - - -This function is some 2.5 times faster on x86, and over 12 times faster on -fpu-less arm, than using libc log(). - +a : + - -x : - value to calculate base 2 logarithm from - -Returns : base 2 logarithm. -Since 0.4 - - -clutter_pow2x () -clutter_pow2xguint clutter_pow2x (ClutterFixed x); - -Calculates 2 to x power. - - -This function is around 11 times faster on x86, and around 22 times faster -on fpu-less arm than libc pow(2, x). + + +clutter_atanx() +clutter_atanx#define clutter_atanx(a) atanf (a * (G_PI/180.0)) + -x : - exponent - -Returns : 2 in x power. +a : + + -Since 0.4 - - -clutter_powx () -clutter_powxguint clutter_powx (guint x, - ClutterFixed y); - -Calculates x to y power. (Note, if x is a constant it will be faster to -calculate the power as clutter_pow2x (CLUTTER_FIXED_MUL(y, log2 (x))) + + +clutter_atan2x() +clutter_atan2x#define clutter_atan2x(x,y) atan2f (x, y) + x : - base + y : - ClutterFixed exponent - -Returns : x in y power. - - -Since 0.4 - - -clutter_qmulx () -clutter_qmulxClutterFixed clutter_qmulx (ClutterFixed op1, - ClutterFixed op2); - -Multiplies two fixed values using 64bit arithmetic; this provides -significantly better precission than the CLUTTER_FIXED_MUL macro, -but at performance cost (about 2.7 times slowdown on ARMv5e, and 2 times -on x86). - + - -op1 : - ClutterFixed - -op2 : - ClutterFixed - -Returns : the result of the operation -Since 0.4 - - -clutter_qdivx () -clutter_qdivxClutterFixed clutter_qdivx (ClutterFixed op1, - ClutterFixed op2); - -Divides two fixed values using 64bit arithmetic; this provides -significantly better precission than the CLUTTER_FIXED_DIV macro, -but at performance cost. + + +clutter_qmulx() +clutter_qmulx#define clutter_qmulx(x,y) ((x) * (y)) + -op1 : - ClutterFixed +x : + -op2 : - ClutterFixed +y : + -Returns : ClutterFixed +Returns : - -Since 0.4 - - -clutter_tani () -clutter_taniClutterFixed clutter_tani (ClutterAngle angle); - -Very fast fixed point implementation of tan function. - - -ClutterAngle is an integer such that 1024 represents -full circle. - - - -angle : - a ClutterAngle - -Returns : ClutterFixed sine value. -Since 0.3 - - -clutter_atani () -clutter_ataniClutterFixed clutter_atani (ClutterFixed x); - -Fast fixed-point version of the arctangent function. + + +clutter_qdivx() +clutter_qdivx#define clutter_qdivx(x,y) ((x) / (y)) + x : - The tangent to calculate the angle for - -Returns : The angle in radians represented as a ClutterFixed -for which the tangent is x. + - - -clutter_atan2i () -clutter_atan2iClutterFixed clutter_atan2i (ClutterFixed y, - ClutterFixed x); - -Calculates the arctangent of y / x but uses the sign of both -arguments to return the angle in right quadrant. - - - y : - Numerator of tangent - -x : - Denominator of tangent + -Returns : The arctangent of y / x +Returns : + + CLUTTER_MAXFIXED -CLUTTER_MAXFIXED#define CLUTTER_MAXFIXED CFX_MAX +CLUTTER_MAXFIXED#define CLUTTER_MAXFIXED G_MAXFLOAT Higher boundary for ClutterFixed @@ -881,7 +623,7 @@ CLUTTER_MINFIXED -CLUTTER_MINFIXED#define CLUTTER_MINFIXED CFX_MIN +CLUTTER_MINFIXED#define CLUTTER_MINFIXED (-G_MAXFLOAT) Lower boundary for ClutterFixed diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-group.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-group.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-group.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-group.xml 2009-01-30 12:41:02.000000000 +0000 @@ -65,7 +65,7 @@ Implemented Interfaces ClutterGroup implements - ClutterContainer. + ClutterScriptable and ClutterContainer. diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-interval.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-interval.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-interval.xml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-interval.xml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,561 @@ + + +]> + + + +Value intervals +3 +CLUTTER Library + + + +Value intervals +An object holding an interval of two values + + + + +Synopsis + + + ClutterInterval; + ClutterIntervalClass; +ClutterInterval* clutter_interval_new (GType gtype, + ...); +ClutterInterval* clutter_interval_new_with_values (GType gtype, + const GValue *initial, + const GValue *final); +ClutterInterval* clutter_interval_clone (ClutterInterval *interval); +GType clutter_interval_get_value_type (ClutterInterval *interval); +void clutter_interval_set_initial_value (ClutterInterval *interval, + const GValue *value); +void clutter_interval_get_initial_value (ClutterInterval *interval, + GValue *value); +GValue* clutter_interval_peek_initial_value (ClutterInterval *interval); +void clutter_interval_set_final_value (ClutterInterval *interval, + const GValue *value); +void clutter_interval_get_final_value (ClutterInterval *interval, + GValue *value); +GValue* clutter_interval_peek_final_value (ClutterInterval *interval); +void clutter_interval_set_interval (ClutterInterval *interval, + ...); +void clutter_interval_get_interval (ClutterInterval *interval, + ...); + +gboolean clutter_interval_compute_value (ClutterInterval *interval, + gdouble factor, + GValue *value); +gboolean clutter_interval_validate (ClutterInterval *interval, + GParamSpec *pspec); + +gboolean (*ClutterProgressFunc) (const GValue *a, + const GValue *b, + gdouble progress, + GValue *retval); +void clutter_interval_register_progress_func + (GType value_type, + ClutterProgressFunc func); + + + + + + + + + + + + +Description + +ClutterInterval is a simple object that can hold two values +defining an interval. ClutterInterval can hold any value that +can be enclosed inside a GValue. + + +Once a ClutterInterval for a specific GType has been instantiated +the "value-type" property cannot be changed anymore. + + +ClutterInterval starts with a floating reference; this means that +any object taking a reference on a ClutterInterval instance should +also take ownership of the interval by using g_object_ref_sink(). + + +ClutterInterval is used by ClutterAnimation to define the +interval of values that an implicit animation should tween over. + + +ClutterInterval can be subclassed to override the validation +and value computation. + + +ClutterInterval is available since Clutter 1.0 + + + + + + +Details + +ClutterInterval +ClutterIntervaltypedef struct { +} ClutterInterval; + + +The ClutterInterval structure contains only private data and should +be accessed using the provided functions. + + +Since 1.0 + + +ClutterIntervalClass +ClutterIntervalClasstypedef struct { + gboolean (* validate) (ClutterInterval *interval, + GParamSpec *pspec); + gboolean (* compute_value) (ClutterInterval *interval, + gdouble factor, + GValue *value); +} ClutterIntervalClass; + + +The ClutterIntervalClass contains only private data. + + + + +validate () + virtual function for validating an interval + using a GParamSpec + + + +compute_value () + virtual function for computing the value + inside an interval using an adimensional factor between 0 and 1 + + +Since 1.0 + + +clutter_interval_new () +clutter_interval_newClutterInterval* clutter_interval_new (GType gtype, + ...); + +Creates a new ClutterInterval holding values of type gtype. + + +This function avoids using a GValue for the initial and final values +of the interval: + + + + interval = clutter_interval_new (G_TYPE_FLOAT, 0.0, 1.0); + interval = clutter_interval_new (G_TYPE_BOOLEAN, FALSE, TRUE); + interval = clutter_interval_new (G_TYPE_INT, 0, 360); + + + + +gtype : + the type of the values in the interval + +... : + the initial value and the final value of the interval + +Returns : the newly created ClutterInterval + + +Since 1.0 + + +clutter_interval_new_with_values () +clutter_interval_new_with_valuesClutterInterval* clutter_interval_new_with_values (GType gtype, + const GValue *initial, + const GValue *final); + +Creates a new ClutterInterval of type gtype, between initial +and final. + + +This function is useful for language bindings. + + + +gtype : + the type of the values in the interval + +initial : + a GValue holding the initial value of the interval + +final : + a GValue holding the final value of the interval + +Returns : the newly created ClutterInterval + + +Since 1.0 + + +clutter_interval_clone () +clutter_interval_cloneClutterInterval* clutter_interval_clone (ClutterInterval *interval); + +Creates a copy of interval. + + + +interval : + a ClutterInterval + +Returns : the newly created ClutterInterval + + +Since 1.0 + + +clutter_interval_get_value_type () +clutter_interval_get_value_typeGType clutter_interval_get_value_type (ClutterInterval *interval); + +Retrieves the GType of the values inside interval. + + + +interval : + a ClutterInterval + +Returns : the type of the value, or G_TYPE_INVALID + + +Since 1.0 + + +clutter_interval_set_initial_value () +clutter_interval_set_initial_valuevoid clutter_interval_set_initial_value (ClutterInterval *interval, + const GValue *value); + +Sets the initial value of interval to value. The value is copied +inside the ClutterInterval. + + + +interval : + a ClutterInterval + +value : + a GValue + +Since 1.0 + + +clutter_interval_get_initial_value () +clutter_interval_get_initial_valuevoid clutter_interval_get_initial_value (ClutterInterval *interval, + GValue *value); + +Retrieves the initial value of interval and copies +it into value. + + +The passed GValue must be initialized to the value held by +the ClutterInterval. + + + +interval : + a ClutterInterval + +value : + a GValue + +Since 1.0 + + +clutter_interval_peek_initial_value () +clutter_interval_peek_initial_valueGValue* clutter_interval_peek_initial_value (ClutterInterval *interval); + +Gets the pointer to the initial value of interval + + + +interval : + a ClutterInterval + +Returns : the initial value of the interval. The value + is owned by the ClutterInterval and it should not be + modified or freed + + +Since 1.0 + + +clutter_interval_set_final_value () +clutter_interval_set_final_valuevoid clutter_interval_set_final_value (ClutterInterval *interval, + const GValue *value); + +Sets the final value of interval to value. The value is +copied inside the ClutterInterval. + + + +interval : + a ClutterInterval + +value : + a GValue + +Since 1.0 + + +clutter_interval_get_final_value () +clutter_interval_get_final_valuevoid clutter_interval_get_final_value (ClutterInterval *interval, + GValue *value); + +Retrieves the final value of interval and copies +it into value. + + +The passed GValue must be initialized to the value held by +the ClutterInterval. + + + +interval : + a ClutterInterval + +value : + a GValue + +Since 1.0 + + +clutter_interval_peek_final_value () +clutter_interval_peek_final_valueGValue* clutter_interval_peek_final_value (ClutterInterval *interval); + +Gets the pointer to the final value of interval + + + +interval : + a ClutterInterval + +Returns : the final value of the interval. The value + is owned by the ClutterInterval and it should not be + modified or freed + + +Since 1.0 + + +clutter_interval_set_interval () +clutter_interval_set_intervalvoid clutter_interval_set_interval (ClutterInterval *interval, + ...); + +Variable arguments wrapper for clutter_interval_set_initial_value() +and clutter_interval_set_final_value() that avoids using the +GValue arguments: + + + + clutter_interval_set_interval (interval, 0, 50); + clutter_interval_set_interval (interval, 1.0, 0.0); + clutter_interval_set_interval (interval, FALSE, TRUE); + + + +This function is meant for the convenience of the C API; bindings +should reimplement this function using the GValue-based API. + + + +interval : + a ClutterInterval + +... : + the initial and final values of the interval + +Since 1.0 + + +clutter_interval_get_interval () +clutter_interval_get_intervalvoid clutter_interval_get_interval (ClutterInterval *interval, + ...); + +Variable arguments wrapper for clutter_interval_get_initial_value() +and clutter_interval_get_final_value() that avoids using the +GValue arguments: + + + + gint a = 0, b = 0; + clutter_interval_get_interval (interval, &a, &b); + + + +This function is meant for the convenience of the C API; bindings +should reimplement this function using the GValue-based API. + + + +interval : + a ClutterInterval + +... : + return locations for the initial and final values of + the interval + +Since 1.0 + + +clutter_interval_compute_value () +clutter_interval_compute_valuegboolean clutter_interval_compute_value (ClutterInterval *interval, + gdouble factor, + GValue *value); + +Computes the value between the interval boundaries given the +progress factor and puts it into value. + + + +interval : + a ClutterInterval + +factor : + the progress factor, between 0 and 1 + +value : + return location for an initialized GValue + +Returns : TRUE if the operation was successful + + +Since 1.0 + + +clutter_interval_validate () +clutter_interval_validategboolean clutter_interval_validate (ClutterInterval *interval, + GParamSpec *pspec); + +Validates the initial and final values of interval against +a GParamSpec. + + + +interval : + a ClutterInterval + +pspec : + a GParamSpec + +Returns : TRUE if the ClutterInterval is valid, FALSE otherwise + + +Since 1.0 + + +ClutterProgressFunc () +ClutterProgressFuncgboolean (*ClutterProgressFunc) (const GValue *a, + const GValue *b, + gdouble progress, + GValue *retval); + +Prototype of the progress function used to compute the value +between the two ends a and b of an interval depending on +the value of progress. + + +The GValue in retval is already initialized with the same +type as a and b. + + +This function will be called by ClutterInterval if the +type of the values of the interval was registered using +clutter_interval_register_progress_func(). + + + +a : + the initial value of an interval + +b : + the final value of an interval + +progress : + the progress factor, between 0 and 1 + +retval : + the value used to store the progress + +Returns : TRUE if the function successfully computed + the value and stored it inside retval + + +Since 1.0 + + +clutter_interval_register_progress_func () +clutter_interval_register_progress_funcvoid clutter_interval_register_progress_func + (GType value_type, + ClutterProgressFunc func); + +Sets the progress function for a given value_type, like: + + + + clutter_interval_register_progress_func (MY_TYPE_FOO, + my_foo_progress); + + + +Whenever a ClutterInterval instance using the default +"compute_value" implementation is set as an +interval between two GValue of type value_type, it will call +func to establish the value depending on the given progress, +for instance: + + + + static gboolean + my_int_progress (const GValue *a, + const GValue *b, + gdouble progress, + GValue *retval) + { + gint ia = g_value_get_int (a); + gint ib = g_value_get_int (b); + gint res = factor * (ib - ia) + ia; + + g_value_set_int (retval, res); + + return TRUE; + } + + clutter_interval_register_progress_func (G_TYPE_INT, my_int_progress); + + + +To unset a previously set progress function of a GType, pass NULL +for func. + + + +value_type : + a GType + +func : + a ClutterProgressFunc, or NULL to unset a previously + set progress function + +Since 1.0 + + + + + + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-label.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-label.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-label.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-label.xml 1970-01-01 01:00:00.000000000 +0100 @@ -1,611 +0,0 @@ - - -]> - - - -ClutterLabel -3 -CLUTTER Library - - - -ClutterLabel -Actor for displaying text - - - - -Synopsis - - - ClutterLabel; - ClutterLabelClass; -ClutterActor* clutter_label_new (void); -ClutterActor* clutter_label_new_with_text (const gchar *font_name, - const gchar *text); -ClutterActor* clutter_label_new_full (const gchar *font_name, - const gchar *text, - const ClutterColor *color); -void clutter_label_set_text (ClutterLabel *label, - const gchar *text); -const gchar* clutter_label_get_text (ClutterLabel *label); -void clutter_label_set_font_name (ClutterLabel *label, - const gchar *font_name); -const gchar* clutter_label_get_font_name (ClutterLabel *label); -void clutter_label_set_color (ClutterLabel *label, - const ClutterColor *color); -void clutter_label_get_color (ClutterLabel *label, - ClutterColor *color); -void clutter_label_set_ellipsize (ClutterLabel *label, - PangoEllipsizeMode mode); -PangoEllipsizeMode clutter_label_get_ellipsize (ClutterLabel *label); -void clutter_label_set_line_wrap (ClutterLabel *label, - gboolean wrap); -gboolean clutter_label_get_line_wrap (ClutterLabel *label); -void clutter_label_set_line_wrap_mode (ClutterLabel *label, - PangoWrapMode wrap_mode); -PangoWrapMode clutter_label_get_line_wrap_mode (ClutterLabel *label); -PangoLayout* clutter_label_get_layout (ClutterLabel *label); -void clutter_label_set_attributes (ClutterLabel *label, - PangoAttrList *attrs); -PangoAttrList* clutter_label_get_attributes (ClutterLabel *label); -void clutter_label_set_use_markup (ClutterLabel *label, - gboolean setting); -gboolean clutter_label_get_use_markup (ClutterLabel *label); -void clutter_label_set_alignment (ClutterLabel *label, - PangoAlignment alignment); -PangoAlignment clutter_label_get_alignment (ClutterLabel *label); -gboolean clutter_label_get_justify (ClutterLabel *label); -void clutter_label_set_justify (ClutterLabel *label, - gboolean justify); - - - - -Object Hierarchy - - GObject - +----GInitiallyUnowned - +----ClutterActor - +----ClutterLabel - - - - - - - -Implemented Interfaces - -ClutterLabel implements - - - - - - -Properties - - "alignment" PangoAlignment : Read / Write - "attributes" PangoAttrList* : Read / Write - "color" ClutterColor* : Read / Write - "ellipsize" PangoEllipsizeMode : Read / Write - "font-name" gchar* : Read / Write - "justify" gboolean : Read / Write - "text" gchar* : Read / Write - "use-markup" gboolean : Read / Write - "wrap" gboolean : Read / Write - "wrap-mode" PangoWrapMode : Read / Write - - - - - - -Description - -ClutterLabel is a ClutterActor that displays text using Pango. - - - - - - -Details - -ClutterLabel -ClutterLabeltypedef struct _ClutterLabel ClutterLabel; - - - - -ClutterLabelClass -ClutterLabelClasstypedef struct { -} ClutterLabelClass; - - - - - -clutter_label_new () -clutter_label_newClutterActor* clutter_label_new (void); - -Creates a new, empty ClutterLabel. - - - -Returns : the newly created ClutterLabel - - - -clutter_label_new_with_text () -clutter_label_new_with_textClutterActor* clutter_label_new_with_text (const gchar *font_name, - const gchar *text); - -Creates a new ClutterLabel displaying text using font_name. - - - -font_name : - the name (and size) of the font to be used - -text : - the text to be displayed - -Returns : a ClutterLabel - - - -clutter_label_new_full () -clutter_label_new_fullClutterActor* clutter_label_new_full (const gchar *font_name, - const gchar *text, - const ClutterColor *color); - -Creates a new ClutterLabel displaying text with color -using font_name. - - - -font_name : - the name (and size) of the font to be used - -text : - the text to be displayed - -color : - ClutterColor for text - -Returns : a ClutterLabel - - - -clutter_label_set_text () -clutter_label_set_textvoid clutter_label_set_text (ClutterLabel *label, - const gchar *text); - -Sets text as the text to be displayed by label. - - - -label : - a ClutterLabel - -text : - the text to be displayed - - - -clutter_label_get_text () -clutter_label_get_textconst gchar* clutter_label_get_text (ClutterLabel *label); - -Retrieves the text displayed by label - - - -label : - a ClutterLabel - -Returns : the text of the label. The returned string is -owned by ClutterLabel and should not be modified or freed. - - - -clutter_label_set_font_name () -clutter_label_set_font_namevoid clutter_label_set_font_name (ClutterLabel *label, - const gchar *font_name); - -Sets font_name as the font used by label. - - -font_name must be a string containing the font name and its -size, similarly to what you would feed to the -pango_font_description_from_string() function. - - - -label : - a ClutterLabel - -font_name : - a font name and size, or NULL for the default font - - - -clutter_label_get_font_name () -clutter_label_get_font_nameconst gchar* clutter_label_get_font_name (ClutterLabel *label); - -Retrieves the font used by label. - - - -label : - a ClutterLabel - -Returns : a string containing the font name, in a format - understandable by pango_font_description_from_string(). The - string is owned by label and should not be modified - or freed. - - - -clutter_label_set_color () -clutter_label_set_colorvoid clutter_label_set_color (ClutterLabel *label, - const ClutterColor *color); - -Sets the color of label. - - - -label : - a ClutterLabel - -color : - a ClutterColor - - - -clutter_label_get_color () -clutter_label_get_colorvoid clutter_label_get_color (ClutterLabel *label, - ClutterColor *color); - -Retrieves the color of label. - - - -label : - a ClutterLabel - -color : - return location for a ClutterColor - - - -clutter_label_set_ellipsize () -clutter_label_set_ellipsizevoid clutter_label_set_ellipsize (ClutterLabel *label, - PangoEllipsizeMode mode); - -Sets the mode used to ellipsize (add an ellipsis: "...") to the text -if there is not enough space to render the entire string. - - - -label : - a ClutterLabel - -mode : - a PangoEllipsizeMode - -Since 0.2 - - -clutter_label_get_ellipsize () -clutter_label_get_ellipsizePangoEllipsizeMode clutter_label_get_ellipsize (ClutterLabel *label); - -Returns the ellipsizing position of the label. -See clutter_label_set_ellipsize(). - - - -label : - a ClutterLabel - -Returns : PangoEllipsizeMode - - -Since 0.2 - - -clutter_label_set_line_wrap () -clutter_label_set_line_wrapvoid clutter_label_set_line_wrap (ClutterLabel *label, - gboolean wrap); - -Toggles line wrapping within the ClutterLabel widget. TRUE makes -it break lines if text exceeds the widget's size. FALSE lets the -text get cut off by the edge of the widget if it exceeds the widget -size. - - - -label : - a ClutterLabel - -wrap : - the setting - -Since 0.2 - - -clutter_label_get_line_wrap () -clutter_label_get_line_wrapgboolean clutter_label_get_line_wrap (ClutterLabel *label); - -Returns whether lines in the label are automatically wrapped. -See clutter_label_set_line_wrap(). - - - -label : - a ClutterLabel - -Returns : TRUE if the lines of the label are automatically wrapped. - - -Since 0.2 - - -clutter_label_set_line_wrap_mode () -clutter_label_set_line_wrap_modevoid clutter_label_set_line_wrap_mode (ClutterLabel *label, - PangoWrapMode wrap_mode); - -If line wrapping is on (see clutter_label_set_line_wrap()) this controls how -the line wrapping is done. The default is PANGO_WRAP_WORD which means -wrap on word boundaries. - - - -label : - a ClutterLabel - -wrap_mode : - the line wrapping mode - -Since 0.2 - - -clutter_label_get_line_wrap_mode () -clutter_label_get_line_wrap_modePangoWrapMode clutter_label_get_line_wrap_mode (ClutterLabel *label); - -Returns line wrap mode used by the label. -See clutter_label_set_line_wrap_mode(). - - - -label : - a ClutterLabel - -Returns : TRUE if the lines of the label are automatically wrapped. - - -Since 0.2 - - -clutter_label_get_layout () -clutter_label_get_layoutPangoLayout* clutter_label_get_layout (ClutterLabel *label); - -Gets the PangoLayout used to display the label. -The layout is useful to e.g. convert text positions to -pixel positions. -The returned layout is owned by the label so need not be -freed by the caller. - - - -label : - a ClutterLabel - -Returns : the PangoLayout for this label - - -Since 0.2 - - -clutter_label_set_attributes () -clutter_label_set_attributesvoid clutter_label_set_attributes (ClutterLabel *label, - PangoAttrList *attrs); - -Sets a PangoAttrList; the attributes in the list are applied to the -label text. The attributes set with this function will be ignored -if the "use_markup" property -is TRUE. - - - -label : - a ClutterLabel - -attrs : - a PangoAttrList - -Since 0.2 - - -clutter_label_get_attributes () -clutter_label_get_attributesPangoAttrList* clutter_label_get_attributes (ClutterLabel *label); - -Gets the attribute list that was set on the label using -clutter_label_set_attributes(), if any. - - - -label : - a ClutterLabel - -Returns : the attribute list, or NULL if none was set. - - -Since 0.2 - - -clutter_label_set_use_markup () -clutter_label_set_use_markupvoid clutter_label_set_use_markup (ClutterLabel *label, - gboolean setting); - -Sets whether the text of the label contains markup in Pango's text markup -language. - - - -label : - a ClutterLabel - -setting : - TRUE if the label's text should be parsed for markup. - - - -clutter_label_get_use_markup () -clutter_label_get_use_markupgboolean clutter_label_get_use_markup (ClutterLabel *label); - -Returns whether the label's text is interpreted as marked up with -the Pango text markup -language. See clutter_label_set_use_markup(). - - - -label : - a ClutterLabel - -Returns : TRUE if the label's text will be parsed for markup. - - - -clutter_label_set_alignment () -clutter_label_set_alignmentvoid clutter_label_set_alignment (ClutterLabel *label, - PangoAlignment alignment); - -Sets text alignment of the label. - - -The alignment will only be used when the contents of the -label are enough to wrap, and the "wrap" -property is set to TRUE. - - - -label : - a ClutterLabel - -alignment : - A PangoAlignment - - - -clutter_label_get_alignment () -clutter_label_get_alignmentPangoAlignment clutter_label_get_alignment (ClutterLabel *label); - -Returns the label's text alignment - - - -label : - a ClutterLabel - -Returns : The label's PangoAlignment - -Since 0.2 - - - -clutter_label_get_justify () -clutter_label_get_justifygboolean clutter_label_get_justify (ClutterLabel *label); - -Retrieves whether the label should justify the text on both margins. - - - -label : - a ClutterLabel - -Returns : TRUE if the text should be justified - - -Since 0.6 - - -clutter_label_set_justify () -clutter_label_set_justifyvoid clutter_label_set_justify (ClutterLabel *label, - gboolean justify); - -Sets whether the text of the label actor should be justified -on both margins. This setting is ignored if Clutter is compiled -against Pango < 1.18. - - - -label : - a ClutterLabel - -justify : - whether the text should be justified - -Since 0.6 - - - - -Property Details -The <literal>"alignment"</literal> property -ClutterLabel:alignment "alignment" PangoAlignment : Read / Write -The preferred alignment for the string.Default value: PANGO_ALIGN_LEFT - -The <literal>"attributes"</literal> property -ClutterLabel:attributes "attributes" PangoAttrList* : Read / Write -A list of style attributes to apply to the text of the label. -The <literal>"color"</literal> property -ClutterLabel:color "color" ClutterColor* : Read / Write -Font Colour. -The <literal>"ellipsize"</literal> property -ClutterLabel:ellipsize "ellipsize" PangoEllipsizeMode : Read / Write -The preferred place to ellipsize the string, if the label does not have enough room to display the entire string.Default value: PANGO_ELLIPSIZE_NONE - -The <literal>"font-name"</literal> property -ClutterLabel:font-name "font-name" gchar* : Read / Write -Pango font description.Default value: NULL - -The <literal>"justify"</literal> property -ClutterLabel:justify "justify" gboolean : Read / Write - -Whether the contents of the label should be justified on both -margins. - - -Default value: FALSE -Since 0.6 - - -The <literal>"text"</literal> property -ClutterLabel:text "text" gchar* : Read / Write -Text to render.Default value: NULL - -The <literal>"use-markup"</literal> property -ClutterLabel:use-markup "use-markup" gboolean : Read / Write -The text of the label includes XML markup. See pango_parse_markup().Default value: FALSE - -The <literal>"wrap"</literal> property -ClutterLabel:wrap "wrap" gboolean : Read / Write -If set, wrap lines if the text becomes too wide.Default value: FALSE - -The <literal>"wrap-mode"</literal> property -ClutterLabel:wrap-mode "wrap-mode" PangoWrapMode : Read / Write -If wrap is set, controls how line-wrapping is done.Default value: PANGO_WRAP_WORD - - - - - - - - diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-main.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-main.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-main.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-main.xml 2009-01-30 12:41:02.000000000 +0000 @@ -52,8 +52,10 @@ void clutter_set_motion_events_frequency (guint frequency); guint clutter_get_motion_events_frequency (void); void clutter_clear_glyph_cache (void); -void clutter_set_use_mipmapped_text (gboolean value); -gboolean clutter_get_use_mipmapped_text (void); +enum ClutterFontFlags; +void clutter_set_font_flags (ClutterFontFlags flags); +ClutterFontFlags clutter_get_font_flags (void); +PangoFontMap* clutter_get_font_map (void); void clutter_threads_set_lock_functions (GCallback enter_fn, GCallback leave_fn); @@ -514,35 +516,84 @@ Since 0.8 - -clutter_set_use_mipmapped_text () -clutter_set_use_mipmapped_textvoid clutter_set_use_mipmapped_text (gboolean value); + +enum ClutterFontFlags +ClutterFontFlagstypedef enum +{ + CLUTTER_FONT_MIPMAPPING = (1 << 0), + CLUTTER_FONT_HINTING = (1 << 1), +} ClutterFontFlags; + + +Runtime flags to change the font quality. To be used with +clutter_set_font_flags(). + + + + +CLUTTER_FONT_MIPMAPPING + Set to use mipmaps for the glyph cache textures. + + + +CLUTTER_FONT_HINTING + Set to enable hinting on the glyphs. + + +Since 1.0 + + +clutter_set_font_flags () +clutter_set_font_flagsvoid clutter_set_font_flags (ClutterFontFlags flags); + +Sets the font quality options for subsequent text rendering +operations. + + +Using mipmapped textures will improve the quality for scaled down +text but will use more texture memory. + -Sets whether subsequent text rendering operations will use -mipmapped textures or not. Using mipmapped textures will improve -the quality for scaled down text but will use more texture memory. +Enabling hinting improves text quality for static text but may +introduce some artifacts if the text is animated. -value : - TRUE to enable mipmapping or FALSE to disable. +flags : + The new flags -Since 0.8 +Since 1.0 - -clutter_get_use_mipmapped_text () -clutter_get_use_mipmapped_textgboolean clutter_get_use_mipmapped_text (void); + +clutter_get_font_flags () +clutter_get_font_flagsClutterFontFlags clutter_get_font_flags (void); -Gets whether mipmapped textures are used in text operations. -See clutter_set_use_mipmapped_text(). +Gets the current font flags for rendering text. See +clutter_set_font_flags(). -Returns : TRUE if text operations should use mipmapped - textures +Returns : The font flags -Since 0.8 +Since 1.0 + + +clutter_get_font_map () +clutter_get_font_mapPangoFontMap* clutter_get_font_map (void); + +Retrieves the PangoFontMap instance used by Clutter. +You can use the global font map object with the COGL +Pango API. + + + +Returns : the PangoFontMap instance. The returned + value is owned by Clutter and it should never be + unreferenced. + + +Since 1.0 clutter_threads_set_lock_functions () diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-media.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-media.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-media.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-media.xml 2009-01-30 12:41:02.000000000 +0000 @@ -13,7 +13,7 @@ ClutterMedia -An interface for controlling playback of media data. +An interface for controlling playback of media data @@ -22,22 +22,22 @@ ClutterMedia; - ClutterMediaInterface; + ClutterMediaIface; void clutter_media_set_uri (ClutterMedia *media, - const char *uri); -const char* clutter_media_get_uri (ClutterMedia *media); + const gchar *uri); +gchar* clutter_media_get_uri (ClutterMedia *media); void clutter_media_set_playing (ClutterMedia *media, gboolean playing); gboolean clutter_media_get_playing (ClutterMedia *media); -void clutter_media_set_position (ClutterMedia *media, - int position); -int clutter_media_get_position (ClutterMedia *media); -void clutter_media_set_volume (ClutterMedia *media, - double volume); -double clutter_media_get_volume (ClutterMedia *media); +void clutter_media_set_progress (ClutterMedia *media, + gdouble progress); +gdouble clutter_media_get_progress (ClutterMedia *media); +void clutter_media_set_audio_volume (ClutterMedia *media, + gdouble volume); +gdouble clutter_media_get_audio_volume (ClutterMedia *media); gboolean clutter_media_get_can_seek (ClutterMedia *media); -int clutter_media_get_buffer_percent (ClutterMedia *media); -int clutter_media_get_duration (ClutterMedia *media); +gdouble clutter_media_get_buffer_fill (ClutterMedia *media); +guint clutter_media_get_duration (ClutterMedia *media); void clutter_media_set_filename (ClutterMedia *media, const gchar *filename); @@ -59,13 +59,13 @@ Properties - "buffer-percent" gint : Read + "audio-volume" gdouble : Read / Write + "buffer-fill" gdouble : Read "can-seek" gboolean : Read - "duration" gint : Read + "duration" guint : Read "playing" gboolean : Read / Write - "position" gint : Read / Write + "progress" gdouble : Read / Write "uri" gchar* : Read / Write - "volume" gdouble : Read / Write @@ -84,12 +84,12 @@ ClutterMedia is an interface for controlling playback of media sources. -It is not implemented inside Clutter, but other integration libraries -like Clutter-GStreamer, implement it to offer a uniform API for -applications. +Clutter core does not provide an implementation of this interface, but +other integration libraries like Clutter-GStreamer implement it to offer +a uniform API for applications. -ClutterMedia is available since Clutter 0.2 +ClutterMedia is available since Clutter 0.2 @@ -103,31 +103,10 @@ - -ClutterMediaInterface -ClutterMediaInterfacetypedef struct { - GTypeInterface base_iface; - void (*set_uri) (ClutterMedia *media, - const char *uri); - const char *(*get_uri) (ClutterMedia *media); - void (*set_playing) (ClutterMedia *media, - gboolean playing); - gboolean (*get_playing) (ClutterMedia *media); - void (*set_position) (ClutterMedia *media, - int position); - int (*get_position) (ClutterMedia *media); - void (*set_volume) (ClutterMedia *media, - double volume); - double (*get_volume) (ClutterMedia *media); - gboolean (*can_seek) (ClutterMedia *media); - int (*get_buffer_percent) (ClutterMedia *media); - int (*get_duration) (ClutterMedia *media); - - /* signals */ - void (* eos) (ClutterMedia *media); - void (* error) (ClutterMedia *media, - GError *error); -} ClutterMediaInterface; + +ClutterMediaIface +ClutterMediaIfacetypedef struct { +} ClutterMediaIface; @@ -135,32 +114,33 @@ clutter_media_set_uri () clutter_media_set_urivoid clutter_media_set_uri (ClutterMedia *media, - const char *uri); + const gchar *uri); Sets the URI of media to uri. media : - ClutterMedia object + a ClutterMedia uri : - URI + the URI of the media stream Since 0.2 clutter_media_get_uri () -clutter_media_get_uriconst char* clutter_media_get_uri (ClutterMedia *media); +clutter_media_get_urigchar* clutter_media_get_uri (ClutterMedia *media); Retrieves the URI from media. media : - A ClutterMedia object + a ClutterMedia -Returns : The URI as a string. +Returns : the URI of the media stream. Use g_free() + to free the returned string Since 0.2 @@ -170,15 +150,15 @@ clutter_media_set_playingvoid clutter_media_set_playing (ClutterMedia *media, gboolean playing); -Starts or stops media playing. +Starts or stops playing of media. media : - A ClutterMedia object + a ClutterMedia playing : - TRUE to start playing, FALSE to stop. + TRUE to start playing Since 0.2 @@ -198,71 +178,72 @@ Since 0.2 - -clutter_media_set_position () -clutter_media_set_positionvoid clutter_media_set_position (ClutterMedia *media, - int position); + +clutter_media_set_progress () +clutter_media_set_progressvoid clutter_media_set_progress (ClutterMedia *media, + gdouble progress); -Sets the playback position of media to position. +Sets the playback progress of media. The progress is +a normalized value between 0.0 (begin) and 1.0 (end). media : - A ClutterMedia object + a ClutterMedia -position : - The desired position. +progress : + the progress of the playback, between 0.0 and 1.0 -Since 0.2 +Since 1.0 - -clutter_media_get_position () -clutter_media_get_positionint clutter_media_get_position (ClutterMedia *media); + +clutter_media_get_progress () +clutter_media_get_progressgdouble clutter_media_get_progress (ClutterMedia *media); -Retrieves the position of media. +Retrieves the playback progress of media. media : - A ClutterMedia object + a ClutterMedia -Returns : The playback position. +Returns : the playback progress, between 0.0 and 1.0 -Since 0.2 +Since 1.0 - -clutter_media_set_volume () -clutter_media_set_volumevoid clutter_media_set_volume (ClutterMedia *media, - double volume); + +clutter_media_set_audio_volume () +clutter_media_set_audio_volumevoid clutter_media_set_audio_volume (ClutterMedia *media, + gdouble volume); Sets the playback volume of media to volume. media : - A ClutterMedia object + a ClutterMedia volume : - The volume as a double between 0.0 and 1.0 + the volume as a double between 0.0 and 1.0 -Since 0.2 +Since 1.0 - -clutter_media_get_volume () -clutter_media_get_volumedouble clutter_media_get_volume (ClutterMedia *media); + +clutter_media_get_audio_volume () +clutter_media_get_audio_volumegdouble clutter_media_get_audio_volume (ClutterMedia *media); Retrieves the playback volume of media. media : - A ClutterMedia object + a ClutterMedia Returns : The playback volume between 0.0 and 1.0 -Since 0.2 +Since 1.0 clutter_media_get_can_seek () @@ -273,41 +254,41 @@ media : - A ClutterMedia object + a ClutterMedia Returns : TRUE if media can seek, FALSE otherwise. Since 0.2 - -clutter_media_get_buffer_percent () -clutter_media_get_buffer_percentint clutter_media_get_buffer_percent (ClutterMedia *media); + +clutter_media_get_buffer_fill () +clutter_media_get_buffer_fillgdouble clutter_media_get_buffer_fill (ClutterMedia *media); Retrieves the amount of the stream that is buffered. media : - A ClutterMedia object + a ClutterMedia -Returns : percentage value +Returns : the fill level, between 0.0 and 1.0 -Since 0.2 +Since 1.0 clutter_media_get_duration () -clutter_media_get_durationint clutter_media_get_duration (ClutterMedia *media); +clutter_media_get_durationguint clutter_media_get_duration (ClutterMedia *media); Retrieves the duration of the media stream that media represents. media : - A ClutterMedia object + a ClutterMedia -Returns : The length of the media stream. +Returns : the duration of the media stream, in seconds Since 0.2 @@ -317,15 +298,15 @@ clutter_media_set_filenamevoid clutter_media_set_filename (ClutterMedia *media, const gchar *filename); -Sets the filename of the media source. +Sets the source of media using a file path. media : - A ClutterMedia object + a ClutterMedia filename : - A filename to media file. + A filename Since 0.2 @@ -333,37 +314,81 @@ Property Details -The <literal>"buffer-percent"</literal> property -ClutterMedia:buffer-percent "buffer-percent" gint : Read -The percentage the current stream buffer is filled.Allowed values: [0,100] +The <literal>"audio-volume"</literal> property +ClutterMedia:audio-volume "audio-volume" gdouble : Read / Write + +The volume of the audio, as a normalized value between +0.0 and 1.0. + + +Allowed values: [0,1] +Default value: 0.5 +Since 1.0 + + +The <literal>"buffer-fill"</literal> property +ClutterMedia:buffer-fill "buffer-fill" gdouble : Read + +The fill level of the buffer for the current stream, +as a value between 0.0 and 1.0. + + +Allowed values: [0,1] Default value: 0 +Since 1.0 + The <literal>"can-seek"</literal> property -ClutterMedia:can-seek "can-seek" gboolean : Read -TRUE if the current stream is seekable.Default value: FALSE +ClutterMedia:can-seek "can-seek" gboolean : Read + +Whether the current stream is seekable. + + +Default value: FALSE +Since 0.2 + The <literal>"duration"</literal> property -ClutterMedia:duration "duration" gint : Read -The duration of the current stream in seconds.Allowed values: >= 0 -Default value: 0 +ClutterMedia:duration "duration" guint : Read + +The duration of the current stream, in seconds + + +Default value: 0 +Since 0.2 + The <literal>"playing"</literal> property -ClutterMedia:playing "playing" gboolean : Read / Write -TRUE if playing.Default value: FALSE +ClutterMedia:playing "playing" gboolean : Read / Write + +Whether the ClutterMedia actor is playing. + + +Default value: FALSE +Since 0.2 + -The <literal>"position"</literal> property -ClutterMedia:position "position" gint : Read / Write -The position in the current stream in seconds.Allowed values: >= 0 +The <literal>"progress"</literal> property +ClutterMedia:progress "progress" gdouble : Read / Write + +The current progress of the playback, as a normalized +value between 0.0 and 1.0. + + +Allowed values: [0,1] Default value: 0 +Since 1.0 + The <literal>"uri"</literal> property -ClutterMedia:uri "uri" gchar* : Read / Write -The loaded URI.Default value: NULL - -The <literal>"volume"</literal> property -ClutterMedia:volume "volume" gdouble : Read / Write -The audio volume.Allowed values: [0,100] -Default value: 50 +ClutterMedia:uri "uri" gchar* : Read / Write + +The location of a media file, expressed as a valid URI. + + +Default value: NULL +Since 0.2 + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-path.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-path.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-path.xml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-path.xml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,956 @@ + + +]> + + + +ClutterPath +3 +CLUTTER Library + + + +ClutterPath +An object describing a path with straight lines +and bezier curves. + + + + +Synopsis + + + ClutterPath; + ClutterPathClass; +void (*ClutterPathCallback) (const ClutterPathNode *node, + gpointer data); +enum ClutterPathNodeType; +ClutterPath* clutter_path_new (void); +ClutterPath* clutter_path_new_with_description (const gchar *desc); + +void clutter_path_add_move_to (ClutterPath *path, + gint x, + gint y); +void clutter_path_add_rel_move_to (ClutterPath *path, + gint x, + gint y); +void clutter_path_add_line_to (ClutterPath *path, + gint x, + gint y); +void clutter_path_add_rel_line_to (ClutterPath *path, + gint x, + gint y); +void clutter_path_add_curve_to (ClutterPath *path, + gint x_1, + gint y_1, + gint x_2, + gint y_2, + gint x_3, + gint y_3); +void clutter_path_add_rel_curve_to (ClutterPath *path, + gint x_1, + gint y_1, + gint x_2, + gint y_2, + gint x_3, + gint y_3); +void clutter_path_add_close (ClutterPath *path); +gboolean clutter_path_add_string (ClutterPath *path, + const gchar *str); +void clutter_path_add_node (ClutterPath *path, + const ClutterPathNode *node); +void clutter_path_add_cairo_path (ClutterPath *path, + const cairo_path_t *cpath); + +guint clutter_path_get_n_nodes (ClutterPath *path); +void clutter_path_get_node (ClutterPath *path, + guint index_, + ClutterPathNode *node); +GSList* clutter_path_get_nodes (ClutterPath *path); +void clutter_path_foreach (ClutterPath *path, + ClutterPathCallback callback, + gpointer user_data); +void clutter_path_insert_node (ClutterPath *path, + gint index_, + const ClutterPathNode *node); +void clutter_path_remove_node (ClutterPath *path, + guint index_); +void clutter_path_replace_node (ClutterPath *path, + guint index_, + const ClutterPathNode *node); +gchar* clutter_path_get_description (ClutterPath *path); +gboolean clutter_path_set_description (ClutterPath *path, + const gchar *str); +void clutter_path_to_cairo_path (ClutterPath *path, + cairo_t *cr); +void clutter_path_clear (ClutterPath *path); +guint clutter_path_get_position (ClutterPath *path, + gdouble progress, + ClutterKnot *position); +guint clutter_path_get_length (ClutterPath *path); + + ClutterPathNode; +ClutterPathNode* clutter_path_node_copy (const ClutterPathNode *node); +void clutter_path_node_free (ClutterPathNode *node); +gboolean clutter_path_node_equal (const ClutterPathNode *node_a, + const ClutterPathNode *node_b); + + + + +Object Hierarchy + + GObject + +----GInitiallyUnowned + +----ClutterPath + + + + + + + + + +Properties + + "description" gchar* : Read / Write + "length" guint : Read + + + + + + +Description + +A ClutterPath contains a description of a path consisting of +straight lines and bezier curves. This can be used in a +ClutterBehaviourPath to animate an actor moving along the path. + + +The path consists of a series of nodes. Each node is one of the +following four types: + + + +CLUTTER_PATH_MOVE_TO + +Changes the position of the path to the given pair of +coordinates. This is usually used as the first node of a path to +mark the start position. If it is used in the middle of a path then +the path will be disjoint and the actor will appear to jump to the +new position when animated. + +CLUTTER_PATH_LINE_TO + +Creates a straight line from the previous point to the given point. + +CLUTTER_PATH_CURVE_TO + +Creates a bezier curve. The end of the last node is used as the +first control point and the three subsequent coordinates given in +the node as used as the other three. + +CLUTTER_PATH_CLOSE + +Creates a straight line from the last node to the last +CLUTTER_PATH_MOVE_TO node. This can be used to close a path so +that it will appear as a loop when animated. + + + + +The first three types have the corresponding relative versions +CLUTTER_PATH_REL_MOVE_TO, CLUTTER_PATH_REL_LINE_TO and +CLUTTER_PATH_REL_CURVE_TO. These are exactly the same except the +coordinates are given relative to the previous node instead of as +direct screen positions. + + +You can build a path using the node adding functions such as +clutter_path_add_line_to(). Alternatively the path can be described +in a string using a subset of the SVG path syntax. See +clutter_path_add_string() for details. + + +ClutterPath is available since Clutter 1.0 + + + + + + +Details + +ClutterPath +ClutterPathtypedef struct _ClutterPath ClutterPath; + +The ClutterPath struct contains only private data and should +be accessed with the functions below. + + +Since 1.0 + + +ClutterPathClass +ClutterPathClasstypedef struct { +} ClutterPathClass; + + +The ClutterPathClass struct contains only private data. + + +Since 1.0 + + +ClutterPathCallback () +ClutterPathCallbackvoid (*ClutterPathCallback) (const ClutterPathNode *node, + gpointer data); + +This function is passed to clutter_path_foreach() and will be +called for each node contained in the path. + + + +node : + the node + +data : + optional data passed to the function + +Since 1.0 + + +enum ClutterPathNodeType +ClutterPathNodeTypetypedef enum { + CLUTTER_PATH_MOVE_TO = 0, + CLUTTER_PATH_LINE_TO = 1, + CLUTTER_PATH_CURVE_TO = 2, + CLUTTER_PATH_CLOSE = 3, + + CLUTTER_PATH_REL_MOVE_TO = CLUTTER_PATH_MOVE_TO | CLUTTER_PATH_RELATIVE, + CLUTTER_PATH_REL_LINE_TO = CLUTTER_PATH_LINE_TO | CLUTTER_PATH_RELATIVE, + CLUTTER_PATH_REL_CURVE_TO = CLUTTER_PATH_CURVE_TO | CLUTTER_PATH_RELATIVE +} ClutterPathNodeType; + + +Types of nodes in a ClutterPath. + + + + +CLUTTER_PATH_MOVE_TO + jump to the given position + + + +CLUTTER_PATH_LINE_TO + create a line from the last node to the + given position + + + +CLUTTER_PATH_CURVE_TO + bezier curve using the last position and + three control points. + + + +CLUTTER_PATH_CLOSE + create a line from the last node to the last + CLUTTER_PATH_MOVE_TO node. + + + +CLUTTER_PATH_REL_MOVE_TO + same as CLUTTER_PATH_MOVE_TO but with + coordinates relative to the last node. + + + +CLUTTER_PATH_REL_LINE_TO + same as CLUTTER_PATH_LINE_TO but with + coordinates relative to the last node. + + + +CLUTTER_PATH_REL_CURVE_TO + same as CLUTTER_PATH_CURVE_TO but with + coordinates relative to the last node. + + +Since 1.0 + + +clutter_path_new () +clutter_path_newClutterPath* clutter_path_new (void); + +Creates a new ClutterPath instance with no nodes. + + +The object has a floating reference so if you add it to a +ClutterBehaviourPath then you do not need to unref it. + + + +Returns : the newly created ClutterPath + + +Since 1.0 + + +clutter_path_new_with_description () +clutter_path_new_with_descriptionClutterPath* clutter_path_new_with_description (const gchar *desc); + +Creates a new ClutterPath instance with the nodes described in +desc. See clutter_path_add_string() for details of the format of +the string. + + +The object has a floating reference so if you add it to a +ClutterBehaviourPath then you do not need to unref it. + + + +desc : + a string describing the path + +Returns : the newly created ClutterPath + + +Since 1.0 + + +clutter_path_add_move_to () +clutter_path_add_move_tovoid clutter_path_add_move_to (ClutterPath *path, + gint x, + gint y); + +Adds a CLUTTER_PATH_MOVE_TO type node to the path. This is usually +used as the first node in a path. It can also be used in the middle +of the path to cause the actor to jump to the new coordinate. + + + +path : + a ClutterPath + +x : + the x coordinate + +y : + the y coordinate + +Since 1.0 + + +clutter_path_add_rel_move_to () +clutter_path_add_rel_move_tovoid clutter_path_add_rel_move_to (ClutterPath *path, + gint x, + gint y); + +Same as clutter_path_add_move_to() except the coordinates are +relative to the previous node. + + + +path : + a ClutterPath + +x : + the x coordinate + +y : + the y coordinate + +Since 1.0 + + +clutter_path_add_line_to () +clutter_path_add_line_tovoid clutter_path_add_line_to (ClutterPath *path, + gint x, + gint y); + +Adds a CLUTTER_PATH_LINE_TO type node to the path. This causes the +actor to move to the new coordinates in a straight line. + + + +path : + a ClutterPath + +x : + the x coordinate + +y : + the y coordinate + +Since 1.0 + + +clutter_path_add_rel_line_to () +clutter_path_add_rel_line_tovoid clutter_path_add_rel_line_to (ClutterPath *path, + gint x, + gint y); + +Same as clutter_path_add_line_to() except the coordinates are +relative to the previous node. + + + +path : + a ClutterPath + +x : + the x coordinate + +y : + the y coordinate + +Since 1.0 + + +clutter_path_add_curve_to () +clutter_path_add_curve_tovoid clutter_path_add_curve_to (ClutterPath *path, + gint x_1, + gint y_1, + gint x_2, + gint y_2, + gint x_3, + gint y_3); + +Adds a CLUTTER_PATH_CURVE_TO type node to the path. This causes +the actor to follow a bezier from the last node to (x_3, y_3) using +(x_1, y_1) and (x_2,y_2) as control points. + + + +path : + a ClutterPath + +x_1 : + the x coordinate of the first control point + +y_1 : + the y coordinate of the first control point + +x_2 : + the x coordinate of the second control point + +y_2 : + the y coordinate of the second control point + +x_3 : + the x coordinate of the third control point + +y_3 : + the y coordinate of the third control point + +Since 1.0 + + +clutter_path_add_rel_curve_to () +clutter_path_add_rel_curve_tovoid clutter_path_add_rel_curve_to (ClutterPath *path, + gint x_1, + gint y_1, + gint x_2, + gint y_2, + gint x_3, + gint y_3); + +Same as clutter_path_add_curve_to() except the coordinates are +relative to the previous node. + + + +path : + a ClutterPath + +x_1 : + the x coordinate of the first control point + +y_1 : + the y coordinate of the first control point + +x_2 : + the x coordinate of the second control point + +y_2 : + the y coordinate of the second control point + +x_3 : + the x coordinate of the third control point + +y_3 : + the y coordinate of the third control point + +Since 1.0 + + +clutter_path_add_close () +clutter_path_add_closevoid clutter_path_add_close (ClutterPath *path); + +Adds a CLUTTER_PATH_CLOSE type node to the path. This creates a +straight line from the last node to the last CLUTTER_PATH_MOVE_TO +type node. + + + +path : + a ClutterPath + +Since 1.0 + + +clutter_path_add_string () +clutter_path_add_stringgboolean clutter_path_add_string (ClutterPath *path, + const gchar *str); + +Adds new nodes to the end of the path as described in str. The +format is a subset of the SVG path format. Each node is represented +by a letter and is followed by zero, one or three pairs of +coordinates. The coordinates can be separated by spaces or a +comma. The types are: + + + +M + +Adds a CLUTTER_PATH_MOVE_TO node. Takes one pair of coordinates. + +L + +Adds a CLUTTER_PATH_LINE_TO node. Takes one pair of coordinates. + +C + +Adds a CLUTTER_PATH_CURVE_TO node. Takes three pairs of coordinates. + +z + +Adds a CLUTTER_PATH_CLOSE node. No coordinates are needed. + + + + +The M, L and C commands can also be specified in lower case which +means the coordinates are relative to the previous node. + + +For example, to move an actor in a 100 by 100 pixel square centered +on the point 300,300 you could use the following path: + + + + + M 250,350 l 0 -100 L 350,250 l 0 100 z + + + + +If the path description isn't valid FALSE will be returned and no +nodes will be added. + + + +path : + a ClutterPath + +str : + a string describing the new nodes + +Returns : TRUE is the path description was valid or FALSE +otherwise. + + +Since 1.0 + + +clutter_path_add_node () +clutter_path_add_nodevoid clutter_path_add_node (ClutterPath *path, + const ClutterPathNode *node); + +Adds node to the end of the path. + + + +path : + a ClutterPath + +node : + a ClutterPathNode + +Since 1.0 + + +clutter_path_add_cairo_path () +clutter_path_add_cairo_pathvoid clutter_path_add_cairo_path (ClutterPath *path, + const cairo_path_t *cpath); + +Add the nodes of the Cairo path to the end of path. + + + +path : + a ClutterPath + +cpath : + a Cairo path + +Since 1.0 + + +clutter_path_get_n_nodes () +clutter_path_get_n_nodesguint clutter_path_get_n_nodes (ClutterPath *path); + +Retrieves the number of nodes in the path. + + + +path : + a ClutterPath + +Returns : the number of nodes. + + +Since 1.0 + + +clutter_path_get_node () +clutter_path_get_nodevoid clutter_path_get_node (ClutterPath *path, + guint index_, + ClutterPathNode *node); + +Retrieves the node of the path indexed by index. + + + +path : + a ClutterPath + +index_ : + the node number to retrieve + +node : + a location to store a copy of the node + +Since 1.0 + + +clutter_path_get_nodes () +clutter_path_get_nodesGSList* clutter_path_get_nodes (ClutterPath *path); + +Returns a GSList of ClutterPathNodes. The list should be +freed with g_slist_free(). The nodes are owned by the path and +should not be freed. Altering the path may cause the nodes in the +list to become invalid so you should copy them if you want to keep +the list. + + + +path : + a ClutterPath + +Returns : a list of nodes in the path. + + +Since 1.0 + + +clutter_path_foreach () +clutter_path_foreachvoid clutter_path_foreach (ClutterPath *path, + ClutterPathCallback callback, + gpointer user_data); + +Calls a function for each node of the path. + + + +path : + a ClutterPath + +callback : + the function to call with each node + +user_data : + user data to pass to the function + +Since 1.0 + + +clutter_path_insert_node () +clutter_path_insert_nodevoid clutter_path_insert_node (ClutterPath *path, + gint index_, + const ClutterPathNode *node); + +Inserts node into the path before the node at the given offset. If +index_ is negative it will append the node to the end of the path. + + + +path : + a ClutterPath + +index_ : + offset of where to insert the node + +node : + the node to insert + +Since 1.0 + + +clutter_path_remove_node () +clutter_path_remove_nodevoid clutter_path_remove_node (ClutterPath *path, + guint index_); + +Removes the node at the given offset from the path. + + + +path : + a ClutterPath + +index_ : + index of the node to remove + +Since 1.0 + + +clutter_path_replace_node () +clutter_path_replace_nodevoid clutter_path_replace_node (ClutterPath *path, + guint index_, + const ClutterPathNode *node); + +Replaces the node at offset index_ with node. + + + +path : + a ClutterPath + +index_ : + index to the existing node + +node : + the replacement node + +Since 1.0 + + +clutter_path_get_description () +clutter_path_get_descriptiongchar* clutter_path_get_description (ClutterPath *path); + +Returns a newly allocated string describing the path in the same +format as used by clutter_path_add_string(). + + + +path : + a ClutterPath + +Returns : a string description of the path. Free with g_free(). + + +Since 1.0 + + +clutter_path_set_description () +clutter_path_set_descriptiongboolean clutter_path_set_description (ClutterPath *path, + const gchar *str); + +Replaces all of the nodes in the path with nodes described by +str. See clutter_path_add_string() for details of the format. + + +If the string is invalid then FALSE is returned and the path is +unaltered. + + + +path : + a ClutterPath + +str : + a string describing the path + +Returns : TRUE is the path was valid, FALSE otherwise. + + +Since 1.0 + + +clutter_path_to_cairo_path () +clutter_path_to_cairo_pathvoid clutter_path_to_cairo_path (ClutterPath *path, + cairo_t *cr); + +Add the nodes of the ClutterPath to the path in the Cairo context. + + + +path : + a ClutterPath + +cr : + a Cairo context + +Since 1.0 + + +clutter_path_clear () +clutter_path_clearvoid clutter_path_clear (ClutterPath *path); + +Removes all nodes from the path. + + + +path : + a ClutterPath + +Since 1.0 + + +clutter_path_get_position () +clutter_path_get_positionguint clutter_path_get_position (ClutterPath *path, + gdouble progress, + ClutterKnot *position); + +The value in progress represents a position along the path where +0.0 is the beginning and 1.0 is the end of the path. An +interpolated position is then stored in position. + + + +path : + a ClutterPath + +progress : + a position along the path as a fraction of its length + +position : + location to store the position + +Returns : index of the node used to calculate the position. + + +Since 1.0 + + +clutter_path_get_length () +clutter_path_get_lengthguint clutter_path_get_length (ClutterPath *path); + +Retrieves an approximation of the total length of the path. + + + +path : + a ClutterPath + +Returns : the length of the path. + + +Since 1.0 + + +ClutterPathNode +ClutterPathNodetypedef struct { + ClutterPathNodeType type; + + ClutterKnot points[3]; +} ClutterPathNode; + + +Represents a single node of a ClutterPath. + + +Some of the coordinates in points may be unused for some node +types. CLUTTER_PATH_MOVE_TO and CLUTTER_PATH_LINE_TO use only two +pairs of coordinates, CLUTTER_PATH_CURVE_TO uses all three and +CLUTTER_PATH_CLOSE uses none. + + + + +ClutterPathNodeType type; + the node's type + + + +ClutterKnot points[3]; + the coordinates of the node + + +Since 1.0 + + +clutter_path_node_copy () +clutter_path_node_copyClutterPathNode* clutter_path_node_copy (const ClutterPathNode *node); + +Makes an allocated copy of a node. + + + +node : + a ClutterPathNode + +Returns : the copied node. + + +Since 1.0 + + +clutter_path_node_free () +clutter_path_node_freevoid clutter_path_node_free (ClutterPathNode *node); + +Frees the memory of an allocated node. + + + +node : + a ClutterPathNode + +Since 1.0 + + +clutter_path_node_equal () +clutter_path_node_equalgboolean clutter_path_node_equal (const ClutterPathNode *node_a, + const ClutterPathNode *node_b); + +Compares two nodes and checks if they are the same type with the +same coordinates. + + + +node_a : + First node + +node_b : + Second node + +Returns : TRUE if the nodes are the same. + + +Since 1.0 + + + + +Property Details +The <literal>"description"</literal> property +ClutterPath:description "description" gchar* : Read / Write +SVG-style description of the path.Default value: "" + +The <literal>"length"</literal> property +ClutterPath:length "length" guint : Read +An approximation of the total length of the path.Default value: 0 + + + + + + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-rectangle.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-rectangle.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-rectangle.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-rectangle.xml 2009-01-30 12:41:02.000000000 +0000 @@ -56,7 +56,7 @@ Implemented Interfaces ClutterRectangle implements - + ClutterScriptable. @@ -93,13 +93,6 @@ ClutterRectangleClass ClutterRectangleClasstypedef struct { - ClutterActorClass parent_class; - - /* padding for future expansion */ - void (*_clutter_rectangle1) (void); - void (*_clutter_rectangle2) (void); - void (*_clutter_rectangle3) (void); - void (*_clutter_rectangle4) (void); } ClutterRectangleClass; diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-scriptable.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-scriptable.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-scriptable.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-scriptable.xml 2009-01-30 12:41:02.000000000 +0000 @@ -4,9 +4,9 @@ ]> - + -ClutterScriptable +ClutterScriptable 3 CLUTTER Library @@ -17,11 +17,11 @@ - + Synopsis - ClutterScriptable; + ClutterScriptable; ClutterScriptableIface; void clutter_scriptable_set_id (ClutterScriptable *scriptable, const gchar *id); @@ -40,15 +40,30 @@ + +Object Hierarchy + + GInterface + +----ClutterScriptable + + + + +Known Implementations + +ClutterScriptable is implemented by + ClutterTexture, ClutterStage, ClutterText, ClutterRectangle, ClutterGroup, ClutterBehaviourPath, ClutterCairoTexture, ClutterActor and ClutterClone. + + - + Description The ClutterScriptableIface interface exposes the UI definition parsing @@ -63,11 +78,11 @@ - + Details - + ClutterScriptable -ClutterScriptabletypedef struct _ClutterScriptable ClutterScriptable; +ClutterScriptabletypedef struct _ClutterScriptable ClutterScriptable; diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-shader.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-shader.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-shader.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-shader.xml 2009-01-30 12:41:02.000000000 +0000 @@ -40,9 +40,40 @@ void clutter_shader_set_is_enabled (ClutterShader *shader, gboolean enabled); gboolean clutter_shader_get_is_enabled (ClutterShader *shader); + +void clutter_shader_set_uniform (ClutterShader *shader, + const gchar *name, + const GValue *value); +CoglHandle clutter_shader_get_cogl_program (ClutterShader *shader); +CoglHandle clutter_shader_get_cogl_fragment_shader + (ClutterShader *shader); +CoglHandle clutter_shader_get_cogl_vertex_shader + (ClutterShader *shader); void clutter_shader_set_uniform_1f (ClutterShader *shader, const gchar *name, gfloat value); + + ClutterShaderFloat; +#define CLUTTER_VALUE_HOLDS_SHADER_FLOAT (x) +void clutter_value_set_shader_float (GValue *value, + gint size, + const gfloat *floats); +const gfloat* clutter_value_get_shader_float (const GValue *value, + gsize *length); + ClutterShaderInt; +#define CLUTTER_VALUE_HOLDS_SHADER_INT (x) +void clutter_value_set_shader_int (GValue *value, + gint size, + const gint *ints); +const COGLint* clutter_value_get_shader_int (const GValue *value, + gsize *length); + ClutterShaderMatrix; +#define CLUTTER_VALUE_HOLDS_SHADER_MATRIX (x) +void clutter_value_set_shader_matrix (GValue *value, + gint size, + const gfloat *matrix); +const GLfloat* clutter_value_get_shader_matrix (const GValue *value, + gsize *length); @@ -315,11 +346,85 @@ Since 0.6 - + +clutter_shader_set_uniform () +clutter_shader_set_uniformvoid clutter_shader_set_uniform (ClutterShader *shader, + const gchar *name, + const GValue *value); + +Sets a user configurable variable in the GLSL shader programs attached to +a ClutterShader. + + + +shader : + a ClutterShader. + +name : + name of uniform in GLSL shader program to set. + +value : + a ClutterShaderFloat, ClutterShaderInt or ClutterShaderMatrix + GValue. + +Since 1.0 + + +clutter_shader_get_cogl_program () +clutter_shader_get_cogl_programCoglHandle clutter_shader_get_cogl_program (ClutterShader *shader); + +Retrieves the underlying CoglHandle for the shader program. + + + +shader : + a ClutterShader + +Returns : A CoglHandle for the shader program, or NULL + + +Since 1.0 + + +clutter_shader_get_cogl_fragment_shader () +clutter_shader_get_cogl_fragment_shaderCoglHandle clutter_shader_get_cogl_fragment_shader + (ClutterShader *shader); + +Retrieves the underlying CoglHandle for the fragment shader. + + + +shader : + a ClutterShader + +Returns : A CoglHandle for the fragment shader, or NULL + + +Since 1.0 + + +clutter_shader_get_cogl_vertex_shader () +clutter_shader_get_cogl_vertex_shaderCoglHandle clutter_shader_get_cogl_vertex_shader + (ClutterShader *shader); + +Retrieves the underlying CoglHandle for the vertex shader. + + + +shader : + a ClutterShader + +Returns : A CoglHandle for the vertex shader, or NULL + + +Since 1.0 + + clutter_shader_set_uniform_1f () -clutter_shader_set_uniform_1fvoid clutter_shader_set_uniform_1f (ClutterShader *shader, +clutter_shader_set_uniform_1fclutter_shader_set_uniform_1fvoid clutter_shader_set_uniform_1f (ClutterShader *shader, const gchar *name, gfloat value); +clutter_shader_set_uniform_1f is deprecated and should not be used in newly-written code. Sets a user configurable variable in the shader programs attached to a ClutterShader. @@ -337,6 +442,207 @@ Since 0.6 + +ClutterShaderFloat +ClutterShaderFloattypedef struct _ClutterShaderFloat ClutterShaderFloat; + + + + +CLUTTER_VALUE_HOLDS_SHADER_FLOAT() +CLUTTER_VALUE_HOLDS_SHADER_FLOAT#define CLUTTER_VALUE_HOLDS_SHADER_FLOAT(x) (G_VALUE_HOLDS ((x), CLUTTER_TYPE_SHADER_FLOAT)) + + +Evaluates to TRUE if x holds a ClutterShaderFloat. + + + +x : + a GValue + +Since 1.0 + + +clutter_value_set_shader_float () +clutter_value_set_shader_floatvoid clutter_value_set_shader_float (GValue *value, + gint size, + const gfloat *floats); + +Sets floats as the contents of value. The passed GValue +must have been initialized using CLUTTER_TYPE_SHADER_FLOAT. + + + +value : + a GValue + +size : + number of floating point values in floats + +floats : + an array of floating point values + +Since 0.8 + + +clutter_value_get_shader_float () +clutter_value_get_shader_floatconst gfloat* clutter_value_get_shader_float (const GValue *value, + gsize *length); + +Retrieves the list of floating point values stored inside +the passed GValue. value must have been initialized with +CLUTTER_TYPE_SHADER_FLOAT. + + + +value : + a GValue + +length : + return location for the number of returned floating + point values, or NULL + +Returns : the pointer to a list of floating point values. + The returned value is owned by the GValue and should never + be modified or freed. + + +Since 0.8 + + +ClutterShaderInt +ClutterShaderInttypedef struct _ClutterShaderInt ClutterShaderInt; + + + + +CLUTTER_VALUE_HOLDS_SHADER_INT() +CLUTTER_VALUE_HOLDS_SHADER_INT#define CLUTTER_VALUE_HOLDS_SHADER_INT(x) (G_VALUE_HOLDS ((x), CLUTTER_TYPE_SHADER_INT)) + + +Evaluates to TRUE if x holds a ClutterShaderInt. + + + +x : + a GValue + +Since 1.0 + + +clutter_value_set_shader_int () +clutter_value_set_shader_intvoid clutter_value_set_shader_int (GValue *value, + gint size, + const gint *ints); + +Sets ints as the contents of value. The passed GValue +must have been initialized using CLUTTER_TYPE_SHADER_INT. + + + +value : + a GValue + +size : + number of integer values in ints + +ints : + an array of integer values + +Since 0.8 + + +clutter_value_get_shader_int () +clutter_value_get_shader_intconst COGLint* clutter_value_get_shader_int (const GValue *value, + gsize *length); + +Retrieves the list of integer values stored inside the passed +GValue. value must have been initialized with +CLUTTER_TYPE_SHADER_INT. + + + +value : + a GValue + +length : + return location for the number of returned integer + values, or NULL + +Returns : the pointer to a list of integer values. + The returned value is owned by the GValue and should never + be modified or freed. + + +Since 0.8 + + +ClutterShaderMatrix +ClutterShaderMatrixtypedef struct _ClutterShaderMatrix ClutterShaderMatrix; + + + + +CLUTTER_VALUE_HOLDS_SHADER_MATRIX() +CLUTTER_VALUE_HOLDS_SHADER_MATRIX#define CLUTTER_VALUE_HOLDS_SHADER_MATRIX(x) (G_VALUE_HOLDS ((x), CLUTTER_TYPE_SHADER_MATRIX)) + + +Evaluates to TRUE if x holds a ClutterShaderMatrix. + + + +x : + a GValue + +Since 1.0 + + +clutter_value_set_shader_matrix () +clutter_value_set_shader_matrixvoid clutter_value_set_shader_matrix (GValue *value, + gint size, + const gfloat *matrix); + +Sets matrix as the contents of value. The passed GValue +must have been initialized using CLUTTER_TYPE_SHADER_MATRIX. + + + +value : + a GValue + +size : + number of floating point values in floats + +matrix : + a matrix of floating point values + +Since 0.8 + + +clutter_value_get_shader_matrix () +clutter_value_get_shader_matrixconst GLfloat* clutter_value_get_shader_matrix (const GValue *value, + gsize *length); + +Retrieves a matrix of floating point values stored inside +the passed GValue. value must have been initialized with +CLUTTER_TYPE_SHADER_MATRIX. + + + +value : + a GValue + +length : + return location for the number of returned floating + point values, or NULL + +Returns : the pointer to a matrix of floating point values. + The returned value is owned by the GValue and should never + be modified or freed. + + +Since 0.8 + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-stage.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-stage.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-stage.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-stage.xml 2009-01-30 12:41:02.000000000 +0000 @@ -41,14 +41,13 @@ gint x, gint y); void clutter_stage_ensure_current (ClutterStage *stage); +void clutter_stage_ensure_viewport (ClutterStage *stage); void clutter_stage_queue_redraw (ClutterStage *stage); gboolean clutter_stage_event (ClutterStage *stage, ClutterEvent *event); void clutter_stage_set_key_focus (ClutterStage *stage, ClutterActor *actor); ClutterActor* clutter_stage_get_key_focus (ClutterStage *stage); -gdouble clutter_stage_get_resolution (ClutterStage *stage); -ClutterFixed clutter_stage_get_resolutionx (ClutterStage *stage); guchar* clutter_stage_read_pixels (ClutterStage *stage, gint x, gint y, @@ -115,7 +114,7 @@ Implemented Interfaces ClutterStage implements - ClutterContainer. + ClutterScriptable and ClutterContainer. @@ -140,6 +139,7 @@ "activate" : Run Last "deactivate" : Run Last "fullscreen" : Run First + "queue-redraw" : Run Last "unfullscreen" : Run Last @@ -192,6 +192,8 @@ void (* unfullscreen) (ClutterStage *stage); void (* activate) (ClutterStage *stage); void (* deactivate) (ClutterStage *stage); + + void (* queue_redraw) (ClutterStage *stage); } ClutterStageClass; @@ -201,7 +203,7 @@ CLUTTER_STAGE_WIDTH() CLUTTER_STAGE_WIDTH#define CLUTTER_STAGE_WIDTH() -Macro that evaluates to the current stage width +Macro that evaluates to the width of the default stage Since 0.2 @@ -210,7 +212,7 @@ CLUTTER_STAGE_HEIGHT() CLUTTER_STAGE_HEIGHT#define CLUTTER_STAGE_HEIGHT() -Macro that evaluates to the current stage height +Macro that evaluates to the height of the default stage Since 0.2 @@ -401,6 +403,28 @@ Since 0.8 + +clutter_stage_ensure_viewport () +clutter_stage_ensure_viewportvoid clutter_stage_ensure_viewport (ClutterStage *stage); + +Ensures that the GL viewport is updated with the current +stage window size. + + +This function will queue a redraw of stage. + + +This function should not be called by applications; it is used +when embedding a ClutterStage into a toolkit with another +windowing system, like GTK+. + + + +stage : + a ClutterStage + +Since 1.0 + clutter_stage_queue_redraw () clutter_stage_queue_redrawvoid clutter_stage_queue_redraw (ClutterStage *stage); @@ -477,39 +501,6 @@ Since 0.6 - -clutter_stage_get_resolution () -clutter_stage_get_resolutiongdouble clutter_stage_get_resolution (ClutterStage *stage); - -Retrieves the resolution (in DPI) of the stage from the default -backend. - - - -stage : - the ClutterStage - -Returns : the resolution of the stage - - -Since 0.6 - - -clutter_stage_get_resolutionx () -clutter_stage_get_resolutionxClutterFixed clutter_stage_get_resolutionx (ClutterStage *stage); - -Fixed point version of clutter_stage_get_resolution(). - - - -stage : - the ClutterStage - -Returns : the resolution of the stage - - -Since 0.6 - clutter_stage_read_pixels () clutter_stage_read_pixelsguchar* clutter_stage_read_pixels (ClutterStage *stage, @@ -686,15 +677,12 @@ return location for a ClutterPerspective - + clutter_stage_set_title () -clutter_stage_set_titlevoid clutter_stage_set_title (ClutterStage *stage, +clutter_stage_set_titlevoid clutter_stage_set_title (ClutterStage *stage, const gchar *title); -Sets the stage title. - - -Since 0.4 +Sets the stage title. @@ -704,7 +692,8 @@ title : A utf8 string for the stage windows title. - +Since 0.4 + clutter_stage_get_title () clutter_stage_get_titleconst gchar* clutter_stage_get_title (ClutterStage *stage); @@ -1052,6 +1041,56 @@ user_data : user data set when the signal handler was connected. Since 0.6 +The <literal>"queue-redraw"</literal> signal +ClutterStage::queue-redrawvoid user_function (ClutterStage *stage, + gpointer user_data) : Run Last + +The ::queue-redraw signal is emitted each time a ClutterStage +has been queued for a redraw. You can use this signal to know +when clutter_stage_queue_redraw() has been called. + + +Toolkits embedding a ClutterStage which require a redraw and +relayout cycle can stop the emission of this signal using the +GSignal API, redraw the UI and then call clutter_redraw() +themselves, like: + + + + static void + on_redraw_complete (void) + { + /* execute the Clutter drawing pipeline */ + clutter_redraw (); + } + + static void + on_stage_queue_redraw (ClutterStage *stage) + { + /* this prevents the default handler to run */ + g_signal_stop_emission_by_name (stage, "queue-redraw"); + + /* queue a redraw with the host toolkit and call + * a function when the redraw has been completed + */ + queue_a_redraw (G_CALLBACK (on_redraw_complete)); + } + + + +This signal is emitted before the Clutter paint +pipeline is run. If you want to know when the pipeline has been +completed you should connect to the ::paint signal on the Stage +with g_signal_connect_after(). + + + +stage : + the stage which was queued for redraw + +user_data : +user data set when the signal handler was connected. +Since 1.0 The <literal>"unfullscreen"</literal> signal ClutterStage::unfullscreenvoid user_function (ClutterStage *stage, gpointer user_data) : Run Last diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-texture.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-texture.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-texture.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-texture.xml 2009-01-30 12:41:02.000000000 +0000 @@ -74,6 +74,9 @@ CoglHandle clutter_texture_get_cogl_texture (ClutterTexture *texture); void clutter_texture_set_cogl_texture (ClutterTexture *texture, CoglHandle cogl_tex); +CoglHandle clutter_texture_get_cogl_material (ClutterTexture *texture); +void clutter_texture_set_cogl_material (ClutterTexture *texture, + CoglHandle cogl_material); @@ -84,6 +87,7 @@ +----GInitiallyUnowned +----ClutterActor +----ClutterTexture + +----ClutterCairoTexture @@ -94,7 +98,7 @@ Implemented Interfaces ClutterTexture implements - + ClutterScriptable. @@ -107,6 +111,7 @@ "filename" gchar* : Write "filter-quality" ClutterTextureQuality : Read / Write / Construct "keep-aspect-ratio" gboolean : Read / Write + "load-async" gboolean : Read / Write "pixel-format" gint : Read "repeat-x" gboolean : Read / Write "repeat-y" gboolean : Read / Write @@ -118,6 +123,7 @@ Signals + "load-finished" : Run Last "pixbuf-change" : Run Last "size-change" : Run Last @@ -165,10 +171,12 @@ ClutterTextureClasstypedef struct { ClutterActorClass parent_class; - void (*size_change) (ClutterTexture *texture, - gint width, + void (*size_change) (ClutterTexture *texture, + gint width, gint height); void (*pixbuf_change) (ClutterTexture *texture); + void (*load_finished) (ClutterTexture *texture, + GError *error); } ClutterTextureClass; @@ -285,7 +293,7 @@ Note this function is intented as a utility call for uniformly applying shaders to groups and other potential visual effects. It requires that -the CLUTTER_FEATURE_OFFSCREEN feature is supported by the current backend +the CLUTTER_FEATURE_OFFSCREEN feature is supported by the current backend and the target system. @@ -407,7 +415,14 @@ GError **error); Sets the ClutterTexture image data from an image file. In case of -failure, FALSE is returned and error is set. +failure, FALSE is returned and error is set. + + +If "load-async" is set to TRUE, this function +will return as soon as possible, and the actual image loading +from disk will be performed asynchronously. "load-finished" +will be emitted when the image has been loaded or if an error +occurred. @@ -463,7 +478,7 @@ Distance in bytes between row starts. bpp : - bytes per pixel (Currently only 3 and 4 supported, + bytes per pixel (Currently only 3 and 4 supported, depending on has_alpha) flags : @@ -477,9 +492,9 @@ Since 0.4. - + clutter_texture_set_from_yuv_data () -clutter_texture_set_from_yuv_datagboolean clutter_texture_set_from_yuv_data (ClutterTexture *texture, +clutter_texture_set_from_yuv_datagboolean clutter_texture_set_from_yuv_data (ClutterTexture *texture, const guchar *data, gint width, gint height, @@ -514,12 +529,12 @@ Returns : TRUE if the texture was successfully updated -Since 0.4. - - +Since 0.4 + + clutter_texture_set_area_from_rgb_data () -clutter_texture_set_area_from_rgb_datagboolean clutter_texture_set_area_from_rgb_data +clutter_texture_set_area_from_rgb_datagboolean clutter_texture_set_area_from_rgb_data (ClutterTexture *texture, const guchar *data, gboolean has_alpha, @@ -561,7 +576,7 @@ Distance in bytes between row starts on source buffer. bpp : - bytes per pixel (Currently only 3 and 4 supported, + bytes per pixel (Currently only 3 and 4 supported, depending on has_alpha) flags : @@ -572,9 +587,9 @@ Returns : TRUE on success, FALSE on failure. -Since 0.6. - +Since 0.6 + clutter_texture_get_base_size () clutter_texture_get_base_sizevoid clutter_texture_get_base_size (ClutterTexture *texture, @@ -715,6 +730,44 @@ Since 0.8 + +clutter_texture_get_cogl_material () +clutter_texture_get_cogl_materialCoglHandle clutter_texture_get_cogl_material (ClutterTexture *texture); + +Returns a handle to the underlying COGL material used for drawing +the actor. No extra reference is taken so if you need to keep the +handle then you should call cogl_material_ref on it. + + + +texture : + A ClutterTexture + +Returns : COGL material handle + +Since 1.0 + + + +clutter_texture_set_cogl_material () +clutter_texture_set_cogl_materialvoid clutter_texture_set_cogl_material (ClutterTexture *texture, + CoglHandle cogl_material); + +Replaces the underlying COGL texture drawn by this actor with +cogl_tex. A reference to the texture is taken so if the handle is +no longer needed it should be deref'd with cogl_texture_unref. + + + +texture : + A ClutterTexture + +cogl_material : + A CoglHandle for a material + +Since 0.8 + + @@ -738,6 +791,24 @@ ClutterTexture:keep-aspect-ratio "keep-aspect-ratio" gboolean : Read / Write Keep the aspect ratio of the texture when requesting the preferred width or height.Default value: FALSE +The <literal>"load-async"</literal> property +ClutterTexture:load-async "load-async" gboolean : Read / Write + +Tries to load a texture from a filename by using a local thread +to perform the read operations. Threading is only enabled if +g_thread_init() has been called prior to clutter_init(), otherwise +ClutterTexture will use the main loop to load the image. + + +The upload of the texture data on the GL pipeline is not +asynchronous, as it must be performed from within the same +thread that called clutter_main(). + + +Default value: FALSE +Since 1.0 + + The <literal>"pixel-format"</literal> property ClutterTexture:pixel-format "pixel-format" gint : Read CoglPixelFormat to use.Allowed values: >= 0 @@ -758,14 +829,34 @@ The <literal>"tile-waste"</literal> property ClutterTexture:tile-waste "tile-waste" gint : Read / Write / Construct Only Max wastage dimension of a texture when using sliced textures or -1 to disable slicing. Bigger values use less textures, smaller values less texture memory.Allowed values: >= -1 -Default value: 64 +Default value: 63 Signal Details -The <literal>"pixbuf-change"</literal> signal +The <literal>"load-finished"</literal> signal +ClutterTexture::load-finishedvoid user_function (ClutterTexture *texture, + gpointer error, + gpointer user_data) : Run Last + +The ::load-finished signal is emitted when a texture load has +completed. If there was an error during loading, error will +be set, otherwise it will be NULL + + + +texture : + the texture which received the signal + +error : + A set error, or NULL + +user_data : +user data set when the signal handler was connected. +Since 1.0 +The <literal>"pixbuf-change"</literal> signal ClutterTexture::pixbuf-changevoid user_function (ClutterTexture *texture, gpointer user_data) : Run Last diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-text.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-text.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-text.xml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-text.xml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,1662 @@ + + +]> + + + +ClutterText +3 +CLUTTER Library + + + +ClutterText +An actor for displaying and editing text + + + + +Synopsis + + + ClutterText; + ClutterTextClass; +ClutterActor* clutter_text_new (void); +ClutterActor* clutter_text_new_full (const gchar *font_name, + const gchar *text, + const ClutterColor *color); +ClutterActor* clutter_text_new_with_text (const gchar *font_name, + const gchar *text); + +void clutter_text_set_text (ClutterText *self, + const gchar *text); +const gchar* clutter_text_get_text (ClutterText *self); +void clutter_text_set_activatable (ClutterText *self, + gboolean activatable); +gboolean clutter_text_get_activatable (ClutterText *self); +void clutter_text_set_alignment (ClutterText *self, + PangoAlignment alignment); +PangoAlignment clutter_text_get_alignment (ClutterText *self); +void clutter_text_set_attributes (ClutterText *self, + PangoAttrList *attrs); +PangoAttrList* clutter_text_get_attributes (ClutterText *self); +void clutter_text_set_color (ClutterText *self, + const ClutterColor *color); +void clutter_text_get_color (ClutterText *self, + ClutterColor *color); +void clutter_text_set_ellipsize (ClutterText *self, + PangoEllipsizeMode mode); +PangoEllipsizeMode clutter_text_get_ellipsize (ClutterText *self); +void clutter_text_set_font_name (ClutterText *self, + const gchar *font_name); +const gchar* clutter_text_get_font_name (ClutterText *self); +void clutter_text_set_password_char (ClutterText *self, + gunichar wc); +gunichar clutter_text_get_password_char (ClutterText *self); +void clutter_text_set_justify (ClutterText *self, + gboolean justify); +gboolean clutter_text_get_justify (ClutterText *self); +PangoLayout* clutter_text_get_layout (ClutterText *self); +void clutter_text_set_line_wrap (ClutterText *self, + gboolean line_wrap); +gboolean clutter_text_get_line_wrap (ClutterText *self); +void clutter_text_set_line_wrap_mode (ClutterText *self, + PangoWrapMode wrap_mode); +PangoWrapMode clutter_text_get_line_wrap_mode (ClutterText *self); +void clutter_text_set_max_length (ClutterText *self, + gint max); +gint clutter_text_get_max_length (ClutterText *self); +void clutter_text_set_selectable (ClutterText *self, + gboolean selectable); +gboolean clutter_text_get_selectable (ClutterText *self); +void clutter_text_set_selection (ClutterText *self, + gssize start_pos, + gssize end_pos); +gchar* clutter_text_get_selection (ClutterText *self); +void clutter_text_set_selection_bound (ClutterText *self, + gint selection_bound); +gint clutter_text_get_selection_bound (ClutterText *self); +void clutter_text_set_single_line_mode (ClutterText *self, + gboolean single_line); +gboolean clutter_text_get_single_line_mode (ClutterText *self); +void clutter_text_set_use_markup (ClutterText *self, + gboolean setting); +gboolean clutter_text_get_use_markup (ClutterText *self); + +void clutter_text_set_editable (ClutterText *self, + gboolean editable); +gboolean clutter_text_get_editable (ClutterText *self); +void clutter_text_insert_text (ClutterText *self, + const gchar *text, + gssize position); +void clutter_text_insert_unichar (ClutterText *self, + gunichar wc); +void clutter_text_delete_chars (ClutterText *self, + guint n_chars); +void clutter_text_delete_text (ClutterText *self, + gssize start_pos, + gssize end_pos); +gchar* clutter_text_get_chars (ClutterText *self, + gssize start_pos, + gssize end_pos); +void clutter_text_set_cursor_color (ClutterText *self, + const ClutterColor *color); +void clutter_text_get_cursor_color (ClutterText *self, + ClutterColor *color); +void clutter_text_set_cursor_position (ClutterText *self, + gint position); +gint clutter_text_get_cursor_position (ClutterText *self); +void clutter_text_set_cursor_visible (ClutterText *self, + gboolean cursor_visible); +gboolean clutter_text_get_cursor_visible (ClutterText *self); +void clutter_text_set_cursor_size (ClutterText *self, + gint size); +guint clutter_text_get_cursor_size (ClutterText *self); + +gboolean clutter_text_activate (ClutterText *self); + + + + +Object Hierarchy + + GObject + +----GInitiallyUnowned + +----ClutterActor + +----ClutterText + + + + + + + +Implemented Interfaces + +ClutterText implements + ClutterScriptable. + + + + + +Properties + + "activatable" gboolean : Read / Write + "alignment" PangoAlignment : Read / Write + "attributes" PangoAttrList* : Read / Write + "color" ClutterColor* : Read / Write + "cursor-color" ClutterColor* : Read / Write + "cursor-color-set" gboolean : Read + "cursor-size" gint : Read / Write + "cursor-visible" gboolean : Read / Write + "editable" gboolean : Read / Write + "ellipsize" PangoEllipsizeMode : Read / Write + "font-name" gchar* : Read / Write + "justify" gboolean : Read / Write + "line-wrap" gboolean : Read / Write + "line-wrap-mode" PangoWrapMode : Read / Write + "max-length" gint : Read / Write + "password-char" guint : Read / Write + "position" gint : Read / Write + "selectable" gboolean : Read / Write + "selection-bound" gint : Read / Write + "single-line-mode" gboolean : Read / Write + "text" gchar* : Read / Write + "use-markup" gboolean : Read / Write + + + + +Signals + + "activate" : Run Last + "cursor-event" : Run Last + "text-changed" : Run Last + + + + + +Description + +ClutterText is an actor that displays custom text using Pango +as the text rendering engine. + + +ClutterText also allows inline editing of the text if the +actor is set editable using clutter_text_set_editable(). + + +Selection using keyboard or pointers can be enabled using +clutter_text_set_selectable(). + + +ClutterText is available since Clutter 1.0 + + + + + + +Details + +ClutterText +ClutterTexttypedef struct _ClutterText ClutterText; + +The ClutterText struct contains only private data. + + +Since 1.0 + + +ClutterTextClass +ClutterTextClasstypedef struct { + /* signals, not vfuncs */ + void (* text_changed) (ClutterText *self); + void (* activate) (ClutterText *self); + void (* cursor_event) (ClutterText *self, + const ClutterGeometry *geometry); +} ClutterTextClass; + + +The ClutterTextClass struct contains only private data. + + + + +text_changed () + class handler for the "text-changed" signal + + + +activate () + class handler for the "activate" signal + + + +cursor_event () + class handler for the "cursor_event" signal + + +Since 1.0 + + +clutter_text_new () +clutter_text_newClutterActor* clutter_text_new (void); + +Creates a new ClutterText actor. This actor can be used to +display and edit text. + + + +Returns : the newly created ClutterText actor + + +Since 1.0 + + +clutter_text_new_full () +clutter_text_new_fullClutterActor* clutter_text_new_full (const gchar *font_name, + const gchar *text, + const ClutterColor *color); + +Creates a new ClutterText actor, using font_name as the font +description; text will be used to set the contents of the actor; +and color will be used as the color to render text. + + +This function is equivalent to calling clutter_text_new(), +clutter_text_set_font_name(), clutter_text_set_text() and +clutter_text_set_color(). + + + +font_name : + a string with a font description + +text : + the contents of the actor + +color : + the color to be used to render text + +Returns : the newly created ClutterText actor + + +Since 1.0 + + +clutter_text_new_with_text () +clutter_text_new_with_textClutterActor* clutter_text_new_with_text (const gchar *font_name, + const gchar *text); + +Creates a new ClutterText actor, using font_name as the font +description; text will be used to set the contents of the actor. + + +This function is equivalent to calling clutter_text_new(), +clutter_text_set_font_name(), and clutter_text_set_text(). + + + +font_name : + a string with a font description + +text : + the contents of the actor + +Returns : the newly created ClutterText actor + + +Since 1.0 + + +clutter_text_set_text () +clutter_text_set_textvoid clutter_text_set_text (ClutterText *self, + const gchar *text); + +Sets the contents of a ClutterText actor. The text string +must not be NULL; to unset the current contents of the +ClutterText actor simply pass "" (an empty string). + + + +self : + a ClutterText + +text : + the text to set + +Since 1.0 + + +clutter_text_get_text () +clutter_text_get_textconst gchar* clutter_text_get_text (ClutterText *self); + +Retrieves a pointer to the current contents of a ClutterText +actor. + + +If you need a copy of the contents for manipulating, either +use g_strdup() on the returned string, or use: + + + + copy = clutter_text_get_chars (text, 0, -1); + + + +Which will return a newly allocated string. + + + +self : + a ClutterText + +Returns : the contents of the actor. The returned string + is owned by the ClutterText actor and should never be + modified or freed + + +Since 1.0 + + +clutter_text_set_activatable () +clutter_text_set_activatablevoid clutter_text_set_activatable (ClutterText *self, + gboolean activatable); + +Sets whether a ClutterText actor should be activatable. + + +An activatable ClutterText actor will emit the "activate" +signal whenever the 'Enter' (or 'Return') key is pressed; if it is not +activatable, a new line will be appended to the current content. + + +An activatable ClutterText must also be set as editable using +clutter_text_set_editable(). + + + +self : + a ClutterText + +activatable : + whether the ClutterText actor should be activatable + +Since 1.0 + + +clutter_text_get_activatable () +clutter_text_get_activatablegboolean clutter_text_get_activatable (ClutterText *self); + +Retrieves whether a ClutterText is activatable or not. + + + +self : + a ClutterText + +Returns : TRUE if the actor is activatable + + +Since 1.0 + + +clutter_text_set_alignment () +clutter_text_set_alignmentvoid clutter_text_set_alignment (ClutterText *self, + PangoAlignment alignment); + +Sets text alignment of the ClutterText actor. + + +The alignment will only be used when the contents of the +ClutterText actor are enough to wrap, and the "line-wrap" +property is set to TRUE. + + + +self : + a ClutterText + +alignment : + A PangoAlignment + +Since 1.0 + + +clutter_text_get_alignment () +clutter_text_get_alignmentPangoAlignment clutter_text_get_alignment (ClutterText *self); + +Retrieves the alignment of self. + + + +self : + a ClutterText + +Returns : a PangoAlignment + +Since 1.0 + + + +clutter_text_set_attributes () +clutter_text_set_attributesvoid clutter_text_set_attributes (ClutterText *self, + PangoAttrList *attrs); + +Sets the attributes list that are going to be applied to the +ClutterText contents. The attributes set with this function +will be ignored if the "use_markup" property is +set to TRUE. + + +The ClutterText actor will take a reference on the PangoAttrList +passed to this function. + + + +self : + a ClutterText + +attrs : + a PangoAttrList or NULL to unset the attributes + +Since 1.0 + + +clutter_text_get_attributes () +clutter_text_get_attributesPangoAttrList* clutter_text_get_attributes (ClutterText *self); + +Gets the attribute list that was set on the ClutterText actor +clutter_text_set_attributes(), if any. + + + +self : + a ClutterText + +Returns : the attribute list, or NULL if none was set. The + returned value is owned by the ClutterText and should not be + unreferenced. + + +Since 1.0 + + +clutter_text_set_color () +clutter_text_set_colorvoid clutter_text_set_color (ClutterText *self, + const ClutterColor *color); + +Sets the color of the contents of a ClutterText actor. + + +The overall opacity of the ClutterText actor will be the +result of the alpha value of color and the composited +opacity of the actor itself on the scenegraph, as returned +by clutter_actor_get_paint_opacity(). + + + +self : + a ClutterText + +color : + a ClutterColor + +Since 1.0 + + +clutter_text_get_color () +clutter_text_get_colorvoid clutter_text_get_color (ClutterText *self, + ClutterColor *color); + +Retrieves the text color as set by clutter_text_get_color(). + + + +self : + a ClutterText + +color : + return location for a ClutterColor + +Since 1.0 + + +clutter_text_set_ellipsize () +clutter_text_set_ellipsizevoid clutter_text_set_ellipsize (ClutterText *self, + PangoEllipsizeMode mode); + +Sets the mode used to ellipsize (add an ellipsis: "...") to the +text if there is not enough space to render the entire contents +of a ClutterText actor + + + +self : + a ClutterText + +mode : + a PangoEllipsizeMode + +Since 1.0 + + +clutter_text_get_ellipsize () +clutter_text_get_ellipsizePangoEllipsizeMode clutter_text_get_ellipsize (ClutterText *self); + +Returns the ellipsizing position of a ClutterText actor, as +set by clutter_text_set_ellipsize(). + + + +self : + a ClutterText + +Returns : PangoEllipsizeMode + + +Since 1.0 + + +clutter_text_set_font_name () +clutter_text_set_font_namevoid clutter_text_set_font_name (ClutterText *self, + const gchar *font_name); + +Sets the font used by a ClutterText. 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, +like: + + + + clutter_text_set_font_name (text, "Sans 10pt"); + clutter_text_set_font_name (text, "Serif 16px"); + clutter_text_set_font_name (text, "Helvetica 10"); + + + + +self : + a ClutterText + +font_name : + a font name, or NULL to set the default font name + +Since 1.0 + + +clutter_text_get_font_name () +clutter_text_get_font_nameconst gchar* clutter_text_get_font_name (ClutterText *self); + +Retrieves the font name as set by clutter_text_set_font_name(). + + + +self : + a ClutterText + +Returns : a string containing the font name. The returned + string is owned by the ClutterText actor and should not be + modified or freed + + +Since 1.0 + + +clutter_text_set_password_char () +clutter_text_set_password_charvoid clutter_text_set_password_char (ClutterText *self, + gunichar wc); + +Sets the character to use in place of the actual text in a +password text actor. + + +If wc is 0 the text will be displayed as it is entered in the +ClutterText actor. + + + +self : + a ClutterText + +wc : + a Unicode character, or 0 to unset the password character + +Since 1.0 + + +clutter_text_get_password_char () +clutter_text_get_password_chargunichar clutter_text_get_password_char (ClutterText *self); + +Retrieves the character to use in place of the actual text +as set by clutter_text_set_password_char(). + + + +self : + a ClutterText + +Returns : a Unicode character or 0 if the password + character is not set + + +Since 1.0 + + +clutter_text_set_justify () +clutter_text_set_justifyvoid clutter_text_set_justify (ClutterText *self, + gboolean justify); + +Sets whether the text of the ClutterText actor should be justified +on both margins. This setting is ignored if Clutter is compiled +against Pango < 1.18. + + + +self : + a ClutterText + +justify : + whether the text should be justified + +Since 1.0 + + +clutter_text_get_justify () +clutter_text_get_justifygboolean clutter_text_get_justify (ClutterText *self); + +Retrieves whether the ClutterText actor should justify its contents +on both margins. + + + +self : + a ClutterText + +Returns : TRUE if the text should be justified + + +Since 0.6 + + +clutter_text_get_layout () +clutter_text_get_layoutPangoLayout* clutter_text_get_layout (ClutterText *self); + +Retrieves the current PangoLayout used by a ClutterText actor. + + + +self : + a ClutterText + +Returns : a PangoLayout. The returned object is owned by + the ClutterText actor and should not be modified or freed + + +Since 1.0 + + +clutter_text_set_line_wrap () +clutter_text_set_line_wrapvoid clutter_text_set_line_wrap (ClutterText *self, + gboolean line_wrap); + +Sets whether the contents of a ClutterText actor should wrap, +if they don't fit the size assigned to the actor. + + + +self : + a ClutterText + +line_wrap : + whether the contents should wrap + +Since 1.0 + + +clutter_text_get_line_wrap () +clutter_text_get_line_wrapgboolean clutter_text_get_line_wrap (ClutterText *self); + +Retrieves the value set using clutter_text_set_line_wrap(). + + + +self : + a ClutterText + +Returns : TRUE if the ClutterText actor should wrap + its contents + + +Since 1.0 + + +clutter_text_set_line_wrap_mode () +clutter_text_set_line_wrap_modevoid clutter_text_set_line_wrap_mode (ClutterText *self, + PangoWrapMode wrap_mode); + +If line wrapping is enabled (see clutter_text_set_line_wrap()) this +function controls how the line wrapping is performed. The default is +PANGO_WRAP_WORD which means wrap on word boundaries. + + + +self : + a ClutterText + +wrap_mode : + the line wrapping mode + +Since 1.0 + + +clutter_text_get_line_wrap_mode () +clutter_text_get_line_wrap_modePangoWrapMode clutter_text_get_line_wrap_mode (ClutterText *self); + +Retrieves the line wrap mode used by the ClutterText actor. + + +See clutter_text_set_line_wrap_mode(). + + + +self : + a ClutterText + +Returns : the wrap mode used by the ClutterText + + +Since 1.0 + + +clutter_text_set_max_length () +clutter_text_set_max_lengthvoid clutter_text_set_max_length (ClutterText *self, + gint max); + +Sets the maximum allowed length of the contents of the actor. If the +current contents are longer than the given length, then they will be +truncated to fit. + + + +self : + a ClutterText + +max : + the maximum number of characters allowed in the text actor; 0 + to disable or -1 to set the length of the current string + +Since 1.0 + + +clutter_text_get_max_length () +clutter_text_get_max_lengthgint clutter_text_get_max_length (ClutterText *self); + +Gets the maximum length of text that can be set into a text actor. + + +See clutter_text_set_max_length(). + + + +self : + a ClutterText + +Returns : the maximum number of characters. + + +Since 1.0 + + +clutter_text_set_selectable () +clutter_text_set_selectablevoid clutter_text_set_selectable (ClutterText *self, + gboolean selectable); + +Sets whether a ClutterText actor should be selectable. + + +A selectable ClutterText will allow selecting its contents using +the pointer or the keyboard. + + + +self : + a ClutterText + +selectable : + whether the ClutterText actor should be selectable + +Since 1.0 + + +clutter_text_get_selectable () +clutter_text_get_selectablegboolean clutter_text_get_selectable (ClutterText *self); + +Retrieves whether a ClutterText is selectable or not. + + + +self : + a ClutterText + +Returns : TRUE if the actor is selectable + + +Since 1.0 + + +clutter_text_set_selection () +clutter_text_set_selectionvoid clutter_text_set_selection (ClutterText *self, + gssize start_pos, + gssize end_pos); + +Selects the region of text between start_pos and end_pos. + + +This function changes the position of the cursor to match +start_pos and the selection bound to match end_pos. + + + +self : + a ClutterText + +start_pos : + start of the selection, in characters + +end_pos : + end of the selection, in characters + +Since 1.0 + + +clutter_text_get_selection () +clutter_text_get_selectiongchar* clutter_text_get_selection (ClutterText *self); + +Retrieves the currently selected text. + + + +self : + a ClutterText + +Returns : a newly allocated string containing the currently + selected text, or NULL. Use g_free() to free the returned + string. + + +Since 1.0 + + +clutter_text_set_selection_bound () +clutter_text_set_selection_boundvoid clutter_text_set_selection_bound (ClutterText *self, + gint selection_bound); + +Sets the other end of the selection, starting from the current +cursor position. + + +If selection_bound is -1, the selection unset. + + + +self : + a ClutterText + +selection_bound : + the position of the end of the selection, in characters + +Since 1.0 + + +clutter_text_get_selection_bound () +clutter_text_get_selection_boundgint clutter_text_get_selection_bound (ClutterText *self); + +Retrieves the other end of the selection of a ClutterText actor, +in characters from the current cursor position. + + + +self : + a ClutterText + +Returns : the position of the other end of the selection + + +Since 1.0 + + +clutter_text_set_single_line_mode () +clutter_text_set_single_line_modevoid clutter_text_set_single_line_mode (ClutterText *self, + gboolean single_line); + +Sets whether a ClutterText actor should be in single line mode +or not. + + +A text actor in single line mode will not wrap text and will clip +the the visible area to the predefined size. The contents of the +text actor will scroll to display the end of the text if its length +is bigger than the allocated width. + + +When setting the single line mode the "activatable" +property is also set as a side effect. Instead of entering a new +line character, the text actor will emit the "activate" +signal. + + + +self : + a ClutterText + +single_line : + whether to enable single line mode + +Since 1.0 + + +clutter_text_get_single_line_mode () +clutter_text_get_single_line_modegboolean clutter_text_get_single_line_mode (ClutterText *self); + +Retrieves whether the ClutterText actor is in single line mode. + + + +self : + a ClutterText + +Returns : TRUE if the ClutterText actor is in single line mode + + +Since 1.0 + + +clutter_text_set_use_markup () +clutter_text_set_use_markupvoid clutter_text_set_use_markup (ClutterText *self, + gboolean setting); + +Sets whether the contents of the ClutterText actor contains markup +in Pango's text markup language. + + +Calling this function on an editable ClutterText will not cause +the actor to parse any markup. + + + +self : + a ClutterText + +setting : + TRUE if the text should be parsed for markup. + +Since 1.0 + + +clutter_text_get_use_markup () +clutter_text_get_use_markupgboolean clutter_text_get_use_markup (ClutterText *self); + +Retrieves whether the contents of the ClutterText actor should be +parsed for the Pango text markup. + + + +self : + a ClutterText + +Returns : TRUE if the contents will be parsed for markup + + +Since 1.0 + + +clutter_text_set_editable () +clutter_text_set_editablevoid clutter_text_set_editable (ClutterText *self, + gboolean editable); + +Sets whether the ClutterText actor should be editable. + + +An editable ClutterText with key focus set using +clutter_actor_grab_key_focus() or clutter_stage_take_key_focus() +will receive key events and will update its contents accordingly. + + + +self : + a ClutterText + +editable : + whether the ClutterText should be editable + +Since 1.0 + + +clutter_text_get_editable () +clutter_text_get_editablegboolean clutter_text_get_editable (ClutterText *self); + +Retrieves whether a ClutterText is editable or not. + + + +self : + a ClutterText + +Returns : TRUE if the actor is editable + + +Since 1.0 + + +clutter_text_insert_text () +clutter_text_insert_textvoid clutter_text_insert_text (ClutterText *self, + const gchar *text, + gssize position); + +Inserts text into a ClutterActor at the given position. + + +If position is a negative number, the text will be appended +at the end of the current contents of the ClutterText. + + +The position is expressed in characters, not in bytes. + + + +self : + a ClutterText + +text : + the text to be inserted + +position : + the position of the insertion, or -1 + +Since 1.0 + + +clutter_text_insert_unichar () +clutter_text_insert_unicharvoid clutter_text_insert_unichar (ClutterText *self, + gunichar wc); + +Inserts wc at the current cursor position of a +ClutterText actor. + + + +self : + a ClutterText + +wc : + a Unicode character + +Since 1.0 + + +clutter_text_delete_chars () +clutter_text_delete_charsvoid clutter_text_delete_chars (ClutterText *self, + guint n_chars); + +Deletes n_chars inside a ClutterText actor, starting from the +current cursor position. + + + +self : + a ClutterText + +n_chars : + the number of characters to delete + +Since 1.0 + + +clutter_text_delete_text () +clutter_text_delete_textvoid clutter_text_delete_text (ClutterText *self, + gssize start_pos, + gssize end_pos); + +Deletes the text inside a ClutterText actor between start_pos +and end_pos. + + +The starting and ending positions are expressed in characters, +not in bytes. + + + +self : + a ClutterText + +start_pos : + starting position + +end_pos : + ending position + +Since 1.0 + + +clutter_text_get_chars () +clutter_text_get_charsgchar* clutter_text_get_chars (ClutterText *self, + gssize start_pos, + gssize end_pos); + +Retrieves the contents of the ClutterText actor between +start_pos and end_pos. + + +The positions are specified in characters, not in bytes. + + + +self : + a ClutterText + +start_pos : + start of text, in characters + +end_pos : + end of text, in characters + +Returns : a newly allocated string with the contents of + the text actor between the specified positions. Use g_free() + to free the resources when done + + +Since 1.0 + + +clutter_text_set_cursor_color () +clutter_text_set_cursor_colorvoid clutter_text_set_cursor_color (ClutterText *self, + const ClutterColor *color); + +Sets the color of the cursor of a ClutterText actor. + + +If color is NULL, the cursor color will be the same as the +text color. + + + +self : + a ClutterText + +color : + the color of the cursor, or NULL to unset it + +Since 1.0 + + +clutter_text_get_cursor_color () +clutter_text_get_cursor_colorvoid clutter_text_get_cursor_color (ClutterText *self, + ClutterColor *color); + +Retrieves the color of the cursor of a ClutterText actor. + + + +self : + a ClutterText + +color : + return location for a ClutterColor + +Since 1.0 + + +clutter_text_set_cursor_position () +clutter_text_set_cursor_positionvoid clutter_text_set_cursor_position (ClutterText *self, + gint position); + +Sets the cursor of a ClutterText actor at position. + + +The position is expressed in characters, not in bytes. + + + +self : + a ClutterText + +position : + the new cursor position, in characters + +Since 1.0 + + +clutter_text_get_cursor_position () +clutter_text_get_cursor_positiongint clutter_text_get_cursor_position (ClutterText *self); + +Retrieves the cursor position. + + + +self : + a ClutterText + +Returns : the cursor position, in characters + + +Since 1.0 + + +clutter_text_set_cursor_visible () +clutter_text_set_cursor_visiblevoid clutter_text_set_cursor_visible (ClutterText *self, + gboolean cursor_visible); + +Sets whether the cursor of a ClutterText actor should be +visible or not. + + +The color of the cursor will be the same as the text color +unless clutter_text_set_cursor_color() has been called. + + +The size of the cursor can be set using clutter_text_set_cursor_size(). + + +The position of the cursor can be changed programmatically using +clutter_text_set_cursor_position(). + + + +self : + a ClutterText + +cursor_visible : + whether the cursor should be visible + +Since 1.0 + + +clutter_text_get_cursor_visible () +clutter_text_get_cursor_visiblegboolean clutter_text_get_cursor_visible (ClutterText *self); + +Retrieves whether the cursor of a ClutterText actor is visible. + + + +self : + a ClutterText + +Returns : TRUE if the cursor is visible + + +Since 1.0 + + +clutter_text_set_cursor_size () +clutter_text_set_cursor_sizevoid clutter_text_set_cursor_size (ClutterText *self, + gint size); + +Sets the size of the cursor of a ClutterText. The cursor +will only be visible if the "cursor-visible" property +is set to TRUE. + + + +self : + a ClutterText + +size : + the size of the cursor, in pixels, or -1 to use the + default value + +Since 1.0 + + +clutter_text_get_cursor_size () +clutter_text_get_cursor_sizeguint clutter_text_get_cursor_size (ClutterText *self); + +Retrieves the size of the cursor of a ClutterText actor. + + + +self : + a ClutterText + +Returns : the size of the cursor, in pixels + + +Since 1.0 + + +clutter_text_activate () +clutter_text_activategboolean clutter_text_activate (ClutterText *self); + +Emits the "activate" signal, if self has been set +as activatable using clutter_text_set_activatable(). + + +This function can be used to emit the ::activate signal inside +a "captured-event" or "key-press-event" +signal handlers before the default signal handler for the +ClutterText is invoked. + + + +self : + a ClutterText + +Returns : TRUE if the ::activate signal has been emitted, + and FALSE otherwise + + +Since 1.0 + + + + +Property Details +The <literal>"activatable"</literal> property +ClutterText:activatable "activatable" gboolean : Read / Write + +Toggles whether return invokes the activate signal or not. + + +Default value: TRUE +Since 1.0 + + +The <literal>"alignment"</literal> property +ClutterText:alignment "alignment" PangoAlignment : Read / Write + +The preferred alignment for the text. This property controls +the alignment of multi-line paragraphs. + + +Default value: PANGO_ALIGN_LEFT +Since 1.0 + + +The <literal>"attributes"</literal> property +ClutterText:attributes "attributes" PangoAttrList* : Read / Write + +A list of PangoStyleAttributes to be applied to the +contents of the ClutterText actor. + + +Since 1.0 + + +The <literal>"color"</literal> property +ClutterText:color "color" ClutterColor* : Read / Write + +The color used to render the text. + + +Since 1.0 + + +The <literal>"cursor-color"</literal> property +ClutterText:cursor-color "cursor-color" ClutterColor* : Read / Write + +The color of the cursor. + + +Since 1.0 + + +The <literal>"cursor-color-set"</literal> property +ClutterText:cursor-color-set "cursor-color-set" gboolean : Read + +Will be set to TRUE if "cursor-color" has been set. + + +Default value: FALSE +Since 1.0 + + +The <literal>"cursor-size"</literal> property +ClutterText:cursor-size "cursor-size" gint : Read / Write + +The size of the cursor, in pixels. If set to -1 the size used will +be the default cursor size of 2 pixels. + + +Allowed values: >= -1 +Default value: 2 +Since 1.0 + + +The <literal>"cursor-visible"</literal> property +ClutterText:cursor-visible "cursor-visible" gboolean : Read / Write + +Whether the input cursor is visible or not, it will only be visible +if both "cursor-visible" and "editable" are +set to TRUE. + + +Default value: TRUE +Since 1.0 + + +The <literal>"editable"</literal> property +ClutterText:editable "editable" gboolean : Read / Write + +Whether key events delivered to the actor causes editing. + + +Default value: TRUE +Since 1.0 + + +The <literal>"ellipsize"</literal> property +ClutterText:ellipsize "ellipsize" PangoEllipsizeMode : Read / Write + +The preferred place to ellipsize the contents of the ClutterText actor + + +Default value: PANGO_ELLIPSIZE_NONE +Since 1.0 + + +The <literal>"font-name"</literal> property +ClutterText:font-name "font-name" gchar* : Read / Write + +The font to be used by the ClutterText, as a string +that can be parsed by pango_font_description_from_string(). + + +Default value: NULL +Since 1.0 + + +The <literal>"justify"</literal> property +ClutterText:justify "justify" gboolean : Read / Write + +Whether the contents of the ClutterText should be justified +on both margins. + + +Default value: FALSE +Since 1.0 + + +The <literal>"line-wrap"</literal> property +ClutterText:line-wrap "line-wrap" gboolean : Read / Write + +Whether to wrap the lines of "text" if the contents +exceed the available allocation. The wrapping strategy is +controlled by the "line-wrap-mode" property. + + +Default value: FALSE +Since 1.0 + + +The <literal>"line-wrap-mode"</literal> property +ClutterText:line-wrap-mode "line-wrap-mode" PangoWrapMode : Read / Write + +If "line-wrap" is set to TRUE, this property will +control how the text is wrapped. + + +Default value: PANGO_WRAP_WORD +Since 1.0 + + +The <literal>"max-length"</literal> property +ClutterText:max-length "max-length" gint : Read / Write + +The maximum length of the contents of the ClutterText actor. + + +Allowed values: >= -1 +Default value: 0 +Since 1.0 + + +The <literal>"password-char"</literal> property +ClutterText:password-char "password-char" guint : Read / Write + +If non-zero, the character that should be used in place of +the actual text in a password text actor. + + +Default value: 0 +Since 1.0 + + +The <literal>"position"</literal> property +ClutterText:position "position" gint : Read / Write + +The current input cursor position. -1 is taken to be the end of the text + + +Allowed values: >= -1 +Default value: -1 +Since 1.0 + + +The <literal>"selectable"</literal> property +ClutterText:selectable "selectable" gboolean : Read / Write + +Whether it is possible to select text, either using the pointer +or the keyboard. + + +Default value: TRUE +Since 1.0 + + +The <literal>"selection-bound"</literal> property +ClutterText:selection-bound "selection-bound" gint : Read / Write + +The current input cursor position. -1 is taken to be the end of the text + + +Allowed values: >= -1 +Default value: -1 +Since 1.0 + + +The <literal>"single-line-mode"</literal> property +ClutterText:single-line-mode "single-line-mode" gboolean : Read / Write + +Whether the ClutterText actor should be in single line mode +or not. A single line ClutterText actor will only contain a +single line of text, scrolling it in case its length is bigger +than the allocated size. + + +Setting this property will also set the "activatable" +property as a side-effect. + + +Default value: FALSE +Since 1.0 + + +The <literal>"text"</literal> property +ClutterText:text "text" gchar* : Read / Write + +The text to render inside the actor. + + +Default value: "" +Since 1.0 + + +The <literal>"use-markup"</literal> property +ClutterText:use-markup "use-markup" gboolean : Read / Write + +Whether the text includes Pango markup. See pango_layout_set_markup() +in the Pango documentation. + + +Default value: FALSE +Since 1.0 + + + + + + +Signal Details +The <literal>"activate"</literal> signal +ClutterText::activatevoid user_function (ClutterText *self, + gpointer user_data) : Run Last + +The ::activate signal is emitted each time the actor is 'activated' +by the user, normally by pressing the 'Enter' key. The signal is +emitted only if "activatable" is set to TRUE. + + + +self : + the ClutterText that emitted the signal + +user_data : +user data set when the signal handler was connected. +Since 1.0 +The <literal>"cursor-event"</literal> signal +ClutterText::cursor-eventvoid user_function (ClutterText *self, + ClutterGeometry *geometry, + gpointer user_data) : Run Last + +The ::cursor-event signal is emitted whenever the cursor position +changes inside a ClutterText actor. Inside geometry it is stored +the current position and size of the cursor, relative to the actor +itself. + + + +self : + the ClutterText that emitted the signal + +geometry : + the coordinates of the cursor + +user_data : +user data set when the signal handler was connected. +Since 1.0 +The <literal>"text-changed"</literal> signal +ClutterText::text-changedvoid user_function (ClutterText *self, + gpointer user_data) : Run Last + +The ::text-changed signal is emitted after actor's text changes + + + +self : + the ClutterText that emitted the signal + +user_data : +user data set when the signal handler was connected. +Since 1.0 + + + + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-timeline.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-timeline.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-timeline.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-timeline.xml 2009-01-30 12:41:02.000000000 +0000 @@ -138,38 +138,40 @@ One way to visualise a timeline is as a path with marks along its length. -When creating a timeline of n_frames via clutter_timeline_new(), then the -number of frames can be seen as the paths length, and each unit of length -(each frame) is delimited by a mark. +When creating a timeline of N frames via clutter_timeline_new(), then the +number of frames can be seen as the paths length, and each unit of +length (each frame) is delimited by a mark. -For a non looping timeline there will be (n_frames + 1) marks along its +For a non looping timeline there will be (N frames + 1) marks along its length. For a looping timeline, the two ends are joined with one mark. Technically this mark represents two discrete frame numbers, but for a looping timeline the start and end frame numbers are considered equivalent. -When you create a timeline it starts with -clutter_timeline_get_current_frame() == 0. +When you create a timeline it will be initialized so that the current +frame, as returned by clutter_timeline_get_current_frame(), will be 0. -After starting a timeline, the first timeout is for current_frame_num == 1 -(Notably it isn't 0 since there is a delay before the first timeout signals -so re-asserting the starting frame (0) wouldn't make sense.) -Notably, this implies that actors you intend to be affected by the -timeline's progress, should be manually primed/positioned for frame 0 which -will be displayed before the first timeout. (If you are not careful about +After starting a timeline, the first timeout is for frame number +one (notably it isn't zero since there is a delay before the first +"new-frame" signal, so re-asserting the frame number +zero wouldn't make sense). + + +This implies that actors you intend to be affected by the timeline's +progress should be manually primed or positioned for frame zero which +will be displayed before the first timeout (if you are not careful about this point you will likely see flashes of incorrect actor state in your -program) +program). -For a non looping timeline the last timeout would be for -current_frame_num == n_frames +For a non looping timeline the last timeout would be for the number +of frames in the timeline, as returned by clutter_timeline_get_n_frames(). -For a looping timeline the timeout for current_frame_num == n_frames would -be followed by a timeout for current_frame_num == 1 (remember frame 0 is -considered == frame (n_frames)). +For a looping timeline the timeout for the last frame would be followed +by a timeout for frame number 1. There may be times when a system is not able to meet the frame rate @@ -178,8 +180,8 @@ the time that the timeline was started, not from the time of the last timeout, so a given timeline should basically elapse in the same - real world - time on any given system. An invariable here though is that -current_frame_num == n_frames will always be signaled, but notably frame 1 -can be interpolated past and so never signaled. +the last frame will always be signaled, but notably frame number 1 can +be interpolated past and thus never signaled. @@ -247,9 +249,9 @@ Since 0.6 - + clutter_timeline_clone () -clutter_timeline_cloneClutterTimeline* clutter_timeline_clone (ClutterTimeline *timeline); +clutter_timeline_cloneClutterTimeline* clutter_timeline_clone (ClutterTimeline *timeline); Create a new ClutterTimeline instance which has property values matching that of supplied timeline. The cloned timeline will not @@ -263,15 +265,15 @@ Returns : a new ClutterTimeline, cloned from timeline -Since 0.4 - +Since 0.4 + clutter_timeline_set_speed () clutter_timeline_set_speedvoid clutter_timeline_set_speed (ClutterTimeline *timeline, guint fps); -Set the speed in frames per second of the timeline. +Sets the speed of timeline in frames per second. @@ -279,7 +281,8 @@ A ClutterTimeline fps : - New speed of timeline as frames per second + New speed of timeline as frames per second, + between 1 and 1000 @@ -388,7 +391,7 @@ timeline : A ClutterTimeline -Returns : Number of frames for this ClutterTimeline. +Returns : the number of frames @@ -524,8 +527,8 @@ clutter_timeline_rewindvoid clutter_timeline_rewind (ClutterTimeline *timeline); Rewinds ClutterTimeline to the first frame if its direction is -CLUTTER_TIMELINE_FORWARD and the last frame if it is -CLUTTER_TIMELINE_BACKWARD. +CLUTTER_TIMELINE_FORWARD and the last frame if it is +CLUTTER_TIMELINE_BACKWARD. @@ -538,7 +541,7 @@ clutter_timeline_skipvoid clutter_timeline_skip (ClutterTimeline *timeline, guint n_frames); -Advance timeline by requested number of frames. +Advance timeline by the requested number of frames. @@ -554,7 +557,13 @@ clutter_timeline_advancevoid clutter_timeline_advance (ClutterTimeline *timeline, guint frame_num); -Advance timeline to requested frame number +Advance timeline to the requested frame number. + + +The timeline will not emit the "new-frame" +signal for frame_num. The first ::new-frame signal after the call to +clutter_timeline_advance() will be emitted for a frame following +frame_num. @@ -642,14 +651,14 @@ clutter_timeline_is_playing () clutter_timeline_is_playinggboolean clutter_timeline_is_playing (ClutterTimeline *timeline); -Query state of a ClutterTimeline instance. +Queries state of a ClutterTimeline. timeline : A ClutterTimeline -Returns : TRUE if timeline is currently playing, FALSE if not. +Returns : TRUE if timeline is currently playing @@ -775,7 +784,13 @@ clutter_timeline_advance_to_markervoid clutter_timeline_advance_to_marker (ClutterTimeline *timeline, const gchar *marker_name); -Advances timeline to the frame of the given marker_name. +Advances timeline to the frame of the given marker_name. + + +Like clutter_timeline_advance(), this function will not +emit the "new-frame" for the frame where marker_name +is set, nor it will emit "marker-reached" for +marker_name. @@ -827,8 +842,12 @@ The <literal>"fps"</literal> property ClutterTimeline:fps "fps" guint : Read / Write -Timeline frames per second. Because of the nature of the main -loop used by Clutter this is to be considered a best approximation. +Number of frames per second. Because of the nature of the main +loop used by Clutter, we can only accept a granularity of one +frame per millisecond. + + +This value is to be considered a best approximation. Allowed values: [1,1000] diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-units.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-units.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-units.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-units.xml 2009-01-30 12:41:02.000000000 +0000 @@ -22,26 +22,24 @@ typedef ClutterUnit; -#define CLUTTER_UNITS_FROM_DEVICE (x) -#define CLUTTER_UNITS_TO_DEVICE (x) -#define CLUTTER_UNITS_FROM_FIXED (x) -#define CLUTTER_UNITS_TO_FIXED (x) +#define CLUTTER_UNITS_FORMAT #define CLUTTER_UNITS_FROM_FLOAT (x) #define CLUTTER_UNITS_TO_FLOAT (x) #define CLUTTER_UNITS_FROM_INT (x) #define CLUTTER_UNITS_TO_INT (x) + +#define CLUTTER_UNITS_FROM_DEVICE (x) +#define CLUTTER_UNITS_TO_DEVICE (x) +#define CLUTTER_UNITS_FROM_FIXED (x) +#define CLUTTER_UNITS_TO_FIXED (x) #define CLUTTER_UNITS_FROM_PANGO_UNIT (x) #define CLUTTER_UNITS_TO_PANGO_UNIT (x) -#define CLUTTER_UNITS_TMP_FROM_DEVICE (x) -#define CLUTTER_UNITS_TMP_TO_DEVICE (x) -#define CLUTTER_UNITS_FROM_STAGE_WIDTH_PERCENTAGE(x) -#define CLUTTER_UNITS_FROM_STAGE_HEIGHT_PERCENTAGE(x) -#define CLUTTER_UNITS_FROM_PARENT_WIDTH_PERCENTAGE(a, x) -#define CLUTTER_UNITS_FROM_PARENT_HEIGHT_PERCENTAGE(a, x) #define CLUTTER_UNITS_FROM_MM (x) -#define CLUTTER_UNITS_FROM_MMX (x) #define CLUTTER_UNITS_FROM_POINTS (x) -#define CLUTTER_UNITS_FROM_POINTSX (x) +#define CLUTTER_UNITS_FROM_EM (x) +ClutterUnit clutter_units_mm (gdouble mm); +ClutterUnit clutter_units_pt (gdouble pt); +ClutterUnit clutter_units_em (gdouble em); #define CLUTTER_MAXUNIT #define CLUTTER_MINUNIT @@ -148,7 +146,7 @@ Details ClutterUnit -ClutterUnittypedef gint32 ClutterUnit; +ClutterUnittypedef float ClutterUnit; Device independent unit used by Clutter. The value held can be transformed @@ -157,63 +155,27 @@ Since 0.4 - -CLUTTER_UNITS_FROM_DEVICE() -CLUTTER_UNITS_FROM_DEVICE#define CLUTTER_UNITS_FROM_DEVICE(x) CLUTTER_UNITS_FROM_INT ((x)) + +CLUTTER_UNITS_FORMAT +CLUTTER_UNITS_FORMAT#define CLUTTER_UNITS_FORMAT "f" -Converts x from pixels to ClutterUnits - - - -x : - value in pixels - -Since 0.6 - - -CLUTTER_UNITS_TO_DEVICE() -CLUTTER_UNITS_TO_DEVICE#define CLUTTER_UNITS_TO_DEVICE(x) CLUTTER_UNITS_TO_INT ((x)) - +Format string that should be used for scanning and printing units. +It is a string literal, but it does not include the percent sign to +allow precision and length modifiers between the percent sign and +the format: + -Converts x from ClutterUnits to pixels + + g_print ("%" CLUTTER_UNITS_FORMAT, units); + - -x : - value in ClutterUnits - -Since 0.6 +Since 1.0 - -CLUTTER_UNITS_FROM_FIXED() -CLUTTER_UNITS_FROM_FIXED#define CLUTTER_UNITS_FROM_FIXED(x) (x) - - - - -x : - - - - - - -CLUTTER_UNITS_TO_FIXED() -CLUTTER_UNITS_TO_FIXED#define CLUTTER_UNITS_TO_FIXED(x) (x) - - - - -x : - - - - - CLUTTER_UNITS_FROM_FLOAT() -CLUTTER_UNITS_FROM_FLOAT#define CLUTTER_UNITS_FROM_FLOAT(x) CLUTTER_FLOAT_TO_FIXED ((x)) +CLUTTER_UNITS_FROM_FLOAT#define CLUTTER_UNITS_FROM_FLOAT(x) (x) @@ -226,7 +188,7 @@ CLUTTER_UNITS_TO_FLOAT() -CLUTTER_UNITS_TO_FLOAT#define CLUTTER_UNITS_TO_FLOAT(x) CLUTTER_FIXED_TO_FLOAT ((x)) +CLUTTER_UNITS_TO_FLOAT#define CLUTTER_UNITS_TO_FLOAT(x) (x) @@ -239,7 +201,7 @@ CLUTTER_UNITS_FROM_INT() -CLUTTER_UNITS_FROM_INT#define CLUTTER_UNITS_FROM_INT(x) CLUTTER_INT_TO_FIXED ((x)) +CLUTTER_UNITS_FROM_INT#define CLUTTER_UNITS_FROM_INT(x) ((float)(x)) @@ -252,7 +214,7 @@ CLUTTER_UNITS_TO_INT() -CLUTTER_UNITS_TO_INT#define CLUTTER_UNITS_TO_INT(x) CLUTTER_FIXED_TO_INT ((x)) +CLUTTER_UNITS_TO_INT#define CLUTTER_UNITS_TO_INT(x) ((int)(x)) @@ -263,26 +225,26 @@ - -CLUTTER_UNITS_FROM_PANGO_UNIT() -CLUTTER_UNITS_FROM_PANGO_UNIT#define CLUTTER_UNITS_FROM_PANGO_UNIT(x) ((x) << 6) + +CLUTTER_UNITS_FROM_DEVICE() +CLUTTER_UNITS_FROM_DEVICE#define CLUTTER_UNITS_FROM_DEVICE(x) CLUTTER_UNITS_FROM_INT ((x)) -Converts a value in Pango units to ClutterUnits +Converts x from pixels to ClutterUnits x : - value in Pango units + value in pixels Since 0.6 - -CLUTTER_UNITS_TO_PANGO_UNIT() -CLUTTER_UNITS_TO_PANGO_UNIT#define CLUTTER_UNITS_TO_PANGO_UNIT(x) ((x) >> 6) + +CLUTTER_UNITS_TO_DEVICE() +CLUTTER_UNITS_TO_DEVICE#define CLUTTER_UNITS_TO_DEVICE(x) CLUTTER_UNITS_TO_INT ((x)) -Converts a value in ClutterUnits to Pango units +Converts x from ClutterUnits to pixels @@ -291,9 +253,9 @@ Since 0.6 - -CLUTTER_UNITS_TMP_FROM_DEVICE() -CLUTTER_UNITS_TMP_FROM_DEVICE#define CLUTTER_UNITS_TMP_FROM_DEVICE(x) (x) + +CLUTTER_UNITS_FROM_FIXED() +CLUTTER_UNITS_FROM_FIXED#define CLUTTER_UNITS_FROM_FIXED(x) (x) @@ -304,9 +266,9 @@ - -CLUTTER_UNITS_TMP_TO_DEVICE() -CLUTTER_UNITS_TMP_TO_DEVICE#define CLUTTER_UNITS_TMP_TO_DEVICE(x) (x) + +CLUTTER_UNITS_TO_FIXED() +CLUTTER_UNITS_TO_FIXED#define CLUTTER_UNITS_TO_FIXED(x) (x) @@ -317,63 +279,38 @@ - -CLUTTER_UNITS_FROM_STAGE_WIDTH_PERCENTAGE() -CLUTTER_UNITS_FROM_STAGE_WIDTH_PERCENTAGE#define CLUTTER_UNITS_FROM_STAGE_WIDTH_PERCENTAGE(x) + +CLUTTER_UNITS_FROM_PANGO_UNIT() +CLUTTER_UNITS_FROM_PANGO_UNIT#define CLUTTER_UNITS_FROM_PANGO_UNIT(x) ((float)((x) / 1024)) + - - -x : - - - - - - -CLUTTER_UNITS_FROM_STAGE_HEIGHT_PERCENTAGE() -CLUTTER_UNITS_FROM_STAGE_HEIGHT_PERCENTAGE#define CLUTTER_UNITS_FROM_STAGE_HEIGHT_PERCENTAGE(x) +Converts a value in Pango units to ClutterUnits x : - - - + value in Pango units - - -CLUTTER_UNITS_FROM_PARENT_WIDTH_PERCENTAGE() -CLUTTER_UNITS_FROM_PARENT_WIDTH_PERCENTAGE#define CLUTTER_UNITS_FROM_PARENT_WIDTH_PERCENTAGE(a, x) +Since 0.6 + + +CLUTTER_UNITS_TO_PANGO_UNIT() +CLUTTER_UNITS_TO_PANGO_UNIT#define CLUTTER_UNITS_TO_PANGO_UNIT(x) ((int)((x) * 1024)) + - - -a : - - -x : - - - - - - -CLUTTER_UNITS_FROM_PARENT_HEIGHT_PERCENTAGE() -CLUTTER_UNITS_FROM_PARENT_HEIGHT_PERCENTAGE#define CLUTTER_UNITS_FROM_PARENT_HEIGHT_PERCENTAGE(a, x) +Converts a value in ClutterUnits to Pango units -a : - - x : - - - + value in ClutterUnits - +Since 0.6 + CLUTTER_UNITS_FROM_MM() -CLUTTER_UNITS_FROM_MM#define CLUTTER_UNITS_FROM_MM(x) +CLUTTER_UNITS_FROM_MM#define CLUTTER_UNITS_FROM_MM(x) (clutter_units_mm (x)) + Converts a value in millimeters into ClutterUnits @@ -384,21 +321,10 @@ Since 0.6 - -CLUTTER_UNITS_FROM_MMX() -CLUTTER_UNITS_FROM_MMX#define CLUTTER_UNITS_FROM_MMX(x) - - - -x : - - - - - CLUTTER_UNITS_FROM_POINTS() -CLUTTER_UNITS_FROM_POINTS#define CLUTTER_UNITS_FROM_POINTS(x) +CLUTTER_UNITS_FROM_POINTS#define CLUTTER_UNITS_FROM_POINTS(x) (clutter_units_pt (x)) + Converts a value in typographic points into ClutterUnits @@ -409,21 +335,74 @@ Since 0.6 - -CLUTTER_UNITS_FROM_POINTSX() -CLUTTER_UNITS_FROM_POINTSX#define CLUTTER_UNITS_FROM_POINTSX(x) + +CLUTTER_UNITS_FROM_EM() +CLUTTER_UNITS_FROM_EM#define CLUTTER_UNITS_FROM_EM(x) (clutter_units_em (x)) + + +Converts a value in em into ClutterUnits x : - + a value in em + +Since 1.0 + + +clutter_units_mm () +clutter_units_mmClutterUnit clutter_units_mm (gdouble mm); + +Converts a value in millimeters to ClutterUnits at +the current DPI. + + +mm : + millimeters to convert + +Returns : the value in units - +Since 1.0 + + +clutter_units_pt () +clutter_units_ptClutterUnit clutter_units_pt (gdouble pt); + +Converts a value in typographic points to ClutterUnits +at the current DPI. + + + +pt : + typographic points to convert + +Returns : the value in units + + +Since 1.0 + + +clutter_units_em () +clutter_units_emClutterUnit clutter_units_em (gdouble em); + +Converts a value in em to ClutterUnits at the +current DPI. + + + +em : + em to convert + +Returns : the value in units + + +Since 1.0 + CLUTTER_MAXUNIT -CLUTTER_MAXUNIT#define CLUTTER_MAXUNIT (0x7fffffff) +CLUTTER_MAXUNIT#define CLUTTER_MAXUNIT (G_MAXFLOAT) Higher boundary for a ClutterUnit @@ -433,7 +412,7 @@ CLUTTER_MINUNIT -CLUTTER_MINUNIT#define CLUTTER_MINUNIT (0x80000000) +CLUTTER_MINUNIT#define CLUTTER_MINUNIT (-G_MAXFLOAT) Lower boundary for a ClutterUnit diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-version.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-version.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-version.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-version.xml 2009-01-30 12:41:02.000000000 +0000 @@ -65,7 +65,7 @@ CLUTTER_MINOR_VERSION -CLUTTER_MINOR_VERSION#define CLUTTER_MINOR_VERSION (8) +CLUTTER_MINOR_VERSION#define CLUTTER_MINOR_VERSION (9) The minor version of the Clutter library (2, if CLUTTER_VERSION is 1.2.3) @@ -74,7 +74,7 @@ CLUTTER_MICRO_VERSION -CLUTTER_MICRO_VERSION#define CLUTTER_MICRO_VERSION (4) +CLUTTER_MICRO_VERSION#define CLUTTER_MICRO_VERSION (0) The micro version of the Clutter library (3, if CLUTTER_VERSION is 1.2.3) @@ -83,7 +83,7 @@ CLUTTER_VERSION -CLUTTER_VERSION#define CLUTTER_VERSION 0.8.4 +CLUTTER_VERSION#define CLUTTER_VERSION 0.9.0 The full version of the Clutter library, like 1.2.3 @@ -92,7 +92,7 @@ CLUTTER_VERSION_S -CLUTTER_VERSION_S#define CLUTTER_VERSION_S "0.8.4" +CLUTTER_VERSION_S#define CLUTTER_VERSION_S "0.9.0" The full version of the Clutter library, in string form (suited for diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/clutter-x11.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/clutter-x11.xml --- clutter-0.8.4/doc/reference/clutter/xml/clutter-x11.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/clutter-x11.xml 2009-01-30 12:41:02.000000000 +0000 @@ -156,8 +156,13 @@ xevent : pointer to XEvent structure -Returns : ClutterX11FilterReturn indicating what the caller - should do with the original event. +Returns : ClutterX11FilterReturn. CLUTTER_X11_FILTER_REMOVE + indicates that Clutter has internally handled the event and the + caller should do no further processing. CLUTTER_X11_FILTER_CONTINUE + indicates that Clutter is either not interested in the event, + or has used the event to update internal state without taking + any exclusive action. CLUTTER_X11_FILTER_TRANSLATE will not + occur. Since 0.8 diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/clutter/xml/subclassing-ClutterActor.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/clutter/xml/subclassing-ClutterActor.xml --- clutter-0.8.4/doc/reference/clutter/xml/subclassing-ClutterActor.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/clutter/xml/subclassing-ClutterActor.xml 2009-01-30 12:41:02.000000000 +0000 @@ -349,23 +349,20 @@ foo_actor_paint (ClutterActor *actor) { FooActor *foo_actor = FOO_ACTOR (actor); - ClutterColor color = { 0, }; ClutterUnit w, h, r; - /* FooActor has a specific background color */ - color.red = foo_actor->bg_color.red; - color.green = foo_actor->bg_color.green; - color.blue = foo_actor->bg_color.blue; - /* the alpha component must take into account the absolute + /* FooActor has a specific background color + * + * the alpha component must take into account the absolute * opacity of the actor on the screen at this point in the * scenegraph; this value is obtained by calling * clutter_actor_get_paint_opacity(). */ - color.alpha = clutter_actor_get_paint_opacity (actor); - - /* set the color of the pen */ - cogl_color (&color); + cogl_set_source_color4ub (priv->fgcol.red, + priv->fgcol.green, + priv->fgcol.blue, + clutter_actor_get_paint_opacity (actor)); /* get the size of the actor with sub-pixel precision */ w = CLUTTER_UNITS_TO_FIXED (clutter_actor_get_widthu (actor)); @@ -439,7 +436,8 @@ const ClutterColor *pick_color) { FooActor *foo_actor = FOO_ACTOR (actor); - ClutterUnit w, h, r; + ClutterUnit width, height; + ClutterFixed radius; /* it is possible to avoid a costly paint by checking whether the * actor should really be painted in pick mode @@ -447,17 +445,19 @@ if (!clutter_actor_should_pick_paint (actor)) return; - w = CLUTTER_UNITS_TO_FIXED (clutter_actor_get_widthu (actor)); - h = CLUTTER_UNITS_TO_FIXED (clutter_actor_get_heightu (actor)); + clutter_actor_get_sizeu (actor, &width, &height); /* this is the arc radius for the rounded rectangle corners */ - r = CLUTTER_UNITS_TO_FIXED (foo_actor->radius); + radius = CLUTTER_UNITS_TO_FIXED (foo_actor-&radius); /* use the passed color to paint ourselves */ - cogl_color (pick_color); + cogl_set_source_color4ub (pick_color->red, + pick_color->green, + pick_color->blue, + pick_color->alpha); /* paint a round rectangle */ - cogl_round_rectangle (0, 0, w, h, r, 5); + cogl_round_rectangle (0, 0, width, height, radius, 5); /* and fill it with the current color */ cogl_fill (); diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/cogl-docs.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/cogl-docs.sgml --- clutter-0.8.4/doc/reference/cogl/cogl-docs.sgml 2008-09-29 15:16:27.000000000 +0100 +++ clutter-0.9.0/doc/reference/cogl/cogl-docs.sgml 2009-01-28 16:47:28.000000000 +0000 @@ -55,9 +55,15 @@ + + + + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/cogl-sections.txt /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/cogl-sections.txt --- clutter-0.8.4/doc/reference/cogl/cogl-sections.txt 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/cogl-sections.txt 2009-01-30 12:41:02.000000000 +0000 @@ -23,18 +23,20 @@ cogl_push_matrix cogl_pop_matrix cogl_scale -cogl_translatex cogl_translate -cogl_rotatex cogl_rotate +CoglClipStackState cogl_clip_set +cogl_clip_set_from_path +cogl_clip_set_from_path_preserve cogl_clip_unset cogl_clip_stack_save cogl_clip_stack_restore +cogl_clip_ensure cogl_enable_depth_test -cogl_alpha_func +cogl_enable_backface_culling cogl_fog_set @@ -62,9 +64,7 @@
    cogl-primitives Primitives -cogl_color -cogl_path_fill -cogl_path_stroke +cogl_path_new cogl_path_move_to cogl_path_close cogl_path_line_to @@ -79,19 +79,41 @@ cogl_path_rectangle cogl_path_round_rectangle cogl_path_ellipse + + +cogl_path_fill +cogl_path_fill_preserve +cogl_path_stroke +cogl_path_stroke_preserve +cogl_set_source_color +cogl_set_source_color4ub +cogl_set_source_color4f +cogl_set_source_texture +cogl_color + + cogl_rectangle -cogl_rectanglex +cogl_polygon +cogl_rectangle_with_multitexture_coords +cogl_rectangle_with_texture_coords +cogl_rectangles_with_texture_coords
    cogl-texture Textures CoglTextureVertex +CoglTextureFlags cogl_texture_new_with_size cogl_texture_new_from_file cogl_texture_new_from_data cogl_texture_new_from_foreign +cogl_texture_new_from_bitmap cogl_is_texture +cogl_texture_ref +cogl_texture_unref + + cogl_texture_get_width cogl_texture_get_height cogl_texture_get_format @@ -104,10 +126,13 @@ cogl_texture_get_data cogl_texture_set_filters cogl_texture_set_region -cogl_texture_ref -cogl_texture_unref -cogl_texture_rectangle -cogl_texture_polygon + + +CoglBitmap +cogl_bitmap_new_from_file +cogl_bitmap_free +cogl_bitmap_get_size_from_file +
    @@ -131,6 +156,10 @@ cogl_program_use cogl_program_get_uniform_location cogl_program_uniform_1f +cogl_program_uniform_1i +cogl_program_uniform_float +cogl_program_uniform_int +cogl_program_uniform_matrix
    @@ -145,3 +174,207 @@ cogl_offscreen_blit_region cogl_draw_buffer
    + +
    +cogl-fixed +Fixed Point API +CoglFixed +COGL_FIXED_BITS +COGL_FIXED_Q +COGL_FIXED_MAX +COGL_FIXED_MIN + + +COGL_FIXED_FROM_FLOAT +COGL_FIXED_TO_FLOAT +COGL_FIXED_FROM_INT +COGL_FIXED_TO_INT +COGL_FIXED_TO_DOUBLE +COGL_FLOAT_TO_INT +COGL_FLOAT_TO_UINT + + +COGL_FIXED_EPSILON +COGL_FIXED_1 +COGL_FIXED_0_5 +COGL_FIXED_30 +COGL_FIXED_45 +COGL_FIXED_60 +COGL_FIXED_90 +COGL_FIXED_120 +COGL_FIXED_180 +COGL_FIXED_240 +COGL_FIXED_255 +COGL_FIXED_270 +COGL_FIXED_360 + + +COGL_FIXED_MUL +COGL_FIXED_DIV +COGL_FIXED_MUL_DIV +COGL_FIXED_FAST_DIV +COGL_FIXED_FAST_MUL +COGL_FIXED_FRACTION +COGL_FIXED_FLOOR +COGL_FIXED_CEIL + + +COGL_FIXED_2_PI +COGL_FIXED_PI +COGL_FIXED_PI_2 +COGL_FIXED_PI_4 +COGL_RADIANS_TO_DEGREES + + +COGL_SQRTI_ARG_10_PERCENT +COGL_SQRTI_ARG_5_PERCENT +COGL_SQRTI_ARG_MAX +cogl_sqrti + + +cogl_fixed_atan2 +cogl_fixed_atani +cogl_fixed_cos +cogl_fixed_log2 +cogl_fixed_pow +cogl_fixed_pow2 +cogl_fixed_sin +cogl_fixed_sqrt +cogl_fixed_tan + + +CoglAngle +COGL_ANGLE_FROM_DEG +COGL_ANGLE_FROM_DEGX +COGL_ANGLE_TO_DEG +COGL_ANGLE_TO_DEGX +cogl_angle_cos +cogl_angle_sin +cogl_angle_tan + + +cogl_fixed_mul +cogl_fixed_div +cogl_fixed_mul_div +cogl_double_to_fixed +cogl_double_to_int +cogl_double_to_unit +
    + +
    +cogl-color +Color Type +CoglColor +cogl_color_new +cogl_color_copy +cogl_color_free +cogl_color_set_from_4ub +cogl_color_set_from_4d +cogl_color_set_from_4f + + +cogl_color_get_red +cogl_color_get_green +cogl_color_get_blue +cogl_color_get_alpha + + +cogl_color_get_red_byte +cogl_color_get_green_byte +cogl_color_get_blue_byte +cogl_color_get_alpha_byte + + +cogl_color_get_red_float +cogl_color_get_green_float +cogl_color_get_blue_float +cogl_color_get_alpha_float +
    + +
    +cogl-vertex-buffer +Vertex Buffers +CoglVertexBufferAttribFlags +COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_MASK +COGL_VERTEX_BUFFER_ATTRIB_FLAG_TYPE_MASK +cogl_vertex_buffer_new +cogl_vertex_buffer_ref +cogl_vertex_buffer_unref +cogl_vertex_buffer_add +cogl_vertex_buffer_delete +cogl_vertex_buffer_enable +cogl_vertex_buffer_disable +cogl_vertex_buffer_submit +cogl_vertex_buffer_draw +cogl_vertex_buffer_draw_range_elements +
    + +
    +cogl-matrix +Matrices +CoglMatrix +cogl_matrix_init_identity +cogl_matrix_multiply +cogl_matrix_rotate +cogl_matrix_translate +cogl_matrix_scale +
    + +
    +cogl-material +Materials +CoglMaterial +CoglMaterialFlags +cogl_material_new +cogl_material_ref +cogl_material_unref +cogl_material_set_ambient +cogl_material_get_ambient +cogl_material_set_ambient_and_diffuse +cogl_material_set_color +cogl_material_set_color4ub +cogl_material_get_color +cogl_material_set_diffuse +cogl_material_get_diffuse +cogl_material_set_emission +cogl_material_get_emission +cogl_material_set_specular +cogl_material_get_specular +cogl_material_set_shininess +cogl_material_get_shininess +cogl_set_source +CoglMaterialAlphaFunc +cogl_material_set_alpha_test_function +CoglMaterialBlendFactor +cogl_material_set_blend_factors +CoglMaterialLayer +cogl_material_set_layer +cogl_material_remove_layer +CoglMaterialLayerCombineFunc +cogl_material_set_layer_combine_function +CoglMaterialLayerCombineChannels +CoglMaterialLayerCombineSrc +cogl_material_set_layer_combine_arg_src +CoglMaterialLayerCombineOp +cogl_material_set_layer_combine_arg_op +cogl_material_set_layer_matrix +cogl_material_set_layer_alpha_combine +cogl_material_set_layer_rgb_combine +cogl_material_get_cogl_enable_flags +CoglMaterialFlushOption +cogl_material_flush_gl_material_state +cogl_material_flush_gl_alpha_func +cogl_material_flush_gl_blend_func +cogl_material_flush_gl_state +cogl_material_get_layers +CoglMaterialLayerType +cogl_material_layer_get_type +CoglMaterialLayerFlags +cogl_material_layer_get_flags +cogl_material_layer_get_texture +cogl_material_layer_flush_gl_sampler_state + + +CoglMaterialLayerPrivFlags +
    + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/html/ch01.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/html/ch01.html --- clutter-0.8.4/doc/reference/cogl/html/ch01.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/html/ch01.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,9 +4,9 @@ COGL - GL Abstraction API - - - + + + @@ -19,12 +19,12 @@ Prev   Home -COGL 0.8.4 Reference Manual +COGL 0.9.0 Reference Manual Next

    -COGL - GL Abstraction API

    +COGL - GL Abstraction API
    About COGL
    @@ -38,15 +38,36 @@ Utility API
    +Matrices — Fuctions for initializing and manipulating 4x4 + matrices. +
    +
    Textures — Fuctions for creating and manipulating textures
    +Materials — Fuctions for creating and manipulating materials +
    +
    Shaders and Programmable Pipeline — Fuctions for accessing the programmable GL pipeline
    Offscreen Buffers — Fuctions for creating and manipulating offscreen frame buffer objects
    +
    +Fixed Point API — Fixed Point API +
    +
    +Color Type +
    +
    +Vertex Buffers — An API for submitting extensible arrays of vertex + attributes to OpenGL in a way that aims to minimise + copying or reformatting of the original data. +
    +
    +Materials — Fuctions for creating and manipulating materials +

    diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/html/cogl-Color-Type.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/html/cogl-Color-Type.html --- clutter-0.8.4/doc/reference/cogl/html/cogl-Color-Type.html 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/cogl/html/cogl-Color-Type.html 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,619 @@ + + + + +Color Type + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +

    Color Type

    +

    Color Type

    +
    +
    +

    Synopsis

    +
    +                    CoglColor;
    +CoglColor*          cogl_color_new                      (void);
    +CoglColor*          cogl_color_copy                     (const CoglColor *color);
    +void                cogl_color_free                     (CoglColor *color);
    +void                cogl_color_set_from_4ub             (CoglColor *dest,
    +                                                         guint8 red,
    +                                                         guint8 green,
    +                                                         guint8 blue,
    +                                                         guint8 alpha);
    +void                cogl_color_set_from_4f              (CoglColor *dest,
    +                                                         float red,
    +                                                         float green,
    +                                                         float blue,
    +                                                         float alpha);
    +
    +float               cogl_color_get_red                  (const CoglColor *color);
    +float               cogl_color_get_green                (const CoglColor *color);
    +float               cogl_color_get_blue                 (const CoglColor *color);
    +float               cogl_color_get_alpha                (const CoglColor *color);
    +
    +unsigned char       cogl_color_get_red_byte             (const CoglColor *color);
    +unsigned char       cogl_color_get_green_byte           (const CoglColor *color);
    +unsigned char       cogl_color_get_blue_byte            (const CoglColor *color);
    +unsigned char       cogl_color_get_alpha_byte           (const CoglColor *color);
    +
    +float               cogl_color_get_red_float            (const CoglColor *color);
    +float               cogl_color_get_green_float          (const CoglColor *color);
    +float               cogl_color_get_blue_float           (const CoglColor *color);
    +float               cogl_color_get_alpha_float          (const CoglColor *color);
    +
    +
    +
    +

    Description

    +

    + +

    +
    +
    +

    Details

    +
    +

    CoglColor

    +
    typedef struct {
    +} CoglColor;
    +
    +

    +A structure for holding a color definition. The contents of +the CoglColor structure are private and should never by accessed +directly.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_color_new ()

    +
    CoglColor*          cogl_color_new                      (void);
    +

    + +

    +
    ++ + + + +

    Returns :

    + + +
    +
    +
    +
    +

    cogl_color_copy ()

    +
    CoglColor*          cogl_color_copy                     (const CoglColor *color);
    +

    + +

    +
    ++ + + + + + + + + + +

    color :

    +

    Returns :

    + + +
    +
    +
    +
    +

    cogl_color_free ()

    +
    void                cogl_color_free                     (CoglColor *color);
    +

    + +

    +
    ++ + + + +

    color :

    + + +
    +
    +
    +
    +

    cogl_color_set_from_4ub ()

    +
    void                cogl_color_set_from_4ub             (CoglColor *dest,
    +                                                         guint8 red,
    +                                                         guint8 green,
    +                                                         guint8 blue,
    +                                                         guint8 alpha);
    +

    +Sets the values of the passed channels into a CoglColor.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + +

    dest :

    return location for a CoglColor +

    red :

    value of the red channel, between 0 and 255 +

    green :

    value of the green channel, between 0 and 255 +

    blue :

    value of the blue channel, between 0 and 255 +

    alpha :

    value of the alpha channel, between 0 and 255 +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_color_set_from_4f ()

    +
    void                cogl_color_set_from_4f              (CoglColor *dest,
    +                                                         float red,
    +                                                         float green,
    +                                                         float blue,
    +                                                         float alpha);
    +

    +Sets the values of the passed channels into a CoglColor

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + +

    dest :

    return location for a CoglColor +

    red :

    value of the red channel, between 0 and 1.0 +

    green :

    value of the green channel, between 0 and 1.0 +

    blue :

    value of the blue channel, between 0 and 1.0 +

    alpha :

    value of the alpha channel, between 0 and 1.0 +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_color_get_red ()

    +
    float               cogl_color_get_red                  (const CoglColor *color);
    +

    +Retrieves the red channel of color as a fixed point +value between 0 and 1.0.

    +

    + +

    +
    ++ + + + + + + + + + +

    color :

    a CoglColor +

    Returns :

    the red channel of the passed color + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_color_get_green ()

    +
    float               cogl_color_get_green                (const CoglColor *color);
    +

    +Retrieves the green channel of color as a fixed point +value between 0 and 1.0.

    +

    + +

    +
    ++ + + + + + + + + + +

    color :

    a CoglColor +

    Returns :

    the green channel of the passed color + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_color_get_blue ()

    +
    float               cogl_color_get_blue                 (const CoglColor *color);
    +

    +Retrieves the blue channel of color as a fixed point +value between 0 and 1.0.

    +

    + +

    +
    ++ + + + + + + + + + +

    color :

    a CoglColor +

    Returns :

    the blue channel of the passed color + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_color_get_alpha ()

    +
    float               cogl_color_get_alpha                (const CoglColor *color);
    +

    +Retrieves the alpha channel of color as a fixed point +value between 0 and 1.0.

    +

    + +

    +
    ++ + + + + + + + + + +

    color :

    a CoglColor +

    Returns :

    the alpha channel of the passed color + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_color_get_red_byte ()

    +
    unsigned char       cogl_color_get_red_byte             (const CoglColor *color);
    +

    +Retrieves the red channel of color as a byte value +between 0 and 255

    +

    + +

    +
    ++ + + + + + + + + + +

    color :

    a CoglColor +

    Returns :

    the red channel of the passed color + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_color_get_green_byte ()

    +
    unsigned char       cogl_color_get_green_byte           (const CoglColor *color);
    +

    +Retrieves the green channel of color as a byte value +between 0 and 255

    +

    + +

    +
    ++ + + + + + + + + + +

    color :

    a CoglColor +

    Returns :

    the green channel of the passed color + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_color_get_blue_byte ()

    +
    unsigned char       cogl_color_get_blue_byte            (const CoglColor *color);
    +

    +Retrieves the blue channel of color as a byte value +between 0 and 255

    +

    + +

    +
    ++ + + + + + + + + + +

    color :

    a CoglColor +

    Returns :

    the blue channel of the passed color + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_color_get_alpha_byte ()

    +
    unsigned char       cogl_color_get_alpha_byte           (const CoglColor *color);
    +

    +Retrieves the alpha channel of color as a byte value +between 0 and 255

    +

    + +

    +
    ++ + + + + + + + + + +

    color :

    a CoglColor +

    Returns :

    the alpha channel of the passed color + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_color_get_red_float ()

    +
    float               cogl_color_get_red_float            (const CoglColor *color);
    +

    +Retrieves the red channel of color as a floating point +value between 0.0 and 1.0

    +

    + +

    +
    ++ + + + + + + + + + +

    color :

    a CoglColor +

    Returns :

    the red channel of the passed color + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_color_get_green_float ()

    +
    float               cogl_color_get_green_float          (const CoglColor *color);
    +

    +Retrieves the green channel of color as a floating point +value between 0.0 and 1.0

    +

    + +

    +
    ++ + + + + + + + + + +

    color :

    a CoglColor +

    Returns :

    the green channel of the passed color + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_color_get_blue_float ()

    +
    float               cogl_color_get_blue_float           (const CoglColor *color);
    +

    +Retrieves the blue channel of color as a floating point +value between 0.0 and 1.0

    +

    + +

    +
    ++ + + + + + + + + + +

    color :

    a CoglColor +

    Returns :

    the blue channel of the passed color + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_color_get_alpha_float ()

    +
    float               cogl_color_get_alpha_float          (const CoglColor *color);
    +

    +Retrieves the alpha channel of color as a floating point +value between 0.0 and 1.0

    +

    + +

    +
    ++ + + + + + + + + + +

    color :

    a CoglColor +

    Returns :

    the alpha channel of the passed color + +
    +

    Since 1.0 +

    +
    +
    +
    + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/html/cogl.devhelp /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/html/cogl.devhelp --- clutter-0.8.4/doc/reference/cogl/html/cogl.devhelp 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/html/cogl.devhelp 2009-01-30 12:41:02.000000000 +0000 @@ -1,15 +1,21 @@ - + + + + + + + @@ -35,20 +41,20 @@ - - + + + + - + - - - + @@ -63,8 +69,20 @@ + + + + + + + + + - + + + + @@ -78,12 +96,22 @@ + + + + + + + + + + @@ -96,10 +124,56 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -117,6 +191,10 @@ + + + + @@ -125,5 +203,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/html/cogl.devhelp2 /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/html/cogl.devhelp2 --- clutter-0.8.4/doc/reference/cogl/html/cogl.devhelp2 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/html/cogl.devhelp2 2009-01-30 12:41:02.000000000 +0000 @@ -1,15 +1,21 @@ - + + + + + + + @@ -23,8 +29,8 @@ - - + + @@ -35,20 +41,20 @@ - - + + + + - + - - - + @@ -63,14 +69,26 @@ + + + + + + + + + - + + + + - + @@ -78,12 +96,22 @@ + + + + + + - - - - + + + + + + + + @@ -96,10 +124,56 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -117,6 +191,10 @@ + + + + @@ -125,5 +203,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/html/cogl-Fixed-Point-API.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/html/cogl-Fixed-Point-API.html --- clutter-0.8.4/doc/reference/cogl/html/cogl-Fixed-Point-API.html 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/cogl/html/cogl-Fixed-Point-API.html 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,1383 @@ + + + + +Fixed Point API + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +

    Fixed Point API

    +

    Fixed Point API — Fixed Point API

    +
    +
    +

    Synopsis

    +
    +typedef             CoglFixed;
    +#define             COGL_FIXED_BITS
    +#define             COGL_FIXED_Q
    +#define             COGL_FIXED_MAX
    +#define             COGL_FIXED_MIN
    +
    +#define             COGL_FIXED_FROM_FLOAT               (x)
    +#define             COGL_FIXED_TO_FLOAT                 (x)
    +#define             COGL_FIXED_FROM_INT                 (x)
    +#define             COGL_FIXED_TO_INT                   (x)
    +#define             COGL_FIXED_TO_DOUBLE                (x)
    +#define             COGL_FLOAT_TO_INT                   (x)
    +#define             COGL_FLOAT_TO_UINT                  (x)
    +
    +#define             COGL_FIXED_EPSILON
    +#define             COGL_FIXED_1
    +#define             COGL_FIXED_0_5
    +#define             COGL_FIXED_30
    +#define             COGL_FIXED_45
    +#define             COGL_FIXED_60
    +#define             COGL_FIXED_90
    +#define             COGL_FIXED_120
    +#define             COGL_FIXED_180
    +#define             COGL_FIXED_240
    +#define             COGL_FIXED_255
    +#define             COGL_FIXED_270
    +#define             COGL_FIXED_360
    +
    +#define             COGL_FIXED_MUL                      (a,b)
    +#define             COGL_FIXED_DIV                      (a,b)
    +#define             COGL_FIXED_MUL_DIV                  (a,b,c)
    +#define             COGL_FIXED_FAST_DIV                 (a,b)
    +#define             COGL_FIXED_FAST_MUL                 (a,b)
    +#define             COGL_FIXED_FRACTION                 (x)
    +#define             COGL_FIXED_FLOOR                    (x)
    +#define             COGL_FIXED_CEIL                     (x)
    +
    +#define             COGL_FIXED_2_PI
    +#define             COGL_FIXED_PI
    +#define             COGL_FIXED_PI_2
    +#define             COGL_FIXED_PI_4
    +#define             COGL_RADIANS_TO_DEGREES
    +
    +#define             COGL_SQRTI_ARG_10_PERCENT
    +#define             COGL_SQRTI_ARG_5_PERCENT
    +#define             COGL_SQRTI_ARG_MAX
    +gint                cogl_sqrti                          (gint x);
    +
    +CoglFixed           cogl_fixed_atan2                    (CoglFixed a,
    +                                                         CoglFixed b);
    +CoglFixed           cogl_fixed_atani                    (CoglFixed a);
    +CoglFixed           cogl_fixed_cos                      (CoglFixed angle);
    +CoglFixed           cogl_fixed_log2                     (guint x);
    +guint               cogl_fixed_pow                      (guint x,
    +                                                         CoglFixed y);
    +guint               cogl_fixed_pow2                     (CoglFixed x);
    +CoglFixed           cogl_fixed_sin                      (CoglFixed angle);
    +CoglFixed           cogl_fixed_sqrt                     (CoglFixed x);
    +CoglFixed           cogl_fixed_tan                      (CoglFixed angle);
    +
    +typedef             CoglAngle;
    +#define             COGL_ANGLE_FROM_DEG                 (x)
    +#define             COGL_ANGLE_FROM_DEGX                (x)
    +#define             COGL_ANGLE_TO_DEG                   (x)
    +#define             COGL_ANGLE_TO_DEGX                  (x)
    +CoglFixed           cogl_angle_cos                      (CoglAngle angle);
    +CoglFixed           cogl_angle_sin                      (CoglAngle angle);
    +CoglFixed           cogl_angle_tan                      (CoglAngle angle);
    +
    +
    +
    +

    Description

    +

    +COGL has a fixed point API targeted at platforms without a floating +point unit, such as embedded devices. On such platforms this API should +be preferred to the floating point one as it does not trigger the slow +path of software emulation, relying on integer math for fixed-to-floating +and floating-to-fixed notations conversion. +

    +

    +It is not recommened for use on platforms with a floating point unit +(e.g. desktop systems), nor for use in language bindings. +

    +

    +Basic rules of Fixed Point arithmethic: +

    +
      +
    • Two fixed point numbers can be directly added, subtracted and + have their modulus taken.

    • +
    • To add other numerical type to a fixed point number it has to + be first converted to fixed point.

    • +
    • A fixed point number can be directly multiplied or divided by + an integer.

    • +
    • Two fixed point numbers can only be multiplied and divided by + the provided COGL_FIXED_MUL and COGL_FIXED_DIV macros.

    • +
    +

    +

    +

    +The fixed point API is available since COGL 1.0.

    +

    + +

    +
    +
    +

    Details

    +
    +

    CoglFixed

    +
    typedef gint32 CoglFixed;
    +
    +

    +Fixed point number using a (16.16) notation.

    +

    + +

    +
    +
    +
    +

    COGL_FIXED_BITS

    +
    #define COGL_FIXED_BITS         (32)
    +
    +

    +Evaluates to the number of bits used by the CoglFixed type.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_Q

    +
    #define COGL_FIXED_Q            (COGL_FIXED_BITS - 16)
    +
    +

    +Evaluates to the number of bits used for the non-integer part +of the CoglFixed type.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_MAX

    +
    #define COGL_FIXED_MAX          (0x7fffffff)
    +
    +

    +The biggest number representable using CoglFixed

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_MIN

    +
    #define COGL_FIXED_MIN          (0x80000000)
    +
    +

    +The smallest number representable using CoglFixed

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_FROM_FLOAT()

    +
    #define COGL_FIXED_FROM_FLOAT(x)        (cogl_double_to_fixed (x))
    +
    +

    +Converts x from a floating point to a fixed point notation.

    +

    + +

    +
    ++ + + + +

    x :

    a floating point number +
    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_TO_FLOAT()

    +
    #define COGL_FIXED_TO_FLOAT(x)          ((float) ((int)(x) / 65536.0))
    +
    +

    +Converts x from a fixed point to a floatint point notation, in +double precision.

    +

    + +

    +
    ++ + + + +

    x :

    a CoglFixed number +
    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_FROM_INT()

    +
    #define COGL_FIXED_FROM_INT(x)          ((x) << COGL_FIXED_Q)
    +
    +

    +Converts x from an integer to a fixed point notation.

    +

    + +

    +
    ++ + + + +

    x :

    an integer number +
    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_TO_INT()

    +
    #define COGL_FIXED_TO_INT(x)            ((x) >> COGL_FIXED_Q)
    +
    +

    +Converts x from a fixed point notation to an integer, dropping +the fractional part without rounding.

    +

    + +

    +
    ++ + + + +

    x :

    a CoglFixed number +
    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_TO_DOUBLE()

    +
    #define COGL_FIXED_TO_DOUBLE(x)         ((double) ((int)(x) / 65536.0))
    +
    +

    + +

    +
    ++ + + + +

    x :

    + + +
    +
    +
    +
    +

    COGL_FLOAT_TO_INT()

    +
    #define COGL_FLOAT_TO_INT(x)            (cogl_double_to_int ((x)))
    +
    +

    +Converts x from a floating point notation to a signed integer.

    +

    + +

    +
    ++ + + + +

    x :

    a floatint point number +
    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FLOAT_TO_UINT()

    +
    #define COGL_FLOAT_TO_UINT(x)           (cogl_double_to_uint ((x)))
    +
    +

    +Converts x from a floating point notation to an unsigned integer.

    +

    + +

    +
    ++ + + + +

    x :

    a floatint point number +
    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_EPSILON

    +
    #define COGL_FIXED_EPSILON      (1)
    +
    +

    +A very small number expressed as a CoglFixed number.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_1

    +
    #define COGL_FIXED_1            (1 << COGL_FIXED_Q)
    +
    +

    +The number 1 expressed as a CoglFixed number.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_0_5

    +
    #define COGL_FIXED_0_5          (32768)
    +
    +

    +The number 0.5 expressed as a CoglFixed number.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_30

    +
    #define COGL_FIXED_30           (COGL_FIXED_FROM_INT (30))
    +
    +

    +Evaluates to the number 30 in fixed point notation.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_45

    +
    #define COGL_FIXED_45           (COGL_FIXED_FROM_INT (45))
    +
    +

    +Evaluates to the number 45 in fixed point notation.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_60

    +
    #define COGL_FIXED_60           (COGL_FIXED_FROM_INT (60))
    +
    +

    +Evaluates to the number 60 in fixed point notation.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_90

    +
    #define COGL_FIXED_90           (COGL_FIXED_FROM_INT (90))
    +
    +

    +Evaluates to the number 90 in fixed point notation.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_120

    +
    #define COGL_FIXED_120          (COGL_FIXED_FROM_INT (120))
    +
    +

    +Evaluates to the number 120 in fixed point notation.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_180

    +
    #define COGL_FIXED_180          (COGL_FIXED_FROM_INT (180))
    +
    +

    +Evaluates to the number 180 in fixed point notation.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_240

    +
    #define COGL_FIXED_240          (COGL_FIXED_FROM_INT (240))
    +
    +

    +Evaluates to the number 240 in fixed point notation.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_255

    +
    #define COGL_FIXED_255          (COGL_FIXED_FROM_INT (255))
    +
    +

    +Evaluates to the number 255 in fixed point notation.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_270

    +
    #define COGL_FIXED_270          (COGL_FIXED_FROM_INT (270))
    +
    +

    +Evaluates to the number 270 in fixed point notation.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_360

    +
    #define COGL_FIXED_360          (COGL_FIXED_FROM_INT (360))
    +
    +

    +Evaluates to the number 360 in fixed point notation.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_MUL()

    +
    #define COGL_FIXED_MUL(a,b)             (cogl_fixed_mul ((a), (b)))
    +
    +

    +Computes (a * b).

    +

    + +

    +
    ++ + + + + + + + + + +

    a :

    a CoglFixed number +

    b :

    a CoglFixed number +
    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_DIV()

    +
    #define COGL_FIXED_DIV(a,b)             (cogl_fixed_div ((a), (b)))
    +
    +

    +Computes (a / b).

    +

    + +

    +
    ++ + + + + + + + + + +

    a :

    a CoglFixed number +

    b :

    a CoglFixed number +
    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_MUL_DIV()

    +
    #define COGL_FIXED_MUL_DIV(a,b,c)       (cogl_fixed_mul_div ((a), (b), (c)))
    +
    +

    +Computes ((a * b) / c). It is logically equivalent to: +

    +

    +

    +
    +  res = COGL_FIXED_DIV (COGL_FIXED_MUL (a, b), c);
    +
    +

    +

    +

    +But it is shorter to type.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    a :

    a CoglFixed number +

    b :

    a CoglFixed number +

    c :

    a CoglFixed number +
    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_FAST_DIV()

    +
    #define COGL_FIXED_FAST_DIV(a,b)        ((((a) << 8) / (b)) << 8)
    +
    +

    +Fast version of COGL_FIXED_DIV, implemented as a macro. +

    +

    +

    +
    +

    Note

    This macro might lose precision. If the precision of the result +is important use COGL_FIXED_DIV instead.
    +

    + +

    +
    ++ + + + + + + + + + +

    a :

    a CoglFixed number +

    b :

    a CoglFixed number +
    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_FAST_MUL()

    +
    #define COGL_FIXED_FAST_MUL(a,b)        ((a) >> 8) * ((b) >> 8)
    +
    +

    +Fast version of COGL_FIXED_MUL, implemented as a macro. +

    +

    +

    +
    +

    Note

    This macro might lose precision. If the precision of the result +is important use COGL_FIXED_MUL instead.
    +

    + +

    +
    ++ + + + + + + + + + +

    a :

    a CoglFixed number +

    b :

    a CoglFixed number +
    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_FRACTION()

    +
    #define COGL_FIXED_FRACTION(x)          ((x) & ((1 << COGL_FIXED_Q) - 1))
    +
    +

    +Retrieves the fractionary part of x.

    +

    + +

    +
    ++ + + + +

    x :

    a CoglFixed number +
    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_FLOOR()

    +
    #define             COGL_FIXED_FLOOR(x)
    +

    +Rounds down a fixed point number to the previous integer.

    +

    + +

    +
    ++ + + + +

    x :

    a CoglFixed number +
    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_CEIL()

    +
    #define COGL_FIXED_CEIL(x)              (COGL_FIXED_FLOOR ((x) + 0xffff))
    +
    +

    +Rounds up a fixed point number to the next integer.

    +

    + +

    +
    ++ + + + +

    x :

    a CoglFixed number +
    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_2_PI

    +
    #define COGL_FIXED_2_PI         (0x0006487f)
    +
    +

    +Two times pi, expressed as a CoglFixed number.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_PI

    +
    #define COGL_FIXED_PI           (0x0003243f)
    +
    +

    +The number pi, expressed as a CoglFixed number.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_PI_2

    +
    #define COGL_FIXED_PI_2         (0x00019220)
    +
    +

    +Half pi, expressed as a CoglFixed number.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_FIXED_PI_4

    +
    #define COGL_FIXED_PI_4         (0x0000c910)
    +
    +

    +pi / 4, expressed as CoglFixed number.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_RADIANS_TO_DEGREES

    +
    #define COGL_RADIANS_TO_DEGREES (0x394bb8)
    +
    +

    +Evaluates to 180 / pi in fixed point notation.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_SQRTI_ARG_10_PERCENT

    +
    #define             COGL_SQRTI_ARG_10_PERCENT
    +

    +Maximum argument that can be passed to cogl_sqrti() for which the +resulting error is < 10%

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_SQRTI_ARG_5_PERCENT

    +
    #define             COGL_SQRTI_ARG_5_PERCENT
    +

    +Maximum argument that can be passed to cogl_sqrti() for which the +resulting error is < 5%

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_SQRTI_ARG_MAX

    +
    #define             COGL_SQRTI_ARG_MAX
    +

    +Maximum argument that can be passed to cogl_sqrti() function.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_sqrti ()

    +
    gint                cogl_sqrti                          (gint x);
    +

    +Very fast fixed point implementation of square root for integers. +

    +

    +This function is at least 6x faster than clib sqrt() on x86, and (this is +not a typo!) about 500x faster on ARM without FPU. It's error is < 5% +for arguments < COGL_SQRTI_ARG_5_PERCENT and < 10% for arguments < +COGL_SQRTI_ARG_10_PERCENT. The maximum argument that can be passed to +this function is COGL_SQRTI_ARG_MAX.

    +

    + +

    +
    ++ + + + + + + + + + +

    x :

    integer value +

    Returns :

    integer square root. + + +
    +

    Since 0.2 +

    +
    +
    +
    +

    cogl_fixed_atan2 ()

    +
    CoglFixed           cogl_fixed_atan2                    (CoglFixed a,
    +                                                         CoglFixed b);
    +

    +Computes the arc tangent of a / b but uses the sign of both +arguments to return the angle in right quadrant.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    a :

    the numerator as a CoglFixed number +

    b :

    the denominator as a CoglFixed number +

    Returns :

    the arc tangent of the passed fraction, in fixed point + notation + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_fixed_atani ()

    +
    CoglFixed           cogl_fixed_atani                    (CoglFixed a);
    +

    +Computes the arc tangent of a.

    +

    + +

    +
    ++ + + + + + + + + + +

    a :

    a CoglFixed number +

    Returns :

    the arc tangent of the passed value, in fixed point notation + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_fixed_cos ()

    +
    CoglFixed           cogl_fixed_cos                      (CoglFixed angle);
    +

    +Computes the cosine of angle.

    +

    + +

    +
    ++ + + + + + + + + + +

    angle :

    a CoglFixed number +

    Returns :

    the cosine of the passed angle, in fixed point notation + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_fixed_log2 ()

    +
    CoglFixed           cogl_fixed_log2                     (guint x);
    +

    +Calculates base 2 logarithm. +

    +

    +This function is some 2.5 times faster on x86, and over 12 times faster on +fpu-less arm, than using libc log().

    +

    + +

    +
    ++ + + + + + + + + + +

    x :

    value to calculate base 2 logarithm from +

    Returns :

    base 2 logarithm. + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_fixed_pow ()

    +
    guint               cogl_fixed_pow                      (guint x,
    +                                                         CoglFixed y);
    +

    +Calculates x to the y power.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    x :

    base +

    y :

    CoglFixed exponent +

    Returns :

    the power of x to the y + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_fixed_pow2 ()

    +
    guint               cogl_fixed_pow2                     (CoglFixed x);
    +

    +Calculates 2 to the x power. +

    +

    +This function is around 11 times faster on x86, and around 22 times faster +on fpu-less arm than libc pow(2, x).

    +

    + +

    +
    ++ + + + + + + + + + +

    x :

    a CoglFixed number +

    Returns :

    the power of 2 to the passed value + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_fixed_sin ()

    +
    CoglFixed           cogl_fixed_sin                      (CoglFixed angle);
    +

    +Computes the sine of angle.

    +

    + +

    +
    ++ + + + + + + + + + +

    angle :

    a CoglFixed number +

    Returns :

    the sine of the passed angle, in fixed point notation + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_fixed_sqrt ()

    +
    CoglFixed           cogl_fixed_sqrt                     (CoglFixed x);
    +

    +Computes the square root of x.

    +

    + +

    +
    ++ + + + + + + + + + +

    x :

    a CoglFixed number +

    Returns :

    the square root of the passed value, in floating point + notation + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_fixed_tan ()

    +
    CoglFixed           cogl_fixed_tan                      (CoglFixed angle);
    +

    +Computes the tangent of angle.

    +

    + +

    +
    ++ + + + + + + + + + +

    angle :

    a CoglFixed number +

    Returns :

    the tangent of the passed angle, in fixed point notation + +
    +

    Since 1.0 +

    +
    +
    +
    +

    CoglAngle

    +
    typedef gint32 CoglAngle;
    +
    +

    +Integer representation of an angle such that 1024 corresponds to +full circle (i.e., 2 * pi).

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_ANGLE_FROM_DEG()

    +
    #define COGL_ANGLE_FROM_DEG(x)  (COGL_FLOAT_TO_INT (((float)(x) * 1024.0f) / 360.0f))
    +
    +

    +Converts an angle in degrees into a CoglAngle.

    +

    + +

    +
    ++ + + + +

    x :

    an angle in degrees in floating point notation +
    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_ANGLE_FROM_DEGX()

    +
    #define COGL_ANGLE_FROM_DEGX(x) (COGL_FIXED_TO_INT ((((x) / 360) * 1024) + COGL_FIXED_0_5))
    +
    +

    +Converts an angle in degrees into a CoglAngle.

    +

    + +

    +
    ++ + + + +

    x :

    an angle in degrees in fixed point notation +
    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_ANGLE_TO_DEG()

    +
    #define COGL_ANGLE_TO_DEG(x)    (((float)(x) * 360.0) / 1024.0)
    +
    +

    +Converts a CoglAngle into an angle in degrees, using floatint point +notation.

    +

    + +

    +
    ++ + + + +

    x :

    a CoglAngle +
    +

    Since 1.0 +

    +
    +
    +
    +

    COGL_ANGLE_TO_DEGX()

    +
    #define COGL_ANGLE_TO_DEGX(x)   (COGL_FIXED_FROM_INT ((x) * 45) / 128)
    +
    +

    +Converts a CoglAngle into an angle in degrees, using fixed point notation

    +

    + +

    +
    ++ + + + +

    x :

    a CoglAngle +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_angle_cos ()

    +
    CoglFixed           cogl_angle_cos                      (CoglAngle angle);
    +

    +Computes the cosine of angle

    +

    + +

    +
    ++ + + + + + + + + + +

    angle :

    an angle expressed using CoglAngle +

    Returns :

    the cosine of the passed angle + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_angle_sin ()

    +
    CoglFixed           cogl_angle_sin                      (CoglAngle angle);
    +

    +Computes the sine of angle

    +

    + +

    +
    ++ + + + + + + + + + +

    angle :

    an angle expressed using CoglAngle +

    Returns :

    the sine of the passed angle + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_angle_tan ()

    +
    CoglFixed           cogl_angle_tan                      (CoglAngle angle);
    +

    +Computes the tangent of angle

    +

    + +

    +
    ++ + + + + + + + + + +

    angle :

    an angle expressed using CoglAngle +

    Returns :

    the tangent of the passed angle + +
    +

    Since 1.0 +

    +
    +
    +
    + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/html/cogl-General-API.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/html/cogl-General-API.html --- clutter-0.8.4/doc/reference/cogl/html/cogl-General-API.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/html/cogl-General-API.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ General API - + @@ -20,7 +20,7 @@ Prev Up Home -COGL 0.8.4 Reference Manual +COGL 0.9.0 Reference Manual Next
    Top @@ -50,156 +50,71 @@ enum CoglPixelFormat; enum CoglBufferTarget; -void cogl_perspective (ClutterFixed fovy, - ClutterFixed aspect, - ClutterFixed z_near, - ClutterFixed z_far); -void cogl_frustum (ClutterFixed left, - ClutterFixed right, - ClutterFixed bottom, - ClutterFixed top, - ClutterFixed z_near, - ClutterFixed z_far); +void cogl_perspective (float fovy, + float aspect, + float z_near, + float z_far); +void cogl_frustum (float left, + float right, + float bottom, + float top, + float z_near, + float z_far); void cogl_setup_viewport (guint width, guint height, - ClutterFixed fovy, - ClutterFixed aspect, - ClutterFixed z_near, - ClutterFixed z_far); + float fovy, + float aspect, + float z_near, + float z_far); void cogl_viewport (guint width, guint height); -void cogl_get_modelview_matrix (ClutterFixed m[16]); -void cogl_get_projection_matrix (ClutterFixed m[16]); -void cogl_get_viewport (ClutterFixed v[4]); +void cogl_get_modelview_matrix (float m[16]); +void cogl_get_projection_matrix (float m[16]); +void cogl_get_viewport (float v[4]); void cogl_push_matrix (void); void cogl_pop_matrix (void); -void cogl_scale (ClutterFixed x, - ClutterFixed y); -void cogl_translatex (ClutterFixed x, - ClutterFixed y, - ClutterFixed z); -void cogl_translate (gint x, - gint y, - gint z); -void cogl_rotatex (ClutterFixed angle, - gint x, - gint y, - gint z); -void cogl_rotate (gint angle, - gint x, - gint y, - gint z); - -void cogl_clip_set (ClutterFixed x_offset, - ClutterFixed y_offset, - ClutterFixed width, - ClutterFixed height); +void cogl_scale (float x, + float y, + float z); +void cogl_translate (float x, + float y, + float z); +void cogl_rotate (float angle, + float x, + float y, + float z); + + CoglClipStackState; +void cogl_clip_set (float x_offset, + float y_offset, + float width, + float height); +void cogl_clip_set_from_path (void); +void cogl_clip_set_from_path_preserve (void); void cogl_clip_unset (void); void cogl_clip_stack_save (void); void cogl_clip_stack_restore (void); +void cogl_clip_ensure (void); void cogl_enable_depth_test (gboolean setting); -void cogl_alpha_func (COGLenum func, - ClutterFixed ref); -void cogl_fog_set (const ClutterColor *fog_color, - ClutterFixed density, - ClutterFixed z_near, - ClutterFixed z_far); +void cogl_enable_backface_culling (gboolean setting); +void cogl_fog_set (const CoglColor *fog_color, + float density, + float z_near, + float z_far);

    @@ -354,6 +269,108 @@

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    COGL_PIXEL_FORMAT_ANY

    Any format +

    COGL_PIXEL_FORMAT_A_8

    8 bits alpha mask +

    COGL_PIXEL_FORMAT_RGB_565

    RGB, 16 bits +

    COGL_PIXEL_FORMAT_RGBA_4444

    RGBA, 16 bits +

    COGL_PIXEL_FORMAT_RGBA_5551

    RGBA, 16 bits +

    COGL_PIXEL_FORMAT_YUV

    FIXME +

    COGL_PIXEL_FORMAT_G_8

    FIXME +

    COGL_PIXEL_FORMAT_RGB_888

    RGB, 24 bits +

    COGL_PIXEL_FORMAT_BGR_888

    BGR, 24 bits +

    COGL_PIXEL_FORMAT_RGBA_8888

    RGBA, 32 bits +

    COGL_PIXEL_FORMAT_BGRA_8888

    BGRA, 32 bits +

    COGL_PIXEL_FORMAT_ARGB_8888

    ARGB, 32 bits +

    COGL_PIXEL_FORMAT_ABGR_8888

    ABGR, 32 bits +

    COGL_PIXEL_FORMAT_RGBA_8888_PRE

    Premultiplied RGBA, 32 bits +

    COGL_PIXEL_FORMAT_BGRA_8888_PRE

    Premultiplied BGRA, 32 bits +

    COGL_PIXEL_FORMAT_ARGB_8888_PRE

    Premultiplied ARGB, 32 bits +

    COGL_PIXEL_FORMAT_ABGR_8888_PRE

    Premultiplied ABGR, 32 bits +

    COGL_PIXEL_FORMAT_RGBA_4444_PRE

    Premultiplied RGBA, 16 bits +

    COGL_PIXEL_FORMAT_RGBA_5551_PRE

    Premultiplied RGBA, 16 bits +
    +

    Since 0.8 +


    @@ -367,26 +384,40 @@ } CoglBufferTarget;

    -

    +Target flags for FBOs.

    +
    ++ + + + + + + + + + + + + + +

    COGL_WINDOW_BUFFER

    FIXME +

    COGL_MASK_BUFFER

    FIXME +

    COGL_OFFSCREEN_BUFFER

    FIXME +
    +

    Since 0.8 +


    cogl_perspective ()

    -
    void                cogl_perspective                    (ClutterFixed fovy,
    -                                                         ClutterFixed aspect,
    -                                                         ClutterFixed z_near,
    -                                                         ClutterFixed z_far);
    +
    void                cogl_perspective                    (float fovy,
    +                                                         float aspect,
    +                                                         float z_near,
    +                                                         float z_far);

    Replaces the current projection matrix with a perspective matrix based on the provided values.

    @@ -422,24 +453,12 @@

    cogl_frustum ()

    -
    void                cogl_frustum                        (ClutterFixed left,
    -                                                         ClutterFixed right,
    -                                                         ClutterFixed bottom,
    -                                                         ClutterFixed top,
    -                                                         ClutterFixed z_near,
    -                                                         ClutterFixed z_far);
    +
    void                cogl_frustum                        (float left,
    +                                                         float right,
    +                                                         float bottom,
    +                                                         float top,
    +                                                         float z_near,
    +                                                         float z_far);

    Replaces the current projection matrix with a perspective matrix for the given viewing frustum.

    @@ -493,18 +512,10 @@ guint height, - ClutterFixed fovy, - ClutterFixed aspect, - ClutterFixed z_near, - ClutterFixed z_far);
    + float fovy, + float aspect, + float z_near, + float z_far);

    Replaces the current viewport and projection matrix with the given values. The viewport is placed at the top left corner of the window @@ -586,9 +597,7 @@


    cogl_get_modelview_matrix ()

    -
    void                cogl_get_modelview_matrix           (ClutterFixed m[16]);
    +
    void                cogl_get_modelview_matrix           (float m[16]);

    Stores the current model-view matrix in m. The matrix is in column-major order.

    @@ -599,9 +608,7 @@

    m :

    - pointer to a 4x4 array of ClutterFixeds to receive the matrix + pointer to a 4x4 array of floats to receive the matrix
    @@ -609,9 +616,7 @@

    cogl_get_projection_matrix ()

    -
    void                cogl_get_projection_matrix          (ClutterFixed m[16]);
    +
    void                cogl_get_projection_matrix          (float m[16]);

    Stores the current projection matrix in m. The matrix is in column-major order.

    @@ -622,9 +627,7 @@

    m :

    - pointer to a 4x4 array of ClutterFixeds to receive the matrix + pointer to a 4x4 array of floats to receive the matrix
    @@ -632,9 +635,7 @@

    cogl_get_viewport ()

    -
    void                cogl_get_viewport                   (ClutterFixed v[4]);
    +
    void                cogl_get_viewport                   (float v[4]);

    Stores the current viewport in v. v[0] and v[1] get the x and y position of the viewport and v[2] and v[3] get the width and @@ -646,9 +647,7 @@

    v :

    - pointer to a 4 element array of ClutterFixeds to + pointer to a 4 element array of floats to receive the viewport dimensions. @@ -678,15 +677,12 @@

    cogl_scale ()

    -
    void                cogl_scale                          (ClutterFixed x,
    -                                                         ClutterFixed y);
    +
    void                cogl_scale                          (float x,
    +                                                         float y,
    +                                                         float z);

    -Multiplies the current model-view matrix by one that scales the x -and y axes by the given values.

    +Multiplies the current model-view matrix by one that scales the x, +y and z axes by the given values.

    @@ -703,43 +699,9 @@ Amount to scale along the y-axis - -
    -
    -
    -
    -

    cogl_translatex ()

    -
    void                cogl_translatex                     (ClutterFixed x,
    -                                                         ClutterFixed y,
    -                                                         ClutterFixed z);
    -

    -Multiplies the current model-view matrix by one that translates the -model along all three axes according to the given values.

    -

    - -

    -
    -- - - - - - - - - - @@ -748,19 +710,12 @@

    cogl_translate ()

    -
    void                cogl_translate                      (gint x,
    -                                                         gint y,
    -                                                         gint z);
    +
    void                cogl_translate                      (float x,
    +                                                         float y,
    +                                                         float z);

    -Integer version of cogl_translatex(). Multiplies the current -model-view matrix by one that translates the model along all three -axes according to the given values.

    +Multiplies the current model-view matrix by one that translates the +model along all three axes according to the given values.

    @@ -787,19 +742,11 @@

    -

    cogl_rotatex ()

    -
    void                cogl_rotatex                        (ClutterFixed angle,
    -                                                         gint x,
    -                                                         gint y,
    -                                                         gint z);
    +

    cogl_rotate ()

    +
    void                cogl_rotate                         (float angle,
    +                                                         float x,
    +                                                         float y,
    +                                                         float z);

    Multiplies the current model-view matrix by one that rotates the model around the vertex specified by x, y and z. The rotation @@ -837,73 +784,36 @@


    -

    cogl_rotate ()

    -
    void                cogl_rotate                         (gint angle,
    -                                                         gint x,
    -                                                         gint y,
    -                                                         gint z);
    -

    -Integer version of cogl_rotatex(). Multiplies the current -model-view matrix by one that rotates the model around the vertex -specified by x, y and z.

    +

    CoglClipStackState

    +
    typedef struct {
    +  /* Stack of stacks */
    +  GSList *stacks;
    +
    +  gboolean stack_dirty;
    +  gboolean stencil_used;
    +} CoglClipStackState;
    +

    -

    x :

    Distance to translate along the x-axis -

    y :

    Distance to translate along the y-axis -

    z :

    Distance to translate along the z-axis + Amount to scale along the z-axis
    -- - - - - - - - - - - - - - - - - - -

    angle :

    Angle in degrees to rotate. -

    x :

    X-component of vertex to rotate around. -

    y :

    Y-component of vertex to rotate around. -

    z :

    Z-component of vertex to rotate around. -

    cogl_clip_set ()

    -
    void                cogl_clip_set                       (ClutterFixed x_offset,
    -                                                         ClutterFixed y_offset,
    -                                                         ClutterFixed width,
    -                                                         ClutterFixed height);
    +
    void                cogl_clip_set                       (float x_offset,
    +                                                         float y_offset,
    +                                                         float width,
    +                                                         float height);

    Specifies a rectangular clipping area for all subsequent drawing operations. Any drawing commands that extend outside the rectangle will be clipped so that only the portion inside the rectangle will be displayed. The rectangle dimensions are transformed by the -current model-view matrix.

    +current model-view matrix. +

    +

    +The rectangle is intersected with the current clip region. To undo +the effect of this function, call cogl_clip_unset().

    @@ -935,11 +845,41 @@

    +

    cogl_clip_set_from_path ()

    +
    void                cogl_clip_set_from_path             (void);
    +

    +Sets a new clipping area using the current path. The current path +is then cleared. The clipping area is intersected with the previous +clipping area. To restore the previous clipping area, call +cogl_clip_unset().

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_clip_set_from_path_preserve ()

    +
    void                cogl_clip_set_from_path_preserve    (void);
    +

    +Sets a new clipping area using the current path. The current path +is then cleared. The clipping area is intersected with the previous +clipping area. To restore the previous clipping area, call +cogl_clip_unset().

    +

    + +

    +

    Since 1.0 +

    +
    +
    +

    cogl_clip_unset ()

    void                cogl_clip_unset                     (void);

    -Removes the current clipping rectangle so that all drawing -operations extend to full size of the viewport again.

    +Reverts the clipping region to the state before the last call to +cogl_clip_set().

    @@ -975,6 +915,21 @@

    +

    cogl_clip_ensure ()

    +
    void                cogl_clip_ensure                    (void);
    +

    +Ensures that the current clipping region has been set in GL. This +will automatically be called before any Cogl primitives but it +maybe be neccessary to call if you are using raw GL calls with +clipping.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +

    cogl_enable_depth_test ()

    void                cogl_enable_depth_test              (
     
    -

    cogl_alpha_func ()

    -
    void                cogl_alpha_func                     (COGLenum func,
    -                                                         ClutterFixed ref);
    +

    cogl_enable_backface_culling ()

    +
    void                cogl_enable_backface_culling        (gboolean setting);

    -Changes the alpha test to use the specified function specified in func, -comparing with the value in ref. The default function is CGL_ALWAYS the -initial reference value is 1.0.

    +Sets whether textures positioned so that their backface is showing +should be hidden. This can be used to efficiently draw two-sided +textures or fully closed cubes without enabling depth testing. Only +calls to cogl_texture_rectangle() and cogl_texture_polygon() are +affected. Backface culling is disabled by default.

    - - - - - - - - + + - - +

    func :

    the comparison function to use, one of CGL_NEVER, CGL_LESS, -CGL_EQUAL, CGL_LEQUAL, CGL_GREATER, CGL_NOTEQUAL, CGL_GEQUAL and GL_ALWAYS. -

    ref :

    reference value. +

    setting :

    TRUE to enable backface culling or FALSE to disable.

    cogl_fog_set ()

    -
    void                cogl_fog_set                        (const ClutterColor *fog_color,
    -                                                         ClutterFixed density,
    -                                                         ClutterFixed z_near,
    -                                                         ClutterFixed z_far);
    +
    void                cogl_fog_set                        (const CoglColor *fog_color,
    +                                                         float density,
    +                                                         float z_near,
    +                                                         float z_far);

    Enables fogging. Fogging causes vertices that are further away from the eye to be rendered with a different color. The color is diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/html/cogl-Materials.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/html/cogl-Materials.html --- clutter-0.8.4/doc/reference/cogl/html/cogl-Materials.html 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/cogl/html/cogl-Materials.html 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,1988 @@ + + + + +Materials + + + + + + + + + + + + + + + + + + + + + + +

    +
    +
    + + +
    +

    Materials

    +

    Materials — Fuctions for creating and manipulating materials

    +
    +
    +

    Synopsis

    +
    +                    CoglMaterial;
    +enum                CoglMaterialFlags;
    +CoglHandle          cogl_material_new                   (void);
    +CoglHandle          cogl_material_ref                   (CoglHandle handle);
    +void                cogl_material_unref                 (CoglHandle handle);
    +void                cogl_material_set_ambient           (CoglHandle material,
    +                                                         const CoglColor *ambient);
    +void                cogl_material_get_ambient           (CoglHandle handle,
    +                                                         CoglColor *ambient);
    +void                cogl_material_set_ambient_and_diffuse
    +                                                        (CoglHandle material,
    +                                                         const CoglColor *color);
    +void                cogl_material_set_color             (CoglHandle material,
    +                                                         const CoglColor *color);
    +void                cogl_material_set_color4ub          (CoglHandle handle,
    +                                                         guint8 red,
    +                                                         guint8 green,
    +                                                         guint8 blue,
    +                                                         guint8 alpha);
    +void                cogl_material_get_color             (CoglHandle handle,
    +                                                         CoglColor *color);
    +void                cogl_material_set_diffuse           (CoglHandle material,
    +                                                         const CoglColor *diffuse);
    +void                cogl_material_get_diffuse           (CoglHandle handle,
    +                                                         CoglColor *diffuse);
    +void                cogl_material_set_emission          (CoglHandle material,
    +                                                         const CoglColor *emission);
    +void                cogl_material_get_emission          (CoglHandle handle,
    +                                                         CoglColor *emission);
    +void                cogl_material_set_specular          (CoglHandle material,
    +                                                         const CoglColor *specular);
    +void                cogl_material_get_specular          (CoglHandle handle,
    +                                                         CoglColor *specular);
    +void                cogl_material_set_shininess         (CoglHandle material,
    +                                                         float shininess);
    +float               cogl_material_get_shininess         (CoglHandle handle);
    +void                cogl_set_source                     (CoglHandle material);
    +enum                CoglMaterialAlphaFunc;
    +void                cogl_material_set_alpha_test_function
    +                                                        (CoglHandle material,
    +                                                         CoglMaterialAlphaFunc alpha_func,
    +                                                         float alpha_reference);
    +enum                CoglMaterialBlendFactor;
    +void                cogl_material_set_blend_factors     (CoglHandle material,
    +                                                         CoglMaterialBlendFactor src_factor,
    +                                                         CoglMaterialBlendFactor dst_factor);
    +                    CoglMaterialLayer;
    +void                cogl_material_set_layer             (CoglHandle material,
    +                                                         gint layer_index,
    +                                                         CoglHandle texture);
    +void                cogl_material_remove_layer          (CoglHandle material,
    +                                                         gint layer_index);
    +enum                CoglMaterialLayerCombineFunc;
    +void                cogl_material_set_layer_combine_function
    +                                                        (CoglHandle material,
    +                                                         gint layer_index,
    +                                                         CoglMaterialLayerCombineChannels channels,
    +                                                         CoglMaterialLayerCombineFunc func);
    +enum                CoglMaterialLayerCombineChannels;
    +enum                CoglMaterialLayerCombineSrc;
    +void                cogl_material_set_layer_combine_arg_src
    +                                                        (CoglHandle material,
    +                                                         gint layer_index,
    +                                                         gint argument,
    +                                                         CoglMaterialLayerCombineChannels channels,
    +                                                         CoglMaterialLayerCombineSrc src);
    +enum                CoglMaterialLayerCombineOp;
    +void                cogl_material_set_layer_combine_arg_op
    +                                                        (CoglHandle material,
    +                                                         gint layer_index,
    +                                                         gint argument,
    +                                                         CoglMaterialLayerCombineChannels channels,
    +                                                         CoglMaterialLayerCombineOp op);
    +void                cogl_material_set_layer_matrix      (CoglHandle material,
    +                                                         gint layer_index,
    +                                                         CoglMatrix *matrix);
    +void                cogl_material_set_layer_alpha_combine
    +                                                        ();
    +void                cogl_material_set_layer_rgb_combine ();
    +gulong              cogl_material_get_cogl_enable_flags (CoglHandle handle);
    +enum                CoglMaterialFlushOption;
    +void                cogl_material_flush_gl_state        (CoglHandle material,
    +                                                         ...);
    +const GList*        cogl_material_get_layers            (CoglHandle material_handle);
    +enum                CoglMaterialLayerType;
    +CoglMaterialLayerType cogl_material_layer_get_type      (CoglHandle layer_handle);
    +enum                CoglMaterialLayerFlags;
    +gulong              cogl_material_layer_get_flags       (CoglHandle layer_handle);
    +CoglHandle          cogl_material_layer_get_texture     (CoglHandle layer_handle);
    +
    +
    +
    +

    Description

    +

    +COGL allows creating and manipulating materials used to fill in +geometry. Materials may simply be lighting attributes (such as an +ambient and diffuse colour) or might represent one or more textures +blended together.

    +

    + +

    +
    +
    +

    Details

    +
    +

    CoglMaterial

    +
    typedef struct {
    +  guint     ref_count;
    +
    +  gulong    flags;
    +
    +  /* If no lighting is enabled; this is the basic material color */
    +  GLfloat   unlit[4];
    +
    +  /* Standard OpenGL lighting model attributes */
    +  GLfloat   ambient[4];
    +  GLfloat   diffuse[4];
    +  GLfloat   specular[4];
    +  GLfloat   emission[4];
    +  GLfloat   shininess;
    +
    +  /* Determines what fragments are discarded based on their alpha */
    +  CoglMaterialAlphaFunc alpha_func;
    +  GLfloat		alpha_func_reference;
    +
    +  /* Determines how this material is blended with other primitives */
    +  CoglMaterialBlendFactor blend_src_factor;
    +  CoglMaterialBlendFactor blend_dst_factor;
    +
    +  GList	   *layers;
    +} CoglMaterial;
    +
    +

    + +

    +
    +
    +
    +

    enum CoglMaterialFlags

    +
    typedef enum _CoglMaterialFlags
    +{
    +  COGL_MATERIAL_FLAG_ENABLE_BLEND	    = 1L<<0,
    +  COGL_MATERIAL_FLAG_SHOWN_SAMPLER_WARNING  = 1L<<1,
    +  COGL_MATERIAL_FLAG_DIRTY	            = 1L<<2,
    +  COGL_MATERIAL_FLAG_LAYERS_DIRTY	    = 1L<<3,
    +  COGL_MATERIAL_FLAG_DEFAULT_COLOR          = 1L<<4,
    +  COGL_MATERIAL_FLAG_DEFAULT_GL_MATERIAL    = 1L<<5,
    +  COGL_MATERIAL_FLAG_DEFAULT_ALPHA_FUNC     = 1L<<6,
    +  COGL_MATERIAL_FLAG_DEFAULT_BLEND_FUNC     = 1L<<7
    +} CoglMaterialFlags;
    +
    +

    + +

    +
    +
    +
    +

    cogl_material_new ()

    +
    CoglHandle          cogl_material_new                   (void);
    +

    +Allocates and initializes a blank white material

    +

    + +

    +
    ++ + + + +

    Returns :

    a handle to the new material +
    +
    +
    +
    +

    cogl_material_ref ()

    +
    CoglHandle          cogl_material_ref                   (CoglHandle handle);
    +

    +Increment the reference count for a cogl material.

    +

    + +

    +
    ++ + + + + + + + + + +

    handle :

    a CoglHandle. +

    Returns :

    the handle. + +Since 1.0 +
    +
    +
    +
    +

    cogl_material_unref ()

    +
    void                cogl_material_unref                 (CoglHandle handle);
    +

    +Decrement the reference count for a cogl material. +

    +

    +Since 1.0

    +

    + +

    +
    ++ + + + +

    handle :

    a CoglHandle. +
    +
    +
    +
    +

    cogl_material_set_ambient ()

    +
    void                cogl_material_set_ambient           (CoglHandle material,
    +                                                         const CoglColor *ambient);
    +

    +Exposing the standard OpenGL lighting model; this function sets +the material's ambient color. The ambient color affects the overall +color of the object. Since the diffuse color will be intense when +the light hits the surface directly, the ambient will most aparent +where the light hits at a slant. +

    +

    +The default value is (0.2, 0.2, 0.2, 1.0) +

    +

    +Since 1.0

    +

    + +

    +
    ++ + + + + + + + + + +

    material :

    A CoglMaterial object +

    ambient :

    The components of the desired ambient color +
    +
    +
    +
    +

    cogl_material_get_ambient ()

    +
    void                cogl_material_get_ambient           (CoglHandle handle,
    +                                                         CoglColor *ambient);
    +

    +This retrieves the materials current ambient color. +

    +

    +Since 1.0

    +

    + +

    +
    ++ + + + + + + + + + +

    handle :

    +

    ambient :

    The location to store the ambient color +
    +
    +
    +
    +

    cogl_material_set_ambient_and_diffuse ()

    +
    void                cogl_material_set_ambient_and_diffuse
    +                                                        (CoglHandle material,
    +                                                         const CoglColor *color);
    +

    +This is a convenience for setting the diffuse and ambient color +of the material at the same time. +

    +

    +The default ambient color is (0.2, 0.2, 0.2, 1.0) +The default diffuse color is (0.8, 0.8, 0.8, 1.0) +

    +

    +Since 1.0

    +

    + +

    +
    ++ + + + + + + + + + +

    material :

    A CoglMaterial object +

    color :

    The components of the desired ambient and diffuse colors +
    +
    +
    +
    +

    cogl_material_set_color ()

    +
    void                cogl_material_set_color             (CoglHandle material,
    +                                                         const CoglColor *color);
    +

    +This is the basic color of the material, used when no lighting is enabled. +

    +

    +The default value is (1.0, 1.0, 1.0, 1.0) +

    +

    +Since 1.0

    +

    + +

    +
    ++ + + + + + + + + + +

    material :

    A CoglMaterial object +

    color :

    + + +
    +
    +
    +
    +

    cogl_material_set_color4ub ()

    +
    void                cogl_material_set_color4ub          (CoglHandle handle,
    +                                                         guint8 red,
    +                                                         guint8 green,
    +                                                         guint8 blue,
    +                                                         guint8 alpha);
    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + +

    handle :

    +

    red :

    +

    green :

    +

    blue :

    +

    alpha :

    + + +
    +
    +
    +
    +

    cogl_material_get_color ()

    +
    void                cogl_material_get_color             (CoglHandle handle,
    +                                                         CoglColor *color);
    +

    +This retrieves the current material color. +

    +

    +Since 1.0

    +

    + +

    +
    ++ + + + + + + + + + +

    handle :

    +

    color :

    The location to store the color +
    +
    +
    +
    +

    cogl_material_set_diffuse ()

    +
    void                cogl_material_set_diffuse           (CoglHandle material,
    +                                                         const CoglColor *diffuse);
    +

    +Exposing the standard OpenGL lighting model; this function sets +the material's diffuse color. The diffuse color is most intense +where the light hits the surface directly; perpendicular to the +surface. +

    +

    +The default value is (0.8, 0.8, 0.8, 1.0) +

    +

    +Since 1.0

    +

    + +

    +
    ++ + + + + + + + + + +

    material :

    A CoglMaterial object +

    diffuse :

    The components of the desired diffuse color +
    +
    +
    +
    +

    cogl_material_get_diffuse ()

    +
    void                cogl_material_get_diffuse           (CoglHandle handle,
    +                                                         CoglColor *diffuse);
    +

    +This retrieves the materials current diffuse color. +

    +

    +Since 1.0

    +

    + +

    +
    ++ + + + + + + + + + +

    handle :

    +

    diffuse :

    The location to store the diffuse color +
    +
    +
    +
    +

    cogl_material_set_emission ()

    +
    void                cogl_material_set_emission          (CoglHandle material,
    +                                                         const CoglColor *emission);
    +

    +Exposing the standard OpenGL lighting model; this function sets +the material's emissive color. It will look like the surface is +a light source emitting this color. +

    +

    +The default value is (0.0, 0.0, 0.0, 1.0) +

    +

    +Since 1.0

    +

    + +

    +
    ++ + + + + + + + + + +

    material :

    A CoglMaterial object +

    emission :

    The components of the desired emissive color +
    +
    +
    +
    +

    cogl_material_get_emission ()

    +
    void                cogl_material_get_emission          (CoglHandle handle,
    +                                                         CoglColor *emission);
    +

    +This retrieves the materials current emission color. +

    +

    +Since 1.0

    +

    + +

    +
    ++ + + + + + + + + + +

    handle :

    +

    emission :

    The location to store the emission color +
    +
    +
    +
    +

    cogl_material_set_specular ()

    +
    void                cogl_material_set_specular          (CoglHandle material,
    +                                                         const CoglColor *specular);
    +

    +Exposing the standard OpenGL lighting model; this function sets +the material's specular color. The intensity of the specular color +depends on the viewport position, and is brightest along the lines +of reflection. +

    +

    +The default value is (0.0, 0.0, 0.0, 1.0) +

    +

    +Since 1.0

    +

    + +

    +
    ++ + + + + + + + + + +

    material :

    A CoglMaterial object +

    specular :

    The components of the desired specular color +
    +
    +
    +
    +

    cogl_material_get_specular ()

    +
    void                cogl_material_get_specular          (CoglHandle handle,
    +                                                         CoglColor *specular);
    +

    +This retrieves the materials current specular color. +

    +

    +Since 1.0

    +

    + +

    +
    ++ + + + + + + + + + +

    handle :

    +

    specular :

    The location to store the specular color +
    +
    +
    +
    +

    cogl_material_set_shininess ()

    +
    void                cogl_material_set_shininess         (CoglHandle material,
    +                                                         float shininess);
    +

    +This function sets the materials shininess which determines how +specular highlights are calculated. A higher shininess will produce +smaller brigher highlights. +

    +

    +The default value is 0.0 +

    +

    +Since 1.0

    +

    + +

    +
    ++ + + + + + + + + + +

    material :

    A CoglMaterial object +shininess: The desired shininess; range: [0.0, 1.0] +

    shininess :

    + + +
    +
    +
    +
    +

    cogl_material_get_shininess ()

    +
    float               cogl_material_get_shininess         (CoglHandle handle);
    +

    +This retrieves the materials current emission color.

    +

    + +

    +
    ++ + + + + + + + + + +

    handle :

    +

    Returns :

    The materials current shininess value + +Since 1.0 +
    +
    +
    +
    +

    cogl_set_source ()

    +
    void                cogl_set_source                     (CoglHandle material);
    +

    +This function sets the source material that will be used to fill +subsequent geometry emitted via the cogl API. +

    +

    +Note: in the future we may add the ability to set a front facing +material, and a back facing material, in which case this function +will set both to the same. +

    +

    +Since 1.0

    +

    + +

    +
    ++ + + + +

    material :

    A CoglMaterial object +
    +
    +
    +
    +

    enum CoglMaterialAlphaFunc

    +
    typedef enum _CoglMaterialAlphaFunc
    +{
    +  COGL_MATERIAL_ALPHA_FUNC_NEVER    = GL_NEVER,
    +  COGL_MATERIAL_ALPHA_FUNC_LESS	    = GL_LESS,
    +  COGL_MATERIAL_ALPHA_FUNC_EQUAL    = GL_EQUAL,
    +  COGL_MATERIAL_ALPHA_FUNC_LEQUAL   = GL_LEQUAL,
    +  COGL_MATERIAL_ALPHA_FUNC_GREATER  = GL_GREATER,
    +  COGL_MATERIAL_ALPHA_FUNC_NOTEQUAL = GL_NOTEQUAL,
    +  COGL_MATERIAL_ALPHA_FUNC_GEQUAL   = GL_GEQUAL,
    +  COGL_MATERIAL_ALPHA_FUNC_ALWAYS   = GL_ALWAYS
    +} CoglMaterialAlphaFunc;
    +
    +

    +Alpha testing happens before blending primitives with the framebuffer and +gives an opportunity to discard fragments based on a comparison with the +incoming alpha value and a reference alpha value. The CoglMaterialAlphaFunc +determines how the comparison is done.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    COGL_MATERIAL_ALPHA_FUNC_NEVER

    Never let the fragment through. +

    COGL_MATERIAL_ALPHA_FUNC_LESS

    Let the fragment through if the incoming + alpha value is less than the reference alpha + value. +

    COGL_MATERIAL_ALPHA_FUNC_EQUAL

    Let the fragment through if the incoming + alpha value equals the reference alpha + value. +

    COGL_MATERIAL_ALPHA_FUNC_LEQUAL

    Let the fragment through if the incoming + alpha value is less than or equal to the + reference alpha value. +

    COGL_MATERIAL_ALPHA_FUNC_GREATER

    Let the fragment through if the incoming + alpha value is greater than the reference + alpha value. +

    COGL_MATERIAL_ALPHA_FUNC_NOTEQUAL

    Let the fragment through if the incoming + alpha value does not equal the reference + alpha value. +

    COGL_MATERIAL_ALPHA_FUNC_GEQUAL

    Let the fragment through if the incoming + alpha value is greater than or equal to the + reference alpha value. +

    COGL_MATERIAL_ALPHA_FUNC_ALWAYS

    Always let the fragment through. +
    +
    +
    +
    +

    cogl_material_set_alpha_test_function ()

    +
    void                cogl_material_set_alpha_test_function
    +                                                        (CoglHandle material,
    +                                                         CoglMaterialAlphaFunc alpha_func,
    +                                                         float alpha_reference);
    +

    +Before a primitive is blended with the framebuffer, it goes through an +alpha test stage which lets you discard fragments based on the current +alpha value. This function lets you change the function used to evaluate +the alpha channel, and thus determine which fragments are discarded +and which continue on to the blending stage. +

    +

    +The default is COGL_MATERIAL_ALPHA_FUNC_ALWAYS +

    +

    +Since 1.0

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    material :

    A CoglMaterial object +

    alpha_func :

    A CoglMaterialAlphaFunc constant +

    alpha_reference :

    A reference point that the chosen alpha function uses + to compare incoming fragments to. +
    +
    +
    +
    +

    enum CoglMaterialBlendFactor

    +
    typedef enum _CoglMaterialBlendFactor
    +{
    +  COGL_MATERIAL_BLEND_FACTOR_ZERO		  = GL_ZERO,
    +  COGL_MATERIAL_BLEND_FACTOR_ONE		  = GL_ONE,
    +  COGL_MATERIAL_BLEND_FACTOR_SRC_COLOR		  = GL_SRC_COLOR,
    +  COGL_MATERIAL_BLEND_FACTOR_DST_COLOR		  = GL_DST_COLOR,
    +  COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_SRC_COLOR  = GL_ONE_MINUS_SRC_COLOR,
    +  COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_DST_COLOR  = GL_ONE_MINUS_DST_COLOR,
    +  COGL_MATERIAL_BLEND_FACTOR_SRC_ALPHA		  = GL_SRC_ALPHA,
    +  COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA  = GL_ONE_MINUS_SRC_ALPHA,
    +  COGL_MATERIAL_BLEND_FACTOR_DST_ALPHA		  = GL_DST_ALPHA,
    +  COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_DST_ALPHA  = GL_ONE_MINUS_DST_ALPHA,
    +  COGL_MATERIAL_BLEND_FACTOR_SRC_ALPHA_SATURATE	  = GL_SRC_ALPHA_SATURATE,
    +} CoglMaterialBlendFactor;
    +
    +

    +Blending occurs after the alpha test function, and combines fragments with +the framebuffer. +

    +

    +A fixed function is used to determine the blended color, which is based on +the incoming source color of your fragment (Rs, Gs, Bs, As), a source +factor (Sr, Sg, Sb, Sa), a destination color (Rd, Rg, Rb, Ra) and +a destination factor (Dr, Dg, Db, Da), and is given by these equations: +

    +

    +

    +
    +R = Rs*Sr + Rd*Dr
    +G = Gs*Sg + Gd*Dg
    +B = Bs*Sb + Bd*Db
    +A = As*Sa + Ad*Da
    +
    +

    +

    +

    +All factors have a range [0, 1] +

    +

    +The factors are selected with the following constants:

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    COGL_MATERIAL_BLEND_FACTOR_ZERO

    (0, 0, 0, 0) +

    COGL_MATERIAL_BLEND_FACTOR_ONE

    (1, 1, 1, 1) +

    COGL_MATERIAL_BLEND_FACTOR_SRC_COLOR

    (Rs, Gs, Bs, As) +

    COGL_MATERIAL_BLEND_FACTOR_DST_COLOR

    (Rd, Gd, Bd, Ad) +

    COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_SRC_COLOR

    (1-Rs, 1-Gs, 1-Bs, 1-As) +

    COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_DST_COLOR

    (1-Rd, 1-Gd, 1-Bd, 1-Ad) +

    COGL_MATERIAL_BLEND_FACTOR_SRC_ALPHA

    (As, As, As, As) +

    COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA

    (1-As, 1-As, 1-As, 1-As) +

    COGL_MATERIAL_BLEND_FACTOR_DST_ALPHA

    (Ad, Ad, Ad, Ad) +

    COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_DST_ALPHA

    (1-Ad, 1-Ad, 1-Ad, 1-Ad) +

    COGL_MATERIAL_BLEND_FACTOR_SRC_ALPHA_SATURATE

    (f,f,f,1) where f=MIN(As,1-Ad) +
    +
    +
    +
    +

    cogl_material_set_blend_factors ()

    +
    void                cogl_material_set_blend_factors     (CoglHandle material,
    +                                                         CoglMaterialBlendFactor src_factor,
    +                                                         CoglMaterialBlendFactor dst_factor);
    +

    +This function lets you control how primitives using this material will get +blended with the contents of your framebuffer. The blended RGBA components +are calculated like this: +

    +

    +(RsSr+RdDr, GsSg+GdDg, BsSb+BsSb, AsSa+AdDa) +

    +

    +Where (Rs,Gs,Bs,As) represents your source - material- color, +(Rd,Gd,Bd,Ad) represents your destination - framebuffer - color, +(Sr,Sg,Sb,Sa) represents your source blend factor and +(Dr,Dg,Db,Da) represents you destination blend factor. +

    +

    +All factors lie in the range [0,1] and incoming color components are also +normalized to the range [0,1] +

    +

    +Since 1.0

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    material :

    A CoglMaterial object +

    src_factor :

    Chooses the CoglMaterialBlendFactor you want plugged in to +the blend equation. +

    dst_factor :

    Chooses the CoglMaterialBlendFactor you want plugged in to +the blend equation. +
    +
    +
    +
    +

    CoglMaterialLayer

    +
    typedef struct {
    +  guint	       ref_count;
    +  guint	       index;	/*!< lowest index is blended first then others
    +			     on top */
    +  gulong       flags;
    +  CoglHandle   texture;	/*!< The texture for this layer, or COGL_INVALID_HANDLE
    +			     for an empty layer */
    +
    +  /* Determines how the color of individual texture fragments
    +   * are calculated. */
    +  CoglMaterialLayerCombineFunc texture_combine_rgb_func;
    +  CoglMaterialLayerCombineSrc texture_combine_rgb_src[3];
    +  CoglMaterialLayerCombineOp texture_combine_rgb_op[3];
    +
    +  CoglMaterialLayerCombineFunc texture_combine_alpha_func;
    +  CoglMaterialLayerCombineSrc texture_combine_alpha_src[3];
    +  CoglMaterialLayerCombineOp texture_combine_alpha_op[3];
    +
    +  /* TODO: Support purely GLSL based material layers */
    +
    +  CoglMatrix matrix;
    +} CoglMaterialLayer;
    +
    +

    + +

    +
    +
    +
    +

    cogl_material_set_layer ()

    +
    void                cogl_material_set_layer             (CoglHandle material,
    +                                                         gint layer_index,
    +                                                         CoglHandle texture);
    +

    +In addition to the standard OpenGL lighting model a Cogl material may have +one or more layers comprised of textures that can be blended together in +order, with a number of different texture combine modes. This function +defines a new texture layer. +

    +

    +The index values of multiple layers do not have to be consecutive; it is +only their relative order that is important. +

    +

    +XXX: In the future, we may define other types of material layers, such +as purely GLSL based layers. +

    +

    +Since 1.0

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    material :

    A CoglMaterial object +

    layer_index :

    +

    texture :

    + + +
    +
    +
    +
    +

    cogl_material_remove_layer ()

    +
    void                cogl_material_remove_layer          (CoglHandle material,
    +                                                         gint layer_index);
    +

    + +

    +
    ++ + + + + + + + + + +

    material :

    +

    layer_index :

    + + +
    +
    +
    +
    +

    enum CoglMaterialLayerCombineFunc

    +
    typedef enum _CoglMaterialLayerCombineFunc
    +{
    +  COGL_MATERIAL_LAYER_COMBINE_FUNC_REPLACE    = GL_REPLACE,
    +  COGL_MATERIAL_LAYER_COMBINE_FUNC_MODULATE   = GL_MODULATE,
    +  COGL_MATERIAL_LAYER_COMBINE_FUNC_ADD	      = GL_ADD,
    +  COGL_MATERIAL_LAYER_COMBINE_FUNC_ADD_SIGNED = GL_ADD_SIGNED,
    +  COGL_MATERIAL_LAYER_COMBINE_FUNC_INTERPOLATE = GL_INTERPOLATE,
    +  COGL_MATERIAL_LAYER_COMBINE_FUNC_SUBTRACT   = GL_SUBTRACT,
    +  COGL_MATERIAL_LAYER_COMBINE_FUNC_DOT3_RGB   = GL_DOT3_RGB,
    +  COGL_MATERIAL_LAYER_COMBINE_FUNC_DOT3_RGBA  = GL_DOT3_RGBA
    +} CoglMaterialLayerCombineFunc;
    +
    +

    +A material may comprise of 1 or more layers that can be combined using a +number of different functions. By default layers are modulated, which is +to say the components of the current source layer S are simply multipled +together with the combined results of the previous layer P like this: +

    +

    +

    +
    +(Rs*Rp, Gs*Gp, Bs*Bp, As*Ap)
    +
    +

    +

    +

    +For more advanced techniques, Cogl exposes the fixed function texture +combining capabilities of your GPU to give you greater control.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    COGL_MATERIAL_LAYER_COMBINE_FUNC_REPLACE

    Arg0 +

    COGL_MATERIAL_LAYER_COMBINE_FUNC_MODULATE

    Arg0 x Arg1 +

    COGL_MATERIAL_LAYER_COMBINE_FUNC_ADD

    Arg0 + Arg1 +

    COGL_MATERIAL_LAYER_COMBINE_FUNC_ADD_SIGNED

    Arg0 + Arg1 - 0.5 +

    COGL_MATERIAL_LAYER_COMBINE_FUNC_INTERPOLATE

    Arg0 x Arg + Arg1 x (1-Arg2) +

    COGL_MATERIAL_LAYER_COMBINE_FUNC_SUBTRACT

    Arg0 - Arg1 +

    COGL_MATERIAL_LAYER_COMBINE_FUNC_DOT3_RGB

    4 x ((Arg0r - 0.5) x (Arg1r - 0.5)) + +

    COGL_MATERIAL_LAYER_COMBINE_FUNC_DOT3_RGBA

    ((Arg0b - 0.5) x (Arg1b - 0.5)) + +
    +
    +
    +
    +

    cogl_material_set_layer_combine_function ()

    +
    void                cogl_material_set_layer_combine_function
    +                                                        (CoglHandle material,
    +                                                         gint layer_index,
    +                                                         CoglMaterialLayerCombineChannels channels,
    +                                                         CoglMaterialLayerCombineFunc func);
    +

    +There are three basic steps to describing how a layer should be combined: +

    +
      +
    1. +Choose a function. +
    2. +
    3. +Specify the source color for each argument of the chosen function. (Note + the functions don't all take the same number of arguments) +
    4. +
    5. +Specify an operator for each argument that can modify the corresponding + source color before the function is applied. +
    6. +
    +

    +

    +

    +Cogl optionally lets you describe 2 seperate combine modes for a single +layer; 1 for the RGB components, and 1 for the Alpha component, so in this +case you would repeat the 3 steps for each channel selector. +

    +

    +(Note: you can't have different modes for each channel, so if you need more + control you will need to use a glsl fragment shader) +

    +

    +For example here is how you could elect to use the ADD function for all +components of layer 1 in your material: +

    +
    +//Step 1: Choose a function. Note the ADD function takes 2 arguments...
    +cogl_material_set_layer_combine_function (material,
    +                                          1,
    +                                          COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA)
    +                                          COGL_MATERIAL_LAYER_COMBINE_FUNC_ADD);
    +//Step 2: Specify the source color for the 2 ADD function arguments...
    +cogl_material_set_layer_combine_arg_src (material,
    +                                         1,//layer index
    +                                         0,//argument index
    +                                         COGL_MATERIAL_LAYER_COMBINE_SRC_PREVIOUS);
    +cogl_material_set_layer_combine_arg_src (material,
    +                                         1,//layer index
    +                                         1,//argument index
    +                                         COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA)
    +                                         COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE);
    +//Step 3: Specify the operators used to modify the arguments...
    +cogl_material_set_layer_combine_arg_op (material,
    +                                        1,//layer index
    +                                        0,//argument index
    +                                        COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA,
    +                                        COGL_MATERIAL_LAYER_COMBINE_OP_SRC_COLOR);
    +cogl_material_set_layer_combine_arg_op (material,
    +                                        1,//layer index
    +                                        1,//argument index
    +                                        COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA,
    +                                        COGL_MATERIAL_LAYER_COMBINE_OP_SRC_COLOR);
    +
    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + +

    material :

    A CoglMaterial object +

    layer_index :

    Specifies the layer whos combine mode you want to modify +

    channels :

    Specifies which channels combine mode you want to modify + (RGB, ALPHA, or RGBA) +

    func :

    Specifies the function you want to use for combining fragments + of the specified layer with the results of previously combined + layers. +
    +
    +
    +
    +

    enum CoglMaterialLayerCombineChannels

    +
    typedef enum _CoglMaterialLayerCombineChannels
    +{
    +  COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGB,
    +  COGL_MATERIAL_LAYER_COMBINE_CHANNELS_ALPHA,
    +  COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA
    +} CoglMaterialLayerCombineChannels;
    +
    +

    +Cogl optionally lets you describe 2 seperate combine modes for a single +layer; 1 for the RGB components, and 1 for the Alpha component, so in this +case you would repeat the 3 steps documented with the +cogl_material_set_layer_combine_function function for each channel +selector. +

    +

    +(Note: you can't have different modes for each channel, so if you need more + control you will need to use a glsl fragment shader)

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGB

    Modify the function or argument + src/op for the RGB components of a + layer +

    COGL_MATERIAL_LAYER_COMBINE_CHANNELS_ALPHA

    Modify the function or argument + src/op for the Alpha component of a + layer +

    COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA

    Modify the function or argument + src/op for all the components of a + layer +
    +
    +
    +
    +

    enum CoglMaterialLayerCombineSrc

    +
    typedef enum _CoglMaterialLayerCombineSrc
    +{
    +  COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE = GL_TEXTURE,
    +
    +  /* Can we find a nicer way... */
    +  COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE0 = GL_TEXTURE0,
    +  COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE1 = GL_TEXTURE1,
    +  COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE2 = GL_TEXTURE2,
    +  COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE3 = GL_TEXTURE3,
    +  COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE4 = GL_TEXTURE4,
    +  COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE5 = GL_TEXTURE5,
    +  COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE6 = GL_TEXTURE6,
    +  COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE7 = GL_TEXTURE7,
    +  /* .. who would ever need more than 8 texture layers.. :-) */
    +
    +  COGL_MATERIAL_LAYER_COMBINE_SRC_CONSTANT	= GL_CONSTANT,
    +  COGL_MATERIAL_LAYER_COMBINE_SRC_PRIMARY_COLOR = GL_PRIMARY_COLOR,
    +  COGL_MATERIAL_LAYER_COMBINE_SRC_PREVIOUS	= GL_PREVIOUS
    +} CoglMaterialLayerCombineSrc;
    +
    +

    +Note for the constants COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE0..n the +numbers may not correspond to the indices you choose for your layers since +your layer indices don't need to be contiguous. If you need to use these +it would probably be sensible to ensure the layer indices do infact +correspond.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE

    The fragment color of the current texture layer +

    COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE0

    The fragment color of texture unit 0 +

    COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE1

    The fragment color of texture unit 1 +

    COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE2

    The fragment color of texture unit 2..7 +

    COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE3

    +

    COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE4

    +

    COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE5

    +

    COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE6

    +

    COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE7

    +

    COGL_MATERIAL_LAYER_COMBINE_SRC_CONSTANT

    A fixed constant color (TODO: no API yet to specify the actual color!) +

    COGL_MATERIAL_LAYER_COMBINE_SRC_PRIMARY_COLOR

    The basic color of the primitive ignoring texturing +

    COGL_MATERIAL_LAYER_COMBINE_SRC_PREVIOUS

    The result of combining all previous layers +
    +
    +
    +
    +

    cogl_material_set_layer_combine_arg_src ()

    +
    void                cogl_material_set_layer_combine_arg_src
    +                                                        (CoglHandle material,
    +                                                         gint layer_index,
    +                                                         gint argument,
    +                                                         CoglMaterialLayerCombineChannels channels,
    +                                                         CoglMaterialLayerCombineSrc src);
    +

    +

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + +

    material :

    A CoglMaterial object +

    layer_index :

    +

    argument :

    +

    channels :

    +

    src :

    +
    +
    +
    +
    +

    enum CoglMaterialLayerCombineOp

    +
    typedef enum _CoglMaterialLayerCombineOp
    +{
    +  COGL_MATERIAL_LAYER_COMBINE_OP_SRC_COLOR	     = GL_SRC_COLOR,
    +  COGL_MATERIAL_LAYER_COMBINE_OP_ONE_MINUS_SRC_COLOR = GL_ONE_MINUS_SRC_COLOR,
    +
    +  COGL_MATERIAL_LAYER_COMBINE_OP_SRC_ALPHA	     = GL_SRC_ALPHA,
    +  COGL_MATERIAL_LAYER_COMBINE_OP_ONE_MINUS_SRC_ALPHA = GL_ONE_MINUS_SRC_ALPHA
    +} CoglMaterialLayerCombineOp;
    +
    +

    + +

    +
    +
    +
    +

    cogl_material_set_layer_combine_arg_op ()

    +
    void                cogl_material_set_layer_combine_arg_op
    +                                                        (CoglHandle material,
    +                                                         gint layer_index,
    +                                                         gint argument,
    +                                                         CoglMaterialLayerCombineChannels channels,
    +                                                         CoglMaterialLayerCombineOp op);
    +

    +

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + +

    material :

    A CoglMaterial object +

    layer_index :

    +

    argument :

    +

    channels :

    +

    op :

    +
    +
    +
    +
    +

    cogl_material_set_layer_matrix ()

    +
    void                cogl_material_set_layer_matrix      (CoglHandle material,
    +                                                         gint layer_index,
    +                                                         CoglMatrix *matrix);
    +

    +This function lets you set a matrix that can be used to e.g. translate +and rotate a single layer of a material used to fill your geometry.

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    material :

    A CoglMaterial object +

    layer_index :

    +

    matrix :

    + + +
    +
    +
    +
    +

    cogl_material_set_layer_alpha_combine ()

    +
    void                cogl_material_set_layer_alpha_combine
    +                                                        ();
    +

    + +

    +
    +
    +
    +

    cogl_material_set_layer_rgb_combine ()

    +
    void                cogl_material_set_layer_rgb_combine ();
    +

    + +

    +
    +
    +
    +

    cogl_material_get_cogl_enable_flags ()

    +
    gulong              cogl_material_get_cogl_enable_flags (CoglHandle handle);
    +

    +This determines what flags need to be passed to cogl_enable before +this material can be used. Normally you shouldn't need to use this +function directly since Cogl will do this internally, but if you are +developing custom primitives directly with OpenGL you may want to use +this. +

    +

    +Note: This API is hopfully just a stop-gap solution. Ideally +cogl_enable will be replaced.

    +

    + +

    +
    ++ + + + + + + + + + +

    handle :

    +

    Returns :

    + + +
    +
    +
    +
    +

    enum CoglMaterialFlushOption

    +
    typedef enum _CoglMaterialFlushOption
    +{
    +  COGL_MATERIAL_FLUSH_FALLBACK_MASK = 1,
    +  COGL_MATERIAL_FLUSH_DISABLE_MASK,
    +  COGL_MATERIAL_FLUSH_LAYER0_OVERRIDE,
    +} CoglMaterialFlushOption;
    +
    +

    +

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    COGL_MATERIAL_FLUSH_FALLBACK_MASK

    Follow this by a guin32 mask + of the layers that can't be supported with the user supplied texture + and need to be replaced with fallback textures. (1 = fallback, and the + least significant bit = layer 0) +

    COGL_MATERIAL_FLUSH_DISABLE_MASK

    Follow this by a guint32 mask + of the layers that you want to completly disable texturing for + (1 = fallback, and the least significant bit = layer 0) +

    COGL_MATERIAL_FLUSH_LAYER0_OVERRIDE

    Follow this by a GLuint OpenGL texture + name to override the texture used for layer 0 of the material. This is + intended for dealing with sliced textures where you will need to point + to each of the texture slices in turn when drawing your geometry. + Passing a value of 0 is the same as not passing the option at all. +
    +
    +
    +
    +

    cogl_material_flush_gl_state ()

    +
    void                cogl_material_flush_gl_state        (CoglHandle material,
    +                                                         ...);
    +

    +This function commits the state of the specified CoglMaterial - including +the texture state for all the layers - to the OpenGL[ES] driver. +

    +

    +Normally you shouldn't need to use this function directly, but if you +are developing a custom primitive using raw OpenGL that works with +CoglMaterials, then you may want to use this function. +

    +

    +Since 1.0

    +

    + +

    +
    ++ + + + + + + + + + +

    material :

    A CoglMaterial object +

    ... :

    A NULL terminated list of (CoglMaterialFlushOption, data) pairs +
    +
    +
    +
    +

    cogl_material_get_layers ()

    +
    const GList*        cogl_material_get_layers            (CoglHandle material_handle);
    +

    +This function lets you access a materials internal list of layers +for iteration. +

    +

    +Note: Normally you shouldn't need to use this function directly since +Cogl will do this internally, but if you are developing custom primitives +directly with OpenGL, you will need to iterate the layers that you want +to texture with. +

    +

    +Note: This function may return more layers than OpenGL can use at once +so it's your responsability limit yourself to +CGL_MAX_COMBINED_TEXTURE_IMAGE_UNITS. +

    +

    +Note: It's a bit out of the ordinary to return a const GList *, but it +was considered sensible to try and avoid list manipulation for every +primitive emitted in a scene, every frame.

    +

    + +

    +
    ++ + + + + + + + + + +

    material_handle :

    +

    Returns :

    + + +
    +
    +
    +
    +

    enum CoglMaterialLayerType

    +
    typedef enum _CoglMaterialLayerType
    +{
    +  COGL_MATERIAL_LAYER_TYPE_TEXTURE
    +} CoglMaterialLayerType;
    +
    +

    +

    +

    + +

    +
    ++ + + + +

    COGL_MATERIAL_LAYER_TYPE_TEXTURE

    The layer represents a CoglTexture +
    +
    +
    +
    +

    cogl_material_layer_get_type ()

    +
    CoglMaterialLayerType cogl_material_layer_get_type      (CoglHandle layer_handle);
    +

    +Currently there is only one type of layer defined: +COGL_MATERIAL_LAYER_TYPE_TEXTURE, but considering we may add purely GLSL +based layers in the future, you should write code that checks the type +first. +

    +

    +Note: Normally you shouldn't need to use this function directly since +Cogl will do this internally, but if you are developing custom primitives +directly with OpenGL, you will need to iterate the layers that you want +to texture with, and thus should be checking the layer types.

    +

    + +

    +
    ++ + + + + + + + + + +

    layer_handle :

    +

    Returns :

    + + +
    +
    +
    +
    +

    enum CoglMaterialLayerFlags

    +
    typedef enum _CoglMaterialLayerFlags
    +{
    +  COGL_MATERIAL_LAYER_FLAG_HAS_USER_MATRIX	= 1L<<0
    +} CoglMaterialLayerFlags;
    +
    +

    +

    +

    + +

    +
    +
    +
    +

    cogl_material_layer_get_flags ()

    +
    gulong              cogl_material_layer_get_flags       (CoglHandle layer_handle);
    +

    +This lets you get a number of flag attributes about the layer. Normally +you shouldn't need to use this function directly since Cogl will do this +internally, but if you are developing custom primitives directly with +OpenGL you may need this.

    +

    + +

    +
    ++ + + + + + + + + + +

    layer_handle :

    A CoglMaterial layer object +

    Returns :

    + + +
    +
    +
    +
    +

    cogl_material_layer_get_texture ()

    +
    CoglHandle          cogl_material_layer_get_texture     (CoglHandle layer_handle);
    +

    +This lets you extract a CoglTexture handle for a specific layer. Normally +you shouldn't need to use this function directly since Cogl will do this +internally, but if you are developing custom primitives directly with +OpenGL you may need this. +

    +

    +Note: In the future, we may support purely GLSL based layers which will +likley return COGL_INVALID_HANDLE if you try to get the texture. +Considering this, you should always call cogl_material_layer_get_type +first, to check it is of type COGL_MATERIAL_LAYER_TYPE_TEXTURE.

    +

    + +

    +
    ++ + + + + + + + + + +

    layer_handle :

    A CoglMaterial layer object +

    Returns :

    + + +
    +
    +
    +
    + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/html/cogl-Matrices.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/html/cogl-Matrices.html --- clutter-0.8.4/doc/reference/cogl/html/cogl-Matrices.html 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/cogl/html/cogl-Matrices.html 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,314 @@ + + + + +Matrices + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +

    Matrices

    +

    Matrices — Fuctions for initializing and manipulating 4x4 + matrices.

    +
    +
    +

    Synopsis

    +
    +                    CoglMatrix;
    +void                cogl_matrix_init_identity           (CoglMatrix *matrix);
    +void                cogl_matrix_multiply                (CoglMatrix *result,
    +                                                         const CoglMatrix *a,
    +                                                         const CoglMatrix *b);
    +void                cogl_matrix_rotate                  (CoglMatrix *matrix,
    +                                                         float angle,
    +                                                         float x,
    +                                                         float y,
    +                                                         float z);
    +void                cogl_matrix_translate               (CoglMatrix *matrix,
    +                                                         float x,
    +                                                         float y,
    +                                                         float z);
    +void                cogl_matrix_scale                   (CoglMatrix *matrix,
    +                                                         float sx,
    +                                                         float sy,
    +                                                         float sz);
    +
    +
    +
    +

    Description

    +

    +Matrices are used in Cogl to describe affine model-view transforms and +texture transforms, and projective transforms. This exposes a utility API +that can be used for direct manipulation of these matrices.

    +

    + +

    +
    +
    +

    Details

    +
    +

    CoglMatrix

    +
    typedef struct {
    +    /* column 0 */
    +    float xx;
    +    float yx;
    +    float zx;
    +    float wx;
    +
    +    /* column 1 */
    +    float xy;
    +    float yy;
    +    float zy;
    +    float wy;
    +
    +    /* column 2 */
    +    float xz;
    +    float yz;
    +    float zz;
    +    float wz;
    +
    +    /* column 3 */
    +    float xw;
    +    float yw;
    +    float zw;
    +    float ww;
    +} CoglMatrix;
    +
    +

    +A CoglMatrix holds a 4x4 transform matrix. This is a single precision, +column-major matrix which means it is compatible with what OpenGL expects. +

    +

    +A CoglMatix can represent transforms such as, rotations, scaling, +translation, sheering, and linear projections. You can combine these +transforms by multiplying multiple matrices in the order you want them +applied. +

    +

    +The transformation of a vertex (x, y, z, w) by a CoglMatrix is given by: +

    +
    +x_new = xx * x + xy * y + xz * z + xw * w
    +y_new = yx * x + yy * y + yz * z + yw * w
    +z_new = zx * x + zy * y + zz * z + zw * w
    +w_new = wx * x + wy * y + wz * z + ww * w
    +
    +

    +Where w is normally 1

    +

    + +

    +
    +
    +
    +

    cogl_matrix_init_identity ()

    +
    void                cogl_matrix_init_identity           (CoglMatrix *matrix);
    +

    +Resets matrix to the identity matrix: +

    +
    +.xx=1; .xy=0; .xz=0; .xw=0;
    +.yx=0; .yy=1; .yz=0; .yw=0;
    +.zx=0; .zy=0; .zz=1; .zw=0;
    +.wx=0; .wy=0; .wz=0; .ww=1;
    +
    +

    + +

    +
    ++ + + + +

    matrix :

    A 4x4 transformation matrix +
    +
    +
    +
    +

    cogl_matrix_multiply ()

    +
    void                cogl_matrix_multiply                (CoglMatrix *result,
    +                                                         const CoglMatrix *a,
    +                                                         const CoglMatrix *b);
    +

    +This function multiples the two supplied matricies together and stores +the result in result

    +

    + +

    +
    ++ + + + + + + + + + + + + + +

    result :

    The address of a 4x4 matrix to store the result in +

    a :

    A 4x4 transformation matrix +

    b :

    A 4x4 transformation matrix +
    +
    +
    +
    +

    cogl_matrix_rotate ()

    +
    void                cogl_matrix_rotate                  (CoglMatrix *matrix,
    +                                                         float angle,
    +                                                         float x,
    +                                                         float y,
    +                                                         float z);
    +

    +This function multiples your matrix with a rotation matrix that applies +a rotation of angle degrees around the specified 3D vector.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + +

    matrix :

    A 4x4 transformation matrix +

    angle :

    The angle you want to rotate in degrees +

    x :

    X component of your rotation vector +

    y :

    Y component of your rotation vector +

    z :

    Z component of your rotation vector +
    +
    +
    +
    +

    cogl_matrix_translate ()

    +
    void                cogl_matrix_translate               (CoglMatrix *matrix,
    +                                                         float x,
    +                                                         float y,
    +                                                         float z);
    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + +

    matrix :

    +

    x :

    +

    y :

    +

    z :

    + + +
    +
    +
    +
    +

    cogl_matrix_scale ()

    +
    void                cogl_matrix_scale                   (CoglMatrix *matrix,
    +                                                         float sx,
    +                                                         float sy,
    +                                                         float sz);
    +

    +This function multiples your matrix with a transform matrix that scales +along the X, Y and Z axis.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + +

    matrix :

    A 4x4 transformation matrix +

    sx :

    The X scale factor +

    sy :

    The Y scale factor +

    sz :

    The Z scale factor +
    +
    +
    +
    + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/html/cogl-Offscreen-Buffers.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/html/cogl-Offscreen-Buffers.html --- clutter-0.8.4/doc/reference/cogl/html/cogl-Offscreen-Buffers.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/html/cogl-Offscreen-Buffers.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,10 +4,10 @@ Offscreen Buffers - + - + @@ -20,8 +20,8 @@ Prev Up Home -COGL 0.8.4 Reference Manual -Next +COGL 0.9.0 Reference Manual +Next
    Top  |  diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/html/cogl-Primitives.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/html/cogl-Primitives.html --- clutter-0.8.4/doc/reference/cogl/html/cogl-Primitives.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/html/cogl-Primitives.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,7 +4,7 @@ Primitives - + @@ -20,7 +20,7 @@ Prev Up Home -COGL 0.8.4 Reference Manual +COGL 0.9.0 Reference Manual Next Top @@ -40,180 +40,117 @@

    Synopsis

    -void                cogl_color                          (const ClutterColor *color);
    -void                cogl_path_fill                      (void);
    -void                cogl_path_stroke                    (void);
    -void                cogl_path_move_to                   (ClutterFixed x,
    -                                                         ClutterFixed y);
    +void                cogl_path_new                       (void);
    +void                cogl_path_move_to                   (float x,
    +                                                         float y);
     void                cogl_path_close                     (void);
    -void                cogl_path_line_to                   (ClutterFixed x,
    -                                                         ClutterFixed y);
    -void                cogl_path_curve_to                  (ClutterFixed x1,
    -                                                         ClutterFixed y1,
    -                                                         ClutterFixed x2,
    -                                                         ClutterFixed y2,
    -                                                         ClutterFixed x3,
    -                                                         ClutterFixed y3);
    -void                cogl_path_arc                       (ClutterFixed center_x,
    -                                                         ClutterFixed center_y,
    -                                                         ClutterFixed radius_x,
    -                                                         ClutterFixed radius_y,
    -                                                         ClutterAngle angle_1,
    -                                                         ClutterAngle angle_2);
    -void                cogl_path_rel_move_to               (ClutterFixed x,
    -                                                         ClutterFixed y);
    -void                cogl_path_rel_line_to               (ClutterFixed x,
    -                                                         ClutterFixed y);
    -void                cogl_path_rel_curve_to              (ClutterFixed x1,
    -                                                         ClutterFixed y1,
    -                                                         ClutterFixed x2,
    -                                                         ClutterFixed y2,
    -                                                         ClutterFixed x3,
    -                                                         ClutterFixed y3);
    -void                cogl_path_line                      (ClutterFixed x1,
    -                                                         ClutterFixed y1,
    -                                                         ClutterFixed x2,
    -                                                         ClutterFixed y2);
    -void                cogl_path_polyline                  (ClutterFixed *coords,
    +void                cogl_path_line_to                   (float x,
    +                                                         float y);
    +void                cogl_path_curve_to                  (float x1,
    +                                                         float y1,
    +                                                         float x2,
    +                                                         float y2,
    +                                                         float x3,
    +                                                         float y3);
    +void                cogl_path_arc                       (float center_x,
    +                                                         float center_y,
    +                                                         float radius_x,
    +                                                         float radius_y,
    +                                                         float angle_1,
    +                                                         float angle_2);
    +void                cogl_path_rel_move_to               (float x,
    +                                                         float y);
    +void                cogl_path_rel_line_to               (float x,
    +                                                         float y);
    +void                cogl_path_rel_curve_to              (float x1,
    +                                                         float y1,
    +                                                         float x2,
    +                                                         float y2,
    +                                                         float x3,
    +                                                         float y3);
    +void                cogl_path_line                      (float x1,
    +                                                         float y1,
    +                                                         float x2,
    +                                                         float y2);
    +void                cogl_path_polyline                  (float *coords,
                                                              gint num_points);
    -void                cogl_path_polygon                   (ClutterFixed *coords,
    +void                cogl_path_polygon                   (float *coords,
                                                              gint num_points);
    -void                cogl_path_rectangle                 (ClutterFixed x,
    -                                                         ClutterFixed y,
    -                                                         ClutterFixed width,
    -                                                         ClutterFixed height);
    -void                cogl_path_round_rectangle           (ClutterFixed x,
    -                                                         ClutterFixed y,
    -                                                         ClutterFixed width,
    -                                                         ClutterFixed height,
    -                                                         ClutterFixed radius,
    -                                                         ClutterAngle arc_step);
    -void                cogl_path_ellipse                   (ClutterFixed center_x,
    +void                cogl_path_rectangle                 (float x,
    +                                                         float y,
    +                                                         float width,
    +                                                         float height);
    +void                cogl_path_round_rectangle           (float x,
    +                                                         float y,
    +                                                         float width,
    +                                                         float height,
    +                                                         float radius,
    +                                                         float arc_step);
    +void                cogl_path_ellipse                   (float center_x,
    +                                                         float center_y,
    +                                                         float radius_x,
    +                                                         float radius_y);
    +
    +void                cogl_path_fill                      (void);
    +void                cogl_path_fill_preserve             (void);
    +void                cogl_path_stroke                    (void);
    +void                cogl_path_stroke_preserve           (void);
    +void                cogl_set_source_color               (const CoglColor *color);
    +void                cogl_set_source_color4ub            (guint8 red,
    +                                                         guint8 green,
    +                                                         guint8 blue,
    +                                                         guint8 alpha);
    +void                cogl_set_source_color4f             (float red,
    +                                                         float green,
    +                                                         float blue,
    +                                                         float alpha);
    +void                cogl_set_source_texture             (CoglHandle texture_handle);
    +#define             cogl_color
    +
    +void                cogl_rectangle                      (float x1,
    +                                                         float y1,
    +                                                         float x2,
    +                                                         float y2);
    +void                cogl_polygon                        (CoglTextureVertex *vertices,
                                                              ClutterFixed center_y,
    +href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
    +>guint n_vertices,
                                                              ClutterFixed radius_x,
    +href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
    +>gboolean use_color);
    +void                cogl_rectangle_with_multitexture_coords
    +                                                        (float x1,
    +                                                         float y1,
    +                                                         float x2,
    +                                                         float y2,
    +                                                         const float *tex_coords,
                                                              ClutterFixed radius_y);
    -void                cogl_rectangle                      (gint x,
    -                                                         gint y,
    -                                                         guint width,
    +>gint tex_coords_len);
    +void                cogl_rectangle_with_texture_coords  (float x1,
    +                                                         float y1,
    +                                                         float x2,
    +                                                         float y2,
    +                                                         float tx1,
    +                                                         float ty1,
    +                                                         float tx2,
    +                                                         float ty2);
    +void                cogl_rectangles_with_texture_coords (const float *verts,
                                                              guint height);
    -void                cogl_rectanglex                     (ClutterFixed x,
    -                                                         ClutterFixed y,
    -                                                         ClutterFixed width,
    -                                                         ClutterFixed height);
    +>guint n_rects);
     
    @@ -242,59 +179,24 @@

    Details

    -

    cogl_color ()

    -
    void                cogl_color                          (const ClutterColor *color);
    +

    cogl_path_new ()

    +
    void                cogl_path_new                       (void);

    -Changes the color of cogl's current paint, which is used for filling and stroking -primitives.

    +Clears the current path and starts a new one.

    -
    -- - - - -

    color :

    new current ClutterColor. -
    -
    -
    -
    -

    cogl_path_fill ()

    -
    void                cogl_path_fill                      (void);
    -

    -Fills the constructed shape using the current drawing color.

    -

    - -

    -
    -
    -
    -

    cogl_path_stroke ()

    -
    void                cogl_path_stroke                    (void);
    -

    -Strokes the constructed shape using the current drawing color -and a width of 1 pixel (regardless of the current transformation -matrix).

    -

    - +

    Since 1.0


    cogl_path_move_to ()

    -
    void                cogl_path_move_to                   (ClutterFixed x,
    -                                                         ClutterFixed y);
    +
    void                cogl_path_move_to                   (float x,
    +                                                         float y);

    -Clears the previously constructed shape and begins a new path -contour by moving the pen to the given coordinates.

    +Moves the pen to the given location. If there is an existing path +this will start a new disjoint subpath.

    @@ -328,12 +230,8 @@

    cogl_path_line_to ()

    -
    void                cogl_path_line_to                   (ClutterFixed x,
    -                                                         ClutterFixed y);
    +
    void                cogl_path_line_to                   (float x,
    +                                                         float y);

    Adds a straight line segment to the current path that ends at the given coordinates.

    @@ -359,24 +257,12 @@

    cogl_path_curve_to ()

    -
    void                cogl_path_curve_to                  (ClutterFixed x1,
    -                                                         ClutterFixed y1,
    -                                                         ClutterFixed x2,
    -                                                         ClutterFixed y2,
    -                                                         ClutterFixed x3,
    -                                                         ClutterFixed y3);
    +
    void                cogl_path_curve_to                  (float x1,
    +                                                         float y1,
    +                                                         float x2,
    +                                                         float y2,
    +                                                         float x3,
    +                                                         float y3);

    Adds a cubic bezier curve segment to the current path with the given second, third and fourth control points and using current pen location @@ -423,24 +309,12 @@


    cogl_path_arc ()

    -
    void                cogl_path_arc                       (ClutterFixed center_x,
    -                                                         ClutterFixed center_y,
    -                                                         ClutterFixed radius_x,
    -                                                         ClutterFixed radius_y,
    -                                                         ClutterAngle angle_1,
    -                                                         ClutterAngle angle_2);
    +
    void                cogl_path_arc                       (float center_x,
    +                                                         float center_y,
    +                                                         float radius_x,
    +                                                         float radius_y,
    +                                                         float angle_1,
    +                                                         float angle_2);

    Adds an elliptical arc segment to the current path. A straight line segment will link the current pen location with the first vertex @@ -488,16 +362,12 @@


    cogl_path_rel_move_to ()

    -
    void                cogl_path_rel_move_to               (ClutterFixed x,
    -                                                         ClutterFixed y);
    -

    -Clears the previously constructed shape and begins a new path -contour by moving the pen to the given coordinates relative -to the current pen location.

    +
    void                cogl_path_rel_move_to               (float x,
    +                                                         float y);
    +

    +Moves the pen to the given offset relative to the current pen +location. If there is an existing path this will start a new +disjoint subpath.

    @@ -520,12 +390,8 @@

    cogl_path_rel_line_to ()

    -
    void                cogl_path_rel_line_to               (ClutterFixed x,
    -                                                         ClutterFixed y);
    +
    void                cogl_path_rel_line_to               (float x,
    +                                                         float y);

    Adds a straight line segment to the current path that ends at the given coordinates relative to the current pen location.

    @@ -551,24 +417,12 @@

    cogl_path_rel_curve_to ()

    -
    void                cogl_path_rel_curve_to              (ClutterFixed x1,
    -                                                         ClutterFixed y1,
    -                                                         ClutterFixed x2,
    -                                                         ClutterFixed y2,
    -                                                         ClutterFixed x3,
    -                                                         ClutterFixed y3);
    +
    void                cogl_path_rel_curve_to              (float x1,
    +                                                         float y1,
    +                                                         float x2,
    +                                                         float y2,
    +                                                         float x3,
    +                                                         float y3);

    Adds a cubic bezier curve segment to the current path with the given second, third and fourth control points and using current pen location @@ -616,21 +470,14 @@


    cogl_path_line ()

    -
    void                cogl_path_line                      (ClutterFixed x1,
    -                                                         ClutterFixed y1,
    -                                                         ClutterFixed x2,
    -                                                         ClutterFixed y2);
    -

    -Clears the previously constructed shape and constructs a straight -line shape start and ending at the given coordinates.

    +
    void                cogl_path_line                      (float x1,
    +                                                         float y1,
    +                                                         float x2,
    +                                                         float y2);
    +

    +Constructs a straight line shape starting and ending at the given +coordinates. If there is an existing path this will start a new +disjoint sub-path.

    @@ -663,17 +510,16 @@

    cogl_path_polyline ()

    -
    void                cogl_path_polyline                  (ClutterFixed *coords,
    +
    void                cogl_path_polyline                  (float *coords,
                                                              gint num_points);

    -Clears the previously constructed shape and constructs a series of straight -line segments, starting from the first given vertex coordinate. Each -subsequent segment stars where the previous one ended and ends at the next -given vertex coordinate. +Constructs a series of straight line segments, starting from the +first given vertex coordinate. If there is an existing path this +will start a new disjoint sub-path. Each subsequent segment starts +where the previous one ended and ends at the next given vertex +coordinate.

    The coords array must contain 2 * num_points values. The first value @@ -704,15 +550,13 @@


    cogl_path_polygon ()

    -
    void                cogl_path_polygon                   (ClutterFixed *coords,
    +
    void                cogl_path_polygon                   (float *coords,
                                                              gint num_points);

    -Clears the previously constructed shape and constructs a polygonal -shape of the given number of vertices. +Constructs a polygonal shape of the given number of vertices. If +there is an existing path this will start a new disjoint sub-path.

    The coords array must contain 2 * num_points values. The first value @@ -742,21 +586,13 @@


    cogl_path_rectangle ()

    -
    void                cogl_path_rectangle                 (ClutterFixed x,
    -                                                         ClutterFixed y,
    -                                                         ClutterFixed width,
    -                                                         ClutterFixed height);
    +
    void                cogl_path_rectangle                 (float x,
    +                                                         float y,
    +                                                         float width,
    +                                                         float height);

    -Clears the previously constructed shape and constructs a rectangular -shape at the given coordinates.

    +Constructs a rectangular shape at the given coordinates. If there +is an existing path this will start a new disjoint sub-path.

    @@ -789,27 +625,15 @@

    cogl_path_round_rectangle ()

    -
    void                cogl_path_round_rectangle           (ClutterFixed x,
    -                                                         ClutterFixed y,
    -                                                         ClutterFixed width,
    -                                                         ClutterFixed height,
    -                                                         ClutterFixed radius,
    -                                                         ClutterAngle arc_step);
    +
    void                cogl_path_round_rectangle           (float x,
    +                                                         float y,
    +                                                         float width,
    +                                                         float height,
    +                                                         float radius,
    +                                                         float arc_step);

    -Clears the previously constructed shape and constructs a rectangular -shape with rounded corners.

    +Constructs a rectangular shape with rounded corners. If there is an +existing path this will start a new disjoint sub-path.

    @@ -853,21 +677,13 @@

    cogl_path_ellipse ()

    -
    void                cogl_path_ellipse                   (ClutterFixed center_x,
    -                                                         ClutterFixed center_y,
    -                                                         ClutterFixed radius_x,
    -                                                         ClutterFixed radius_y);
    +
    void                cogl_path_ellipse                   (float center_x,
    +                                                         float center_y,
    +                                                         float radius_x,
    +                                                         float radius_y);

    -Clears the previously constructed shape and constructs an ellipse -shape.

    +Constructs an ellipse shape. If there is an existing path this will +start a new disjoint sub-path.

    @@ -899,22 +715,102 @@

    -

    cogl_rectangle ()

    -
    void                cogl_rectangle                      (gint x,
    +

    cogl_path_fill ()

    +
    void                cogl_path_fill                      (void);
    +

    +Fills the constructed shape using the current drawing color. The +current path is then cleared. To use the path again, call +cogl_path_fill_preserve() instead.

    +

    + +

    +
    +
    +
    +

    cogl_path_fill_preserve ()

    +
    void                cogl_path_fill_preserve             (void);
    +

    +Fills the constructed shape using the current drawing color and +preserves the path to be used again.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_path_stroke ()

    +
    void                cogl_path_stroke                    (void);
    +

    +Strokes the constructed shape using the current drawing color and a +width of 1 pixel (regardless of the current transformation +matrix). To current path is then cleared. To use the path again, +call cogl_path_stroke_preserve() instead.

    +

    + +

    +
    +
    +
    +

    cogl_path_stroke_preserve ()

    +
    void                cogl_path_stroke_preserve           (void);
    +

    +Strokes the constructed shape using the current drawing color and +preserves the path to be used again.

    +

    + +

    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_set_source_color ()

    +
    void                cogl_set_source_color               (const CoglColor *color);
    +

    +Sets the source color using normalized values for each component. +This color will be used for any subsequent drawing operation. +

    +

    +See also cogl_set_source_color4ub() and cogl_set_source_color4f() +if you already have the color components.

    +

    + +

    +
    ++ + + + +

    color :

    a CoglColor +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_set_source_color4ub ()

    +
    void                cogl_set_source_color4ub            (guint8 red,
                                                              gint y,
    +href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"
    +>guint8 green,
                                                              guint width,
    +href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"
    +>guint8 blue,
                                                              guint height);
    +href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8" +>guint8 alpha);
    +

    +Sets the source color using unsigned bytes for each component. This +color will be used for any subsequent drawing operation. +

    -Fills a rectangle at the given coordinates with the current -drawing color in a highly optimizied fashion.

    +The value for each component is an unsigned byte in the range +between 0 and 255.

    @@ -922,23 +818,141 @@ -

    x :

    +

    red :

    + value of the red channel, between 0 and 255 + + + +

    green :

    + value of the green channel, between 0 and 255 + + + +

    blue :

    + value of the blue channel, between 0 and 255 + + + +

    alpha :

    + value of the alpha channel, between 0 and 255 + + + +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_set_source_color4f ()

    +
    void                cogl_set_source_color4f             (float red,
    +                                                         float green,
    +                                                         float blue,
    +                                                         float alpha);
    +

    +Sets the source color using normalized values for each component. +This color will be used for any subsequent drawing operation. +

    +

    +The value for each component is a fixed point number in the range +between 0 and 1.0. If the values passed in are outside that +range, they will be clamped.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + +

    red :

    value of the red channel, between 0 and 1.0 +

    green :

    value of the green channel, between 0 and 1.0 +

    blue :

    value of the blue channel, between 0 and 1.0 +

    alpha :

    value of the alpha channel, between 0 and 1.0 +
    +

    Since 1.0 +

    +
    +
    +
    +

    cogl_set_source_texture ()

    +
    void                cogl_set_source_texture             (CoglHandle texture_handle);
    +

    +This is a convenience function for creating a material with the first +layer set to texture_handle and setting that material as the source with +cogl_set_source. +

    +

    +Since 1.0

    +

    + +

    +
    ++ + + + +

    texture_handle :

    The Cogl texture you want as your source +
    +
    +
    +
    +

    cogl_color

    +
    #define cogl_color              cogl_color_REPLACED_BY_cogl_set_source_color
    +
    +

    + +

    +
    +
    +
    +

    cogl_rectangle ()

    +
    void                cogl_rectangle                      (float x1,
    +                                                         float y1,
    +                                                         float x2,
    +                                                         float y2);
    +

    +Fills a rectangle at the given coordinates with the current source material

    +

    + +

    +
    ++ + + - + - - + - - + @@ -946,21 +960,89 @@
    -

    cogl_rectanglex ()

    -
    void                cogl_rectanglex                     (ClutterFixed x,
    +

    cogl_polygon ()

    +
    void                cogl_polygon                        (CoglTextureVertex *vertices,
                                                              ClutterFixed y,
    +href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
    +>guint n_vertices,
                                                              ClutterFixed width,
    +href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
    +>gboolean use_color);
    +

    +Draws a convex polygon using the current source material to fill / texture +with according to the texture coordinates passed. +

    +

    +If use_color is TRUE then the color will be changed for each vertex using +the value specified in the color member of CoglTextureVertex. This can be +used for example to make the texture fade out by setting the alpha value of +the color. +

    +

    +All of the texture coordinates must be in the range [0,1] and repeating the +texture is not supported. +

    +

    +Because of the way this function is implemented it will currently only work +if either the texture is not sliced or the backend is not OpenGL ES and the +minifying and magnifying functions are both set to CGL_NEAREST. +

    +

    +Since 1.0

    +

    + +

    +

    x1 :

    X coordinate of the top-left corner

    y :

    y1 :

    Y coordinate of the top-left corner

    width :

    Width of the rectangle +

    x2 :

    X coordinate of the bottom-right corner

    height :

    Height of the rectangle +

    y2 :

    Y coordinate of the bottom-right corner
    ++ + + + + + + + + + + + + + +

    vertices :

    An array of CoglTextureVertex structs +

    n_vertices :

    The length of the vertices array +

    use_color :

    TRUE if the color member of CoglTextureVertex should be used +
    +
    +
    +
    +

    cogl_rectangle_with_multitexture_coords ()

    +
    void                cogl_rectangle_with_multitexture_coords
    +                                                        (float x1,
    +                                                         float y1,
    +                                                         float x2,
    +                                                         float y2,
    +                                                         const float *tex_coords,
                                                              ClutterFixed height);
    +href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint" +>gint tex_coords_len);
    +

    +This function draws a rectangle using the current source material to +texture or fill with. As a material may contain multiple texture layers +this interface lets you supply texture coordinates for each layer of the +material. +

    +

    +The first pair of coordinates are for the first layer (with the smallest +layer index) and if you supply less texture coordinates than there are +layers in the current source material then default texture coordinates +(0.0, 0.0, 1.0, 1.0) are generated. +

    -A fixed-point version of cogl_fast_fill_rectangle.

    +Since 1.0

    @@ -968,28 +1050,149 @@ -

    x :

    - X coordinate of the top-left corner +

    x1 :

    + x coordinate upper left on screen. -

    y :

    - Y coordinate of the top-left corner +

    y1 :

    + y coordinate upper left on screen. -

    width :

    - Width of the rectangle +

    x2 :

    + x coordinate lower right on screen. -

    height :

    - Height of the rectangle +

    y2 :

    + y coordinate lower right on screen. + + + +

    tex_coords :

    + An array containing groups of 4 float values: + [tx1, ty1, tx2, ty2] that are interpreted as two texture coordinates; one + for the upper left texel, and one for the lower right texel. Each value + should be between 0.0 and 1.0, where the coordinate (0.0, 0.0) represents + the top left of the texture, and (1.0, 1.0) the bottom right. + + + +

    tex_coords_len :

    + The length of the tex_coords array. (e.g. for one layer + and one group of texture coordinates, this would be 4)
    +
    +
    +

    cogl_rectangle_with_texture_coords ()

    +
    void                cogl_rectangle_with_texture_coords  (float x1,
    +                                                         float y1,
    +                                                         float x2,
    +                                                         float y2,
    +                                                         float tx1,
    +                                                         float ty1,
    +                                                         float tx2,
    +                                                         float ty2);
    +

    +Draw a rectangle using the current material and supply texture coordinates +to be used for the first texture layer of the material. To draw the entire +texture pass in tx1=0.0 ty1=0.0 tx2=1.0 ty2=1.0. +

    +

    +Since 1.0

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    x1 :

    x coordinate upper left on screen. +

    y1 :

    y coordinate upper left on screen. +

    x2 :

    x coordinate lower right on screen. +

    y2 :

    y coordinate lower right on screen. +

    tx1 :

    x part of texture coordinate to use for upper left pixel +

    ty1 :

    y part of texture coordinate to use for upper left pixel +

    tx2 :

    x part of texture coordinate to use for lower right pixel +

    ty2 :

    y part of texture coordinate to use for left pixel +
    +
    +
    +
    +

    cogl_rectangles_with_texture_coords ()

    +
    void                cogl_rectangles_with_texture_coords (const float *verts,
    +                                                         guint n_rects);
    +

    +Draws a series of rectangles in the same way that +cogl_rectangle_with_texture_coords() does. In some situations it can give a +significant performance boost to use this function rather than +calling cogl_rectangle_with_texture_coords() separately for each rectangle. +

    +

    +verts should point to an array of floats with +n_rects * 8 elements. Each group of 8 values corresponds to the +parameters x1, y1, x2, y2, tx1, ty1, tx2 and ty2 and have the same +meaning as in cogl_rectangle_with_texture_coords().

    +

    + +

    +
    ++ + + + + + + + + + +

    verts :

    an array of vertices +

    n_rects :

    number of rectangles to draw +
    +

    Since 0.8.6 +

    +
    @@ -484,8 +515,8 @@ href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" >gchar *uniform_name);

    -Retrieve the location (offset) of a uniform variable in a shader program, a -uniform is a variable that is constant for all vertices/fragments for a +Retrieve the location (offset) of a uniform variable in a shader program, +a uniform is a variable that is constant for all vertices/fragments for a shader object and is possible to modify as an external parameter.

    @@ -505,8 +536,9 @@

    Returns :

    - the offset of a uniform in a specified program, this uniform can be -set using cogl_program_uniform_1f when the program is in use. + the offset of a uniform in a specified program. + This uniform can be set using cogl_program_uniform_1f() when the + program is in use. @@ -520,8 +552,37 @@ href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gfloat" >gfloat value);

    -Changes the value of a uniform in the currently used (see cogl_program_use) -shader program.

    +Changes the value of a floating point uniform in the currently +used (see cogl_program_use()) shader program.

    +

    + +

    +
    ++ + + + + + + + + + +

    uniform_no :

    the unform to set. +

    value :

    the new value of the uniform. +
    + +
    +
    +

    cogl_program_uniform_1i ()

    +
    void                cogl_program_uniform_1i             (COGLint uniform_no,
    +                                                         gint value);
    +

    +Changes the value of an integer uniform in the currently +used (see cogl_program_use()) shader program.

    @@ -541,6 +602,144 @@
    +
    +
    +

    cogl_program_uniform_float ()

    +
    void                cogl_program_uniform_float          (COGLint uniform_no,
    +                                                         gint size,
    +                                                         gint count,
    +                                                         const GLfloat *value);
    +

    +Changes the value of a float vector uniform, or uniform array in the +currently used (see cogl_program_use) shader program.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + +

    uniform_no :

    the uniform to set. +

    size :

    Size of float vector. +

    count :

    Size of array of uniforms. +

    value :

    the new value of the uniform. +
    +
    +
    +
    +

    cogl_program_uniform_int ()

    +
    void                cogl_program_uniform_int            (COGLint uniform_no,
    +                                                         gint size,
    +                                                         gint count,
    +                                                         const COGLint *value);
    +

    +Changes the value of a int vector uniform, or uniform array in the +currently used (see cogl_program_use()) shader program.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + +

    uniform_no :

    the uniform to set. +

    size :

    Size of int vector. +

    count :

    Size of array of uniforms. +

    value :

    the new value of the uniform. +
    +
    +
    +
    +

    cogl_program_uniform_matrix ()

    +
    void                cogl_program_uniform_matrix         (COGLint uniform_no,
    +                                                         gint size,
    +                                                         gint count,
    +                                                         gboolean transpose,
    +                                                         const GLfloat *value);
    +

    +Changes the value of a matrix uniform, or uniform array in the +currently used (see cogl_program_use()) shader program. The size +parameter is used to determine the square size of the matrix.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + +

    uniform_no :

    the uniform to set. +

    size :

    Size of matrix. +

    count :

    Size of array of uniforms. +

    transpose :

    Whether to transpose the matrix when setting the uniform. +

    value :

    the new value of the uniform. +
    +
    + +
    +
    +

    enum CoglTextureFlags

    +
    typedef enum {
    +  COGL_TEXTURE_NONE        = 0,
    +  COGL_TEXTURE_AUTO_MIPMAP = 1 << 0
    +} CoglTextureFlags;
    +
    +

    +Flags to pass to the cogl_texture_new_* family of functions.

    +

    + +

    +
    ++ + + + + + + +

    COGL_TEXTURE_NONE

    No flags specified +

    COGL_TEXTURE_AUTO_MIPMAP

    Enables the automatic generation of the + mipmap pyramid from the base level image whenever it is updated
    +

    Since 1.0 +


    @@ -291,12 +300,10 @@ gint max_waste, - gboolean auto_mipmap, + CoglTextureFlags flags, CoglPixelFormat internal_format);

    -Create a new texture with specified dimensions and pixel format.

    +Creates a new COGL texture with the specified dimensions and pixel format.

    @@ -315,30 +322,32 @@

    max_waste :

    - maximum extra horizontal and|or vertical margin pixels to make -texture fit GPU limitations. + maximum extra horizontal and|or vertical margin pixels + to make the texture fit GPU limitations -

    auto_mipmap :

    - enable or disable automatic generation of mipmap pyramid -from the base level image whenever it is updated. +

    flags :

    + Optional flags for the texture, or COGL_TEXTURE_NONE

    internal_format :

    the CoglPixelFormat to use for the GPU storage of the -texture. + texture.

    Returns :

    - a CoglHandle to the newly created texture or COGL_INVALID_HANDLE -if texture creation failed. + a CoglHandle to the newly created texture or + COGL_INVALID_HANDLE on failure +
    +

    Since 0.8 +


    @@ -349,15 +358,13 @@ gint max_waste, - gboolean auto_mipmap, + CoglTextureFlags flags, CoglPixelFormat internal_format, GError **error);

    -Load an image file from disk.

    +Creates a COGL texture from an image file.

    @@ -371,37 +378,41 @@

    max_waste :

    - maximum extra horizontal and|or vertical margin pixels to make -texture fit GPU limitations. + maximum extra horizontal and|or vertical margin pixels + to make the texture fit GPU limitations -

    auto_mipmap :

    - enable or disable automatic generation of mipmap pyramid -from the base level image whenever it is updated. +

    flags :

    + Optional flags for the texture, or COGL_TEXTURE_NONE

    internal_format :

    the CoglPixelFormat to use for the GPU storage of the -texture. + texture

    error :

    - a return location for a GError or NULL. +>GError or NULL

    Returns :

    - a CoglHandle to the newly created texture or COGL_INVALID_HANDLE -if creating the texture failed. + a CoglHandle to the newly created texture or + COGL_INVALID_HANDLE on failure +
    +

    Since 0.8 +


    @@ -415,9 +426,7 @@ gint max_waste, - gboolean auto_mipmap, + CoglTextureFlags flags, CoglPixelFormat format, CoglPixelFormat internal_format, guchar *data);

    -Create a new cogl texture based on data residing in memory.

    +Creates a new COGL texture based on data residing in memory.

    @@ -436,23 +445,23 @@

    width :

    - width of texture in pixels. + width of texture in pixels

    height :

    - height of texture in pixels. + height of texture in pixels

    max_waste :

    - maximum extra horizontal and|or vertical margin pixels to make + maximum extra horizontal and|or vertical margin pixels + to make the texture fit GPU limitations -

    auto_mipmap :

    - enable or disable automatic generation of mipmap pyramid -from the base level image whenever it is updated. +

    flags :

    + Optional flags for the texture, or COGL_TEXTURE_NONE @@ -462,29 +471,32 @@

    internal_format :

    - the CoglPixelFormat that will be used for storing the -buffer on the GPU. + the CoglPixelFormat that will be used for storing + the buffer on the GPU

    rowstride :

    - the memory offset in bytes between the starts of scanlines in -data. + the memory offset in bytes between the starts of + scanlines in data

    data :

    - pointer the memory region where the source buffer resides. + pointer the memory region where the source buffer resides

    Returns :

    - a CoglHandle to the newly created texture or COGL_INVALID_HANDLE -if creating the texture failed. + a CoglHandle to the newly created texture or + COGL_INVALID_HANDLE on failure +
    +

    Since 0.8 +


    @@ -497,9 +509,9 @@ GLuint y_pot_waste, CoglPixelFormat format);

    -Create a cogl texture based on an existing OpenGL texture, the width, height -and format are passed along since it is not possible to query this from a -handle with GLES 1.0.

    +Creates a COGL texture based on an existing OpenGL texture; the +width, height and format are passed along since it is not possible +to query this from a handle with GLES 1.0.

    @@ -543,12 +555,66 @@

    Returns :

    - a CoglHandle to the newly created texture or COGL_INVALID_HANDLE -if creating the texture failed. + a CoglHandle to the newly created texture or + COGL_INVALID_HANDLE on failure + + + + +
    +

    Since 0.8 +

    + +
    +
    +

    cogl_texture_new_from_bitmap ()

    +
    CoglHandle          cogl_texture_new_from_bitmap        (CoglBitmap *bitmap,
    +                                                         gint max_waste,
    +                                                         CoglTextureFlags flags,
    +                                                         CoglPixelFormat internal_format);
    +

    +Creates a COGL texture from a CoglBitmap.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + +

    bitmap :

    a CoglBitmap +

    max_waste :

    maximum extra horizontal and|or vertical margin pixels + to make the texture fit GPU limitations +

    flags :

    Optional flags for the texture, or COGL_TEXTURE_NONE +

    internal_format :

    the CoglPixelFormat to use for the GPU storage of the +texture +

    Returns :

    a CoglHandle to the newly created texture or + COGL_INVALID_HANDLE on failure +
    +

    Since 1.0 +


    @@ -584,6 +650,49 @@

    +

    cogl_texture_ref ()

    +
    CoglHandle          cogl_texture_ref                    (CoglHandle handle);
    +

    +Increment the reference count for a cogl texture.

    +

    + +

    +
    ++ + + + + + + + + + +

    handle :

    a CoglHandle. +

    Returns :

    the handle. +
    +
    +
    +
    +

    cogl_texture_unref ()

    +
    void                cogl_texture_unref                  (CoglHandle handle);
    +

    +Deccrement the reference count for a cogl texture.

    +

    + +

    +
    ++ + + + +

    handle :

    a CoglHandle. +
    +
    +
    +

    cogl_texture_get_width ()

    
     
    -

    cogl_texture_ref ()

    -
    CoglHandle          cogl_texture_ref                    (CoglHandle handle);
    +

    CoglBitmap

    +
    typedef struct _CoglBitmap CoglBitmap;

    -Increment the reference count for a cogl texture.

    +Type used for storing image data.

    +

    + +

    +
    +
    +
    +

    cogl_bitmap_new_from_file ()

    +
    CoglBitmap*         cogl_bitmap_new_from_file           (const gchar *filename,
    +                                                         GError **error);
    +

    +Load an image file from disk. This function can be safely called from +within a thread.

    @@ -1065,67 +1190,68 @@ -

    handle :

    - a CoglHandle. +

    filename :

    + the file to load. + + + +

    error :

    + a GError or NULL.

    Returns :

    - the handle. + A CoglBitmap to the new loaded image data, or NULL if loading +the image failed. +
    +

    Since 1.0 +


    -

    cogl_texture_unref ()

    -
    void                cogl_texture_unref                  (CoglHandle handle);
    +

    cogl_bitmap_free ()

    +
    void                cogl_bitmap_free                    (CoglBitmap *bmp);

    -Deccrement the reference count for a cogl texture.

    +Frees a CoglBitmap.

    - - +

    handle :

    a CoglHandle. +

    bmp :

    a CoglBitmap.

    -

    cogl_texture_rectangle ()

    -
    void                cogl_texture_rectangle              (CoglHandle handle,
    -                                                         ClutterFixed x1,
    -                                                         ClutterFixed y1,
    -                                                         ClutterFixed x2,
    -                                                         ClutterFixed y2,
    -                                                         ClutterFixed tx1,
    -                                                         ClutterFixed ty1,
    +

    cogl_bitmap_get_size_from_file ()

    +
    gboolean            cogl_bitmap_get_size_from_file      (const gchar *filename,
                                                              ClutterFixed tx2,
    +href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
    +>gint *width,
                                                              ClutterFixed ty2);
    +href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint" +>gint *height);

    -Draw a rectangle from a texture to the display, to draw the entire -texture pass in tx1=0.0 ty1=0.0 tx2=1.0 ty2=1.0.

    +Parses an image file enough to extract the width and height +of the bitmap.

    @@ -1133,114 +1259,31 @@ -

    handle :

    - a CoglHandle. - - - -

    x1 :

    - x coordinate upper left on screen. - - - -

    y1 :

    - y coordinate upper left on screen. - - - -

    x2 :

    - x coordinate lower right on screen. - - - -

    y2 :

    - y coordinate lower right on screen. - - - -

    tx1 :

    - x part of texture coordinate to use for upper left pixel +

    filename :

    + the file to check -

    ty1 :

    - y part of texture coordinate to use for upper left pixel +

    width :

    + return location for the bitmap width -

    tx2 :

    - x part of texture coordinate to use for lower right pixel +

    height :

    + return location for the bitmap height -

    ty2 :

    - y part of texture coordinate to use for left pixel - - - -
    - -
    -
    -

    cogl_texture_polygon ()

    -
    void                cogl_texture_polygon                (CoglHandle handle,
    -                                                         guint n_vertices,
    -                                                         CoglTextureVertex *vertices,
    -                                                         gboolean use_color);
    -

    -Draws a polygon from a texture with the given model and texture -coordinates. This can be used to draw arbitrary shapes textured -with a COGL texture. If use_color is TRUE then the current COGL -color will be changed for each vertex using the value specified in -the color member of CoglTextureVertex. This can be used for -example to make the texture fade out by setting the alpha value of -the color. -

    -

    -All of the texture coordinates must be in the range [0,1] and -repeating the texture is not supported. -

    -

    -Because of the way this function is implemented it will currently -only work if either the texture is not sliced or the backend is not -OpenGL ES and the minifying and magnifying functions are both set -to CGL_NEAREST.

    -

    +

    Returns :

    + + -

    -
    -- - - - - - - - - - - - - - - -

    handle :

    A CoglHandle for a texture -

    n_vertices :

    The length of the vertices array -

    vertices :

    An array of CoglTextureVertex structs -

    use_color :

    TRUE if the color member of CoglTextureVertex should be used
    +

    Since 1.0 +

    diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/html/cogl-Utility-API.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/html/cogl-Utility-API.html --- clutter-0.8.4/doc/reference/cogl/html/cogl-Utility-API.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/html/cogl-Utility-API.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,10 +4,10 @@ Utility API - + - + @@ -20,8 +20,8 @@ Prev Up Home -COGL 0.8.4 Reference Manual -Next +COGL 0.9.0 Reference Manual +Next
    Top  |  @@ -48,7 +48,7 @@ void (*CoglFuncPtr) (void); enum CoglFeatureFlags; -ClutterFeatureFlags cogl_get_features (void); +CoglFeatureFlags cogl_get_features (void); gboolean cogl_features_available (CoglFeatureFlags features); @@ -76,9 +76,7 @@ gint *alpha); -void cogl_paint_init (const ClutterColor *color); +void cogl_paint_init (const CoglColor *color); int cogl_util_next_p2 (int a); @@ -172,8 +170,8 @@ COGL_FEATURE_OFFSCREEN_MULTISAMPLE = (1 << 7), COGL_FEATURE_OFFSCREEN_BLIT = (1 << 8), COGL_FEATURE_FOUR_CLIP_PLANES = (1 << 9), - COGL_FEATURE_STENCIL_BUFFER = (1 << 10) - + COGL_FEATURE_STENCIL_BUFFER = (1 << 10), + COGL_FEATURE_VBOS = (1 << 11) } CoglFeatureFlags;

    @@ -181,11 +179,73 @@

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    COGL_FEATURE_TEXTURE_RECTANGLE

    ARB_texture_rectangle support +

    COGL_FEATURE_TEXTURE_NPOT

    ARB_texture_non_power_of_two support +

    COGL_FEATURE_TEXTURE_YUV

    ycbcr conversion support +

    COGL_FEATURE_TEXTURE_READ_PIXELS

    glReadPixels() support +

    COGL_FEATURE_SHADERS_GLSL

    GLSL support +

    COGL_FEATURE_OFFSCREEN

    FBO support +

    COGL_FEATURE_OFFSCREEN_MULTISAMPLE

    Multisample support on FBOs +

    COGL_FEATURE_OFFSCREEN_BLIT

    Blit support on FBOs +

    COGL_FEATURE_FOUR_CLIP_PLANES

    At least 4 clip planes available +

    COGL_FEATURE_STENCIL_BUFFER

    Stencil buffer support +

    COGL_FEATURE_VBOS

    VBO support +
    +

    Since 0.8 +


    cogl_get_features ()

    -
    ClutterFeatureFlags cogl_get_features                   (void);
    +
    CoglFeatureFlags    cogl_get_features                   (void);

    Returns all of the features supported by COGL.

    @@ -373,9 +433,7 @@


    cogl_paint_init ()

    -
    void                cogl_paint_init                     (const ClutterColor *color);
    +
    void                cogl_paint_init                     (const CoglColor *color);

    Clears the color buffer to color. The depth buffer and stencil buffers are also cleared and fogging and lighting are disabled.

    diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/html/cogl-Vertex-Buffers.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/html/cogl-Vertex-Buffers.html --- clutter-0.8.4/doc/reference/cogl/html/cogl-Vertex-Buffers.html 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/cogl/html/cogl-Vertex-Buffers.html 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,631 @@ + + + + +Vertex Buffers + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +

    Vertex Buffers

    +

    Vertex Buffers — An API for submitting extensible arrays of vertex + attributes to OpenGL in a way that aims to minimise + copying or reformatting of the original data.

    +
    +
    +

    Synopsis

    +
    +enum                CoglVertexBufferAttribFlags;
    +#define             COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_MASK
    +#define             COGL_VERTEX_BUFFER_ATTRIB_FLAG_TYPE_MASK
    +CoglHandle          cogl_vertex_buffer_new              (guint n_vertices);
    +CoglHandle          cogl_vertex_buffer_ref              (CoglHandle handle);
    +void                cogl_vertex_buffer_unref            (CoglHandle handle);
    +void                cogl_vertex_buffer_add              (CoglHandle handle,
    +                                                         const char *attribute_name,
    +                                                         guint8 n_components,
    +                                                         GLenum gl_type,
    +                                                         gboolean normalized,
    +                                                         guint16 stride,
    +                                                         const void *pointer);
    +void                cogl_vertex_buffer_delete           (CoglHandle handle,
    +                                                         const char *attribute_name);
    +void                cogl_vertex_buffer_enable           (CoglHandle handle,
    +                                                         const char *attribute_name);
    +void                cogl_vertex_buffer_disable          (CoglHandle handle,
    +                                                         const char *attribute_name);
    +void                cogl_vertex_buffer_submit           (CoglHandle handle);
    +void                cogl_vertex_buffer_draw             (CoglHandle handle,
    +                                                         GLenum mode,
    +                                                         GLint first,
    +                                                         GLsizei count);
    +void                cogl_vertex_buffer_draw_range_elements
    +                                                        (CoglHandle handle,
    +                                                         GLenum mode,
    +                                                         GLuint min_index,
    +                                                         GLuint max_index,
    +                                                         GLsizei count,
    +                                                         GLenum indices_type,
    +                                                         const GLvoid *indices);
    +
    +
    +
    +

    Description

    +

    +The Attributes Buffer API is designed to be a fairly raw mechanism for +developers to be able to submit geometry to Cogl in a format that can be +directly consumed by an OpenGL driver and with awareness of the specific +hardware being used then costly format conversion can also be avoided. +

    +

    +They are designed to work on top of buffer objects and developers should +understand that attribute buffers are not that cheap to create but once they +have been submitted they can be stored in GPU addressable memory and can +be quickly reused. +

    +

    +Although this API does allow you to modify attribute buffers after they have +been submitted to the GPU you must note that modification is also not that +cheap, so if at all possible think of tricks that let you reuse a static +buffer. To help with this, it is possible to enable and disable individual +attributes cheaply. +

    +

    +Take for example attributes representing an elipse. If you were to submit +color attributes, texture coordinates and normals, then you would be able +to draw an elipses in the following different ways without modifying +the vertex buffer, only by changing your source material. +

    +
      +
    • Flat colored elipse
    • +
    • Textured elipse
    • +
    • Smoothly lit textured elipse blended with the color.
    • +
    +

    +

    +

    +Another trick that can be used is submitting highly detailed vertices and +then using cogl_vertex_buffer_draw_range_elements to sample sub-sets of +the geometry or lower resolution geometry out from a fixed buffer. +

    +

    +The API doesn't currently give you any control over the actual OpenGL buffer +objects that are created, but you can expect that when you first submit +your attributes they start off in one or more GL_STATIC_DRAW buffers. +If you then update some of your attributes; then these attributes will +normally be moved into new GL_DYNAMIC_DRAW draw buffers.

    +

    + +

    +
    +
    +

    Details

    +
    +

    enum CoglVertexBufferAttribFlags

    +
    typedef enum _CoglVertexBufferAttribFlags
    +{
    +  /* Types */
    +  /* NB: update the _TYPE_MASK below if these are changed */
    +  COGL_VERTEX_BUFFER_ATTRIB_FLAG_COLOR_ARRAY	  = 1<<0,
    +  COGL_VERTEX_BUFFER_ATTRIB_FLAG_NORMAL_ARRAY	  = 1<<1,
    +  COGL_VERTEX_BUFFER_ATTRIB_FLAG_TEXTURE_COORD_ARRAY  = 1<<2,
    +  COGL_VERTEX_BUFFER_ATTRIB_FLAG_VERTEX_ARRAY	  = 1<<3,
    +  COGL_VERTEX_BUFFER_ATTRIB_FLAG_CUSTOM_ARRAY	  = 1<<4,
    +  COGL_VERTEX_BUFFER_ATTRIB_FLAG_INVALID	  = 1<<5,
    +
    +  COGL_VERTEX_BUFFER_ATTRIB_FLAG_NORMALIZED	  = 1<<6,
    +  COGL_VERTEX_BUFFER_ATTRIB_FLAG_ENABLED	  = 1<<7,
    +
    +  /* Usage hints */
    +  /* FIXME - flatten into one flag, since its used as a boolean */
    +  COGL_VERTEX_BUFFER_ATTRIB_FLAG_INFREQUENT_RESUBMIT  = 1<<8,
    +  COGL_VERTEX_BUFFER_ATTRIB_FLAG_FREQUENT_RESUBMIT	  = 1<<9,
    +
    +  /* GL Data types */
    +  /* NB: Update the _GL_TYPE_MASK below if these are changed */
    +  COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_BYTE	    = 1<<10,
    +  COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_BYTE  = 1<<11,
    +  COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_SHORT	    = 1<<12,
    +  COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_SHORT = 1<<13,
    +  COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_INT	    = 1<<14,
    +  COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_INT   = 1<<15,
    +  COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_FLOAT	    = 1<<16,
    +  COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_DOUBLE	    = 1<<17,
    +
    +  COGL_VERTEX_BUFFER_ATTRIB_FLAG_SUBMITTED		    = 1<<18,
    +  COGL_VERTEX_BUFFER_ATTRIB_FLAG_UNUSED		    = 1<<19
    +
    +  /* XXX NB: If we need > 24 bits then look at changing the layout
    +   * of struct _CoglVertexBufferAttrib below */
    +} CoglVertexBufferAttribFlags;
    +
    +

    + +

    +
    +
    +
    +

    COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_MASK

    +
    #define             COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_MASK
    +

    + +

    +
    +
    +
    +

    COGL_VERTEX_BUFFER_ATTRIB_FLAG_TYPE_MASK

    +
    #define             COGL_VERTEX_BUFFER_ATTRIB_FLAG_TYPE_MASK
    +

    + +

    +
    +
    +
    +

    cogl_vertex_buffer_new ()

    +
    CoglHandle          cogl_vertex_buffer_new              (guint n_vertices);
    +

    +This creates a Cogl handle for a new vertex buffer that you can then start +to add attributes too.

    +

    + +

    +
    ++ + + + + + + + + + +

    n_vertices :

    The number of vertices that your attributes will correspond to. +

    Returns :

    + + +
    +
    +
    +
    +

    cogl_vertex_buffer_ref ()

    +
    CoglHandle          cogl_vertex_buffer_ref              (CoglHandle handle);
    +

    +Increment the reference count for a vertex buffer

    +

    + +

    +
    ++ + + + + + + + + + +

    handle :

    a CoglHandle. +

    Returns :

    the handle. +
    +
    +
    +
    +

    cogl_vertex_buffer_unref ()

    +
    void                cogl_vertex_buffer_unref            (CoglHandle handle);
    +

    +Decrement the reference count for a vertex buffer

    +

    + +

    +
    ++ + + + +

    handle :

    a CoglHandle. +
    +
    +
    +
    +

    cogl_vertex_buffer_add ()

    +
    void                cogl_vertex_buffer_add              (CoglHandle handle,
    +                                                         const char *attribute_name,
    +                                                         guint8 n_components,
    +                                                         GLenum gl_type,
    +                                                         gboolean normalized,
    +                                                         guint16 stride,
    +                                                         const void *pointer);
    +

    +This function lets you add an attribute to a buffer. You either use one +of the built-in names to add standard attributes, like positions, colors +and normals or you can add custom attributes for use in shaders. +

    +

    +Note: The number of vertices declared when first creating the vertex +buffer is used to determine how many attribute values will be read from the +supplied pointer. +

    +

    +Note: the data supplied here isn't copied anywhere until you call +cogl_vertex_buffer_submit, so the supplied pointer must remain valid +until then. +(This is an important optimisation since we can't create the underlying +OpenGL buffer object until we know about all the attributes, and repeatedly +copying large buffers of vertex data may be very costly) If you add +attributes after submitting then you will need to re-call +cogl_vertex_buffer_submit to commit the changes to the GPU. (Be carefull +to minimize the number of calls to cogl_vertex_buffer_submit though) +

    +

    +Note: If you are interleving attributes it is assumed that that each +interleaved attribute starts no farther than +- stride bytes from the other +attributes it is interleved with. I.e. this is ok: +|-0-0-0-0-0-0-0-0-0-0| +This is not ok: +|- - - - -0-0-0-0-0-0 0 0 0 0| +(Though you can have multiple groups of interleved attributes)

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    handle :

    A vertex buffer handle +

    attribute_name :

    The name of your attribute. It should be a valid GLSL + variable name and standard attribute types must use one + of following built-in names: (Note: they correspond to the + built-in names in GLSL) +
      +
    • "gl_Color"
    • +
    • "gl_Normal"
    • +
    • "gl_MultiTexCoord0, gl_MultiTexCoord1, ..."
    • +
    • "gl_Vertex"
    • +
    + To support adding multiple variations of the same attribute + the name can have a detail component, E.g. + "gl_Color::active" or "gl_Color::inactive" +

    n_components :

    The number of components per attribute and must be 1,2,3 or 4 +

    gl_type :

    Specifies the data type of each component (GL_BYTE, GL_UNSIGNED_BYTE, + GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT or + GL_DOUBLE) +

    normalized :

    If GL_TRUE, this specifies that values stored in an integer + format should be mapped into the range [-1.0, 1.0] or [0.1, 1.0] + for unsigned values. If GL_FALSE they are converted to floats + directly. +

    stride :

    This specifies the number of bytes from the start of one attribute + value to the start of the next value (for the same attribute). So + for example with a position interleved with color like this: + XYRGBAXYRGBAXYRGBA, then if each letter represents a byte, the + stride for both attributes is 6. The special value 0 means the + values are stored sequentially in memory. +

    pointer :

    This addresses the first attribute in the vertex array. (This + must remain valid until you call cogl_vertex_buffer_submit) +
    +
    +
    +
    +

    cogl_vertex_buffer_delete ()

    +
    void                cogl_vertex_buffer_delete           (CoglHandle handle,
    +                                                         const char *attribute_name);
    +

    +This function deletes an attribute from a buffer. You will need to +call cogl_vertex_buffer_submit to commit this change to the GPU.

    +

    + +

    +
    ++ + + + + + + + + + +

    handle :

    A vertex buffer handle +

    attribute_name :

    The name of a previously added attribute +
    +
    +
    +
    +

    cogl_vertex_buffer_enable ()

    +
    void                cogl_vertex_buffer_enable           (CoglHandle handle,
    +                                                         const char *attribute_name);
    +

    +This function enables a previosuly added attribute +

    +

    +Since it can be costly to add and remove new attributes to buffers; to make +individual buffers more reuseable it is possible to enable and disable +attributes before using a buffer for drawing. +

    +

    +Note: You don't need to call cogl_vertex_buffer_submit after using this +function

    +

    + +

    +
    ++ + + + + + + + + + +

    handle :

    A vertex buffer handle +

    attribute_name :

    The name of the attribute you want to enable +
    +
    +
    +
    +

    cogl_vertex_buffer_disable ()

    +
    void                cogl_vertex_buffer_disable          (CoglHandle handle,
    +                                                         const char *attribute_name);
    +

    +This function disables a previosuly added attribute +

    +

    +Since it can be costly to add and remove new attributes to buffers; to make +individual buffers more reuseable it is possible to enable and disable +attributes before using a buffer for drawing. +

    +

    +Note: You don't need to call cogl_vertex_buffer_submit after using this +function

    +

    + +

    +
    ++ + + + + + + + + + +

    handle :

    A vertex buffer handle +

    attribute_name :

    The name of the attribute you want to disable +
    +
    +
    +
    +

    cogl_vertex_buffer_submit ()

    +
    void                cogl_vertex_buffer_submit           (CoglHandle handle);
    +

    +This function copies all the user added attributes into buffer objects +managed by the OpenGL driver. +

    +

    +You should aim to minimize calls to this function.

    +

    + +

    +
    ++ + + + +

    handle :

    A vertex buffer handle +
    +
    +
    +
    +

    cogl_vertex_buffer_draw ()

    +
    void                cogl_vertex_buffer_draw             (CoglHandle handle,
    +                                                         GLenum mode,
    +                                                         GLint first,
    +                                                         GLsizei count);
    +

    +This function lets you draw geometry using all or a subset of the +vertices in a vertex buffer.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + +

    handle :

    A vertex buffer handle +

    mode :

    Specifies how the vertices should be interpreted, and should be + a valid GL primitive type: +
      +
    • GL_POINTS
    • +
    • GL_LINE_STRIP
    • +
    • GL_LINE_LOOP
    • +
    • GL_LINES
    • +
    • GL_TRIANGLE_STRIP
    • +
    • GL_TRIANGLE_FAN
    • +
    • GL_TRIANGLES
    • +
    + (Note: only types available in GLES are listed) +

    first :

    Specifies the index of the first vertex you want to draw with +

    count :

    Specifies the number of vertices you want to draw. +
    +
    +
    +
    +

    cogl_vertex_buffer_draw_range_elements ()

    +
    void                cogl_vertex_buffer_draw_range_elements
    +                                                        (CoglHandle handle,
    +                                                         GLenum mode,
    +                                                         GLuint min_index,
    +                                                         GLuint max_index,
    +                                                         GLsizei count,
    +                                                         GLenum indices_type,
    +                                                         const GLvoid *indices);
    +

    +This function lets you use an array of indices to specify the vertices +within your vertex buffer that you want to draw.

    +

    + +

    +
    ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    handle :

    A vertex buffer handle +

    mode :

    Specifies how the vertices should be interpreted, and should be + a valid GL primitive type: +
      +
    • GL_POINTS
    • +
    • GL_LINE_STRIP
    • +
    • GL_LINE_LOOP
    • +
    • GL_LINES
    • +
    • GL_TRIANGLE_STRIP
    • +
    • GL_TRIANGLE_FAN
    • +
    • GL_TRIANGLES
    • +
    + (Note: only types available in GLES are listed) +

    min_index :

    Specifies the minimum vertex index contained in indices +

    max_index :

    Specifies the maximum vertex index contained in indices +

    count :

    Specifies the number of vertices you want to draw. +

    indices_type :

    Specifies the data type used for the indices, and must be + one of: +
      +
    • GL_UNSIGNED_BYTE
    • +
    • GL_UNSIGNED_SHORT
    • +
    • GL_UNSIGNED_INT
    • +
    +

    indices :

    Specifies the address of your array of indices +
    +
    +
    +
    + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/html/index.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/html/index.html --- clutter-0.8.4/doc/reference/cogl/html/index.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/html/index.html 2009-01-30 12:41:02.000000000 +0000 @@ -2,9 +2,9 @@ -COGL 0.8.4 Reference Manual +COGL 0.9.0 Reference Manual - + @@ -16,11 +16,11 @@
    -
    -

    Version 0.8.4

    +
    +

    Version 0.9.0

    -

    +

    Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later @@ -60,15 +60,36 @@ Utility API

    +Matrices — Fuctions for initializing and manipulating 4x4 + matrices. +
    +
    Textures — Fuctions for creating and manipulating textures
    +Materials — Fuctions for creating and manipulating materials +
    +
    Shaders and Programmable Pipeline — Fuctions for accessing the programmable GL pipeline
    Offscreen Buffers — Fuctions for creating and manipulating offscreen frame buffer objects
    +
    +Fixed Point API — Fixed Point API +
    +
    +Color Type +
    +
    +Vertex Buffers — An API for submitting extensible arrays of vertex + attributes to OpenGL in a way that aims to minimise + copying or reformatting of the original data. +
    +
    +Materials — Fuctions for creating and manipulating materials +
    Index
    A. License
    diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/html/index.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/html/index.sgml --- clutter-0.8.4/doc/reference/cogl/html/index.sgml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/html/index.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -22,24 +22,24 @@ - - + + + + - + - - - + @@ -54,8 +54,20 @@ + + + + + + + + + - + + + + @@ -73,16 +85,30 @@ + + + + + + + + + + + + + + @@ -95,10 +121,60 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -120,6 +196,10 @@ + + + + @@ -132,3 +212,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/html/ix01.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/html/ix01.html --- clutter-0.8.4/doc/reference/cogl/html/ix01.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/html/ix01.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,9 +4,9 @@ Index - - - + + + @@ -16,49 +16,147 @@ - + - +

    -Index

    +Index

    C

    +
    CoglAngle, CoglAngle +
    +
    CoglBitmap, CoglBitmap +
    CoglBufferTarget, enum CoglBufferTarget
    +
    CoglClipStackState, CoglClipStackState +
    +
    CoglColor, CoglColor +
    CoglFeatureFlags, enum CoglFeatureFlags
    +
    CoglFixed, CoglFixed +
    CoglFuncPtr, CoglFuncPtr ()
    CoglHandle, CoglHandle
    +
    CoglMaterial, CoglMaterial, CoglMaterial +
    +
    CoglMaterialAlphaFunc, enum CoglMaterialAlphaFunc, enum CoglMaterialAlphaFunc +
    +
    CoglMaterialBlendFactor, enum CoglMaterialBlendFactor, enum CoglMaterialBlendFactor +
    +
    CoglMaterialFlags, enum CoglMaterialFlags, enum CoglMaterialFlags +
    +
    CoglMaterialFlushOption, enum CoglMaterialFlushOption, enum CoglMaterialFlushOption +
    +
    CoglMaterialLayer, CoglMaterialLayer, CoglMaterialLayer +
    +
    CoglMaterialLayerCombineChannels, enum CoglMaterialLayerCombineChannels, enum CoglMaterialLayerCombineChannels +
    +
    CoglMaterialLayerCombineFunc, enum CoglMaterialLayerCombineFunc, enum CoglMaterialLayerCombineFunc +
    +
    CoglMaterialLayerCombineOp, enum CoglMaterialLayerCombineOp, enum CoglMaterialLayerCombineOp +
    +
    CoglMaterialLayerCombineSrc, enum CoglMaterialLayerCombineSrc, enum CoglMaterialLayerCombineSrc +
    +
    CoglMaterialLayerFlags, enum CoglMaterialLayerFlags, enum CoglMaterialLayerFlags +
    +
    CoglMaterialLayerType, enum CoglMaterialLayerType, enum CoglMaterialLayerType +
    +
    CoglMatrix, CoglMatrix +
    CoglPixelFormat, enum CoglPixelFormat
    +
    CoglTextureFlags, enum CoglTextureFlags +
    CoglTextureVertex, CoglTextureVertex
    +
    CoglVertexBufferAttribFlags, enum CoglVertexBufferAttribFlags +
    COGL_AFIRST_BIT, COGL_AFIRST_BIT
    -
    cogl_alpha_func, cogl_alpha_func () +
    cogl_angle_cos, cogl_angle_cos () +
    +
    COGL_ANGLE_FROM_DEG, COGL_ANGLE_FROM_DEG() +
    +
    COGL_ANGLE_FROM_DEGX, COGL_ANGLE_FROM_DEGX() +
    +
    cogl_angle_sin, cogl_angle_sin () +
    +
    cogl_angle_tan, cogl_angle_tan () +
    +
    COGL_ANGLE_TO_DEG, COGL_ANGLE_TO_DEG() +
    +
    COGL_ANGLE_TO_DEGX, COGL_ANGLE_TO_DEGX()
    COGL_A_BIT, COGL_A_BIT
    COGL_BGR_BIT, COGL_BGR_BIT
    +
    cogl_bitmap_free, cogl_bitmap_free () +
    +
    cogl_bitmap_get_size_from_file, cogl_bitmap_get_size_from_file () +
    +
    cogl_bitmap_new_from_file, cogl_bitmap_new_from_file () +
    cogl_check_extension, cogl_check_extension ()
    +
    cogl_clip_ensure, cogl_clip_ensure () +
    cogl_clip_set, cogl_clip_set ()
    +
    cogl_clip_set_from_path, cogl_clip_set_from_path () +
    +
    cogl_clip_set_from_path_preserve, cogl_clip_set_from_path_preserve () +
    cogl_clip_stack_restore, cogl_clip_stack_restore ()
    cogl_clip_stack_save, cogl_clip_stack_save ()
    cogl_clip_unset, cogl_clip_unset ()
    -
    cogl_color, cogl_color () +
    cogl_color, cogl_color +
    +
    cogl_color_copy, cogl_color_copy () +
    +
    cogl_color_free, cogl_color_free () +
    +
    cogl_color_get_alpha, cogl_color_get_alpha () +
    +
    cogl_color_get_alpha_byte, cogl_color_get_alpha_byte () +
    +
    cogl_color_get_alpha_float, cogl_color_get_alpha_float () +
    +
    cogl_color_get_blue, cogl_color_get_blue () +
    +
    cogl_color_get_blue_byte, cogl_color_get_blue_byte () +
    +
    cogl_color_get_blue_float, cogl_color_get_blue_float () +
    +
    cogl_color_get_green, cogl_color_get_green () +
    +
    cogl_color_get_green_byte, cogl_color_get_green_byte () +
    +
    cogl_color_get_green_float, cogl_color_get_green_float () +
    +
    cogl_color_get_red, cogl_color_get_red () +
    +
    cogl_color_get_red_byte, cogl_color_get_red_byte () +
    +
    cogl_color_get_red_float, cogl_color_get_red_float () +
    +
    cogl_color_new, cogl_color_new () +
    +
    cogl_color_set_from_4f, cogl_color_set_from_4f () +
    +
    cogl_color_set_from_4ub, cogl_color_set_from_4ub ()
    cogl_create_context, cogl_create_context ()
    @@ -70,10 +168,102 @@
    cogl_draw_buffer, cogl_draw_buffer ()
    +
    cogl_enable_backface_culling, cogl_enable_backface_culling () +
    cogl_enable_depth_test, cogl_enable_depth_test ()
    cogl_features_available, cogl_features_available ()
    +
    COGL_FIXED_0_5, COGL_FIXED_0_5 +
    +
    COGL_FIXED_1, COGL_FIXED_1 +
    +
    COGL_FIXED_120, COGL_FIXED_120 +
    +
    COGL_FIXED_180, COGL_FIXED_180 +
    +
    COGL_FIXED_240, COGL_FIXED_240 +
    +
    COGL_FIXED_255, COGL_FIXED_255 +
    +
    COGL_FIXED_270, COGL_FIXED_270 +
    +
    COGL_FIXED_2_PI, COGL_FIXED_2_PI +
    +
    COGL_FIXED_30, COGL_FIXED_30 +
    +
    COGL_FIXED_360, COGL_FIXED_360 +
    +
    COGL_FIXED_45, COGL_FIXED_45 +
    +
    COGL_FIXED_60, COGL_FIXED_60 +
    +
    COGL_FIXED_90, COGL_FIXED_90 +
    +
    cogl_fixed_atan2, cogl_fixed_atan2 () +
    +
    cogl_fixed_atani, cogl_fixed_atani () +
    +
    COGL_FIXED_BITS, COGL_FIXED_BITS +
    +
    COGL_FIXED_CEIL, COGL_FIXED_CEIL() +
    +
    cogl_fixed_cos, cogl_fixed_cos () +
    +
    COGL_FIXED_DIV, COGL_FIXED_DIV() +
    +
    COGL_FIXED_EPSILON, COGL_FIXED_EPSILON +
    +
    COGL_FIXED_FAST_DIV, COGL_FIXED_FAST_DIV() +
    +
    COGL_FIXED_FAST_MUL, COGL_FIXED_FAST_MUL() +
    +
    COGL_FIXED_FLOOR, COGL_FIXED_FLOOR() +
    +
    COGL_FIXED_FRACTION, COGL_FIXED_FRACTION() +
    +
    COGL_FIXED_FROM_FLOAT, COGL_FIXED_FROM_FLOAT() +
    +
    COGL_FIXED_FROM_INT, COGL_FIXED_FROM_INT() +
    +
    cogl_fixed_log2, cogl_fixed_log2 () +
    +
    COGL_FIXED_MAX, COGL_FIXED_MAX +
    +
    COGL_FIXED_MIN, COGL_FIXED_MIN +
    +
    COGL_FIXED_MUL, COGL_FIXED_MUL() +
    +
    COGL_FIXED_MUL_DIV, COGL_FIXED_MUL_DIV() +
    +
    COGL_FIXED_PI, COGL_FIXED_PI +
    +
    COGL_FIXED_PI_2, COGL_FIXED_PI_2 +
    +
    COGL_FIXED_PI_4, COGL_FIXED_PI_4 +
    +
    cogl_fixed_pow, cogl_fixed_pow () +
    +
    cogl_fixed_pow2, cogl_fixed_pow2 () +
    +
    COGL_FIXED_Q, COGL_FIXED_Q +
    +
    cogl_fixed_sin, cogl_fixed_sin () +
    +
    cogl_fixed_sqrt, cogl_fixed_sqrt () +
    +
    cogl_fixed_tan, cogl_fixed_tan () +
    +
    COGL_FIXED_TO_DOUBLE, COGL_FIXED_TO_DOUBLE() +
    +
    COGL_FIXED_TO_FLOAT, COGL_FIXED_TO_FLOAT() +
    +
    COGL_FIXED_TO_INT, COGL_FIXED_TO_INT() +
    +
    COGL_FLOAT_TO_INT, COGL_FLOAT_TO_INT() +
    +
    COGL_FLOAT_TO_UINT, COGL_FLOAT_TO_UINT() +
    cogl_fog_set, cogl_fog_set ()
    cogl_frustum, cogl_frustum () @@ -100,6 +290,82 @@
    cogl_is_texture, cogl_is_texture ()
    +
    cogl_material_flush_gl_state, cogl_material_flush_gl_state (), cogl_material_flush_gl_state () +
    +
    cogl_material_get_ambient, cogl_material_get_ambient (), cogl_material_get_ambient () +
    +
    cogl_material_get_cogl_enable_flags, cogl_material_get_cogl_enable_flags (), cogl_material_get_cogl_enable_flags () +
    +
    cogl_material_get_color, cogl_material_get_color (), cogl_material_get_color () +
    +
    cogl_material_get_diffuse, cogl_material_get_diffuse (), cogl_material_get_diffuse () +
    +
    cogl_material_get_emission, cogl_material_get_emission (), cogl_material_get_emission () +
    +
    cogl_material_get_layers, cogl_material_get_layers (), cogl_material_get_layers () +
    +
    cogl_material_get_shininess, cogl_material_get_shininess (), cogl_material_get_shininess () +
    +
    cogl_material_get_specular, cogl_material_get_specular (), cogl_material_get_specular () +
    +
    cogl_material_layer_get_flags, cogl_material_layer_get_flags (), cogl_material_layer_get_flags () +
    +
    cogl_material_layer_get_texture, cogl_material_layer_get_texture (), cogl_material_layer_get_texture () +
    +
    cogl_material_layer_get_type, cogl_material_layer_get_type (), cogl_material_layer_get_type () +
    +
    cogl_material_new, cogl_material_new (), cogl_material_new () +
    +
    cogl_material_ref, cogl_material_ref (), cogl_material_ref () +
    +
    cogl_material_remove_layer, cogl_material_remove_layer (), cogl_material_remove_layer () +
    +
    cogl_material_set_alpha_test_function, cogl_material_set_alpha_test_function (), cogl_material_set_alpha_test_function () +
    +
    cogl_material_set_ambient, cogl_material_set_ambient (), cogl_material_set_ambient () +
    +
    cogl_material_set_ambient_and_diffuse, cogl_material_set_ambient_and_diffuse (), cogl_material_set_ambient_and_diffuse () +
    +
    cogl_material_set_blend_factors, cogl_material_set_blend_factors (), cogl_material_set_blend_factors () +
    +
    cogl_material_set_color, cogl_material_set_color (), cogl_material_set_color () +
    +
    cogl_material_set_color4ub, cogl_material_set_color4ub (), cogl_material_set_color4ub () +
    +
    cogl_material_set_diffuse, cogl_material_set_diffuse (), cogl_material_set_diffuse () +
    +
    cogl_material_set_emission, cogl_material_set_emission (), cogl_material_set_emission () +
    +
    cogl_material_set_layer, cogl_material_set_layer (), cogl_material_set_layer () +
    +
    cogl_material_set_layer_alpha_combine, cogl_material_set_layer_alpha_combine (), cogl_material_set_layer_alpha_combine () +
    +
    cogl_material_set_layer_combine_arg_op, cogl_material_set_layer_combine_arg_op (), cogl_material_set_layer_combine_arg_op () +
    +
    cogl_material_set_layer_combine_arg_src, cogl_material_set_layer_combine_arg_src (), cogl_material_set_layer_combine_arg_src () +
    +
    cogl_material_set_layer_combine_function, cogl_material_set_layer_combine_function (), cogl_material_set_layer_combine_function () +
    +
    cogl_material_set_layer_matrix, cogl_material_set_layer_matrix (), cogl_material_set_layer_matrix () +
    +
    cogl_material_set_layer_rgb_combine, cogl_material_set_layer_rgb_combine (), cogl_material_set_layer_rgb_combine () +
    +
    cogl_material_set_shininess, cogl_material_set_shininess (), cogl_material_set_shininess () +
    +
    cogl_material_set_specular, cogl_material_set_specular (), cogl_material_set_specular () +
    +
    cogl_material_unref, cogl_material_unref (), cogl_material_unref () +
    +
    cogl_matrix_init_identity, cogl_matrix_init_identity () +
    +
    cogl_matrix_multiply, cogl_matrix_multiply () +
    +
    cogl_matrix_rotate, cogl_matrix_rotate () +
    +
    cogl_matrix_scale, cogl_matrix_scale () +
    +
    cogl_matrix_translate, cogl_matrix_translate () +
    cogl_offscreen_blit, cogl_offscreen_blit ()
    cogl_offscreen_blit_region, cogl_offscreen_blit_region () @@ -124,12 +390,16 @@
    cogl_path_fill, cogl_path_fill ()
    +
    cogl_path_fill_preserve, cogl_path_fill_preserve () +
    cogl_path_line, cogl_path_line ()
    cogl_path_line_to, cogl_path_line_to ()
    cogl_path_move_to, cogl_path_move_to ()
    +
    cogl_path_new, cogl_path_new () +
    cogl_path_polygon, cogl_path_polygon ()
    cogl_path_polyline, cogl_path_polyline () @@ -146,12 +416,16 @@
    cogl_path_stroke, cogl_path_stroke ()
    +
    cogl_path_stroke_preserve, cogl_path_stroke_preserve () +
    cogl_perspective, cogl_perspective ()
    COGL_PIXEL_FORMAT_24, COGL_PIXEL_FORMAT_24
    COGL_PIXEL_FORMAT_32, COGL_PIXEL_FORMAT_32
    +
    cogl_polygon, cogl_polygon () +
    cogl_pop_matrix, cogl_pop_matrix ()
    COGL_PREMULT_BIT, COGL_PREMULT_BIT @@ -166,24 +440,46 @@
    cogl_program_uniform_1f, cogl_program_uniform_1f ()
    +
    cogl_program_uniform_1i, cogl_program_uniform_1i () +
    +
    cogl_program_uniform_float, cogl_program_uniform_float () +
    +
    cogl_program_uniform_int, cogl_program_uniform_int () +
    +
    cogl_program_uniform_matrix, cogl_program_uniform_matrix () +
    cogl_program_unref, cogl_program_unref ()
    cogl_program_use, cogl_program_use ()
    cogl_push_matrix, cogl_push_matrix ()
    +
    COGL_RADIANS_TO_DEGREES, COGL_RADIANS_TO_DEGREES +
    cogl_rectangle, cogl_rectangle ()
    -
    cogl_rectanglex, cogl_rectanglex () +
    cogl_rectangles_with_texture_coords, cogl_rectangles_with_texture_coords ()
    -
    cogl_rotate, cogl_rotate () +
    cogl_rectangle_with_multitexture_coords, cogl_rectangle_with_multitexture_coords () +
    +
    cogl_rectangle_with_texture_coords, cogl_rectangle_with_texture_coords ()
    -
    cogl_rotatex, cogl_rotatex () +
    cogl_rotate, cogl_rotate ()
    cogl_scale, cogl_scale ()
    cogl_setup_viewport, cogl_setup_viewport ()
    +
    cogl_set_source, cogl_set_source (), cogl_set_source () +
    +
    cogl_set_source_color, cogl_set_source_color () +
    +
    cogl_set_source_color4f, cogl_set_source_color4f () +
    +
    cogl_set_source_color4ub, cogl_set_source_color4ub () +
    +
    cogl_set_source_texture, cogl_set_source_texture () +
    cogl_shader_compile, cogl_shader_compile ()
    cogl_shader_get_info_log, cogl_shader_get_info_log () @@ -196,6 +492,14 @@
    cogl_shader_unref, cogl_shader_unref ()
    +
    cogl_sqrti, cogl_sqrti () +
    +
    COGL_SQRTI_ARG_10_PERCENT, COGL_SQRTI_ARG_10_PERCENT +
    +
    COGL_SQRTI_ARG_5_PERCENT, COGL_SQRTI_ARG_5_PERCENT +
    +
    COGL_SQRTI_ARG_MAX, COGL_SQRTI_ARG_MAX +
    cogl_texture_get_data, cogl_texture_get_data ()
    cogl_texture_get_format, cogl_texture_get_format () @@ -216,6 +520,8 @@
    cogl_texture_is_sliced, cogl_texture_is_sliced ()
    +
    cogl_texture_new_from_bitmap, cogl_texture_new_from_bitmap () +
    cogl_texture_new_from_data, cogl_texture_new_from_data ()
    cogl_texture_new_from_file, cogl_texture_new_from_file () @@ -224,10 +530,6 @@
    cogl_texture_new_with_size, cogl_texture_new_with_size ()
    -
    cogl_texture_polygon, cogl_texture_polygon () -
    -
    cogl_texture_rectangle, cogl_texture_rectangle () -
    cogl_texture_ref, cogl_texture_ref ()
    cogl_texture_set_filters, cogl_texture_set_filters () @@ -238,14 +540,36 @@
    cogl_translate, cogl_translate ()
    -
    cogl_translatex, cogl_translatex () -
    COGL_UNORDERED_MASK, COGL_UNORDERED_MASK
    COGL_UNPREMULT_MASK, COGL_UNPREMULT_MASK
    cogl_util_next_p2, cogl_util_next_p2 ()
    +
    cogl_vertex_buffer_add, cogl_vertex_buffer_add () +
    +
    COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_MASK, COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_MASK +
    +
    COGL_VERTEX_BUFFER_ATTRIB_FLAG_TYPE_MASK, COGL_VERTEX_BUFFER_ATTRIB_FLAG_TYPE_MASK +
    +
    cogl_vertex_buffer_delete, cogl_vertex_buffer_delete () +
    +
    cogl_vertex_buffer_disable, cogl_vertex_buffer_disable () +
    +
    cogl_vertex_buffer_draw, cogl_vertex_buffer_draw () +
    +
    cogl_vertex_buffer_draw_range_elements, cogl_vertex_buffer_draw_range_elements () +
    +
    cogl_vertex_buffer_enable, cogl_vertex_buffer_enable () +
    +
    cogl_vertex_buffer_new, cogl_vertex_buffer_new () +
    +
    cogl_vertex_buffer_ref, cogl_vertex_buffer_ref () +
    +
    cogl_vertex_buffer_submit, cogl_vertex_buffer_submit () +
    +
    cogl_vertex_buffer_unref, cogl_vertex_buffer_unref () +
    cogl_viewport, cogl_viewport ()
    diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/html/license.html /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/html/license.html --- clutter-0.8.4/doc/reference/cogl/html/license.html 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/html/license.html 2009-01-30 12:41:02.000000000 +0000 @@ -4,8 +4,8 @@ Appendix A. License - - + + @@ -18,7 +18,7 @@ Prev   Home -COGL 0.8.4 Reference Manual +COGL 0.9.0 Reference Manual  
    diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/Makefile.am --- clutter-0.8.4/doc/reference/cogl/Makefile.am 2008-09-29 15:16:27.000000000 +0100 +++ clutter-0.9.0/doc/reference/cogl/Makefile.am 2009-01-28 08:12:46.000000000 +0000 @@ -55,11 +55,10 @@ # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES=\ cogl-bitmap.h \ - cogl-context.h \ - cogl-defines.h \ - cogl-internal.h \ - cogl-primitives.h \ - cogl-texture.h \ + cogl-defines-gl.h \ + cogl-defines-gles.h \ + cogl-handle.h \ + cogl-primitives.h \ gl \ gles diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/Makefile.in --- clutter-0.8.4/doc/reference/cogl/Makefile.in 2008-11-28 18:22:49.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/Makefile.in 2009-01-28 16:48:58.000000000 +0000 @@ -100,7 +100,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -125,6 +124,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -275,11 +275,10 @@ # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES = \ cogl-bitmap.h \ - cogl-context.h \ - cogl-defines.h \ - cogl-internal.h \ - cogl-primitives.h \ - cogl-texture.h \ + cogl-defines-gl.h \ + cogl-defines-gles.h \ + cogl-handle.h \ + cogl-primitives.h \ gl \ gles diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/tmpl/cogl-attributes-buffer.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/tmpl/cogl-attributes-buffer.sgml --- clutter-0.8.4/doc/reference/cogl/tmpl/cogl-attributes-buffer.sgml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/cogl/tmpl/cogl-attributes-buffer.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,19 @@ + +Attributes Buffer API + + + + + + + + + + + + + + + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/tmpl/cogl-color.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/tmpl/cogl-color.sgml --- clutter-0.8.4/doc/reference/cogl/tmpl/cogl-color.sgml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/cogl/tmpl/cogl-color.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,182 @@ + +Color Type + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@Returns: + + + + + + + +@color: +@Returns: + + + + + + + +@color: + + + + + + + +@dest: +@red: +@green: +@blue: +@alpha: + + + + + + + +@dest: +@red: +@green: +@blue: +@alpha: + + + + + + + +@color: +@Returns: + + + + + + + +@color: +@Returns: + + + + + + + +@color: +@Returns: + + + + + + + +@color: +@Returns: + + + + + + + +@color: +@Returns: + + + + + + + +@color: +@Returns: + + + + + + + +@color: +@Returns: + + + + + + + +@color: +@Returns: + + + + + + + +@color: +@Returns: + + + + + + + +@color: +@Returns: + + + + + + + +@color: +@Returns: + + + + + + + +@color: +@Returns: + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/tmpl/cogl-fixed.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/tmpl/cogl-fixed.sgml --- clutter-0.8.4/doc/reference/cogl/tmpl/cogl-fixed.sgml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/cogl/tmpl/cogl-fixed.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,483 @@ + +Fixed Point API + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@a: +@b: + + + + + + + +@a: +@b: + + + + + + + +@a: +@b: +@c: + + + + + + + +@a: +@b: + + + + + + + +@a: +@b: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@x: +@Returns: + + + + + + + +@a: +@b: +@Returns: + + + + + + + +@a: +@Returns: + + + + + + + +@angle: +@Returns: + + + + + + + +@x: +@Returns: + + + + + + + +@x: +@y: +@Returns: + + + + + + + +@x: +@Returns: + + + + + + + +@angle: +@Returns: + + + + + + + +@x: +@Returns: + + + + + + + +@angle: +@Returns: + + + + + + + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@angle: +@Returns: + + + + + + + +@angle: +@Returns: + + + + + + + +@angle: +@Returns: + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/tmpl/cogl-material.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/tmpl/cogl-material.sgml --- clutter-0.8.4/doc/reference/cogl/tmpl/cogl-material.sgml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/cogl/tmpl/cogl-material.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,488 @@ + +Materials + + + + + + + + + + + + + + + + + + + + + + +@ref_count: +@flags: +@unlit: +@ambient: +@diffuse: +@specular: +@emission: +@shininess: +@alpha_func: +@alpha_func_reference: +@blend_src_factor: +@blend_dst_factor: +@layers: + + + + + + +@COGL_MATERIAL_FLAG_ENABLE_BLEND: +@COGL_MATERIAL_FLAG_SHOWN_SAMPLER_WARNING: +@COGL_MATERIAL_FLAG_DIRTY: +@COGL_MATERIAL_FLAG_LAYERS_DIRTY: +@COGL_MATERIAL_FLAG_DEFAULT_COLOR: +@COGL_MATERIAL_FLAG_DEFAULT_GL_MATERIAL: +@COGL_MATERIAL_FLAG_DEFAULT_ALPHA_FUNC: +@COGL_MATERIAL_FLAG_DEFAULT_BLEND_FUNC: + + + + + + +@Returns: + + + + + + + +@handle: +@Returns: + + + + + + + +@handle: + + + + + + + +@material: +@ambient: + + + + + + + +@handle: +@ambient: + + + + + + + +@material: +@color: + + + + + + + +@material: +@color: + + + + + + + +@handle: +@red: +@green: +@blue: +@alpha: + + + + + + + +@handle: +@color: + + + + + + + +@material: +@diffuse: + + + + + + + +@handle: +@diffuse: + + + + + + + +@material: +@emission: + + + + + + + +@handle: +@emission: + + + + + + + +@material: +@specular: + + + + + + + +@handle: +@specular: + + + + + + + +@material: +@shininess: + + + + + + + +@handle: +@Returns: + + + + + + + +@material: + + + + + + + +@COGL_MATERIAL_ALPHA_FUNC_NEVER: +@COGL_MATERIAL_ALPHA_FUNC_LESS: +@COGL_MATERIAL_ALPHA_FUNC_EQUAL: +@COGL_MATERIAL_ALPHA_FUNC_LEQUAL: +@COGL_MATERIAL_ALPHA_FUNC_GREATER: +@COGL_MATERIAL_ALPHA_FUNC_NOTEQUAL: +@COGL_MATERIAL_ALPHA_FUNC_GEQUAL: +@COGL_MATERIAL_ALPHA_FUNC_ALWAYS: + + + + + + +@material: +@alpha_func: +@alpha_reference: + + + + + + + +@COGL_MATERIAL_BLEND_FACTOR_ZERO: +@COGL_MATERIAL_BLEND_FACTOR_ONE: +@COGL_MATERIAL_BLEND_FACTOR_SRC_COLOR: +@COGL_MATERIAL_BLEND_FACTOR_DST_COLOR: +@COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_SRC_COLOR: +@COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_DST_COLOR: +@COGL_MATERIAL_BLEND_FACTOR_SRC_ALPHA: +@COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA: +@COGL_MATERIAL_BLEND_FACTOR_DST_ALPHA: +@COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_DST_ALPHA: +@COGL_MATERIAL_BLEND_FACTOR_SRC_ALPHA_SATURATE: + + + + + + +@material: +@src_factor: +@dst_factor: + + + + + + + +@ref_count: +@index: +@flags: +@texture: +@texture_combine_rgb_func: +@texture_combine_rgb_src: +@texture_combine_rgb_op: +@texture_combine_alpha_func: +@texture_combine_alpha_src: +@texture_combine_alpha_op: +@matrix: + + + + + + +@material: +@layer_index: +@texture: + + + + + + + +@material: +@layer_index: + + + + + + + +@COGL_MATERIAL_LAYER_COMBINE_FUNC_REPLACE: +@COGL_MATERIAL_LAYER_COMBINE_FUNC_MODULATE: +@COGL_MATERIAL_LAYER_COMBINE_FUNC_ADD: +@COGL_MATERIAL_LAYER_COMBINE_FUNC_ADD_SIGNED: +@COGL_MATERIAL_LAYER_COMBINE_FUNC_INTERPOLATE: +@COGL_MATERIAL_LAYER_COMBINE_FUNC_SUBTRACT: +@COGL_MATERIAL_LAYER_COMBINE_FUNC_DOT3_RGB: +@COGL_MATERIAL_LAYER_COMBINE_FUNC_DOT3_RGBA: + + + + + + +@material: +@layer_index: +@channels: +@func: + + + + + + + +@COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGB: +@COGL_MATERIAL_LAYER_COMBINE_CHANNELS_ALPHA: +@COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA: + + + + + + +@COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE: +@COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE0: +@COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE1: +@COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE2: +@COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE3: +@COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE4: +@COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE5: +@COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE6: +@COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE7: +@COGL_MATERIAL_LAYER_COMBINE_SRC_CONSTANT: +@COGL_MATERIAL_LAYER_COMBINE_SRC_PRIMARY_COLOR: +@COGL_MATERIAL_LAYER_COMBINE_SRC_PREVIOUS: + + + + + + +@material: +@layer_index: +@argument: +@channels: +@src: + + + + + + + +@COGL_MATERIAL_LAYER_COMBINE_OP_SRC_COLOR: +@COGL_MATERIAL_LAYER_COMBINE_OP_ONE_MINUS_SRC_COLOR: +@COGL_MATERIAL_LAYER_COMBINE_OP_SRC_ALPHA: +@COGL_MATERIAL_LAYER_COMBINE_OP_ONE_MINUS_SRC_ALPHA: + + + + + + +@material: +@layer_index: +@argument: +@channels: +@op: + + + + + + + +@material: +@layer_index: +@matrix: + + + + + + + + + + + + + + + + + + + + + +@handle: +@Returns: + + + + + + + +@COGL_MATERIAL_FLUSH_FALLBACK_MASK: +@COGL_MATERIAL_FLUSH_DISABLE_MASK: +@COGL_MATERIAL_FLUSH_LAYER0_OVERRIDE: + + + + + + +@material: +@Varargs: + + + + + + + +@material_handle: +@Returns: + + + + + + + +@COGL_MATERIAL_LAYER_TYPE_TEXTURE: + + + + + + +@layer_handle: +@Returns: + + + + + + + +@COGL_MATERIAL_LAYER_FLAG_HAS_USER_MATRIX: + + + + + + +@layer_handle: +@Returns: + + + + + + + +@layer_handle: +@Returns: + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/tmpl/cogl-matrix.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/tmpl/cogl-matrix.sgml --- clutter-0.8.4/doc/reference/cogl/tmpl/cogl-matrix.sgml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/cogl/tmpl/cogl-matrix.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,93 @@ + +Matrices + + + + + + + + + + + + + + + + + + + + + + +@xx: +@yx: +@zx: +@wx: +@xy: +@yy: +@zy: +@wy: +@xz: +@yz: +@zz: +@wz: +@xw: +@yw: +@zw: +@ww: + + + + + + +@matrix: + + + + + + + +@result: +@a: +@b: + + + + + + + +@matrix: +@angle: +@x: +@y: +@z: + + + + + + + +@matrix: +@x: +@y: +@z: + + + + + + + +@matrix: +@sx: +@sy: +@sz: + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/tmpl/cogl-mesh.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/tmpl/cogl-mesh.sgml --- clutter-0.8.4/doc/reference/cogl/tmpl/cogl-mesh.sgml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/cogl/tmpl/cogl-mesh.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,145 @@ + +Mesh API + + + + + + + + + + + + + + + + + + + + + + +@n_vertices: +@Returns: + + + + + + + +@handle: +@Returns: + + + + + + + +@handle: + + + + + + + +@COGL_MESH_ATTRIBUTE_FLAG_COLOR_ARRAY: +@COGL_MESH_ATTRIBUTE_FLAG_NORMAL_ARRAY: +@COGL_MESH_ATTRIBUTE_FLAG_TEXTURE_COORD_ARRAY: +@COGL_MESH_ATTRIBUTE_FLAG_VERTEX_ARRAY: +@COGL_MESH_ATTRIBUTE_FLAG_CUSTOM_ARRAY: +@COGL_MESH_ATTRIBUTE_FLAG_INVALID: +@COGL_MESH_ATTRIBUTE_FLAG_NORMALIZED: +@COGL_MESH_ATTRIBUTE_FLAG_ENABLED: +@COGL_MESH_ATTRIBUTE_FLAG_INFREQUENT_RESUBMIT: +@COGL_MESH_ATTRIBUTE_FLAG_FREQUENT_RESUBMIT: +@COGL_MESH_ATTRIBUTE_FLAG_GL_TYPE_BYTE: +@COGL_MESH_ATTRIBUTE_FLAG_GL_TYPE_UNSIGNED_BYTE: +@COGL_MESH_ATTRIBUTE_FLAG_GL_TYPE_SHORT: +@COGL_MESH_ATTRIBUTE_FLAG_GL_TYPE_UNSIGNED_SHORT: +@COGL_MESH_ATTRIBUTE_FLAG_GL_TYPE_INT: +@COGL_MESH_ATTRIBUTE_FLAG_GL_TYPE_UNSIGNED_INT: +@COGL_MESH_ATTRIBUTE_FLAG_GL_TYPE_FLOAT: +@COGL_MESH_ATTRIBUTE_FLAG_GL_TYPE_DOUBLE: +@COGL_MESH_ATTRIBUTE_FLAG_SUBMITTED: +@COGL_MESH_ATTRIBUTE_FLAG_UNUSED: + + + + + + +@handle: +@attribute_name: +@n_components: +@gl_type: +@normalized: +@stride: +@pointer: + + + + + + + +@handle: +@attribute_name: + + + + + + + +@handle: +@attribute_name: + + + + + + + +@handle: +@attribute_name: + + + + + + + +@handle: +@mode: +@first: +@count: + + + + + + + +@handle: +@mode: +@start: +@end: +@count: +@type: +@indices: + + + + + + + +@handle: + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/tmpl/cogl-primitives.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/tmpl/cogl-primitives.sgml --- clutter-0.8.4/doc/reference/cogl/tmpl/cogl-primitives.sgml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/tmpl/cogl-primitives.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -17,22 +17,7 @@ - - - - - -@color: - - - - - - - - - - + @@ -185,25 +170,134 @@ @radius_y: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@color: + + + + + + + +@red: +@green: +@blue: +@alpha: + + + + + + + +@red: +@green: +@blue: +@alpha: + + + + + + + +@texture_handle: + + + + + + + + + -@x: -@y: -@width: -@height: +@x1: +@y1: +@x2: +@y2: - + -@x: -@y: -@width: -@height: +@vertices: +@n_vertices: +@use_color: + + + + + + + +@x1: +@y1: +@x2: +@y2: +@tex_coords: +@tex_coords_len: + + + + + + + +@x1: +@y1: +@x2: +@y2: +@tx1: +@ty1: +@tx2: +@ty2: + + + + + + + +@verts: +@n_rects: diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/tmpl/cogl.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/tmpl/cogl.sgml --- clutter-0.8.4/doc/reference/cogl/tmpl/cogl.sgml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/tmpl/cogl.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -198,15 +198,6 @@ @x: @y: - - - - - - - -@x: -@y: @z: @@ -220,7 +211,7 @@ @z: - + @@ -231,16 +222,14 @@ @z: - + -@angle: -@x: -@y: -@z: - +@stacks: +@stack_dirty: +@stencil_used: @@ -253,6 +242,20 @@ @height: + + + + + + + + + + + + + + @@ -274,6 +277,13 @@ + + + + + + + @@ -282,13 +292,12 @@ @setting: - + -@func: -@ref: +@setting: diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/tmpl/cogl-shaders.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/tmpl/cogl-shaders.sgml --- clutter-0.8.4/doc/reference/cogl/tmpl/cogl-shaders.sgml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/tmpl/cogl-shaders.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -167,3 +167,46 @@ @value: + + + + + +@uniform_no: +@value: + + + + + + + +@uniform_no: +@size: +@count: +@value: + + + + + + + +@uniform_no: +@size: +@count: +@value: + + + + + + + +@uniform_no: +@size: +@count: +@transpose: +@value: + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/tmpl/cogl-texture.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/tmpl/cogl-texture.sgml --- clutter-0.8.4/doc/reference/cogl/tmpl/cogl-texture.sgml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/tmpl/cogl-texture.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -29,6 +29,14 @@ @ty: @color: + + + + + +@COGL_TEXTURE_NONE: +@COGL_TEXTURE_AUTO_MIPMAP: + @@ -37,7 +45,7 @@ @width: @height: @max_waste: -@auto_mipmap: +@flags: @internal_format: @Returns: @@ -49,7 +57,7 @@ @filename: @max_waste: -@auto_mipmap: +@flags: @internal_format: @error: @Returns: @@ -63,7 +71,7 @@ @width: @height: @max_waste: -@auto_mipmap: +@flags: @format: @internal_format: @rowstride: @@ -86,6 +94,18 @@ @Returns: + + + + + +@bitmap: +@max_waste: +@flags: +@internal_format: +@Returns: + + @@ -95,6 +115,23 @@ @Returns: + + + + + +@handle: +@Returns: + + + + + + + +@handle: + + @@ -220,47 +257,38 @@ @Returns: - + -@handle: -@Returns: - - + -@handle: +@filename: +@error: +@Returns: - + -@handle: -@x1: -@y1: -@x2: -@y2: -@tx1: -@ty1: -@tx2: -@ty2: +@bmp: - + -@handle: -@n_vertices: -@vertices: -@use_color: +@filename: +@width: +@height: +@Returns: diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/tmpl/cogl-unused.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/tmpl/cogl-unused.sgml --- clutter-0.8.4/doc/reference/cogl/tmpl/cogl-unused.sgml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/tmpl/cogl-unused.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,267 @@ + + + + + + + + + + + + + + + + + + + + + +Attributes Buffer API + + + + + + + + + + + + + + + + + + + + + + + +Mesh API + + + + + + + +@COGL_MESH_ATTRIBUTE_FLAG_COLOR_ARRAY: +@COGL_MESH_ATTRIBUTE_FLAG_NORMAL_ARRAY: +@COGL_MESH_ATTRIBUTE_FLAG_TEXTURE_COORD_ARRAY: +@COGL_MESH_ATTRIBUTE_FLAG_VERTEX_ARRAY: +@COGL_MESH_ATTRIBUTE_FLAG_CUSTOM_ARRAY: +@COGL_MESH_ATTRIBUTE_FLAG_INVALID: +@COGL_MESH_ATTRIBUTE_FLAG_NORMALIZED: +@COGL_MESH_ATTRIBUTE_FLAG_ENABLED: +@COGL_MESH_ATTRIBUTE_FLAG_INFREQUENT_RESUBMIT: +@COGL_MESH_ATTRIBUTE_FLAG_FREQUENT_RESUBMIT: +@COGL_MESH_ATTRIBUTE_FLAG_GL_TYPE_BYTE: +@COGL_MESH_ATTRIBUTE_FLAG_GL_TYPE_UNSIGNED_BYTE: +@COGL_MESH_ATTRIBUTE_FLAG_GL_TYPE_SHORT: +@COGL_MESH_ATTRIBUTE_FLAG_GL_TYPE_UNSIGNED_SHORT: +@COGL_MESH_ATTRIBUTE_FLAG_GL_TYPE_INT: +@COGL_MESH_ATTRIBUTE_FLAG_GL_TYPE_UNSIGNED_INT: +@COGL_MESH_ATTRIBUTE_FLAG_GL_TYPE_FLOAT: +@COGL_MESH_ATTRIBUTE_FLAG_GL_TYPE_DOUBLE: +@COGL_MESH_ATTRIBUTE_FLAG_SUBMITTED: +@COGL_MESH_ATTRIBUTE_FLAG_UNUSED: + + + + + + +@func: +@ref: + + + + + + +@dest: +@red: +@green: +@blue: +@alpha: + + + + + + +@dest: +@red: +@green: +@blue: +@alpha: + + + + + + +@handle: +@attribute_name: +@n_components: +@gl_type: +@normalized: +@stride: +@pointer: + + + + + + +@handle: +@attribute_name: + + + + + + +@handle: +@attribute_name: + + + + + + +@handle: +@mode: +@first: +@count: + + + + + + +@handle: +@mode: +@start: +@end: +@count: +@type: +@indices: + + + + + + +@handle: +@attribute_name: + + + + + + +@n_vertices: +@Returns: + + + + + + +@handle: +@Returns: + + + + + + +@handle: + + + + + + +@handle: + + + + + + +@x: +@y: +@width: +@height: + + + + + + +@angle: +@x: +@y: +@z: + + + + + + +@red: +@green: +@blue: +@alpha: + + + + + + +@handle: +@verts: +@n_rects: + + + + + + +@handle: +@n_vertices: +@vertices: +@use_color: + + + + + + +@handle: +@x1: +@y1: +@x2: +@y2: +@tx1: +@ty1: +@tx2: +@ty2: + + + + + + +@x: +@y: +@z: + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/tmpl/cogl-util.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/tmpl/cogl-util.sgml --- clutter-0.8.4/doc/reference/cogl/tmpl/cogl-util.sgml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/tmpl/cogl-util.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -67,6 +67,7 @@ @COGL_FEATURE_OFFSCREEN_BLIT: @COGL_FEATURE_FOUR_CLIP_PLANES: @COGL_FEATURE_STENCIL_BUFFER: +@COGL_FEATURE_VBOS: diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/tmpl/cogl-vertex-buffer.sgml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/tmpl/cogl-vertex-buffer.sgml --- clutter-0.8.4/doc/reference/cogl/tmpl/cogl-vertex-buffer.sgml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/cogl/tmpl/cogl-vertex-buffer.sgml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,159 @@ + +Vertex Buffers + + + + + + + + + + + + + + + + + + + + + + +@COGL_VERTEX_BUFFER_ATTRIB_FLAG_COLOR_ARRAY: +@COGL_VERTEX_BUFFER_ATTRIB_FLAG_NORMAL_ARRAY: +@COGL_VERTEX_BUFFER_ATTRIB_FLAG_TEXTURE_COORD_ARRAY: +@COGL_VERTEX_BUFFER_ATTRIB_FLAG_VERTEX_ARRAY: +@COGL_VERTEX_BUFFER_ATTRIB_FLAG_CUSTOM_ARRAY: +@COGL_VERTEX_BUFFER_ATTRIB_FLAG_INVALID: +@COGL_VERTEX_BUFFER_ATTRIB_FLAG_NORMALIZED: +@COGL_VERTEX_BUFFER_ATTRIB_FLAG_ENABLED: +@COGL_VERTEX_BUFFER_ATTRIB_FLAG_INFREQUENT_RESUBMIT: +@COGL_VERTEX_BUFFER_ATTRIB_FLAG_FREQUENT_RESUBMIT: +@COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_BYTE: +@COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_BYTE: +@COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_SHORT: +@COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_SHORT: +@COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_INT: +@COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_INT: +@COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_FLOAT: +@COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_DOUBLE: +@COGL_VERTEX_BUFFER_ATTRIB_FLAG_SUBMITTED: +@COGL_VERTEX_BUFFER_ATTRIB_FLAG_UNUSED: + + + + + + + + + + + + + + + + + + + + +@n_vertices: +@Returns: + + + + + + + +@handle: +@Returns: + + + + + + + +@handle: + + + + + + + +@handle: +@attribute_name: +@n_components: +@gl_type: +@normalized: +@stride: +@pointer: + + + + + + + +@handle: +@attribute_name: + + + + + + + +@handle: +@attribute_name: + + + + + + + +@handle: +@attribute_name: + + + + + + + +@handle: + + + + + + + +@handle: +@mode: +@first: +@count: + + + + + + + +@handle: +@mode: +@min_index: +@max_index: +@count: +@indices_type: +@indices: + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/version.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/version.xml --- clutter-0.8.4/doc/reference/cogl/version.xml 2008-12-01 11:36:55.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/version.xml 2009-01-30 12:31:31.000000000 +0000 @@ -1 +1 @@ -0.8.4 \ No newline at end of file +0.9.0 \ No newline at end of file diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/xml/cogl-color.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/xml/cogl-color.xml --- clutter-0.8.4/doc/reference/cogl/xml/cogl-color.xml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/cogl/xml/cogl-color.xml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,390 @@ + + +]> + + +Color Type +3 +COGL Library + + + +Color Type + + + + + +Synopsis + + + CoglColor; +CoglColor* cogl_color_new (void); +CoglColor* cogl_color_copy (const CoglColor *color); +void cogl_color_free (CoglColor *color); +void cogl_color_set_from_4ub (CoglColor *dest, + guint8 red, + guint8 green, + guint8 blue, + guint8 alpha); +void cogl_color_set_from_4f (CoglColor *dest, + float red, + float green, + float blue, + float alpha); + +float cogl_color_get_red (const CoglColor *color); +float cogl_color_get_green (const CoglColor *color); +float cogl_color_get_blue (const CoglColor *color); +float cogl_color_get_alpha (const CoglColor *color); + +unsigned char cogl_color_get_red_byte (const CoglColor *color); +unsigned char cogl_color_get_green_byte (const CoglColor *color); +unsigned char cogl_color_get_blue_byte (const CoglColor *color); +unsigned char cogl_color_get_alpha_byte (const CoglColor *color); + +float cogl_color_get_red_float (const CoglColor *color); +float cogl_color_get_green_float (const CoglColor *color); +float cogl_color_get_blue_float (const CoglColor *color); +float cogl_color_get_alpha_float (const CoglColor *color); + + + + + + + + + + + + +Description + + + + + + +Details + +CoglColor +CoglColortypedef struct { +} CoglColor; + + +A structure for holding a color definition. The contents of +the CoglColor structure are private and should never by accessed +directly. + + +Since 1.0 + + +cogl_color_new () +cogl_color_newCoglColor* cogl_color_new (void); + + + +Returns : + + + + + +cogl_color_copy () +cogl_color_copyCoglColor* cogl_color_copy (const CoglColor *color); + + + +color : + + +Returns : + + + + + +cogl_color_free () +cogl_color_freevoid cogl_color_free (CoglColor *color); + + + +color : + + + + + + +cogl_color_set_from_4ub () +cogl_color_set_from_4ubvoid cogl_color_set_from_4ub (CoglColor *dest, + guint8 red, + guint8 green, + guint8 blue, + guint8 alpha); + +Sets the values of the passed channels into a CoglColor. + + + +dest : + return location for a CoglColor + +red : + value of the red channel, between 0 and 255 + +green : + value of the green channel, between 0 and 255 + +blue : + value of the blue channel, between 0 and 255 + +alpha : + value of the alpha channel, between 0 and 255 + +Since 1.0 + + +cogl_color_set_from_4f () +cogl_color_set_from_4fvoid cogl_color_set_from_4f (CoglColor *dest, + float red, + float green, + float blue, + float alpha); + +Sets the values of the passed channels into a CoglColor + + + +dest : + return location for a CoglColor + +red : + value of the red channel, between 0 and 1.0 + +green : + value of the green channel, between 0 and 1.0 + +blue : + value of the blue channel, between 0 and 1.0 + +alpha : + value of the alpha channel, between 0 and 1.0 + +Since 1.0 + + +cogl_color_get_red () +cogl_color_get_redfloat cogl_color_get_red (const CoglColor *color); + +Retrieves the red channel of color as a fixed point +value between 0 and 1.0. + + + +color : + a CoglColor + +Returns : the red channel of the passed color + + +Since 1.0 + + +cogl_color_get_green () +cogl_color_get_greenfloat cogl_color_get_green (const CoglColor *color); + +Retrieves the green channel of color as a fixed point +value between 0 and 1.0. + + + +color : + a CoglColor + +Returns : the green channel of the passed color + + +Since 1.0 + + +cogl_color_get_blue () +cogl_color_get_bluefloat cogl_color_get_blue (const CoglColor *color); + +Retrieves the blue channel of color as a fixed point +value between 0 and 1.0. + + + +color : + a CoglColor + +Returns : the blue channel of the passed color + + +Since 1.0 + + +cogl_color_get_alpha () +cogl_color_get_alphafloat cogl_color_get_alpha (const CoglColor *color); + +Retrieves the alpha channel of color as a fixed point +value between 0 and 1.0. + + + +color : + a CoglColor + +Returns : the alpha channel of the passed color + + +Since 1.0 + + +cogl_color_get_red_byte () +cogl_color_get_red_byteunsigned char cogl_color_get_red_byte (const CoglColor *color); + +Retrieves the red channel of color as a byte value +between 0 and 255 + + + +color : + a CoglColor + +Returns : the red channel of the passed color + + +Since 1.0 + + +cogl_color_get_green_byte () +cogl_color_get_green_byteunsigned char cogl_color_get_green_byte (const CoglColor *color); + +Retrieves the green channel of color as a byte value +between 0 and 255 + + + +color : + a CoglColor + +Returns : the green channel of the passed color + + +Since 1.0 + + +cogl_color_get_blue_byte () +cogl_color_get_blue_byteunsigned char cogl_color_get_blue_byte (const CoglColor *color); + +Retrieves the blue channel of color as a byte value +between 0 and 255 + + + +color : + a CoglColor + +Returns : the blue channel of the passed color + + +Since 1.0 + + +cogl_color_get_alpha_byte () +cogl_color_get_alpha_byteunsigned char cogl_color_get_alpha_byte (const CoglColor *color); + +Retrieves the alpha channel of color as a byte value +between 0 and 255 + + + +color : + a CoglColor + +Returns : the alpha channel of the passed color + + +Since 1.0 + + +cogl_color_get_red_float () +cogl_color_get_red_floatfloat cogl_color_get_red_float (const CoglColor *color); + +Retrieves the red channel of color as a floating point +value between 0.0 and 1.0 + + + +color : + a CoglColor + +Returns : the red channel of the passed color + + +Since 1.0 + + +cogl_color_get_green_float () +cogl_color_get_green_floatfloat cogl_color_get_green_float (const CoglColor *color); + +Retrieves the green channel of color as a floating point +value between 0.0 and 1.0 + + + +color : + a CoglColor + +Returns : the green channel of the passed color + + +Since 1.0 + + +cogl_color_get_blue_float () +cogl_color_get_blue_floatfloat cogl_color_get_blue_float (const CoglColor *color); + +Retrieves the blue channel of color as a floating point +value between 0.0 and 1.0 + + + +color : + a CoglColor + +Returns : the blue channel of the passed color + + +Since 1.0 + + +cogl_color_get_alpha_float () +cogl_color_get_alpha_floatfloat cogl_color_get_alpha_float (const CoglColor *color); + +Retrieves the alpha channel of color as a floating point +value between 0.0 and 1.0 + + + +color : + a CoglColor + +Returns : the alpha channel of the passed color + + +Since 1.0 + + + + + + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/xml/cogl-fixed.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/xml/cogl-fixed.xml --- clutter-0.8.4/doc/reference/cogl/xml/cogl-fixed.xml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/cogl/xml/cogl-fixed.xml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,957 @@ + + +]> + + +Fixed Point API +3 +COGL Library + + + +Fixed Point API +Fixed Point API + + + + +Synopsis + + +typedef CoglFixed; +#define COGL_FIXED_BITS +#define COGL_FIXED_Q +#define COGL_FIXED_MAX +#define COGL_FIXED_MIN + +#define COGL_FIXED_FROM_FLOAT (x) +#define COGL_FIXED_TO_FLOAT (x) +#define COGL_FIXED_FROM_INT (x) +#define COGL_FIXED_TO_INT (x) +#define COGL_FIXED_TO_DOUBLE (x) +#define COGL_FLOAT_TO_INT (x) +#define COGL_FLOAT_TO_UINT (x) + +#define COGL_FIXED_EPSILON +#define COGL_FIXED_1 +#define COGL_FIXED_0_5 +#define COGL_FIXED_30 +#define COGL_FIXED_45 +#define COGL_FIXED_60 +#define COGL_FIXED_90 +#define COGL_FIXED_120 +#define COGL_FIXED_180 +#define COGL_FIXED_240 +#define COGL_FIXED_255 +#define COGL_FIXED_270 +#define COGL_FIXED_360 + +#define COGL_FIXED_MUL (a,b) +#define COGL_FIXED_DIV (a,b) +#define COGL_FIXED_MUL_DIV (a,b,c) +#define COGL_FIXED_FAST_DIV (a,b) +#define COGL_FIXED_FAST_MUL (a,b) +#define COGL_FIXED_FRACTION (x) +#define COGL_FIXED_FLOOR (x) +#define COGL_FIXED_CEIL (x) + +#define COGL_FIXED_2_PI +#define COGL_FIXED_PI +#define COGL_FIXED_PI_2 +#define COGL_FIXED_PI_4 +#define COGL_RADIANS_TO_DEGREES + +#define COGL_SQRTI_ARG_10_PERCENT +#define COGL_SQRTI_ARG_5_PERCENT +#define COGL_SQRTI_ARG_MAX +gint cogl_sqrti (gint x); + +CoglFixed cogl_fixed_atan2 (CoglFixed a, + CoglFixed b); +CoglFixed cogl_fixed_atani (CoglFixed a); +CoglFixed cogl_fixed_cos (CoglFixed angle); +CoglFixed cogl_fixed_log2 (guint x); +guint cogl_fixed_pow (guint x, + CoglFixed y); +guint cogl_fixed_pow2 (CoglFixed x); +CoglFixed cogl_fixed_sin (CoglFixed angle); +CoglFixed cogl_fixed_sqrt (CoglFixed x); +CoglFixed cogl_fixed_tan (CoglFixed angle); + +typedef CoglAngle; +#define COGL_ANGLE_FROM_DEG (x) +#define COGL_ANGLE_FROM_DEGX (x) +#define COGL_ANGLE_TO_DEG (x) +#define COGL_ANGLE_TO_DEGX (x) +CoglFixed cogl_angle_cos (CoglAngle angle); +CoglFixed cogl_angle_sin (CoglAngle angle); +CoglFixed cogl_angle_tan (CoglAngle angle); + + + + + + + + + + + + +Description + +COGL has a fixed point API targeted at platforms without a floating +point unit, such as embedded devices. On such platforms this API should +be preferred to the floating point one as it does not trigger the slow +path of software emulation, relying on integer math for fixed-to-floating +and floating-to-fixed notations conversion. + + +It is not recommened for use on platforms with a floating point unit +(e.g. desktop systems), nor for use in language bindings. + + +Basic rules of Fixed Point arithmethic: + + + Two fixed point numbers can be directly added, subtracted and + have their modulus taken. + + + To add other numerical type to a fixed point number it has to + be first converted to fixed point. + + + A fixed point number can be directly multiplied or divided by + an integer. + + + Two fixed point numbers can only be multiplied and divided by + the provided COGL_FIXED_MUL and COGL_FIXED_DIV macros. + + + + +The fixed point API is available since COGL 1.0. + + + + + + +Details + +CoglFixed +CoglFixedtypedef gint32 CoglFixed; + + +Fixed point number using a (16.16) notation. + + + + +COGL_FIXED_BITS +COGL_FIXED_BITS#define COGL_FIXED_BITS (32) + + +Evaluates to the number of bits used by the CoglFixed type. + + +Since 1.0 + + +COGL_FIXED_Q +COGL_FIXED_Q#define COGL_FIXED_Q (COGL_FIXED_BITS - 16) + + +Evaluates to the number of bits used for the non-integer part +of the CoglFixed type. + + +Since 1.0 + + +COGL_FIXED_MAX +COGL_FIXED_MAX#define COGL_FIXED_MAX (0x7fffffff) + + +The biggest number representable using CoglFixed + + +Since 1.0 + + +COGL_FIXED_MIN +COGL_FIXED_MIN#define COGL_FIXED_MIN (0x80000000) + + +The smallest number representable using CoglFixed + + +Since 1.0 + + +COGL_FIXED_FROM_FLOAT() +COGL_FIXED_FROM_FLOAT#define COGL_FIXED_FROM_FLOAT(x) (cogl_double_to_fixed (x)) + + +Converts x from a floating point to a fixed point notation. + + + +x : + a floating point number + +Since 1.0 + + +COGL_FIXED_TO_FLOAT() +COGL_FIXED_TO_FLOAT#define COGL_FIXED_TO_FLOAT(x) ((float) ((int)(x) / 65536.0)) + + +Converts x from a fixed point to a floatint point notation, in +double precision. + + + +x : + a CoglFixed number + +Since 1.0 + + +COGL_FIXED_FROM_INT() +COGL_FIXED_FROM_INT#define COGL_FIXED_FROM_INT(x) ((x) << COGL_FIXED_Q) + + +Converts x from an integer to a fixed point notation. + + + +x : + an integer number + +Since 1.0 + + +COGL_FIXED_TO_INT() +COGL_FIXED_TO_INT#define COGL_FIXED_TO_INT(x) ((x) >> COGL_FIXED_Q) + + +Converts x from a fixed point notation to an integer, dropping +the fractional part without rounding. + + + +x : + a CoglFixed number + +Since 1.0 + + +COGL_FIXED_TO_DOUBLE() +COGL_FIXED_TO_DOUBLE#define COGL_FIXED_TO_DOUBLE(x) ((double) ((int)(x) / 65536.0)) + + + + +x : + + + + + + +COGL_FLOAT_TO_INT() +COGL_FLOAT_TO_INT#define COGL_FLOAT_TO_INT(x) (cogl_double_to_int ((x))) + + +Converts x from a floating point notation to a signed integer. + + + +x : + a floatint point number + +Since 1.0 + + +COGL_FLOAT_TO_UINT() +COGL_FLOAT_TO_UINT#define COGL_FLOAT_TO_UINT(x) (cogl_double_to_uint ((x))) + + +Converts x from a floating point notation to an unsigned integer. + + + +x : + a floatint point number + +Since 1.0 + + +COGL_FIXED_EPSILON +COGL_FIXED_EPSILON#define COGL_FIXED_EPSILON (1) + + +A very small number expressed as a CoglFixed number. + + +Since 1.0 + + +COGL_FIXED_1 +COGL_FIXED_1#define COGL_FIXED_1 (1 << COGL_FIXED_Q) + + +The number 1 expressed as a CoglFixed number. + + +Since 1.0 + + +COGL_FIXED_0_5 +COGL_FIXED_0_5#define COGL_FIXED_0_5 (32768) + + +The number 0.5 expressed as a CoglFixed number. + + +Since 1.0 + + +COGL_FIXED_30 +COGL_FIXED_30#define COGL_FIXED_30 (COGL_FIXED_FROM_INT (30)) + + +Evaluates to the number 30 in fixed point notation. + + +Since 1.0 + + +COGL_FIXED_45 +COGL_FIXED_45#define COGL_FIXED_45 (COGL_FIXED_FROM_INT (45)) + + +Evaluates to the number 45 in fixed point notation. + + +Since 1.0 + + +COGL_FIXED_60 +COGL_FIXED_60#define COGL_FIXED_60 (COGL_FIXED_FROM_INT (60)) + + +Evaluates to the number 60 in fixed point notation. + + +Since 1.0 + + +COGL_FIXED_90 +COGL_FIXED_90#define COGL_FIXED_90 (COGL_FIXED_FROM_INT (90)) + + +Evaluates to the number 90 in fixed point notation. + + +Since 1.0 + + +COGL_FIXED_120 +COGL_FIXED_120#define COGL_FIXED_120 (COGL_FIXED_FROM_INT (120)) + + +Evaluates to the number 120 in fixed point notation. + + +Since 1.0 + + +COGL_FIXED_180 +COGL_FIXED_180#define COGL_FIXED_180 (COGL_FIXED_FROM_INT (180)) + + +Evaluates to the number 180 in fixed point notation. + + +Since 1.0 + + +COGL_FIXED_240 +COGL_FIXED_240#define COGL_FIXED_240 (COGL_FIXED_FROM_INT (240)) + + +Evaluates to the number 240 in fixed point notation. + + +Since 1.0 + + +COGL_FIXED_255 +COGL_FIXED_255#define COGL_FIXED_255 (COGL_FIXED_FROM_INT (255)) + + +Evaluates to the number 255 in fixed point notation. + + +Since 1.0 + + +COGL_FIXED_270 +COGL_FIXED_270#define COGL_FIXED_270 (COGL_FIXED_FROM_INT (270)) + + +Evaluates to the number 270 in fixed point notation. + + +Since 1.0 + + +COGL_FIXED_360 +COGL_FIXED_360#define COGL_FIXED_360 (COGL_FIXED_FROM_INT (360)) + + +Evaluates to the number 360 in fixed point notation. + + +Since 1.0 + + +COGL_FIXED_MUL() +COGL_FIXED_MUL#define COGL_FIXED_MUL(a,b) (cogl_fixed_mul ((a), (b))) + + +Computes (a * b). + + + +a : + a CoglFixed number + +b : + a CoglFixed number + +Since 1.0 + + +COGL_FIXED_DIV() +COGL_FIXED_DIV#define COGL_FIXED_DIV(a,b) (cogl_fixed_div ((a), (b))) + + +Computes (a / b). + + + +a : + a CoglFixed number + +b : + a CoglFixed number + +Since 1.0 + + +COGL_FIXED_MUL_DIV() +COGL_FIXED_MUL_DIV#define COGL_FIXED_MUL_DIV(a,b,c) (cogl_fixed_mul_div ((a), (b), (c))) + + +Computes ((a * b) / c). It is logically equivalent to: + + + + res = COGL_FIXED_DIV (COGL_FIXED_MUL (a, b), c); + + + +But it is shorter to type. + + + +a : + a CoglFixed number + +b : + a CoglFixed number + +c : + a CoglFixed number + +Since 1.0 + + +COGL_FIXED_FAST_DIV() +COGL_FIXED_FAST_DIV#define COGL_FIXED_FAST_DIV(a,b) ((((a) << 8) / (b)) << 8) + + +Fast version of COGL_FIXED_DIV, implemented as a macro. + + +This macro might lose precision. If the precision of the result +is important use COGL_FIXED_DIV instead. + + + +a : + a CoglFixed number + +b : + a CoglFixed number + +Since 1.0 + + +COGL_FIXED_FAST_MUL() +COGL_FIXED_FAST_MUL#define COGL_FIXED_FAST_MUL(a,b) ((a) >> 8) * ((b) >> 8) + + +Fast version of COGL_FIXED_MUL, implemented as a macro. + + +This macro might lose precision. If the precision of the result +is important use COGL_FIXED_MUL instead. + + + +a : + a CoglFixed number + +b : + a CoglFixed number + +Since 1.0 + + +COGL_FIXED_FRACTION() +COGL_FIXED_FRACTION#define COGL_FIXED_FRACTION(x) ((x) & ((1 << COGL_FIXED_Q) - 1)) + + +Retrieves the fractionary part of x. + + + +x : + a CoglFixed number + +Since 1.0 + + +COGL_FIXED_FLOOR() +COGL_FIXED_FLOOR#define COGL_FIXED_FLOOR(x) + +Rounds down a fixed point number to the previous integer. + + + +x : + a CoglFixed number + +Since 1.0 + + +COGL_FIXED_CEIL() +COGL_FIXED_CEIL#define COGL_FIXED_CEIL(x) (COGL_FIXED_FLOOR ((x) + 0xffff)) + + +Rounds up a fixed point number to the next integer. + + + +x : + a CoglFixed number + +Since 1.0 + + +COGL_FIXED_2_PI +COGL_FIXED_2_PI#define COGL_FIXED_2_PI (0x0006487f) + + +Two times pi, expressed as a CoglFixed number. + + +Since 1.0 + + +COGL_FIXED_PI +COGL_FIXED_PI#define COGL_FIXED_PI (0x0003243f) + + +The number pi, expressed as a CoglFixed number. + + +Since 1.0 + + +COGL_FIXED_PI_2 +COGL_FIXED_PI_2#define COGL_FIXED_PI_2 (0x00019220) + + +Half pi, expressed as a CoglFixed number. + + +Since 1.0 + + +COGL_FIXED_PI_4 +COGL_FIXED_PI_4#define COGL_FIXED_PI_4 (0x0000c910) + + +pi / 4, expressed as CoglFixed number. + + +Since 1.0 + + +COGL_RADIANS_TO_DEGREES +COGL_RADIANS_TO_DEGREES#define COGL_RADIANS_TO_DEGREES (0x394bb8) + + +Evaluates to 180 / pi in fixed point notation. + + +Since 1.0 + + +COGL_SQRTI_ARG_10_PERCENT +COGL_SQRTI_ARG_10_PERCENT#define COGL_SQRTI_ARG_10_PERCENT + +Maximum argument that can be passed to cogl_sqrti() for which the +resulting error is < 10% + + +Since 1.0 + + +COGL_SQRTI_ARG_5_PERCENT +COGL_SQRTI_ARG_5_PERCENT#define COGL_SQRTI_ARG_5_PERCENT + +Maximum argument that can be passed to cogl_sqrti() for which the +resulting error is < 5% + + +Since 1.0 + + +COGL_SQRTI_ARG_MAX +COGL_SQRTI_ARG_MAX#define COGL_SQRTI_ARG_MAX + +Maximum argument that can be passed to cogl_sqrti() function. + + +Since 1.0 + + +cogl_sqrti () +cogl_sqrtigint cogl_sqrti (gint x); + +Very fast fixed point implementation of square root for integers. + + +This function is at least 6x faster than clib sqrt() on x86, and (this is +not a typo!) about 500x faster on ARM without FPU. It's error is < 5% +for arguments < COGL_SQRTI_ARG_5_PERCENT and < 10% for arguments < +COGL_SQRTI_ARG_10_PERCENT. The maximum argument that can be passed to +this function is COGL_SQRTI_ARG_MAX. + + + +x : + integer value + +Returns : integer square root. + + + +Since 0.2 + + +cogl_fixed_atan2 () +cogl_fixed_atan2CoglFixed cogl_fixed_atan2 (CoglFixed a, + CoglFixed b); + +Computes the arc tangent of a / b but uses the sign of both +arguments to return the angle in right quadrant. + + + +a : + the numerator as a CoglFixed number + +b : + the denominator as a CoglFixed number + +Returns : the arc tangent of the passed fraction, in fixed point + notation + + +Since 1.0 + + +cogl_fixed_atani () +cogl_fixed_ataniCoglFixed cogl_fixed_atani (CoglFixed a); + +Computes the arc tangent of a. + + + +a : + a CoglFixed number + +Returns : the arc tangent of the passed value, in fixed point notation + + +Since 1.0 + + +cogl_fixed_cos () +cogl_fixed_cosCoglFixed cogl_fixed_cos (CoglFixed angle); + +Computes the cosine of angle. + + + +angle : + a CoglFixed number + +Returns : the cosine of the passed angle, in fixed point notation + + +Since 1.0 + + +cogl_fixed_log2 () +cogl_fixed_log2CoglFixed cogl_fixed_log2 (guint x); + +Calculates base 2 logarithm. + + +This function is some 2.5 times faster on x86, and over 12 times faster on +fpu-less arm, than using libc log(). + + + +x : + value to calculate base 2 logarithm from + +Returns : base 2 logarithm. + + +Since 1.0 + + +cogl_fixed_pow () +cogl_fixed_powguint cogl_fixed_pow (guint x, + CoglFixed y); + +Calculates x to the y power. + + + +x : + base + +y : + CoglFixed exponent + +Returns : the power of x to the y + + +Since 1.0 + + +cogl_fixed_pow2 () +cogl_fixed_pow2guint cogl_fixed_pow2 (CoglFixed x); + +Calculates 2 to the x power. + + +This function is around 11 times faster on x86, and around 22 times faster +on fpu-less arm than libc pow(2, x). + + + +x : + a CoglFixed number + +Returns : the power of 2 to the passed value + + +Since 1.0 + + +cogl_fixed_sin () +cogl_fixed_sinCoglFixed cogl_fixed_sin (CoglFixed angle); + +Computes the sine of angle. + + + +angle : + a CoglFixed number + +Returns : the sine of the passed angle, in fixed point notation + + +Since 1.0 + + +cogl_fixed_sqrt () +cogl_fixed_sqrtCoglFixed cogl_fixed_sqrt (CoglFixed x); + +Computes the square root of x. + + + +x : + a CoglFixed number + +Returns : the square root of the passed value, in floating point + notation + + +Since 1.0 + + +cogl_fixed_tan () +cogl_fixed_tanCoglFixed cogl_fixed_tan (CoglFixed angle); + +Computes the tangent of angle. + + + +angle : + a CoglFixed number + +Returns : the tangent of the passed angle, in fixed point notation + + +Since 1.0 + + +CoglAngle +CoglAngletypedef gint32 CoglAngle; + + +Integer representation of an angle such that 1024 corresponds to +full circle (i.e., 2 * pi). + + +Since 1.0 + + +COGL_ANGLE_FROM_DEG() +COGL_ANGLE_FROM_DEG#define COGL_ANGLE_FROM_DEG(x) (COGL_FLOAT_TO_INT (((float)(x) * 1024.0f) / 360.0f)) + + +Converts an angle in degrees into a CoglAngle. + + + +x : + an angle in degrees in floating point notation + +Since 1.0 + + +COGL_ANGLE_FROM_DEGX() +COGL_ANGLE_FROM_DEGX#define COGL_ANGLE_FROM_DEGX(x) (COGL_FIXED_TO_INT ((((x) / 360) * 1024) + COGL_FIXED_0_5)) + + +Converts an angle in degrees into a CoglAngle. + + + +x : + an angle in degrees in fixed point notation + +Since 1.0 + + +COGL_ANGLE_TO_DEG() +COGL_ANGLE_TO_DEG#define COGL_ANGLE_TO_DEG(x) (((float)(x) * 360.0) / 1024.0) + + +Converts a CoglAngle into an angle in degrees, using floatint point +notation. + + + +x : + a CoglAngle + +Since 1.0 + + +COGL_ANGLE_TO_DEGX() +COGL_ANGLE_TO_DEGX#define COGL_ANGLE_TO_DEGX(x) (COGL_FIXED_FROM_INT ((x) * 45) / 128) + + +Converts a CoglAngle into an angle in degrees, using fixed point notation + + + +x : + a CoglAngle + +Since 1.0 + + +cogl_angle_cos () +cogl_angle_cosCoglFixed cogl_angle_cos (CoglAngle angle); + +Computes the cosine of angle + + + +angle : + an angle expressed using CoglAngle + +Returns : the cosine of the passed angle + + +Since 1.0 + + +cogl_angle_sin () +cogl_angle_sinCoglFixed cogl_angle_sin (CoglAngle angle); + +Computes the sine of angle + + + +angle : + an angle expressed using CoglAngle + +Returns : the sine of the passed angle + + +Since 1.0 + + +cogl_angle_tan () +cogl_angle_tanCoglFixed cogl_angle_tan (CoglAngle angle); + +Computes the tangent of angle + + + +angle : + an angle expressed using CoglAngle + +Returns : the tangent of the passed angle + + +Since 1.0 + + + + + + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/xml/cogl-material.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/xml/cogl-material.xml --- clutter-0.8.4/doc/reference/cogl/xml/cogl-material.xml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/cogl/xml/cogl-material.xml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,1511 @@ + + +]> + + +Materials +3 +COGL Library + + + +Materials +Fuctions for creating and manipulating materials + + + + +Synopsis + + + CoglMaterial; +enum CoglMaterialFlags; +CoglHandle cogl_material_new (void); +CoglHandle cogl_material_ref (CoglHandle handle); +void cogl_material_unref (CoglHandle handle); +void cogl_material_set_ambient (CoglHandle material, + const CoglColor *ambient); +void cogl_material_get_ambient (CoglHandle handle, + CoglColor *ambient); +void cogl_material_set_ambient_and_diffuse + (CoglHandle material, + const CoglColor *color); +void cogl_material_set_color (CoglHandle material, + const CoglColor *color); +void cogl_material_set_color4ub (CoglHandle handle, + guint8 red, + guint8 green, + guint8 blue, + guint8 alpha); +void cogl_material_get_color (CoglHandle handle, + CoglColor *color); +void cogl_material_set_diffuse (CoglHandle material, + const CoglColor *diffuse); +void cogl_material_get_diffuse (CoglHandle handle, + CoglColor *diffuse); +void cogl_material_set_emission (CoglHandle material, + const CoglColor *emission); +void cogl_material_get_emission (CoglHandle handle, + CoglColor *emission); +void cogl_material_set_specular (CoglHandle material, + const CoglColor *specular); +void cogl_material_get_specular (CoglHandle handle, + CoglColor *specular); +void cogl_material_set_shininess (CoglHandle material, + float shininess); +float cogl_material_get_shininess (CoglHandle handle); +void cogl_set_source (CoglHandle material); +enum CoglMaterialAlphaFunc; +void cogl_material_set_alpha_test_function + (CoglHandle material, + CoglMaterialAlphaFunc alpha_func, + float alpha_reference); +enum CoglMaterialBlendFactor; +void cogl_material_set_blend_factors (CoglHandle material, + CoglMaterialBlendFactor src_factor, + CoglMaterialBlendFactor dst_factor); + CoglMaterialLayer; +void cogl_material_set_layer (CoglHandle material, + gint layer_index, + CoglHandle texture); +void cogl_material_remove_layer (CoglHandle material, + gint layer_index); +enum CoglMaterialLayerCombineFunc; +void cogl_material_set_layer_combine_function + (CoglHandle material, + gint layer_index, + CoglMaterialLayerCombineChannels channels, + CoglMaterialLayerCombineFunc func); +enum CoglMaterialLayerCombineChannels; +enum CoglMaterialLayerCombineSrc; +void cogl_material_set_layer_combine_arg_src + (CoglHandle material, + gint layer_index, + gint argument, + CoglMaterialLayerCombineChannels channels, + CoglMaterialLayerCombineSrc src); +enum CoglMaterialLayerCombineOp; +void cogl_material_set_layer_combine_arg_op + (CoglHandle material, + gint layer_index, + gint argument, + CoglMaterialLayerCombineChannels channels, + CoglMaterialLayerCombineOp op); +void cogl_material_set_layer_matrix (CoglHandle material, + gint layer_index, + CoglMatrix *matrix); +void cogl_material_set_layer_alpha_combine + (); +void cogl_material_set_layer_rgb_combine (); +gulong cogl_material_get_cogl_enable_flags (CoglHandle handle); +enum CoglMaterialFlushOption; +void cogl_material_flush_gl_state (CoglHandle material, + ...); +const GList* cogl_material_get_layers (CoglHandle material_handle); +enum CoglMaterialLayerType; +CoglMaterialLayerType cogl_material_layer_get_type (CoglHandle layer_handle); +enum CoglMaterialLayerFlags; +gulong cogl_material_layer_get_flags (CoglHandle layer_handle); +CoglHandle cogl_material_layer_get_texture (CoglHandle layer_handle); + + + + + + + + + + + + +Description + +COGL allows creating and manipulating materials used to fill in +geometry. Materials may simply be lighting attributes (such as an +ambient and diffuse colour) or might represent one or more textures +blended together. + + + + + + +Details + +CoglMaterial +CoglMaterialtypedef struct { + guint ref_count; + + gulong flags; + + /* If no lighting is enabled; this is the basic material color */ + GLfloat unlit[4]; + + /* Standard OpenGL lighting model attributes */ + GLfloat ambient[4]; + GLfloat diffuse[4]; + GLfloat specular[4]; + GLfloat emission[4]; + GLfloat shininess; + + /* Determines what fragments are discarded based on their alpha */ + CoglMaterialAlphaFunc alpha_func; + GLfloat alpha_func_reference; + + /* Determines how this material is blended with other primitives */ + CoglMaterialBlendFactor blend_src_factor; + CoglMaterialBlendFactor blend_dst_factor; + + GList *layers; +} CoglMaterial; + + + + + +enum CoglMaterialFlags +CoglMaterialFlagstypedef enum _CoglMaterialFlags +{ + COGL_MATERIAL_FLAG_ENABLE_BLEND = 1L<<0, + COGL_MATERIAL_FLAG_SHOWN_SAMPLER_WARNING = 1L<<1, + COGL_MATERIAL_FLAG_DIRTY = 1L<<2, + COGL_MATERIAL_FLAG_LAYERS_DIRTY = 1L<<3, + COGL_MATERIAL_FLAG_DEFAULT_COLOR = 1L<<4, + COGL_MATERIAL_FLAG_DEFAULT_GL_MATERIAL = 1L<<5, + COGL_MATERIAL_FLAG_DEFAULT_ALPHA_FUNC = 1L<<6, + COGL_MATERIAL_FLAG_DEFAULT_BLEND_FUNC = 1L<<7 +} CoglMaterialFlags; + + + + + +cogl_material_new () +cogl_material_newCoglHandle cogl_material_new (void); + +Allocates and initializes a blank white material + + + +Returns : a handle to the new material + + + +cogl_material_ref () +cogl_material_refCoglHandle cogl_material_ref (CoglHandle handle); + +Increment the reference count for a cogl material. + + + +handle : + a CoglHandle. + +Returns : the handle. + +Since 1.0 + + + +cogl_material_unref () +cogl_material_unrefvoid cogl_material_unref (CoglHandle handle); + +Decrement the reference count for a cogl material. + + +Since 1.0 + + + +handle : + a CoglHandle. + + + +cogl_material_set_ambient () +cogl_material_set_ambientvoid cogl_material_set_ambient (CoglHandle material, + const CoglColor *ambient); + +Exposing the standard OpenGL lighting model; this function sets +the material's ambient color. The ambient color affects the overall +color of the object. Since the diffuse color will be intense when +the light hits the surface directly, the ambient will most aparent +where the light hits at a slant. + + +The default value is (0.2, 0.2, 0.2, 1.0) + + +Since 1.0 + + + +material : + A CoglMaterial object + +ambient : + The components of the desired ambient color + + + +cogl_material_get_ambient () +cogl_material_get_ambientvoid cogl_material_get_ambient (CoglHandle handle, + CoglColor *ambient); + +This retrieves the materials current ambient color. + + +Since 1.0 + + + +handle : + + +ambient : + The location to store the ambient color + + + +cogl_material_set_ambient_and_diffuse () +cogl_material_set_ambient_and_diffusevoid cogl_material_set_ambient_and_diffuse + (CoglHandle material, + const CoglColor *color); + +This is a convenience for setting the diffuse and ambient color +of the material at the same time. + + +The default ambient color is (0.2, 0.2, 0.2, 1.0) +The default diffuse color is (0.8, 0.8, 0.8, 1.0) + + +Since 1.0 + + + +material : + A CoglMaterial object + +color : + The components of the desired ambient and diffuse colors + + + +cogl_material_set_color () +cogl_material_set_colorvoid cogl_material_set_color (CoglHandle material, + const CoglColor *color); + +This is the basic color of the material, used when no lighting is enabled. + + +The default value is (1.0, 1.0, 1.0, 1.0) + + +Since 1.0 + + + +material : + A CoglMaterial object + +color : + + + + + + +cogl_material_set_color4ub () +cogl_material_set_color4ubvoid cogl_material_set_color4ub (CoglHandle handle, + guint8 red, + guint8 green, + guint8 blue, + guint8 alpha); + + + +handle : + + +red : + + +green : + + +blue : + + +alpha : + + + + + + +cogl_material_get_color () +cogl_material_get_colorvoid cogl_material_get_color (CoglHandle handle, + CoglColor *color); + +This retrieves the current material color. + + +Since 1.0 + + + +handle : + + +color : + The location to store the color + + + +cogl_material_set_diffuse () +cogl_material_set_diffusevoid cogl_material_set_diffuse (CoglHandle material, + const CoglColor *diffuse); + +Exposing the standard OpenGL lighting model; this function sets +the material's diffuse color. The diffuse color is most intense +where the light hits the surface directly; perpendicular to the +surface. + + +The default value is (0.8, 0.8, 0.8, 1.0) + + +Since 1.0 + + + +material : + A CoglMaterial object + +diffuse : + The components of the desired diffuse color + + + +cogl_material_get_diffuse () +cogl_material_get_diffusevoid cogl_material_get_diffuse (CoglHandle handle, + CoglColor *diffuse); + +This retrieves the materials current diffuse color. + + +Since 1.0 + + + +handle : + + +diffuse : + The location to store the diffuse color + + + +cogl_material_set_emission () +cogl_material_set_emissionvoid cogl_material_set_emission (CoglHandle material, + const CoglColor *emission); + +Exposing the standard OpenGL lighting model; this function sets +the material's emissive color. It will look like the surface is +a light source emitting this color. + + +The default value is (0.0, 0.0, 0.0, 1.0) + + +Since 1.0 + + + +material : + A CoglMaterial object + +emission : + The components of the desired emissive color + + + +cogl_material_get_emission () +cogl_material_get_emissionvoid cogl_material_get_emission (CoglHandle handle, + CoglColor *emission); + +This retrieves the materials current emission color. + + +Since 1.0 + + + +handle : + + +emission : + The location to store the emission color + + + +cogl_material_set_specular () +cogl_material_set_specularvoid cogl_material_set_specular (CoglHandle material, + const CoglColor *specular); + +Exposing the standard OpenGL lighting model; this function sets +the material's specular color. The intensity of the specular color +depends on the viewport position, and is brightest along the lines +of reflection. + + +The default value is (0.0, 0.0, 0.0, 1.0) + + +Since 1.0 + + + +material : + A CoglMaterial object + +specular : + The components of the desired specular color + + + +cogl_material_get_specular () +cogl_material_get_specularvoid cogl_material_get_specular (CoglHandle handle, + CoglColor *specular); + +This retrieves the materials current specular color. + + +Since 1.0 + + + +handle : + + +specular : + The location to store the specular color + + + +cogl_material_set_shininess () +cogl_material_set_shininessvoid cogl_material_set_shininess (CoglHandle material, + float shininess); + +This function sets the materials shininess which determines how +specular highlights are calculated. A higher shininess will produce +smaller brigher highlights. + + +The default value is 0.0 + + +Since 1.0 + + + +material : + A CoglMaterial object +shininess: The desired shininess; range: [0.0, 1.0] + +shininess : + + + + + + +cogl_material_get_shininess () +cogl_material_get_shininessfloat cogl_material_get_shininess (CoglHandle handle); + +This retrieves the materials current emission color. + + + +handle : + + +Returns : The materials current shininess value + +Since 1.0 + + + +cogl_set_source () +cogl_set_sourcevoid cogl_set_source (CoglHandle material); + +This function sets the source material that will be used to fill +subsequent geometry emitted via the cogl API. + + +Note: in the future we may add the ability to set a front facing +material, and a back facing material, in which case this function +will set both to the same. + + +Since 1.0 + + + +material : + A CoglMaterial object + + + +enum CoglMaterialAlphaFunc +CoglMaterialAlphaFunctypedef enum _CoglMaterialAlphaFunc +{ + COGL_MATERIAL_ALPHA_FUNC_NEVER = GL_NEVER, + COGL_MATERIAL_ALPHA_FUNC_LESS = GL_LESS, + COGL_MATERIAL_ALPHA_FUNC_EQUAL = GL_EQUAL, + COGL_MATERIAL_ALPHA_FUNC_LEQUAL = GL_LEQUAL, + COGL_MATERIAL_ALPHA_FUNC_GREATER = GL_GREATER, + COGL_MATERIAL_ALPHA_FUNC_NOTEQUAL = GL_NOTEQUAL, + COGL_MATERIAL_ALPHA_FUNC_GEQUAL = GL_GEQUAL, + COGL_MATERIAL_ALPHA_FUNC_ALWAYS = GL_ALWAYS +} CoglMaterialAlphaFunc; + + +Alpha testing happens before blending primitives with the framebuffer and +gives an opportunity to discard fragments based on a comparison with the +incoming alpha value and a reference alpha value. The CoglMaterialAlphaFunc +determines how the comparison is done. + + + + +COGL_MATERIAL_ALPHA_FUNC_NEVER + Never let the fragment through. + + + +COGL_MATERIAL_ALPHA_FUNC_LESS + Let the fragment through if the incoming + alpha value is less than the reference alpha + value. + + + +COGL_MATERIAL_ALPHA_FUNC_EQUAL + Let the fragment through if the incoming + alpha value equals the reference alpha + value. + + + +COGL_MATERIAL_ALPHA_FUNC_LEQUAL + Let the fragment through if the incoming + alpha value is less than or equal to the + reference alpha value. + + + +COGL_MATERIAL_ALPHA_FUNC_GREATER + Let the fragment through if the incoming + alpha value is greater than the reference + alpha value. + + + +COGL_MATERIAL_ALPHA_FUNC_NOTEQUAL + Let the fragment through if the incoming + alpha value does not equal the reference + alpha value. + + + +COGL_MATERIAL_ALPHA_FUNC_GEQUAL + Let the fragment through if the incoming + alpha value is greater than or equal to the + reference alpha value. + + + +COGL_MATERIAL_ALPHA_FUNC_ALWAYS + Always let the fragment through. + + + + +cogl_material_set_alpha_test_function () +cogl_material_set_alpha_test_functionvoid cogl_material_set_alpha_test_function + (CoglHandle material, + CoglMaterialAlphaFunc alpha_func, + float alpha_reference); + +Before a primitive is blended with the framebuffer, it goes through an +alpha test stage which lets you discard fragments based on the current +alpha value. This function lets you change the function used to evaluate +the alpha channel, and thus determine which fragments are discarded +and which continue on to the blending stage. + + +The default is COGL_MATERIAL_ALPHA_FUNC_ALWAYS + + +Since 1.0 + + + +material : + A CoglMaterial object + +alpha_func : + A CoglMaterialAlphaFunc constant + +alpha_reference : + A reference point that the chosen alpha function uses + to compare incoming fragments to. + + + +enum CoglMaterialBlendFactor +CoglMaterialBlendFactortypedef enum _CoglMaterialBlendFactor +{ + COGL_MATERIAL_BLEND_FACTOR_ZERO = GL_ZERO, + COGL_MATERIAL_BLEND_FACTOR_ONE = GL_ONE, + COGL_MATERIAL_BLEND_FACTOR_SRC_COLOR = GL_SRC_COLOR, + COGL_MATERIAL_BLEND_FACTOR_DST_COLOR = GL_DST_COLOR, + COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = GL_ONE_MINUS_SRC_COLOR, + COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_DST_COLOR = GL_ONE_MINUS_DST_COLOR, + COGL_MATERIAL_BLEND_FACTOR_SRC_ALPHA = GL_SRC_ALPHA, + COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = GL_ONE_MINUS_SRC_ALPHA, + COGL_MATERIAL_BLEND_FACTOR_DST_ALPHA = GL_DST_ALPHA, + COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = GL_ONE_MINUS_DST_ALPHA, + COGL_MATERIAL_BLEND_FACTOR_SRC_ALPHA_SATURATE = GL_SRC_ALPHA_SATURATE, +} CoglMaterialBlendFactor; + + +Blending occurs after the alpha test function, and combines fragments with +the framebuffer. + +A fixed function is used to determine the blended color, which is based on +the incoming source color of your fragment (Rs, Gs, Bs, As), a source +factor (Sr, Sg, Sb, Sa), a destination color (Rd, Rg, Rb, Ra) and +a destination factor (Dr, Dg, Db, Da), and is given by these equations: + + +R = Rs*Sr + Rd*Dr +G = Gs*Sg + Gd*Dg +B = Bs*Sb + Bd*Db +A = As*Sa + Ad*Da + + + +All factors have a range [0, 1] + + +The factors are selected with the following constants: + + + + +COGL_MATERIAL_BLEND_FACTOR_ZERO + (0, 0, 0, 0) + + + +COGL_MATERIAL_BLEND_FACTOR_ONE + (1, 1, 1, 1) + + + +COGL_MATERIAL_BLEND_FACTOR_SRC_COLOR + (Rs, Gs, Bs, As) + + + +COGL_MATERIAL_BLEND_FACTOR_DST_COLOR + (Rd, Gd, Bd, Ad) + + + +COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_SRC_COLOR + (1-Rs, 1-Gs, 1-Bs, 1-As) + + + +COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_DST_COLOR + (1-Rd, 1-Gd, 1-Bd, 1-Ad) + + + +COGL_MATERIAL_BLEND_FACTOR_SRC_ALPHA + (As, As, As, As) + + + +COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA + (1-As, 1-As, 1-As, 1-As) + + + +COGL_MATERIAL_BLEND_FACTOR_DST_ALPHA + (Ad, Ad, Ad, Ad) + + + +COGL_MATERIAL_BLEND_FACTOR_ONE_MINUS_DST_ALPHA + (1-Ad, 1-Ad, 1-Ad, 1-Ad) + + + +COGL_MATERIAL_BLEND_FACTOR_SRC_ALPHA_SATURATE + (f,f,f,1) where f=MIN(As,1-Ad) + + + + +cogl_material_set_blend_factors () +cogl_material_set_blend_factorsvoid cogl_material_set_blend_factors (CoglHandle material, + CoglMaterialBlendFactor src_factor, + CoglMaterialBlendFactor dst_factor); + +This function lets you control how primitives using this material will get +blended with the contents of your framebuffer. The blended RGBA components +are calculated like this: + + +(RsSr+RdDr, GsSg+GdDg, BsSb+BsSb, AsSa+AdDa) + + +Where (Rs,Gs,Bs,As) represents your source - material- color, +(Rd,Gd,Bd,Ad) represents your destination - framebuffer - color, +(Sr,Sg,Sb,Sa) represents your source blend factor and +(Dr,Dg,Db,Da) represents you destination blend factor. + + +All factors lie in the range [0,1] and incoming color components are also +normalized to the range [0,1] + + +Since 1.0 + + + +material : + A CoglMaterial object + +src_factor : + Chooses the CoglMaterialBlendFactor you want plugged in to +the blend equation. + +dst_factor : + Chooses the CoglMaterialBlendFactor you want plugged in to +the blend equation. + + + +CoglMaterialLayer +CoglMaterialLayertypedef struct { + guint ref_count; + guint index; /*!< lowest index is blended first then others + on top */ + gulong flags; + CoglHandle texture; /*!< The texture for this layer, or COGL_INVALID_HANDLE + for an empty layer */ + + /* Determines how the color of individual texture fragments + * are calculated. */ + CoglMaterialLayerCombineFunc texture_combine_rgb_func; + CoglMaterialLayerCombineSrc texture_combine_rgb_src[3]; + CoglMaterialLayerCombineOp texture_combine_rgb_op[3]; + + CoglMaterialLayerCombineFunc texture_combine_alpha_func; + CoglMaterialLayerCombineSrc texture_combine_alpha_src[3]; + CoglMaterialLayerCombineOp texture_combine_alpha_op[3]; + + /* TODO: Support purely GLSL based material layers */ + + CoglMatrix matrix; +} CoglMaterialLayer; + + + + + +cogl_material_set_layer () +cogl_material_set_layervoid cogl_material_set_layer (CoglHandle material, + gint layer_index, + CoglHandle texture); + +In addition to the standard OpenGL lighting model a Cogl material may have +one or more layers comprised of textures that can be blended together in +order, with a number of different texture combine modes. This function +defines a new texture layer. + + +The index values of multiple layers do not have to be consecutive; it is +only their relative order that is important. + + +XXX: In the future, we may define other types of material layers, such +as purely GLSL based layers. + + +Since 1.0 + + + +material : + A CoglMaterial object + +layer_index : + + +texture : + + + + + + +cogl_material_remove_layer () +cogl_material_remove_layervoid cogl_material_remove_layer (CoglHandle material, + gint layer_index); + + + +material : + + +layer_index : + + + + + + +enum CoglMaterialLayerCombineFunc +CoglMaterialLayerCombineFunctypedef enum _CoglMaterialLayerCombineFunc +{ + COGL_MATERIAL_LAYER_COMBINE_FUNC_REPLACE = GL_REPLACE, + COGL_MATERIAL_LAYER_COMBINE_FUNC_MODULATE = GL_MODULATE, + COGL_MATERIAL_LAYER_COMBINE_FUNC_ADD = GL_ADD, + COGL_MATERIAL_LAYER_COMBINE_FUNC_ADD_SIGNED = GL_ADD_SIGNED, + COGL_MATERIAL_LAYER_COMBINE_FUNC_INTERPOLATE = GL_INTERPOLATE, + COGL_MATERIAL_LAYER_COMBINE_FUNC_SUBTRACT = GL_SUBTRACT, + COGL_MATERIAL_LAYER_COMBINE_FUNC_DOT3_RGB = GL_DOT3_RGB, + COGL_MATERIAL_LAYER_COMBINE_FUNC_DOT3_RGBA = GL_DOT3_RGBA +} CoglMaterialLayerCombineFunc; + + +A material may comprise of 1 or more layers that can be combined using a +number of different functions. By default layers are modulated, which is +to say the components of the current source layer S are simply multipled +together with the combined results of the previous layer P like this: + + + +(Rs*Rp, Gs*Gp, Bs*Bp, As*Ap) + + + +For more advanced techniques, Cogl exposes the fixed function texture +combining capabilities of your GPU to give you greater control. + + + + +COGL_MATERIAL_LAYER_COMBINE_FUNC_REPLACE + Arg0 + + + +COGL_MATERIAL_LAYER_COMBINE_FUNC_MODULATE + Arg0 x Arg1 + + + +COGL_MATERIAL_LAYER_COMBINE_FUNC_ADD + Arg0 + Arg1 + + + +COGL_MATERIAL_LAYER_COMBINE_FUNC_ADD_SIGNED + Arg0 + Arg1 - 0.5 + + + +COGL_MATERIAL_LAYER_COMBINE_FUNC_INTERPOLATE + Arg0 x Arg + Arg1 x (1-Arg2) + + + +COGL_MATERIAL_LAYER_COMBINE_FUNC_SUBTRACT + Arg0 - Arg1 + + + +COGL_MATERIAL_LAYER_COMBINE_FUNC_DOT3_RGB + 4 x ((Arg0r - 0.5) x (Arg1r - 0.5)) + + + + +COGL_MATERIAL_LAYER_COMBINE_FUNC_DOT3_RGBA + ((Arg0b - 0.5) x (Arg1b - 0.5)) + + + + + +cogl_material_set_layer_combine_function () +cogl_material_set_layer_combine_functionvoid cogl_material_set_layer_combine_function + (CoglHandle material, + gint layer_index, + CoglMaterialLayerCombineChannels channels, + CoglMaterialLayerCombineFunc func); + +There are three basic steps to describing how a layer should be combined: + + +Choose a function. + + +Specify the source color for each argument of the chosen function. (Note + the functions don't all take the same number of arguments) + + +Specify an operator for each argument that can modify the corresponding + source color before the function is applied. + + + + +Cogl optionally lets you describe 2 seperate combine modes for a single +layer; 1 for the RGB components, and 1 for the Alpha component, so in this +case you would repeat the 3 steps for each channel selector. + + +(Note: you can't have different modes for each channel, so if you need more + control you will need to use a glsl fragment shader) + + +For example here is how you could elect to use the ADD function for all +components of layer 1 in your material: + +//Step 1: Choose a function. Note the ADD function takes 2 arguments... +cogl_material_set_layer_combine_function (material, + 1, + COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA) + COGL_MATERIAL_LAYER_COMBINE_FUNC_ADD); +//Step 2: Specify the source color for the 2 ADD function arguments... +cogl_material_set_layer_combine_arg_src (material, + 1,//layer index + 0,//argument index + COGL_MATERIAL_LAYER_COMBINE_SRC_PREVIOUS); +cogl_material_set_layer_combine_arg_src (material, + 1,//layer index + 1,//argument index + COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA) + COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE); +//Step 3: Specify the operators used to modify the arguments... +cogl_material_set_layer_combine_arg_op (material, + 1,//layer index + 0,//argument index + COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA, + COGL_MATERIAL_LAYER_COMBINE_OP_SRC_COLOR); +cogl_material_set_layer_combine_arg_op (material, + 1,//layer index + 1,//argument index + COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA, + COGL_MATERIAL_LAYER_COMBINE_OP_SRC_COLOR); + + + + +material : + A CoglMaterial object + +layer_index : + Specifies the layer whos combine mode you want to modify + +channels : + Specifies which channels combine mode you want to modify + (RGB, ALPHA, or RGBA) + +func : + Specifies the function you want to use for combining fragments + of the specified layer with the results of previously combined + layers. + + + +enum CoglMaterialLayerCombineChannels +CoglMaterialLayerCombineChannelstypedef enum _CoglMaterialLayerCombineChannels +{ + COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGB, + COGL_MATERIAL_LAYER_COMBINE_CHANNELS_ALPHA, + COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA +} CoglMaterialLayerCombineChannels; + + +Cogl optionally lets you describe 2 seperate combine modes for a single +layer; 1 for the RGB components, and 1 for the Alpha component, so in this +case you would repeat the 3 steps documented with the +cogl_material_set_layer_combine_function function for each channel +selector. + + +(Note: you can't have different modes for each channel, so if you need more + control you will need to use a glsl fragment shader) + + + + +COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGB + Modify the function or argument + src/op for the RGB components of a + layer + + + +COGL_MATERIAL_LAYER_COMBINE_CHANNELS_ALPHA + Modify the function or argument + src/op for the Alpha component of a + layer + + + +COGL_MATERIAL_LAYER_COMBINE_CHANNELS_RGBA + Modify the function or argument + src/op for all the components of a + layer + + + + +enum CoglMaterialLayerCombineSrc +CoglMaterialLayerCombineSrctypedef enum _CoglMaterialLayerCombineSrc +{ + COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE = GL_TEXTURE, + + /* Can we find a nicer way... */ + COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE0 = GL_TEXTURE0, + COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE1 = GL_TEXTURE1, + COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE2 = GL_TEXTURE2, + COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE3 = GL_TEXTURE3, + COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE4 = GL_TEXTURE4, + COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE5 = GL_TEXTURE5, + COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE6 = GL_TEXTURE6, + COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE7 = GL_TEXTURE7, + /* .. who would ever need more than 8 texture layers.. :-) */ + + COGL_MATERIAL_LAYER_COMBINE_SRC_CONSTANT = GL_CONSTANT, + COGL_MATERIAL_LAYER_COMBINE_SRC_PRIMARY_COLOR = GL_PRIMARY_COLOR, + COGL_MATERIAL_LAYER_COMBINE_SRC_PREVIOUS = GL_PREVIOUS +} CoglMaterialLayerCombineSrc; + + +Note for the constants COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE0..n the +numbers may not correspond to the indices you choose for your layers since +your layer indices don't need to be contiguous. If you need to use these +it would probably be sensible to ensure the layer indices do infact +correspond. + + + + +COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE + The fragment color of the current texture layer + + + +COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE0 + The fragment color of texture unit 0 + + + +COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE1 + The fragment color of texture unit 1 + + + +COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE2 + The fragment color of texture unit 2..7 + + + +COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE3 + + + + +COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE4 + + + + +COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE5 + + + + +COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE6 + + + + +COGL_MATERIAL_LAYER_COMBINE_SRC_TEXTURE7 + + + + +COGL_MATERIAL_LAYER_COMBINE_SRC_CONSTANT + A fixed constant color (TODO: no API yet to specify the actual color!) + + + +COGL_MATERIAL_LAYER_COMBINE_SRC_PRIMARY_COLOR + The basic color of the primitive ignoring texturing + + + +COGL_MATERIAL_LAYER_COMBINE_SRC_PREVIOUS + The result of combining all previous layers + + + + +cogl_material_set_layer_combine_arg_src () +cogl_material_set_layer_combine_arg_srcvoid cogl_material_set_layer_combine_arg_src + (CoglHandle material, + gint layer_index, + gint argument, + CoglMaterialLayerCombineChannels channels, + CoglMaterialLayerCombineSrc src); + + + + + +material : + A CoglMaterial object + +layer_index : + + +argument : + + +channels : + + +src : + + + + +enum CoglMaterialLayerCombineOp +CoglMaterialLayerCombineOptypedef enum _CoglMaterialLayerCombineOp +{ + COGL_MATERIAL_LAYER_COMBINE_OP_SRC_COLOR = GL_SRC_COLOR, + COGL_MATERIAL_LAYER_COMBINE_OP_ONE_MINUS_SRC_COLOR = GL_ONE_MINUS_SRC_COLOR, + + COGL_MATERIAL_LAYER_COMBINE_OP_SRC_ALPHA = GL_SRC_ALPHA, + COGL_MATERIAL_LAYER_COMBINE_OP_ONE_MINUS_SRC_ALPHA = GL_ONE_MINUS_SRC_ALPHA +} CoglMaterialLayerCombineOp; + + + + + +cogl_material_set_layer_combine_arg_op () +cogl_material_set_layer_combine_arg_opvoid cogl_material_set_layer_combine_arg_op + (CoglHandle material, + gint layer_index, + gint argument, + CoglMaterialLayerCombineChannels channels, + CoglMaterialLayerCombineOp op); + + + + + +material : + A CoglMaterial object + +layer_index : + + +argument : + + +channels : + + +op : + + + + +cogl_material_set_layer_matrix () +cogl_material_set_layer_matrixvoid cogl_material_set_layer_matrix (CoglHandle material, + gint layer_index, + CoglMatrix *matrix); + +This function lets you set a matrix that can be used to e.g. translate +and rotate a single layer of a material used to fill your geometry. + + + +material : + A CoglMaterial object + +layer_index : + + +matrix : + + + + + + +cogl_material_set_layer_alpha_combine () +cogl_material_set_layer_alpha_combinevoid cogl_material_set_layer_alpha_combine + (); + + + + +cogl_material_set_layer_rgb_combine () +cogl_material_set_layer_rgb_combinevoid cogl_material_set_layer_rgb_combine (); + + + + +cogl_material_get_cogl_enable_flags () +cogl_material_get_cogl_enable_flagsgulong cogl_material_get_cogl_enable_flags (CoglHandle handle); + +This determines what flags need to be passed to cogl_enable before +this material can be used. Normally you shouldn't need to use this +function directly since Cogl will do this internally, but if you are +developing custom primitives directly with OpenGL you may want to use +this. + + +Note: This API is hopfully just a stop-gap solution. Ideally +cogl_enable will be replaced. + + + +handle : + + +Returns : + + + + + +enum CoglMaterialFlushOption +CoglMaterialFlushOptiontypedef enum _CoglMaterialFlushOption +{ + COGL_MATERIAL_FLUSH_FALLBACK_MASK = 1, + COGL_MATERIAL_FLUSH_DISABLE_MASK, + COGL_MATERIAL_FLUSH_LAYER0_OVERRIDE, +} CoglMaterialFlushOption; + + + + + + + +COGL_MATERIAL_FLUSH_FALLBACK_MASK + Follow this by a guin32 mask + of the layers that can't be supported with the user supplied texture + and need to be replaced with fallback textures. (1 = fallback, and the + least significant bit = layer 0) + + + +COGL_MATERIAL_FLUSH_DISABLE_MASK + Follow this by a guint32 mask + of the layers that you want to completly disable texturing for + (1 = fallback, and the least significant bit = layer 0) + + + +COGL_MATERIAL_FLUSH_LAYER0_OVERRIDE + Follow this by a GLuint OpenGL texture + name to override the texture used for layer 0 of the material. This is + intended for dealing with sliced textures where you will need to point + to each of the texture slices in turn when drawing your geometry. + Passing a value of 0 is the same as not passing the option at all. + + + + +cogl_material_flush_gl_state () +cogl_material_flush_gl_statevoid cogl_material_flush_gl_state (CoglHandle material, + ...); + +This function commits the state of the specified CoglMaterial - including +the texture state for all the layers - to the OpenGL[ES] driver. + + +Normally you shouldn't need to use this function directly, but if you +are developing a custom primitive using raw OpenGL that works with +CoglMaterials, then you may want to use this function. + + +Since 1.0 + + + +material : + A CoglMaterial object + +... : + A NULL terminated list of (CoglMaterialFlushOption, data) pairs + + + +cogl_material_get_layers () +cogl_material_get_layersconst GList* cogl_material_get_layers (CoglHandle material_handle); + +This function lets you access a materials internal list of layers +for iteration. + + +Note: Normally you shouldn't need to use this function directly since +Cogl will do this internally, but if you are developing custom primitives +directly with OpenGL, you will need to iterate the layers that you want +to texture with. + + +Note: This function may return more layers than OpenGL can use at once +so it's your responsability limit yourself to +CGL_MAX_COMBINED_TEXTURE_IMAGE_UNITS. + + +Note: It's a bit out of the ordinary to return a const GList *, but it +was considered sensible to try and avoid list manipulation for every +primitive emitted in a scene, every frame. + + + +material_handle : + + +Returns : + + + + + +enum CoglMaterialLayerType +CoglMaterialLayerTypetypedef enum _CoglMaterialLayerType +{ + COGL_MATERIAL_LAYER_TYPE_TEXTURE +} CoglMaterialLayerType; + + + + + + + +COGL_MATERIAL_LAYER_TYPE_TEXTURE + The layer represents a CoglTexture + + + + +cogl_material_layer_get_type () +cogl_material_layer_get_typeCoglMaterialLayerType cogl_material_layer_get_type (CoglHandle layer_handle); + +Currently there is only one type of layer defined: +COGL_MATERIAL_LAYER_TYPE_TEXTURE, but considering we may add purely GLSL +based layers in the future, you should write code that checks the type +first. + + +Note: Normally you shouldn't need to use this function directly since +Cogl will do this internally, but if you are developing custom primitives +directly with OpenGL, you will need to iterate the layers that you want +to texture with, and thus should be checking the layer types. + + + +layer_handle : + + +Returns : + + + + + +enum CoglMaterialLayerFlags +CoglMaterialLayerFlagstypedef enum _CoglMaterialLayerFlags +{ + COGL_MATERIAL_LAYER_FLAG_HAS_USER_MATRIX = 1L<<0 +} CoglMaterialLayerFlags; + + + + + + + +cogl_material_layer_get_flags () +cogl_material_layer_get_flagsgulong cogl_material_layer_get_flags (CoglHandle layer_handle); + +This lets you get a number of flag attributes about the layer. Normally +you shouldn't need to use this function directly since Cogl will do this +internally, but if you are developing custom primitives directly with +OpenGL you may need this. + + + +layer_handle : + A CoglMaterial layer object + +Returns : + + + + + +cogl_material_layer_get_texture () +cogl_material_layer_get_textureCoglHandle cogl_material_layer_get_texture (CoglHandle layer_handle); + +This lets you extract a CoglTexture handle for a specific layer. Normally +you shouldn't need to use this function directly since Cogl will do this +internally, but if you are developing custom primitives directly with +OpenGL you may need this. + + +Note: In the future, we may support purely GLSL based layers which will +likley return COGL_INVALID_HANDLE if you try to get the texture. +Considering this, you should always call cogl_material_layer_get_type +first, to check it is of type COGL_MATERIAL_LAYER_TYPE_TEXTURE. + + + +layer_handle : + A CoglMaterial layer object + +Returns : + + + + + + + + + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/xml/cogl-matrix.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/xml/cogl-matrix.xml --- clutter-0.8.4/doc/reference/cogl/xml/cogl-matrix.xml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/cogl/xml/cogl-matrix.xml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,239 @@ + + +]> + + +Matrices +3 +COGL Library + + + +Matrices +Fuctions for initializing and manipulating 4x4 + matrices. + + + + +Synopsis + + + CoglMatrix; +void cogl_matrix_init_identity (CoglMatrix *matrix); +void cogl_matrix_multiply (CoglMatrix *result, + const CoglMatrix *a, + const CoglMatrix *b); +void cogl_matrix_rotate (CoglMatrix *matrix, + float angle, + float x, + float y, + float z); +void cogl_matrix_translate (CoglMatrix *matrix, + float x, + float y, + float z); +void cogl_matrix_scale (CoglMatrix *matrix, + float sx, + float sy, + float sz); + + + + + + + + + + + + +Description + +Matrices are used in Cogl to describe affine model-view transforms and +texture transforms, and projective transforms. This exposes a utility API +that can be used for direct manipulation of these matrices. + + + + + + +Details + +CoglMatrix +CoglMatrixtypedef struct { + /* column 0 */ + float xx; + float yx; + float zx; + float wx; + + /* column 1 */ + float xy; + float yy; + float zy; + float wy; + + /* column 2 */ + float xz; + float yz; + float zz; + float wz; + + /* column 3 */ + float xw; + float yw; + float zw; + float ww; +} CoglMatrix; + + +A CoglMatrix holds a 4x4 transform matrix. This is a single precision, +column-major matrix which means it is compatible with what OpenGL expects. + + +A CoglMatix can represent transforms such as, rotations, scaling, +translation, sheering, and linear projections. You can combine these +transforms by multiplying multiple matrices in the order you want them +applied. + + +The transformation of a vertex (x, y, z, w) by a CoglMatrix is given by: + +x_new = xx * x + xy * y + xz * z + xw * w +y_new = yx * x + yy * y + yz * z + yw * w +z_new = zx * x + zy * y + zz * z + zw * w +w_new = wx * x + wy * y + wz * z + ww * w + +Where w is normally 1 + + + + +cogl_matrix_init_identity () +cogl_matrix_init_identityvoid cogl_matrix_init_identity (CoglMatrix *matrix); + +Resets matrix to the identity matrix: + +.xx=1; .xy=0; .xz=0; .xw=0; +.yx=0; .yy=1; .yz=0; .yw=0; +.zx=0; .zy=0; .zz=1; .zw=0; +.wx=0; .wy=0; .wz=0; .ww=1; + + + + +matrix : + A 4x4 transformation matrix + + + +cogl_matrix_multiply () +cogl_matrix_multiplyvoid cogl_matrix_multiply (CoglMatrix *result, + const CoglMatrix *a, + const CoglMatrix *b); + +This function multiples the two supplied matricies together and stores +the result in result + + + +result : + The address of a 4x4 matrix to store the result in + +a : + A 4x4 transformation matrix + +b : + A 4x4 transformation matrix + + + +cogl_matrix_rotate () +cogl_matrix_rotatevoid cogl_matrix_rotate (CoglMatrix *matrix, + float angle, + float x, + float y, + float z); + +This function multiples your matrix with a rotation matrix that applies +a rotation of angle degrees around the specified 3D vector. + + + +matrix : + A 4x4 transformation matrix + +angle : + The angle you want to rotate in degrees + +x : + X component of your rotation vector + +y : + Y component of your rotation vector + +z : + Z component of your rotation vector + + + +cogl_matrix_translate () +cogl_matrix_translatevoid cogl_matrix_translate (CoglMatrix *matrix, + float x, + float y, + float z); + + + +matrix : + + +x : + + +y : + + +z : + + + + + + +cogl_matrix_scale () +cogl_matrix_scalevoid cogl_matrix_scale (CoglMatrix *matrix, + float sx, + float sy, + float sz); + +This function multiples your matrix with a transform matrix that scales +along the X, Y and Z axis. + + + +matrix : + A 4x4 transformation matrix + +sx : + The X scale factor + +sy : + The Y scale factor + +sz : + The Z scale factor + + + + + + + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/xml/cogl-primitives.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/xml/cogl-primitives.xml --- clutter-0.8.4/doc/reference/cogl/xml/cogl-primitives.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/xml/cogl-primitives.xml 2009-01-30 12:41:02.000000000 +0000 @@ -21,66 +21,97 @@ Synopsis -void cogl_color (const ClutterColor *color); -void cogl_path_fill (void); -void cogl_path_stroke (void); -void cogl_path_move_to (ClutterFixed x, - ClutterFixed y); +void cogl_path_new (void); +void cogl_path_move_to (float x, + float y); void cogl_path_close (void); -void cogl_path_line_to (ClutterFixed x, - ClutterFixed y); -void cogl_path_curve_to (ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2, - ClutterFixed x3, - ClutterFixed y3); -void cogl_path_arc (ClutterFixed center_x, - ClutterFixed center_y, - ClutterFixed radius_x, - ClutterFixed radius_y, - ClutterAngle angle_1, - ClutterAngle angle_2); -void cogl_path_rel_move_to (ClutterFixed x, - ClutterFixed y); -void cogl_path_rel_line_to (ClutterFixed x, - ClutterFixed y); -void cogl_path_rel_curve_to (ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2, - ClutterFixed x3, - ClutterFixed y3); -void cogl_path_line (ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2); -void cogl_path_polyline (ClutterFixed *coords, +void cogl_path_line_to (float x, + float y); +void cogl_path_curve_to (float x1, + float y1, + float x2, + float y2, + float x3, + float y3); +void cogl_path_arc (float center_x, + float center_y, + float radius_x, + float radius_y, + float angle_1, + float angle_2); +void cogl_path_rel_move_to (float x, + float y); +void cogl_path_rel_line_to (float x, + float y); +void cogl_path_rel_curve_to (float x1, + float y1, + float x2, + float y2, + float x3, + float y3); +void cogl_path_line (float x1, + float y1, + float x2, + float y2); +void cogl_path_polyline (float *coords, gint num_points); -void cogl_path_polygon (ClutterFixed *coords, +void cogl_path_polygon (float *coords, gint num_points); -void cogl_path_rectangle (ClutterFixed x, - ClutterFixed y, - ClutterFixed width, - ClutterFixed height); -void cogl_path_round_rectangle (ClutterFixed x, - ClutterFixed y, - ClutterFixed width, - ClutterFixed height, - ClutterFixed radius, - ClutterAngle arc_step); -void cogl_path_ellipse (ClutterFixed center_x, - ClutterFixed center_y, - ClutterFixed radius_x, - ClutterFixed radius_y); -void cogl_rectangle (gint x, - gint y, - guint width, - guint height); -void cogl_rectanglex (ClutterFixed x, - ClutterFixed y, - ClutterFixed width, - ClutterFixed height); +void cogl_path_rectangle (float x, + float y, + float width, + float height); +void cogl_path_round_rectangle (float x, + float y, + float width, + float height, + float radius, + float arc_step); +void cogl_path_ellipse (float center_x, + float center_y, + float radius_x, + float radius_y); + +void cogl_path_fill (void); +void cogl_path_fill_preserve (void); +void cogl_path_stroke (void); +void cogl_path_stroke_preserve (void); +void cogl_set_source_color (const CoglColor *color); +void cogl_set_source_color4ub (guint8 red, + guint8 green, + guint8 blue, + guint8 alpha); +void cogl_set_source_color4f (float red, + float green, + float blue, + float alpha); +void cogl_set_source_texture (CoglHandle texture_handle); +#define cogl_color + +void cogl_rectangle (float x1, + float y1, + float x2, + float y2); +void cogl_polygon (CoglTextureVertex *vertices, + guint n_vertices, + gboolean use_color); +void cogl_rectangle_with_multitexture_coords + (float x1, + float y1, + float x2, + float y2, + const float *tex_coords, + gint tex_coords_len); +void cogl_rectangle_with_texture_coords (float x1, + float y1, + float x2, + float y2, + float tx1, + float ty1, + float tx2, + float ty2); +void cogl_rectangles_with_texture_coords (const float *verts, + guint n_rects); @@ -118,44 +149,22 @@ Details - -cogl_color () -cogl_colorvoid cogl_color (const ClutterColor *color); - -Changes the color of cogl's current paint, which is used for filling and stroking -primitives. - - - -color : - new current ClutterColor. - - - -cogl_path_fill () -cogl_path_fillvoid cogl_path_fill (void); + +cogl_path_new () +cogl_path_newvoid cogl_path_new (void); -Fills the constructed shape using the current drawing color. - - - - -cogl_path_stroke () -cogl_path_strokevoid cogl_path_stroke (void); - -Strokes the constructed shape using the current drawing color -and a width of 1 pixel (regardless of the current transformation -matrix). +Clears the current path and starts a new one. +Since 1.0 cogl_path_move_to () -cogl_path_move_tovoid cogl_path_move_to (ClutterFixed x, - ClutterFixed y); +cogl_path_move_tovoid cogl_path_move_to (float x, + float y); -Clears the previously constructed shape and begins a new path -contour by moving the pen to the given coordinates. +Moves the pen to the given location. If there is an existing path +this will start a new disjoint subpath. @@ -177,8 +186,8 @@ cogl_path_line_to () -cogl_path_line_tovoid cogl_path_line_to (ClutterFixed x, - ClutterFixed y); +cogl_path_line_tovoid cogl_path_line_to (float x, + float y); Adds a straight line segment to the current path that ends at the given coordinates. @@ -194,12 +203,12 @@ cogl_path_curve_to () -cogl_path_curve_tovoid cogl_path_curve_to (ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2, - ClutterFixed x3, - ClutterFixed y3); +cogl_path_curve_tovoid cogl_path_curve_to (float x1, + float y1, + float x2, + float y2, + float x3, + float y3); Adds a cubic bezier curve segment to the current path with the given second, third and fourth control points and using current pen location @@ -228,12 +237,12 @@ cogl_path_arc () -cogl_path_arcvoid cogl_path_arc (ClutterFixed center_x, - ClutterFixed center_y, - ClutterFixed radius_x, - ClutterFixed radius_y, - ClutterAngle angle_1, - ClutterAngle angle_2); +cogl_path_arcvoid cogl_path_arc (float center_x, + float center_y, + float radius_x, + float radius_y, + float angle_1, + float angle_2); Adds an elliptical arc segment to the current path. A straight line segment will link the current pen location with the first vertex @@ -263,12 +272,12 @@ cogl_path_rel_move_to () -cogl_path_rel_move_tovoid cogl_path_rel_move_to (ClutterFixed x, - ClutterFixed y); +cogl_path_rel_move_tovoid cogl_path_rel_move_to (float x, + float y); -Clears the previously constructed shape and begins a new path -contour by moving the pen to the given coordinates relative -to the current pen location. +Moves the pen to the given offset relative to the current pen +location. If there is an existing path this will start a new +disjoint subpath. @@ -281,8 +290,8 @@ cogl_path_rel_line_to () -cogl_path_rel_line_tovoid cogl_path_rel_line_to (ClutterFixed x, - ClutterFixed y); +cogl_path_rel_line_tovoid cogl_path_rel_line_to (float x, + float y); Adds a straight line segment to the current path that ends at the given coordinates relative to the current pen location. @@ -298,12 +307,12 @@ cogl_path_rel_curve_to () -cogl_path_rel_curve_tovoid cogl_path_rel_curve_to (ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2, - ClutterFixed x3, - ClutterFixed y3); +cogl_path_rel_curve_tovoid cogl_path_rel_curve_to (float x1, + float y1, + float x2, + float y2, + float x3, + float y3); Adds a cubic bezier curve segment to the current path with the given second, third and fourth control points and using current pen location @@ -333,13 +342,14 @@ cogl_path_line () -cogl_path_linevoid cogl_path_line (ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2); - -Clears the previously constructed shape and constructs a straight -line shape start and ending at the given coordinates. +cogl_path_linevoid cogl_path_line (float x1, + float y1, + float x2, + float y2); + +Constructs a straight line shape starting and ending at the given +coordinates. If there is an existing path this will start a new +disjoint sub-path. @@ -358,13 +368,14 @@ cogl_path_polyline () -cogl_path_polylinevoid cogl_path_polyline (ClutterFixed *coords, +cogl_path_polylinevoid cogl_path_polyline (float *coords, gint num_points); -Clears the previously constructed shape and constructs a series of straight -line segments, starting from the first given vertex coordinate. Each -subsequent segment stars where the previous one ended and ends at the next -given vertex coordinate. +Constructs a series of straight line segments, starting from the +first given vertex coordinate. If there is an existing path this +will start a new disjoint sub-path. Each subsequent segment starts +where the previous one ended and ends at the next given vertex +coordinate. The coords array must contain 2 * num_points values. The first value @@ -385,11 +396,11 @@ cogl_path_polygon () -cogl_path_polygonvoid cogl_path_polygon (ClutterFixed *coords, +cogl_path_polygonvoid cogl_path_polygon (float *coords, gint num_points); -Clears the previously constructed shape and constructs a polygonal -shape of the given number of vertices. +Constructs a polygonal shape of the given number of vertices. If +there is an existing path this will start a new disjoint sub-path. The coords array must contain 2 * num_points values. The first value @@ -409,13 +420,13 @@ cogl_path_rectangle () -cogl_path_rectanglevoid cogl_path_rectangle (ClutterFixed x, - ClutterFixed y, - ClutterFixed width, - ClutterFixed height); +cogl_path_rectanglevoid cogl_path_rectangle (float x, + float y, + float width, + float height); -Clears the previously constructed shape and constructs a rectangular -shape at the given coordinates. +Constructs a rectangular shape at the given coordinates. If there +is an existing path this will start a new disjoint sub-path. @@ -434,15 +445,15 @@ cogl_path_round_rectangle () -cogl_path_round_rectanglevoid cogl_path_round_rectangle (ClutterFixed x, - ClutterFixed y, - ClutterFixed width, - ClutterFixed height, - ClutterFixed radius, - ClutterAngle arc_step); +cogl_path_round_rectanglevoid cogl_path_round_rectangle (float x, + float y, + float width, + float height, + float radius, + float arc_step); -Clears the previously constructed shape and constructs a rectangular -shape with rounded corners. +Constructs a rectangular shape with rounded corners. If there is an +existing path this will start a new disjoint sub-path. @@ -468,13 +479,13 @@ cogl_path_ellipse () -cogl_path_ellipsevoid cogl_path_ellipse (ClutterFixed center_x, - ClutterFixed center_y, - ClutterFixed radius_x, - ClutterFixed radius_y); +cogl_path_ellipsevoid cogl_path_ellipse (float center_x, + float center_y, + float radius_x, + float radius_y); -Clears the previously constructed shape and constructs an ellipse -shape. +Constructs an ellipse shape. If there is an existing path this will +start a new disjoint sub-path. @@ -491,55 +502,334 @@ Y radius of the ellipse + +cogl_path_fill () +cogl_path_fillvoid cogl_path_fill (void); + +Fills the constructed shape using the current drawing color. The +current path is then cleared. To use the path again, call +cogl_path_fill_preserve() instead. + + + + +cogl_path_fill_preserve () +cogl_path_fill_preservevoid cogl_path_fill_preserve (void); + +Fills the constructed shape using the current drawing color and +preserves the path to be used again. + + +Since 1.0 + + +cogl_path_stroke () +cogl_path_strokevoid cogl_path_stroke (void); + +Strokes the constructed shape using the current drawing color and a +width of 1 pixel (regardless of the current transformation +matrix). To current path is then cleared. To use the path again, +call cogl_path_stroke_preserve() instead. + + + + +cogl_path_stroke_preserve () +cogl_path_stroke_preservevoid cogl_path_stroke_preserve (void); + +Strokes the constructed shape using the current drawing color and +preserves the path to be used again. + + +Since 1.0 + + +cogl_set_source_color () +cogl_set_source_colorvoid cogl_set_source_color (const CoglColor *color); + +Sets the source color using normalized values for each component. +This color will be used for any subsequent drawing operation. + + +See also cogl_set_source_color4ub() and cogl_set_source_color4f() +if you already have the color components. + + + +color : + a CoglColor + +Since 1.0 + + +cogl_set_source_color4ub () +cogl_set_source_color4ubvoid cogl_set_source_color4ub (guint8 red, + guint8 green, + guint8 blue, + guint8 alpha); + +Sets the source color using unsigned bytes for each component. This +color will be used for any subsequent drawing operation. + + +The value for each component is an unsigned byte in the range +between 0 and 255. + + + +red : + value of the red channel, between 0 and 255 + +green : + value of the green channel, between 0 and 255 + +blue : + value of the blue channel, between 0 and 255 + +alpha : + value of the alpha channel, between 0 and 255 + +Since 1.0 + + +cogl_set_source_color4f () +cogl_set_source_color4fvoid cogl_set_source_color4f (float red, + float green, + float blue, + float alpha); + +Sets the source color using normalized values for each component. +This color will be used for any subsequent drawing operation. + + +The value for each component is a fixed point number in the range +between 0 and 1.0. If the values passed in are outside that +range, they will be clamped. + + + +red : + value of the red channel, between 0 and 1.0 + +green : + value of the green channel, between 0 and 1.0 + +blue : + value of the blue channel, between 0 and 1.0 + +alpha : + value of the alpha channel, between 0 and 1.0 + +Since 1.0 + + +cogl_set_source_texture () +cogl_set_source_texturevoid cogl_set_source_texture (CoglHandle texture_handle); + +This is a convenience function for creating a material with the first +layer set to texture_handle and setting that material as the source with +cogl_set_source. + + +Since 1.0 + + + +texture_handle : + The Cogl texture you want as your source + + + +cogl_color +cogl_color#define cogl_color cogl_color_REPLACED_BY_cogl_set_source_color + + + + cogl_rectangle () -cogl_rectanglevoid cogl_rectangle (gint x, - gint y, - guint width, - guint height); +cogl_rectanglevoid cogl_rectangle (float x1, + float y1, + float x2, + float y2); -Fills a rectangle at the given coordinates with the current -drawing color in a highly optimizied fashion. +Fills a rectangle at the given coordinates with the current source material -x : +x1 : X coordinate of the top-left corner -y : +y1 : Y coordinate of the top-left corner -width : - Width of the rectangle +x2 : + X coordinate of the bottom-right corner -height : - Height of the rectangle +y2 : + Y coordinate of the bottom-right corner - -cogl_rectanglex () -cogl_rectanglexvoid cogl_rectanglex (ClutterFixed x, - ClutterFixed y, - ClutterFixed width, - ClutterFixed height); + +cogl_polygon () +cogl_polygonvoid cogl_polygon (CoglTextureVertex *vertices, + guint n_vertices, + gboolean use_color); -A fixed-point version of cogl_fast_fill_rectangle. +Draws a convex polygon using the current source material to fill / texture +with according to the texture coordinates passed. + + +If use_color is TRUE then the color will be changed for each vertex using +the value specified in the color member of CoglTextureVertex. This can be +used for example to make the texture fade out by setting the alpha value of +the color. + + +All of the texture coordinates must be in the range [0,1] and repeating the +texture is not supported. + + +Because of the way this function is implemented it will currently only work +if either the texture is not sliced or the backend is not OpenGL ES and the +minifying and magnifying functions are both set to CGL_NEAREST. + + +Since 1.0 -x : - X coordinate of the top-left corner +vertices : + An array of CoglTextureVertex structs -y : - Y coordinate of the top-left corner +n_vertices : + The length of the vertices array -width : - Width of the rectangle +use_color : + TRUE if the color member of CoglTextureVertex should be used -height : - Height of the rectangle + + +cogl_rectangle_with_multitexture_coords () +cogl_rectangle_with_multitexture_coordsvoid cogl_rectangle_with_multitexture_coords + (float x1, + float y1, + float x2, + float y2, + const float *tex_coords, + gint tex_coords_len); + +This function draws a rectangle using the current source material to +texture or fill with. As a material may contain multiple texture layers +this interface lets you supply texture coordinates for each layer of the +material. + + +The first pair of coordinates are for the first layer (with the smallest +layer index) and if you supply less texture coordinates than there are +layers in the current source material then default texture coordinates +(0.0, 0.0, 1.0, 1.0) are generated. + + +Since 1.0 + + + +x1 : + x coordinate upper left on screen. + +y1 : + y coordinate upper left on screen. + +x2 : + x coordinate lower right on screen. + +y2 : + y coordinate lower right on screen. + +tex_coords : + An array containing groups of 4 float values: + [tx1, ty1, tx2, ty2] that are interpreted as two texture coordinates; one + for the upper left texel, and one for the lower right texel. Each value + should be between 0.0 and 1.0, where the coordinate (0.0, 0.0) represents + the top left of the texture, and (1.0, 1.0) the bottom right. + +tex_coords_len : + The length of the tex_coords array. (e.g. for one layer + and one group of texture coordinates, this would be 4) + + + +cogl_rectangle_with_texture_coords () +cogl_rectangle_with_texture_coordsvoid cogl_rectangle_with_texture_coords (float x1, + float y1, + float x2, + float y2, + float tx1, + float ty1, + float tx2, + float ty2); + +Draw a rectangle using the current material and supply texture coordinates +to be used for the first texture layer of the material. To draw the entire +texture pass in tx1=0.0 ty1=0.0 tx2=1.0 ty2=1.0. + + +Since 1.0 + + + +x1 : + x coordinate upper left on screen. + +y1 : + y coordinate upper left on screen. + +x2 : + x coordinate lower right on screen. + +y2 : + y coordinate lower right on screen. + +tx1 : + x part of texture coordinate to use for upper left pixel + +ty1 : + y part of texture coordinate to use for upper left pixel + +tx2 : + x part of texture coordinate to use for lower right pixel + +ty2 : + y part of texture coordinate to use for left pixel + +cogl_rectangles_with_texture_coords () +cogl_rectangles_with_texture_coordsvoid cogl_rectangles_with_texture_coords (const float *verts, + guint n_rects); + +Draws a series of rectangles in the same way that +cogl_rectangle_with_texture_coords() does. In some situations it can give a +significant performance boost to use this function rather than +calling cogl_rectangle_with_texture_coords() separately for each rectangle. + + +verts should point to an array of floats with +n_rects * 8 elements. Each group of 8 values corresponds to the +parameters x1, y1, x2, y2, tx1, ty1, tx2 and ty2 and have the same +meaning as in cogl_rectangle_with_texture_coords(). + + + +verts : + an array of vertices + +n_rects : + number of rectangles to draw + +Since 0.8.6 + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/xml/cogl-shaders.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/xml/cogl-shaders.xml --- clutter-0.8.4/doc/reference/cogl/xml/cogl-shaders.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/xml/cogl-shaders.xml 2009-01-30 12:41:02.000000000 +0000 @@ -46,6 +46,21 @@ const gchar *uniform_name); void cogl_program_uniform_1f (COGLint uniform_no, gfloat value); +void cogl_program_uniform_1i (COGLint uniform_no, + gint value); +void cogl_program_uniform_float (COGLint uniform_no, + gint size, + gint count, + const GLfloat *value); +void cogl_program_uniform_int (COGLint uniform_no, + gint size, + gint count, + const COGLint *value); +void cogl_program_uniform_matrix (COGLint uniform_no, + gint size, + gint count, + gboolean transpose, + const GLfloat *value); @@ -291,13 +306,13 @@ cogl_program_usevoid cogl_program_use (CoglHandle handle); Activate a specific shader program replacing that part of the GL -rendering pipeline, if passed in COGL_INVALID_HANDLE the default +rendering pipeline, if passed in COGL_INVALID_HANDLE the default behavior of GL is reinstated. handle : - a CoglHandle for a shader program or COGL_INVALID_HANDLE. + a CoglHandle for a shader program or COGL_INVALID_HANDLE. @@ -305,8 +320,8 @@ cogl_program_get_uniform_locationCOGLint cogl_program_get_uniform_location (CoglHandle handle, const gchar *uniform_name); -Retrieve the location (offset) of a uniform variable in a shader program, a -uniform is a variable that is constant for all vertices/fragments for a +Retrieve the location (offset) of a uniform variable in a shader program, +a uniform is a variable that is constant for all vertices/fragments for a shader object and is possible to modify as an external parameter. @@ -317,8 +332,9 @@ uniform_name : the name of a uniform. -Returns : the offset of a uniform in a specified program, this uniform can be -set using cogl_program_uniform_1f when the program is in use. +Returns : the offset of a uniform in a specified program. + This uniform can be set using cogl_program_uniform_1f() when the + program is in use. @@ -326,8 +342,8 @@ cogl_program_uniform_1fvoid cogl_program_uniform_1f (COGLint uniform_no, gfloat value); -Changes the value of a uniform in the currently used (see cogl_program_use) -shader program. +Changes the value of a floating point uniform in the currently +used (see cogl_program_use()) shader program. @@ -338,6 +354,103 @@ the new value of the uniform. + +cogl_program_uniform_1i () +cogl_program_uniform_1ivoid cogl_program_uniform_1i (COGLint uniform_no, + gint value); + +Changes the value of an integer uniform in the currently +used (see cogl_program_use()) shader program. + + + +uniform_no : + the unform to set. + +value : + the new value of the uniform. + + + +cogl_program_uniform_float () +cogl_program_uniform_floatvoid cogl_program_uniform_float (COGLint uniform_no, + gint size, + gint count, + const GLfloat *value); + +Changes the value of a float vector uniform, or uniform array in the +currently used (see cogl_program_use) shader program. + + + +uniform_no : + the uniform to set. + +size : + Size of float vector. + +count : + Size of array of uniforms. + +value : + the new value of the uniform. + + + +cogl_program_uniform_int () +cogl_program_uniform_intvoid cogl_program_uniform_int (COGLint uniform_no, + gint size, + gint count, + const COGLint *value); + +Changes the value of a int vector uniform, or uniform array in the +currently used (see cogl_program_use()) shader program. + + + +uniform_no : + the uniform to set. + +size : + Size of int vector. + +count : + Size of array of uniforms. + +value : + the new value of the uniform. + + + +cogl_program_uniform_matrix () +cogl_program_uniform_matrixvoid cogl_program_uniform_matrix (COGLint uniform_no, + gint size, + gint count, + gboolean transpose, + const GLfloat *value); + +Changes the value of a matrix uniform, or uniform array in the +currently used (see cogl_program_use()) shader program. The size +parameter is used to determine the square size of the matrix. + + + +uniform_no : + the uniform to set. + +size : + Size of matrix. + +count : + Size of array of uniforms. + +transpose : + Whether to transpose the matrix when setting the uniform. + +value : + the new value of the uniform. + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/xml/cogl-texture.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/xml/cogl-texture.xml --- clutter-0.8.4/doc/reference/cogl/xml/cogl-texture.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/xml/cogl-texture.xml 2009-01-30 12:41:02.000000000 +0000 @@ -21,20 +21,21 @@ CoglTextureVertex; +enum CoglTextureFlags; CoglHandle cogl_texture_new_with_size (guint width, guint height, gint max_waste, - gboolean auto_mipmap, + CoglTextureFlags flags, CoglPixelFormat internal_format); CoglHandle cogl_texture_new_from_file (const gchar *filename, gint max_waste, - gboolean auto_mipmap, + CoglTextureFlags flags, CoglPixelFormat internal_format, GError **error); CoglHandle cogl_texture_new_from_data (guint width, guint height, gint max_waste, - gboolean auto_mipmap, + CoglTextureFlags flags, CoglPixelFormat format, CoglPixelFormat internal_format, guint rowstride, @@ -46,7 +47,14 @@ GLuint x_pot_waste, GLuint y_pot_waste, CoglPixelFormat format); +CoglHandle cogl_texture_new_from_bitmap (CoglBitmap *bitmap, + gint max_waste, + CoglTextureFlags flags, + CoglPixelFormat internal_format); gboolean cogl_is_texture (CoglHandle handle); +CoglHandle cogl_texture_ref (CoglHandle handle); +void cogl_texture_unref (CoglHandle handle); + guint cogl_texture_get_width (CoglHandle handle); guint cogl_texture_get_height (CoglHandle handle); CoglPixelFormat cogl_texture_get_format (CoglHandle handle); @@ -77,21 +85,14 @@ CoglPixelFormat format, guint rowstride, const guchar *data); -CoglHandle cogl_texture_ref (CoglHandle handle); -void cogl_texture_unref (CoglHandle handle); -void cogl_texture_rectangle (CoglHandle handle, - ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2, - ClutterFixed tx1, - ClutterFixed ty1, - ClutterFixed tx2, - ClutterFixed ty2); -void cogl_texture_polygon (CoglHandle handle, - guint n_vertices, - CoglTextureVertex *vertices, - gboolean use_color); + + CoglBitmap; +CoglBitmap* cogl_bitmap_new_from_file (const gchar *filename, + GError **error); +void cogl_bitmap_free (CoglBitmap *bmp); +gboolean cogl_bitmap_get_size_from_file (const gchar *filename, + gint *width, + gint *height); @@ -119,9 +120,9 @@ CoglTextureVertex CoglTextureVertextypedef struct { - ClutterFixed x, y, z; - ClutterFixed tx, ty; - ClutterColor color; + float x, y, z; + float tx, ty; + CoglColor color; } CoglTextureVertex; @@ -130,46 +131,71 @@ -ClutterFixed x; +float x; Model x-coordinate -ClutterFixed y; +float y; Model y-coordinate -ClutterFixed z; +float z; Model z-coordinate -ClutterFixed tx; +float tx; Texture x-coordinate -ClutterFixed ty; +float ty; Texture y-coordinate -ClutterColor color; +CoglColor color; The color to use at this vertex. This is ignored if use_color is FALSE when calling cogl_texture_polygon(). - + +enum CoglTextureFlags +CoglTextureFlagstypedef enum { + COGL_TEXTURE_NONE = 0, + COGL_TEXTURE_AUTO_MIPMAP = 1 << 0 +} CoglTextureFlags; + + +Flags to pass to the cogl_texture_new_* family of functions. + + + + +COGL_TEXTURE_NONE + No flags specified + + + +COGL_TEXTURE_AUTO_MIPMAP + Enables the automatic generation of the + mipmap pyramid from the base level image whenever it is updated + + +Since 1.0 + + cogl_texture_new_with_size () -cogl_texture_new_with_sizeCoglHandle cogl_texture_new_with_size (guint width, +cogl_texture_new_with_sizeCoglHandle cogl_texture_new_with_size (guint width, guint height, gint max_waste, - gboolean auto_mipmap, + CoglTextureFlags flags, CoglPixelFormat internal_format); -Create a new texture with specified dimensions and pixel format. +Creates a new COGL texture with the specified dimensions and pixel format. @@ -180,30 +206,31 @@ height of texture in pixels. max_waste : - maximum extra horizontal and|or vertical margin pixels to make -texture fit GPU limitations. + maximum extra horizontal and|or vertical margin pixels + to make the texture fit GPU limitations -auto_mipmap : - enable or disable automatic generation of mipmap pyramid -from the base level image whenever it is updated. +flags : + Optional flags for the texture, or COGL_TEXTURE_NONE internal_format : the CoglPixelFormat to use for the GPU storage of the -texture. + texture. -Returns : a CoglHandle to the newly created texture or COGL_INVALID_HANDLE -if texture creation failed. +Returns : a CoglHandle to the newly created texture or + COGL_INVALID_HANDLE on failure + - - +Since 0.8 + + cogl_texture_new_from_file () -cogl_texture_new_from_fileCoglHandle cogl_texture_new_from_file (const gchar *filename, +cogl_texture_new_from_fileCoglHandle cogl_texture_new_from_file (const gchar *filename, gint max_waste, - gboolean auto_mipmap, + CoglTextureFlags flags, CoglPixelFormat internal_format, GError **error); -Load an image file from disk. +Creates a COGL texture from an image file. @@ -211,73 +238,76 @@ the file to load max_waste : - maximum extra horizontal and|or vertical margin pixels to make -texture fit GPU limitations. + maximum extra horizontal and|or vertical margin pixels + to make the texture fit GPU limitations -auto_mipmap : - enable or disable automatic generation of mipmap pyramid -from the base level image whenever it is updated. +flags : + Optional flags for the texture, or COGL_TEXTURE_NONE internal_format : the CoglPixelFormat to use for the GPU storage of the -texture. + texture error : - a GError or NULL. + return location for a GError or NULL -Returns : a CoglHandle to the newly created texture or COGL_INVALID_HANDLE -if creating the texture failed. +Returns : a CoglHandle to the newly created texture or + COGL_INVALID_HANDLE on failure + - - +Since 0.8 + + cogl_texture_new_from_data () -cogl_texture_new_from_dataCoglHandle cogl_texture_new_from_data (guint width, +cogl_texture_new_from_dataCoglHandle cogl_texture_new_from_data (guint width, guint height, gint max_waste, - gboolean auto_mipmap, + CoglTextureFlags flags, CoglPixelFormat format, CoglPixelFormat internal_format, guint rowstride, const guchar *data); -Create a new cogl texture based on data residing in memory. +Creates a new COGL texture based on data residing in memory. width : - width of texture in pixels. + width of texture in pixels height : - height of texture in pixels. + height of texture in pixels max_waste : - maximum extra horizontal and|or vertical margin pixels to make + maximum extra horizontal and|or vertical margin pixels + to make the texture fit GPU limitations -auto_mipmap : - enable or disable automatic generation of mipmap pyramid -from the base level image whenever it is updated. +flags : + Optional flags for the texture, or COGL_TEXTURE_NONE format : the CoglPixelFormat the buffer is stored in in RAM internal_format : - the CoglPixelFormat that will be used for storing the -buffer on the GPU. + the CoglPixelFormat that will be used for storing + the buffer on the GPU rowstride : - the memory offset in bytes between the starts of scanlines in -data. + the memory offset in bytes between the starts of + scanlines in data data : - pointer the memory region where the source buffer resides. + pointer the memory region where the source buffer resides -Returns : a CoglHandle to the newly created texture or COGL_INVALID_HANDLE -if creating the texture failed. +Returns : a CoglHandle to the newly created texture or + COGL_INVALID_HANDLE on failure + - - +Since 0.8 + + cogl_texture_new_from_foreign () -cogl_texture_new_from_foreignCoglHandle cogl_texture_new_from_foreign (GLuint gl_handle, +cogl_texture_new_from_foreignCoglHandle cogl_texture_new_from_foreign (GLuint gl_handle, GLenum gl_target, GLuint width, GLuint height, @@ -285,9 +315,9 @@ GLuint y_pot_waste, CoglPixelFormat format); -Create a cogl texture based on an existing OpenGL texture, the width, height -and format are passed along since it is not possible to query this from a -handle with GLES 1.0. +Creates a COGL texture based on an existing OpenGL texture; the +width, height and format are passed along since it is not possible +to query this from a handle with GLES 1.0. @@ -312,10 +342,43 @@ format : format of the foreign texture. -Returns : a CoglHandle to the newly created texture or COGL_INVALID_HANDLE -if creating the texture failed. +Returns : a CoglHandle to the newly created texture or + COGL_INVALID_HANDLE on failure + - +Since 0.8 + + +cogl_texture_new_from_bitmap () +cogl_texture_new_from_bitmapCoglHandle cogl_texture_new_from_bitmap (CoglBitmap *bitmap, + gint max_waste, + CoglTextureFlags flags, + CoglPixelFormat internal_format); + +Creates a COGL texture from a CoglBitmap. + + + +bitmap : + a CoglBitmap + +max_waste : + maximum extra horizontal and|or vertical margin pixels + to make the texture fit GPU limitations + +flags : + Optional flags for the texture, or COGL_TEXTURE_NONE + +internal_format : + the CoglPixelFormat to use for the GPU storage of the +texture + +Returns : a CoglHandle to the newly created texture or + COGL_INVALID_HANDLE on failure + + +Since 1.0 + cogl_is_texture () cogl_is_texturegboolean cogl_is_texture (CoglHandle handle); @@ -331,6 +394,32 @@ FALSE otherwise + +cogl_texture_ref () +cogl_texture_refCoglHandle cogl_texture_ref (CoglHandle handle); + +Increment the reference count for a cogl texture. + + + +handle : + a CoglHandle. + +Returns : the handle. + + + +cogl_texture_unref () +cogl_texture_unrefvoid cogl_texture_unref (CoglHandle handle); + +Deccrement the reference count for a cogl texture. + + + +handle : + a CoglHandle. + + cogl_texture_get_width () cogl_texture_get_widthguint cogl_texture_get_width (CoglHandle handle); @@ -582,117 +671,74 @@ Returns : TRUE if the subregion upload was successful, otherwise FALSE. - -cogl_texture_ref () -cogl_texture_refCoglHandle cogl_texture_ref (CoglHandle handle); + +CoglBitmap +CoglBitmaptypedef struct _CoglBitmap CoglBitmap; -Increment the reference count for a cogl texture. +Type used for storing image data. - -handle : - a CoglHandle. - -Returns : the handle. - - - -cogl_texture_unref () -cogl_texture_unrefvoid cogl_texture_unref (CoglHandle handle); + + +cogl_bitmap_new_from_file () +cogl_bitmap_new_from_fileCoglBitmap* cogl_bitmap_new_from_file (const gchar *filename, + GError **error); -Deccrement the reference count for a cogl texture. +Load an image file from disk. This function can be safely called from +within a thread. -handle : - a CoglHandle. +filename : + the file to load. - - -cogl_texture_rectangle () -cogl_texture_rectanglevoid cogl_texture_rectangle (CoglHandle handle, - ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2, - ClutterFixed tx1, - ClutterFixed ty1, - ClutterFixed tx2, - ClutterFixed ty2); +error : + a GError or NULL. + +Returns : A CoglBitmap to the new loaded image data, or NULL if loading +the image failed. + + +Since 1.0 + + +cogl_bitmap_free () +cogl_bitmap_freevoid cogl_bitmap_free (CoglBitmap *bmp); -Draw a rectangle from a texture to the display, to draw the entire -texture pass in tx1=0.0 ty1=0.0 tx2=1.0 ty2=1.0. +Frees a CoglBitmap. -handle : - a CoglHandle. - -x1 : - x coordinate upper left on screen. - -y1 : - y coordinate upper left on screen. - -x2 : - x coordinate lower right on screen. - -y2 : - y coordinate lower right on screen. - -tx1 : - x part of texture coordinate to use for upper left pixel - -ty1 : - y part of texture coordinate to use for upper left pixel - -tx2 : - x part of texture coordinate to use for lower right pixel - -ty2 : - y part of texture coordinate to use for left pixel +bmp : + a CoglBitmap. - -cogl_texture_polygon () -cogl_texture_polygonvoid cogl_texture_polygon (CoglHandle handle, - guint n_vertices, - CoglTextureVertex *vertices, - gboolean use_color); - -Draws a polygon from a texture with the given model and texture -coordinates. This can be used to draw arbitrary shapes textured -with a COGL texture. If use_color is TRUE then the current COGL -color will be changed for each vertex using the value specified in -the color member of CoglTextureVertex. This can be used for -example to make the texture fade out by setting the alpha value of -the color. - - -All of the texture coordinates must be in the range [0,1] and -repeating the texture is not supported. - + +cogl_bitmap_get_size_from_file () +cogl_bitmap_get_size_from_filegboolean cogl_bitmap_get_size_from_file (const gchar *filename, + gint *width, + gint *height); -Because of the way this function is implemented it will currently -only work if either the texture is not sliced or the backend is not -OpenGL ES and the minifying and magnifying functions are both set -to CGL_NEAREST. +Parses an image file enough to extract the width and height +of the bitmap. -handle : - A CoglHandle for a texture +filename : + the file to check -n_vertices : - The length of the vertices array +width : + return location for the bitmap width -vertices : - An array of CoglTextureVertex structs +height : + return location for the bitmap height -use_color : - TRUE if the color member of CoglTextureVertex should be used +Returns : + + - +Since 1.0 + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/xml/cogl-util.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/xml/cogl-util.xml --- clutter-0.8.4/doc/reference/cogl/xml/cogl-util.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/xml/cogl-util.xml 2009-01-30 12:41:02.000000000 +0000 @@ -27,7 +27,7 @@ void (*CoglFuncPtr) (void); enum CoglFeatureFlags; -ClutterFeatureFlags cogl_get_features (void); +CoglFeatureFlags cogl_get_features (void); gboolean cogl_features_available (CoglFeatureFlags features); CoglFuncPtr cogl_get_proc_address (const gchar *name); @@ -37,7 +37,7 @@ gint *green, gint *blue, gint *alpha); -void cogl_paint_init (const ClutterColor *color); +void cogl_paint_init (const CoglColor *color); int cogl_util_next_p2 (int a); @@ -111,9 +111,9 @@ - + enum CoglFeatureFlags -CoglFeatureFlagstypedef enum +CoglFeatureFlagstypedef enum { COGL_FEATURE_TEXTURE_RECTANGLE = (1 << 1), COGL_FEATURE_TEXTURE_NPOT = (1 << 2), @@ -124,18 +124,75 @@ COGL_FEATURE_OFFSCREEN_MULTISAMPLE = (1 << 7), COGL_FEATURE_OFFSCREEN_BLIT = (1 << 8), COGL_FEATURE_FOUR_CLIP_PLANES = (1 << 9), - COGL_FEATURE_STENCIL_BUFFER = (1 << 10) - + COGL_FEATURE_STENCIL_BUFFER = (1 << 10), + COGL_FEATURE_VBOS = (1 << 11) } CoglFeatureFlags; Flags for the supported features. + + +COGL_FEATURE_TEXTURE_RECTANGLE + ARB_texture_rectangle support + + + +COGL_FEATURE_TEXTURE_NPOT + ARB_texture_non_power_of_two support + + + +COGL_FEATURE_TEXTURE_YUV + ycbcr conversion support + + + +COGL_FEATURE_TEXTURE_READ_PIXELS + glReadPixels() support + + + +COGL_FEATURE_SHADERS_GLSL + GLSL support + + + +COGL_FEATURE_OFFSCREEN + FBO support + + + +COGL_FEATURE_OFFSCREEN_MULTISAMPLE + Multisample support on FBOs + + + +COGL_FEATURE_OFFSCREEN_BLIT + Blit support on FBOs + + + +COGL_FEATURE_FOUR_CLIP_PLANES + At least 4 clip planes available + + + +COGL_FEATURE_STENCIL_BUFFER + Stencil buffer support + + + +COGL_FEATURE_VBOS + VBO support + + +Since 0.8 cogl_get_features () -cogl_get_featuresClutterFeatureFlags cogl_get_features (void); +cogl_get_featuresCoglFeatureFlags cogl_get_features (void); Returns all of the features supported by COGL. @@ -226,7 +283,7 @@ cogl_paint_init () -cogl_paint_initvoid cogl_paint_init (const ClutterColor *color); +cogl_paint_initvoid cogl_paint_init (const CoglColor *color); Clears the color buffer to color. The depth buffer and stencil buffers are also cleared and fogging and lighting are disabled. diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/xml/cogl-vertex-buffer.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/xml/cogl-vertex-buffer.xml --- clutter-0.8.4/doc/reference/cogl/xml/cogl-vertex-buffer.xml 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/doc/reference/cogl/xml/cogl-vertex-buffer.xml 2009-01-30 12:41:02.000000000 +0000 @@ -0,0 +1,481 @@ + + +]> + + +Vertex Buffers +3 +COGL Library + + + +Vertex Buffers +An API for submitting extensible arrays of vertex + attributes to OpenGL in a way that aims to minimise + copying or reformatting of the original data. + + + + +Synopsis + + +enum CoglVertexBufferAttribFlags; +#define COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_MASK +#define COGL_VERTEX_BUFFER_ATTRIB_FLAG_TYPE_MASK +CoglHandle cogl_vertex_buffer_new (guint n_vertices); +CoglHandle cogl_vertex_buffer_ref (CoglHandle handle); +void cogl_vertex_buffer_unref (CoglHandle handle); +void cogl_vertex_buffer_add (CoglHandle handle, + const char *attribute_name, + guint8 n_components, + GLenum gl_type, + gboolean normalized, + guint16 stride, + const void *pointer); +void cogl_vertex_buffer_delete (CoglHandle handle, + const char *attribute_name); +void cogl_vertex_buffer_enable (CoglHandle handle, + const char *attribute_name); +void cogl_vertex_buffer_disable (CoglHandle handle, + const char *attribute_name); +void cogl_vertex_buffer_submit (CoglHandle handle); +void cogl_vertex_buffer_draw (CoglHandle handle, + GLenum mode, + GLint first, + GLsizei count); +void cogl_vertex_buffer_draw_range_elements + (CoglHandle handle, + GLenum mode, + GLuint min_index, + GLuint max_index, + GLsizei count, + GLenum indices_type, + const GLvoid *indices); + + + + + + + + + + + + +Description + +The Attributes Buffer API is designed to be a fairly raw mechanism for +developers to be able to submit geometry to Cogl in a format that can be +directly consumed by an OpenGL driver and with awareness of the specific +hardware being used then costly format conversion can also be avoided. + + +They are designed to work on top of buffer objects and developers should +understand that attribute buffers are not that cheap to create but once they +have been submitted they can be stored in GPU addressable memory and can +be quickly reused. + + +Although this API does allow you to modify attribute buffers after they have +been submitted to the GPU you must note that modification is also not that +cheap, so if at all possible think of tricks that let you reuse a static +buffer. To help with this, it is possible to enable and disable individual +attributes cheaply. + + +Take for example attributes representing an elipse. If you were to submit +color attributes, texture coordinates and normals, then you would be able +to draw an elipses in the following different ways without modifying +the vertex buffer, only by changing your source material. + +Flat colored elipse +Textured elipse +Smoothly lit textured elipse blended with the color. + + + +Another trick that can be used is submitting highly detailed vertices and +then using cogl_vertex_buffer_draw_range_elements to sample sub-sets of +the geometry or lower resolution geometry out from a fixed buffer. + + +The API doesn't currently give you any control over the actual OpenGL buffer +objects that are created, but you can expect that when you first submit +your attributes they start off in one or more GL_STATIC_DRAW buffers. +If you then update some of your attributes; then these attributes will +normally be moved into new GL_DYNAMIC_DRAW draw buffers. + + + + + + +Details + +enum CoglVertexBufferAttribFlags +CoglVertexBufferAttribFlagstypedef enum _CoglVertexBufferAttribFlags +{ + /* Types */ + /* NB: update the _TYPE_MASK below if these are changed */ + COGL_VERTEX_BUFFER_ATTRIB_FLAG_COLOR_ARRAY = 1<<0, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_NORMAL_ARRAY = 1<<1, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_TEXTURE_COORD_ARRAY = 1<<2, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_VERTEX_ARRAY = 1<<3, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_CUSTOM_ARRAY = 1<<4, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_INVALID = 1<<5, + + COGL_VERTEX_BUFFER_ATTRIB_FLAG_NORMALIZED = 1<<6, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_ENABLED = 1<<7, + + /* Usage hints */ + /* FIXME - flatten into one flag, since its used as a boolean */ + COGL_VERTEX_BUFFER_ATTRIB_FLAG_INFREQUENT_RESUBMIT = 1<<8, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_FREQUENT_RESUBMIT = 1<<9, + + /* GL Data types */ + /* NB: Update the _GL_TYPE_MASK below if these are changed */ + COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_BYTE = 1<<10, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_BYTE = 1<<11, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_SHORT = 1<<12, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_SHORT = 1<<13, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_INT = 1<<14, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_UNSIGNED_INT = 1<<15, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_FLOAT = 1<<16, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_DOUBLE = 1<<17, + + COGL_VERTEX_BUFFER_ATTRIB_FLAG_SUBMITTED = 1<<18, + COGL_VERTEX_BUFFER_ATTRIB_FLAG_UNUSED = 1<<19 + + /* XXX NB: If we need > 24 bits then look at changing the layout + * of struct _CoglVertexBufferAttrib below */ +} CoglVertexBufferAttribFlags; + + + + + +COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_MASK +COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_MASK#define COGL_VERTEX_BUFFER_ATTRIB_FLAG_GL_TYPE_MASK + + + + +COGL_VERTEX_BUFFER_ATTRIB_FLAG_TYPE_MASK +COGL_VERTEX_BUFFER_ATTRIB_FLAG_TYPE_MASK#define COGL_VERTEX_BUFFER_ATTRIB_FLAG_TYPE_MASK + + + + +cogl_vertex_buffer_new () +cogl_vertex_buffer_newCoglHandle cogl_vertex_buffer_new (guint n_vertices); + +This creates a Cogl handle for a new vertex buffer that you can then start +to add attributes too. + + + +n_vertices : + The number of vertices that your attributes will correspond to. + +Returns : + + + + + +cogl_vertex_buffer_ref () +cogl_vertex_buffer_refCoglHandle cogl_vertex_buffer_ref (CoglHandle handle); + +Increment the reference count for a vertex buffer + + + +handle : + a CoglHandle. + +Returns : the handle. + + + +cogl_vertex_buffer_unref () +cogl_vertex_buffer_unrefvoid cogl_vertex_buffer_unref (CoglHandle handle); + +Decrement the reference count for a vertex buffer + + + +handle : + a CoglHandle. + + + +cogl_vertex_buffer_add () +cogl_vertex_buffer_addvoid cogl_vertex_buffer_add (CoglHandle handle, + const char *attribute_name, + guint8 n_components, + GLenum gl_type, + gboolean normalized, + guint16 stride, + const void *pointer); + +This function lets you add an attribute to a buffer. You either use one +of the built-in names to add standard attributes, like positions, colors +and normals or you can add custom attributes for use in shaders. + + +Note: The number of vertices declared when first creating the vertex +buffer is used to determine how many attribute values will be read from the +supplied pointer. + + +Note: the data supplied here isn't copied anywhere until you call +cogl_vertex_buffer_submit, so the supplied pointer must remain valid +until then. +(This is an important optimisation since we can't create the underlying +OpenGL buffer object until we know about all the attributes, and repeatedly +copying large buffers of vertex data may be very costly) If you add +attributes after submitting then you will need to re-call +cogl_vertex_buffer_submit to commit the changes to the GPU. (Be carefull +to minimize the number of calls to cogl_vertex_buffer_submit though) + + +Note: If you are interleving attributes it is assumed that that each +interleaved attribute starts no farther than +- stride bytes from the other +attributes it is interleved with. I.e. this is ok: +|-0-0-0-0-0-0-0-0-0-0| +This is not ok: +|- - - - -0-0-0-0-0-0 0 0 0 0| +(Though you can have multiple groups of interleved attributes) + + + +handle : + A vertex buffer handle + +attribute_name : + The name of your attribute. It should be a valid GLSL + variable name and standard attribute types must use one + of following built-in names: (Note: they correspond to the + built-in names in GLSL) + + "gl_Color" + "gl_Normal" + "gl_MultiTexCoord0, gl_MultiTexCoord1, ..." + "gl_Vertex" + + To support adding multiple variations of the same attribute + the name can have a detail component, E.g. + "gl_Color::active" or "gl_Color::inactive" + +n_components : + The number of components per attribute and must be 1,2,3 or 4 + +gl_type : + Specifies the data type of each component (GL_BYTE, GL_UNSIGNED_BYTE, + GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT or + GL_DOUBLE) + +normalized : + If GL_TRUE, this specifies that values stored in an integer + format should be mapped into the range [-1.0, 1.0] or [0.1, 1.0] + for unsigned values. If GL_FALSE they are converted to floats + directly. + +stride : + This specifies the number of bytes from the start of one attribute + value to the start of the next value (for the same attribute). So + for example with a position interleved with color like this: + XYRGBAXYRGBAXYRGBA, then if each letter represents a byte, the + stride for both attributes is 6. The special value 0 means the + values are stored sequentially in memory. + +pointer : + This addresses the first attribute in the vertex array. (This + must remain valid until you call cogl_vertex_buffer_submit) + + + +cogl_vertex_buffer_delete () +cogl_vertex_buffer_deletevoid cogl_vertex_buffer_delete (CoglHandle handle, + const char *attribute_name); + +This function deletes an attribute from a buffer. You will need to +call cogl_vertex_buffer_submit to commit this change to the GPU. + + + +handle : + A vertex buffer handle + +attribute_name : + The name of a previously added attribute + + + +cogl_vertex_buffer_enable () +cogl_vertex_buffer_enablevoid cogl_vertex_buffer_enable (CoglHandle handle, + const char *attribute_name); + +This function enables a previosuly added attribute + + +Since it can be costly to add and remove new attributes to buffers; to make +individual buffers more reuseable it is possible to enable and disable +attributes before using a buffer for drawing. + + +Note: You don't need to call cogl_vertex_buffer_submit after using this +function + + + +handle : + A vertex buffer handle + +attribute_name : + The name of the attribute you want to enable + + + +cogl_vertex_buffer_disable () +cogl_vertex_buffer_disablevoid cogl_vertex_buffer_disable (CoglHandle handle, + const char *attribute_name); + +This function disables a previosuly added attribute + + +Since it can be costly to add and remove new attributes to buffers; to make +individual buffers more reuseable it is possible to enable and disable +attributes before using a buffer for drawing. + + +Note: You don't need to call cogl_vertex_buffer_submit after using this +function + + + +handle : + A vertex buffer handle + +attribute_name : + The name of the attribute you want to disable + + + +cogl_vertex_buffer_submit () +cogl_vertex_buffer_submitvoid cogl_vertex_buffer_submit (CoglHandle handle); + +This function copies all the user added attributes into buffer objects +managed by the OpenGL driver. + + +You should aim to minimize calls to this function. + + + +handle : + A vertex buffer handle + + + +cogl_vertex_buffer_draw () +cogl_vertex_buffer_drawvoid cogl_vertex_buffer_draw (CoglHandle handle, + GLenum mode, + GLint first, + GLsizei count); + +This function lets you draw geometry using all or a subset of the +vertices in a vertex buffer. + + + +handle : + A vertex buffer handle + +mode : + Specifies how the vertices should be interpreted, and should be + a valid GL primitive type: + + GL_POINTS + GL_LINE_STRIP + GL_LINE_LOOP + GL_LINES + GL_TRIANGLE_STRIP + GL_TRIANGLE_FAN + GL_TRIANGLES + + (Note: only types available in GLES are listed) + +first : + Specifies the index of the first vertex you want to draw with + +count : + Specifies the number of vertices you want to draw. + + + +cogl_vertex_buffer_draw_range_elements () +cogl_vertex_buffer_draw_range_elementsvoid cogl_vertex_buffer_draw_range_elements + (CoglHandle handle, + GLenum mode, + GLuint min_index, + GLuint max_index, + GLsizei count, + GLenum indices_type, + const GLvoid *indices); + +This function lets you use an array of indices to specify the vertices +within your vertex buffer that you want to draw. + + + +handle : + A vertex buffer handle + +mode : + Specifies how the vertices should be interpreted, and should be + a valid GL primitive type: + + GL_POINTS + GL_LINE_STRIP + GL_LINE_LOOP + GL_LINES + GL_TRIANGLE_STRIP + GL_TRIANGLE_FAN + GL_TRIANGLES + + (Note: only types available in GLES are listed) + +min_index : + Specifies the minimum vertex index contained in indices + +max_index : + Specifies the maximum vertex index contained in indices + +count : + Specifies the number of vertices you want to draw. + +indices_type : + Specifies the data type used for the indices, and must be + one of: + + GL_UNSIGNED_BYTE + GL_UNSIGNED_SHORT + GL_UNSIGNED_INT + + +indices : + Specifies the address of your array of indices + + + + + + + + + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/cogl/xml/cogl.xml /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/cogl/xml/cogl.xml --- clutter-0.8.4/doc/reference/cogl/xml/cogl.xml 2008-12-01 11:57:23.000000000 +0000 +++ clutter-0.9.0/doc/reference/cogl/xml/cogl.xml 2009-01-30 12:41:02.000000000 +0000 @@ -31,62 +31,59 @@ enum CoglPixelFormat; enum CoglBufferTarget; -void cogl_perspective (ClutterFixed fovy, - ClutterFixed aspect, - ClutterFixed z_near, - ClutterFixed z_far); -void cogl_frustum (ClutterFixed left, - ClutterFixed right, - ClutterFixed bottom, - ClutterFixed top, - ClutterFixed z_near, - ClutterFixed z_far); +void cogl_perspective (float fovy, + float aspect, + float z_near, + float z_far); +void cogl_frustum (float left, + float right, + float bottom, + float top, + float z_near, + float z_far); void cogl_setup_viewport (guint width, guint height, - ClutterFixed fovy, - ClutterFixed aspect, - ClutterFixed z_near, - ClutterFixed z_far); + float fovy, + float aspect, + float z_near, + float z_far); void cogl_viewport (guint width, guint height); -void cogl_get_modelview_matrix (ClutterFixed m[16]); -void cogl_get_projection_matrix (ClutterFixed m[16]); -void cogl_get_viewport (ClutterFixed v[4]); +void cogl_get_modelview_matrix (float m[16]); +void cogl_get_projection_matrix (float m[16]); +void cogl_get_viewport (float v[4]); void cogl_push_matrix (void); void cogl_pop_matrix (void); -void cogl_scale (ClutterFixed x, - ClutterFixed y); -void cogl_translatex (ClutterFixed x, - ClutterFixed y, - ClutterFixed z); -void cogl_translate (gint x, - gint y, - gint z); -void cogl_rotatex (ClutterFixed angle, - gint x, - gint y, - gint z); -void cogl_rotate (gint angle, - gint x, - gint y, - gint z); - -void cogl_clip_set (ClutterFixed x_offset, - ClutterFixed y_offset, - ClutterFixed width, - ClutterFixed height); +void cogl_scale (float x, + float y, + float z); +void cogl_translate (float x, + float y, + float z); +void cogl_rotate (float angle, + float x, + float y, + float z); + + CoglClipStackState; +void cogl_clip_set (float x_offset, + float y_offset, + float width, + float height); +void cogl_clip_set_from_path (void); +void cogl_clip_set_from_path_preserve (void); void cogl_clip_unset (void); void cogl_clip_stack_save (void); void cogl_clip_stack_restore (void); +void cogl_clip_ensure (void); void cogl_enable_depth_test (gboolean setting); -void cogl_alpha_func (COGLenum func, - ClutterFixed ref); -void cogl_fog_set (const ClutterColor *fog_color, - ClutterFixed density, - ClutterFixed z_near, - ClutterFixed z_far); +void cogl_enable_backface_culling (gboolean setting); +void cogl_fog_set (const CoglColor *fog_color, + float density, + float z_near, + float z_far); @@ -165,9 +162,9 @@ - + enum CoglPixelFormat -CoglPixelFormattypedef enum +CoglPixelFormattypedef enum { COGL_PIXEL_FORMAT_ANY = 0, COGL_PIXEL_FORMAT_A_8 = 1 | COGL_A_BIT, @@ -234,10 +231,107 @@ Pixel formats used by COGL. + + +COGL_PIXEL_FORMAT_ANY + Any format + + + +COGL_PIXEL_FORMAT_A_8 + 8 bits alpha mask + + + +COGL_PIXEL_FORMAT_RGB_565 + RGB, 16 bits + + + +COGL_PIXEL_FORMAT_RGBA_4444 + RGBA, 16 bits + + + +COGL_PIXEL_FORMAT_RGBA_5551 + RGBA, 16 bits + + + +COGL_PIXEL_FORMAT_YUV + FIXME + + + +COGL_PIXEL_FORMAT_G_8 + FIXME + + + +COGL_PIXEL_FORMAT_RGB_888 + RGB, 24 bits + + + +COGL_PIXEL_FORMAT_BGR_888 + BGR, 24 bits + + + +COGL_PIXEL_FORMAT_RGBA_8888 + RGBA, 32 bits + + + +COGL_PIXEL_FORMAT_BGRA_8888 + BGRA, 32 bits + + + +COGL_PIXEL_FORMAT_ARGB_8888 + ARGB, 32 bits + + + +COGL_PIXEL_FORMAT_ABGR_8888 + ABGR, 32 bits + + + +COGL_PIXEL_FORMAT_RGBA_8888_PRE + Premultiplied RGBA, 32 bits + + + +COGL_PIXEL_FORMAT_BGRA_8888_PRE + Premultiplied BGRA, 32 bits + + + +COGL_PIXEL_FORMAT_ARGB_8888_PRE + Premultiplied ARGB, 32 bits + + + +COGL_PIXEL_FORMAT_ABGR_8888_PRE + Premultiplied ABGR, 32 bits + + + +COGL_PIXEL_FORMAT_RGBA_4444_PRE + Premultiplied RGBA, 16 bits + + + +COGL_PIXEL_FORMAT_RGBA_5551_PRE + Premultiplied RGBA, 16 bits + + +Since 0.8 - + enum CoglBufferTarget -CoglBufferTargettypedef enum +CoglBufferTargettypedef enum { COGL_WINDOW_BUFFER = (1 << 1), COGL_MASK_BUFFER = (1 << 2), @@ -246,16 +340,33 @@ } CoglBufferTarget; - +Target flags for FBOs. + + +COGL_WINDOW_BUFFER + FIXME + + + +COGL_MASK_BUFFER + FIXME + + + +COGL_OFFSCREEN_BUFFER + FIXME + + +Since 0.8 cogl_perspective () -cogl_perspectivevoid cogl_perspective (ClutterFixed fovy, - ClutterFixed aspect, - ClutterFixed z_near, - ClutterFixed z_far); +cogl_perspectivevoid cogl_perspective (float fovy, + float aspect, + float z_near, + float z_far); Replaces the current projection matrix with a perspective matrix based on the provided values. @@ -277,12 +388,12 @@ cogl_frustum () -cogl_frustumvoid cogl_frustum (ClutterFixed left, - ClutterFixed right, - ClutterFixed bottom, - ClutterFixed top, - ClutterFixed z_near, - ClutterFixed z_far); +cogl_frustumvoid cogl_frustum (float left, + float right, + float bottom, + float top, + float z_near, + float z_far); Replaces the current projection matrix with a perspective matrix for the given viewing frustum. @@ -313,10 +424,10 @@ cogl_setup_viewport () cogl_setup_viewportvoid cogl_setup_viewport (guint width, guint height, - ClutterFixed fovy, - ClutterFixed aspect, - ClutterFixed z_near, - ClutterFixed z_far); + float fovy, + float aspect, + float z_near, + float z_far); Replaces the current viewport and projection matrix with the given values. The viewport is placed at the top left corner of the window @@ -365,7 +476,7 @@ cogl_get_modelview_matrix () -cogl_get_modelview_matrixvoid cogl_get_modelview_matrix (ClutterFixed m[16]); +cogl_get_modelview_matrixvoid cogl_get_modelview_matrix (float m[16]); Stores the current model-view matrix in m. The matrix is in column-major order. @@ -373,12 +484,12 @@ m : - pointer to a 4x4 array of ClutterFixeds to receive the matrix + pointer to a 4x4 array of floats to receive the matrix cogl_get_projection_matrix () -cogl_get_projection_matrixvoid cogl_get_projection_matrix (ClutterFixed m[16]); +cogl_get_projection_matrixvoid cogl_get_projection_matrix (float m[16]); Stores the current projection matrix in m. The matrix is in column-major order. @@ -386,12 +497,12 @@ m : - pointer to a 4x4 array of ClutterFixeds to receive the matrix + pointer to a 4x4 array of floats to receive the matrix cogl_get_viewport () -cogl_get_viewportvoid cogl_get_viewport (ClutterFixed v[4]); +cogl_get_viewportvoid cogl_get_viewport (float v[4]); Stores the current viewport in v. v[0] and v[1] get the x and y position of the viewport and v[2] and v[3] get the width and @@ -400,7 +511,7 @@ v : - pointer to a 4 element array of ClutterFixeds to + pointer to a 4 element array of floats to receive the viewport dimensions. @@ -423,11 +534,12 @@ cogl_scale () -cogl_scalevoid cogl_scale (ClutterFixed x, - ClutterFixed y); +cogl_scalevoid cogl_scale (float x, + float y, + float z); -Multiplies the current model-view matrix by one that scales the x -and y axes by the given values. +Multiplies the current model-view matrix by one that scales the x, +y and z axes by the given values. @@ -437,37 +549,18 @@ y : Amount to scale along the y-axis - - -cogl_translatex () -cogl_translatexvoid cogl_translatex (ClutterFixed x, - ClutterFixed y, - ClutterFixed z); - -Multiplies the current model-view matrix by one that translates the -model along all three axes according to the given values. - - - -x : - Distance to translate along the x-axis - -y : - Distance to translate along the y-axis - z : - Distance to translate along the z-axis + Amount to scale along the z-axis cogl_translate () -cogl_translatevoid cogl_translate (gint x, - gint y, - gint z); - -Integer version of cogl_translatex(). Multiplies the current -model-view matrix by one that translates the model along all three -axes according to the given values. +cogl_translatevoid cogl_translate (float x, + float y, + float z); + +Multiplies the current model-view matrix by one that translates the +model along all three axes according to the given values. @@ -481,12 +574,12 @@ Distance to translate along the z-axis - -cogl_rotatex () -cogl_rotatexvoid cogl_rotatex (ClutterFixed angle, - gint x, - gint y, - gint z); + +cogl_rotate () +cogl_rotatevoid cogl_rotate (float angle, + float x, + float y, + float z); Multiplies the current model-view matrix by one that rotates the model around the vertex specified by x, y and z. The rotation @@ -509,44 +602,35 @@ Z-component of vertex to rotate around. - -cogl_rotate () -cogl_rotatevoid cogl_rotate (gint angle, - gint x, - gint y, - gint z); - -Integer version of cogl_rotatex(). Multiplies the current -model-view matrix by one that rotates the model around the vertex -specified by x, y and z. + +CoglClipStackState +CoglClipStackStatetypedef struct { + /* Stack of stacks */ + GSList *stacks; + + gboolean stack_dirty; + gboolean stencil_used; +} CoglClipStackState; + - -angle : - Angle in degrees to rotate. - -x : - X-component of vertex to rotate around. - -y : - Y-component of vertex to rotate around. - -z : - Z-component of vertex to rotate around. - - + cogl_clip_set () -cogl_clip_setvoid cogl_clip_set (ClutterFixed x_offset, - ClutterFixed y_offset, - ClutterFixed width, - ClutterFixed height); +cogl_clip_setvoid cogl_clip_set (float x_offset, + float y_offset, + float width, + float height); Specifies a rectangular clipping area for all subsequent drawing operations. Any drawing commands that extend outside the rectangle will be clipped so that only the portion inside the rectangle will be displayed. The rectangle dimensions are transformed by the -current model-view matrix. +current model-view matrix. + + +The rectangle is intersected with the current clip region. To undo +the effect of this function, call cogl_clip_unset(). @@ -563,12 +647,36 @@ height of the clip rectangle + +cogl_clip_set_from_path () +cogl_clip_set_from_pathvoid cogl_clip_set_from_path (void); + +Sets a new clipping area using the current path. The current path +is then cleared. The clipping area is intersected with the previous +clipping area. To restore the previous clipping area, call +cogl_clip_unset(). + + +Since 1.0 + + +cogl_clip_set_from_path_preserve () +cogl_clip_set_from_path_preservevoid cogl_clip_set_from_path_preserve (void); + +Sets a new clipping area using the current path. The current path +is then cleared. The clipping area is intersected with the previous +clipping area. To restore the previous clipping area, call +cogl_clip_unset(). + + +Since 1.0 + cogl_clip_unset () cogl_clip_unsetvoid cogl_clip_unset (void); -Removes the current clipping rectangle so that all drawing -operations extend to full size of the viewport again. +Reverts the clipping region to the state before the last call to +cogl_clip_set(). @@ -595,6 +703,18 @@ Since 0.8.2 + +cogl_clip_ensure () +cogl_clip_ensurevoid cogl_clip_ensure (void); + +Ensures that the current clipping region has been set in GL. This +will automatically be called before any Cogl primitives but it +maybe be neccessary to call if you are using raw GL calls with +clipping. + + +Since 1.0 + cogl_enable_depth_test () cogl_enable_depth_testvoid cogl_enable_depth_test (gboolean setting); @@ -611,31 +731,28 @@ TRUE to enable depth testing or FALSE to disable. - -cogl_alpha_func () -cogl_alpha_funcvoid cogl_alpha_func (COGLenum func, - ClutterFixed ref); - -Changes the alpha test to use the specified function specified in func, -comparing with the value in ref. The default function is CGL_ALWAYS the -initial reference value is 1.0. + +cogl_enable_backface_culling () +cogl_enable_backface_cullingvoid cogl_enable_backface_culling (gboolean setting); + +Sets whether textures positioned so that their backface is showing +should be hidden. This can be used to efficiently draw two-sided +textures or fully closed cubes without enabling depth testing. Only +calls to cogl_texture_rectangle() and cogl_texture_polygon() are +affected. Backface culling is disabled by default. -func : - the comparison function to use, one of CGL_NEVER, CGL_LESS, -CGL_EQUAL, CGL_LEQUAL, CGL_GREATER, CGL_NOTEQUAL, CGL_GEQUAL and GL_ALWAYS. - -ref : - reference value. +setting : + TRUE to enable backface culling or FALSE to disable. cogl_fog_set () -cogl_fog_setvoid cogl_fog_set (const ClutterColor *fog_color, - ClutterFixed density, - ClutterFixed z_near, - ClutterFixed z_far); +cogl_fog_setvoid cogl_fog_set (const CoglColor *fog_color, + float density, + float z_near, + float z_far); Enables fogging. Fogging causes vertices that are further away from the eye to be rendered with a different color. The color is diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/Makefile.am --- clutter-0.8.4/doc/reference/Makefile.am 2008-09-29 15:16:27.000000000 +0100 +++ clutter-0.9.0/doc/reference/Makefile.am 2009-01-28 08:12:46.000000000 +0000 @@ -1 +1 @@ -SUBDIRS = clutter cogl +SUBDIRS = cogl clutter diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/doc/reference/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/doc/reference/Makefile.in --- clutter-0.8.4/doc/reference/Makefile.in 2008-11-28 18:22:48.000000000 +0000 +++ clutter-0.9.0/doc/reference/Makefile.in 2009-01-28 16:48:58.000000000 +0000 @@ -105,7 +105,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -130,6 +129,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -221,7 +221,7 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = clutter cogl +SUBDIRS = cogl clutter all: all-recursive .SUFFIXES: diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/HACKING /tmp/VXszleoOf1/clutter-0.9.0/HACKING --- clutter-0.8.4/HACKING 2008-09-29 15:16:27.000000000 +0100 +++ clutter-0.9.0/HACKING 2009-01-28 08:12:44.000000000 +0000 @@ -3,7 +3,7 @@ General notes and rules on clutter core hacking; - - GNU style indentation, please try hard to wrap at 80 chars. + - Follow the CODING_STYLE document. - All non static public API funcs should be documented in the source files via gtk-doc. Structures, enumerations and macros should be documented in @@ -31,7 +31,7 @@ ClutterUnit should always be used internally. - Properties should always be in floating point (never fixed point). - The preferred precision is double. + The preferred precision is double. - Properties should use pixels whenever is possible. If sub-pixel precision is fundamental, use ClutterParamSpecUnit and @@ -54,7 +54,9 @@ - Use CLUTTER_NOTE() macro for debug statements. - - New features should also include an exhaustive test unit under tests. + - New features should also include an exhaustive test unit under + tests/conform and, eventually, a user-interactive tes under + tests/interactive. RELEASES ======== @@ -91,4 +93,4 @@ - Release any dependant add-ons following similar rules to above. Dont forget to check *.pc file version deps! -$LastChangedDate: 2008-06-26 14:59:30 +0100 (Thu, 26 Jun 2008) $ +$LastChangedDate$ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/HACKING.backends /tmp/VXszleoOf1/clutter-0.9.0/HACKING.backends --- clutter-0.8.4/HACKING.backends 2008-09-29 15:16:27.000000000 +0100 +++ clutter-0.9.0/HACKING.backends 2008-12-10 22:44:39.000000000 +0000 @@ -152,4 +152,4 @@ - calling public API, like clutter_actor_paint(), or checking properties on the stage implementation instead of the ClutterStage wrapper. -$LastChangedDate: 2008-06-26 15:17:16 +0100 (Thu, 26 Jun 2008) $ +$LastChangedDate$ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/Makefile.am --- clutter-0.8.4/Makefile.am 2008-09-29 15:16:27.000000000 +0100 +++ clutter-0.9.0/Makefile.am 2009-01-29 16:07:01.000000000 +0000 @@ -21,15 +21,26 @@ clutter-$(CLUTTER_FLAVOUR)-$(CLUTTER_API_VERSION).pc: clutter.pc @cp $< $@ +.PHONY: test-report full-report +test-report full-report: + $(MAKE) -C tests/conform $(@) + pkgconfig_DATA = $(pcfiles) pkgconfigdir = $(libdir)/pkgconfig DEFAULT_FLAVOUR = @CLUTTER_FLAVOUR@ -EXTRA_DIST = clutter.pc.in HACKING HACKING.backends +EXTRA_DIST = \ + ChangeLog.SVN \ + clutter.pc.in \ + HACKING \ + HACKING.backends \ + CODING_STYLE CLEANFILES = $(pcfiles) +DISTCLEANFILES = + DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-maintainer-flags # Extra clean files so that maintainer-clean removes *everything* @@ -47,3 +58,34 @@ Makefile.in \ missing \ $(NULL) + +MAINTAINERCLEANFILES += $(srcdir)/ChangeLog + +PREV_RELEASE=$(CLUTTER_MAJOR_VERSION).$$(echo "$(CLUTTER_MINOR_VERSION)-1" | bc) + +CHANGELOGS = ChangeLog + +changelogs: + @$(MAKE) $(AM_MAKEFLAGS) $(CHANGELOGS) + +dist-hook: changelogs + changelogs="$(CHANGELOGS)"; \ + for changelog in $$changelogs; \ + do \ + cp -f $(srcdir)/$$changelog $(distdir)/ 2>/dev/null || \ + cp -f $$changelog $(distdir)/; \ + done + +$(srcdir)/ChangeLog: + @if test -d "$(top_srcdir)/.git"; \ + then \ + to=""; \ + from="$(PREV_RELEASE)"; \ + echo Creating $@ && \ + ( echo '# Generated by configure. Do no edit.'; echo; \ + $(top_srcdir)/missing --run perl $(top_srcdir)/build/gen-changelog.pl $$from.0..$$to ) > $@ ; \ + else \ + echo A git checkout is required to generate $@; \ + fi + +.PHONY: changelogs ChangeLog $(srcdir)/ChangeLog diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/Makefile.in --- clutter-0.8.4/Makefile.in 2008-11-28 18:22:49.000000000 +0000 +++ clutter-0.9.0/Makefile.in 2009-01-29 16:07:21.000000000 +0000 @@ -37,8 +37,8 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/clutter.pc.in \ $(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \ - ChangeLog INSTALL NEWS TODO config.guess config.sub depcomp \ - install-sh ltmain.sh missing mkinstalldirs + ChangeLog INSTALL NEWS TODO compile config.guess config.sub \ + depcomp install-sh ltmain.sh missing mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -131,7 +131,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -156,6 +155,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -258,26 +258,23 @@ pkgconfig_DATA = $(pcfiles) pkgconfigdir = $(libdir)/pkgconfig DEFAULT_FLAVOUR = @CLUTTER_FLAVOUR@ -EXTRA_DIST = clutter.pc.in HACKING HACKING.backends +EXTRA_DIST = \ + ChangeLog.SVN \ + clutter.pc.in \ + HACKING \ + HACKING.backends \ + CODING_STYLE + CLEANFILES = $(pcfiles) +DISTCLEANFILES = DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-maintainer-flags # Extra clean files so that maintainer-clean removes *everything* -MAINTAINERCLEANFILES = \ - aclocal.m4 \ - compile \ - config.guess \ - config.h.in \ - config.sub \ - configure \ - depcomp \ - gtk-doc.make \ - install-sh \ - ltmain.sh \ - Makefile.in \ - missing \ - $(NULL) - +MAINTAINERCLEANFILES = aclocal.m4 compile config.guess config.h.in \ + config.sub configure depcomp gtk-doc.make install-sh ltmain.sh \ + Makefile.in missing $(NULL) $(srcdir)/ChangeLog +PREV_RELEASE = $(CLUTTER_MAJOR_VERSION).$$(echo "$(CLUTTER_MINOR_VERSION)-1" | bc) +CHANGELOGS = ChangeLog all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -536,6 +533,9 @@ || exit 1; \ fi; \ done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ @@ -668,6 +668,7 @@ distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -737,19 +738,19 @@ .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ - dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \ - distclean distclean-generic distclean-hdr distclean-libtool \ - distclean-tags distcleancheck distdir distuninstallcheck dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-recursive uninstall uninstall-am \ - uninstall-pkgconfigDATA + dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-zip \ + distcheck distclean distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pkgconfigDATA install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-pkgconfigDATA # clutter-..pc - for generic dependencies @@ -759,6 +760,35 @@ # clutter--..pc - for backend-specific dependencies clutter-$(CLUTTER_FLAVOUR)-$(CLUTTER_API_VERSION).pc: clutter.pc @cp $< $@ + +.PHONY: test-report full-report +test-report full-report: + $(MAKE) -C tests/conform $(@) + +changelogs: + @$(MAKE) $(AM_MAKEFLAGS) $(CHANGELOGS) + +dist-hook: changelogs + changelogs="$(CHANGELOGS)"; \ + for changelog in $$changelogs; \ + do \ + cp -f $(srcdir)/$$changelog $(distdir)/ 2>/dev/null || \ + cp -f $$changelog $(distdir)/; \ + done + +$(srcdir)/ChangeLog: + @if test -d "$(top_srcdir)/.git"; \ + then \ + to=""; \ + from="$(PREV_RELEASE)"; \ + echo Creating $@ && \ + ( echo '# Generated by configure. Do no edit.'; echo; \ + $(top_srcdir)/missing --run perl $(top_srcdir)/build/gen-changelog.pl $$from.0..$$to ) > $@ ; \ + else \ + echo A git checkout is required to generate $@; \ + fi + +.PHONY: changelogs ChangeLog $(srcdir)/ChangeLog # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/NEWS /tmp/VXszleoOf1/clutter-0.9.0/NEWS --- clutter-0.8.4/NEWS 2008-11-28 18:22:17.000000000 +0000 +++ clutter-0.9.0/NEWS 2009-01-28 16:45:24.000000000 +0000 @@ -1,38 +1,138 @@ -Clutter 0.8.4 (29/11/2008) +Clutter 0.9.0 (xx/01/2009) =============================================================================== - * List of changes between 0.8.2 and 0.8.4 + * List of changes between 0.8.6 and 0.9.0 - o Documentation improvements - o Add clutter_actor_get_paint_visibility(), for checking the visibility - of an actor taking into account the visibility of its parents - o Texture-from-pixmap actor improvements - o Add support for ClutterColor-based properties - o Remove a stray dependency on gdk-pixbuf-xlib-2.0 - o ClutterGroup will queue a repaint when raising/lowering children - - * List of bugs fixed since 0.8.2 - - o #1043 - COGL calls glTexSubImage2D() with out-of-bounds values (SIGSEGV) - o #1057 - cogl_texture_rectangle doesn't support backward coordinates - o #1074 - FBOs on GLES - o #1195 - ClutterBehaviourBspline only works for very short paths - o #1196 - Texture border drawing problems - o #1197 - Missing const for clutter_init_with_args * - o #1200 - Crash with invalid DISPLAY - o #1201 - test-depth.c:14: error: ‘raise’ redeclared as different - kind of symbol - o #1206 - Picking disabled dithering - o #1207 - Timelines sometime miss markers - o #1230 - Pick fails on low precision color buffers - o #1237 - clutter_texture_set_filter_quality calls - clutter_texture_[un]realize - o #1238 - [PATCH] Pack bitfields in ClutterTexturePrivate - o #1265 - ClutterScore doesn't emit 'started' signal. - o #1280 - clutter_score_append_at_marker lead to segfault - o #1291 - file name not given when invalid external json structure loaded - o #1299 - clutter_score_remove will segfault if timelines are - more than 52 and continue to remove them + o ClutterText is a new actor allowing text display, text editing + both in multi-line and single-line modes, and text selection using + the pointer devices and the keyboard. ClutterText supercedes both + ClutterLabel and ClutterEntry. + o ClutterClone is a new actor that allows cloning of other actors, + both simple and composite. ClutterClone supercedes ClutterCloneTexture. + o ClutterBindingPool is a new API that allows to easily add key bindings + to an actor. + o ClutterAnimation is a new API for implicit animations, similar to + the tweening API used in toolkits like jQuery, Tween and Flash. This + new API supercedes the ClutterEffect API. + o ClutterAlpha uses "animation modes" instead of raw function + pointers; it is still possible to pass alpha functions. The alpha + functions provided by Clutter have been removed from the public + API. It is possible to register global alpha functions and use + them though a logical id. + o The interval of the ClutterAlpha:alpha property has been changed + to a floating point value in the [ -1.0, 2.0 ] range; this allowed + the addition of "overshooting" easing modes. + o COGL now supports backface culling. + o The COGL-based Pango renderer is public API and it is accessible + to developers. It is also possible to access the PangoContext used + by Clutter in order to create PangoLayouts to render text. + o The ClutterFixed API has been moved to COGL. + o COGL does not depend on Clutter data types anymore. + o The ClutterMedia interface has been overhauled: implementations + now must only override the interface properties. The ranges of + some properties have been changed to normalized values. + o COGL now exposes only floating point entry points, and reserves + the eventual conversion to fixed point only when needed. The + fixed point type and macros are publicly available for developers + concerned about floating point operations. + o COGL has a new Vertex Attribues API that allows submitting an + extensible number of vertex attributes to OpenGL in a way that + does not require format conversions and allows fast re-use. + o COGL has a new Material API that decouples paths from fills; it + is possible to create an arbitrary path and fill it with a COGL + texture. The Material API also allows setting multiple texture + layers and defining the blend modes and colors. + o ClutterTexture has the ability to use a worker thread to asynchronously + load an image from a file, as long as the GLib threading support has + been enabled prior to calling clutter_init(). + o Clutter now supports localization of the help output, and it + also supports globally setting the text direction for non left to + right locales. + o ClutterCairoTexture is a new actor that allows using Cairo + to draw on a ClutterTexture; since Cairo does not have an OpenGL + backend, the drawing is not hardware accelerated. + o Clutter has a unit testing suite, based on the GLib unit test + framework, which can be used to track regressions. + o A ClutterPath object has been added, and it is used by the + BehaviourPath. The Path object allows defining paths using a set + of coordinates and operations. A Path can be "painted" either using + COGL primitives or using Cairo primitives, allowing an easier way + to paint non-rectangular shaped actors. + o ClutterInterval is a simple object, used by ClutterAnimation, that + describes an interval between two values, and interpolates between + the initial and final values of the interval. + + * List of bugs fixed since 0.8.6 + + o #835 - Optimize clutter_actor_real_pick() + o #851 - setting anchor point causes picking problem + o #883 - Outstanding COGL merge issues + o #1003 - Add clutter_actor_take_key_focus + o #1014 - Clutter Animation API Improvements. + o #1049 - Clutter doesn't support most GLSL uniforms + o #1051 - WebKit/Clutter product/component? + o #1058 - Build clutter-box2d with Clutter 0.8 + o #1066 - Clipping regression in 0.8 + o #1086 - virtualize stage_queue_redraw + o #1105 - low level access to PangoClutter + o #1106 - ClutterText instead of ClutterLabel and ClutterEntry + o #1108 - Enter/Leave events logics wrt. skipped motion events + o #1109 - clutter-0.8.0 fails to compile + o #1123 - Crash when FBO actor is used and the stage is MINIMIZED + o #1144 - Provide an option to load images asynchronously in ClutterTexture + o #1162 - Add unit testing for Clutter + o #1164 - Mesh API + o #1172 - Disjoint paths and clip to path + o #1189 - Backface culling + o #1209 - Move fixed point API in COGL + o #1210 - Add CoglColor API + o #1211 - Drop ClutterFeatureFlags usage from COGL + o #1212 - Allow only a single include file for Clutter + o #1215 - Move the Pango renderer to the public API + o #1219 - Clean up cogl.h + o #1231 - Build fails in gles flavour in revision 3442 + o #1233 - CLUTTER_ALPHA_SINE_INC is broken in trunk + o #1251 - Merge the Cairo texture actor in core + o #1252 - Merge ClutterBehaviourPath and ClutterBehaviourBspline + o #1261 - [patch] Minimize differences between gl/cogl-texture.c and + gles/cogl-texture.c + o #1269 - mingw32 building failed at clutter-media.c + o #1270 - Update to mingw-cross-compile.sh + o #1271 - mingw compiling failed: undefined reference to + `_glDrawRangeElements@24' + o #1284 - Return something reasonable from clutter_x11_handle_event() + o #1300 - clutter_score_remove and clutter_score_remove_all are different + in object remove + o #1310 - font rendering problem + o #1313 - Fix computation of camera distance + o #1314 - clutter_sinx() is more inaccurate than it needs to be + o #1321 - Get Matrix in float + o #1323 - ClutterBehaviorDepth conflicts with other behaviors + o #1325 - ClutterPath to cairo_path_t conversion functions + o #1330 - We should not queue redraw for non-visible actors + o #1334 - Default value for ClutterLabel::text should be "" instead of NULL + o #1344 - clutter_actor_transform_stage_point gives invalid coordinates + for big actors + o #1352 - Weird cogl-pango.h includes in clutter-[entry|label].c + o #1354 - Floating point exception when set fps>1000 and start timeline + o #1361 - Unused ClutterStage::get_resolution() methods + o #1365 - ClutterEntry doesn't get the cursor when it should + o #1366 - disable-npots fails to build on mac + o #1380 - Return booleans from CLUTTER_ACTOR_IS_* macros + o #1386 - Wrong clipping dimensions for larger actors + o #1387 - Clarify new-frame signal emission with advance() + o #1388 - Clarify signal emission for advance_to_marker() + o #1395 - behaviour_apply and behaviour_get_nth_actor are opposite on + actors sequence + o #1397 - clutter command line is not localized. + o #1402 - Change default tile-waste from 64 to 63 + o #1403 - ClutterMedia::get_uri() should return allocated string + o #1404 - ClutterMedia issues + o #1405 - Fix properties that have X11 types to be 'long' + o #1409 - Use G_SIGNAL_RUN_LAST with ::queue-redraw signal + o #1410 - [patch] Implements a generic ClutterActorClone class without fbos + o #1414 - avoid relayout of ClutterTexture if not syncing size + o #1415 - short-circuit setting same clip again Clutter 0.8.2 (25/09/2008) =============================================================================== diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/po/clutter-0.9.pot /tmp/VXszleoOf1/clutter-0.9.0/po/clutter-0.9.pot --- clutter-0.8.4/po/clutter-0.9.pot 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/po/clutter-0.9.pot 2009-01-29 15:51:47.000000000 +0000 @@ -0,0 +1,75 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-01-29 15:51+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Translate to default:RTL if you want your widgets +#. * to be RTL, otherwise translate to default:LTR. +#. * +#. * Do *not* translate it to "predefinito:LTR": if it +#. * it isn't default:LTR or default:RTL it will not work +#. +#: clutter/clutter-main.c:428 +msgid "default:LTR" +msgstr "" + +#: clutter/clutter-main.c:1240 +msgid "Show frames per second" +msgstr "" + +#: clutter/clutter-main.c:1242 +msgid "Default frame rate" +msgstr "" + +#: clutter/clutter-main.c:1244 +msgid "Make all warnings fatal" +msgstr "" + +#: clutter/clutter-main.c:1247 +msgid "Direction for the text" +msgstr "" + +#: clutter/clutter-main.c:1250 +msgid "Clutter debugging flags to set" +msgstr "" + +#: clutter/clutter-main.c:1252 +msgid "Clutter debugging flags to unset" +msgstr "" + +#: clutter/clutter-main.c:1395 +msgid "Clutter Options" +msgstr "" + +#: clutter/clutter-main.c:1396 +msgid "Show Clutter Options" +msgstr "" + +#: clutter/glx/clutter-backend-glx.c:155 +msgid "VBlank method to be used (none, dri or glx)" +msgstr "" + +#: clutter/x11/clutter-backend-x11.c:240 +msgid "X display to use" +msgstr "" + +#: clutter/x11/clutter-backend-x11.c:246 +msgid "X screen to use" +msgstr "" + +#: clutter/x11/clutter-backend-x11.c:251 +msgid "Make X calls synchronous" +msgstr "" diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/po/POTFILES.in /tmp/VXszleoOf1/clutter-0.9.0/po/POTFILES.in --- clutter-0.8.4/po/POTFILES.in 2008-09-29 15:16:27.000000000 +0100 +++ clutter-0.9.0/po/POTFILES.in 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,14 @@ +clutter/clutter-actor.c +clutter/clutter-behaviour.c +clutter/clutter-color.c +clutter/clutter-container.c +clutter/clutter-event.c +clutter/clutter-fixed.c +clutter/clutter-fixed.h +clutter/clutter-main.c +clutter/clutter-stage-window.c +clutter/clutter-stage.c +clutter/clutter-texture.c +clutter/clutter-units.c +clutter/glx/clutter-backend-glx.c +clutter/x11/clutter-backend-x11.c diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/README /tmp/VXszleoOf1/clutter-0.9.0/README --- clutter-0.8.4/README 2008-11-28 18:16:52.000000000 +0000 +++ clutter-0.9.0/README 2009-01-30 12:30:57.000000000 +0000 @@ -1,7 +1,7 @@ -Clutter 0.8 README. -=================== +Clutter 1.0 README +================== -Clutter it an open source software library for creating fast, visually +Clutter is an open source software library for creating fast, visually rich and animated graphical user interfaces. Clutter currently requires: @@ -167,6 +167,116 @@ Relevant information for developers with existing Clutter applications wanting to port to newer releases (See NEWS for general new feature info). +Release Notes for Clutter 1.0 +------------------------------- + +* The clutter_actor_set_shader_param() function now takes a + GValue, which can be set using the clutter_value_set_shader() + family of functions. The floating point wrapper has been + rename clutter_actor_set_shader_param_float() to match the newly + added clutter_actor_set_shader_param_int(). + +* The Pango renderer API has been exposed as public API, after + a full rename from PangoClutter to CoglPango, to avoid namespace + collisions with upstream Pango. The Pango font map, renderer and + glyph cache can be used by third party code and depend only on + COGL. + +* Both Clutter and COGL only allow including + and directly, respectively. This allows avoiding + breaking API every time a type definition is moved across + headers, and improves the reliability of third party code against + internal refactorings. + +* COGL has an internal Color type, used to store a color definition + that can be efficiently used with the least amount of conversions + by both the GL and GLES implementations. The COGL API has been + changed to drop the usage of ClutterColor in favour of CoglColor. + +* The fixed point API implementation Clutter uses internally has been + moved from the Clutter namespace to the COGL one. The ClutterFixed + type and relative API is just a wrapper around CoglFixed and its + API. The change removed the private (yet publicly exported) and + the already deprecated ClutterFixed API. + +* ClutterLabel and ClutterEntry have been removed from the API, as + both have been superceded by the ClutterText actor. + +* ClutterCloneTexture has been removed from the API; in its place, + there is a generic ClutterClone actor which allows to "clone" + any existing actors -- even composite ones -- without using + frame buffer objects (FBOs). + +* The ClutterEffectTemplate and clutter_effect_* functions have been + superceded by ClutterAnimation and thus removed from the public API. + +* The ClutterBehaviourBspline has been superceded by the usage of + ClutterPath inside ClutterBehaviourPath, and thus removed from the + public API. + + Cogl API changes for Clutter 1.0 + -------------------------------- + +* All drawing functions now use a source material to determine how geometry is + filled. The source material is set via cogl_set_source. Or the convenience + functions cogl_set_source_color and cogl_set_source_texture. + + "drawing functions" include: cogl_rectangle, cogl_texture_rectangle, + cogl_texture_multiple_rectangles, cogl_texture_polygon (though the + cogl_texture_* funcs have been renamed; see below for details), + cogl_path_fill/stroke and cogl_vertex_buffer_draw*. + + cogl_texture_rectangle, cogl_texture_multiple_rectangles and + cogl_texture_polygon no longer take a texture handle; instead the current + source material is referenced. The functions have also been renamed to: + cogl_rectangle_with_texture_coords, cogl_rectangles_with_texture_coords + and cogl_polygon respectively. + + Most code that previously did: + cogl_texture_rectangle (tex_handle, x, y,...); + needs to be changed to now do: + cogl_set_source_texture (tex_handle); + cogl_rectangle_with_texture_coords (x, y,....); + + In the less likely case where you were blending your source texture with a + color like: + cogl_set_source_color4ub (r,g,b,a); /* (where r,g,b,a isn't just white) */ + cogl_texture_rectangle (tex_handle, x, y,...); + you will need your own material to do that: + material = cogl_material_new (); + cogl_material_set_color4ub (r,g,b,a); + cogl_material_set_layer (material, 0, tex_handle)); + cogl_set_source_material (material); + + Code that uses the texture coordinates, 0, 0, 1, 1 don't need to use + cogl_rectangle_with_texure_coords since these are the coordinates that + cogl_rectangle will use. + + For cogl_texture_polygon; as well as dropping the texture handle, the + n_vertices and vertices arguments were transposed for consistency. So + code previously written as: + cogl_texture_polygon (tex_handle, 3, verts, TRUE); + need to be written as: + cogl_set_source_texture (tex_handle); + cogl_polygon (verts, 3, TRUE); + +* The arguments to cogl_rectangle have been changed - for consistency - from + x1, y2, width, height, to x1, y1, x2, y2. + +* A CoglMatrix type and utility API has been added; this is currently used to + support describing texture matrices. + +* cogl_alpha_func has been removed, since this is now controlled using the + material API via cogl_material_set_alpha_test_function () + +* A Cogl Vertex Buffer API has been added that allows you to efficiently + manage arrays of vertex attributes in buffers that may be stored on + the GPU. These allow you to avoid the costs of repeatedy validating + vertex data and mapping it into the GPU. + +* cogl_scale now supports scaling on the z axis + + Release Notes for Clutter 0.8 ------------------------------- @@ -331,13 +441,6 @@ * ClutterContainer can have per child custom properties via ClutterChildMeta. -* ClutterBehaviourEllipse will not change the depth of an actor when - it is applied to it, unless the behaviour has a tilt angle on the X - or the Y different than zero. - -* A stray dependency on gdk-pixbuf-xlib-2.0 has been removed. Clutter has - not been using the Xlib-specific API of GdkPixbuf since 0.8. - Release Notes for Clutter 0.6 ------------------------------- @@ -520,4 +623,4 @@ ClutterContainer::actor-added and ClutterContainer::actor-removed should be used instead. -$LastChangedDate: 2008-09-25 15:25:52 +0100 (Thu, 25 Sep 2008) $ +$LastChangedDate$ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/ADDING_NEW_TESTS /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/ADDING_NEW_TESTS --- clutter-0.8.4/tests/conform/ADDING_NEW_TESTS 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/ADDING_NEW_TESTS 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,31 @@ + +How: +---- + +You should including the following at the top of your new unit test: +#include "test-conform-common.h" + +Instead of a main () function add an entry point with a prototype as follows: + +void +test_blah (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + +} + +Add a TEST_CONFORM_SIMPLE() entry in test-conform-main.c + + +Notes: +------ + +NB: A test fails if it exits. (regardless of the exit status) + +Don't call clutter_init since that is handled in test-conform-common.c + +Make sure you clean up *everything* you create. Noteable things you might miss +include timelines, behaviours, and all actors you add to the stage. This is important because otherwise you can cause cascading failures in other tests. + +Be aware that to help avoid tests causing cascading side effects for other tests all children of the default stage are destroyed between tests. + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/Makefile.am --- clutter-0.8.4/tests/conform/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/Makefile.am 2009-01-28 16:47:03.000000000 +0000 @@ -0,0 +1,127 @@ +NULL = + +noinst_PROGRAMS = test-conformance + +test_conformance_SOURCES = \ + test-conform-main.c \ + test-conform-common.c \ + test-conform-common.h \ + \ + test-timeline-dup-frames.c \ + test-timeline-interpolate.c \ + test-timeline-rewind.c \ + test-timeline-smoothness.c \ + test-timeline.c \ + test-vertex-buffer-contiguous.c \ + test-vertex-buffer-interleved.c \ + test-vertex-buffer-mutability.c \ + test-path.c \ + test-pick.c \ + test-clutter-rectangle.c \ + test-clutter-fixed.c \ + test-actor-invariants.c \ + test-paint-opacity.c \ + test-backface-culling.c \ + test-binding-pool.c \ + test-clutter-text.c \ + test-text-cache.c \ + test-anchors.c \ + $(NULL) + +# For convenience, this provides a way to easily run individual unit tests: +.PHONY: wrappers clean-wrappers + +UNIT_TESTS = `./test-conformance -l -m thorough | $(GREP) '^/'` + +wrappers: test-conformance$(EXEEXT) + @for i in $(UNIT_TESTS); \ + do \ + unit=`basename $$i | sed -e s/_/-/g`; \ + echo "GEN $$unit"; \ + ( echo "#!/bin/sh" ; echo "$(top_srcdir)/tests/conform/test-launcher.sh '$$i'" ) > $$unit$(EXEEXT) ; \ + chmod +x $$unit$(EXEEXT); \ + done + +clean-wrappers: + @for i in $(UNIT_TESTS); \ + do \ + unit=`basename $$i | sed -e s/_/-/g`; \ + echo "RM $$unit"; \ + rm -f $$unit$(EXEEXT) ; \ + done + +# NB: BUILT_SOURCES here a misnomer. We aren't building source, just inserting +# a phony rule that will generate symlink scripts for running individual tests +BUILT_SOURCES = wrappers + +test_conformance_CFLAGS = \ + -I$(top_srcdir)/ \ + -I$(top_srcdir)/clutter \ + -I$(top_builddir)/clutter \ + $(CLUTTER_CFLAGS) \ + $(MAINTAINER_CFLAGS) + +test_conformance_LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la + +.PHONY: test +.PHONY: test-report test-report-normal test-report-disable-npots +.PHONY: full-report full-report-normal full-report-disable-npots +.PHONY: full-report-generate + +test: + @gtester -o=test-conformance-results.xml ./test-conformance + +test-report-normal: + @gtester -o=test-conformance-results.xml -k ./test-conformance \ + && ( gtester-report test-conformance-results.xml \ + | sed 's/>GTester Unit Test ReportGTester Unit Test Report (normal) test-conformance-results.html ) \ + && gnome-open ./test-conformance-results.html + +test-report-disable-npots: + @../tools/disable-npots.sh \ + gtester -o=test-conformance-results-dn.xml -k ./test-conformance \ + && ( gtester-report test-conformance-results-dn.xml \ + | sed 's/>GTester Unit Test ReportGTester Unit Test Report (no NPOTs) test-conformance-results-dn.html ) \ + && gnome-open ./test-conformance-results-dn.html + +test-report: test-report-normal + +full-report-normal: + @gtester -o=test-conformance-results.xml -k -m=slow ./test-conformance \ + && ( gtester-report test-conformance-results.xml \ + | sed 's/>GTester Unit Test ReportGTester Unit Test Report (normal) test-conformance-results.html ) + +full-report-disable-npots: + @../tools/disable-npots.sh \ + gtester -o=test-conformance-results-dn.xml -k -m=slow ./test-conformance \ + && ( gtester-report test-conformance-results-dn.xml \ + | sed 's/>GTester Unit Test ReportGTester Unit Test Report (no NPOTs) test-conformance-results-dn.html ) + +XML_REPORTS = test-conformance-results.xml +HTML_REPORTS = test-conformance-results.html + +if HAVE_LIBDL +XML_REPORTS += test-conformance-results-dn.xml +HTML_REPORTS += test-conformance-results-dn.html +full-report-generate: full-report-normal full-report-disable-npots + +else +full-report-generate: full-report-normal + +endif + +full-report: full-report-generate + @for x in $(HTML_REPORTS); do \ + gnome-open "$$x"; \ + done + +EXTRA_DIST = ADDING_NEW_TESTS test-launcher.sh + +# we override the clean-generic target to clean up the wrappers so +# we cannot use CLEANFILES +clean-generic: clean-wrappers + rm -f $(XML_REPORTS) $(HTML_REPORTS) diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/Makefile.in --- clutter-0.8.4/tests/conform/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/Makefile.in 2009-01-28 16:48:58.000000000 +0000 @@ -0,0 +1,945 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = test-conformance$(EXEEXT) +@HAVE_LIBDL_TRUE@am__append_1 = test-conformance-results-dn.xml +@HAVE_LIBDL_TRUE@am__append_2 = test-conformance-results-dn.html +subdir = tests/conform +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am__objects_1 = +am_test_conformance_OBJECTS = \ + test_conformance-test-conform-main.$(OBJEXT) \ + test_conformance-test-conform-common.$(OBJEXT) \ + test_conformance-test-timeline-dup-frames.$(OBJEXT) \ + test_conformance-test-timeline-interpolate.$(OBJEXT) \ + test_conformance-test-timeline-rewind.$(OBJEXT) \ + test_conformance-test-timeline-smoothness.$(OBJEXT) \ + test_conformance-test-timeline.$(OBJEXT) \ + test_conformance-test-vertex-buffer-contiguous.$(OBJEXT) \ + test_conformance-test-vertex-buffer-interleved.$(OBJEXT) \ + test_conformance-test-vertex-buffer-mutability.$(OBJEXT) \ + test_conformance-test-path.$(OBJEXT) \ + test_conformance-test-pick.$(OBJEXT) \ + test_conformance-test-clutter-rectangle.$(OBJEXT) \ + test_conformance-test-clutter-fixed.$(OBJEXT) \ + test_conformance-test-actor-invariants.$(OBJEXT) \ + test_conformance-test-paint-opacity.$(OBJEXT) \ + test_conformance-test-backface-culling.$(OBJEXT) \ + test_conformance-test-binding-pool.$(OBJEXT) \ + test_conformance-test-clutter-text.$(OBJEXT) \ + test_conformance-test-text-cache.$(OBJEXT) \ + test_conformance-test-anchors.$(OBJEXT) $(am__objects_1) +test_conformance_OBJECTS = $(am_test_conformance_OBJECTS) +test_conformance_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la +test_conformance_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_conformance_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(test_conformance_SOURCES) +DIST_SOURCES = $(test_conformance_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CLUTTER_API_VERSION = @CLUTTER_API_VERSION@ +CLUTTER_CFLAGS = @CLUTTER_CFLAGS@ +CLUTTER_COGL = @CLUTTER_COGL@ +CLUTTER_DEBUG_CFLAGS = @CLUTTER_DEBUG_CFLAGS@ +CLUTTER_DEPS_CFLAGS = @CLUTTER_DEPS_CFLAGS@ +CLUTTER_DEPS_LIBS = @CLUTTER_DEPS_LIBS@ +CLUTTER_FLAVOUR = @CLUTTER_FLAVOUR@ +CLUTTER_GL_HEADER = @CLUTTER_GL_HEADER@ +CLUTTER_LIBS = @CLUTTER_LIBS@ +CLUTTER_LT_LDFLAGS = @CLUTTER_LT_LDFLAGS@ +CLUTTER_LT_VERSION = @CLUTTER_LT_VERSION@ +CLUTTER_MAJORMINOR = @CLUTTER_MAJORMINOR@ +CLUTTER_MAJOR_VERSION = @CLUTTER_MAJOR_VERSION@ +CLUTTER_MICRO_VERSION = @CLUTTER_MICRO_VERSION@ +CLUTTER_MINOR_VERSION = @CLUTTER_MINOR_VERSION@ +CLUTTER_REQUIRES = @CLUTTER_REQUIRES@ +CLUTTER_STAGE_TYPE = @CLUTTER_STAGE_TYPE@ +CLUTTER_VERSION = @CLUTTER_VERSION@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GCC_FLAGS = @GCC_FLAGS@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_PREFIX = @GLIB_PREFIX@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +JSON_PREFIX = @JSON_PREFIX@ +JW = @JW@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGO_PREFIX = @PANGO_PREFIX@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +RANLIB = @RANLIB@ +SDL_CONFIG = @SDL_CONFIG@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TSLIB_CFLAGS = @TSLIB_CFLAGS@ +TSLIB_LIBS = @TSLIB_LIBS@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XINPUT_CFLAGS = @XINPUT_CFLAGS@ +XINPUT_LIBS = @XINPUT_LIBS@ +XMKMF = @XMKMF@ +XMLTO = @XMLTO@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +backendextra = @backendextra@ +backendextralib = @backendextralib@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +clutterbackend = @clutterbackend@ +clutterbackendlib = @clutterbackendlib@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +imagebackend = @imagebackend@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +NULL = +test_conformance_SOURCES = \ + test-conform-main.c \ + test-conform-common.c \ + test-conform-common.h \ + \ + test-timeline-dup-frames.c \ + test-timeline-interpolate.c \ + test-timeline-rewind.c \ + test-timeline-smoothness.c \ + test-timeline.c \ + test-vertex-buffer-contiguous.c \ + test-vertex-buffer-interleved.c \ + test-vertex-buffer-mutability.c \ + test-path.c \ + test-pick.c \ + test-clutter-rectangle.c \ + test-clutter-fixed.c \ + test-actor-invariants.c \ + test-paint-opacity.c \ + test-backface-culling.c \ + test-binding-pool.c \ + test-clutter-text.c \ + test-text-cache.c \ + test-anchors.c \ + $(NULL) + +UNIT_TESTS = `./test-conformance -l -m thorough | $(GREP) '^/'` + +# NB: BUILT_SOURCES here a misnomer. We aren't building source, just inserting +# a phony rule that will generate symlink scripts for running individual tests +BUILT_SOURCES = wrappers +test_conformance_CFLAGS = \ + -I$(top_srcdir)/ \ + -I$(top_srcdir)/clutter \ + -I$(top_builddir)/clutter \ + $(CLUTTER_CFLAGS) \ + $(MAINTAINER_CFLAGS) + +test_conformance_LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la +XML_REPORTS = test-conformance-results.xml $(am__append_1) +HTML_REPORTS = test-conformance-results.html $(am__append_2) +EXTRA_DIST = ADDING_NEW_TESTS test-launcher.sh +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/conform/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/conform/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +test-conformance$(EXEEXT): $(test_conformance_OBJECTS) $(test_conformance_DEPENDENCIES) + @rm -f test-conformance$(EXEEXT) + $(test_conformance_LINK) $(test_conformance_OBJECTS) $(test_conformance_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conformance-test-actor-invariants.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conformance-test-anchors.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conformance-test-backface-culling.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conformance-test-binding-pool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conformance-test-clutter-fixed.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conformance-test-clutter-rectangle.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conformance-test-clutter-text.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conformance-test-conform-common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conformance-test-conform-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conformance-test-paint-opacity.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conformance-test-path.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conformance-test-pick.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conformance-test-text-cache.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conformance-test-timeline-dup-frames.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conformance-test-timeline-interpolate.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conformance-test-timeline-rewind.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conformance-test-timeline-smoothness.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conformance-test-timeline.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conformance-test-vertex-buffer-contiguous.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conformance-test-vertex-buffer-interleved.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conformance-test-vertex-buffer-mutability.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +test_conformance-test-conform-main.o: test-conform-main.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-conform-main.o -MD -MP -MF $(DEPDIR)/test_conformance-test-conform-main.Tpo -c -o test_conformance-test-conform-main.o `test -f 'test-conform-main.c' || echo '$(srcdir)/'`test-conform-main.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-conform-main.Tpo $(DEPDIR)/test_conformance-test-conform-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-conform-main.c' object='test_conformance-test-conform-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-conform-main.o `test -f 'test-conform-main.c' || echo '$(srcdir)/'`test-conform-main.c + +test_conformance-test-conform-main.obj: test-conform-main.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-conform-main.obj -MD -MP -MF $(DEPDIR)/test_conformance-test-conform-main.Tpo -c -o test_conformance-test-conform-main.obj `if test -f 'test-conform-main.c'; then $(CYGPATH_W) 'test-conform-main.c'; else $(CYGPATH_W) '$(srcdir)/test-conform-main.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-conform-main.Tpo $(DEPDIR)/test_conformance-test-conform-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-conform-main.c' object='test_conformance-test-conform-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-conform-main.obj `if test -f 'test-conform-main.c'; then $(CYGPATH_W) 'test-conform-main.c'; else $(CYGPATH_W) '$(srcdir)/test-conform-main.c'; fi` + +test_conformance-test-conform-common.o: test-conform-common.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-conform-common.o -MD -MP -MF $(DEPDIR)/test_conformance-test-conform-common.Tpo -c -o test_conformance-test-conform-common.o `test -f 'test-conform-common.c' || echo '$(srcdir)/'`test-conform-common.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-conform-common.Tpo $(DEPDIR)/test_conformance-test-conform-common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-conform-common.c' object='test_conformance-test-conform-common.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-conform-common.o `test -f 'test-conform-common.c' || echo '$(srcdir)/'`test-conform-common.c + +test_conformance-test-conform-common.obj: test-conform-common.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-conform-common.obj -MD -MP -MF $(DEPDIR)/test_conformance-test-conform-common.Tpo -c -o test_conformance-test-conform-common.obj `if test -f 'test-conform-common.c'; then $(CYGPATH_W) 'test-conform-common.c'; else $(CYGPATH_W) '$(srcdir)/test-conform-common.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-conform-common.Tpo $(DEPDIR)/test_conformance-test-conform-common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-conform-common.c' object='test_conformance-test-conform-common.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-conform-common.obj `if test -f 'test-conform-common.c'; then $(CYGPATH_W) 'test-conform-common.c'; else $(CYGPATH_W) '$(srcdir)/test-conform-common.c'; fi` + +test_conformance-test-timeline-dup-frames.o: test-timeline-dup-frames.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-timeline-dup-frames.o -MD -MP -MF $(DEPDIR)/test_conformance-test-timeline-dup-frames.Tpo -c -o test_conformance-test-timeline-dup-frames.o `test -f 'test-timeline-dup-frames.c' || echo '$(srcdir)/'`test-timeline-dup-frames.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-timeline-dup-frames.Tpo $(DEPDIR)/test_conformance-test-timeline-dup-frames.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-timeline-dup-frames.c' object='test_conformance-test-timeline-dup-frames.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-timeline-dup-frames.o `test -f 'test-timeline-dup-frames.c' || echo '$(srcdir)/'`test-timeline-dup-frames.c + +test_conformance-test-timeline-dup-frames.obj: test-timeline-dup-frames.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-timeline-dup-frames.obj -MD -MP -MF $(DEPDIR)/test_conformance-test-timeline-dup-frames.Tpo -c -o test_conformance-test-timeline-dup-frames.obj `if test -f 'test-timeline-dup-frames.c'; then $(CYGPATH_W) 'test-timeline-dup-frames.c'; else $(CYGPATH_W) '$(srcdir)/test-timeline-dup-frames.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-timeline-dup-frames.Tpo $(DEPDIR)/test_conformance-test-timeline-dup-frames.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-timeline-dup-frames.c' object='test_conformance-test-timeline-dup-frames.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-timeline-dup-frames.obj `if test -f 'test-timeline-dup-frames.c'; then $(CYGPATH_W) 'test-timeline-dup-frames.c'; else $(CYGPATH_W) '$(srcdir)/test-timeline-dup-frames.c'; fi` + +test_conformance-test-timeline-interpolate.o: test-timeline-interpolate.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-timeline-interpolate.o -MD -MP -MF $(DEPDIR)/test_conformance-test-timeline-interpolate.Tpo -c -o test_conformance-test-timeline-interpolate.o `test -f 'test-timeline-interpolate.c' || echo '$(srcdir)/'`test-timeline-interpolate.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-timeline-interpolate.Tpo $(DEPDIR)/test_conformance-test-timeline-interpolate.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-timeline-interpolate.c' object='test_conformance-test-timeline-interpolate.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-timeline-interpolate.o `test -f 'test-timeline-interpolate.c' || echo '$(srcdir)/'`test-timeline-interpolate.c + +test_conformance-test-timeline-interpolate.obj: test-timeline-interpolate.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-timeline-interpolate.obj -MD -MP -MF $(DEPDIR)/test_conformance-test-timeline-interpolate.Tpo -c -o test_conformance-test-timeline-interpolate.obj `if test -f 'test-timeline-interpolate.c'; then $(CYGPATH_W) 'test-timeline-interpolate.c'; else $(CYGPATH_W) '$(srcdir)/test-timeline-interpolate.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-timeline-interpolate.Tpo $(DEPDIR)/test_conformance-test-timeline-interpolate.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-timeline-interpolate.c' object='test_conformance-test-timeline-interpolate.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-timeline-interpolate.obj `if test -f 'test-timeline-interpolate.c'; then $(CYGPATH_W) 'test-timeline-interpolate.c'; else $(CYGPATH_W) '$(srcdir)/test-timeline-interpolate.c'; fi` + +test_conformance-test-timeline-rewind.o: test-timeline-rewind.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-timeline-rewind.o -MD -MP -MF $(DEPDIR)/test_conformance-test-timeline-rewind.Tpo -c -o test_conformance-test-timeline-rewind.o `test -f 'test-timeline-rewind.c' || echo '$(srcdir)/'`test-timeline-rewind.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-timeline-rewind.Tpo $(DEPDIR)/test_conformance-test-timeline-rewind.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-timeline-rewind.c' object='test_conformance-test-timeline-rewind.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-timeline-rewind.o `test -f 'test-timeline-rewind.c' || echo '$(srcdir)/'`test-timeline-rewind.c + +test_conformance-test-timeline-rewind.obj: test-timeline-rewind.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-timeline-rewind.obj -MD -MP -MF $(DEPDIR)/test_conformance-test-timeline-rewind.Tpo -c -o test_conformance-test-timeline-rewind.obj `if test -f 'test-timeline-rewind.c'; then $(CYGPATH_W) 'test-timeline-rewind.c'; else $(CYGPATH_W) '$(srcdir)/test-timeline-rewind.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-timeline-rewind.Tpo $(DEPDIR)/test_conformance-test-timeline-rewind.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-timeline-rewind.c' object='test_conformance-test-timeline-rewind.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-timeline-rewind.obj `if test -f 'test-timeline-rewind.c'; then $(CYGPATH_W) 'test-timeline-rewind.c'; else $(CYGPATH_W) '$(srcdir)/test-timeline-rewind.c'; fi` + +test_conformance-test-timeline-smoothness.o: test-timeline-smoothness.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-timeline-smoothness.o -MD -MP -MF $(DEPDIR)/test_conformance-test-timeline-smoothness.Tpo -c -o test_conformance-test-timeline-smoothness.o `test -f 'test-timeline-smoothness.c' || echo '$(srcdir)/'`test-timeline-smoothness.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-timeline-smoothness.Tpo $(DEPDIR)/test_conformance-test-timeline-smoothness.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-timeline-smoothness.c' object='test_conformance-test-timeline-smoothness.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-timeline-smoothness.o `test -f 'test-timeline-smoothness.c' || echo '$(srcdir)/'`test-timeline-smoothness.c + +test_conformance-test-timeline-smoothness.obj: test-timeline-smoothness.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-timeline-smoothness.obj -MD -MP -MF $(DEPDIR)/test_conformance-test-timeline-smoothness.Tpo -c -o test_conformance-test-timeline-smoothness.obj `if test -f 'test-timeline-smoothness.c'; then $(CYGPATH_W) 'test-timeline-smoothness.c'; else $(CYGPATH_W) '$(srcdir)/test-timeline-smoothness.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-timeline-smoothness.Tpo $(DEPDIR)/test_conformance-test-timeline-smoothness.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-timeline-smoothness.c' object='test_conformance-test-timeline-smoothness.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-timeline-smoothness.obj `if test -f 'test-timeline-smoothness.c'; then $(CYGPATH_W) 'test-timeline-smoothness.c'; else $(CYGPATH_W) '$(srcdir)/test-timeline-smoothness.c'; fi` + +test_conformance-test-timeline.o: test-timeline.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-timeline.o -MD -MP -MF $(DEPDIR)/test_conformance-test-timeline.Tpo -c -o test_conformance-test-timeline.o `test -f 'test-timeline.c' || echo '$(srcdir)/'`test-timeline.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-timeline.Tpo $(DEPDIR)/test_conformance-test-timeline.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-timeline.c' object='test_conformance-test-timeline.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-timeline.o `test -f 'test-timeline.c' || echo '$(srcdir)/'`test-timeline.c + +test_conformance-test-timeline.obj: test-timeline.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-timeline.obj -MD -MP -MF $(DEPDIR)/test_conformance-test-timeline.Tpo -c -o test_conformance-test-timeline.obj `if test -f 'test-timeline.c'; then $(CYGPATH_W) 'test-timeline.c'; else $(CYGPATH_W) '$(srcdir)/test-timeline.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-timeline.Tpo $(DEPDIR)/test_conformance-test-timeline.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-timeline.c' object='test_conformance-test-timeline.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-timeline.obj `if test -f 'test-timeline.c'; then $(CYGPATH_W) 'test-timeline.c'; else $(CYGPATH_W) '$(srcdir)/test-timeline.c'; fi` + +test_conformance-test-vertex-buffer-contiguous.o: test-vertex-buffer-contiguous.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-vertex-buffer-contiguous.o -MD -MP -MF $(DEPDIR)/test_conformance-test-vertex-buffer-contiguous.Tpo -c -o test_conformance-test-vertex-buffer-contiguous.o `test -f 'test-vertex-buffer-contiguous.c' || echo '$(srcdir)/'`test-vertex-buffer-contiguous.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-vertex-buffer-contiguous.Tpo $(DEPDIR)/test_conformance-test-vertex-buffer-contiguous.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-vertex-buffer-contiguous.c' object='test_conformance-test-vertex-buffer-contiguous.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-vertex-buffer-contiguous.o `test -f 'test-vertex-buffer-contiguous.c' || echo '$(srcdir)/'`test-vertex-buffer-contiguous.c + +test_conformance-test-vertex-buffer-contiguous.obj: test-vertex-buffer-contiguous.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-vertex-buffer-contiguous.obj -MD -MP -MF $(DEPDIR)/test_conformance-test-vertex-buffer-contiguous.Tpo -c -o test_conformance-test-vertex-buffer-contiguous.obj `if test -f 'test-vertex-buffer-contiguous.c'; then $(CYGPATH_W) 'test-vertex-buffer-contiguous.c'; else $(CYGPATH_W) '$(srcdir)/test-vertex-buffer-contiguous.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-vertex-buffer-contiguous.Tpo $(DEPDIR)/test_conformance-test-vertex-buffer-contiguous.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-vertex-buffer-contiguous.c' object='test_conformance-test-vertex-buffer-contiguous.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-vertex-buffer-contiguous.obj `if test -f 'test-vertex-buffer-contiguous.c'; then $(CYGPATH_W) 'test-vertex-buffer-contiguous.c'; else $(CYGPATH_W) '$(srcdir)/test-vertex-buffer-contiguous.c'; fi` + +test_conformance-test-vertex-buffer-interleved.o: test-vertex-buffer-interleved.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-vertex-buffer-interleved.o -MD -MP -MF $(DEPDIR)/test_conformance-test-vertex-buffer-interleved.Tpo -c -o test_conformance-test-vertex-buffer-interleved.o `test -f 'test-vertex-buffer-interleved.c' || echo '$(srcdir)/'`test-vertex-buffer-interleved.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-vertex-buffer-interleved.Tpo $(DEPDIR)/test_conformance-test-vertex-buffer-interleved.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-vertex-buffer-interleved.c' object='test_conformance-test-vertex-buffer-interleved.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-vertex-buffer-interleved.o `test -f 'test-vertex-buffer-interleved.c' || echo '$(srcdir)/'`test-vertex-buffer-interleved.c + +test_conformance-test-vertex-buffer-interleved.obj: test-vertex-buffer-interleved.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-vertex-buffer-interleved.obj -MD -MP -MF $(DEPDIR)/test_conformance-test-vertex-buffer-interleved.Tpo -c -o test_conformance-test-vertex-buffer-interleved.obj `if test -f 'test-vertex-buffer-interleved.c'; then $(CYGPATH_W) 'test-vertex-buffer-interleved.c'; else $(CYGPATH_W) '$(srcdir)/test-vertex-buffer-interleved.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-vertex-buffer-interleved.Tpo $(DEPDIR)/test_conformance-test-vertex-buffer-interleved.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-vertex-buffer-interleved.c' object='test_conformance-test-vertex-buffer-interleved.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-vertex-buffer-interleved.obj `if test -f 'test-vertex-buffer-interleved.c'; then $(CYGPATH_W) 'test-vertex-buffer-interleved.c'; else $(CYGPATH_W) '$(srcdir)/test-vertex-buffer-interleved.c'; fi` + +test_conformance-test-vertex-buffer-mutability.o: test-vertex-buffer-mutability.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-vertex-buffer-mutability.o -MD -MP -MF $(DEPDIR)/test_conformance-test-vertex-buffer-mutability.Tpo -c -o test_conformance-test-vertex-buffer-mutability.o `test -f 'test-vertex-buffer-mutability.c' || echo '$(srcdir)/'`test-vertex-buffer-mutability.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-vertex-buffer-mutability.Tpo $(DEPDIR)/test_conformance-test-vertex-buffer-mutability.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-vertex-buffer-mutability.c' object='test_conformance-test-vertex-buffer-mutability.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-vertex-buffer-mutability.o `test -f 'test-vertex-buffer-mutability.c' || echo '$(srcdir)/'`test-vertex-buffer-mutability.c + +test_conformance-test-vertex-buffer-mutability.obj: test-vertex-buffer-mutability.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-vertex-buffer-mutability.obj -MD -MP -MF $(DEPDIR)/test_conformance-test-vertex-buffer-mutability.Tpo -c -o test_conformance-test-vertex-buffer-mutability.obj `if test -f 'test-vertex-buffer-mutability.c'; then $(CYGPATH_W) 'test-vertex-buffer-mutability.c'; else $(CYGPATH_W) '$(srcdir)/test-vertex-buffer-mutability.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-vertex-buffer-mutability.Tpo $(DEPDIR)/test_conformance-test-vertex-buffer-mutability.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-vertex-buffer-mutability.c' object='test_conformance-test-vertex-buffer-mutability.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-vertex-buffer-mutability.obj `if test -f 'test-vertex-buffer-mutability.c'; then $(CYGPATH_W) 'test-vertex-buffer-mutability.c'; else $(CYGPATH_W) '$(srcdir)/test-vertex-buffer-mutability.c'; fi` + +test_conformance-test-path.o: test-path.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-path.o -MD -MP -MF $(DEPDIR)/test_conformance-test-path.Tpo -c -o test_conformance-test-path.o `test -f 'test-path.c' || echo '$(srcdir)/'`test-path.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-path.Tpo $(DEPDIR)/test_conformance-test-path.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-path.c' object='test_conformance-test-path.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-path.o `test -f 'test-path.c' || echo '$(srcdir)/'`test-path.c + +test_conformance-test-path.obj: test-path.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-path.obj -MD -MP -MF $(DEPDIR)/test_conformance-test-path.Tpo -c -o test_conformance-test-path.obj `if test -f 'test-path.c'; then $(CYGPATH_W) 'test-path.c'; else $(CYGPATH_W) '$(srcdir)/test-path.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-path.Tpo $(DEPDIR)/test_conformance-test-path.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-path.c' object='test_conformance-test-path.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-path.obj `if test -f 'test-path.c'; then $(CYGPATH_W) 'test-path.c'; else $(CYGPATH_W) '$(srcdir)/test-path.c'; fi` + +test_conformance-test-pick.o: test-pick.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-pick.o -MD -MP -MF $(DEPDIR)/test_conformance-test-pick.Tpo -c -o test_conformance-test-pick.o `test -f 'test-pick.c' || echo '$(srcdir)/'`test-pick.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-pick.Tpo $(DEPDIR)/test_conformance-test-pick.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-pick.c' object='test_conformance-test-pick.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-pick.o `test -f 'test-pick.c' || echo '$(srcdir)/'`test-pick.c + +test_conformance-test-pick.obj: test-pick.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-pick.obj -MD -MP -MF $(DEPDIR)/test_conformance-test-pick.Tpo -c -o test_conformance-test-pick.obj `if test -f 'test-pick.c'; then $(CYGPATH_W) 'test-pick.c'; else $(CYGPATH_W) '$(srcdir)/test-pick.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-pick.Tpo $(DEPDIR)/test_conformance-test-pick.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-pick.c' object='test_conformance-test-pick.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-pick.obj `if test -f 'test-pick.c'; then $(CYGPATH_W) 'test-pick.c'; else $(CYGPATH_W) '$(srcdir)/test-pick.c'; fi` + +test_conformance-test-clutter-rectangle.o: test-clutter-rectangle.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-clutter-rectangle.o -MD -MP -MF $(DEPDIR)/test_conformance-test-clutter-rectangle.Tpo -c -o test_conformance-test-clutter-rectangle.o `test -f 'test-clutter-rectangle.c' || echo '$(srcdir)/'`test-clutter-rectangle.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-clutter-rectangle.Tpo $(DEPDIR)/test_conformance-test-clutter-rectangle.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-clutter-rectangle.c' object='test_conformance-test-clutter-rectangle.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-clutter-rectangle.o `test -f 'test-clutter-rectangle.c' || echo '$(srcdir)/'`test-clutter-rectangle.c + +test_conformance-test-clutter-rectangle.obj: test-clutter-rectangle.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-clutter-rectangle.obj -MD -MP -MF $(DEPDIR)/test_conformance-test-clutter-rectangle.Tpo -c -o test_conformance-test-clutter-rectangle.obj `if test -f 'test-clutter-rectangle.c'; then $(CYGPATH_W) 'test-clutter-rectangle.c'; else $(CYGPATH_W) '$(srcdir)/test-clutter-rectangle.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-clutter-rectangle.Tpo $(DEPDIR)/test_conformance-test-clutter-rectangle.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-clutter-rectangle.c' object='test_conformance-test-clutter-rectangle.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-clutter-rectangle.obj `if test -f 'test-clutter-rectangle.c'; then $(CYGPATH_W) 'test-clutter-rectangle.c'; else $(CYGPATH_W) '$(srcdir)/test-clutter-rectangle.c'; fi` + +test_conformance-test-clutter-fixed.o: test-clutter-fixed.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-clutter-fixed.o -MD -MP -MF $(DEPDIR)/test_conformance-test-clutter-fixed.Tpo -c -o test_conformance-test-clutter-fixed.o `test -f 'test-clutter-fixed.c' || echo '$(srcdir)/'`test-clutter-fixed.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-clutter-fixed.Tpo $(DEPDIR)/test_conformance-test-clutter-fixed.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-clutter-fixed.c' object='test_conformance-test-clutter-fixed.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-clutter-fixed.o `test -f 'test-clutter-fixed.c' || echo '$(srcdir)/'`test-clutter-fixed.c + +test_conformance-test-clutter-fixed.obj: test-clutter-fixed.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-clutter-fixed.obj -MD -MP -MF $(DEPDIR)/test_conformance-test-clutter-fixed.Tpo -c -o test_conformance-test-clutter-fixed.obj `if test -f 'test-clutter-fixed.c'; then $(CYGPATH_W) 'test-clutter-fixed.c'; else $(CYGPATH_W) '$(srcdir)/test-clutter-fixed.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-clutter-fixed.Tpo $(DEPDIR)/test_conformance-test-clutter-fixed.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-clutter-fixed.c' object='test_conformance-test-clutter-fixed.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-clutter-fixed.obj `if test -f 'test-clutter-fixed.c'; then $(CYGPATH_W) 'test-clutter-fixed.c'; else $(CYGPATH_W) '$(srcdir)/test-clutter-fixed.c'; fi` + +test_conformance-test-actor-invariants.o: test-actor-invariants.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-actor-invariants.o -MD -MP -MF $(DEPDIR)/test_conformance-test-actor-invariants.Tpo -c -o test_conformance-test-actor-invariants.o `test -f 'test-actor-invariants.c' || echo '$(srcdir)/'`test-actor-invariants.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-actor-invariants.Tpo $(DEPDIR)/test_conformance-test-actor-invariants.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-actor-invariants.c' object='test_conformance-test-actor-invariants.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-actor-invariants.o `test -f 'test-actor-invariants.c' || echo '$(srcdir)/'`test-actor-invariants.c + +test_conformance-test-actor-invariants.obj: test-actor-invariants.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-actor-invariants.obj -MD -MP -MF $(DEPDIR)/test_conformance-test-actor-invariants.Tpo -c -o test_conformance-test-actor-invariants.obj `if test -f 'test-actor-invariants.c'; then $(CYGPATH_W) 'test-actor-invariants.c'; else $(CYGPATH_W) '$(srcdir)/test-actor-invariants.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-actor-invariants.Tpo $(DEPDIR)/test_conformance-test-actor-invariants.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-actor-invariants.c' object='test_conformance-test-actor-invariants.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-actor-invariants.obj `if test -f 'test-actor-invariants.c'; then $(CYGPATH_W) 'test-actor-invariants.c'; else $(CYGPATH_W) '$(srcdir)/test-actor-invariants.c'; fi` + +test_conformance-test-paint-opacity.o: test-paint-opacity.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-paint-opacity.o -MD -MP -MF $(DEPDIR)/test_conformance-test-paint-opacity.Tpo -c -o test_conformance-test-paint-opacity.o `test -f 'test-paint-opacity.c' || echo '$(srcdir)/'`test-paint-opacity.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-paint-opacity.Tpo $(DEPDIR)/test_conformance-test-paint-opacity.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-paint-opacity.c' object='test_conformance-test-paint-opacity.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-paint-opacity.o `test -f 'test-paint-opacity.c' || echo '$(srcdir)/'`test-paint-opacity.c + +test_conformance-test-paint-opacity.obj: test-paint-opacity.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-paint-opacity.obj -MD -MP -MF $(DEPDIR)/test_conformance-test-paint-opacity.Tpo -c -o test_conformance-test-paint-opacity.obj `if test -f 'test-paint-opacity.c'; then $(CYGPATH_W) 'test-paint-opacity.c'; else $(CYGPATH_W) '$(srcdir)/test-paint-opacity.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-paint-opacity.Tpo $(DEPDIR)/test_conformance-test-paint-opacity.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-paint-opacity.c' object='test_conformance-test-paint-opacity.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-paint-opacity.obj `if test -f 'test-paint-opacity.c'; then $(CYGPATH_W) 'test-paint-opacity.c'; else $(CYGPATH_W) '$(srcdir)/test-paint-opacity.c'; fi` + +test_conformance-test-backface-culling.o: test-backface-culling.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-backface-culling.o -MD -MP -MF $(DEPDIR)/test_conformance-test-backface-culling.Tpo -c -o test_conformance-test-backface-culling.o `test -f 'test-backface-culling.c' || echo '$(srcdir)/'`test-backface-culling.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-backface-culling.Tpo $(DEPDIR)/test_conformance-test-backface-culling.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-backface-culling.c' object='test_conformance-test-backface-culling.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-backface-culling.o `test -f 'test-backface-culling.c' || echo '$(srcdir)/'`test-backface-culling.c + +test_conformance-test-backface-culling.obj: test-backface-culling.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-backface-culling.obj -MD -MP -MF $(DEPDIR)/test_conformance-test-backface-culling.Tpo -c -o test_conformance-test-backface-culling.obj `if test -f 'test-backface-culling.c'; then $(CYGPATH_W) 'test-backface-culling.c'; else $(CYGPATH_W) '$(srcdir)/test-backface-culling.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-backface-culling.Tpo $(DEPDIR)/test_conformance-test-backface-culling.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-backface-culling.c' object='test_conformance-test-backface-culling.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-backface-culling.obj `if test -f 'test-backface-culling.c'; then $(CYGPATH_W) 'test-backface-culling.c'; else $(CYGPATH_W) '$(srcdir)/test-backface-culling.c'; fi` + +test_conformance-test-binding-pool.o: test-binding-pool.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-binding-pool.o -MD -MP -MF $(DEPDIR)/test_conformance-test-binding-pool.Tpo -c -o test_conformance-test-binding-pool.o `test -f 'test-binding-pool.c' || echo '$(srcdir)/'`test-binding-pool.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-binding-pool.Tpo $(DEPDIR)/test_conformance-test-binding-pool.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-binding-pool.c' object='test_conformance-test-binding-pool.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-binding-pool.o `test -f 'test-binding-pool.c' || echo '$(srcdir)/'`test-binding-pool.c + +test_conformance-test-binding-pool.obj: test-binding-pool.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-binding-pool.obj -MD -MP -MF $(DEPDIR)/test_conformance-test-binding-pool.Tpo -c -o test_conformance-test-binding-pool.obj `if test -f 'test-binding-pool.c'; then $(CYGPATH_W) 'test-binding-pool.c'; else $(CYGPATH_W) '$(srcdir)/test-binding-pool.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-binding-pool.Tpo $(DEPDIR)/test_conformance-test-binding-pool.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-binding-pool.c' object='test_conformance-test-binding-pool.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-binding-pool.obj `if test -f 'test-binding-pool.c'; then $(CYGPATH_W) 'test-binding-pool.c'; else $(CYGPATH_W) '$(srcdir)/test-binding-pool.c'; fi` + +test_conformance-test-clutter-text.o: test-clutter-text.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-clutter-text.o -MD -MP -MF $(DEPDIR)/test_conformance-test-clutter-text.Tpo -c -o test_conformance-test-clutter-text.o `test -f 'test-clutter-text.c' || echo '$(srcdir)/'`test-clutter-text.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-clutter-text.Tpo $(DEPDIR)/test_conformance-test-clutter-text.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-clutter-text.c' object='test_conformance-test-clutter-text.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-clutter-text.o `test -f 'test-clutter-text.c' || echo '$(srcdir)/'`test-clutter-text.c + +test_conformance-test-clutter-text.obj: test-clutter-text.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-clutter-text.obj -MD -MP -MF $(DEPDIR)/test_conformance-test-clutter-text.Tpo -c -o test_conformance-test-clutter-text.obj `if test -f 'test-clutter-text.c'; then $(CYGPATH_W) 'test-clutter-text.c'; else $(CYGPATH_W) '$(srcdir)/test-clutter-text.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-clutter-text.Tpo $(DEPDIR)/test_conformance-test-clutter-text.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-clutter-text.c' object='test_conformance-test-clutter-text.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-clutter-text.obj `if test -f 'test-clutter-text.c'; then $(CYGPATH_W) 'test-clutter-text.c'; else $(CYGPATH_W) '$(srcdir)/test-clutter-text.c'; fi` + +test_conformance-test-text-cache.o: test-text-cache.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-text-cache.o -MD -MP -MF $(DEPDIR)/test_conformance-test-text-cache.Tpo -c -o test_conformance-test-text-cache.o `test -f 'test-text-cache.c' || echo '$(srcdir)/'`test-text-cache.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-text-cache.Tpo $(DEPDIR)/test_conformance-test-text-cache.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-text-cache.c' object='test_conformance-test-text-cache.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-text-cache.o `test -f 'test-text-cache.c' || echo '$(srcdir)/'`test-text-cache.c + +test_conformance-test-text-cache.obj: test-text-cache.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-text-cache.obj -MD -MP -MF $(DEPDIR)/test_conformance-test-text-cache.Tpo -c -o test_conformance-test-text-cache.obj `if test -f 'test-text-cache.c'; then $(CYGPATH_W) 'test-text-cache.c'; else $(CYGPATH_W) '$(srcdir)/test-text-cache.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-text-cache.Tpo $(DEPDIR)/test_conformance-test-text-cache.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-text-cache.c' object='test_conformance-test-text-cache.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-text-cache.obj `if test -f 'test-text-cache.c'; then $(CYGPATH_W) 'test-text-cache.c'; else $(CYGPATH_W) '$(srcdir)/test-text-cache.c'; fi` + +test_conformance-test-anchors.o: test-anchors.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-anchors.o -MD -MP -MF $(DEPDIR)/test_conformance-test-anchors.Tpo -c -o test_conformance-test-anchors.o `test -f 'test-anchors.c' || echo '$(srcdir)/'`test-anchors.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-anchors.Tpo $(DEPDIR)/test_conformance-test-anchors.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-anchors.c' object='test_conformance-test-anchors.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-anchors.o `test -f 'test-anchors.c' || echo '$(srcdir)/'`test-anchors.c + +test_conformance-test-anchors.obj: test-anchors.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -MT test_conformance-test-anchors.obj -MD -MP -MF $(DEPDIR)/test_conformance-test-anchors.Tpo -c -o test_conformance-test-anchors.obj `if test -f 'test-anchors.c'; then $(CYGPATH_W) 'test-anchors.c'; else $(CYGPATH_W) '$(srcdir)/test-anchors.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_conformance-test-anchors.Tpo $(DEPDIR)/test_conformance-test-anchors.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-anchors.c' object='test_conformance-test-anchors.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conformance_CFLAGS) $(CFLAGS) -c -o test_conformance-test-anchors.obj `if test -f 'test-anchors.c'; then $(CYGPATH_W) 'test-anchors.c'; else $(CYGPATH_W) '$(srcdir)/test-anchors.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + + +# For convenience, this provides a way to easily run individual unit tests: +.PHONY: wrappers clean-wrappers + +wrappers: test-conformance$(EXEEXT) + @for i in $(UNIT_TESTS); \ + do \ + unit=`basename $$i | sed -e s/_/-/g`; \ + echo "GEN $$unit"; \ + ( echo "#!/bin/sh" ; echo "$(top_srcdir)/tests/conform/test-launcher.sh '$$i'" ) > $$unit$(EXEEXT) ; \ + chmod +x $$unit$(EXEEXT); \ + done + +clean-wrappers: + @for i in $(UNIT_TESTS); \ + do \ + unit=`basename $$i | sed -e s/_/-/g`; \ + echo "RM $$unit"; \ + rm -f $$unit$(EXEEXT) ; \ + done + +.PHONY: test +.PHONY: test-report test-report-normal test-report-disable-npots +.PHONY: full-report full-report-normal full-report-disable-npots +.PHONY: full-report-generate + +test: + @gtester -o=test-conformance-results.xml ./test-conformance + +test-report-normal: + @gtester -o=test-conformance-results.xml -k ./test-conformance \ + && ( gtester-report test-conformance-results.xml \ + | sed 's/>GTester Unit Test ReportGTester Unit Test Report (normal) test-conformance-results.html ) \ + && gnome-open ./test-conformance-results.html + +test-report-disable-npots: + @../tools/disable-npots.sh \ + gtester -o=test-conformance-results-dn.xml -k ./test-conformance \ + && ( gtester-report test-conformance-results-dn.xml \ + | sed 's/>GTester Unit Test ReportGTester Unit Test Report (no NPOTs) test-conformance-results-dn.html ) \ + && gnome-open ./test-conformance-results-dn.html + +test-report: test-report-normal + +full-report-normal: + @gtester -o=test-conformance-results.xml -k -m=slow ./test-conformance \ + && ( gtester-report test-conformance-results.xml \ + | sed 's/>GTester Unit Test ReportGTester Unit Test Report (normal) test-conformance-results.html ) + +full-report-disable-npots: + @../tools/disable-npots.sh \ + gtester -o=test-conformance-results-dn.xml -k -m=slow ./test-conformance \ + && ( gtester-report test-conformance-results-dn.xml \ + | sed 's/>GTester Unit Test ReportGTester Unit Test Report (no NPOTs) test-conformance-results-dn.html ) +@HAVE_LIBDL_TRUE@full-report-generate: full-report-normal full-report-disable-npots + +@HAVE_LIBDL_FALSE@full-report-generate: full-report-normal + +full-report: full-report-generate + @for x in $(HTML_REPORTS); do \ + gnome-open "$$x"; \ + done + +# we override the clean-generic target to clean up the wrappers so +# we cannot use CLEANFILES +clean-generic: clean-wrappers + rm -f $(XML_REPORTS) $(HTML_REPORTS) +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-actor-invariants.c /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-actor-invariants.c --- clutter-0.8.4/tests/conform/test-actor-invariants.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-actor-invariants.c 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,103 @@ +#include +#include + +#include + +#include "test-conform-common.h" + +void +test_initial_state (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterActor *actor; + + actor = clutter_rectangle_new (); + + g_assert (!(CLUTTER_ACTOR_IS_REALIZED (actor))); + g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor))); + g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor))); + + clutter_actor_destroy (actor); +} + +void +test_realized (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterActor *actor; + + actor = clutter_rectangle_new (); + + g_assert (!(CLUTTER_ACTOR_IS_REALIZED (actor))); + + clutter_actor_realize (actor); + + g_assert (CLUTTER_ACTOR_IS_REALIZED (actor)); + + g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor))); + g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor))); + + clutter_actor_destroy (actor); +} + +void +test_mapped (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterActor *actor; + + actor = clutter_rectangle_new (); + + g_assert (!(CLUTTER_ACTOR_IS_REALIZED (actor))); + g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor))); + + clutter_actor_show (actor); + + g_assert (CLUTTER_ACTOR_IS_REALIZED (actor)); + g_assert (CLUTTER_ACTOR_IS_MAPPED (actor)); + + g_assert (CLUTTER_ACTOR_IS_VISIBLE (actor)); + + clutter_actor_destroy (actor); +} + +void +test_show_on_set_parent (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterActor *actor, *group; + gboolean show_on_set_parent; + + group = clutter_group_new (); + + g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (group))); + + actor = clutter_rectangle_new (); + g_object_get (G_OBJECT (actor), + "show-on-set-parent", &show_on_set_parent, + NULL); + + g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor))); + g_assert (show_on_set_parent == TRUE); + + clutter_group_add (group, actor); + g_object_get (G_OBJECT (actor), + "show-on-set-parent", &show_on_set_parent, + NULL); + + g_assert (CLUTTER_ACTOR_IS_VISIBLE (actor)); + g_assert (show_on_set_parent == TRUE); + + g_object_ref (actor); + clutter_actor_unparent (actor); + g_object_get (G_OBJECT (actor), + "show-on-set-parent", &show_on_set_parent, + NULL); + + g_assert (CLUTTER_ACTOR_IS_REALIZED (actor)); + g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor))); + g_assert (show_on_set_parent == TRUE); + + clutter_actor_destroy (actor); + clutter_actor_destroy (group); +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-anchors.c /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-anchors.c --- clutter-0.8.4/tests/conform/test-anchors.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-anchors.c 2009-01-28 16:47:03.000000000 +0000 @@ -0,0 +1,698 @@ +#include +#include +#include + +#include "test-conform-common.h" + +#define NOTIFY_ANCHOR_X (1 << 0) +#define NOTIFY_ANCHOR_Y (1 << 1) +#define NOTIFY_ANCHOR_GRAVITY (1 << 2) +#define NOTIFY_SCALE_X (1 << 3) +#define NOTIFY_SCALE_Y (1 << 4) +#define NOTIFY_SCALE_CENTER_X (1 << 5) +#define NOTIFY_SCALE_CENTER_Y (1 << 6) +#define NOTIFY_SCALE_GRAVITY (1 << 7) +#define NOTIFY_ROTATION_ANGLE_X (1 << 8) +#define NOTIFY_ROTATION_ANGLE_Y (1 << 9) +#define NOTIFY_ROTATION_ANGLE_Z (1 << 10) +#define NOTIFY_ROTATION_CENTER_X (1 << 11) +#define NOTIFY_ROTATION_CENTER_Y (1 << 12) +#define NOTIFY_ROTATION_CENTER_Z (1 << 13) +#define NOTIFY_ROTATION_CENTER_Z_GRAVITY (1 << 14) + +#define RECT_WIDTH 100 +#define RECT_HEIGHT 80 + +/* Allow the transformed position by off by a certain number of + pixels */ +#define POSITION_TOLERANCE 2 + +typedef struct _TestState +{ + gulong notifications; + ClutterActor *rect; +} TestState; + +static const struct +{ + ClutterGravity gravity; + gint x_pos, y_pos; +} gravities[] = + { + { CLUTTER_GRAVITY_NORTH, RECT_WIDTH / 2, 0 }, + { CLUTTER_GRAVITY_NORTH_EAST, RECT_WIDTH, 0 }, + { CLUTTER_GRAVITY_EAST, RECT_WIDTH, RECT_HEIGHT / 2 }, + { CLUTTER_GRAVITY_SOUTH_EAST, RECT_WIDTH, RECT_HEIGHT }, + { CLUTTER_GRAVITY_SOUTH, RECT_WIDTH / 2, RECT_HEIGHT }, + { CLUTTER_GRAVITY_SOUTH_WEST, 0, RECT_HEIGHT }, + { CLUTTER_GRAVITY_WEST, 0, RECT_HEIGHT / 2 }, + { CLUTTER_GRAVITY_NORTH_WEST, 0, 0 }, + { CLUTTER_GRAVITY_CENTER, RECT_WIDTH / 2, RECT_HEIGHT / 2 } + }; + +static const char * const +properties[] = + { "anchor-x", + "anchor-y", + "anchor-gravity", + "scale-x", + "scale-y", + "scale-center-x", + "scale-center-y", + "scale-gravity", + "rotation-angle-x", + "rotation-angle-y", + "rotation-angle-z", + "rotation-center-x", + "rotation-center-y", + "rotation-center-z", + "rotation-center-z-gravity" }; + +static void +notify_cb (GObject *object, GParamSpec *pspec, TestState *state) +{ + int i; + int new_flags = 0; + int flag = 1; + + for (i = 0; i < G_N_ELEMENTS (properties); i++) + { + if (!strcmp (properties[i], pspec->name)) + new_flags |= flag; + flag <<= 1; + } + + g_assert ((new_flags & state->notifications) == 0); + + state->notifications |= new_flags; +} + +#define assert_notifications(flags) \ + do \ + { \ + g_assert (state->notifications == (flags)); \ + state->notifications = 0; \ + } while (0) + +/* Helper macro to assert the transformed position. This needs to be a + macro so that the assertion failure will report the right line + number */ +#define assert_coords(state, x_1, y_1, x_2, y_2) \ + do \ + { \ + ClutterVertex verts[4]; \ + clutter_actor_get_abs_allocation_vertices ((state)->rect, verts); \ + check_coords ((state), (x_1), (y_1), (x_2), (y_2), verts); \ + g_assert (approx_equal ((x_1), \ + CLUTTER_UNITS_TO_DEVICE (verts[0].x))); \ + g_assert (approx_equal ((y_1), \ + CLUTTER_UNITS_TO_DEVICE (verts[0].y))); \ + g_assert (approx_equal ((x_2), \ + CLUTTER_UNITS_TO_DEVICE (verts[3].x))); \ + g_assert (approx_equal ((y_2), \ + CLUTTER_UNITS_TO_DEVICE (verts[3].y))); \ + } while (0) + +#define assert_position(state, x, y) \ + assert_coords((state), (x), (y), (x) + RECT_WIDTH, (y) + RECT_HEIGHT) + +#define assert_vertex_and_free(v, xc, yc, zc) \ + do \ + { \ + g_assert (approx_equal (CLUTTER_UNITS_TO_DEVICE (v->x), xc) \ + && approx_equal (CLUTTER_UNITS_TO_DEVICE (v->y), yc) \ + && approx_equal (CLUTTER_UNITS_TO_DEVICE (v->z), zc)); \ + g_boxed_free (CLUTTER_TYPE_VERTEX, v); \ + } while (0) + +static inline gboolean +approx_equal (int a, int b) +{ + return abs (a - b) <= POSITION_TOLERANCE; +} + +static void +check_coords (TestState *state, + gint x_1, gint y_1, gint x_2, gint y_2, + const ClutterVertex *verts) +{ + if (g_test_verbose ()) + g_print ("checking that (%i,%i,%i,%i) \xe2\x89\x88 (%i,%i,%i,%i): %s\n", + x_1, y_1, x_2, y_2, + CLUTTER_UNITS_TO_DEVICE (verts[0].x), + CLUTTER_UNITS_TO_DEVICE (verts[0].y), + CLUTTER_UNITS_TO_DEVICE (verts[3].x), + CLUTTER_UNITS_TO_DEVICE (verts[3].y), + approx_equal (x_1, CLUTTER_UNITS_TO_DEVICE (verts[0].x)) + && approx_equal (y_1, CLUTTER_UNITS_TO_DEVICE (verts[0].y)) + && approx_equal (x_2, CLUTTER_UNITS_TO_DEVICE (verts[3].x)) + && approx_equal (y_2, CLUTTER_UNITS_TO_DEVICE (verts[3].y)) + ? "yes" : "NO"); +} + +static void +test_anchor_point (TestState *state) +{ + ClutterActor *rect = state->rect; + gint anchor_x, anchor_y; + ClutterGravity anchor_gravity; + int i; + + /* Assert the default settings */ + g_assert (clutter_actor_get_x (rect) == 100); + g_assert (clutter_actor_get_y (rect) == 200); + g_assert (clutter_actor_get_width (rect) == RECT_WIDTH); + g_assert (clutter_actor_get_height (rect) == RECT_HEIGHT); + g_object_get (rect, + "anchor-x", &anchor_x, "anchor-y", &anchor_y, + "anchor-gravity", &anchor_gravity, + NULL); + g_assert (anchor_x == 0); + g_assert (anchor_y == 0); + g_assert (anchor_gravity == CLUTTER_GRAVITY_NONE); + + /* Change the anchor point */ + clutter_actor_set_anchor_point (rect, 20, 30); + g_object_get (rect, + "anchor-x", &anchor_x, "anchor-y", &anchor_y, + "anchor-gravity", &anchor_gravity, + NULL); + g_assert (anchor_x == 20); + g_assert (anchor_y == 30); + g_assert (anchor_gravity == CLUTTER_GRAVITY_NONE); + assert_position (state, 80, 170); + assert_notifications (NOTIFY_ANCHOR_X | NOTIFY_ANCHOR_Y); + + /* Move the anchor point */ + clutter_actor_move_anchor_point (rect, 40, 50); + g_object_get (rect, + "anchor-x", &anchor_x, "anchor-y", &anchor_y, + "anchor-gravity", &anchor_gravity, + NULL); + g_assert (anchor_x == 40); + g_assert (anchor_y == 50); + g_assert (anchor_gravity == CLUTTER_GRAVITY_NONE); + assert_position (state, 80, 170); + assert_notifications (NOTIFY_ANCHOR_X | NOTIFY_ANCHOR_Y); + + /* Put the actor back to its default position */ + clutter_actor_set_position (rect, 100, 200); + + /* Change the anchor point with each of the gravities */ + for (i = 0; i < G_N_ELEMENTS (gravities); i++) + { + if (g_test_verbose ()) + { + GEnumClass *gravity_class = g_type_class_ref (CLUTTER_TYPE_GRAVITY); + GEnumValue *value = g_enum_get_value (gravity_class, + gravities[i].gravity); + g_print ("Setting gravity to %s\n", + value ? value->value_name : "?"); + g_type_class_unref (gravity_class); + } + + g_object_set (rect, "anchor-gravity", gravities[i].gravity, NULL); + + g_object_get (rect, + "anchor-x", &anchor_x, "anchor-y", &anchor_y, + "anchor-gravity", &anchor_gravity, + NULL); + g_assert (anchor_x == gravities[i].x_pos); + g_assert (anchor_y == gravities[i].y_pos); + g_assert (anchor_gravity == gravities[i].gravity); + assert_position (state, + 100 - gravities[i].x_pos, + 200 - gravities[i].y_pos); + + assert_notifications (NOTIFY_ANCHOR_X | NOTIFY_ANCHOR_Y + | NOTIFY_ANCHOR_GRAVITY); + } + + /* Verify that the anchor point moves if the actor changes size when + it is set from the gravity */ + clutter_actor_set_size (rect, RECT_WIDTH * 2, RECT_HEIGHT * 2); + g_object_get (rect, + "anchor-x", &anchor_x, "anchor-y", &anchor_y, + "anchor-gravity", &anchor_gravity, + NULL); + g_assert (anchor_x == RECT_WIDTH); + g_assert (anchor_y == RECT_HEIGHT); + g_assert (anchor_gravity == CLUTTER_GRAVITY_CENTER); + assert_coords (state, 100 - RECT_WIDTH, 200 - RECT_HEIGHT, + 100 + RECT_WIDTH, 200 + RECT_HEIGHT); + assert_notifications (0); + clutter_actor_set_size (rect, RECT_WIDTH, RECT_HEIGHT); + + /* Change the anchor point using units again to assert that the + gravity property changes */ + clutter_actor_set_anchor_point (rect, 20, 30); + g_object_get (rect, + "anchor-x", &anchor_x, "anchor-y", &anchor_y, + "anchor-gravity", &anchor_gravity, + NULL); + g_assert (anchor_x == 20); + g_assert (anchor_y == 30); + g_assert (anchor_gravity == CLUTTER_GRAVITY_NONE); + assert_position (state, 80, 170); + assert_notifications (NOTIFY_ANCHOR_X | NOTIFY_ANCHOR_Y + | NOTIFY_ANCHOR_GRAVITY); + + /* Verify that the anchor point doesn't move if the actor changes + size when it is set from units */ + clutter_actor_set_size (rect, RECT_WIDTH * 2, RECT_HEIGHT * 2); + g_object_get (rect, + "anchor-x", &anchor_x, "anchor-y", &anchor_y, + "anchor-gravity", &anchor_gravity, + NULL); + g_assert (anchor_x == 20); + g_assert (anchor_y == 30); + g_assert (anchor_gravity == CLUTTER_GRAVITY_NONE); + assert_coords (state, 80, 170, 80 + RECT_WIDTH * 2, 170 + RECT_HEIGHT * 2); + assert_notifications (0); + clutter_actor_set_size (rect, RECT_WIDTH, RECT_HEIGHT); + + /* Put the anchor back */ + clutter_actor_set_anchor_point_from_gravity (rect, CLUTTER_GRAVITY_NONE); + assert_notifications (NOTIFY_ANCHOR_X | NOTIFY_ANCHOR_Y); +} + +static void +test_scale_center (TestState *state) +{ + ClutterActor *rect = state->rect; + gdouble scale_x, scale_y; + gint center_x, center_y; + ClutterGravity gravity; + int i; + + /* Assert the default settings */ + g_assert (clutter_actor_get_x (rect) == 100); + g_assert (clutter_actor_get_y (rect) == 200); + g_assert (clutter_actor_get_width (rect) == RECT_WIDTH); + g_assert (clutter_actor_get_height (rect) == RECT_HEIGHT); + g_object_get (rect, + "scale-center-x", ¢er_x, "scale-center-y", ¢er_y, + "scale-x", &scale_x, "scale-y", &scale_y, + "scale-gravity", &gravity, + NULL); + g_assert (center_x == 0); + g_assert (center_y == 0); + g_assert (scale_x == 1.0); + g_assert (scale_y == 1.0); + g_assert (gravity == CLUTTER_GRAVITY_NONE); + + /* Try changing the scale without affecting the center */ + g_object_set (rect, "scale-x", 2.0, "scale-y", 3.0, NULL); + g_assert (clutter_actor_get_x (rect) == 100); + g_assert (clutter_actor_get_y (rect) == 200); + g_assert (clutter_actor_get_width (rect) == RECT_WIDTH); + g_assert (clutter_actor_get_height (rect) == RECT_HEIGHT); + g_object_get (rect, + "scale-center-x", ¢er_x, "scale-center-y", ¢er_y, + "scale-x", &scale_x, "scale-y", &scale_y, + "scale-gravity", &gravity, + NULL); + g_assert (center_x == 0); + g_assert (center_y == 0); + g_assert (scale_x == 2.0); + g_assert (scale_y == 3.0); + g_assert (gravity == CLUTTER_GRAVITY_NONE); + assert_notifications (NOTIFY_SCALE_X | NOTIFY_SCALE_Y); + assert_coords (state, 100, 200, 100 + RECT_WIDTH * 2, 200 + RECT_HEIGHT * 3); + + /* Change the scale and center */ + g_object_set (rect, "scale-x", 4.0, "scale-y", 2.0, + "scale-center-x", 10, "scale-center-y", 20, NULL); + g_assert (clutter_actor_get_x (rect) == 100); + g_assert (clutter_actor_get_y (rect) == 200); + g_assert (clutter_actor_get_width (rect) == RECT_WIDTH); + g_assert (clutter_actor_get_height (rect) == RECT_HEIGHT); + g_object_get (rect, + "scale-center-x", ¢er_x, "scale-center-y", ¢er_y, + "scale-x", &scale_x, "scale-y", &scale_y, + "scale-gravity", &gravity, + NULL); + g_assert (center_x == 10); + g_assert (center_y == 20); + g_assert (scale_x == 4.0); + g_assert (scale_y == 2.0); + g_assert (gravity == CLUTTER_GRAVITY_NONE); + assert_notifications (NOTIFY_SCALE_X | NOTIFY_SCALE_Y + | NOTIFY_SCALE_CENTER_X | NOTIFY_SCALE_CENTER_Y); + assert_coords (state, 100 + 10 - 10 * 4, 200 + 20 - 20 * 2, + 100 + 10 + (RECT_WIDTH - 10) * 4, + 200 + 20 + (RECT_HEIGHT - 20) * 2); + + /* Change the anchor point with each of the gravities */ + for (i = 0; i < G_N_ELEMENTS (gravities); i++) + { + if (g_test_verbose ()) + { + GEnumClass *gravity_class = g_type_class_ref (CLUTTER_TYPE_GRAVITY); + GEnumValue *value = g_enum_get_value (gravity_class, + gravities[i].gravity); + g_print ("Setting scale center to %s\n", + value ? value->value_name : "?"); + g_type_class_unref (gravity_class); + } + + g_object_set (rect, "scale-gravity", gravities[i].gravity, NULL); + + g_assert (clutter_actor_get_x (rect) == 100); + g_assert (clutter_actor_get_y (rect) == 200); + g_assert (clutter_actor_get_width (rect) == RECT_WIDTH); + g_assert (clutter_actor_get_height (rect) == RECT_HEIGHT); + g_object_get (rect, + "scale-center-x", ¢er_x, "scale-center-y", ¢er_y, + "scale-x", &scale_x, "scale-y", &scale_y, + "scale-gravity", &gravity, + NULL); + g_assert (center_x == gravities[i].x_pos); + g_assert (center_y == gravities[i].y_pos); + g_assert (scale_x == 4.0); + g_assert (scale_y == 2.0); + g_assert (gravity == gravities[i].gravity); + assert_notifications (NOTIFY_SCALE_X | NOTIFY_SCALE_Y + | NOTIFY_SCALE_CENTER_X | NOTIFY_SCALE_CENTER_Y + | NOTIFY_SCALE_GRAVITY); + assert_coords (state, + 100 - gravities[i].x_pos * 3, + 200 - gravities[i].y_pos, + 100 + (gravities[i].x_pos + + (RECT_WIDTH - gravities[i].x_pos) * 4), + 200 + (gravities[i].y_pos + + (RECT_HEIGHT - gravities[i].y_pos) * 2)); + } + + /* Change the scale center using units again to assert that the + gravity property changes */ + clutter_actor_set_scale_full (rect, 4, 2, 10, 20); + g_object_get (rect, + "scale-center-x", ¢er_x, "scale-center-y", ¢er_y, + "scale-x", &scale_x, "scale-y", &scale_y, + "scale-gravity", &gravity, + NULL); + g_assert (center_x == 10); + g_assert (center_y == 20); + g_assert (scale_x == 4.0); + g_assert (scale_y == 2.0); + g_assert (gravity == CLUTTER_GRAVITY_NONE); + assert_notifications (NOTIFY_SCALE_X | NOTIFY_SCALE_Y + | NOTIFY_SCALE_CENTER_X | NOTIFY_SCALE_CENTER_Y + | NOTIFY_SCALE_GRAVITY); + assert_coords (state, 100 + 10 - 10 * 4, 200 + 20 - 20 * 2, + 100 + 10 + (RECT_WIDTH - 10) * 4, + 200 + 20 + (RECT_HEIGHT - 20) * 2); + + /* Put the scale back to normal */ + clutter_actor_set_scale_full (rect, 1, 1, 0, 0); + assert_notifications (NOTIFY_SCALE_X | NOTIFY_SCALE_Y + | NOTIFY_SCALE_CENTER_X | NOTIFY_SCALE_CENTER_Y); +} + +static void +test_rotate_center (TestState *state) +{ + ClutterActor *rect = state->rect; + gdouble angle_x, angle_y, angle_z; + ClutterVertex *center_x, *center_y, *center_z; + ClutterGravity z_center_gravity; + guint stage_width, stage_height; + gint rect_x, rect_y; + int i; + + /* Position the rectangle at the center of the stage so that + rotations by 90° along the X or Y axis will cause the actor to be + appear as a flat line. This makes verifying the transformations + easier */ + clutter_actor_get_size (clutter_actor_get_stage (rect), + &stage_width, &stage_height); + rect_x = stage_width / 2; + rect_y = stage_height / 2; + clutter_actor_set_position (rect, rect_x, rect_y); + + /* Assert the default settings */ + g_assert (clutter_actor_get_x (rect) == rect_x); + g_assert (clutter_actor_get_y (rect) == rect_y); + g_assert (clutter_actor_get_width (rect) == RECT_WIDTH); + g_assert (clutter_actor_get_height (rect) == RECT_HEIGHT); + g_object_get (rect, + "rotation-angle-x", &angle_x, + "rotation-angle-y", &angle_y, + "rotation-angle-z", &angle_z, + "rotation-center-x", ¢er_x, + "rotation-center-y", ¢er_y, + "rotation-center-z", ¢er_z, + "rotation-center-z-gravity", &z_center_gravity, + NULL); + g_assert (angle_x == 0.0); + g_assert (angle_y == 0.0); + g_assert (angle_z == 0.0); + assert_vertex_and_free (center_x, 0, 0, 0); + assert_vertex_and_free (center_y, 0, 0, 0); + assert_vertex_and_free (center_z, 0, 0, 0); + g_assert (z_center_gravity == CLUTTER_GRAVITY_NONE); + + /* Change each of the rotation angles without affecting the center + point */ + for (i = CLUTTER_X_AXIS; i <= CLUTTER_Z_AXIS; i++) + { + char prop_name[] = "rotation-angle- "; + prop_name[sizeof (prop_name) - 2] = i - CLUTTER_X_AXIS + 'x'; + + if (g_test_verbose ()) + g_print ("Setting %s to 90 degrees\n", prop_name); + + g_object_set (rect, prop_name, 90.0, NULL); + assert_notifications (NOTIFY_ROTATION_ANGLE_X << (i - CLUTTER_X_AXIS)); + + g_assert (clutter_actor_get_x (rect) == rect_x); + g_assert (clutter_actor_get_y (rect) == rect_y); + g_assert (clutter_actor_get_width (rect) == RECT_WIDTH); + g_assert (clutter_actor_get_height (rect) == RECT_HEIGHT); + g_object_get (rect, + "rotation-angle-x", &angle_x, + "rotation-angle-y", &angle_y, + "rotation-angle-z", &angle_z, + "rotation-center-x", ¢er_x, + "rotation-center-y", ¢er_y, + "rotation-center-z", ¢er_z, + "rotation-center-z-gravity", &z_center_gravity, + NULL); + if (i == CLUTTER_X_AXIS) + { + g_assert (angle_x == 90.0); + assert_coords (state, rect_x, rect_y, + CLUTTER_UNITS_TO_DEVICE (verts[3].x), rect_y); + } + else + g_assert (angle_x == 0.0); + if (i == CLUTTER_Y_AXIS) + { + g_assert (angle_y == 90.0); + assert_coords (state, rect_x, rect_y, + rect_x, CLUTTER_UNITS_TO_DEVICE (verts[3].y)); + } + else + g_assert (angle_y == 0.0); + if (i == CLUTTER_Z_AXIS) + { + g_assert (angle_z == 90.0); + assert_coords (state, rect_x, rect_y, + rect_x - RECT_HEIGHT, rect_y + RECT_WIDTH); + } + else + g_assert (angle_z == 0.0); + assert_vertex_and_free (center_x, 0, 0, 0); + assert_vertex_and_free (center_y, 0, 0, 0); + assert_vertex_and_free (center_z, 0, 0, 0); + g_assert (z_center_gravity == CLUTTER_GRAVITY_NONE); + + g_object_set (rect, prop_name, 0.0, NULL); + assert_notifications (NOTIFY_ROTATION_ANGLE_X << (i - CLUTTER_X_AXIS)); + } + + clutter_actor_set_position (rect, rect_x -= 10, rect_y -= 20); + + /* Same test but also change the center position */ + for (i = CLUTTER_X_AXIS; i <= CLUTTER_Z_AXIS; i++) + { + char prop_name[] = "rotation-angle- "; + prop_name[sizeof (prop_name) - 2] = i - CLUTTER_X_AXIS + 'x'; + + if (g_test_verbose ()) + g_print ("Setting %s to 90 degrees with center 10,20,0\n", prop_name); + + clutter_actor_set_rotation (rect, i, 90.0, 10, 20, 0); + assert_notifications ((NOTIFY_ROTATION_ANGLE_X << (i - CLUTTER_X_AXIS)) + | (NOTIFY_ROTATION_CENTER_X + << (i - CLUTTER_X_AXIS))); + + g_assert (clutter_actor_get_x (rect) == rect_x); + g_assert (clutter_actor_get_y (rect) == rect_y); + g_assert (clutter_actor_get_width (rect) == RECT_WIDTH); + g_assert (clutter_actor_get_height (rect) == RECT_HEIGHT); + g_object_get (rect, + "rotation-angle-x", &angle_x, + "rotation-angle-y", &angle_y, + "rotation-angle-z", &angle_z, + "rotation-center-x", ¢er_x, + "rotation-center-y", ¢er_y, + "rotation-center-z", ¢er_z, + "rotation-center-z-gravity", &z_center_gravity, + NULL); + if (i == CLUTTER_X_AXIS) + { + g_assert (angle_x == 90.0); + assert_coords (state, + CLUTTER_UNITS_TO_DEVICE (verts[0].x), rect_y + 20, + CLUTTER_UNITS_TO_DEVICE (verts[3].x), rect_y + 20); + assert_vertex_and_free (center_x, 10, 20, 0); + } + else + { + g_assert (angle_x == 0.0); + assert_vertex_and_free (center_x, 0, 0, 0); + } + if (i == CLUTTER_Y_AXIS) + { + g_assert (angle_y == 90.0); + assert_coords (state, + rect_x + 10, CLUTTER_UNITS_TO_DEVICE (verts[0].y), + rect_x + 10, CLUTTER_UNITS_TO_DEVICE (verts[3].y)); + assert_vertex_and_free (center_y, 10, 20, 0); + } + else + { + g_assert (angle_y == 0.0); + assert_vertex_and_free (center_y, 0, 0, 0); + } + if (i == CLUTTER_Z_AXIS) + { + g_assert (angle_z == 90.0); + assert_coords (state, + rect_x + 10 + 20, + rect_y + 20 - 10, + rect_x + 10 + 20 - RECT_HEIGHT, + rect_y + 20 + RECT_WIDTH - 10); + assert_vertex_and_free (center_z, 10, 20, 0); + } + else + { + g_assert (angle_z == 0.0); + assert_vertex_and_free (center_z, 0, 0, 0); + } + g_assert (z_center_gravity == CLUTTER_GRAVITY_NONE); + + clutter_actor_set_rotation (rect, i, 0, 0, 0, 0); + assert_notifications ((NOTIFY_ROTATION_ANGLE_X << (i - CLUTTER_X_AXIS)) + | (NOTIFY_ROTATION_CENTER_X + << (i - CLUTTER_X_AXIS))); + + } + + /* Try rotating the z with all of the gravities */ + for (i = 0; i < G_N_ELEMENTS (gravities); i++) + { + if (g_test_verbose ()) + { + GEnumClass *gravity_class = g_type_class_ref (CLUTTER_TYPE_GRAVITY); + GEnumValue *value = g_enum_get_value (gravity_class, + gravities[i].gravity); + g_print ("Setting z rotation to 90 degrees with center at %s\n", + value ? value->value_name : "?"); + g_type_class_unref (gravity_class); + } + + clutter_actor_set_z_rotation_from_gravity (rect, 90, + gravities[i].gravity); + assert_notifications (NOTIFY_ROTATION_ANGLE_Z + | NOTIFY_ROTATION_CENTER_Z + | NOTIFY_ROTATION_CENTER_Z_GRAVITY); + + g_assert (clutter_actor_get_x (rect) == rect_x); + g_assert (clutter_actor_get_y (rect) == rect_y); + g_assert (clutter_actor_get_width (rect) == RECT_WIDTH); + g_assert (clutter_actor_get_height (rect) == RECT_HEIGHT); + g_object_get (rect, + "rotation-angle-x", &angle_x, + "rotation-angle-y", &angle_y, + "rotation-angle-z", &angle_z, + "rotation-center-x", ¢er_x, + "rotation-center-y", ¢er_y, + "rotation-center-z", ¢er_z, + "rotation-center-z-gravity", &z_center_gravity, + NULL); + g_assert (angle_x == 0.0); + g_assert (angle_y == 0.0); + g_assert (angle_z == 90.0); + assert_vertex_and_free (center_x, 0, 0, 0); + assert_vertex_and_free (center_y, 0, 0, 0); + assert_vertex_and_free (center_z, + gravities[i].x_pos, gravities[i].y_pos, 0); + assert_coords (state, + rect_x + gravities[i].x_pos + gravities[i].y_pos, + rect_y + gravities[i].y_pos - gravities[i].x_pos, + rect_x + gravities[i].x_pos + gravities[i].y_pos + - RECT_HEIGHT, + rect_y + gravities[i].y_pos + RECT_WIDTH + - gravities[i].x_pos); + g_assert (z_center_gravity == gravities[i].gravity); + g_assert (clutter_actor_get_z_rotation_gravity (rect) + == gravities[i].gravity); + + /* Put the rotation back */ + clutter_actor_set_z_rotation_from_gravity (rect, 0, CLUTTER_GRAVITY_NONE); + assert_notifications (NOTIFY_ROTATION_ANGLE_Z + | NOTIFY_ROTATION_CENTER_Z + | NOTIFY_ROTATION_CENTER_Z_GRAVITY); + } +} + +static gboolean +idle_cb (gpointer data) +{ + test_anchor_point (data); + test_scale_center (data); + test_rotate_center (data); + + clutter_main_quit (); + + return FALSE; +} + +void +test_anchors (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + TestState state; + ClutterActor *stage; + + stage = clutter_stage_get_default (); + + state.rect = clutter_rectangle_new (); + clutter_container_add (CLUTTER_CONTAINER (stage), state.rect, NULL); + clutter_actor_set_position (state.rect, 100, 200); + clutter_actor_set_size (state.rect, RECT_WIDTH, RECT_HEIGHT); + + /* Record notifications on the actor properties */ + state.notifications = 0; + g_signal_connect (state.rect, "notify", + G_CALLBACK (notify_cb), &state); + + /* Run the tests in a low priority idle function so that we can be + sure the stage is correctly setup */ + g_idle_add_full (G_PRIORITY_LOW, idle_cb, &state, NULL); + + clutter_actor_show (stage); + + clutter_main (); + + g_idle_remove_by_data (&state); + + clutter_actor_destroy (state.rect); + + if (g_test_verbose ()) + g_print ("OK\n"); +} + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-backface-culling.c /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-backface-culling.c --- clutter-0.8.4/tests/conform/test-backface-culling.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-backface-culling.c 2009-01-29 08:31:37.000000000 +0000 @@ -0,0 +1,274 @@ + +#include +#include +#include + +#include "test-conform-common.h" + +static const ClutterColor stage_color = { 0x0, 0x0, 0x0, 0xff }; + +#ifdef CLUTTER_COGL_HAS_GL + +/* Size the texture so that it is just off a power of two to enourage + it so use software tiling when NPOTs aren't available */ +#define TEXTURE_SIZE 33 + +#else /* CLUTTER_COGL_HAS_GL */ + +/* We can't use the funny-sized texture on GL ES because it will break + cogl_texture_polygon. However there is only one code path for + rendering quads so there is no need */ +#define TEXTURE_SIZE 32 + +#endif /* CLUTTER_COGL_HAS_GL */ + +/* Amount of pixels to skip off the top, bottom, left and right of the + texture when reading back the stage */ +#define TEST_INSET 4 + +typedef struct _TestState +{ + guint frame; + CoglHandle texture; +} TestState; + +static gboolean +validate_part (int xnum, int ynum, gboolean shown) +{ + guchar *pixels, *p; + ClutterActor *stage = clutter_stage_get_default (); + gboolean ret = TRUE; + + /* Read the appropriate part but skip out a few pixels around the + edges */ + pixels = clutter_stage_read_pixels (CLUTTER_STAGE (stage), + xnum * TEXTURE_SIZE + TEST_INSET, + ynum * TEXTURE_SIZE + TEST_INSET, + TEXTURE_SIZE - TEST_INSET * 2, + TEXTURE_SIZE - TEST_INSET * 2); + + /* Make sure every pixels is the appropriate color */ + for (p = pixels; + p < pixels + ((TEXTURE_SIZE - TEST_INSET * 2) + * (TEXTURE_SIZE - TEST_INSET * 2)); + p += 4) + { + if (p[0] != (shown ? 255 : 0)) + ret = FALSE; + if (p[1] != 0) + ret = FALSE; + if (p[2] != 0) + ret = FALSE; + } + + g_free (pixels); + + return ret; +} + +static void +validate_result (TestState *state) +{ + /* Front-facing texture */ + g_assert (validate_part (0, 0, TRUE)); + /* Back-facing texture */ + g_assert (validate_part (1, 0, FALSE)); + /* Front-facing texture polygon */ + g_assert (validate_part (2, 0, TRUE)); + /* Back-facing texture polygon */ + g_assert (validate_part (3, 0, FALSE)); + /* Regular rectangle */ + g_assert (validate_part (4, 0, TRUE)); + + /* Backface culling disabled - everything should be shown */ + + /* Front-facing texture */ + g_assert (validate_part (0, 1, TRUE)); + /* Back-facing texture */ + g_assert (validate_part (1, 1, TRUE)); + /* Front-facing texture polygon */ + g_assert (validate_part (2, 1, TRUE)); + /* Back-facing texture polygon */ + g_assert (validate_part (3, 1, TRUE)); + /* Regular rectangle */ + g_assert (validate_part (4, 1, TRUE)); + + /* Comment this out if you want visual feedback of what this test + * paints. + */ + clutter_main_quit (); +} + +static void +on_paint (ClutterActor *actor, TestState *state) +{ + int i; + int frame_num; + + cogl_enable_backface_culling (TRUE); + + cogl_push_matrix (); + + /* Render the scene twice - once with backface culling enabled and + once without. The second time is translated so that it is below + the first */ + for (i = 0; i < 2; i++) + { + float x1 = 0, x2, y1 = 0, y2 = (float)(TEXTURE_SIZE); + CoglTextureVertex verts[4]; + + memset (verts, 0, sizeof (verts)); + + /* Set the color to white so that all the textures will be drawn + at their own color */ + cogl_set_source_color4f (1.0, 1.0, + 1.0, 1.0); + + x2 = x1 + (float)(TEXTURE_SIZE); + + /* Draw a front-facing texture */ + cogl_set_source_texture (state->texture); + cogl_rectangle (x1, y1, x2, y2); + + x1 = x2; + x2 = x1 + (float)(TEXTURE_SIZE); + + /* Draw a back-facing texture */ + cogl_set_source_texture (state->texture); + cogl_rectangle (x2, y1, x1, y2); + + x1 = x2; + x2 = x1 + (float)(TEXTURE_SIZE); + + /* Draw a front-facing texture polygon */ + verts[0].x = x1; verts[0].y = y2; + verts[1].x = x2; verts[1].y = y2; + verts[2].x = x2; verts[2].y = y1; + verts[3].x = x1; verts[3].y = y1; + verts[0].tx = 0; verts[0].ty = 0; + verts[1].tx = 1.0; verts[1].ty = 0; + verts[2].tx = 1.0; verts[2].ty = 1.0; + verts[3].tx = 0; verts[3].ty = 1.0; + cogl_set_source_texture (state->texture); + cogl_polygon (verts, 4, FALSE); + + x1 = x2; + x2 = x1 + (float)(TEXTURE_SIZE); + + /* Draw a back-facing texture polygon */ + verts[0].x = x1; verts[0].y = y1; + verts[1].x = x2; verts[1].y = y1; + verts[2].x = x2; verts[2].y = y2; + verts[3].x = x1; verts[3].y = y2; + verts[0].tx = 0; verts[0].ty = 0; + verts[1].tx = 1.0; verts[1].ty = 0; + verts[2].tx = 1.0; verts[2].ty = 1.0; + verts[3].tx = 0; verts[3].ty = 1.0; + cogl_set_source_texture (state->texture); + cogl_polygon (verts, 4, FALSE); + + x1 = x2; + x2 = x1 + (float)(TEXTURE_SIZE); + + /* Draw a regular rectangle (this should always show) */ + cogl_set_source_color4f (1.0, 0, 0, 1.0); + cogl_rectangle (x1, y1, x2, y2); + + /* The second time round draw beneath the first with backface + culling disabled */ + cogl_translate (0, TEXTURE_SIZE, 0); + cogl_enable_backface_culling (FALSE); + } + + cogl_pop_matrix (); + + /* XXX: Experiments have shown that for some buggy drivers, when using + * glReadPixels there is some kind of race, so we delay our test for a + * few frames and a few seconds: + */ + /* Need to increment frame first because clutter_stage_read_pixels + fires a redraw */ + frame_num = state->frame++; + if (frame_num == 2) + validate_result (state); + else if (frame_num < 2) + g_usleep (G_USEC_PER_SEC); +} + +static gboolean +queue_redraw (gpointer stage) +{ + clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); + + return TRUE; +} + +static CoglHandle +make_texture (void) +{ + guchar *tex_data, *p; + CoglHandle tex; + + tex_data = g_malloc (TEXTURE_SIZE * TEXTURE_SIZE * 4); + + for (p = tex_data + TEXTURE_SIZE * TEXTURE_SIZE * 4; p > tex_data;) + { + *(--p) = 255; + *(--p) = 0; + *(--p) = 0; + *(--p) = 255; + } + + tex = cogl_texture_new_from_data (TEXTURE_SIZE, + TEXTURE_SIZE, + 8, + COGL_TEXTURE_NONE, + COGL_PIXEL_FORMAT_RGBA_8888, + COGL_PIXEL_FORMAT_ANY, + TEXTURE_SIZE * 4, + tex_data); + + g_free (tex_data); + + return tex; +} + +void +test_backface_culling (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + TestState state; + ClutterActor *stage; + ClutterActor *group; + guint idle_source; + + state.frame = 0; + + state.texture = make_texture (); + + stage = clutter_stage_get_default (); + + clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); + + group = clutter_group_new (); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), group); + + /* We force continuous redrawing of the stage, since we need to skip + * the first few frames, and we wont be doing anything else that + * will trigger redrawing. */ + idle_source = g_idle_add (queue_redraw, stage); + + g_signal_connect (group, "paint", G_CALLBACK (on_paint), &state); + + clutter_actor_show_all (stage); + + clutter_main (); + + g_source_remove (idle_source); + + cogl_texture_unref (state.texture); + + if (g_test_verbose ()) + g_print ("OK\n"); +} + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-binding-pool.c /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-binding-pool.c --- clutter-0.8.4/tests/conform/test-binding-pool.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-binding-pool.c 2009-01-29 08:31:37.000000000 +0000 @@ -0,0 +1,313 @@ +#include + +#include + +#include +#include + +#include "test-conform-common.h" + +#define TYPE_KEY_GROUP (key_group_get_type ()) +#define KEY_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_KEY_GROUP, KeyGroup)) +#define IS_KEY_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_KEY_GROUP)) +#define KEY_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_KEY_GROUP, KeyGroupClass)) +#define IS_KEY_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_KEY_GROUP)) + +typedef struct _KeyGroup KeyGroup; +typedef struct _KeyGroupClass KeyGroupClass; + +struct _KeyGroup +{ + ClutterGroup parent_instance; + + gint selected_index; +}; + +struct _KeyGroupClass +{ + ClutterGroupClass parent_class; + + void (* activate) (KeyGroup *group, + ClutterActor *child); +}; + +G_DEFINE_TYPE (KeyGroup, key_group, CLUTTER_TYPE_GROUP); + +enum +{ + ACTIVATE, + + LAST_SIGNAL +}; + +static guint group_signals[LAST_SIGNAL] = { 0, }; + +static gboolean +key_group_action_move_left (KeyGroup *self, + const gchar *action_name, + guint key_val, + ClutterModifierType modifiers) +{ + gint n_children; + + g_assert_cmpstr (action_name, ==, "move-left"); + g_assert_cmpint (key_val, ==, CLUTTER_Left); + + n_children = clutter_group_get_n_children (CLUTTER_GROUP (self)); + + self->selected_index -= 1; + + if (self->selected_index < 0) + self->selected_index = n_children - 1; + + return TRUE; +} + +static gboolean +key_group_action_move_right (KeyGroup *self, + const gchar *action_name, + guint key_val, + ClutterModifierType modifiers) +{ + gint n_children; + + g_assert_cmpstr (action_name, ==, "move-right"); + g_assert_cmpint (key_val, ==, CLUTTER_Right); + + n_children = clutter_group_get_n_children (CLUTTER_GROUP (self)); + + self->selected_index += 1; + + if (self->selected_index >= n_children) + self->selected_index = 0; + + return TRUE; +} + +static gboolean +key_group_action_activate (KeyGroup *self, + const gchar *action_name, + guint key_val, + ClutterModifierType modifiers) +{ + ClutterActor *child = NULL; + + g_assert_cmpstr (action_name, ==, "activate"); + g_assert (key_val == CLUTTER_Return || + key_val == CLUTTER_KP_Enter || + key_val == CLUTTER_ISO_Enter); + + if (self->selected_index == -1) + return FALSE; + + child = clutter_group_get_nth_child (CLUTTER_GROUP (self), + self->selected_index); + + if (child) + { + g_signal_emit (self, group_signals[ACTIVATE], 0, child); + return TRUE; + } + else + return FALSE; +} + +static gboolean +key_group_key_press (ClutterActor *actor, + ClutterKeyEvent *event) +{ + ClutterBindingPool *pool; + gboolean res; + + pool = clutter_binding_pool_find (G_OBJECT_TYPE_NAME (actor)); + g_assert (pool != NULL); + + res = clutter_binding_pool_activate (pool, + event->keyval, + event->modifier_state, + G_OBJECT (actor)); + + /* if we activate a key binding, redraw the actor */ + if (res) + clutter_actor_queue_redraw (actor); + + return res; +} + +static void +key_group_paint (ClutterActor *actor) +{ + KeyGroup *self = KEY_GROUP (actor); + GList *children, *l; + gint i; + + children = clutter_container_get_children (CLUTTER_CONTAINER (self)); + + for (l = children, i = 0; l != NULL; l = l->next, i++) + { + ClutterActor *child = l->data; + + /* paint the selection rectangle */ + if (i == self->selected_index) + { + ClutterActorBox box = { 0, }; + + clutter_actor_get_allocation_box (child, &box); + + box.x1 -= CLUTTER_UNITS_FROM_DEVICE (2); + box.y1 -= CLUTTER_UNITS_FROM_DEVICE (2); + box.x2 += CLUTTER_UNITS_FROM_DEVICE (2); + box.y2 += CLUTTER_UNITS_FROM_DEVICE (2); + + cogl_set_source_color4ub (255, 255, 0, 224); + cogl_rectangle (CLUTTER_UNITS_TO_DEVICE (box.x1), + CLUTTER_UNITS_TO_DEVICE (box.y1), + CLUTTER_UNITS_TO_DEVICE (box.x2), + CLUTTER_UNITS_TO_DEVICE (box.y2)); + } + + if (CLUTTER_ACTOR_IS_VISIBLE (child)) + clutter_actor_paint (child); + } + + g_list_free (children); +} + +static void +key_group_finalize (GObject *gobject) +{ + G_OBJECT_CLASS (key_group_parent_class)->finalize (gobject); +} + +static void +key_group_class_init (KeyGroupClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); + ClutterBindingPool *binding_pool; + + gobject_class->finalize = key_group_finalize; + + actor_class->paint = key_group_paint; + actor_class->key_press_event = key_group_key_press; + + group_signals[ACTIVATE] = + g_signal_new (g_intern_static_string ("activate"), + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (KeyGroupClass, activate), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + CLUTTER_TYPE_ACTOR); + + binding_pool = clutter_binding_pool_get_for_class (klass); + + clutter_binding_pool_install_action (binding_pool, "move-right", + CLUTTER_Right, 0, + G_CALLBACK (key_group_action_move_right), + NULL, NULL); + clutter_binding_pool_install_action (binding_pool, "move-left", + CLUTTER_Left, 0, + G_CALLBACK (key_group_action_move_left), + NULL, NULL); + clutter_binding_pool_install_action (binding_pool, "activate", + CLUTTER_Return, 0, + G_CALLBACK (key_group_action_activate), + NULL, NULL); + clutter_binding_pool_install_action (binding_pool, "activate", + CLUTTER_KP_Enter, 0, + G_CALLBACK (key_group_action_activate), + NULL, NULL); + clutter_binding_pool_install_action (binding_pool, "activate", + CLUTTER_ISO_Enter, 0, + G_CALLBACK (key_group_action_activate), + NULL, NULL); +} + +static void +key_group_init (KeyGroup *self) +{ + self->selected_index = -1; +} + +static void +init_event (ClutterKeyEvent *event) +{ + event->type = CLUTTER_KEY_PRESS; + event->time = 0; /* not needed */ + event->flags = CLUTTER_EVENT_FLAG_SYNTHETIC; + event->stage = NULL; /* not needed */ + event->source = NULL; /* not needed */ + event->modifier_state = 0; + event->hardware_keycode = 0; /* not needed */ +} + +static void +send_keyval (KeyGroup *group, int keyval) +{ + ClutterKeyEvent event; + + init_event (&event); + event.keyval = keyval; + event.unicode_value = 0; /* should be ignored for cursor keys etc. */ + + clutter_actor_event (CLUTTER_ACTOR (group), (ClutterEvent *) &event, FALSE); +} + +static void +on_activate (KeyGroup *key_group, + ClutterActor *child, + gpointer data) +{ + gint _index = GPOINTER_TO_INT (data); + + g_assert_cmpint (key_group->selected_index, ==, _index); +} + +void +test_binding_pool (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + KeyGroup *key_group = g_object_new (TYPE_KEY_GROUP, NULL); + + clutter_container_add (CLUTTER_CONTAINER (key_group), + g_object_new (CLUTTER_TYPE_RECTANGLE, + "width", 50, + "height", 50, + "x", 0, "y", 0, + NULL), + g_object_new (CLUTTER_TYPE_RECTANGLE, + "width", 50, + "height", 50, + "x", 75, "y", 0, + NULL), + g_object_new (CLUTTER_TYPE_RECTANGLE, + "width", 50, + "height", 50, + "x", 150, "y", 0, + NULL), + NULL); + + g_assert_cmpint (key_group->selected_index, ==, -1); + + send_keyval (key_group, CLUTTER_Left); + g_assert_cmpint (key_group->selected_index, ==, 2); + + send_keyval (key_group, CLUTTER_Left); + g_assert_cmpint (key_group->selected_index, ==, 1); + + send_keyval (key_group, CLUTTER_Right); + g_assert_cmpint (key_group->selected_index, ==, 2); + + send_keyval (key_group, CLUTTER_Right); + g_assert_cmpint (key_group->selected_index, ==, 0); + + g_signal_connect (key_group, + "activate", G_CALLBACK (on_activate), + GINT_TO_POINTER (0)); + + send_keyval (key_group, CLUTTER_Return); + + clutter_actor_destroy (CLUTTER_ACTOR (key_group)); +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-clutter-fixed.c /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-clutter-fixed.c --- clutter-0.8.4/tests/conform/test-clutter-fixed.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-clutter-fixed.c 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,18 @@ +#include +#include + +#include "test-conform-common.h" + +void +test_fixed_constants (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + g_assert_cmpint (CFX_ONE, ==, CLUTTER_FLOAT_TO_FIXED (1.0)); + g_assert_cmpint (CFX_ONE, ==, CLUTTER_INT_TO_FIXED (1)); + + g_assert_cmpint (CFX_HALF, ==, CLUTTER_FLOAT_TO_FIXED (0.5)); + + g_assert_cmpfloat (CLUTTER_FIXED_TO_FLOAT (CFX_ONE), ==, 1.0); + g_assert_cmpfloat (CLUTTER_FIXED_TO_FLOAT (CFX_HALF), ==, 0.5); +} + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-clutter-rectangle.c /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-clutter-rectangle.c --- clutter-0.8.4/tests/conform/test-clutter-rectangle.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-clutter-rectangle.c 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,56 @@ +#include +#include +#include + +#include + +#include + +#include "test-conform-common.h" + +void +test_rect_set_size (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterActor *rect = clutter_rectangle_new (); + + /* initial positioning */ + g_assert_cmpint (clutter_actor_get_x (rect), ==, 0); + g_assert_cmpint (clutter_actor_get_y (rect), ==, 0); + + clutter_actor_set_size (rect, 100, 100); + + /* make sure that changing the size does not affect the + * rest of the bounding box + */ + g_assert_cmpint (clutter_actor_get_x (rect), ==, 0); + g_assert_cmpint (clutter_actor_get_y (rect), ==, 0); + + g_assert_cmpint (clutter_actor_get_width (rect), ==, 100); + g_assert_cmpint (clutter_actor_get_height (rect), ==, 100); + + clutter_actor_destroy (rect); +} + +void +test_rect_set_color (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterActor *rect = clutter_rectangle_new (); + ClutterColor white = { 255, 255, 255, 255 }; + ClutterColor black = { 0, 0, 0, 255 }; + ClutterColor check = { 0, }; + + clutter_rectangle_set_color (CLUTTER_RECTANGLE (rect), &black); + clutter_rectangle_get_color (CLUTTER_RECTANGLE (rect), &check); + g_assert_cmpint (check.blue, ==, black.blue); + + clutter_rectangle_set_color (CLUTTER_RECTANGLE (rect), &white); + clutter_rectangle_get_color (CLUTTER_RECTANGLE (rect), &check); + g_assert_cmpint (check.green, ==, white.green); + + g_assert_cmpint (clutter_actor_get_opacity (rect), ==, white.alpha); + + clutter_actor_destroy (rect); +} + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-clutter-text.c /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-clutter-text.c --- clutter-0.8.4/tests/conform/test-clutter-text.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-clutter-text.c 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,431 @@ +#include +#include +#include + +#include "test-conform-common.h" + +typedef struct { + gunichar unichar; + const char bytes[6]; + gint nbytes; +} TestData; + +static const TestData +test_text_data[] = { + { 0xe4, "\xc3\xa4", 2 }, /* LATIN SMALL LETTER A WITH DIAERESIS */ + { 0x2665, "\xe2\x99\xa5", 3 } /* BLACK HEART SUIT */ +}; + +void +test_text_utf8_validation (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + int i; + + for (i = 0; i < G_N_ELEMENTS (test_text_data); i++) + { + const TestData *t = &test_text_data[i]; + gunichar unichar; + char bytes[6]; + int nbytes; + + g_assert (g_unichar_validate (t->unichar)); + + nbytes = g_unichar_to_utf8 (t->unichar, bytes); + bytes[nbytes] = '\0'; + g_assert (nbytes == t->nbytes); + g_assert (memcmp (t->bytes, bytes, nbytes) == 0); + + unichar = g_utf8_get_char_validated (bytes, nbytes); + g_assert (unichar == t->unichar); + } +} + +static int +get_nbytes (ClutterText *text) +{ + const char *s = clutter_text_get_text (text); + return strlen (s); +} + +static int +get_nchars (ClutterText *text) +{ + const char *s = clutter_text_get_text (text); + g_assert (g_utf8_validate (s, -1, NULL)); + return g_utf8_strlen (s, -1); +} + +#define DONT_MOVE_CURSOR (-2) + +static void +insert_unichar (ClutterText *text, gunichar unichar, int position) +{ + if (position > DONT_MOVE_CURSOR) + { + clutter_text_set_cursor_position (text, position); + g_assert_cmpint (clutter_text_get_cursor_position (text), ==, position); + } + + clutter_text_insert_unichar (text, unichar); +} + +void +test_text_empty (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterText *text = CLUTTER_TEXT (clutter_text_new ()); + + g_assert_cmpstr (clutter_text_get_text (text), ==, ""); + g_assert_cmpint (*clutter_text_get_text (text), ==, '\0'); + g_assert_cmpint (clutter_text_get_cursor_position (text), ==, -1); + + clutter_actor_destroy (CLUTTER_ACTOR (text)); +} + +void +test_text_set_empty (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterText *text = CLUTTER_TEXT (clutter_text_new ()); + + /* annoyingly slightly different from initially empty */ + clutter_text_set_text (text, ""); + g_assert_cmpint (get_nchars (text), ==, 0); + g_assert_cmpint (get_nbytes (text), ==, 0); + g_assert_cmpint (clutter_text_get_cursor_position (text), ==, -1); + + clutter_actor_destroy (CLUTTER_ACTOR (text)); +} + +void +test_text_set_text (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterText *text = CLUTTER_TEXT (clutter_text_new ()); + + clutter_text_set_text (text, "abcdef"); + g_assert_cmpint (get_nchars (text), ==, 6); + g_assert_cmpint (get_nbytes (text), ==, 6); + g_assert_cmpint (clutter_text_get_cursor_position (text), ==, -1); + + clutter_text_set_cursor_position (text, 5); + g_assert_cmpint (clutter_text_get_cursor_position (text), ==, 5); + + /* FIXME: cursor position should be -1? + clutter_text_set_text (text, ""); + g_assert_cmpint (clutter_text_get_cursor_position (text), ==, -1); + */ + + clutter_actor_destroy (CLUTTER_ACTOR (text)); +} + +void +test_text_append_some (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterText *text = CLUTTER_TEXT (clutter_text_new ()); + int i; + + for (i = 0; i < G_N_ELEMENTS (test_text_data); i++) + { + const TestData *t = &test_text_data[i]; + int j; + + for (j = 1; j <= 4; j++) + { + insert_unichar (text, t->unichar, DONT_MOVE_CURSOR); + + g_assert_cmpint (get_nchars (text), ==, j); + g_assert_cmpint (get_nbytes (text), ==, j * t->nbytes); + g_assert_cmpint (clutter_text_get_cursor_position (text), ==, -1); + } + + clutter_text_set_text (text, ""); + } + + clutter_actor_destroy (CLUTTER_ACTOR (text)); +} + +void +test_text_prepend_some (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterText *text = CLUTTER_TEXT (clutter_text_new ()); + int i; + + for (i = 0; i < G_N_ELEMENTS (test_text_data); i++) + { + const TestData *t = &test_text_data[i]; + int j; + + clutter_text_insert_unichar (text, t->unichar); + + g_assert_cmpint (get_nchars (text), ==, 1); + g_assert_cmpint (get_nbytes (text), ==, 1 * t->nbytes); + g_assert_cmpint (clutter_text_get_cursor_position (text), ==, -1); + + for (j = 2; j <= 4; j++) + { + insert_unichar (text, t->unichar, 0); + + g_assert_cmpint (get_nchars (text), ==, j); + g_assert_cmpint (get_nbytes (text), ==, j * t->nbytes); + g_assert_cmpint (clutter_text_get_cursor_position (text), ==, 1); + } + + clutter_text_set_text (text, ""); + } + + clutter_actor_destroy (CLUTTER_ACTOR (text)); +} + +void +test_text_insert (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterText *text = CLUTTER_TEXT (clutter_text_new ()); + int i; + + for (i = 0; i < G_N_ELEMENTS (test_text_data); i++) + { + const TestData *t = &test_text_data[i]; + + clutter_text_insert_unichar (text, t->unichar); + clutter_text_insert_unichar (text, t->unichar); + + insert_unichar (text, t->unichar, 1); + + g_assert_cmpint (get_nchars (text), ==, 3); + g_assert_cmpint (get_nbytes (text), ==, 3 * t->nbytes); + g_assert_cmpint (clutter_text_get_cursor_position (text), ==, 2); + + clutter_text_set_text (text, ""); + } + + clutter_actor_destroy (CLUTTER_ACTOR (text)); +} + +void +test_text_delete_chars (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterText *text = CLUTTER_TEXT (clutter_text_new ()); + int i; + + for (i = 0; i < G_N_ELEMENTS (test_text_data); i++) + { + const TestData *t = &test_text_data[i]; + int j; + + for (j = 0; j < 4; j++) + clutter_text_insert_unichar (text, t->unichar); + + clutter_text_set_cursor_position (text, 2); + clutter_text_delete_chars (text, 1); + g_assert_cmpint (get_nchars (text), ==, 3); + g_assert_cmpint (get_nbytes (text), ==, 3 * t->nbytes); + g_assert_cmpint (clutter_text_get_cursor_position (text), ==, 1); + + clutter_text_set_cursor_position (text, 2); + clutter_text_delete_chars (text, 1); + g_assert_cmpint (get_nchars (text), ==, 2); + g_assert_cmpint (get_nbytes (text), ==, 2 * t->nbytes); + g_assert_cmpint (clutter_text_get_cursor_position (text), ==, 1); + + clutter_text_set_text (text, ""); + } + + clutter_actor_destroy (CLUTTER_ACTOR (text)); +} + +void +test_text_get_chars (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterText *text = CLUTTER_TEXT (clutter_text_new ()); + gchar *chars; + + clutter_text_set_text (text, "00abcdef11"); + g_assert_cmpint (get_nchars (text), ==, 10); + g_assert_cmpint (get_nbytes (text), ==, 10); + g_assert_cmpstr (clutter_text_get_text (text), ==, "00abcdef11"); + + chars = clutter_text_get_chars (text, 2, -1); + g_assert_cmpstr (chars, ==, "abcdef11"); + g_free (chars); + + chars = clutter_text_get_chars (text, 0, 8); + g_assert_cmpstr (chars, ==, "00abcdef"); + g_free (chars); + + chars = clutter_text_get_chars (text, 2, 8); + g_assert_cmpstr (chars, ==, "abcdef"); + g_free (chars); + + chars = clutter_text_get_chars (text, 8, 12); + g_assert_cmpstr (chars, ==, "11"); + g_free (chars); + + clutter_actor_destroy (CLUTTER_ACTOR (text)); +} + +void +test_text_delete_text (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterText *text = CLUTTER_TEXT (clutter_text_new ()); + int i; + + for (i = 0; i < G_N_ELEMENTS (test_text_data); i++) + { + const TestData *t = &test_text_data[i]; + int j; + + for (j = 0; j < 4; j++) + clutter_text_insert_unichar (text, t->unichar); + + clutter_text_set_cursor_position (text, 3); + clutter_text_delete_text (text, 2, 4); + + g_assert_cmpint (get_nchars (text), ==, 2); + g_assert_cmpint (get_nbytes (text), ==, 2 * t->nbytes); + + /* FIXME: cursor position should be -1? + g_assert_cmpint (clutter_text_get_cursor_position (text), ==, -1); + */ + + clutter_text_set_text (text, ""); + } + + clutter_actor_destroy (CLUTTER_ACTOR (text)); +} + +void +test_text_password_char (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterText *text = CLUTTER_TEXT (clutter_text_new ()); + + g_assert_cmpint (clutter_text_get_password_char (text), ==, 0); + + clutter_text_set_text (text, "hello"); + g_assert_cmpstr (clutter_text_get_text (text), ==, "hello"); + + clutter_text_set_password_char (text, '*'); + g_assert_cmpint (clutter_text_get_password_char (text), ==, '*'); + + g_assert_cmpstr (clutter_text_get_text (text), ==, "hello"); + + clutter_actor_destroy (CLUTTER_ACTOR (text)); +} + +static void +init_event (ClutterKeyEvent *event) +{ + event->type = CLUTTER_KEY_PRESS; + event->time = 0; /* not needed */ + event->flags = CLUTTER_EVENT_FLAG_SYNTHETIC; + event->stage = NULL; /* not needed */ + event->source = NULL; /* not needed */ + event->modifier_state = 0; + event->hardware_keycode = 0; /* not needed */ +} + +static void +send_keyval (ClutterText *text, int keyval) +{ + ClutterKeyEvent event; + + init_event (&event); + event.keyval = keyval; + event.unicode_value = 0; /* should be ignored for cursor keys etc. */ + + clutter_actor_event (CLUTTER_ACTOR (text), (ClutterEvent *) &event, FALSE); +} + +static void +send_unichar (ClutterText *text, gunichar unichar) +{ + ClutterKeyEvent event; + + init_event (&event); + event.keyval = 0; /* should be ignored for printable characters */ + event.unicode_value = unichar; + + clutter_actor_event (CLUTTER_ACTOR (text), (ClutterEvent *) &event, FALSE); +} + +void +test_text_cursor (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterText *text = CLUTTER_TEXT (clutter_text_new ()); + int i; + + /* only editable entries listen to events */ + clutter_text_set_editable (text, TRUE); + + for (i = 0; i < G_N_ELEMENTS (test_text_data); i++) + { + const TestData *t = &test_text_data[i]; + int j; + + for (j = 0; j < 4; ++j) + clutter_text_insert_unichar (text, t->unichar); + + clutter_text_set_cursor_position (text, 2); + + /* test cursor moves and is clamped */ + send_keyval (text, CLUTTER_Left); + g_assert_cmpint (clutter_text_get_cursor_position (text), ==, 1); + + send_keyval (text, CLUTTER_Left); + g_assert_cmpint (clutter_text_get_cursor_position (text), ==, 0); + + send_keyval (text, CLUTTER_Left); + g_assert_cmpint (clutter_text_get_cursor_position (text), ==, 0); + + /* delete text containing the cursor */ + clutter_text_set_cursor_position (text, 3); + g_assert_cmpint (clutter_text_get_cursor_position (text), ==, 3); + + clutter_text_delete_text (text, 2, 4); + send_keyval (text, CLUTTER_Left); + + /* FIXME: cursor position should be -1? + g_assert_cmpint (clutter_text_get_cursor_position (text), ==, -1); + */ + + clutter_text_set_text (text, ""); + } + + clutter_actor_destroy (CLUTTER_ACTOR (text)); +} + +void +test_text_event (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterText *text = CLUTTER_TEXT (clutter_text_new ()); + int i; + + /* only editable entries listen to events */ + clutter_text_set_editable (text, TRUE); + + for (i = 0; i < G_N_ELEMENTS (test_text_data); i++) + { + const TestData *t = &test_text_data[i]; + + send_unichar (text, t->unichar); + + g_assert_cmpint (get_nchars (text), ==, 1); + g_assert_cmpint (get_nbytes (text), ==, 1 * t->nbytes); + g_assert_cmpint (clutter_text_get_cursor_position (text), ==, -1); + + clutter_text_set_text (text, ""); + } + + clutter_actor_destroy (CLUTTER_ACTOR (text)); +} + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-conform-common.c /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-conform-common.c --- clutter-0.8.4/tests/conform/test-conform-common.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-conform-common.c 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,42 @@ +#include + +#include "test-conform-common.h" + +/** + * test_conform_simple_fixture_setup: + * + * Initialise stuff before each test is run + */ +void +test_conform_simple_fixture_setup (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + /* const TestConformSharedState *shared_state = data; */ + ClutterActor *stage = clutter_stage_get_default (); + GList *actors = clutter_container_get_children (CLUTTER_CONTAINER (stage)); + GList *tmp; + + /* To help reduce leakage between unit tests, we destroy all children of the stage */ + for (tmp = actors; tmp != NULL; tmp = tmp->next) + { + ClutterActor *leaked_actor = tmp->data; + + if (g_test_verbose ()) + g_print ("Freeing leaked actor %p\n", leaked_actor); + clutter_actor_destroy (leaked_actor); + } +} + + +/** + * test_conform_simple_fixture_teardown: + * + * Cleanup stuff after each test has finished + */ +void +test_conform_simple_fixture_teardown (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + /* const TestConformSharedState *shared_state = data; */ +} + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-conform-common.h /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-conform-common.h --- clutter-0.8.4/tests/conform/test-conform-common.h 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-conform-common.h 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,25 @@ + +/* Stuff you put in here is setup once in main() and gets passed around to + * all test functions and fixture setup/teardown functions in the data + * argument */ +typedef struct _TestConformSharedState +{ + int *argc_addr; + char ***argv_addr; +} TestConformSharedState; + + +/* This fixture structure is allocated by glib, and before running each test + * the test_conform_simple_fixture_setup func (see below) is called to + * initialise it, and test_conform_simple_fixture_teardown is called when + * the test is finished. */ +typedef struct _TestConformSimpleFixture +{ + /**/ +} TestConformSimpleFixture; + +void test_conform_simple_fixture_setup (TestConformSimpleFixture *fixture, + gconstpointer data); +void test_conform_simple_fixture_teardown (TestConformSimpleFixture *fixture, + gconstpointer data); + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-conform-main.c /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-conform-main.c --- clutter-0.8.4/tests/conform/test-conform-main.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-conform-main.c 2009-01-28 16:47:03.000000000 +0000 @@ -0,0 +1,114 @@ +#include "config.h" + +#include + +#include +#include + +#include "test-conform-common.h" + + +/* This is a bit of sugar for adding new conformance tests: + * + * - It adds an extern function definition just to save maintaining a header + * that lists test entry points. + * - It sets up callbacks for a fixture, which lets us share initialization + * *code* between tests. (see test-conform-common.c) + * - It passes in a shared *data* pointer that is initialised once in main(), + * that gets passed to the fixture setup and test functions. (See the + * definition in test-conform-common.h) + */ +#define TEST_CONFORM_SIMPLE(NAMESPACE, FUNC) \ + extern void FUNC (TestConformSimpleFixture *fixture, gconstpointer data); \ + g_test_add ("/conform" NAMESPACE "/" #FUNC, \ + TestConformSimpleFixture, \ + shared_state, /* data argument for test */ \ + test_conform_simple_fixture_setup, \ + FUNC, \ + test_conform_simple_fixture_teardown); + + +int +main (int argc, char **argv) +{ + TestConformSharedState *shared_state = g_new0 (TestConformSharedState, 1); + const gchar *display; + +#ifdef HAVE_CLUTTER_GLX + /* on X11 we need a display connection to run the test suite */ + display = g_getenv ("DISPLAY"); + if (!display || *display == '\0') + { + g_print ("No DISPLAY found. Unable to run the conformance " + "test suite without a display."); + return EXIT_SUCCESS; + } +#endif + + g_test_init (&argc, &argv, NULL); + + g_test_bug_base ("http://bugzilla.openedhand.com/show_bug.cgi?id=%s"); + + g_assert (clutter_init (shared_state->argc_addr, shared_state->argv_addr) + == CLUTTER_INIT_SUCCESS); + + /* Initialise the state you need to share with everything. + */ + shared_state->argc_addr = &argc; + shared_state->argv_addr = &argv; + + TEST_CONFORM_SIMPLE ("/timeline", test_timeline); + if (g_test_slow ()) + { + TEST_CONFORM_SIMPLE ("/timeline", test_timeline_dup_frames); + TEST_CONFORM_SIMPLE ("/timeline", test_timeline_interpolate); + TEST_CONFORM_SIMPLE ("/timeline", test_timeline_rewind); + TEST_CONFORM_SIMPLE ("/timeline", test_timeline_smoothness); + } + + TEST_CONFORM_SIMPLE ("/picking", test_pick); + + /* ClutterText */ + TEST_CONFORM_SIMPLE ("/text", test_text_utf8_validation); + TEST_CONFORM_SIMPLE ("/text", test_text_empty); + TEST_CONFORM_SIMPLE ("/text", test_text_set_empty); + TEST_CONFORM_SIMPLE ("/text", test_text_set_text); + TEST_CONFORM_SIMPLE ("/text", test_text_append_some); + TEST_CONFORM_SIMPLE ("/text", test_text_prepend_some); + TEST_CONFORM_SIMPLE ("/text", test_text_insert); + TEST_CONFORM_SIMPLE ("/text", test_text_delete_chars); + TEST_CONFORM_SIMPLE ("/text", test_text_delete_text); + TEST_CONFORM_SIMPLE ("/text", test_text_cursor); + TEST_CONFORM_SIMPLE ("/text", test_text_event); + TEST_CONFORM_SIMPLE ("/text", test_text_get_chars); + TEST_CONFORM_SIMPLE ("/text", test_text_cache); + TEST_CONFORM_SIMPLE ("/text", test_text_password_char); + + TEST_CONFORM_SIMPLE ("/rectangle", test_rect_set_size); + TEST_CONFORM_SIMPLE ("/rectangle", test_rect_set_color); + + TEST_CONFORM_SIMPLE ("/fixed", test_fixed_constants); + + TEST_CONFORM_SIMPLE ("/invariants", test_initial_state); + TEST_CONFORM_SIMPLE ("/invariants", test_realized); + TEST_CONFORM_SIMPLE ("/invariants", test_mapped); + TEST_CONFORM_SIMPLE ("/invariants", test_show_on_set_parent); + + TEST_CONFORM_SIMPLE ("/vertex-buffer", test_vertex_buffer_contiguous); + TEST_CONFORM_SIMPLE ("/vertex-buffer", test_vertex_buffer_interleved); + TEST_CONFORM_SIMPLE ("/vertex-buffer", test_vertex_buffer_mutability); + + TEST_CONFORM_SIMPLE ("/opacity", test_label_opacity); + TEST_CONFORM_SIMPLE ("/opacity", test_rectangle_opacity); + TEST_CONFORM_SIMPLE ("/opacity", test_paint_opacity); + + TEST_CONFORM_SIMPLE ("/texture", test_backface_culling); + + TEST_CONFORM_SIMPLE ("/path", test_path); + + TEST_CONFORM_SIMPLE ("/binding-pool", test_binding_pool); + + TEST_CONFORM_SIMPLE ("/actor", test_anchors); + + return g_test_run (); +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-launcher.sh /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-launcher.sh --- clutter-0.8.4/tests/conform/test-launcher.sh 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-launcher.sh 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,24 @@ +#!/bin/sh + +UNIT_TEST_PATH=$1 + +test -z ${UNIT_TEST_PATH} && { + echo "Usage: $0 /path/to/unit_test" + exit 1 +} + +UNIT_TEST=`basename ${UNIT_TEST_PATH}` + +echo "Running: gtester -p ${UNIT_TEST_PATH} ./test-conformance" +echo "" +gtester -p ${UNIT_TEST_PATH} -m slow --verbose ./test-conformance + +echo "" +echo "NOTE: For debugging purposes, you can run this single test as follows:" +echo "$ libtool --mode=execute \\" +echo " gdb --eval-command=\"b ${UNIT_TEST}\" \\" +echo " --args ./test-conformance -p ${UNIT_TEST_PATH}" +echo "or:" +echo "$ env G_SLICE=always-malloc \\" +echo " libtool --mode=execute \\" +echo " valgrind ./test-conformance -p ${UNIT_TEST_PATH}" diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-paint-opacity.c /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-paint-opacity.c --- clutter-0.8.4/tests/conform/test-paint-opacity.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-paint-opacity.c 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,144 @@ +#include +#include + +#include "test-conform-common.h" + +void +test_label_opacity (TestConformSimpleFixture *fixture, + gpointer dummy) +{ + ClutterActor *stage; + ClutterActor *label; + ClutterColor label_color = { 255, 0, 0, 128 }; + ClutterColor color_check = { 0, }; + + stage = clutter_stage_get_default (); + + label = clutter_text_new_with_text ("Sans 18px", "Label, 50% opacity"); + clutter_text_set_color (CLUTTER_TEXT (label), &label_color); + + if (g_test_verbose ()) + g_print ("label 50%%.get_color()/1\n"); + clutter_text_get_color (CLUTTER_TEXT (label), &color_check); + g_assert (color_check.alpha == label_color.alpha); + + clutter_container_add (CLUTTER_CONTAINER (stage), label, NULL); + clutter_actor_set_position (label, 10, 10); + + if (g_test_verbose ()) + g_print ("label 50%%.get_color()/2\n"); + clutter_text_get_color (CLUTTER_TEXT (label), &color_check); + g_assert (color_check.alpha == label_color.alpha); + + if (g_test_verbose ()) + g_print ("label 50%%.get_paint_opacity()/1\n"); + g_assert (clutter_actor_get_paint_opacity (label) == 255); + + if (g_test_verbose ()) + g_print ("label 50%%.get_paint_opacity()/2\n"); + clutter_actor_set_opacity (label, 128); + g_assert (clutter_actor_get_paint_opacity (label) == 128); + + clutter_actor_destroy (label); +} + +void +test_rectangle_opacity (TestConformSimpleFixture *fixture, + gpointer dummy) +{ + ClutterActor *stage; + ClutterActor *rect; + ClutterColor rect_color = { 0, 0, 255, 255 }; + ClutterColor color_check = { 0, }; + + stage = clutter_stage_get_default (); + + rect = clutter_rectangle_new_with_color (&rect_color); + clutter_actor_set_size (rect, 128, 128); + clutter_actor_set_position (rect, 150, 90); + + if (g_test_verbose ()) + g_print ("rect 100%%.get_color()/1\n"); + clutter_rectangle_get_color (CLUTTER_RECTANGLE (rect), &color_check); + g_assert (color_check.alpha == rect_color.alpha); + + clutter_container_add (CLUTTER_CONTAINER (stage), rect, NULL); + + if (g_test_verbose ()) + g_print ("rect 100%%.get_color()/2\n"); + clutter_rectangle_get_color (CLUTTER_RECTANGLE (rect), &color_check); + g_assert (color_check.alpha == rect_color.alpha); + + if (g_test_verbose ()) + g_print ("rect 100%%.get_paint_opacity()\n"); + g_assert (clutter_actor_get_paint_opacity (rect) == 255); + + clutter_actor_destroy (rect); +} + +void +test_paint_opacity (TestConformSimpleFixture *fixture, + gpointer dummy) +{ + ClutterActor *stage, *group1, *group2; + ClutterActor *label, *rect; + ClutterColor label_color = { 255, 0, 0, 128 }; + ClutterColor rect_color = { 0, 0, 255, 255 }; + ClutterColor color_check = { 0, }; + + stage = clutter_stage_get_default (); + + group1 = clutter_group_new (); + clutter_actor_set_opacity (group1, 128); + clutter_container_add (CLUTTER_CONTAINER (stage), group1, NULL); + clutter_actor_set_position (group1, 10, 30); + clutter_actor_show (group1); + + label = clutter_text_new_with_text ("Sans 18px", "Label+Group, 25% opacity"); + clutter_text_set_color (CLUTTER_TEXT (label), &label_color); + + if (g_test_verbose ()) + g_print ("label 50%% + group 50%%.get_color()/1\n"); + clutter_text_get_color (CLUTTER_TEXT (label), &color_check); + g_assert (color_check.alpha == label_color.alpha); + + clutter_container_add (CLUTTER_CONTAINER (group1), label, NULL); + + if (g_test_verbose ()) + g_print ("label 50%% + group 50%%.get_color()/2\n"); + clutter_text_get_color (CLUTTER_TEXT (label), &color_check); + g_assert (color_check.alpha == label_color.alpha); + + if (g_test_verbose ()) + g_print ("label 50%% + group 50%%.get_paint_opacity() = 128\n"); + g_assert (clutter_actor_get_paint_opacity (label) == 128); + + clutter_actor_destroy (label); + + group2 = clutter_group_new (); + clutter_container_add (CLUTTER_CONTAINER (group1), group2, NULL); + clutter_actor_set_position (group2, 10, 60); + + rect = clutter_rectangle_new_with_color (&rect_color); + clutter_actor_set_size (rect, 128, 128); + + if (g_test_verbose ()) + g_print ("rect 100%% + group 100%% + group 50%%.get_color()/1\n"); + clutter_rectangle_get_color (CLUTTER_RECTANGLE (rect), &color_check); + g_assert (color_check.alpha == rect_color.alpha); + + clutter_container_add (CLUTTER_CONTAINER (group2), rect, NULL); + + if (g_test_verbose ()) + g_print ("rect 100%% + group 100%% + group 50%%.get_color()/2\n"); + clutter_rectangle_get_color (CLUTTER_RECTANGLE (rect), &color_check); + g_assert (color_check.alpha == rect_color.alpha); + + if (g_test_verbose ()) + g_print ("rect 100%%.get_paint_opacity()\n"); + g_assert (clutter_actor_get_paint_opacity (rect) == 128); + + clutter_actor_destroy (rect); + clutter_actor_destroy (group2); + clutter_actor_destroy (group1); +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-path.c /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-path.c --- clutter-0.8.4/tests/conform/test-path.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-path.c 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,704 @@ +#include +#include +#include +#include + +#include "test-conform-common.h" + +#define MAX_NODES 128 + +#define FLOAT_FUZZ_AMOUNT 5.0f + +typedef struct _CallbackData CallbackData; + +typedef gboolean (* PathTestFunc) (CallbackData *data); + +static void compare_node (const ClutterPathNode *node, gpointer data_p); + +struct _CallbackData +{ + ClutterPath *path; + + guint n_nodes; + ClutterPathNode nodes[MAX_NODES]; + + gboolean nodes_different; + guint nodes_found; +}; + +static const char path_desc[] = + "M 21 22 " + "L 25 26 " + "C 29 30 31 32 33 34 " + "m 23 24 " + "l 27 28 " + "c 35 36 37 38 39 40 " + "z"; +static const ClutterPathNode path_nodes[] = + { { CLUTTER_PATH_MOVE_TO, { { 21, 22 }, { 0, 0 }, { 0, 0 } } }, + { CLUTTER_PATH_LINE_TO, { { 25, 26 }, { 0, 0 }, { 0, 0 } } }, + { CLUTTER_PATH_CURVE_TO, { { 29, 30 }, { 31, 32 }, { 33, 34 } } }, + { CLUTTER_PATH_REL_MOVE_TO, { { 23, 24 }, { 0, 0 }, { 0, 0 } } }, + { CLUTTER_PATH_REL_LINE_TO, { { 27, 28 }, { 0, 0 }, { 0, 0 } } }, + { CLUTTER_PATH_REL_CURVE_TO, { { 35, 36 }, { 37, 38 }, { 39, 40 } } }, + { CLUTTER_PATH_CLOSE, { { 0, 0 }, { 0, 0 }, { 0, 0 } } } }; + +static gboolean +path_test_add_move_to (CallbackData *data) +{ + ClutterPathNode node; + + node.type = CLUTTER_PATH_MOVE_TO; + node.points[0].x = 1; + node.points[0].y = 2; + + clutter_path_add_move_to (data->path, node.points[0].x, node.points[0].y); + + data->nodes[data->n_nodes++] = node; + + return TRUE; +} + +static gboolean +path_test_add_line_to (CallbackData *data) +{ + ClutterPathNode node; + + node.type = CLUTTER_PATH_LINE_TO; + node.points[0].x = 3; + node.points[0].y = 4; + + clutter_path_add_line_to (data->path, node.points[0].x, node.points[0].y); + + data->nodes[data->n_nodes++] = node; + + return TRUE; +} + +static gboolean +path_test_add_curve_to (CallbackData *data) +{ + ClutterPathNode node; + + node.type = CLUTTER_PATH_CURVE_TO; + node.points[0].x = 5; + node.points[0].y = 6; + node.points[1].x = 7; + node.points[1].y = 8; + node.points[2].x = 9; + node.points[2].y = 10; + + clutter_path_add_curve_to (data->path, + node.points[0].x, node.points[0].y, + node.points[1].x, node.points[1].y, + node.points[2].x, node.points[2].y); + + data->nodes[data->n_nodes++] = node; + + return TRUE; +} + +static gboolean +path_test_add_close (CallbackData *data) +{ + ClutterPathNode node; + + node.type = CLUTTER_PATH_CLOSE; + + clutter_path_add_close (data->path); + + data->nodes[data->n_nodes++] = node; + + return TRUE; +} + +static gboolean +path_test_add_rel_move_to (CallbackData *data) +{ + ClutterPathNode node; + + node.type = CLUTTER_PATH_REL_MOVE_TO; + node.points[0].x = 11; + node.points[0].y = 12; + + clutter_path_add_rel_move_to (data->path, node.points[0].x, node.points[0].y); + + data->nodes[data->n_nodes++] = node; + + return TRUE; +} + +static gboolean +path_test_add_rel_line_to (CallbackData *data) +{ + ClutterPathNode node; + + node.type = CLUTTER_PATH_REL_LINE_TO; + node.points[0].x = 13; + node.points[0].y = 14; + + clutter_path_add_rel_line_to (data->path, node.points[0].x, node.points[0].y); + + data->nodes[data->n_nodes++] = node; + + return TRUE; +} + +static gboolean +path_test_add_rel_curve_to (CallbackData *data) +{ + ClutterPathNode node; + + node.type = CLUTTER_PATH_REL_CURVE_TO; + node.points[0].x = 15; + node.points[0].y = 16; + node.points[1].x = 17; + node.points[1].y = 18; + node.points[2].x = 19; + node.points[2].y = 20; + + clutter_path_add_rel_curve_to (data->path, + node.points[0].x, node.points[0].y, + node.points[1].x, node.points[1].y, + node.points[2].x, node.points[2].y); + + data->nodes[data->n_nodes++] = node; + + return TRUE; +} + +static gboolean +path_test_add_string (CallbackData *data) +{ + int i; + + for (i = 0; i < G_N_ELEMENTS (path_nodes); i++) + data->nodes[data->n_nodes++] = path_nodes[i]; + + clutter_path_add_string (data->path, path_desc); + + return TRUE; +} + +static gboolean +path_test_add_node_by_struct (CallbackData *data) +{ + int i; + + for (i = 0; i < G_N_ELEMENTS (path_nodes); i++) + { + data->nodes[data->n_nodes++] = path_nodes[i]; + clutter_path_add_node (data->path, path_nodes + i); + } + + return TRUE; +} + +static gboolean +path_test_get_n_nodes (CallbackData *data) +{ + return clutter_path_get_n_nodes (data->path) == data->n_nodes; +} + +static gboolean +path_test_get_node (CallbackData *data) +{ + int i; + + data->nodes_found = 0; + data->nodes_different = FALSE; + + for (i = 0; i < data->n_nodes; i++) + { + ClutterPathNode node; + + clutter_path_get_node (data->path, i, &node); + + compare_node (&node, data); + } + + return !data->nodes_different; +} + +static gboolean +path_test_get_nodes (CallbackData *data) +{ + GSList *list, *node; + + data->nodes_found = 0; + data->nodes_different = FALSE; + + list = clutter_path_get_nodes (data->path); + + for (node = list; node; node = node->next) + compare_node (node->data, data); + + g_slist_free (list); + + return !data->nodes_different && data->nodes_found == data->n_nodes; +} + +static gboolean +path_test_insert_beginning (CallbackData *data) +{ + ClutterPathNode node; + + node.type = CLUTTER_PATH_LINE_TO; + node.points[0].x = 41; + node.points[0].y = 42; + + memmove (data->nodes + 1, data->nodes, + data->n_nodes++ * sizeof (ClutterPathNode)); + data->nodes[0] = node; + + clutter_path_insert_node (data->path, 0, &node); + + return TRUE; +} + +static gboolean +path_test_insert_end (CallbackData *data) +{ + ClutterPathNode node; + + node.type = CLUTTER_PATH_LINE_TO; + node.points[0].x = 43; + node.points[0].y = 44; + + data->nodes[data->n_nodes++] = node; + + clutter_path_insert_node (data->path, -1, &node); + + return TRUE; +} + +static gboolean +path_test_insert_middle (CallbackData *data) +{ + ClutterPathNode node; + int pos = data->n_nodes / 2; + + node.type = CLUTTER_PATH_LINE_TO; + node.points[0].x = 45; + node.points[0].y = 46; + + memmove (data->nodes + pos + 1, data->nodes + pos, + (data->n_nodes - pos) * sizeof (ClutterPathNode)); + data->nodes[pos] = node; + data->n_nodes++; + + clutter_path_insert_node (data->path, pos, &node); + + return TRUE; +} + +static gboolean +path_test_clear (CallbackData *data) +{ + clutter_path_clear (data->path); + + data->n_nodes = 0; + + return TRUE; +} + +static gboolean +path_test_clear_insert (CallbackData *data) +{ + return path_test_clear (data) && path_test_insert_middle (data); +} + +static gboolean +path_test_remove_beginning (CallbackData *data) +{ + memmove (data->nodes, data->nodes + 1, + --data->n_nodes * sizeof (ClutterPathNode)); + + clutter_path_remove_node (data->path, 0); + + return TRUE; +} + +static gboolean +path_test_remove_end (CallbackData *data) +{ + clutter_path_remove_node (data->path, --data->n_nodes); + + return TRUE; +} + +static gboolean +path_test_remove_middle (CallbackData *data) +{ + int pos = data->n_nodes / 2; + + memmove (data->nodes + pos, data->nodes + pos + 1, + (--data->n_nodes - pos) * sizeof (ClutterPathNode)); + + clutter_path_remove_node (data->path, pos); + + return TRUE; +} + +static gboolean +path_test_remove_only (CallbackData *data) +{ + return path_test_clear (data) + && path_test_add_line_to (data) + && path_test_remove_beginning (data); +} + +static gboolean +path_test_replace (CallbackData *data) +{ + ClutterPathNode node; + int pos = data->n_nodes / 2; + + node.type = CLUTTER_PATH_LINE_TO; + node.points[0].x = 47; + node.points[0].y = 48; + + data->nodes[pos] = node; + + clutter_path_replace_node (data->path, pos, &node); + + return TRUE; +} + +static gboolean +path_test_set_description (CallbackData *data) +{ + data->n_nodes = G_N_ELEMENTS (path_nodes); + memcpy (data->nodes, path_nodes, sizeof (path_nodes)); + + return clutter_path_set_description (data->path, path_desc); +} + +static gboolean +path_test_get_description (CallbackData *data) +{ + char *desc1, *desc2; + gboolean ret = TRUE; + + desc1 = clutter_path_get_description (data->path); + clutter_path_clear (data->path); + if (!clutter_path_set_description (data->path, desc1)) + ret = FALSE; + desc2 = clutter_path_get_description (data->path); + + if (strcmp (desc1, desc2)) + ret = FALSE; + + g_free (desc1); + g_free (desc2); + + return ret; +} + +static gboolean +path_test_convert_to_cairo_path (CallbackData *data) +{ + cairo_surface_t *surface; + cairo_t *cr; + cairo_path_t *cpath; + guint i, j; + ClutterKnot path_start = { 0, 0 }, last_point = { 0, 0 }; + + /* Create a temporary image surface and context to hold the cairo + path */ + surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 10, 10); + cr = cairo_create (surface); + + /* Convert to a cairo path */ + clutter_path_to_cairo_path (data->path, cr); + + /* Get a copy of the cairo path data */ + cpath = cairo_copy_path (cr); + + /* Convert back to a clutter path */ + clutter_path_clear (data->path); + clutter_path_add_cairo_path (data->path, cpath); + + /* The relative nodes will have been converted to absolute so we + need to reflect this in the node array for comparison */ + for (i = 0; i < data->n_nodes; i++) + { + switch (data->nodes[i].type) + { + case CLUTTER_PATH_MOVE_TO: + path_start = last_point = data->nodes[i].points[0]; + break; + + case CLUTTER_PATH_LINE_TO: + last_point = data->nodes[i].points[0]; + break; + + case CLUTTER_PATH_CURVE_TO: + last_point = data->nodes[i].points[2]; + break; + + case CLUTTER_PATH_REL_MOVE_TO: + last_point.x += data->nodes[i].points[0].x; + last_point.y += data->nodes[i].points[0].y; + data->nodes[i].points[0] = last_point; + data->nodes[i].type = CLUTTER_PATH_MOVE_TO; + path_start = last_point; + break; + + case CLUTTER_PATH_REL_LINE_TO: + last_point.x += data->nodes[i].points[0].x; + last_point.y += data->nodes[i].points[0].y; + data->nodes[i].points[0] = last_point; + data->nodes[i].type = CLUTTER_PATH_LINE_TO; + break; + + case CLUTTER_PATH_REL_CURVE_TO: + for (j = 0; j < 3; j++) + { + data->nodes[i].points[j].x += last_point.x; + data->nodes[i].points[j].y += last_point.y; + } + last_point = data->nodes[i].points[2]; + data->nodes[i].type = CLUTTER_PATH_CURVE_TO; + break; + + case CLUTTER_PATH_CLOSE: + last_point = path_start; + + /* Cairo always adds a move to after every close so we need + to insert one here */ + memmove (data->nodes + i + 2, data->nodes + i + 1, + (data->n_nodes - i - 1) * sizeof (ClutterPathNode)); + data->nodes[i + 1].type = CLUTTER_PATH_MOVE_TO; + data->nodes[i + 1].points[0] = last_point; + data->n_nodes++; + break; + } + } + + /* Free the cairo resources */ + cairo_path_destroy (cpath); + cairo_destroy (cr); + cairo_surface_destroy (surface); + + return TRUE; +} + +static gboolean +float_fuzzy_equals (float fa, float fb) +{ + return fabs (fa - fb) <= FLOAT_FUZZ_AMOUNT; +} + +static void +set_triangle_path (CallbackData *data) +{ + /* Triangular shaped path hitting (0,0), (64,64) and (128,0) in four + parts. The two curves are actually straight lines */ + static const ClutterPathNode nodes[] = + { { CLUTTER_PATH_MOVE_TO, { { 0, 0 } } }, + { CLUTTER_PATH_LINE_TO, { { 32, 32 } } }, + { CLUTTER_PATH_CURVE_TO, { { 40, 40 }, { 56, 56 }, { 64, 64 } } }, + { CLUTTER_PATH_REL_CURVE_TO, { { 8, -8 }, { 24, -24 }, { 32, -32 } } }, + { CLUTTER_PATH_REL_LINE_TO, { { 32, -32 } } } }; + gint i; + + clutter_path_clear (data->path); + + for (i = 0; i < G_N_ELEMENTS (nodes); i++) + clutter_path_add_node (data->path, nodes + i); + + memcpy (data->nodes, nodes, sizeof (nodes)); + data->n_nodes = G_N_ELEMENTS (nodes); +} + +static gboolean +path_test_get_position (CallbackData *data) +{ + static const float values[] = { 0.125f, 16.0f, 16.0f, + 0.375f, 48.0f, 48.0f, + 0.625f, 80.0f, 48.0f, + 0.875f, 112.0f, 16.0f }; + gint i; + + set_triangle_path (data); + + for (i = 0; i < G_N_ELEMENTS (values); i += 3) + { + ClutterKnot pos; + + clutter_path_get_position (data->path, + values[i], + &pos); + + if (!float_fuzzy_equals (values[i + 1], pos.x) + || !float_fuzzy_equals (values[i + 2], pos.y)) + return FALSE; + } + + return TRUE; +} + +static gboolean +path_test_get_length (CallbackData *data) +{ + const float actual_length /* sqrt(64**2 + 64**2) * 2 */ = 181.019336f; + guint approx_length; + + set_triangle_path (data); + + g_object_get (data->path, "length", &approx_length, NULL); + + /* Allow 15% margin of error */ + return fabs (approx_length - actual_length) / actual_length <= 0.15f; +} + +static gboolean +path_test_boxed_type (CallbackData *data) +{ + gboolean ret = TRUE; + GSList *nodes, *l; + GValue value; + + nodes = clutter_path_get_nodes (data->path); + + memset (&value, 0, sizeof (value)); + + for (l = nodes; l; l = l->next) + { + g_value_init (&value, CLUTTER_TYPE_PATH_NODE); + + g_value_set_boxed (&value, l->data); + + if (!clutter_path_node_equal (l->data, + g_value_get_boxed (&value))) + ret = FALSE; + + g_value_unset (&value); + } + + g_slist_free (nodes); + + return ret; +} + +static const struct +{ + const char *desc; + PathTestFunc func; +} +path_tests[] = + { + { "Add line to", path_test_add_line_to }, + { "Add move to", path_test_add_move_to }, + { "Add curve to", path_test_add_curve_to }, + { "Add close", path_test_add_close }, + { "Add relative line to", path_test_add_rel_line_to }, + { "Add relative move to", path_test_add_rel_move_to }, + { "Add relative curve to", path_test_add_rel_curve_to }, + { "Add string", path_test_add_string }, + { "Add node by struct", path_test_add_node_by_struct }, + { "Get number of nodes", path_test_get_n_nodes }, + { "Get a node", path_test_get_node }, + { "Get all nodes", path_test_get_nodes }, + { "Insert at beginning", path_test_insert_beginning }, + { "Insert at end", path_test_insert_end }, + { "Insert at middle", path_test_insert_middle }, + { "Add after insert", path_test_add_line_to }, + { "Clear then insert", path_test_clear_insert }, + { "Add string again", path_test_add_string }, + { "Remove from beginning", path_test_remove_beginning }, + { "Remove from end", path_test_remove_end }, + { "Remove from middle", path_test_remove_middle }, + { "Add after remove", path_test_add_line_to }, + { "Remove only node", path_test_remove_only }, + { "Add after remove again", path_test_add_line_to }, + { "Replace a node", path_test_replace }, + { "Set description", path_test_set_description }, + { "Get description", path_test_get_description }, + { "Convert to cairo path and back", path_test_convert_to_cairo_path }, + { "Clear", path_test_clear }, + { "Get position", path_test_get_position }, + { "Check node boxed type", path_test_boxed_type }, + { "Get length", path_test_get_length } + }; + +static void +compare_node (const ClutterPathNode *node, gpointer data_p) +{ + CallbackData *data = data_p; + + if (data->nodes_found >= data->n_nodes) + data->nodes_different = TRUE; + else + { + guint n_points = 0, i; + const ClutterPathNode *onode = data->nodes + data->nodes_found; + + if (node->type != onode->type) + data->nodes_different = TRUE; + + switch (node->type & ~CLUTTER_PATH_RELATIVE) + { + case CLUTTER_PATH_MOVE_TO: n_points = 1; break; + case CLUTTER_PATH_LINE_TO: n_points = 1; break; + case CLUTTER_PATH_CURVE_TO: n_points = 3; break; + case CLUTTER_PATH_CLOSE: n_points = 0; break; + + default: + data->nodes_different = TRUE; + break; + } + + for (i = 0; i < n_points; i++) + if (node->points[i].x != onode->points[i].x + || node->points[i].y != onode->points[i].y) + { + data->nodes_different = TRUE; + break; + } + } + + data->nodes_found++; +} + +static gboolean +compare_nodes (CallbackData *data) +{ + data->nodes_different = FALSE; + data->nodes_found = 0; + + clutter_path_foreach (data->path, compare_node, data); + + return !data->nodes_different && data->nodes_found == data->n_nodes; +} + +void +test_path (TestConformSimpleFixture *fixture, + gconstpointer _data) +{ + CallbackData data; + gint i; + + memset (&data, 0, sizeof (data)); + + data.path = clutter_path_new (); + + for (i = 0; i < G_N_ELEMENTS (path_tests); i++) + { + gboolean succeeded; + + if (g_test_verbose ()) + g_print ("%s... ", path_tests[i].desc); + + succeeded = path_tests[i].func (&data) && compare_nodes (&data); + + if (g_test_verbose ()) + g_print ("%s\n", succeeded ? "ok" : "FAIL"); + + g_assert (succeeded); + } + + g_object_unref (data.path); +} + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-pick.c /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-pick.c --- clutter-0.8.4/tests/conform/test-pick.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-pick.c 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,109 @@ +#include + +#include "test-conform-common.h" + +#define STAGE_WIDTH 320 +#define STAGE_HEIGHT 200 +#define ACTORS_X 12 +#define ACTORS_Y 16 + +typedef struct _State State; + +struct _State +{ + ClutterActor *stage; + int y, x; + guint32 gids[ACTORS_X * ACTORS_Y]; + guint actor_width, actor_height; + gboolean pass; +}; + +static gboolean +on_timeout (State *state) +{ + int y, x; + + for (y = 0; y < ACTORS_Y; y++) + for (x = 0; x < ACTORS_X; x++) + { + gboolean pass = FALSE; + guint32 gid; + ClutterActor *actor + = clutter_stage_get_actor_at_pos (CLUTTER_STAGE (state->stage), + x * state->actor_width + + state->actor_width / 2, + y * state->actor_height + + state->actor_height / 2); + + if (g_test_verbose ()) + g_print ("actor %u -> ", state->gids[y * ACTORS_X + x]); + + if (actor == NULL) + { + if (g_test_verbose ()) + g_print ("NULL: FAIL\n"); + } + else + { + gid = clutter_actor_get_gid (actor); + if (gid == state->gids[y * ACTORS_X + x]) + pass = TRUE; + + if (g_test_verbose ()) + g_print ("% 8i: %s\n", gid, pass ? "pass" : "FAIL"); + } + + if (!pass) + state->pass = FALSE; + } + + clutter_main_quit (); + + return FALSE; +} + +void +test_pick (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + int y, x; + State state; + + state.pass = TRUE; + + state.stage = clutter_stage_get_default (); + + clutter_actor_set_size (state.stage, STAGE_WIDTH, STAGE_HEIGHT); + state.actor_width = STAGE_WIDTH / ACTORS_X; + state.actor_height = STAGE_HEIGHT / ACTORS_Y; + + for (y = 0; y < ACTORS_Y; y++) + for (x = 0; x < ACTORS_X; x++) + { + ClutterColor color = { x * 255 / (ACTORS_X - 1), + y * 255 / (ACTORS_Y - 1), + 128, 255 }; + ClutterGeometry geom = { x * state.actor_width, y * state.actor_height, + state.actor_width, state.actor_height }; + ClutterActor *rect = clutter_rectangle_new_with_color (&color); + + clutter_actor_set_geometry (rect, &geom); + + clutter_container_add (CLUTTER_CONTAINER (state.stage), rect, NULL); + + state.gids[y * ACTORS_X + x] = clutter_actor_get_gid (rect); + } + + clutter_actor_show (state.stage); + + g_timeout_add (250, (GSourceFunc) on_timeout, &state); + + clutter_main (); + + + if (g_test_verbose ()) + g_print ("end result: %s\n", state.pass ? "pass" : "FAIL"); + + g_assert (state.pass); +} + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-text-cache.c /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-text-cache.c --- clutter-0.8.4/tests/conform/test-text-cache.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-text-cache.c 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,286 @@ +#include +#include +#include + +#include "test-conform-common.h" + +#define TEST_FONT "Sans 10" + +static const char long_text[] = + "This is some REALLY " + "long text that contains markup for testing the use_markup " + "property and to test word-wrapping, justification and alignment."; + +typedef struct _CallbackData CallbackData; + +struct _CallbackData +{ + ClutterActor *stage; + ClutterActor *label; + + PangoLayout *old_layout; + gboolean layout_changed; + PangoRectangle label_extents; + + PangoLayout *test_layout; + + gboolean test_failed; +}; + +static void +on_paint (ClutterActor *label, CallbackData *data) +{ + PangoLayout *new_layout; + + /* Check whether the layout used for this paint is different from + the layout used for the last paint */ + new_layout = clutter_text_get_layout (CLUTTER_TEXT (data->label)); + data->layout_changed = data->old_layout != new_layout; + + if (data->old_layout) + g_object_unref (data->old_layout); + /* Keep a reference to the old layout so we can be sure it won't + just reallocate a new layout with the same address */ + data->old_layout = g_object_ref (new_layout); + + pango_layout_get_extents (new_layout, NULL, &data->label_extents); +} + +static void +force_redraw (CallbackData *data) +{ + clutter_redraw (CLUTTER_STAGE (clutter_actor_get_stage (data->label))); +} + +static gboolean +check_result (CallbackData *data, const char *note, + gboolean layout_should_change) +{ + PangoRectangle test_extents; + gboolean fail = FALSE; + + if (g_test_verbose ()) + g_print ("%s: ", note); + + /* Force a redraw to get the on_paint handler to run */ + force_redraw (data); + + /* Compare the extents from the label with the extents from our test + layout */ + pango_layout_get_extents (data->test_layout, NULL, &test_extents); + if (memcmp (&test_extents, &data->label_extents, sizeof (PangoRectangle))) + { + if (g_test_verbose ()) + g_print ("extents are different: expected: %d, %d, %d, %d " + "-> text: %d, %d, %d, %d\n", + test_extents.x / 1024, + test_extents.y / 1024, + test_extents.width / 1024, + test_extents.height / 1024, + data->label_extents.x / 1024, + data->label_extents.y / 1024, + data->label_extents.width / 1024, + data->label_extents.height / 1024); + + fail = TRUE; + } + else + { + if (g_test_verbose ()) + g_print ("extents are the same, "); + } + + if (data->layout_changed) + { + if (g_test_verbose ()) + g_print ("layout changed, "); + } + else + { + if (g_test_verbose ()) + g_print ("layout did not change, "); + } + + if (data->layout_changed != layout_should_change) + fail = TRUE; + + if (fail) + { + if (g_test_verbose ()) + g_print ("FAIL\n"); + + data->test_failed = TRUE; + } + else + { + if (g_test_verbose ()) + g_print ("pass\n"); + } + + return fail; +} + +static gboolean +do_tests (CallbackData *data) +{ + PangoFontDescription *fd; + static const ClutterColor red = { 0xff, 0x00, 0x00, 0xff }; + PangoAttrList *attr_list, *attr_list_copy; + PangoAttribute *attr; + + /* TEST 1: change the text */ + clutter_text_set_text (CLUTTER_TEXT (data->label), "Counter 0"); + pango_layout_set_text (data->test_layout, "Counter 0", -1); + g_assert (check_result (data, "Change text", TRUE) == FALSE); + + /* TEST 2: change a single character */ + clutter_text_set_text (CLUTTER_TEXT (data->label), "Counter 1"); + pango_layout_set_text (data->test_layout, "Counter 1", -1); + g_assert (check_result (data, "Change a single character", TRUE) == FALSE); + + /* TEST 3: move the label */ + clutter_actor_set_position (data->label, 10, 0); + g_assert (check_result (data, "Move the label", FALSE) == FALSE); + + /* TEST 4: change the font */ + clutter_text_set_font_name (CLUTTER_TEXT (data->label), "Serif 15"); + fd = pango_font_description_from_string ("Serif 15"); + pango_layout_set_font_description (data->test_layout, fd); + pango_font_description_free (fd); + g_assert (check_result (data, "Change the font", TRUE) == FALSE); + + /* TEST 5: change the color */ + clutter_text_set_color (CLUTTER_TEXT (data->label), &red); + g_assert (check_result (data, "Change the color", FALSE) == FALSE); + + /* TEST 6: change the attributes */ + attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD); + attr->start_index = 0; + attr->end_index = 2; + attr_list = pango_attr_list_new (); + pango_attr_list_insert (attr_list, attr); + attr_list_copy = pango_attr_list_copy (attr_list); + clutter_text_set_attributes (CLUTTER_TEXT (data->label), attr_list); + pango_layout_set_attributes (data->test_layout, attr_list_copy); + pango_attr_list_unref (attr_list_copy); + pango_attr_list_unref (attr_list); + g_assert (check_result (data, "Change the attributes", TRUE) == FALSE); + + /* TEST 7: change the text again */ + clutter_text_set_attributes (CLUTTER_TEXT (data->label), NULL); + clutter_text_set_text (CLUTTER_TEXT (data->label), long_text); + pango_layout_set_attributes (data->test_layout, NULL); + pango_layout_set_text (data->test_layout, long_text, -1); + g_assert (check_result (data, "Change the text again", TRUE) == FALSE); + + /* TEST 8: enable markup */ + clutter_text_set_use_markup (CLUTTER_TEXT (data->label), TRUE); + pango_layout_set_markup (data->test_layout, long_text, -1); + g_assert (check_result (data, "Enable markup", TRUE) == FALSE); + + /* This part can't be a test because Clutter won't restrict the + width if wrapping and ellipsizing is disabled so the extents will + be different, but we still want to do it for the later tests */ + clutter_actor_set_width (data->label, 200); + pango_layout_set_width (data->test_layout, 200 * PANGO_SCALE); + /* Force a redraw so that changing the width won't affect the + results */ + force_redraw (data); + + /* TEST 9: enable ellipsize */ + clutter_text_set_ellipsize (CLUTTER_TEXT (data->label), + PANGO_ELLIPSIZE_END); + pango_layout_set_ellipsize (data->test_layout, PANGO_ELLIPSIZE_END); + g_assert (check_result (data, "Enable ellipsize", TRUE) == FALSE); + clutter_text_set_ellipsize (CLUTTER_TEXT (data->label), + PANGO_ELLIPSIZE_NONE); + pango_layout_set_ellipsize (data->test_layout, PANGO_ELLIPSIZE_NONE); + force_redraw (data); + + /* TEST 10: enable line wrap */ + clutter_text_set_line_wrap (CLUTTER_TEXT (data->label), TRUE); + pango_layout_set_wrap (data->test_layout, PANGO_WRAP_WORD); + g_assert (check_result (data, "Enable line wrap", TRUE) == FALSE); + + /* TEST 11: change wrap mode */ + clutter_text_set_line_wrap_mode (CLUTTER_TEXT (data->label), + PANGO_WRAP_CHAR); + pango_layout_set_wrap (data->test_layout, PANGO_WRAP_CHAR); + g_assert (check_result (data, "Change wrap mode", TRUE) == FALSE); + + /* TEST 12: enable justify */ + clutter_text_set_justify (CLUTTER_TEXT (data->label), TRUE); + pango_layout_set_justify (data->test_layout, TRUE); + /* Pango appears to have a bug which means that you can't change the + justification after setting the text but this fixes it. + See http://bugzilla.gnome.org/show_bug.cgi?id=551865 */ + pango_layout_context_changed (data->test_layout); + g_assert (check_result (data, "Enable justify", TRUE) == FALSE); + + /* TEST 13: change alignment */ + clutter_text_set_alignment (CLUTTER_TEXT (data->label), PANGO_ALIGN_RIGHT); + pango_layout_set_alignment (data->test_layout, PANGO_ALIGN_RIGHT); + g_assert (check_result (data, "Change alignment", TRUE) == FALSE); + + clutter_main_quit (); + + return FALSE; +} + +static PangoLayout * +make_layout_like_label (ClutterText *label) +{ + PangoLayout *label_layout, *new_layout; + PangoContext *context; + PangoFontDescription *fd; + + /* Make another layout using the same context as the layout from the + label */ + label_layout = clutter_text_get_layout (label); + context = pango_layout_get_context (label_layout); + new_layout = pango_layout_new (context); + fd = pango_font_description_from_string (TEST_FONT); + pango_layout_set_font_description (new_layout, fd); + pango_font_description_free (fd); + + return new_layout; +} + +void +test_text_cache (TestConformSimpleFixture *fixture, + gconstpointer _data) +{ + CallbackData data; + + memset (&data, 0, sizeof (data)); + + data.stage = clutter_stage_get_default (); + + data.label = clutter_text_new_with_text (TEST_FONT, ""); + + data.test_layout = make_layout_like_label (CLUTTER_TEXT (data.label)); + + g_signal_connect (data.label, "paint", G_CALLBACK (on_paint), &data); + + clutter_container_add (CLUTTER_CONTAINER (data.stage), data.label, NULL); + + clutter_actor_show (data.stage); + + clutter_threads_add_idle ((GSourceFunc) do_tests, &data); + + clutter_main (); + + if (g_test_verbose ()) + g_print ("\nOverall result: "); + + if (g_test_verbose ()) + { + if (data.test_failed) + g_print ("FAIL\n"); + else + g_print ("pass\n"); + } + else + g_assert (data.test_failed != TRUE); +} + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-timeline.c /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-timeline.c --- clutter-0.8.4/tests/conform/test-timeline.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-timeline.c 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,296 @@ +#include +#include +#include +#include + +#include "test-conform-common.h" + +/* This test runs three timelines at 30 fps with 10 frames. Some of + the timelines have markers. Once the timelines are run it then + checks that all of the frames were hit, all of the markers were hit + and that the completed signal was fired. The timelines are then run + again but this time with a timeout source that introduces a + delay. This should cause some frames to be skipped. The test is run + again but only the markers and the completed signal is checked + for. */ + +#define FRAME_COUNT 10 + +typedef struct _TimelineData TimelineData; + +struct _TimelineData +{ + int timeline_num; + + guint frame_hit_count[FRAME_COUNT + 1]; + GSList *markers_hit; + guint completed_count; +}; + +static void +timeline_data_init (TimelineData *data, int timeline_num) +{ + memset (data, 0, sizeof (TimelineData)); + data->timeline_num = timeline_num; +} + +static void +timeline_data_destroy (TimelineData *data) +{ + g_slist_foreach (data->markers_hit, (GFunc) g_free, NULL); + g_slist_free (data->markers_hit); +} + +static void +timeline_complete_cb (ClutterTimeline *timeline, + TimelineData *data) +{ + if (g_test_verbose ()) + g_print ("%i: Completed\n", data->timeline_num); + + data->completed_count++; +} + +static void +timeline_new_frame_cb (ClutterTimeline *timeline, + gint frame_no, + TimelineData *data) +{ + if (g_test_verbose ()) + g_print ("%i: Doing frame %d, delta = %i\n", + data->timeline_num, frame_no, + clutter_timeline_get_delta (timeline, NULL)); + data->frame_hit_count[frame_no]++; +} + +static void +timeline_marker_reached_cb (ClutterTimeline *timeline, + const gchar *marker_name, + guint frame_num, + TimelineData *data) +{ + if (g_test_verbose ()) + g_print ("%i: Marker `%s' (%d) reached, delta = %i\n", + data->timeline_num, marker_name, frame_num, + clutter_timeline_get_delta (timeline, NULL)); + data->markers_hit = g_slist_prepend (data->markers_hit, + g_strdup (marker_name)); +} + +static gboolean +check_timeline (ClutterTimeline *timeline, + TimelineData *data, + gboolean check_missed_frames) +{ + gchar **markers; + gsize n_markers; + guint *marker_reached_count; + gboolean succeeded = TRUE; + GSList *node; + int i; + int missed_frame_count = 0; + int frame_offset; + + if (clutter_timeline_get_direction (timeline) == CLUTTER_TIMELINE_BACKWARD) + frame_offset = 0; + else + frame_offset = 1; + + markers = clutter_timeline_list_markers (timeline, -1, &n_markers); + marker_reached_count = g_new0 (guint, n_markers); + + for (node = data->markers_hit; node; node = node->next) + { + for (i = 0; i < n_markers; i++) + if (!strcmp (node->data, markers[i])) + break; + + if (i < n_markers) + marker_reached_count[i]++; + else + { + if (g_test_verbose ()) + g_print ("FAIL: unknown marker '%s' hit for %i\n", + (char *) node->data, data->timeline_num); + succeeded = FALSE; + } + } + + for (i = 0; i < n_markers; i++) + if (marker_reached_count[i] != 1) + { + if (g_test_verbose ()) + g_print ("FAIL: marker '%s' hit %i times for %i\n", + markers[i], marker_reached_count[i], data->timeline_num); + succeeded = FALSE; + } + + if (check_missed_frames) + { + for (i = 0; i < FRAME_COUNT; i++) + if (data->frame_hit_count[i + frame_offset] != 1) + missed_frame_count++; + + if (missed_frame_count) + { + if (g_test_verbose ()) + g_print ("FAIL: missed %i frame%s for %i\n", + missed_frame_count, missed_frame_count == 1 ? "" : "s", + data->timeline_num); + succeeded = FALSE; + } + } + + if (data->completed_count != 1) + { + if (g_test_verbose ()) + g_print ("FAIL: timeline %i completed %i times\n", + data->timeline_num, data->completed_count); + succeeded = FALSE; + } + + g_strfreev (markers); + g_free (marker_reached_count); + + return succeeded; +} + +static gboolean +timeout_cb (gpointer data) +{ + clutter_main_quit (); + + return FALSE; +} + +static gboolean +delay_cb (gpointer data) +{ + /* Waste a bit of time so that it will skip frames */ + g_usleep (G_USEC_PER_SEC * 66 / 1000); + + return TRUE; +} + +void +test_timeline (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterTimeline *timeline_1; + TimelineData data_1; + ClutterTimeline *timeline_2; + TimelineData data_2; + ClutterTimeline *timeline_3; + TimelineData data_3; + gchar **markers; + gsize n_markers; + guint delay_tag; + + timeline_data_init (&data_1, 1); + timeline_1 = clutter_timeline_new (FRAME_COUNT, 30); + clutter_timeline_add_marker_at_frame (timeline_1, "foo", 5); + clutter_timeline_add_marker_at_frame (timeline_1, "bar", 5); + clutter_timeline_add_marker_at_frame (timeline_1, "baz", 5); + clutter_timeline_add_marker_at_frame (timeline_1, "near-end-marker", 9); + clutter_timeline_add_marker_at_frame (timeline_1, "end-marker", 10); + markers = clutter_timeline_list_markers (timeline_1, 5, &n_markers); + g_assert (markers != NULL); + g_assert (n_markers == 3); + g_strfreev (markers); + + timeline_data_init (&data_2, 2); + timeline_2 = clutter_timeline_clone (timeline_1); + clutter_timeline_add_marker_at_frame (timeline_2, "bar", 2); + markers = clutter_timeline_list_markers (timeline_2, -1, &n_markers); + g_assert (markers != NULL); + g_assert (n_markers == 1); + g_assert (strcmp (markers[0], "bar") == 0); + g_strfreev (markers); + + timeline_data_init (&data_3, 3); + timeline_3 = clutter_timeline_clone (timeline_1); + clutter_timeline_set_direction (timeline_3, CLUTTER_TIMELINE_BACKWARD); + clutter_timeline_add_marker_at_frame (timeline_3, "foo", 5); + clutter_timeline_add_marker_at_frame (timeline_3, "baz", 8); + clutter_timeline_add_marker_at_frame (timeline_3, "near-end-marker", 1); + clutter_timeline_add_marker_at_frame (timeline_3, "end-marker", 0); + + g_signal_connect (timeline_1, + "marker-reached", G_CALLBACK (timeline_marker_reached_cb), + &data_1); + g_signal_connect (timeline_1, + "new-frame", G_CALLBACK (timeline_new_frame_cb), + &data_1); + g_signal_connect (timeline_1, + "completed", G_CALLBACK (timeline_complete_cb), + &data_1); + + g_signal_connect (timeline_2, + "marker-reached::bar", + G_CALLBACK (timeline_marker_reached_cb), + &data_2); + g_signal_connect (timeline_2, + "new-frame", G_CALLBACK (timeline_new_frame_cb), + &data_2); + g_signal_connect (timeline_2, + "completed", G_CALLBACK (timeline_complete_cb), + &data_2); + + g_signal_connect (timeline_3, + "marker-reached", G_CALLBACK (timeline_marker_reached_cb), + &data_3); + g_signal_connect (timeline_3, + "new-frame", G_CALLBACK (timeline_new_frame_cb), + &data_3); + g_signal_connect (timeline_3, + "completed", G_CALLBACK (timeline_complete_cb), + &data_3); + + if (g_test_verbose ()) + g_print ("Without delay...\n"); + + clutter_timeline_start (timeline_1); + clutter_timeline_start (timeline_2); + clutter_timeline_start (timeline_3); + + clutter_threads_add_timeout (2000, timeout_cb, NULL); + + clutter_main (); + + g_assert (check_timeline (timeline_1, &data_1, TRUE)); + g_assert (check_timeline (timeline_2, &data_2, TRUE)); + g_assert (check_timeline (timeline_3, &data_3, TRUE)); + + if (g_test_verbose ()) + g_print ("With delay...\n"); + + timeline_data_destroy (&data_1); + timeline_data_init (&data_1, 1); + timeline_data_destroy (&data_2); + timeline_data_init (&data_2, 2); + timeline_data_destroy (&data_3); + timeline_data_init (&data_3, 3); + + clutter_timeline_start (timeline_1); + clutter_timeline_start (timeline_2); + clutter_timeline_start (timeline_3); + + clutter_threads_add_timeout (2000, timeout_cb, NULL); + delay_tag = clutter_threads_add_timeout (99, delay_cb, NULL); + + clutter_main (); + + g_assert (check_timeline (timeline_1, &data_1, FALSE)); + g_assert (check_timeline (timeline_2, &data_2, FALSE)); + g_assert (check_timeline (timeline_3, &data_3, FALSE)); + + g_object_unref (timeline_1); + g_object_unref (timeline_2); + g_object_unref (timeline_3); + + timeline_data_destroy (&data_1); + timeline_data_destroy (&data_2); + timeline_data_destroy (&data_3); + + g_source_remove (delay_tag); +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-timeline-dup-frames.c /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-timeline-dup-frames.c --- clutter-0.8.4/tests/conform/test-timeline-dup-frames.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-timeline-dup-frames.c 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,101 @@ +#include +#include +#include + +#include "test-conform-common.h" + +/* We use a nice slow timeline for this test since we + * dont want the timeouts to interpolate the timeline + * forward multiple frames */ +#define TEST_TIMELINE_FPS 10 +#define TEST_TIMELINE_FRAME_COUNT 20 + +typedef struct _TestState { + ClutterTimeline *timeline; + gint prev_frame; + gint completion_count; + gint passed; +}TestState; + + +static void +new_frame_cb (ClutterTimeline *timeline, + gint frame_num, + TestState *state) +{ + gint current_frame = clutter_timeline_get_current_frame (state->timeline); + + if (state->prev_frame + != clutter_timeline_get_current_frame (state->timeline)) + { + g_test_message ("timeline previous frame=%-4i " + "actual frame=%-4i (OK)\n", + state->prev_frame, + current_frame); + } + else + { + g_test_message ("timeline previous frame=%-4i " + "actual frame=%-4i (FAILED)\n", + state->prev_frame, + current_frame); + + state->passed = FALSE; + } + + state->prev_frame = current_frame; +} + + +static void +completed_cb (ClutterTimeline *timeline, + TestState *state) +{ + state->completion_count++; + + if (state->completion_count == 2) + { + if (state->passed) + { + g_test_message ("Passed\n"); + clutter_main_quit (); + } + else + { + g_test_message ("Failed\n"); + exit (EXIT_FAILURE); + } + } +} + + +void +test_timeline_dup_frames (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + TestState state; + + state.timeline = + clutter_timeline_new (TEST_TIMELINE_FRAME_COUNT, + TEST_TIMELINE_FPS); + clutter_timeline_set_loop (state.timeline, TRUE); + g_signal_connect (G_OBJECT(state.timeline), + "new-frame", + G_CALLBACK(new_frame_cb), + &state); + g_signal_connect (G_OBJECT(state.timeline), + "completed", + G_CALLBACK(completed_cb), + &state); + + state.prev_frame = -1; + state.completion_count = 0; + state.passed = TRUE; + + clutter_timeline_start (state.timeline); + + clutter_main(); + + g_object_unref (state.timeline); +} + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-timeline-interpolate.c /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-timeline-interpolate.c --- clutter-0.8.4/tests/conform/test-timeline-interpolate.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-timeline-interpolate.c 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,165 @@ +#include +#include +#include + +#include "test-conform-common.h" + +/* We ask for 1 frame per millisecond. + * Whenever this rate can't be achieved then the timeline + * will interpolate the number frames that should have + * passed between timeouts. */ +#define TEST_TIMELINE_FPS 1000 +#define TEST_TIMELINE_FRAME_COUNT 5000 + +/* We are at the mercy of the system scheduler so this + * may not be a very reliable tolerance. */ +#define TEST_ERROR_TOLERANCE 20 + +typedef struct _TestState { + ClutterTimeline *timeline; + GTimeVal start_time; + guint new_frame_counter; + gint expected_frame; + gint completion_count; + gboolean passed; +}TestState; + + +static void +new_frame_cb (ClutterTimeline *timeline, + gint frame_num, + TestState *state) +{ + GTimeVal current_time; + gint current_frame; + glong msec_diff; + gint loop_overflow = 0; + static gint step = 1; + + g_get_current_time (¤t_time); + + current_frame = clutter_timeline_get_current_frame (state->timeline); + + msec_diff = (current_time.tv_sec - state->start_time.tv_sec) * 1000; + msec_diff += (current_time.tv_usec - state->start_time.tv_usec)/1000; + + /* If we expect to have interpolated past the end of the timeline + * we keep track of the overflow so we can determine when + * the next timeout will happen. We then clip expected_frames + * to TEST_TIMELINE_FRAME_COUNT since clutter-timeline + * semantics guaranty this frame is always signaled before + * looping */ + if (state->expected_frame > TEST_TIMELINE_FRAME_COUNT) + { + loop_overflow = state->expected_frame - TEST_TIMELINE_FRAME_COUNT; + state->expected_frame = TEST_TIMELINE_FRAME_COUNT; + } + + if (current_frame >= (state->expected_frame-TEST_ERROR_TOLERANCE) + && current_frame <= (state->expected_frame+TEST_ERROR_TOLERANCE)) + { + g_test_message ("\nelapsed milliseconds=%-5li " + "expected frame=%-4i actual frame=%-4i (OK)\n", + msec_diff, + state->expected_frame, + current_frame); + } + else + { + g_test_message ("\nelapsed milliseconds=%-5li " + "expected frame=%-4i actual frame=%-4i (FAILED)\n", + msec_diff, + state->expected_frame, + current_frame); + state->passed = FALSE; + } + + if (step>0) + { + state->expected_frame = current_frame + (TEST_TIMELINE_FPS / 4); + g_test_message ("Sleeping for 250ms " + "so next frame should be (%i + %i) = %i\n", + current_frame, + (TEST_TIMELINE_FPS / 4), + state->expected_frame); + g_usleep (250000); + } + else + { + state->expected_frame = current_frame + TEST_TIMELINE_FPS; + g_test_message ("Sleeping for 1sec " + "so next frame should be (%i + %i) = %i\n", + current_frame, + TEST_TIMELINE_FPS, + state->expected_frame); + g_usleep (1000000); + } + + if (current_frame >= TEST_TIMELINE_FRAME_COUNT) + { + state->expected_frame += loop_overflow; + state->expected_frame -= TEST_TIMELINE_FRAME_COUNT; + g_test_message ("End of timeline reached: " + "Wrapping expected frame too %i\n", + state->expected_frame); + } + + state->new_frame_counter++; + step = -step; +} + + +static void +completed_cb (ClutterTimeline *timeline, + TestState *state) +{ + state->completion_count++; + + if (state->completion_count == 2) + { + if (state->passed) + { + g_test_message ("Passed\n"); + clutter_main_quit (); + } + else + { + g_test_message ("Failed\n"); + exit (EXIT_FAILURE); + } + } +} + + +void +test_timeline_interpolate (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + TestState state; + + state.timeline = + clutter_timeline_new (TEST_TIMELINE_FRAME_COUNT, + TEST_TIMELINE_FPS); + clutter_timeline_set_loop (state.timeline, TRUE); + g_signal_connect (G_OBJECT(state.timeline), + "new-frame", + G_CALLBACK(new_frame_cb), + &state); + g_signal_connect (G_OBJECT(state.timeline), + "completed", + G_CALLBACK(completed_cb), + &state); + + state.completion_count = 0; + state.new_frame_counter = 0; + state.passed = TRUE; + state.expected_frame = 0; + + g_get_current_time (&state.start_time); + clutter_timeline_start (state.timeline); + + clutter_main(); + + g_object_unref (state.timeline); +} + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-timeline-rewind.c /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-timeline-rewind.c --- clutter-0.8.4/tests/conform/test-timeline-rewind.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-timeline-rewind.c 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,98 @@ +#include +#include +#include + +#include "test-conform-common.h" + +#define TEST_TIMELINE_FPS 10 +#define TEST_TIMELINE_FRAME_COUNT 5 +#define TEST_WATCHDOG_KICK_IN_SECONDS 10 + +typedef struct _TestState { + ClutterTimeline *timeline; + gint rewind_count; +}TestState; + + +static gboolean +watchdog_timeout (TestState *state) +{ + g_test_message ("Watchdog timer kicking in\n"); + g_test_message ("rewind_count=%i\n", state->rewind_count); + if (state->rewind_count <= 3) + { + /* The test has hung */ + g_test_message ("Failed (This test shouldn't have hung!)\n"); + exit (EXIT_FAILURE); + } + else + { + g_test_message ("Passed\n"); + clutter_main_quit (); + } + + return FALSE; +} + + +static void +new_frame_cb (ClutterTimeline *timeline, + gint frame_num, + TestState *state) +{ + gint current_frame = clutter_timeline_get_current_frame (timeline); + + if (current_frame == TEST_TIMELINE_FRAME_COUNT) + { + g_test_message ("new-frame signal recieved (end of timeline)\n"); + g_test_message ("Rewinding timeline\n"); + clutter_timeline_rewind (timeline); + state->rewind_count++; + } + else + { + if (current_frame == 0) + { + g_test_message ("new-frame signal recieved (start of timeline)\n"); + } + else + { + g_test_message ("new-frame signal recieved (mid frame)\n"); + } + + if (state->rewind_count >= 2) + { + g_test_message ("Sleeping for 1 second\n"); + g_usleep (1000000); + } + } +} + + +void +test_timeline_rewind (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + TestState state; + + state.timeline = + clutter_timeline_new (TEST_TIMELINE_FRAME_COUNT, + TEST_TIMELINE_FPS); + g_signal_connect (G_OBJECT(state.timeline), + "new-frame", + G_CALLBACK(new_frame_cb), + &state); + g_test_message ("Installing a watchdog timeout " + "to determine if this test hangs\n"); + g_timeout_add (TEST_WATCHDOG_KICK_IN_SECONDS*1000, + (GSourceFunc)watchdog_timeout, + &state); + state.rewind_count = 0; + + clutter_timeline_start (state.timeline); + + clutter_main(); + + g_object_unref (state.timeline); +} + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-timeline-smoothness.c /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-timeline-smoothness.c --- clutter-0.8.4/tests/conform/test-timeline-smoothness.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-timeline-smoothness.c 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,115 @@ +#include +#include +#include + +#include "test-conform-common.h" + +#define TEST_TIMELINE_FPS 10 +#define TEST_TIMELINE_FRAME_COUNT 20 +#define TEST_ERROR_TOLERANCE 5 + +typedef struct _TestState { + ClutterTimeline *timeline; + GTimeVal start_time; + GTimeVal prev_frame_time; + guint frame; + gint completion_count; + gint passed; +}TestState; + + +static void +new_frame_cb (ClutterTimeline *timeline, + gint frame_num, + TestState *state) +{ + GTimeVal current_time; + glong total_elapsed_ms; + glong frame_elapsed_ms = 0; + gchar *bump = ""; + + g_get_current_time (¤t_time); + + total_elapsed_ms = (current_time.tv_sec - state->start_time.tv_sec) * 1000; + total_elapsed_ms += (current_time.tv_usec - state->start_time.tv_usec)/1000; + + if (state->frame>0) + { + frame_elapsed_ms = + (current_time.tv_sec - state->prev_frame_time.tv_sec) * 1000; + frame_elapsed_ms += + (current_time.tv_usec - state->prev_frame_time.tv_usec)/1000; + + if (ABS(frame_elapsed_ms - (1000/TEST_TIMELINE_FPS)) + > TEST_ERROR_TOLERANCE) + { + state->passed = FALSE; + bump = " (BUMP)"; + } + } + + g_test_message ("timeline frame=%-2d total elapsed=%-4li(ms) " + "since last frame=%-4li(ms)%s\n", + clutter_timeline_get_current_frame(state->timeline), + total_elapsed_ms, + frame_elapsed_ms, + bump); + + state->prev_frame_time = current_time; + state->frame++; +} + + +static void +completed_cb (ClutterTimeline *timeline, + TestState *state) +{ + state->completion_count++; + + if (state->completion_count == 2) + { + if (state->passed) + { + g_test_message ("Passed\n"); + clutter_main_quit (); + } + else + { + g_test_message ("Failed\n"); + exit (EXIT_FAILURE); + } + } +} + + +void +test_timeline_smoothness (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + TestState state; + + state.timeline = + clutter_timeline_new (TEST_TIMELINE_FRAME_COUNT, + TEST_TIMELINE_FPS); + clutter_timeline_set_loop (state.timeline, TRUE); + g_signal_connect (G_OBJECT(state.timeline), + "new-frame", + G_CALLBACK(new_frame_cb), + &state); + g_signal_connect (G_OBJECT(state.timeline), + "completed", + G_CALLBACK(completed_cb), + &state); + + state.frame = 0; + state.completion_count = 0; + state.passed = TRUE; + + g_get_current_time (&state.start_time); + clutter_timeline_start (state.timeline); + + clutter_main(); + + g_object_unref (state.timeline); +} + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-vertex-buffer-contiguous.c /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-vertex-buffer-contiguous.c --- clutter-0.8.4/tests/conform/test-vertex-buffer-contiguous.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-vertex-buffer-contiguous.c 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,195 @@ + +#include +#include + +#include "test-conform-common.h" + +/* This test verifies that the simplest usage of the vertex buffer API, + * where we add contiguous (x,y) GLfloat vertices, and RGBA GLubyte color + * attributes to a buffer, submit, and draw. + * + * It also tries to verify that the enable/disable attribute APIs are working + * too. + * + * If you want visual feedback of what this test paints for debugging purposes, + * then remove the call to clutter_main_quit() in validate_result. + */ + +typedef struct _TestState +{ + CoglHandle buffer; + ClutterGeometry stage_geom; + guint frame; +} TestState; + +static void +validate_result (TestState *state) +{ + GLubyte pixel[4]; + GLint y_off = state->stage_geom.height - 90; + + /* NB: glReadPixels is done in GL screen space so y = 0 is at the bottom */ + if (g_test_verbose ()) + g_print ("y_off = %d\n", y_off); + + /* NB: We ignore the alpha, since we don't know if our render target is + * RGB or RGBA */ + +#define RED 0 +#define GREEN 1 +#define BLUE 2 + + /* Should see a blue pixel */ + glReadPixels (10, y_off, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &pixel); + if (g_test_verbose ()) + g_print ("pixel 0 = %x, %x, %x\n", pixel[RED], pixel[GREEN], pixel[BLUE]); + g_assert (pixel[RED] == 0 && pixel[GREEN] == 0 && pixel[BLUE] != 0); + + /* Should see a red pixel */ + glReadPixels (110, y_off, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &pixel); + if (g_test_verbose ()) + g_print ("pixel 1 = %x, %x, %x\n", pixel[RED], pixel[GREEN], pixel[BLUE]); + g_assert (pixel[RED] != 0 && pixel[GREEN] == 0 && pixel[BLUE] == 0); + + /* Should see a blue pixel */ + glReadPixels (210, y_off, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &pixel); + if (g_test_verbose ()) + g_print ("pixel 2 = %x, %x, %x\n", pixel[RED], pixel[GREEN], pixel[BLUE]); + g_assert (pixel[RED] == 0 && pixel[GREEN] == 0 && pixel[BLUE] != 0); + +#undef RED +#undef GREEN +#undef BLUE + + /* Comment this out if you want visual feedback of what this test + * paints. + */ + clutter_main_quit (); +} + +static void +on_paint (ClutterActor *actor, TestState *state) +{ + /* Draw a faded blue triangle */ + cogl_vertex_buffer_enable (state->buffer, "gl_Color::blue"); + cogl_set_source_color4ub (0xff, 0x00, 0x00, 0xff); + cogl_vertex_buffer_draw (state->buffer, + GL_TRIANGLE_STRIP, /* mode */ + 0, /* first */ + 3); /* count */ + + /* Draw a red triangle */ + /* Here we are testing that the disable attribute works; if it doesn't + * the triangle will remain faded blue */ + cogl_translate (100, 0, 0); + cogl_vertex_buffer_disable (state->buffer, "gl_Color::blue"); + cogl_set_source_color4ub (0xff, 0x00, 0x00, 0xff); + cogl_vertex_buffer_draw (state->buffer, + GL_TRIANGLE_STRIP, /* mode */ + 0, /* first */ + 3); /* count */ + + /* Draw a faded blue triangle */ + /* Here we are testing that the re-enable works; if it doesn't + * the triangle will remain red */ + cogl_translate (100, 0, 0); + cogl_vertex_buffer_enable (state->buffer, "gl_Color::blue"); + cogl_set_source_color4ub (0xff, 0x00, 0x00, 0xff); + cogl_vertex_buffer_draw (state->buffer, + GL_TRIANGLE_STRIP, /* mode */ + 0, /* first */ + 3); /* count */ + + /* XXX: Experiments have shown that for some buggy drivers, when using + * glReadPixels there is some kind of race, so we delay our test for a + * few frames and a few seconds: + */ + if (state->frame >= 2) + validate_result (state); + else + g_usleep (G_USEC_PER_SEC); + + state->frame++; +} + +static gboolean +queue_redraw (gpointer stage) +{ + clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); + + return TRUE; +} + +void +test_vertex_buffer_contiguous (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + TestState state; + ClutterActor *stage; + ClutterColor stage_clr = {0x0, 0x0, 0x0, 0xff}; + ClutterActor *group; + guint idle_source; + + state.frame = 0; + + stage = clutter_stage_get_default (); + + clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_clr); + clutter_actor_get_geometry (stage, &state.stage_geom); + + group = clutter_group_new (); + clutter_actor_set_size (group, + state.stage_geom.width, + state.stage_geom.height); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), group); + + /* We force continuous redrawing of the stage, since we need to skip + * the first few frames, and we wont be doing anything else that + * will trigger redrawing. */ + idle_source = g_idle_add (queue_redraw, stage); + + g_signal_connect (group, "paint", G_CALLBACK (on_paint), &state); + + { + GLfloat triangle_verts[3][2] = + { + {0.0, 0.0}, + {100.0, 100.0}, + {0.0, 100.0} + }; + GLbyte triangle_colors[3][4] = + { + {0x00, 0x00, 0xff, 0xff}, /* blue */ + {0x00, 0x00, 0xff, 0x00}, /* transparent blue */ + {0x00, 0x00, 0xff, 0x00} /* transparent blue */ + }; + state.buffer = cogl_vertex_buffer_new (3 /* n vertices */); + cogl_vertex_buffer_add (state.buffer, + "gl_Vertex", + 2, /* n components */ + GL_FLOAT, + FALSE, /* normalized */ + 0, /* stride */ + triangle_verts); + cogl_vertex_buffer_add (state.buffer, + "gl_Color::blue", + 4, /* n components */ + GL_UNSIGNED_BYTE, + FALSE, /* normalized */ + 0, /* stride */ + triangle_colors); + cogl_vertex_buffer_submit (state.buffer); + } + + clutter_actor_show_all (stage); + + clutter_main (); + + cogl_vertex_buffer_unref (state.buffer); + + g_source_remove (idle_source); + + if (g_test_verbose ()) + g_print ("OK\n"); +} + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-vertex-buffer-interleved.c /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-vertex-buffer-interleved.c --- clutter-0.8.4/tests/conform/test-vertex-buffer-interleved.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-vertex-buffer-interleved.c 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,173 @@ + +#include +#include + +#include "test-conform-common.h" + +/* This test verifies that interleved attributes work with the vertex buffer + * API. We add (x,y) GLfloat vertices, interleved with RGBA GLubyte color + * attributes to a buffer, submit and draw. + * + * If you want visual feedback of what this test paints for debugging purposes, + * then remove the call to clutter_main_quit() in validate_result. + */ + +typedef struct _TestState +{ + CoglHandle buffer; + ClutterGeometry stage_geom; + guint frame; +} TestState; + +typedef struct _InterlevedVertex +{ + GLfloat x; + GLfloat y; + + GLubyte r; + GLubyte g; + GLubyte b; + GLubyte a; +} InterlevedVertex; + + +static void +validate_result (TestState *state) +{ + GLubyte pixel[4]; + GLint y_off = state->stage_geom.height - 90; + + /* NB: glReadPixels is done in GL screen space so y = 0 is at the bottom */ + + /* NB: We ignore the alpha, since we don't know if our render target is + * RGB or RGBA */ + +#define RED 0 +#define GREEN 1 +#define BLUE 2 + + /* Should see a blue pixel */ + glReadPixels (10, y_off, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &pixel); + if (g_test_verbose ()) + g_print ("pixel 0 = %x, %x, %x\n", pixel[RED], pixel[GREEN], pixel[BLUE]); + g_assert (pixel[RED] == 0 && pixel[GREEN] == 0 && pixel[BLUE] != 0); + +#undef RED +#undef GREEN +#undef BLUE + + /* Comment this out if you want visual feedback of what this test + * paints. + */ + clutter_main_quit (); +} + +static void +on_paint (ClutterActor *actor, TestState *state) +{ + /* Draw a faded blue triangle */ + cogl_vertex_buffer_draw (state->buffer, + GL_TRIANGLE_STRIP, /* mode */ + 0, /* first */ + 3); /* count */ + + /* XXX: Experiments have shown that for some buggy drivers, when using + * glReadPixels there is some kind of race, so we delay our test for a + * few frames and a few seconds: + */ + if (state->frame >= 2) + validate_result (state); + else + g_usleep (G_USEC_PER_SEC); + + state->frame++; +} + +static gboolean +queue_redraw (gpointer stage) +{ + clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); + + return TRUE; +} + +void +test_vertex_buffer_interleved (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + TestState state; + ClutterActor *stage; + ClutterColor stage_clr = {0x0, 0x0, 0x0, 0xff}; + ClutterActor *group; + guint idle_source; + + state.frame = 0; + + stage = clutter_stage_get_default (); + + clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_clr); + clutter_actor_get_geometry (stage, &state.stage_geom); + + group = clutter_group_new (); + clutter_actor_set_size (group, + state.stage_geom.width, + state.stage_geom.height); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), group); + + /* We force continuous redrawing of the stage, since we need to skip + * the first few frames, and we wont be doing anything else that + * will trigger redrawing. */ + idle_source = g_idle_add (queue_redraw, stage); + + g_signal_connect (group, "paint", G_CALLBACK (on_paint), &state); + + { + InterlevedVertex verts[3] = + { + { /* .x = */ 0.0, /* .y = */ 0.0, + /* blue */ + /* .r = */ 0x00, /* .g = */ 0x00, /* .b = */ 0xff, /* .a = */ 0xff }, + + { /* .x = */ 100.0, /* .y = */ 100.0, + /* transparent blue */ + /* .r = */ 0x00, /* .g = */ 0x00, /* .b = */ 0xff, /* .a = */ 0x00 }, + + { /* .x = */ 0.0, /* .y = */ 100.0, + /* transparent blue */ + /* .r = */ 0x00, /* .g = */ 0x00, /* .b = */ 0xff, /* .a = */ 0x00 }, + }; + + /* We assume the compiler is doing no funny struct padding for this test: + */ + g_assert (sizeof (InterlevedVertex) == 12); + + state.buffer = cogl_vertex_buffer_new (3 /* n vertices */); + cogl_vertex_buffer_add (state.buffer, + "gl_Vertex", + 2, /* n components */ + GL_FLOAT, + FALSE, /* normalized */ + 12, /* stride */ + &verts[0].x); + cogl_vertex_buffer_add (state.buffer, + "gl_Color", + 4, /* n components */ + GL_UNSIGNED_BYTE, + FALSE, /* normalized */ + 12, /* stride */ + &verts[0].r); + cogl_vertex_buffer_submit (state.buffer); + } + + clutter_actor_show_all (stage); + + clutter_main (); + + cogl_vertex_buffer_unref (state.buffer); + + g_source_remove (idle_source); + + if (g_test_verbose ()) + g_print ("OK\n"); +} + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/conform/test-vertex-buffer-mutability.c /tmp/VXszleoOf1/clutter-0.9.0/tests/conform/test-vertex-buffer-mutability.c --- clutter-0.8.4/tests/conform/test-vertex-buffer-mutability.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/conform/test-vertex-buffer-mutability.c 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,206 @@ + +#include +#include + +#include "test-conform-common.h" + +/* This test verifies that modifying a vertex buffer works, by updating + * vertex positions, and deleting and re-adding different color attributes. + * + * If you want visual feedback of what this test paints for debugging purposes, + * then remove the call to clutter_main_quit() in validate_result. + */ + +typedef struct _TestState +{ + CoglHandle buffer; + ClutterGeometry stage_geom; + guint frame; +} TestState; + +static void +validate_result (TestState *state) +{ + GLubyte pixel[4]; + GLint y_off = state->stage_geom.height - 90; + /* NB: glReadPixels is done in GL screen space so y = 0 is at the bottom */ + + /* NB: We ignore the alpha, since we don't know if our render target is + * RGB or RGBA */ + +#define RED 0 +#define GREEN 1 +#define BLUE 2 + + /* Should see a red pixel */ + glReadPixels (110, y_off, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &pixel); + if (g_test_verbose ()) + g_print ("pixel 0 = %x, %x, %x\n", pixel[RED], pixel[GREEN], pixel[BLUE]); + g_assert (pixel[RED] != 0 && pixel[GREEN] == 0 && pixel[BLUE] == 0); + + /* Should see a green pixel */ + glReadPixels (210, y_off, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &pixel); + if (g_test_verbose ()) + g_print ("pixel 1 = %x, %x, %x\n", pixel[RED], pixel[GREEN], pixel[BLUE]); + g_assert (pixel[RED] == 0 && pixel[GREEN] != 0 && pixel[BLUE] == 0); + +#undef RED +#undef GREEN +#undef BLUE + + /* Comment this out if you want visual feedback of what this test + * paints. + */ + clutter_main_quit (); +} + +static void +on_paint (ClutterActor *actor, TestState *state) +{ + GLfloat triangle_verts[3][2] = + { + {100.0, 0.0}, + {200.0, 100.0}, + {100.0, 100.0} + }; + GLbyte triangle_colors[3][4] = + { + {0x00, 0xff, 0x00, 0xff}, /* blue */ + {0x00, 0xff, 0x00, 0x00}, /* transparent blue */ + {0x00, 0xff, 0x00, 0x00} /* transparent blue */ + }; + + /* + * Draw a red triangle + */ + + cogl_set_source_color4ub (0xff, 0x00, 0x00, 0xff); + + cogl_vertex_buffer_add (state->buffer, + "gl_Vertex", + 2, /* n components */ + GL_FLOAT, + FALSE, /* normalized */ + 0, /* stride */ + triangle_verts); + cogl_vertex_buffer_delete (state->buffer, "gl_Color"); + cogl_vertex_buffer_submit (state->buffer); + + cogl_vertex_buffer_draw (state->buffer, + GL_TRIANGLE_STRIP, /* mode */ + 0, /* first */ + 3); /* count */ + + /* + * Draw a faded green triangle + */ + + cogl_vertex_buffer_add (state->buffer, + "gl_Color", + 4, /* n components */ + GL_UNSIGNED_BYTE, + FALSE, /* normalized */ + 0, /* stride */ + triangle_colors); + cogl_vertex_buffer_submit (state->buffer); + + cogl_translate (100, 0, 0); + cogl_vertex_buffer_draw (state->buffer, + GL_TRIANGLE_STRIP, /* mode */ + 0, /* first */ + 3); /* count */ + + + /* XXX: Experiments have shown that for some buggy drivers, when using + * glReadPixels there is some kind of race, so we delay our test for a + * few frames and a few seconds: + */ + if (state->frame >= 2) + validate_result (state); + else + g_usleep (G_USEC_PER_SEC); + + state->frame++; +} + +static gboolean +queue_redraw (gpointer stage) +{ + clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); + + return TRUE; +} + +void +test_vertex_buffer_mutability (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + TestState state; + ClutterActor *stage; + ClutterColor stage_clr = {0x0, 0x0, 0x0, 0xff}; + ClutterActor *group; + guint idle_source; + + state.frame = 0; + + stage = clutter_stage_get_default (); + + clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_clr); + clutter_actor_get_geometry (stage, &state.stage_geom); + + group = clutter_group_new (); + clutter_actor_set_size (group, + state.stage_geom.width, + state.stage_geom.height); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), group); + + /* We force continuous redrawing of the stage, since we need to skip + * the first few frames, and we wont be doing anything else that + * will trigger redrawing. */ + idle_source = g_idle_add (queue_redraw, stage); + + g_signal_connect (group, "paint", G_CALLBACK (on_paint), &state); + + { + GLfloat triangle_verts[3][2] = + { + {0.0, 0.0}, + {100.0, 100.0}, + {0.0, 100.0} + }; + GLbyte triangle_colors[3][4] = + { + {0x00, 0x00, 0xff, 0xff}, /* blue */ + {0x00, 0x00, 0xff, 0x00}, /* transparent blue */ + {0x00, 0x00, 0xff, 0x00} /* transparent blue */ + }; + state.buffer = cogl_vertex_buffer_new (3 /* n vertices */); + cogl_vertex_buffer_add (state.buffer, + "gl_Vertex", + 2, /* n components */ + GL_FLOAT, + FALSE, /* normalized */ + 0, /* stride */ + triangle_verts); + cogl_vertex_buffer_add (state.buffer, + "gl_Color", + 4, /* n components */ + GL_UNSIGNED_BYTE, + FALSE, /* normalized */ + 0, /* stride */ + triangle_colors); + cogl_vertex_buffer_submit (state.buffer); + } + + clutter_actor_show_all (stage); + + clutter_main (); + + cogl_vertex_buffer_unref (state.buffer); + + g_source_remove (idle_source); + + if (g_test_verbose ()) + g_print ("OK\n"); +} + Binary files /tmp/KiLtNNiWKF/clutter-0.8.4/tests/data/light0.png and /tmp/VXszleoOf1/clutter-0.9.0/tests/data/light0.png differ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/data/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/tests/data/Makefile.am --- clutter-0.8.4/tests/data/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/data/Makefile.am 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,7 @@ + +EXTRA_DIST = \ + redhand.png \ + redhand_alpha.png \ + light0.png \ + test-script.json + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/data/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/tests/data/Makefile.in --- clutter-0.8.4/tests/data/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/data/Makefile.in 2009-01-28 16:48:58.000000000 +0000 @@ -0,0 +1,386 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = tests/data +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CLUTTER_API_VERSION = @CLUTTER_API_VERSION@ +CLUTTER_CFLAGS = @CLUTTER_CFLAGS@ +CLUTTER_COGL = @CLUTTER_COGL@ +CLUTTER_DEBUG_CFLAGS = @CLUTTER_DEBUG_CFLAGS@ +CLUTTER_DEPS_CFLAGS = @CLUTTER_DEPS_CFLAGS@ +CLUTTER_DEPS_LIBS = @CLUTTER_DEPS_LIBS@ +CLUTTER_FLAVOUR = @CLUTTER_FLAVOUR@ +CLUTTER_GL_HEADER = @CLUTTER_GL_HEADER@ +CLUTTER_LIBS = @CLUTTER_LIBS@ +CLUTTER_LT_LDFLAGS = @CLUTTER_LT_LDFLAGS@ +CLUTTER_LT_VERSION = @CLUTTER_LT_VERSION@ +CLUTTER_MAJORMINOR = @CLUTTER_MAJORMINOR@ +CLUTTER_MAJOR_VERSION = @CLUTTER_MAJOR_VERSION@ +CLUTTER_MICRO_VERSION = @CLUTTER_MICRO_VERSION@ +CLUTTER_MINOR_VERSION = @CLUTTER_MINOR_VERSION@ +CLUTTER_REQUIRES = @CLUTTER_REQUIRES@ +CLUTTER_STAGE_TYPE = @CLUTTER_STAGE_TYPE@ +CLUTTER_VERSION = @CLUTTER_VERSION@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GCC_FLAGS = @GCC_FLAGS@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_PREFIX = @GLIB_PREFIX@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +JSON_PREFIX = @JSON_PREFIX@ +JW = @JW@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGO_PREFIX = @PANGO_PREFIX@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +RANLIB = @RANLIB@ +SDL_CONFIG = @SDL_CONFIG@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TSLIB_CFLAGS = @TSLIB_CFLAGS@ +TSLIB_LIBS = @TSLIB_LIBS@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XINPUT_CFLAGS = @XINPUT_CFLAGS@ +XINPUT_LIBS = @XINPUT_LIBS@ +XMKMF = @XMKMF@ +XMLTO = @XMLTO@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +backendextra = @backendextra@ +backendextralib = @backendextralib@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +clutterbackend = @clutterbackend@ +clutterbackendlib = @clutterbackendlib@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +imagebackend = @imagebackend@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = \ + redhand.png \ + redhand_alpha.png \ + light0.png \ + test-script.json + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/data/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/data/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Binary files /tmp/KiLtNNiWKF/clutter-0.8.4/tests/data/redhand_alpha.png and /tmp/VXszleoOf1/clutter-0.9.0/tests/data/redhand_alpha.png differ Binary files /tmp/KiLtNNiWKF/clutter-0.8.4/tests/data/redhand.png and /tmp/VXszleoOf1/clutter-0.9.0/tests/data/redhand.png differ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/data/test-script.json /tmp/VXszleoOf1/clutter-0.9.0/tests/data/test-script.json --- clutter-0.8.4/tests/data/test-script.json 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/data/test-script.json 2009-01-28 08:12:46.000000000 +0000 @@ -0,0 +1,78 @@ +{ + "My Scene" : { + "id" : "main-stage", + "type" : "ClutterStage", + "title" : "ClutterScript test", + "color" : "white", + "signals" : [ + { "name" : "key-press-event", "handler" : "clutter_main_quit" }, + { "name" : "destroy", "handler" : "clutter_main_quit" } + ], + "children" : [ + { + "id" : "red-button", + "type" : "ClutterRectangle", + "color" : "#ff0000ff", + "x" : 50, "y" : 50, "width" : 100, "height" : 100, + "reactive" : true, + "rotation" : [ + { "z-axis" : [ 45.0, [ 75, 75 ] ] } + ], + "behaviours" : [ "fade-behaviour", "path-behaviour" ] + }, + { + "id" : "green-button", + "type" : "ClutterRectangle", + "color" : "#00ff00ff", + "border-width" : 5, + "border-color" : "#00cc00ff", + "x" : 200, + "y" : 50, + "width" : 100, + "height" : 100, + "reactive" : true, + "signals" : [ + { "name" : "button-press-event", "handler" : "clutter_main_quit" } + ] + }, + { + "id" : "red-hand", + "type" : "ClutterTexture", + "filename" : "redhand.png", + "x" : 100, + "y" : 100, + "width" : "20mm", + "keep-aspect-ratio" : true, + "anchor-x" : "5mm", + "anchor-y" : "5pt", + "opacity" : 100, + "behaviours" : [ "rotate-behaviour", "fade-behaviour" ] + }, + { + "id" : "red-hand-clone", + "type" : "ClutterCloneTexture", + "parent-texture" : "red-hand", + "x" : 250, + "y" : 150, + "opacity" : 100, + }, + { + "id" : "label", + "type" : "ClutterLabel", + "x" : 50, + "y" : 200, + "width" : 400, + "text" : "Clutter\tScript", + "font-name" : "Sans 24px", + "color" : "black", + "alignment" : "center", + "wrap" : false, + "ellipsize" : "none", + "rotation" : [ + { "y-axis" : [ 60.0, [ 275, 100 ] ] }, + { "z-axis" : [ 45.0, [ 75, 75 ] ] } + ] + } + ] + } +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/Makefile.am --- clutter-0.8.4/tests/interactive/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/Makefile.am 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,85 @@ + +UNIT_TESTS = \ + test-textures.c \ + test-events.c \ + test-offscreen.c \ + test-scale.c \ + test-actors.c \ + test-actor-clone.c \ + test-behave.c \ + test-project.c \ + test-perspective.c \ + test-rotate.c \ + test-depth.c \ + test-threads.c \ + test-score.c \ + test-script.c \ + test-model.c \ + test-grab.c \ + test-fullscreen.c \ + test-shader.c \ + test-unproject.c \ + test-viewport.c \ + test-fbo.c \ + test-multistage.c \ + test-cogl-primitives.c \ + test-cogl-tex-tile.c \ + test-cogl-tex-convert.c \ + test-cogl-tex-foreign.c \ + test-cogl-tex-getset.c \ + test-cogl-offscreen.c \ + test-cogl-tex-polygon.c \ + test-cogl-multitexture.c \ + test-stage-read-pixels.c \ + test-random-text.c \ + test-clip.c \ + test-paint-wrapper.c \ + test-texture-quality.c \ + test-layout.c \ + test-animation.c \ + test-easing.c \ + test-binding-pool.c \ + test-text.c \ + test-text-field.c \ + test-clutter-cairo-flowers.c + +if X11_TESTS +UNIT_TESTS += test-pixmap.c +UNIT_TESTS += test-devices.c +endif + +#FIXME - this is is a bit of a yukky way of ensuring the tests find our data: +test-script.json: + ln -sf $(top_srcdir)/tests/data/test-script.json +redhand.png: + ln -sf $(top_srcdir)/tests/data/redhand.png +redhand_alpha.png: + ln -sf $(top_srcdir)/tests/data/redhand_alpha.png +light0.png: + ln -sf $(top_srcdir)/tests/data/light0.png +light1.png: + ln -sf $(top_srcdir)/tests/data/light1.png + +# For convenience, this provides a way to easily run individual unit tests: +.PHONY: wrappers +wrappers: test-interactive$(EXEEXT) + for i in $(UNIT_TESTS); \ + do \ + ln -sf $(top_srcdir)/tests/interactive/wrapper.sh $${i%*.c}; \ + done + +# NB: BUILT_SOURCES here a misnomer. We aren't building source, just inserting +# a phony rule that will generate symlink scripts for running individual tests +BUILT_SOURCES = wrappers redhand.png redhand_alpha.png light0.png light1.png test-script.json + +INCLUDES = -I$(top_srcdir)/ -I$(top_srcdir)/clutter -I$(top_builddir)/clutter +LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la +AM_CFLAGS = $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS) +AM_LDFLAGS = $(CLUTTER_LIBS) + +noinst_PROGRAMS = test-interactive + +test_interactive_SOURCES = \ + test-main.c \ + $(UNIT_TESTS) +test_interactive_LDFLAGS = -export-dynamic diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/Makefile.in --- clutter-0.8.4/tests/interactive/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/Makefile.in 2009-01-28 16:48:58.000000000 +0000 @@ -0,0 +1,629 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@X11_TESTS_TRUE@am__append_1 = test-pixmap.c test-devices.c +noinst_PROGRAMS = test-interactive$(EXEEXT) +subdir = tests/interactive +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am__test_interactive_SOURCES_DIST = test-main.c test-textures.c \ + test-events.c test-offscreen.c test-scale.c test-actors.c \ + test-actor-clone.c test-behave.c test-project.c \ + test-perspective.c test-rotate.c test-depth.c test-threads.c \ + test-score.c test-script.c test-model.c test-grab.c \ + test-fullscreen.c test-shader.c test-unproject.c \ + test-viewport.c test-fbo.c test-multistage.c \ + test-cogl-primitives.c test-cogl-tex-tile.c \ + test-cogl-tex-convert.c test-cogl-tex-foreign.c \ + test-cogl-tex-getset.c test-cogl-offscreen.c \ + test-cogl-tex-polygon.c test-cogl-multitexture.c \ + test-stage-read-pixels.c test-random-text.c test-clip.c \ + test-paint-wrapper.c test-texture-quality.c test-layout.c \ + test-animation.c test-easing.c test-binding-pool.c test-text.c \ + test-text-field.c test-clutter-cairo-flowers.c test-pixmap.c \ + test-devices.c +@X11_TESTS_TRUE@am__objects_1 = test-pixmap.$(OBJEXT) \ +@X11_TESTS_TRUE@ test-devices.$(OBJEXT) +am__objects_2 = test-textures.$(OBJEXT) test-events.$(OBJEXT) \ + test-offscreen.$(OBJEXT) test-scale.$(OBJEXT) \ + test-actors.$(OBJEXT) test-actor-clone.$(OBJEXT) \ + test-behave.$(OBJEXT) test-project.$(OBJEXT) \ + test-perspective.$(OBJEXT) test-rotate.$(OBJEXT) \ + test-depth.$(OBJEXT) test-threads.$(OBJEXT) \ + test-score.$(OBJEXT) test-script.$(OBJEXT) \ + test-model.$(OBJEXT) test-grab.$(OBJEXT) \ + test-fullscreen.$(OBJEXT) test-shader.$(OBJEXT) \ + test-unproject.$(OBJEXT) test-viewport.$(OBJEXT) \ + test-fbo.$(OBJEXT) test-multistage.$(OBJEXT) \ + test-cogl-primitives.$(OBJEXT) test-cogl-tex-tile.$(OBJEXT) \ + test-cogl-tex-convert.$(OBJEXT) \ + test-cogl-tex-foreign.$(OBJEXT) test-cogl-tex-getset.$(OBJEXT) \ + test-cogl-offscreen.$(OBJEXT) test-cogl-tex-polygon.$(OBJEXT) \ + test-cogl-multitexture.$(OBJEXT) \ + test-stage-read-pixels.$(OBJEXT) test-random-text.$(OBJEXT) \ + test-clip.$(OBJEXT) test-paint-wrapper.$(OBJEXT) \ + test-texture-quality.$(OBJEXT) test-layout.$(OBJEXT) \ + test-animation.$(OBJEXT) test-easing.$(OBJEXT) \ + test-binding-pool.$(OBJEXT) test-text.$(OBJEXT) \ + test-text-field.$(OBJEXT) test-clutter-cairo-flowers.$(OBJEXT) \ + $(am__objects_1) +am_test_interactive_OBJECTS = test-main.$(OBJEXT) $(am__objects_2) +test_interactive_OBJECTS = $(am_test_interactive_OBJECTS) +test_interactive_LDADD = $(LDADD) +test_interactive_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la +test_interactive_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(test_interactive_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(test_interactive_SOURCES) +DIST_SOURCES = $(am__test_interactive_SOURCES_DIST) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CLUTTER_API_VERSION = @CLUTTER_API_VERSION@ +CLUTTER_CFLAGS = @CLUTTER_CFLAGS@ +CLUTTER_COGL = @CLUTTER_COGL@ +CLUTTER_DEBUG_CFLAGS = @CLUTTER_DEBUG_CFLAGS@ +CLUTTER_DEPS_CFLAGS = @CLUTTER_DEPS_CFLAGS@ +CLUTTER_DEPS_LIBS = @CLUTTER_DEPS_LIBS@ +CLUTTER_FLAVOUR = @CLUTTER_FLAVOUR@ +CLUTTER_GL_HEADER = @CLUTTER_GL_HEADER@ +CLUTTER_LIBS = @CLUTTER_LIBS@ +CLUTTER_LT_LDFLAGS = @CLUTTER_LT_LDFLAGS@ +CLUTTER_LT_VERSION = @CLUTTER_LT_VERSION@ +CLUTTER_MAJORMINOR = @CLUTTER_MAJORMINOR@ +CLUTTER_MAJOR_VERSION = @CLUTTER_MAJOR_VERSION@ +CLUTTER_MICRO_VERSION = @CLUTTER_MICRO_VERSION@ +CLUTTER_MINOR_VERSION = @CLUTTER_MINOR_VERSION@ +CLUTTER_REQUIRES = @CLUTTER_REQUIRES@ +CLUTTER_STAGE_TYPE = @CLUTTER_STAGE_TYPE@ +CLUTTER_VERSION = @CLUTTER_VERSION@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GCC_FLAGS = @GCC_FLAGS@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_PREFIX = @GLIB_PREFIX@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +JSON_PREFIX = @JSON_PREFIX@ +JW = @JW@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGO_PREFIX = @PANGO_PREFIX@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +RANLIB = @RANLIB@ +SDL_CONFIG = @SDL_CONFIG@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TSLIB_CFLAGS = @TSLIB_CFLAGS@ +TSLIB_LIBS = @TSLIB_LIBS@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XINPUT_CFLAGS = @XINPUT_CFLAGS@ +XINPUT_LIBS = @XINPUT_LIBS@ +XMKMF = @XMKMF@ +XMLTO = @XMLTO@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +backendextra = @backendextra@ +backendextralib = @backendextralib@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +clutterbackend = @clutterbackend@ +clutterbackendlib = @clutterbackendlib@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +imagebackend = @imagebackend@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +UNIT_TESTS = test-textures.c test-events.c test-offscreen.c \ + test-scale.c test-actors.c test-actor-clone.c test-behave.c \ + test-project.c test-perspective.c test-rotate.c test-depth.c \ + test-threads.c test-score.c test-script.c test-model.c \ + test-grab.c test-fullscreen.c test-shader.c test-unproject.c \ + test-viewport.c test-fbo.c test-multistage.c \ + test-cogl-primitives.c test-cogl-tex-tile.c \ + test-cogl-tex-convert.c test-cogl-tex-foreign.c \ + test-cogl-tex-getset.c test-cogl-offscreen.c \ + test-cogl-tex-polygon.c test-cogl-multitexture.c \ + test-stage-read-pixels.c test-random-text.c test-clip.c \ + test-paint-wrapper.c test-texture-quality.c test-layout.c \ + test-animation.c test-easing.c test-binding-pool.c test-text.c \ + test-text-field.c test-clutter-cairo-flowers.c $(am__append_1) + +# NB: BUILT_SOURCES here a misnomer. We aren't building source, just inserting +# a phony rule that will generate symlink scripts for running individual tests +BUILT_SOURCES = wrappers redhand.png redhand_alpha.png light0.png light1.png test-script.json +INCLUDES = -I$(top_srcdir)/ -I$(top_srcdir)/clutter -I$(top_builddir)/clutter +LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la +AM_CFLAGS = $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS) +AM_LDFLAGS = $(CLUTTER_LIBS) +test_interactive_SOURCES = \ + test-main.c \ + $(UNIT_TESTS) + +test_interactive_LDFLAGS = -export-dynamic +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/interactive/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/interactive/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +test-interactive$(EXEEXT): $(test_interactive_OBJECTS) $(test_interactive_DEPENDENCIES) + @rm -f test-interactive$(EXEEXT) + $(test_interactive_LINK) $(test_interactive_OBJECTS) $(test_interactive_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-actor-clone.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-actors.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-animation.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-behave.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-binding-pool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-clip.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-clutter-cairo-flowers.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cogl-multitexture.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cogl-offscreen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cogl-primitives.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cogl-tex-convert.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cogl-tex-foreign.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cogl-tex-getset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cogl-tex-polygon.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cogl-tex-tile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-depth.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-devices.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-easing.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-events.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fbo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fullscreen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-grab.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-layout.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-model.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-multistage.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-offscreen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-paint-wrapper.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-perspective.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pixmap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-project.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-random-text.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-rotate.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-scale.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-score.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-script.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-shader.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stage-read-pixels.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-text-field.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-text.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-texture-quality.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-textures.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-threads.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-unproject.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-viewport.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + + +#FIXME - this is is a bit of a yukky way of ensuring the tests find our data: +test-script.json: + ln -sf $(top_srcdir)/tests/data/test-script.json +redhand.png: + ln -sf $(top_srcdir)/tests/data/redhand.png +redhand_alpha.png: + ln -sf $(top_srcdir)/tests/data/redhand_alpha.png +light0.png: + ln -sf $(top_srcdir)/tests/data/light0.png +light1.png: + ln -sf $(top_srcdir)/tests/data/light1.png + +# For convenience, this provides a way to easily run individual unit tests: +.PHONY: wrappers +wrappers: test-interactive$(EXEEXT) + for i in $(UNIT_TESTS); \ + do \ + ln -sf $(top_srcdir)/tests/interactive/wrapper.sh $${i%*.c}; \ + done +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-actor-clone.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-actor-clone.c --- clutter-0.8.4/tests/interactive/test-actor-clone.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-actor-clone.c 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,288 @@ +#include + +#include +#include +#include +#include +#include + +#define NHANDS 6 + +typedef struct SuperOH +{ + ClutterActor **hand, *bgtex; + ClutterActor *real_hand; + ClutterActor *group; + ClutterActor *stage; + + gint stage_width; + gint stage_height; + gfloat radius; + + ClutterBehaviour *scaler_1; + ClutterBehaviour *scaler_2; + ClutterTimeline *timeline; +} SuperOH; + +static gint n_hands = NHANDS; + +static GOptionEntry super_oh_entries[] = { + { + "num-hands", 'n', + 0, + G_OPTION_ARG_INT, &n_hands, + "Number of hands", "HANDS" + }, + { NULL } +}; + +/* input handler */ +static gboolean +input_cb (ClutterActor *stage, + ClutterEvent *event, + gpointer data) +{ + SuperOH *oh = data; + + if (event->type == CLUTTER_BUTTON_PRESS) + { + ClutterButtonEvent *button_event; + ClutterActor *e; + gint x, y; + + clutter_event_get_coords (event, &x, &y); + + button_event = (ClutterButtonEvent *) event; + g_print ("*** button press event (button:%d) at %d, %d ***\n", + button_event->button, + x, y); + + e = clutter_stage_get_actor_at_pos (CLUTTER_STAGE (stage), x, y); + + /* only allow hiding the clones */ + if (e && CLUTTER_IS_CLONE (e)) + { + clutter_actor_hide (e); + return TRUE; + } + } + else if (event->type == CLUTTER_KEY_RELEASE) + { + ClutterKeyEvent *kev = (ClutterKeyEvent *) event; + + g_print ("*** key press event (key:%c) ***\n", + clutter_key_event_symbol (kev)); + + if (clutter_key_event_symbol (kev) == CLUTTER_q) + { + clutter_main_quit (); + return TRUE; + } + else if (clutter_key_event_symbol (kev) == CLUTTER_r) + { + gint i; + + for (i = 0; i < n_hands; i++) + clutter_actor_show (oh->hand[i]); + + clutter_actor_show (oh->real_hand); + + return TRUE; + } + } + + return FALSE; +} + + +/* Timeline handler */ +static void +frame_cb (ClutterTimeline *timeline, + gint frame_num, + gpointer data) +{ + SuperOH *oh = data; + gint i; + + /* Rotate everything clockwise about stage center*/ + + clutter_actor_set_rotation (oh->group, + CLUTTER_Z_AXIS, + frame_num, + oh->stage_width / 2, + oh->stage_height / 2, + 0); + + for (i = 0; i < n_hands; i++) + { + gdouble scale_x, scale_y; + + clutter_actor_get_scale (oh->hand[i], &scale_x, &scale_y); + + /* Rotate each hand around there centers - to get this we need + * to take into account any scaling. + */ + clutter_actor_set_rotation (oh->hand[i], + CLUTTER_Z_AXIS, + -6.0 * frame_num, + 0, 0, 0); + } +} + +static gdouble +my_sine_wave (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = clutter_alpha_get_timeline (alpha); + gdouble progress = clutter_timeline_get_progress (timeline); + + return sin (progress * G_PI); +} + +G_MODULE_EXPORT int +test_actor_clone_main (int argc, char *argv[]) +{ + ClutterAlpha *alpha; + ClutterActor *stage; + ClutterColor stage_color = { 0x61, 0x64, 0x8c, 0xff }; + SuperOH *oh; + gint i; + GError *error; + ClutterActor *real_hand, *tmp; + ClutterColor clr = { 0xff, 0xff, 0x00, 0xff }; + + error = NULL; + + clutter_init_with_args (&argc, &argv, + NULL, + super_oh_entries, + NULL, + &error); + if (error) + { + g_warning ("Unable to initialise Clutter:\n%s", + error->message); + g_error_free (error); + + return EXIT_FAILURE; + } + + stage = clutter_stage_get_default (); + clutter_actor_set_size (stage, 800, 600); + + clutter_stage_set_title (CLUTTER_STAGE (stage), "Clone Test"); + clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); + + oh = g_new (SuperOH, 1); + + /* Create a timeline to manage animation */ + oh->timeline = clutter_timeline_new (360, 60); + clutter_timeline_set_loop (oh->timeline, TRUE); + + /* fire a callback for frame change */ + g_signal_connect (oh->timeline, "new-frame", G_CALLBACK (frame_cb), oh); + + /* Set up some behaviours to handle scaling */ + alpha = clutter_alpha_new_with_func (oh->timeline, my_sine_wave, NULL, NULL); + + oh->scaler_1 = clutter_behaviour_scale_new (alpha, 0.5, 0.5, 1.0, 1.0); + oh->scaler_2 = clutter_behaviour_scale_new (alpha, 1.0, 1.0, 0.5, 0.5); + + tmp = clutter_texture_new_from_file ("redhand.png", &error); + if (tmp == NULL) + { + g_error ("image load failed: %s", error->message); + return EXIT_FAILURE; + } + + clutter_actor_set_size (tmp, 300, 500); + + real_hand = clutter_group_new (); + clutter_container_add_actor (CLUTTER_CONTAINER (real_hand), tmp); + tmp = clutter_rectangle_new_with_color (&clr); + clutter_actor_set_size (tmp, 100, 100); + clutter_container_add_actor (CLUTTER_CONTAINER (real_hand), tmp); + clutter_actor_set_scale (real_hand, 0.5, 0.5); + oh->real_hand = real_hand; + + /* Now stick the group we want to clone into another group with a custom + * opacity to verify that the clones don't traverse this parent when + * calculating their opacity. */ + tmp = clutter_group_new (); + clutter_actor_set_opacity (tmp, 0x80); + clutter_container_add_actor (CLUTTER_CONTAINER (tmp), real_hand); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), tmp); + + /* create a new group to hold multiple actors in a group */ + oh->group = clutter_group_new(); + + oh->hand = g_new (ClutterActor*, n_hands); + + oh->stage_width = clutter_actor_get_width (stage); + oh->stage_height = clutter_actor_get_height (stage); + oh->radius = (oh->stage_width + oh->stage_height) + / n_hands; + + for (i = 0; i < n_hands; i++) + { + gint x, y, w, h; + + /* Create a texture from file, then clone in to same resources */ + oh->hand[i] = clutter_clone_new (real_hand); + clutter_actor_set_size (oh->hand[i], 200, 213); + + /* Place around a circle */ + w = clutter_actor_get_width (oh->hand[0]); + h = clutter_actor_get_height (oh->hand[0]); + + x = oh->stage_width / 2 + + oh->radius + * cos (i * G_PI / (n_hands / 2)) + - w / 2; + + y = oh->stage_height / 2 + + oh->radius + * sin (i * G_PI / (n_hands / 2)) + - h / 2; + + clutter_actor_set_position (oh->hand[i], x, y); + + clutter_actor_move_anchor_point_from_gravity (oh->hand[i], + CLUTTER_GRAVITY_CENTER); + + /* Add to our group group */ + clutter_container_add_actor (CLUTTER_CONTAINER (oh->group), oh->hand[i]); + + if (i % 2) + clutter_behaviour_apply (oh->scaler_1, oh->hand[i]); + else + clutter_behaviour_apply (oh->scaler_2, oh->hand[i]); + } + + /* Add the group to the stage */ + clutter_container_add_actor (CLUTTER_CONTAINER (stage), oh->group); + + /* Show everying */ + clutter_actor_show (stage); + + g_signal_connect (stage, "button-press-event", + G_CALLBACK (input_cb), + oh); + g_signal_connect (stage, "key-release-event", + G_CALLBACK (input_cb), + oh); + + /* and start it */ + clutter_timeline_start (oh->timeline); + + clutter_main (); + + /* clean up */ + g_object_unref (oh->scaler_1); + g_object_unref (oh->scaler_2); + g_object_unref (oh->timeline); + g_free (oh->hand); + g_free (oh); + + return EXIT_SUCCESS; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-actors.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-actors.c --- clutter-0.8.4/tests/interactive/test-actors.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-actors.c 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,267 @@ +#include + +#include +#include +#include +#include +#include + +#define NHANDS 6 + +typedef struct SuperOH +{ + ClutterActor **hand, *bgtex; + ClutterActor *real_hand; + ClutterActor *group; + ClutterActor *stage; + + gint stage_width; + gint stage_height; + gfloat radius; + + ClutterBehaviour *scaler_1; + ClutterBehaviour *scaler_2; + ClutterTimeline *timeline; +} SuperOH; + +static gint n_hands = NHANDS; + +static GOptionEntry super_oh_entries[] = { + { + "num-hands", 'n', + 0, + G_OPTION_ARG_INT, &n_hands, + "Number of hands", "HANDS" + }, + { NULL } +}; + +/* input handler */ +static gboolean +input_cb (ClutterActor *stage, + ClutterEvent *event, + gpointer data) +{ + SuperOH *oh = data; + + if (event->type == CLUTTER_BUTTON_PRESS) + { + ClutterButtonEvent *button_event; + ClutterActor *e; + gint x, y; + + clutter_event_get_coords (event, &x, &y); + + button_event = (ClutterButtonEvent *) event; + g_print ("*** button press event (button:%d) at %d, %d ***\n", + button_event->button, + x, y); + + e = clutter_stage_get_actor_at_pos (CLUTTER_STAGE (stage), x, y); + + /* only allow hiding the clones */ + if (e && (CLUTTER_IS_TEXTURE (e) || CLUTTER_IS_CLONE (e))) + { + clutter_actor_hide (e); + return TRUE; + } + } + else if (event->type == CLUTTER_KEY_RELEASE) + { + ClutterKeyEvent *kev = (ClutterKeyEvent *) event; + + g_print ("*** key press event (key:%c) ***\n", + clutter_key_event_symbol (kev)); + + if (clutter_key_event_symbol (kev) == CLUTTER_q) + { + clutter_main_quit (); + return TRUE; + } + else if (clutter_key_event_symbol (kev) == CLUTTER_r) + { + gint i; + + for (i = 0; i < n_hands; i++) + clutter_actor_show (oh->hand[i]); + + return TRUE; + } + } + + return FALSE; +} + + +/* Timeline handler */ +static void +frame_cb (ClutterTimeline *timeline, + gint frame_num, + gpointer data) +{ + SuperOH *oh = data; + gint i; + + /* Rotate everything clockwise about stage center*/ + + clutter_actor_set_rotation (oh->group, + CLUTTER_Z_AXIS, + frame_num, + oh->stage_width / 2, + oh->stage_height / 2, + 0); + + for (i = 0; i < n_hands; i++) + { + /* Rotate each hand around there centers - to get this we need + * to take into account any scaling. + */ + clutter_actor_set_rotation (oh->hand[i], + CLUTTER_Z_AXIS, + -6.0 * frame_num, + 0, 0, 0); + } +} + +static gdouble +my_sine_wave (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = clutter_alpha_get_timeline (alpha); + gdouble progress = clutter_timeline_get_progress (timeline); + + return sin (progress * G_PI); +} + +G_MODULE_EXPORT int +test_actors_main (int argc, char *argv[]) +{ + ClutterAlpha *alpha; + ClutterActor *stage; + ClutterColor stage_color = { 0x61, 0x64, 0x8c, 0xff }; + SuperOH *oh; + gint i; + GError *error; + ClutterActor *real_hand; + + error = NULL; + + clutter_init_with_args (&argc, &argv, + NULL, + super_oh_entries, + NULL, + &error); + if (error) + { + g_warning ("Unable to initialise Clutter:\n%s", + error->message); + g_error_free (error); + + return EXIT_FAILURE; + } + + stage = clutter_stage_get_default (); + clutter_actor_set_size (stage, 800, 600); + + clutter_stage_set_title (CLUTTER_STAGE (stage), "Clone Test"); + clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); + + oh = g_new (SuperOH, 1); + oh->stage = stage; + + /* Create a timeline to manage animation */ + oh->timeline = clutter_timeline_new (360, 60); + clutter_timeline_set_loop (oh->timeline, TRUE); + + /* fire a callback for frame change */ + g_signal_connect (oh->timeline, "new-frame", G_CALLBACK (frame_cb), oh); + + /* Set up some behaviours to handle scaling */ + alpha = clutter_alpha_new_with_func (oh->timeline, my_sine_wave, NULL, NULL); + + oh->scaler_1 = clutter_behaviour_scale_new (alpha, 0.5, 0.5, 1.0, 1.0); + oh->scaler_2 = clutter_behaviour_scale_new (alpha, 1.0, 1.0, 0.5, 0.5); + + real_hand = clutter_texture_new_from_file ("redhand.png", &error); + if (real_hand == NULL) + { + g_error ("image load failed: %s", error->message); + return EXIT_FAILURE; + } + + /* create a new group to hold multiple actors in a group */ + oh->group = clutter_group_new(); + + oh->hand = g_new (ClutterActor*, n_hands); + + oh->stage_width = clutter_actor_get_width (stage); + oh->stage_height = clutter_actor_get_height (stage); + oh->radius = (oh->stage_width + oh->stage_height) + / n_hands; + + for (i = 0; i < n_hands; i++) + { + gint x, y, w, h; + + if (i == 0) + oh->hand[i] = real_hand; + else + oh->hand[i] = clutter_clone_new (real_hand); + + clutter_actor_set_size (oh->hand[i], 200, 213); + + /* Place around a circle */ + w = clutter_actor_get_width (oh->hand[i]); + h = clutter_actor_get_height (oh->hand[i]); + + x = oh->stage_width / 2 + + oh->radius + * cos (i * G_PI / (n_hands / 2)) + - w / 2; + + y = oh->stage_height / 2 + + oh->radius + * sin (i * G_PI / (n_hands / 2)) + - h / 2; + + clutter_actor_set_position (oh->hand[i], x, y); + + clutter_actor_move_anchor_point_from_gravity (oh->hand[i], + CLUTTER_GRAVITY_CENTER); + + /* Add to our group group */ + clutter_container_add_actor (CLUTTER_CONTAINER (oh->group), oh->hand[i]); + + if (i % 2) + clutter_behaviour_apply (oh->scaler_1, oh->hand[i]); + else + clutter_behaviour_apply (oh->scaler_2, oh->hand[i]); + } + + /* Add the group to the stage */ + clutter_container_add_actor (CLUTTER_CONTAINER (stage), oh->group); + + /* Show everying */ + clutter_actor_show (stage); + + g_signal_connect (stage, "button-press-event", + G_CALLBACK (input_cb), + oh); + g_signal_connect (stage, "key-release-event", + G_CALLBACK (input_cb), + oh); + + /* and start it */ + clutter_timeline_start (oh->timeline); + + clutter_main (); + + /* clean up */ + g_object_unref (oh->scaler_1); + g_object_unref (oh->scaler_2); + g_object_unref (oh->timeline); + g_free (oh->hand); + g_free (oh); + + return EXIT_SUCCESS; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-animation.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-animation.c --- clutter-0.8.4/tests/interactive/test-animation.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-animation.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,114 @@ +#include +#include +#include + +static gboolean is_expanded = FALSE; + +static void +on_animation_complete (ClutterAnimation *animation, + ClutterActor *actor) +{ + is_expanded = !is_expanded; + + g_print ("Animation complete\n"); + + clutter_actor_set_reactive (actor, TRUE); +} + +static gboolean +on_button_press (ClutterActor *actor, + ClutterButtonEvent *event, + gpointer dummy) +{ + ClutterAnimation *animation; + gint old_x, old_y, new_x, new_y; + guint old_width, old_height, new_width, new_height; + gdouble new_angle; + ClutterVertex vertex = { 0, }; + ClutterColor new_color = { 0, }; + + clutter_actor_get_position (actor, &old_x, &old_y); + clutter_actor_get_size (actor, &old_width, &old_height); + + /* determine the final state of the animation depending on + * the state of the actor + */ + if (!is_expanded) + { + new_x = old_x - 100; + new_y = old_y - 100; + new_width = old_width + 200; + new_height = old_height + 200; + new_angle = 360.0; + + new_color.red = 0xdd; + new_color.green = 0x44; + new_color.blue = 0xdd; + new_color.alpha = 0xff; + } + else + { + new_x = old_x + 100; + new_y = old_y + 100; + new_width = old_width - 200; + new_height = old_height - 200; + new_angle = 0.0; + + new_color.red = 0x44; + new_color.green = 0xdd; + new_color.blue = 0x44; + new_color.alpha = 0x88; + } + + vertex.x = CLUTTER_UNITS_FROM_FLOAT ((float) new_width / 2); + vertex.y = CLUTTER_UNITS_FROM_FLOAT ((float) new_height / 2); + + animation = + clutter_actor_animate (actor, CLUTTER_EASE_IN_EXPO, 2000, + "x", new_x, + "y", new_y, + "width", new_width, + "height", new_height, + "color", &new_color, + "rotation-angle-z", new_angle, + "fixed::rotation-center-z", &vertex, + "fixed::reactive", FALSE, + NULL); + g_signal_connect (animation, + "completed", G_CALLBACK (on_animation_complete), + actor); + + return TRUE; +} + +G_MODULE_EXPORT int +test_animation_main (int argc, char *argv[]) +{ + ClutterActor *stage, *rect; + ClutterColor stage_color = { 0x66, 0x66, 0xdd, 0xff }; + ClutterColor rect_color = { 0x44, 0xdd, 0x44, 0xff }; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); + + rect = clutter_rectangle_new_with_color (&rect_color); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), rect); + clutter_actor_set_size (rect, 50, 50); + clutter_actor_set_anchor_point (rect, 25, 25); + clutter_actor_set_position (rect, + clutter_actor_get_width (stage) / 2, + clutter_actor_get_height (stage) / 2); + clutter_actor_set_opacity (rect, 0x88); + clutter_actor_set_reactive (rect, TRUE); + g_signal_connect (rect, + "button-press-event", G_CALLBACK (on_button_press), + NULL); + + clutter_actor_show (stage); + + clutter_main (); + + return EXIT_SUCCESS; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-behave.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-behave.c --- clutter-0.8.4/tests/interactive/test-behave.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-behave.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,228 @@ +#include +#include +#include + +#include +#include + +#include + +static gboolean +button_press_cb (ClutterStage *stage, + ClutterButtonEvent *event, + gpointer data) +{ + const gchar *click_type; + + switch (event->click_count) + { + case 2: + click_type = "double"; + break; + case 3: + click_type = "triple"; + break; + default: + click_type = "single"; + break; + } + + g_print ("%s button press event\n", click_type); + + return FALSE; +} + +static gboolean +scroll_event_cb (ClutterStage *stage, + ClutterScrollEvent *event, + gpointer data) +{ + g_print ("scroll direction: %s\n", + event->direction == CLUTTER_SCROLL_UP ? "up" + : "down"); + + return FALSE; +} + +static void +timeline_completed (ClutterTimeline *timeline) +{ + ClutterTimelineDirection direction; + + direction = clutter_timeline_get_direction (timeline); + + if (direction == CLUTTER_TIMELINE_FORWARD) + direction = CLUTTER_TIMELINE_BACKWARD; + else + direction = CLUTTER_TIMELINE_FORWARD; + + clutter_timeline_set_direction (timeline, direction); +} + +typedef enum { + PATH_POLY, + PATH_ELLIPSE, + PATH_BSPLINE +} path_t; + +G_MODULE_EXPORT int +test_behave_main (int argc, char *argv[]) +{ + ClutterTimeline *timeline; + ClutterAlpha *alpha; + ClutterBehaviour *o_behave, *p_behave; + ClutterActor *stage; + ClutterActor *group, *rect, *hand; + ClutterColor stage_color = { 0xcc, 0xcc, 0xcc, 0xff }; + ClutterColor rect_bg_color = { 0x33, 0x22, 0x22, 0xff }; + ClutterColor rect_border_color = { 0, 0, 0, 0 }; + int i; + path_t path_type = PATH_POLY; + + const char *knots_poly = ("M 0, 0 L 0, 300 L 300, 300 " + "L 300, 0 L 0, 0"); + + /* A spiral created with inkscake */ + const char *knots_bspline = + "M 34.285713,35.219326 " + "C 44.026891,43.384723 28.084874,52.378758 20.714286,51.409804 " + "C 0.7404474,48.783999 -4.6171866,23.967448 1.904757,8.0764719 " + "C 13.570984,-20.348756 49.798303,-26.746504 74.999994,-13.352108 " + "C 111.98449,6.3047056 119.56591,55.259271 99.047626,89.505034 " + "C 71.699974,135.14925 9.6251774,143.91924 -33.571422,116.17172 " + "C -87.929934,81.254291 -97.88804,5.8941057 -62.857155,-46.209236 " + "C -20.430061,-109.31336 68.300385,-120.45954 129.2857,-78.114021 " + "C 201.15479,-28.21129 213.48932,73.938876 163.80954,143.79074 " + "C 106.45226,224.43749 -9.1490153,237.96076 -87.85713,180.93363 " + "C -177.29029,116.13577 -192.00272,-12.937817 -127.61907,-100.49494 " + "C -55.390344,-198.72081 87.170553,-214.62275 183.57141,-142.87593 " + "C 290.59464,-63.223369 307.68641,92.835839 228.57145,198.07645"; + + for (i = 0; i < argc; ++i) + { + if (!strncmp (argv[i], "--path", 6)) + { + if (!strncmp (argv[i] + 7, "poly", 4)) + path_type = PATH_POLY; + else if (!strncmp (argv[i] + 7, "bspline", 7)) + path_type = PATH_BSPLINE; + else if (!strncmp (argv[i] + 7, "ellipse", 7)) + path_type = PATH_ELLIPSE; + } + else if (!strncmp (argv[i], "--help", 6)) + { + printf ("behave [--path=poly|ellipse|bspline]\n"); + exit (0); + } + } + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + clutter_stage_hide_cursor (CLUTTER_STAGE (stage)); + + g_signal_connect (stage, "button-press-event", + G_CALLBACK (button_press_cb), + NULL); + g_signal_connect (stage, "scroll-event", + G_CALLBACK (scroll_event_cb), + NULL); + g_signal_connect (stage, "key-press-event", + G_CALLBACK (clutter_main_quit), + NULL); + + clutter_stage_set_color (CLUTTER_STAGE (stage), + &stage_color); + + /* Make a hand */ + group = clutter_group_new (); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), group); + clutter_actor_show (group); + + hand = clutter_texture_new_from_file ("redhand.png", NULL); + if (hand == NULL) + { + g_error("pixbuf load failed"); + return 1; + } + clutter_actor_set_position (hand, 0, 0); + clutter_actor_show (hand); + + rect = clutter_rectangle_new (); + clutter_actor_set_position (rect, 0, 0); + clutter_actor_set_size (rect, + clutter_actor_get_width (hand), + clutter_actor_get_height (hand)); + clutter_rectangle_set_color (CLUTTER_RECTANGLE (rect), + &rect_bg_color); + clutter_rectangle_set_border_width (CLUTTER_RECTANGLE (rect), 10); + clutter_color_parse ("DarkSlateGray", &rect_border_color); + clutter_rectangle_set_border_color (CLUTTER_RECTANGLE (rect), + &rect_border_color); + clutter_actor_show (rect); + + clutter_container_add (CLUTTER_CONTAINER (group), rect, hand, NULL); + + /* Make a timeline */ + timeline = clutter_timeline_new_for_duration (4000); /* num frames, fps */ + clutter_timeline_set_loop (timeline, TRUE); + g_signal_connect (timeline, + "completed", G_CALLBACK (timeline_completed), + NULL); + + /* Set an alpha func to power behaviour - ramp is constant rise */ + alpha = clutter_alpha_new_full (timeline, CLUTTER_LINEAR); + + /* Create a behaviour for that alpha */ + o_behave = clutter_behaviour_opacity_new (alpha, 0X33, 0xff); + + /* Apply it to our actor */ + clutter_behaviour_apply (o_behave, group); + + /* Make a path behaviour and apply that too */ + switch (path_type) + { + case PATH_POLY: + { + ClutterPath *path = clutter_path_new (); + clutter_path_set_description (path, knots_poly); + p_behave = clutter_behaviour_path_new (alpha, path); + } + break; + case PATH_ELLIPSE: + p_behave = + clutter_behaviour_ellipse_new (alpha, 200, 200, 400, 300, + CLUTTER_ROTATE_CW, + 0.0, 360.0); + + clutter_behaviour_ellipse_set_angle_tilt (CLUTTER_BEHAVIOUR_ELLIPSE (p_behave), + CLUTTER_X_AXIS, + 45.0); + clutter_behaviour_ellipse_set_angle_tilt (CLUTTER_BEHAVIOUR_ELLIPSE (p_behave), + CLUTTER_Z_AXIS, + 45.0); + break; + + case PATH_BSPLINE: + { + ClutterPath *path = clutter_path_new (); + clutter_path_set_description (path, knots_bspline); + p_behave = clutter_behaviour_path_new (alpha, path); + } + break; + } + + clutter_behaviour_apply (p_behave, group); + + /* start the timeline and thus the animations */ + clutter_timeline_start (timeline); + + clutter_actor_show_all (stage); + + clutter_main(); + + g_object_unref (o_behave); + g_object_unref (p_behave); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-binding-pool.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-binding-pool.c --- clutter-0.8.4/tests/interactive/test-binding-pool.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-binding-pool.c 2009-01-29 08:31:37.000000000 +0000 @@ -0,0 +1,313 @@ +#include +#include + +#include +#include + +#include +#include + +#define TYPE_KEY_GROUP (key_group_get_type ()) +#define KEY_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_KEY_GROUP, KeyGroup)) +#define IS_KEY_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_KEY_GROUP)) +#define KEY_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_KEY_GROUP, KeyGroupClass)) +#define IS_KEY_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_KEY_GROUP)) + +typedef struct _KeyGroup KeyGroup; +typedef struct _KeyGroupClass KeyGroupClass; + +struct _KeyGroup +{ + ClutterGroup parent_instance; + + gint selected_index; +}; + +struct _KeyGroupClass +{ + ClutterGroupClass parent_class; + + void (* activate) (KeyGroup *group, + ClutterActor *child); +}; + +G_DEFINE_TYPE (KeyGroup, key_group, CLUTTER_TYPE_GROUP); + +enum +{ + ACTIVATE, + + LAST_SIGNAL +}; + +static guint group_signals[LAST_SIGNAL] = { 0, }; + +static gboolean +key_group_action_move_left (KeyGroup *self, + const gchar *action_name, + guint key_val, + ClutterModifierType modifiers) +{ + gint n_children; + + g_debug ("%s: activated '%s' (k:%d, m:%d)", + G_STRLOC, + action_name, + key_val, + modifiers); + + n_children = clutter_group_get_n_children (CLUTTER_GROUP (self)); + + self->selected_index -= 1; + + if (self->selected_index < 0) + self->selected_index = n_children - 1; + + return TRUE; +} + +static gboolean +key_group_action_move_right (KeyGroup *self, + const gchar *action_name, + guint key_val, + ClutterModifierType modifiers) +{ + gint n_children; + + g_debug ("%s: activated '%s' (k:%d, m:%d)", + G_STRLOC, + action_name, + key_val, + modifiers); + + n_children = clutter_group_get_n_children (CLUTTER_GROUP (self)); + + self->selected_index += 1; + + if (self->selected_index >= n_children) + self->selected_index = 0; + + return TRUE; +} + +static gboolean +key_group_action_activate (KeyGroup *self, + const gchar *action_name, + guint key_val, + ClutterModifierType modifiers) +{ + ClutterActor *child = NULL; + + g_debug ("%s: activated '%s' (k:%d, m:%d)", + G_STRLOC, + action_name, + key_val, + modifiers); + + if (self->selected_index == -1) + return FALSE; + + child = clutter_group_get_nth_child (CLUTTER_GROUP (self), + self->selected_index); + + if (child) + { + g_signal_emit (self, group_signals[ACTIVATE], 0, child); + return TRUE; + } + else + return FALSE; +} + +static gboolean +key_group_key_press (ClutterActor *actor, + ClutterKeyEvent *event) +{ + ClutterBindingPool *pool; + gboolean res; + + pool = clutter_binding_pool_find (G_OBJECT_TYPE_NAME (actor)); + g_assert (pool != NULL); + + res = clutter_binding_pool_activate (pool, + event->keyval, + event->modifier_state, + G_OBJECT (actor)); + + /* if we activate a key binding, redraw the actor */ + if (res) + clutter_actor_queue_redraw (actor); + + return res; +} + +static void +key_group_paint (ClutterActor *actor) +{ + KeyGroup *self = KEY_GROUP (actor); + GList *children, *l; + gint i; + + children = clutter_container_get_children (CLUTTER_CONTAINER (self)); + + for (l = children, i = 0; l != NULL; l = l->next, i++) + { + ClutterActor *child = l->data; + + /* paint the selection rectangle */ + if (i == self->selected_index) + { + ClutterActorBox box = { 0, }; + + clutter_actor_get_allocation_box (child, &box); + + box.x1 -= CLUTTER_UNITS_FROM_DEVICE (2); + box.y1 -= CLUTTER_UNITS_FROM_DEVICE (2); + box.x2 += CLUTTER_UNITS_FROM_DEVICE (2); + box.y2 += CLUTTER_UNITS_FROM_DEVICE (2); + + cogl_set_source_color4ub (255, 255, 0, 224); + cogl_rectangle (CLUTTER_UNITS_TO_DEVICE (box.x1), + CLUTTER_UNITS_TO_DEVICE (box.y1), + CLUTTER_UNITS_TO_DEVICE (box.x2), + CLUTTER_UNITS_TO_DEVICE (box.y2)); + } + + if (CLUTTER_ACTOR_IS_VISIBLE (child)) + clutter_actor_paint (child); + } + + g_list_free (children); +} + +static void +key_group_finalize (GObject *gobject) +{ + G_OBJECT_CLASS (key_group_parent_class)->finalize (gobject); +} + +static void +key_group_class_init (KeyGroupClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); + ClutterBindingPool *binding_pool; + + gobject_class->finalize = key_group_finalize; + + actor_class->paint = key_group_paint; + actor_class->key_press_event = key_group_key_press; + + group_signals[ACTIVATE] = + g_signal_new (g_intern_static_string ("activate"), + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (KeyGroupClass, activate), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + CLUTTER_TYPE_ACTOR); + + binding_pool = clutter_binding_pool_get_for_class (klass); + + clutter_binding_pool_install_action (binding_pool, "move-right", + CLUTTER_Right, 0, + G_CALLBACK (key_group_action_move_right), + NULL, NULL); + clutter_binding_pool_install_action (binding_pool, "move-left", + CLUTTER_Left, 0, + G_CALLBACK (key_group_action_move_left), + NULL, NULL); + clutter_binding_pool_install_action (binding_pool, "activate", + CLUTTER_Return, 0, + G_CALLBACK (key_group_action_activate), + NULL, NULL); + clutter_binding_pool_install_action (binding_pool, "activate", + CLUTTER_KP_Enter, 0, + G_CALLBACK (key_group_action_activate), + NULL, NULL); + clutter_binding_pool_install_action (binding_pool, "activate", + CLUTTER_ISO_Enter, 0, + G_CALLBACK (key_group_action_activate), + NULL, NULL); +} + +static void +key_group_init (KeyGroup *self) +{ + self->selected_index = -1; +} + +static void +on_key_group_activate (KeyGroup *group, + ClutterActor *child) +{ + g_print ("Child '%d' activated!\n", clutter_actor_get_gid (child)); +} + +G_MODULE_EXPORT int +test_binding_pool_main (int argc, char *argv[]) +{ + ClutterActor *stage, *key_group; + ClutterColor red_color = { 255, 0, 0, 255 }; + ClutterColor green_color = { 0, 255, 0, 255 }; + ClutterColor blue_color = { 0, 0, 255, 255 }; + gint group_x, group_y; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + g_signal_connect (stage, + "button-press-event", G_CALLBACK (clutter_main_quit), + NULL); + + key_group = g_object_new (TYPE_KEY_GROUP, NULL); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), key_group); + + /* add three rectangles to the key group */ + clutter_container_add (CLUTTER_CONTAINER (key_group), + g_object_new (CLUTTER_TYPE_RECTANGLE, + "color", &red_color, + "width", 50, + "height", 50, + "x", 0, + "y", 0, + NULL), + g_object_new (CLUTTER_TYPE_RECTANGLE, + "color", &green_color, + "width", 50, + "height", 50, + "x", 75, + "y", 0, + NULL), + g_object_new (CLUTTER_TYPE_RECTANGLE, + "color", &blue_color, + "width", 50, + "height", 50, + "x", 150, + "y", 0, + NULL), + NULL); + + g_signal_connect (key_group, + "activate", G_CALLBACK (on_key_group_activate), + NULL); + + group_x = + (clutter_actor_get_width (stage) - clutter_actor_get_width (key_group)) + / 2; + group_y = + (clutter_actor_get_height (stage) - clutter_actor_get_height (key_group)) + / 2; + + clutter_actor_set_position (key_group, group_x, group_y); + clutter_actor_set_reactive (key_group, TRUE); + + clutter_stage_set_key_focus (CLUTTER_STAGE (stage), key_group); + + clutter_actor_show (stage); + + clutter_main (); + + return EXIT_SUCCESS; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-clip.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-clip.c --- clutter-0.8.4/tests/interactive/test-clip.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-clip.c 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,338 @@ +#include +#include + +typedef struct _CallbackData CallbackData; +typedef struct _Clip Clip; + +typedef enum + { + CLIP_NONE, + CLIP_RECTANGLE, + CLIP_ELLIPSE, + CLIP_SHAPES + } ClipType; + +struct _Clip +{ + ClipType type; + gint x1, y1, x2, y2; +}; + +struct _CallbackData +{ + ClutterActor *stage; + CoglHandle hand; + + Clip current_clip; + + GSList *clips; +}; + +static const char +instructions[] = + "Press and drag any of the three mouse buttons to add a clip with different " + "shapes. Press 'r' to reset or 'u' to undo the last clip."; + +static void +path_shapes (gint x, gint y, gint width, gint height) +{ + cogl_path_move_to (CLUTTER_INT_TO_FIXED (x), CLUTTER_INT_TO_FIXED (y)); + cogl_path_line_to (CLUTTER_INT_TO_FIXED (x), + CLUTTER_INT_TO_FIXED (y + height * 4 / 5)); + cogl_path_line_to (CLUTTER_INT_TO_FIXED (x + width * 4 / 15), + CLUTTER_INT_TO_FIXED (y + height * 4 / 5)); + cogl_path_close (); + + cogl_path_rectangle (CLUTTER_INT_TO_FIXED (x + width / 3), + CLUTTER_INT_TO_FIXED (y), + CLUTTER_INT_TO_FIXED (width * 4 / 15), + CLUTTER_INT_TO_FIXED (height * 4 / 5)); + + cogl_path_ellipse (CLUTTER_INT_TO_FIXED (x + width * 4 / 5), + CLUTTER_INT_TO_FIXED (y + height * 2 / 5), + CLUTTER_INT_TO_FIXED (width * 2 / 15), + CLUTTER_INT_TO_FIXED (height * 2 / 5)); +} + +static void +draw_shapes (gint x, gint y) +{ + path_shapes (x, y, 300, 100); + cogl_set_source_color4ub (0x00, 0x00, 0xff, 0xff); + cogl_path_fill_preserve (); + cogl_set_source_color4ub (0xff, 0x00, 0x00, 0xff); + cogl_path_stroke (); +} + +static void +make_clip_path (Clip *clip) +{ + switch (clip->type) + { + case CLIP_NONE: + break; + + case CLIP_RECTANGLE: + cogl_path_rectangle (CLUTTER_INT_TO_FIXED (clip->x1), + CLUTTER_INT_TO_FIXED (clip->y1), + CLUTTER_INT_TO_FIXED (clip->x2 - clip->x1), + CLUTTER_INT_TO_FIXED (clip->y2 - clip->y1)); + break; + + case CLIP_ELLIPSE: + cogl_path_ellipse (CLUTTER_INT_TO_FIXED (clip->x1 + clip->x2) / 2, + CLUTTER_INT_TO_FIXED (clip->y1 + clip->y2) / 2, + CLUTTER_INT_TO_FIXED (clip->x2 - clip->x1) / 2, + CLUTTER_INT_TO_FIXED (clip->y2 - clip->y1) / 2); + break; + + case CLIP_SHAPES: + { + int x, y, width, height; + + if (clip->x1 < clip->x2) + { + x = clip->x1; + width = clip->x2 - x; + } + else + { + x = clip->x2; + width = clip->x1 - x; + } + if (clip->y1 < clip->y2) + { + y = clip->y1; + height = clip->y2 - y; + } + else + { + y = clip->y2; + height = clip->y1 - y; + } + + path_shapes (x, y, width, height); + } + break; + } +} + +static void +on_paint (ClutterActor *actor, CallbackData *data) +{ + int i; + ClutterGeometry stage_size; + gint hand_width, hand_height; + GSList *node; + + clutter_actor_get_allocation_geometry (data->stage, &stage_size); + + hand_width = cogl_texture_get_width (data->hand); + hand_height = cogl_texture_get_height (data->hand); + + /* Setup the clipping */ + for (node = data->clips; node; node = node->next) + { + Clip *clip = (Clip *) node->data; + + if (clip->type == CLIP_RECTANGLE) + cogl_clip_set (CLUTTER_INT_TO_FIXED (clip->x1), + CLUTTER_INT_TO_FIXED (clip->y1), + CLUTTER_INT_TO_FIXED (clip->x2 - clip->x1), + CLUTTER_INT_TO_FIXED (clip->y2 - clip->y1)); + else + { + make_clip_path (clip); + cogl_clip_set_from_path (); + } + } + + /* Draw a rectangle filling the entire stage */ + cogl_set_source_color4ub (0x80, 0x80, 0xff, 0xff); + cogl_rectangle (0, 0, stage_size.width, stage_size.height); + + draw_shapes (10, 10); + + /* Draw the hand at different rotations */ + for (i = -2; i <= 2; i++) + { + cogl_push_matrix (); + + cogl_translate (stage_size.width / 2 + stage_size.width / 6 * i, + stage_size.height / 2, 0); + + cogl_rotate (i * 40, 0, 1, 0); + + cogl_set_source_color4ub (0xff, 0xff, 0xff, 0xff); + + cogl_set_source_texture (data->hand); + cogl_rectangle_with_texture_coords (CLUTTER_INT_TO_FIXED (-hand_width / 2), + CLUTTER_INT_TO_FIXED (-hand_height / 2), + CLUTTER_INT_TO_FIXED (hand_width / 2), + CLUTTER_INT_TO_FIXED (hand_height / 2), + 0, 0, CFX_ONE, CFX_ONE); + + cogl_pop_matrix (); + } + + draw_shapes (stage_size.width - 310, stage_size.height - 110); + + /* Remove all of the clipping */ + g_slist_foreach (data->clips, (GFunc) cogl_clip_unset, NULL); + + /* Draw the bounding box for each of the clips */ + for (node = data->clips; node; node = node->next) + { + Clip *clip = (Clip *) node->data; + + make_clip_path (clip); + cogl_set_source_color4ub (0x00, 0x00, 0xff, 0xff); + cogl_path_stroke (); + } + + /* Draw the bounding box for the pending new clip */ + if (data->current_clip.type != CLIP_NONE) + { + make_clip_path (&data->current_clip); + cogl_set_source_color4ub (0xff, 0x00, 0x00, 0xff); + cogl_path_stroke (); + } +} + +static gboolean +on_button_press (ClutterActor *stage, ClutterButtonEvent *event, + CallbackData *data) +{ + data->current_clip.x1 = data->current_clip.x2 = event->x; + data->current_clip.y1 = data->current_clip.y2 = event->y; + + data->current_clip.type + = event->button == 1 ? CLIP_RECTANGLE + : event->button == 2 ? CLIP_SHAPES + : CLIP_ELLIPSE; + + clutter_actor_queue_redraw (stage); + + return FALSE; +} + +static gboolean +on_button_release (ClutterActor *stage, ClutterButtonEvent *event, + CallbackData *data) +{ + if (data->current_clip.type != CLIP_NONE) + { + data->clips = g_slist_prepend (data->clips, + g_slice_copy (sizeof (Clip), + &data->current_clip)); + + data->current_clip.type = CLIP_NONE; + } + + clutter_actor_queue_redraw (stage); + + return FALSE; +} + +static gboolean +on_motion (ClutterActor *stage, ClutterMotionEvent *event, + CallbackData *data) +{ + if (data->current_clip.type != CLIP_NONE) + { + data->current_clip.x2 = event->x; + data->current_clip.y2 = event->y; + + clutter_actor_queue_redraw (stage); + } + + return FALSE; +} + +static void +free_clips (CallbackData *data) +{ + GSList *node; + + for (node = data->clips; node; node = node->next) + g_slice_free (Clip, node->data); + + g_slist_free (data->clips); + + data->clips = NULL; +} + +static gpointer +on_key_press (ClutterActor *stage, ClutterKeyEvent *event, + CallbackData *data) +{ + switch (event->keyval) + { + case CLUTTER_r: + free_clips (data); + clutter_actor_queue_redraw (stage); + break; + + case CLUTTER_u: + if (data->clips) + { + g_slice_free (Clip, data->clips->data); + data->clips = g_slist_delete_link (data->clips, data->clips); + clutter_actor_queue_redraw (stage); + } + break; + } + + return FALSE; +} + +G_MODULE_EXPORT int +test_clip_main (int argc, char **argv) +{ + CallbackData data; + ClutterActor *stub_actor, *label; + + clutter_init (&argc, &argv); + + data.current_clip.type = CLIP_NONE; + data.clips = NULL; + + data.stage = clutter_stage_get_default (); + + stub_actor = clutter_rectangle_new (); + clutter_container_add (CLUTTER_CONTAINER (data.stage), stub_actor, NULL); + + data.hand = cogl_texture_new_from_file ("redhand.png", 64, + COGL_TEXTURE_NONE, + COGL_PIXEL_FORMAT_ANY, + NULL); + + label = clutter_text_new_with_text ("Sans 12px", instructions); + clutter_text_set_line_wrap (CLUTTER_TEXT (label), TRUE); + clutter_actor_set_width (label, clutter_actor_get_width (data.stage) - 310); + clutter_actor_set_y (label, + clutter_actor_get_height (data.stage) + - clutter_actor_get_height (label)); + clutter_container_add (CLUTTER_CONTAINER (data.stage), label, NULL); + + g_signal_connect (stub_actor, "paint", G_CALLBACK (on_paint), &data); + + g_signal_connect (data.stage, "button-press-event", + G_CALLBACK (on_button_press), &data); + g_signal_connect (data.stage, "button-release-event", + G_CALLBACK (on_button_release), &data); + g_signal_connect (data.stage, "motion-event", + G_CALLBACK (on_motion), &data); + g_signal_connect (data.stage, "key-press-event", + G_CALLBACK (on_key_press), &data); + + clutter_actor_show (data.stage); + + clutter_main (); + + cogl_texture_unref (data.hand); + + free_clips (&data); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-clutter-cairo-flowers.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-clutter-cairo-flowers.c --- clutter-0.8.4/tests/interactive/test-clutter-cairo-flowers.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-clutter-cairo-flowers.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,212 @@ +/* + * Pretty cairo flower hack. + */ + +#include + +#include /* for sleep(), used for screenshots */ +#include +#include "math.h" + +#define PETAL_MIN 20 +#define PETAL_VAR 40 +#define N_FLOWERS 40 /* reduce if you have a small card */ + +typedef struct Flower +{ + ClutterActor *ctex; + gint x,y,rot,v,rv; +} +Flower; + +ClutterActor* +make_flower_actor (void) +{ + /* No science here, just a hack from toying */ + gint i, j; + + double colors[] = { + 0.71, 0.81, 0.83, + 1.0, 0.78, 0.57, + 0.64, 0.30, 0.35, + 0.73, 0.40, 0.39, + 0.91, 0.56, 0.64, + 0.70, 0.47, 0.45, + 0.92, 0.75, 0.60, + 0.82, 0.86, 0.85, + 0.51, 0.56, 0.67, + 1.0, 0.79, 0.58, + + }; + + gint size; + gint petal_size; + gint n_groups; /* Num groups of petals 1-3 */ + gint n_petals; /* num of petals 4 - 8 */ + gint pm1, pm2; + + gint idx, last_idx = -1; + + ClutterActor *ctex; + cairo_t *cr; + + petal_size = PETAL_MIN + rand() % PETAL_VAR; + size = petal_size * 8; + + n_groups = rand() % 3 + 1; + + ctex = clutter_cairo_texture_new (size, size); + + cr = clutter_cairo_texture_create (CLUTTER_CAIRO_TEXTURE (ctex)); + + cairo_set_tolerance (cr, 0.1); + + /* Clear */ + cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR); + cairo_paint(cr); + cairo_set_operator (cr, CAIRO_OPERATOR_OVER); + + cairo_translate(cr, size/2, size/2); + + for (i=0; iy += flowers[i]->v; + flowers[i]->rot += flowers[i]->rv; + + if (flowers[i]->y > (gint)clutter_actor_get_height + (clutter_stage_get_default ())) + flowers[i]->y = -clutter_actor_get_height (flowers[i]->ctex); + + clutter_actor_set_position (flowers[i]->ctex, + flowers[i]->x, flowers[i]->y); + + clutter_actor_set_rotation (flowers[i]->ctex, + CLUTTER_Z_AXIS, + flowers[i]->rot, + clutter_actor_get_width (flowers[i]->ctex)/2, + clutter_actor_get_height (flowers[i]->ctex)/2, + 0); + } + + return TRUE; +} + +void foo(void) { g_usleep(10000000); } + +int +test_clutter_cairo_flowers_main (int argc, char **argv) +{ + int i; + ClutterActor *stage; + ClutterColor stage_color = { 0x0, 0x0, 0x0, 0xff }; + Flower *flowers[N_FLOWERS]; + + srand(time(NULL)); + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + + clutter_stage_set_color (CLUTTER_STAGE (stage), + &stage_color); + + g_object_set(stage, "fullscreen", TRUE, NULL); + + for (i=0; i< N_FLOWERS; i++) + { + flowers[i] = g_new0(Flower, 1); + flowers[i]->ctex = make_flower_actor(); + flowers[i]->x = rand() % clutter_actor_get_width(stage) + - (PETAL_MIN+PETAL_VAR)*2; + flowers[i]->y = rand() % clutter_actor_get_height(stage); + flowers[i]->rv = rand() % 5 + 1; + flowers[i]->v = rand() % 10 + 2; + + clutter_group_add (CLUTTER_GROUP(stage), flowers[i]->ctex); + clutter_actor_set_position (flowers[i]->ctex, + flowers[i]->x, flowers[i]->y); + } + + g_timeout_add (50, tick, flowers); + + clutter_actor_show_all (CLUTTER_ACTOR (stage)); + + g_signal_connect (stage, "key-press-event", + G_CALLBACK (clutter_main_quit), + NULL); + + clutter_main(); + + return 1; +} + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-cogl-multitexture.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-cogl-multitexture.c --- clutter-0.8.4/tests/interactive/test-cogl-multitexture.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-cogl-multitexture.c 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,159 @@ +#include +#include +#include + +#include +#include +#include + +#include +#include + +#define TIMELINE_FRAME_COUNT 200 + +typedef struct _TestMultiLayerMaterialState +{ + ClutterActor *group; + CoglHandle material; + CoglHandle alpha_tex; + CoglHandle redhand_tex; + CoglHandle light_tex0; + ClutterFixed *tex_coords; + + CoglMatrix tex_matrix; + CoglMatrix rot_matrix; + +} TestMultiLayerMaterialState; + + +static void +frame_cb (ClutterTimeline *timeline, + gint frame_no, + gpointer data) +{ + TestMultiLayerMaterialState *state = data; + + cogl_matrix_multiply (&state->tex_matrix, + &state->tex_matrix, + &state->rot_matrix); + cogl_material_set_layer_matrix (state->material, 2, &state->tex_matrix); +} + +static void +material_rectangle_paint (ClutterActor *actor, gpointer data) +{ + TestMultiLayerMaterialState *state = data; + + cogl_set_source (state->material); + cogl_rectangle_with_multitexture_coords ( + CLUTTER_INT_TO_FIXED(0), + CLUTTER_INT_TO_FIXED(0), + CLUTTER_INT_TO_FIXED(TIMELINE_FRAME_COUNT), + CLUTTER_INT_TO_FIXED(TIMELINE_FRAME_COUNT), + state->tex_coords, + 12); +} + +G_MODULE_EXPORT int +test_cogl_multitexture_main (int argc, char *argv[]) +{ + ClutterTimeline *timeline; + ClutterBehaviour *r_behave; + ClutterActor *stage; + ClutterColor stage_color = { 0x61, 0x56, 0x56, 0xff }; + TestMultiLayerMaterialState *state = g_new0 (TestMultiLayerMaterialState, 1); + ClutterGeometry geom; + ClutterFixed tex_coords[] = + { + /* tx1 ty1 tx2 ty2 */ + 0, 0, CLUTTER_INT_TO_FIXED (1), CLUTTER_INT_TO_FIXED (1), + 0, 0, CLUTTER_INT_TO_FIXED (1), CLUTTER_INT_TO_FIXED (1), + 0, 0, CLUTTER_INT_TO_FIXED (1), CLUTTER_INT_TO_FIXED (1) + }; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + clutter_actor_get_geometry (stage, &geom); + + clutter_stage_set_color (CLUTTER_STAGE (stage), + &stage_color); + + /* We create a non-descript actor that we know doesn't have a + * default paint handler, so that we can easily control + * painting in a paint signal handler, without having to + * sub-class anything etc. */ + state->group = clutter_group_new (); + clutter_actor_set_position (state->group, geom.width/2, geom.height/2); + g_signal_connect (state->group, "paint", + G_CALLBACK(material_rectangle_paint), state); + + state->alpha_tex = + cogl_texture_new_from_file ("./redhand_alpha.png", + -1, /* disable slicing */ + TRUE, + COGL_PIXEL_FORMAT_ANY, + NULL); + state->redhand_tex = + cogl_texture_new_from_file ("./redhand.png", + -1, /* disable slicing */ + TRUE, + COGL_PIXEL_FORMAT_ANY, + NULL); + state->light_tex0 = + cogl_texture_new_from_file ("./light0.png", + -1, /* disable slicing */ + TRUE, + COGL_PIXEL_FORMAT_ANY, + NULL); + + state->material = cogl_material_new (); + cogl_material_set_layer (state->material, 0, state->alpha_tex); + cogl_material_set_layer (state->material, 1, state->redhand_tex); + cogl_material_set_layer (state->material, 2, state->light_tex0); + + state->tex_coords = tex_coords; + + cogl_matrix_init_identity (&state->tex_matrix); + cogl_matrix_init_identity (&state->rot_matrix); + + cogl_matrix_translate (&state->rot_matrix, 0.5, 0.5, 0); + cogl_matrix_rotate (&state->rot_matrix, 10.0, 0, 0, 1.0); + cogl_matrix_translate (&state->rot_matrix, -0.5, -0.5, 0); + + clutter_actor_set_anchor_point (state->group, 86, 125); + clutter_container_add_actor (CLUTTER_CONTAINER(stage), + state->group); + + timeline = clutter_timeline_new (TIMELINE_FRAME_COUNT, 26 /* fps */); + g_object_set (timeline, "loop", TRUE, NULL); + + g_signal_connect (timeline, "new-frame", G_CALLBACK (frame_cb), state); + + r_behave = + clutter_behaviour_rotate_new (clutter_alpha_new_full (timeline, + CLUTTER_LINEAR), + CLUTTER_Y_AXIS, + CLUTTER_ROTATE_CW, + 0.0, 360.0); + + /* Apply it to our actor */ + clutter_behaviour_apply (r_behave, state->group); + + /* start the timeline and thus the animations */ + clutter_timeline_start (timeline); + + clutter_actor_show_all (stage); + + clutter_main(); + + cogl_material_unref (state->material); + cogl_texture_unref (state->alpha_tex); + cogl_texture_unref (state->redhand_tex); + cogl_texture_unref (state->light_tex0); + g_free (state); + + g_object_unref (r_behave); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-cogl-offscreen.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-cogl-offscreen.c --- clutter-0.8.4/tests/interactive/test-cogl-offscreen.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-cogl-offscreen.c 2009-01-29 08:31:37.000000000 +0000 @@ -0,0 +1,216 @@ +#include +#include +#include +#include +#include +#include + +/* Coglbox declaration + *--------------------------------------------------*/ + +G_BEGIN_DECLS + +#define TEST_TYPE_COGLBOX test_coglbox_get_type() + +#define TEST_COGLBOX(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ + TEST_TYPE_COGLBOX, TestCoglboxClass)) + +#define TEST_COGLBOX_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), \ + TEST_TYPE_COGLBOX, TestCoglboxClass)) + +#define TEST_IS_COGLBOX(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ + TEST_TYPE_COGLBOX)) + +#define TEST_IS_COGLBOX_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), \ + TEST_TYPE_COGLBOX)) + +#define TEST_COGLBOX_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), \ + TEST_TYPE_COGLBOX, TestCoglboxClass)) + +typedef struct _TestCoglbox TestCoglbox; +typedef struct _TestCoglboxClass TestCoglboxClass; +typedef struct _TestCoglboxPrivate TestCoglboxPrivate; + +struct _TestCoglbox +{ + ClutterActor parent; + + /*< private >*/ + TestCoglboxPrivate *priv; +}; + +struct _TestCoglboxClass +{ + ClutterActorClass parent_class; + + /* padding for future expansion */ + void (*_test_coglbox1) (void); + void (*_test_coglbox2) (void); + void (*_test_coglbox3) (void); + void (*_test_coglbox4) (void); +}; + +static GType test_coglbox_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +/* Coglbox private declaration + *--------------------------------------------------*/ + +G_DEFINE_TYPE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR); + +#define TEST_COGLBOX_GET_PRIVATE(obj) \ +(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate)) + +struct _TestCoglboxPrivate +{ + CoglHandle texhand_id; + CoglHandle texture_id; + CoglHandle offscreen_id; +}; + +/* Coglbox implementation + *--------------------------------------------------*/ + +static void +test_coglbox_paint(ClutterActor *self) +{ + TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (self); + ClutterFixed texcoords[4] = { + CLUTTER_FLOAT_TO_FIXED (0.0f), + CLUTTER_FLOAT_TO_FIXED (0.0f), + CLUTTER_FLOAT_TO_FIXED (1.0f), + CLUTTER_FLOAT_TO_FIXED (1.0f) + }; + CoglHandle material; + + priv = TEST_COGLBOX_GET_PRIVATE (self); + + cogl_set_source_color4ub (0x66, 0x66, 0xdd, 0xff); + cogl_rectangle (0, 0, 400, 400); + + cogl_set_source_texture (priv->texhand_id); + cogl_rectangle_with_texture_coords (0, 0, + CLUTTER_INT_TO_FIXED (400), + CLUTTER_INT_TO_FIXED (400), + 0, 0, + CLUTTER_INT_TO_FIXED (6), + CLUTTER_INT_TO_FIXED (6)); + + cogl_draw_buffer (COGL_OFFSCREEN_BUFFER, priv->offscreen_id); + + cogl_set_source_color4ub (0xff, 0, 0, 0xff); + cogl_rectangle (20, 20, 20 + 100, 20 + 100); + + cogl_set_source_color4ub (0, 0xff, 0, 0xff); + cogl_rectangle (80, 80, 80 + 100, 80 + 100); + + cogl_draw_buffer (COGL_WINDOW_BUFFER, 0); + + material = cogl_material_new (); + cogl_material_set_color4ub (material, 0xff, 0xff, 0xff, 0x88); + cogl_material_set_layer (material, 0, priv->texture_id); + cogl_set_source (material); + cogl_rectangle_with_texture_coords (CLUTTER_INT_TO_FIXED (100), + CLUTTER_INT_TO_FIXED (100), + CLUTTER_INT_TO_FIXED (300), + CLUTTER_INT_TO_FIXED (300), + texcoords[0], + texcoords[1], + texcoords[2], + texcoords[3]); +} + +static void +test_coglbox_finalize (GObject *object) +{ + G_OBJECT_CLASS (test_coglbox_parent_class)->finalize (object); +} + +static void +test_coglbox_dispose (GObject *object) +{ + TestCoglboxPrivate *priv; + + priv = TEST_COGLBOX_GET_PRIVATE (object); + + cogl_texture_unref (priv->texture_id); + cogl_offscreen_unref (priv->offscreen_id); + + G_OBJECT_CLASS (test_coglbox_parent_class)->dispose (object); +} + +static void +test_coglbox_init (TestCoglbox *self) +{ + TestCoglboxPrivate *priv; + self->priv = priv = TEST_COGLBOX_GET_PRIVATE(self); + + printf ("Loading redhand.png\n"); + priv->texhand_id = cogl_texture_new_from_file ("redhand.png", 0, + COGL_TEXTURE_NONE, + COGL_PIXEL_FORMAT_ANY, + NULL); + + printf ("Creating texture with size\n"); + priv->texture_id = cogl_texture_new_with_size (200, 200, 0, + COGL_TEXTURE_NONE, + COGL_PIXEL_FORMAT_RGB_888); + + if (priv->texture_id == COGL_INVALID_HANDLE) + printf ("Failed creating texture with size!\n"); + + printf ("Creating offscreen\n"); + priv->offscreen_id = cogl_offscreen_new_to_texture (priv->texture_id); + + if (priv->offscreen_id == COGL_INVALID_HANDLE) + printf ("Failed creating offscreen to texture!\n"); +} + +static void +test_coglbox_class_init (TestCoglboxClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); + + gobject_class->finalize = test_coglbox_finalize; + gobject_class->dispose = test_coglbox_dispose; + actor_class->paint = test_coglbox_paint; + + g_type_class_add_private (gobject_class, sizeof (TestCoglboxPrivate)); +} + +static ClutterActor* +test_coglbox_new (void) +{ + return g_object_new (TEST_TYPE_COGLBOX, NULL); +} + +G_MODULE_EXPORT int +test_cogl_offscreen_main (int argc, char *argv[]) +{ + ClutterActor *stage; + ClutterActor *coglbox; + + clutter_init(&argc, &argv); + + /* Stage */ + stage = clutter_stage_get_default (); + clutter_actor_set_size (stage, 400, 400); + clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Test"); + + /* Cogl Box */ + coglbox = test_coglbox_new (); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), coglbox); + + clutter_actor_show_all (stage); + + clutter_main (); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-cogl-primitives.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-cogl-primitives.c --- clutter-0.8.4/tests/interactive/test-cogl-primitives.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-cogl-primitives.c 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,162 @@ +#include +#include +#include +#include +#include +#include + +typedef void (*PaintFunc) (void); + +static void +test_paint_line () +{ + cogl_path_line (CLUTTER_INT_TO_FIXED (-50), + CLUTTER_INT_TO_FIXED (-25), + CLUTTER_INT_TO_FIXED (50), + CLUTTER_INT_TO_FIXED (25)); +} + +static void +test_paint_rect () +{ + cogl_path_rectangle (CLUTTER_INT_TO_FIXED (-50), + CLUTTER_INT_TO_FIXED (-25), + CLUTTER_INT_TO_FIXED (100), + CLUTTER_INT_TO_FIXED (50)); +} + +static void +test_paint_rndrect() +{ + cogl_path_round_rectangle (CLUTTER_INT_TO_FIXED (-50), + CLUTTER_INT_TO_FIXED (-25), + CLUTTER_INT_TO_FIXED (100), + CLUTTER_INT_TO_FIXED (50), + CLUTTER_INT_TO_FIXED (10), + 5); +} + +static void +test_paint_polyl () +{ + ClutterFixed poly_coords[] = { + CLUTTER_INT_TO_FIXED (-50), + CLUTTER_INT_TO_FIXED (-50), + CLUTTER_INT_TO_FIXED (+50), + CLUTTER_INT_TO_FIXED (-30), + CLUTTER_INT_TO_FIXED (+30), + CLUTTER_INT_TO_FIXED (+30), + CLUTTER_INT_TO_FIXED (-30), + CLUTTER_INT_TO_FIXED (+40) + }; + + cogl_path_polyline (poly_coords, 4); +} + +static void +test_paint_polyg () +{ + gfloat poly_coords[] = { + CLUTTER_INT_TO_FIXED (-50), + CLUTTER_INT_TO_FIXED (-50), + CLUTTER_INT_TO_FIXED (+50), + CLUTTER_INT_TO_FIXED (-30), + CLUTTER_INT_TO_FIXED (+30), + CLUTTER_INT_TO_FIXED (+30), + CLUTTER_INT_TO_FIXED (-30), + CLUTTER_INT_TO_FIXED (+40) + }; + + cogl_path_polygon (poly_coords, 4); +} + +static void +test_paint_elp () +{ + cogl_path_ellipse (0, 0, + CLUTTER_INT_TO_FIXED (60), + CLUTTER_INT_TO_FIXED (40)); +} + +static void +test_paint_curve () +{ + cogl_path_move_to (CLUTTER_INT_TO_FIXED (-50), + CLUTTER_INT_TO_FIXED (+50)); + + cogl_path_curve_to (CLUTTER_INT_TO_FIXED (+100), + CLUTTER_INT_TO_FIXED (-50), + CLUTTER_INT_TO_FIXED (-100), + CLUTTER_INT_TO_FIXED (-50), + CLUTTER_INT_TO_FIXED (+50), + CLUTTER_INT_TO_FIXED (+50)); +} + +static PaintFunc paint_func []= +{ + test_paint_line, + test_paint_rect, + test_paint_rndrect, + test_paint_polyl, + test_paint_polyg, + test_paint_elp, + test_paint_curve +}; + +static void +paint_cb (ClutterActor *self, ClutterTimeline *tl) +{ + gint paint_index = (clutter_timeline_get_current_frame (tl) + % G_N_ELEMENTS (paint_func)); + + cogl_push_matrix (); + + paint_func[paint_index] (); + + cogl_translate (100, 100, 0); + cogl_set_source_color4ub (0, 160, 0, 255); + cogl_path_stroke_preserve (); + + cogl_translate (150, 0, 0); + cogl_set_source_color4ub (200, 0, 0, 255); + cogl_path_fill (); + + cogl_pop_matrix(); +} + +G_MODULE_EXPORT int +test_cogl_primitives_main (int argc, char *argv[]) +{ + ClutterActor *stage; + ClutterActor *coglbox; + ClutterTimeline *tl; + + clutter_init(&argc, &argv); + + /* One frame for each paint function at one frame per second */ + tl = clutter_timeline_new (G_N_ELEMENTS (paint_func), 1); + clutter_timeline_set_loop (tl, TRUE); + clutter_timeline_start (tl); + + stage = clutter_stage_get_default (); + clutter_actor_set_size (stage, 400, 400); + clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Test"); + + coglbox = clutter_group_new (); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), coglbox); + g_signal_connect (coglbox, "paint", G_CALLBACK (paint_cb), tl); + /* Redraw every frame of the timeline */ + g_signal_connect_swapped (tl, "new-frame", + G_CALLBACK (clutter_actor_queue_redraw), coglbox); + + clutter_actor_set_rotation (coglbox, CLUTTER_Y_AXIS, -30, 200, 0, 0); + clutter_actor_set_position (coglbox, 0, 100); + + clutter_actor_show (stage); + + clutter_main (); + + g_object_unref (tl); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-cogl-tex-convert.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-cogl-tex-convert.c --- clutter-0.8.4/tests/interactive/test-cogl-tex-convert.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-cogl-tex-convert.c 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,221 @@ +#include +#include +#include +#include +#include +#include + +/* Coglbox declaration + *--------------------------------------------------*/ + +G_BEGIN_DECLS + +#define TEST_TYPE_COGLBOX test_coglbox_get_type() + +#define TEST_COGLBOX(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ + TEST_TYPE_COGLBOX, TestCoglboxClass)) + +#define TEST_COGLBOX_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), \ + TEST_TYPE_COGLBOX, TestCoglboxClass)) + +#define TEST_IS_COGLBOX(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ + TEST_TYPE_COGLBOX)) + +#define TEST_IS_COGLBOX_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), \ + TEST_TYPE_COGLBOX)) + +#define TEST_COGLBOX_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), \ + TEST_TYPE_COGLBOX, TestCoglboxClass)) + +typedef struct _TestCoglbox TestCoglbox; +typedef struct _TestCoglboxClass TestCoglboxClass; +typedef struct _TestCoglboxPrivate TestCoglboxPrivate; + +struct _TestCoglbox +{ + ClutterActor parent; + + /*< private >*/ + TestCoglboxPrivate *priv; +}; + +struct _TestCoglboxClass +{ + ClutterActorClass parent_class; + + /* padding for future expansion */ + void (*_test_coglbox1) (void); + void (*_test_coglbox2) (void); + void (*_test_coglbox3) (void); + void (*_test_coglbox4) (void); +}; + +static GType test_coglbox_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +/* Coglbox private declaration + *--------------------------------------------------*/ + +G_DEFINE_TYPE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR); + +#define TEST_COGLBOX_GET_PRIVATE(obj) \ +(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate)) + +struct _TestCoglboxPrivate +{ + CoglHandle cogl_tex_id[4]; + gint frame; +}; + +/* Coglbox implementation + *--------------------------------------------------*/ + +static void +test_coglbox_paint(ClutterActor *self) +{ + TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (self); + ClutterFixed texcoords[4] = { + CLUTTER_FLOAT_TO_FIXED (0.0f), + CLUTTER_FLOAT_TO_FIXED (0.0f), + CLUTTER_FLOAT_TO_FIXED (1.0f), + CLUTTER_FLOAT_TO_FIXED (1.0f) + }; + + priv = TEST_COGLBOX_GET_PRIVATE (self); + + cogl_set_source_color4ub (0x66, 0x66, 0xdd, 0xff); + cogl_rectangle (0, 0, 400, 400); + + cogl_push_matrix (); + cogl_set_source_texture (priv->cogl_tex_id[0]); + cogl_rectangle_with_texture_coords (0, 0, + CLUTTER_INT_TO_FIXED (200), + CLUTTER_INT_TO_FIXED (213), + texcoords[0], texcoords[1], + texcoords[2], texcoords[3]); + + cogl_pop_matrix (); + cogl_push_matrix (); + cogl_translate (200, 0, 0); + cogl_set_source_texture (priv->cogl_tex_id[1]); + cogl_rectangle_with_texture_coords (0, 0, + CLUTTER_INT_TO_FIXED (200), + CLUTTER_INT_TO_FIXED (213), + texcoords[0], texcoords[1], + texcoords[2], texcoords[3]); + + cogl_pop_matrix (); + cogl_push_matrix (); + cogl_translate (0, 200, 0); + cogl_set_source_texture (priv->cogl_tex_id[2]); + cogl_rectangle_with_texture_coords (0, 0, + CLUTTER_INT_TO_FIXED (200), + CLUTTER_INT_TO_FIXED (213), + texcoords[0], texcoords[1], + texcoords[2], texcoords[3]); + + cogl_pop_matrix (); + cogl_push_matrix (); + cogl_translate (200, 200, 0); + cogl_set_source_texture (priv->cogl_tex_id[3]); + cogl_rectangle_with_texture_coords (0, 0, + CLUTTER_INT_TO_FIXED (200), + CLUTTER_INT_TO_FIXED (213), + texcoords[0], texcoords[1], + texcoords[2], texcoords[3]); + + cogl_pop_matrix(); +} + +static void +test_coglbox_finalize (GObject *object) +{ + G_OBJECT_CLASS (test_coglbox_parent_class)->finalize (object); +} + +static void +test_coglbox_dispose (GObject *object) +{ + TestCoglboxPrivate *priv; + + priv = TEST_COGLBOX_GET_PRIVATE (object); + cogl_texture_unref (priv->cogl_tex_id); + + G_OBJECT_CLASS (test_coglbox_parent_class)->dispose (object); +} + +static void +test_coglbox_init (TestCoglbox *self) +{ + TestCoglboxPrivate *priv; + self->priv = priv = TEST_COGLBOX_GET_PRIVATE(self); + + priv->cogl_tex_id[0] = + cogl_texture_new_from_file ("redhand.png", 0, + COGL_TEXTURE_NONE, + COGL_PIXEL_FORMAT_ANY, NULL); + + priv->cogl_tex_id[1] = + cogl_texture_new_from_file ("redhand.png", 0, + COGL_TEXTURE_NONE, + COGL_PIXEL_FORMAT_BGRA_8888, NULL); + + priv->cogl_tex_id[2] = + cogl_texture_new_from_file ("redhand.png", 0, + COGL_TEXTURE_NONE, + COGL_PIXEL_FORMAT_ARGB_8888, NULL); + + priv->cogl_tex_id[3] = + cogl_texture_new_from_file ("redhand.png", 0, + COGL_TEXTURE_NONE, + COGL_PIXEL_FORMAT_G_8, NULL); +} + +static void +test_coglbox_class_init (TestCoglboxClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); + + gobject_class->finalize = test_coglbox_finalize; + gobject_class->dispose = test_coglbox_dispose; + actor_class->paint = test_coglbox_paint; + + g_type_class_add_private (gobject_class, sizeof (TestCoglboxPrivate)); +} + +static ClutterActor* +test_coglbox_new (void) +{ + return g_object_new (TEST_TYPE_COGLBOX, NULL); +} + +G_MODULE_EXPORT int +test_cogl_tex_convert_main (int argc, char *argv[]) +{ + ClutterActor *stage; + ClutterActor *coglbox; + + clutter_init(&argc, &argv); + + /* Stage */ + stage = clutter_stage_get_default (); + clutter_actor_set_size (stage, 400, 400); + clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Test"); + + /* Cogl Box */ + coglbox = test_coglbox_new (); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), coglbox); + + clutter_actor_show_all (stage); + + clutter_main (); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-cogl-tex-foreign.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-cogl-tex-foreign.c --- clutter-0.8.4/tests/interactive/test-cogl-tex-foreign.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-cogl-tex-foreign.c 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,208 @@ +#include +#include +#include +#include +#include +#include + +/* Coglbox declaration + *--------------------------------------------------*/ + +G_BEGIN_DECLS + +#define TEST_TYPE_COGLBOX test_coglbox_get_type() + +#define TEST_COGLBOX(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ + TEST_TYPE_COGLBOX, TestCoglboxClass)) + +#define TEST_COGLBOX_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), \ + TEST_TYPE_COGLBOX, TestCoglboxClass)) + +#define TEST_IS_COGLBOX(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ + TEST_TYPE_COGLBOX)) + +#define TEST_IS_COGLBOX_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), \ + TEST_TYPE_COGLBOX)) + +#define TEST_COGLBOX_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), \ + TEST_TYPE_COGLBOX, TestCoglboxClass)) + +typedef struct _TestCoglbox TestCoglbox; +typedef struct _TestCoglboxClass TestCoglboxClass; +typedef struct _TestCoglboxPrivate TestCoglboxPrivate; + +struct _TestCoglbox +{ + ClutterActor parent; + + /*< private >*/ + TestCoglboxPrivate *priv; +}; + +struct _TestCoglboxClass +{ + ClutterActorClass parent_class; + + /* padding for future expansion */ + void (*_test_coglbox1) (void); + void (*_test_coglbox2) (void); + void (*_test_coglbox3) (void); + void (*_test_coglbox4) (void); +}; + +static GType test_coglbox_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +/* Coglbox private declaration + *--------------------------------------------------*/ + +G_DEFINE_TYPE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR); + +#define TEST_COGLBOX_GET_PRIVATE(obj) \ +(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate)) + +struct _TestCoglboxPrivate +{ + GLuint gl_handle; + CoglHandle cogl_handle; +}; + +/* Coglbox implementation + *--------------------------------------------------*/ + +static void +test_coglbox_paint(ClutterActor *self) +{ + TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (self); + ClutterFixed texcoords[4] = { + CLUTTER_FLOAT_TO_FIXED (0.3f), + CLUTTER_FLOAT_TO_FIXED (0.3f), + CLUTTER_FLOAT_TO_FIXED (0.7f), + CLUTTER_FLOAT_TO_FIXED (0.7f) + }; + + priv = TEST_COGLBOX_GET_PRIVATE (self); + + cogl_set_source_color4ub (0x66, 0x66, 0xdd, 0xff); + cogl_rectangle (0,0,400,400); + + cogl_push_matrix (); + + cogl_translate (100,100,0); + cogl_set_source_texture (priv->cogl_handle); + cogl_rectangle_with_texture_coords (0, 0, + CLUTTER_INT_TO_FIXED (200), + CLUTTER_INT_TO_FIXED (200), + texcoords[0], texcoords[1], + texcoords[2], texcoords[3]); + + cogl_pop_matrix(); +} + +static void +test_coglbox_finalize (GObject *object) +{ + G_OBJECT_CLASS (test_coglbox_parent_class)->finalize (object); +} + +static void +test_coglbox_dispose (GObject *object) +{ + TestCoglboxPrivate *priv; + + priv = TEST_COGLBOX_GET_PRIVATE (object); + + cogl_texture_unref (priv->cogl_handle); + glDeleteTextures (1, &priv->gl_handle); + + G_OBJECT_CLASS (test_coglbox_parent_class)->dispose (object); +} + +static void +test_coglbox_init (TestCoglbox *self) +{ + TestCoglboxPrivate *priv; + guchar data[12]; + + self->priv = priv = TEST_COGLBOX_GET_PRIVATE(self); + + /* Prepare a 2x2 pixels texture */ + + data[0] = 255; data[1] = 0; data[2] = 0; + data[3] = 0; data[4] = 255; data[5] = 0; + data[6] = 0; data[7] = 0; data[8] = 255; + data[9] = 0; data[10] = 0; data[11] = 0; + + glGenTextures (1, &priv->gl_handle); + glBindTexture (GL_TEXTURE_2D, priv->gl_handle); + + glPixelStorei (GL_UNPACK_ALIGNMENT, 1); + glTexImage2D (GL_TEXTURE_2D, 0, GL_RGB, + 2, 2, 0, GL_RGB, GL_UNSIGNED_BYTE, data); + + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + + /* Create texture from foreign */ + + priv->cogl_handle = + cogl_texture_new_from_foreign (priv->gl_handle, + GL_TEXTURE_2D, + 2, 2, 0, 0, + COGL_PIXEL_FORMAT_RGB_888); + + if (priv->cogl_handle == COGL_INVALID_HANDLE) + { + printf ("Failed creating texture from foreign!\n"); + return; + } +} + +static void +test_coglbox_class_init (TestCoglboxClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); + + gobject_class->finalize = test_coglbox_finalize; + gobject_class->dispose = test_coglbox_dispose; + actor_class->paint = test_coglbox_paint; + + g_type_class_add_private (gobject_class, sizeof (TestCoglboxPrivate)); +} + +static ClutterActor* +test_coglbox_new (void) +{ + return g_object_new (TEST_TYPE_COGLBOX, NULL); +} + +G_MODULE_EXPORT int +test_cogl_tex_foreign_main (int argc, char *argv[]) +{ + ClutterActor *stage; + ClutterActor *coglbox; + + clutter_init(&argc, &argv); + + /* Stage */ + stage = clutter_stage_get_default (); + clutter_actor_set_size (stage, 400, 400); + clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Test"); + + /* Cogl Box */ + coglbox = test_coglbox_new (); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), coglbox); + + clutter_actor_show_all (stage); + + clutter_main (); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-cogl-tex-getset.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-cogl-tex-getset.c --- clutter-0.8.4/tests/interactive/test-cogl-tex-getset.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-cogl-tex-getset.c 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,268 @@ +#include +#include +#include +#include +#include +#include + +/* Coglbox declaration + *--------------------------------------------------*/ + +G_BEGIN_DECLS + +#define TEST_TYPE_COGLBOX test_coglbox_get_type() + +#define TEST_COGLBOX(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ + TEST_TYPE_COGLBOX, TestCoglboxClass)) + +#define TEST_COGLBOX_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), \ + TEST_TYPE_COGLBOX, TestCoglboxClass)) + +#define TEST_IS_COGLBOX(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ + TEST_TYPE_COGLBOX)) + +#define TEST_IS_COGLBOX_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), \ + TEST_TYPE_COGLBOX)) + +#define TEST_COGLBOX_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), \ + TEST_TYPE_COGLBOX, TestCoglboxClass)) + +typedef struct _TestCoglbox TestCoglbox; +typedef struct _TestCoglboxClass TestCoglboxClass; +typedef struct _TestCoglboxPrivate TestCoglboxPrivate; + +struct _TestCoglbox +{ + ClutterActor parent; + + /*< private >*/ + TestCoglboxPrivate *priv; +}; + +struct _TestCoglboxClass +{ + ClutterActorClass parent_class; + + /* padding for future expansion */ + void (*_test_coglbox1) (void); + void (*_test_coglbox2) (void); + void (*_test_coglbox3) (void); + void (*_test_coglbox4) (void); +}; + +static GType test_coglbox_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +/* Coglbox private declaration + *--------------------------------------------------*/ + +G_DEFINE_TYPE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR); + +#define TEST_COGLBOX_GET_PRIVATE(obj) \ +(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate)) + +struct _TestCoglboxPrivate +{ + CoglHandle cogl_tex_id[4]; +}; + +/* Coglbox implementation + *--------------------------------------------------*/ + +static void +test_coglbox_paint(ClutterActor *self) +{ + TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (self); + ClutterFixed texcoords[4] = { + CLUTTER_FLOAT_TO_FIXED (0.0f), + CLUTTER_FLOAT_TO_FIXED (0.0f), + CLUTTER_FLOAT_TO_FIXED (1.0f), + CLUTTER_FLOAT_TO_FIXED (1.0f) + }; + + priv = TEST_COGLBOX_GET_PRIVATE (self); + + cogl_set_source_color4ub (0x66, 0x66, 0xdd, 0xff); + cogl_rectangle (0, 0, 400, 400); + + cogl_push_matrix (); + + cogl_translate (100, 100, 0); + cogl_set_source_texture (priv->cogl_tex_id[1]); + cogl_rectangle_with_texture_coords (0, 0, + CLUTTER_INT_TO_FIXED (200), + CLUTTER_INT_TO_FIXED (213), + texcoords[0], texcoords[1], + texcoords[2], texcoords[3]); + + cogl_pop_matrix(); +} + +static void +test_coglbox_finalize (GObject *object) +{ + G_OBJECT_CLASS (test_coglbox_parent_class)->finalize (object); +} + +static void +test_coglbox_dispose (GObject *object) +{ + TestCoglboxPrivate *priv; + + priv = TEST_COGLBOX_GET_PRIVATE (object); + cogl_texture_unref (priv->cogl_tex_id); + + G_OBJECT_CLASS (test_coglbox_parent_class)->dispose (object); +} + +static void +test_coglbox_init (TestCoglbox *self) +{ + TestCoglboxPrivate *priv; + guint width; + guint height; + guint rowstride; + CoglPixelFormat format; + gint size; + guchar *data; + gint x,y,t; + guchar *pixel; + + self->priv = priv = TEST_COGLBOX_GET_PRIVATE(self); + + /* Load image from file */ + + priv->cogl_tex_id[0] = + cogl_texture_new_from_file ("redhand.png", 40, + COGL_TEXTURE_NONE, + COGL_PIXEL_FORMAT_ANY, NULL); + + if (priv->cogl_tex_id[0] == COGL_INVALID_HANDLE) + { + printf ("Failed loading redhand.png image!\n"); + return; + } + + printf("Texture loaded from file.\n"); + + /* Obtain pixel data */ + + format = cogl_texture_get_format (priv->cogl_tex_id[0]); + g_assert(format == COGL_PIXEL_FORMAT_RGBA_8888 || + format == COGL_PIXEL_FORMAT_ARGB_8888); + + width = cogl_texture_get_width (priv->cogl_tex_id[0]); + height = cogl_texture_get_height (priv->cogl_tex_id[0]); + size = cogl_texture_get_data (priv->cogl_tex_id[0], + format, 0, NULL); + + printf("size: %dx%d\n", width, height); + printf("format: 0x%x\n", format); + printf("bytesize: %d\n", size); + + data = (guchar*) g_malloc (sizeof(guchar) * size); + + cogl_texture_get_data (priv->cogl_tex_id[0], + format, 0, data); + rowstride = cogl_texture_get_rowstride (priv->cogl_tex_id[0]); + + /* Create new texture from modified data */ + + priv->cogl_tex_id[1] = + cogl_texture_new_from_data (width, height, 0, + COGL_TEXTURE_NONE, + format, format, + rowstride, data); + + if (priv->cogl_tex_id[1] == COGL_INVALID_HANDLE) + { + printf ("Failed creating image from data!\n"); + return; + } + + printf ("Texture created from data.\n"); + + /* Modify data (swap red and green) */ + + for (y=0; ycogl_tex_id[1], + 0, 0, 0, 0, + 100, 100, width, height, + format, 0, data); + + cogl_texture_set_region (priv->cogl_tex_id[1], + 100, 100, 100, 100, + 100, 100, width, height, + format, 0, data); + + printf ("Subregion data updated.\n"); +} + +static void +test_coglbox_class_init (TestCoglboxClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); + + gobject_class->finalize = test_coglbox_finalize; + gobject_class->dispose = test_coglbox_dispose; + actor_class->paint = test_coglbox_paint; + + g_type_class_add_private (gobject_class, sizeof (TestCoglboxPrivate)); +} + +static ClutterActor* +test_coglbox_new (void) +{ + return g_object_new (TEST_TYPE_COGLBOX, NULL); +} + +G_MODULE_EXPORT int +test_cogl_tex_getset_main (int argc, char *argv[]) +{ + ClutterActor *stage; + ClutterActor *coglbox; + + clutter_init(&argc, &argv); + + /* Stage */ + stage = clutter_stage_get_default (); + clutter_actor_set_size (stage, 400, 400); + clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Test"); + + /* Cogl Box */ + coglbox = test_coglbox_new (); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), coglbox); + + clutter_actor_show_all (stage); + + clutter_main (); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-cogl-tex-polygon.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-cogl-tex-polygon.c --- clutter-0.8.4/tests/interactive/test-cogl-tex-polygon.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-cogl-tex-polygon.c 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,410 @@ +#include +#include +#include +#include +#include +#include + +/* Coglbox declaration + *--------------------------------------------------*/ + +G_BEGIN_DECLS + +#define TEST_TYPE_COGLBOX test_coglbox_get_type() + +#define TEST_COGLBOX(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ + TEST_TYPE_COGLBOX, TestCoglboxClass)) + +#define TEST_COGLBOX_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), \ + TEST_TYPE_COGLBOX, TestCoglboxClass)) + +#define TEST_IS_COGLBOX(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ + TEST_TYPE_COGLBOX)) + +#define TEST_IS_COGLBOX_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), \ + TEST_TYPE_COGLBOX)) + +#define TEST_COGLBOX_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), \ + TEST_TYPE_COGLBOX, TestCoglboxClass)) + +typedef struct _TestCoglbox TestCoglbox; +typedef struct _TestCoglboxClass TestCoglboxClass; +typedef struct _TestCoglboxPrivate TestCoglboxPrivate; + +struct _TestCoglbox +{ + ClutterActor parent; + + /*< private >*/ + TestCoglboxPrivate *priv; +}; + +struct _TestCoglboxClass +{ + ClutterActorClass parent_class; + + /* padding for future expansion */ + void (*_test_coglbox1) (void); + void (*_test_coglbox2) (void); + void (*_test_coglbox3) (void); + void (*_test_coglbox4) (void); +}; + +static GType test_coglbox_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +/* Coglbox private declaration + *--------------------------------------------------*/ + +G_DEFINE_TYPE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR); + +#define TEST_COGLBOX_GET_PRIVATE(obj) \ +(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate)) + +struct _TestCoglboxPrivate +{ + CoglHandle sliced_tex, not_sliced_tex; + gint frame; + gboolean use_sliced; + gboolean use_linear_filtering; +}; + +/* Coglbox implementation + *--------------------------------------------------*/ + +static void +test_coglbox_fade_texture (CoglHandle tex_id, + ClutterFixed x1, + ClutterFixed y1, + ClutterFixed x2, + ClutterFixed y2, + ClutterFixed tx1, + ClutterFixed ty1, + ClutterFixed tx2, + ClutterFixed ty2) +{ + CoglTextureVertex vertices[4]; + int i; + + vertices[0].x = x1; + vertices[0].y = y1; + vertices[0].z = 0; + vertices[0].tx = tx1; + vertices[0].ty = ty1; + vertices[1].x = x1; + vertices[1].y = y2; + vertices[1].z = 0; + vertices[1].tx = tx1; + vertices[1].ty = ty2; + vertices[2].x = x2; + vertices[2].y = y2; + vertices[2].z = 0; + vertices[2].tx = tx2; + vertices[2].ty = ty2; + vertices[3].x = x2; + vertices[3].y = y1; + vertices[3].z = 0; + vertices[3].tx = tx2; + vertices[3].ty = ty1; + + for (i = 0; i < 4; i++) + { + cogl_color_set_from_4ub (&(vertices[i].color), + 255, + 255, + 255, + ((i ^ (i >> 1)) & 1) ? 0 : 128); + } + + cogl_set_source_texture (tex_id); + cogl_polygon (vertices, 4, TRUE); + + cogl_set_source_color4ub (255, 255, 255, 255); +} + +static void +test_coglbox_triangle_texture (CoglHandle tex_id, + ClutterFixed x, + ClutterFixed y, + ClutterFixed tx1, + ClutterFixed ty1, + ClutterFixed tx2, + ClutterFixed ty2, + ClutterFixed tx3, + ClutterFixed ty3) +{ + CoglTextureVertex vertices[3]; + int tex_width = cogl_texture_get_width (tex_id); + int tex_height = cogl_texture_get_height (tex_id); + + vertices[0].x = x + tx1 * tex_width; + vertices[0].y = y + ty1 * tex_height; + vertices[0].z = 0; + vertices[0].tx = tx1; + vertices[0].ty = ty1; + + vertices[1].x = x + tx2 * tex_width; + vertices[1].y = y + ty2 * tex_height; + vertices[1].z = 0; + vertices[1].tx = tx2; + vertices[1].ty = ty2; + + vertices[2].x = x + tx3 * tex_width; + vertices[2].y = y + ty3 * tex_height; + vertices[2].z = 0; + vertices[2].tx = tx3; + vertices[2].ty = ty3; + + cogl_set_source_texture (tex_id); + cogl_polygon (vertices, 3, FALSE); +} + +static void +test_coglbox_paint (ClutterActor *self) +{ + TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (self); + CoglHandle tex_handle = priv->use_sliced ? priv->sliced_tex + : priv->not_sliced_tex; + int tex_width = cogl_texture_get_width (tex_handle); + int tex_height = cogl_texture_get_height (tex_handle); + + cogl_texture_set_filters (tex_handle, + priv->use_linear_filtering + ? CGL_LINEAR : CGL_NEAREST, + priv->use_linear_filtering + ? CGL_LINEAR : CGL_NEAREST); + + cogl_push_matrix (); + cogl_translate (tex_width / 2, 0, 0); + cogl_rotate (priv->frame, 0, 1, 0); + cogl_translate (-tex_width / 2, 0, 0); + + /* Draw a hand and refect it */ + cogl_set_source_texture (tex_handle); + cogl_rectangle_with_texture_coords (0, 0, + CLUTTER_INT_TO_FIXED (tex_width), + CLUTTER_INT_TO_FIXED (tex_height), + 0, 0, CFX_ONE, CFX_ONE); + test_coglbox_fade_texture (tex_handle, + 0, CLUTTER_INT_TO_FIXED (tex_height), + CLUTTER_INT_TO_FIXED (tex_width), + CLUTTER_INT_TO_FIXED (tex_height * 3 / 2), + 0, CFX_ONE, + CFX_ONE, CFX_ONE / 2); + + cogl_pop_matrix (); + + cogl_push_matrix (); + cogl_translate (tex_width * 3 / 2 + 60, 0, 0); + cogl_rotate (priv->frame, 0, 1, 0); + cogl_translate (-tex_width / 2 - 10, 0, 0); + + /* Draw the texture split into two triangles */ + test_coglbox_triangle_texture (tex_handle, + 0, 0, + 0, 0, + 0, CFX_ONE, + CFX_ONE, CFX_ONE); + test_coglbox_triangle_texture (tex_handle, + CLUTTER_INT_TO_FIXED (20), 0, + 0, 0, + CFX_ONE, 0, + CFX_ONE, CFX_ONE); + + cogl_pop_matrix (); +} + +static void +test_coglbox_finalize (GObject *object) +{ + G_OBJECT_CLASS (test_coglbox_parent_class)->finalize (object); +} + +static void +test_coglbox_dispose (GObject *object) +{ + TestCoglboxPrivate *priv; + + priv = TEST_COGLBOX_GET_PRIVATE (object); + cogl_texture_unref (priv->not_sliced_tex); + cogl_texture_unref (priv->sliced_tex); + + G_OBJECT_CLASS (test_coglbox_parent_class)->dispose (object); +} + +static void +test_coglbox_init (TestCoglbox *self) +{ + TestCoglboxPrivate *priv; + GError *error = NULL; + self->priv = priv = TEST_COGLBOX_GET_PRIVATE (self); + + priv->use_linear_filtering = FALSE; + priv->use_sliced = FALSE; + + priv->sliced_tex = + cogl_texture_new_from_file ("redhand.png", 10, + COGL_TEXTURE_NONE, + COGL_PIXEL_FORMAT_ANY, + &error); + if (priv->sliced_tex == COGL_INVALID_HANDLE) + { + if (error) + { + g_warning ("Texture loading failed: %s", error->message); + g_error_free (error); + error = NULL; + } + else + g_warning ("Texture loading failed: "); + } + + priv->not_sliced_tex = + cogl_texture_new_from_file ("redhand.png", -1, + COGL_TEXTURE_NONE, + COGL_PIXEL_FORMAT_ANY, + &error); + if (priv->not_sliced_tex == COGL_INVALID_HANDLE) + { + if (error) + { + g_warning ("Texture loading failed: %s", error->message); + g_error_free (error); + } + else + g_warning ("Texture loading failed: "); + } +} + +static void +test_coglbox_class_init (TestCoglboxClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); + + gobject_class->finalize = test_coglbox_finalize; + gobject_class->dispose = test_coglbox_dispose; + actor_class->paint = test_coglbox_paint; + + g_type_class_add_private (gobject_class, sizeof (TestCoglboxPrivate)); +} + +static ClutterActor* +test_coglbox_new (void) +{ + return g_object_new (TEST_TYPE_COGLBOX, NULL); +} + +static void +frame_cb (ClutterTimeline *timeline, + gint frame_num, + gpointer data) +{ + TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (data); + + priv->frame = frame_num; + clutter_actor_queue_redraw (CLUTTER_ACTOR (data)); +} + +static void +update_toggle_text (ClutterText *button, gboolean val) +{ + clutter_text_set_text (button, val ? "Enabled" : "Disabled"); +} + +static gboolean +on_toggle_click (ClutterActor *button, ClutterEvent *event, + gboolean *toggle_val) +{ + update_toggle_text (CLUTTER_TEXT (button), *toggle_val = !*toggle_val); + + return TRUE; +} + +static ClutterActor * +make_toggle (const char *label_text, gboolean *toggle_val) +{ + ClutterActor *group = clutter_group_new (); + ClutterActor *label = clutter_text_new_with_text ("Sans 14", label_text); + ClutterActor *button = clutter_text_new_with_text ("Sans 14", ""); + + clutter_actor_set_reactive (button, TRUE); + + update_toggle_text (CLUTTER_TEXT (button), *toggle_val); + + clutter_actor_set_position (button, clutter_actor_get_width (label) + 10, 0); + clutter_container_add (CLUTTER_CONTAINER (group), label, button, NULL); + + g_signal_connect (button, "button-press-event", G_CALLBACK (on_toggle_click), + toggle_val); + + return group; +} + +G_MODULE_EXPORT int +test_cogl_tex_polygon_main (int argc, char *argv[]) +{ + ClutterActor *stage; + ClutterActor *coglbox; + ClutterActor *filtering_toggle; + ClutterActor *slicing_toggle; + ClutterActor *note; + ClutterTimeline *timeline; + ClutterColor blue = { 0x30, 0x30, 0xff, 0xff }; + + clutter_init (&argc, &argv); + + /* Stage */ + stage = clutter_stage_get_default (); + clutter_stage_set_color (CLUTTER_STAGE (stage), &blue); + clutter_actor_set_size (stage, 640, 480); + clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Test"); + + /* Cogl Box */ + coglbox = test_coglbox_new (); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), coglbox); + + /* Timeline for animation */ + timeline = clutter_timeline_new (360, 60); /* num frames, fps */ + g_object_set (timeline, "loop", TRUE, NULL); /* have it loop */ + g_signal_connect (timeline, "new-frame", G_CALLBACK (frame_cb), coglbox); + clutter_timeline_start (timeline); + + /* Labels for toggling settings */ + slicing_toggle = make_toggle ("Texture slicing: ", + &(TEST_COGLBOX_GET_PRIVATE (coglbox) + ->use_sliced)); + clutter_actor_set_position (slicing_toggle, 0, + clutter_actor_get_height (stage) + - clutter_actor_get_height (slicing_toggle)); + filtering_toggle = make_toggle ("Linear filtering: ", + &(TEST_COGLBOX_GET_PRIVATE (coglbox) + ->use_linear_filtering)); + clutter_actor_set_position (filtering_toggle, 0, + clutter_actor_get_y (slicing_toggle) + - clutter_actor_get_height (filtering_toggle)); + note = clutter_text_new_with_text ("Sans 10", "<- Click to change"); + clutter_actor_set_position (note, + clutter_actor_get_width (filtering_toggle) + 10, + (clutter_actor_get_height (stage) + + clutter_actor_get_y (filtering_toggle)) / 2 + - clutter_actor_get_height (note) / 2); + + clutter_container_add (CLUTTER_CONTAINER (stage), + slicing_toggle, + filtering_toggle, + note, + NULL); + + clutter_actor_show (stage); + + clutter_main (); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-cogl-tex-tile.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-cogl-tex-tile.c --- clutter-0.8.4/tests/interactive/test-cogl-tex-tile.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-cogl-tex-tile.c 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,221 @@ +#include +#include +#include +#include +#include +#include +#include + +/* Coglbox declaration + *--------------------------------------------------*/ + +G_BEGIN_DECLS + +#define TEST_TYPE_COGLBOX test_coglbox_get_type() + +#define TEST_COGLBOX(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ + TEST_TYPE_COGLBOX, TestCoglboxClass)) + +#define TEST_COGLBOX_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), \ + TEST_TYPE_COGLBOX, TestCoglboxClass)) + +#define TEST_IS_COGLBOX(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ + TEST_TYPE_COGLBOX)) + +#define TEST_IS_COGLBOX_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), \ + TEST_TYPE_COGLBOX)) + +#define TEST_COGLBOX_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), \ + TEST_TYPE_COGLBOX, TestCoglboxClass)) + +typedef struct _TestCoglbox TestCoglbox; +typedef struct _TestCoglboxClass TestCoglboxClass; +typedef struct _TestCoglboxPrivate TestCoglboxPrivate; + +struct _TestCoglbox +{ + ClutterActor parent; + + /*< private >*/ + TestCoglboxPrivate *priv; +}; + +struct _TestCoglboxClass +{ + ClutterActorClass parent_class; + + /* padding for future expansion */ + void (*_test_coglbox1) (void); + void (*_test_coglbox2) (void); + void (*_test_coglbox3) (void); + void (*_test_coglbox4) (void); +}; + +static GType test_coglbox_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +/* Coglbox private declaration + *--------------------------------------------------*/ + +G_DEFINE_TYPE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR); + +#define TEST_COGLBOX_GET_PRIVATE(obj) \ +(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate)) + +struct _TestCoglboxPrivate +{ + CoglHandle cogl_tex_id; + gint frame; +}; + +/* Coglbox implementation + *--------------------------------------------------*/ + +static void +test_coglbox_paint(ClutterActor *self) +{ + TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (self); + ClutterFixed texcoords[4] = { + CLUTTER_FLOAT_TO_FIXED (0.0f), + CLUTTER_FLOAT_TO_FIXED (0.0f), + CLUTTER_FLOAT_TO_FIXED (1.0f), + CLUTTER_FLOAT_TO_FIXED (1.0f) + }; + gint pingpong_frame; + ClutterFixed sin_frame, cos_frame; + ClutterFixed frac_frame; + gint t; + sin_frame = clutter_sinx (priv->frame); + cos_frame = clutter_cosx (priv->frame); + + pingpong_frame = (priv->frame <= 180 ? priv->frame : 360 - priv->frame); + frac_frame = (CLUTTER_INT_TO_FIXED (pingpong_frame) / + CLUTTER_INT_TO_FIXED (180)); + frac_frame += 0.5; + frac_frame *= 2; + + for (t=0; t<4; t+=2) + { + texcoords[t] += cos_frame; + texcoords[t+1] += sin_frame; + + texcoords[t] = (texcoords[t] * frac_frame); + texcoords[t+1] = (texcoords[t+1] * frac_frame); + } + + priv = TEST_COGLBOX_GET_PRIVATE (self); + + cogl_push_matrix (); + + cogl_set_source_color4ub (0x66, 0x66, 0xdd, 0xff); + cogl_rectangle (0, 0, 400, 400); + + cogl_translate (100, 100, 0); + cogl_set_source_texture (priv->cogl_tex_id); + cogl_rectangle_with_texture_coords (0, 0, + CLUTTER_INT_TO_FIXED (200), + CLUTTER_INT_TO_FIXED (213), + texcoords[0], texcoords[1], + texcoords[2], texcoords[3]); + + cogl_pop_matrix(); +} + +static void +test_coglbox_finalize (GObject *object) +{ + G_OBJECT_CLASS (test_coglbox_parent_class)->finalize (object); +} + +static void +test_coglbox_dispose (GObject *object) +{ + TestCoglboxPrivate *priv; + + priv = TEST_COGLBOX_GET_PRIVATE (object); + cogl_texture_unref (priv->cogl_tex_id); + + G_OBJECT_CLASS (test_coglbox_parent_class)->dispose (object); +} + +static void +test_coglbox_init (TestCoglbox *self) +{ + TestCoglboxPrivate *priv; + self->priv = priv = TEST_COGLBOX_GET_PRIVATE(self); + + priv->cogl_tex_id = cogl_texture_new_from_file ("redhand.png", 0, + COGL_TEXTURE_NONE, + COGL_PIXEL_FORMAT_ANY, + NULL); + + cogl_texture_set_filters (priv->cogl_tex_id, + CGL_LINEAR, CGL_LINEAR); +} + +static void +test_coglbox_class_init (TestCoglboxClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); + + gobject_class->finalize = test_coglbox_finalize; + gobject_class->dispose = test_coglbox_dispose; + actor_class->paint = test_coglbox_paint; + + g_type_class_add_private (gobject_class, sizeof (TestCoglboxPrivate)); +} + +static ClutterActor* +test_coglbox_new (void) +{ + return g_object_new (TEST_TYPE_COGLBOX, NULL); +} + +static void +frame_cb (ClutterTimeline *timeline, + gint frame_num, + gpointer data) +{ + TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (data); + + priv->frame = frame_num; + clutter_actor_queue_redraw (CLUTTER_ACTOR (data)); +} + +G_MODULE_EXPORT int +test_cogl_tex_tile_main (int argc, char *argv[]) +{ + ClutterActor *stage; + ClutterActor *coglbox; + ClutterTimeline *timeline; + + clutter_init(&argc, &argv); + + /* Stage */ + stage = clutter_stage_get_default (); + clutter_actor_set_size (stage, 400, 400); + clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Test"); + + /* Cogl Box */ + coglbox = test_coglbox_new (); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), coglbox); + + /* Timeline for animation */ + timeline = clutter_timeline_new (360, 60); /* num frames, fps */ + g_object_set (timeline, "loop", TRUE, NULL); /* have it loop */ + g_signal_connect (timeline, "new-frame", G_CALLBACK (frame_cb), coglbox); + clutter_timeline_start (timeline); + + clutter_actor_show_all (stage); + + clutter_main (); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-depth.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-depth.c --- clutter-0.8.4/tests/interactive/test-depth.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-depth.c 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,212 @@ +#include +#include +#include + +/* each time the timeline animating the label completes, swap the direction */ +static void +timeline_completed (ClutterTimeline *timeline, + gpointer user_data) +{ + clutter_timeline_set_direction (timeline, + !clutter_timeline_get_direction (timeline)); + clutter_timeline_start (timeline); +} + +static ClutterActor *raise_actor[2]; +static gboolean raise_no = 0; + +static gboolean +raise_top (gpointer ignored) +{ + clutter_actor_raise_top (raise_actor[raise_no]); + raise_no = !raise_no; + return TRUE; +} + +static ClutterActor * +clone_box (ClutterActor *original) +{ + guint width, height; + ClutterActor *group; + ClutterActor *clone; + + clutter_actor_get_size (original, &width, &height); + + group = clutter_group_new (); + clone = clutter_clone_new (original); + clutter_container_add_actor (CLUTTER_CONTAINER (group), clone); + clutter_actor_set_depth (clone, width/2); + + clone = clutter_clone_new (original); + clutter_container_add_actor (CLUTTER_CONTAINER (group), clone); + clutter_actor_set_rotation (clone, CLUTTER_Y_AXIS, 180, width/2, 0, 0); + clutter_actor_set_depth (clone, -(gint)width/2); + + clone = clutter_clone_new (original); + clutter_container_add_actor (CLUTTER_CONTAINER (group), clone); + clutter_actor_set_rotation (clone, CLUTTER_Y_AXIS, 90, 0, 0, 0); + clutter_actor_set_depth (clone, width/2); + clutter_actor_set_position (clone, 0, 0); + + clone = clutter_clone_new (original); + clutter_container_add_actor (CLUTTER_CONTAINER (group), clone); + clutter_actor_set_rotation (clone, CLUTTER_Y_AXIS, 90, 0, 0, 0); + clutter_actor_set_depth (clone, width/2); + clutter_actor_set_position (clone, width, 0); + + clone = clutter_clone_new (original); + clutter_container_add_actor (CLUTTER_CONTAINER (group), clone); + clutter_actor_set_rotation (clone, CLUTTER_X_AXIS, 90, 0, 0, 0); + clutter_actor_set_depth (clone, -(gint)width/2); + clutter_actor_set_position (clone, 0, height); + + clone = clutter_clone_new (original); + clutter_container_add_actor (CLUTTER_CONTAINER (group), clone); + clutter_actor_set_rotation (clone, CLUTTER_X_AXIS, 90, 0, 0, 0); + clutter_actor_set_depth (clone, -(gint)width/2); + clutter_actor_set_position (clone, 0, 0); + + clutter_actor_show_all (group); + return group; +} + +static ClutterActor * +janus_group (const gchar *front_text, + const gchar *back_text) +{ + ClutterColor slide_color = {0x00, 0x00, 0x00, 0xff}; + ClutterColor red = {0xff, 0x00, 0x00, 0xff}; + ClutterColor green = {0x00, 0xff, 0x00, 0xff}; + ClutterActor *group, *rectangle, *front, *back; + guint width, height; + guint width2, height2; + + group = clutter_group_new (); + rectangle = clutter_rectangle_new_with_color (&slide_color); + front = clutter_text_new_with_text ("Sans 50px", front_text); + back = clutter_text_new_with_text ("Sans 50px", back_text); + clutter_text_set_color (CLUTTER_TEXT (front), &red); + clutter_text_set_color (CLUTTER_TEXT (back), &green); + + clutter_actor_get_size (front, &width, &height); + clutter_actor_get_size (back, &width2, &height2); + + if (width2 > width) + width = width2; + if (height2 > height) + height = height2; + + clutter_actor_set_size (rectangle, width, height); + clutter_actor_set_rotation (back, CLUTTER_Y_AXIS, 180, width/2, 0, 0); + + clutter_container_add (CLUTTER_CONTAINER (group), + back, rectangle, front, NULL); + + clutter_actor_show_all (group); + return group; +} + + +G_MODULE_EXPORT gint +test_depth_main (int argc, char *argv[]) +{ + ClutterTimeline *timeline; + ClutterBehaviour *d_behave; + ClutterBehaviour *r_behave; + ClutterActor *stage; + ClutterActor *group, *hand, *label, *rect, *janus, *box; + ClutterColor stage_color = { 0xcc, 0xcc, 0xcc, 0xff }; + ClutterColor rect_color = { 0, 0, 0, 0x88 }; + GError *error; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); + clutter_stage_set_use_fog (CLUTTER_STAGE (stage), TRUE); + clutter_stage_set_fog (CLUTTER_STAGE (stage), 1.0, 10, -50); + + g_signal_connect (stage, + "button-press-event", G_CALLBACK (clutter_main_quit), + NULL); + + group = clutter_group_new (); + clutter_stage_add (stage, group); + clutter_actor_show (group); + + label = clutter_text_new_with_text ("Mono 26", "Clutter"); + clutter_actor_set_position (label, 120, 200); + clutter_actor_show (label); + + error = NULL; + hand = clutter_texture_new_from_file ("redhand.png", &error); + if (error) + g_error ("Unable to load redhand.png: %s", error->message); + clutter_actor_set_position (hand, 240, 100); + clutter_actor_show (hand); + + rect = clutter_rectangle_new_with_color (&rect_color); + clutter_actor_set_position (rect, 340, 100); + clutter_actor_set_size (rect, 200, 200); + clutter_actor_show (rect); + + clutter_container_add (CLUTTER_CONTAINER (group), hand, rect, NULL); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), label); + + /* 3 seconds, at 60 fps */ + timeline = clutter_timeline_new (180, 60); + g_signal_connect (timeline, + "completed", G_CALLBACK (timeline_completed), + NULL); + + d_behave = + clutter_behaviour_depth_new (clutter_alpha_new_full (timeline, + CLUTTER_LINEAR), + -100, 100); + clutter_behaviour_apply (d_behave, label); + + /* add two faced actor */ + janus = janus_group ("GREEN", "RED"); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), janus); + clutter_actor_set_position (janus, 300, 350); + + r_behave = + clutter_behaviour_rotate_new (clutter_alpha_new_full (timeline, + CLUTTER_LINEAR), + CLUTTER_Y_AXIS, + CLUTTER_ROTATE_CW, + 0, 360); + clutter_behaviour_apply (r_behave, janus); + + /* add hand box */ + box = clone_box (hand); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), box); + clutter_actor_set_position (box, 200, 250); + clutter_actor_set_scale (box, 0.5, 0.5); + clutter_actor_set_rotation (box, CLUTTER_X_AXIS, 45, 0, 0, 0); + clutter_actor_set_opacity (box, 0x44); + + r_behave = + clutter_behaviour_rotate_new (clutter_alpha_new_full (timeline, + CLUTTER_LINEAR), + CLUTTER_Y_AXIS, + CLUTTER_ROTATE_CW, + 0, 360); + clutter_behaviour_apply (r_behave, box); + + + clutter_actor_show (stage); + + clutter_timeline_start (timeline); + + raise_actor[0] = rect; + raise_actor[1] = hand; + g_timeout_add (2000, raise_top, NULL); + + clutter_main (); + + g_object_unref (d_behave); + g_object_unref (timeline); + + return EXIT_SUCCESS; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-devices.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-devices.c --- clutter-0.8.4/tests/interactive/test-devices.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-devices.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,83 @@ +#include +#include +#include + +typedef struct { + + GHashTable *devices; + +} TestDevicesApp; + + + +static gboolean +stage_motion_event_cb (ClutterActor *actor, + ClutterEvent *event, + gpointer userdata) +{ + TestDevicesApp *app = (TestDevicesApp *)userdata; + ClutterActor *hand = NULL; + ClutterMotionEvent *mev = (ClutterMotionEvent *)event; + + hand = g_hash_table_lookup (app->devices, mev->device); + clutter_actor_set_position (hand, mev->x, mev->y); + + return FALSE; +} + +G_MODULE_EXPORT int +test_devices_main (int argc, char **argv) +{ + ClutterActor *stage = NULL; + GSList *stage_devices = NULL; + TestDevicesApp *app = NULL; + ClutterColor stage_color = { 0x61, 0x64, 0x8c, 0xff }; + + clutter_x11_enable_xinput (); + clutter_init (&argc, &argv); + + app = g_new0 (TestDevicesApp, 1); + app->devices = g_hash_table_new (g_direct_hash, g_direct_equal) ; + + stage = clutter_stage_get_default (); + clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); + //clutter_stage_fullscreen (CLUTTER_STAGE (stage)); + + g_signal_connect (stage, + "motion-event", + G_CALLBACK(stage_motion_event_cb), + app); + clutter_actor_show_all (stage); + + stage_devices = clutter_x11_get_input_devices (); + + if (stage_devices == NULL) + g_error ("No extended input devices found."); + + do + { + if (stage_devices) + { + ClutterX11XInputDevice *device = NULL; + ClutterActor *hand = NULL; + + device = (ClutterX11XInputDevice *)stage_devices->data; + + if (clutter_x11_get_input_device_type (device) + == CLUTTER_X11_XINPUT_POINTER_DEVICE) + { + + g_debug("got a pointer device...\n"); + + hand = clutter_texture_new_from_file ("redhand.png", NULL); + g_hash_table_insert (app->devices, device, hand); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), hand); + } + + } + } while ((stage_devices = stage_devices->next) != NULL); + + clutter_main (); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-easing.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-easing.c --- clutter-0.8.4/tests/interactive/test-easing.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-easing.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,150 @@ +#include +#include +#include + +const struct { + const gchar *name; + ClutterAnimationMode mode; +} easing_modes[] = { + { "linear", CLUTTER_LINEAR }, + { "easeInQuad", CLUTTER_EASE_IN_QUAD }, + { "easeOutQuad", CLUTTER_EASE_OUT_QUAD }, + { "easeInOutQuad", CLUTTER_EASE_IN_OUT_QUAD }, + { "easeInCubic", CLUTTER_EASE_IN_CUBIC }, + { "easeOutCubic", CLUTTER_EASE_OUT_CUBIC }, + { "easeInOutCubic", CLUTTER_EASE_IN_OUT_CUBIC }, + { "easeInQuart", CLUTTER_EASE_IN_QUART }, + { "easeOutQuart", CLUTTER_EASE_OUT_QUART }, + { "easeInOutQuart", CLUTTER_EASE_IN_OUT_QUART }, + { "easeInQuint", CLUTTER_EASE_IN_QUINT }, + { "easeOutQuint", CLUTTER_EASE_OUT_QUINT }, + { "easeInOutQuint", CLUTTER_EASE_IN_OUT_QUINT }, + { "easeInSine", CLUTTER_EASE_IN_SINE }, + { "easeOutSine", CLUTTER_EASE_OUT_SINE }, + { "easeInOutSine", CLUTTER_EASE_IN_OUT_SINE }, + { "easeInExpo", CLUTTER_EASE_IN_EXPO }, + { "easeOutExpo", CLUTTER_EASE_OUT_EXPO }, + { "easeInOutExpo", CLUTTER_EASE_IN_OUT_EXPO }, + { "easeInCirc", CLUTTER_EASE_IN_CIRC }, + { "easeOutCirc", CLUTTER_EASE_OUT_CIRC }, + { "easeInOutCirc", CLUTTER_EASE_IN_OUT_CIRC }, + { "easeInElastic", CLUTTER_EASE_IN_ELASTIC }, + { "easeOutElastic", CLUTTER_EASE_OUT_ELASTIC }, + { "easeInOutElastic", CLUTTER_EASE_IN_OUT_ELASTIC }, + { "easeInBack", CLUTTER_EASE_IN_BACK }, + { "easeOutBack", CLUTTER_EASE_OUT_BACK }, + { "easeInOutBack", CLUTTER_EASE_IN_OUT_BACK }, + { "easeInBounce", CLUTTER_EASE_IN_BOUNCE }, + { "easeOutBounce", CLUTTER_EASE_OUT_BOUNCE }, + { "easeInOutBounce", CLUTTER_EASE_IN_OUT_BOUNCE }, +}; + +static const gint n_easing_modes = G_N_ELEMENTS (easing_modes); +static gint current_mode = 0; + +static ClutterActor *main_stage = NULL; +static ClutterActor *easing_mode_label = NULL; + +static gboolean +on_button_press (ClutterActor *actor, + ClutterButtonEvent *event, + ClutterActor *rectangle) +{ + if (event->button == 3) + { + gchar *text; + guint stage_width, stage_height; + guint label_width, label_height; + + current_mode = (current_mode + 1 < n_easing_modes) ? current_mode + 1 + : 0; + + text = g_strdup_printf ("Easing mode: %s (%d of %d)\n" + "Right click to change the easing mode", + easing_modes[current_mode].name, + current_mode + 1, + n_easing_modes); + + clutter_text_set_text (CLUTTER_TEXT (easing_mode_label), text); + g_free (text); + + clutter_actor_get_size (main_stage, + &stage_width, + &stage_height); + clutter_actor_get_size (easing_mode_label, + &label_width, + &label_height); + + clutter_actor_set_position (easing_mode_label, + stage_width - label_width - 10, + stage_height - label_height - 10); + } + else if (event->button == 1) + { + ClutterAnimation *animation; + ClutterAnimationMode cur_mode; + + cur_mode = easing_modes[current_mode].mode; + + animation = + clutter_actor_animate (rectangle, cur_mode, 2000, + "x", event->x, + "y", event->y, + NULL); + } + + return TRUE; +} + +G_MODULE_EXPORT int +test_easing_main (int argc, char *argv[]) +{ + ClutterActor *stage, *rect, *label; + ClutterColor stage_color = { 0x66, 0x66, 0xdd, 0xff }; + ClutterColor rect_color = { 0x44, 0xdd, 0x44, 0xff }; + gchar *text; + guint stage_width, stage_height; + guint label_width, label_height; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); + main_stage = stage; + + clutter_actor_get_size (stage, &stage_width, &stage_height); + + rect = clutter_rectangle_new_with_color (&rect_color); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), rect); + clutter_actor_set_size (rect, 50, 50); + clutter_actor_set_anchor_point (rect, 25, 25); + clutter_actor_set_position (rect, stage_width / 2, stage_height / 2); + clutter_actor_set_opacity (rect, 0x88); + g_signal_connect (stage, + "button-press-event", G_CALLBACK (on_button_press), + rect); + + text = g_strdup_printf ("Easing mode: %s (%d of %d)\n" + "Right click to change the easing mode", + easing_modes[current_mode].name, + current_mode + 1, + n_easing_modes); + + label = clutter_text_new (); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), label); + clutter_text_set_font_name (CLUTTER_TEXT (label), "Sans 18px"); + clutter_text_set_text (CLUTTER_TEXT (label), text); + clutter_actor_get_size (label, &label_width, &label_height); + clutter_actor_set_position (label, + stage_width - label_width - 10, + stage_height - label_height - 10); + easing_mode_label = label; + + g_free (text); + + clutter_actor_show (stage); + + clutter_main (); + + return EXIT_SUCCESS; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-events.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-events.c --- clutter-0.8.4/tests/interactive/test-events.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-events.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,304 @@ +#include +#include +#include + +gboolean IsFullScreen = FALSE, IsMotion = TRUE; + +static void +stage_state_cb (ClutterStage *stage, + gpointer data) +{ + gchar *detail = (gchar*)data; + + printf("[stage signal] %s\n", detail); +} + +static gboolean +blue_button_cb (ClutterActor *actor, + ClutterEvent *event, + gpointer data) +{ + ClutterActor *stage; + + stage = clutter_stage_get_default (); + + if (IsFullScreen) + IsFullScreen = FALSE; + else + IsFullScreen = TRUE; + + g_object_set (stage, "fullscreen", IsFullScreen, NULL); + + g_print ("*** Fullscreen %s ***\n", + IsFullScreen ? "enabled" : "disabled"); + + return FALSE; +} + +static gboolean +red_button_cb (ClutterActor *actor, + ClutterEvent *event, + gpointer data) +{ + + if (IsMotion) + IsMotion = FALSE; + else + IsMotion = TRUE; + + clutter_set_motion_events_enabled (IsMotion); + + g_print ("*** Per actor motion events %s ***\n", + IsMotion ? "enabled" : "disabled"); + + return FALSE; +} + +static gboolean +capture_cb (ClutterActor *actor, + ClutterEvent *event, + gpointer data) +{ + g_print ("* captured event for type '%s' *\n", + G_OBJECT_TYPE_NAME (actor)); + + return FALSE; +} + +static void +key_focus_in_cb (ClutterActor *actor, + gpointer data) +{ + ClutterActor *focus_box = CLUTTER_ACTOR(data); + + if (actor == clutter_stage_get_default ()) + clutter_actor_hide (focus_box); + else + { + clutter_actor_set_position (focus_box, + clutter_actor_get_x (actor) - 5, + clutter_actor_get_y (actor) - 5); + + clutter_actor_set_size (focus_box, + clutter_actor_get_width (actor) + 10, + clutter_actor_get_height (actor) + 10); + clutter_actor_show (focus_box); + } +} + +static void +fill_keybuf (char *keybuf, ClutterKeyEvent *event) +{ + char utf8[6]; + int len; + + /* printable character, if any (ß, ∑) */ + len = g_unichar_to_utf8 (event->unicode_value, utf8); + utf8[len] = '\0'; + sprintf(keybuf, "'%s' ", utf8); + + /* key combination (s, S, Delete) */ + len = g_unichar_to_utf8 (clutter_keysym_to_unicode (event->keyval), + utf8); + utf8[len] = '\0'; + + if (event->modifier_state & CLUTTER_SHIFT_MASK) + strcat (keybuf, ""); + if (event->modifier_state & CLUTTER_LOCK_MASK) + strcat (keybuf, ""); + if (event->modifier_state & CLUTTER_CONTROL_MASK) + strcat (keybuf, ""); + if (event->modifier_state & CLUTTER_MOD1_MASK) + strcat (keybuf, ""); + if (event->modifier_state & CLUTTER_MOD2_MASK) + strcat (keybuf, ""); + if (event->modifier_state & CLUTTER_MOD3_MASK) + strcat (keybuf, ""); + if (event->modifier_state & CLUTTER_MOD4_MASK) + strcat (keybuf, ""); + if (event->modifier_state & CLUTTER_MOD5_MASK) + strcat (keybuf, ""); + strcat (keybuf, utf8); +} + +static gboolean +input_cb (ClutterActor *actor, + ClutterEvent *event, + gpointer data) +{ + ClutterStage *stage = CLUTTER_STAGE (clutter_stage_get_default ()); + gchar keybuf[128], *source = (gchar*)data; + + switch (event->type) + { + case CLUTTER_KEY_PRESS: + fill_keybuf (keybuf, &event->key); + printf ("[%s] KEY PRESS %s", source, keybuf); + break; + case CLUTTER_KEY_RELEASE: + fill_keybuf (keybuf, &event->key); + printf ("[%s] KEY RELEASE %s", source, keybuf); + break; + case CLUTTER_MOTION: + g_print ("[%s] MOTION", source); + break; + case CLUTTER_ENTER: + g_print ("[%s] ENTER", source); + break; + case CLUTTER_LEAVE: + g_print ("[%s] LEAVE", source); + break; + case CLUTTER_BUTTON_PRESS: + g_print ("[%s] BUTTON PRESS (click count:%i)", + source, event->button.click_count); + break; + case CLUTTER_BUTTON_RELEASE: + g_print ("[%s] BUTTON RELEASE (click count:%i)", + source, event->button.click_count); + + if (clutter_event_get_source (event) == CLUTTER_ACTOR (stage)) + clutter_stage_set_key_focus (stage, NULL); + else if (clutter_event_get_source (event) == actor + && clutter_actor_get_parent (actor) == CLUTTER_ACTOR (stage)) + clutter_stage_set_key_focus (stage, actor); + break; + case CLUTTER_SCROLL: + g_print ("[%s] BUTTON SCROLL (click count:%i)", + source, event->button.click_count); + break; + case CLUTTER_STAGE_STATE: + g_print ("[%s] STAGE STATE", source); + break; + case CLUTTER_DESTROY_NOTIFY: + g_print ("[%s] DESTROY NOTIFY", source); + break; + case CLUTTER_CLIENT_MESSAGE: + g_print ("[%s] CLIENT MESSAGE", source); + break; + case CLUTTER_DELETE: + g_print ("[%s] DELETE", source); + break; + case CLUTTER_NOTHING: + return FALSE; + } + + if (clutter_event_get_source (event) == actor) + g_print (" *source*"); + + g_print ("\n"); + + return FALSE; +} + +G_MODULE_EXPORT int +test_events_main (int argc, char *argv[]) +{ + ClutterActor *stage, *actor, *focus_box, *group; + ClutterColor rcol = { 0xff, 0, 0, 0xff}, + bcol = { 0, 0, 0xff, 0xff }, + gcol = { 0, 0xff, 0, 0xff }, + ycol = { 0xff, 0xff, 0, 0xff }, + ncol = { 0, 0, 0, 0xff }; + + clutter_init (&argc, &argv); + + + + stage = clutter_stage_get_default (); + g_signal_connect (stage, "event", G_CALLBACK (input_cb), "stage"); + + g_signal_connect (stage, "fullscreen", + G_CALLBACK (stage_state_cb), "fullscreen"); + g_signal_connect (stage, "unfullscreen", + G_CALLBACK (stage_state_cb), "unfullscreen"); + g_signal_connect (stage, "activate", + G_CALLBACK (stage_state_cb), "activate"); + g_signal_connect (stage, "deactivate", + G_CALLBACK (stage_state_cb), "deactivate"); + + g_signal_connect (stage, "captured-event", G_CALLBACK (capture_cb), NULL); + + focus_box = clutter_rectangle_new_with_color (&ncol); + clutter_container_add (CLUTTER_CONTAINER(stage), focus_box, NULL); + + actor = clutter_rectangle_new_with_color (&rcol); + clutter_actor_set_size (actor, 100, 100); + clutter_actor_set_position (actor, 100, 100); + + clutter_actor_set_reactive (actor, TRUE); + + clutter_container_add (CLUTTER_CONTAINER (stage), actor, NULL); + + g_signal_connect (actor, "event", G_CALLBACK (input_cb), "red box"); + g_signal_connect (actor, "focus-in", G_CALLBACK (key_focus_in_cb), + focus_box); + + /* Toggle motion - enter/leave capture */ + g_signal_connect (actor, "button-press-event", + G_CALLBACK (red_button_cb), NULL); + + clutter_stage_set_key_focus (CLUTTER_STAGE (stage), actor); + + actor = clutter_rectangle_new_with_color (&gcol); + clutter_actor_set_size (actor, 100, 100); + clutter_actor_set_position (actor, 250, 100); + + clutter_actor_set_reactive (actor, TRUE); + + clutter_container_add (CLUTTER_CONTAINER (stage), actor, NULL); + + g_signal_connect (actor, "event", G_CALLBACK (input_cb), "green box"); + g_signal_connect (actor, "focus-in", G_CALLBACK (key_focus_in_cb), + focus_box); + + g_signal_connect (actor, "captured-event", G_CALLBACK (capture_cb), NULL); + + actor = clutter_rectangle_new_with_color (&bcol); + clutter_actor_set_size (actor, 100, 100); + clutter_actor_set_position (actor, 400, 100); + + clutter_actor_set_reactive (actor, TRUE); + + clutter_container_add (CLUTTER_CONTAINER(stage), actor, NULL); + + g_signal_connect (actor, "event", G_CALLBACK (input_cb), "blue box"); + g_signal_connect (actor, "focus-in", G_CALLBACK (key_focus_in_cb), + focus_box); + /* Fullscreen */ + g_signal_connect (actor, "button-press-event", + G_CALLBACK (blue_button_cb), NULL); + + /* non reactive */ + actor = clutter_rectangle_new_with_color (&ncol); + clutter_actor_set_size (actor, 400, 50); + clutter_actor_set_position (actor, 100, 250); + + clutter_container_add (CLUTTER_CONTAINER(stage), actor, NULL); + + g_signal_connect (actor, "event", G_CALLBACK (input_cb), "blue box"); + g_signal_connect (actor, "focus-in", G_CALLBACK (key_focus_in_cb), + focus_box); + + g_signal_connect (stage, "focus-in", G_CALLBACK (key_focus_in_cb), + focus_box); + + /* non reactive group, with reactive child */ + actor = clutter_rectangle_new_with_color (&ycol); + clutter_actor_set_size (actor, 100, 100); + clutter_actor_set_reactive (actor, TRUE); + + g_signal_connect (actor, "event", G_CALLBACK (input_cb), "yellow box"); + + /* note group not reactive */ + group = clutter_group_new (); + clutter_container_add (CLUTTER_CONTAINER (group), actor, NULL); + clutter_container_add (CLUTTER_CONTAINER (stage), group, NULL); + clutter_actor_set_position (group, 100, 350); + clutter_actor_show_all (group); + + clutter_actor_show_all (CLUTTER_ACTOR (stage)); + + clutter_main(); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-fbo.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-fbo.c --- clutter-0.8.4/tests/interactive/test-fbo.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-fbo.c 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,219 @@ +#include "../config.h" + +/*#define TEST_GROUP */ + +/* These variables are used instead of the standard GLSL variables on + GLES 2 */ +#ifdef HAVE_COGL_GLES2 + +#define GLES2_VARS \ + "precision mediump float;\n" \ + "varying vec2 tex_coord;\n" \ + "varying vec4 frag_color;\n" +#define TEX_COORD "tex_coord" +#define COLOR_VAR "frag_color" + +#else /* HAVE_COGL_GLES2 */ + +#define GLES2_VARS "" +#define TEX_COORD "gl_TexCoord[0]" +#define COLOR_VAR "gl_Color" + +#endif /* HAVE_COGL_GLES2 */ + +#include + +#include +#include +#include +#include + +ClutterActor* +make_source(void) +{ + ClutterActor *source, *actor; + GError *error = NULL; + + ClutterColor yellow = {0xff, 0xff, 0x00, 0xff}; + + source = clutter_group_new(); + actor = clutter_texture_new_from_file ("redhand.png", &error); + if (!actor) + g_error("pixbuf load failed: %s", error ? error->message : "Unknown"); + + clutter_group_add (source, actor); + + actor = clutter_text_new_with_text ("Sans Bold 50px", "Clutter"); + + clutter_text_set_color (CLUTTER_TEXT (actor), &yellow); + clutter_actor_set_y (actor, clutter_actor_get_height(source) + 5); + clutter_group_add (source, actor); + + return source; +} + +ClutterShader* +make_shader(void) +{ + ClutterShader *shader; + GError *error = NULL; + + shader = clutter_shader_new (); + clutter_shader_set_fragment_source (shader, + + GLES2_VARS + "uniform float radius ;" + "uniform sampler2D rectTexture;" + "uniform float x_step, y_step;" + "" + "void main()" + "{" + " vec4 color = texture2D(rectTexture, " TEX_COORD ".st);" + " float u;" + " float v;" + " int count = 1;" + " for (u=-radius;umessage); + g_error_free (error); + } + + return shader; +} + +G_MODULE_EXPORT gint +test_fbo_main (gint argc, gchar *argv[]) +{ + ClutterColor blue = {0x33, 0x44, 0x55, 0xff}; + + ClutterActor *fbo; + ClutterActor *onscreen_source, *offscreen_source, *trans_source; + ClutterActor *foo_source; + ClutterActor *stage; + ClutterActor *clone; + ClutterShader *shader; + gint padx, pady; + gint fbo_width, fbo_height; + + clutter_init (&argc, &argv); + + if (clutter_feature_available (CLUTTER_FEATURE_OFFSCREEN) == FALSE) + g_error("This test requires CLUTTER_FEATURE_OFFSCREEN"); + + stage = clutter_stage_get_default (); + clutter_stage_set_color (CLUTTER_STAGE (stage), &blue); + + /* Create the first source */ + onscreen_source = make_source(); + clutter_actor_show_all (onscreen_source); + clutter_group_add (stage, onscreen_source); + + /* Basic sizing for alignment */ + fbo_width = clutter_actor_get_width (onscreen_source); + fbo_height = clutter_actor_get_height (onscreen_source); + padx = fbo_width + 10; + pady = fbo_height + 10; + clutter_actor_set_size (stage, padx*4, pady*2); + + /* Second hand from fbo onscreen */ + if ((fbo = clutter_texture_new_from_actor (onscreen_source)) == NULL) + g_error("onscreen fbo creation failed"); + + clutter_actor_set_position (fbo, padx, 0); + clutter_group_add (stage, fbo); + + /* apply a shader to it */ + shader = make_shader(); + clutter_actor_set_shader (fbo, shader); + clutter_actor_set_shader_param_float (fbo, "radius", 2.0); + clutter_actor_set_shader_param_float (fbo, "x_step", + 1.0f / clutter_util_next_p2 (fbo_width)); + clutter_actor_set_shader_param_float (fbo, "y_step", + 1.0f / clutter_util_next_p2 (fbo_height)); + + /* Third from cloning the fbo texture */ + clone = clutter_clone_new (fbo); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), clone); + clutter_actor_set_position (clone, padx*2, 0); + + + /* Forth - an offscreen source */ + offscreen_source = make_source(); + clutter_actor_show_all (offscreen_source); /* need to show() offscreen */ + if ((fbo = clutter_texture_new_from_actor (offscreen_source)) == NULL) + g_error("offscreen fbo creation failed"); + + clutter_actor_set_position (fbo, padx*3, 0); + clutter_group_add (stage, fbo); + + + /* 5th transformed */ + trans_source = make_source(); + clutter_actor_show_all (trans_source); /* need to show() offscreen */ + + clutter_actor_set_scale (trans_source, 2.5, 2.5); + + if ((fbo = clutter_texture_new_from_actor (trans_source)) == NULL) + g_error("transformed fbo creation failed"); + + clutter_actor_set_position (fbo, 0, pady); + clutter_group_add (stage, fbo); + + + /* 6th resized bigger, but after fbo creation */ + trans_source = make_source(); + clutter_actor_show_all (trans_source); /* need to show() offscreen */ + + if ((fbo = clutter_texture_new_from_actor (trans_source)) == NULL) + g_error("transformed fbo creation failed"); + + /* rotate after */ + clutter_actor_move_anchor_point_from_gravity (trans_source, + CLUTTER_GRAVITY_CENTER); + clutter_actor_set_rotation (trans_source, CLUTTER_Z_AXIS, 90.0, 0, 0, 0); + + clutter_actor_set_position (fbo, padx, pady); + clutter_group_add (stage, fbo); + + + /* non visual breaks */ + foo_source = make_source(); + g_object_ref_sink (foo_source); + + clutter_actor_show_all (foo_source); + if ((fbo = clutter_texture_new_from_actor (foo_source)) == NULL) + g_error("foo fbo creation failed"); + + g_object_unref (foo_source); /* fbo should keep it around */ + + clutter_actor_set_position (fbo, padx*3, pady); + clutter_group_add (stage, fbo); + + /* TODO: + * Check realize/unrealize + * get_pixbuf() + * set_rgba on fbo texture. + */ + + clutter_actor_show_all (stage); + clutter_main (); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-fullscreen.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-fullscreen.c --- clutter-0.8.4/tests/interactive/test-fullscreen.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-fullscreen.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,98 @@ +#include +#include +#include + +enum +{ + START, + HIDE, + SHOW, + DONE +}; + +static int state = START; + +static void +on_fullscreen (ClutterStage *stage) +{ + g_debug ("fullscreen set, size: %dx%d, mapped: %s", + clutter_actor_get_width (CLUTTER_ACTOR (stage)), + clutter_actor_get_height (CLUTTER_ACTOR (stage)), + CLUTTER_ACTOR_IS_MAPPED (stage) ? "true" : "false"); +} + +static void +on_unfullscreen (ClutterStage *stage) +{ + g_debug ("fullscreen unset, size: %dx%d, mapped: %s", + clutter_actor_get_width (CLUTTER_ACTOR (stage)), + clutter_actor_get_height (CLUTTER_ACTOR (stage)), + CLUTTER_ACTOR_IS_MAPPED (stage) ? "true" : "false"); +} + +static gboolean +toggle_fullscreen (gpointer dummy) +{ + ClutterActor *stage = clutter_stage_get_default (); + gboolean is_fullscreen = FALSE; + + g_object_get (G_OBJECT (stage), "fullscreen", &is_fullscreen, NULL); + + switch (state) + { + case START: + g_debug ("start: is_fullscreen := %s", is_fullscreen ? "true" : "false"); + clutter_actor_hide (stage); + state = HIDE; + return TRUE; + + case HIDE: + g_debug ("hide: is_fullscreen := %s", is_fullscreen ? "true" : "false"); + clutter_actor_show (stage); + state = SHOW; + return TRUE; + + case SHOW: + g_debug ("show: is_fullscreen := %s", is_fullscreen ? "true" : "false"); + clutter_stage_unfullscreen (CLUTTER_STAGE (stage)); + state = DONE; + return TRUE; + + case DONE: + g_debug ("done: is_fullscreen := %s", is_fullscreen ? "true" : "false"); + clutter_main_quit (); + break; + } + + return FALSE; +} + +G_MODULE_EXPORT int +test_fullscreen_main (int argc, char *argv[]) +{ + ClutterActor *stage; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + g_signal_connect (stage, + "fullscreen", G_CALLBACK (on_fullscreen), + NULL); + g_signal_connect (stage, + "unfullscreen", G_CALLBACK (on_unfullscreen), + NULL); + + clutter_stage_fullscreen (CLUTTER_STAGE (stage)); + clutter_actor_show (stage); + + g_debug ("stage size: %dx%d, mapped: %s", + clutter_actor_get_width (stage), + clutter_actor_get_height (stage), + CLUTTER_ACTOR_IS_MAPPED (stage) ? "true" : "false"); + + g_timeout_add (1000, toggle_fullscreen, NULL); + + clutter_main (); + + return EXIT_SUCCESS; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-grab.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-grab.c --- clutter-0.8.4/tests/interactive/test-grab.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-grab.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,236 @@ +#include +#include + +static void +stage_state_cb (ClutterStage *stage, + gpointer data) +{ + gchar *detail = (gchar*)data; + + printf("[stage signal] %s\n", detail); +} + +static gboolean +debug_event_cb (ClutterActor *actor, + ClutterEvent *event, + gpointer data) +{ + gchar keybuf[9], *source = (gchar*)data; + int len = 0; + + switch (event->type) + { + case CLUTTER_KEY_PRESS: + len = g_unichar_to_utf8 (clutter_keysym_to_unicode (event->key.keyval), + keybuf); + keybuf[len] = '\0'; + printf ("[%s] KEY PRESS '%s'", source, keybuf); + break; + case CLUTTER_KEY_RELEASE: + len = g_unichar_to_utf8 (clutter_keysym_to_unicode (event->key.keyval), + keybuf); + keybuf[len] = '\0'; + printf ("[%s] KEY RELEASE '%s'", source, keybuf); + break; + case CLUTTER_MOTION: + printf("[%s] MOTION", source); + break; + case CLUTTER_ENTER: + printf("[%s] ENTER", source); + break; + case CLUTTER_LEAVE: + printf("[%s] LEAVE", source); + break; + case CLUTTER_BUTTON_PRESS: + printf("[%s] BUTTON PRESS (click count:%i)", + source, event->button.click_count); + break; + case CLUTTER_BUTTON_RELEASE: + printf("[%s] BUTTON RELEASE", source); + break; + case CLUTTER_SCROLL: + printf("[%s] BUTTON SCROLL", source); + break; + case CLUTTER_STAGE_STATE: + printf("[%s] STAGE STATE", source); + break; + case CLUTTER_DESTROY_NOTIFY: + printf("[%s] DESTROY NOTIFY", source); + break; + case CLUTTER_CLIENT_MESSAGE: + printf("[%s] CLIENT MESSAGE\n", source); + break; + case CLUTTER_DELETE: + printf("[%s] DELETE", source); + break; + case CLUTTER_NOTHING: + return FALSE; + } + + if (clutter_event_get_source (event) == actor) + printf(" *source*"); + + printf("\n"); + + return FALSE; +} + +static gboolean +grab_pointer_cb (ClutterActor *actor, + ClutterEvent *event, + gpointer data) +{ + clutter_grab_pointer (actor); + return FALSE; +} + +static gboolean +red_release_cb (ClutterActor *actor, + ClutterEvent *event, + gpointer data) +{ + clutter_ungrab_pointer (); + return FALSE; +} + +static gboolean +blue_release_cb (ClutterActor *actor, + ClutterEvent *event, + gpointer data) +{ + clutter_actor_destroy (actor); + return FALSE; +} + +static gboolean +green_press_cb (ClutterActor *actor, + ClutterEvent *event, + gpointer data) +{ + clutter_set_motion_events_enabled (!clutter_get_motion_events_enabled ()); + + g_print ("per actor motion events are now %s\n", + clutter_get_motion_events_enabled () ? "enabled" : "disabled"); + + return FALSE; +} + +static gboolean +toggle_grab_pointer_cb (ClutterActor *actor, + ClutterEvent *event, + gpointer data) +{ + /* we only deal with the event if the source is ourself */ + if (event->button.source == actor) + { + if (clutter_get_pointer_grab () != NULL) + clutter_ungrab_pointer (); + else + clutter_grab_pointer (actor); + } + return FALSE; +} + +static gboolean +cyan_press_cb (ClutterActor *actor, + ClutterEvent *event, + gpointer data) +{ + if (clutter_get_keyboard_grab () != NULL) + clutter_ungrab_keyboard (); + else + clutter_grab_keyboard (actor); + return FALSE; +} + + + +G_MODULE_EXPORT int +test_grab_main (int argc, char *argv[]) +{ + ClutterActor *stage, *actor; + ClutterColor rcol = { 0xff, 0, 0, 0xff}, + bcol = { 0, 0, 0xff, 0xff }, + gcol = { 0, 0xff, 0, 0xff }, + ccol = { 0, 0xff, 0xff, 0xff }, + ycol = { 0xff, 0xff, 0, 0xff }; + + clutter_init (&argc, &argv); + + g_print ("Red box: aquire grab on press, releases it on next button release\n"); + g_print ("Blue box: aquire grab on press, destroys the blue box actor on release\n"); + g_print ("Yellow box: aquire grab on press, releases grab on next press on yellow box\n"); + g_print ("Green box: toggle per actor motion events.\n\n"); + g_print ("Cyan box: toggle grab (from cyan box) for keyboard events.\n\n"); + + stage = clutter_stage_get_default (); + g_signal_connect (stage, "event", G_CALLBACK (debug_event_cb), "stage"); + + g_signal_connect (stage, "fullscreen", + G_CALLBACK (stage_state_cb), "fullscreen"); + g_signal_connect (stage, "unfullscreen", + G_CALLBACK (stage_state_cb), "unfullscreen"); + g_signal_connect (stage, "activate", + G_CALLBACK (stage_state_cb), "activate"); + g_signal_connect (stage, "deactivate", + G_CALLBACK (stage_state_cb), "deactivate"); + + actor = clutter_rectangle_new_with_color (&rcol); + clutter_actor_set_size (actor, 100, 100); + clutter_actor_set_position (actor, 100, 100); + clutter_actor_set_reactive (actor, TRUE); + clutter_container_add (CLUTTER_CONTAINER (stage), actor, NULL); + g_signal_connect (actor, "event", G_CALLBACK (debug_event_cb), "red box"); + g_signal_connect (actor, "button-press-event", + G_CALLBACK (grab_pointer_cb), NULL); + g_signal_connect (actor, "button-release-event", + G_CALLBACK (red_release_cb), NULL); + + actor = clutter_rectangle_new_with_color (&ycol); + clutter_actor_set_size (actor, 100, 100); + clutter_actor_set_position (actor, 100, 300); + clutter_actor_set_reactive (actor, TRUE); + clutter_container_add (CLUTTER_CONTAINER (stage), actor, NULL); + g_signal_connect (actor, "event", G_CALLBACK (debug_event_cb), "yellow box"); + g_signal_connect (actor, "button-press-event", + G_CALLBACK (toggle_grab_pointer_cb), NULL); + + actor = clutter_rectangle_new_with_color (&bcol); + clutter_actor_set_size (actor, 100, 100); + clutter_actor_set_position (actor, 300, 100); + clutter_actor_set_reactive (actor, TRUE); + clutter_container_add (CLUTTER_CONTAINER (stage), actor, NULL); + g_signal_connect (actor, "event", + G_CALLBACK (debug_event_cb), "blue box"); + g_signal_connect (actor, "button-press-event", + G_CALLBACK (grab_pointer_cb), NULL); + g_signal_connect (actor, "button-release-event", + G_CALLBACK (blue_release_cb), NULL); + + actor = clutter_rectangle_new_with_color (&gcol); + clutter_actor_set_size (actor, 100, 100); + clutter_actor_set_position (actor, 300, 300); + clutter_actor_set_reactive (actor, TRUE); + clutter_container_add (CLUTTER_CONTAINER (stage), actor, NULL); + g_signal_connect (actor, "event", + G_CALLBACK (debug_event_cb), "green box"); + g_signal_connect (actor, "button-press-event", + G_CALLBACK (green_press_cb), NULL); + + + actor = clutter_rectangle_new_with_color (&ccol); + clutter_actor_set_size (actor, 100, 100); + clutter_actor_set_position (actor, 500, 100); + clutter_actor_set_reactive (actor, TRUE); + clutter_container_add (CLUTTER_CONTAINER (stage), actor, NULL); + g_signal_connect (actor, "event", + G_CALLBACK (debug_event_cb), "cyan box"); + g_signal_connect (actor, "button-press-event", + G_CALLBACK (cyan_press_cb), NULL); + + clutter_actor_show_all (CLUTTER_ACTOR (stage)); + + clutter_main(); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-layout.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-layout.c --- clutter-0.8.4/tests/interactive/test-layout.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-layout.c 2009-01-28 16:45:25.000000000 +0000 @@ -0,0 +1,816 @@ +#include +#include + +#include +#include +#include + +/* layout actor, by Lucas Rocha */ + +#define MY_TYPE_THING (my_thing_get_type ()) +#define MY_THING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MY_TYPE_THING, MyThing)) +#define MY_IS_THING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MY_TYPE_THING)) +#define MY_THING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MY_TYPE_THING, MyThingClass)) +#define MY_IS_THING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MY_TYPE_THING)) +#define MY_THING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MY_TYPE_THING, MyThingClass)) + +typedef struct _MyThing MyThing; +typedef struct _MyThingPrivate MyThingPrivate; +typedef struct _MyThingClass MyThingClass; + +struct _MyThing +{ + ClutterActor parent_instance; + + MyThingPrivate *priv; +}; + +struct _MyThingClass +{ + ClutterActorClass parent_class; +}; + +enum +{ + PROP_0, + + PROP_SPACING, + PROP_PADDING, + PROP_USE_TRANSFORMED_BOX +}; + +static void clutter_container_iface_init (ClutterContainerIface *iface); + +G_DEFINE_TYPE_WITH_CODE (MyThing, + my_thing, + CLUTTER_TYPE_ACTOR, + G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_CONTAINER, + clutter_container_iface_init)); + +#define MY_THING_GET_PRIVATE(obj) \ +(G_TYPE_INSTANCE_GET_PRIVATE ((obj), MY_TYPE_THING, MyThingPrivate)) + +struct _MyThingPrivate +{ + GList *children; + + ClutterUnit spacing; + ClutterUnit padding; + + guint use_transformed_box : 1; +}; + +/* Add, remove, foreach, copied from ClutterGroup code. */ + +static void +my_thing_real_add (ClutterContainer *container, + ClutterActor *actor) +{ + MyThing *group = MY_THING (container); + MyThingPrivate *priv = group->priv; + + g_object_ref (actor); + + priv->children = g_list_append (priv->children, actor); + clutter_actor_set_parent (actor, CLUTTER_ACTOR (group)); + + g_signal_emit_by_name (container, "actor-added", actor); + + /* queue relayout to allocate new item */ + clutter_actor_queue_relayout (CLUTTER_ACTOR (group)); + + g_object_unref (actor); +} + +static void +my_thing_real_remove (ClutterContainer *container, + ClutterActor *actor) +{ + MyThing *group = MY_THING (container); + MyThingPrivate *priv = group->priv; + + g_object_ref (actor); + + priv->children = g_list_remove (priv->children, actor); + clutter_actor_unparent (actor); + + /* At this point, the actor passed to the "actor-removed" signal + * handlers is not parented anymore to the container but since we + * are holding a reference on it, it's still valid + */ + g_signal_emit_by_name (container, "actor-removed", actor); + + /* queue relayout to re-allocate children without the + removed item */ + clutter_actor_queue_relayout (CLUTTER_ACTOR (group)); + + g_object_unref (actor); +} + +static void +my_thing_real_foreach (ClutterContainer *container, + ClutterCallback callback, + gpointer user_data) +{ + MyThingPrivate *priv = MY_THING (container)->priv; + GList *l; + + for (l = priv->children; l; l = l->next) + (* callback) (CLUTTER_ACTOR (l->data), user_data); +} + +static void +clutter_container_iface_init (ClutterContainerIface *iface) +{ + iface->add = my_thing_real_add; + iface->remove = my_thing_real_remove; + iface->foreach = my_thing_real_foreach; +} + +static void +my_thing_set_property (GObject *gobject, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + MyThingPrivate *priv = MY_THING (gobject)->priv; + gboolean needs_relayout = TRUE; + + switch (prop_id) + { + case PROP_SPACING: + priv->spacing = clutter_value_get_unit (value); + break; + + case PROP_PADDING: + priv->padding = clutter_value_get_unit (value); + break; + + case PROP_USE_TRANSFORMED_BOX: + priv->use_transformed_box = g_value_get_boolean (value); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + needs_relayout = FALSE; + break; + } + + /* setting spacing or padding queues a relayout + because they are supposed to change the internal + allocation of children */ + if (needs_relayout) + clutter_actor_queue_relayout (CLUTTER_ACTOR (gobject)); +} + +static void +my_thing_get_property (GObject *gobject, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + MyThingPrivate *priv = MY_THING (gobject)->priv; + + switch (prop_id) + { + case PROP_SPACING: + clutter_value_set_unit (value, priv->spacing); + break; + + case PROP_PADDING: + clutter_value_set_unit (value, priv->padding); + break; + + case PROP_USE_TRANSFORMED_BOX: + g_value_set_boolean (value, priv->use_transformed_box); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +my_thing_finalize (GObject *gobject) +{ + G_OBJECT_CLASS (my_thing_parent_class)->finalize (gobject); +} + +static void +my_thing_dispose (GObject *gobject) +{ + MyThing *self = MY_THING (gobject); + MyThingPrivate *priv = self->priv; + + if (priv->children) + { + g_list_foreach (priv->children, (GFunc) clutter_actor_destroy, NULL); + priv->children = NULL; + } + + G_OBJECT_CLASS (my_thing_parent_class)->dispose (gobject); +} + +static void +my_thing_get_preferred_width (ClutterActor *self, + ClutterUnit for_height, + ClutterUnit *min_width_p, + ClutterUnit *natural_width_p) +{ + MyThingPrivate *priv; + GList *l; + ClutterUnit min_left, min_right; + ClutterUnit natural_left, natural_right; + + priv = MY_THING (self)->priv; + + min_left = 0; + min_right = 0; + natural_left = 0; + natural_right = 0; + + for (l = priv->children; l != NULL; l = l->next) + { + ClutterActor *child; + ClutterUnit child_x, child_min, child_natural; + + child = l->data; + + child_x = clutter_actor_get_xu (child); + + clutter_actor_get_preferred_size (child, + &child_min, NULL, + &child_natural, NULL); + + if (l == priv->children) + { + /* First child */ + min_left = child_x; + natural_left = child_x; + min_right = min_left + child_min; + natural_right = natural_left + child_natural; + } + else + { + /* Union of extents with previous children */ + if (child_x < min_left) + min_left = child_x; + + if (child_x < natural_left) + natural_left = child_x; + + if (child_x + child_min > min_right) + min_right = child_x + child_min; + + if (child_x + child_natural > natural_right) + natural_right = child_x + child_natural; + } + } + + if (min_left < 0) + min_left = 0; + + if (natural_left < 0) + natural_left = 0; + + if (min_right < 0) + min_right = 0; + + if (natural_right < 0) + natural_right = 0; + + g_assert (min_right >= min_left); + g_assert (natural_right >= natural_left); + + if (min_width_p) + *min_width_p = min_right - min_left; + + if (natural_width_p) + *natural_width_p = natural_right - min_left; +} + +static void +my_thing_get_preferred_height (ClutterActor *self, + ClutterUnit for_width, + ClutterUnit *min_height_p, + ClutterUnit *natural_height_p) +{ + MyThingPrivate *priv; + GList *l; + ClutterUnit min_top, min_bottom; + ClutterUnit natural_top, natural_bottom; + + priv = MY_THING (self)->priv; + + min_top = 0; + min_bottom = 0; + natural_top = 0; + natural_bottom = 0; + + for (l = priv->children; l != NULL; l = l->next) + { + ClutterActor *child; + ClutterUnit child_y, child_min, child_natural; + + child = l->data; + + child_y = clutter_actor_get_yu (child); + + clutter_actor_get_preferred_size (child, + NULL, &child_min, + NULL, &child_natural); + + if (l == priv->children) + { + /* First child */ + min_top = child_y; + natural_top = child_y; + min_bottom = min_top + child_min; + natural_bottom = natural_top + child_natural; + } + else + { + /* Union of extents with previous children */ + if (child_y < min_top) + min_top = child_y; + + if (child_y < natural_top) + natural_top = child_y; + + if (child_y + child_min > min_bottom) + min_bottom = child_y + child_min; + + if (child_y + child_natural > natural_bottom) + natural_bottom = child_y + child_natural; + } + } + + if (min_top < 0) + min_top = 0; + + if (natural_top < 0) + natural_top = 0; + + if (min_bottom < 0) + min_bottom = 0; + + if (natural_bottom < 0) + natural_bottom = 0; + + g_assert (min_bottom >= min_top); + g_assert (natural_bottom >= natural_top); + + if (min_height_p) + *min_height_p = min_bottom - min_top; + + if (natural_height_p) + *natural_height_p = natural_bottom - min_top; +} + +static void +my_thing_allocate (ClutterActor *self, + const ClutterActorBox *box, + gboolean origin_changed) +{ + MyThingPrivate *priv; + ClutterUnit current_x, current_y, max_row_height; + GList *l; + + /* chain up to set actor->allocation */ + CLUTTER_ACTOR_CLASS (my_thing_parent_class)->allocate (self, box, + origin_changed); + + priv = MY_THING (self)->priv; + + current_x = priv->padding; + current_y = priv->padding; + max_row_height = 0; + + /* The allocation logic here is to horizontally place children + * side-by-side and reflow into a new row when we run out of + * space + */ + for (l = priv->children; l != NULL; l = l->next) + { + ClutterActor *child; + ClutterUnit natural_width, natural_height; + ClutterActorBox child_box; + + child = l->data; + + clutter_actor_get_preferred_size (child, + NULL, NULL, + &natural_width, &natural_height); + + /* if it fits in the current row, keep it there; otherwise + * reflow into another row + */ + if (current_x + natural_width > box->x2 - box->x1 - priv->padding) + { + current_x = priv->padding; + current_y += max_row_height + priv->spacing; + max_row_height = 0; + } + + child_box.x1 = current_x; + child_box.y1 = current_y; + child_box.x2 = child_box.x1 + natural_width; + child_box.y2 = child_box.y1 + natural_height; + + clutter_actor_allocate (child, &child_box, origin_changed); + + /* if we take into account the transformation of the children + * then we first check if it's transformed; then we get the + * onscreen coordinates of the two points of the bounding box + * of the actor (origin(x, y) and (origin + size)(x,y)) and + * we update the coordinates and area given to the next child + */ + if (priv->use_transformed_box) + { + if (clutter_actor_is_scaled (child) || + clutter_actor_is_rotated (child)) + { + ClutterVertex v1 = { 0, }, v2 = { 0, }; + ClutterActorBox transformed_box = { 0, }; + + /* origin */ + if (!origin_changed) + { + v1.x = 0; + v1.y = 0; + } + else + { + v1.x = box->x1; + v1.y = box->y1; + } + + clutter_actor_apply_transform_to_point (child, &v1, &v2); + transformed_box.x1 = v2.x; + transformed_box.y1 = v2.y; + + /* size */ + v1.x = natural_width; + v1.y = natural_height; + clutter_actor_apply_transform_to_point (child, &v1, &v2); + transformed_box.x2 = v2.x; + transformed_box.y2 = v2.y; + + natural_width = transformed_box.x2 - transformed_box.x1; + natural_height = transformed_box.y2 - transformed_box.y1; + } + } + + /* Record the maximum child height on current row to know + * what's the increment that should be used for the next + * row + */ + if (natural_height > max_row_height) + max_row_height = natural_height; + + current_x += natural_width + priv->spacing; + } +} + +static void +my_thing_paint (ClutterActor *actor) +{ + MyThing *self = MY_THING (actor); + GList *c; + + cogl_push_matrix(); + + /* paint all visible children */ + for (c = self->priv->children; + c != NULL; + c = c->next) + { + ClutterActor *child = c->data; + + g_assert (child != NULL); + + if (CLUTTER_ACTOR_IS_VISIBLE (child)) + clutter_actor_paint (child); + } + + cogl_pop_matrix(); +} + +#define MIN_SIZE 24 +#define MAX_SIZE 64 + +static void +my_thing_class_init (MyThingClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); + + gobject_class->set_property = my_thing_set_property; + gobject_class->get_property = my_thing_get_property; + gobject_class->dispose = my_thing_dispose; + gobject_class->finalize = my_thing_finalize; + + actor_class->get_preferred_width = my_thing_get_preferred_width; + actor_class->get_preferred_height = my_thing_get_preferred_height; + actor_class->allocate = my_thing_allocate; + actor_class->paint = my_thing_paint; + + g_object_class_install_property (gobject_class, + PROP_SPACING, + clutter_param_spec_unit ("spacing", + "Spacing", + "Spacing of the thing", + 0, CLUTTER_MAXUNIT, + 0, + G_PARAM_READWRITE)); + + g_object_class_install_property (gobject_class, + PROP_PADDING, + clutter_param_spec_unit ("padding", + "Padding", + "Padding around the thing", + 0, CLUTTER_MAXUNIT, + 0, + G_PARAM_READWRITE)); + + g_object_class_install_property (gobject_class, + PROP_USE_TRANSFORMED_BOX, + g_param_spec_boolean ("use-transformed-box", + "Use Transformed Box", + "Use transformed box when allocating", + FALSE, + G_PARAM_READWRITE)); + + g_type_class_add_private (klass, sizeof (MyThingPrivate)); +} + +static void +my_thing_init (MyThing *thing) +{ + thing->priv = MY_THING_GET_PRIVATE (thing); +} + +ClutterActor * +my_thing_new (gint padding, + gint spacing) +{ + return g_object_new (MY_TYPE_THING, + "padding", CLUTTER_UNITS_FROM_DEVICE (padding), + "spacing", CLUTTER_UNITS_FROM_DEVICE (spacing), + NULL); + +} + +/* test code */ + +static ClutterActor *box = NULL; +static ClutterActor *icon = NULL; +static ClutterTimeline *main_timeline = NULL; +static ClutterBehaviour *behaviour = NULL; + +static ClutterColor bg_color; + +static void +toggle_property_value (ClutterActor *actor, + const gchar *property_name) +{ + gboolean value; + + g_object_get (G_OBJECT (actor), + property_name, &value, + NULL); + + value = !value; + + g_object_set (G_OBJECT (box), + property_name, value, + NULL); +} + +static void +increase_property_value (ClutterActor *actor, + const char *property_name) +{ + ClutterUnit value; + + g_object_get (G_OBJECT (actor), + property_name, &value, + NULL); + + value = value + CLUTTER_UNITS_FROM_DEVICE (10); + + g_object_set (G_OBJECT (box), + property_name, value, + NULL); +} + +static void +decrease_property_value (ClutterActor *actor, + const char *property_name) +{ + ClutterUnit value; + + g_object_get (G_OBJECT (actor), + property_name, &value, + NULL); + + value = MAX (0, value - CLUTTER_UNITS_FROM_DEVICE (10)); + + g_object_set (G_OBJECT (box), + property_name, value, + NULL); +} + +static ClutterActor * +create_item (void) +{ + ClutterActor *clone = clutter_clone_new (icon); + + gint32 size = g_random_int_range (MIN_SIZE, MAX_SIZE); + + clutter_actor_set_size (clone, size, size); + + clutter_behaviour_apply (behaviour, clone); + + return clone; +} + +static gboolean +keypress_cb (ClutterActor *actor, + ClutterKeyEvent *event, + gpointer data) +{ + switch (clutter_key_event_symbol (event)) + { + case CLUTTER_q: + { + clutter_main_quit (); + } + + case CLUTTER_a: + { + if (icon != NULL) + { + ClutterActor *clone = create_item (); + + /* Add one item to container */ + clutter_container_add_actor (CLUTTER_CONTAINER (box), clone); + } + break; + } + + case CLUTTER_d: + { + GList *children = + clutter_container_get_children (CLUTTER_CONTAINER (box)); + + if (children) + { + GList *last = g_list_last (children); + + /* Remove last item on container */ + clutter_container_remove_actor (CLUTTER_CONTAINER (box), + CLUTTER_ACTOR (last->data)); + } + break; + } + + case CLUTTER_w: + { + decrease_property_value (box, "padding"); + break; + } + + case CLUTTER_e: + { + increase_property_value (box, "padding"); + break; + } + + case CLUTTER_r: + { + decrease_property_value (box, "spacing"); + break; + } + + case CLUTTER_s: + { + toggle_property_value (box, "use-transformed-box"); + break; + } + + case CLUTTER_t: + { + increase_property_value (box, "spacing"); + break; + } + + case CLUTTER_z: + { + if (clutter_timeline_is_playing (main_timeline)) + clutter_timeline_pause (main_timeline); + else + clutter_timeline_start (main_timeline); + + break; + } + + default: + break; + } + + return FALSE; +} + +static void +relayout_on_frame (ClutterTimeline *timeline) +{ + gboolean use_transformed_box; + + /* if we care about transformations updating the layout, we need to inform + * the layout that a transformation is happening; this is either done by + * attaching a notification on the transformation properties or by simply + * queuing a relayout on each frame of the timeline used to drive the + * behaviour. for simplicity's sake, we used the latter + */ + + g_object_get (G_OBJECT (box), + "use-transformed-box", &use_transformed_box, + NULL); + + if (use_transformed_box) + clutter_actor_queue_relayout (box); +} + +G_MODULE_EXPORT int +test_layout_main (int argc, char *argv[]) +{ + ClutterActor *stage, *instructions; + ClutterAlpha *alpha; + gint i; + GError *error = NULL; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + clutter_actor_set_size (stage, 800, 600); + + clutter_color_parse ("Red", &bg_color); + + main_timeline = clutter_timeline_new_for_duration (2000); + clutter_timeline_set_loop (main_timeline, TRUE); + g_signal_connect (main_timeline, "new-frame", + G_CALLBACK (relayout_on_frame), + NULL); + + alpha = clutter_alpha_new_full (main_timeline, CLUTTER_LINEAR); + behaviour = clutter_behaviour_scale_new (alpha, 1.0, 1.0, 2.0, 2.0); + + box = my_thing_new (10, 10); + + clutter_actor_set_position (box, 20, 20); + clutter_actor_set_size (box, 350, -1); + + icon = clutter_texture_new_from_file ("redhand.png", &error); + if (error) + g_error ("Unable to load 'redhand.png': %s", error->message); + + for (i = 0; i < 33; i++) + { + ClutterActor *clone = create_item (); + + clutter_container_add_actor (CLUTTER_CONTAINER (box), clone); + } + + clutter_container_add_actor (CLUTTER_CONTAINER (stage), box); + + instructions = clutter_text_new_with_text ("Sans 14", + "Instructions:\n" + "a - add a new item\n" + "d - remove last item\n" + "z - start/pause behaviour\n" + "w - decrease padding\n" + "e - increase padding\n" + "r - decrease spacing\n" + "t - increase spacing\n" + "s - use transformed box\n" + "q - quit"); + + clutter_text_set_use_markup (CLUTTER_TEXT (instructions), TRUE); + clutter_actor_set_position (instructions, 450, 10); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), instructions); + + g_signal_connect (stage, "key-release-event", + G_CALLBACK (keypress_cb), + NULL); + + clutter_actor_show (stage); + + clutter_main (); + + g_object_unref (main_timeline); + g_object_unref (behaviour); + + return EXIT_SUCCESS; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-main.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-main.c --- clutter-0.8.4/tests/interactive/test-main.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-main.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,39 @@ +#include +#include + + +int +main (int argc, char **argv) +{ + GModule *module; + char *unit_test; + char *main_symbol_name; + gpointer func; + int (*unit_test_main) (int argc, char **argv); + int ret; + + if (argc < 2) + g_error ("Usage: %s unit_test", argv[0]); + + module = g_module_open (NULL, 0); + if (!module) + g_error ("Failed to open self for symbol lookup"); + + unit_test = g_path_get_basename (argv[1]); + + main_symbol_name = g_strdup_printf ("%s_main", unit_test); + main_symbol_name = g_strdelimit (main_symbol_name, "-", '_'); + + if (!g_module_symbol (module, main_symbol_name, &func)) + g_error ("Failed to look up main symbol for the test: %s", unit_test); + + unit_test_main = func; + ret = unit_test_main (argc - 1, argv + 1); + + g_free (unit_test); + g_free (main_symbol_name); + g_module_close (module); + + return ret; +} + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-model.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-model.c --- clutter-0.8.4/tests/interactive/test-model.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-model.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,236 @@ +#include +#include +#include + +enum +{ + COLUMN_FOO, + COLUMN_BAR, + + N_COLUMNS +}; + +static void +print_iter (ClutterModelIter *iter, + const gchar *text) +{ + ClutterModel *model; + gint i; + gchar *string; + + model = clutter_model_iter_get_model (iter); + + clutter_model_iter_get (iter, COLUMN_FOO, &i, COLUMN_BAR, &string, -1); + + g_print ("[row:%02d]: %s: (%s: %d), (%s: %s)\n", + clutter_model_iter_get_row (iter), + text, + clutter_model_get_column_name (model, COLUMN_FOO), i, + clutter_model_get_column_name (model, COLUMN_BAR), string); + + g_free (string); +} + +static gboolean +foreach_func (ClutterModel *model, + ClutterModelIter *iter, + gpointer dummy) +{ + gint i; + gchar *string; + + clutter_model_iter_get (iter, COLUMN_FOO, &i, COLUMN_BAR, &string, -1); + + g_print ("[row:%02d]: Foreach: %d, %s\n", + clutter_model_iter_get_row (iter), + i, string); + + g_free (string); + + return TRUE; +} + +static gboolean +filter_func (ClutterModel *model, + ClutterModelIter *iter, + gpointer dummy) +{ + gint i = 0; + + clutter_model_iter_get (iter, COLUMN_FOO, &i, -1); + + return !(i % 2); +} + +static gint +sort_func (ClutterModel *model, + const GValue *a, + const GValue *b, + gpointer dummy) +{ + return -1 * strcmp (g_value_get_string (a), g_value_get_string (b)); +} + +static void +on_row_changed (ClutterModel *model, + ClutterModelIter *iter) +{ + print_iter (iter, "Changed"); +} + +static void +filter_model (ClutterModel *model) +{ + ClutterModelIter *iter; + + g_print ("\n* Filter function: even rows\n"); + clutter_model_set_filter (model, filter_func, NULL, NULL); + + iter = clutter_model_get_first_iter (model); + while (!clutter_model_iter_is_last (iter)) + { + print_iter (iter, "Filtered Forward Iteration"); + + iter = clutter_model_iter_next (iter); + } + g_object_unref (iter); + + g_print ("\n* Sorting function: reverse alpha\n"); + clutter_model_set_sort (model, COLUMN_BAR, sort_func, NULL, NULL); + + g_signal_connect (model, "row-changed", G_CALLBACK (on_row_changed), NULL); + + iter = clutter_model_get_iter_at_row (model, 0); + clutter_model_iter_set (iter, COLUMN_BAR, "Changed string of 0th row, " + "automatically gets sorted", + -1); + g_object_unref (iter); + + clutter_model_foreach (model, foreach_func, NULL); + + g_print ("\n* Unset filter\n"); + clutter_model_set_filter (model, NULL, NULL, NULL); + + while (clutter_model_get_n_rows (model)) + clutter_model_remove (model, 0); + + clutter_main_quit (); +} + +static void +iterate (ClutterModel *model) +{ + ClutterModelIter *iter; + + iter = clutter_model_get_first_iter (model); + + while (!clutter_model_iter_is_last (iter)) + { + print_iter (iter, "Forward Iteration"); + iter = clutter_model_iter_next (iter); + } + g_object_unref (iter); + + iter = clutter_model_get_last_iter (model); + do + { + print_iter (iter, "Reverse Iteration"); + iter = clutter_model_iter_prev (iter); + } + while (!clutter_model_iter_is_first (iter)); + + print_iter (iter, "Reverse Iteration"); + g_object_unref (iter); + + filter_model (model); +} + + +static gboolean +populate_model (ClutterModel *model) +{ + gint i; + + for (i = 0; i < 10; i++) + { + gchar *string = g_strdup_printf ("String %d", i); + + clutter_model_append (model, + COLUMN_FOO, i, + COLUMN_BAR, string, + -1); + g_free (string); + } + + clutter_model_foreach (model, foreach_func, NULL); + iterate (model); + + return FALSE; +} + +static void +on_row_added (ClutterModel *model, + ClutterModelIter *iter, + gpointer dummy) +{ + gint i; + gchar *string; + + clutter_model_iter_get (iter, COLUMN_FOO, &i, COLUMN_BAR, &string, -1); + + g_print ("[row:%02d]: Added: %d, %s\n", + clutter_model_iter_get_row (iter), + i, string); + + g_free (string); +} + +static void +on_row_removed (ClutterModel *model, + ClutterModelIter *iter, + gpointer dummy) +{ + print_iter (iter, "Removed"); +} + +static void +on_sort_changed (ClutterModel *model) +{ + g_print ("*** Sort Changed ***\n\n"); + clutter_model_foreach (model, foreach_func, NULL); +} + +static void +on_filter_changed (ClutterModel *model) +{ + g_print ("*** Filter Changed ***\n\n"); +} + +G_MODULE_EXPORT int +test_model_main (int argc, char *argv[]) +{ + ClutterModel *model; + + clutter_init (&argc, &argv); + + model = clutter_list_model_new (N_COLUMNS, + G_TYPE_INT, "Foo", + G_TYPE_STRING, "Bar"); + + g_timeout_add (1000, (GSourceFunc) populate_model, model); + + g_signal_connect (model, "row-added", + G_CALLBACK (on_row_added), NULL); + g_signal_connect (model, "row-removed", + G_CALLBACK (on_row_removed), NULL); + g_signal_connect (model, "sort-changed", + G_CALLBACK (on_sort_changed), NULL); + g_signal_connect (model, "filter-changed", + G_CALLBACK (on_filter_changed), NULL); + + clutter_main(); + + g_object_unref (model); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-multistage.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-multistage.c --- clutter-0.8.4/tests/interactive/test-multistage.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-multistage.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,131 @@ +#include +#include + +static gint n_stages = 1; + +static gboolean +tex_button_cb (ClutterActor *actor, + ClutterEvent *event, + gpointer data) +{ + clutter_actor_hide (actor); + + return TRUE; +} + +static gboolean +on_button_press (ClutterActor *actor, + ClutterEvent *event, + gpointer data) +{ + ClutterActor *new_stage; + ClutterActor *label, *tex; + gint width, height; + gchar *stage_label, *win_title; + ClutterColor color = { 0xdd, 0x33, 0xdd, 0xff }; + ClutterColor white = { 0x99, 0x99, 0x99, 0xff }; + ClutterTimeline *timeline; + ClutterAlpha *alpha; + ClutterBehaviour *r_behave; + + new_stage = clutter_stage_new (); + if (!new_stage) + return FALSE; + + /* FIXME: below should really be automatic */ + /* clutter_stage_ensure_cogl_context (CLUTTER_STAGE(new_stage)); */ + + clutter_stage_set_color (CLUTTER_STAGE (new_stage), &color); + clutter_actor_set_size (new_stage, 320, 240); + + tex = clutter_texture_new_from_file ("redhand.png", NULL); + + if (!tex) + g_error ("pixbuf load failed"); + + clutter_actor_set_reactive (tex, TRUE); + g_signal_connect (tex, "button-press-event", + G_CALLBACK (tex_button_cb), NULL); + + clutter_container_add_actor (CLUTTER_CONTAINER (new_stage), tex); + + stage_label = g_strdup_printf ("Stage: %d", ++n_stages); + label = clutter_text_new_with_text ("Mono 12", stage_label); + + clutter_text_set_color (CLUTTER_TEXT (label), &white); + clutter_text_set_use_markup (CLUTTER_TEXT (label), TRUE); + width = (clutter_actor_get_width (new_stage) + - clutter_actor_get_width (label)) / 2; + height = (clutter_actor_get_height (new_stage) + - clutter_actor_get_height (label)) / 2; + clutter_actor_set_position (label, width, height); + clutter_container_add_actor (CLUTTER_CONTAINER (new_stage), label); + clutter_actor_show (label); + g_free (stage_label); + + /* + g_signal_connect (new_stage, "button-press-event", + G_CALLBACK (clutter_actor_destroy), + NULL); + */ + + win_title = g_strdup_printf ("Stage:%p", new_stage); + clutter_stage_set_title (CLUTTER_STAGE(new_stage), win_title); + + timeline = clutter_timeline_new_for_duration (2000); + g_object_set (timeline, "loop", TRUE, NULL); + + alpha = clutter_alpha_new_full (timeline, CLUTTER_LINEAR); + r_behave = clutter_behaviour_rotate_new (alpha, + CLUTTER_Y_AXIS, + CLUTTER_ROTATE_CW, + 0.0, 360.0); + + clutter_behaviour_rotate_set_center (CLUTTER_BEHAVIOUR_ROTATE (r_behave), + clutter_actor_get_width (label)/2, + 0, + 0); + + clutter_behaviour_apply (r_behave, label); + clutter_timeline_start (timeline); + + clutter_actor_show_all (new_stage); + + return TRUE; +} + +G_MODULE_EXPORT int +test_multistage_main (int argc, char *argv[]) +{ + ClutterActor *stage_default; + ClutterActor *label; + gint width, height; + gchar *win_title; + + clutter_init (&argc, &argv); + + stage_default = clutter_stage_get_default (); + g_signal_connect (stage_default, "button-press-event", + G_CALLBACK (on_button_press), + NULL); + + label = clutter_text_new_with_text ("Mono 16", "Default stage"); + width = (clutter_actor_get_width (stage_default) + - clutter_actor_get_width (label)) + / 2; + height = (clutter_actor_get_height (stage_default) + - clutter_actor_get_height (label)) + / 2; + clutter_actor_set_position (label, width, height); + clutter_container_add_actor (CLUTTER_CONTAINER (stage_default), label); + clutter_actor_show (label); + + win_title = g_strdup_printf ("Stage:%p", stage_default); + clutter_stage_set_title (CLUTTER_STAGE(stage_default), win_title); + + clutter_actor_show (stage_default); + + clutter_main (); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-offscreen.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-offscreen.c --- clutter-0.8.4/tests/interactive/test-offscreen.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-offscreen.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,32 @@ +#include +#include + +/* Very simple test just to see what happens setting up offscreen rendering */ + +G_MODULE_EXPORT int +test_offscreen_main (int argc, char *argv[]) +{ + ClutterActor *stage; + gboolean offscreen; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + + /* Attempt to set up rendering offscreen */ + g_object_set (stage, "offscreen", TRUE, NULL); + + /* See if it worked */ + g_object_get (stage, "offscreen", &offscreen, NULL); + + if (offscreen == FALSE) + printf ("FAIL: Unable to setup offscreen rendering\n."); + else + printf ("SUCCESS: Able to setup offscreen rendering\n."); + + clutter_actor_show_all (CLUTTER_ACTOR (stage)); + + clutter_main(); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-paint-wrapper.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-paint-wrapper.c --- clutter-0.8.4/tests/interactive/test-paint-wrapper.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-paint-wrapper.c 2009-01-29 08:31:37.000000000 +0000 @@ -0,0 +1,317 @@ +#include +#include + +#if defined (_MSC_VER) && !defined (_USE_MATH_DEFINES) +#define _USE_MATH_DEFINES +#endif + +#include +#include +#include +#include + +#define TRAILS 0 +#define NHANDS 6 +#define RADIUS ((CLUTTER_STAGE_WIDTH()+CLUTTER_STAGE_HEIGHT())/NHANDS) + +typedef struct SuperOH +{ + ClutterActor **hand, *bgtex; + ClutterActor *group; + + gboolean *paint_guards; + +} SuperOH; + +static gint n_hands = NHANDS; + +static GOptionEntry super_oh_entries[] = { + { + "num-hands", 'n', + 0, + G_OPTION_ARG_INT, &n_hands, + "Number of hands", "HANDS" + }, + { NULL } +}; + +static gint +get_radius (void) +{ + return (CLUTTER_STAGE_HEIGHT() + CLUTTER_STAGE_HEIGHT()) / n_hands ; +} + +/* input handler */ +static gboolean +input_cb (ClutterStage *stage, + ClutterEvent *event, + gpointer data) +{ + if (event->type == CLUTTER_BUTTON_PRESS) + { + ClutterButtonEvent *button_event; + ClutterActor *e; + gint x, y; + + clutter_event_get_coords (event, &x, &y); + + button_event = (ClutterButtonEvent *) event; + g_print ("*** button press event (button:%d) ***\n", + button_event->button); + + e = clutter_stage_get_actor_at_pos (stage, x, y); + + if (e && (CLUTTER_IS_TEXTURE (e) || CLUTTER_IS_CLONE (e))) + { + clutter_actor_hide (e); + return TRUE; + } + } + else if (event->type == CLUTTER_KEY_RELEASE) + { + ClutterKeyEvent *kev = (ClutterKeyEvent *) event; + + g_print ("*** key press event (key:%c) ***\n", + clutter_key_event_symbol (kev)); + + if (clutter_key_event_symbol (kev) == CLUTTER_q) + { + clutter_main_quit (); + return TRUE; + } + } + + return FALSE; +} + + +/* Timeline handler */ +static void +frame_cb (ClutterTimeline *timeline, + gint frame_num, + gpointer data) +{ + SuperOH *oh = (SuperOH *)data; + gint i; + + /* Rotate everything clockwise about stage center*/ + + clutter_actor_set_rotation (CLUTTER_ACTOR (oh->group), + CLUTTER_Z_AXIS, + frame_num, + CLUTTER_STAGE_WIDTH () / 2, + CLUTTER_STAGE_HEIGHT () / 2, + 0); + + for (i = 0; i < n_hands; i++) + { + gdouble scale_x, scale_y; + + clutter_actor_get_scale (oh->hand[i], &scale_x, &scale_y); + + /* Rotate each hand around there centers - to get this we need + * to take into account any scaling. + * + * FIXME: scaling causes drift so disabled for now. Need rotation + * unit based functions to fix. + */ + clutter_actor_set_rotation (oh->hand[i], CLUTTER_Z_AXIS, + - 6.0 * frame_num, 0, 0, 0); + } +} + +static void +hand_pre_paint (ClutterActor *actor, + gpointer user_data) +{ + SuperOH *oh = (SuperOH *) user_data; + guint w, h; + int actor_num; + + for (actor_num = 0; oh->hand[actor_num] != actor; actor_num++); + + g_assert (oh->paint_guards[actor_num] == FALSE); + + clutter_actor_get_size (actor, &w, &h); + + cogl_set_source_color4ub (255, 0, 0, 128); + cogl_rectangle (0, 0, w / 2, h / 2); + + oh->paint_guards[actor_num] = TRUE; +} + +static void +hand_post_paint (ClutterActor *actor, + gpointer user_data) +{ + SuperOH *oh = (SuperOH *) user_data; + guint w, h; + int actor_num; + + for (actor_num = 0; oh->hand[actor_num] != actor; actor_num++); + + g_assert (oh->paint_guards[actor_num] == TRUE); + + clutter_actor_get_size (actor, &w, &h); + + cogl_set_source_color4ub (0, 255, 0, 128); + cogl_rectangle (w / 2, h / 2, w, h); + + oh->paint_guards[actor_num] = FALSE; +} + +static gdouble +my_sine_wave (ClutterAlpha *alpha, + gpointer dummy G_GNUC_UNUSED) +{ + ClutterTimeline *timeline = clutter_alpha_get_timeline (alpha); + gdouble progress = clutter_timeline_get_progress (timeline); + + return sin (progress * G_PI); +} + +G_MODULE_EXPORT int +test_paint_wrapper_main (int argc, char *argv[]) +{ + ClutterTimeline *timeline; + ClutterAlpha *alpha; + ClutterBehaviour *scaler_1, *scaler_2; + ClutterActor *stage; + ClutterColor stage_color = { 0x61, 0x64, 0x8c, 0xff }; + SuperOH *oh; + gint i; + GError *error; + + error = NULL; + + clutter_init_with_args (&argc, &argv, + NULL, + super_oh_entries, + NULL, + &error); + if (error) + { + g_warning ("Unable to initialise Clutter:\n%s", + error->message); + g_error_free (error); + + exit (1); + } + + stage = clutter_stage_get_default (); + clutter_actor_set_size (stage, 800, 600); + + clutter_stage_set_title (CLUTTER_STAGE (stage), "Actors Test"); + clutter_stage_set_color (CLUTTER_STAGE (stage), + &stage_color); + + oh = g_new(SuperOH, 1); + + /* Create a timeline to manage animation */ + timeline = clutter_timeline_new (360, 60); /* num frames, fps */ + g_object_set (timeline, "loop", TRUE, NULL); /* have it loop */ + + /* fire a callback for frame change */ + g_signal_connect (timeline, "new-frame", G_CALLBACK (frame_cb), oh); + + /* Set up some behaviours to handle scaling */ + alpha = clutter_alpha_new_with_func (timeline, my_sine_wave, NULL, NULL); + + scaler_1 = clutter_behaviour_scale_new (alpha, + 0.5, 0.5, + 1.0, 1.0); + + scaler_2 = clutter_behaviour_scale_new (alpha, + 1.0, 1.0, + 0.5, 0.5); + + /* create a new group to hold multiple actors in a group */ + oh->group = clutter_group_new(); + + oh->hand = g_new (ClutterActor*, n_hands); + for (i = 0; i < n_hands; i++) + { + gint x, y, w, h; + gint radius = get_radius (); + + /* Create a texture from file, then clone in to same resources */ + if (i == 0) + { + if ((oh->hand[i] = clutter_texture_new_from_file ("redhand.png", + &error)) == NULL) + { + g_error ("image load failed: %s", error->message); + exit (1); + } + } + else + oh->hand[i] = clutter_clone_new (oh->hand[0]); + + /* paint something before each hand */ + g_signal_connect (oh->hand[i], + "paint", G_CALLBACK (hand_pre_paint), + oh); + + /* paint something after each hand */ + g_signal_connect_after (oh->hand[i], + "paint", G_CALLBACK (hand_post_paint), + oh); + + /* Place around a circle */ + w = clutter_actor_get_width (oh->hand[0]); + h = clutter_actor_get_height (oh->hand[0]); + + x = CLUTTER_STAGE_WIDTH () / 2 + + radius + * cos (i * M_PI / (n_hands / 2)) + - w / 2; + + y = CLUTTER_STAGE_HEIGHT () / 2 + + radius + * sin (i * M_PI / (n_hands / 2)) + - h / 2; + + clutter_actor_set_position (oh->hand[i], x, y); + + clutter_actor_move_anchor_point_from_gravity (oh->hand[i], + CLUTTER_GRAVITY_CENTER); + + /* Add to our group group */ + clutter_container_add_actor (CLUTTER_CONTAINER (oh->group), oh->hand[i]); + +#if 1 /* FIXME: disabled as causes drift? - see comment above */ + if (i % 2) + clutter_behaviour_apply (scaler_1, oh->hand[i]); + else + clutter_behaviour_apply (scaler_2, oh->hand[i]); +#endif + } + + oh->paint_guards = g_malloc0 (sizeof (gboolean) * n_hands); + + /* Add the group to the stage */ + clutter_container_add_actor (CLUTTER_CONTAINER (stage), + CLUTTER_ACTOR (oh->group)); + + /* Show everying ( and map window ) */ + clutter_actor_show (stage); + + + g_signal_connect (stage, "button-press-event", + G_CALLBACK (input_cb), + oh); + g_signal_connect (stage, "key-release-event", + G_CALLBACK (input_cb), + oh); + + /* and start it */ + clutter_timeline_start (timeline); + + clutter_main (); + + g_free (oh->hand); + g_free (oh->paint_guards); + g_free (oh); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-perspective.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-perspective.c --- clutter-0.8.4/tests/interactive/test-perspective.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-perspective.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,52 @@ +#include +#include + +G_MODULE_EXPORT int +test_perspective_main (int argc, char *argv[]) +{ + ClutterActor *rect; + ClutterActor *stage; + ClutterColor red = {0xff, 0, 0, 0xff}, white = {0xff, 0xff, 0xff, 0xff}; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + g_object_set (stage, "fullscreen", TRUE, NULL); + + clutter_stage_set_color (CLUTTER_STAGE (stage), &red); + + rect = clutter_rectangle_new_with_color (&white); + clutter_actor_set_size (rect, + clutter_actor_get_width(stage), + clutter_actor_get_height(stage)); + clutter_actor_set_position (rect, 0, 0); + clutter_group_add (CLUTTER_GROUP (stage), rect); + + rect = clutter_rectangle_new_with_color (&red); + clutter_actor_set_size (rect, 2, 2); + clutter_actor_set_position (rect, 1, 1); + clutter_group_add (CLUTTER_GROUP (stage), rect); + + rect = clutter_rectangle_new_with_color (&red); + clutter_actor_set_size (rect, 2, 2); + clutter_actor_set_position (rect, clutter_actor_get_width(stage)-3, 1); + clutter_group_add (CLUTTER_GROUP (stage), rect); + + rect = clutter_rectangle_new_with_color (&red); + clutter_actor_set_size (rect, 2, 2); + clutter_actor_set_position (rect, 1, clutter_actor_get_height(stage)-3); + clutter_group_add (CLUTTER_GROUP (stage), rect); + + rect = clutter_rectangle_new_with_color (&red); + clutter_actor_set_size (rect, 2, 2); + clutter_actor_set_position (rect, + clutter_actor_get_width(stage)-3, + clutter_actor_get_height(stage)-3); + clutter_group_add (CLUTTER_GROUP (stage), rect); + + clutter_actor_show_all (CLUTTER_ACTOR (stage)); + + clutter_main (); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-pixmap.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-pixmap.c --- clutter-0.8.4/tests/interactive/test-pixmap.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-pixmap.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,263 @@ +#include + +#include +#include +#include + +#if HAVE_CLUTTER_GLX + +#include +#include +#include + +#include +#include + +#include +#include + +#define IMAGE "redhand.png" + +# ifdef USE_GDKPIXBUF +# include + +static gboolean disable_x11 = FALSE; +static gboolean disable_glx = FALSE; + +static GOptionEntry g_options[] = +{ + { "disable-x11", + 0, 0, + G_OPTION_ARG_NONE, + &disable_x11, + "Disable redirection through X11 pixmap", + NULL }, + { "disable-glx", + 0, 0, + G_OPTION_ARG_NONE, + &disable_glx, + "Disable redirection through GLX pixmap", + NULL }, + + { NULL } +}; + +static gboolean +stage_key_release_cb (ClutterActor *actor, + ClutterEvent *event, + gpointer data) +{ + switch (clutter_key_event_symbol (&event->key)) + { + case CLUTTER_q: + case CLUTTER_Q: + clutter_main_quit (); + break; + } + return FALSE; +} + +static gboolean +stage_button_press_cb (ClutterActor *actor, + ClutterEvent *event, + gpointer data) +{ + Pixmap pxm = (Pixmap)data; + Display *dpy = clutter_x11_get_default_display (); + GC gc; + XGCValues gc_values = {0}; + + + gc = XCreateGC (dpy, + pxm, + 0, + &gc_values); + + XDrawLine (dpy, pxm, gc, 0, 0, 100, 100); + + return FALSE; +} + +Pixmap +create_pixmap (guint *width, guint *height, guint *depth) +{ + Display *dpy = clutter_x11_get_default_display (); + Pixmap pixmap; + GdkPixbuf *pixbuf; + GError *error = NULL; + XImage *image; + char *data, *d; + guchar *p, *line, *endofline, *end; + guint w, h, rowstride; + GC gc; + XGCValues gc_values = {0}; + + pixbuf = gdk_pixbuf_new_from_file (IMAGE, &error); + if (error) + g_error ("%s", error->message); + + /* We assume that the image had an alpha channel */ + g_assert (gdk_pixbuf_get_has_alpha (pixbuf)); + + w = gdk_pixbuf_get_width (pixbuf); + h = gdk_pixbuf_get_height (pixbuf); + rowstride = gdk_pixbuf_get_rowstride (pixbuf); + + data = g_malloc (w * h * 4); + image = XCreateImage (dpy, + None, + 32, + ZPixmap, + 0, + data, + w, h, + 8, + w * 4); + + p = gdk_pixbuf_get_pixels (pixbuf); + d = data; + end = p + rowstride*h; + + /* Convert from RGBA as contained in the pixmap to ARGB as used in X */ + for (line = p; line < end ; line += rowstride) + { + p = line; + endofline = p + 4 * w; + + for (p = line; p < endofline; p += 4, d+=4) + { + +# define r ((guint32)(*(p))) +# define g ((guint32)(*(p+1))) +# define b ((guint32)(*(p+2))) +# define a ((guint32)(*(p+3))) + guint32 pixel = + ((a << 24) & 0xFF000000 ) | + ((r << 16) & 0x00FF0000 ) | + ((g << 8) & 0x0000FF00) | + ((b) & 0x000000FF ); + + *((guint32 *)d) = pixel; + + } +# undef r +# undef g +# undef b +# undef a + + } + + g_object_unref (pixbuf); + + pixmap = XCreatePixmap (dpy, + DefaultRootWindow (dpy), + w, h, + 32); + + gc = XCreateGC (dpy, + pixmap, + 0, + &gc_values); + + XPutImage (dpy, + pixmap, + gc, + image, + 0, 0, + 0, 0, + w, h); + + XFreeGC (dpy, gc); + XDestroyImage (image); + + if (width) *width = w; + if (height) *height = h; + if (depth) *depth = 32; + + return pixmap; +} +# endif /* USE_GDKPIXBUF */ + +G_MODULE_EXPORT int +test_pixmap_main (int argc, char **argv) +{ +#ifdef USE_GDKPIXBUF + GOptionContext *context; + ClutterActor *stage, *tex; + Pixmap pixmap; + const ClutterColor gry = { 0x99, 0x99, 0x99, 0xFF }; + Window win_remote; + guint w, h, d; + + clutter_init (&argc, &argv); + + context = g_option_context_new (" - text-pixmap options"); + g_option_context_add_main_entries (context, g_options, NULL); + g_option_context_parse (context, &argc, &argv, NULL); + + if (argc < 2) + g_error ("usage: %s ", argv[0]); + + win_remote = strtol (argv[1], NULL, 0); + + stage = clutter_stage_get_default (); + clutter_stage_set_color (CLUTTER_STAGE (stage), &gry); + + /* a pixmap */ + pixmap = create_pixmap (&w, &h, &d); + + tex = clutter_x11_texture_pixmap_new_with_pixmap (pixmap); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), tex); + /* oddly, the actor's size is 0 until it is realized, even though + pixmap-height is set */ + clutter_actor_set_position (tex, 0, + clutter_actor_get_height (stage) + - clutter_actor_get_height (tex)); + + /* a window */ + if (!disable_x11) + { + tex = clutter_x11_texture_pixmap_new_with_window (win_remote); + + clutter_actor_set_position (tex, 0, 0); + + clutter_container_add_actor (CLUTTER_CONTAINER (stage), tex); + + clutter_x11_texture_pixmap_set_automatic (CLUTTER_X11_TEXTURE_PIXMAP (tex), + TRUE); + } + +# ifdef HAVE_CLUTTER_GLX + /* a window with glx */ + if (!disable_glx) + { + tex = clutter_glx_texture_pixmap_new_with_window (win_remote); + + clutter_actor_set_position (tex, + clutter_actor_get_width (stage) + - clutter_actor_get_width (tex), + 0); + + clutter_container_add_actor (CLUTTER_CONTAINER (stage), tex); + + clutter_x11_texture_pixmap_set_automatic (CLUTTER_X11_TEXTURE_PIXMAP (tex), + TRUE); + } +#endif /* HAVE_CLUTTER_GLX */ + + g_signal_connect (stage, "key-release-event", + G_CALLBACK (stage_key_release_cb), (gpointer)pixmap); + g_signal_connect (stage, "button-press-event", + G_CALLBACK (stage_button_press_cb), (gpointer)pixmap); + + clutter_actor_show_all (stage); + + clutter_main (); +# endif /* USE_GDKPIXBUF */ + + return EXIT_SUCCESS; +} + +#else /* HAVE_CLUTTER_GLX */ +int test_pixmap_main (int argc, char **argv) { return EXIT_SUCCESS; }; +#endif /* HAVE_CLUTTER_GLX */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-project.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-project.c --- clutter-0.8.4/tests/interactive/test-project.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-project.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,239 @@ +#include +#include +#include +#include + +static ClutterActor *main_stage, *rect, *p[5]; + +static void +init_handles () +{ + gint i; + ClutterVertex v[4]; + ClutterVertex v1, v2; + ClutterColor blue = { 0, 0, 0xff, 0xff }; + + clutter_actor_get_abs_allocation_vertices (rect, v); + for (i = 0; i < 4; ++i) + { + p[i] = clutter_rectangle_new_with_color (&blue); + clutter_actor_set_size (p[i], 5, 5); + clutter_actor_set_position (p[i], 0, 0); + clutter_group_add (CLUTTER_GROUP (main_stage), p[i]); + + clutter_actor_set_positionu (p[i], + v[i].x - + clutter_actor_get_widthu (p[i])/2, + v[i].y - + clutter_actor_get_heightu (p[i])/2); + + clutter_actor_raise_top (p[i]); + + clutter_actor_show (p[i]); + } + + v1.x = clutter_actor_get_widthu (rect) / 2; + v1.y = clutter_actor_get_heightu (rect) / 2; + v1.z = 0; + + clutter_actor_apply_transform_to_point (rect, &v1, &v2); + p[4] = clutter_rectangle_new_with_color (&blue); + clutter_actor_set_size (p[4], 5, 5); + clutter_actor_set_position (p[4], 0, 0); + clutter_group_add (CLUTTER_GROUP (main_stage), p[4]); + clutter_actor_set_positionu (p[4], + v2.x - + clutter_actor_get_widthu (p[4])/2, + v2.y - + clutter_actor_get_heightu (p[4])/2); + + clutter_actor_raise_top (p[4]); + + clutter_actor_show (p[4]); +} + +static void +place_handles () +{ + gint i; + ClutterVertex v[4]; + ClutterVertex v1, v2; + + clutter_actor_get_abs_allocation_vertices (rect, v); + for (i = 0; i < 4; ++i) + { + clutter_actor_set_positionu (p[i], + v[i].x - + clutter_actor_get_widthu (p[i])/2, + v[i].y - + clutter_actor_get_heightu (p[i])/2); + } + + v1.x = clutter_actor_get_widthu (rect)/2; + v1.y = clutter_actor_get_heightu (rect)/2; + v1.z = 0; + + clutter_actor_apply_transform_to_point (rect, &v1, &v2); + clutter_actor_set_positionu (p[4], + v2.x - clutter_actor_get_widthu (p[4])/2, + v2.y - clutter_actor_get_heightu (p[4])/2); +} + +#define M(m,row,col) (m)[col*4+row] + +static gint +find_handle_index (ClutterActor * a) +{ + gint i; + for (i = 0; i < sizeof(p)/sizeof(p[0]); ++i) + if (p[i] == a) + return i; + + return -1; +} + +static gboolean +on_event (ClutterStage *stage, + ClutterEvent *event, + gpointer user_data) +{ + static ClutterActor * dragging = NULL; + + switch (event->type) + { + case CLUTTER_BUTTON_PRESS: + { + gint x, y; + ClutterActor * actor; + + clutter_event_get_coords (event, &x, &y); + + actor = clutter_stage_get_actor_at_pos (stage, x, y); + + if (actor != CLUTTER_ACTOR (stage)) + { + if (actor != rect) + dragging = actor; + } + } + break; + + case CLUTTER_MOTION: + { + if (dragging) + { + gint x, y; + gint i; + ClutterActorBox box1, box2; + ClutterUnit xp, yp; + + i = find_handle_index (dragging); + + if (i < 0) + break; + + clutter_event_get_coords (event, &x, &y); + + clutter_actor_get_allocation_box (dragging, &box1); + clutter_actor_get_allocation_box (rect, &box2); + + xp = CLUTTER_UNITS_FROM_DEVICE (x - 3) - box1.x1; + yp = CLUTTER_UNITS_FROM_DEVICE (y - 3) - box1.y1; + + if (i == 4) + { + g_debug ("moving box by %f, %f", + CLUTTER_UNITS_TO_FLOAT (xp), + CLUTTER_UNITS_TO_FLOAT (yp)); + + clutter_actor_move_byu (rect, xp, yp); + } + else + { + g_debug ("adjusting box by %f, %f, handle %d", + CLUTTER_UNITS_TO_FLOAT (xp), + CLUTTER_UNITS_TO_FLOAT (yp), + i); + + switch (i) + { + case 0: + box2.x1 += xp; + box2.y1 += yp; + break; + case 1: + box2.x2 += xp; + box2.y1 += yp; + break; + case 2: + box2.x1 += xp; + box2.y2 += yp; + break; + case 3: + box2.x2 += xp; + box2.y2 += yp; + break; + } + + /* FIXME this is just plain wrong, to allocate directly + * like this + */ + clutter_actor_allocate (rect, &box2, TRUE); + } + + place_handles (); + } + } + break; + + case CLUTTER_BUTTON_RELEASE: + { + dragging = NULL; + } + break; + + default: + break; + } + + return FALSE; +} + + +G_MODULE_EXPORT int +test_project_main (int argc, char *argv[]) +{ + ClutterActor *label; + + ClutterColor stage_color = { 0x0, 0x0, 0x0, 0xff }, + white = { 0xff, 0xff, 0xff, 0xff }; + + clutter_init (&argc, &argv); + + main_stage = clutter_stage_get_default (); + + clutter_stage_set_color (CLUTTER_STAGE (main_stage), &stage_color); + clutter_actor_set_size (main_stage, 640, 480); + + rect = clutter_rectangle_new_with_color (&white); + clutter_actor_set_size (rect, 320, 240); + clutter_actor_set_position (rect, 180, 120); + clutter_actor_set_rotation (rect, CLUTTER_Y_AXIS, 60, 0, 0, 0); + clutter_group_add (CLUTTER_GROUP (main_stage), rect); + + label = clutter_text_new_with_text ("Mono 8pt", "Drag the blue rectangles"); + clutter_text_set_color (CLUTTER_TEXT (label), &white); + + clutter_actor_set_position (label, 10, 10); + clutter_group_add (CLUTTER_GROUP (main_stage), label); + + clutter_actor_show_all (main_stage); + + g_signal_connect (main_stage, "event", G_CALLBACK (on_event), NULL); + + init_handles (); + + clutter_main(); + + return EXIT_SUCCESS; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-random-text.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-random-text.c --- clutter-0.8.4/tests/interactive/test-random-text.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-random-text.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,86 @@ +#include +#include +#include + +#define MAX_TEXT_LEN 10 +#define MIN_FONT_SIZE 10 +#define MAX_FONT_SIZE 30 + +static const char * const font_names[] = + { + "Sans", "Sans Italic", "Serif", "Serif Bold", "Times", "Monospace" + }; +#define FONT_NAME_COUNT 6 + +static gboolean +on_idle (gpointer data) +{ + ClutterActor *stage = CLUTTER_ACTOR (data); + int line_height = 0, xpos = 0, ypos = 0; + int stage_width = clutter_actor_get_width (stage); + int stage_height = clutter_actor_get_height (stage); + char text[MAX_TEXT_LEN + 1]; + char font_name[64]; + int i; + GList *children, *node; + + /* Remove all of the children of the stage */ + children = clutter_container_get_children (CLUTTER_CONTAINER (stage)); + for (node = children; node; node = node->next) + clutter_container_remove_actor (CLUTTER_CONTAINER (stage), + CLUTTER_ACTOR (node->data)); + g_list_free (children); + + /* Fill the stage with new random labels */ + while (ypos < stage_height) + { + int text_len = rand () % MAX_TEXT_LEN + 1; + ClutterActor *label; + + for (i = 0; i < text_len; i++) + text[i] = rand () % (128 - 32) + 32; + text[text_len] = '\0'; + + sprintf (font_name, "%s %i", + font_names[rand () % FONT_NAME_COUNT], + rand () % (MAX_FONT_SIZE - MIN_FONT_SIZE) + MIN_FONT_SIZE); + + label = clutter_text_new_with_text (font_name, text); + + if (clutter_actor_get_height (label) > line_height) + line_height = clutter_actor_get_height (label); + + if (xpos + clutter_actor_get_width (label) > stage_width) + { + xpos = 0; + ypos += line_height; + line_height = 0; + } + + clutter_actor_set_position (label, xpos, ypos); + + clutter_container_add (CLUTTER_CONTAINER (stage), label, NULL); + + xpos += clutter_actor_get_width (label); + } + + return TRUE; +} + +G_MODULE_EXPORT int +test_random_text_main (int argc, char **argv) +{ + ClutterActor *stage; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + + clutter_actor_show (stage); + + clutter_threads_add_idle (on_idle, stage); + + clutter_main (); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-rotate.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-rotate.c --- clutter-0.8.4/tests/interactive/test-rotate.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-rotate.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,73 @@ +#include +#include +#include + +#include +#include + +#include + +G_MODULE_EXPORT int +test_rotate_main (int argc, char *argv[]) +{ + ClutterTimeline *timeline; + ClutterAlpha *alpha; + ClutterBehaviour *r_behave; + ClutterActor *stage; + ClutterActor *hand, *label; + ClutterColor stage_color = { 0xcc, 0xcc, 0xcc, 0xff }; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + + clutter_stage_set_color (CLUTTER_STAGE (stage), + &stage_color); + + /* Make a hand */ + hand = clutter_texture_new_from_file ("redhand.png", NULL); + if (!hand) + g_error("pixbuf load failed"); + + clutter_actor_set_position (hand, 240, 140); + clutter_actor_show (hand); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), hand); + + label = clutter_text_new_with_text ("Mono 16", "The Wonder of the Spinning Hand"); + clutter_text_set_alignment (CLUTTER_TEXT (label), PANGO_ALIGN_CENTER); + clutter_actor_set_position (label, 150, 150); + clutter_actor_set_size (label, 500, 100); + clutter_actor_show (label); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), label); + + /* Make a timeline */ + timeline = clutter_timeline_new (200, 26); /* num frames, fps */ + g_object_set (timeline, "loop", TRUE, NULL); + + /* Set an alpha func to power behaviour */ + alpha = clutter_alpha_new_full (timeline, CLUTTER_LINEAR); + + /* Create a behaviour for that alpha */ + r_behave = clutter_behaviour_rotate_new (alpha, + CLUTTER_Z_AXIS, + CLUTTER_ROTATE_CW, + 0.0, 360.0); + + clutter_behaviour_rotate_set_center (CLUTTER_BEHAVIOUR_ROTATE (r_behave), + 86, 125, 0); + + /* Apply it to our actor */ + clutter_behaviour_apply (r_behave, hand); + clutter_behaviour_apply (r_behave, label); + + /* start the timeline and thus the animations */ + clutter_timeline_start (timeline); + + clutter_actor_show_all (stage); + + clutter_main(); + + g_object_unref (r_behave); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-scale.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-scale.c --- clutter-0.8.4/tests/interactive/test-scale.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-scale.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,113 @@ +#include +#include +#include + +static const ClutterGravity gravities[] = { + CLUTTER_GRAVITY_NORTH_EAST, + CLUTTER_GRAVITY_NORTH, + CLUTTER_GRAVITY_NORTH_WEST, + CLUTTER_GRAVITY_WEST, + CLUTTER_GRAVITY_SOUTH_WEST, + CLUTTER_GRAVITY_SOUTH, + CLUTTER_GRAVITY_SOUTH_EAST, + CLUTTER_GRAVITY_EAST, + CLUTTER_GRAVITY_CENTER, + CLUTTER_GRAVITY_NONE +}; + +static gint gindex = 0; +static ClutterActor *label; + +static void +set_next_gravity (ClutterActor *actor) +{ + ClutterGravity gravity = gravities[gindex]; + GEnumClass *eclass; + GEnumValue *evalue; + + clutter_actor_move_anchor_point_from_gravity (actor, gravities[gindex]); + + eclass = g_type_class_ref (CLUTTER_TYPE_GRAVITY); + evalue = g_enum_get_value (eclass, gravity); + clutter_text_set_text (CLUTTER_TEXT (label), evalue->value_nick); + g_type_class_unref (eclass); + + if (++gindex >= G_N_ELEMENTS (gravities)) + gindex = 0; +} + +static gdouble +my_ramp_func (ClutterAlpha *alpha, + gpointer unused) +{ + ClutterTimeline *timeline = clutter_alpha_get_timeline (alpha); + + return clutter_timeline_get_progress (timeline); +} + +G_MODULE_EXPORT int +test_scale_main (int argc, char *argv[]) +{ + ClutterActor *stage, *rect; + ClutterColor stage_color = { 0x0, 0x0, 0x0, 0xff }; + ClutterColor rect_color = { 0xff, 0xff, 0xff, 0x99 }; + ClutterTimeline *timeline; + ClutterAlpha *alpha; + ClutterBehaviour *behave; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + + clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); + clutter_actor_set_size (stage, 300, 300); + + rect = clutter_rectangle_new_with_color (&rect_color); + clutter_actor_set_size (rect, 100, 100); + clutter_actor_set_position (rect, 100, 100); + + clutter_group_add (CLUTTER_GROUP (stage), rect); + + label = clutter_text_new_with_text ("Sans 20px", ""); + clutter_text_set_color (CLUTTER_TEXT (label), + &(ClutterColor) { 0xff, 0xff, 0xff, 0xff }); + clutter_actor_set_position (label, + clutter_actor_get_x (rect), + clutter_actor_get_y (rect) + + clutter_actor_get_height (rect)); + + clutter_group_add (CLUTTER_GROUP (stage), label); + + rect_color.alpha = 0xff; + rect = clutter_rectangle_new_with_color (&rect_color); + clutter_actor_set_position (rect, 100, 100); + clutter_actor_set_size (rect, 100, 100); + set_next_gravity (rect); + + clutter_group_add (CLUTTER_GROUP (stage), rect); + + timeline = clutter_timeline_new_for_duration (750); + alpha = clutter_alpha_new_with_func (timeline, + my_ramp_func, + NULL, NULL); + + behave = clutter_behaviour_scale_new (alpha, + 0.0, 0.0, /* scale start */ + 1.0, 1.0); /* scale end */ + + clutter_behaviour_apply (behave, rect); + + clutter_timeline_set_loop (timeline, TRUE); + g_signal_connect_swapped (timeline, "completed", + G_CALLBACK (set_next_gravity), rect); + clutter_timeline_start (timeline); + + clutter_actor_show_all (stage); + + clutter_main(); + + g_object_unref (timeline); + g_object_unref (behave); + + return EXIT_SUCCESS; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-score.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-score.c --- clutter-0.8.4/tests/interactive/test-score.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-score.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,127 @@ +#include +#include +#include +#include + +static gint level = 1; + +static void +on_score_started (ClutterScore *score) +{ + g_print ("Score started\n"); +} + +static void +on_score_completed (ClutterScore *score) +{ + g_print ("Score completed\n"); + clutter_main_quit (); +} + +static void +on_timeline_started (ClutterScore *score, + ClutterTimeline *timeline) +{ + gint i; + + for (i = 0; i < level; i++) + g_print (" "); + + 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) +{ + gint i; + + level -= 1; + + for (i = 0; i < level; i++) + g_print (" "); + + g_print ("Completed timeline: `%s'\n", + (gchar *) g_object_get_data (G_OBJECT (timeline), "timeline-name")); +} + +G_MODULE_EXPORT int +test_score_main (int argc, char **argv) +{ + ClutterScore *score; + ClutterTimeline *timeline_1; + ClutterTimeline *timeline_2; + ClutterTimeline *timeline_3; + ClutterTimeline *timeline_4; + ClutterTimeline *timeline_5; + GSList *timelines; + + clutter_init (&argc, &argv); + + timeline_1 = clutter_timeline_new_for_duration (1000); + g_object_set_data_full (G_OBJECT (timeline_1), + "timeline-name", g_strdup ("Timeline 1"), + g_free); + + timeline_2 = clutter_timeline_new_for_duration (1000); + clutter_timeline_add_marker_at_time (timeline_2, "foo", 500); + g_object_set_data_full (G_OBJECT (timeline_2), + "timeline-name", g_strdup ("Timeline 2"), + g_free); + + timeline_3 = clutter_timeline_new_for_duration (1000); + g_object_set_data_full (G_OBJECT (timeline_3), + "timeline-name", g_strdup ("Timeline 3"), + g_free); + + timeline_4 = clutter_timeline_new_for_duration (1000); + g_object_set_data_full (G_OBJECT (timeline_4), + "timeline-name", g_strdup ("Timeline 4"), + g_free); + + timeline_5 = clutter_timeline_new_for_duration (1000); + 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_main (); + + 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); + + return EXIT_SUCCESS; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-script.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-script.c --- clutter-0.8.4/tests/interactive/test-script.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-script.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,173 @@ +#include +#include + +#include +#include + +#include + +static ClutterScript *script = NULL; +static guint merge_id = 0; + +static const gchar *test_unmerge = +"[" +" {" +" \"id\" : \"main-stage\"," +" \"type\" : \"ClutterStage\"," +" \"children\" : [ \"blue-button\" ]" +" }," +" {" +" \"id\" : \"blue-button\"," +" \"type\" : \"ClutterRectangle\"," +" \"color\" : \"#0000ffff\"," +" \"x\" : 350," +" \"y\" : 50," +" \"width\" : 100," +" \"height\" : 100," +" \"visible\" : true," +" \"reactive\" : true" +" }" +"]"; + +static const gchar *test_behaviour = +"[" +" {" +" \"id\" : \"main-timeline\"," +" \"type\" : \"ClutterTimeline\"," +" \"duration\" : 5000," +" \"loop\" : true" +" }," +" {" +" \"id\" : \"path-behaviour\"," +" \"type\" : \"ClutterBehaviourPath\"," +" \"path\" : \"M 50 50 L 100 100\"," +" \"alpha\" : {" +" \"timeline\" : \"main-timeline\"," +" \"mode\" : \"linear\"" +" }" +" }," +" {" +" \"id\" : \"rotate-behaviour\"," +" \"type\" : \"ClutterBehaviourRotate\"," +" \"angle-start\" : 0.0," +" \"angle-end\" : 360.0," +" \"axis\" : \"y-axis\"," +" \"alpha\" : {" +" \"timeline\" : \"main-timeline\"," +" \"mode\" : \"ease-in-sine\"" +" }" +" }," +" {" +" \"id\" : \"fade-behaviour\"," +" \"type\" : \"ClutterBehaviourOpacity\"," +" \"opacity-start\" : 255," +" \"opacity-end\" : 0," +" \"alpha\" : {" +" \"timeline\" : \"main-timeline\"," +" \"mode\" : \"easeOutCubic\"" +" }" +" }" +"]"; + +static gboolean +blue_button_press (ClutterActor *actor, + ClutterButtonEvent *event, + gpointer data) +{ + g_print ("[*] Pressed `%s'\n", clutter_get_script_id (G_OBJECT (actor))); + g_print ("[*] Unmerging objects with merge id: %d\n", merge_id); + + clutter_script_unmerge_objects (script, merge_id); + + return TRUE; +} + +static gboolean +red_button_press (ClutterActor *actor, + ClutterButtonEvent *event, + gpointer data) +{ + GObject *timeline; + + g_print ("[*] Pressed `%s'\n", clutter_get_script_id (G_OBJECT (actor))); + + timeline = clutter_script_get_object (script, "main-timeline"); + g_assert (CLUTTER_IS_TIMELINE (timeline)); + + if (!clutter_timeline_is_playing (CLUTTER_TIMELINE (timeline))) + clutter_timeline_start (CLUTTER_TIMELINE (timeline)); + else + clutter_timeline_pause (CLUTTER_TIMELINE (timeline)); + + return TRUE; +} + +G_MODULE_EXPORT int +test_script_main (int argc, char *argv[]) +{ + GObject *stage, *blue_button, *red_button; + GError *error = NULL; + gint res; + + clutter_init (&argc, &argv); + + script = clutter_script_new (); + g_assert (CLUTTER_IS_SCRIPT (script)); + + clutter_script_load_from_data (script, test_behaviour, -1, &error); + if (error) + { + g_print ("*** Error:\n" + "*** %s\n", error->message); + g_error_free (error); + g_object_unref (script); + return EXIT_FAILURE; + } + + clutter_script_load_from_file (script, "test-script.json", &error); + if (error) + { + g_print ("*** Error:\n" + "*** %s\n", error->message); + g_error_free (error); + g_object_unref (script); + return EXIT_FAILURE; + } + + merge_id = clutter_script_load_from_data (script, test_unmerge, -1, &error); + if (error) + { + g_print ("*** Error:\n" + "*** %s\n", error->message); + g_error_free (error); + g_object_unref (script); + return EXIT_FAILURE; + } + + clutter_script_connect_signals (script, NULL); + + res = clutter_script_get_objects (script, + "main-stage", &stage, + "red-button", &red_button, + "blue-button", &blue_button, + NULL); + g_assert (res == 3); + + clutter_actor_show (CLUTTER_ACTOR (stage)); + + g_signal_connect (red_button, + "button-press-event", + G_CALLBACK (red_button_press), + NULL); + + g_signal_connect (blue_button, + "button-press-event", + G_CALLBACK (blue_button_press), + NULL); + + clutter_main (); + + g_object_unref (script); + + return EXIT_SUCCESS; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-shader.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-shader.c --- clutter-0.8.4/tests/interactive/test-shader.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-shader.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,400 @@ +/*#define TEST_GROUP */ + +#include +#include "../config.h" + +#include +#include +#include +#include + +/* Dynamic branching appeared in "Shader Model 3.0" that low-end IGPs + * don't support. + */ +#define GPU_SUPPORTS_DYNAMIC_BRANCHING 0 + +typedef struct +{ + gchar *name; + gchar *source; +} ShaderSource; + +/* These variables are used instead of the standard GLSL variables on + GLES 2 */ +#ifdef HAVE_COGL_GLES2 + +#define GLES2_VARS \ + "precision mediump float;\n" \ + "varying vec2 tex_coord;\n" \ + "varying vec4 frag_color;\n" +#define TEX_COORD "tex_coord" +#define COLOR_VAR "frag_color" + +#else /* HAVE_COGL_GLES2 */ + +#define GLES2_VARS "" +#define TEX_COORD "gl_TexCoord[0]" +#define COLOR_VAR "gl_Color" + +#endif /* HAVE_COGL_GLES2 */ + +/* a couple of boilerplate defines that are common amongst all the + * sample shaders + */ + +/* FRAGMENT_SHADER_BEGIN: generate boilerplate with a local vec4 color already + * initialized, from a sampler2D in a variable tex. + */ +#define FRAGMENT_SHADER_VARS \ + GLES2_VARS \ + "uniform sampler2D tex;" \ + "uniform float x_step, y_step;" \ + +#define FRAGMENT_SHADER_BEGIN \ + "void main (){" \ + " vec4 color = texture2D (tex, vec2(" TEX_COORD "));" + +/* FRAGMENT_SHADER_END: apply the changed color to the output buffer correctly + * blended with the gl specified color (makes the opacity of actors work + * correctly). + */ +#define FRAGMENT_SHADER_END \ + " gl_FragColor = color;" \ + " gl_FragColor = gl_FragColor * " COLOR_VAR ";" \ + "}" + +static ShaderSource shaders[]= + { + {"brightness-contrast", + FRAGMENT_SHADER_VARS + "uniform float brightness, contrast;" + FRAGMENT_SHADER_BEGIN + " color.rgb = (color.rgb - vec3(0.5, 0.5, 0.5)) * contrast + " + "vec3 (brightness + 0.5, brightness + 0.5, brightness + 0.5);" + FRAGMENT_SHADER_END + }, + + {"box-blur", + FRAGMENT_SHADER_VARS + +#if GPU_SUPPORTS_DYNAMIC_BRANCHING + "uniform float radius;" + FRAGMENT_SHADER_BEGIN + "float u, v;" + "int count = 1;" + "for (u=-radius;u= 0 && shaders[new_no].name) + { + ClutterShader *shader; + GError *error; + shader_no = new_no; + + g_print ("setting shaders[%i] named '%s'\n", + shader_no, + shaders[shader_no].name); + + shader = clutter_shader_new (); + + error = NULL; + g_object_set (G_OBJECT (shader), + "fragment-source", shaders[shader_no].source, NULL); + + /* try to bind the shader, provoking an error we catch if there is issues + * with the shader sources we've provided. At a later stage it should be + * possible to iterate through a set of alternate shader sources (glsl -> + * asm -> cg?) and the one that succesfully compiles is used. + */ + clutter_shader_compile (shader, &error); + if (error) + { + g_print ("unable to set shaders[%i] named '%s': %s", + shader_no, shaders[shader_no].name, + error->message); + g_error_free (error); + clutter_actor_set_shader (actor, NULL); + } + else + { + clutter_actor_set_shader (actor, NULL); + clutter_actor_set_shader (actor, shader); + clutter_actor_set_shader_param_int (actor, "tex", 0); + clutter_actor_set_shader_param_float (actor, "radius", 3.0); + clutter_actor_set_shader_param_float (actor, "brightness", 0.4); + clutter_actor_set_shader_param_float (actor, "contrast", -1.9); + + if (CLUTTER_IS_TEXTURE (actor)) + { + tex_width = clutter_actor_get_width (actor); + tex_width = clutter_util_next_p2 (tex_width); + tex_height = clutter_actor_get_height (actor); + tex_height = clutter_util_next_p2 (tex_height); + + clutter_actor_set_shader_param_float (actor, "x_step", + 1.0f / tex_width); + clutter_actor_set_shader_param_float (actor, "y_step", + 1.0f / tex_height); + } + } + } +} + +static gboolean +button_release_cb (ClutterActor *actor, + ClutterEvent *event, + gpointer data) +{ + gint new_no; + + if (event->button.button == 1) + { + new_no = shader_no - 1; + } + else + { + new_no = shader_no + 1; + } + + set_shader_num (actor, new_no); + + return FALSE; +} + +#ifdef HAVE_COGL_GLES2 +static gboolean +timeout_cb (gpointer data) +{ + int new_no = shader_no + 1; + + if (shaders[new_no].name == NULL) + new_no = 0; + + set_shader_num (CLUTTER_ACTOR (data), new_no); + + return TRUE; +} +#endif /* HAVE_COGL_GLES2 */ + +G_MODULE_EXPORT gint +test_shader_main (gint argc, gchar *argv[]) +{ + ClutterActor *actor; + ClutterActor *stage; + ClutterColor stage_color = { 0x61, 0x64, 0x8c, 0xff }; + ClutterShader *shader; + GError *error; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + clutter_actor_set_size (stage, 512, 384); + + g_print ("applying shaders[%i] named '%s'\n", + shader_no, + shaders[shader_no].name); + + shader = clutter_shader_new (); + + error = NULL; + clutter_shader_set_fragment_source (shader, shaders[shader_no].source, -1); + clutter_shader_compile (shader, &error); + if (error) + { + g_print ("unable to load shaders[%d] named '%s': %s\n", + shader_no, + shaders[shader_no].name, + error->message); + g_error_free (error); + + return EXIT_FAILURE; + } + + clutter_stage_set_title (CLUTTER_STAGE (stage), "Shader Test"); + clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); + +#ifndef TEST_GROUP + actor = g_object_new (CLUTTER_TYPE_TEXTURE, + "filename", "redhand.png", + "disable-slicing", TRUE, + NULL); + actor = clutter_texture_new_from_file ("redhand.png", &error); + if (!actor) + g_error("pixbuf load failed: %s", error ? error->message : "Unknown"); + +#else + actor = clutter_group_new (); + { + ClutterActor *child1, *child2, *child3, *child4; + ClutterColor color = { 0xff, 0x22, 0x66, 0x99 }; + + child1 = clutter_texture_new_from_file ("redhand.png", &error); + if (!child1) + g_error("pixbuf load failed: %s", error ? error->message : "Unknown"); + child2 = clutter_texture_new_from_file ("redhand.png", &error); + if (!child2) + g_error("pixbuf load failed: %s", error ? error->message : "Unknown"); + child3 = clutter_rectangle_new (); + child4 = clutter_text_new_with_text ("Sans 20px", "Shady stuff"); + + clutter_rectangle_set_color (child3, &color); + clutter_actor_set_size (child3, 50, 50); + clutter_actor_set_position (child1, 0, 0); + clutter_actor_set_position (child2, 50, 100); + clutter_actor_set_position (child3, 30, -30); + clutter_actor_set_position (child4, -50, 20); + + clutter_group_add (CLUTTER_GROUP (actor), child1); + clutter_group_add (CLUTTER_GROUP (actor), child2); + clutter_group_add (CLUTTER_GROUP (actor), child3); + clutter_group_add (CLUTTER_GROUP (actor), child4); + + clutter_actor_show_all (actor); + } +#endif + + clutter_actor_set_shader (actor, shader); + clutter_actor_set_position (actor, 100, 100); + + clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor); + + clutter_actor_set_shader_param_int (actor, "tex", 0); + clutter_actor_set_shader_param_float (actor, "brightness", 0.4); + clutter_actor_set_shader_param_float (actor, "contrast", -1.9); + + clutter_actor_set_reactive (actor, TRUE); + g_signal_connect (actor, "button-release-event", + G_CALLBACK (button_release_cb), NULL); + +#ifdef HAVE_COGL_GLES2 + /* On an embedded platform it is difficult to right click so we will + cycle through the shaders automatically */ + g_timeout_add_seconds (3, timeout_cb, actor); +#endif + + /* Show everying ( and map window ) */ + clutter_actor_show_all (stage); + + clutter_main (); + + return EXIT_SUCCESS; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-stage-read-pixels.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-stage-read-pixels.c --- clutter-0.8.4/tests/interactive/test-stage-read-pixels.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-stage-read-pixels.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,156 @@ +#include +#include +#include + +#define DOT_SIZE 2 +#define TEX_SIZE 64 + +typedef struct _CallbackData CallbackData; + +struct _CallbackData +{ + ClutterActor *stage; + ClutterActor *tex; + ClutterActor *box; + ClutterMotionEvent event; + guint idle_source; +}; + +static ClutterActor * +make_label (void) +{ + ClutterActor *label; + gchar *text; + gchar *argv[] = { "ls", "--help", NULL }; + + label = clutter_text_new (); + clutter_text_set_font_name (CLUTTER_TEXT (label), "Sans 10"); + + if (g_spawn_sync (NULL, argv, NULL, + G_SPAWN_STDERR_TO_DEV_NULL | G_SPAWN_SEARCH_PATH, + NULL, NULL, &text, NULL, NULL, NULL)) + { + clutter_text_set_text (CLUTTER_TEXT (label), text); + g_free (text); + } + + return label; +} + +static ClutterActor * +make_tex (void) +{ + ClutterActor *tex = clutter_texture_new (); + + clutter_actor_set_size (tex, TEX_SIZE * 2, TEX_SIZE * 2); + + return tex; +} + +static ClutterActor * +make_box (void) +{ + ClutterActor *box; + static const ClutterColor blue = { 0x00, 0x00, 0xff, 0xff }; + + box = clutter_rectangle_new_with_color (&blue); + clutter_actor_set_size (box, DOT_SIZE + 2, DOT_SIZE + 2); + clutter_actor_hide (box); + + return box; +} + +static gboolean +on_motion_idle (gpointer user_data) +{ + CallbackData *data = (CallbackData *) user_data; + guchar *pixels, *p; + guint stage_width, stage_height; + gint x, y; + + data->idle_source = 0; + + clutter_actor_get_size (data->stage, &stage_width, &stage_height); + + x = CLAMP (data->event.x - TEX_SIZE / 2, 0, (int) stage_width - TEX_SIZE); + y = CLAMP (data->event.y - TEX_SIZE / 2, 0, (int) stage_height - TEX_SIZE); + + clutter_actor_set_position (data->box, x + TEX_SIZE / 2 - 1, + y + TEX_SIZE / 2 - 1); + clutter_actor_show (data->box); + /* Redraw so that the layouting will be done and the box will be + drawn in the right position */ + clutter_redraw (CLUTTER_STAGE (data->stage)); + + pixels = clutter_stage_read_pixels (CLUTTER_STAGE (data->stage), + x, y, TEX_SIZE, TEX_SIZE); + + /* Make a red dot in the center */ + p = pixels + (TEX_SIZE / 2 - DOT_SIZE / 2) * TEX_SIZE * 4 + + (TEX_SIZE / 2 - DOT_SIZE / 2) * 4; + for (y = 0; y < DOT_SIZE; y++) + { + for (x = 0; x < DOT_SIZE; x++) + { + *(p++) = 255; + memset (p, 0, 3); + p += 3; + } + p += TEX_SIZE * 4 - DOT_SIZE * 4; + } + + /* Set all of the alpa values to full */ + for (p = pixels + TEX_SIZE * TEX_SIZE * 4; p > pixels; p -= 4) + *(p - 1) = 255; + + clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (data->tex), + pixels, TRUE, + TEX_SIZE, TEX_SIZE, + TEX_SIZE * 4, 4, 0, NULL); + g_free (pixels); + + return FALSE; +} + +static gboolean +on_motion (ClutterActor *stage, ClutterMotionEvent *event, CallbackData *data) +{ + /* Handle the motion event in an idle handler so that multiple + events will be combined into one */ + if (data->idle_source == 0) + data->idle_source = clutter_threads_add_idle (on_motion_idle, data); + + data->event = *event; + + return FALSE; +} + +G_MODULE_EXPORT int +test_stage_read_pixels_main (int argc, char **argv) +{ + CallbackData data; + + clutter_init (&argc, &argv); + + data.idle_source = 0; + data.stage = clutter_stage_get_default (); + + data.tex = make_tex (); + data.box = make_box (); + clutter_actor_set_position (data.tex, + clutter_actor_get_width (data.stage) + - clutter_actor_get_width (data.tex), + clutter_actor_get_height (data.stage) + - clutter_actor_get_height (data.tex)); + + clutter_container_add (CLUTTER_CONTAINER (data.stage), + make_label (), data.tex, data.box, NULL); + + g_signal_connect (data.stage, "motion-event", G_CALLBACK (on_motion), &data); + + clutter_actor_show (data.stage); + + clutter_main (); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-text.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-text.c --- clutter-0.8.4/tests/interactive/test-text.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-text.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,89 @@ +#include + +#include +#include + +#define FONT "Mono Bold 22px" + +static gchar *runes = +"ᚠᛇᚻ᛫ᛒᛦᚦ᛫ᚠᚱᚩᚠᚢᚱ᛫ᚠᛁᚱᚪ᛫ᚷᛖᚻᚹᛦᛚᚳᚢᛗ\n" +"ᛋᚳᛖᚪᛚ᛫ᚦᛖᚪᚻ᛫ᛗᚪᚾᚾᚪ᛫ᚷᛖᚻᚹᛦᛚᚳ᛫ᛗᛁᚳᛚᚢᚾ᛫ᚻᛦᛏ᛫ᛞᚫᛚᚪᚾ\n" +"ᚷᛁᚠ᛫ᚻᛖ᛫ᚹᛁᛚᛖ᛫ᚠᚩᚱ᛫ᛞᚱᛁᚻᛏᚾᛖ᛫ᛞᚩᛗᛖᛋ᛫ᚻᛚᛇᛏᚪᚾ᛬\n"; + + +static void +cursor_event (ClutterText *text, + ClutterGeometry *geometry) +{ + gint y; + + y = clutter_actor_get_y (CLUTTER_ACTOR (text)); + + if (y + geometry->y < 50) + { + clutter_actor_set_y (CLUTTER_ACTOR (text), y + 100); + } + else if (y + geometry->y > 720) + { + clutter_actor_set_y (CLUTTER_ACTOR (text), y - 100); + } + +} + +G_MODULE_EXPORT gint +test_text_main (gint argc, + gchar **argv) +{ + ClutterActor *stage; + ClutterActor *text; + ClutterColor text_color = { 0x33, 0xff, 0x33, 0xff }; + ClutterColor cursor_color = { 0xff, 0x33, 0x33, 0xff }; + ClutterColor background_color = { 0x00, 0x00, 0x00, 0xff }; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + clutter_stage_set_color (CLUTTER_STAGE (stage), &background_color); + + text = clutter_text_new_full (FONT, "·", &text_color); + + clutter_container_add (CLUTTER_CONTAINER (stage), text, NULL); + clutter_actor_set_position (text, 40, 30); + clutter_actor_set_width (text, 1024); + clutter_text_set_line_wrap (CLUTTER_TEXT (text), TRUE); + + clutter_actor_set_reactive (text, TRUE); + clutter_stage_set_key_focus (CLUTTER_STAGE (stage), text); + + clutter_text_set_editable (CLUTTER_TEXT (text), TRUE); + clutter_text_set_selectable (CLUTTER_TEXT (text), TRUE); + clutter_text_set_cursor_color (CLUTTER_TEXT (text), &cursor_color); + + if (argv[1]) + { + GError *error = NULL; + gchar *utf8; + + g_file_get_contents (argv[1], &utf8, NULL, &error); + if (error) + { + utf8 = g_strconcat ("Unable to open '", argv[1], "':\n", + error->message, + NULL); + g_error_free (error); + } + + clutter_text_set_text (CLUTTER_TEXT (text), utf8); + } + else + clutter_text_set_text (CLUTTER_TEXT (text), runes); + + g_signal_connect (text, "cursor-event", G_CALLBACK (cursor_event), NULL); + + clutter_actor_set_size (stage, 1024, 768); + clutter_actor_show (stage); + + clutter_main (); + + return EXIT_SUCCESS; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-text-field.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-text-field.c --- clutter-0.8.4/tests/interactive/test-text-field.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-text-field.c 2009-01-29 13:30:31.000000000 +0000 @@ -0,0 +1,117 @@ +#include +#include +#include + +#define FONT "Mono Bold 14px" + +static void +on_entry_paint (ClutterActor *actor, + gpointer data) +{ + ClutterActorBox allocation = { 0, }; + ClutterUnit width, height; + + clutter_actor_get_allocation_box (actor, &allocation); + width = allocation.x2 - allocation.x1; + height = allocation.y2 - allocation.y1; + + cogl_set_source_color4ub (255, 255, 255, 255); + cogl_path_round_rectangle (0, 0, + CLUTTER_UNITS_TO_FIXED (width), + CLUTTER_UNITS_TO_FIXED (height), + (float)(4), + COGL_ANGLE_FROM_DEG (1.0)); + cogl_path_stroke (); +} + +static void +on_entry_activate (ClutterText *text, + gpointer data) +{ + g_print ("Text activated: %s\n", clutter_text_get_text (text)); +} + +static ClutterActor * +create_label (const ClutterColor *color, + const gchar *text) +{ + ClutterActor *retval = clutter_text_new_full (FONT, text, color); + + clutter_text_set_editable (CLUTTER_TEXT (retval), FALSE); + clutter_text_set_selectable (CLUTTER_TEXT (retval), FALSE); + + return retval; +} + +static ClutterActor * +create_entry (const ClutterColor *color, + const gchar *text, + gunichar password_char, + gint max_length) +{ + ClutterActor *retval = clutter_text_new_full (FONT, text, color); + ClutterColor selection = { 0, }; + + clutter_actor_set_width (retval, 200); + clutter_actor_set_reactive (retval, TRUE); + + clutter_color_darken (color, &selection); + + clutter_text_set_editable (CLUTTER_TEXT (retval), TRUE); + clutter_text_set_selectable (CLUTTER_TEXT (retval), TRUE); + clutter_text_set_activatable (CLUTTER_TEXT (retval), TRUE); + clutter_text_set_single_line_mode (CLUTTER_TEXT (retval), TRUE); + clutter_text_set_password_char (CLUTTER_TEXT (retval), password_char); + clutter_text_set_cursor_color (CLUTTER_TEXT (retval), &selection); + clutter_text_set_max_length (CLUTTER_TEXT (retval), max_length); + + g_signal_connect (retval, "activate", + G_CALLBACK (on_entry_activate), + NULL); + g_signal_connect (retval, "paint", + G_CALLBACK (on_entry_paint), + NULL); + + return retval; +} + +G_MODULE_EXPORT gint +test_text_field_main (gint argc, + gchar **argv) +{ + ClutterActor *stage; + ClutterActor *text; + ClutterColor entry_color = {0x33, 0xff, 0x33, 0xff}; + ClutterColor label_color = {0xff, 0xff, 0xff, 0xff}; + ClutterColor background_color = {0x00, 0x00, 0x00, 0xff}; + gint height; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + clutter_stage_set_color (CLUTTER_STAGE (stage), &background_color); + + text = create_label (&label_color, "Input field: "); + clutter_actor_set_position (text, 10, 10); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), text); + + height = clutter_actor_get_height (text); + + text = create_entry (&entry_color, "some text", 0, 0); + clutter_actor_set_position (text, 200, 10); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), text); + + text = create_label (&label_color, "Password field: "); + clutter_actor_set_position (text, 10, height + 12); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), text); + + text = create_entry (&entry_color, "password", '*', 8); + clutter_actor_set_position (text, 200, height + 12); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), text); + + clutter_actor_show (stage); + + clutter_main (); + + return EXIT_SUCCESS; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-texture-quality.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-texture-quality.c --- clutter-0.8.4/tests/interactive/test-texture-quality.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-texture-quality.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,99 @@ +#include +#include +#include + +/* each time the timeline animating the label completes, swap the direction */ +static void +timeline_completed (ClutterTimeline *timeline, + gpointer user_data) +{ + clutter_timeline_set_direction (timeline, + !clutter_timeline_get_direction (timeline)); + clutter_timeline_start (timeline); +} + +static gboolean +change_filter (gpointer actor) +{ + ClutterTextureQuality old_quality; + + old_quality = clutter_texture_get_filter_quality (actor); + switch (old_quality) + { + case CLUTTER_TEXTURE_QUALITY_LOW: + clutter_texture_set_filter_quality (actor, + CLUTTER_TEXTURE_QUALITY_MEDIUM); + g_print ("Setting texture rendering quality to medium\n"); + break; + case CLUTTER_TEXTURE_QUALITY_MEDIUM: + clutter_texture_set_filter_quality (actor, + CLUTTER_TEXTURE_QUALITY_HIGH); + g_print ("Setting texture rendering quality to high\n"); + break; + case CLUTTER_TEXTURE_QUALITY_HIGH: + clutter_texture_set_filter_quality (actor, + CLUTTER_TEXTURE_QUALITY_LOW); + g_print ("Setting texture rendering quality to low\n"); + break; + } + return TRUE; +} + +G_MODULE_EXPORT gint +test_texture_quality_main (int argc, char *argv[]) +{ + ClutterTimeline *timeline; + ClutterAlpha *alpha; + ClutterBehaviour *depth_behavior; + ClutterActor *stage; + ClutterActor *image; + ClutterColor stage_color = { 0x12, 0x34, 0x56, 0xff }; + GError *error; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); + clutter_stage_set_use_fog (CLUTTER_STAGE (stage), TRUE); + clutter_stage_set_fog (CLUTTER_STAGE (stage), 1.0, 10, -50); + + g_signal_connect (stage, + "button-press-event", G_CALLBACK (clutter_main_quit), + NULL); + + error = NULL; + image = clutter_texture_new_from_file (argv[1]?argv[1]:"redhand.png", &error); + if (error) + g_error ("Unable to load image: %s", error->message); + + if (!argv[1]) + g_print ("Hint: the redhand.png isn't a good test image for this test.\n" + "This test can take any clutter loadable image as an argument\n"); + + /* center the image */ + clutter_actor_set_position (image, + (clutter_actor_get_width (stage) - clutter_actor_get_width (image))/2, + (clutter_actor_get_height (stage) - clutter_actor_get_height (image))/2); + clutter_container_add (CLUTTER_CONTAINER (stage), image, NULL); + + timeline = clutter_timeline_new (60*5, 60); + g_signal_connect (timeline, + "completed", G_CALLBACK (timeline_completed), + NULL); + + alpha = clutter_alpha_new_full (timeline, CLUTTER_LINEAR); + depth_behavior = clutter_behaviour_depth_new (alpha, -2500, 400); + clutter_behaviour_apply (depth_behavior, image); + + clutter_actor_show (stage); + clutter_timeline_start (timeline); + + g_timeout_add (10000, change_filter, image); + + clutter_main (); + + g_object_unref (depth_behavior); + g_object_unref (timeline); + + return EXIT_SUCCESS; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-textures.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-textures.c --- clutter-0.8.4/tests/interactive/test-textures.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-textures.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,115 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include + +guchar* +make_rgba_data (int width, int height, int bpp, int has_alpha, int *rowstride_p) +{ +#define CHECK_SIZE 20 + + gint x,y, rowstride, i = 0; + guchar *pixels; + + g_assert(bpp == 4); + g_assert(has_alpha == TRUE); + + rowstride = width * bpp; + *rowstride_p = rowstride; + + pixels = g_try_malloc (height * rowstride); + if (!pixels) + return NULL; + + for (y = 0; y < height; y++) + { + i = 0; + for (x = 0; x < width; x++) + { + guchar *p; + + p = pixels + y * rowstride + x * bpp; + + p[0] = p[1] = p[2] = 0; p[3] = 0xff; + + if (x && y && y % CHECK_SIZE && x % CHECK_SIZE) + { + if (x % CHECK_SIZE == 1) + { + if (++i > 3) + i = 0; + } + p[i] = 0xff; + } + } + } + + return pixels; +} + +#define SPIN() while (g_main_context_pending (NULL)) \ + g_main_context_iteration (NULL, FALSE); + +G_MODULE_EXPORT int +test_textures_main (int argc, char *argv[]) +{ + ClutterActor *texture; + ClutterActor *stage; + gint i, j; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + clutter_actor_show_all (CLUTTER_ACTOR (stage)); + + SPIN(); + + for (i=100; i<=5000; i += 100) + for (j=0; j<4; j++) + { + const int width = i+j; + const int height = i+j; + const gboolean has_alpha = TRUE; + const int bpp = has_alpha ? 4 : 3; + int rowstride; + guchar *pixels; + + pixels = make_rgba_data (width, height, bpp, has_alpha, &rowstride); + if (!pixels) + g_error("No memory for %ix%i RGBA data failed", width, height); + + printf("o %ix%i texture... ", width, height); + + texture = clutter_texture_new (); + if (!clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (texture), + pixels, + has_alpha, + width, + height, + rowstride, + bpp, + 0, NULL)) + g_error("texture creation failed"); + g_free(pixels); + + printf("uploaded to texture...\n"); + + clutter_container_add (CLUTTER_CONTAINER (stage), texture, NULL); + clutter_actor_set_size (texture, 400, 400); + clutter_actor_show (texture); + + /* Hide & show to unreaise then realise the texture */ + clutter_actor_hide (texture); + clutter_actor_show (texture); + + SPIN(); + + clutter_container_remove (CLUTTER_CONTAINER (stage), texture, NULL); + } + + return EXIT_SUCCESS; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-threads.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-threads.c --- clutter-0.8.4/tests/interactive/test-threads.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-threads.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,248 @@ +#include +#include +#include +#include + +typedef struct +{ + ClutterActor *stage; + ClutterActor *label; + ClutterActor *progress; + + ClutterTimeline *timeline; + + volatile gboolean cancelled; +} TestThreadData; + +static TestThreadData * +test_thread_data_new (void) +{ + TestThreadData *data; + + data = g_new0 (TestThreadData, 1); + + return data; +} + +static void +test_thread_data_free (TestThreadData *data) +{ + g_object_unref (data->progress); + g_object_unref (data->label); + g_object_unref (data->stage); + g_object_unref (data->timeline); + + g_free (data); +} + +static gboolean +test_thread_done_idle (gpointer user_data) +{ + TestThreadData *data = user_data; + + g_print ("Thread completed\n"); + + clutter_text_set_text (CLUTTER_TEXT (data->label), "Completed"); + clutter_timeline_stop (data->timeline); + + test_thread_data_free (data); + + return FALSE; +} + +static GStaticPrivate test_thread_data = G_STATIC_PRIVATE_INIT; + +typedef struct +{ + gint count; + TestThreadData *thread_data; +} TestUpdate; + +static gboolean +update_label_idle (gpointer data) +{ + TestUpdate *update = data; + guint width; + gchar *text; + + text = g_strdup_printf ("Count to %d", update->count); + + clutter_text_set_text (CLUTTER_TEXT (update->thread_data->label), text); + clutter_actor_set_width (update->thread_data->label, -1); + + if (update->count == 0) + width = 0; + else if (update->count == 100) + width = 350; + else + width = (guint) (update->count / 100.0 * 350.0); + + clutter_actor_set_width (update->thread_data->progress, width); + + g_free (text); + g_free (update); + + return FALSE; +} + +static void +do_something_very_slow (void) +{ + TestThreadData *data; + gint i; + + data = (TestThreadData *) g_static_private_get (&test_thread_data); + if (data->cancelled) + return; + + for (i = 0; i < 100; i++) + { + gint msecs; + + msecs = 1 + (int) (100.0 * rand () / ((RAND_MAX + 1.0) / 3)); + + /* sleep for a while */ + g_usleep (msecs * 1000); + + if ((i % 10) == 0) + { + TestUpdate *update; + + update = g_new (TestUpdate, 1); + update->count = i; + update->thread_data = data; + + clutter_threads_add_idle_full (G_PRIORITY_DEFAULT + 30, + update_label_idle, + update, NULL); + } + } +} + +static gpointer +test_thread_func (gpointer user_data) +{ + TestThreadData *data; + + data = user_data; + g_static_private_set (&test_thread_data, data, NULL); + + do_something_very_slow (); + + clutter_threads_add_idle_full (G_PRIORITY_DEFAULT + 30, + test_thread_done_idle, + data, NULL); + + return NULL; +} + +static ClutterTimeline *timeline = NULL; +static ClutterActor *count_label = NULL; +static ClutterActor *help_label = NULL; +static ClutterActor *progress_rect = NULL; + +static void +on_key_press_event (ClutterStage *stage, + ClutterKeyEvent *event, + gpointer user_data) +{ + TestThreadData *data; + + switch (clutter_key_event_symbol (event)) + { + case CLUTTER_s: + clutter_text_set_text (CLUTTER_TEXT (help_label), "Press 'q' to quit"); + + clutter_timeline_start (timeline); + + data = test_thread_data_new (); + data->stage = g_object_ref (stage); + data->label = g_object_ref (count_label); + data->progress = g_object_ref (progress_rect); + data->timeline = g_object_ref (timeline); + g_thread_create (test_thread_func, data, FALSE, NULL); + break; + case CLUTTER_q: + clutter_main_quit (); + break; + } +} + +G_MODULE_EXPORT int +test_threads_main (int argc, char *argv[]) +{ + ClutterActor *stage; + ClutterActor *rect; + ClutterColor stage_color = { 0xcc, 0xcc, 0xcc, 0xff }; + ClutterColor rect_color = { 0xee, 0x55, 0x55, 0x99 }; + ClutterColor progress_color = { 0x55, 0xee, 0x55, 0xbb }; + ClutterBehaviour *r_behaviour, *p_behaviour; + ClutterAlpha *alpha; + const ClutterKnot knots[] = { + { 75, 150 }, + { 400, 150 } + }; + + g_thread_init (NULL); + clutter_threads_init (); + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); + clutter_actor_set_size (stage, 600, 300); + + count_label = clutter_text_new_with_text ("Mono 12", "Counter"); + clutter_actor_set_position (count_label, 350, 50); + + help_label = clutter_text_new_with_text ("Mono 12", "Press 's' to start"); + clutter_actor_set_position (help_label, 50, 50); + + rect = clutter_rectangle_new_with_color (&rect_color); + clutter_actor_set_position (rect, 75, 150); + clutter_actor_set_size (rect, 50, 50); + clutter_actor_set_anchor_point (rect, 25, 25); + + progress_rect = clutter_rectangle_new_with_color (&progress_color); + clutter_actor_set_position (progress_rect, 50, 225); + clutter_actor_set_size (progress_rect, 350, 50); + + clutter_container_add (CLUTTER_CONTAINER (stage), + count_label, help_label, + rect, progress_rect, + NULL); + + timeline = clutter_timeline_new (150, 50); + clutter_timeline_set_loop (timeline, TRUE); + + alpha = clutter_alpha_new_full (timeline, CLUTTER_LINEAR); + r_behaviour = clutter_behaviour_rotate_new (alpha, + CLUTTER_Z_AXIS, + CLUTTER_ROTATE_CW, + 0.0, 360.0); + clutter_behaviour_apply (r_behaviour, rect); + + alpha = clutter_alpha_new_full (timeline, CLUTTER_LINEAR); + p_behaviour = clutter_behaviour_path_new_with_knots (alpha, + knots, + G_N_ELEMENTS (knots)); + clutter_behaviour_apply (p_behaviour, rect); + + g_signal_connect (stage, + "button-press-event", G_CALLBACK (clutter_main_quit), + NULL); + g_signal_connect (stage, + "key-press-event", G_CALLBACK (on_key_press_event), + NULL); + + clutter_actor_show (stage); + + clutter_threads_enter (); + clutter_main (); + clutter_threads_leave (); + + g_object_unref (p_behaviour); + g_object_unref (r_behaviour); + g_object_unref (timeline); + + return EXIT_SUCCESS; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-unproject.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-unproject.c --- clutter-0.8.4/tests/interactive/test-unproject.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-unproject.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,155 @@ +#include + +#include +#include +#include +#include + +#define RECT_L 200 +#define RECT_T 150 +#define RECT_W 320 +#define RECT_H 240 + +static ClutterActor *test_rectangle = NULL; +static ClutterActor *label = NULL; + + +static gboolean +on_event (ClutterStage *stage, + ClutterEvent *event, + gpointer user_data) +{ + switch (event->type) + { + case CLUTTER_BUTTON_PRESS: + { + gint x, y; + ClutterActor * actor; + ClutterUnit xu2, yu2; + + clutter_event_get_coords (event, &x, &y); + + actor = clutter_stage_get_actor_at_pos (stage, x, y); + + if (clutter_actor_transform_stage_point (actor, + CLUTTER_UNITS_FROM_DEVICE (x), + CLUTTER_UNITS_FROM_DEVICE (y), + &xu2, &yu2)) + { + gchar *txt; + + if (actor == test_rectangle) + txt = g_strdup_printf ("Click on rectangle\n" + "Screen coords: [%d, %d]\n" + "Local coords : [%d, %d]", + x, y, + CLUTTER_UNITS_TO_DEVICE (xu2), + CLUTTER_UNITS_TO_DEVICE (yu2)); + else + txt = g_strdup_printf ("Click on stage\n" + "Screen coords: [%d, %d]\n" + "Local coords : [%d, %d]", + x, y, + CLUTTER_UNITS_TO_DEVICE (xu2), + CLUTTER_UNITS_TO_DEVICE (yu2)); + + clutter_text_set_text (CLUTTER_TEXT (label), txt); + g_free (txt); + } + else + clutter_text_set_text (CLUTTER_TEXT (label), "Unprojection failed."); + } + break; + + default: + break; + } + + return FALSE; +} + + +G_MODULE_EXPORT int +test_unproject_main (int argc, char *argv[]) +{ + gchar *txt; + ClutterActor *rect, *stage, *label0; + int i, rotate_x = 0, rotate_y = 60, rotate_z = 0; + ClutterColor stage_clr = { 0x0, 0x0, 0x0, 0xff }, + white = { 0xff, 0xff, 0xff, 0xff }, + blue = { 0x0, 0xff, 0xff, 0xff }; + + for (i = 0; i < argc; ++i) + { + if (!strncmp (argv[i], "--rotate-x", 10)) + { + rotate_x = atoi (argv[i] + 11); + } + else if (!strncmp (argv[i], "--rotate-y", 10)) + { + rotate_y = atoi (argv[i] + 11); + } + else if (!strncmp (argv[i], "--rotate-z", 10)) + { + rotate_z = atoi (argv[i] + 11); + } + else if (!strncmp (argv[i], "--help", 6)) + { + g_print ("%s [--rotage-x=degrees] " + "[--rotage-y=degrees] " + "[--rotage-z=degrees]\n", + argv[0]); + + return EXIT_FAILURE; + } + } + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + + clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_clr); + clutter_actor_set_size (stage, 640, 480); + + rect = clutter_rectangle_new_with_color (&white); + clutter_actor_set_size (rect, RECT_W, RECT_H); + clutter_actor_set_position (rect, RECT_L, RECT_T); + clutter_actor_set_rotation (rect, CLUTTER_X_AXIS, rotate_x, 0, 0, 0); + clutter_actor_set_rotation (rect, CLUTTER_Y_AXIS, rotate_y, 0, 0, 0); + clutter_actor_set_rotation (rect, CLUTTER_Z_AXIS, rotate_z, 0, 0, 0); + clutter_group_add (CLUTTER_GROUP (stage), rect); + test_rectangle = rect; + + txt = g_strdup_printf ("Rectangle: L %d, R %d, T %d, B %d\n" + "Rotation : x %d, y %d, z %d", + RECT_L, RECT_L + RECT_W, + RECT_T, RECT_T + RECT_H, + rotate_x, rotate_y, rotate_z); + + label0 = clutter_text_new_with_text ("Mono 8pt", txt); + clutter_text_set_color (CLUTTER_TEXT (label0), &white); + + clutter_actor_set_position (label0, 10, 10); + clutter_group_add (CLUTTER_GROUP (stage), label0); + + g_free (txt); + + label = + clutter_text_new_with_text ("Mono 8pt", "Click around!"); + + clutter_text_set_color (CLUTTER_TEXT (label), &blue); + + clutter_actor_set_position (label, 10, 50); + clutter_group_add (CLUTTER_GROUP (stage), label); + + clutter_actor_show_all (stage); + + g_signal_connect (stage, "event", G_CALLBACK (on_event), NULL); + + clutter_main(); + + test_rectangle = NULL; + label = NULL; + + return EXIT_SUCCESS; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/interactive/test-viewport.c /tmp/VXszleoOf1/clutter-0.9.0/tests/interactive/test-viewport.c --- clutter-0.8.4/tests/interactive/test-viewport.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/interactive/test-viewport.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,64 @@ +#include +#include +#include + +#include +#include + +#include + +G_MODULE_EXPORT int +test_viewport_main (int argc, char *argv[]) +{ + ClutterTimeline *timeline; + ClutterAlpha *alpha; + ClutterBehaviour *r_behave; + ClutterActor *stage; + ClutterActor *hand; + ClutterColor stage_color = { 0xcc, 0xcc, 0xcc, 0xff }; + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + + clutter_stage_set_color (CLUTTER_STAGE (stage), + &stage_color); + + /* Make a hand */ + hand = clutter_texture_new_from_file ("redhand.png", NULL); + if (!hand) + g_error("pixbuf load failed"); + + clutter_actor_set_position (hand, 300, 200); + clutter_actor_set_clip (hand, 20, 21, 132, 170); + clutter_actor_set_anchor_point (hand, 86, 125); + clutter_actor_show (hand); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), hand); + + /* Make a timeline */ + timeline = clutter_timeline_new (200, 26); /* num frames, fps */ + clutter_timeline_set_loop (timeline, TRUE); + + /* Set an alpha func to power behaviour */ + alpha = clutter_alpha_new_full (timeline, CLUTTER_LINEAR); + + /* Create a behaviour for that alpha */ + r_behave = clutter_behaviour_rotate_new (alpha, + CLUTTER_Z_AXIS, + CLUTTER_ROTATE_CW, + 0.0, 360.0); + + /* Apply it to our actor */ + clutter_behaviour_apply (r_behave, hand); + + /* start the timeline and thus the animations */ + clutter_timeline_start (timeline); + + clutter_actor_show_all (stage); + + clutter_main(); + + g_object_unref (r_behave); + + return 0; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/tests/Makefile.am --- clutter-0.8.4/tests/Makefile.am 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/Makefile.am 2009-01-28 08:12:46.000000000 +0000 @@ -1,78 +1,13 @@ -noinst_PROGRAMS = test-textures test-events test-offscreen test-scale \ - test-actors test-behave test-text test-entry test-project \ - test-perspective test-rotate test-depth \ - test-threads test-timeline test-timeline-dup-frames \ - test-timeline-interpolate test-timeline-rewind \ - test-timeline-smoothness \ - test-threads test-timeline test-score test-script \ - test-model test-grab test-effects test-fullscreen \ - test-shader test-unproject test-viewport test-fbo \ - test-opacity test-multistage \ - test-cogl-primitives test-cogl-tex-tile \ - test-cogl-tex-convert test-cogl-tex-foreign \ - test-cogl-tex-getset test-cogl-offscreen \ - test-cogl-tex-polygon test-stage-read-pixels \ - test-random-text test-clip test-paint-wrapper \ - test-texture-quality test-entry-auto test-layout \ - test-invariants test-label-cache test-pick +SUBDIRS = data conform interactive micro-bench tools -if X11_TESTS -noinst_PROGRAMS += test-pixmap -noinst_PROGRAMS += test-devices -endif +EXTRA_DIST = README -INCLUDES = -I$(top_srcdir)/ -I$(top_srcdir)/clutter -I$(top_builddir)/clutter -LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -AM_CFLAGS = $(CLUTTER_CFLAGS) -AM_LDFLAGS = $(CLUTTER_LIBS) +.PHONY: test conform +test conform: + $(MAKE) -C ./conform test +.PHONY: test-report full-report +test-report full-report: + $(MAKE) -C ./conform $(@) -test_textures_SOURCES = test-textures.c -test_events_SOURCES = test-events.c -test_offscreen_SOURCES = test-offscreen.c -test_scale_SOURCES = test-scale.c -test_actors_SOURCES = test-actors.c -test_grab_SOURCES = test-grab.c -test_behave_SOURCES = test-behave.c -test_text_SOURCES = test-text.c -test_entry_SOURCES = test-entry.c -test_project_SOURCES = test-project.c -test_unproject_SOURCES = test-unproject.c -test_perspective_SOURCES = test-perspective.c -test_rotate_SOURCES = test-rotate.c -test_depth_SOURCES = test-depth.c -test_threads_SOURCES = test-threads.c -test_timeline_SOURCES = test-timeline.c -test_timeline_dup_frames_SOURCES = test-timeline-dup-frames.c -test_timeline_interpolate_SOURCES = test-timeline-interpolate.c -test_timeline_rewind_SOURCES = test-timeline-rewind.c -test_timeline_smoothness_SOURCES = test-timeline-smoothness.c -test_shader_SOURCES = test-shader.c -test_score_SOURCES = test-score.c -test_script_SOURCES = test-script.c -test_model_SOURCES = test-model.c -test_effects_SOURCES = test-effects.c -test_fullscreen_SOURCES = test-fullscreen.c -test_viewport_SOURCES = test-viewport.c -test_fbo_SOURCES = test-fbo.c -test_opacity_SOURCES = test-opacity.c -test_multistage_SOURCES = test-multistage.c -test_pixmap_SOURCES = test-pixmap.c -test_pixmap_LDFLAGS = -lXcomposite -test_cogl_primitives_SOURCES = test-cogl-primitives.c -test_cogl_tex_tile_SOURCES = test-cogl-tex-tile.c -test_cogl_tex_convert_SOURCES = test-cogl-tex-convert.c -test_cogl_tex_foreign_SOURCES = test-cogl-tex-foreign.c -test_cogl_tex_getset_SOURCES = test-cogl-tex-getset.c -test_cogl_offscreen_SOURCES = test-cogl-offscreen.c -test_stage_read_pixels_SOURCES = test-stage-read-pixels.c -test_random_text_SOURCES = test-random-text.c -test_paint_wrapper_SOURCES = test-paint-wrapper.c -test_texture_quality_SOURCES = test-texture-quality.c -test_entry_auto_SOURCES = test-entry-auto.c -test_layout_SOURCES = test-layout.c -test_invariants_SOURCES = test-invariants.c -test_devices_SOURCES = test-devices.c -test_label_cache_SOURCES = test-label-cache.c -test_pick_SOURCES = test-pick.c - -EXTRA_DIST = redhand.png test-script.json +# run make test as part of make check +check-local: test diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/tests/Makefile.in --- clutter-0.8.4/tests/Makefile.in 2008-11-28 18:22:49.000000000 +0000 +++ clutter-0.9.0/tests/Makefile.in 2009-01-28 16:48:58.000000000 +0000 @@ -13,7 +13,6 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -32,33 +31,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -noinst_PROGRAMS = test-textures$(EXEEXT) test-events$(EXEEXT) \ - test-offscreen$(EXEEXT) test-scale$(EXEEXT) \ - test-actors$(EXEEXT) test-behave$(EXEEXT) test-text$(EXEEXT) \ - test-entry$(EXEEXT) test-project$(EXEEXT) \ - test-perspective$(EXEEXT) test-rotate$(EXEEXT) \ - test-depth$(EXEEXT) test-threads$(EXEEXT) \ - test-timeline$(EXEEXT) test-timeline-dup-frames$(EXEEXT) \ - test-timeline-interpolate$(EXEEXT) \ - test-timeline-rewind$(EXEEXT) \ - test-timeline-smoothness$(EXEEXT) test-threads$(EXEEXT) \ - test-timeline$(EXEEXT) test-score$(EXEEXT) \ - test-script$(EXEEXT) test-model$(EXEEXT) test-grab$(EXEEXT) \ - test-effects$(EXEEXT) test-fullscreen$(EXEEXT) \ - test-shader$(EXEEXT) test-unproject$(EXEEXT) \ - test-viewport$(EXEEXT) test-fbo$(EXEEXT) test-opacity$(EXEEXT) \ - test-multistage$(EXEEXT) test-cogl-primitives$(EXEEXT) \ - test-cogl-tex-tile$(EXEEXT) test-cogl-tex-convert$(EXEEXT) \ - test-cogl-tex-foreign$(EXEEXT) test-cogl-tex-getset$(EXEEXT) \ - test-cogl-offscreen$(EXEEXT) test-cogl-tex-polygon$(EXEEXT) \ - test-stage-read-pixels$(EXEEXT) test-random-text$(EXEEXT) \ - test-clip$(EXEEXT) test-paint-wrapper$(EXEEXT) \ - test-texture-quality$(EXEEXT) test-entry-auto$(EXEEXT) \ - test-layout$(EXEEXT) test-invariants$(EXEEXT) \ - test-label-cache$(EXEEXT) test-pick$(EXEEXT) $(am__EXEEXT_1) -@X11_TESTS_TRUE@am__append_1 = test-pixmap test-devices subdir = tests -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -66,283 +40,20 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = -@X11_TESTS_TRUE@am__EXEEXT_1 = test-pixmap$(EXEEXT) \ -@X11_TESTS_TRUE@ test-devices$(EXEEXT) -PROGRAMS = $(noinst_PROGRAMS) -am_test_actors_OBJECTS = test-actors.$(OBJEXT) -test_actors_OBJECTS = $(am_test_actors_OBJECTS) -test_actors_LDADD = $(LDADD) -test_actors_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_behave_OBJECTS = test-behave.$(OBJEXT) -test_behave_OBJECTS = $(am_test_behave_OBJECTS) -test_behave_LDADD = $(LDADD) -test_behave_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -test_clip_SOURCES = test-clip.c -test_clip_OBJECTS = test-clip.$(OBJEXT) -test_clip_LDADD = $(LDADD) -test_clip_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_cogl_offscreen_OBJECTS = test-cogl-offscreen.$(OBJEXT) -test_cogl_offscreen_OBJECTS = $(am_test_cogl_offscreen_OBJECTS) -test_cogl_offscreen_LDADD = $(LDADD) -test_cogl_offscreen_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_cogl_primitives_OBJECTS = test-cogl-primitives.$(OBJEXT) -test_cogl_primitives_OBJECTS = $(am_test_cogl_primitives_OBJECTS) -test_cogl_primitives_LDADD = $(LDADD) -test_cogl_primitives_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_cogl_tex_convert_OBJECTS = test-cogl-tex-convert.$(OBJEXT) -test_cogl_tex_convert_OBJECTS = $(am_test_cogl_tex_convert_OBJECTS) -test_cogl_tex_convert_LDADD = $(LDADD) -test_cogl_tex_convert_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_cogl_tex_foreign_OBJECTS = test-cogl-tex-foreign.$(OBJEXT) -test_cogl_tex_foreign_OBJECTS = $(am_test_cogl_tex_foreign_OBJECTS) -test_cogl_tex_foreign_LDADD = $(LDADD) -test_cogl_tex_foreign_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_cogl_tex_getset_OBJECTS = test-cogl-tex-getset.$(OBJEXT) -test_cogl_tex_getset_OBJECTS = $(am_test_cogl_tex_getset_OBJECTS) -test_cogl_tex_getset_LDADD = $(LDADD) -test_cogl_tex_getset_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -test_cogl_tex_polygon_SOURCES = test-cogl-tex-polygon.c -test_cogl_tex_polygon_OBJECTS = test-cogl-tex-polygon.$(OBJEXT) -test_cogl_tex_polygon_LDADD = $(LDADD) -test_cogl_tex_polygon_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_cogl_tex_tile_OBJECTS = test-cogl-tex-tile.$(OBJEXT) -test_cogl_tex_tile_OBJECTS = $(am_test_cogl_tex_tile_OBJECTS) -test_cogl_tex_tile_LDADD = $(LDADD) -test_cogl_tex_tile_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_depth_OBJECTS = test-depth.$(OBJEXT) -test_depth_OBJECTS = $(am_test_depth_OBJECTS) -test_depth_LDADD = $(LDADD) -test_depth_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_devices_OBJECTS = test-devices.$(OBJEXT) -test_devices_OBJECTS = $(am_test_devices_OBJECTS) -test_devices_LDADD = $(LDADD) -test_devices_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_effects_OBJECTS = test-effects.$(OBJEXT) -test_effects_OBJECTS = $(am_test_effects_OBJECTS) -test_effects_LDADD = $(LDADD) -test_effects_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_entry_OBJECTS = test-entry.$(OBJEXT) -test_entry_OBJECTS = $(am_test_entry_OBJECTS) -test_entry_LDADD = $(LDADD) -test_entry_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_entry_auto_OBJECTS = test-entry-auto.$(OBJEXT) -test_entry_auto_OBJECTS = $(am_test_entry_auto_OBJECTS) -test_entry_auto_LDADD = $(LDADD) -test_entry_auto_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_events_OBJECTS = test-events.$(OBJEXT) -test_events_OBJECTS = $(am_test_events_OBJECTS) -test_events_LDADD = $(LDADD) -test_events_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_fbo_OBJECTS = test-fbo.$(OBJEXT) -test_fbo_OBJECTS = $(am_test_fbo_OBJECTS) -test_fbo_LDADD = $(LDADD) -test_fbo_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_fullscreen_OBJECTS = test-fullscreen.$(OBJEXT) -test_fullscreen_OBJECTS = $(am_test_fullscreen_OBJECTS) -test_fullscreen_LDADD = $(LDADD) -test_fullscreen_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_grab_OBJECTS = test-grab.$(OBJEXT) -test_grab_OBJECTS = $(am_test_grab_OBJECTS) -test_grab_LDADD = $(LDADD) -test_grab_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_invariants_OBJECTS = test-invariants.$(OBJEXT) -test_invariants_OBJECTS = $(am_test_invariants_OBJECTS) -test_invariants_LDADD = $(LDADD) -test_invariants_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_label_cache_OBJECTS = test-label-cache.$(OBJEXT) -test_label_cache_OBJECTS = $(am_test_label_cache_OBJECTS) -test_label_cache_LDADD = $(LDADD) -test_label_cache_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_layout_OBJECTS = test-layout.$(OBJEXT) -test_layout_OBJECTS = $(am_test_layout_OBJECTS) -test_layout_LDADD = $(LDADD) -test_layout_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_model_OBJECTS = test-model.$(OBJEXT) -test_model_OBJECTS = $(am_test_model_OBJECTS) -test_model_LDADD = $(LDADD) -test_model_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_multistage_OBJECTS = test-multistage.$(OBJEXT) -test_multistage_OBJECTS = $(am_test_multistage_OBJECTS) -test_multistage_LDADD = $(LDADD) -test_multistage_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_offscreen_OBJECTS = test-offscreen.$(OBJEXT) -test_offscreen_OBJECTS = $(am_test_offscreen_OBJECTS) -test_offscreen_LDADD = $(LDADD) -test_offscreen_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_opacity_OBJECTS = test-opacity.$(OBJEXT) -test_opacity_OBJECTS = $(am_test_opacity_OBJECTS) -test_opacity_LDADD = $(LDADD) -test_opacity_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_paint_wrapper_OBJECTS = test-paint-wrapper.$(OBJEXT) -test_paint_wrapper_OBJECTS = $(am_test_paint_wrapper_OBJECTS) -test_paint_wrapper_LDADD = $(LDADD) -test_paint_wrapper_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_perspective_OBJECTS = test-perspective.$(OBJEXT) -test_perspective_OBJECTS = $(am_test_perspective_OBJECTS) -test_perspective_LDADD = $(LDADD) -test_perspective_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_pick_OBJECTS = test-pick.$(OBJEXT) -test_pick_OBJECTS = $(am_test_pick_OBJECTS) -test_pick_LDADD = $(LDADD) -test_pick_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_pixmap_OBJECTS = test-pixmap.$(OBJEXT) -test_pixmap_OBJECTS = $(am_test_pixmap_OBJECTS) -test_pixmap_LDADD = $(LDADD) -test_pixmap_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -test_pixmap_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(test_pixmap_LDFLAGS) $(LDFLAGS) -o $@ -am_test_project_OBJECTS = test-project.$(OBJEXT) -test_project_OBJECTS = $(am_test_project_OBJECTS) -test_project_LDADD = $(LDADD) -test_project_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_random_text_OBJECTS = test-random-text.$(OBJEXT) -test_random_text_OBJECTS = $(am_test_random_text_OBJECTS) -test_random_text_LDADD = $(LDADD) -test_random_text_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_rotate_OBJECTS = test-rotate.$(OBJEXT) -test_rotate_OBJECTS = $(am_test_rotate_OBJECTS) -test_rotate_LDADD = $(LDADD) -test_rotate_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_scale_OBJECTS = test-scale.$(OBJEXT) -test_scale_OBJECTS = $(am_test_scale_OBJECTS) -test_scale_LDADD = $(LDADD) -test_scale_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_score_OBJECTS = test-score.$(OBJEXT) -test_score_OBJECTS = $(am_test_score_OBJECTS) -test_score_LDADD = $(LDADD) -test_score_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_script_OBJECTS = test-script.$(OBJEXT) -test_script_OBJECTS = $(am_test_script_OBJECTS) -test_script_LDADD = $(LDADD) -test_script_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_shader_OBJECTS = test-shader.$(OBJEXT) -test_shader_OBJECTS = $(am_test_shader_OBJECTS) -test_shader_LDADD = $(LDADD) -test_shader_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_stage_read_pixels_OBJECTS = test-stage-read-pixels.$(OBJEXT) -test_stage_read_pixels_OBJECTS = $(am_test_stage_read_pixels_OBJECTS) -test_stage_read_pixels_LDADD = $(LDADD) -test_stage_read_pixels_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_text_OBJECTS = test-text.$(OBJEXT) -test_text_OBJECTS = $(am_test_text_OBJECTS) -test_text_LDADD = $(LDADD) -test_text_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_texture_quality_OBJECTS = test-texture-quality.$(OBJEXT) -test_texture_quality_OBJECTS = $(am_test_texture_quality_OBJECTS) -test_texture_quality_LDADD = $(LDADD) -test_texture_quality_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_textures_OBJECTS = test-textures.$(OBJEXT) -test_textures_OBJECTS = $(am_test_textures_OBJECTS) -test_textures_LDADD = $(LDADD) -test_textures_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_threads_OBJECTS = test-threads.$(OBJEXT) -test_threads_OBJECTS = $(am_test_threads_OBJECTS) -test_threads_LDADD = $(LDADD) -test_threads_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_timeline_OBJECTS = test-timeline.$(OBJEXT) -test_timeline_OBJECTS = $(am_test_timeline_OBJECTS) -test_timeline_LDADD = $(LDADD) -test_timeline_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_timeline_dup_frames_OBJECTS = \ - test-timeline-dup-frames.$(OBJEXT) -test_timeline_dup_frames_OBJECTS = \ - $(am_test_timeline_dup_frames_OBJECTS) -test_timeline_dup_frames_LDADD = $(LDADD) -test_timeline_dup_frames_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_timeline_interpolate_OBJECTS = \ - test-timeline-interpolate.$(OBJEXT) -test_timeline_interpolate_OBJECTS = \ - $(am_test_timeline_interpolate_OBJECTS) -test_timeline_interpolate_LDADD = $(LDADD) -test_timeline_interpolate_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_timeline_rewind_OBJECTS = test-timeline-rewind.$(OBJEXT) -test_timeline_rewind_OBJECTS = $(am_test_timeline_rewind_OBJECTS) -test_timeline_rewind_LDADD = $(LDADD) -test_timeline_rewind_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_timeline_smoothness_OBJECTS = \ - test-timeline-smoothness.$(OBJEXT) -test_timeline_smoothness_OBJECTS = \ - $(am_test_timeline_smoothness_OBJECTS) -test_timeline_smoothness_LDADD = $(LDADD) -test_timeline_smoothness_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_unproject_OBJECTS = test-unproject.$(OBJEXT) -test_unproject_OBJECTS = $(am_test_unproject_OBJECTS) -test_unproject_LDADD = $(LDADD) -test_unproject_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -am_test_viewport_OBJECTS = test-viewport.$(OBJEXT) -test_viewport_OBJECTS = $(am_test_viewport_OBJECTS) -test_viewport_LDADD = $(LDADD) -test_viewport_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(test_actors_SOURCES) $(test_behave_SOURCES) test-clip.c \ - $(test_cogl_offscreen_SOURCES) $(test_cogl_primitives_SOURCES) \ - $(test_cogl_tex_convert_SOURCES) \ - $(test_cogl_tex_foreign_SOURCES) \ - $(test_cogl_tex_getset_SOURCES) test-cogl-tex-polygon.c \ - $(test_cogl_tex_tile_SOURCES) $(test_depth_SOURCES) \ - $(test_devices_SOURCES) $(test_effects_SOURCES) \ - $(test_entry_SOURCES) $(test_entry_auto_SOURCES) \ - $(test_events_SOURCES) $(test_fbo_SOURCES) \ - $(test_fullscreen_SOURCES) $(test_grab_SOURCES) \ - $(test_invariants_SOURCES) $(test_label_cache_SOURCES) \ - $(test_layout_SOURCES) $(test_model_SOURCES) \ - $(test_multistage_SOURCES) $(test_offscreen_SOURCES) \ - $(test_opacity_SOURCES) $(test_paint_wrapper_SOURCES) \ - $(test_perspective_SOURCES) $(test_pick_SOURCES) \ - $(test_pixmap_SOURCES) $(test_project_SOURCES) \ - $(test_random_text_SOURCES) $(test_rotate_SOURCES) \ - $(test_scale_SOURCES) $(test_score_SOURCES) \ - $(test_script_SOURCES) $(test_shader_SOURCES) \ - $(test_stage_read_pixels_SOURCES) $(test_text_SOURCES) \ - $(test_texture_quality_SOURCES) $(test_textures_SOURCES) \ - $(test_threads_SOURCES) $(test_timeline_SOURCES) \ - $(test_timeline_dup_frames_SOURCES) \ - $(test_timeline_interpolate_SOURCES) \ - $(test_timeline_rewind_SOURCES) \ - $(test_timeline_smoothness_SOURCES) $(test_unproject_SOURCES) \ - $(test_viewport_SOURCES) -DIST_SOURCES = $(test_actors_SOURCES) $(test_behave_SOURCES) \ - test-clip.c $(test_cogl_offscreen_SOURCES) \ - $(test_cogl_primitives_SOURCES) \ - $(test_cogl_tex_convert_SOURCES) \ - $(test_cogl_tex_foreign_SOURCES) \ - $(test_cogl_tex_getset_SOURCES) test-cogl-tex-polygon.c \ - $(test_cogl_tex_tile_SOURCES) $(test_depth_SOURCES) \ - $(test_devices_SOURCES) $(test_effects_SOURCES) \ - $(test_entry_SOURCES) $(test_entry_auto_SOURCES) \ - $(test_events_SOURCES) $(test_fbo_SOURCES) \ - $(test_fullscreen_SOURCES) $(test_grab_SOURCES) \ - $(test_invariants_SOURCES) $(test_label_cache_SOURCES) \ - $(test_layout_SOURCES) $(test_model_SOURCES) \ - $(test_multistage_SOURCES) $(test_offscreen_SOURCES) \ - $(test_opacity_SOURCES) $(test_paint_wrapper_SOURCES) \ - $(test_perspective_SOURCES) $(test_pick_SOURCES) \ - $(test_pixmap_SOURCES) $(test_project_SOURCES) \ - $(test_random_text_SOURCES) $(test_rotate_SOURCES) \ - $(test_scale_SOURCES) $(test_score_SOURCES) \ - $(test_script_SOURCES) $(test_shader_SOURCES) \ - $(test_stage_read_pixels_SOURCES) $(test_text_SOURCES) \ - $(test_texture_quality_SOURCES) $(test_textures_SOURCES) \ - $(test_threads_SOURCES) $(test_timeline_SOURCES) \ - $(test_timeline_dup_frames_SOURCES) \ - $(test_timeline_interpolate_SOURCES) \ - $(test_timeline_rewind_SOURCES) \ - $(test_timeline_smoothness_SOURCES) $(test_unproject_SOURCES) \ - $(test_viewport_SOURCES) +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -394,7 +105,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GCC_FLAGS = @GCC_FLAGS@ -GDKPIXBUF_PREFIX = @GDKPIXBUF_PREFIX@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ @@ -419,6 +129,7 @@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -510,63 +221,11 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -INCLUDES = -I$(top_srcdir)/ -I$(top_srcdir)/clutter -I$(top_builddir)/clutter -LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la -AM_CFLAGS = $(CLUTTER_CFLAGS) -AM_LDFLAGS = $(CLUTTER_LIBS) -test_textures_SOURCES = test-textures.c -test_events_SOURCES = test-events.c -test_offscreen_SOURCES = test-offscreen.c -test_scale_SOURCES = test-scale.c -test_actors_SOURCES = test-actors.c -test_grab_SOURCES = test-grab.c -test_behave_SOURCES = test-behave.c -test_text_SOURCES = test-text.c -test_entry_SOURCES = test-entry.c -test_project_SOURCES = test-project.c -test_unproject_SOURCES = test-unproject.c -test_perspective_SOURCES = test-perspective.c -test_rotate_SOURCES = test-rotate.c -test_depth_SOURCES = test-depth.c -test_threads_SOURCES = test-threads.c -test_timeline_SOURCES = test-timeline.c -test_timeline_dup_frames_SOURCES = test-timeline-dup-frames.c -test_timeline_interpolate_SOURCES = test-timeline-interpolate.c -test_timeline_rewind_SOURCES = test-timeline-rewind.c -test_timeline_smoothness_SOURCES = test-timeline-smoothness.c -test_shader_SOURCES = test-shader.c -test_score_SOURCES = test-score.c -test_script_SOURCES = test-script.c -test_model_SOURCES = test-model.c -test_effects_SOURCES = test-effects.c -test_fullscreen_SOURCES = test-fullscreen.c -test_viewport_SOURCES = test-viewport.c -test_fbo_SOURCES = test-fbo.c -test_opacity_SOURCES = test-opacity.c -test_multistage_SOURCES = test-multistage.c -test_pixmap_SOURCES = test-pixmap.c -test_pixmap_LDFLAGS = -lXcomposite -test_cogl_primitives_SOURCES = test-cogl-primitives.c -test_cogl_tex_tile_SOURCES = test-cogl-tex-tile.c -test_cogl_tex_convert_SOURCES = test-cogl-tex-convert.c -test_cogl_tex_foreign_SOURCES = test-cogl-tex-foreign.c -test_cogl_tex_getset_SOURCES = test-cogl-tex-getset.c -test_cogl_offscreen_SOURCES = test-cogl-offscreen.c -test_stage_read_pixels_SOURCES = test-stage-read-pixels.c -test_random_text_SOURCES = test-random-text.c -test_paint_wrapper_SOURCES = test-paint-wrapper.c -test_texture_quality_SOURCES = test-texture-quality.c -test_entry_auto_SOURCES = test-entry-auto.c -test_layout_SOURCES = test-layout.c -test_invariants_SOURCES = test-invariants.c -test_devices_SOURCES = test-devices.c -test_label_cache_SOURCES = test-label-cache.c -test_pick_SOURCES = test-pick.c -EXTRA_DIST = redhand.png test-script.json -all: all-am +SUBDIRS = data conform interactive micro-bench tools +EXTRA_DIST = README +all: all-recursive .SUFFIXES: -.SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -597,243 +256,82 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -test-actors$(EXEEXT): $(test_actors_OBJECTS) $(test_actors_DEPENDENCIES) - @rm -f test-actors$(EXEEXT) - $(LINK) $(test_actors_OBJECTS) $(test_actors_LDADD) $(LIBS) -test-behave$(EXEEXT): $(test_behave_OBJECTS) $(test_behave_DEPENDENCIES) - @rm -f test-behave$(EXEEXT) - $(LINK) $(test_behave_OBJECTS) $(test_behave_LDADD) $(LIBS) -test-clip$(EXEEXT): $(test_clip_OBJECTS) $(test_clip_DEPENDENCIES) - @rm -f test-clip$(EXEEXT) - $(LINK) $(test_clip_OBJECTS) $(test_clip_LDADD) $(LIBS) -test-cogl-offscreen$(EXEEXT): $(test_cogl_offscreen_OBJECTS) $(test_cogl_offscreen_DEPENDENCIES) - @rm -f test-cogl-offscreen$(EXEEXT) - $(LINK) $(test_cogl_offscreen_OBJECTS) $(test_cogl_offscreen_LDADD) $(LIBS) -test-cogl-primitives$(EXEEXT): $(test_cogl_primitives_OBJECTS) $(test_cogl_primitives_DEPENDENCIES) - @rm -f test-cogl-primitives$(EXEEXT) - $(LINK) $(test_cogl_primitives_OBJECTS) $(test_cogl_primitives_LDADD) $(LIBS) -test-cogl-tex-convert$(EXEEXT): $(test_cogl_tex_convert_OBJECTS) $(test_cogl_tex_convert_DEPENDENCIES) - @rm -f test-cogl-tex-convert$(EXEEXT) - $(LINK) $(test_cogl_tex_convert_OBJECTS) $(test_cogl_tex_convert_LDADD) $(LIBS) -test-cogl-tex-foreign$(EXEEXT): $(test_cogl_tex_foreign_OBJECTS) $(test_cogl_tex_foreign_DEPENDENCIES) - @rm -f test-cogl-tex-foreign$(EXEEXT) - $(LINK) $(test_cogl_tex_foreign_OBJECTS) $(test_cogl_tex_foreign_LDADD) $(LIBS) -test-cogl-tex-getset$(EXEEXT): $(test_cogl_tex_getset_OBJECTS) $(test_cogl_tex_getset_DEPENDENCIES) - @rm -f test-cogl-tex-getset$(EXEEXT) - $(LINK) $(test_cogl_tex_getset_OBJECTS) $(test_cogl_tex_getset_LDADD) $(LIBS) -test-cogl-tex-polygon$(EXEEXT): $(test_cogl_tex_polygon_OBJECTS) $(test_cogl_tex_polygon_DEPENDENCIES) - @rm -f test-cogl-tex-polygon$(EXEEXT) - $(LINK) $(test_cogl_tex_polygon_OBJECTS) $(test_cogl_tex_polygon_LDADD) $(LIBS) -test-cogl-tex-tile$(EXEEXT): $(test_cogl_tex_tile_OBJECTS) $(test_cogl_tex_tile_DEPENDENCIES) - @rm -f test-cogl-tex-tile$(EXEEXT) - $(LINK) $(test_cogl_tex_tile_OBJECTS) $(test_cogl_tex_tile_LDADD) $(LIBS) -test-depth$(EXEEXT): $(test_depth_OBJECTS) $(test_depth_DEPENDENCIES) - @rm -f test-depth$(EXEEXT) - $(LINK) $(test_depth_OBJECTS) $(test_depth_LDADD) $(LIBS) -test-devices$(EXEEXT): $(test_devices_OBJECTS) $(test_devices_DEPENDENCIES) - @rm -f test-devices$(EXEEXT) - $(LINK) $(test_devices_OBJECTS) $(test_devices_LDADD) $(LIBS) -test-effects$(EXEEXT): $(test_effects_OBJECTS) $(test_effects_DEPENDENCIES) - @rm -f test-effects$(EXEEXT) - $(LINK) $(test_effects_OBJECTS) $(test_effects_LDADD) $(LIBS) -test-entry$(EXEEXT): $(test_entry_OBJECTS) $(test_entry_DEPENDENCIES) - @rm -f test-entry$(EXEEXT) - $(LINK) $(test_entry_OBJECTS) $(test_entry_LDADD) $(LIBS) -test-entry-auto$(EXEEXT): $(test_entry_auto_OBJECTS) $(test_entry_auto_DEPENDENCIES) - @rm -f test-entry-auto$(EXEEXT) - $(LINK) $(test_entry_auto_OBJECTS) $(test_entry_auto_LDADD) $(LIBS) -test-events$(EXEEXT): $(test_events_OBJECTS) $(test_events_DEPENDENCIES) - @rm -f test-events$(EXEEXT) - $(LINK) $(test_events_OBJECTS) $(test_events_LDADD) $(LIBS) -test-fbo$(EXEEXT): $(test_fbo_OBJECTS) $(test_fbo_DEPENDENCIES) - @rm -f test-fbo$(EXEEXT) - $(LINK) $(test_fbo_OBJECTS) $(test_fbo_LDADD) $(LIBS) -test-fullscreen$(EXEEXT): $(test_fullscreen_OBJECTS) $(test_fullscreen_DEPENDENCIES) - @rm -f test-fullscreen$(EXEEXT) - $(LINK) $(test_fullscreen_OBJECTS) $(test_fullscreen_LDADD) $(LIBS) -test-grab$(EXEEXT): $(test_grab_OBJECTS) $(test_grab_DEPENDENCIES) - @rm -f test-grab$(EXEEXT) - $(LINK) $(test_grab_OBJECTS) $(test_grab_LDADD) $(LIBS) -test-invariants$(EXEEXT): $(test_invariants_OBJECTS) $(test_invariants_DEPENDENCIES) - @rm -f test-invariants$(EXEEXT) - $(LINK) $(test_invariants_OBJECTS) $(test_invariants_LDADD) $(LIBS) -test-label-cache$(EXEEXT): $(test_label_cache_OBJECTS) $(test_label_cache_DEPENDENCIES) - @rm -f test-label-cache$(EXEEXT) - $(LINK) $(test_label_cache_OBJECTS) $(test_label_cache_LDADD) $(LIBS) -test-layout$(EXEEXT): $(test_layout_OBJECTS) $(test_layout_DEPENDENCIES) - @rm -f test-layout$(EXEEXT) - $(LINK) $(test_layout_OBJECTS) $(test_layout_LDADD) $(LIBS) -test-model$(EXEEXT): $(test_model_OBJECTS) $(test_model_DEPENDENCIES) - @rm -f test-model$(EXEEXT) - $(LINK) $(test_model_OBJECTS) $(test_model_LDADD) $(LIBS) -test-multistage$(EXEEXT): $(test_multistage_OBJECTS) $(test_multistage_DEPENDENCIES) - @rm -f test-multistage$(EXEEXT) - $(LINK) $(test_multistage_OBJECTS) $(test_multistage_LDADD) $(LIBS) -test-offscreen$(EXEEXT): $(test_offscreen_OBJECTS) $(test_offscreen_DEPENDENCIES) - @rm -f test-offscreen$(EXEEXT) - $(LINK) $(test_offscreen_OBJECTS) $(test_offscreen_LDADD) $(LIBS) -test-opacity$(EXEEXT): $(test_opacity_OBJECTS) $(test_opacity_DEPENDENCIES) - @rm -f test-opacity$(EXEEXT) - $(LINK) $(test_opacity_OBJECTS) $(test_opacity_LDADD) $(LIBS) -test-paint-wrapper$(EXEEXT): $(test_paint_wrapper_OBJECTS) $(test_paint_wrapper_DEPENDENCIES) - @rm -f test-paint-wrapper$(EXEEXT) - $(LINK) $(test_paint_wrapper_OBJECTS) $(test_paint_wrapper_LDADD) $(LIBS) -test-perspective$(EXEEXT): $(test_perspective_OBJECTS) $(test_perspective_DEPENDENCIES) - @rm -f test-perspective$(EXEEXT) - $(LINK) $(test_perspective_OBJECTS) $(test_perspective_LDADD) $(LIBS) -test-pick$(EXEEXT): $(test_pick_OBJECTS) $(test_pick_DEPENDENCIES) - @rm -f test-pick$(EXEEXT) - $(LINK) $(test_pick_OBJECTS) $(test_pick_LDADD) $(LIBS) -test-pixmap$(EXEEXT): $(test_pixmap_OBJECTS) $(test_pixmap_DEPENDENCIES) - @rm -f test-pixmap$(EXEEXT) - $(test_pixmap_LINK) $(test_pixmap_OBJECTS) $(test_pixmap_LDADD) $(LIBS) -test-project$(EXEEXT): $(test_project_OBJECTS) $(test_project_DEPENDENCIES) - @rm -f test-project$(EXEEXT) - $(LINK) $(test_project_OBJECTS) $(test_project_LDADD) $(LIBS) -test-random-text$(EXEEXT): $(test_random_text_OBJECTS) $(test_random_text_DEPENDENCIES) - @rm -f test-random-text$(EXEEXT) - $(LINK) $(test_random_text_OBJECTS) $(test_random_text_LDADD) $(LIBS) -test-rotate$(EXEEXT): $(test_rotate_OBJECTS) $(test_rotate_DEPENDENCIES) - @rm -f test-rotate$(EXEEXT) - $(LINK) $(test_rotate_OBJECTS) $(test_rotate_LDADD) $(LIBS) -test-scale$(EXEEXT): $(test_scale_OBJECTS) $(test_scale_DEPENDENCIES) - @rm -f test-scale$(EXEEXT) - $(LINK) $(test_scale_OBJECTS) $(test_scale_LDADD) $(LIBS) -test-score$(EXEEXT): $(test_score_OBJECTS) $(test_score_DEPENDENCIES) - @rm -f test-score$(EXEEXT) - $(LINK) $(test_score_OBJECTS) $(test_score_LDADD) $(LIBS) -test-script$(EXEEXT): $(test_script_OBJECTS) $(test_script_DEPENDENCIES) - @rm -f test-script$(EXEEXT) - $(LINK) $(test_script_OBJECTS) $(test_script_LDADD) $(LIBS) -test-shader$(EXEEXT): $(test_shader_OBJECTS) $(test_shader_DEPENDENCIES) - @rm -f test-shader$(EXEEXT) - $(LINK) $(test_shader_OBJECTS) $(test_shader_LDADD) $(LIBS) -test-stage-read-pixels$(EXEEXT): $(test_stage_read_pixels_OBJECTS) $(test_stage_read_pixels_DEPENDENCIES) - @rm -f test-stage-read-pixels$(EXEEXT) - $(LINK) $(test_stage_read_pixels_OBJECTS) $(test_stage_read_pixels_LDADD) $(LIBS) -test-text$(EXEEXT): $(test_text_OBJECTS) $(test_text_DEPENDENCIES) - @rm -f test-text$(EXEEXT) - $(LINK) $(test_text_OBJECTS) $(test_text_LDADD) $(LIBS) -test-texture-quality$(EXEEXT): $(test_texture_quality_OBJECTS) $(test_texture_quality_DEPENDENCIES) - @rm -f test-texture-quality$(EXEEXT) - $(LINK) $(test_texture_quality_OBJECTS) $(test_texture_quality_LDADD) $(LIBS) -test-textures$(EXEEXT): $(test_textures_OBJECTS) $(test_textures_DEPENDENCIES) - @rm -f test-textures$(EXEEXT) - $(LINK) $(test_textures_OBJECTS) $(test_textures_LDADD) $(LIBS) -test-threads$(EXEEXT): $(test_threads_OBJECTS) $(test_threads_DEPENDENCIES) - @rm -f test-threads$(EXEEXT) - $(LINK) $(test_threads_OBJECTS) $(test_threads_LDADD) $(LIBS) -test-timeline$(EXEEXT): $(test_timeline_OBJECTS) $(test_timeline_DEPENDENCIES) - @rm -f test-timeline$(EXEEXT) - $(LINK) $(test_timeline_OBJECTS) $(test_timeline_LDADD) $(LIBS) -test-timeline-dup-frames$(EXEEXT): $(test_timeline_dup_frames_OBJECTS) $(test_timeline_dup_frames_DEPENDENCIES) - @rm -f test-timeline-dup-frames$(EXEEXT) - $(LINK) $(test_timeline_dup_frames_OBJECTS) $(test_timeline_dup_frames_LDADD) $(LIBS) -test-timeline-interpolate$(EXEEXT): $(test_timeline_interpolate_OBJECTS) $(test_timeline_interpolate_DEPENDENCIES) - @rm -f test-timeline-interpolate$(EXEEXT) - $(LINK) $(test_timeline_interpolate_OBJECTS) $(test_timeline_interpolate_LDADD) $(LIBS) -test-timeline-rewind$(EXEEXT): $(test_timeline_rewind_OBJECTS) $(test_timeline_rewind_DEPENDENCIES) - @rm -f test-timeline-rewind$(EXEEXT) - $(LINK) $(test_timeline_rewind_OBJECTS) $(test_timeline_rewind_LDADD) $(LIBS) -test-timeline-smoothness$(EXEEXT): $(test_timeline_smoothness_OBJECTS) $(test_timeline_smoothness_DEPENDENCIES) - @rm -f test-timeline-smoothness$(EXEEXT) - $(LINK) $(test_timeline_smoothness_OBJECTS) $(test_timeline_smoothness_LDADD) $(LIBS) -test-unproject$(EXEEXT): $(test_unproject_OBJECTS) $(test_unproject_DEPENDENCIES) - @rm -f test-unproject$(EXEEXT) - $(LINK) $(test_unproject_OBJECTS) $(test_unproject_LDADD) $(LIBS) -test-viewport$(EXEEXT): $(test_viewport_OBJECTS) $(test_viewport_DEPENDENCIES) - @rm -f test-viewport$(EXEEXT) - $(LINK) $(test_viewport_OBJECTS) $(test_viewport_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-actors.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-behave.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-clip.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cogl-offscreen.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cogl-primitives.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cogl-tex-convert.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cogl-tex-foreign.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cogl-tex-getset.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cogl-tex-polygon.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cogl-tex-tile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-depth.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-devices.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-effects.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-entry-auto.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-entry.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-events.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fbo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fullscreen.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-grab.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-invariants.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-label-cache.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-layout.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-model.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-multistage.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-offscreen.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-opacity.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-paint-wrapper.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-perspective.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pick.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pixmap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-project.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-random-text.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-rotate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-scale.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-score.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-script.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-shader.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stage-read-pixels.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-text.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-texture-quality.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-textures.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-threads.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-timeline-dup-frames.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-timeline-interpolate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-timeline-rewind.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-timeline-smoothness.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-timeline.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-unproject.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-viewport.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -844,10 +342,23 @@ mkid -fID $$unique tags: TAGS -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ @@ -860,7 +371,7 @@ $$tags $$unique; \ fi ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -907,19 +418,38 @@ || exit 1; \ fi; \ done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -installcheck: installcheck-am +installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ @@ -935,80 +465,87 @@ maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -clean: clean-am +clean: clean-recursive -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am +clean-am: clean-generic clean-libtool mostlyclean-am -distclean: distclean-am - -rm -rf ./$(DEPDIR) +distclean: distclean-recursive -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags +distclean-am: clean-am distclean-generic distclean-tags -dvi: dvi-am +dvi: dvi-recursive dvi-am: -html: html-am +html: html-recursive -info: info-am +info: info-recursive info-am: install-data-am: -install-dvi: install-dvi-am +install-dvi: install-dvi-recursive install-exec-am: -install-html: install-html-am +install-html: install-html-recursive -install-info: install-info-am +install-info: install-info-recursive install-man: -install-pdf: install-pdf-am +install-pdf: install-pdf-recursive -install-ps: install-ps-am +install-ps: install-ps-recursive installcheck-am: -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) +maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic -mostlyclean: mostlyclean-am +mostlyclean: mostlyclean-recursive -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool +mostlyclean-am: mostlyclean-generic mostlyclean-libtool -pdf: pdf-am +pdf: pdf-recursive pdf-am: -ps: ps-am +ps: ps-recursive ps-am: uninstall-am: -.MAKE: install-am install-strip +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am check-local clean clean-generic \ + clean-libtool ctags ctags-recursive distclean \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am + + +.PHONY: test conform +test conform: + $(MAKE) -C ./conform test +.PHONY: test-report full-report +test-report full-report: + $(MAKE) -C ./conform $(@) +# run make test as part of make check +check-local: test # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/micro-bench/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/tests/micro-bench/Makefile.am --- clutter-0.8.4/tests/micro-bench/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/micro-bench/Makefile.am 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,13 @@ +noinst_PROGRAMS = \ + test-text + +INCLUDES = -I$(top_srcdir)/ -I$(top_srcdir)/clutter -I$(top_builddir)/clutter +LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la +AM_CFLAGS = \ + $(CLUTTER_CFLAGS) \ + $(MAINTAINER_CFLAGS) \ + -DTESTS_DATA_DIR=\""$(top_srcdir)/tests/data/"\" +AM_LDFLAGS = $(CLUTTER_LIBS) + +test_text_SOURCES = test-text.c + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/micro-bench/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/tests/micro-bench/Makefile.in --- clutter-0.8.4/tests/micro-bench/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/micro-bench/Makefile.in 2009-01-28 16:48:58.000000000 +0000 @@ -0,0 +1,498 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = test-text$(EXEEXT) +subdir = tests/micro-bench +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_test_text_OBJECTS = test-text.$(OBJEXT) +test_text_OBJECTS = $(am_test_text_OBJECTS) +test_text_LDADD = $(LDADD) +test_text_DEPENDENCIES = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(test_text_SOURCES) +DIST_SOURCES = $(test_text_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CLUTTER_API_VERSION = @CLUTTER_API_VERSION@ +CLUTTER_CFLAGS = @CLUTTER_CFLAGS@ +CLUTTER_COGL = @CLUTTER_COGL@ +CLUTTER_DEBUG_CFLAGS = @CLUTTER_DEBUG_CFLAGS@ +CLUTTER_DEPS_CFLAGS = @CLUTTER_DEPS_CFLAGS@ +CLUTTER_DEPS_LIBS = @CLUTTER_DEPS_LIBS@ +CLUTTER_FLAVOUR = @CLUTTER_FLAVOUR@ +CLUTTER_GL_HEADER = @CLUTTER_GL_HEADER@ +CLUTTER_LIBS = @CLUTTER_LIBS@ +CLUTTER_LT_LDFLAGS = @CLUTTER_LT_LDFLAGS@ +CLUTTER_LT_VERSION = @CLUTTER_LT_VERSION@ +CLUTTER_MAJORMINOR = @CLUTTER_MAJORMINOR@ +CLUTTER_MAJOR_VERSION = @CLUTTER_MAJOR_VERSION@ +CLUTTER_MICRO_VERSION = @CLUTTER_MICRO_VERSION@ +CLUTTER_MINOR_VERSION = @CLUTTER_MINOR_VERSION@ +CLUTTER_REQUIRES = @CLUTTER_REQUIRES@ +CLUTTER_STAGE_TYPE = @CLUTTER_STAGE_TYPE@ +CLUTTER_VERSION = @CLUTTER_VERSION@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GCC_FLAGS = @GCC_FLAGS@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_PREFIX = @GLIB_PREFIX@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +JSON_PREFIX = @JSON_PREFIX@ +JW = @JW@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGO_PREFIX = @PANGO_PREFIX@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +RANLIB = @RANLIB@ +SDL_CONFIG = @SDL_CONFIG@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TSLIB_CFLAGS = @TSLIB_CFLAGS@ +TSLIB_LIBS = @TSLIB_LIBS@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XINPUT_CFLAGS = @XINPUT_CFLAGS@ +XINPUT_LIBS = @XINPUT_LIBS@ +XMKMF = @XMKMF@ +XMLTO = @XMLTO@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +backendextra = @backendextra@ +backendextralib = @backendextralib@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +clutterbackend = @clutterbackend@ +clutterbackendlib = @clutterbackendlib@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +imagebackend = @imagebackend@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = -I$(top_srcdir)/ -I$(top_srcdir)/clutter -I$(top_builddir)/clutter +LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la +AM_CFLAGS = \ + $(CLUTTER_CFLAGS) \ + $(MAINTAINER_CFLAGS) \ + -DTESTS_DATA_DIR=\""$(top_srcdir)/tests/data/"\" + +AM_LDFLAGS = $(CLUTTER_LIBS) +test_text_SOURCES = test-text.c +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/micro-bench/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/micro-bench/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +test-text$(EXEEXT): $(test_text_OBJECTS) $(test_text_DEPENDENCIES) + @rm -f test-text$(EXEEXT) + $(LINK) $(test_text_OBJECTS) $(test_text_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-text.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/micro-bench/test-text.c /tmp/VXszleoOf1/clutter-0.9.0/tests/micro-bench/test-text.c --- clutter-0.8.4/tests/micro-bench/test-text.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/micro-bench/test-text.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,117 @@ +#include + +#include +#include + +#define STAGE_WIDTH 640 +#define STAGE_HEIGHT 480 + +#define COLS 18 +#define ROWS 20 + +static void +on_paint (ClutterActor *actor, gconstpointer *data) +{ + static GTimer *timer = NULL; + static int fps = 0; + + if (!timer) + { + timer = g_timer_new (); + g_timer_start (timer); + } + + if (g_timer_elapsed (timer, NULL) >= 1) + { + printf ("fps: %d\n", fps); + g_timer_start (timer); + fps = 0; + } + + ++fps; +} + +static gboolean +queue_redraw (gpointer stage) +{ + clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); + + return TRUE; +} + +int +main (int argc, char *argv[]) +{ + ClutterActor *stage; + ClutterColor stage_color = { 0x00, 0x00, 0x00, 0xff }; + ClutterColor label_color = { 0xff, 0xff, 0xff, 0xff }; + ClutterActor *group; + + g_setenv ("CLUTTER_VBLANK", "none", FALSE); + + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT); + clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); + + group = clutter_group_new (); + clutter_actor_set_size (group, STAGE_WIDTH, STAGE_WIDTH); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), group); + + g_idle_add (queue_redraw, stage); + + g_signal_connect (group, "paint", G_CALLBACK (on_paint), NULL); + + { + gint row, col; + + for (row=0; row - -#if defined (_MSC_VER) && !defined (_USE_MATH_DEFINES) -#define _USE_MATH_DEFINES -#endif - -#include -#include -#include -#include - -#define TRAILS 0 -#define NHANDS 6 -#define RADIUS ((CLUTTER_STAGE_WIDTH()+CLUTTER_STAGE_HEIGHT())/NHANDS) - -typedef struct SuperOH -{ - ClutterActor **hand, *bgtex; - ClutterActor *group; - -} SuperOH; - -static gint n_hands = NHANDS; - -static GOptionEntry super_oh_entries[] = { - { - "num-hands", 'n', - 0, - G_OPTION_ARG_INT, &n_hands, - "Number of hands", "HANDS" - }, - { NULL } -}; - -static gint -get_radius (void) -{ - return (CLUTTER_STAGE_HEIGHT() + CLUTTER_STAGE_HEIGHT()) / n_hands ; -} - -/* input handler */ -static gboolean -input_cb (ClutterActor *stage, - ClutterEvent *event, - gpointer data) -{ - SuperOH *oh = data; - - if (event->type == CLUTTER_BUTTON_PRESS) - { - ClutterButtonEvent *button_event; - ClutterActor *e; - gint x, y; - - clutter_event_get_coords (event, &x, &y); - - button_event = (ClutterButtonEvent *) event; - g_print ("*** button press event (button:%d) ***\n", - button_event->button); - - e = clutter_stage_get_actor_at_pos (CLUTTER_STAGE (stage), x, y); - - if (e && (CLUTTER_IS_TEXTURE (e) || CLUTTER_IS_CLONE_TEXTURE (e))) - { - clutter_actor_hide (e); - return TRUE; - } - } - else if (event->type == CLUTTER_KEY_RELEASE) - { - ClutterKeyEvent *kev = (ClutterKeyEvent *) event; - - g_print ("*** key press event (key:%c) ***\n", - clutter_key_event_symbol (kev)); - - if (clutter_key_event_symbol (kev) == CLUTTER_q) - { - clutter_main_quit (); - return TRUE; - } - else if (clutter_key_event_symbol (kev) == CLUTTER_r) - { - gint i; - - for (i = 0; i < n_hands; i++) - clutter_actor_show (oh->hand[i]); - - return TRUE; - } - } - - return FALSE; -} - - -/* Timeline handler */ -static void -frame_cb (ClutterTimeline *timeline, - gint frame_num, - gpointer data) -{ - SuperOH *oh = data; - gint i; - - /* Rotate everything clockwise about stage center*/ - - clutter_actor_set_rotation (CLUTTER_ACTOR (oh->group), - CLUTTER_Z_AXIS, - frame_num, - CLUTTER_STAGE_WIDTH () / 2, - CLUTTER_STAGE_HEIGHT () / 2, - 0); - - for (i = 0; i < n_hands; i++) - { - gdouble scale_x, scale_y; - - clutter_actor_get_scale (oh->hand[i], &scale_x, &scale_y); - - /* Rotate each hand around there centers - to get this we need - * to take into account any scaling. - * - * FIXME: scaling causes drift so disabled for now. Need rotation - * unit based functions to fix. - */ - clutter_actor_set_rotation (oh->hand[i], CLUTTER_Z_AXIS, - - 6.0 * frame_num, 0, 0, 0); - } -} - -int -main (int argc, char *argv[]) -{ - ClutterTimeline *timeline; - ClutterAlpha *alpha; - ClutterBehaviour *scaler_1, *scaler_2; - ClutterActor *stage; - ClutterColor stage_color = { 0x61, 0x64, 0x8c, 0xff }; - SuperOH *oh; - gint i; - GError *error; - - error = NULL; - - clutter_init_with_args (&argc, &argv, - NULL, - super_oh_entries, - NULL, - &error); - if (error) - { - g_warning ("Unable to initialise Clutter:\n%s", - error->message); - g_error_free (error); - - exit (1); - } - - stage = clutter_stage_get_default (); - clutter_actor_set_size (stage, 800, 600); - - clutter_stage_set_title (CLUTTER_STAGE (stage), "Actors Test"); - clutter_stage_set_color (CLUTTER_STAGE (stage), - &stage_color); - - oh = g_new(SuperOH, 1); - - /* Create a timeline to manage animation */ - timeline = clutter_timeline_new (360, 60); /* num frames, fps */ - g_object_set (timeline, "loop", TRUE, NULL); /* have it loop */ - - /* fire a callback for frame change */ - g_signal_connect (timeline, "new-frame", G_CALLBACK (frame_cb), oh); - - /* Set up some behaviours to handle scaling */ - alpha = clutter_alpha_new_full (timeline, CLUTTER_ALPHA_SINE, NULL, NULL); - - scaler_1 = clutter_behaviour_scale_new (alpha, - 0.5, 0.5, - 1.0, 1.0); - - scaler_2 = clutter_behaviour_scale_new (alpha, - 1.0, 1.0, - 0.5, 0.5); - - /* create a new group to hold multiple actors in a group */ - oh->group = clutter_group_new(); - - oh->hand = g_new (ClutterActor*, n_hands); - for (i = 0; i < n_hands; i++) - { - gint x, y, w, h; - gint radius = get_radius (); - - /* Create a texture from file, then clone in to same resources */ - if (i == 0) - { - if ((oh->hand[i] = clutter_texture_new_from_file ("redhand.png", - &error)) == NULL) - { - g_error ("image load failed: %s", error->message); - exit (1); - } - } - else - oh->hand[i] = clutter_clone_texture_new (CLUTTER_TEXTURE(oh->hand[0])); - - /* Place around a circle */ - w = clutter_actor_get_width (oh->hand[0]); - h = clutter_actor_get_height (oh->hand[0]); - - x = CLUTTER_STAGE_WIDTH () / 2 - + radius - * cos (i * M_PI / (n_hands / 2)) - - w / 2; - - y = CLUTTER_STAGE_HEIGHT () / 2 - + radius - * sin (i * M_PI / (n_hands / 2)) - - h / 2; - - clutter_actor_set_position (oh->hand[i], x, y); - - clutter_actor_move_anchor_point_from_gravity (oh->hand[i], - CLUTTER_GRAVITY_CENTER); - - /* Add to our group group */ - clutter_container_add_actor (CLUTTER_CONTAINER (oh->group), oh->hand[i]); - -#if 1 /* FIXME: disabled as causes drift? - see comment above */ - if (i % 2) - clutter_behaviour_apply (scaler_1, oh->hand[i]); - else - clutter_behaviour_apply (scaler_2, oh->hand[i]); -#endif - } - - /* Add the group to the stage */ - clutter_container_add_actor (CLUTTER_CONTAINER (stage), - CLUTTER_ACTOR (oh->group)); - - /* Show everying ( and map window ) */ - clutter_actor_show (stage); - - - g_signal_connect (stage, "button-press-event", - G_CALLBACK (input_cb), - oh); - g_signal_connect (stage, "key-release-event", - G_CALLBACK (input_cb), - oh); - - /* and start it */ - clutter_timeline_start (timeline); - - clutter_main (); - - g_free (oh->hand); - g_free (oh); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-behave.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-behave.c --- clutter-0.8.4/tests/test-behave.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-behave.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,232 +0,0 @@ -#include -#include -#include - -#include - -#include - -static gboolean -button_press_cb (ClutterStage *stage, - ClutterButtonEvent *event, - gpointer data) -{ - const gchar *click_type; - - switch (event->click_count) - { - case 2: - click_type = "double"; - break; - case 3: - click_type = "triple"; - break; - default: - click_type = "single"; - break; - } - - g_print ("%s button press event\n", click_type); - - return FALSE; -} - -static gboolean -scroll_event_cb (ClutterStage *stage, - ClutterScrollEvent *event, - gpointer data) -{ - g_print ("scroll direction: %s\n", - event->direction == CLUTTER_SCROLL_UP ? "up" - : "down"); - - return FALSE; -} - -static void -timeline_completed (ClutterTimeline *timeline) -{ - ClutterTimelineDirection direction; - - direction = clutter_timeline_get_direction (timeline); - - if (direction == CLUTTER_TIMELINE_FORWARD) - direction = CLUTTER_TIMELINE_BACKWARD; - else - direction = CLUTTER_TIMELINE_FORWARD; - - clutter_timeline_set_direction (timeline, direction); -} - -typedef enum { - PATH_POLY, - PATH_ELLIPSE, - PATH_BSPLINE -} path_t; - -#define MAGIC 0.551784 -#define RADIUS 200 - -int -main (int argc, char *argv[]) -{ - ClutterTimeline *timeline; - ClutterAlpha *alpha; - ClutterBehaviour *o_behave, *p_behave; - ClutterActor *stage; - ClutterActor *group, *rect, *hand; - ClutterColor stage_color = { 0xcc, 0xcc, 0xcc, 0xff }; - ClutterColor rect_bg_color = { 0x33, 0x22, 0x22, 0xff }; - ClutterColor rect_border_color = { 0, 0, 0, 0 }; - int i; - path_t path_type = PATH_POLY; - - ClutterKnot knots_poly[] = {{ 0, 0 }, { 0, 300 }, { 300, 300 }, - { 300, 0 }, {0, 0 }}; - - ClutterKnot origin = { 200, 200 }; - - ClutterKnot knots_bspline[] = {{ -RADIUS, 0 }, - { -RADIUS, RADIUS*MAGIC }, - { -RADIUS*MAGIC, RADIUS }, - { 0, RADIUS }, - { RADIUS*MAGIC, RADIUS }, - { RADIUS, RADIUS*MAGIC }, - { RADIUS, 0 }, - { RADIUS, -RADIUS*MAGIC }, - { RADIUS*MAGIC, -RADIUS }, - { 0, -RADIUS }, - { -RADIUS*MAGIC, -RADIUS }, - { -RADIUS, -RADIUS*MAGIC }, - { -RADIUS, 0}}; - - for (i = 0; i < argc; ++i) - { - if (!strncmp (argv[i], "--path", 6)) - { - if (!strncmp (argv[i] + 7, "poly", 4)) - path_type = PATH_POLY; - else if (!strncmp (argv[i] + 7, "bspline", 7)) - path_type = PATH_BSPLINE; - else if (!strncmp (argv[i] + 7, "ellipse", 7)) - path_type = PATH_ELLIPSE; - } - else if (!strncmp (argv[i], "--help", 6)) - { - printf ("behave [--path=poly|ellipse|bspline]\n"); - exit (0); - } - } - - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - clutter_stage_hide_cursor (CLUTTER_STAGE (stage)); - - g_signal_connect (stage, "button-press-event", - G_CALLBACK (button_press_cb), - NULL); - g_signal_connect (stage, "scroll-event", - G_CALLBACK (scroll_event_cb), - NULL); - g_signal_connect (stage, "key-press-event", - G_CALLBACK (clutter_main_quit), - NULL); - - clutter_stage_set_color (CLUTTER_STAGE (stage), - &stage_color); - - /* Make a hand */ - group = clutter_group_new (); - clutter_container_add_actor (CLUTTER_CONTAINER (stage), group); - clutter_actor_show (group); - - hand = clutter_texture_new_from_file ("redhand.png", NULL); - if (hand == NULL) - { - g_error("pixbuf load failed"); - return 1; - } - clutter_actor_set_position (hand, 0, 0); - clutter_actor_show (hand); - - rect = clutter_rectangle_new (); - clutter_actor_set_position (rect, 0, 0); - clutter_actor_set_size (rect, - clutter_actor_get_width (hand), - clutter_actor_get_height (hand)); - clutter_rectangle_set_color (CLUTTER_RECTANGLE (rect), - &rect_bg_color); - clutter_rectangle_set_border_width (CLUTTER_RECTANGLE (rect), 10); - clutter_color_parse ("DarkSlateGray", &rect_border_color); - clutter_rectangle_set_border_color (CLUTTER_RECTANGLE (rect), - &rect_border_color); - clutter_actor_show (rect); - - clutter_container_add (CLUTTER_CONTAINER (group), rect, hand, NULL); - - /* Make a timeline */ - timeline = clutter_timeline_new_for_duration (4000); /* num frames, fps */ - clutter_timeline_set_loop (timeline, TRUE); - g_signal_connect (timeline, - "completed", G_CALLBACK (timeline_completed), - NULL); - - /* Set an alpha func to power behaviour - ramp is constant rise/fall */ - alpha = clutter_alpha_new_full (timeline, - CLUTTER_ALPHA_RAMP_INC, - NULL, NULL); - - /* Create a behaviour for that alpha */ - o_behave = clutter_behaviour_opacity_new (alpha, 0X33, 0xff); - - /* Apply it to our actor */ - clutter_behaviour_apply (o_behave, group); - - /* Make a path behaviour and apply that too */ - switch (path_type) - { - case PATH_POLY: - p_behave = clutter_behaviour_path_new (alpha, knots_poly, 5); - break; - case PATH_ELLIPSE: - p_behave = - clutter_behaviour_ellipse_new (alpha, 200, 200, 400, 300, - CLUTTER_ROTATE_CW, - 0.0, 360.0); - - clutter_behaviour_ellipse_set_angle_tilt (CLUTTER_BEHAVIOUR_ELLIPSE (p_behave), - CLUTTER_X_AXIS, - 45.0); - clutter_behaviour_ellipse_set_angle_tilt (CLUTTER_BEHAVIOUR_ELLIPSE (p_behave), - CLUTTER_Z_AXIS, - 45.0); - break; - - case PATH_BSPLINE: - origin.x = 0; - origin.y = RADIUS; - p_behave = - clutter_behaviour_bspline_new (alpha, knots_bspline, - sizeof (knots_bspline)/sizeof(ClutterKnot)); - - clutter_behaviour_bspline_set_origin ( - CLUTTER_BEHAVIOUR_BSPLINE (p_behave), - &origin); - break; - } - - clutter_behaviour_apply (p_behave, group); - - /* start the timeline and thus the animations */ - clutter_timeline_start (timeline); - - clutter_actor_show_all (stage); - - clutter_main(); - - g_object_unref (o_behave); - g_object_unref (p_behave); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-clip.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-clip.c --- clutter-0.8.4/tests/test-clip.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-clip.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,127 +0,0 @@ -#include -#include -#include -#include - -#define TL_SCALE 5.0f - -typedef struct _CallbackData CallbackData; - -struct _CallbackData -{ - ClutterActor *stage, *group, *rect, *hand; -}; - -static void -on_new_frame (ClutterTimeline *tl, int frame_num, CallbackData *data) -{ - int i; - int stage_width = clutter_actor_get_width (data->stage); - int stage_height = clutter_actor_get_height (data->stage); - gdouble progress = clutter_timeline_get_progress (tl); - gdouble angle = progress * 2 * M_PI * TL_SCALE; - gdouble rotation[3]; - - gdouble xpos = stage_width * 0.45 * sin (angle) + stage_width / 8; - gdouble ypos = stage_height * 0.45 * sin (angle) + stage_height / 8; - gdouble zpos = stage_width * cos (angle) - stage_width / 2; - - clutter_actor_set_position (data->hand, xpos, ypos); - clutter_actor_set_depth (data->hand, zpos); - clutter_actor_set_rotation (data->hand, CLUTTER_Y_AXIS, - angle / M_PI * 180.0 * 3, - clutter_actor_get_width (data->hand) / 2, - clutter_actor_get_height (data->hand) / 2, - 0); - - memset (rotation, 0, sizeof (rotation)); - - if (progress < 1 / 3.0) - rotation[2] = 360 * progress * 3; - else if (progress < 2 / 3.0) - rotation[1] = 360 * progress * 3; - else - rotation[0] = 360 * progress * 3; - - for (i = 0; i < 3; i++) - { - clutter_actor_set_rotation (data->group, i, - rotation[i], - clutter_actor_get_width (data->rect) / 2, - clutter_actor_get_height (data->rect) / 2, - 0); - clutter_actor_set_rotation (data->rect, i, - rotation[i], - clutter_actor_get_width (data->rect) / 2, - clutter_actor_get_height (data->rect) / 2, - 0); - } -} - -int -main (int argc, char **argv) -{ - ClutterGeometry geom; - ClutterTimeline *tl; - ClutterColor blue = { 0x40, 0x40, 0xff, 0xff }; - CallbackData data; - ClutterActor *other_hand; - int x, y; - - clutter_init (&argc, &argv); - - data.stage = clutter_stage_get_default (); - - data.group = clutter_group_new (); - - clutter_actor_get_geometry (data.stage, &geom); - geom.x = geom.width / 4; - geom.y = geom.height / 4; - geom.width /= 2; - geom.height /= 2; - clutter_actor_set_geometry (data.group, &geom); - - data.rect = clutter_rectangle_new_with_color (&blue); - clutter_actor_set_geometry (data.rect, &geom); - clutter_container_add (CLUTTER_CONTAINER (data.stage), data.rect, NULL); - - clutter_container_add (CLUTTER_CONTAINER (data.stage), data.group, NULL); - - clutter_actor_set_clip (data.group, 0, 0, geom.width, geom.height); - - data.hand = clutter_texture_new_from_file ("redhand.png", NULL); - if (data.hand == NULL) - { - g_critical ("pixbuf loading failed"); - exit (1); - } - clutter_container_add (CLUTTER_CONTAINER (data.group), data.hand, NULL); - - /* Add a hand at each of the four corners of the group */ - for (y = 0; y < 2; y++) - for (x = 0; x < 2; x++) - { - other_hand = clutter_clone_texture_new (CLUTTER_TEXTURE (data.hand)); - clutter_actor_set_anchor_point_from_gravity - (other_hand, CLUTTER_GRAVITY_CENTER); - clutter_actor_set_position (other_hand, - x * geom.width, - y * geom.height); - clutter_container_add (CLUTTER_CONTAINER (data.group), - other_hand, NULL); - } - - clutter_actor_raise_top (data.hand); - - tl = clutter_timeline_new (360 * TL_SCALE, 60); - clutter_timeline_start (tl); - clutter_timeline_set_loop (tl, TRUE); - - g_signal_connect (tl, "new-frame", G_CALLBACK (on_new_frame), &data); - - clutter_actor_show (data.stage); - - clutter_main (); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-cogl-offscreen.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-cogl-offscreen.c --- clutter-0.8.4/tests/test-cogl-offscreen.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-cogl-offscreen.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,218 +0,0 @@ -#include -#include -#include -#include -#include - -/* Coglbox declaration - *--------------------------------------------------*/ - -G_BEGIN_DECLS - -#define TEST_TYPE_COGLBOX test_coglbox_get_type() - -#define TEST_COGLBOX(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - TEST_TYPE_COGLBOX, TestCoglboxClass)) - -#define TEST_COGLBOX_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - TEST_TYPE_COGLBOX, TestCoglboxClass)) - -#define TEST_IS_COGLBOX(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - TEST_TYPE_COGLBOX)) - -#define TEST_IS_COGLBOX_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - TEST_TYPE_COGLBOX)) - -#define TEST_COGLBOX_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - TEST_TYPE_COGLBOX, TestCoglboxClass)) - -typedef struct _TestCoglbox TestCoglbox; -typedef struct _TestCoglboxClass TestCoglboxClass; -typedef struct _TestCoglboxPrivate TestCoglboxPrivate; - -struct _TestCoglbox -{ - ClutterActor parent; - - /*< private >*/ - TestCoglboxPrivate *priv; -}; - -struct _TestCoglboxClass -{ - ClutterActorClass parent_class; - - /* padding for future expansion */ - void (*_test_coglbox1) (void); - void (*_test_coglbox2) (void); - void (*_test_coglbox3) (void); - void (*_test_coglbox4) (void); -}; - -GType test_coglbox_get_type (void) G_GNUC_CONST; - -G_END_DECLS - -/* Coglbox private declaration - *--------------------------------------------------*/ - -G_DEFINE_TYPE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR); - -#define TEST_COGLBOX_GET_PRIVATE(obj) \ -(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate)) - -struct _TestCoglboxPrivate -{ - CoglHandle texhand_id; - CoglHandle texture_id; - CoglHandle offscreen_id; -}; - -/* Coglbox implementation - *--------------------------------------------------*/ - -static void -test_coglbox_paint(ClutterActor *self) -{ - TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (self); - - ClutterColor cback = {0x66, 0x66, 0xDD, 0xFF}; - ClutterColor cred = {0xFF, 0x0, 0x0, 0xFF}; - ClutterColor cgreen = {0x0, 0xFF, 0x0, 0xFF}; - ClutterColor cfullopaque = {0xFF, 0xFF, 0xFF, 0xFF}; - ClutterColor chalfopaque = {0xFF, 0xFF, 0xFF, 0x88}; - - ClutterFixed texcoords[4] = { - CLUTTER_FLOAT_TO_FIXED (0.0f), - CLUTTER_FLOAT_TO_FIXED (0.0f), - CLUTTER_FLOAT_TO_FIXED (1.0f), - CLUTTER_FLOAT_TO_FIXED (1.0f) - }; - - priv = TEST_COGLBOX_GET_PRIVATE (self); - - cogl_color (&cback); - cogl_rectangle (0,0,400,400); - - cogl_color (&cfullopaque); - cogl_texture_rectangle (priv->texhand_id, - 0,0, - CLUTTER_INT_TO_FIXED (400), - CLUTTER_INT_TO_FIXED (400), - 0,0, - CLUTTER_INT_TO_FIXED (6), - CLUTTER_INT_TO_FIXED (6)); - - cogl_draw_buffer (COGL_OFFSCREEN_BUFFER, priv->offscreen_id); - - cogl_color (&cred); - cogl_rectangle (20,20,100,100); - - cogl_color (&cgreen); - cogl_rectangle (80,80,100,100); - - cogl_draw_buffer (COGL_WINDOW_BUFFER, 0); - - cogl_color (&chalfopaque); - cogl_texture_rectangle (priv->texture_id, - CLUTTER_INT_TO_FIXED (100), - CLUTTER_INT_TO_FIXED (100), - CLUTTER_INT_TO_FIXED (300), - CLUTTER_INT_TO_FIXED (300), - texcoords[0], - texcoords[1], - texcoords[2], - texcoords[3]); -} - -static void -test_coglbox_finalize (GObject *object) -{ - G_OBJECT_CLASS (test_coglbox_parent_class)->finalize (object); -} - -static void -test_coglbox_dispose (GObject *object) -{ - TestCoglboxPrivate *priv; - - priv = TEST_COGLBOX_GET_PRIVATE (object); - - cogl_texture_unref (priv->texture_id); - cogl_offscreen_unref (priv->offscreen_id); - - G_OBJECT_CLASS (test_coglbox_parent_class)->dispose (object); -} - -static void -test_coglbox_init (TestCoglbox *self) -{ - TestCoglboxPrivate *priv; - self->priv = priv = TEST_COGLBOX_GET_PRIVATE(self); - - printf ("Loading redhand.png\n"); - priv->texhand_id = cogl_texture_new_from_file ("redhand.png", 0, FALSE, - COGL_PIXEL_FORMAT_ANY, - NULL); - - printf ("Creating texture with size\n"); - priv->texture_id = cogl_texture_new_with_size (200,200,0, FALSE, - COGL_PIXEL_FORMAT_RGB_888); - - if (priv->texture_id == COGL_INVALID_HANDLE) - printf ("Failed creating texture with size!\n"); - - printf ("Creating offscreen\n"); - priv->offscreen_id = cogl_offscreen_new_to_texture (priv->texture_id); - - if (priv->offscreen_id == COGL_INVALID_HANDLE) - printf ("Failed creating offscreen to texture!\n"); -} - -static void -test_coglbox_class_init (TestCoglboxClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); - - gobject_class->finalize = test_coglbox_finalize; - gobject_class->dispose = test_coglbox_dispose; - actor_class->paint = test_coglbox_paint; - - g_type_class_add_private (gobject_class, sizeof (TestCoglboxPrivate)); -} - -ClutterActor* -test_coglbox_new (void) -{ - return g_object_new (TEST_TYPE_COGLBOX, NULL); -} - -int -main (int argc, char *argv[]) -{ - ClutterActor *stage; - ClutterActor *coglbox; - - clutter_init(&argc, &argv); - - /* Stage */ - stage = clutter_stage_get_default (); - clutter_actor_set_size (stage, 400, 400); - clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Test"); - - /* Cogl Box */ - coglbox = test_coglbox_new (); - clutter_container_add_actor (CLUTTER_CONTAINER (stage), coglbox); - - clutter_actor_show_all (stage); - - clutter_main (); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-cogl-primitives.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-cogl-primitives.c --- clutter-0.8.4/tests/test-cogl-primitives.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-cogl-primitives.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,305 +0,0 @@ -#include -#include -#include -#include -#include - -/* Coglbox declaration - *--------------------------------------------------*/ - -G_BEGIN_DECLS - -#define TEST_TYPE_COGLBOX test_coglbox_get_type() - -#define TEST_COGLBOX(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - TEST_TYPE_COGLBOX, TestCoglboxClass)) - -#define TEST_COGLBOX_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - TEST_TYPE_COGLBOX, TestCoglboxClass)) - -#define TEST_IS_COGLBOX(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - TEST_TYPE_COGLBOX)) - -#define TEST_IS_COGLBOX_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - TEST_TYPE_COGLBOX)) - -#define TEST_COGLBOX_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - TEST_TYPE_COGLBOX, TestCoglboxClass)) - -typedef struct _TestCoglbox TestCoglbox; -typedef struct _TestCoglboxClass TestCoglboxClass; -typedef struct _TestCoglboxPrivate TestCoglboxPrivate; - -struct _TestCoglbox -{ - ClutterActor parent; - - /*< private >*/ - TestCoglboxPrivate *priv; -}; - -struct _TestCoglboxClass -{ - ClutterActorClass parent_class; - - /* padding for future expansion */ - void (*_test_coglbox1) (void); - void (*_test_coglbox2) (void); - void (*_test_coglbox3) (void); - void (*_test_coglbox4) (void); -}; - -GType test_coglbox_get_type (void) G_GNUC_CONST; - -G_END_DECLS - -/* Coglbox private declaration - *--------------------------------------------------*/ - -G_DEFINE_TYPE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR); - -#define TEST_COGLBOX_GET_PRIVATE(obj) \ -(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate)) - -struct _TestCoglboxPrivate -{ - void (*_test_coglbox_priv1) (void); -}; - -/* Coglbox implementation - *--------------------------------------------------*/ - -typedef void (*PaintFunc) (void); - -static void -test_paint_line () -{ - cogl_path_line (CLUTTER_INT_TO_FIXED (-50), - CLUTTER_INT_TO_FIXED (-25), - CLUTTER_INT_TO_FIXED (50), - CLUTTER_INT_TO_FIXED (25)); -} - -static void -test_paint_rect () -{ - cogl_path_rectangle (CLUTTER_INT_TO_FIXED (-50), - CLUTTER_INT_TO_FIXED (-25), - CLUTTER_INT_TO_FIXED (100), - CLUTTER_INT_TO_FIXED (50)); -} - -static void -test_paint_rndrect() -{ - cogl_path_round_rectangle (CLUTTER_INT_TO_FIXED (-50), - CLUTTER_INT_TO_FIXED (-25), - CLUTTER_INT_TO_FIXED (100), - CLUTTER_INT_TO_FIXED (50), - CLUTTER_INT_TO_FIXED (10), - 5); -} - -static void -test_paint_polyl () -{ - ClutterFixed poly_coords[] = { - CLUTTER_INT_TO_FIXED (-50), - CLUTTER_INT_TO_FIXED (-50), - CLUTTER_INT_TO_FIXED (+50), - CLUTTER_INT_TO_FIXED (-30), - CLUTTER_INT_TO_FIXED (+30), - CLUTTER_INT_TO_FIXED (+30), - CLUTTER_INT_TO_FIXED (-30), - CLUTTER_INT_TO_FIXED (+40) - }; - - cogl_path_polyline (poly_coords, 4); -} - -static void -test_paint_polyg () -{ - gint poly_coords[] = { - CLUTTER_INT_TO_FIXED (-50), - CLUTTER_INT_TO_FIXED (-50), - CLUTTER_INT_TO_FIXED (+50), - CLUTTER_INT_TO_FIXED (-30), - CLUTTER_INT_TO_FIXED (+30), - CLUTTER_INT_TO_FIXED (+30), - CLUTTER_INT_TO_FIXED (-30), - CLUTTER_INT_TO_FIXED (+40) - }; - - cogl_path_polygon (poly_coords, 4); -} - -static void -test_paint_elp () -{ - cogl_path_ellipse (0, 0, - CLUTTER_INT_TO_FIXED (60), - CLUTTER_INT_TO_FIXED (40)); -} - -static void -test_paint_curve () -{ - cogl_path_move_to (CLUTTER_INT_TO_FIXED (-50), - CLUTTER_INT_TO_FIXED (+50)); - - cogl_path_curve_to (CLUTTER_INT_TO_FIXED (+100), - CLUTTER_INT_TO_FIXED (-50), - CLUTTER_INT_TO_FIXED (-100), - CLUTTER_INT_TO_FIXED (-50), - CLUTTER_INT_TO_FIXED (+50), - CLUTTER_INT_TO_FIXED (+50)); -} - -static PaintFunc paint_func []= -{ - test_paint_line, - test_paint_rect, - test_paint_rndrect, - test_paint_polyl, - test_paint_polyg, - test_paint_elp, - test_paint_curve -}; - -static void -test_coglbox_paint(ClutterActor *self) -{ - TestCoglboxPrivate *priv; - - ClutterColor cfill; - ClutterColor cstroke; - - static GTimer *timer = NULL; - static gint paint_index = 0; - - gint NUM_PAINT_FUNCS; - - NUM_PAINT_FUNCS = G_N_ELEMENTS (paint_func); - - priv = TEST_COGLBOX_GET_PRIVATE (self); - - - if (!timer) - { - timer = g_timer_new (); - g_timer_start (timer); - } - - if (g_timer_elapsed (timer, NULL) >= 1) - { - paint_index += 1; - paint_index = paint_index % NUM_PAINT_FUNCS; - g_timer_start (timer); - } - - cfill.red = 0; - cfill.green = 160; - cfill.blue = 0; - cfill.alpha = 255; - - cstroke.red = 200; - cstroke.green = 0; - cstroke.blue = 0; - cstroke.alpha = 255; - - cogl_push_matrix (); - - paint_func[paint_index] (); - - cogl_translate (100,100,0); - cogl_color (&cstroke); - cogl_path_stroke (); - - cogl_translate (150,0,0); - cogl_color (&cfill); - cogl_path_fill (); - - cogl_pop_matrix(); - -} - -static void -test_coglbox_finalize (GObject *object) -{ - G_OBJECT_CLASS (test_coglbox_parent_class)->finalize (object); -} - -static void -test_coglbox_dispose (GObject *object) -{ - TestCoglboxPrivate *priv; - - priv = TEST_COGLBOX_GET_PRIVATE (object); - - G_OBJECT_CLASS (test_coglbox_parent_class)->dispose (object); -} - -static void -test_coglbox_init (TestCoglbox *self) -{ - TestCoglboxPrivate *priv; - self->priv = priv = TEST_COGLBOX_GET_PRIVATE(self); -} - -static void -test_coglbox_class_init (TestCoglboxClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); - - gobject_class->finalize = test_coglbox_finalize; - gobject_class->dispose = test_coglbox_dispose; - actor_class->paint = test_coglbox_paint; - - g_type_class_add_private (gobject_class, sizeof (TestCoglboxPrivate)); -} - -ClutterActor* -test_coglbox_new (void) -{ - return g_object_new (TEST_TYPE_COGLBOX, NULL); -} - -#define SPIN() while (g_main_context_pending (NULL)) \ - g_main_context_iteration (NULL, FALSE); - -int -main (int argc, char *argv[]) -{ - ClutterActor *stage; - ClutterActor *coglbox; - - clutter_init(&argc, &argv); - - stage = clutter_stage_get_default (); - clutter_actor_set_size (stage, 400, 400); - clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Test"); - - coglbox = test_coglbox_new (); - clutter_container_add_actor (CLUTTER_CONTAINER (stage), coglbox); - - clutter_actor_set_rotation (coglbox, CLUTTER_Y_AXIS, -30, 200, 0, 0); - clutter_actor_set_position (coglbox, 0, 100); - - clutter_actor_show_all (stage); - - while (1) - { - clutter_actor_hide (coglbox); - clutter_actor_show (coglbox); - SPIN(); - } - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-cogl-tex-convert.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-cogl-tex-convert.c --- clutter-0.8.4/tests/test-cogl-tex-convert.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-cogl-tex-convert.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,221 +0,0 @@ -#include -#include -#include -#include -#include - -/* Coglbox declaration - *--------------------------------------------------*/ - -G_BEGIN_DECLS - -#define TEST_TYPE_COGLBOX test_coglbox_get_type() - -#define TEST_COGLBOX(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - TEST_TYPE_COGLBOX, TestCoglboxClass)) - -#define TEST_COGLBOX_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - TEST_TYPE_COGLBOX, TestCoglboxClass)) - -#define TEST_IS_COGLBOX(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - TEST_TYPE_COGLBOX)) - -#define TEST_IS_COGLBOX_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - TEST_TYPE_COGLBOX)) - -#define TEST_COGLBOX_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - TEST_TYPE_COGLBOX, TestCoglboxClass)) - -typedef struct _TestCoglbox TestCoglbox; -typedef struct _TestCoglboxClass TestCoglboxClass; -typedef struct _TestCoglboxPrivate TestCoglboxPrivate; - -struct _TestCoglbox -{ - ClutterActor parent; - - /*< private >*/ - TestCoglboxPrivate *priv; -}; - -struct _TestCoglboxClass -{ - ClutterActorClass parent_class; - - /* padding for future expansion */ - void (*_test_coglbox1) (void); - void (*_test_coglbox2) (void); - void (*_test_coglbox3) (void); - void (*_test_coglbox4) (void); -}; - -GType test_coglbox_get_type (void) G_GNUC_CONST; - -G_END_DECLS - -/* Coglbox private declaration - *--------------------------------------------------*/ - -G_DEFINE_TYPE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR); - -#define TEST_COGLBOX_GET_PRIVATE(obj) \ -(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate)) - -struct _TestCoglboxPrivate -{ - CoglHandle cogl_tex_id[4]; - gint frame; -}; - -/* Coglbox implementation - *--------------------------------------------------*/ - -static void -test_coglbox_paint(ClutterActor *self) -{ - TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (self); - - ClutterColor cback = {0x66, 0x66, 0xDD, 0xFF}; - ClutterColor cwhite = {0xFF, 0xFF, 0xFF, 0xFF}; - ClutterFixed texcoords[4] = { - CLUTTER_FLOAT_TO_FIXED (0.0f), - CLUTTER_FLOAT_TO_FIXED (0.0f), - CLUTTER_FLOAT_TO_FIXED (1.0f), - CLUTTER_FLOAT_TO_FIXED (1.0f) - }; - - priv = TEST_COGLBOX_GET_PRIVATE (self); - - cogl_color (&cback); - cogl_rectangle (0,0,400,400); - - cogl_color (&cwhite); - - cogl_push_matrix (); - cogl_texture_rectangle (priv->cogl_tex_id[0], - 0, 0, - CLUTTER_INT_TO_FIXED (200), - CLUTTER_INT_TO_FIXED (213), - texcoords[0], texcoords[1], - texcoords[2], texcoords[3]); - - cogl_pop_matrix (); - cogl_push_matrix (); - cogl_translate (200,0,0); - cogl_texture_rectangle (priv->cogl_tex_id[1], - 0, 0, - CLUTTER_INT_TO_FIXED (200), - CLUTTER_INT_TO_FIXED (213), - texcoords[0], texcoords[1], - texcoords[2], texcoords[3]); - - cogl_pop_matrix (); - cogl_push_matrix (); - cogl_translate (0,200,0); - cogl_texture_rectangle (priv->cogl_tex_id[2], - 0, 0, - CLUTTER_INT_TO_FIXED (200), - CLUTTER_INT_TO_FIXED (213), - texcoords[0], texcoords[1], - texcoords[2], texcoords[3]); - - cogl_pop_matrix (); - cogl_push_matrix (); - cogl_translate (200,200,0); - cogl_texture_rectangle (priv->cogl_tex_id[3], - 0, 0, - CLUTTER_INT_TO_FIXED (200), - CLUTTER_INT_TO_FIXED (213), - texcoords[0], texcoords[1], - texcoords[2], texcoords[3]); - - cogl_pop_matrix(); -} - -static void -test_coglbox_finalize (GObject *object) -{ - G_OBJECT_CLASS (test_coglbox_parent_class)->finalize (object); -} - -static void -test_coglbox_dispose (GObject *object) -{ - TestCoglboxPrivate *priv; - - priv = TEST_COGLBOX_GET_PRIVATE (object); - cogl_texture_unref (priv->cogl_tex_id); - - G_OBJECT_CLASS (test_coglbox_parent_class)->dispose (object); -} - -static void -test_coglbox_init (TestCoglbox *self) -{ - TestCoglboxPrivate *priv; - self->priv = priv = TEST_COGLBOX_GET_PRIVATE(self); - - priv->cogl_tex_id[0] = - cogl_texture_new_from_file ("redhand.png", 0, FALSE, - COGL_PIXEL_FORMAT_ANY, NULL); - - priv->cogl_tex_id[1] = - cogl_texture_new_from_file ("redhand.png", 0, FALSE, - COGL_PIXEL_FORMAT_BGRA_8888, NULL); - - priv->cogl_tex_id[2] = - cogl_texture_new_from_file ("redhand.png", 0, FALSE, - COGL_PIXEL_FORMAT_ARGB_8888, NULL); - - priv->cogl_tex_id[3] = - cogl_texture_new_from_file ("redhand.png", 0, FALSE, - COGL_PIXEL_FORMAT_G_8, NULL); -} - -static void -test_coglbox_class_init (TestCoglboxClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); - - gobject_class->finalize = test_coglbox_finalize; - gobject_class->dispose = test_coglbox_dispose; - actor_class->paint = test_coglbox_paint; - - g_type_class_add_private (gobject_class, sizeof (TestCoglboxPrivate)); -} - -ClutterActor* -test_coglbox_new (void) -{ - return g_object_new (TEST_TYPE_COGLBOX, NULL); -} - -int -main (int argc, char *argv[]) -{ - ClutterActor *stage; - ClutterActor *coglbox; - - clutter_init(&argc, &argv); - - /* Stage */ - stage = clutter_stage_get_default (); - clutter_actor_set_size (stage, 400, 400); - clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Test"); - - /* Cogl Box */ - coglbox = test_coglbox_new (); - clutter_container_add_actor (CLUTTER_CONTAINER (stage), coglbox); - - clutter_actor_show_all (stage); - - clutter_main (); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-cogl-tex-foreign.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-cogl-tex-foreign.c --- clutter-0.8.4/tests/test-cogl-tex-foreign.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-cogl-tex-foreign.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,212 +0,0 @@ -#include -#include -#include -#include -#include - -/* Coglbox declaration - *--------------------------------------------------*/ - -G_BEGIN_DECLS - -#define TEST_TYPE_COGLBOX test_coglbox_get_type() - -#define TEST_COGLBOX(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - TEST_TYPE_COGLBOX, TestCoglboxClass)) - -#define TEST_COGLBOX_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - TEST_TYPE_COGLBOX, TestCoglboxClass)) - -#define TEST_IS_COGLBOX(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - TEST_TYPE_COGLBOX)) - -#define TEST_IS_COGLBOX_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - TEST_TYPE_COGLBOX)) - -#define TEST_COGLBOX_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - TEST_TYPE_COGLBOX, TestCoglboxClass)) - -typedef struct _TestCoglbox TestCoglbox; -typedef struct _TestCoglboxClass TestCoglboxClass; -typedef struct _TestCoglboxPrivate TestCoglboxPrivate; - -struct _TestCoglbox -{ - ClutterActor parent; - - /*< private >*/ - TestCoglboxPrivate *priv; -}; - -struct _TestCoglboxClass -{ - ClutterActorClass parent_class; - - /* padding for future expansion */ - void (*_test_coglbox1) (void); - void (*_test_coglbox2) (void); - void (*_test_coglbox3) (void); - void (*_test_coglbox4) (void); -}; - -GType test_coglbox_get_type (void) G_GNUC_CONST; - -G_END_DECLS - -/* Coglbox private declaration - *--------------------------------------------------*/ - -G_DEFINE_TYPE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR); - -#define TEST_COGLBOX_GET_PRIVATE(obj) \ -(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate)) - -struct _TestCoglboxPrivate -{ - GLuint gl_handle; - CoglHandle cogl_handle; -}; - -/* Coglbox implementation - *--------------------------------------------------*/ - -static void -test_coglbox_paint(ClutterActor *self) -{ - TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (self); - - ClutterColor cback = {0x66, 0x66, 0xDD, 0xFF}; - ClutterColor cwhite = {0xFF, 0xFF, 0xFF, 0xFF}; - ClutterFixed texcoords[4] = { - CLUTTER_FLOAT_TO_FIXED (0.3f), - CLUTTER_FLOAT_TO_FIXED (0.3f), - CLUTTER_FLOAT_TO_FIXED (0.7f), - CLUTTER_FLOAT_TO_FIXED (0.7f) - }; - - priv = TEST_COGLBOX_GET_PRIVATE (self); - - cogl_color (&cback); - cogl_rectangle (0,0,400,400); - - cogl_color (&cwhite); - - cogl_push_matrix (); - - cogl_translate (100,100,0); - cogl_texture_rectangle (priv->cogl_handle, - 0, 0, - CLUTTER_INT_TO_FIXED (200), - CLUTTER_INT_TO_FIXED (200), - texcoords[0], texcoords[1], - texcoords[2], texcoords[3]); - - cogl_pop_matrix(); -} - -static void -test_coglbox_finalize (GObject *object) -{ - G_OBJECT_CLASS (test_coglbox_parent_class)->finalize (object); -} - -static void -test_coglbox_dispose (GObject *object) -{ - TestCoglboxPrivate *priv; - - priv = TEST_COGLBOX_GET_PRIVATE (object); - - cogl_texture_unref (priv->cogl_handle); - glDeleteTextures (1, &priv->gl_handle); - - G_OBJECT_CLASS (test_coglbox_parent_class)->dispose (object); -} - -static void -test_coglbox_init (TestCoglbox *self) -{ - TestCoglboxPrivate *priv; - guchar data[12]; - - self->priv = priv = TEST_COGLBOX_GET_PRIVATE(self); - - /* Prepare a 2x2 pixels texture */ - - data[0] = 255; data[1] = 0; data[2] = 0; - data[3] = 0; data[4] = 255; data[5] = 0; - data[6] = 0; data[7] = 0; data[8] = 255; - data[9] = 0; data[10] = 0; data[11] = 0; - - glGenTextures (1, &priv->gl_handle); - glBindTexture (GL_TEXTURE_2D, priv->gl_handle); - - glPixelStorei (GL_UNPACK_ALIGNMENT, 1); - glTexImage2D (GL_TEXTURE_2D, 0, GL_RGB, - 2, 2, 0, GL_RGB, GL_UNSIGNED_BYTE, data); - - glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - - /* Create texture from foreign */ - - priv->cogl_handle = - cogl_texture_new_from_foreign (priv->gl_handle, - GL_TEXTURE_2D, - 2, 2, 0, 0, - COGL_PIXEL_FORMAT_RGB_888); - - if (priv->cogl_handle == COGL_INVALID_HANDLE) - { - printf ("Failed creating texture from foreign!\n"); - return; - } -} - -static void -test_coglbox_class_init (TestCoglboxClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); - - gobject_class->finalize = test_coglbox_finalize; - gobject_class->dispose = test_coglbox_dispose; - actor_class->paint = test_coglbox_paint; - - g_type_class_add_private (gobject_class, sizeof (TestCoglboxPrivate)); -} - -ClutterActor* -test_coglbox_new (void) -{ - return g_object_new (TEST_TYPE_COGLBOX, NULL); -} - -int -main (int argc, char *argv[]) -{ - ClutterActor *stage; - ClutterActor *coglbox; - - clutter_init(&argc, &argv); - - /* Stage */ - stage = clutter_stage_get_default (); - clutter_actor_set_size (stage, 400, 400); - clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Test"); - - /* Cogl Box */ - coglbox = test_coglbox_new (); - clutter_container_add_actor (CLUTTER_CONTAINER (stage), coglbox); - - clutter_actor_show_all (stage); - - clutter_main (); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-cogl-tex-getset.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-cogl-tex-getset.c --- clutter-0.8.4/tests/test-cogl-tex-getset.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-cogl-tex-getset.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,270 +0,0 @@ -#include -#include -#include -#include -#include - -/* Coglbox declaration - *--------------------------------------------------*/ - -G_BEGIN_DECLS - -#define TEST_TYPE_COGLBOX test_coglbox_get_type() - -#define TEST_COGLBOX(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - TEST_TYPE_COGLBOX, TestCoglboxClass)) - -#define TEST_COGLBOX_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - TEST_TYPE_COGLBOX, TestCoglboxClass)) - -#define TEST_IS_COGLBOX(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - TEST_TYPE_COGLBOX)) - -#define TEST_IS_COGLBOX_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - TEST_TYPE_COGLBOX)) - -#define TEST_COGLBOX_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - TEST_TYPE_COGLBOX, TestCoglboxClass)) - -typedef struct _TestCoglbox TestCoglbox; -typedef struct _TestCoglboxClass TestCoglboxClass; -typedef struct _TestCoglboxPrivate TestCoglboxPrivate; - -struct _TestCoglbox -{ - ClutterActor parent; - - /*< private >*/ - TestCoglboxPrivate *priv; -}; - -struct _TestCoglboxClass -{ - ClutterActorClass parent_class; - - /* padding for future expansion */ - void (*_test_coglbox1) (void); - void (*_test_coglbox2) (void); - void (*_test_coglbox3) (void); - void (*_test_coglbox4) (void); -}; - -GType test_coglbox_get_type (void) G_GNUC_CONST; - -G_END_DECLS - -/* Coglbox private declaration - *--------------------------------------------------*/ - -G_DEFINE_TYPE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR); - -#define TEST_COGLBOX_GET_PRIVATE(obj) \ -(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate)) - -struct _TestCoglboxPrivate -{ - CoglHandle cogl_tex_id[4]; -}; - -/* Coglbox implementation - *--------------------------------------------------*/ - -static void -test_coglbox_paint(ClutterActor *self) -{ - TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (self); - - ClutterColor cback = {0x66, 0x66, 0xDD, 0xFF}; - ClutterColor cwhite = {0xFF, 0xFF, 0xFF, 0xFF}; - ClutterFixed texcoords[4] = { - CLUTTER_FLOAT_TO_FIXED (0.0f), - CLUTTER_FLOAT_TO_FIXED (0.0f), - CLUTTER_FLOAT_TO_FIXED (1.0f), - CLUTTER_FLOAT_TO_FIXED (1.0f) - }; - - priv = TEST_COGLBOX_GET_PRIVATE (self); - - cogl_color (&cback); - cogl_rectangle (0,0,400,400); - - cogl_color (&cwhite); - - cogl_push_matrix (); - - cogl_translate (100,100,0); - cogl_texture_rectangle (priv->cogl_tex_id[1], - 0, 0, - CLUTTER_INT_TO_FIXED (200), - CLUTTER_INT_TO_FIXED (213), - texcoords[0], texcoords[1], - texcoords[2], texcoords[3]); - - cogl_pop_matrix(); -} - -static void -test_coglbox_finalize (GObject *object) -{ - G_OBJECT_CLASS (test_coglbox_parent_class)->finalize (object); -} - -static void -test_coglbox_dispose (GObject *object) -{ - TestCoglboxPrivate *priv; - - priv = TEST_COGLBOX_GET_PRIVATE (object); - cogl_texture_unref (priv->cogl_tex_id); - - G_OBJECT_CLASS (test_coglbox_parent_class)->dispose (object); -} - -static void -test_coglbox_init (TestCoglbox *self) -{ - TestCoglboxPrivate *priv; - guint width; - guint height; - guint rowstride; - CoglPixelFormat format; - gint size; - guchar *data; - gint x,y,t; - guchar *pixel; - - self->priv = priv = TEST_COGLBOX_GET_PRIVATE(self); - - /* Load image from file */ - - priv->cogl_tex_id[0] = - cogl_texture_new_from_file ("redhand.png", 40, FALSE, - COGL_PIXEL_FORMAT_ANY, NULL); - - if (priv->cogl_tex_id[0] == COGL_INVALID_HANDLE) - { - printf ("Failed loading redhand.png image!\n"); - return; - } - - printf("Texture loaded from file.\n"); - - /* Obtain pixel data */ - - format = cogl_texture_get_format (priv->cogl_tex_id[0]); - g_assert(format == COGL_PIXEL_FORMAT_RGBA_8888 || - format == COGL_PIXEL_FORMAT_ARGB_8888); - - width = cogl_texture_get_width (priv->cogl_tex_id[0]); - height = cogl_texture_get_height (priv->cogl_tex_id[0]); - size = cogl_texture_get_data (priv->cogl_tex_id[0], - format, 0, NULL); - - printf("size: %dx%d\n", width, height); - printf("format: 0x%x\n", format); - printf("bytesize: %d\n", size); - - data = (guchar*) g_malloc (sizeof(guchar) * size); - - cogl_texture_get_data (priv->cogl_tex_id[0], - format, 0, data); - rowstride = cogl_texture_get_rowstride (priv->cogl_tex_id[0]); - - /* Create new texture from modified data */ - - priv->cogl_tex_id[1] = - cogl_texture_new_from_data (width, height, 0, FALSE, - format, format, - rowstride, data); - - if (priv->cogl_tex_id[1] == COGL_INVALID_HANDLE) - { - printf ("Failed creating image from data!\n"); - return; - } - - printf ("Texture created from data.\n"); - - /* Modify data (swap red and green) */ - - for (y=0; ycogl_tex_id[1], - 0, 0, 0, 0, - 100, 100, width, height, - format, 0, data); - - cogl_texture_set_region (priv->cogl_tex_id[1], - 100, 100, 100, 100, - 100, 100, width, height, - format, 0, data); - - printf ("Subregion data updated.\n"); -} - -static void -test_coglbox_class_init (TestCoglboxClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); - - gobject_class->finalize = test_coglbox_finalize; - gobject_class->dispose = test_coglbox_dispose; - actor_class->paint = test_coglbox_paint; - - g_type_class_add_private (gobject_class, sizeof (TestCoglboxPrivate)); -} - -ClutterActor* -test_coglbox_new (void) -{ - return g_object_new (TEST_TYPE_COGLBOX, NULL); -} - -int -main (int argc, char *argv[]) -{ - ClutterActor *stage; - ClutterActor *coglbox; - - clutter_init(&argc, &argv); - - /* Stage */ - stage = clutter_stage_get_default (); - clutter_actor_set_size (stage, 400, 400); - clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Test"); - - /* Cogl Box */ - coglbox = test_coglbox_new (); - clutter_container_add_actor (CLUTTER_CONTAINER (stage), coglbox); - - clutter_actor_show_all (stage); - - clutter_main (); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-cogl-tex-polygon.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-cogl-tex-polygon.c --- clutter-0.8.4/tests/test-cogl-tex-polygon.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-cogl-tex-polygon.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,394 +0,0 @@ -#include -#include -#include -#include -#include - -/* Coglbox declaration - *--------------------------------------------------*/ - -G_BEGIN_DECLS - -#define TEST_TYPE_COGLBOX test_coglbox_get_type() - -#define TEST_COGLBOX(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - TEST_TYPE_COGLBOX, TestCoglboxClass)) - -#define TEST_COGLBOX_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - TEST_TYPE_COGLBOX, TestCoglboxClass)) - -#define TEST_IS_COGLBOX(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - TEST_TYPE_COGLBOX)) - -#define TEST_IS_COGLBOX_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - TEST_TYPE_COGLBOX)) - -#define TEST_COGLBOX_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - TEST_TYPE_COGLBOX, TestCoglboxClass)) - -typedef struct _TestCoglbox TestCoglbox; -typedef struct _TestCoglboxClass TestCoglboxClass; -typedef struct _TestCoglboxPrivate TestCoglboxPrivate; - -struct _TestCoglbox -{ - ClutterActor parent; - - /*< private >*/ - TestCoglboxPrivate *priv; -}; - -struct _TestCoglboxClass -{ - ClutterActorClass parent_class; - - /* padding for future expansion */ - void (*_test_coglbox1) (void); - void (*_test_coglbox2) (void); - void (*_test_coglbox3) (void); - void (*_test_coglbox4) (void); -}; - -GType test_coglbox_get_type (void) G_GNUC_CONST; - -G_END_DECLS - -/* Coglbox private declaration - *--------------------------------------------------*/ - -G_DEFINE_TYPE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR); - -#define TEST_COGLBOX_GET_PRIVATE(obj) \ -(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate)) - -struct _TestCoglboxPrivate -{ - CoglHandle sliced_tex, not_sliced_tex; - gint frame; - gboolean use_sliced; - gboolean use_linear_filtering; -}; - -/* Coglbox implementation - *--------------------------------------------------*/ - -static void -test_coglbox_fade_texture (CoglHandle tex_id, - ClutterFixed x1, - ClutterFixed y1, - ClutterFixed x2, - ClutterFixed y2, - ClutterFixed tx1, - ClutterFixed ty1, - ClutterFixed tx2, - ClutterFixed ty2) -{ - CoglTextureVertex vertices[4]; - int i; - static const ClutterColor white = { 0xff, 0xff, 0xff, 0xff }; - - vertices[0].x = x1; - vertices[0].y = y1; - vertices[0].z = 0; - vertices[0].tx = tx1; - vertices[0].ty = ty1; - vertices[1].x = x1; - vertices[1].y = y2; - vertices[1].z = 0; - vertices[1].tx = tx1; - vertices[1].ty = ty2; - vertices[2].x = x2; - vertices[2].y = y2; - vertices[2].z = 0; - vertices[2].tx = tx2; - vertices[2].ty = ty2; - vertices[3].x = x2; - vertices[3].y = y1; - vertices[3].z = 0; - vertices[3].tx = tx2; - vertices[3].ty = ty1; - - for (i = 0; i < 4; i++) - { - vertices[i].color.red = 255; - vertices[i].color.green = 255; - vertices[i].color.blue = 255; - vertices[i].color.alpha = ((i ^ (i >> 1)) & 1) ? 0 : 128; - } - - cogl_texture_polygon (tex_id, 4, vertices, TRUE); - - cogl_color (&white); -} - -static void -test_coglbox_triangle_texture (CoglHandle tex_id, - ClutterFixed x, - ClutterFixed y, - ClutterFixed tx1, - ClutterFixed ty1, - ClutterFixed tx2, - ClutterFixed ty2, - ClutterFixed tx3, - ClutterFixed ty3) -{ - CoglTextureVertex vertices[3]; - int tex_width = cogl_texture_get_width (tex_id); - int tex_height = cogl_texture_get_height (tex_id); - - vertices[0].x = x + tx1 * tex_width; - vertices[0].y = y + ty1 * tex_height; - vertices[0].z = 0; - vertices[0].tx = tx1; - vertices[0].ty = ty1; - - vertices[1].x = x + tx2 * tex_width; - vertices[1].y = y + ty2 * tex_height; - vertices[1].z = 0; - vertices[1].tx = tx2; - vertices[1].ty = ty2; - - vertices[2].x = x + tx3 * tex_width; - vertices[2].y = y + ty3 * tex_height; - vertices[2].z = 0; - vertices[2].tx = tx3; - vertices[2].ty = ty3; - - cogl_texture_polygon (tex_id, 3, vertices, FALSE); -} - -static void -test_coglbox_paint (ClutterActor *self) -{ - TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (self); - CoglHandle tex_handle = priv->use_sliced - ? priv->sliced_tex : priv->not_sliced_tex; - int tex_width = cogl_texture_get_width (tex_handle); - int tex_height = cogl_texture_get_height (tex_handle); - static const ClutterColor white = { 0xff, 0xff, 0xff, 0xff }; - - cogl_color (&white); - - cogl_texture_set_filters (tex_handle, - priv->use_linear_filtering - ? CGL_LINEAR : CGL_NEAREST, - priv->use_linear_filtering - ? CGL_LINEAR : CGL_NEAREST); - - cogl_push_matrix (); - cogl_translate (tex_width / 2, 0, 0); - cogl_rotate (priv->frame, 0, 1, 0); - cogl_translate (-tex_width / 2, 0, 0); - - /* Draw a hand and refect it */ - cogl_texture_rectangle (tex_handle, - 0, 0, - CLUTTER_INT_TO_FIXED (tex_width), - CLUTTER_INT_TO_FIXED (tex_height), - 0, 0, CFX_ONE, CFX_ONE); - test_coglbox_fade_texture (tex_handle, - 0, CLUTTER_INT_TO_FIXED (tex_height), - CLUTTER_INT_TO_FIXED (tex_width), - CLUTTER_INT_TO_FIXED (tex_height * 3 / 2), - 0, CFX_ONE, - CFX_ONE, CFX_ONE / 2); - - cogl_pop_matrix (); - - cogl_push_matrix (); - cogl_translate (tex_width * 3 / 2 + 60, 0, 0); - cogl_rotate (priv->frame, 0, 1, 0); - cogl_translate (-tex_width / 2 - 10, 0, 0); - - /* Draw the texture split into two triangles */ - test_coglbox_triangle_texture (tex_handle, - 0, 0, - 0, 0, - 0, CFX_ONE, - CFX_ONE, CFX_ONE); - test_coglbox_triangle_texture (tex_handle, - CLUTTER_INT_TO_FIXED (20), 0, - 0, 0, - CFX_ONE, 0, - CFX_ONE, CFX_ONE); - - cogl_pop_matrix (); -} - -static void -test_coglbox_finalize (GObject *object) -{ - G_OBJECT_CLASS (test_coglbox_parent_class)->finalize (object); -} - -static void -test_coglbox_dispose (GObject *object) -{ - TestCoglboxPrivate *priv; - - priv = TEST_COGLBOX_GET_PRIVATE (object); - cogl_texture_unref (priv->not_sliced_tex); - cogl_texture_unref (priv->sliced_tex); - - G_OBJECT_CLASS (test_coglbox_parent_class)->dispose (object); -} - -static void -test_coglbox_init (TestCoglbox *self) -{ - TestCoglboxPrivate *priv; - GError *error = NULL; - self->priv = priv = TEST_COGLBOX_GET_PRIVATE (self); - - priv->use_linear_filtering = FALSE; - priv->use_sliced = FALSE; - - priv->sliced_tex = cogl_texture_new_from_file - ("redhand.png", 10, FALSE, COGL_PIXEL_FORMAT_ANY, &error); - if (priv->sliced_tex == NULL) - { - g_warning ("Texture loading failed: %s", error->message); - g_error_free (error); - error = NULL; - } - - priv->not_sliced_tex = cogl_texture_new_from_file - ("redhand.png", -1, FALSE, COGL_PIXEL_FORMAT_ANY, &error); - if (priv->not_sliced_tex == NULL) - { - g_warning ("Texture loading failed: %s", error->message); - g_error_free (error); - } -} - -static void -test_coglbox_class_init (TestCoglboxClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); - - gobject_class->finalize = test_coglbox_finalize; - gobject_class->dispose = test_coglbox_dispose; - actor_class->paint = test_coglbox_paint; - - g_type_class_add_private (gobject_class, sizeof (TestCoglboxPrivate)); -} - -ClutterActor* -test_coglbox_new (void) -{ - return g_object_new (TEST_TYPE_COGLBOX, NULL); -} - -static void -frame_cb (ClutterTimeline *timeline, - gint frame_num, - gpointer data) -{ - TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (data); - - priv->frame = frame_num; - clutter_actor_queue_redraw (CLUTTER_ACTOR (data)); -} - -static void -update_toggle_text (ClutterLabel *button, gboolean val) -{ - clutter_label_set_text (button, val ? "Enabled" : "Disabled"); -} - -static gboolean -on_toggle_click (ClutterActor *button, ClutterEvent *event, - gboolean *toggle_val) -{ - update_toggle_text (CLUTTER_LABEL (button), *toggle_val = !*toggle_val); - - return TRUE; -} - -static ClutterActor * -make_toggle (const char *label_text, gboolean *toggle_val) -{ - ClutterActor *group = clutter_group_new (); - ClutterActor *label = clutter_label_new_with_text ("Sans 14", label_text); - ClutterActor *button = clutter_label_new_with_text ("Sans 14", ""); - - clutter_actor_set_reactive (button, TRUE); - - update_toggle_text (CLUTTER_LABEL (button), *toggle_val); - - clutter_actor_set_position (button, clutter_actor_get_width (label) + 10, 0); - clutter_container_add (CLUTTER_CONTAINER (group), label, button, NULL); - - g_signal_connect (button, "button-press-event", G_CALLBACK (on_toggle_click), - toggle_val); - - return group; -} - -int -main (int argc, char *argv[]) -{ - ClutterActor *stage; - ClutterActor *coglbox; - ClutterActor *filtering_toggle; - ClutterActor *slicing_toggle; - ClutterActor *note; - ClutterTimeline *timeline; - ClutterColor blue = { 0x30, 0x30, 0xff, 0xff }; - - clutter_init (&argc, &argv); - - /* Stage */ - stage = clutter_stage_get_default (); - clutter_stage_set_color (CLUTTER_STAGE (stage), &blue); - clutter_actor_set_size (stage, 640, 480); - clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Test"); - - /* Cogl Box */ - coglbox = test_coglbox_new (); - clutter_container_add_actor (CLUTTER_CONTAINER (stage), coglbox); - - /* Timeline for animation */ - timeline = clutter_timeline_new (360, 60); /* num frames, fps */ - g_object_set (timeline, "loop", TRUE, NULL); /* have it loop */ - g_signal_connect (timeline, "new-frame", G_CALLBACK (frame_cb), coglbox); - clutter_timeline_start (timeline); - - /* Labels for toggling settings */ - slicing_toggle = make_toggle ("Texture slicing: ", - &(TEST_COGLBOX_GET_PRIVATE (coglbox) - ->use_sliced)); - clutter_actor_set_position (slicing_toggle, 0, - clutter_actor_get_height (stage) - - clutter_actor_get_height (slicing_toggle)); - filtering_toggle = make_toggle ("Linear filtering: ", - &(TEST_COGLBOX_GET_PRIVATE (coglbox) - ->use_linear_filtering)); - clutter_actor_set_position (filtering_toggle, 0, - clutter_actor_get_y (slicing_toggle) - - clutter_actor_get_height (filtering_toggle)); - note = clutter_label_new_with_text ("Sans 10", "<- Click to change"); - clutter_actor_set_position (note, - clutter_actor_get_width (filtering_toggle) + 10, - (clutter_actor_get_height (stage) - + clutter_actor_get_y (filtering_toggle)) / 2 - - clutter_actor_get_height (note) / 2); - - clutter_container_add (CLUTTER_CONTAINER (stage), - slicing_toggle, - filtering_toggle, - note, - NULL); - - clutter_actor_show (stage); - - clutter_main (); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-cogl-tex-tile.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-cogl-tex-tile.c --- clutter-0.8.4/tests/test-cogl-tex-tile.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-cogl-tex-tile.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,224 +0,0 @@ -#include -#include -#include -#include -#include - -/* Coglbox declaration - *--------------------------------------------------*/ - -G_BEGIN_DECLS - -#define TEST_TYPE_COGLBOX test_coglbox_get_type() - -#define TEST_COGLBOX(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - TEST_TYPE_COGLBOX, TestCoglboxClass)) - -#define TEST_COGLBOX_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - TEST_TYPE_COGLBOX, TestCoglboxClass)) - -#define TEST_IS_COGLBOX(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - TEST_TYPE_COGLBOX)) - -#define TEST_IS_COGLBOX_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - TEST_TYPE_COGLBOX)) - -#define TEST_COGLBOX_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - TEST_TYPE_COGLBOX, TestCoglboxClass)) - -typedef struct _TestCoglbox TestCoglbox; -typedef struct _TestCoglboxClass TestCoglboxClass; -typedef struct _TestCoglboxPrivate TestCoglboxPrivate; - -struct _TestCoglbox -{ - ClutterActor parent; - - /*< private >*/ - TestCoglboxPrivate *priv; -}; - -struct _TestCoglboxClass -{ - ClutterActorClass parent_class; - - /* padding for future expansion */ - void (*_test_coglbox1) (void); - void (*_test_coglbox2) (void); - void (*_test_coglbox3) (void); - void (*_test_coglbox4) (void); -}; - -GType test_coglbox_get_type (void) G_GNUC_CONST; - -G_END_DECLS - -/* Coglbox private declaration - *--------------------------------------------------*/ - -G_DEFINE_TYPE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR); - -#define TEST_COGLBOX_GET_PRIVATE(obj) \ -(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate)) - -struct _TestCoglboxPrivate -{ - CoglHandle cogl_tex_id; - gint frame; -}; - -/* Coglbox implementation - *--------------------------------------------------*/ - -static void -test_coglbox_paint(ClutterActor *self) -{ - TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (self); - - ClutterColor cback = {0x66, 0x66, 0xDD, 0xFF}; - ClutterColor cwhite = {0xFF, 0xFF, 0xFF, 0xFF}; - ClutterFixed texcoords[4] = { - CLUTTER_FLOAT_TO_FIXED (0.0f), - CLUTTER_FLOAT_TO_FIXED (0.0f), - CLUTTER_FLOAT_TO_FIXED (1.0f), - CLUTTER_FLOAT_TO_FIXED (1.0f) - }; - - gint pingpong_frame; - ClutterFixed sin_frame, cos_frame; - ClutterFixed frac_frame; - gint t; - - sin_frame = clutter_sini (CLUTTER_ANGLE_FROM_DEG (priv->frame)); - cos_frame = clutter_cosi (CLUTTER_ANGLE_FROM_DEG (priv->frame)); - - pingpong_frame = (priv->frame <= 180 ? priv->frame : 360 - priv->frame); - frac_frame = CFX_QDIV (CLUTTER_INT_TO_FIXED (pingpong_frame), - CLUTTER_INT_TO_FIXED (180)); - frac_frame += (CFX_ONE >> 1); - frac_frame <<= 1; - - for (t=0; t<4; t+=2) - { - texcoords[t] += cos_frame; - texcoords[t+1] += sin_frame; - - texcoords[t] = CFX_QMUL (texcoords[t], frac_frame); - texcoords[t+1] = CFX_QMUL (texcoords[t+1], frac_frame); - } - - priv = TEST_COGLBOX_GET_PRIVATE (self); - - cogl_push_matrix (); - - cogl_color (&cback); - cogl_rectangle (0,0,400,400); - - cogl_color (&cwhite); - cogl_translate (100,100,0); - cogl_texture_rectangle (priv->cogl_tex_id, - 0, 0, - CLUTTER_INT_TO_FIXED (200), - CLUTTER_INT_TO_FIXED (213), - texcoords[0], texcoords[1], - texcoords[2], texcoords[3]); - - cogl_pop_matrix(); -} - -static void -test_coglbox_finalize (GObject *object) -{ - G_OBJECT_CLASS (test_coglbox_parent_class)->finalize (object); -} - -static void -test_coglbox_dispose (GObject *object) -{ - TestCoglboxPrivate *priv; - - priv = TEST_COGLBOX_GET_PRIVATE (object); - cogl_texture_unref (priv->cogl_tex_id); - - G_OBJECT_CLASS (test_coglbox_parent_class)->dispose (object); -} - -static void -test_coglbox_init (TestCoglbox *self) -{ - TestCoglboxPrivate *priv; - self->priv = priv = TEST_COGLBOX_GET_PRIVATE(self); - - priv->cogl_tex_id = cogl_texture_new_from_file ("redhand.png", 0, FALSE, - COGL_PIXEL_FORMAT_ANY, - NULL); - - cogl_texture_set_filters (priv->cogl_tex_id, - CGL_LINEAR, CGL_LINEAR); -} - -static void -test_coglbox_class_init (TestCoglboxClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); - - gobject_class->finalize = test_coglbox_finalize; - gobject_class->dispose = test_coglbox_dispose; - actor_class->paint = test_coglbox_paint; - - g_type_class_add_private (gobject_class, sizeof (TestCoglboxPrivate)); -} - -ClutterActor* -test_coglbox_new (void) -{ - return g_object_new (TEST_TYPE_COGLBOX, NULL); -} - -static void -frame_cb (ClutterTimeline *timeline, - gint frame_num, - gpointer data) -{ - TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (data); - - priv->frame = frame_num; - clutter_actor_queue_redraw (CLUTTER_ACTOR (data)); -} - -int -main (int argc, char *argv[]) -{ - ClutterActor *stage; - ClutterActor *coglbox; - ClutterTimeline *timeline; - - clutter_init(&argc, &argv); - - /* Stage */ - stage = clutter_stage_get_default (); - clutter_actor_set_size (stage, 400, 400); - clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Test"); - - /* Cogl Box */ - coglbox = test_coglbox_new (); - clutter_container_add_actor (CLUTTER_CONTAINER (stage), coglbox); - - /* Timeline for animation */ - timeline = clutter_timeline_new (360, 60); /* num frames, fps */ - g_object_set (timeline, "loop", TRUE, NULL); /* have it loop */ - g_signal_connect (timeline, "new-frame", G_CALLBACK (frame_cb), coglbox); - clutter_timeline_start (timeline); - - clutter_actor_show_all (stage); - - clutter_main (); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-depth.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-depth.c --- clutter-0.8.4/tests/test-depth.c 2008-10-24 09:50:46.000000000 +0100 +++ clutter-0.9.0/tests/test-depth.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,212 +0,0 @@ -#include -#include - -/* each time the timeline animating the label completes, swap the direction */ -static void -timeline_completed (ClutterTimeline *timeline, - gpointer user_data) -{ - clutter_timeline_set_direction (timeline, - !clutter_timeline_get_direction (timeline)); - clutter_timeline_start (timeline); -} - -static ClutterActor *raise_actor[2]; -static gboolean raise_no = 0; - -static gboolean -raise_top (gpointer ignored) -{ - clutter_actor_raise_top (raise_actor[raise_no]); - raise_no = !raise_no; - return TRUE; -} - -static ClutterActor * -clone_box (ClutterTexture *original) -{ - guint width, height; - ClutterActor *group; - ClutterActor *clone; - - clutter_actor_get_size (CLUTTER_ACTOR (original), &width, &height); - - group = clutter_group_new (); - clone = clutter_clone_texture_new (original); - clutter_container_add_actor (CLUTTER_CONTAINER (group), clone); - clutter_actor_set_depth (clone, width/2); - - clone = clutter_clone_texture_new (original); - clutter_container_add_actor (CLUTTER_CONTAINER (group), clone); - clutter_actor_set_rotation (clone, CLUTTER_Y_AXIS, 180, width/2, 0, 0); - clutter_actor_set_depth (clone, -width/2); - - clone = clutter_clone_texture_new (original); - clutter_container_add_actor (CLUTTER_CONTAINER (group), clone); - clutter_actor_set_rotation (clone, CLUTTER_Y_AXIS, 90, 0, 0, 0); - clutter_actor_set_depth (clone, width/2); - clutter_actor_set_position (clone, 0, 0); - - clone = clutter_clone_texture_new (original); - clutter_container_add_actor (CLUTTER_CONTAINER (group), clone); - clutter_actor_set_rotation (clone, CLUTTER_Y_AXIS, 90, 0, 0, 0); - clutter_actor_set_depth (clone, width/2); - clutter_actor_set_position (clone, width, 0); - - clone = clutter_clone_texture_new (original); - clutter_container_add_actor (CLUTTER_CONTAINER (group), clone); - clutter_actor_set_rotation (clone, CLUTTER_X_AXIS, 90, 0, 0, 0); - clutter_actor_set_depth (clone, -width/2); - clutter_actor_set_position (clone, 0, height); - - clone = clutter_clone_texture_new (original); - clutter_container_add_actor (CLUTTER_CONTAINER (group), clone); - clutter_actor_set_rotation (clone, CLUTTER_X_AXIS, 90, 0, 0, 0); - clutter_actor_set_depth (clone, -width/2); - clutter_actor_set_position (clone, 0, 0); - - clutter_actor_show_all (group); - return group; -} - -static ClutterActor * -janus_group (const gchar *front_text, - const gchar *back_text) -{ - ClutterColor slide_color = {0x00, 0x00, 0x00, 0xff}; - ClutterColor red = {0xff, 0x00, 0x00, 0xff}; - ClutterColor green = {0x00, 0xff, 0x00, 0xff}; - ClutterActor *group, *rectangle, *front, *back; - guint width, height; - guint width2, height2; - - group = clutter_group_new (); - rectangle = clutter_rectangle_new_with_color (&slide_color); - front = clutter_label_new_with_text ("Sans 50px", front_text); - back = clutter_label_new_with_text ("Sans 50px", back_text); - clutter_label_set_color (CLUTTER_LABEL (front), &red); - clutter_label_set_color (CLUTTER_LABEL (back), &green); - - clutter_actor_get_size (front, &width, &height); - clutter_actor_get_size (back, &width2, &height2); - - if (width2 > width) - width = width2; - if (height2 > height) - height = height2; - - clutter_actor_set_size (rectangle, width, height); - clutter_actor_set_rotation (back, CLUTTER_Y_AXIS, 180, width/2, 0, 0); - - clutter_container_add (CLUTTER_CONTAINER (group), - back, rectangle, front, NULL); - - clutter_actor_show_all (group); - return group; -} - - -gint -main (int argc, char *argv[]) -{ - ClutterTimeline *timeline; - ClutterBehaviour *d_behave; - ClutterBehaviour *r_behave; - ClutterActor *stage; - ClutterActor *group, *hand, *label, *rect, *janus, *box; - ClutterColor stage_color = { 0xcc, 0xcc, 0xcc, 0xff }; - ClutterColor rect_color = { 0, 0, 0, 0x88 }; - GError *error; - - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); - clutter_stage_set_use_fog (CLUTTER_STAGE (stage), TRUE); - clutter_stage_set_fog (CLUTTER_STAGE (stage), 1.0, 10, -50); - - g_signal_connect (stage, - "button-press-event", G_CALLBACK (clutter_main_quit), - NULL); - - group = clutter_group_new (); - clutter_stage_add (stage, group); - clutter_actor_show (group); - - label = clutter_label_new_with_text ("Mono 26", "Clutter"); - clutter_actor_set_position (label, 120, 200); - clutter_actor_show (label); - - error = NULL; - hand = clutter_texture_new_from_file ("redhand.png", &error); - if (error) - g_error ("Unable to load redhand.png: %s", error->message); - clutter_actor_set_position (hand, 240, 100); - clutter_actor_show (hand); - - rect = clutter_rectangle_new_with_color (&rect_color); - clutter_actor_set_position (rect, 340, 100); - clutter_actor_set_size (rect, 200, 200); - clutter_actor_show (rect); - - clutter_container_add (CLUTTER_CONTAINER (group), hand, rect, NULL); - clutter_container_add_actor (CLUTTER_CONTAINER (stage), label); - - /* 3 seconds, at 60 fps */ - timeline = clutter_timeline_new (180, 60); - g_signal_connect (timeline, - "completed", G_CALLBACK (timeline_completed), - NULL); - - d_behave = clutter_behaviour_depth_new (clutter_alpha_new_full (timeline, - CLUTTER_ALPHA_RAMP_INC, - NULL, NULL), - -100, 100); - clutter_behaviour_apply (d_behave, label); - - /* add two faced actor */ - janus = janus_group ("GREEN", "RED"); - clutter_container_add_actor (CLUTTER_CONTAINER (stage), janus); - clutter_actor_set_position (janus, 300, 350); - - r_behave = clutter_behaviour_rotate_new (clutter_alpha_new_full (timeline, - CLUTTER_ALPHA_RAMP_INC, - NULL, NULL), - CLUTTER_Y_AXIS, - CLUTTER_ROTATE_CW, - 0, 360); - clutter_behaviour_apply (r_behave, janus); - - - /* add hand box */ - box = clone_box (CLUTTER_TEXTURE (hand)); - clutter_container_add_actor (CLUTTER_CONTAINER (stage), box); - clutter_actor_set_position (box, 200, 250); - clutter_actor_set_scale (box, 0.5, 0.5); - clutter_actor_set_rotation (box, CLUTTER_X_AXIS, 45, 0, 0, 0); - clutter_actor_set_opacity (box, 0x44); - - r_behave = clutter_behaviour_rotate_new (clutter_alpha_new_full (timeline, - CLUTTER_ALPHA_RAMP_INC, - NULL, NULL), - CLUTTER_Y_AXIS, - CLUTTER_ROTATE_CW, - 0, 360); - clutter_behaviour_apply (r_behave, box); - - - clutter_actor_show (stage); - - clutter_timeline_start (timeline); - - raise_actor[0] = rect; - raise_actor[1] = hand; - g_timeout_add (2000, raise_top, NULL); - - clutter_main (); - - g_object_unref (d_behave); - g_object_unref (timeline); - - return EXIT_SUCCESS; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-devices.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-devices.c --- clutter-0.8.4/tests/test-devices.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-devices.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,82 +0,0 @@ -#include -#include - -typedef struct { - - GHashTable *devices; - -} TestDevicesApp; - - - -static gboolean -stage_motion_event_cb (ClutterActor *actor, - ClutterEvent *event, - gpointer userdata) -{ - TestDevicesApp *app = (TestDevicesApp *)userdata; - ClutterActor *hand = NULL; - ClutterMotionEvent *mev = (ClutterMotionEvent *)event; - - hand = g_hash_table_lookup (app->devices, mev->device); - clutter_actor_set_position (hand, mev->x, mev->y); - - return FALSE; -} - -int -main (int argc, char **argv) -{ - ClutterActor *stage = NULL; - GSList *stage_devices = NULL; - TestDevicesApp *app = NULL; - ClutterColor stage_color = { 0x61, 0x64, 0x8c, 0xff }; - - clutter_x11_enable_xinput (); - clutter_init (&argc, &argv); - - app = g_new0 (TestDevicesApp, 1); - app->devices = g_hash_table_new (g_direct_hash, g_direct_equal) ; - - stage = clutter_stage_get_default (); - clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); - //clutter_stage_fullscreen (CLUTTER_STAGE (stage)); - - g_signal_connect (stage, - "motion-event", - G_CALLBACK(stage_motion_event_cb), - app); - clutter_actor_show_all (stage); - - stage_devices = clutter_x11_get_input_devices (); - - if (stage_devices == NULL) - g_error ("No extended input devices found."); - - do - { - if (stage_devices) - { - ClutterX11XInputDevice *device = NULL; - ClutterActor *hand = NULL; - - device = (ClutterX11XInputDevice *)stage_devices->data; - - if (clutter_x11_get_input_device_type (device) - == CLUTTER_X11_XINPUT_POINTER_DEVICE) - { - - g_debug("got a pointer device...\n"); - - hand = clutter_texture_new_from_file ("redhand.png", NULL); - g_hash_table_insert (app->devices, device, hand); - clutter_container_add_actor (CLUTTER_CONTAINER (stage), hand); - } - - } - } while ((stage_devices = stage_devices->next) != NULL); - - clutter_main (); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-effects.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-effects.c --- clutter-0.8.4/tests/test-effects.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-effects.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,94 +0,0 @@ -#include -#include - -static ClutterEffectTemplate *tmpl = NULL; -static ClutterTimeline *timeline = NULL; - -int -main (int argc, char *argv[]) -{ - ClutterActor *stage, *actor; - ClutterContainer *container; - ClutterColor stage_color = { 0xcc, 0xcc, 0xcc, 0xff }; - ClutterColor rect_color = { 0, 0, 0, 0xdd }; - - clutter_init (&argc, &argv); - - timeline = clutter_timeline_new_for_duration (5000); - clutter_timeline_set_loop (timeline, TRUE); - tmpl = - clutter_effect_template_new (timeline, CLUTTER_ALPHA_RAMP_INC); - - stage = clutter_stage_get_default (); - container = CLUTTER_CONTAINER (stage); - g_signal_connect (stage, - "button-press-event", G_CALLBACK (clutter_main_quit), - NULL); - - clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); - clutter_stage_set_use_fog (CLUTTER_STAGE (stage), TRUE); - clutter_actor_set_size (stage, 800, 600); - clutter_actor_show_all (stage); - - actor = clutter_rectangle_new_with_color (&rect_color); - clutter_container_add_actor (container, actor); - clutter_actor_set_size (actor, 50, 50); - clutter_actor_set_position (actor, 50, 10); - clutter_effect_fade (tmpl, actor, 0x22, NULL, NULL); - clutter_actor_show (actor); - - actor = clutter_rectangle_new_with_color (&rect_color); - clutter_container_add_actor (container, actor); - clutter_actor_set_size (actor, 50, 50); - clutter_actor_set_position (actor, 750, 70); - clutter_effect_depth (tmpl, actor, -500, NULL, NULL); - clutter_actor_show (actor); - - actor = clutter_rectangle_new_with_color (&rect_color); - clutter_container_add_actor (container, actor); - clutter_actor_set_size (actor, 50, 50); - clutter_actor_set_position (actor, 50, 140); - clutter_effect_move (tmpl, actor, 750, 140, NULL, NULL); - clutter_actor_show (actor); - - actor = clutter_rectangle_new_with_color (&rect_color); - clutter_container_add_actor (container, actor); - clutter_actor_set_size (actor, 50, 50); - clutter_actor_set_position (actor, 750, 210); - { - ClutterKnot knots[2]; - - knots[0].x = 750; knots[0].y = 210; - knots[1].x = 350; knots[1].y = 210; - - clutter_effect_path (tmpl, actor, knots, 2, NULL, NULL); - } - clutter_actor_show (actor); - - actor = clutter_rectangle_new_with_color (&rect_color); - clutter_container_add_actor (container, actor); - clutter_actor_set_size (actor, 50, 50); - clutter_actor_set_position (actor, 50, 280); - clutter_actor_set_anchor_point_from_gravity (actor, CLUTTER_GRAVITY_CENTER); - - clutter_effect_scale (tmpl, actor, 2.0, 2.0, NULL, NULL); - clutter_actor_show (actor); - - actor = clutter_rectangle_new_with_color (&rect_color); - clutter_container_add_actor (container, actor); - clutter_actor_set_size (actor, 50, 50); - clutter_actor_set_position (actor, 750, 350); - clutter_effect_rotate (tmpl, actor, - CLUTTER_Z_AXIS, 180.0, - 25, 25, 0, - CLUTTER_ROTATE_CW, - NULL, NULL); - clutter_actor_show (actor); - - clutter_main (); - - g_object_unref (tmpl); - g_object_unref (timeline); - - return EXIT_SUCCESS; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-entry-auto.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-entry-auto.c --- clutter-0.8.4/tests/test-entry-auto.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-entry-auto.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,301 +0,0 @@ - -#include -#include - -#ifndef g_assert_cmpint -# define g_assert_cmpint(x,y,z) g_assert((x) y (z)) -#endif - -typedef struct { - gunichar unichar; - const char bytes[6]; - gint nbytes; -} TestData; - -const TestData -test_data[] = { - { 0xe4, "\xc3\xa4", 2 }, /* LATIN SMALL LETTER A WITH DIAERESIS */ - { 0x2665, "\xe2\x99\xa5", 3 } /* BLACK HEART SUIT */ -}; - -static void -selfcheck (const TestData *t) -{ - gunichar unichar; - char bytes[6]; - int nbytes; - - g_assert (g_unichar_validate (t->unichar)); - - nbytes = g_unichar_to_utf8 (t->unichar, bytes); - bytes[nbytes] = '\0'; - g_assert (nbytes == t->nbytes); - g_assert (memcmp (t->bytes, bytes, nbytes) == 0); - - unichar = g_utf8_get_char_validated (bytes, nbytes); - g_assert (unichar == t->unichar); -} - -static int -get_nbytes (ClutterEntry *entry) -{ - const char *s = clutter_entry_get_text (entry); - return strlen (s); -} - -static int -get_nchars (ClutterEntry *entry) -{ - const char *s = clutter_entry_get_text (entry); - g_assert (g_utf8_validate (s, -1, NULL)); - return g_utf8_strlen (s, -1); -} - -#define DONT_MOVE_CURSOR (-2) - -static void -insert_unichar (ClutterEntry *entry, gunichar unichar, int position) -{ - if (position > DONT_MOVE_CURSOR) - { - clutter_entry_set_cursor_position (entry, position); - g_assert_cmpint (clutter_entry_get_cursor_position (entry), ==, position); - } - - clutter_entry_insert_unichar (entry, unichar); -} - -static void -test_empty (ClutterEntry *entry, const TestData *unused) -{ - g_assert (clutter_entry_get_text (entry) == NULL); - g_assert_cmpint (clutter_entry_get_cursor_position (entry), ==, -1); -} - -static void -test_set_empty (ClutterEntry *entry, const TestData *unused) -{ - /* annoyingly slightly different from initially empty */ - clutter_entry_set_text (entry, ""); - g_assert_cmpint (get_nchars (entry), ==, 0); - g_assert_cmpint (get_nbytes (entry), ==, 0); - g_assert_cmpint (clutter_entry_get_cursor_position (entry), ==, -1); -} - -static void -test_set_text (ClutterEntry *entry, const TestData *unused) -{ - clutter_entry_set_text (entry, "abcdef"); - g_assert_cmpint (get_nchars (entry), ==, 6); - g_assert_cmpint (get_nbytes (entry), ==, 6); - g_assert_cmpint (clutter_entry_get_cursor_position (entry), ==, -1); - - clutter_entry_set_cursor_position (entry, 5); - g_assert_cmpint (clutter_entry_get_cursor_position (entry), ==, 5); - - clutter_entry_set_text (entry, ""); - /* FIXME: cursor position should be -1? - g_assert_cmpint (clutter_entry_get_cursor_position (entry), ==, -1); - */ -} - -static void -test_insert (ClutterEntry *entry, const TestData *t) -{ - clutter_entry_insert_unichar (entry, t->unichar); - clutter_entry_insert_unichar (entry, t->unichar); - - insert_unichar (entry, t->unichar, 1); - g_assert_cmpint (get_nchars (entry), ==, 3); - g_assert_cmpint (get_nbytes (entry), ==, 3 * t->nbytes); - g_assert_cmpint (clutter_entry_get_cursor_position (entry), ==, 2); -} - -static void -test_append_some (ClutterEntry *entry, const TestData *t) -{ - int i; - - for (i = 1; i <= 4; i++) - { - insert_unichar (entry, t->unichar, DONT_MOVE_CURSOR); - g_assert_cmpint (get_nchars (entry), ==, i); - g_assert_cmpint (get_nbytes (entry), ==, i * t->nbytes); - g_assert_cmpint (clutter_entry_get_cursor_position (entry), ==, -1); - } -} - -static void -test_prepend_some (ClutterEntry *entry, const TestData *t) -{ - int i; - - clutter_entry_insert_unichar (entry, t->unichar); - g_assert_cmpint (get_nchars (entry), ==, 1); - g_assert_cmpint (get_nbytes (entry), ==, 1 * t->nbytes); - g_assert_cmpint (clutter_entry_get_cursor_position (entry), ==, -1); - - for (i = 2; i <= 4; i++) - { - insert_unichar (entry, t->unichar, 0); - g_assert_cmpint (get_nchars (entry), ==, i); - g_assert_cmpint (get_nbytes (entry), ==, i * t->nbytes); - g_assert_cmpint (clutter_entry_get_cursor_position (entry), ==, 1); - } -} - -static void -test_delete_chars (ClutterEntry *entry, const TestData *t) -{ - int i; - - for (i = 0; i < 4; i++) - clutter_entry_insert_unichar (entry, t->unichar); - - clutter_entry_set_cursor_position (entry, 2); - clutter_entry_delete_chars (entry, 1); - g_assert_cmpint (get_nchars (entry), ==, 3); - g_assert_cmpint (get_nbytes (entry), ==, 3 * t->nbytes); - g_assert_cmpint (clutter_entry_get_cursor_position (entry), ==, 1); - - clutter_entry_set_cursor_position (entry, 2); - clutter_entry_delete_chars (entry, 1); - g_assert_cmpint (get_nchars (entry), ==, 2); - g_assert_cmpint (get_nbytes (entry), ==, 2 * t->nbytes); - g_assert_cmpint (clutter_entry_get_cursor_position (entry), ==, 1); -} - -static void -test_delete_text (ClutterEntry *entry, const TestData *t) -{ - int i; - - for (i = 0; i < 4; i++) - clutter_entry_insert_unichar (entry, t->unichar); - - clutter_entry_set_cursor_position (entry, 3); - clutter_entry_delete_text (entry, 2, 4); - g_assert_cmpint (get_nchars (entry), ==, 2); - g_assert_cmpint (get_nbytes (entry), ==, 2 * t->nbytes); - /* FIXME: cursor position should be -1? - g_assert_cmpint (clutter_entry_get_cursor_position (entry), ==, -1); - */ -} - -static void -init_event (ClutterKeyEvent *event) -{ - event->type = CLUTTER_KEY_PRESS; - event->time = 0; /* not needed */ - event->flags = CLUTTER_EVENT_FLAG_SYNTHETIC; - event->stage = NULL; /* not needed */ - event->source = NULL; /* not needed */ - event->modifier_state = 0; - event->hardware_keycode = 0; /* not needed */ -} - -static void -send_keyval (ClutterEntry *entry, int keyval) -{ - ClutterKeyEvent event; - - init_event (&event); - event.keyval = keyval; - event.unicode_value = 0; /* should be ignored for cursor keys etc. */ - - clutter_entry_handle_key_event (entry, &event); -} - -static void -send_unichar (ClutterEntry *entry, gunichar unichar) -{ - ClutterKeyEvent event; - - init_event (&event); - event.keyval = 0; /* should be ignored for printable characters */ - event.unicode_value = unichar; - - clutter_entry_handle_key_event (entry, &event); -} - -static void -test_cursor (ClutterEntry *entry, const TestData *t) -{ - int i; - - for (i = 0; i < 4; ++i) - clutter_entry_insert_unichar (entry, t->unichar); - clutter_entry_set_cursor_position (entry, 2); - - /* test cursor moves and is clamped */ - send_keyval (entry, CLUTTER_Left); - g_assert_cmpint (clutter_entry_get_cursor_position (entry), ==, 1); - - send_keyval (entry, CLUTTER_Left); - g_assert_cmpint (clutter_entry_get_cursor_position (entry), ==, 0); - - send_keyval (entry, CLUTTER_Left); - g_assert_cmpint (clutter_entry_get_cursor_position (entry), ==, 0); - - /* delete text containing the cursor */ - clutter_entry_set_cursor_position (entry, 3); - g_assert_cmpint (clutter_entry_get_cursor_position (entry), ==, 3); - - clutter_entry_delete_text (entry, 2, 4); - send_keyval (entry, CLUTTER_Left); - /* FIXME: cursor position should be -1? - g_assert_cmpint (clutter_entry_get_cursor_position (entry), ==, -1); - */ -} - -static void -test_event (ClutterEntry *entry, const TestData *t) -{ - send_unichar (entry, t->unichar); - g_assert_cmpint (get_nchars (entry), ==, 1); - g_assert_cmpint (get_nbytes (entry), ==, 1 * t->nbytes); - g_assert_cmpint (clutter_entry_get_cursor_position (entry), ==, -1); -} - -static void -run (void (*test_func)(ClutterEntry *, const TestData *), const TestData *t) -{ - ClutterActor *entry; - - entry = clutter_entry_new (); - test_func (CLUTTER_ENTRY (entry), t); - clutter_actor_destroy (entry); -} - -int -main (int argc, char **argv) -{ - int i; - - g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL); - - for (i = 0; i < G_N_ELEMENTS (test_data); ++i) - selfcheck (&test_data[i]); - - clutter_init (&argc, &argv); - - run (test_empty, NULL); - run (test_set_empty, NULL); - run (test_set_text, NULL); - - for (i = 0; i < G_N_ELEMENTS (test_data); ++i) - { - const TestData *t = &test_data[i]; - - run (test_append_some, t); - run (test_prepend_some, t); - run (test_insert, t); - run (test_delete_chars, t); - run (test_delete_text, t); - run (test_cursor, t); - run (test_event, t); - } - - return 0; -} - diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-entry.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-entry.c --- clutter-0.8.4/tests/test-entry.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-entry.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,46 +0,0 @@ -#include - -static void -on_entry_activated (ClutterEntry *entry, gpointer null) -{ - g_print ("Activated: %s\n", clutter_entry_get_text (entry)); -} - -int -main (int argc, char *argv[]) -{ - ClutterActor *entry; - ClutterActor *stage; - ClutterColor stage_color = { 0x00, 0x00, 0x00, 0xff }; - ClutterColor entry_color = { 0x33, 0xdd, 0xff, 0xff }; - - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - - clutter_actor_set_size (stage, 800, 600); - clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); - clutter_stage_set_title (CLUTTER_STAGE (stage), "ClutterEntry Test"); - - entry = clutter_entry_new_with_text ("Sans 14", - "Type something, be sure to use the " - "left/right arrow keys to move the " - "cursor position."); - clutter_entry_set_color (CLUTTER_ENTRY (entry), &entry_color); - clutter_actor_set_size (entry, 600, 50); - clutter_actor_set_position (entry, 100, 100); - /*clutter_entry_set_visibility (CLUTTER_ENTRY (entry), FALSE);*/ - /*clutter_entry_set_max_length (CLUTTER_ENTRY (entry), 50);*/ - - clutter_group_add (CLUTTER_GROUP (stage), entry); - clutter_stage_set_key_focus (CLUTTER_STAGE (stage), entry); - - clutter_actor_show_all (stage); - - g_signal_connect (entry, "activate", - G_CALLBACK (on_entry_activated), NULL); - - clutter_main(); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-events.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-events.c --- clutter-0.8.4/tests/test-events.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-events.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,303 +0,0 @@ -#include -#include - -gboolean IsFullScreen = FALSE, IsMotion = TRUE; - -static void -stage_state_cb (ClutterStage *stage, - gpointer data) -{ - gchar *detail = (gchar*)data; - - printf("[stage signal] %s\n", detail); -} - -static gboolean -blue_button_cb (ClutterActor *actor, - ClutterEvent *event, - gpointer data) -{ - ClutterActor *stage; - - stage = clutter_stage_get_default (); - - if (IsFullScreen) - IsFullScreen = FALSE; - else - IsFullScreen = TRUE; - - g_object_set (stage, "fullscreen", IsFullScreen, NULL); - - g_print ("*** Fullscreen %s ***\n", - IsFullScreen ? "enabled" : "disabled"); - - return FALSE; -} - -static gboolean -red_button_cb (ClutterActor *actor, - ClutterEvent *event, - gpointer data) -{ - - if (IsMotion) - IsMotion = FALSE; - else - IsMotion = TRUE; - - clutter_set_motion_events_enabled (IsMotion); - - g_print ("*** Per actor motion events %s ***\n", - IsMotion ? "enabled" : "disabled"); - - return FALSE; -} - -static gboolean -capture_cb (ClutterActor *actor, - ClutterEvent *event, - gpointer data) -{ - g_print ("* captured event for type '%s' *\n", - G_OBJECT_TYPE_NAME (actor)); - - return FALSE; -} - -static void -key_focus_in_cb (ClutterActor *actor, - gpointer data) -{ - ClutterActor *focus_box = CLUTTER_ACTOR(data); - - if (actor == clutter_stage_get_default ()) - clutter_actor_hide (focus_box); - else - { - clutter_actor_set_position (focus_box, - clutter_actor_get_x (actor) - 5, - clutter_actor_get_y (actor) - 5); - - clutter_actor_set_size (focus_box, - clutter_actor_get_width (actor) + 10, - clutter_actor_get_height (actor) + 10); - clutter_actor_show (focus_box); - } -} - -static void -fill_keybuf (char *keybuf, ClutterKeyEvent *event) -{ - char utf8[6]; - int len; - - /* printable character, if any (ß, ∑) */ - len = g_unichar_to_utf8 (event->unicode_value, utf8); - utf8[len] = '\0'; - sprintf(keybuf, "'%s' ", utf8); - - /* key combination (s, S, Delete) */ - len = g_unichar_to_utf8 (clutter_keysym_to_unicode (event->keyval), - utf8); - utf8[len] = '\0'; - - if (event->modifier_state & CLUTTER_SHIFT_MASK) - strcat (keybuf, ""); - if (event->modifier_state & CLUTTER_LOCK_MASK) - strcat (keybuf, ""); - if (event->modifier_state & CLUTTER_CONTROL_MASK) - strcat (keybuf, ""); - if (event->modifier_state & CLUTTER_MOD1_MASK) - strcat (keybuf, ""); - if (event->modifier_state & CLUTTER_MOD2_MASK) - strcat (keybuf, ""); - if (event->modifier_state & CLUTTER_MOD3_MASK) - strcat (keybuf, ""); - if (event->modifier_state & CLUTTER_MOD4_MASK) - strcat (keybuf, ""); - if (event->modifier_state & CLUTTER_MOD5_MASK) - strcat (keybuf, ""); - strcat (keybuf, utf8); -} - -static gboolean -input_cb (ClutterActor *actor, - ClutterEvent *event, - gpointer data) -{ - ClutterStage *stage = CLUTTER_STAGE (clutter_stage_get_default ()); - gchar keybuf[128], *source = (gchar*)data; - - switch (event->type) - { - case CLUTTER_KEY_PRESS: - fill_keybuf (keybuf, &event->key); - printf ("[%s] KEY PRESS %s", source, keybuf); - break; - case CLUTTER_KEY_RELEASE: - fill_keybuf (keybuf, &event->key); - printf ("[%s] KEY RELEASE %s", source, keybuf); - break; - case CLUTTER_MOTION: - g_print ("[%s] MOTION", source); - break; - case CLUTTER_ENTER: - g_print ("[%s] ENTER", source); - break; - case CLUTTER_LEAVE: - g_print ("[%s] LEAVE", source); - break; - case CLUTTER_BUTTON_PRESS: - g_print ("[%s] BUTTON PRESS (click count:%i)", - source, event->button.click_count); - break; - case CLUTTER_BUTTON_RELEASE: - g_print ("[%s] BUTTON RELEASE (click count:%i)", - source, event->button.click_count); - - if (clutter_event_get_source (event) == CLUTTER_ACTOR (stage)) - clutter_stage_set_key_focus (stage, NULL); - else if (clutter_event_get_source (event) == actor - && clutter_actor_get_parent (actor) == CLUTTER_ACTOR (stage)) - clutter_stage_set_key_focus (stage, actor); - break; - case CLUTTER_SCROLL: - g_print ("[%s] BUTTON SCROLL (click count:%i)", - source, event->button.click_count); - break; - case CLUTTER_STAGE_STATE: - g_print ("[%s] STAGE STATE", source); - break; - case CLUTTER_DESTROY_NOTIFY: - g_print ("[%s] DESTROY NOTIFY", source); - break; - case CLUTTER_CLIENT_MESSAGE: - g_print ("[%s] CLIENT MESSAGE", source); - break; - case CLUTTER_DELETE: - g_print ("[%s] DELETE", source); - break; - case CLUTTER_NOTHING: - return FALSE; - } - - if (clutter_event_get_source (event) == actor) - g_print (" *source*"); - - g_print ("\n"); - - return FALSE; -} - -int -main (int argc, char *argv[]) -{ - ClutterActor *stage, *actor, *focus_box, *group; - ClutterColor rcol = { 0xff, 0, 0, 0xff}, - bcol = { 0, 0, 0xff, 0xff }, - gcol = { 0, 0xff, 0, 0xff }, - ycol = { 0xff, 0xff, 0, 0xff }, - ncol = { 0, 0, 0, 0xff }; - - clutter_init (&argc, &argv); - - - - stage = clutter_stage_get_default (); - g_signal_connect (stage, "event", G_CALLBACK (input_cb), "stage"); - - g_signal_connect (stage, "fullscreen", - G_CALLBACK (stage_state_cb), "fullscreen"); - g_signal_connect (stage, "unfullscreen", - G_CALLBACK (stage_state_cb), "unfullscreen"); - g_signal_connect (stage, "activate", - G_CALLBACK (stage_state_cb), "activate"); - g_signal_connect (stage, "deactivate", - G_CALLBACK (stage_state_cb), "deactivate"); - - g_signal_connect (stage, "captured-event", G_CALLBACK (capture_cb), NULL); - - focus_box = clutter_rectangle_new_with_color (&ncol); - clutter_container_add (CLUTTER_CONTAINER(stage), focus_box, NULL); - - actor = clutter_rectangle_new_with_color (&rcol); - clutter_actor_set_size (actor, 100, 100); - clutter_actor_set_position (actor, 100, 100); - - clutter_actor_set_reactive (actor, TRUE); - - clutter_container_add (CLUTTER_CONTAINER (stage), actor, NULL); - - g_signal_connect (actor, "event", G_CALLBACK (input_cb), "red box"); - g_signal_connect (actor, "focus-in", G_CALLBACK (key_focus_in_cb), - focus_box); - - /* Toggle motion - enter/leave capture */ - g_signal_connect (actor, "button-press-event", - G_CALLBACK (red_button_cb), NULL); - - clutter_stage_set_key_focus (CLUTTER_STAGE (stage), actor); - - actor = clutter_rectangle_new_with_color (&gcol); - clutter_actor_set_size (actor, 100, 100); - clutter_actor_set_position (actor, 250, 100); - - clutter_actor_set_reactive (actor, TRUE); - - clutter_container_add (CLUTTER_CONTAINER (stage), actor, NULL); - - g_signal_connect (actor, "event", G_CALLBACK (input_cb), "green box"); - g_signal_connect (actor, "focus-in", G_CALLBACK (key_focus_in_cb), - focus_box); - - g_signal_connect (actor, "captured-event", G_CALLBACK (capture_cb), NULL); - - actor = clutter_rectangle_new_with_color (&bcol); - clutter_actor_set_size (actor, 100, 100); - clutter_actor_set_position (actor, 400, 100); - - clutter_actor_set_reactive (actor, TRUE); - - clutter_container_add (CLUTTER_CONTAINER(stage), actor, NULL); - - g_signal_connect (actor, "event", G_CALLBACK (input_cb), "blue box"); - g_signal_connect (actor, "focus-in", G_CALLBACK (key_focus_in_cb), - focus_box); - /* Fullscreen */ - g_signal_connect (actor, "button-press-event", - G_CALLBACK (blue_button_cb), NULL); - - /* non reactive */ - actor = clutter_rectangle_new_with_color (&ncol); - clutter_actor_set_size (actor, 400, 50); - clutter_actor_set_position (actor, 100, 250); - - clutter_container_add (CLUTTER_CONTAINER(stage), actor, NULL); - - g_signal_connect (actor, "event", G_CALLBACK (input_cb), "blue box"); - g_signal_connect (actor, "focus-in", G_CALLBACK (key_focus_in_cb), - focus_box); - - g_signal_connect (stage, "focus-in", G_CALLBACK (key_focus_in_cb), - focus_box); - - /* non reactive group, with reactive child */ - actor = clutter_rectangle_new_with_color (&ycol); - clutter_actor_set_size (actor, 100, 100); - clutter_actor_set_reactive (actor, TRUE); - - g_signal_connect (actor, "event", G_CALLBACK (input_cb), "yellow box"); - - /* note group not reactive */ - group = clutter_group_new (); - clutter_container_add (CLUTTER_CONTAINER (group), actor, NULL); - clutter_container_add (CLUTTER_CONTAINER (stage), group, NULL); - clutter_actor_set_position (group, 100, 350); - clutter_actor_show_all (group); - - clutter_actor_show_all (CLUTTER_ACTOR (stage)); - - clutter_main(); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-fbo.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-fbo.c --- clutter-0.8.4/tests/test-fbo.c 2008-11-04 16:36:16.000000000 +0000 +++ clutter-0.9.0/tests/test-fbo.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,219 +0,0 @@ -#include "../config.h" - -/*#define TEST_GROUP */ - -/* These variables are used instead of the standard GLSL variables on - GLES 2 */ -#ifdef HAVE_COGL_GLES2 - -#define GLES2_VARS \ - "precision mediump float;\n" \ - "varying vec2 tex_coord;\n" \ - "varying vec4 frag_color;\n" -#define TEX_COORD "tex_coord" -#define COLOR_VAR "frag_color" - -#else /* HAVE_COGL_GLES2 */ - -#define GLES2_VARS "" -#define TEX_COORD "gl_TexCoord[0]" -#define COLOR_VAR "gl_Color" - -#endif /* HAVE_COGL_GLES2 */ - -#include - -#include -#include -#include - -ClutterActor* -make_source(void) -{ - ClutterActor *source, *actor; - GError *error = NULL; - - ClutterColor yellow = {0xff, 0xff, 0x00, 0xff}; - - source = clutter_group_new(); - actor = clutter_texture_new_from_file ("redhand.png", &error); - if (!actor) - g_error("pixbuf load failed: %s", error ? error->message : "Unknown"); - - clutter_group_add (source, actor); - - actor = clutter_label_new_with_text ("Sans Bold 50px", "Clutter"); - - clutter_label_set_color (CLUTTER_LABEL (actor), &yellow); - clutter_actor_set_y (actor, clutter_actor_get_height(source) + 5); - clutter_group_add (source, actor); - - return source; -} - -ClutterShader* -make_shader(void) -{ - ClutterShader *shader; - GError *error = NULL; - - shader = clutter_shader_new (); - clutter_shader_set_fragment_source (shader, - - GLES2_VARS - "uniform float radius ;" - "uniform sampler2D rectTexture;" - "uniform float x_step, y_step;" - "" - "void main()" - "{" - " vec4 color = texture2D(rectTexture, " TEX_COORD ".st);" - " float u;" - " float v;" - " int count = 1;" - " for (u=-radius;umessage); - g_error_free (error); - } - - return shader; -} - -gint -main (gint argc, - gchar *argv[]) -{ - ClutterColor blue = {0x33, 0x44, 0x55, 0xff}; - - ClutterActor *fbo; - ClutterActor *onscreen_source, *offscreen_source, *trans_source; - ClutterActor *foo_source; - ClutterActor *stage; - ClutterActor *clone; - ClutterShader *shader; - gint padx, pady; - gint fbo_width, fbo_height; - - clutter_init (&argc, &argv); - - if (clutter_feature_available (CLUTTER_FEATURE_OFFSCREEN) == FALSE) - g_error("This test requires CLUTTER_FEATURE_OFFSCREEN"); - - stage = clutter_stage_get_default (); - clutter_stage_set_color (CLUTTER_STAGE (stage), &blue); - - /* Create the first source */ - onscreen_source = make_source(); - clutter_actor_show_all (onscreen_source); - clutter_group_add (stage, onscreen_source); - - /* Basic sizing for alignment */ - fbo_width = clutter_actor_get_width (onscreen_source); - fbo_height = clutter_actor_get_height (onscreen_source); - padx = fbo_width + 10; - pady = fbo_height + 10; - clutter_actor_set_size (stage, padx*4, pady*2); - - /* Second hand from fbo onscreen */ - if ((fbo = clutter_texture_new_from_actor (onscreen_source)) == NULL) - g_error("onscreen fbo creation failed"); - - clutter_actor_set_position (fbo, padx, 0); - clutter_group_add (stage, fbo); - - /* apply a shader to it */ - shader = make_shader(); - clutter_actor_set_shader (fbo, shader); - clutter_actor_set_shader_param (fbo, "radius", 2.0); - clutter_actor_set_shader_param (fbo, "x_step", - 1.0f / clutter_util_next_p2 (fbo_width)); - clutter_actor_set_shader_param (fbo, "y_step", - 1.0f / clutter_util_next_p2 (fbo_height)); - - /* Third from cloning the fbo texture */ - clone = clutter_clone_texture_new (CLUTTER_TEXTURE(fbo)); - clutter_container_add_actor (CLUTTER_CONTAINER (stage), clone); - clutter_actor_set_position (clone, padx*2, 0); - - - /* Forth - an offscreen source */ - offscreen_source = make_source(); - clutter_actor_show_all (offscreen_source); /* need to show() offscreen */ - if ((fbo = clutter_texture_new_from_actor (offscreen_source)) == NULL) - g_error("offscreen fbo creation failed"); - - clutter_actor_set_position (fbo, padx*3, 0); - clutter_group_add (stage, fbo); - - - /* 5th transformed */ - trans_source = make_source(); - clutter_actor_show_all (trans_source); /* need to show() offscreen */ - - clutter_actor_set_scale (trans_source, 2.5, 2.5); - - if ((fbo = clutter_texture_new_from_actor (trans_source)) == NULL) - g_error("transformed fbo creation failed"); - - clutter_actor_set_position (fbo, 0, pady); - clutter_group_add (stage, fbo); - - - /* 6th resized bigger, but after fbo creation */ - trans_source = make_source(); - clutter_actor_show_all (trans_source); /* need to show() offscreen */ - - if ((fbo = clutter_texture_new_from_actor (trans_source)) == NULL) - g_error("transformed fbo creation failed"); - - /* rotate after */ - clutter_actor_move_anchor_point_from_gravity (trans_source, - CLUTTER_GRAVITY_CENTER); - clutter_actor_set_rotation (trans_source, CLUTTER_Z_AXIS, 90.0, 0, 0, 0); - - clutter_actor_set_position (fbo, padx, pady); - clutter_group_add (stage, fbo); - - - /* non visual breaks */ - foo_source = make_source(); - g_object_ref_sink (foo_source); - - clutter_actor_show_all (foo_source); - if ((fbo = clutter_texture_new_from_actor (foo_source)) == NULL) - g_error("foo fbo creation failed"); - - g_object_unref (foo_source); /* fbo should keep it around */ - - clutter_actor_set_position (fbo, padx*3, pady); - clutter_group_add (stage, fbo); - - /* TODO: - * Check realize/unrealize - * get_pixbuf() - * set_rgba on fbo texture. - */ - - clutter_actor_show_all (stage); - clutter_main (); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-fullscreen.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-fullscreen.c --- clutter-0.8.4/tests/test-fullscreen.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-fullscreen.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,97 +0,0 @@ -#include -#include - -enum -{ - START, - HIDE, - SHOW, - DONE -}; - -static int state = START; - -static void -on_fullscreen (ClutterStage *stage) -{ - g_debug ("fullscreen set, size: %dx%d, mapped: %s", - clutter_actor_get_width (CLUTTER_ACTOR (stage)), - clutter_actor_get_height (CLUTTER_ACTOR (stage)), - CLUTTER_ACTOR_IS_MAPPED (stage) ? "true" : "false"); -} - -static void -on_unfullscreen (ClutterStage *stage) -{ - g_debug ("fullscreen unset, size: %dx%d, mapped: %s", - clutter_actor_get_width (CLUTTER_ACTOR (stage)), - clutter_actor_get_height (CLUTTER_ACTOR (stage)), - CLUTTER_ACTOR_IS_MAPPED (stage) ? "true" : "false"); -} - -static gboolean -toggle_fullscreen (gpointer dummy) -{ - ClutterActor *stage = clutter_stage_get_default (); - gboolean is_fullscreen = FALSE; - - g_object_get (G_OBJECT (stage), "fullscreen", &is_fullscreen, NULL); - - switch (state) - { - case START: - g_debug ("start: is_fullscreen := %s", is_fullscreen ? "true" : "false"); - clutter_actor_hide (stage); - state = HIDE; - return TRUE; - - case HIDE: - g_debug ("hide: is_fullscreen := %s", is_fullscreen ? "true" : "false"); - clutter_actor_show (stage); - state = SHOW; - return TRUE; - - case SHOW: - g_debug ("show: is_fullscreen := %s", is_fullscreen ? "true" : "false"); - clutter_stage_unfullscreen (CLUTTER_STAGE (stage)); - state = DONE; - return TRUE; - - case DONE: - g_debug ("done: is_fullscreen := %s", is_fullscreen ? "true" : "false"); - clutter_main_quit (); - break; - } - - return FALSE; -} - -int -main (int argc, char *argv[]) -{ - ClutterActor *stage; - - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - g_signal_connect (stage, - "fullscreen", G_CALLBACK (on_fullscreen), - NULL); - g_signal_connect (stage, - "unfullscreen", G_CALLBACK (on_unfullscreen), - NULL); - - clutter_stage_fullscreen (CLUTTER_STAGE (stage)); - clutter_actor_show (stage); - - g_debug ("stage size: %dx%d, mapped: %s", - clutter_actor_get_width (stage), - clutter_actor_get_height (stage), - CLUTTER_ACTOR_IS_MAPPED (stage) ? "true" : "false"); - - g_timeout_add (1000, toggle_fullscreen, NULL); - - clutter_main (); - - return EXIT_SUCCESS; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-grab.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-grab.c --- clutter-0.8.4/tests/test-grab.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-grab.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,235 +0,0 @@ -#include - -static void -stage_state_cb (ClutterStage *stage, - gpointer data) -{ - gchar *detail = (gchar*)data; - - printf("[stage signal] %s\n", detail); -} - -static gboolean -debug_event_cb (ClutterActor *actor, - ClutterEvent *event, - gpointer data) -{ - gchar keybuf[9], *source = (gchar*)data; - int len = 0; - - switch (event->type) - { - case CLUTTER_KEY_PRESS: - len = g_unichar_to_utf8 (clutter_keysym_to_unicode (event->key.keyval), - keybuf); - keybuf[len] = '\0'; - printf ("[%s] KEY PRESS '%s'", source, keybuf); - break; - case CLUTTER_KEY_RELEASE: - len = g_unichar_to_utf8 (clutter_keysym_to_unicode (event->key.keyval), - keybuf); - keybuf[len] = '\0'; - printf ("[%s] KEY RELEASE '%s'", source, keybuf); - break; - case CLUTTER_MOTION: - printf("[%s] MOTION", source); - break; - case CLUTTER_ENTER: - printf("[%s] ENTER", source); - break; - case CLUTTER_LEAVE: - printf("[%s] LEAVE", source); - break; - case CLUTTER_BUTTON_PRESS: - printf("[%s] BUTTON PRESS (click count:%i)", - source, event->button.click_count); - break; - case CLUTTER_BUTTON_RELEASE: - printf("[%s] BUTTON RELEASE", source); - break; - case CLUTTER_SCROLL: - printf("[%s] BUTTON SCROLL", source); - break; - case CLUTTER_STAGE_STATE: - printf("[%s] STAGE STATE", source); - break; - case CLUTTER_DESTROY_NOTIFY: - printf("[%s] DESTROY NOTIFY", source); - break; - case CLUTTER_CLIENT_MESSAGE: - printf("[%s] CLIENT MESSAGE\n", source); - break; - case CLUTTER_DELETE: - printf("[%s] DELETE", source); - break; - case CLUTTER_NOTHING: - return FALSE; - } - - if (clutter_event_get_source (event) == actor) - printf(" *source*"); - - printf("\n"); - - return FALSE; -} - -static gboolean -grab_pointer_cb (ClutterActor *actor, - ClutterEvent *event, - gpointer data) -{ - clutter_grab_pointer (actor); - return FALSE; -} - -static gboolean -red_release_cb (ClutterActor *actor, - ClutterEvent *event, - gpointer data) -{ - clutter_ungrab_pointer (); - return FALSE; -} - -static gboolean -blue_release_cb (ClutterActor *actor, - ClutterEvent *event, - gpointer data) -{ - clutter_actor_destroy (actor); - return FALSE; -} - -static gboolean -green_press_cb (ClutterActor *actor, - ClutterEvent *event, - gpointer data) -{ - clutter_set_motion_events_enabled (!clutter_get_motion_events_enabled ()); - - g_print ("per actor motion events are now %s\n", - clutter_get_motion_events_enabled () ? "enabled" : "disabled"); - - return FALSE; -} - -static gboolean -toggle_grab_pointer_cb (ClutterActor *actor, - ClutterEvent *event, - gpointer data) -{ - /* we only deal with the event if the source is ourself */ - if (event->button.source == actor) - { - if (clutter_get_pointer_grab () != NULL) - clutter_ungrab_pointer (); - else - clutter_grab_pointer (actor); - } - return FALSE; -} - -static gboolean -cyan_press_cb (ClutterActor *actor, - ClutterEvent *event, - gpointer data) -{ - if (clutter_get_keyboard_grab () != NULL) - clutter_ungrab_keyboard (); - else - clutter_grab_keyboard (actor); - return FALSE; -} - - - -int -main (int argc, char *argv[]) -{ - ClutterActor *stage, *actor; - ClutterColor rcol = { 0xff, 0, 0, 0xff}, - bcol = { 0, 0, 0xff, 0xff }, - gcol = { 0, 0xff, 0, 0xff }, - ccol = { 0, 0xff, 0xff, 0xff }, - ycol = { 0xff, 0xff, 0, 0xff }; - - clutter_init (&argc, &argv); - - g_print ("Red box: aquire grab on press, releases it on next button release\n"); - g_print ("Blue box: aquire grab on press, destroys the blue box actor on release\n"); - g_print ("Yellow box: aquire grab on press, releases grab on next press on yellow box\n"); - g_print ("Green box: toggle per actor motion events.\n\n"); - g_print ("Cyan box: toggle grab (from cyan box) for keyboard events.\n\n"); - - stage = clutter_stage_get_default (); - g_signal_connect (stage, "event", G_CALLBACK (debug_event_cb), "stage"); - - g_signal_connect (stage, "fullscreen", - G_CALLBACK (stage_state_cb), "fullscreen"); - g_signal_connect (stage, "unfullscreen", - G_CALLBACK (stage_state_cb), "unfullscreen"); - g_signal_connect (stage, "activate", - G_CALLBACK (stage_state_cb), "activate"); - g_signal_connect (stage, "deactivate", - G_CALLBACK (stage_state_cb), "deactivate"); - - actor = clutter_rectangle_new_with_color (&rcol); - clutter_actor_set_size (actor, 100, 100); - clutter_actor_set_position (actor, 100, 100); - clutter_actor_set_reactive (actor, TRUE); - clutter_container_add (CLUTTER_CONTAINER (stage), actor, NULL); - g_signal_connect (actor, "event", G_CALLBACK (debug_event_cb), "red box"); - g_signal_connect (actor, "button-press-event", - G_CALLBACK (grab_pointer_cb), NULL); - g_signal_connect (actor, "button-release-event", - G_CALLBACK (red_release_cb), NULL); - - actor = clutter_rectangle_new_with_color (&ycol); - clutter_actor_set_size (actor, 100, 100); - clutter_actor_set_position (actor, 100, 300); - clutter_actor_set_reactive (actor, TRUE); - clutter_container_add (CLUTTER_CONTAINER (stage), actor, NULL); - g_signal_connect (actor, "event", G_CALLBACK (debug_event_cb), "yellow box"); - g_signal_connect (actor, "button-press-event", - G_CALLBACK (toggle_grab_pointer_cb), NULL); - - actor = clutter_rectangle_new_with_color (&bcol); - clutter_actor_set_size (actor, 100, 100); - clutter_actor_set_position (actor, 300, 100); - clutter_actor_set_reactive (actor, TRUE); - clutter_container_add (CLUTTER_CONTAINER (stage), actor, NULL); - g_signal_connect (actor, "event", - G_CALLBACK (debug_event_cb), "blue box"); - g_signal_connect (actor, "button-press-event", - G_CALLBACK (grab_pointer_cb), NULL); - g_signal_connect (actor, "button-release-event", - G_CALLBACK (blue_release_cb), NULL); - - actor = clutter_rectangle_new_with_color (&gcol); - clutter_actor_set_size (actor, 100, 100); - clutter_actor_set_position (actor, 300, 300); - clutter_actor_set_reactive (actor, TRUE); - clutter_container_add (CLUTTER_CONTAINER (stage), actor, NULL); - g_signal_connect (actor, "event", - G_CALLBACK (debug_event_cb), "green box"); - g_signal_connect (actor, "button-press-event", - G_CALLBACK (green_press_cb), NULL); - - - actor = clutter_rectangle_new_with_color (&ccol); - clutter_actor_set_size (actor, 100, 100); - clutter_actor_set_position (actor, 500, 100); - clutter_actor_set_reactive (actor, TRUE); - clutter_container_add (CLUTTER_CONTAINER (stage), actor, NULL); - g_signal_connect (actor, "event", - G_CALLBACK (debug_event_cb), "cyan box"); - g_signal_connect (actor, "button-press-event", - G_CALLBACK (cyan_press_cb), NULL); - - clutter_actor_show_all (CLUTTER_ACTOR (stage)); - - clutter_main(); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-invariants.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-invariants.c --- clutter-0.8.4/tests/test-invariants.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-invariants.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,188 +0,0 @@ -#include -#include - -#include - -/* dummy unit testing API; to be replaced by GTest in 1.0 */ -typedef void (* test_func) (void); - -typedef struct _TestUnit TestUnit; - -struct _TestUnit -{ - gchar *name; - test_func func; -}; - -static GSList *units = NULL; - -static void -test_init (gint *argc, - gchar ***argv) -{ - g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL); - - g_assert (clutter_init (argc, argv) == CLUTTER_INIT_SUCCESS); -} - -static void -test_add_func (const gchar *name, - test_func func) -{ - TestUnit *unit; - - unit = g_slice_new (TestUnit); - unit->name = g_strdup (name); - unit->func = func; - - units = g_slist_prepend (units, unit); -} - -static int -test_run (void) -{ - GSList *l; - - units = g_slist_reverse (units); - - for (l = units; l != NULL; l = l->next) - { - TestUnit *u = l->data; - GString *test_name = g_string_sized_new (75); - gsize len, i; - - g_string_append (test_name, "Testing: "); - g_string_append (test_name, u->name); - len = 75 - test_name->len; - - for (i = 0; i < len; i++) - g_string_append_c (test_name, '.'); - - g_print ("%s", test_name->str); - - u->func (); - - g_print ("OK\n"); - } - - for (l = units; l != NULL; l = l->next) - { - TestUnit *u = l->data; - - g_free (u->name); - g_slice_free (TestUnit, u); - } - - g_slist_free (units); - - return EXIT_SUCCESS; -} - -/* test units */ -static void -test_initial_state (void) -{ - ClutterActor *actor; - - actor = clutter_rectangle_new (); - - g_assert (!(CLUTTER_ACTOR_IS_REALIZED (actor))); - g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor))); - g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor))); - - clutter_actor_destroy (actor); -} - -static void -test_realized (void) -{ - ClutterActor *actor; - - actor = clutter_rectangle_new (); - - g_assert (!(CLUTTER_ACTOR_IS_REALIZED (actor))); - - clutter_actor_realize (actor); - - g_assert (CLUTTER_ACTOR_IS_REALIZED (actor)); - - g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor))); - g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor))); - - clutter_actor_destroy (actor); -} - - -static void -test_mapped (void) -{ - ClutterActor *actor; - - actor = clutter_rectangle_new (); - - g_assert (!(CLUTTER_ACTOR_IS_REALIZED (actor))); - g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor))); - - clutter_actor_show (actor); - - g_assert (CLUTTER_ACTOR_IS_REALIZED (actor)); - g_assert (CLUTTER_ACTOR_IS_MAPPED (actor)); - - g_assert (CLUTTER_ACTOR_IS_VISIBLE (actor)); - - clutter_actor_destroy (actor); -} - -static void -test_show_on_set_parent (void) -{ - ClutterActor *actor, *group; - gboolean show_on_set_parent; - - group = clutter_group_new (); - - g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (group))); - - actor = clutter_rectangle_new (); - g_object_get (G_OBJECT (actor), - "show-on-set-parent", &show_on_set_parent, - NULL); - - g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor))); - g_assert (show_on_set_parent == TRUE); - - clutter_group_add (group, actor); - g_object_get (G_OBJECT (actor), - "show-on-set-parent", &show_on_set_parent, - NULL); - - g_assert (CLUTTER_ACTOR_IS_VISIBLE (actor)); - g_assert (show_on_set_parent == TRUE); - - g_object_ref (actor); - clutter_actor_unparent (actor); - g_object_get (G_OBJECT (actor), - "show-on-set-parent", &show_on_set_parent, - NULL); - - g_assert (CLUTTER_ACTOR_IS_REALIZED (actor)); - g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor))); - g_assert (show_on_set_parent == TRUE); - - clutter_actor_destroy (actor); - clutter_actor_destroy (group); -} - -int -main (int argc, - char *argv[]) -{ - test_init (&argc, &argv); - - test_add_func ("/invariants/initial-state", test_initial_state); - test_add_func ("/invariants/realized", test_realized); - test_add_func ("/invariants/mapped", test_mapped); - test_add_func ("/invariants/show-on-set-parent", test_show_on_set_parent); - - return test_run (); -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-label-cache.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-label-cache.c --- clutter-0.8.4/tests/test-label-cache.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-label-cache.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,257 +0,0 @@ -#include -#include - -#define TEST_FONT "Sans 10" - -static const char long_text[] = - "This is some REALLY " - "long text that contains markup for testing the use_markup " - "property and to test word-wrapping, justification and alignment."; - -typedef struct _CallbackData CallbackData; - -struct _CallbackData -{ - ClutterActor *stage; - ClutterActor *label; - - PangoLayout *old_layout; - gboolean layout_changed; - PangoRectangle label_extents; - - PangoLayout *test_layout; - - gboolean test_failed; -}; - -static void -on_paint (ClutterActor *label, CallbackData *data) -{ - PangoLayout *new_layout; - - /* Check whether the layout used for this paint is different from - the layout used for the last paint */ - new_layout = clutter_label_get_layout (CLUTTER_LABEL (data->label)); - data->layout_changed = data->old_layout != new_layout; - - if (data->old_layout) - g_object_unref (data->old_layout); - /* Keep a reference to the old layout so we can be sure it won't - just reallocate a new layout with the same address */ - data->old_layout = g_object_ref (new_layout); - - pango_layout_get_extents (new_layout, NULL, &data->label_extents); -} - -static void -force_redraw (CallbackData *data) -{ - clutter_redraw (CLUTTER_STAGE (clutter_actor_get_stage (data->label))); -} - -static gboolean -check_result (CallbackData *data, const char *note, - gboolean layout_should_change) -{ - PangoRectangle test_extents; - gboolean fail = FALSE; - - printf ("%s: ", note); - - /* Force a redraw to get the on_paint handler to run */ - force_redraw (data); - - /* Compare the extents from the label with the extents from our test - layout */ - pango_layout_get_extents (data->test_layout, NULL, &test_extents); - if (memcmp (&test_extents, &data->label_extents, sizeof (PangoRectangle))) - { - printf ("extents are different, "); - fail = TRUE; - } - else - printf ("extents are the same, "); - - if (data->layout_changed) - printf ("layout changed, "); - else - printf ("layout did not change, "); - - if (data->layout_changed != layout_should_change) - fail = TRUE; - - if (fail) - { - printf ("FAIL\n"); - data->test_failed = TRUE; - } - else - printf ("pass\n"); - - return fail; -} - -static gboolean -do_tests (CallbackData *data) -{ - PangoFontDescription *fd; - static const ClutterColor red = { 0xff, 0x00, 0x00, 0xff }; - PangoAttrList *attr_list, *attr_list_copy; - PangoAttribute *attr; - - /* TEST 1: change the text */ - clutter_label_set_text (CLUTTER_LABEL (data->label), "Counter 0"); - pango_layout_set_text (data->test_layout, "Counter 0", -1); - check_result (data, "Change text", TRUE); - - /* TEST 2: change a single character */ - clutter_label_set_text (CLUTTER_LABEL (data->label), "Counter 1"); - pango_layout_set_text (data->test_layout, "Counter 1", -1); - check_result (data, "Change a single character", TRUE); - - /* TEST 3: move the label */ - clutter_actor_set_position (data->label, 10, 0); - check_result (data, "Move the label", FALSE); - - /* TEST 4: change the font */ - clutter_label_set_font_name (CLUTTER_LABEL (data->label), "Serif 15"); - fd = pango_font_description_from_string ("Serif 15"); - pango_layout_set_font_description (data->test_layout, fd); - pango_font_description_free (fd); - check_result (data, "Change the font", TRUE); - - /* TEST 5: change the color */ - clutter_label_set_color (CLUTTER_LABEL (data->label), &red); - check_result (data, "Change the color", FALSE); - - /* TEST 6: change the attributes */ - attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD); - attr->start_index = 0; - attr->end_index = 2; - attr_list = pango_attr_list_new (); - pango_attr_list_insert (attr_list, attr); - attr_list_copy = pango_attr_list_copy (attr_list); - clutter_label_set_attributes (CLUTTER_LABEL (data->label), attr_list); - pango_layout_set_attributes (data->test_layout, attr_list_copy); - pango_attr_list_unref (attr_list_copy); - pango_attr_list_unref (attr_list); - check_result (data, "Change the attributes", TRUE); - - /* TEST 7: change the text again */ - clutter_label_set_attributes (CLUTTER_LABEL (data->label), NULL); - clutter_label_set_text (CLUTTER_LABEL (data->label), long_text); - pango_layout_set_attributes (data->test_layout, NULL); - pango_layout_set_text (data->test_layout, long_text, -1); - check_result (data, "Change the text again", TRUE); - - /* TEST 8: enable markup */ - clutter_label_set_use_markup (CLUTTER_LABEL (data->label), TRUE); - pango_layout_set_markup (data->test_layout, long_text, -1); - check_result (data, "Enable markup", TRUE); - - /* This part can't be a test because Clutter won't restrict the - width if wrapping and ellipsizing is disabled so the extents will - be different, but we still want to do it for the later tests */ - clutter_actor_set_width (data->label, 200); - pango_layout_set_width (data->test_layout, 200 * PANGO_SCALE); - /* Force a redraw so that changing the width won't affect the - results */ - force_redraw (data); - - /* TEST 9: enable ellipsize */ - clutter_label_set_ellipsize (CLUTTER_LABEL (data->label), - PANGO_ELLIPSIZE_END); - pango_layout_set_ellipsize (data->test_layout, PANGO_ELLIPSIZE_END); - check_result (data, "Enable ellipsize", TRUE); - clutter_label_set_ellipsize (CLUTTER_LABEL (data->label), - PANGO_ELLIPSIZE_NONE); - pango_layout_set_ellipsize (data->test_layout, PANGO_ELLIPSIZE_NONE); - force_redraw (data); - - /* TEST 10: enable line wrap */ - clutter_label_set_line_wrap (CLUTTER_LABEL (data->label), TRUE); - pango_layout_set_wrap (data->test_layout, PANGO_WRAP_WORD); - check_result (data, "Enable line wrap", TRUE); - - /* TEST 11: change wrap mode */ - clutter_label_set_line_wrap_mode (CLUTTER_LABEL (data->label), - PANGO_WRAP_CHAR); - pango_layout_set_wrap (data->test_layout, PANGO_WRAP_CHAR); - check_result (data, "Change wrap mode", TRUE); - - /* TEST 12: enable justify */ - clutter_label_set_justify (CLUTTER_LABEL (data->label), TRUE); - pango_layout_set_justify (data->test_layout, TRUE); - /* Pango appears to have a bug which means that you can't change the - justification after setting the text but this fixes it. - See http://bugzilla.gnome.org/show_bug.cgi?id=551865 */ - pango_layout_context_changed (data->test_layout); - check_result (data, "Enable justify", TRUE); - - /* TEST 13: change alignment */ - clutter_label_set_alignment (CLUTTER_LABEL (data->label), PANGO_ALIGN_RIGHT); - pango_layout_set_alignment (data->test_layout, PANGO_ALIGN_RIGHT); - check_result (data, "Change alignment", TRUE); - - clutter_main_quit (); - - return FALSE; -} - -static PangoLayout * -make_layout_like_label (ClutterLabel *label) -{ - PangoLayout *label_layout, *new_layout; - PangoContext *context; - PangoFontDescription *fd; - - /* Make another layout using the same context as the layout from the - label */ - label_layout = clutter_label_get_layout (label); - context = pango_layout_get_context (label_layout); - new_layout = pango_layout_new (context); - fd = pango_font_description_from_string (TEST_FONT); - pango_layout_set_font_description (new_layout, fd); - pango_font_description_free (fd); - - return new_layout; -} - -int -main (int argc, char **argv) -{ - CallbackData data; - int ret = 0; - - memset (&data, 0, sizeof (data)); - - clutter_init (&argc, &argv); - - data.stage = clutter_stage_get_default (); - - data.label = clutter_label_new_with_text (TEST_FONT, ""); - - data.test_layout = make_layout_like_label (CLUTTER_LABEL (data.label)); - - g_signal_connect (data.label, "paint", G_CALLBACK (on_paint), &data); - - clutter_container_add (CLUTTER_CONTAINER (data.stage), data.label, NULL); - - clutter_actor_show (data.stage); - - clutter_threads_add_idle ((GSourceFunc) do_tests, &data); - - clutter_main (); - - printf ("\nOverall result: "); - - if (data.test_failed) - { - printf ("FAIL\n"); - ret = 1; - } - else - printf ("pass\n"); - - return ret; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-layout.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-layout.c --- clutter-0.8.4/tests/test-layout.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-layout.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,818 +0,0 @@ -#include -#include - -#include -#include - -/* layout actor, by Lucas Rocha */ - -#define MY_TYPE_THING (my_thing_get_type ()) -#define MY_THING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MY_TYPE_THING, MyThing)) -#define MY_IS_THING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MY_TYPE_THING)) -#define MY_THING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MY_TYPE_THING, MyThingClass)) -#define MY_IS_THING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MY_TYPE_THING)) -#define MY_THING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MY_TYPE_THING, MyThingClass)) - -typedef struct _MyThing MyThing; -typedef struct _MyThingPrivate MyThingPrivate; -typedef struct _MyThingClass MyThingClass; - -struct _MyThing -{ - ClutterActor parent_instance; - - MyThingPrivate *priv; -}; - -struct _MyThingClass -{ - ClutterActorClass parent_class; -}; - -enum -{ - PROP_0, - - PROP_SPACING, - PROP_PADDING, - PROP_USE_TRANSFORMED_BOX -}; - -static void clutter_container_iface_init (ClutterContainerIface *iface); - -G_DEFINE_TYPE_WITH_CODE (MyThing, - my_thing, - CLUTTER_TYPE_ACTOR, - G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_CONTAINER, - clutter_container_iface_init)); - -#define MY_THING_GET_PRIVATE(obj) \ -(G_TYPE_INSTANCE_GET_PRIVATE ((obj), MY_TYPE_THING, MyThingPrivate)) - -struct _MyThingPrivate -{ - GList *children; - - ClutterUnit spacing; - ClutterUnit padding; - - guint use_transformed_box : 1; -}; - -/* Add, remove, foreach, copied from ClutterGroup code. */ - -static void -my_thing_real_add (ClutterContainer *container, - ClutterActor *actor) -{ - MyThing *group = MY_THING (container); - MyThingPrivate *priv = group->priv; - - g_object_ref (actor); - - priv->children = g_list_append (priv->children, actor); - clutter_actor_set_parent (actor, CLUTTER_ACTOR (group)); - - g_signal_emit_by_name (container, "actor-added", actor); - - /* queue relayout to allocate new item */ - clutter_actor_queue_relayout (CLUTTER_ACTOR (group)); - - g_object_unref (actor); -} - -static void -my_thing_real_remove (ClutterContainer *container, - ClutterActor *actor) -{ - MyThing *group = MY_THING (container); - MyThingPrivate *priv = group->priv; - - g_object_ref (actor); - - priv->children = g_list_remove (priv->children, actor); - clutter_actor_unparent (actor); - - /* At this point, the actor passed to the "actor-removed" signal - * handlers is not parented anymore to the container but since we - * are holding a reference on it, it's still valid - */ - g_signal_emit_by_name (container, "actor-removed", actor); - - /* queue relayout to re-allocate children without the - removed item */ - clutter_actor_queue_relayout (CLUTTER_ACTOR (group)); - - g_object_unref (actor); -} - -static void -my_thing_real_foreach (ClutterContainer *container, - ClutterCallback callback, - gpointer user_data) -{ - MyThingPrivate *priv = MY_THING (container)->priv; - GList *l; - - for (l = priv->children; l; l = l->next) - (* callback) (CLUTTER_ACTOR (l->data), user_data); -} - -static void -clutter_container_iface_init (ClutterContainerIface *iface) -{ - iface->add = my_thing_real_add; - iface->remove = my_thing_real_remove; - iface->foreach = my_thing_real_foreach; -} - -static void -my_thing_set_property (GObject *gobject, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - MyThingPrivate *priv = MY_THING (gobject)->priv; - gboolean needs_relayout = TRUE; - - switch (prop_id) - { - case PROP_SPACING: - priv->spacing = clutter_value_get_unit (value); - break; - - case PROP_PADDING: - priv->padding = clutter_value_get_unit (value); - break; - - case PROP_USE_TRANSFORMED_BOX: - priv->use_transformed_box = g_value_get_boolean (value); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - needs_relayout = FALSE; - break; - } - - /* setting spacing or padding queues a relayout - because they are supposed to change the internal - allocation of children */ - if (needs_relayout) - clutter_actor_queue_relayout (CLUTTER_ACTOR (gobject)); -} - -static void -my_thing_get_property (GObject *gobject, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - MyThingPrivate *priv = MY_THING (gobject)->priv; - - switch (prop_id) - { - case PROP_SPACING: - clutter_value_set_unit (value, priv->spacing); - break; - - case PROP_PADDING: - clutter_value_set_unit (value, priv->padding); - break; - - case PROP_USE_TRANSFORMED_BOX: - g_value_set_boolean (value, priv->use_transformed_box); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); - break; - } -} - -static void -my_thing_finalize (GObject *gobject) -{ - G_OBJECT_CLASS (my_thing_parent_class)->finalize (gobject); -} - -static void -my_thing_dispose (GObject *gobject) -{ - MyThing *self = MY_THING (gobject); - MyThingPrivate *priv = self->priv; - - if (priv->children) - { - g_list_foreach (priv->children, (GFunc) clutter_actor_destroy, NULL); - priv->children = NULL; - } - - G_OBJECT_CLASS (my_thing_parent_class)->dispose (gobject); -} - -static void -my_thing_get_preferred_width (ClutterActor *self, - ClutterUnit for_height, - ClutterUnit *min_width_p, - ClutterUnit *natural_width_p) -{ - MyThingPrivate *priv; - GList *l; - ClutterUnit min_left, min_right; - ClutterUnit natural_left, natural_right; - - priv = MY_THING (self)->priv; - - min_left = 0; - min_right = 0; - natural_left = 0; - natural_right = 0; - - for (l = priv->children; l != NULL; l = l->next) - { - ClutterActor *child; - ClutterUnit child_x, child_min, child_natural; - - child = l->data; - - child_x = clutter_actor_get_xu (child); - - clutter_actor_get_preferred_size (child, - &child_min, NULL, - &child_natural, NULL); - - if (l == priv->children) - { - /* First child */ - min_left = child_x; - natural_left = child_x; - min_right = min_left + child_min; - natural_right = natural_left + child_natural; - } - else - { - /* Union of extents with previous children */ - if (child_x < min_left) - min_left = child_x; - - if (child_x < natural_left) - natural_left = child_x; - - if (child_x + child_min > min_right) - min_right = child_x + child_min; - - if (child_x + child_natural > natural_right) - natural_right = child_x + child_natural; - } - } - - if (min_left < 0) - min_left = 0; - - if (natural_left < 0) - natural_left = 0; - - if (min_right < 0) - min_right = 0; - - if (natural_right < 0) - natural_right = 0; - - g_assert (min_right >= min_left); - g_assert (natural_right >= natural_left); - - if (min_width_p) - *min_width_p = min_right - min_left; - - if (natural_width_p) - *natural_width_p = natural_right - min_left; -} - -static void -my_thing_get_preferred_height (ClutterActor *self, - ClutterUnit for_width, - ClutterUnit *min_height_p, - ClutterUnit *natural_height_p) -{ - MyThingPrivate *priv; - GList *l; - ClutterUnit min_top, min_bottom; - ClutterUnit natural_top, natural_bottom; - - priv = MY_THING (self)->priv; - - min_top = 0; - min_bottom = 0; - natural_top = 0; - natural_bottom = 0; - - for (l = priv->children; l != NULL; l = l->next) - { - ClutterActor *child; - ClutterUnit child_y, child_min, child_natural; - - child = l->data; - - child_y = clutter_actor_get_yu (child); - - clutter_actor_get_preferred_size (child, - NULL, &child_min, - NULL, &child_natural); - - if (l == priv->children) - { - /* First child */ - min_top = child_y; - natural_top = child_y; - min_bottom = min_top + child_min; - natural_bottom = natural_top + child_natural; - } - else - { - /* Union of extents with previous children */ - if (child_y < min_top) - min_top = child_y; - - if (child_y < natural_top) - natural_top = child_y; - - if (child_y + child_min > min_bottom) - min_bottom = child_y + child_min; - - if (child_y + child_natural > natural_bottom) - natural_bottom = child_y + child_natural; - } - } - - if (min_top < 0) - min_top = 0; - - if (natural_top < 0) - natural_top = 0; - - if (min_bottom < 0) - min_bottom = 0; - - if (natural_bottom < 0) - natural_bottom = 0; - - g_assert (min_bottom >= min_top); - g_assert (natural_bottom >= natural_top); - - if (min_height_p) - *min_height_p = min_bottom - min_top; - - if (natural_height_p) - *natural_height_p = natural_bottom - min_top; -} - -static void -my_thing_allocate (ClutterActor *self, - const ClutterActorBox *box, - gboolean origin_changed) -{ - MyThingPrivate *priv; - ClutterUnit current_x, current_y, max_row_height; - GList *l; - - /* chain up to set actor->allocation */ - CLUTTER_ACTOR_CLASS (my_thing_parent_class)->allocate (self, box, - origin_changed); - - priv = MY_THING (self)->priv; - - current_x = priv->padding; - current_y = priv->padding; - max_row_height = 0; - - /* The allocation logic here is to horizontally place children - * side-by-side and reflow into a new row when we run out of - * space - */ - for (l = priv->children; l != NULL; l = l->next) - { - ClutterActor *child; - ClutterUnit natural_width, natural_height; - ClutterActorBox child_box; - - child = l->data; - - clutter_actor_get_preferred_size (child, - NULL, NULL, - &natural_width, &natural_height); - - /* if it fits in the current row, keep it there; otherwise - * reflow into another row - */ - if (current_x + natural_width > box->x2 - box->x1 - priv->padding) - { - current_x = priv->padding; - current_y += max_row_height + priv->spacing; - max_row_height = 0; - } - - child_box.x1 = current_x; - child_box.y1 = current_y; - child_box.x2 = child_box.x1 + natural_width; - child_box.y2 = child_box.y1 + natural_height; - - clutter_actor_allocate (child, &child_box, origin_changed); - - /* if we take into account the transformation of the children - * then we first check if it's transformed; then we get the - * onscreen coordinates of the two points of the bounding box - * of the actor (origin(x, y) and (origin + size)(x,y)) and - * we update the coordinates and area given to the next child - */ - if (priv->use_transformed_box) - { - if (clutter_actor_is_scaled (child) || - clutter_actor_is_rotated (child)) - { - ClutterVertex v1 = { 0, }, v2 = { 0, }; - ClutterActorBox transformed_box = { 0, }; - - /* origin */ - if (!origin_changed) - { - v1.x = 0; - v1.y = 0; - } - else - { - v1.x = box->x1; - v1.y = box->y1; - } - - clutter_actor_apply_transform_to_point (child, &v1, &v2); - transformed_box.x1 = v2.x; - transformed_box.y1 = v2.y; - - /* size */ - v1.x = natural_width; - v1.y = natural_height; - clutter_actor_apply_transform_to_point (child, &v1, &v2); - transformed_box.x2 = v2.x; - transformed_box.y2 = v2.y; - - natural_width = transformed_box.x2 - transformed_box.x1; - natural_height = transformed_box.y2 - transformed_box.y1; - } - } - - /* Record the maximum child height on current row to know - * what's the increment that should be used for the next - * row - */ - if (natural_height > max_row_height) - max_row_height = natural_height; - - current_x += natural_width + priv->spacing; - } -} - -static void -my_thing_paint (ClutterActor *actor) -{ - MyThing *self = MY_THING (actor); - GList *c; - - cogl_push_matrix(); - - /* paint all visible children */ - for (c = self->priv->children; - c != NULL; - c = c->next) - { - ClutterActor *child = c->data; - - g_assert (child != NULL); - - if (CLUTTER_ACTOR_IS_VISIBLE (child)) - clutter_actor_paint (child); - } - - cogl_pop_matrix(); -} - -#define MIN_SIZE 24 -#define MAX_SIZE 64 - -static void -my_thing_class_init (MyThingClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); - - gobject_class->set_property = my_thing_set_property; - gobject_class->get_property = my_thing_get_property; - gobject_class->dispose = my_thing_dispose; - gobject_class->finalize = my_thing_finalize; - - actor_class->get_preferred_width = my_thing_get_preferred_width; - actor_class->get_preferred_height = my_thing_get_preferred_height; - actor_class->allocate = my_thing_allocate; - actor_class->paint = my_thing_paint; - - g_object_class_install_property (gobject_class, - PROP_SPACING, - clutter_param_spec_unit ("spacing", - "Spacing", - "Spacing of the thing", - 0, CLUTTER_MAXUNIT, - 0, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, - PROP_PADDING, - clutter_param_spec_unit ("padding", - "Padding", - "Padding around the thing", - 0, CLUTTER_MAXUNIT, - 0, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, - PROP_USE_TRANSFORMED_BOX, - g_param_spec_boolean ("use-transformed-box", - "Use Transformed Box", - "Use transformed box when allocating", - FALSE, - G_PARAM_READWRITE)); - - g_type_class_add_private (klass, sizeof (MyThingPrivate)); -} - -static void -my_thing_init (MyThing *thing) -{ - thing->priv = MY_THING_GET_PRIVATE (thing); -} - -ClutterActor * -my_thing_new (gint padding, - gint spacing) -{ - return g_object_new (MY_TYPE_THING, - "padding", CLUTTER_UNITS_FROM_DEVICE (padding), - "spacing", CLUTTER_UNITS_FROM_DEVICE (spacing), - NULL); - -} - -/* test code */ - -static ClutterActor *box = NULL; -static ClutterActor *icon = NULL; -static ClutterTimeline *main_timeline = NULL; -static ClutterBehaviour *behaviour = NULL; - -static ClutterColor bg_color; - -static void -toggle_property_value (ClutterActor *actor, - const gchar *property_name) -{ - gboolean value; - - g_object_get (G_OBJECT (actor), - property_name, &value, - NULL); - - value = !value; - - g_object_set (G_OBJECT (box), - property_name, value, - NULL); -} - -static void -increase_property_value (ClutterActor *actor, - const char *property_name) -{ - ClutterUnit value; - - g_object_get (G_OBJECT (actor), - property_name, &value, - NULL); - - value = value + CLUTTER_UNITS_FROM_DEVICE (10); - - g_object_set (G_OBJECT (box), - property_name, value, - NULL); -} - -static void -decrease_property_value (ClutterActor *actor, - const char *property_name) -{ - ClutterUnit value; - - g_object_get (G_OBJECT (actor), - property_name, &value, - NULL); - - value = MAX (0, value - CLUTTER_UNITS_FROM_DEVICE (10)); - - g_object_set (G_OBJECT (box), - property_name, value, - NULL); -} - -static ClutterActor * -create_item (void) -{ - ClutterActor *clone = - clutter_clone_texture_new (CLUTTER_TEXTURE (icon)); - - gint32 size = g_random_int_range (MIN_SIZE, MAX_SIZE); - - clutter_actor_set_size (clone, size, size); - - clutter_behaviour_apply (behaviour, clone); - - return clone; -} - -static gboolean -keypress_cb (ClutterActor *actor, - ClutterKeyEvent *event, - gpointer data) -{ - switch (clutter_key_event_symbol (event)) - { - case CLUTTER_q: - { - clutter_main_quit (); - } - - case CLUTTER_a: - { - if (icon != NULL) - { - ClutterActor *clone = create_item (); - - /* Add one item to container */ - clutter_container_add_actor (CLUTTER_CONTAINER (box), clone); - } - break; - } - - case CLUTTER_d: - { - GList *children = - clutter_container_get_children (CLUTTER_CONTAINER (box)); - - if (children) - { - GList *last = g_list_last (children); - - /* Remove last item on container */ - clutter_container_remove_actor (CLUTTER_CONTAINER (box), - CLUTTER_ACTOR (last->data)); - } - break; - } - - case CLUTTER_w: - { - decrease_property_value (box, "padding"); - break; - } - - case CLUTTER_e: - { - increase_property_value (box, "padding"); - break; - } - - case CLUTTER_r: - { - decrease_property_value (box, "spacing"); - break; - } - - case CLUTTER_s: - { - toggle_property_value (box, "use-transformed-box"); - break; - } - - case CLUTTER_t: - { - increase_property_value (box, "spacing"); - break; - } - - case CLUTTER_z: - { - if (clutter_timeline_is_playing (main_timeline)) - clutter_timeline_pause (main_timeline); - else - clutter_timeline_start (main_timeline); - - break; - } - - default: - break; - } - - return FALSE; -} - -static void -relayout_on_frame (ClutterTimeline *timeline) -{ - gboolean use_transformed_box; - - /* if we care about transformations updating the layout, we need to inform - * the layout that a transformation is happening; this is either done by - * attaching a notification on the transformation properties or by simply - * queuing a relayout on each frame of the timeline used to drive the - * behaviour. for simplicity's sake, we used the latter - */ - - g_object_get (G_OBJECT (box), - "use-transformed-box", &use_transformed_box, - NULL); - - if (use_transformed_box) - clutter_actor_queue_relayout (box); -} - -int -main (int argc, - char *argv[]) -{ - ClutterActor *stage, *instructions; - gint i; - GError *error = NULL; - - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - clutter_actor_set_size (stage, 800, 600); - - clutter_color_parse ("Red", &bg_color); - - main_timeline = clutter_timeline_new_for_duration (2000); - clutter_timeline_set_loop (main_timeline, TRUE); - g_signal_connect (main_timeline, "new-frame", - G_CALLBACK (relayout_on_frame), - NULL); - - behaviour = clutter_behaviour_scale_new (clutter_alpha_new_full (main_timeline, - CLUTTER_ALPHA_SINE, - NULL, NULL), - 1.0, 1.0, 2.0, 2.0); - - box = my_thing_new (10, 10); - - clutter_actor_set_position (box, 20, 20); - clutter_actor_set_size (box, 350, -1); - - icon = clutter_texture_new_from_file ("redhand.png", &error); - if (error) - g_error ("Unable to load 'redhand.png': %s", error->message); - - for (i = 0; i < 33; i++) - { - ClutterActor *clone = create_item (); - - clutter_container_add_actor (CLUTTER_CONTAINER (box), clone); - } - - clutter_container_add_actor (CLUTTER_CONTAINER (stage), box); - - instructions = clutter_label_new_with_text ("Sans 14", - "Instructions:\n" - "a - add a new item\n" - "d - remove last item\n" - "z - start/pause behaviour\n" - "w - decrease padding\n" - "e - increase padding\n" - "r - decrease spacing\n" - "t - increase spacing\n" - "s - use transformed box\n" - "q - quit"); - - clutter_label_set_use_markup (CLUTTER_LABEL (instructions), TRUE); - clutter_actor_set_position (instructions, 450, 10); - clutter_container_add_actor (CLUTTER_CONTAINER (stage), instructions); - - g_signal_connect (stage, "key-release-event", - G_CALLBACK (keypress_cb), - NULL); - - clutter_actor_show (stage); - - clutter_main (); - - g_object_unref (main_timeline); - g_object_unref (behaviour); - - return EXIT_SUCCESS; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-model.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-model.c --- clutter-0.8.4/tests/test-model.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-model.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,235 +0,0 @@ -#include -#include - -enum -{ - COLUMN_FOO, - COLUMN_BAR, - - N_COLUMNS -}; - -static void -print_iter (ClutterModelIter *iter, - const gchar *text) -{ - ClutterModel *model; - gint i; - gchar *string; - - model = clutter_model_iter_get_model (iter); - - clutter_model_iter_get (iter, COLUMN_FOO, &i, COLUMN_BAR, &string, -1); - - g_print ("[row:%02d]: %s: (%s: %d), (%s: %s)\n", - clutter_model_iter_get_row (iter), - text, - clutter_model_get_column_name (model, COLUMN_FOO), i, - clutter_model_get_column_name (model, COLUMN_BAR), string); - - g_free (string); -} - -static gboolean -foreach_func (ClutterModel *model, - ClutterModelIter *iter, - gpointer dummy) -{ - gint i; - gchar *string; - - clutter_model_iter_get (iter, COLUMN_FOO, &i, COLUMN_BAR, &string, -1); - - g_print ("[row:%02d]: Foreach: %d, %s\n", - clutter_model_iter_get_row (iter), - i, string); - - g_free (string); - - return TRUE; -} - -static gboolean -filter_func (ClutterModel *model, - ClutterModelIter *iter, - gpointer dummy) -{ - gint i = 0; - - clutter_model_iter_get (iter, COLUMN_FOO, &i, -1); - - return !(i % 2); -} - -static gint -sort_func (ClutterModel *model, - const GValue *a, - const GValue *b, - gpointer dummy) -{ - return -1 * strcmp (g_value_get_string (a), g_value_get_string (b)); -} - -static void -on_row_changed (ClutterModel *model, - ClutterModelIter *iter) -{ - print_iter (iter, "Changed"); -} - -static void -filter_model (ClutterModel *model) -{ - ClutterModelIter *iter; - - g_print ("\n* Filter function: even rows\n"); - clutter_model_set_filter (model, filter_func, NULL, NULL); - - iter = clutter_model_get_first_iter (model); - while (!clutter_model_iter_is_last (iter)) - { - print_iter (iter, "Filtered Forward Iteration"); - - iter = clutter_model_iter_next (iter); - } - g_object_unref (iter); - - g_print ("\n* Sorting function: reverse alpha\n"); - clutter_model_set_sort (model, COLUMN_BAR, sort_func, NULL, NULL); - - g_signal_connect (model, "row-changed", G_CALLBACK (on_row_changed), NULL); - - iter = clutter_model_get_iter_at_row (model, 0); - clutter_model_iter_set (iter, COLUMN_BAR, "Changed string of 0th row, " - "automatically gets sorted", - -1); - g_object_unref (iter); - - clutter_model_foreach (model, foreach_func, NULL); - - g_print ("\n* Unset filter\n"); - clutter_model_set_filter (model, NULL, NULL, NULL); - - while (clutter_model_get_n_rows (model)) - clutter_model_remove (model, 0); - - clutter_main_quit (); -} - -static void -iterate (ClutterModel *model) -{ - ClutterModelIter *iter; - - iter = clutter_model_get_first_iter (model); - - while (!clutter_model_iter_is_last (iter)) - { - print_iter (iter, "Forward Iteration"); - iter = clutter_model_iter_next (iter); - } - g_object_unref (iter); - - iter = clutter_model_get_last_iter (model); - do - { - print_iter (iter, "Reverse Iteration"); - iter = clutter_model_iter_prev (iter); - } - while (!clutter_model_iter_is_first (iter)); - - print_iter (iter, "Reverse Iteration"); - g_object_unref (iter); - - filter_model (model); -} - - -static gboolean -populate_model (ClutterModel *model) -{ - gint i; - - for (i = 0; i < 10; i++) - { - gchar *string = g_strdup_printf ("String %d", i); - - clutter_model_append (model, - COLUMN_FOO, i, - COLUMN_BAR, string, - -1); - g_free (string); - } - - clutter_model_foreach (model, foreach_func, NULL); - iterate (model); - - return FALSE; -} - -static void -on_row_added (ClutterModel *model, - ClutterModelIter *iter, - gpointer dummy) -{ - gint i; - gchar *string; - - clutter_model_iter_get (iter, COLUMN_FOO, &i, COLUMN_BAR, &string, -1); - - g_print ("[row:%02d]: Added: %d, %s\n", - clutter_model_iter_get_row (iter), - i, string); - - g_free (string); -} - -static void -on_row_removed (ClutterModel *model, - ClutterModelIter *iter, - gpointer dummy) -{ - print_iter (iter, "Removed"); -} - -static void -on_sort_changed (ClutterModel *model) -{ - g_print ("*** Sort Changed ***\n\n"); - clutter_model_foreach (model, foreach_func, NULL); -} - -static void -on_filter_changed (ClutterModel *model) -{ - g_print ("*** Filter Changed ***\n\n"); -} - -int -main (int argc, char *argv[]) -{ - ClutterModel *model; - - clutter_init (&argc, &argv); - - model = clutter_list_model_new (N_COLUMNS, - G_TYPE_INT, "Foo", - G_TYPE_STRING, "Bar"); - - g_timeout_add (1000, (GSourceFunc) populate_model, model); - - g_signal_connect (model, "row-added", - G_CALLBACK (on_row_added), NULL); - g_signal_connect (model, "row-removed", - G_CALLBACK (on_row_removed), NULL); - g_signal_connect (model, "sort-changed", - G_CALLBACK (on_sort_changed), NULL); - g_signal_connect (model, "filter-changed", - G_CALLBACK (on_filter_changed), NULL); - - clutter_main(); - - g_object_unref (model); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-multistage.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-multistage.c --- clutter-0.8.4/tests/test-multistage.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-multistage.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,133 +0,0 @@ -#include - -static gint n_stages = 1; - -static gboolean -tex_button_cb (ClutterActor *actor, - ClutterEvent *event, - gpointer data) -{ - clutter_actor_hide (actor); - - return TRUE; -} - -static gboolean -on_button_press (ClutterActor *actor, - ClutterEvent *event, - gpointer data) -{ - ClutterActor *new_stage; - ClutterActor *label, *tex; - gint width, height; - gchar *stage_label, *win_title; - ClutterColor color = { 0xdd, 0x33, 0xdd, 0xff }; - ClutterColor white = { 0x99, 0x99, 0x99, 0xff }; - ClutterTimeline *timeline; - ClutterAlpha *alpha; - ClutterBehaviour *r_behave; - - new_stage = clutter_stage_new (); - if (!new_stage) - return FALSE; - - /* FIXME: below should really be automatic */ - /* clutter_stage_ensure_cogl_context (CLUTTER_STAGE(new_stage)); */ - - clutter_stage_set_color (CLUTTER_STAGE (new_stage), &color); - clutter_actor_set_size (new_stage, 320, 240); - - tex = clutter_texture_new_from_file ("redhand.png", NULL); - - if (!tex) - g_error ("pixbuf load failed"); - - clutter_actor_set_reactive (tex, TRUE); - g_signal_connect (tex, "button-press-event", - G_CALLBACK (tex_button_cb), NULL); - - clutter_container_add_actor (CLUTTER_CONTAINER (new_stage), tex); - - stage_label = g_strdup_printf ("Stage: %d", ++n_stages); - label = clutter_label_new_with_text ("Mono 12", stage_label); - - clutter_label_set_color (CLUTTER_LABEL (label), &white); - clutter_label_set_use_markup (CLUTTER_LABEL (label), TRUE); - width = (clutter_actor_get_width (new_stage) - - clutter_actor_get_width (label)) / 2; - height = (clutter_actor_get_height (new_stage) - - clutter_actor_get_height (label)) / 2; - clutter_actor_set_position (label, width, height); - clutter_container_add_actor (CLUTTER_CONTAINER (new_stage), label); - clutter_actor_show (label); - g_free (stage_label); - - /* - g_signal_connect (new_stage, "button-press-event", - G_CALLBACK (clutter_actor_destroy), - NULL); - */ - - win_title = g_strdup_printf ("Stage:%p", new_stage); - clutter_stage_set_title (CLUTTER_STAGE(new_stage), win_title); - - timeline = clutter_timeline_new_for_duration (2000); - g_object_set (timeline, "loop", TRUE, NULL); - - alpha = clutter_alpha_new_full (timeline, - CLUTTER_ALPHA_RAMP_INC, - NULL, NULL); - - r_behave = clutter_behaviour_rotate_new (alpha, - CLUTTER_Y_AXIS, - CLUTTER_ROTATE_CW, - 0.0, 360.0); - - clutter_behaviour_rotate_set_center (CLUTTER_BEHAVIOUR_ROTATE (r_behave), - clutter_actor_get_width (label)/2, - 0, - 0); - - clutter_behaviour_apply (r_behave, label); - clutter_timeline_start (timeline); - - clutter_actor_show_all (new_stage); - - return TRUE; -} - -int -main (int argc, char *argv[]) -{ - ClutterActor *stage_default; - ClutterActor *label; - gint width, height; - gchar *win_title; - - clutter_init (&argc, &argv); - - stage_default = clutter_stage_get_default (); - g_signal_connect (stage_default, "button-press-event", - G_CALLBACK (on_button_press), - NULL); - - label = clutter_label_new_with_text ("Mono 16", "Default stage"); - width = (clutter_actor_get_width (stage_default) - - clutter_actor_get_width (label)) - / 2; - height = (clutter_actor_get_height (stage_default) - - clutter_actor_get_height (label)) - / 2; - clutter_actor_set_position (label, width, height); - clutter_container_add_actor (CLUTTER_CONTAINER (stage_default), label); - clutter_actor_show (label); - - win_title = g_strdup_printf ("Stage:%p", stage_default); - clutter_stage_set_title (CLUTTER_STAGE(stage_default), win_title); - - clutter_actor_show (stage_default); - - clutter_main (); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-offscreen.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-offscreen.c --- clutter-0.8.4/tests/test-offscreen.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-offscreen.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,31 +0,0 @@ -#include - -/* Very simple test just to see what happens setting up offscreen rendering */ - -int -main (int argc, char *argv[]) -{ - ClutterActor *stage; - gboolean offscreen; - - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - - /* Attempt to set up rendering offscreen */ - g_object_set (stage, "offscreen", TRUE, NULL); - - /* See if it worked */ - g_object_get (stage, "offscreen", &offscreen, NULL); - - if (offscreen == FALSE) - printf ("FAIL: Unable to setup offscreen rendering\n."); - else - printf ("SUCCESS: Able to setup offscreen rendering\n."); - - clutter_actor_show_all (CLUTTER_ACTOR (stage)); - - clutter_main(); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-opacity.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-opacity.c --- clutter-0.8.4/tests/test-opacity.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-opacity.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,115 +0,0 @@ -#include -#include - -#include - -#include - -int -main (int argc, char *argv[]) -{ - ClutterActor *stage, *group1, *group2, *label, *rect; - ClutterColor label_color = { 255, 0, 0, 128 }; - ClutterColor rect_color = { 0, 0, 255, 255 }; - ClutterColor color_check = { 0, }; - - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - - label = clutter_label_new_with_text ("Sans 18px", "Label, 50% opacity"); - clutter_label_set_color (CLUTTER_LABEL (label), &label_color); - - g_print ("label 50%%.get_color()/1\n"); - clutter_label_get_color (CLUTTER_LABEL (label), &color_check); - g_assert (color_check.alpha == label_color.alpha); - - clutter_container_add (CLUTTER_CONTAINER (stage), label, NULL); - clutter_actor_set_position (label, 10, 10); - - g_print ("label 50%%.get_color()/2\n"); - clutter_label_get_color (CLUTTER_LABEL (label), &color_check); - g_assert (color_check.alpha == label_color.alpha); - - g_print ("label 50%%.get_paint_opacity() = %d\n", - clutter_actor_get_paint_opacity (label)); - g_assert (clutter_actor_get_paint_opacity (label) == 128); - - clutter_actor_show (label); - - group1 = clutter_group_new (); - clutter_actor_set_opacity (group1, 128); - clutter_container_add (CLUTTER_CONTAINER (stage), group1, NULL); - clutter_actor_set_position (group1, 10, 30); - clutter_actor_show (group1); - - label = clutter_label_new_with_text ("Sans 18px", "Label+Group, 25% opacity"); - - clutter_label_set_color (CLUTTER_LABEL (label), &label_color); - - g_print ("label 50%% + group 50%%.get_color()/1\n"); - clutter_label_get_color (CLUTTER_LABEL (label), &color_check); - g_assert (color_check.alpha == label_color.alpha); - - clutter_container_add (CLUTTER_CONTAINER (group1), label, NULL); - - g_print ("label 50%% + group 50%%.get_color()/2\n"); - clutter_label_get_color (CLUTTER_LABEL (label), &color_check); - g_assert (color_check.alpha == label_color.alpha); - - g_print ("label 50%% + group 50%%.get_paint_opacity() = %d\n", - clutter_actor_get_paint_opacity (label)); - g_assert (clutter_actor_get_paint_opacity (label) == 64); - - clutter_actor_show (label); - - group2 = clutter_group_new (); - clutter_container_add (CLUTTER_CONTAINER (group1), group2, NULL); - clutter_actor_set_position (group2, 10, 60); - clutter_actor_show (group2); - - rect = clutter_rectangle_new_with_color (&rect_color); - clutter_actor_set_size (rect, 128, 128); - - g_print ("rect 100%% + group 100%% + group 50%%.get_color()/1\n"); - clutter_rectangle_get_color (CLUTTER_RECTANGLE (rect), &color_check); - g_assert (color_check.alpha == rect_color.alpha); - - clutter_container_add (CLUTTER_CONTAINER (group2), rect, NULL); - - g_print ("rect 100%% + group 100%% + group 50%%.get_color()/2\n"); - clutter_rectangle_get_color (CLUTTER_RECTANGLE (rect), &color_check); - g_assert (color_check.alpha == rect_color.alpha); - - g_print ("rect 100%%.get_paint_opacity() = %d\n", - clutter_actor_get_paint_opacity (rect)); - g_assert (clutter_actor_get_paint_opacity (rect) == 128); - - clutter_actor_show (rect); - - rect = clutter_rectangle_new_with_color (&rect_color); - clutter_actor_set_size (rect, 128, 128); - clutter_actor_set_position (rect, 150, 90); - - g_print ("rect 100%%.get_color()/1\n"); - clutter_rectangle_get_color (CLUTTER_RECTANGLE (rect), &color_check); - g_assert (color_check.alpha == rect_color.alpha); - - clutter_container_add (CLUTTER_CONTAINER (stage), rect, NULL); - - g_print ("rect 100%%.get_color()/2\n"); - clutter_rectangle_get_color (CLUTTER_RECTANGLE (rect), &color_check); - g_assert (color_check.alpha == rect_color.alpha); - - g_print ("rect 100%%.get_paint_opacity() = %d\n", - clutter_actor_get_paint_opacity (rect)); - g_assert (clutter_actor_get_paint_opacity (rect) == 255); - - clutter_actor_show (rect); - - clutter_actor_show_all (stage); - - clutter_main (); - - return EXIT_SUCCESS; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-paint-wrapper.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-paint-wrapper.c --- clutter-0.8.4/tests/test-paint-wrapper.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-paint-wrapper.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,297 +0,0 @@ -#include - -#if defined (_MSC_VER) && !defined (_USE_MATH_DEFINES) -#define _USE_MATH_DEFINES -#endif - -#include -#include -#include -#include - -#define TRAILS 0 -#define NHANDS 6 -#define RADIUS ((CLUTTER_STAGE_WIDTH()+CLUTTER_STAGE_HEIGHT())/NHANDS) - -typedef struct SuperOH -{ - ClutterActor **hand, *bgtex; - ClutterActor *group; - -} SuperOH; - -static gint n_hands = NHANDS; - -static GOptionEntry super_oh_entries[] = { - { - "num-hands", 'n', - 0, - G_OPTION_ARG_INT, &n_hands, - "Number of hands", "HANDS" - }, - { NULL } -}; - -static gint -get_radius (void) -{ - return (CLUTTER_STAGE_HEIGHT() + CLUTTER_STAGE_HEIGHT()) / n_hands ; -} - -/* input handler */ -static gboolean -input_cb (ClutterStage *stage, - ClutterEvent *event, - gpointer data) -{ - if (event->type == CLUTTER_BUTTON_PRESS) - { - ClutterButtonEvent *button_event; - ClutterActor *e; - gint x, y; - - clutter_event_get_coords (event, &x, &y); - - button_event = (ClutterButtonEvent *) event; - g_print ("*** button press event (button:%d) ***\n", - button_event->button); - - e = clutter_stage_get_actor_at_pos (stage, x, y); - - if (e && (CLUTTER_IS_TEXTURE (e) || CLUTTER_IS_CLONE_TEXTURE (e))) - { - clutter_actor_hide (e); - return TRUE; - } - } - else if (event->type == CLUTTER_KEY_RELEASE) - { - ClutterKeyEvent *kev = (ClutterKeyEvent *) event; - - g_print ("*** key press event (key:%c) ***\n", - clutter_key_event_symbol (kev)); - - if (clutter_key_event_symbol (kev) == CLUTTER_q) - { - clutter_main_quit (); - return TRUE; - } - } - - return FALSE; -} - - -/* Timeline handler */ -static void -frame_cb (ClutterTimeline *timeline, - gint frame_num, - gpointer data) -{ - SuperOH *oh = (SuperOH *)data; - gint i; - - /* Rotate everything clockwise about stage center*/ - - clutter_actor_set_rotation (CLUTTER_ACTOR (oh->group), - CLUTTER_Z_AXIS, - frame_num, - CLUTTER_STAGE_WIDTH () / 2, - CLUTTER_STAGE_HEIGHT () / 2, - 0); - - for (i = 0; i < n_hands; i++) - { - gdouble scale_x, scale_y; - - clutter_actor_get_scale (oh->hand[i], &scale_x, &scale_y); - - /* Rotate each hand around there centers - to get this we need - * to take into account any scaling. - * - * FIXME: scaling causes drift so disabled for now. Need rotation - * unit based functions to fix. - */ - clutter_actor_set_rotation (oh->hand[i], CLUTTER_Z_AXIS, - - 6.0 * frame_num, 0, 0, 0); - } -} - -static gboolean hand_pre_paint_guard = FALSE; - -static void -hand_pre_paint (ClutterActor *actor, - gpointer user_data) -{ - ClutterColor red = { 255, 0, 0, 128 }; - guint w, h; - - g_assert (hand_pre_paint_guard == FALSE); - - clutter_actor_get_size (actor, &w, &h); - - cogl_color (&red); - cogl_rectangle (0, 0, w / 2, h / 2); - - hand_pre_paint_guard = TRUE; -} - -static void -hand_post_paint (ClutterActor *actor, - gpointer user_data) -{ - ClutterColor green = { 0, 255, 0, 128 }; - guint w, h; - - g_assert (hand_pre_paint_guard == TRUE); - - clutter_actor_get_size (actor, &w, &h); - - cogl_color (&green); - cogl_rectangle (w / 2, h / 2, w / 2, h / 2); - - hand_pre_paint_guard = FALSE; -} - -int -main (int argc, char *argv[]) -{ - ClutterTimeline *timeline; - ClutterAlpha *alpha; - ClutterBehaviour *scaler_1, *scaler_2; - ClutterActor *stage; - ClutterColor stage_color = { 0x61, 0x64, 0x8c, 0xff }; - SuperOH *oh; - gint i; - GError *error; - - error = NULL; - - clutter_init_with_args (&argc, &argv, - NULL, - super_oh_entries, - NULL, - &error); - if (error) - { - g_warning ("Unable to initialise Clutter:\n%s", - error->message); - g_error_free (error); - - exit (1); - } - - stage = clutter_stage_get_default (); - clutter_actor_set_size (stage, 800, 600); - - clutter_stage_set_title (CLUTTER_STAGE (stage), "Actors Test"); - clutter_stage_set_color (CLUTTER_STAGE (stage), - &stage_color); - - oh = g_new(SuperOH, 1); - - /* Create a timeline to manage animation */ - timeline = clutter_timeline_new (360, 60); /* num frames, fps */ - g_object_set (timeline, "loop", TRUE, NULL); /* have it loop */ - - /* fire a callback for frame change */ - g_signal_connect (timeline, "new-frame", G_CALLBACK (frame_cb), oh); - - /* Set up some behaviours to handle scaling */ - alpha = clutter_alpha_new_full (timeline, CLUTTER_ALPHA_SINE, NULL, NULL); - - scaler_1 = clutter_behaviour_scale_new (alpha, - 0.5, 0.5, - 1.0, 1.0); - - scaler_2 = clutter_behaviour_scale_new (alpha, - 1.0, 1.0, - 0.5, 0.5); - - /* create a new group to hold multiple actors in a group */ - oh->group = clutter_group_new(); - - oh->hand = g_new (ClutterActor*, n_hands); - for (i = 0; i < n_hands; i++) - { - gint x, y, w, h; - gint radius = get_radius (); - - /* Create a texture from file, then clone in to same resources */ - if (i == 0) - { - if ((oh->hand[i] = clutter_texture_new_from_file ("redhand.png", - &error)) == NULL) - { - g_error ("image load failed: %s", error->message); - exit (1); - } - } - else - oh->hand[i] = clutter_clone_texture_new (CLUTTER_TEXTURE(oh->hand[0])); - - /* paint something before each hand */ - g_signal_connect (oh->hand[i], - "paint", G_CALLBACK (hand_pre_paint), - NULL); - - /* paint something after each hand */ - g_signal_connect_after (oh->hand[i], - "paint", G_CALLBACK (hand_post_paint), - NULL); - - /* Place around a circle */ - w = clutter_actor_get_width (oh->hand[0]); - h = clutter_actor_get_height (oh->hand[0]); - - x = CLUTTER_STAGE_WIDTH () / 2 - + radius - * cos (i * M_PI / (n_hands / 2)) - - w / 2; - - y = CLUTTER_STAGE_HEIGHT () / 2 - + radius - * sin (i * M_PI / (n_hands / 2)) - - h / 2; - - clutter_actor_set_position (oh->hand[i], x, y); - - clutter_actor_move_anchor_point_from_gravity (oh->hand[i], - CLUTTER_GRAVITY_CENTER); - - /* Add to our group group */ - clutter_container_add_actor (CLUTTER_CONTAINER (oh->group), oh->hand[i]); - -#if 1 /* FIXME: disabled as causes drift? - see comment above */ - if (i % 2) - clutter_behaviour_apply (scaler_1, oh->hand[i]); - else - clutter_behaviour_apply (scaler_2, oh->hand[i]); -#endif - } - - /* Add the group to the stage */ - clutter_container_add_actor (CLUTTER_CONTAINER (stage), - CLUTTER_ACTOR (oh->group)); - - /* Show everying ( and map window ) */ - clutter_actor_show (stage); - - - g_signal_connect (stage, "button-press-event", - G_CALLBACK (input_cb), - oh); - g_signal_connect (stage, "key-release-event", - G_CALLBACK (input_cb), - oh); - - /* and start it */ - clutter_timeline_start (timeline); - - clutter_main (); - - g_free (oh->hand); - g_free (oh); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-perspective.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-perspective.c --- clutter-0.8.4/tests/test-perspective.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-perspective.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,51 +0,0 @@ -#include - -int -main (int argc, char *argv[]) -{ - ClutterActor *rect; - ClutterActor *stage; - ClutterColor red = {0xff, 0, 0, 0xff}, white = {0xff, 0xff, 0xff, 0xff}; - - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - g_object_set (stage, "fullscreen", TRUE, NULL); - - clutter_stage_set_color (CLUTTER_STAGE (stage), &red); - - rect = clutter_rectangle_new_with_color (&white); - clutter_actor_set_size (rect, - clutter_actor_get_width(stage), - clutter_actor_get_height(stage)); - clutter_actor_set_position (rect, 0, 0); - clutter_group_add (CLUTTER_GROUP (stage), rect); - - rect = clutter_rectangle_new_with_color (&red); - clutter_actor_set_size (rect, 2, 2); - clutter_actor_set_position (rect, 1, 1); - clutter_group_add (CLUTTER_GROUP (stage), rect); - - rect = clutter_rectangle_new_with_color (&red); - clutter_actor_set_size (rect, 2, 2); - clutter_actor_set_position (rect, clutter_actor_get_width(stage)-3, 1); - clutter_group_add (CLUTTER_GROUP (stage), rect); - - rect = clutter_rectangle_new_with_color (&red); - clutter_actor_set_size (rect, 2, 2); - clutter_actor_set_position (rect, 1, clutter_actor_get_height(stage)-3); - clutter_group_add (CLUTTER_GROUP (stage), rect); - - rect = clutter_rectangle_new_with_color (&red); - clutter_actor_set_size (rect, 2, 2); - clutter_actor_set_position (rect, - clutter_actor_get_width(stage)-3, - clutter_actor_get_height(stage)-3); - clutter_group_add (CLUTTER_GROUP (stage), rect); - - clutter_actor_show_all (CLUTTER_ACTOR (stage)); - - clutter_main (); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-pick.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-pick.c --- clutter-0.8.4/tests/test-pick.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-pick.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,99 +0,0 @@ -#include - -#define STAGE_WIDTH 320 -#define STAGE_HEIGHT 200 -#define ACTORS_X 12 -#define ACTORS_Y 16 - -typedef struct _Data Data; - -struct _Data -{ - ClutterActor *stage; - int y, x; - guint32 gids[ACTORS_X * ACTORS_Y]; - guint actor_width, actor_height; - int ret; -}; - -static gboolean -on_timeout (Data *data) -{ - int y, x; - - for (y = 0; y < ACTORS_Y; y++) - for (x = 0; x < ACTORS_X; x++) - { - gboolean pass = FALSE; - guint32 gid; - ClutterActor *actor - = clutter_stage_get_actor_at_pos (CLUTTER_STAGE (data->stage), - x * data->actor_width - + data->actor_width / 2, - y * data->actor_height - + data->actor_height / 2); - - printf ("actor %u -> ", data->gids[y * ACTORS_X + x]); - - if (actor == NULL) - printf ("NULL: FAIL\n"); - else - { - gid = clutter_actor_get_gid (actor); - if (gid == data->gids[y * ACTORS_X + x]) - pass = TRUE; - printf ("% 8i: %s\n", gid, pass ? "pass" : "FAIL"); - } - - if (!pass) - data->ret = 1; - } - - clutter_main_quit (); - - return FALSE; -} - -int -main (int argc, char **argv) -{ - int y, x; - Data data; - - data.ret = 0; - - clutter_init (&argc, &argv); - - data.stage = clutter_stage_get_default (); - - clutter_actor_set_size (data.stage, STAGE_WIDTH, STAGE_HEIGHT); - data.actor_width = STAGE_WIDTH / ACTORS_X; - data.actor_height = STAGE_HEIGHT / ACTORS_Y; - - for (y = 0; y < ACTORS_Y; y++) - for (x = 0; x < ACTORS_X; x++) - { - ClutterColor color = { x * 255 / (ACTORS_X - 1), - y * 255 / (ACTORS_Y - 1), - 128, 255 }; - ClutterGeometry geom = { x * data.actor_width, y * data.actor_height, - data.actor_width, data.actor_height }; - ClutterActor *rect = clutter_rectangle_new_with_color (&color); - - clutter_actor_set_geometry (rect, &geom); - - clutter_container_add (CLUTTER_CONTAINER (data.stage), rect, NULL); - - data.gids[y * ACTORS_X + x] = clutter_actor_get_gid (rect); - } - - clutter_actor_show (data.stage); - - g_timeout_add (250, (GSourceFunc) on_timeout, &data); - - clutter_main (); - - printf ("end result: %s\n", data.ret ? "FAIL" : "pass"); - - return data.ret; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-pixmap.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-pixmap.c --- clutter-0.8.4/tests/test-pixmap.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-pixmap.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,260 +0,0 @@ -#include - -#include -#include - -#if HAVE_CLUTTER_GLX - -#include -#include -#include - -#include -#include - -#include -#include - -#define IMAGE "redhand.png" - -# ifdef USE_GDKPIXBUF -static gboolean disable_x11 = FALSE; -static gboolean disable_glx = FALSE; - -static GOptionEntry g_options[] = -{ - { "disable-x11", - 0, 0, - G_OPTION_ARG_NONE, - &disable_x11, - "Disable redirection through X11 pixmap", - NULL }, - { "disable-glx", - 0, 0, - G_OPTION_ARG_NONE, - &disable_glx, - "Disable redirection through GLX pixmap", - NULL }, - - { NULL } -}; - -static gboolean -stage_key_release_cb (ClutterActor *actor, - ClutterEvent *event, - gpointer data) -{ - switch (clutter_key_event_symbol (&event->key)) - { - case CLUTTER_q: - case CLUTTER_Q: - clutter_main_quit (); - break; - } - return FALSE; -} - -static gboolean -stage_button_press_cb (ClutterActor *actor, - ClutterEvent *event, - gpointer data) -{ - Pixmap pxm = (Pixmap)data; - Display *dpy = clutter_x11_get_default_display (); - GC gc; - XGCValues gc_values = {0}; - - - gc = XCreateGC (dpy, - pxm, - 0, - &gc_values); - - XDrawLine (dpy, pxm, gc, 0, 0, 100, 100); - - return FALSE; -} - -Pixmap -create_pixmap (guint *width, guint *height, guint *depth) -{ - Display *dpy = clutter_x11_get_default_display (); - Pixmap pixmap; - GdkPixbuf *pixbuf; - GError *error = NULL; - XImage *image; - char *data, *d; - guchar *p, *line, *endofline, *end; - guint w, h, rowstride; - GC gc; - XGCValues gc_values = {0}; - - pixbuf = gdk_pixbuf_new_from_file (IMAGE, &error); - if (error) - g_error (error->message); - - /* We assume that the image had an alpha channel */ - g_assert (gdk_pixbuf_get_has_alpha (pixbuf)); - - w = gdk_pixbuf_get_width (pixbuf); - h = gdk_pixbuf_get_height (pixbuf); - rowstride = gdk_pixbuf_get_rowstride (pixbuf); - - data = g_malloc (w * h * 4); - image = XCreateImage (dpy, - None, - 32, - ZPixmap, - 0, - data, - w, h, - 8, - w * 4); - - p = gdk_pixbuf_get_pixels (pixbuf); - d = data; - end = p + rowstride*h; - - /* Convert from RGBA as contained in the pixmap to ARGB as used in X */ - for (line = p; line < end ; line += rowstride) - { - p = line; - endofline = p + 4 * w; - - for (p = line; p < endofline; p += 4, d+=4) - { - -# define r ((guint32)(*(p))) -# define g ((guint32)(*(p+1))) -# define b ((guint32)(*(p+2))) -# define a ((guint32)(*(p+3))) - guint32 pixel = - ((a << 24) & 0xFF000000 ) | - ((r << 16) & 0x00FF0000 ) | - ((g << 8) & 0x0000FF00) | - ((b) & 0x000000FF ); - - *((guint32 *)d) = pixel; - - } -# undef r -# undef g -# undef b -# undef a - - } - - g_object_unref (pixbuf); - - pixmap = XCreatePixmap (dpy, - DefaultRootWindow (dpy), - w, h, - 32); - - gc = XCreateGC (dpy, - pixmap, - 0, - &gc_values); - - XPutImage (dpy, - pixmap, - gc, - image, - 0, 0, - 0, 0, - w, h); - - XFreeGC (dpy, gc); - XDestroyImage (image); - - if (width) *width = w; - if (height) *height = h; - if (depth) *depth = 32; - - return pixmap; -} -# endif /* USE_GDKPIXBUF */ - -int -main (int argc, char **argv) -{ -#ifdef USE_GDKPIXBUF - GOptionContext *context; - ClutterActor *stage, *tex; - Pixmap pixmap; - const ClutterColor gry = { 0x99, 0x99, 0x99, 0xFF }; - Window win_remote; - guint w, h, d; - - clutter_init (&argc, &argv); - - context = g_option_context_new (" - text-pixmap options"); - g_option_context_add_main_entries (context, g_options, NULL); - g_option_context_parse (context, &argc, &argv, NULL); - - if (argc < 2) - g_error ("usage: %s ", argv[0]); - - win_remote = strtol (argv[1], NULL, 0); - - stage = clutter_stage_get_default (); - clutter_stage_set_color (CLUTTER_STAGE (stage), &gry); - - /* a pixmap */ - pixmap = create_pixmap (&w, &h, &d); - - tex = clutter_x11_texture_pixmap_new_with_pixmap (pixmap); - clutter_container_add_actor (CLUTTER_CONTAINER (stage), tex); - /* oddly, the actor's size is 0 until it is realized, even though - pixmap-height is set */ - clutter_actor_set_position (tex, 0, - clutter_actor_get_height (stage) - - clutter_actor_get_height (tex)); - - /* a window */ - if (!disable_x11) - { - tex = clutter_x11_texture_pixmap_new_with_window (win_remote); - - clutter_actor_set_position (tex, 0, 0); - - clutter_container_add_actor (CLUTTER_CONTAINER (stage), tex); - - clutter_x11_texture_pixmap_set_automatic (CLUTTER_X11_TEXTURE_PIXMAP (tex), - TRUE); - } - -# ifdef HAVE_CLUTTER_GLX - /* a window with glx */ - if (!disable_glx) - { - tex = clutter_glx_texture_pixmap_new_with_window (win_remote); - - clutter_actor_set_position (tex, - clutter_actor_get_width (stage) - - clutter_actor_get_width (tex), - 0); - - clutter_container_add_actor (CLUTTER_CONTAINER (stage), tex); - - clutter_x11_texture_pixmap_set_automatic (CLUTTER_X11_TEXTURE_PIXMAP (tex), - TRUE); - } -#endif /* HAVE_CLUTTER_GLX */ - - g_signal_connect (stage, "key-release-event", - G_CALLBACK (stage_key_release_cb), (gpointer)pixmap); - g_signal_connect (stage, "button-press-event", - G_CALLBACK (stage_button_press_cb), (gpointer)pixmap); - - clutter_actor_show_all (stage); - - clutter_main (); -# endif /* USE_GDKPIXBUF */ - - return EXIT_SUCCESS; -} - -#else /* HAVE_CLUTTER_GLX */ -int main (int argc, char **argv) { return EXIT_SUCCESS; }; -#endif /* HAVE_CLUTTER_GLX */ diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-project.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-project.c --- clutter-0.8.4/tests/test-project.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-project.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,241 +0,0 @@ -#include -#include -#include - -static ClutterActor *main_stage, *rect, *p[5]; - -static void -init_handles () -{ - gint i; - ClutterVertex v[4]; - ClutterVertex v1, v2; - ClutterColor blue = { 0, 0, 0xff, 0xff }; - - clutter_actor_get_abs_allocation_vertices (rect, v); - for (i = 0; i < 4; ++i) - { - p[i] = clutter_rectangle_new_with_color (&blue); - clutter_actor_set_size (p[i], 5, 5); - clutter_actor_set_position (p[i], 0, 0); - clutter_group_add (CLUTTER_GROUP (main_stage), p[i]); - - clutter_actor_set_position (p[i], - CLUTTER_FIXED_INT (v[i].x) - - clutter_actor_get_width (p[i])/2, - CLUTTER_FIXED_INT (v[i].y) - - clutter_actor_get_height (p[i])/2); - - clutter_actor_raise_top (p[i]); - - clutter_actor_show (p[i]); - } - - v1.x = CLUTTER_INT_TO_FIXED (clutter_actor_get_width (rect)/2); - v1.y = CLUTTER_INT_TO_FIXED (clutter_actor_get_height (rect)/2); - v1.z = 0; - - clutter_actor_apply_transform_to_point (rect, &v1, &v2); - p[4] = clutter_rectangle_new_with_color (&blue); - clutter_actor_set_size (p[4], 5, 5); - clutter_actor_set_position (p[4], 0, 0); - clutter_group_add (CLUTTER_GROUP (main_stage), p[4]); - clutter_actor_set_position (p[4], - CLUTTER_FIXED_INT (v2.x) - - clutter_actor_get_width (p[4])/2, - CLUTTER_FIXED_INT (v2.y) - - clutter_actor_get_height (p[4])/2); - - clutter_actor_raise_top (p[4]); - - clutter_actor_show (p[4]); -} - -static void -place_handles () -{ - gint i; - ClutterVertex v[4]; - ClutterVertex v1, v2; - - clutter_actor_get_abs_allocation_vertices (rect, v); - for (i = 0; i < 4; ++i) - { - clutter_actor_set_position (p[i], - CLUTTER_FIXED_INT (v[i].x) - - clutter_actor_get_width (p[i])/2, - CLUTTER_FIXED_INT (v[i].y) - - clutter_actor_get_height (p[i])/2); - } - - v1.x = CLUTTER_INT_TO_FIXED (clutter_actor_get_width (rect)/2); - v1.y = CLUTTER_INT_TO_FIXED (clutter_actor_get_height (rect)/2); - v1.z = 0; - - clutter_actor_apply_transform_to_point (rect, &v1, &v2); - clutter_actor_set_position (p[4], - CLUTTER_FIXED_INT (v2.x) - - clutter_actor_get_width (p[4])/2, - CLUTTER_FIXED_INT (v2.y) - - clutter_actor_get_height (p[4])/2); -} - -#define M(m,row,col) (m)[col*4+row] - -static gint -find_handle_index (ClutterActor * a) -{ - gint i; - for (i = 0; i < sizeof(p)/sizeof(p[0]); ++i) - if (p[i] == a) - return i; - - return -1; -} - -gboolean -on_event (ClutterStage *stage, - ClutterEvent *event, - gpointer user_data) -{ - static ClutterActor * dragging = NULL; - - switch (event->type) - { - case CLUTTER_BUTTON_PRESS: - { - gint x, y; - ClutterActor * actor; - - clutter_event_get_coords (event, &x, &y); - - actor = clutter_stage_get_actor_at_pos (stage, x, y); - - if (actor != CLUTTER_ACTOR (stage)) - { - if (actor != rect) - dragging = actor; - } - } - break; - - case CLUTTER_MOTION: - { - if (dragging) - { - gint x, y; - gint i; - ClutterActorBox box1, box2; - ClutterFixed xp, yp; - - i = find_handle_index (dragging); - - if (i < 0) - break; - - clutter_event_get_coords (event, &x, &y); - - clutter_actor_get_allocation_box (dragging, &box1); - clutter_actor_get_allocation_box (rect, &box2); - - xp = CLUTTER_INT_TO_FIXED (x-3) - box1.x1; - yp = CLUTTER_INT_TO_FIXED (y-3) - box1.y1; - - if (i == 4) - { - g_debug ("moving box by %f, %f", - CLUTTER_FIXED_TO_FLOAT (xp), - CLUTTER_FIXED_TO_FLOAT (yp)); - - clutter_actor_move_by (rect, - CLUTTER_FIXED_INT(xp), - CLUTTER_FIXED_INT(yp)); - } - else - { - g_debug ("adjusting box by %f, %f, handle %d", - CLUTTER_FIXED_TO_FLOAT (xp), - CLUTTER_FIXED_TO_FLOAT (yp), - i); - switch (i) - { - case 0: - box2.x1 += xp; - box2.y1 += yp; - break; - case 1: - box2.x2 += xp; - box2.y1 += yp; - break; - case 2: - box2.x1 += xp; - box2.y2 += yp; - break; - case 3: - box2.x2 += xp; - box2.y2 += yp; - break; - } - - /* FIXME this is just plain wrong, to allocate directly - * like this - */ - clutter_actor_allocate (rect, &box2, TRUE); - } - - place_handles (); - } - } - break; - - case CLUTTER_BUTTON_RELEASE: - { - dragging = NULL; - } - break; - - default: - break; - } - - return FALSE; -} - - -int -main (int argc, char *argv[]) -{ - ClutterActor *label; - - ClutterColor stage_color = { 0x0, 0x0, 0x0, 0xff }, - white = { 0xff, 0xff, 0xff, 0xff }; - - clutter_init (&argc, &argv); - - main_stage = clutter_stage_get_default (); - - clutter_stage_set_color (CLUTTER_STAGE (main_stage), &stage_color); - clutter_actor_set_size (main_stage, 640, 480); - - rect = clutter_rectangle_new_with_color (&white); - clutter_actor_set_size (rect, 320, 240); - clutter_actor_set_position (rect, 180, 120); - clutter_actor_set_rotation (rect, CLUTTER_Y_AXIS, 60, 0, 0, 0); - clutter_group_add (CLUTTER_GROUP (main_stage), rect); - - label = clutter_label_new_with_text ("Mono 8pt", "Drag the blue rectangles"); - clutter_label_set_color (CLUTTER_LABEL (label), &white); - - clutter_actor_set_position (label, 10, 10); - clutter_group_add (CLUTTER_GROUP (main_stage), label); - - clutter_actor_show_all (main_stage); - - g_signal_connect (main_stage, "event", G_CALLBACK (on_event), NULL); - - init_handles (); - - clutter_main(); - - return EXIT_SUCCESS; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-random-text.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-random-text.c --- clutter-0.8.4/tests/test-random-text.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-random-text.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,85 +0,0 @@ -#include -#include - -#define MAX_TEXT_LEN 10 -#define MIN_FONT_SIZE 10 -#define MAX_FONT_SIZE 30 - -static const char * const font_names[] = - { - "Sans", "Sans Italic", "Serif", "Serif Bold", "Times", "Monospace" - }; -#define FONT_NAME_COUNT 6 - -static gboolean -on_idle (gpointer data) -{ - ClutterActor *stage = CLUTTER_ACTOR (data); - int line_height = 0, xpos = 0, ypos = 0; - int stage_width = clutter_actor_get_width (stage); - int stage_height = clutter_actor_get_height (stage); - char text[MAX_TEXT_LEN + 1]; - char font_name[64]; - int i; - GList *children, *node; - - /* Remove all of the children of the stage */ - children = clutter_container_get_children (CLUTTER_CONTAINER (stage)); - for (node = children; node; node = node->next) - clutter_container_remove_actor (CLUTTER_CONTAINER (stage), - CLUTTER_ACTOR (node->data)); - g_list_free (children); - - /* Fill the stage with new random labels */ - while (ypos < stage_height) - { - int text_len = rand () % MAX_TEXT_LEN + 1; - ClutterActor *label; - - for (i = 0; i < text_len; i++) - text[i] = rand () % (128 - 32) + 32; - text[text_len] = '\0'; - - sprintf (font_name, "%s %i", - font_names[rand () % FONT_NAME_COUNT], - rand () % (MAX_FONT_SIZE - MIN_FONT_SIZE) + MIN_FONT_SIZE); - - label = clutter_label_new_with_text (font_name, text); - - if (clutter_actor_get_height (label) > line_height) - line_height = clutter_actor_get_height (label); - - if (xpos + clutter_actor_get_width (label) > stage_width) - { - xpos = 0; - ypos += line_height; - line_height = 0; - } - - clutter_actor_set_position (label, xpos, ypos); - - clutter_container_add (CLUTTER_CONTAINER (stage), label, NULL); - - xpos += clutter_actor_get_width (label); - } - - return TRUE; -} - -int -main (int argc, char **argv) -{ - ClutterActor *stage; - - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - - clutter_actor_show (stage); - - clutter_threads_add_idle (on_idle, stage); - - clutter_main (); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-rotate.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-rotate.c --- clutter-0.8.4/tests/test-rotate.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-rotate.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,74 +0,0 @@ -#include -#include -#include - -#include - -#include - -int -main (int argc, char *argv[]) -{ - ClutterTimeline *timeline; - ClutterAlpha *alpha; - ClutterBehaviour *r_behave; - ClutterActor *stage; - ClutterActor *hand, *label; - ClutterColor stage_color = { 0xcc, 0xcc, 0xcc, 0xff }; - - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - - clutter_stage_set_color (CLUTTER_STAGE (stage), - &stage_color); - - /* Make a hand */ - hand = clutter_texture_new_from_file ("redhand.png", NULL); - if (!hand) - g_error("pixbuf load failed"); - - clutter_actor_set_position (hand, 240, 140); - clutter_actor_show (hand); - clutter_container_add_actor (CLUTTER_CONTAINER (stage), hand); - - label = clutter_label_new_with_text ("Mono 16", "The Wonder of the Spinning Hand"); - clutter_label_set_alignment (CLUTTER_LABEL (label), PANGO_ALIGN_CENTER); - clutter_actor_set_position (label, 150, 150); - clutter_actor_set_size (label, 500, 100); - clutter_actor_show (label); - clutter_container_add_actor (CLUTTER_CONTAINER (stage), label); - - /* Make a timeline */ - timeline = clutter_timeline_new (200, 26); /* num frames, fps */ - g_object_set (timeline, "loop", TRUE, NULL); - - /* Set an alpha func to power behaviour - ramp is constant rise/fall */ - alpha = clutter_alpha_new_full (timeline, - CLUTTER_ALPHA_RAMP_INC, - NULL, NULL); - - /* Create a behaviour for that alpha */ - r_behave = clutter_behaviour_rotate_new (alpha, - CLUTTER_Z_AXIS, - CLUTTER_ROTATE_CW, - 0.0, 360.0); - - clutter_behaviour_rotate_set_center (CLUTTER_BEHAVIOUR_ROTATE (r_behave), - 86, 125, 0); - - /* Apply it to our actor */ - clutter_behaviour_apply (r_behave, hand); - clutter_behaviour_apply (r_behave, label); - - /* start the timeline and thus the animations */ - clutter_timeline_start (timeline); - - clutter_actor_show_all (stage); - - clutter_main(); - - g_object_unref (r_behave); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-scale.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-scale.c --- clutter-0.8.4/tests/test-scale.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-scale.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,86 +0,0 @@ -#include -#include - -static const ClutterGravity gravities[] = { - CLUTTER_GRAVITY_NORTH_EAST, - CLUTTER_GRAVITY_NORTH, - CLUTTER_GRAVITY_NORTH_WEST, - CLUTTER_GRAVITY_WEST, - CLUTTER_GRAVITY_SOUTH_WEST, - CLUTTER_GRAVITY_SOUTH, - CLUTTER_GRAVITY_SOUTH_EAST, - CLUTTER_GRAVITY_EAST, - CLUTTER_GRAVITY_CENTER, - CLUTTER_GRAVITY_NONE -}; - -static gint gindex = 0; - -static void -on_timeline_completed (ClutterTimeline *cluttertimeline, - gpointer data) -{ - ClutterActor *actor = CLUTTER_ACTOR (data); - - if (++gindex >= G_N_ELEMENTS (gravities)) - gindex = 0; - - clutter_actor_move_anchor_point_from_gravity (actor, gravities[gindex]); -} - -int -main (int argc, char *argv[]) -{ - ClutterActor *stage, *rect; - ClutterColor stage_color = { 0x0, 0x0, 0x0, 0xff }; - ClutterColor rect_color = { 0xff, 0xff, 0xff, 0x99 }; - ClutterTimeline *timeline; - ClutterAlpha *alpha; - ClutterBehaviour *behave; - - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - - clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); - clutter_actor_set_size (stage, 300, 300); - - rect = clutter_rectangle_new_with_color (&rect_color); - clutter_actor_set_size (rect, 100, 100); - clutter_actor_set_position (rect, 100, 100); - - clutter_group_add (CLUTTER_GROUP (stage), rect); - - rect_color.alpha = 0xff; - rect = clutter_rectangle_new_with_color (&rect_color); - clutter_actor_set_position (rect, 100, 100); - clutter_actor_set_size (rect, 100, 100); - clutter_actor_move_anchor_point_from_gravity (rect, CLUTTER_GRAVITY_CENTER); - - clutter_group_add (CLUTTER_GROUP (stage), rect); - - timeline = clutter_timeline_new_for_duration (750); - alpha = clutter_alpha_new_full (timeline, - CLUTTER_ALPHA_RAMP, - NULL, NULL); - - behave = clutter_behaviour_scale_new (alpha, - 0.0, 0.0, /* scale start */ - 1.0, 1.0); /* scale end */ - - clutter_behaviour_apply (behave, rect); - - clutter_timeline_set_loop (timeline, TRUE); - g_signal_connect (timeline, "completed", - G_CALLBACK(on_timeline_completed), rect); - clutter_timeline_start (timeline); - - clutter_actor_show_all (stage); - - clutter_main(); - - g_object_unref (timeline); - g_object_unref (behave); - - return EXIT_SUCCESS; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-score.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-score.c --- clutter-0.8.4/tests/test-score.c 2008-11-14 14:54:09.000000000 +0000 +++ clutter-0.9.0/tests/test-score.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,126 +0,0 @@ -#include -#include -#include - -static gint level = 1; - -static void -on_score_started (ClutterScore *score) -{ - g_print ("Score started\n"); -} - -static void -on_score_completed (ClutterScore *score) -{ - g_print ("Score completed\n"); - clutter_main_quit (); -} - -static void -on_timeline_started (ClutterScore *score, - ClutterTimeline *timeline) -{ - gint i; - - for (i = 0; i < level; i++) - g_print (" "); - - 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) -{ - gint i; - - level -= 1; - - for (i = 0; i < level; i++) - g_print (" "); - - g_print ("Completed timeline: `%s'\n", - (gchar *) g_object_get_data (G_OBJECT (timeline), "timeline-name")); -} - -int -main (int argc, char **argv) -{ - ClutterScore *score; - ClutterTimeline *timeline_1; - ClutterTimeline *timeline_2; - ClutterTimeline *timeline_3; - ClutterTimeline *timeline_4; - ClutterTimeline *timeline_5; - GSList *timelines; - - clutter_init (&argc, &argv); - - timeline_1 = clutter_timeline_new_for_duration (1000); - g_object_set_data_full (G_OBJECT (timeline_1), - "timeline-name", g_strdup ("Timeline 1"), - g_free); - - timeline_2 = clutter_timeline_new_for_duration (1000); - clutter_timeline_add_marker_at_time (timeline_2, "foo", 500); - g_object_set_data_full (G_OBJECT (timeline_2), - "timeline-name", g_strdup ("Timeline 2"), - g_free); - - timeline_3 = clutter_timeline_new_for_duration (1000); - g_object_set_data_full (G_OBJECT (timeline_3), - "timeline-name", g_strdup ("Timeline 3"), - g_free); - - timeline_4 = clutter_timeline_new_for_duration (1000); - g_object_set_data_full (G_OBJECT (timeline_4), - "timeline-name", g_strdup ("Timeline 4"), - g_free); - - timeline_5 = clutter_timeline_new_for_duration (1000); - 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_main (); - - 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); - - return EXIT_SUCCESS; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-script.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-script.c --- clutter-0.8.4/tests/test-script.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-script.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,172 +0,0 @@ -#include -#include - -#include - -#include - -static ClutterScript *script = NULL; -static guint merge_id = 0; - -static const gchar *test_unmerge = -"[" -" {" -" \"id\" : \"main-stage\"," -" \"type\" : \"ClutterStage\"," -" \"children\" : [ \"blue-button\" ]" -" }," -" {" -" \"id\" : \"blue-button\"," -" \"type\" : \"ClutterRectangle\"," -" \"color\" : \"#0000ffff\"," -" \"x\" : 350," -" \"y\" : 50," -" \"width\" : 100," -" \"height\" : 100," -" \"visible\" : true," -" \"reactive\" : true" -" }" -"]"; - -static const gchar *test_behaviour = -"[" -" {" -" \"id\" : \"main-timeline\"," -" \"type\" : \"ClutterTimeline\"," -" \"duration\" : 5000," -" \"loop\" : true" -" }," -" {" -" \"id\" : \"path-behaviour\"," -" \"type\" : \"ClutterBehaviourPath\"," -" \"knots\" : [ [ 50, 50 ], { \"x\" : 100, \"y\" : 100 } ]," -" \"alpha\" : {" -" \"timeline\" : \"main-timeline\"," -" \"function\" : \"ramp\"" -" }" -" }," -" {" -" \"id\" : \"rotate-behaviour\"," -" \"type\" : \"ClutterBehaviourRotate\"," -" \"angle-start\" : 0.0," -" \"angle-end\" : 360.0," -" \"axis\" : \"y-axis\"," -" \"alpha\" : {" -" \"timeline\" : \"main-timeline\"," -" \"function\" : \"sine\"" -" }" -" }," -" {" -" \"id\" : \"fade-behaviour\"," -" \"type\" : \"ClutterBehaviourOpacity\"," -" \"opacity-start\" : 255," -" \"opacity-end\" : 0," -" \"alpha\" : {" -" \"timeline\" : \"main-timeline\"," -" \"function\" : \"ramp-inc\"" -" }" -" }" -"]"; - -static gboolean -blue_button_press (ClutterActor *actor, - ClutterButtonEvent *event, - gpointer data) -{ - g_print ("[*] Pressed `%s'\n", clutter_get_script_id (G_OBJECT (actor))); - g_print ("[*] Unmerging objects with merge id: %d\n", merge_id); - - clutter_script_unmerge_objects (script, merge_id); - - return TRUE; -} - -static gboolean -red_button_press (ClutterActor *actor, - ClutterButtonEvent *event, - gpointer data) -{ - GObject *timeline; - - g_print ("[*] Pressed `%s'\n", clutter_get_script_id (G_OBJECT (actor))); - - timeline = clutter_script_get_object (script, "main-timeline"); - g_assert (CLUTTER_IS_TIMELINE (timeline)); - - if (!clutter_timeline_is_playing (CLUTTER_TIMELINE (timeline))) - clutter_timeline_start (CLUTTER_TIMELINE (timeline)); - else - clutter_timeline_pause (CLUTTER_TIMELINE (timeline)); - - return TRUE; -} - -int -main (int argc, char *argv[]) -{ - GObject *stage, *blue_button, *red_button; - GError *error = NULL; - gint res; - - clutter_init (&argc, &argv); - - script = clutter_script_new (); - g_assert (CLUTTER_IS_SCRIPT (script)); - - clutter_script_load_from_data (script, test_behaviour, -1, &error); - if (error) - { - g_print ("*** Error:\n" - "*** %s\n", error->message); - g_error_free (error); - g_object_unref (script); - return EXIT_FAILURE; - } - - clutter_script_load_from_file (script, "test-script.json", &error); - if (error) - { - g_print ("*** Error:\n" - "*** %s\n", error->message); - g_error_free (error); - g_object_unref (script); - return EXIT_FAILURE; - } - - merge_id = clutter_script_load_from_data (script, test_unmerge, -1, &error); - if (error) - { - g_print ("*** Error:\n" - "*** %s\n", error->message); - g_error_free (error); - g_object_unref (script); - return EXIT_FAILURE; - } - - clutter_script_connect_signals (script, NULL); - - res = clutter_script_get_objects (script, - "main-stage", &stage, - "red-button", &red_button, - "blue-button", &blue_button, - NULL); - g_assert (res == 3); - - clutter_actor_show (CLUTTER_ACTOR (stage)); - - g_signal_connect (red_button, - "button-press-event", - G_CALLBACK (red_button_press), - NULL); - - g_signal_connect (blue_button, - "button-press-event", - G_CALLBACK (blue_button_press), - NULL); - - clutter_main (); - - g_object_unref (script); - - return EXIT_SUCCESS; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-script.json /tmp/VXszleoOf1/clutter-0.9.0/tests/test-script.json --- clutter-0.8.4/tests/test-script.json 2008-11-28 18:00:01.000000000 +0000 +++ clutter-0.9.0/tests/test-script.json 1970-01-01 01:00:00.000000000 +0100 @@ -1,78 +0,0 @@ -{ - "My Scene" : { - "id" : "main-stage", - "type" : "ClutterStage", - "title" : "ClutterScript test", - "color" : "white", - "signals" : [ - { "name" : "key-press-event", "handler" : "clutter_main_quit" }, - { "name" : "destroy", "handler" : "clutter_main_quit" } - ], - "children" : [ - { - "id" : "red-button", - "type" : "ClutterRectangle", - "color" : "#ff0000ff", - "x" : 50, "y" : 50, "width" : 100, "height" : 100, - "reactive" : true, - "rotation" : [ - { "z-axis" : [ 45.0, [ 75, 75 ] ] } - ], - "behaviours" : [ "fade-behaviour", "path-behaviour" ] - }, - { - "id" : "green-button", - "type" : "ClutterRectangle", - "color" : "#00ff00ff", - "border-width" : 5, - "border-color" : "#00cc00ff", - "x" : 200, - "y" : 50, - "width" : 100, - "height" : 100, - "reactive" : true, - "signals" : [ - { "name" : "button-press-event", "handler" : "clutter_main_quit" } - ] - }, - { - "id" : "red-hand", - "type" : "ClutterTexture", - "filename" : "redhand.png", - "x" : 100, - "y" : 100, - "width" : "20mm", - "keep-aspect-ratio" : true, - "anchor-x" : "5mm", - "anchor-y" : "5pt", - "opacity" : 100, - "behaviours" : [ "rotate-behaviour", "fade-behaviour" ] - }, - { - "id" : "red-hand-clone", - "type" : "ClutterCloneTexture", - "parent-texture" : "red-hand", - "x" : 250, - "y" : 150, - "opacity" : 100, - }, - { - "id" : "label", - "type" : "ClutterLabel", - "x" : 50, - "y" : 200, - "width" : 400, - "text" : "Clutter\tScript", - "font-name" : "Sans 24px", - "color" : "black", - "alignment" : "center", - "wrap" : false, - "ellipsize" : "none", - "rotation" : [ - { "y-axis" : [ 60.0, [ 275, 100 ] ] }, - { "z-axis" : [ 45.0, [ 75, 75 ] ] } - ] - } - ] - } -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-shader.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-shader.c --- clutter-0.8.4/tests/test-shader.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-shader.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,399 +0,0 @@ -/*#define TEST_GROUP */ - -#include -#include "../config.h" - -#include -#include -#include - -/* Dynamic branching appeared in "Shader Model 3.0" that low-end IGPs - * don't support. - */ -#define GPU_SUPPORTS_DYNAMIC_BRANCHING 0 - -typedef struct -{ - gchar *name; - gchar *source; -} ShaderSource; - -/* These variables are used instead of the standard GLSL variables on - GLES 2 */ -#ifdef HAVE_COGL_GLES2 - -#define GLES2_VARS \ - "precision mediump float;\n" \ - "varying vec2 tex_coord;\n" \ - "varying vec4 frag_color;\n" -#define TEX_COORD "tex_coord" -#define COLOR_VAR "frag_color" - -#else /* HAVE_COGL_GLES2 */ - -#define GLES2_VARS "" -#define TEX_COORD "gl_TexCoord[0]" -#define COLOR_VAR "gl_Color" - -#endif /* HAVE_COGL_GLES2 */ - -/* a couple of boilerplate defines that are common amongst all the - * sample shaders - */ - -/* FRAGMENT_SHADER_BEGIN: generate boilerplate with a local vec4 color already - * initialized, from a sampler2D in a variable tex. - */ -#define FRAGMENT_SHADER_VARS \ - GLES2_VARS \ - "uniform sampler2D tex;" \ - "uniform float x_step, y_step;" \ - -#define FRAGMENT_SHADER_BEGIN \ - "void main (){" \ - " vec4 color = texture2D (tex, vec2(" TEX_COORD "));" - -/* FRAGMENT_SHADER_END: apply the changed color to the output buffer correctly - * blended with the gl specified color (makes the opacity of actors work - * correctly). - */ -#define FRAGMENT_SHADER_END \ - " gl_FragColor = color;" \ - " gl_FragColor = gl_FragColor * " COLOR_VAR ";" \ - "}" - -static ShaderSource shaders[]= - { - {"brightness-contrast", - FRAGMENT_SHADER_VARS - "uniform float brightness, contrast;" - FRAGMENT_SHADER_BEGIN - " color.rgb = (color.rgb - vec3(0.5, 0.5, 0.5)) * contrast + " - "vec3 (brightness + 0.5, brightness + 0.5, brightness + 0.5);" - FRAGMENT_SHADER_END - }, - - {"box-blur", - FRAGMENT_SHADER_VARS - -#if GPU_SUPPORTS_DYNAMIC_BRANCHING - "uniform float radius;" - FRAGMENT_SHADER_BEGIN - "float u, v;" - "int count = 1;" - "for (u=-radius;u= 0 && shaders[new_no].name) - { - ClutterShader *shader; - GError *error; - shader_no = new_no; - - g_print ("setting shaders[%i] named '%s'\n", - shader_no, - shaders[shader_no].name); - - shader = clutter_shader_new (); - - error = NULL; - g_object_set (G_OBJECT (shader), - "fragment-source", shaders[shader_no].source, NULL); - - /* try to bind the shader, provoking an error we catch if there is issues - * with the shader sources we've provided. At a later stage it should be - * possible to iterate through a set of alternate shader sources (glsl -> - * asm -> cg?) and the one that succesfully compiles is used. - */ - clutter_shader_compile (shader, &error); - if (error) - { - g_print ("unable to set shaders[%i] named '%s': %s", - shader_no, shaders[shader_no].name, - error->message); - g_error_free (error); - clutter_actor_set_shader (actor, NULL); - } - else - { - clutter_actor_set_shader (actor, NULL); - clutter_actor_set_shader (actor, shader); - clutter_actor_set_shader_param (actor, "radius", 3.0); - clutter_actor_set_shader_param (actor, "brightness", 0.4); - clutter_actor_set_shader_param (actor, "contrast", -1.9); - - if (CLUTTER_IS_TEXTURE (actor)) - { - tex_width = clutter_actor_get_width (actor); - tex_width = clutter_util_next_p2 (tex_width); - tex_height = clutter_actor_get_height (actor); - tex_height = clutter_util_next_p2 (tex_height); - - clutter_actor_set_shader_param (actor, "x_step", - 1.0f / tex_width); - clutter_actor_set_shader_param (actor, "y_step", - 1.0f / tex_height); - } - } - } -} - -static gboolean -button_release_cb (ClutterActor *actor, - ClutterEvent *event, - gpointer data) -{ - gint new_no; - - if (event->button.button == 1) - { - new_no = shader_no - 1; - } - else - { - new_no = shader_no + 1; - } - - set_shader_num (actor, new_no); - - return FALSE; -} - -#ifdef HAVE_COGL_GLES2 -static gboolean -timeout_cb (gpointer data) -{ - int new_no = shader_no + 1; - - if (shaders[new_no].name == NULL) - new_no = 0; - - set_shader_num (CLUTTER_ACTOR (data), new_no); - - return TRUE; -} -#endif /* HAVE_COGL_GLES2 */ - -gint -main (gint argc, - gchar *argv[]) -{ - ClutterActor *actor; - ClutterActor *stage; - ClutterColor stage_color = { 0x61, 0x64, 0x8c, 0xff }; - ClutterShader *shader; - GError *error; - - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - clutter_actor_set_size (stage, 512, 384); - - g_print ("applying shaders[%i] named '%s'\n", - shader_no, - shaders[shader_no].name); - - shader = clutter_shader_new (); - - error = NULL; - clutter_shader_set_fragment_source (shader, shaders[shader_no].source, -1); - clutter_shader_compile (shader, &error); - if (error) - { - g_print ("unable to load shaders[%d] named '%s': %s\n", - shader_no, - shaders[shader_no].name, - error->message); - g_error_free (error); - - return EXIT_FAILURE; - } - - clutter_stage_set_title (CLUTTER_STAGE (stage), "Shader Test"); - clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); - -#ifndef TEST_GROUP - actor = g_object_new (CLUTTER_TYPE_TEXTURE, - "filename", "redhand.png", - "disable-slicing", TRUE, - NULL); - actor = clutter_texture_new_from_file ("redhand.png", &error); - if (!actor) - g_error("pixbuf load failed: %s", error ? error->message : "Unknown"); - -#else - actor = clutter_group_new (); - { - ClutterActor *child1, *child2, *child3, *child4; - ClutterColor color = { 0xff, 0x22, 0x66, 0x99 }; - - child1 = clutter_texture_new_from_file ("redhand.png", &error); - if (!child1) - g_error("pixbuf load failed: %s", error ? error->message : "Unknown"); - child2 = clutter_texture_new_from_file ("redhand.png", &error); - if (!child2) - g_error("pixbuf load failed: %s", error ? error->message : "Unknown"); - child3 = clutter_rectangle_new (); - child4 = clutter_label_new_with_text ("Sans 20px", "Shady stuff"); - - clutter_rectangle_set_color (child3, &color); - clutter_actor_set_size (child3, 50, 50); - clutter_actor_set_position (child1, 0, 0); - clutter_actor_set_position (child2, 50, 100); - clutter_actor_set_position (child3, 30, -30); - clutter_actor_set_position (child4, -50, 20); - - clutter_group_add (CLUTTER_GROUP (actor), child1); - clutter_group_add (CLUTTER_GROUP (actor), child2); - clutter_group_add (CLUTTER_GROUP (actor), child3); - clutter_group_add (CLUTTER_GROUP (actor), child4); - - clutter_actor_show_all (actor); - } -#endif - - clutter_actor_set_shader (actor, shader); - clutter_actor_set_position (actor, 100, 100); - - clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor); - - - clutter_actor_set_shader_param (actor, "brightness", 0.4); - clutter_actor_set_shader_param (actor, "contrast", -1.9); - - clutter_actor_set_reactive (actor, TRUE); - g_signal_connect (actor, "button-release-event", - G_CALLBACK (button_release_cb), NULL); - -#ifdef HAVE_COGL_GLES2 - /* On an embedded platform it is difficult to right click so we will - cycle through the shaders automatically */ - g_timeout_add_seconds (3, timeout_cb, actor); -#endif - - /* Show everying ( and map window ) */ - clutter_actor_show_all (stage); - - clutter_main (); - - return EXIT_SUCCESS; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-stage-read-pixels.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-stage-read-pixels.c --- clutter-0.8.4/tests/test-stage-read-pixels.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-stage-read-pixels.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,155 +0,0 @@ -#include -#include - -#define DOT_SIZE 2 -#define TEX_SIZE 64 - -typedef struct _CallbackData CallbackData; - -struct _CallbackData -{ - ClutterActor *stage; - ClutterActor *tex; - ClutterActor *box; - ClutterMotionEvent event; - guint idle_source; -}; - -static ClutterActor * -make_label (void) -{ - ClutterActor *label; - gchar *text; - gchar *argv[] = { "ls", "--help", NULL }; - - label = clutter_label_new (); - clutter_label_set_font_name (CLUTTER_LABEL (label), "Sans 10"); - - if (g_spawn_sync (NULL, argv, NULL, - G_SPAWN_STDERR_TO_DEV_NULL | G_SPAWN_SEARCH_PATH, - NULL, NULL, &text, NULL, NULL, NULL)) - { - clutter_label_set_text (CLUTTER_LABEL (label), text); - g_free (text); - } - - return label; -} - -static ClutterActor * -make_tex (void) -{ - ClutterActor *tex = clutter_texture_new (); - - clutter_actor_set_size (tex, TEX_SIZE * 2, TEX_SIZE * 2); - - return tex; -} - -static ClutterActor * -make_box (void) -{ - ClutterActor *box; - static const ClutterColor blue = { 0x00, 0x00, 0xff, 0xff }; - - box = clutter_rectangle_new_with_color (&blue); - clutter_actor_set_size (box, DOT_SIZE + 2, DOT_SIZE + 2); - clutter_actor_hide (box); - - return box; -} - -static gboolean -on_motion_idle (gpointer user_data) -{ - CallbackData *data = (CallbackData *) user_data; - guchar *pixels, *p; - guint stage_width, stage_height; - gint x, y; - - data->idle_source = 0; - - clutter_actor_get_size (data->stage, &stage_width, &stage_height); - - x = CLAMP (data->event.x - TEX_SIZE / 2, 0, (int) stage_width - TEX_SIZE); - y = CLAMP (data->event.y - TEX_SIZE / 2, 0, (int) stage_height - TEX_SIZE); - - clutter_actor_set_position (data->box, x + TEX_SIZE / 2 - 1, - y + TEX_SIZE / 2 - 1); - clutter_actor_show (data->box); - /* Redraw so that the layouting will be done and the box will be - drawn in the right position */ - clutter_redraw (CLUTTER_STAGE (data->stage)); - - pixels = clutter_stage_read_pixels (CLUTTER_STAGE (data->stage), - x, y, TEX_SIZE, TEX_SIZE); - - /* Make a red dot in the center */ - p = pixels + (TEX_SIZE / 2 - DOT_SIZE / 2) * TEX_SIZE * 4 - + (TEX_SIZE / 2 - DOT_SIZE / 2) * 4; - for (y = 0; y < DOT_SIZE; y++) - { - for (x = 0; x < DOT_SIZE; x++) - { - *(p++) = 255; - memset (p, 0, 3); - p += 3; - } - p += TEX_SIZE * 4 - DOT_SIZE * 4; - } - - /* Set all of the alpa values to full */ - for (p = pixels + TEX_SIZE * TEX_SIZE * 4; p > pixels; p -= 4) - *(p - 1) = 255; - - clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (data->tex), - pixels, TRUE, - TEX_SIZE, TEX_SIZE, - TEX_SIZE * 4, 4, 0, NULL); - g_free (pixels); - - return FALSE; -} - -static gboolean -on_motion (ClutterActor *stage, ClutterMotionEvent *event, CallbackData *data) -{ - /* Handle the motion event in an idle handler so that multiple - events will be combined into one */ - if (data->idle_source == 0) - data->idle_source = clutter_threads_add_idle (on_motion_idle, data); - - data->event = *event; - - return FALSE; -} - -int -main (int argc, char **argv) -{ - CallbackData data; - - clutter_init (&argc, &argv); - - data.idle_source = 0; - data.stage = clutter_stage_get_default (); - - data.tex = make_tex (); - data.box = make_box (); - clutter_actor_set_position (data.tex, - clutter_actor_get_width (data.stage) - - clutter_actor_get_width (data.tex), - clutter_actor_get_height (data.stage) - - clutter_actor_get_height (data.tex)); - - clutter_container_add (CLUTTER_CONTAINER (data.stage), - make_label (), data.tex, data.box, NULL); - - g_signal_connect (data.stage, "motion-event", G_CALLBACK (on_motion), &data); - - clutter_actor_show (data.stage); - - clutter_main (); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-text.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-text.c --- clutter-0.8.4/tests/test-text.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-text.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,104 +0,0 @@ -#include - -#include -#include - -#define STAGE_WIDTH 640 -#define STAGE_HEIGHT 480 - -#define COLS 18 -#define ROWS 20 - -gboolean idle (gpointer data) -{ - ClutterActor *stage = CLUTTER_ACTOR (data); - - static GTimer *timer = NULL; - static int fps = 0; - - if (!timer) - { - timer = g_timer_new (); - g_timer_start (timer); - } - - if (g_timer_elapsed (timer, NULL) >= 1) - { - printf ("fps: %d\n", fps); - g_timer_start (timer); - fps = 0; - } - - clutter_actor_paint (stage); - ++fps; - - return TRUE; -} - -int -main (int argc, char *argv[]) -{ - ClutterActor *stage; - ClutterColor stage_color = { 0x00, 0x00, 0x00, 0xff }; - ClutterColor label_color = { 0xff, 0xff, 0xff, 0xff }; - - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT); - clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); - - { - gint row, col; - - for (row=0; row -#include - -/* each time the timeline animating the label completes, swap the direction */ -static void -timeline_completed (ClutterTimeline *timeline, - gpointer user_data) -{ - clutter_timeline_set_direction (timeline, - !clutter_timeline_get_direction (timeline)); - clutter_timeline_start (timeline); -} - -static gboolean -change_filter (gpointer actor) -{ - ClutterTextureQuality old_quality; - - old_quality = clutter_texture_get_filter_quality (actor); - switch (old_quality) - { - case CLUTTER_TEXTURE_QUALITY_LOW: - clutter_texture_set_filter_quality (actor, - CLUTTER_TEXTURE_QUALITY_MEDIUM); - g_print ("Setting texture rendering quality to medium\n"); - break; - case CLUTTER_TEXTURE_QUALITY_MEDIUM: - clutter_texture_set_filter_quality (actor, - CLUTTER_TEXTURE_QUALITY_HIGH); - g_print ("Setting texture rendering quality to high\n"); - break; - case CLUTTER_TEXTURE_QUALITY_HIGH: - clutter_texture_set_filter_quality (actor, - CLUTTER_TEXTURE_QUALITY_LOW); - g_print ("Setting texture rendering quality to low\n"); - break; - } - return TRUE; -} - -gint -main (int argc, char *argv[]) -{ - ClutterTimeline *timeline; - ClutterBehaviour *depth_behavior; - ClutterActor *stage; - ClutterActor *image; - ClutterColor stage_color = { 0x12, 0x34, 0x56, 0xff }; - GError *error; - - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); - clutter_stage_set_use_fog (CLUTTER_STAGE (stage), TRUE); - clutter_stage_set_fog (CLUTTER_STAGE (stage), 1.0, 10, -50); - - g_signal_connect (stage, - "button-press-event", G_CALLBACK (clutter_main_quit), - NULL); - - error = NULL; - image = clutter_texture_new_from_file (argv[1]?argv[1]:"redhand.png", &error); - if (error) - g_error ("Unable to load image: %s", error->message); - - if (!argv[1]) - g_print ("Hint: the redhand.png isn't a good test image for this test.\n" - "This test can take any clutter loadable image as an argument\n"); - - /* center the image */ - clutter_actor_set_position (image, - (clutter_actor_get_width (stage) - clutter_actor_get_width (image))/2, - (clutter_actor_get_height (stage) - clutter_actor_get_height (image))/2); - clutter_container_add (CLUTTER_CONTAINER (stage), image, NULL); - - timeline = clutter_timeline_new (60*5, 60); - g_signal_connect (timeline, - "completed", G_CALLBACK (timeline_completed), - NULL); - - depth_behavior = clutter_behaviour_depth_new ( - clutter_alpha_new_full (timeline, CLUTTER_ALPHA_RAMP_INC, NULL, NULL), - -2500, 400); - - clutter_behaviour_apply (depth_behavior, image); - - clutter_actor_show (stage); - clutter_timeline_start (timeline); - - g_timeout_add (10000, change_filter, image); - - clutter_main (); - - g_object_unref (depth_behavior); - g_object_unref (timeline); - - return EXIT_SUCCESS; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-textures.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-textures.c --- clutter-0.8.4/tests/test-textures.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-textures.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,114 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include - -guchar* -make_rgba_data (int width, int height, int bpp, int has_alpha, int *rowstride_p) -{ -#define CHECK_SIZE 20 - - gint x,y, rowstride, i = 0; - guchar *pixels; - - g_assert(bpp == 4); - g_assert(has_alpha == TRUE); - - rowstride = width * bpp; - *rowstride_p = rowstride; - - pixels = g_try_malloc (height * rowstride); - if (!pixels) - return NULL; - - for (y = 0; y < height; y++) - { - i = 0; - for (x = 0; x < width; x++) - { - guchar *p; - - p = pixels + y * rowstride + x * bpp; - - p[0] = p[1] = p[2] = 0; p[3] = 0xff; - - if (x && y && y % CHECK_SIZE && x % CHECK_SIZE) - { - if (x % CHECK_SIZE == 1) - { - if (++i > 3) - i = 0; - } - p[i] = 0xff; - } - } - } - - return pixels; -} - -#define SPIN() while (g_main_context_pending (NULL)) \ - g_main_context_iteration (NULL, FALSE); - -int -main (int argc, char *argv[]) -{ - ClutterActor *texture; - ClutterActor *stage; - gint i, j; - - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - clutter_actor_show_all (CLUTTER_ACTOR (stage)); - - SPIN(); - - for (i=100; i<=5000; i += 100) - for (j=0; j<4; j++) - { - const int width = i+j; - const int height = i+j; - const gboolean has_alpha = TRUE; - const int bpp = has_alpha ? 4 : 3; - int rowstride; - guchar *pixels; - - pixels = make_rgba_data (width, height, bpp, has_alpha, &rowstride); - if (!pixels) - g_error("No memory for %ix%i RGBA data failed", width, height); - - printf("o %ix%i texture... ", width, height); - - texture = clutter_texture_new (); - if (!clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (texture), - pixels, - has_alpha, - width, - height, - rowstride, - bpp, - 0, NULL)) - g_error("texture creation failed"); - g_free(pixels); - - printf("uploaded to texture...\n"); - - clutter_container_add (CLUTTER_CONTAINER (stage), texture, NULL); - clutter_actor_set_size (texture, 400, 400); - clutter_actor_show (texture); - - /* Hide & show to unreaise then realise the texture */ - clutter_actor_hide (texture); - clutter_actor_show (texture); - - SPIN(); - - clutter_container_remove (CLUTTER_CONTAINER (stage), texture, NULL); - } - - return EXIT_SUCCESS; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-threads.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-threads.c --- clutter-0.8.4/tests/test-threads.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-threads.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,247 +0,0 @@ -#include -#include -#include - -typedef struct -{ - ClutterActor *stage; - ClutterActor *label; - ClutterActor *progress; - - ClutterTimeline *timeline; - - volatile gboolean cancelled; -} TestThreadData; - -static TestThreadData * -test_thread_data_new (void) -{ - TestThreadData *data; - - data = g_new0 (TestThreadData, 1); - - return data; -} - -static void -test_thread_data_free (TestThreadData *data) -{ - g_object_unref (data->progress); - g_object_unref (data->label); - g_object_unref (data->stage); - g_object_unref (data->timeline); - - g_free (data); -} - -static gboolean -test_thread_done_idle (gpointer user_data) -{ - TestThreadData *data = user_data; - - g_print ("Thread completed\n"); - - clutter_label_set_text (CLUTTER_LABEL (data->label), "Completed"); - clutter_timeline_stop (data->timeline); - - test_thread_data_free (data); - - return FALSE; -} - -static GStaticPrivate test_thread_data = G_STATIC_PRIVATE_INIT; - -typedef struct -{ - gint count; - TestThreadData *thread_data; -} TestUpdate; - -static gboolean -update_label_idle (gpointer data) -{ - TestUpdate *update = data; - guint width; - gchar *text; - - text = g_strdup_printf ("Count to %d", update->count); - - clutter_label_set_text (CLUTTER_LABEL (update->thread_data->label), text); - clutter_actor_set_width (update->thread_data->label, -1); - - if (update->count == 0) - width = 0; - else if (update->count == 100) - width = 350; - else - width = (guint) (update->count / 100.0 * 350.0); - - clutter_actor_set_width (update->thread_data->progress, width); - - g_free (text); - g_free (update); - - return FALSE; -} - -static void -do_something_very_slow (void) -{ - TestThreadData *data; - gint i; - - data = (TestThreadData *) g_static_private_get (&test_thread_data); - if (data->cancelled) - return; - - for (i = 0; i < 100; i++) - { - gint msecs; - - msecs = 1 + (int) (100.0 * rand () / ((RAND_MAX + 1.0) / 3)); - - /* sleep for a while */ - g_usleep (msecs * 1000); - - if ((i % 10) == 0) - { - TestUpdate *update; - - update = g_new (TestUpdate, 1); - update->count = i; - update->thread_data = data; - - clutter_threads_add_idle_full (G_PRIORITY_DEFAULT + 30, - update_label_idle, - update, NULL); - } - } -} - -static gpointer -test_thread_func (gpointer user_data) -{ - TestThreadData *data; - - data = user_data; - g_static_private_set (&test_thread_data, data, NULL); - - do_something_very_slow (); - - clutter_threads_add_idle_full (G_PRIORITY_DEFAULT + 30, - test_thread_done_idle, - data, NULL); - - return NULL; -} - -static ClutterTimeline *timeline = NULL; -static ClutterActor *count_label = NULL; -static ClutterActor *help_label = NULL; -static ClutterActor *progress_rect = NULL; - -static void -on_key_press_event (ClutterStage *stage, - ClutterKeyEvent *event, - gpointer user_data) -{ - TestThreadData *data; - - switch (clutter_key_event_symbol (event)) - { - case CLUTTER_s: - clutter_label_set_text (CLUTTER_LABEL (help_label), "Press 'q' to quit"); - - clutter_timeline_start (timeline); - - data = test_thread_data_new (); - data->stage = g_object_ref (stage); - data->label = g_object_ref (count_label); - data->progress = g_object_ref (progress_rect); - data->timeline = g_object_ref (timeline); - g_thread_create (test_thread_func, data, FALSE, NULL); - break; - case CLUTTER_q: - clutter_main_quit (); - break; - } -} - -int -main (int argc, char *argv[]) -{ - ClutterActor *stage; - ClutterActor *rect; - ClutterColor stage_color = { 0xcc, 0xcc, 0xcc, 0xff }; - ClutterColor rect_color = { 0xee, 0x55, 0x55, 0x99 }; - ClutterColor progress_color = { 0x55, 0xee, 0x55, 0xbb }; - ClutterBehaviour *r_behaviour, *p_behaviour; - const ClutterKnot knots[] = { - { 75, 150 }, - { 400, 150 } - }; - - g_thread_init (NULL); - clutter_threads_init (); - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); - clutter_actor_set_size (stage, 600, 300); - - count_label = clutter_label_new_with_text ("Mono 12", "Counter"); - clutter_actor_set_position (count_label, 350, 50); - - help_label = clutter_label_new_with_text ("Mono 12", "Press 's' to start"); - clutter_actor_set_position (help_label, 50, 50); - - rect = clutter_rectangle_new_with_color (&rect_color); - clutter_actor_set_position (rect, 75, 150); - clutter_actor_set_size (rect, 50, 50); - clutter_actor_set_anchor_point (rect, 25, 25); - - progress_rect = clutter_rectangle_new_with_color (&progress_color); - clutter_actor_set_position (progress_rect, 50, 225); - clutter_actor_set_size (progress_rect, 350, 50); - - clutter_container_add (CLUTTER_CONTAINER (stage), - count_label, help_label, - rect, progress_rect, - NULL); - - timeline = clutter_timeline_new (150, 50); - clutter_timeline_set_loop (timeline, TRUE); - r_behaviour = clutter_behaviour_rotate_new (clutter_alpha_new_full (timeline, - CLUTTER_ALPHA_RAMP_INC, - NULL, NULL), - CLUTTER_Z_AXIS, - CLUTTER_ROTATE_CW, - 0.0, 360.0); - clutter_behaviour_apply (r_behaviour, rect); - - p_behaviour = clutter_behaviour_path_new (clutter_alpha_new_full (timeline, - CLUTTER_ALPHA_SINE, - NULL, NULL), - knots, - G_N_ELEMENTS (knots)); - clutter_behaviour_apply (p_behaviour, rect); - - g_signal_connect (stage, - "button-press-event", G_CALLBACK (clutter_main_quit), - NULL); - g_signal_connect (stage, - "key-press-event", G_CALLBACK (on_key_press_event), - NULL); - - clutter_actor_show (stage); - - clutter_threads_enter (); - clutter_main (); - clutter_threads_leave (); - - g_object_unref (p_behaviour); - g_object_unref (r_behaviour); - g_object_unref (timeline); - - return EXIT_SUCCESS; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-timeline.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-timeline.c --- clutter-0.8.4/tests/test-timeline.c 2008-11-04 16:36:16.000000000 +0000 +++ clutter-0.9.0/tests/test-timeline.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,293 +0,0 @@ -#include -#include -#include -#include - -/* This test runs three timelines at 30 fps with 10 frames. Some of - the timelines have markers. Once the timelines are run it then - checks that all of the frames were hit, all of the markers were hit - and that the completed signal was fired. The timelines are then run - again but this time with a timeout source that introduces a - delay. This should cause some frames to be skipped. The test is run - again but only the markers and the completed signal is checked - for. */ - -#define FRAME_COUNT 10 - -typedef struct _TimelineData TimelineData; - -struct _TimelineData -{ - int timeline_num; - - guint frame_hit_count[FRAME_COUNT + 1]; - GSList *markers_hit; - guint completed_count; -}; - -static void -timeline_data_init (TimelineData *data, int timeline_num) -{ - memset (data, 0, sizeof (TimelineData)); - data->timeline_num = timeline_num; -} - -static void -timeline_data_destroy (TimelineData *data) -{ - g_slist_foreach (data->markers_hit, (GFunc) g_free, NULL); - g_slist_free (data->markers_hit); -} - -static void -timeline_complete_cb (ClutterTimeline *timeline, - TimelineData *data) -{ - printf ("%i: Completed\n", data->timeline_num); - data->completed_count++; -} - -static void -timeline_new_frame_cb (ClutterTimeline *timeline, - gint frame_no, - TimelineData *data) -{ - printf ("%i: Doing frame %d, delta = %i\n", - data->timeline_num, frame_no, - clutter_timeline_get_delta (timeline, NULL)); - data->frame_hit_count[frame_no]++; -} - -static void -timeline_marker_reached_cb (ClutterTimeline *timeline, - const gchar *marker_name, - guint frame_num, - TimelineData *data) -{ - printf ("%i: Marker `%s' (%d) reached, delta = %i\n", - data->timeline_num, marker_name, frame_num, - clutter_timeline_get_delta (timeline, NULL)); - data->markers_hit = g_slist_prepend (data->markers_hit, - g_strdup (marker_name)); -} - -static gboolean -check_timeline (ClutterTimeline *timeline, - TimelineData *data, - gboolean check_missed_frames) -{ - gchar **markers; - gsize n_markers; - guint *marker_reached_count; - gboolean succeeded = TRUE; - GSList *node; - int i; - int missed_frame_count = 0; - int frame_offset; - - if (clutter_timeline_get_direction (timeline) == CLUTTER_TIMELINE_BACKWARD) - frame_offset = 0; - else - frame_offset = 1; - - markers = clutter_timeline_list_markers (timeline, -1, &n_markers); - marker_reached_count = g_new0 (guint, n_markers); - - for (node = data->markers_hit; node; node = node->next) - { - for (i = 0; i < n_markers; i++) - if (!strcmp (node->data, markers[i])) - break; - - if (i < n_markers) - marker_reached_count[i]++; - else - { - printf ("FAIL: unknown marker '%s' hit for %i\n", - (char *) node->data, data->timeline_num); - succeeded = FALSE; - } - } - - for (i = 0; i < n_markers; i++) - if (marker_reached_count[i] != 1) - { - printf ("FAIL: marker '%s' hit %i times for %i\n", - markers[i], marker_reached_count[i], data->timeline_num); - succeeded = FALSE; - } - - if (check_missed_frames) - { - for (i = 0; i < FRAME_COUNT; i++) - if (data->frame_hit_count[i + frame_offset] != 1) - missed_frame_count++; - - if (missed_frame_count) - { - printf ("FAIL: missed %i frame%s for %i\n", - missed_frame_count, missed_frame_count == 1 ? "" : "s", - data->timeline_num); - succeeded = FALSE; - } - } - - if (data->completed_count != 1) - { - printf ("FAIL: timeline %i completed %i times\n", - data->timeline_num, data->completed_count); - succeeded = FALSE; - } - - g_strfreev (markers); - g_free (marker_reached_count); - - return succeeded; -} - -static gboolean -timeout_cb (gpointer data) -{ - clutter_main_quit (); - - return FALSE; -} - -static gboolean -delay_cb (gpointer data) -{ - /* Waste a bit of time so that it will skip frames */ - g_usleep (G_USEC_PER_SEC * 66 / 1000); - - return TRUE; -} - -int -main (int argc, char **argv) -{ - ClutterTimeline *timeline_1; - TimelineData data_1; - ClutterTimeline *timeline_2; - TimelineData data_2; - ClutterTimeline *timeline_3; - TimelineData data_3; - gchar **markers; - gsize n_markers; - int ret = EXIT_SUCCESS; - - clutter_init (&argc, &argv); - - timeline_data_init (&data_1, 1); - timeline_1 = clutter_timeline_new (FRAME_COUNT, 30); - clutter_timeline_add_marker_at_frame (timeline_1, "foo", 5); - clutter_timeline_add_marker_at_frame (timeline_1, "bar", 5); - clutter_timeline_add_marker_at_frame (timeline_1, "baz", 5); - clutter_timeline_add_marker_at_frame (timeline_1, "near-end-marker", 9); - clutter_timeline_add_marker_at_frame (timeline_1, "end-marker", 10); - markers = clutter_timeline_list_markers (timeline_1, 5, &n_markers); - g_assert (markers != NULL); - g_assert (n_markers == 3); - g_strfreev (markers); - - timeline_data_init (&data_2, 2); - timeline_2 = clutter_timeline_clone (timeline_1); - clutter_timeline_add_marker_at_frame (timeline_2, "bar", 2); - markers = clutter_timeline_list_markers (timeline_2, -1, &n_markers); - g_assert (markers != NULL); - g_assert (n_markers == 1); - g_assert (strcmp (markers[0], "bar") == 0); - g_strfreev (markers); - - timeline_data_init (&data_3, 3); - timeline_3 = clutter_timeline_clone (timeline_1); - clutter_timeline_set_direction (timeline_3, CLUTTER_TIMELINE_BACKWARD); - clutter_timeline_add_marker_at_frame (timeline_3, "foo", 5); - clutter_timeline_add_marker_at_frame (timeline_3, "baz", 8); - clutter_timeline_add_marker_at_frame (timeline_3, "near-end-marker", 1); - clutter_timeline_add_marker_at_frame (timeline_3, "end-marker", 0); - - g_signal_connect (timeline_1, - "marker-reached", G_CALLBACK (timeline_marker_reached_cb), - &data_1); - g_signal_connect (timeline_1, - "new-frame", G_CALLBACK (timeline_new_frame_cb), - &data_1); - g_signal_connect (timeline_1, - "completed", G_CALLBACK (timeline_complete_cb), - &data_1); - - g_signal_connect (timeline_2, - "marker-reached::bar", - G_CALLBACK (timeline_marker_reached_cb), - &data_2); - g_signal_connect (timeline_2, - "new-frame", G_CALLBACK (timeline_new_frame_cb), - &data_2); - g_signal_connect (timeline_2, - "completed", G_CALLBACK (timeline_complete_cb), - &data_2); - - g_signal_connect (timeline_3, - "marker-reached", G_CALLBACK (timeline_marker_reached_cb), - &data_3); - g_signal_connect (timeline_3, - "new-frame", G_CALLBACK (timeline_new_frame_cb), - &data_3); - g_signal_connect (timeline_3, - "completed", G_CALLBACK (timeline_complete_cb), - &data_3); - - printf ("Without delay...\n"); - - clutter_timeline_start (timeline_1); - clutter_timeline_start (timeline_2); - clutter_timeline_start (timeline_3); - - clutter_threads_add_timeout (2000, timeout_cb, NULL); - - clutter_main (); - - if (!check_timeline (timeline_1, &data_1, TRUE)) - ret = EXIT_FAILURE; - if (!check_timeline (timeline_2, &data_2, TRUE)) - ret = EXIT_FAILURE; - if (!check_timeline (timeline_3, &data_3, TRUE)) - ret = EXIT_FAILURE; - - printf ("With delay...\n"); - - timeline_data_destroy (&data_1); - timeline_data_init (&data_1, 1); - timeline_data_destroy (&data_2); - timeline_data_init (&data_2, 2); - timeline_data_destroy (&data_3); - timeline_data_init (&data_3, 3); - - clutter_timeline_start (timeline_1); - clutter_timeline_start (timeline_2); - clutter_timeline_start (timeline_3); - - clutter_threads_add_timeout (2000, timeout_cb, NULL); - clutter_threads_add_timeout (99, delay_cb, NULL); - - clutter_main (); - - if (!check_timeline (timeline_1, &data_1, FALSE)) - ret = EXIT_FAILURE; - if (!check_timeline (timeline_2, &data_2, FALSE)) - ret = EXIT_FAILURE; - if (!check_timeline (timeline_3, &data_3, FALSE)) - ret = EXIT_FAILURE; - - g_object_unref (timeline_1); - g_object_unref (timeline_2); - g_object_unref (timeline_3); - - timeline_data_destroy (&data_1); - timeline_data_destroy (&data_2); - timeline_data_destroy (&data_3); - - printf ("Overall result: %s\n", ret == EXIT_SUCCESS ? "PASS" : "FAIL"); - - return ret; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-timeline-dup-frames.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-timeline-dup-frames.c --- clutter-0.8.4/tests/test-timeline-dup-frames.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-timeline-dup-frames.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,97 +0,0 @@ -#include -#include -#include - -/* We use a nice slow timeline for this test since we - * dont want the timeouts to interpolate the timeline - * forward multiple frames */ -#define TEST_TIMELINE_FPS 10 -#define TEST_TIMELINE_FRAME_COUNT 20 - -typedef struct _TestState { - ClutterTimeline *timeline; - gint prev_frame; - gint completion_count; - gint passed; -}TestState; - - -static void -new_frame_cb (ClutterTimeline *timeline, - gint frame_num, - TestState *state) -{ - gint current_frame = clutter_timeline_get_current_frame (state->timeline); - - if (state->prev_frame != clutter_timeline_get_current_frame (state->timeline)) - { - g_print("timeline previous frame=%-4i actual frame=%-4i (OK)\n", - state->prev_frame, - current_frame); - } - else - { - g_print("timeline previous frame=%-4i actual frame=%-4i (FAILED)\n", - state->prev_frame, - current_frame); - - state->passed = FALSE; - } - - state->prev_frame = current_frame; -} - - -static void -completed_cb (ClutterTimeline *timeline, - TestState *state) -{ - state->completion_count++; - - if (state->completion_count == 2) - { - if (state->passed) - { - g_print("Passed\n"); - exit(EXIT_SUCCESS); - } - else - { - g_print("Failed\n"); - exit(EXIT_FAILURE); - } - } -} - - -int -main(int argc, char **argv) -{ - TestState state; - - clutter_init(&argc, &argv); - - state.timeline = - clutter_timeline_new (TEST_TIMELINE_FRAME_COUNT, - TEST_TIMELINE_FPS); - clutter_timeline_set_loop (state.timeline, TRUE); - g_signal_connect (G_OBJECT(state.timeline), - "new-frame", - G_CALLBACK(new_frame_cb), - &state); - g_signal_connect (G_OBJECT(state.timeline), - "completed", - G_CALLBACK(completed_cb), - &state); - - state.prev_frame = -1; - state.completion_count = 0; - state.passed = TRUE; - - clutter_timeline_start (state.timeline); - - clutter_main(); - - return EXIT_FAILURE; -} - diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-timeline-interpolate.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-timeline-interpolate.c --- clutter-0.8.4/tests/test-timeline-interpolate.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-timeline-interpolate.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,155 +0,0 @@ -#include -#include -#include - -/* We ask for 1 frame per millisecond. - * Whenever this rate can't be achieved then the timeline - * will interpolate the number frames that should have - * passed between timeouts. */ -#define TEST_TIMELINE_FPS 1000 -#define TEST_TIMELINE_FRAME_COUNT 5000 - -/* We are at the mercy of the system scheduler so this - * may not be a very reliable tolerance. */ -#define TEST_ERROR_TOLERANCE 20 - -typedef struct _TestState { - ClutterTimeline *timeline; - GTimeVal start_time; - guint new_frame_counter; - gint expected_frame; - gint completion_count; - gboolean passed; -}TestState; - - -static void -new_frame_cb (ClutterTimeline *timeline, - gint frame_num, - TestState *state) -{ - GTimeVal current_time; - gint current_frame; - glong msec_diff; - gint loop_overflow = 0; - static gint step = 1; - - g_get_current_time (¤t_time); - - current_frame = clutter_timeline_get_current_frame (state->timeline); - - msec_diff = (current_time.tv_sec - state->start_time.tv_sec) * 1000; - msec_diff += (current_time.tv_usec - state->start_time.tv_usec)/1000; - - /* If we expect to have interpolated past the end of the timeline - * we keep track of the overflow so we can determine when - * the next timeout will happen. We then clip expected_frames - * to TEST_TIMELINE_FRAME_COUNT since clutter-timeline - * semantics guaranty this frame is always signaled before - * looping */ - if (state->expected_frame > TEST_TIMELINE_FRAME_COUNT) - { - loop_overflow = state->expected_frame - TEST_TIMELINE_FRAME_COUNT; - state->expected_frame = TEST_TIMELINE_FRAME_COUNT; - } - - if (current_frame >= (state->expected_frame-TEST_ERROR_TOLERANCE) - && current_frame <= (state->expected_frame+TEST_ERROR_TOLERANCE)) - { - g_print ("\nelapsed milliseconds=%-5li expected frame=%-4i actual frame=%-4i (OK)\n", - msec_diff, - state->expected_frame, - current_frame); - } - else - { - g_print ("\nelapsed milliseconds=%-5li expected frame=%-4i actual frame=%-4i (FAILED)\n", - msec_diff, - state->expected_frame, - current_frame); - state->passed = FALSE; - } - - if (step>0) - { - state->expected_frame = current_frame + (TEST_TIMELINE_FPS / 4); - g_print ("Sleeping for 250ms so next frame should be (%i + %i) = %i\n", - current_frame, (TEST_TIMELINE_FPS / 4), state->expected_frame); - g_usleep (250000); - } - else - { - state->expected_frame = current_frame + TEST_TIMELINE_FPS; - g_print ("Sleeping for 1sec so next frame should be (%i + %i) = %i\n", - current_frame, TEST_TIMELINE_FPS, state->expected_frame); - g_usleep (1000000); - } - - if (current_frame >= TEST_TIMELINE_FRAME_COUNT) - { - state->expected_frame += loop_overflow; - state->expected_frame -= TEST_TIMELINE_FRAME_COUNT; - g_print ("End of timeline reached: Wrapping expected frame too %i\n", - state->expected_frame); - } - - state->new_frame_counter++; - step = -step; -} - - -static void -completed_cb (ClutterTimeline *timeline, - TestState *state) -{ - state->completion_count++; - - if (state->completion_count == 2) - { - if (state->passed) - { - g_print("Passed\n"); - exit(EXIT_SUCCESS); - } - else - { - g_print("Failed\n"); - exit(EXIT_FAILURE); - } - } -} - - -int -main (int argc, char **argv) -{ - TestState state; - - clutter_init (&argc, &argv); - - state.timeline = - clutter_timeline_new (TEST_TIMELINE_FRAME_COUNT, - TEST_TIMELINE_FPS); - clutter_timeline_set_loop (state.timeline, TRUE); - g_signal_connect (G_OBJECT(state.timeline), - "new-frame", - G_CALLBACK(new_frame_cb), - &state); - g_signal_connect (G_OBJECT(state.timeline), - "completed", - G_CALLBACK(completed_cb), - &state); - - state.completion_count = 0; - state.new_frame_counter = 0; - state.passed = TRUE; - state.expected_frame = 0; - - g_get_current_time (&state.start_time); - clutter_timeline_start (state.timeline); - - clutter_main(); - - return EXIT_FAILURE; -} - diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-timeline-rewind.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-timeline-rewind.c --- clutter-0.8.4/tests/test-timeline-rewind.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-timeline-rewind.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,96 +0,0 @@ -#include -#include -#include - -#define TEST_TIMELINE_FPS 10 -#define TEST_TIMELINE_FRAME_COUNT 5 -#define TEST_WATCHDOG_KICK_IN_SECONDS 10 - -typedef struct _TestState { - ClutterTimeline *timeline; - gint rewind_count; -}TestState; - - -static gboolean -watchdog_timeout (TestState *state) -{ - g_print ("Watchdog timer kicking in\n"); - g_print ("rewind_count=%i\n", state->rewind_count); - if (state->rewind_count <= 3) - { - /* The test has hung */ - g_print ("Failed (This test shouldn't have hung!)\n"); - exit (EXIT_FAILURE); - } - else - { - g_print ("Passed\n"); - exit (EXIT_SUCCESS); - } - - return FALSE; -} - - -static void -new_frame_cb (ClutterTimeline *timeline, - gint frame_num, - TestState *state) -{ - gint current_frame = clutter_timeline_get_current_frame (timeline); - - if (current_frame == TEST_TIMELINE_FRAME_COUNT) - { - g_print ("new-frame signal recieved (end of timeline)\n"); - g_print ("Rewinding timeline\n"); - clutter_timeline_rewind (timeline); - state->rewind_count++; - } - else - { - if (current_frame == 0) - { - g_print ("new-frame signal recieved (start of timeline)\n"); - } - else - { - g_print ("new-frame signal recieved (mid frame)\n"); - } - - if (state->rewind_count >= 2) - { - g_print ("Sleeping for 1 second\n"); - g_usleep (1000000); - } - } -} - - -int -main (int argc, char **argv) -{ - TestState state; - - clutter_init (&argc, &argv); - - state.timeline = - clutter_timeline_new (TEST_TIMELINE_FRAME_COUNT, - TEST_TIMELINE_FPS); - g_signal_connect (G_OBJECT(state.timeline), - "new-frame", - G_CALLBACK(new_frame_cb), - &state); - g_print ("Installing a watchdog timeout to determin if this test hangs\n"); - g_timeout_add (TEST_WATCHDOG_KICK_IN_SECONDS*1000, - (GSourceFunc)watchdog_timeout, - &state); - state.rewind_count = 0; - - clutter_timeline_start (state.timeline); - - clutter_main(); - - return EXIT_FAILURE; -} - diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-timeline-smoothness.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-timeline-smoothness.c --- clutter-0.8.4/tests/test-timeline-smoothness.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-timeline-smoothness.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,113 +0,0 @@ -#include -#include -#include - -#define TEST_TIMELINE_FPS 10 -#define TEST_TIMELINE_FRAME_COUNT 20 -#define TEST_ERROR_TOLERANCE 5 - -typedef struct _TestState { - ClutterTimeline *timeline; - GTimeVal start_time; - GTimeVal prev_frame_time; - guint frame; - gint completion_count; - gint passed; -}TestState; - - -static void -new_frame_cb (ClutterTimeline *timeline, - gint frame_num, - TestState *state) -{ - GTimeVal current_time; - glong total_elapsed_ms; - glong frame_elapsed_ms = 0; - gchar *bump = ""; - - g_get_current_time (¤t_time); - - total_elapsed_ms = (current_time.tv_sec - state->start_time.tv_sec) * 1000; - total_elapsed_ms += (current_time.tv_usec - state->start_time.tv_usec)/1000; - - if (state->frame>0) - { - frame_elapsed_ms = - (current_time.tv_sec - state->prev_frame_time.tv_sec) * 1000; - frame_elapsed_ms += - (current_time.tv_usec - state->prev_frame_time.tv_usec)/1000; - - if (ABS(frame_elapsed_ms - (1000/TEST_TIMELINE_FPS)) - > TEST_ERROR_TOLERANCE) - { - state->passed = FALSE; - bump = " (BUMP)"; - } - } - - g_print ("timeline frame=%-2d total elapsed=%-4li(ms) since last frame=%-4li(ms)%s\n", - clutter_timeline_get_current_frame(state->timeline), - total_elapsed_ms, - frame_elapsed_ms, - bump); - - state->prev_frame_time = current_time; - state->frame++; -} - - -static void -completed_cb (ClutterTimeline *timeline, - TestState *state) -{ - state->completion_count++; - - if (state->completion_count == 2) - { - if (state->passed) - { - g_print("Passed\n"); - exit(EXIT_SUCCESS); - } - else - { - g_print("Failed\n"); - exit(EXIT_FAILURE); - } - } -} - - -int -main(int argc, char **argv) -{ - TestState state; - - clutter_init (&argc, &argv); - - state.timeline = - clutter_timeline_new (TEST_TIMELINE_FRAME_COUNT, - TEST_TIMELINE_FPS); - clutter_timeline_set_loop (state.timeline, TRUE); - g_signal_connect (G_OBJECT(state.timeline), - "new-frame", - G_CALLBACK(new_frame_cb), - &state); - g_signal_connect (G_OBJECT(state.timeline), - "completed", - G_CALLBACK(completed_cb), - &state); - - state.frame = 0; - state.completion_count = 0; - state.passed = TRUE; - - g_get_current_time (&state.start_time); - clutter_timeline_start (state.timeline); - - clutter_main(); - - return EXIT_FAILURE; -} - diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-unproject.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-unproject.c --- clutter-0.8.4/tests/test-unproject.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-unproject.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,149 +0,0 @@ -#include - -#include -#include -#include - -ClutterActor *label; - -#define RECT_L 200 -#define RECT_T 150 -#define RECT_W 320 -#define RECT_H 240 - -gboolean -on_event (ClutterStage *stage, - ClutterEvent *event, - gpointer user_data) -{ - switch (event->type) - { - case CLUTTER_BUTTON_PRESS: - { - gint x, y; - ClutterActor * actor; - ClutterUnit xu2, yu2; - - clutter_event_get_coords (event, &x, &y); - - actor = clutter_stage_get_actor_at_pos (stage, x, y); - - - if (clutter_actor_transform_stage_point (actor, - CLUTTER_UNITS_FROM_DEVICE (x), - CLUTTER_UNITS_FROM_DEVICE (y), - &xu2, &yu2)) - { - gchar *txt; - - if (actor != CLUTTER_ACTOR (stage)) - txt = g_strdup_printf ("Click on rectangle\n" - "Screen coords: [%d, %d]\n" - "Local coords : [%d, %d]", - x, y, - CLUTTER_UNITS_TO_DEVICE (xu2), - CLUTTER_UNITS_TO_DEVICE (yu2)); - else - txt = g_strdup_printf ("Click on stage\n" - "Screen coords: [%d, %d]\n" - "Local coords : [%d, %d]", - x, y, - CLUTTER_UNITS_TO_DEVICE (xu2), - CLUTTER_UNITS_TO_DEVICE (yu2)); - - clutter_label_set_text (CLUTTER_LABEL (label), txt); - g_free (txt); - } - else - clutter_label_set_text (CLUTTER_LABEL (label), - "Unprojection failed."); - } - break; - - default: - break; - } - - return FALSE; -} - - -int -main (int argc, char *argv[]) -{ - gchar *txt; - ClutterActor *rect, *stage, *label0; - int i, rotate_x = 0, rotate_y = 60, rotate_z = 0; - ClutterColor stage_clr = { 0x0, 0x0, 0x0, 0xff }, - white = { 0xff, 0xff, 0xff, 0xff }, - blue = { 0, 0xff, 0xff, 0xff }; - - for (i = 0; i < argc; ++i) - { - if (!strncmp (argv[i], "--rotate-x", 10)) - { - rotate_x = atoi (argv[i] + 11); - } - else if (!strncmp (argv[i], "--rotate-y", 10)) - { - rotate_y = atoi (argv[i] + 11); - } - else if (!strncmp (argv[i], "--rotate-z", 10)) - { - rotate_z = atoi (argv[i] + 11); - } - else if (!strncmp (argv[i], "--help", 6)) - { - printf ("%s [--rotage-x=degrees] [--rotage-y=degrees] " - "[--rotage-z=degrees]\n", - argv[0]); - - exit (0); - } - } - - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - - clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_clr); - clutter_actor_set_size (stage, 640, 480); - - rect = clutter_rectangle_new_with_color (&white); - clutter_actor_set_size (rect, RECT_W, RECT_H); - clutter_actor_set_position (rect, RECT_L, RECT_T); - clutter_actor_set_rotation (rect, CLUTTER_X_AXIS, rotate_x, 0, 0, 0); - clutter_actor_set_rotation (rect, CLUTTER_Y_AXIS, rotate_y, 0, 0, 0); - clutter_actor_set_rotation (rect, CLUTTER_Z_AXIS, rotate_z, 0, 0, 0); - clutter_group_add (CLUTTER_GROUP (stage), rect); - - txt = g_strdup_printf ("Rectangle: L %d, R %d, T %d, B %d\n" - "Rotation : x %d, y %d, z %d", - RECT_L, RECT_L + RECT_W, - RECT_T, RECT_T + RECT_H, - rotate_x, rotate_y, rotate_z); - - label0 = clutter_label_new_with_text ("Mono 8pt", txt); - clutter_label_set_color (CLUTTER_LABEL (label0), &white); - - clutter_actor_set_position (label0, 10, 10); - clutter_group_add (CLUTTER_GROUP (stage), label0); - - g_free (txt); - - label = - clutter_label_new_with_text ("Mono 8pt", "Click around!"); - - clutter_label_set_color (CLUTTER_LABEL (label), &blue); - - clutter_actor_set_position (label, 10, 50); - clutter_group_add (CLUTTER_GROUP (stage), label); - - clutter_actor_show_all (stage); - - g_signal_connect (stage, "event", G_CALLBACK (on_event), NULL); - - clutter_main(); - - return EXIT_SUCCESS; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/test-viewport.c /tmp/VXszleoOf1/clutter-0.9.0/tests/test-viewport.c --- clutter-0.8.4/tests/test-viewport.c 2008-09-29 15:16:26.000000000 +0100 +++ clutter-0.9.0/tests/test-viewport.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,65 +0,0 @@ -#include -#include -#include - -#include - -#include - -int -main (int argc, char *argv[]) -{ - ClutterTimeline *timeline; - ClutterAlpha *alpha; - ClutterBehaviour *r_behave; - ClutterActor *stage; - ClutterActor *hand; - ClutterColor stage_color = { 0xcc, 0xcc, 0xcc, 0xff }; - - clutter_init (&argc, &argv); - - stage = clutter_stage_get_default (); - - clutter_stage_set_color (CLUTTER_STAGE (stage), - &stage_color); - - /* Make a hand */ - hand = clutter_texture_new_from_file ("redhand.png", NULL); - if (!hand) - g_error("pixbuf load failed"); - - clutter_actor_set_position (hand, 300, 200); - clutter_actor_set_clip (hand, 20, 21, 132, 170); - clutter_actor_set_anchor_point (hand, 86, 125); - clutter_actor_show (hand); - clutter_container_add_actor (CLUTTER_CONTAINER (stage), hand); - - /* Make a timeline */ - timeline = clutter_timeline_new (200, 26); /* num frames, fps */ - g_object_set (timeline, "loop", TRUE, NULL); - - /* Set an alpha func to power behaviour - ramp is constant rise/fall */ - alpha = clutter_alpha_new_full (timeline, - CLUTTER_ALPHA_RAMP_INC, - NULL, NULL); - - /* Create a behaviour for that alpha */ - r_behave = clutter_behaviour_rotate_new (alpha, - CLUTTER_Z_AXIS, - CLUTTER_ROTATE_CW, - 0.0, 360.0); - - /* Apply it to our actor */ - clutter_behaviour_apply (r_behave, hand); - - /* start the timeline and thus the animations */ - clutter_timeline_start (timeline); - - clutter_actor_show_all (stage); - - clutter_main(); - - g_object_unref (r_behave); - - return 0; -} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/tools/disable-npots.c /tmp/VXszleoOf1/clutter-0.9.0/tests/tools/disable-npots.c --- clutter-0.8.4/tests/tools/disable-npots.c 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/tools/disable-npots.c 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,91 @@ +/* + * This file can be build as a shared library and then used as an + * LD_PRELOAD to fake a system where NPOTs is not supported. It simply + * overrides glGetString and removes the extension strings. + */ + +/* This is just included to get the right GL header */ +#include + +#include +#include +#include +#include +#include + +/* If RTLD_NEXT isn't available then try just using NULL */ +#ifdef RTLD_NEXT +#define LIB_HANDLE RTLD_NEXT +#else +#define LIB_HANDLE NULL +#endif + +typedef const GLubyte * (* GetStringFunc) (GLenum name); + +static const char * const bad_strings[] += { "GL_ARB_texture_non_power_of_two", + "GL_ARB_texture_rectangle", + "GL_EXT_texture_rectangle", + NULL }; + +const GLubyte * +glGetString (GLenum name) +{ + const GLubyte *ret = NULL; + static GetStringFunc func = NULL; + static GLubyte *extensions = NULL; + + if (func == NULL + && (func = (GetStringFunc) dlsym (LIB_HANDLE, "glGetString")) == NULL) + fprintf (stderr, "dlsym: %s\n", dlerror ()); + else if (func == glGetString) + fprintf (stderr, "dlsym returned the wrapper of glGetString\n"); + else + { + ret = (* func) (name); + + if (name == GL_EXTENSIONS) + { + if (extensions == NULL) + { + if ((extensions = (GLubyte *) strdup ((char *) ret)) == NULL) + fprintf (stderr, "strdup: %s\n", strerror (errno)); + else + { + GLubyte *dst = extensions, *src = extensions; + + while (1) + { + const char * const *str = bad_strings; + GLubyte *end; + + while (isspace (*src)) + *(dst++) = *(src++); + + if (*src == 0) + break; + + for (end = src + 1; *end && !isspace (*end); end++); + + while (*str && strncmp ((char *) src, *str, end - src)) + str++; + + if (*str == NULL) + { + memcpy (dst, src, end - src); + dst += end - src; + } + + src = end; + } + + *dst = '\0'; + } + } + + ret = extensions; + } + } + + return ret; +} diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/tools/disable-npots.sh.in /tmp/VXszleoOf1/clutter-0.9.0/tests/tools/disable-npots.sh.in --- clutter-0.8.4/tests/tools/disable-npots.sh.in 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/tools/disable-npots.sh.in 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,15 @@ +#!/bin/sh + +# This script sets up the LD_PRELOAD environment to use +# libdisable-npots.la + +# Read the .la file so we can get the library name +. "--builddir--/tests/tools/libdisable-npots.la" + +if test -n "$LD_PRELOAD"; then + LD_PRELOAD="${LD_PRELOAD}:"; +fi + +export LD_PRELOAD="${LD_PRELOAD}--builddir--/tests/tools/.libs/${dlname}" + +exec "$@" diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/tools/Makefile.am /tmp/VXszleoOf1/clutter-0.9.0/tests/tools/Makefile.am --- clutter-0.8.4/tests/tools/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/tools/Makefile.am 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,28 @@ +lib_LTLIBRARIES = + +if HAVE_LIBDL + +lib_LTLIBRARIES += libdisable-npots.la + +endif + +libdisable_npots_la_SOURCES = disable-npots.c + +libdisable_npots_la_LIBADD = -ldl + +INCLUDES = \ + -I$(top_srcdir)/clutter \ + -I$(top_builddir)/clutter \ + $(CLUTTER_CFLAGS) \ + -D_GNU_SOURCE + +all-local : disable-npots.sh + +clean-local : + rm -f disable-npots.sh + +disable-npots.sh : $(top_builddir)/tests/tools/disable-npots.sh.in + sed 's|--builddir--|'`cd '$(top_builddir)' && pwd`'|' < $< > $@ && \ + chmod 755 disable-npots.sh + +EXTRA_DIST = README disable-npots.sh.in diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/tools/Makefile.in /tmp/VXszleoOf1/clutter-0.9.0/tests/tools/Makefile.in --- clutter-0.8.4/tests/tools/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/tools/Makefile.in 2009-01-28 16:48:58.000000000 +0000 @@ -0,0 +1,539 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@HAVE_LIBDL_TRUE@am__append_1 = libdisable-npots.la +subdir = tests/tools +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libdisable_npots_la_DEPENDENCIES = +am_libdisable_npots_la_OBJECTS = disable-npots.lo +libdisable_npots_la_OBJECTS = $(am_libdisable_npots_la_OBJECTS) +@HAVE_LIBDL_TRUE@am_libdisable_npots_la_rpath = -rpath $(libdir) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libdisable_npots_la_SOURCES) +DIST_SOURCES = $(libdisable_npots_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CLUTTER_API_VERSION = @CLUTTER_API_VERSION@ +CLUTTER_CFLAGS = @CLUTTER_CFLAGS@ +CLUTTER_COGL = @CLUTTER_COGL@ +CLUTTER_DEBUG_CFLAGS = @CLUTTER_DEBUG_CFLAGS@ +CLUTTER_DEPS_CFLAGS = @CLUTTER_DEPS_CFLAGS@ +CLUTTER_DEPS_LIBS = @CLUTTER_DEPS_LIBS@ +CLUTTER_FLAVOUR = @CLUTTER_FLAVOUR@ +CLUTTER_GL_HEADER = @CLUTTER_GL_HEADER@ +CLUTTER_LIBS = @CLUTTER_LIBS@ +CLUTTER_LT_LDFLAGS = @CLUTTER_LT_LDFLAGS@ +CLUTTER_LT_VERSION = @CLUTTER_LT_VERSION@ +CLUTTER_MAJORMINOR = @CLUTTER_MAJORMINOR@ +CLUTTER_MAJOR_VERSION = @CLUTTER_MAJOR_VERSION@ +CLUTTER_MICRO_VERSION = @CLUTTER_MICRO_VERSION@ +CLUTTER_MINOR_VERSION = @CLUTTER_MINOR_VERSION@ +CLUTTER_REQUIRES = @CLUTTER_REQUIRES@ +CLUTTER_STAGE_TYPE = @CLUTTER_STAGE_TYPE@ +CLUTTER_VERSION = @CLUTTER_VERSION@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GCC_FLAGS = @GCC_FLAGS@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_PREFIX = @GLIB_PREFIX@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +JSON_PREFIX = @JSON_PREFIX@ +JW = @JW@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGO_PREFIX = @PANGO_PREFIX@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +RANLIB = @RANLIB@ +SDL_CONFIG = @SDL_CONFIG@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TSLIB_CFLAGS = @TSLIB_CFLAGS@ +TSLIB_LIBS = @TSLIB_LIBS@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XINPUT_CFLAGS = @XINPUT_CFLAGS@ +XINPUT_LIBS = @XINPUT_LIBS@ +XMKMF = @XMKMF@ +XMLTO = @XMLTO@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +backendextra = @backendextra@ +backendextralib = @backendextralib@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +clutterbackend = @clutterbackend@ +clutterbackendlib = @clutterbackendlib@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +imagebackend = @imagebackend@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +lib_LTLIBRARIES = $(am__append_1) +libdisable_npots_la_SOURCES = disable-npots.c +libdisable_npots_la_LIBADD = -ldl +INCLUDES = \ + -I$(top_srcdir)/clutter \ + -I$(top_builddir)/clutter \ + $(CLUTTER_CFLAGS) \ + -D_GNU_SOURCE + +EXTRA_DIST = README disable-npots.sh.in +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/tools/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/tools/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libdisable-npots.la: $(libdisable_npots_la_OBJECTS) $(libdisable_npots_la_DEPENDENCIES) + $(LINK) $(am_libdisable_npots_la_rpath) $(libdisable_npots_la_OBJECTS) $(libdisable_npots_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disable-npots.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) all-local +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am all-local check check-am clean \ + clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ + ctags distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libLTLIBRARIES install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-libLTLIBRARIES + + +all-local : disable-npots.sh + +clean-local : + rm -f disable-npots.sh + +disable-npots.sh : $(top_builddir)/tests/tools/disable-npots.sh.in + sed 's|--builddir--|'`cd '$(top_builddir)' && pwd`'|' < $< > $@ && \ + chmod 755 disable-npots.sh +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/tests/tools/README /tmp/VXszleoOf1/clutter-0.9.0/tests/tools/README --- clutter-0.8.4/tests/tools/README 1970-01-01 01:00:00.000000000 +0100 +++ clutter-0.9.0/tests/tools/README 2009-01-28 08:12:47.000000000 +0000 @@ -0,0 +1,2 @@ +This is a place holder for tools such as gltrace like libraries + diff -Nru /tmp/KiLtNNiWKF/clutter-0.8.4/TODO /tmp/VXszleoOf1/clutter-0.9.0/TODO --- clutter-0.8.4/TODO 2008-09-29 15:16:27.000000000 +0100 +++ clutter-0.9.0/TODO 2009-01-28 08:12:44.000000000 +0000 @@ -1,43 +1,7 @@ TODO ==== -$LastChangedDate: 2007-12-24 12:13:31 +0000 (Mon, 24 Dec 2007) $ +See http://bugzilla.openedhand.com using the product Clutter and +the target milestone of '1.0'. -0.6 -=== - -Definetly: - - * More ClutterUnits support, convert actor API to units. - * Fragment shader support infrastructure - * XML/JSON type 'layout' files - include actors + behaviours + timeline etc. - - App developers manual. - * Events for Actors - * Add 'sensitive' property, false by default. Only pick sensitive actors - * Very simple focus model - actors have a focus flag and if set emit - key events. - * Motion events need to be explicitly enabled. - - Mipmaps for pango renderer to improving text scaling quality - * ClutterScore - * Class for chaining timelines together - -Nice/Maybe: - - - Lookat type functionality. - - Improve cogl massively to be be processing like. - - Gradient support ? - - Rectangle like props to all actors - - Glitz integration - * Some kind of focus model. - * Apple/Win native backends. - * ClutterBehaviourDepth (trivial) - - ClutterTextureAnimation (trivial) - - Glitz backend over GLX (would cover above) - -(Also see bugzilla.o-hand.com bug with 0.6 milestones for more - detail/status on the above) - -0.8 -=== - - - ? +$LastChangedDate$