2 * Copyright (c) 2013 Samsung Electronics Co., Ltd.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
22 * @brief EailIcon implementation
25 #include <Elementary.h>
27 #include "eail_icon.h"
30 * @brief EailIcon type definition
32 G_DEFINE_TYPE(EailIcon, eail_icon, EAIL_TYPE_IMAGE);
35 * @brief EailIcon initializer
37 * @param obj AtkObject instance
38 * @param data initialization data
41 eail_icon_initialize(AtkObject *obj, gpointer data)
43 ATK_OBJECT_CLASS(eail_icon_parent_class)->initialize(obj, data);
45 obj->role = ATK_ROLE_ICON;
49 * @brief Gets the name of obj
51 * Returns obj's name or obj's icon file path if obj has no assigned name,
52 * or null if none of the previous applies.
54 * @param obj AtkObject instance
55 * @returns string representing obj's name or its file path,
56 * or null if obj doesn't have a name or an a file path
59 eail_icon_get_name(AtkObject *obj)
62 Evas_Object *widget = NULL;
64 name = ATK_OBJECT_CLASS(eail_icon_parent_class)->get_name(obj);
65 if (name != NULL) return name;
67 widget = eail_widget_get_widget(EAIL_WIDGET(obj));
70 name = (const gchar*)elm_icon_standard_get(widget);
71 if (!name) elm_image_file_get(widget, &name, NULL);
78 * @brief EailIcon instance initializer
80 * @param icon EailIcon instance
83 eail_icon_init(EailIcon *icon)
88 * @brief EailItem class initializer
89 * @param klass EailIconClass instance
92 eail_icon_class_init(EailIconClass *klass)
94 AtkObjectClass *atk_class = ATK_OBJECT_CLASS(klass);
96 atk_class->initialize = eail_icon_initialize;
97 atk_class->get_name = eail_icon_get_name;