Re: [anjuta-devel] New project interface and introspection



Hi,

Le 09/10/2010 15:04, Abderrahim Kitouni a écrit :
Well, as I understand it, the project manager uses a GFile to identify
nodes, so I expect every file to map to exactly one node.

It's not true for a source file used in several targets. Each target will have its own source node, but all these source nodes will have the same GFile. It can be a different GFile object but corresponding to the same file. But I hesitate to consider as different two GFile objects corresponding to the same file.


I'm not sure how python handles these, but as I see it,
gobject-introspection doesn't have a way to specify that a function
returns a floating reference. Either way, floating references are only
for C convenience, and you should expect the returned reference to be
ref_sink'ed immediately.

I think the python wrapper convert immediately floating reference to normal reference.


Another issue is that ianjuta_project_new_node is node not really a
constant return.
What I meant is that it can do its job without looking at the state of
the project object (and could thus be thread-safe), and just use its
parameters.

Yes, it must be implemented like this.


I think this is the best option : the backend already has to take care
because it can be called from multiple threads, so having it implement
it's own threading is better (and it can even implement that using
processes, as it is recommended for python). And for simple,
machine-friendly formats, the backend may skip explicit threading
altogether, and just use e.g g_file_load_contents in order not to block
the GUI.

I change my mind and I'm agree with this.


Will other plugins have access to the project nodes? Or are these just
for the project manager? If they aren't exposed outside the project
manager, I think we don't need to worry about ownership. We just need to
put some rules on when it is fine to modify something and when it isn't.
Exposing the project nodes will make it easier for other plugins though
(they don't need to keep asking the project manager for the children of
a given node as identified by a GFile).

I have not completely decided yet. But the new API is easier to use, so I think it rather makes sense to expose it to other plugin and remove most of the project manager interface.


"When opening a project, the project manager finds the correct backend
and creates an IAnjutaProject object, and calls load_node passing the
root node. The backend then goes on to start a thread for doing the
actual work and sends progress signals to the project manager.

Yes, that's right. The backend can even load the project without using thread.


The backend is also responsible for monitoring its files for changes
from outside Anjuta, if such a file is changed, the project (or a part
thereof) should be reloaded, and appropriate signals emitted.

Yes. I think it's important to be able to reload only a part of the project. Then, I don't know if the backend automatically reload the project or just emit a signal expecting that someone will ask it to reload the node.


When the changes are done inside Anjuta, the project manager calls
add_node_before or add_node_after and then (immediately?) calls
save_node in which the backend is responsible for writing out the
modified nodes."

Yes. It can be possible that any plugin can call add_node_before or add_node_after and then save_node. It can be possible to call several times add_node before calling save_node


In other news, I've tried to implement a sample project backend (using a
simple xml file) in Vala. And aside from a bug in valac, it seems easy
enough (although it is the kind that reorganizes your project file, not
very nice). But the current interface is definitely ok for simple
projects as well.

I would like to spend some time on the autotool backend but I have to change the IAnjutaProject interface so we can check that it's working well now. I suppose that for you it's better if I change the IAnjutaProject interface as soon as possible, next week by example or could you wait for a few additional weeks ?

Regards,

Sébastien



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]