Commit Graph

26 Commits

Author SHA1 Message Date
Emmanuele Bassi
c69bb976b3 Annotate all public symbols
We are going to switch to compiler annotations to determine the
visibility of the symbols.
2014-03-17 18:53:27 +00:00
Emmanuele Bassi
0fc4053613 color: Add initializers for ClutterColor
Similar to the ones we have for the other boxed types in Clutter.
2012-04-27 12:30:47 +01:00
Emmanuele Bassi
d28e04be72 Move all enumerations to a separate file
This should allow sharing types, and we can avoid glib-mkenums thrawling
the whole repository for enumerations.
2011-10-11 17:59:46 +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
Damien Lespiau
6100aee5bd color: Mark the new static color API as being new from 1.6
The patch was written a while ago but only merged in the 1.5.x cycle.
2011-01-17 15:22:48 +00:00
Emmanuele Bassi
ae4e06d8c4 introspection: Skip some C-only structures
The ParamSpec sub-classes we define are meant to be used only from the C
API, as high-level languages completely ignore them.

The ClutterStageWindow interface is an internal type that escaped into
the public headers; all its methods are private, but we cannot remove
the type until we break for 2.0.
2010-12-10 17:15:39 +00:00
Emmanuele Bassi
694632ce95 build: Re-arrange headers
Try to minimize the included headers, especially in clutter-actor.h.
2010-11-18 18:23:49 +00:00
Emmanuele Bassi
1ce47bb562 docs: Remove unnecessary '#'
The hash is confusing gtk-doc.
2010-11-18 15:04:33 +00:00
Emmanuele Bassi
985518c601 color: Add named, global colors
Since EGA colors are apparently all the rage in other toolkits, Clutter
should not be left out. On top of the usual CGA/EGA palette the static
colors also include the Tango Icon palette, which at least is more
pleasant to the eye.

Static colors are accessed through an enumeration by using
clutter_color_get_static(), or using the short-hand pre-processor
macros.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2066
2010-11-11 13:14:23 +00:00
Emmanuele Bassi
d5376bf317 color: Add Color.interpolate() method
The interpolate() method does what it says on the tin: it interpolates
between two colors using the given factor.

ClutterColor uses it to register a progress function for Intervals.
2010-10-11 15:39:19 +01:00
Damien Lespiau
30b5dac7c3 [misc] Update headers #endif comments
While grepping through the public headers looking for invalid use of
private HAVE_* defines, I stumbled upon two out of sync comments. Yes
it's a very minor trivial change.
2009-06-29 21:37:02 +02:00
Emmanuele Bassi
7d674db9d2 Clean up of the ClutterColor API
The ClutterColor API has some inconsistencies:

  - the string deserialization function does not match the rest of
    the conversion function naming policy; the naming should be:

        clutter_color_parse()   ->      clutter_color_from_string()

    and the first parameter should be the ClutterColor that will
    be set from the string, not the string itself (a GDK-ism).

  - the fixed point API should not be exposed, especially in the
    form of ClutterFixed values

  - the non-fixed point HLS conversion functions do not make any
    sense. The values returned should be:

      hue        := range [ 0, 360 ]
      luminance  := range [ 0,   1 ]
      saturation := range [ 0,   1 ]

    like the current fixed point API does. Returning a value in
    the [ 0, 255 ] range is completely useless

  - the clutter_color_equal() should be converted for its use inside
    a GHashTable; a clutter_color_hash() should be added as well

  - the second parameter of the clutter_color_shade() function should
    be the shading factor, not the result (another GDK-ism). this way
    the function call can be translated from this:

      color.shade(out result, factor)

    to the more natural:

      color.shade(factor, out result)

This somewhat large commit fixes all these issues and updates the
internal users of the API.
2009-03-10 12:38:02 +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
3ced5a9086 2008-10-21 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-color.[ch] (clutter_value_set_color): Constify
	colors and values where needed.
2008-10-21 18:50:44 +00:00
Emmanuele Bassi
0cd9345864 Declare clutter_color_new() 2008-10-20 10:36:41 +00:00
Emmanuele Bassi
8f1819cd52 2008-10-17 Thomas Wood <thomas@linux.intel.com>
reviewed by: Emmanuele Bassi <ebassi@linux.intel.com>

	* 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 16:23:46 +00:00
Emmanuele Bassi
f57edd70d3 Even more documentation fixes 2007-08-07 14:03:58 +00:00
Tomas Frydrych
c5fee48847 added clutter_color_to/from_hlsx(); clobbered hue to 0..255 in clutter_colour_to/from_hls() 2007-05-10 11:37:45 +00:00
Emmanuele Bassi
4bd3fa583e 2007-03-22 Emmanuele Bassi <ebassi@openedhand.com>
* 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.
2007-03-22 18:21:59 +00:00
Emmanuele Bassi
9bd77e25b2 2007-01-17 Emmanuele Bassi <ebassi@openedhand.com>
* 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 13:51:14 +00:00
Tomas Frydrych
3b7a8c0c5c replacement of floating point ops with fixed point 2007-01-16 10:39:18 +00:00
Emmanuele Bassi
89de2fa269 2006-12-27 Emmanuele Bassi <ebassi@openedhand.com>
* 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-27 18:19:34 +00:00
Emmanuele Bassi
9118c2ef99 2006-12-14 Emmanuele Bassi <ebassi@openedhand.com>
* 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-14 22:19:08 +00:00
Emmanuele Bassi
b45b844004 2006-12-05 Emmanuele Bassi <ebassi@openedhand.com>
* 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-05 04:56:24 +00:00
Emmanuele Bassi
f6fe9e7412 2006-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* 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-05 13:38:31 +00:00
Matthew Allum
342ea125f1 Merge gobject-branch into trunk 2006-05-29 08:59:36 +00:00