Back to index

unity  6.0.0
unity-dash-view-accessible.cpp
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2011 Canonical Ltd
00003  *
00004  * This program is free software: you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License version 3 as
00006  * published by the Free Software Foundation.
00007  *
00008  * This program is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  * GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00015  *
00016  * Authored by: Alejandro PiƱeiro Iglesias <apinheiro@igalia.com>
00017  */
00018 
00031 #include <glib/gi18n.h>
00032 
00033 #include "unity-dash-view-accessible.h"
00034 
00035 #include "unitya11y.h"
00036 #include "DashView.h"
00037 
00038 using namespace unity::dash;
00039 
00040 /* GObject */
00041 static void unity_dash_view_accessible_class_init(UnityDashViewAccessibleClass* klass);
00042 static void unity_dash_view_accessible_init(UnityDashViewAccessible* self);
00043 static void unity_dash_view_accessible_finalize(GObject* object);
00044 
00045 /* AtkObject.h */
00046 static void       unity_dash_view_accessible_initialize(AtkObject* accessible,
00047                                                         gpointer   data);
00048 
00049 G_DEFINE_TYPE(UnityDashViewAccessible, unity_dash_view_accessible,  NUX_TYPE_VIEW_ACCESSIBLE)
00050 
00051 #define UNITY_DASH_VIEW_ACCESSIBLE_GET_PRIVATE(obj)                      \
00052   (G_TYPE_INSTANCE_GET_PRIVATE ((obj), UNITY_TYPE_DASH_VIEW_ACCESSIBLE,  \
00053                                 UnityDashViewAccessiblePrivate))
00054 
00055 struct _UnityDashViewAccessiblePrivate
00056 {
00057 
00058 };
00059 
00060 
00061 static void
00062 unity_dash_view_accessible_class_init(UnityDashViewAccessibleClass* klass)
00063 {
00064   GObjectClass* gobject_class = G_OBJECT_CLASS(klass);
00065   AtkObjectClass* atk_class = ATK_OBJECT_CLASS(klass);
00066 
00067   gobject_class->finalize = unity_dash_view_accessible_finalize;
00068 
00069   /* AtkObject */
00070   atk_class->initialize = unity_dash_view_accessible_initialize;
00071 
00072   g_type_class_add_private(gobject_class, sizeof(UnityDashViewAccessiblePrivate));
00073 }
00074 
00075 static void
00076 unity_dash_view_accessible_init(UnityDashViewAccessible* self)
00077 {
00078   UnityDashViewAccessiblePrivate* priv =
00079     UNITY_DASH_VIEW_ACCESSIBLE_GET_PRIVATE(self);
00080 
00081   self->priv = priv;
00082 }
00083 
00084 static void
00085 unity_dash_view_accessible_finalize(GObject* object)
00086 {
00087   G_OBJECT_CLASS(unity_dash_view_accessible_parent_class)->finalize(object);
00088 }
00089 
00090 AtkObject*
00091 unity_dash_view_accessible_new(nux::Object* object)
00092 {
00093   AtkObject* accessible = NULL;
00094 
00095   g_return_val_if_fail(dynamic_cast<DashView*>(object), NULL);
00096 
00097   accessible = ATK_OBJECT(g_object_new(UNITY_TYPE_DASH_VIEW_ACCESSIBLE, NULL));
00098 
00099   atk_object_initialize(accessible, object);
00100   atk_object_set_name(accessible, _("Dash"));
00101 
00102   return accessible;
00103 }
00104 
00105 /* AtkObject.h */
00106 static void
00107 unity_dash_view_accessible_initialize(AtkObject* accessible,
00108                                       gpointer data)
00109 {
00110   ATK_OBJECT_CLASS(unity_dash_view_accessible_parent_class)->initialize(accessible, data);
00111 
00112   accessible->role = ATK_ROLE_PANEL;
00113 }
00114