On 8 May 2012 22:31, Colomban Wendling lists.ban@herbesfolles.org wrote:
Le 07/05/2012 18:04, Nick Treleaven a écrit :
On 02/05/2012 05:46, Lex Trotman wrote:
Hi All,
To summarise since the thread has several subthreads.
- Tagmanager Understandability
a. I generated the doxygen documentation for tagmanager, it works if you set recursive, but didn't help much:
- if its not OOP why does it say things like "TMWorkspace is derived
from TMWorkObject" and similar?
documentation bug IMO
I don't think so. TM uses a more or less OOP-like approach. See for example TMWorkspace:
typedef struct { TMWorkObject work_object; /*!< The parent work object */ GPtrArray *global_tags; /*!< Global tags loaded at startup */ GPtrArray *work_objects; /*!< An array of TMWorkObject pointers */ } TMWorkspace;
The first field (work_object) is the inherited "class", here TMWorkObject. And you'll see numerous places where the code uses such a derived structure as a TMWorkObject -- since it is one actually --, which looks quite like OOP.
Or see tm_workspace.c:44:tm_create_workspace(): it uses tm_work_object_register() to register itself as a new type of work object with a few methods (or vfuncs), and the initializes iself with tm_work_object_init(), etc.
I very well understand Lex's questionings about how it does actually work, since it brings a second OOP-style programming in C, less well known than GObject -- though of course less complex also, but still (BTW maybe porting to GObject could help?)
Thanks Colomban, that helps :)
[...]
Cheers Lex