~ubuntu-branches/ubuntu/intrepid/gnome-games/intrepid

« back to all changes in this revision

Viewing changes to libgames-support/games-controls.c

  • Committer: Package Import Robot
  • Author(s): Daniel Holbach
  • Date: 2007-02-13 08:40:20 UTC
  • mto: This revision was merged to the branch mainline in revision 35.
  • Revision ID: package-import@ubuntu.com-20070213084020-zewbmxapszr0alkc
Tags: upstream-2.17.91
ImportĀ upstreamĀ versionĀ 2.17.91

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
  N_COLUMNS
43
43
};
44
44
 
 
45
G_DEFINE_TYPE (GamesControlsList, games_controls_list, GTK_TYPE_VBOX)
 
46
 
45
47
static void
46
 
games_controls_list_dispose (GamesControlsList * list)
 
48
games_controls_list_dispose (GObject *object)
 
49
        
47
50
{
 
51
  GamesControlsList *list = GAMES_CONTROLS_LIST (object);
48
52
  GConfClient *client;
49
53
  GSList *l;
50
54
 
51
 
  if (list->dispose_has_run)
52
 
    return;
53
 
 
54
55
  client = gconf_client_get_default ();
55
 
  l = list->notify_list;
56
 
  while (l) {
57
 
    gconf_client_notify_remove (client, GPOINTER_TO_INT (l->data));
58
 
    l = l->next;
 
56
  for (l = list->notify_list; l != NULL; l = l->next) {
 
57
    gconf_client_notify_remove (client, GPOINTER_TO_UINT (l->data));
59
58
  }
60
 
 
61
 
  list->dispose_has_run = TRUE;
62
 
}
63
 
 
64
 
static void
65
 
games_controls_list_finalize (GamesControlsList * list)
66
 
{
67
59
  g_slist_free (list->notify_list);
 
60
  list->notify_list = NULL;
 
61
  g_object_unref (client);
 
62
 
 
63
  G_OBJECT_CLASS (games_controls_list_parent_class)->dispose (object);
68
64
}
69
65
 
70
66
static void
72
68
{
73
69
  GObjectClass *oclass = G_OBJECT_CLASS (class);
74
70
 
75
 
  oclass->dispose = (GObjectFinalizeFunc) games_controls_list_dispose;
76
 
  oclass->finalize = (GObjectFinalizeFunc) games_controls_list_finalize;
 
71
  oclass->dispose = games_controls_list_dispose;
77
72
}
78
73
 
79
74
/*
254
249
  g_signal_connect (G_OBJECT (list->view), "button_press_event",
255
250
                    G_CALLBACK (abort_on_button_press_event), list);
256
251
 
257
 
  list->dispose_has_run = FALSE;
258
252
  list->notify_list = NULL;
259
253
}
260
254
 
261
 
GType
262
 
games_controls_list_get_type (void)
263
 
{
264
 
  static GType type = 0;
265
 
 
266
 
  if (!type) {
267
 
    static const GTypeInfo info = {
268
 
      sizeof (GamesControlsListClass),
269
 
      (GBaseInitFunc) NULL,
270
 
      (GBaseFinalizeFunc) NULL,
271
 
      (GClassInitFunc) games_controls_list_class_init,
272
 
      (GClassFinalizeFunc) NULL,
273
 
      NULL,
274
 
      sizeof (GamesControlsList),
275
 
      0,
276
 
      (GInstanceInitFunc) games_controls_list_init
277
 
    };
278
 
 
279
 
    type =
280
 
      g_type_register_static (GTK_TYPE_VBOX, "GamesControlsList", &info, 0);
281
 
  }
282
 
 
283
 
  return type;
284
 
}
285
 
 
286
255
GtkWidget *
287
256
games_controls_list_new (void)
288
257
{
392
361
                                 list, NULL, NULL);
393
362
 
394
363
  list->notify_list =
395
 
    g_slist_prepend (list->notify_list, GINT_TO_POINTER (cid));
 
364
    g_slist_prepend (list->notify_list, GUINT_TO_POINTER (cid));
396
365
 
397
366
  g_object_unref (G_OBJECT (client));
398
367
}