EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *cal;
   const char *weekdays[] =
     {
        "S", "M", "T", "W", "T", "F", "S"
     };

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add("calendar", "Calendar Layout Formatting Example");
   elm_win_autodel_set(win, EINA_TRUE);

   cal = elm_calendar_add(win);
   evas_object_size_hint_weight_set(cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, cal);

   elm_calendar_format_function_set(cal, _format_month_year);
   elm_calendar_weekdays_names_set(cal, weekdays);

   evas_object_show(cal);

   evas_object_show(win);

   elm_run();
   elm_shutdown();

   return 0;
}
Exemplo n.º 2
0
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win = NULL, *image = NULL, *btn = NULL, *bx = NULL;
   char buf[PATH_MAX];
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
   win = elm_win_util_standard_add("test", "Hello Elementary");
   elm_win_autodel_set(win, EINA_TRUE);
   
   bx = elm_box_add(win);
   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, bx);
   evas_object_show(bx);
   
   snprintf(buf, sizeof(buf), "bodhilogo-simple.png");

   image = elm_image_add(win);
    /*if (!elm_image_file_set(image, buf, NULL))
     {
        printf("error: could not load image \"%s\"\n", buf);
        return -1;
     } */
   elm_image_file_set(image, NULL, NULL);
   evas_object_size_hint_weight_set(image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, image);
   evas_object_show(image);
   
   evas_object_resize(win, 300, 200);
   evas_object_show(win);

   elm_run(); 
   return EXIT_SUCCESS;
}
Exemplo n.º 3
0
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *o;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add("efl-thread-3", "EFL Thread 3");
   elm_win_autodel_set(win, EINA_TRUE);

   o = evas_object_rectangle_add(evas_object_evas_get(win));
   evas_object_color_set(o, 50, 80, 180, 255);
   evas_object_resize(o, 100, 100);
   evas_object_show(o);
   rect = o;

   // create custom thread to do some "work on the side"
   my_thread_new();

   evas_object_resize(win, 400, 400);
   evas_object_show(win);

   elm_run();
   elm_shutdown();

   return 0;
}
Exemplo n.º 4
0
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *o, *bg;

   win = elm_win_add(NULL, "efl-thread-4", ELM_WIN_BASIC);
   elm_win_title_set(win, "EFL Thread 4");
   elm_win_autodel_set(win, EINA_TRUE);
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
   evas_object_resize(win, 400, 400);
   evas_object_show(win);

   bg = elm_bg_add(win);
   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, bg);
   evas_object_show(bg);

   o = evas_object_rectangle_add(evas_object_evas_get(win));
   evas_object_color_set(o, 50, 80, 180, 255);
   evas_object_resize(o, 100, 100);
   evas_object_show(o);
   // new in the examples - we have a mouse down on the blue box cancel
   // the thread
   evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, down, NULL);
   rect = o;

   // create custom thread to do some "work on the side"
   my_thread_new();

   elm_run();
   elm_shutdown();

   return 0;
}
Exemplo n.º 5
0
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   if (!ecore_main_loop_glib_integrate())
    {
       printf("Cannot integrate with glib main loop");
       return -1;
    }

#if !GLIB_CHECK_VERSION(2,35,0)
   g_type_init();
