1 --- gtk+-2.6.4/gtk/gtkhashtable.c 1970-01-01 02:00:00.000000000 +0200
2 +++ gtk+-2.6.4/gtk/gtkhashtable.c 2005-04-06 16:19:36.596974776 +0300
4 +/* GTK - The GIMP Toolkit
5 + * Copyright (C) 2005 Nokia
6 + * Author: Jorn Baayen <jbaayen@gnome.org>
8 + * This library is free software; you can redistribute it and/or
9 + * modify it under the terms of the GNU Lesser General Public
10 + * License as published by the Free Software Foundation; either
11 + * version 2 of the License, or (at your option) any later version.
13 + * This library is distributed in the hope that it will be useful,
14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 + * Lesser General Public License for more details.
18 + * You should have received a copy of the GNU Lesser General Public
19 + * License along with this library; if not, write to the
20 + * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 + * Boston, MA 02111-1307, USA.
25 +#include "gtkhashtable.h"
27 +static gpointer parent_class = NULL;
29 +static void _gtk_hash_table_init (GtkHashTable *hash_table);
30 +static void _gtk_hash_table_class_init (GtkHashTableClass *klass);
31 +static void _gtk_hash_table_finalize (GObject *object);
34 +_gtk_hash_table_get_type (void)
36 + static GType hash_table_type = 0;
38 + if (!hash_table_type)
40 + static const GTypeInfo hash_table_info =
42 + sizeof (GtkHashTableClass),
43 + NULL, /* base_init */
44 + NULL, /* base_finalize */
45 + (GClassInitFunc) _gtk_hash_table_class_init,
46 + NULL, /* class_finalize */
47 + NULL, /* class_data */
48 + sizeof (GtkHashTable),
49 + 0, /* n_preallocs */
50 + (GInstanceInitFunc) _gtk_hash_table_init,
54 + g_type_register_static (G_TYPE_OBJECT, "GtkHashTable",
55 + &hash_table_info, 0);
58 + return hash_table_type;
62 +_gtk_hash_table_init (GtkHashTable *hash_table)
64 + hash_table->hash = g_hash_table_new_full (g_str_hash, g_str_equal,
69 +_gtk_hash_table_class_init (GtkHashTableClass *klass)
71 + GObjectClass *object_class = G_OBJECT_CLASS (klass);
73 + parent_class = g_type_class_peek_parent (klass);
75 + object_class->finalize = _gtk_hash_table_finalize;
79 +_gtk_hash_table_finalize (GObject *object)
81 + GtkHashTable *hash_table = GTK_HASH_TABLE (object);
83 + g_hash_table_destroy (hash_table->hash);
85 + G_OBJECT_CLASS (parent_class)->finalize (object);
89 + * _gtk_hash_table_new:
91 + * Creates a new #GtkHashTable. This is a #GHashTable wrapped in a GObject,
92 + * thereby supporting refcounting.
94 + * Return value: a new #GtkHashTable
97 +_gtk_hash_table_new (void)
99 + return g_object_new (GTK_TYPE_HASH_TABLE, NULL);