Commit Graph

20 Commits

Author SHA1 Message Date
Emmanuele Bassi
e3259435f2 2.0: Remove all Since: annotations
We're starting from scratch.
2013-04-05 18:48:01 +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
Bastian Winkler
8e1c1909f8 model: Change the column argument type to gint for clutter_model_set_sort
Like in clutter_model_set_sorting_column this function should take a
gint column, otherwise GObject-Introspection won't allow to pass a NULL
sorting function.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2527
2011-01-21 20:42:52 +00:00
Emmanuele Bassi
4f5a5f38f7 Add more padding in Model and ModelIter classes
ClutterModel and ClutterModelIter have 4 padding slots, but if they
have to survive the 1.x API cycle they will need at least twice that
amount.
2009-05-20 16:06:09 +01:00
Emmanuele Bassi
01d172293c [model] Rework Model behaviour with a filter
Currently ClutterModel::get_iter_at_row() ignores whether we have
a filter in place. This also extends to the get_n_rows() method.

The more consistent, more intuitive and surely more correct way to
handle a Model with a filter in place is to take into account the
presence of the filter itself -- that is:

  - get_n_rows() should take into account the filter and return the
    number of *filtered* rows

  - get_iter_at_row() should also take the filter into account and
    get the first non-filtered row

These two changes make the ClutterModel with a filter function
behave like a subset of the original Model without a filter in
place.

For instance, given a model with three rows:

  - [row 0]     <does not match filter>
  - [row 1]     <matches filter>
  - [row 2]     <matches filter>
  - [row 3]     <does not match filter>

The get_n_rows() method will return "2", since only two rows will
match the filter; the get_first_iter() method will ask for the
zero-eth row, which will return an iterator pointing to the contents
of row 1 (but the :row property of the iterator will be set to 0);
the get_last_iter() method will ask for the last row, which will
return an iterator pointing to the contents of row 2 (but the :row
property of the iterator will be set to 1).

This changes will hopefully make the Model API more consistent
in its usage whether there is a filter in place or not.
2009-04-29 15:26:05 +01:00
Emmanuele Bassi
44fefa2afe [model] Add :filter-set
Currently, there is no way for implementations of the ClutterModel
abstract class to know whether there is a filter in place. Since
subclasses might implement some optimization in case there is no
filter present, we need a simple (and public) API to ask the model
itself.
2009-04-29 15:14:40 +01: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
f6dce7f9e5 2008-05-15 Emmanuele Bassi <ebassi@openedhand.com>
* 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.

	* tests/test-pixmap.c (create_pixmap), (main): Fix preprocessor
	directives.
2008-05-15 14:31:43 +00:00
Emmanuele Bassi
7c05499865 2008-03-19 Emmanuele Bassi <ebassi@openedhand.com>
* 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 18:33:33 +00:00
Emmanuele Bassi
ccc4ad400b 2008-01-14 Emmanuele Bassi <ebassi@openedhand.com>
* clutter.symbols: Add clutter_model_insertv()

	* clutter/clutter-model.[ch] (clutter_model_insertv): Add a vector
	based insertion API, for language bindings
2008-01-14 10:13:35 +00:00
Emmanuele Bassi
09263f94b0 2008-01-07 Emmanuele Bassi <ebassi@openedhand.com>
* 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-07 17:17:43 +00:00
Emmanuele Bassi
5eecda2dba 2007-12-15 Emmanuele Bassi <ebassi@openedhand.com>
* 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 14:36:27 +00:00
Emmanuele Bassi
afaa4fe26f 2007-12-15 Emmanuele Bassi <ebassi@openedhand.com>
* 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-15 13:02:06 +00:00
Emmanuele Bassi
6193beb8be 2007-12-14 Emmanuele Bassi <ebassi@openedhand.com>
* 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 17:25:55 +00:00
Emmanuele Bassi
81e908f9fb 2007-12-10 Emmanuele Bassi <ebassi@openedhand.com>
* 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 16:22:05 +00:00
Emmanuele Bassi
be8fdbe5c1 2007-12-10 Emmanuele Bassi <ebassi@openedhand.com>
* 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 15:08:53 +00:00
Emmanuele Bassi
640b9aa07b 2007-11-30 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-model.h: Complete the documentation of
	the ClutterModelClass structure members.
2007-11-30 13:22:03 +00:00
Emmanuele Bassi
687561dfe2 2007-11-29 Emmanuele Bassi <ebassi@openedhand.com>
* 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 15:01:21 +00:00
Emmanuele Bassi
9800eb0639 2007-11-28 Emmanuele Bassi <ebassi@openedhand.com>
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 18:04:24 +00:00
Neil J. Patel
70e09ab9df 2007-11-15 Neil J. Patel <njp@o-hand.com>
* 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-15 10:02:25 +00:00