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 EailPhoto implementation
25 #include <Elementary.h>
27 #include "eail_photo.h"
28 #include "eail_priv.h"
30 static void atk_image_iface_init(AtkImageIface *iface);
33 * @brief EailPhoto type definition
35 G_DEFINE_TYPE_WITH_CODE(EailPhoto, eail_photo, EAIL_TYPE_IMAGE,
36 G_IMPLEMENT_INTERFACE(ATK_TYPE_IMAGE,
37 atk_image_iface_init));
41 * @brief Gets the image size
43 * @param image AtkImage instance
44 * @param [out] width photo width or -1 if value cannot be obtained
45 * @param [out] height photo height or -1 if value cannot be obtained
48 eail_photo_size_get(AtkImage *image, gint *width, gint *height)
50 g_return_if_fail(ATK_IS_IMAGE(image));
52 Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(image));
59 evas_object_geometry_get(widget, NULL, NULL, width, height);
63 * @brief EailPhoto initializer
65 * @param obj AtkObject instance
66 * @param data initialization data
69 eail_photo_initialize(AtkObject *obj, gpointer data)
71 ATK_OBJECT_CLASS(eail_photo_parent_class)->initialize(obj, data);
75 * @brief EailPhoto class initializer
77 * @param klass EailPhotoClass instance
80 eail_photo_class_init(EailPhotoClass *klass)
82 AtkObjectClass *atk_class = ATK_OBJECT_CLASS(klass);
83 atk_class->initialize = eail_photo_initialize;
87 * @brief EailPhoto instance initializer
89 * @param photo EailPhoto instance
92 eail_photo_init(EailPhoto *photo)
97 * @brief AtkImage interface initializer
99 * @param iface AtkImage interface
102 atk_image_iface_init(AtkImageIface* iface)
106 iface->get_image_size = eail_photo_size_get;