diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-10-26 13:41:27 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-10-30 15:35:58 +0100 |
commit | 0ca6ae1b4b142dfa947bec45c833388f86cc9709 (patch) | |
tree | babbea5b0360bb252154903ee9487589d2a5e789 /src/mm-plugin.h | |
parent | e5b4b4d0e5ab11a581504ce88be2a1aa317524e8 (diff) |
plugin-manager,plugin: run pre-probing filters early
For each port, we will construct the list of plugins to test with. In that list
we will include those plugins which are likely to handle a given port, so we
will skip all those which aren't.
To see if a plugin is likely or not, we will run the pre-probing filters before
adding them to the list, with the new `mm_plugin_discard_port_early()'. This
method will return one of these hints:
* UNSUPPORTED: The plugin will not be able to handle this port.
* MAYBE: The plugin may handle this port.
* LIKELY: The plugin may (very likely) handle this port.
* SUPPORTED: If any plugin should support the port, this is it.
Plugins reported to be 'likely' supporting the port will be probed before the
ones reported just as 'maybe'.
If a plugin reports 'supported' only that one and the fallback generic ones will
be tried.
Diffstat (limited to 'src/mm-plugin.h')
-rw-r--r-- | src/mm-plugin.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mm-plugin.h b/src/mm-plugin.h index 6d5d14e1..a423ceb0 100644 --- a/src/mm-plugin.h +++ b/src/mm-plugin.h @@ -67,6 +67,13 @@ typedef enum { MM_PLUGIN_SUPPORTS_PORT_SUPPORTED } MMPluginSupportsResult; +typedef enum { + MM_PLUGIN_SUPPORTS_HINT_UNSUPPORTED, + MM_PLUGIN_SUPPORTS_HINT_MAYBE, + MM_PLUGIN_SUPPORTS_HINT_LIKELY, + MM_PLUGIN_SUPPORTS_HINT_SUPPORTED, +} MMPluginSupportsHint; + typedef struct _MMPlugin MMPlugin; typedef struct _MMPluginClass MMPluginClass; typedef struct _MMPluginPrivate MMPluginPrivate; @@ -102,8 +109,12 @@ struct _MMPluginClass { GType mm_plugin_get_type (void); const gchar *mm_plugin_get_name (MMPlugin *plugin); -gint mm_plugin_cmp (const MMPlugin *plugin_a, - const MMPlugin *plugin_b); + +/* This method will run all pre-probing filters, to see if we can discard this + * plugin from the probing logic as soon as possible. */ +MMPluginSupportsHint mm_plugin_discard_port_early (MMPlugin *plugin, + MMDevice *device, + GUdevDevice *port); void mm_plugin_supports_port (MMPlugin *plugin, MMDevice *device, |