diff options
author | Christian Persch <chpe@src.gnome.org> | 2003-09-02 07:20:17 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2003-09-02 07:20:17 +0800 |
commit | 73a95385f4034998cc78199dc8bb9ee22d90d6aa (patch) | |
tree | 499d78ab52e8937f672e3659105dda083a34c988 /embed/ephy-embed-event.c | |
parent | 3375c1878c4c0ebf4f5067d128024ea484208f62 (diff) | |
download | gsoc2013-epiphany-73a95385f4034998cc78199dc8bb9ee22d90d6aa.tar gsoc2013-epiphany-73a95385f4034998cc78199dc8bb9ee22d90d6aa.tar.gz gsoc2013-epiphany-73a95385f4034998cc78199dc8bb9ee22d90d6aa.tar.bz2 gsoc2013-epiphany-73a95385f4034998cc78199dc8bb9ee22d90d6aa.tar.lz gsoc2013-epiphany-73a95385f4034998cc78199dc8bb9ee22d90d6aa.tar.xz gsoc2013-epiphany-73a95385f4034998cc78199dc8bb9ee22d90d6aa.tar.zst gsoc2013-epiphany-73a95385f4034998cc78199dc8bb9ee22d90d6aa.zip |
Mega-patch, changelog too long to paste here.
Diffstat (limited to 'embed/ephy-embed-event.c')
-rw-r--r-- | embed/ephy-embed-event.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/embed/ephy-embed-event.c b/embed/ephy-embed-event.c index 396410453..027164114 100644 --- a/embed/ephy-embed-event.c +++ b/embed/ephy-embed-event.c @@ -14,6 +14,8 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ */ #include "ephy-embed-event.h" @@ -21,6 +23,8 @@ #include <glib/ghash.h> #include <gtk/gtktypeutils.h> +#define EPHY_EMBED_EVENT_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_EMBED_EVENT, EphyEmbedEventPrivate)) + struct EphyEmbedEventPrivate { GHashTable *props; @@ -71,6 +75,8 @@ ephy_embed_event_class_init (EphyEmbedEventClass *klass) parent_class = g_type_class_peek_parent (klass); object_class->finalize = ephy_embed_event_finalize; + + g_type_class_add_private (object_class, sizeof(EphyEmbedEventPrivate)); } static void @@ -83,7 +89,7 @@ free_g_value (gpointer value) static void ephy_embed_event_init (EphyEmbedEvent *event) { - event->priv = g_new0 (EphyEmbedEventPrivate, 1); + event->priv = EPHY_EMBED_EVENT_GET_PRIVATE (event); event->priv->props = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, free_g_value); @@ -92,19 +98,10 @@ ephy_embed_event_init (EphyEmbedEvent *event) static void ephy_embed_event_finalize (GObject *object) { - EphyEmbedEvent *event; - - g_return_if_fail (object != NULL); - g_return_if_fail (IS_EPHY_EMBED_EVENT (object)); - - event = EPHY_EMBED_EVENT (object); - - g_return_if_fail (event->priv != NULL); + EphyEmbedEvent *event = EPHY_EMBED_EVENT (object); g_hash_table_destroy (event->priv->props); - g_free (event->priv); - G_OBJECT_CLASS (parent_class)->finalize (object); } @@ -114,9 +111,7 @@ ephy_embed_event_new (void) { EphyEmbedEvent *event; - event = EPHY_EMBED_EVENT (g_object_new (EPHY_EMBED_EVENT_TYPE, NULL)); - - g_return_val_if_fail (event->priv != NULL, NULL); + event = EPHY_EMBED_EVENT (g_object_new (EPHY_TYPE_EMBED_EVENT, NULL)); return event; } |