Commit f29e6a34 authored by xan@webkit.org's avatar xan@webkit.org

2010-12-11 Xan Lopez <xlopez@igalia.com>

        Reviewed by Martin Robinson.

        [GTK] Add APIs for plugin management
        https://bugs.webkit.org/show_bug.cgi?id=50827

        Add WebKitWebPluginDatabase and WebKitWebPlugin classes for basic
        plugin management at the client level. For now they provide
        "read-only" access to the plugin list.

        * GNUmakefile.am: add new files to the build.
        * tests/testwebplugindatabase.c: Test that the database contains
        the test plugin, which should always be loaded.
        * webkit/webkit.h: add new headers.
        * webkit/webkitdefines.h: add new defines.
        * webkit/webkitwebplugin.cpp: An new class representing a plugin object.
        * webkit/webkitwebplugin.h: ditto.
        * webkit/webkitwebplugindatabase.cpp: A new class that contains the list of active plugins.
        * webkit/webkitwebplugindatabase.h: ditto.
        * webkit/webkitwebplugindatabaseprivate.h: Private header.
        * webkit/webkitwebpluginprivate.h: Private header.
        * webkit/webkitwebview.cpp:
        (webkit_get_web_plugin_database): returns the WebKitWebPluginDatabase for this session.
        * webkit/webkitwebview.h: add method to header.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73858 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6c506bcd
