Commit Graph

1816 Commits

Author SHA1 Message Date
Gustavo Sverzut Barbieri 88d6b934aa eina_model: new events for load/unload.
Added the events: loaded and unloaded to notify eina_model_load() and
eina_model_unload() were called.

To be more specific, the interfaces used by EINA_MODEL_TYPE_MIXIN
(Eina_Model_Interface_Properties and Eina_Model_Interface_Children)
also do:
 * properties,loaded
 * properties,unloaded
 * children,loaded
 * children,unloaded



SVN revision: 68035
2012-02-16 19:48:13 +00:00
Gustavo Sverzut Barbieri f7787c0e26 3/3 eina_model: fix inheritance test.
HUMAN_POOPER_IFACE must have ANIMAL_POOPER_IFACE as parent interface,
otherwise the order will be incorrect.

The test were also improved in other ways:
 * use ck_assert_int_eq() instead of fail_if()... it prints the incorrect value
 * check refcount
 * unref models
 * shutdown eina



SVN revision: 68034
2012-02-16 19:33:50 +00:00
Gustavo Sverzut Barbieri ca2db67b69 2/3 eina_model: properly eliminate duplicates.
We must check for duplicates otherwise we'll have remaining entries
after topological sort.



SVN revision: 68033
2012-02-16 19:31:56 +00:00
Gustavo Sverzut Barbieri 769d2e2210 1/3 eina_model: lookup interfaces in the correct order.
We should lookup then in forward order, as they are sorted from
most-specific first, with parents at the end.

This breaks test, will fix in the last commit (3/3).



SVN revision: 68032
2012-02-16 19:30:23 +00:00
Tom Hacohen e9e9d41cf2 Elm model: Updated examples.
Patch by Yakov.

SVN revision: 68027
2012-02-16 12:37:27 +00:00
Jonas M. Gastal e4f6736b86 Documentation for all eina model functions.
SVN revision: 67992
2012-02-15 18:44:50 +00:00
Gustavo Sverzut Barbieri b7750c1a5b make tasn happier
SVN revision: 67987
2012-02-15 14:17:16 +00:00
Gustavo Sverzut Barbieri cd15de4af3 review animal as example for other example files.
SVN revision: 67986
2012-02-15 14:08:01 +00:00
Gustavo Sverzut Barbieri c94a7ec770 build example.
SVN revision: 67985
2012-02-15 13:50:43 +00:00
Tom Hacohen de808a0fb8 Eina model: Added an advanced inheritance + interface example.
SVN revision: 67965
2012-02-15 08:18:47 +00:00
Tom Hacohen b1bb770688 Eina model: Fix issues with interface inheritance.
The ptr comparison had issues.
Order of interface overrides was wrong.

SVN revision: 67915
2012-02-14 09:48:00 +00:00
Gustavo Sverzut Barbieri 75839f61a5 eina_value_stringshare: safer copy, to cope copying user-generated structs.
array, list, struct and others set() now copies the values. These
values can be created by user, in this case string is just a stack
object and not a real eina_stringshare.

To cope with it, add the string instead of referencing it. Bit slower,
but nicer behavior.




SVN revision: 67886
2012-02-13 16:18:47 +00:00
Gustavo Sverzut Barbieri c511fece19 improve documentation of eina model and value.
SVN revision: 67851
2012-02-11 18:04:32 +00:00
Gustavo Sverzut Barbieri 4915aeb8db model: add helper for common pattern
SVN revision: 67845
2012-02-11 00:48:42 +00:00
Gustavo Sverzut Barbieri 5c0041f6ad one day I'll be less stupid...
... or one day we'll move to git so I can rewrite stupid commits :-D



SVN revision: 67844
2012-02-11 00:42:00 +00:00
Gustavo Sverzut Barbieri 1fc6b13d10 eina_value: break usage, but makes it more uniform and correct.
I did a bad decision to steal memory for Array, List, Hash and Struct
types, it was nice to not have to copy it internally, but breaks when
one needs to set a new value that was set elsewhere. What did not
happen with string, integers and other basic types.

This was exposed by Raphael Kubo using eina_model_property_set() with
complex types (Array, List and Hash) and it was not possible to
correctly set such properties.

