MidoriExtension

MidoriExtension

Synopsis

#include <midori/midori.h>

struct              MidoriExtension;
struct              MidoriExtensionClass;
GObject *           midori_extension_load_from_file     (const gchar *extension_path,
                                                         const gchar *filename,
                                                         gboolean activate,
                                                         gboolean test);
void                midori_extension_activate           (GObject *extension,
                                                         const gchar *filename,
                                                         gboolean activate,
                                                         MidoriApp *app);
GObject *           midori_extension_activate_gracefully
                                                        (MidoriApp *app,
                                                         const gchar *extension_path,
                                                         const gchar *filename,
                                                         gboolean activate);
gboolean            midori_extension_is_prepared        (MidoriExtension *extension);
gboolean            midori_extension_has_preferences    (MidoriExtension *extension);
gboolean            midori_extension_is_active          (MidoriExtension *extension);
void                midori_extension_deactivate         (MidoriExtension *extension);
MidoriApp *         midori_extension_get_app            (MidoriExtension *extension);
const gchar *       midori_extension_get_config_dir     (MidoriExtension *extension);
void                midori_extension_install_boolean    (MidoriExtension *extension,
                                                         const gchar *name,
                                                         gboolean default_value);
gboolean            midori_extension_get_boolean        (MidoriExtension *extension,
                                                         const gchar *name);
void                midori_extension_set_boolean        (MidoriExtension *extension,
                                                         const gchar *name,
                                                         gboolean value);
void                midori_extension_install_integer    (MidoriExtension *extension,
                                                         const gchar *name,
                                                         gint default_value);
gint                midori_extension_get_integer        (MidoriExtension *extension,
                                                         const gchar *name);
void                midori_extension_set_integer        (MidoriExtension *extension,
                                                         const gchar *name,
                                                         gint value);
void                midori_extension_install_string     (MidoriExtension *extension,
                                                         const gchar *name,
                                                         const gchar *default_value);
const gchar *       midori_extension_get_string         (MidoriExtension *extension,
                                                         const gchar *name);
void                midori_extension_set_string         (MidoriExtension *extension,
                                                         const gchar *name,
                                                         const gchar *value);
void                midori_extension_install_string_list
                                                        (MidoriExtension *extension,
                                                         const gchar *name,
                                                         gchar **default_value,
                                                         gsize default_length);
gchar **            midori_extension_get_string_list    (MidoriExtension *extension,
                                                         const gchar *name,
                                                         gsize *length);
void                midori_extension_set_string_list    (MidoriExtension *extension,
                                                         const gchar *name,
                                                         gchar **value,
                                                         gsize length);
void                midori_extension_load_from_folder   (MidoriApp *app,
                                                         gchar **keys,
                                                         gboolean activate);

Description

Details

struct MidoriExtension

struct MidoriExtension {
    GObject parent_instance;

    MidoriExtensionPrivate* priv;
};

struct MidoriExtensionClass

struct MidoriExtensionClass {
    GObjectClass parent_class;
};

midori_extension_load_from_file ()

GObject *           midori_extension_load_from_file     (const gchar *extension_path,
                                                         const gchar *filename,
                                                         gboolean activate,
                                                         gboolean test);

midori_extension_activate ()

void                midori_extension_activate           (GObject *extension,
                                                         const gchar *filename,
                                                         gboolean activate,
                                                         MidoriApp *app);

midori_extension_activate_gracefully ()

GObject *           midori_extension_activate_gracefully
                                                        (MidoriApp *app,
                                                         const gchar *extension_path,
                                                         const gchar *filename,
                                                         gboolean activate);

midori_extension_is_prepared ()

gboolean            midori_extension_is_prepared        (MidoriExtension *extension);

Determines if extension is prepared for use, for instance by ensuring that all required values are set and that it is actually activatable.

extension :

a MidoriExtension

Returns :

TRUE if extension is ready for use

midori_extension_has_preferences ()

gboolean            midori_extension_has_preferences    (MidoriExtension *extension);

Determines if extension has preferences.

extension :

a MidoriExtension

Returns :

TRUE if extension has preferences

midori_extension_is_active ()

gboolean            midori_extension_is_active          (MidoriExtension *extension);

Determines if extension is active.

extension :

a MidoriExtension

Returns :

TRUE if extension is active

Since 0.1.2


midori_extension_deactivate ()

void                midori_extension_deactivate         (MidoriExtension *extension);

Attempts to deactivate extension.

extension :

a MidoriExtension

midori_extension_get_app ()

MidoriApp *         midori_extension_get_app            (MidoriExtension *extension);

