2011-07-18 11:08:39 -07:00
|
|
|
//Compile with:
|
2012-12-07 08:19:56 -08:00
|
|
|
//gcc -g -o icon_example_01 icon_example_01.c `pkg-config --cflags --libs elementary`
|
2011-07-18 11:08:39 -07:00
|
|
|
|
|
|
|
#include <Elementary.h>
|
|
|
|
|
2012-03-27 23:04:36 -07:00
|
|
|
EAPI_MAIN int
|
2017-04-19 23:33:59 -07:00
|
|
|
elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
|
2011-07-18 11:08:39 -07:00
|
|
|
{
|
2013-06-25 23:34:38 -07:00
|
|
|
Evas_Object *win, *icon;
|
2011-07-18 11:08:39 -07:00
|
|
|
const char *path, *group, *name;
|
|
|
|
|
|
|
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
|
|
|
|
2013-06-25 23:34:38 -07:00
|
|
|
win = elm_win_util_standard_add("icon", "Icon");
|
|
|
|
elm_win_autodel_set(win, EINA_TRUE);
|
2011-07-18 11:08:39 -07:00
|
|
|
|
|
|
|
icon = elm_icon_add(win);
|
|
|
|
elm_icon_standard_set(icon, "home");
|
|
|
|
|
|
|
|
path = NULL;
|
|
|
|
group = NULL;
|
|
|
|
name = NULL;
|
2012-06-27 11:09:12 -07:00
|
|
|
elm_image_file_get(icon, &path, &group);
|
2011-07-18 11:08:39 -07:00
|
|
|
name = elm_icon_standard_get(icon);
|
|
|
|
printf("path = %s, group = %s, name = %s\n", path, group, name);
|
|
|
|
|
2012-06-27 11:09:12 -07:00
|
|
|
elm_image_no_scale_set(icon, EINA_TRUE);
|
2012-06-06 11:05:22 -07:00
|
|
|
elm_image_resizable_set(icon, EINA_FALSE, EINA_TRUE);
|
2012-06-27 11:09:12 -07:00
|
|
|
elm_image_smooth_set(icon, EINA_FALSE);
|
2012-06-28 11:40:35 -07:00
|
|
|
elm_image_fill_outside_set(icon, EINA_TRUE);
|
2011-07-18 11:08:39 -07:00
|
|
|
|
|
|
|
evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
elm_win_resize_object_add(win, icon);
|
|
|
|
evas_object_show(icon);
|
|
|
|
|
|
|
|
evas_object_resize(win, 320, 320);
|
|
|
|
evas_object_show(win);
|
|
|
|
|
|
|
|
elm_run();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
ELM_MAIN()
|