Add midori_extension_is_active
This commit is contained in:
parent
cfd3a47543
commit
b5e2146249
2 changed files with 34 additions and 0 deletions
|
@ -28,6 +28,7 @@ struct _MidoriExtensionPrivate
|
||||||
gchar* version;
|
gchar* version;
|
||||||
gchar* authors;
|
gchar* authors;
|
||||||
|
|
||||||
|
gboolean active;
|
||||||
gchar* config_dir;
|
gchar* config_dir;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -139,13 +140,25 @@ midori_extension_class_init (MidoriExtensionClass* class)
|
||||||
g_type_class_add_private (class, sizeof (MidoriExtensionPrivate));
|
g_type_class_add_private (class, sizeof (MidoriExtensionPrivate));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
midori_extension_activate_cb (MidoriExtension* extension,
|
||||||
|
MidoriApp* app)
|
||||||
|
{
|
||||||
|
extension->priv->active = TRUE;
|
||||||
|
/* FIXME: Disconnect all signal handlers */
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
midori_extension_init (MidoriExtension* extension)
|
midori_extension_init (MidoriExtension* extension)
|
||||||
{
|
{
|
||||||
extension->priv = G_TYPE_INSTANCE_GET_PRIVATE (extension,
|
extension->priv = G_TYPE_INSTANCE_GET_PRIVATE (extension,
|
||||||
MIDORI_TYPE_EXTENSION, MidoriExtensionPrivate);
|
MIDORI_TYPE_EXTENSION, MidoriExtensionPrivate);
|
||||||
|
|
||||||
|
extension->priv->active = FALSE;
|
||||||
extension->priv->config_dir = NULL;
|
extension->priv->config_dir = NULL;
|
||||||
|
|
||||||
|
g_signal_connect (extension, "activate",
|
||||||
|
G_CALLBACK (midori_extension_activate_cb), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -239,6 +252,24 @@ midori_extension_is_prepared (MidoriExtension* extension)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* midori_extension_is_active:
|
||||||
|
* @extension: a #MidoriExtension
|
||||||
|
*
|
||||||
|
* Determines if @extension is active.
|
||||||
|
*
|
||||||
|
* Return value: %TRUE if @extension is active
|
||||||
|
*
|
||||||
|
* Since: 0.1.2
|
||||||
|
**/
|
||||||
|
gboolean
|
||||||
|
midori_extension_is_active (MidoriExtension* extension)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (MIDORI_IS_EXTENSION (extension), FALSE);
|
||||||
|
|
||||||
|
return extension->priv->active;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* midori_extension_deactivate:
|
* midori_extension_deactivate:
|
||||||
* @extension: a #MidoriExtension
|
* @extension: a #MidoriExtension
|
||||||
|
|
|
@ -51,6 +51,9 @@ midori_extension_get_type (void);
|
||||||
gboolean
|
gboolean
|
||||||
midori_extension_is_prepared (MidoriExtension* extension);
|
midori_extension_is_prepared (MidoriExtension* extension);
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
midori_extension_is_active (MidoriExtension* extension);
|
||||||
|
|
||||||
void
|
void
|
||||||
midori_extension_deactivate (MidoriExtension* extension);
|
midori_extension_deactivate (MidoriExtension* extension);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue