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



Hi,

As it's not very different from the existing code, I have already implemented and committed the new API that I have proposed in my previous mail.

While doing it, I have found some errors and missing method in the IAnjutaProject interface described in the previous mail. Here is the fixed new interface.


* The IAnjutaProject interface is implemented by the project object.

gboolean
ianjuta_project_load_node (
        IAnjutaProject *project,
        AnjutaProjectNode *node,
        GError *err
        );

gboolean
ianjuta_project_save_node (
        IAnjutaProject *project,
        AnjutaProjectNode *node,
        GError *err
        );

AnjutaProjectNode *
ianjuta_project_add_node_before (
        IAnjutaProject *project,
        AnjutaProjectNode *parent,
        AnjutaProjectNode *sibling,
        AnjutaProjectNodeType type,
        GFile *file,
        const gchar *name,
        GError *err
        );

AnjutaProjectNode *
ianjuta_project_add_node_after (
        IAnjutaProject *project,
        AnjutaProjectNode *parent,
        AnjutaProjectNode *sibling,
        AnjutaProjectNodeType type,
        GFile *file,
        const gchar *name,
        GError *err
        );

gboolean
ianjuta_project_remove_node (
        IAnjutaProject *project,
        AnjutaProjectNode *node,
        GError *err
        );

AnjutaProjectProperty *
ianjuta_project_set_property (
        IAnjutaProject *project,
        AnjutaProjectNode *node,
        AnjutaProjectProperty *property,
        const gchar *value,
        GError *err
        );

gboolean
ianjuta_project_remove_property (
        IAnjutaProject *project,
        AnjutaProjectNode *node,
        AnjutaProjectProperty *property,
        GError *err
        );

AnjutaProjectNode *
ianjuta_project_get_root (
        IAnjutaProject *project,
        GError *err
        );

GList *
ianjuta_project_get_node_info(
        IAnjutaProject *project,
        GError *err
        );

All comments of the previous mail are still valid. I have few new remarks:

- Using ianjuta_project_add_node_before instead of ianjuta_project_new_node and anjuta_project_node_insert_before has a drawback. If the worker thread is running, the GUI thread need to wait until it is completed before calling ianjuta_project_add_node. It means that by example the node name is not checked immediately which can be a bit confusing for the user. With ianjuta_project_new_node, the backend can check the node names while the worker thread is running. It needs some care if it access some global data though.

- I need to add the get_root function to get the root name because the ianjuta_project_backend_new_project give a project object and not a node.

- The ianjuta_project_get_node_info is useful to know which kind of nodes are available. It could be moved in the IAnjutaProjectBackend interface. I have kept here because it can be useful after loading a project while the backend interface is not needed anymore.

- The ianjuta_project_free_node function is not needed and has been removed because it's not possible to get the ownership of one node or have a floating node. All nodes are always owned by the project object.


Regards,

Sébastien



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