2
Copyright (C) 2008 Christian Dywan <christian@twotoasts.de>
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Lesser General Public
6
License as published by the Free Software Foundation; either
7
version 2.1 of the License, or (at your option) any later version.
9
See the file COPYING for the full license text.
12
#include "midori-extension.h"
14
#include <katze/katze.h>
16
G_DEFINE_TYPE (MidoriExtension, midori_extension, G_TYPE_OBJECT);
18
struct _MidoriExtensionPrivate
37
midori_extension_finalize (GObject* object);
40
midori_extension_set_property (GObject* object,
46
midori_extension_get_property (GObject* object,
52
midori_extension_class_init (MidoriExtensionClass* class)
54
GObjectClass* gobject_class;
57
gobject_class = G_OBJECT_CLASS (class);
58
gobject_class->finalize = midori_extension_finalize;
59
gobject_class->set_property = midori_extension_set_property;
60
gobject_class->get_property = midori_extension_get_property;
62
flags = G_PARAM_READWRITE | G_PARAM_CONSTRUCT;
64
g_object_class_install_property (gobject_class,
69
"The name of the extension",
73
g_object_class_install_property (gobject_class,
78
"The description of the extension",
82
g_object_class_install_property (gobject_class,
87
"The version of the extension",
91
g_object_class_install_property (gobject_class,
96
"The authors of the extension",
100
g_type_class_add_private (class, sizeof (MidoriExtensionPrivate));
104
midori_extension_init (MidoriExtension* extension)
106
extension->priv = G_TYPE_INSTANCE_GET_PRIVATE (extension,
107
MIDORI_TYPE_EXTENSION, MidoriExtensionPrivate);
111
midori_extension_finalize (GObject* object)
113
MidoriExtension* extension = MIDORI_EXTENSION (object);
115
katze_assign (extension->priv->name, NULL);
116
katze_assign (extension->priv->description, NULL);
117
katze_assign (extension->priv->version, NULL);
118
katze_assign (extension->priv->authors, NULL);
122
midori_extension_set_property (GObject* object,
127
MidoriExtension* extension = MIDORI_EXTENSION (object);
132
katze_assign (extension->priv->name, g_value_dup_string (value));
134
case PROP_DESCRIPTION:
135
katze_assign (extension->priv->description, g_value_dup_string (value));
138
katze_assign (extension->priv->version, g_value_dup_string (value));
141
katze_assign (extension->priv->authors, g_value_dup_string (value));
144
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
150
midori_extension_get_property (GObject* object,
155
MidoriExtension* extension = MIDORI_EXTENSION (object);
160
g_value_set_string (value, extension->priv->name);
162
case PROP_DESCRIPTION:
163
g_value_set_string (value, extension->priv->description);
166
g_value_set_string (value, extension->priv->version);
169
g_value_set_string (value, extension->priv->authors);
172
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);