Retrieves the MidoriApp the extension belongs to. The extension has to be active.

extension :

a MidoriExtension

Returns :

the MidoriApp instance Since 0.1.6

midori_extension_get_config_dir ()

const gchar *       midori_extension_get_config_dir     (MidoriExtension *extension);

Retrieves the path to a directory reserved for configuration files specific to the extension.

If settings are installed on the extension, they will be loaded from and saved to a file "config" in this path.

extension :

a MidoriExtension

Returns :

a path, such as ~/.config/midori/extensions/name

midori_extension_install_boolean ()

void                midori_extension_install_boolean    (MidoriExtension *extension,
                                                         const gchar *name,
                                                         gboolean default_value);

Installs a boolean that can be used to conveniently store user configuration.

Note that all settings have to be installed before the extension is activated.

extension :

a MidoriExtension

name :

the name of the setting

default_value :

the default value

Since 0.1.3


midori_extension_get_boolean ()

gboolean            midori_extension_get_boolean        (MidoriExtension *extension,
                                                         const gchar *name);

Retrieves the value of the specified setting.

extension :

a MidoriExtension

name :

the name of the setting

Since 0.1.3


midori_extension_set_boolean ()

void                midori_extension_set_boolean        (MidoriExtension *extension,
                                                         const gchar *name,
                                                         gboolean value);

Assigns a new value to the specified setting.

extension :

a MidoriExtension

name :

the name of the setting

value :

the new value

Since 0.1.3


midori_extension_install_integer ()

void                midori_extension_install_integer    (MidoriExtension *extension,
                                                         const gchar *name,
                                                         gint default_value);

Installs an integer that can be used to conveniently store user configuration.

Note that all settings have to be installed before the extension is activated.

extension :

a MidoriExtension

name :

the name of the setting

default_value :

the default value

Since 0.1.3


midori_extension_get_integer ()

gint                midori_extension_get_integer        (MidoriExtension *extension,
                                                         const gchar *name);

Retrieves the value of the specified setting.

extension :

a MidoriExtension

name :

the name of the setting

Since 0.1.3


midori_extension_set_integer ()

void                midori_extension_set_integer        (MidoriExtension *extension,
                                                         const gchar *name,
                                                         gint value);

Assigns a new value to the specified setting.

extension :

a MidoriExtension

name :

the name of the setting

value :

the new value

Since 0.1.3


midori_extension_install_string ()

void                midori_extension_install_string     (MidoriExtension *extension,
                                                         const gchar *name,
                                                         const gchar *default_value);

Installs a string that can be used to conveniently store user configuration.

Note that all settings have to be installed before the extension is activated.

extension :

a MidoriExtension

name :

the name of the setting

default_value :

the default value

Since 0.1.3


midori_extension_get_string ()

const gchar *       midori_extension_get_string         (MidoriExtension *extension,
                                                         const gchar *name);

Retrieves the value of the specified setting.

extension :

a MidoriExtension

name :

the name of the setting

Since 0.1.3


midori_extension_set_string ()

void                midori_extension_set_string         (MidoriExtension *extension,
                                                         const gchar *name,
                                                         const gchar *value);

Assigns a new value to the specified setting.

extension :

a MidoriExtension

name :

the name of the setting

value :

the new value

Since 0.1.3


midori_extension_install_string_list ()

void                midori_extension_install_string_list
                                                        (MidoriExtension *extension,
                                                         const gchar *name,
                                                         gchar **default_value,
                                                         gsize default_length);

Installs a string list that can be used to conveniently store user configuration.

Note that all settings have to be installed before the extension is activated.

extension :

a MidoriExtension

name :

the name of the setting

default_value :

the default value

Since 0.1.7


midori_extension_get_string_list ()

gchar **            midori_extension_get_string_list    (MidoriExtension *extension,
                                                         const gchar *name,
                                                         gsize *length);

Retrieves the value of the specified setting.

extension :

a MidoriExtension

name :

the name of the setting

length :

return location to store number of strings, or NULL

Returns :

a newly allocated NULL-terminated list of strings, should be freed with g_strfreev()

Since 0.1.7


midori_extension_set_string_list ()

void                midori_extension_set_string_list    (MidoriExtension *extension,
                                                         const gchar *name,
                                                         gchar **value,
                                                         gsize length);

Assigns a new value to the specified setting.

extension :

a MidoriExtension

name :

the name of the setting

value :

the new value

length :

number of strings in value, or G_MAXSIZE

Since 0.1.7


midori_extension_load_from_folder ()

void                midori_extension_load_from_folder   (MidoriApp *app,
                                                         gchar **keys,
                                                         gboolean activate);