2010-12-11 Xan Lopez <xlopez@igalia.com>
Reviewed by Martin Robinson.
[GTK] Add APIs for plugin management
https://bugs.webkit.org/show_bug.cgi?id=50827
Add WebKitWebPluginDatabase and WebKitWebPlugin classes for basic
plugin management at the client level. For now they provide
"read-only" access to the plugin list.
* GNUmakefile.am: add new files to the build.
* tests/testwebplugindatabase.c: Test that the database contains
the test plugin, which should always be loaded.
* webkit/webkit.h: add new headers.
* webkit/webkitdefines.h: add new defines.
* webkit/webkitwebplugin.cpp: An new class representing a plugin object.
* webkit/webkitwebplugin.h: ditto.
* webkit/webkitwebplugindatabase.cpp: A new class that contains the list of active plugins.
* webkit/webkitwebplugindatabase.h: ditto.
* webkit/webkitwebplugindatabaseprivate.h: Private header.
* webkit/webkitwebpluginprivate.h: Private header.
* webkit/webkitwebview.cpp:
(webkit_get_web_plugin_database): returns the WebKitWebPluginDatabase for this session.
* webkit/webkitwebview.h: add method to header.
2010-12-10 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
Reviewed by Martin Robinson.
......
......@@ -127,6 +127,8 @@ webkitgtk_static_h_api += \
$(srcdir)/WebKit/gtk/webkit/webkitwebhistoryitem.h \
$(srcdir)/WebKit/gtk/webkit/webkitwebinspector.h \
$(srcdir)/WebKit/gtk/webkit/webkitwebnavigationaction.h \
$(srcdir)/WebKit/gtk/webkit/webkitwebplugin.h \
$(srcdir)/WebKit/gtk/webkit/webkitwebplugindatabase.h \
$(srcdir)/WebKit/gtk/webkit/webkitwebpolicydecision.h \
$(srcdir)/WebKit/gtk/webkit/webkitwebresource.h \
$(srcdir)/WebKit/gtk/webkit/webkitwebsettings.h \
......@@ -200,6 +202,10 @@ webkitgtk_sources += \
WebKit/gtk/webkit/webkitwebnavigationactionprivate.h \
WebKit/gtk/webkit/webkitwebpolicydecision.cpp \
WebKit/gtk/webkit/webkitwebresource.cpp \
WebKit/gtk/webkit/webkitwebplugin.cpp \
WebKit/gtk/webkit/webkitwebpluginprivate.h \
WebKit/gtk/webkit/webkitwebplugindatabase.cpp \
WebKit/gtk/webkit/webkitwebplugindatabaseprivate.h \
WebKit/gtk/webkit/webkitwebsettings.cpp \
WebKit/gtk/webkit/webkitwebview.cpp \
WebKit/gtk/webkit/webkitwebviewprivate.h \
......@@ -395,6 +401,7 @@ TEST_PROGS += \
Programs/unittests/testwebsettings \
Programs/unittests/testwebresource \
Programs/unittests/testwebdatasource \
Programs/unittests/testwebplugindatabase \
Programs/unittests/testwebview \
Programs/unittests/testkeyevents \
Programs/unittests/testcopyandpaste
......@@ -450,6 +457,11 @@ Programs_unittests_testwebframe_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testwebframe_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testwebframe_LDFLAGS = $(webkit_tests_ldflags)
Programs_unittests_testwebplugindatabase_SOURCES = WebKit/gtk/tests/testwebplugindatabase.c
Programs_unittests_testwebplugindatabase_CFLAGS = -DTEST_PLUGIN_DIR=\"${shell pwd}/${top_builddir}/TestNetscapePlugin/.libs\" $(webkit_tests_cflags)
Programs_unittests_testwebplugindatabase_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testwebplugindatabase_LDFLAGS = $(webkit_tests_ldflags)
Programs_unittests_testwebbackforwardlist_SOURCES = WebKit/gtk/tests/testwebbackforwardlist.c
Programs_unittests_testwebbackforwardlist_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testwebbackforwardlist_LDADD = $(webkit_tests_ldadd)
......
/*
* Copyright (C) 2010 Igalia S.L.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include <errno.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <gtk/gtk.h>
#include <webkit/webkit.h>
#if GTK_CHECK_VERSION(2, 14, 0)
/* This function is not public, so we need an extern declaration */
extern void webkit_web_settings_add_extra_plugin_directory(WebKitWebView* view, const gchar* directory);
static void test_webkit_web_plugin_database_get_plugins()
{
WebKitWebView* view = WEBKIT_WEB_VIEW(webkit_web_view_new());
WebKitWebPluginDatabase* database;
GSList* pluginList, *p;
gboolean found = FALSE;
webkit_web_settings_add_extra_plugin_directory(view, TEST_PLUGIN_DIR);
g_object_ref_sink(G_OBJECT(view));
database = webkit_get_web_plugin_database();
pluginList = webkit_web_plugin_database_get_plugins(database);
for (p = pluginList; p; p = p->next) {
WebKitWebPlugin* plugin = (WebKitWebPlugin*)p->data;
if (!g_strcmp0(webkit_web_plugin_get_name(plugin), "WebKit Test PlugIn") &&
!g_strcmp0(webkit_web_plugin_get_description(plugin), "Simple Netscape plug-in that handles test content for WebKit"))
found = TRUE;
}
webkit_web_plugin_database_plugins_list_free(pluginList);
g_assert(found);
g_object_unref(view);
}
int main(int argc, char** argv)
{
g_thread_init(NULL);
gtk_test_init(&argc, &argv, NULL);
g_test_bug_base("https://bugs.webkit.org/");
g_test_add_func("/webkit/webplugindatabase/getplugins", test_webkit_web_plugin_database_get_plugins);
return g_test_run ();
}
#else
int main(int argc, char** argv)
{
g_critical("You will need at least gtk-2.14.0 to run the unit tests. Doing nothing now.");
return 0;
}
#endif
......@@ -39,6 +39,8 @@
#include <webkit/webkitwebview.h>
#include <webkit/webkitwebbackforwardlist.h>
#include <webkit/webkitwebhistoryitem.h>
#include <webkit/webkitwebplugin.h>
#include <webkit/webkitwebplugindatabase.h>
#include <webkit/webkitwebpolicydecision.h>
#include <webkit/webkitwebnavigationaction.h>
#include <webkit/webkitwebresource.h>
......
......@@ -95,6 +95,12 @@ typedef struct _WebKitGeolocationPolicyDecisionClass WebKitGeolocationPolicyDeci
typedef struct _WebKitViewportAttributes WebKitViewportAttributes;
typedef struct _WebKitViewportAttributesClass WebKitViewportAttributesClass;
typedef struct _WebKitWebPluginDatabase WebKitWebPluginDatabase;
typedef struct _WebKitWebPluginDatabaseClass WebKitWebPluginDatabaseClass;
typedef struct _WebKitWebPlugin WebKitWebPlugin;
typedef struct _WebKitWebPluginClass WebKitWebPluginClass;
G_END_DECLS
#endif
/*
* Copyright (C) 2010 Igalia S.L.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"
#include "webkitwebplugin.h"
#include "PluginPackage.h"
#include "webkitprivate.h"
#include "webkitwebpluginprivate.h"
using namespace WebCore;
G_DEFINE_TYPE(WebKitWebPlugin, webkit_web_plugin, G_TYPE_OBJECT)
static void freeMIMEType(WebKitWebPluginMIMEType* mimeType)
{
if (mimeType->name)
g_free(mimeType->name);
if (mimeType->description)
g_free(mimeType->description);
if (mimeType->extensions)
g_strfreev(mimeType->extensions);
g_slice_free(WebKitWebPluginMIMEType, mimeType);
}
void webkit_web_plugin_mime_type_list_free(GSList* list)
{
for (GSList* p = list; p; p = p->next)
freeMIMEType((WebKitWebPluginMIMEType*)p->data);
g_slist_free(list);
}
static void webkit_web_plugin_finalize(GObject* object)
{
WebKitWebPluginPrivate* priv = WEBKIT_WEB_PLUGIN(object)->priv;
if (priv->mimeTypes)
webkit_web_plugin_mime_type_list_free(priv->mimeTypes);
delete WEBKIT_WEB_PLUGIN(object)->priv;
G_OBJECT_CLASS(webkit_web_plugin_parent_class)->dispose(object);
}
static void webkit_web_plugin_class_init(WebKitWebPluginClass* klass)
{
webkit_init();
GObjectClass* gobjectClass = reinterpret_cast<GObjectClass*>(klass);
gobjectClass->finalize = webkit_web_plugin_finalize;
g_type_class_add_private(klass, sizeof(WebKitWebPluginPrivate));
}
static void webkit_web_plugin_init(WebKitWebPlugin *plugin)
{
WebKitWebPluginPrivate* priv = WEBKIT_WEB_PLUGIN_GET_PRIVATE(plugin);
plugin->priv = priv = new WebKitWebPluginPrivate();
}
namespace WebKit {
WebKitWebPlugin* kitNew(WebCore::PluginPackage* package)
{
WebKitWebPlugin* plugin = WEBKIT_WEB_PLUGIN(g_object_new(WEBKIT_TYPE_WEB_PLUGIN, 0));
plugin->priv->corePlugin = package;
return plugin;
}
}
/**
* webkit_web_plugin_get_name:
* @plugin: a #WebKitWebPlugin
*
* Returns: the name string for @plugin.
*
* Since: 1.3.8
*/
const char* webkit_web_plugin_get_name(WebKitWebPlugin* plugin)
{
g_return_val_if_fail(WEBKIT_IS_WEB_PLUGIN(plugin), 0);
WebKitWebPluginPrivate* priv = plugin->priv;
if (!priv->name.length())
priv->name = priv->corePlugin->name().utf8();
return priv->name.data();
}
/**
* webkit_web_plugin_get_description:
* @plugin: a #WebKitWebPlugin
*
* Returns: the description string for @plugin.
*
* Since: 1.3.8
*/
const char* webkit_web_plugin_get_description(WebKitWebPlugin* plugin)
{
g_return_val_if_fail(WEBKIT_IS_WEB_PLUGIN(plugin), 0);
WebKitWebPluginPrivate* priv = plugin->priv;
if (!priv->description.length())
priv->description = priv->corePlugin->description().utf8();
return priv->description.data();
}
/**
* webkit_web_plugin_get_mimetypes:
* @plugin: a #WebKitWebPlugin
*
* Returns all the #WebKitWebPluginMIMEType that @plugin is handling
* at the moment.
*
* Returns: (transfer container) (element-type WebKitWebPluginMIMEType): a #GSList of #WebKitWebPluginMIMEType
*
* Since: 1.3.8
*/
GSList* webkit_web_plugin_get_mimetypes(WebKitWebPlugin* plugin)
{
g_return_val_if_fail(WEBKIT_IS_WEB_PLUGIN(plugin), 0);
WebKitWebPluginPrivate* priv = plugin->priv;
if (priv->mimeTypes)
return priv->mimeTypes;
const MIMEToDescriptionsMap& mimeToDescriptions = priv->corePlugin->mimeToDescriptions();
MIMEToDescriptionsMap::const_iterator end = mimeToDescriptions.end();
for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) {
WebKitWebPluginMIMEType* mimeType = g_slice_new0(WebKitWebPluginMIMEType);
mimeType->name = g_strdup(it->first.utf8().data());
mimeType->description = g_strdup(it->second.utf8().data());
Vector<String> extensions = priv->corePlugin->mimeToExtensions().get(it->first);
mimeType->extensions = static_cast<gchar**>(g_malloc0(extensions.size() + 1));
for (unsigned i = 0; i < extensions.size(); i++)
mimeType->extensions[i] = g_strdup(extensions[i].utf8().data());
priv->mimeTypes = g_slist_append(priv->mimeTypes, mimeType);
}
return priv->mimeTypes;
}
/*
* Copyright (C) 2010 Igalia S.L.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef webkitwebplugin_h
#define webkitwebplugin_h
#include <glib-object.h>
#include <webkit/webkitdefines.h>
G_BEGIN_DECLS
#define WEBKIT_TYPE_WEB_PLUGIN (webkit_web_plugin_get_type())
#define WEBKIT_WEB_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_WEB_PLUGIN, WebKitWebPlugin))
#define WEBKIT_WEB_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_WEB_PLUGIN, WebKitWebPluginClass))
#define WEBKIT_IS_WEB_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_WEB_PLUGIN))
#define WEBKIT_IS_WEB_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_WEB_PLUGIN))
#define WEBKIT_WEB_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_WEB_PLUGIN, WebKitWebPluginClass))
typedef struct _WebKitWebPluginPrivate WebKitWebPluginPrivate;
/**
* WebKitWebPluginMIMEType:
* @name: the name of the MIME type.
* @description: the description of the MIME type.
* @extensions: the extensions associated with this MIME type.
*
* A structure representing one of the MIME types associated with a
* plugin. A #GSList of these objects will be returned by
* #webkit_web_plugin_get_mimetypes, use
* #webkit_web_plugin_mime_type_list_free to free it.
*
* Since: 1.3.8
*/
typedef struct _WebKitWebPluginMIMEType {
char* name;
char* description;
char** extensions;
} WebKitWebPluginMIMEType;
WEBKIT_API void
webkit_web_plugin_mime_type_list_free (GSList*);
struct _WebKitWebPluginClass {
GObjectClass parentClass;
};
struct _WebKitWebPlugin {
GObject parentInstance;
WebKitWebPluginPrivate* priv;
};
WEBKIT_API GType
webkit_web_plugin_get_type (void) G_GNUC_CONST;
WEBKIT_API const char*
webkit_web_plugin_get_name (WebKitWebPlugin*);
WEBKIT_API const char*
webkit_web_plugin_get_description (WebKitWebPlugin*);
WEBKIT_API GSList*
webkit_web_plugin_get_mimetypes (WebKitWebPlugin*);
G_END_DECLS
#endif
/*
* Copyright (C) 2010 Igalia S.L.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"
#include "webkitwebplugindatabase.h"
#include "PluginDatabase.h"
#include "webkitprivate.h"
#include "webkitwebplugindatabaseprivate.h"
#include "webkitwebpluginprivate.h"
using namespace WebKit;
using namespace WebCore;
G_DEFINE_TYPE(WebKitWebPluginDatabase, webkit_web_plugin_database, G_TYPE_OBJECT)
static void webkit_web_plugin_database_dispose(GObject* object)
{
G_OBJECT_CLASS(webkit_web_plugin_database_parent_class)->dispose(object);
}
static void webkit_web_plugin_database_class_init(WebKitWebPluginDatabaseClass* klass)
{
webkit_init();
GObjectClass* gobjectClass = reinterpret_cast<GObjectClass*>(klass);
gobjectClass->dispose = webkit_web_plugin_database_dispose;
g_type_class_add_private(klass, sizeof(WebKitWebPluginDatabasePrivate));
}
static void webkit_web_plugin_database_init(WebKitWebPluginDatabase* database)
{
WebKitWebPluginDatabasePrivate* priv = WEBKIT_WEB_PLUGIN_DATABASE_GET_PRIVATE(database);
database->priv = priv;
priv->coreDatabase = PluginDatabase::installedPlugins();
}
/**
* webkit_web_plugin_database_list_free:
* @list: a #WebKitWebPluginDatabasePluginList
*
* Frees @list.
*
* Since: 1.3.8
*/
void webkit_web_plugin_database_plugins_list_free(GSList* list)
{
g_return_if_fail(list);
for (GSList* p = list; p; p = p->next)
g_object_unref(p->data);
g_slist_free(list);
}
/**
* webkit_web_plugin_database_get_plugins:
* @database: a #WebKitWebPluginDatabase
*
* Returns all #WebKitWebPlugin available in @database.
*
* Returns: (transfer full) (element-type WebKitWebPlugin): a #GSList of #WebKitWebPlugin
*
* Since: 1.3.8
*/
GSList* webkit_web_plugin_database_get_plugins(WebKitWebPluginDatabase* database)
{
g_return_val_if_fail(WEBKIT_IS_WEB_PLUGIN_DATABASE(database), 0);
GSList* gPlugins = 0;
const Vector<PluginPackage*>& plugins = database->priv->coreDatabase->plugins();
for (unsigned int i = 0; i < plugins.size(); ++i) {
PluginPackage* plugin = plugins[i];
gPlugins = g_slist_append(gPlugins, kitNew(plugin));
}
return gPlugins;
}
/**
* webkit_web_plugin_database_get_plugin_for_mimetype:
* @database: a #WebKitWebPluginDatabase
* @mimeType: a mime type
*
* Returns the #WebKitWebPlugin that is handling @mimeType in the
* @database, or %NULL if there's none doing so.
*
* Returns: (transfer full): a #WebKitWebPlugin
*
* Since: 1.3.8
*/
WebKitWebPlugin* webkit_web_plugin_database_get_plugin_for_mimetype(WebKitWebPluginDatabase* database, const char* mimeType)
{
g_return_val_if_fail(WEBKIT_IS_WEB_PLUGIN_DATABASE(database), 0);
g_return_val_if_fail(mimeType, 0);
return kitNew(database->priv->coreDatabase->pluginForMIMEType(mimeType));
}
/**
* webkit_web_plugin_database_refresh:
* @database: a #WebKitWebPluginDatabase
*
* Refreshes @database adding new plugins that are now in use and
* removing those that have been disabled or are otherwise no longer
* available.
*
* Since: 1.3.8
*/
void webkit_web_plugin_database_refresh(WebKitWebPluginDatabase* database)
{
g_return_if_fail(WEBKIT_IS_WEB_PLUGIN_DATABASE(database));
database->priv->coreDatabase->refresh();
}
WebKitWebPluginDatabase* webkit_web_plugin_database_new(void)
{
return WEBKIT_WEB_PLUGIN_DATABASE(g_object_new(WEBKIT_TYPE_WEB_PLUGIN_DATABASE, 0));
}
/*
* Copyright (C) 2010 Igalia S.L.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef webkitwebplugindatabase_h
#define webkitwebplugindatabase_h
#include <glib-object.h>
#include <webkit/webkitdefines.h>
G_BEGIN_DECLS
#define WEBKIT_TYPE_WEB_PLUGIN_DATABASE (webkit_web_plugin_database_get_type())
#define WEBKIT_WEB_PLUGIN_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_WEB_PLUGIN_DATABASE, WebKitWebPluginDatabase))
#define WEBKIT_WEB_PLUGIN_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_WEB_PLUGIN_DATABASE, WebKitWebPluginDatabaseClass))
#define WEBKIT_IS_WEB_PLUGIN_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_WEB_PLUGIN_DATABASE))
#define WEBKIT_IS_WEB_PLUGIN_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_WEB_PLUGIN_DATABASE))
#define WEBKIT_WEB_PLUGIN_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_WEB_PLUGIN_DATABASE, WebKitWebPluginDatabaseClass))
typedef struct _WebKitWebPluginDatabasePrivate WebKitWebPluginDatabasePrivate;
struct _WebKitWebPluginDatabaseClass {
GObjectClass parentClass;
};
struct _WebKitWebPluginDatabase {
GObject parentInstance;
WebKitWebPluginDatabasePrivate* priv;
};
WEBKIT_API GType
webkit_web_plugin_database_get_type (void) G_GNUC_CONST;
WEBKIT_API void
webkit_web_plugin_database_plugins_list_free (GSList*);
WEBKIT_API GSList*
webkit_web_plugin_database_get_plugins (WebKitWebPluginDatabase*);
WEBKIT_API WebKitWebPlugin*
webkit_web_plugin_database_get_plugin_for_mimetype (WebKitWebPluginDatabase*, const char *);
WEBKIT_API void
webkit_web_plugin_database_refresh (WebKitWebPluginDatabase*);
G_END_DECLS
#endif
/*
* Copyright (C) 2010 Igalia S.L.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef webkitwebplugindatabaseprivate_h
#define webkitwebplugindatabaseprivate_h