#endif

   Evas_Object *win;

   win = elm_win_add(NULL, WINDOW_TEST_TITLE, ELM_WIN_BASIC);
   elm_win_title_set(win, WINDOW_TEST_TITLE);
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
   elm_win_autodel_set(win, EINA_TRUE );

   evas_object_smart_callback_add(win, "focus,in", on_focus_in, NULL);
   initialize_and_show_tooltip(win);

   evas_object_resize(win, 320, 320);
   /* and show the window */
   evas_object_show(win);

   elm_run();
   elm_shutdown();

   /* exit code */
   return 0;
}
Exemplo n.º 6
0
EAPI_MAIN int
elm_main(int argc, char **argv) {
	Evas_Object *win = NULL;
	Evas_Object *bg = NULL;

	win = elm_win_add(NULL, "Background sample", ELM_WIN_BASIC);
	elm_win_autodel_set(win, EINA_TRUE);
	elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

	bg = elm_bg_add(win);
	elm_bg_option_set(bg, ELM_BG_OPTION_CENTER);
	elm_bg_color_set(bg, 255, 0, 255);
	evas_object_show(bg);

	evas_object_smart_callback_add(win, "focus,in", _register_cb, bg);

	register_request_listener(EVENT_HIDE, hide, bg);
	register_request_listener(EVENT_SHOW, show, bg);

	elm_win_resize_object_add(win, bg);
	evas_object_resize(win, 240, 200);

	evas_object_show(win);

	elm_run();
	elm_shutdown();
	return 0;
}
Exemplo n.º 7
0
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *bt;
   Elm_Transit *trans;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add("transit-basic", "Transit - Basic");
   elm_win_autodel_set(win, EINA_TRUE);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Resizing Effect");
   evas_object_show(bt);
   evas_object_move(bt, 50, 100);
   evas_object_resize(bt, 100, 50);

   trans = elm_transit_add();
   elm_transit_object_add(trans, bt);

   elm_transit_effect_resizing_add(trans, 100, 50, 300, 150);

   elm_transit_duration_set(trans, 5.0);
   elm_transit_go(trans);

   evas_object_resize(win, 400, 400);
   evas_object_show(win);

   elm_run();

   return 0;
}
Exemplo n.º 8
0
EAPI_MAIN int
elm_main(int argc, char **argv) {
	Evas_Object *win = NULL;
	Evas_Object *dayselector = NULL;

	win = elm_win_add(NULL, "dayselector sample", ELM_WIN_BASIC);
	elm_win_title_set(win, "dayselector sample");
	elm_win_autodel_set(win, EINA_TRUE);
	elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

	dayselector = elm_dayselector_add(win);
	elm_object_text_set(dayselector, "DaySelector!");

	request_init();

	evas_object_smart_callback_add(win, "focus,in", _register_cb, dayselector);

	register_request_listener(EVENT_RESIZE, resize, dayselector);
	register_request_listener(EVENT_SET_DISABLED, set_disabled, dayselector);
	register_request_listener(EVENT_SET_ENABLED, set_enabled, dayselector);
	register_request_listener(EVENT_HIDE, hide, dayselector);
	register_request_listener(EVENT_SHOW, show, dayselector);

	evas_object_resize(win, 380, 80);
	evas_object_resize(dayselector, 120, 40);
	evas_object_move(dayselector, 30, 15);

	evas_object_show(win);
	evas_object_show(dayselector);

	elm_run();
	request_shutdown();
	elm_shutdown();
	return 0;
}
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *o;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add("efl-thread-4", "EFL Thread 4");
   evas_object_smart_callback_add(win, "delete,request", del, NULL);

   o = evas_object_rectangle_add(evas_object_evas_get(win));
   evas_object_color_set(o, 50, 80, 180, 255);
   evas_object_resize(o, 100, 100);
   evas_object_show(o);
   // new in the examples - we have a mouse down on the blue box cancel
   // the thread
   evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, down, NULL);
   rect = o;

   // create custom thread to do some "work on the side"
   my_thread_new();

   evas_object_resize(win, 400, 400);
   evas_object_show(win);

   elm_run();
   pthread_mutex_lock(&th_lock);
   th_exit = 1;
   pthread_mutex_unlock(&th_lock);
   elm_shutdown();

   return 0;
}
Exemplo n.º 10
0
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *o;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add("efl-thread-5", "EFL Thread 5");
   evas_object_smart_callback_add(win, "delete,request", del, NULL);

   o = evas_object_rectangle_add(evas_object_evas_get(win));
   evas_object_color_set(o, 50, 80, 180, 255);
   evas_object_resize(o, 100, 100);
   evas_object_show(o);
   evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, down, NULL);
   rect = o;

   // explicitly create ecore thread to do some "work on the side" and pass
   // in NULL as data ptr to callbacks and true at the end means to actually
   // make a new thread and not use the thread pool (there is a thread pool
   // with as many thread workers as there are cpu's so this means you do not
   // overload the cpu's with more work than you actually have processing
   // units *IF* your threads do actually spend their time doing actual
   // heavy computation)
   thr = ecore_thread_feedback_run(th_do, th_feedback, th_end, th_cancel,
                                   NULL, EINA_TRUE);

   evas_object_resize(win, 400, 400);
   evas_object_show(win);

   elm_run();
   if (thr) ecore_thread_cancel(thr);

   return 0;
}
Exemplo n.º 11
0
static void
_init_prefs(Evas_Object *win)
{
   Evas_Object *bg, *prefs;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
   elm_win_autodel_set(win, EINA_TRUE);

   bg = elm_bg_add(win);
   elm_win_resize_object_add(win, bg);
   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_show(bg);

   prefs = elm_prefs_add(win);
   evas_object_size_hint_weight_set(prefs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, prefs);
   evas_object_show(prefs);
   elm_prefs_autosave_set(prefs, EINA_TRUE);
   prefs_data = elm_prefs_data_new("./data/prefs_example_02.cfg", NULL,
                                   EET_FILE_MODE_READ_WRITE);
   elm_prefs_file_set(prefs, "./data/prefs_example_02.epb", NULL);
   elm_prefs_data_set(prefs, prefs_data);

   evas_object_resize(win, 320, 320);
}
Exemplo n.º 12
0
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *o, *bg;

   win = elm_win_add(NULL, "efl-thread-3", ELM_WIN_BASIC);
   elm_win_title_set(win, "EFL Thread 3");
   elm_win_autodel_set(win, EINA_TRUE);
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
   evas_object_resize(win, 400, 400);
   evas_object_show(win);

   bg = elm_bg_add(win);
   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, bg);
   evas_object_show(bg);

   o = evas_object_rectangle_add(evas_object_evas_get(win));
   evas_object_color_set(o, 50, 80, 180, 255);
   evas_object_resize(o, 100, 100);
   evas_object_show(o);
   rect = o;

   // create custom thread to do some "work on the side"
   my_thread_new();

   elm_run();
   elm_shutdown();

   return 0;
}
Exemplo n.º 13
0
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *bg, *cal;

   win = elm_win_add(NULL, "calendar", ELM_WIN_BASIC);
   elm_win_title_set(win, "Calendar Creation Example");
   elm_win_autodel_set(win, EINA_TRUE);
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   bg = elm_bg_add(win);
   elm_win_resize_object_add(win, bg);
   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_show(bg);

   cal = elm_calendar_add(win);
   elm_win_resize_object_add(win, cal);
   evas_object_size_hint_weight_set(cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_show(cal);

   evas_object_show(win);

   elm_run();
   elm_shutdown();

   return 0;
}
Exemplo n.º 14
0
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *bg, *bt, *bt2, *rect, *rect2, *rect3, *hover;

   win = elm_win_add(NULL, "hover", ELM_WIN_BASIC);
   elm_win_title_set(win, "Hover");
   elm_win_autodel_set(win, EINA_TRUE);
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   bg = elm_bg_add(win);
   elm_win_resize_object_add(win, bg);
   evas_object_show(bg);

   rect = evas_object_rectangle_add(evas_object_evas_get(win));
   evas_object_size_hint_min_set(rect, 25, 25);
   evas_object_color_set(rect, 255, 0, 0, 255);
   evas_object_show(rect);

   rect2 = evas_object_rectangle_add(evas_object_evas_get(win));
   evas_object_size_hint_min_set(rect2, 25, 25);
   evas_object_color_set(rect2, 0, 255, 0, 255);
   evas_object_show(rect2);

   rect3 = evas_object_rectangle_add(evas_object_evas_get(win));
   evas_object_size_hint_min_set(rect3, 25, 25);
   evas_object_color_set(rect3, 0, 0, 255, 255);
   evas_object_show(rect3);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Show hover");
   evas_object_move(bt, 60, 90);
   evas_object_resize(bt, 80, 20);
   evas_object_show(bt);

   bt2 = elm_button_add(win);
   elm_object_text_set(bt2, "Hide hover");
   evas_object_show(bt2);

   hover = elm_hover_add(win);
   elm_hover_parent_set(hover, win);
   elm_hover_target_set(hover, bt);

   elm_object_style_set(hover, "popout");

   elm_hover_content_set(hover, "left", rect);
   elm_hover_content_set(hover, "top", rect2);
   elm_hover_content_set(hover, "right", rect3);
   elm_hover_content_set(hover, "middle", bt2);

   evas_object_smart_callback_add(bt, "clicked", _show_hover, hover);
   evas_object_smart_callback_add(bt2, "clicked", _hide_hover, hover);

   evas_object_resize(win, 200, 200);
   evas_object_show(win);

   elm_run();

   return 0;
}
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *bg;
   Evas_Object *thumb;
   char buf[PATH_MAX];
