Makefiles: Use $(PHONY) instead of .PHONY.
[pspp] / src / ui / gui / psppire-dict.c
index e381e5dab7a40050df1a47f89e33564ded7341f6..5487853facfddd779b0589bd2c61c822c3099a6c 100644 (file)
@@ -63,8 +63,6 @@ enum  {
 
 
 /* --- prototypes --- */
-static void psppire_dict_class_init    (PsppireDictClass       *class);
-static void psppire_dict_init  (PsppireDict            *dict);
 static void psppire_dict_dispose       (GObject                *object);
 
 static void dictionary_tree_model_init (GtkTreeModelIface *iface);
@@ -141,55 +139,12 @@ static GObjectClass     *parent_class = NULL;
 static guint signals [n_SIGNALS];
 
 /* --- functions --- */
-/**
- * psppire_dict_get_type:
- * @returns: the type ID for accelerator groups.
- */
-GType
-psppire_dict_get_type (void)
-{
-  static GType object_type = 0;
-
-  if (!object_type)
-    {
-      static const GTypeInfo object_info = {
-       sizeof (PsppireDictClass),
-       (GBaseInitFunc) NULL,
-       (GBaseFinalizeFunc) NULL,
-       (GClassInitFunc) psppire_dict_class_init,
-       NULL,   /* class_finalize */
-       NULL,   /* class_data */
-       sizeof (PsppireDict),
-       0,      /* n_preallocs */
-       (GInstanceInitFunc) psppire_dict_init,
-      };
-
-      static const GInterfaceInfo tree_model_info = {
-       (GInterfaceInitFunc) dictionary_tree_model_init,
-       NULL,
-       NULL
-      };
-
-      static const GInterfaceInfo list_model_info = {
-       (GInterfaceInitFunc) ssw_init_iface,
-       NULL,
-       NULL
-      };
-
-      object_type = g_type_register_static (G_TYPE_OBJECT,
-                                           "PsppireDict",
-                                           &object_info, 0);
-
-      g_type_add_interface_static (object_type, GTK_TYPE_TREE_MODEL,
-                                  &tree_model_info);
-
-      g_type_add_interface_static (object_type, G_TYPE_LIST_MODEL,
-                                  &list_model_info);
-    }
-
-  return object_type;
-}
 
+G_DEFINE_TYPE_WITH_CODE (PsppireDict, psppire_dict, G_TYPE_OBJECT,
+                        G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL,
+                                               dictionary_tree_model_init)
+                        G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL,
+                                               ssw_init_iface))
 
 static void
 psppire_dict_class_init (PsppireDictClass *class)
@@ -956,29 +911,6 @@ psppire_dict_get_weight_variable (const PsppireDict *dict)
   return dict_get_weight (dict->dict);
 }
 
-
-
-#if DEBUGGING
-void
-psppire_dict_dump (const PsppireDict *dict)
-{
-  gint i;
-  const struct dictionary *d = dict->dict;
-
-  for (i = 0; i < dict_get_var_cnt (d); ++i)
-    {
-      const struct variable *v = psppire_dict_get_variable (dict, i);
-      int di = var_get_dict_index (v);
-      g_print ("`%s' idx=%d, fv=%d\n",
-              var_get_name(v),
-              di,
-              var_get_case_index(v));
-
-    }
-}
-#endif
-
-
 const gchar *
 psppire_dict_encoding (const PsppireDict *dict)
 {