Re: [compiz] [PATCH] Descriptions for dbus when plugin not loaded

2007-05-21 Thread David Reveman
On Fri, 2007-05-18 at 15:17 +0100, Mike Dransfield wrote:
> David Reveman wrote:
> > On Tue, 2007-05-15 at 19:23 +0100, Mike Dransfield wrote:
> >   
> >> Here is a quick patch for dbus to make it try to load the
> >> metadata from a file if the plugin is not loaded.
> >>
> >> I have tested it and it works fine, but I wanted to check to
> >> see if you had something else in mind.
> >> 
> >
> > Yes, I think we should load/initialize and read the metadata from
> > plugins. Some minor changes need to be made to the plugin system before
> > we're able to load and initialize a plugin without activating it but it
> > should be easy to fix.
> >   
> 
> I thought you might have something like that in mind, I shall
> wait for that to be done.

I looked at the code and you should be able to implement this without
any changes to the plugin loading system.

The dbus plugin will have to manually call 
p->vTable->getVersion, p->vTable->init and p->vTable->fini when
retrieving metadata from an non-active plugin but that's fine.

> 
> > BTW, I'm not very interested in just returning the descriptions.
> > The GetPluginMetadata method should return an array of full meta data
> > documents. This needs to be supported by the dbus plugin before we can
> > remove plugin dependencies from the core.
> >   
> 
> Once the above is done, I can look at modifying the getMetadata
> function.  I think it would be appropriate to change this function
> to return a dictionary because its likely that it will be modified
> and it will save breaking scripts.

You can go ahead and add this right now. If you don't know exactly how
to do the plugin loading and meta data reading then just leave that to
me.

-David

___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] [PATCH] Descriptions for dbus when plugin not loaded

2007-05-18 Thread Mike Dransfield
David Reveman wrote:
> On Tue, 2007-05-15 at 19:23 +0100, Mike Dransfield wrote:
>   
>> Here is a quick patch for dbus to make it try to load the
>> metadata from a file if the plugin is not loaded.
>>
>> I have tested it and it works fine, but I wanted to check to
>> see if you had something else in mind.
>> 
>
> Yes, I think we should load/initialize and read the metadata from
> plugins. Some minor changes need to be made to the plugin system before
> we're able to load and initialize a plugin without activating it but it
> should be easy to fix.
>   

I thought you might have something like that in mind, I shall
wait for that to be done.

> BTW, I'm not very interested in just returning the descriptions.
> The GetPluginMetadata method should return an array of full meta data
> documents. This needs to be supported by the dbus plugin before we can
> remove plugin dependencies from the core.
>   

Once the above is done, I can look at modifying the getMetadata
function.  I think it would be appropriate to change this function
to return a dictionary because its likely that it will be modified
and it will save breaking scripts.

> - David
>
>
>
>   

___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] [PATCH] Descriptions for dbus when plugin not loaded

2007-05-17 Thread David Reveman
On Tue, 2007-05-15 at 19:23 +0100, Mike Dransfield wrote:
> Here is a quick patch for dbus to make it try to load the
> metadata from a file if the plugin is not loaded.
> 
> I have tested it and it works fine, but I wanted to check to
> see if you had something else in mind.

Yes, I think we should load/initialize and read the metadata from
plugins. Some minor changes need to be made to the plugin system before
we're able to load and initialize a plugin without activating it but it
should be easy to fix.

BTW, I'm not very interested in just returning the descriptions.
The GetPluginMetadata method should return an array of full meta data
documents. This needs to be supported by the dbus plugin before we can
remove plugin dependencies from the core.

- David



___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


[compiz] [PATCH] Descriptions for dbus when plugin not loaded

2007-05-15 Thread Mike Dransfield

Here is a quick patch for dbus to make it try to load the
metadata from a file if the plugin is not loaded.

I have tested it and it works fine, but I wanted to check to
see if you had something else in mind.
diff --git a/plugins/dbus.c b/plugins/dbus.c
index 811d2d6..8dc6c40 100644
--- a/plugins/dbus.c
+++ b/plugins/dbus.c
@@ -1742,15 +1742,30 @@ dbusHandleGetPluginMetadataMessage (DBusConnection 
*connection,
 
reply = dbus_message_new_method_return (message);
 
-   if (!loadedPlugin && p->vTable->getMetadata)
+   if (p->vTable->getMetadata)
{
CompMetadata *m;
 
-   m = (*p->vTable->getMetadata) (p);
+   if (loadedPlugin)
+   {
+   m = malloc (sizeof (CompMetadata));
+   if (!m)
+   return FALSE;
+   compInitPluginMetadata (m, p->vTable->name);
+   compAddMetadataFromFile (m, p->vTable->name);
+   }
+   else
+   {
+   m = (*p->vTable->getMetadata) (p);
+   }
+
if (m)
{
shortDesc = compGetShortPluginDescription (m);
longDesc  = compGetLongPluginDescription (m);
+
+   if (loadedPlugin)
+   free (m);
}
}
 
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz