fixed plugin image size problem
[framework/uifw/elementary.git] / doc / widgets / widget_preview_map.c
1 #ifdef HAVE_CONFIG_H
2 # include "elementary_config.h"
3 #else
4 # define __UNUSED__
5 #endif
6
7 #include <Elementary.h>
8
9 /* FIXME: it shouldn't be required. For unknown reason map won't call
10  * pan_calculate until shot delay time, but then it will take a screenshot
11  * when the map isn't loaded yet (actually it won't be downloaded, because
12  * after the SS it will kill the preview). */
13 static Eina_Bool
14 _nasty_hack(void *data)
15 {
16    Evas_Object *o = data;
17    Evas *e = evas_object_evas_get(o);
18    evas_smart_objects_calculate(e);
19    return ECORE_CALLBACK_CANCEL;
20 }
21
22 EAPI_MAIN int
23 elm_main(int argc __UNUSED__, char **argv)
24 {
25    Evas_Object *win, *bg;
26    Evas_Coord w, h;
27    Evas_Object *o;
28
29    w = atoi(argv[1]);
30    h = atoi(argv[2]);
31
32    win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
33    bg = elm_bg_add(win);
34    elm_win_resize_object_add(win, bg);
35    evas_object_show(bg);
36
37    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
38
39    o = elm_map_add(win);
40    evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
41    elm_win_resize_object_add(win, o);
42    evas_object_show(o);
43
44    ecore_timer_add(0.5, _nasty_hack, win);
45
46 #include "widget_preview_tmpl_foot.c"