#ifdef ELM_ETHUMB   
   Ethumb_Client *client;
#endif
   
   elm_need_ethumb();

   elm_app_info_set(elm_main, "elementary", "images/plant_01.jpg");
   win = elm_win_add(NULL, "thumb", ELM_WIN_BASIC);
   elm_win_title_set(win, "Thumbnailer");
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
   elm_win_autodel_set(win, EINA_TRUE);

   bg = elm_bg_add(win);
   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, bg);
   evas_object_show(bg);

#ifdef ELM_ETHUMB
   client = elm_thumb_ethumb_client_get();
   if (!client)
     {
	printf("error: could not get Ethumb client.\n");
	return 1;
     }
   ethumb_client_size_set(client, 160, 160);
#endif
   
   thumb = elm_thumb_add(win);

   evas_object_smart_callback_add(thumb, "generate,start", _generation_started_cb, NULL);
   evas_object_smart_callback_add(thumb, "generate,stop", _generation_finished_cb, NULL);
   evas_object_smart_callback_add(thumb, "generate,error", _generation_error_cb, NULL);

   elm_thumb_editable_set(thumb, EINA_FALSE);
   snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
   elm_thumb_file_set(thumb, buf, NULL);
   elm_thumb_reload(thumb);

   evas_object_size_hint_weight_set(thumb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, thumb);
   evas_object_show(thumb);

   evas_object_size_hint_min_set(bg, 160, 160);
   evas_object_size_hint_max_set(bg, 640, 640);
   evas_object_resize(win, 320, 320);
   evas_object_show(win);

   elm_run(); /* and run the program now, starting to handle all
               * events, etc. */
   elm_shutdown(); /* clean up and shut down */
   /* exit code */
   return 0;
}
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *bx, *ck;
   unsigned int digedit;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add("clock", "Clock Example");
   elm_win_autodel_set(win, EINA_TRUE);

   bx = elm_box_add(win);
   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, bx);
   evas_object_show(bx);

   /* pristine (no seconds, military time) */
   ck = elm_clock_add(win);
   elm_box_pack_end(bx, ck);
   evas_object_show(ck);

   /* am/pm */
   ck = elm_clock_add(win);
   elm_clock_show_am_pm_set(ck, EINA_TRUE);
   elm_box_pack_end(bx, ck);
   evas_object_show(ck);

   /* with seconds and custom time */
   ck = elm_clock_add(win);
   elm_clock_show_seconds_set(ck, EINA_TRUE);
   elm_clock_time_set(ck, 10, 11, 12);
   elm_box_pack_end(bx, ck);
   evas_object_show(ck);

   /* in edition mode, with seconds, custom time and am/pm set */
   ck = elm_clock_add(win);
   elm_clock_edit_set(ck, EINA_TRUE);
   elm_clock_show_seconds_set(ck, EINA_TRUE);
   elm_clock_show_am_pm_set(ck, EINA_TRUE);
   elm_clock_time_set(ck, 10, 11, 12);
   elm_box_pack_end(bx, ck);
   evas_object_show(ck);

   /* in edition mode, with seconds, but only some digits editable */
   ck = elm_clock_add(win);
   elm_clock_show_seconds_set(ck, EINA_TRUE);
   elm_clock_edit_set(ck, EINA_TRUE);
   digedit = ELM_CLOCK_EDIT_HOUR_UNIT | ELM_CLOCK_EDIT_MIN_UNIT | ELM_CLOCK_EDIT_SEC_UNIT;
   elm_clock_edit_mode_set(ck, digedit);
   elm_box_pack_end(bx, ck);
   evas_object_show(ck);

   evas_object_show(win);

   elm_run();
   elm_shutdown();

   return 0;
}
Exemplo n.º 17
0
EAPI_MAIN int
elm_main(int argc, char **argv) {
	Evas_Object *map = NULL;
	Evas_Object *bg = NULL;
	Evas_Object *icon = NULL;
	Elm_Map_Overlay *item =  NULL;

	win = elm_win_add(NULL, "Main Window", ELM_WIN_BASIC);
	elm_win_title_set(win, "Hello, My World Map!");
	elm_win_autodel_set(win, EINA_TRUE);
	elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

	bg = elm_bg_add(win);
	evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	elm_win_resize_object_add(win, bg);
	evas_object_show(bg);

	map = elm_map_add(win);
	evas_object_size_hint_weight_set(map, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	elm_win_resize_object_add(win, map);
	evas_object_show(map);

	icon = elm_icon_add(win);
	elm_object_text_set(icon, "Icon1");
	elm_icon_standard_set(icon, "home");

	item = elm_map_overlay_add(map,21.009865, 52.224855);
	elm_map_overlay_icon_set(item, icon);

	evas_object_smart_callback_add(win, "focus,in", _register_cb, map);

	register_request_listener(EVENT_SET_FOCUS, set_focus, map);
	register_request_listener(EVENT_UNSET_FOCUS, unset_focus, map);
	register_request_listener(EVENT_SET_FOCUSABLE, set_focusable, map);
	register_request_listener(EVENT_UNSET_FOCUSABLE, unset_focusable, map);
	register_request_listener(EVENT_ADD_CHILDREN, add_children,map);
	register_request_listener(EVENT_RM_CHILDREN, rm_children,item);
	register_request_listener(EVENT_HIDE, hide, map);
	register_request_listener(EVENT_SHOW, show, map);

	register_request_listener(ACTION_ZOOM_IN, register_action_zoom_in, map);
	register_request_listener(ACTION_ZOOM_OUT, register_action_zoom_out, map);
	register_request_listener(ACTION_SCROLL_LEFT, register_action_scroll_left, map);
	register_request_listener(ACTION_SCROLL_RIGHT, register_action_scroll_right, map);
	register_request_listener(ACTION_SCROLL_UP, register_action_scroll_up, map);
	register_request_listener(ACTION_SCROLL_DOWN, register_action_scroll_down, map);
	register_request_listener(ACTION_CLICK, register_action_click, map);
	register_request_listener(ACTION_PRESS, register_action_press, map);

	elm_map_zoom_set(map, 2);

	evas_object_resize(win, 800, 800);
	evas_object_show(win);

	elm_run();
	request_shutdown();
	elm_shutdown();
	return 0;
}
EAPI_MAIN int
elm_main(int    argc,
         char **argv)
{
   Evas_Object *win, *grid, *idx;
   Elm_Object_Item *gg_it;
   unsigned int i;

   Elm_Gengrid_Item_Class gic;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
   elm_app_info_set(elm_main, "elementary", "images");

   win = elm_win_util_standard_add("index", "Index Example");
   elm_win_autodel_set(win, EINA_TRUE);

   grid = elm_gengrid_add(win);
   elm_gengrid_item_size_set(grid, 150, 150);

   gic.item_style = "default";
   gic.func.text_get = _grid_label_get;
   gic.func.content_get = _grid_content_get;
   gic.func.state_get = NULL;
   gic.func.del = NULL;

   evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, grid);
   evas_object_show(grid);

   idx = elm_index_add(win);
   evas_object_size_hint_weight_set(idx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, idx);
   evas_object_show(idx);

   for (i = 0; i < (sizeof(items) / sizeof(items[0])); i++)
     {
        char buf[32];

        gg_it = elm_gengrid_item_append(grid, &gic, (void *)i, NULL, NULL);

        /* indexing by first letters */
        snprintf(buf, sizeof(buf), "%c", items[i][0]);
        elm_index_item_sorted_insert(idx, buf, NULL, gg_it, _index_icmp, NULL);
     }

   evas_object_smart_callback_add(idx, "delay,changed", _index_changed, NULL);

   elm_index_autohide_disabled_set(idx, EINA_FALSE);
   elm_index_level_go(idx, 0);

   evas_object_resize(win, 320, 300);
   evas_object_show(win);

   elm_run();
   elm_shutdown();

   return 0;
}
Exemplo n.º 19
0
EAPI_MAIN int
elm_main(int argc, char **argv) {
	Evas_Object *win = NULL;
	Evas_Object *video = NULL;
	Evas_Object *player = NULL;
	char *video_file = NULL;

	win = elm_win_add(NULL, "Main Window", ELM_WIN_BASIC);
	elm_win_title_set(win, "Player app!");
	elm_win_autodel_set(win, EINA_TRUE);
	elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

	player = elm_player_add(win);

	video = elm_video_add(win);

	evas_object_smart_callback_add(win, "focus,in", _register_cb, player);

	register_request_listener(EVENT_SET_FOCUSABLE, set_focusable, player);
	register_request_listener(EVENT_UNSET_FOCUSABLE, unset_focusable, player);
	register_request_listener(EVENT_SET_FOCUS, set_focus, player);
	register_request_listener(EVENT_UNSET_FOCUS, unset_focus, player);
	register_request_listener(EVENT_RESIZE, resize, player);
	register_request_listener(EVENT_SET_DISABLED, set_disabled, player);
	register_request_listener(EVENT_SET_ENABLED, set_enabled, player);
	register_request_listener(EVENT_HIDE, hide, player);
	register_request_listener(EVENT_SHOW, show, player);

	register_request_listener(ACTION_FORWARD, register_action_forward, player);
	register_request_listener(ACTION_NEXT, register_action_next, player);
	register_request_listener(ACTION_PAUSE, register_action_pause, player);
	register_request_listener(ACTION_PLAY, register_action_play, player);
	register_request_listener(ACTION_PREV, register_action_prev, player);
	register_request_listener(ACTION_REWIND, register_action_rewind, player);
	register_request_listener(ACTION_STOP, register_action_stop, player);

	elm_video_stop(video);

	evas_object_resize(win, 480, 320);
	elm_win_resize_object_add(win, video);
	evas_object_resize(player, 480, 10);
	evas_object_move(player, 0, 300);
	elm_object_part_content_set(player, "video", video);

	evas_object_show(win);
	evas_object_show(video);
	evas_object_show(player);

	video_file = get_file(argv[0], MY_VIDEO);
	elm_video_file_set(video, video_file);
	elm_video_play(video);

	elm_run();
	request_shutdown();
	elm_shutdown();
	free(video_file);
	return 0;
}
Exemplo n.º 20
0
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *panes, *panes_h, *bt;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add("panes", "Panes Example");
   elm_win_autodel_set(win, EINA_TRUE);
   elm_win_focus_highlight_enabled_set(win, EINA_TRUE);

   panes = elm_panes_add(win);
   evas_object_size_hint_weight_set(panes, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, panes);
   evas_object_show(panes);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Left");
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_show(bt);
   elm_object_part_content_set(panes, "left", bt);

   panes_h = elm_panes_add(win);
   elm_panes_horizontal_set(panes_h, EINA_TRUE);
   evas_object_size_hint_weight_set(panes_h, EVAS_HINT_EXPAND,
                                    EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(panes_h, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_show(panes_h);
   elm_object_part_content_set(panes, "right", panes_h);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Up");
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_show(bt);
   elm_object_part_content_set(panes_h, "left", bt);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Down");
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_show(bt);
   elm_object_part_content_set(panes_h, "right", bt);

   evas_object_smart_callback_add(panes, "clicked", _clicked, panes);
   evas_object_smart_callback_add(panes, "clicked,double", _clicked_double,
                                  panes);
   evas_object_smart_callback_add(panes, "press", _press, panes);
   evas_object_smart_callback_add(panes, "unpress", _unpress, panes);

   evas_object_resize(win, 320, 400);
   evas_object_show(win);

   elm_run();

   return 0;
}
Exemplo n.º 21
0
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *bg, *bx, *notify, *content;

   win = elm_win_util_standard_add("notify", "Notify");
   elm_win_autodel_set(win, EINA_TRUE);
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   bx = elm_box_add(win);
   elm_box_horizontal_set(bx, EINA_FALSE);
   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, bx);
   evas_object_show(bx);

   content = elm_label_add(win);
   elm_object_text_set(content, "default");
   evas_object_show(content);

   notify = elm_notify_add(win);
   elm_notify_allow_events_set(notify, EINA_FALSE);
   elm_notify_timeout_set(notify, 5);
   elm_object_content_set(notify, content);
   evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_show(notify);
   elm_box_pack_end(bx, notify);
   evas_object_smart_callback_add(notify, "block,clicked", _hide, NULL);

   content = elm_label_add(win);
   elm_object_text_set(content, "bottom");
   evas_object_show(content);

   notify = elm_notify_add(win);
   elm_notify_align_set(notify, 0.5, 1.0);
   elm_object_content_set(notify, content);
   evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_show(notify);
   elm_box_pack_end(bx, notify);

   content = elm_label_add(win);
   elm_object_text_set(content, "center");
   evas_object_show(content);

   notify = elm_notify_add(win);
   elm_notify_align_set(notify, 0.5, 0.5);
   elm_object_content_set(notify, content);
   evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_show(notify);
   elm_box_pack_end(bx, notify);

   evas_object_resize(win, 100, 200);
   evas_object_show(win);

   elm_run();
   elm_shutdown();

   return 0;
}
Exemplo n.º 22
0
static void
_init_radio(Evas_Object *win)
{
   Evas_Object *bg, *radio, *group, *bx, *ic;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
   elm_win_autodel_set(win, EINA_TRUE);

   bg = elm_bg_add(win);
   elm_win_resize_object_add(win, bg);
   evas_object_show(bg);

   bx = elm_box_add(win);
   elm_box_horizontal_set(bx, EINA_TRUE);
   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, bx);
   evas_object_show(bx);

   group = radio = elm_radio_add(win);
   elm_object_text_set(radio, RADIO1);
   elm_radio_state_value_set(radio, 1);
   elm_radio_value_pointer_set(radio, &val);
   ic = elm_icon_add(win);
   elm_icon_standard_set(ic, "home");
   elm_object_part_content_set(radio, "icon", ic);
   elm_box_pack_end(bx, radio);
   evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_show(radio);

   radio = elm_radio_add(win);
   elm_object_text_set(radio, RADIO2);
   elm_radio_state_value_set(radio, 2);
   elm_radio_value_pointer_set(radio, &val);
   elm_radio_group_add(radio, group);
   ic = elm_icon_add(win);
   elm_icon_standard_set(ic, "file");
   elm_object_part_content_set(radio, "icon", ic);
   elm_box_pack_end(bx, radio);
   evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_show(radio);

   radio = elm_radio_add(win);
   elm_object_text_set(radio, RADIO3);
   elm_radio_state_value_set(radio, 3);
   elm_radio_value_pointer_set(radio, &val);
   elm_radio_group_add(radio, group);
   elm_box_pack_end(bx, radio);
   evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_show(radio);

   elm_radio_value_set(radio, RADIO2_SEL);
}
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *bg, *box;
   Evas_Object *list;

   win = elm_win_add(NULL, "icon", ELM_WIN_BASIC);
   elm_win_title_set(win, "Icon");
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
   elm_win_autodel_set(win, EINA_TRUE);

   bg = elm_bg_add(win);
   elm_bg_color_set(bg, 255,255 ,255);
   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, bg);
   evas_object_show(bg);

   box = elm_box_add(win);
   elm_box_horizontal_set(box, EINA_TRUE);
   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_win_resize_object_add(win, box);
   evas_object_show(box);

   if (!_itc)
     {
        _itc = elm_genlist_item_class_new();
        _itc->item_style = "double_label";
        _itc->func.text_get = _item_label_get;
        _itc->func.content_get = _item_content_get;
        _itc->func.state_get = NULL;
        _itc->func.del = NULL;
     }

   list = _genlist_add(box);
   _genlist_fill(list);

   list = _genlist_add(box);
   elm_genlist_mode_set(list, ELM_LIST_LIMIT);
   _genlist_fill(list);

   list = _genlist_add(box);
   elm_genlist_mode_set(list, ELM_LIST_COMPRESS);
   _genlist_fill(list);

   evas_object_size_hint_min_set(bg, 800, 160);
   evas_object_size_hint_max_set(bg, 800, 640);
   evas_object_resize(win, 800, 320);
   evas_object_show(win);

   elm_run();
   elm_shutdown();

   return 0;
}
Exemplo n.º 24
0
EAPI_MAIN int
elm_main(int argc, char **argv) {
	Evas_Object *win = NULL;
	Evas_Object *toolbar = NULL;
	Evas_Object *box = NULL;
	Evas_Object *bg = NULL;

	win = elm_win_add(NULL, "Main Window", ELM_WIN_BASIC);
	elm_win_title_set(win, "Sample toolbar item application!");
	elm_win_autodel_set(win, EINA_TRUE);
	elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

	bg = elm_bg_add(win);
	evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	elm_win_resize_object_add(win, bg);
	evas_object_show(bg);

	box = elm_box_add(win);
	evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	elm_win_resize_object_add(win, box);
	evas_object_show(box);

	toolbar = elm_toolbar_add(win);
	elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_SCROLL);
	evas_object_size_hint_weight_set(toolbar, 0.0, 0.0);
	evas_object_size_hint_align_set(toolbar, EVAS_HINT_FILL, 0.0);
	evas_object_show(toolbar);

	elm_toolbar_item_append(toolbar, NULL, "Item 1", NULL, NULL);
	elm_toolbar_item_append(toolbar, NULL, "Item 2", NULL, NULL);

	evas_object_smart_callback_add(win, "focus,in", _register_cb, toolbar);

	register_request_listener(EVENT_SET_FOCUS, set_focus, toolbar);
	register_request_listener(EVENT_UNSET_FOCUS, unset_focus, toolbar);
	register_request_listener(EVENT_SET_FOCUSABLE, set_focusable, toolbar);
	register_request_listener(EVENT_UNSET_FOCUSABLE, unset_focusable, toolbar);
	register_request_listener(EVENT_ADD_CHILDREN, add_children, toolbar);
	register_request_listener(EVENT_RM_CHILDREN, rm_children, toolbar);
	register_request_listener(EVENT_HIDE, hide, toolbar);
	register_request_listener(EVENT_SHOW, show, toolbar);

	register_request_listener(ACTION_CLICK, register_action_click, toolbar);

	evas_object_resize(win, 240, 60);
	evas_object_show(box);
	elm_box_pack_end(box, toolbar);
	evas_object_show(win);
	evas_object_show(toolbar);

	elm_run();
	request_shutdown();
	elm_shutdown();
	return 0;
}
Exemplo n.º 25
0
int
main(int argc, char **argv)
{
   Evas_Object *win;

   if (!elm_init(argc, argv)) return -1;

   win = elm_win_util_standard_add("Genlist", "Genlist Basic Tutorial");
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
   elm_win_autodel_set(win, EINA_TRUE);
   //win 400x400 px
   evas_object_resize(win, 400, 400);

   //GENLIST here
   Evas_Object *list;
   list = elm_genlist_add(win);

   Elm_Genlist_Item_Class *_itc = elm_genlist_item_class_new();
   _itc->item_style        = "default";
   _itc->func.text_get     = _genlist_text_get;
   _itc->func.content_get  = _genlist_content_get;
   _itc->func.state_get    = NULL;
   _itc->func.del          = NULL;

   Elm_Genlist_Item_Class *_itc2 = elm_genlist_item_class_new();
   _itc2->item_style        = "group_index";
   _itc2->func.text_get     = _genlist_text_get;
   _itc2->func.content_get  = _genlist_content_get;
   _itc2->func.state_get    = NULL;
   _itc2->func.del          = NULL;

   int i=0;
   for (i=0; i<20; i++)
     {
        elm_genlist_item_append(
                list,
                _itc,
                (void *)(uintptr_t) i,   // Item data
                NULL,                    // Parent item for trees, NULL if none
                ELM_GENLIST_ITEM_NONE,   // Item type; this is the common one
                _genlist_selected_cb,    // Callback on selection of the item
                _itc2                    // Data for that callback function
                );
     }

   evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, list);
   evas_object_show(list);

   evas_object_show(win);
   elm_run();
   elm_shutdown();
   return 0;
}
Exemplo n.º 26
0
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *bg, *obj, *photocam;
   char buf[PATH_MAX];

   elm_app_info_set(elm_main, "elementary", "images/insanely_huge_test_image.jpg");
   win = elm_win_add(NULL, "photocam", ELM_WIN_BASIC);
   elm_win_title_set(win, "Photocam");
   elm_win_autodel_set(win, EINA_TRUE);
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   bg = elm_bg_add(win);
   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, bg);
   evas_object_show(bg);

   photocam = elm_photocam_add(win);
   snprintf(buf, sizeof(buf), "%s/images/insanely_huge_test_image.jpg", elm_app_data_dir_get());
   elm_photocam_file_set(photocam, buf);
   elm_scroller_bounce_set(photocam, EINA_FALSE, EINA_TRUE);
   evas_object_smart_callback_add(photocam, "loaded,detail", _bring_in, NULL);
   evas_object_resize(photocam, 500, 400);
   evas_object_show(photocam);

   obj = elm_button_add(win);
   elm_object_text_set(obj, "Fit");
   evas_object_show(obj);
   evas_object_resize(obj, 50, 30);
   evas_object_move(obj, 10, 410);
   evas_object_smart_callback_add(obj, "clicked", _fit, photocam);

   obj = elm_button_add(win);
   elm_object_text_set(obj, "Unfit");
   evas_object_show(obj);
   evas_object_resize(obj, 70, 30);
   evas_object_move(obj, 70, 410);
   evas_object_smart_callback_add(obj, "clicked", _unfit, photocam);

   obj = elm_slider_add(win);
   elm_object_text_set(obj, "Zoom");
   evas_object_show(obj);
   evas_object_resize(obj, 300, 30);
   evas_object_move(obj, 150, 410);
   evas_object_smart_callback_add(obj, "changed", _zoom, photocam);

   evas_object_resize(win, 500, 440);
   evas_object_show(win);

   elm_run();
   elm_shutdown();

   return 0;
}
Exemplo n.º 27
0
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *bg, *prefs, *layout;
   Elm_Prefs_Data *prefs_data;

   win = elm_win_add(NULL, "Prefs", ELM_WIN_BASIC);
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
   elm_win_title_set(win, "Prefs Example 03");
   elm_win_autodel_set(win, EINA_TRUE);

   bg = elm_bg_add(win);
   elm_win_resize_object_add(win, bg);
   evas_object_size_hint_min_set(bg, WIDTH, HEIGHT);
   evas_object_size_hint_max_set(bg, WIDTH, HEIGHT);
   evas_object_show(bg);

   layout = elm_layout_add(win);
   elm_layout_file_set(layout, "prefs_example_03.edj", "prefs_edje");

   prefs = elm_prefs_add(win);
   evas_object_size_hint_weight_set(prefs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_resize(prefs, WIDTH, HEIGHT);
   evas_object_show(prefs);

   evas_object_smart_callback_add(prefs, "page,loaded", _page_loaded_cb,
                                  layout);
   evas_object_smart_callback_add(prefs, "item,changed", _item_changed_cb,
                                  layout);

   elm_prefs_autosave_set(prefs, EINA_TRUE);

   prefs_data =
     elm_prefs_data_new("./prefs_example_03.cfg", NULL, EET_FILE_MODE_READ_WRITE);

   elm_prefs_file_set(prefs, "prefs_example_03.epb", NULL);
   elm_prefs_data_set(prefs, prefs_data);

   elm_prefs_item_swallow(prefs, "main:swal", layout);

   _update_animation_time(prefs, layout);
   _update_animation(prefs, layout);

   evas_object_resize(win, WIDTH, HEIGHT);
   evas_object_show(win);

   elm_run();

   elm_prefs_data_unref(prefs_data);

   elm_shutdown();

   return 0;
}
Exemplo n.º 28
0
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *prefs, *notify, *label;
   Elm_Prefs_Data *prefs_data;

   win = elm_win_util_standard_add("prefs", "Prefs Example 02");
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
   elm_win_autodel_set(win, EINA_TRUE);

   prefs = elm_prefs_add(win);
   evas_object_size_hint_weight_set(prefs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, prefs);
   evas_object_show(prefs);

   elm_prefs_autosave_set(prefs, EINA_TRUE);

   prefs_data = elm_prefs_data_new("./prefs_example_02.cfg", NULL,
                                   EET_FILE_MODE_READ_WRITE);

   elm_prefs_file_set(prefs, "prefs_example_02.epb", NULL);
   elm_prefs_data_set(prefs, prefs_data);

   label = elm_label_add(win);
   elm_object_text_set(label, "Editable, Visible and Disable! Just Saying...");
   evas_object_size_hint_weight_set(label, 0.0, 0.0);
   evas_object_size_hint_align_set(label, 0.5, 0.5);

   notify = elm_notify_add(win);
   elm_notify_align_set(notify, 0.5, 1);
   elm_notify_timeout_set(notify, 2);
   elm_object_content_set(notify, label);
   evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_show(notify);

   evas_object_data_set(notify, "prefs", prefs);
   evas_object_data_set(notify, "prefs_data", prefs_data);

   evas_object_smart_callback_add(prefs, "action", _action_cb, notify);

   evas_object_resize(win, 320, 320);
   evas_object_show(win);

   ecore_timer_add(5.0, _elm_prefs_items_change, notify);

   elm_run();

   elm_prefs_data_unref(prefs_data);

   elm_shutdown();

   return 0;
}
Exemplo n.º 29
0
EAPI_MAIN int
elm_main(int argc, char **argv)
{
    Evas_Object *win, *prefs, *notify, *label;
    Elm_Prefs_Data *prefs_data;

    win = elm_win_util_standard_add("prefs", "Prefs Example 01");
    elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
    elm_win_autodel_set(win, EINA_TRUE);

    prefs = elm_prefs_add(win);
    evas_object_size_hint_weight_set(prefs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    elm_win_resize_object_add(win, prefs);
    evas_object_show(prefs);

    evas_object_smart_callback_add(prefs, "page,saved", _page_saved_cb, NULL);
    evas_object_smart_callback_add(prefs, "page,loaded", _page_loaded_cb, NULL);
    evas_object_smart_callback_add(prefs, "item,changed", _item_changed_cb, win);

    elm_prefs_autosave_set(prefs, EINA_TRUE);

    prefs_data = elm_prefs_data_new("./prefs_example_01.cfg", NULL,
                                    EET_FILE_MODE_READ_WRITE);

    elm_prefs_file_set(prefs, "prefs_example_01.epb", NULL);
    elm_prefs_data_set(prefs, prefs_data);

    label = elm_label_add(win);
    elm_object_text_set(label, "Setting Values Programmatically");
    evas_object_size_hint_align_set(label, 0.5, 0.5);

    notify = elm_notify_add(win);
    elm_notify_align_set(notify, 0.5, 1);
    elm_notify_timeout_set(notify, 2);
    elm_object_content_set(notify, label);
    evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_show(notify);

    evas_object_data_set(notify, "prefs_data", prefs_data);

    evas_object_resize(win, 320, 320);
    evas_object_show(win);

    ecore_timer_add(5.0, _elm_prefs_data_change, notify);

    elm_run();

    elm_prefs_data_unref(prefs_data);

    elm_shutdown();

    return 0;
}
Exemplo n.º 30
0
EAPI_MAIN int
elm_main (
        int argc,
        char **argv)
{
    Evas_Object *win, *bg, *box, *logout, *ulist, *login;

#if !GLIB_CHECK_VERSION (2, 36, 0)
    g_type_init ();
#endif

    win = elm_win_add(NULL, "tlmui", ELM_WIN_BASIC);
    elm_win_title_set(win, "Demo tlm-ui");
    elm_win_autodel_set(win, EINA_TRUE);
    elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
    evas_object_resize(win, 500, 400);
    evas_object_show(win);

    main_window = g_malloc0 (sizeof(MainWindow));
    main_window->win = win;
    main_window->use_nfc_tag = FALSE;
    main_window->user_label = NULL;

    //background
    bg = elm_bg_add(win);
    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    elm_win_resize_object_add(win, bg);
    evas_object_show(bg);

    box = elm_box_add (win);
    evas_object_size_hint_weight_set (box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_show (box);
    elm_win_resize_object_add (win, box);

    login = _add_login_box (win);
    elm_box_pack_end (box, login);

    ulist = _add_user_list (win);
    elm_box_pack_end (box, ulist);

    logout = _add_logout_box (win);
    elm_box_pack_end (box, logout);

    _set_loggedin_username ();

    // run the mainloop and process events and callbacks
    elm_run();
    elm_shutdown();

    g_free (main_window);

    return 0;
}