GConf Settings

Using eel-gconf-extensions.h, retrieving Epiphany's GConf settings is a snap. The keys used by Epiphany are all listed in epiphany/lib/ephy-prefs.h (but ephy-prefs.h is not installed alongside Epiphany, and so cannot be included by your extension). For example, the following function will return whether or not the statusbar is to be displayed:

Example 4.7. Retrieving a GConf value

static gboolean
is_statusbar_wanted (void)
{
	return eel_gconf_get_boolean ("/apps/epiphany/general/show_statusbar");
}

Even better, how about a callback for when a GConf key is changed:

Example 4.8. Listening to GConf

struct EphyFooExtensionPrivate
{
	/* ... */
	guint gconf_cnxn_id;
	/* ... */
};

static void
my_gconf_cb (GConfClient *client,
	     guint cnxn_id,
	     GConfEntry *entry,
	     gpointer user_data)
{
	/* Do something */
}

static void
ephy_foo_extension_init (EphyFooExtension *extension)
{
	/* ... */
	extension->priv->gconf_cnxn_id = eel_gconf_notification_add
		("/apps/epiphany/general/show_statusbar", (GConfClientNotifyFunc) my_gconf_cb, NULL);
}

static void
ephy_foo_extension_finalize (EphyFooExtension *extension)
{
	if (extension->priv->gconf_cnxn_id != 0)
	{
		eel_gconf_notification_remove (extension->priv->gconf_cnxn_id);
		extension->priv->gconf_cnxn_id = 0;
	}
	/* ... */
}

Voila! my_gconf_cb will be called when the GConf key is modified from within any program. Isn't GConf great?

Read epiphany-extensions/include/eel-gconf-extensions.h for a full list of functions.

If your extension is written in Python, you may use gnome-python's GConf bindings.