Now it's all set, but the behavior changed and the memory is not
stolen and released anymore. Test eina_test_value.c was changed to
reflect it.



SVN revision: 67843
2012-02-11 00:34:25 +00:00
Gustavo Sverzut Barbieri 3fbce27e8d value: be safer on reset of existing values.
if user get and then set the same value, we should not crash and this
may happen with previous code as the old
string/array/value/list... were released, then you ended with the
released memory still being pointed.



SVN revision: 67841
2012-02-10 22:03:48 +00:00
Gustavo Sverzut Barbieri 6609523415 value: just setup on new memory!
We should not flush and then setup the memory, instead we leave
vset/pset functions do their own stuff to clean previous data, if any.



SVN revision: 67840
2012-02-10 21:43:55 +00:00
Gustavo Sverzut Barbieri edfd15d9ca value: allow multiple flush.
multiple flush may happen when handling errors. May be used in some cases.




SVN revision: 67839
2012-02-10 21:34:28 +00:00
Gustavo Sverzut Barbieri 0d1b66d44e eina_value: fix convert to string on empty/null cases.
SVN revision: 67838
2012-02-10 21:18:59 +00:00
Gustavo Sverzut Barbieri 63cc1bceea fix test leaks
SVN revision: 67836
2012-02-10 20:39:27 +00:00
Gustavo Sverzut Barbieri e8924c7600 eina_value_hash: must free hash value after it's flushed.
SVN revision: 67835
2012-02-10 20:39:07 +00:00
Gustavo Sverzut Barbieri 817d6234b8 fix memleak in test suite.
SVN revision: 67834
2012-02-10 20:38:28 +00:00
Jonas M. Gastal 27f0f4cceb Another example for eina_model.
Patch by: "Jonas M. Gastal" <jgastal@profusion.mobi>



SVN revision: 67832
2012-02-10 17:18:10 +00:00
Gustavo Sverzut Barbieri ef2976ec46 thanks vincent.
I just did that mistake to see if you were paying attention... /me liar! :-)


SVN revision: 67822
2012-02-10 11:03:18 +00:00
Gustavo Sverzut Barbieri 687e59a102 eina_model: add xref/xunref, xrefs_get and models_usage_dump!
Let's try to help debug by allowing extended reference management that
takes in account an identifier. This identifier is accounted on xref
and xunref and must match.

xrefs_get will return the list of such references, for debugging purposes.

eina_models_list_get() was added to return all live models, just
tracked when EINA_MODEL_DEBUG is enabled.

eina_models_usage_dump() was added and use the same infrastructure as
eina_models_list_get() and eina_model_xrefs_get() to aid debugging :-)




SVN revision: 67821
2012-02-10 10:48:39 +00:00
Gustavo Sverzut Barbieri 6d60ece7db add missing shutdown
SVN revision: 67818
2012-02-10 10:34:19 +00:00
Gustavo Sverzut Barbieri 5150befe04 remove @EINA_CPPFLAGS@ from remaining Makefile.am
Thanks to Tommy[D] for spotting the problem!


SVN revision: 67799
2012-02-09 21:42:50 +00:00
Gustavo Sverzut Barbieri 232fbec9f1 add Jonas to authors.
He worked previously with documentation, now is helping me with
Eina_Model and will keep adding some examples and fixes here and
there.



SVN revision: 67798
2012-02-09 20:26:00 +00:00
Jonas M. Gastal 9f90af4dc7 More documentation for eina_model.
Patch by: "Jonas M. Gastal" <jgastal@profusion.mobi>



SVN revision: 67797
2012-02-09 19:13:54 +00:00
Gustavo Sverzut Barbieri 0bcae96ccb eina_model: rename all "search" to "criteria_match"
SVN revision: 67796
2012-02-09 16:29:50 +00:00
Gustavo Sverzut Barbieri 013c986c40 eina_model: helper function to setup subclass during runtime.
SVN revision: 67795
2012-02-09 16:20:16 +00:00
Tom Hacohen 0b8df6a240 Eina examples: Formatted model example a bit.
SVN revision: 67791
2012-02-09 12:29:56 +00:00
Tom Hacohen 29c291ff3b Eina model: Made i_method_resolve a macro (for interface as well)
Same as the previous commit about "Type" this time about Interface.
This will also hopefully remove the likelihood for hacks.
Previous functions are still available as method_offset_resolve.

