Commit Graph

687 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
Jonas M. Gastal e4f6736b86 Documentation for all eina model functions.
SVN revision: 67992
2012-02-15 18:44:50 +00:00
Tom Hacohen de808a0fb8 Eina model: Added an advanced inheritance + interface example.
SVN revision: 67965
2012-02-15 08: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 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
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 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
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 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
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
Jihoon Kim 36c2029d0a fix @dates in each header file
SVN revision: 67705
2012-02-05 23:37:45 +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
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
Gustavo Sverzut Barbieri 0d72a87ff6 add missing @since 1.2
SVN revision: 67638
2012-01-31 16:47:36 +00:00
Gustavo Sverzut Barbieri 948ce4b9ec eina_value: add EINA_VALUE_TYPE_MODEL
SVN revision: 67637
2012-01-31 16:45:59 +00:00
Gustavo Sverzut Barbieri 088ab8dd2b eina_model: change the way extensions are done.
Thanks to Tasn review it was noticed that subclasses using "const void *value"
with sub-structure would have to resolve their methods manually, quite bad.

Then the extension will happen with structures inside structures, as
previously used in Evas_Smart_Class. To allow the system to resolve
the methods and keep it, it is now specificed the type_size.

A new function is added to help extensions:
eina_model_type_method_resolve(), together with few helper macros.

To allow Eina_Model_Type to be augmented with more methods without
breaking the ABI, 4 slots are left there. We expect we got it right
from beginning and these will never be used, but we can never be sure
;-)

Last but not least, similar changes were done to Eina_Model_Interface
for consistency matters.




SVN revision: 67635
2012-01-31 15:26:48 +00:00
Tom Hacohen 92d70212c5 Eina: Added EINA_C_ARRAY_LENGTH.
This macro returns the length of a standard C array.

SVN revision: 67589
2012-01-29 15:38:01 +00:00
Vincent Torri 16b49b02f5 Eina: fix previous commit
SVN revision: 67564
2012-01-27 07:52:30 +00:00
Vincent Torri fcd0b658cf Eina: fix compilation errors in Eina_RWLock code when building code on Windows > XP
SVN revision: 67545
2012-01-26 07:21:27 +00:00
Gustavo Sverzut Barbieri 3683b0e719 eina_value_struct_member_value: helper to be used by esql and possibly others.
It is common to already known the member, then no need to query
it. This provides optimized retrieval for people that can manage it.



SVN revision: 67538
2012-01-25 16:58:57 +00:00
Jonas M. Gastal 263d6af353 Small fixes to eina_model documentation.
Patch by: "Jonas M. Gastal" <jgastal@profusion.mobi>



SVN revision: 67535
2012-01-25 13:48:32 +00:00
Tom Hacohen 4bd08d2ca5 Eina model: Fix the example in the docs to compile.
SVN revision: 67534
2012-01-25 12:05:20 +00:00
Gustavo Sverzut Barbieri 73b1d45d15 value got the helper, will be useful in other cases as well.
SVN revision: 67518
2012-01-24 22:56:17 +00:00
Gustavo Sverzut Barbieri 73b595df2f more efficient model properties based on struct.
this is a killer, should be very efficient in memory and speed to
set/get items: instead of a hash of properties, keep them in a C
struct!

The constraint is that properties have fixed types defined at compile
time and cannot be deleted, but this is expected in many cases (ie:
esql rows).




SVN revision: 67517
2012-01-24 22:17:57 +00:00
Vincent Torri 0b96df92ee Eina: include stdlib.h instead of alloca.h (alloca() is not used while malloc() is)
SVN revision: 67419
2012-01-21 07:44:05 +00:00
Gustavo Sverzut Barbieri 8b9fd10c60 install eina_model.h
thanks JihoonKim


SVN revision: 67410
2012-01-21 04:22:18 +00:00
Gustavo Sverzut Barbieri 7c0357ddeb welcome eina_model.
This is a simple to use generic hierarchical data access. It includes
properties, children, reference counting and notifications (callbacks).

It can be understood in the same lines as GObject or PyObject, but I
believe the best usage is just to provide data models, not generic
Object Oriented Programming in C.

It misses most of documentation, although the important bits are
there. Need help here :-/



SVN revision: 67405
2012-01-21 01:30:09 +00:00
Iván Briano 2283fda5f4 My bad.. the type is referring to something out of the macro
SVN revision: 67404
2012-01-20 20:18:10 +00:00
Iván Briano 3c007c2791 type-o... see what I did there? Yes, I'm an idiot.
SVN revision: 67402
2012-01-20 19:31:32 +00:00
Guillaume Friloux 0f2dba299d From: Guillaume Friloux <guillaume.friloux@asp64.com>
Subject: Re: [E-devel] Various patches in eina's doc

update authors in doc patch.



SVN revision: 67369
2012-01-20 02:58:57 +00:00
Cedric BAIL 113348cac9 eina: fix inarray macro.
SVN revision: 67346
2012-01-19 15:13:07 +00:00
Vincent Torri 9a76004770 Eina: Fix compilation of eina_semaphore_lock() (Windows port)
Patch by Shinwoo Kim


SVN revision: 67317
2012-01-19 06:33:42 +00:00
Guillaume Friloux 537bc81acb From: Guillaume Friloux <guillaume.friloux@asp64.com>
Hello again e people, i have play a bit with eina's comments to get
proper namings and fix broken references.



SVN revision: 67289
2012-01-18 04:32:37 +00:00
Carsten Haitzler 46c5dd5329 void impl for eina_lock stuff should return "innocuous" values - ie
pretend things succeed ad on a lockless platform u cant have threads
anyway :)



SVN revision: 67288
2012-01-18 04:27:13 +00:00
Carsten Haitzler 0e9a475092 update all minor versions to 2 (or 6) - and yes. i missed making most
be 1.1 (or 1.5) for the last release. too late. THIS is why i'm sick
and tired of all the bloody separate libs that have to be versiioned
and build and released separately. :( too many places to go fix up per
release.



SVN revision: 67284
2012-01-18 02:32:36 +00:00
Gustavo Sverzut Barbieri 91c925fc54 eina_value: add array of struct test.
works nice :-)


SVN revision: 67159
2012-01-12 23:31:42 +00:00
Gustavo Sverzut Barbieri b1feb2fe8c eina_value: add struct type.
efficient storage with named access, can specify compare, alloc, free
and other operations for even better management.

no changelog/news as this is under eina_value, all new for 1.2 release.



SVN revision: 67155
2012-01-12 22:58:31 +00:00
Gustavo Sverzut Barbieri c486211f59 eina_value: simpler and faster code using newer eina_inarray_alloc_at()
SVN revision: 67153
2012-01-12 19:16:46 +00:00
Gustavo Sverzut Barbieri 72d4da0022 eina_inarray: add useful function to open space in array.
no changelog or news as eina_inarray is new and this is already stated
in these files.



SVN revision: 67152
2012-01-12 19:08:26 +00:00
Gustavo Sverzut Barbieri 9d424b133b eina_value: use mempool.
thanks to discomfitor about the tip.



SVN revision: 67151
2012-01-12 18:50:43 +00:00