Commit Graph

22 Commits

Author SHA1 Message Date
Emmanuele Bassi
63e909576a Deprecate State and Animator
The PropertyTransition, KeyframeTransition, and TransitionGroup classes
can effectively replace Animator and State in their common usage.
2012-04-27 12:30:48 +01:00
Emmanuele Bassi
7646404196 script: Support translatable strings for properties
ClutterScript should be able to automatically call gettext() and friends
on strings loaded from a UI definition, prior to passing the string to
the object it is constructing.

The basic implementation is trivial:

  - set a translation domain on the ClutterScript instance
  - mark the translatable strings inside the JSON data, like:

      "property" : {
        "translatable" : true,
        "string" : "a translatable string"
      }

The hard part is now getting the tools we use to extract the
translatable strings to understand the JSON format we use inside
ClutterScript.
2012-03-06 14:23:33 +00:00
Emmanuele Bassi
fb9df4bef2 Annotate all functions available since 1.10 2012-02-27 16:35:09 +00:00
Emmanuele Bassi
8d8d4ae7e5 script: Add loading from a resource
GLib has gained support for compiling ancillary data files into the same
binary blob as a library or as an executable.

We should add this feature to ClutterScript, so that it's possible to
bundle UI definitions with an application.
2012-01-24 12:04:56 +00:00
Emmanuele Bassi
809298b5a2 Move more typedefs into clutter-types.h 2011-10-11 17:59:50 +01:00
Emmanuele Bassi
b33973f9f8 script: Rename "state" → "states"
Make it clear that the key used when defining a state-based signal is
linked to the states of a ClutterState.
2011-06-13 13:47:08 +01:00
Emmanuele Bassi
29d7c5a297 script: Allow resolving signals states added from code
Currently, defining states for object signals can only be done by
defining a ClutterState inside the ClutterScript definition. We should
allow creating a (named) ClutterState in code, and associating it to a
ClutterScript instance — and have the Script resolve the "state" field
of a signal definition correctly.
2011-06-13 13:47:08 +01:00
Emmanuele Bassi
2b81d90dd7 Eliminate G_CONST_RETURN
The G_CONST_RETURN define in GLib is, and has always been, a bit fuzzy.

We always used it to conform to the platform, at least for public-facing
API.

At first I assumed it has something to do with brain-damaged compilers
or with weird platforms where const was not really supported; sadly,
it's something much, much worse: it's a define that can be toggled at
compile-time to remove const from the signature of public API. This is a
truly terrifying feature that I assume was added in the past century,
and whose inception clearly had something to do with massive doses of
absynthe and opium — because any other explanation would make the
existence of such a feature even worse than assuming drugs had anything
to do with it.

Anyway, and pleasing the gods, this dubious feature is being
removed/deprecated in GLib; see bug:

  https://bugzilla.gnome.org/show_bug.cgi?id=644611

Before deprecation, though, we should just remove its usage from the
whole API. We should especially remove its usage from Cally's internals,
since there it never made sense in the first place.
2011-06-07 16:06:24 +01:00
Emmanuele Bassi
9229fb6114 [docs] Bring down the undocumented symbols to 2%
The usual pre-release documentation blitzing. Most of the remaining
symbols are either COGL or X11 specific, or dummy interface typedefs.
2009-03-16 15:00:55 +00:00
Emmanuele Bassi
a32eca26b6 2008-10-30 Emmanuele Bassi <ebassi@linux.intel.com>
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 17:04:34 +00:00
Emmanuele Bassi
c34e17163d 2008-08-27 Emmanuele Bassi <ebassi@openedhand.com>
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-27 12:16:56 +00:00
Emmanuele Bassi
5521867989 2008-06-24 Emmanuele Bassi <ebassi@openedhand.com>
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 16:47:43 +00:00
Emmanuele Bassi
cbddf6aa1a 2008-01-18 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.h:
	* clutter/clutter-script.h:
	* clutter/clutter-stage.h:
	* clutter/clutter-units.h: Documentation fixes and additions.
2008-01-18 11:25:47 +00:00
Emmanuele Bassi
6fae4bcfc9 2007-12-06 Emmanuele Bassi <ebassi@openedhand.com>
* 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 11:25:16 +00:00
Emmanuele Bassi
fd0e52848b 2007-11-18 Emmanuele Bassi <ebassi@openedhand.com>
* 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 15:41:47 +00:00
Emmanuele Bassi
960619b9e3 2007-11-15 Emmanuele Bassi <ebassi@openedhand.com>
* 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 15:24:43 +00:00
Emmanuele Bassi
b0e169d73c 2007-11-14 Emmanuele Bassi <ebassi@openedhand.com>
* 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 11:32:24 +00:00
Emmanuele Bassi
35132fb5de 2007-10-27 Emmanuele Bassi <ebassi@openedhand.com>
* 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 19:08:59 +00:00
Emmanuele Bassi
6ab8c4d28a 2007-10-26 Emmanuele Bassi <ebassi@openedhand.com>
* 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-26 09:05:06 +00:00
Emmanuele Bassi
f1105807fb 2007-10-18 Emmanuele Bassi <ebassi@openedhand.com>
* 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)
2007-10-18 12:31:07 +00:00
Emmanuele Bassi
ac9aa06fcf 2007-10-09 Emmanuele Bassi <ebassi@openedhand.com>
* 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 13:29:03 +00:00
Emmanuele Bassi
991562f536 2007-10-08 Emmanuele Bassi <ebassi@openedhand.com>
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 15:03:22 +00:00