SVN revision: 67786
2012-02-09 10:32:14 +00:00
Lucas De Marchi 4c184eff2f eina_sched: fix rt priority drop
Thanks to cedric for noticing this bug. Priority in userspace are in the
opposite order as in kernel space.




SVN revision: 67776
2012-02-09 00:06:14 +00:00
Tom Hacohen 8144798618 Eina model: Added an eina model example for inheritance.
Patch by Yakov Goldberg.

SVN revision: 67767
2012-02-08 16:39:19 +00:00
Tom Hacohen 1dbab17f64 Eina model: Made _method_resolve a macro to remove the need for offsetof.
This will also hopefully remove the likelihood for hacks.
Previous functions are still available as method_offset_resolve.

SVN revision: 67765
2012-02-08 15:37:07 +00:00
Gustavo Sverzut Barbieri 68d5bb81bc eina_model: correctly retrieve the memory from value.
val->value.ptr is just valid on 64bits platforms, as on 32bits both
pointers of the Eina_Value_Struct fits in the 8bytes of val->value.buf.

Always use the function to correctly retrieve it.



SVN revision: 67764
2012-02-08 15:13:25 +00:00
Tom Hacohen b5de0cf46b Eina model: Fix another issue with the method resolve functios.
Make it possible to resolve foo (the last item).
struct _My_Object_Type
{
   Eina_Model_Type parent_class;
   ...
   void (*foo)(Eina_Model *, int);
};

SVN revision: 67733
2012-02-07 13:24:27 +00:00
Tom Hacohen c0ab80f047 Eina Model: Fix wrong error checking in the method resolve functions.
This enables resolving method foo...
struct _My_Object_Type
{
   Eina_Model_Type parent;
   void (*foo)(Eina_Model *, int);
   ...
}

SVN revision: 67732
2012-02-07 13:17:13 +00:00
Jihoon Kim 36c2029d0a fix @dates in each header file
SVN revision: 67705
2012-02-05 23:37:45 +00:00
Vincent Torri 6199e30512 Eina: use new Evil API to detect absolute path name
SVN revision: 67702
2012-02-05 09:41:25 +00:00
Vincent Torri 76057ccbe8 Eina: append and prepend __ to gcc attributes
Avoid conflicts with macros that have been previously defined
with the same name than the attribute


SVN revision: 67701
2012-02-05 09:34:17 +00:00
Jonas M. Gastal 90f5f268dc Change eina_mode_child_search to more descriptive
eina_model_child_criteria_match.

Patch by: "Jonas M. Gastal" <jgastal@profusion.mobi>



SVN revision: 67688
2012-02-02 12:32:13 +00:00
Jonas M. Gastal 8f35a3d5ab Better documentation for eina_model.
Patch by: "Jonas M. Gastal" <jgastal@profusion.mobi>



SVN revision: 67687
2012-02-02 12:31:46 +00:00
Gustavo Sverzut Barbieri ceb07e60d1 eina_value: fix struct type.
1. consider case where the struct was not set for flush and others;
 2. flush previous struct on pset;
 3. setup the new struct members memory on pset;
 4. always use ops->alloc and ops->free if they are provided;



SVN revision: 67662
2012-01-31 21:05:20 +00:00
Mike Blumenkrantz 128f5aa6e9 unbreak eina_value
SVN revision: 67643
2012-01-31 17:31:48 +00:00
Tom Hacohen 518424907e Eina stringshare: fixed up the previous commit a bit.
Fixed wrong usage of Eina_Stringshare - Thanks k-s.
Omited the star from the typedef - Thanks Sacihel.

SVN revision: 67642
2012-01-31 17:27:57 +00:00
Tom Hacohen ade018086c Eina stringshare: Added Eina_Stringshare a stringshare visual hint.
It's interchangeable with const char *, it's juts there as a visual hint
for functions expecting stringshared values. Docs are not enough...

SVN revision: 67641
2012-01-31 17:12:23 +00:00
Mike Blumenkrantz 56dc6e9571 add new eina value dummy type TIMESTAMP which is identical to ULONG
SVN revision: 67639
2012-01-31 16:55:10 +00:00