~mial/ubuntu/oneiric/unity/bug-791810

« back to all changes in this revision

Viewing changes to services/panel-root-accessible.c

  • Committer: Rodrigo Moya
  • Date: 2011-01-30 17:46:02 UTC
  • mto: This revision was merged to the branch mainline in revision 812.
  • Revision ID: rodrigo.moya@canonical.com-20110130174602-vn2xbke40e7ihens
Several fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// -*- Mode: C; tab-width:2; indent-tabs-mode: t; c-basic-offset: 2 -*-
2
1
/*
3
2
 * Copyright (C) 2011 Canonical Ltd
4
3
 *
39
38
static void
40
39
panel_root_accessible_class_init (PanelRootAccessibleClass *klass)
41
40
{
42
 
        GObjectClass *object_class;
43
 
        AtkObjectClass *atk_class;
44
 
 
45
 
        /* GObject */
46
 
        object_class = G_OBJECT_CLASS (klass);
47
 
 
48
 
        /* AtkObject */
49
 
        atk_class = ATK_OBJECT_CLASS (klass);
50
 
        atk_class->initialize = panel_root_accessible_initialize;
51
 
        atk_class->get_n_children = panel_root_accessible_get_n_children;
 
41
  GObjectClass *object_class;
 
42
  AtkObjectClass *atk_class;
 
43
 
 
44
  /* GObject */
 
45
  object_class = G_OBJECT_CLASS (klass);
 
46
 
 
47
  /* AtkObject */
 
48
  atk_class = ATK_OBJECT_CLASS (klass);
 
49
  atk_class->initialize = panel_root_accessible_initialize;
 
50
  atk_class->get_n_children = panel_root_accessible_get_n_children;
52
51
  atk_class->ref_child = panel_root_accessible_ref_child;
53
52
  atk_class->get_parent = panel_root_accessible_get_parent;
54
53
 
58
57
static void
59
58
panel_root_accessible_init (PanelRootAccessible *root)
60
59
{
61
 
        root->priv = GET_PRIVATE (root);
 
60
  root->priv = GET_PRIVATE (root);
62
61
}
63
62
 
64
63
AtkObject *
65
64
panel_root_accessible_new (void)
66
65
{
67
 
        AtkObject *accessible;
68
 
 
69
 
        accessible = ATK_OBJECT (g_object_new (PANEL_TYPE_ROOT_ACCESSIBLE, NULL));
70
 
 
71
 
        atk_object_initialize (accessible, NULL);
72
 
 
73
 
        return accessible;
 
66
  AtkObject *accessible;
 
67
 
 
68
  accessible = ATK_OBJECT (g_object_new (PANEL_TYPE_ROOT_ACCESSIBLE, NULL));
 
69
  atk_object_initialize (accessible, NULL);
 
70
 
 
71
  return accessible;
74
72
}
75
73
 
76
74
/* Implementation of AtkObject methods */
78
76
static void
79
77
panel_root_accessible_initialize (AtkObject *accessible, gpointer data)
80
78
{
81
 
        g_return_if_fail (PANEL_IS_ROOT_ACCESSIBLE (accessible));
82
 
 
83
 
        accessible->role = ATK_ROLE_APPLICATION;
84
 
        atk_object_set_name (accessible, _("Unity Panel Service"));
85
 
        atk_object_set_parent (accessible, NULL);
86
 
 
87
 
        ATK_OBJECT_CLASS (panel_root_accessible_parent_class)->initialize (accessible, data);
 
79
  g_return_if_fail (PANEL_IS_ROOT_ACCESSIBLE (accessible));
 
80
 
 
81
  ATK_OBJECT_CLASS (panel_root_accessible_parent_class)->initialize (accessible, data);
 
82
 
 
83
  accessible->role = ATK_ROLE_APPLICATION;
 
84
  atk_object_set_name (accessible, g_get_prgname ());
 
85
  atk_object_set_parent (accessible, NULL);
88
86
}
89
87
 
90
88
static gint
91
89
panel_root_accessible_get_n_children (AtkObject *accessible)
92
90
{
93
 
        guint n_children;
94
 
 
95
 
        g_return_val_if_fail (PANEL_IS_ROOT_ACCESSIBLE (accessible), 0);
96
 
 
97
 
        n_children = panel_service_get_n_indicators (panel_service_get_default ());
98
 
 
99
 
        g_debug ("PanelRootAccessible has %d children", n_children);
100
 
 
101
 
        return n_children;
 
91
  guint n_children;
 
92
 
 
93
  g_return_val_if_fail (PANEL_IS_ROOT_ACCESSIBLE (accessible), 0);
 
94
 
 
95
  n_children = panel_service_get_n_indicators (panel_service_get_default ());
 
96
 
 
97
  g_debug ("PanelRootAccessible has %d children", n_children);
 
98
 
 
99
  return n_children;
102
100
}
103
101
 
104
102
static AtkObject *
105
103
panel_root_accessible_ref_child (AtkObject *accessible, gint i)
106
104
{
107
 
        AtkObject *child;
108
 
 
109
 
        g_return_val_if_fail (PANEL_IS_ROOT_ACCESSIBLE (accessible), NULL);
110
 
 
111
 
        child = panel_indicator_accessible_new (); /* FIXME */
112
 
        atk_object_set_parent (child, accessible);
113
 
 
114
 
        g_debug ("Returning ATK child %p", child);
115
 
 
116
 
        return child;
 
105
  AtkObject *child;
 
106
 
 
107
  g_return_val_if_fail (PANEL_IS_ROOT_ACCESSIBLE (accessible), NULL);
 
108
 
 
109
  child = panel_indicator_accessible_new (); /* FIXME */
 
110
  atk_object_set_parent (child, accessible);
 
111
 
 
112
  g_debug ("Returning ATK child %p", child);
 
113
 
 
114
  return child;
117
115
}
118
116
 
119
117
static AtkObject *