elm: Use EINA_TRUE/EINA_FALSE for Eina_Bool type.
[framework/uifw/elementary.git] / src / bin / test_icon.c
1 #include <Elementary.h>
2 #ifdef HAVE_CONFIG_H
3 # include "elementary_config.h"
4 #endif
5 #ifndef ELM_LIB_QUICKLAUNCH
6 static void
7 icon_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
8 {
9    printf("clicked!\n");
10 }
11
12 void
13 test_icon(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
14 {
15    Evas_Object *win, *ic;
16    char buf[PATH_MAX];
17
18    win = elm_win_add(NULL, "icon-transparent", ELM_WIN_BASIC);
19    elm_win_title_set(win, "Icon Transparent");
20    elm_win_autodel_set(win, EINA_TRUE);
21    elm_win_alpha_set(win, EINA_TRUE);
22
23    ic = elm_icon_add(win);
24    snprintf(buf, sizeof(buf), "%s/images/logo.png", elm_app_data_dir_get());
25    elm_icon_file_set(ic, buf, NULL);
26    elm_icon_scale_set(ic, 0, 0);
27    elm_icon_no_scale_set(ic, 1);
28    evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
29    evas_object_size_hint_fill_set(ic, 0.5, 0.5);
30    elm_win_resize_object_add(win, ic);
31    evas_object_show(ic);
32
33    evas_object_smart_callback_add(ic, "clicked", icon_clicked, NULL);
34
35    evas_object_show(win);
36 }
37 #endif