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 EailThumb Implementation
25 #include <Elementary.h>
28 #include "eail_thumb.h"
29 #include "eail_widget.h"
31 static void atk_image_iface_init(AtkImageIface *iface);
34 * @brief EailThumb type definition
36 G_DEFINE_TYPE_WITH_CODE(EailThumb,
39 G_IMPLEMENT_INTERFACE(ATK_TYPE_IMAGE,
40 atk_image_iface_init));
43 * @brief EailThumb initializer
45 * @param obj AtkObject instance
46 * @param data initialization data
49 eail_thumb_initialize(AtkObject *obj, gpointer data)
51 ATK_OBJECT_CLASS(eail_thumb_parent_class)->initialize(obj, data);
55 * @brief EailThumb instance initializer
57 * @param thumb EailThumb instance
60 eail_thumb_init(EailThumb *thumb)
65 * @brief Gets the state set of obj
67 * @param obj AtkObject instance
68 * @return AtkStateSet representing the state set of obj
71 eail_thumb_ref_state_set(AtkObject *obj)
73 AtkStateSet *state_set;
75 g_return_val_if_fail(EAIL_IS_THUMB(obj), NULL);
77 state_set = ATK_OBJECT_CLASS(eail_thumb_parent_class)->ref_state_set(obj);
79 atk_state_set_add_state(state_set, ATK_STATE_ANIMATED);
85 * @brief EailThumb class initializer
87 * @param klass EailThumbClass instance
90 eail_thumb_class_init(EailThumbClass *klass)
92 AtkObjectClass *atk_class = ATK_OBJECT_CLASS(klass);
93 atk_class->initialize = eail_thumb_initialize;
94 atk_class->ref_state_set = eail_thumb_ref_state_set;
98 * @brief Gets the current size of a thumb
100 * @param image AtkImage instance
101 * @param [out] width thumb's current width
102 * @param [out] height thumb's current height
105 eail_thumb_size_get(AtkImage *image, gint *width, gint *height)
108 Ethumb_Client *client;
112 g_return_if_fail(EAIL_IS_THUMB(image));
114 client = elm_thumb_ethumb_client_get();
115 ethumb_client_size_get(client, width, height);
118 widget = eail_widget_get_widget(EAIL_WIDGET(image));
127 evas_object_geometry_get(widget, NULL, NULL, width, height);
131 * @brief AtkImage interface initializer
133 * @param iface AtkImageIface instance
136 atk_image_iface_init(AtkImageIface *iface)
138 g_return_if_fail(iface != NULL);
140 iface->get_image_size = eail_thumb_size_get;