summaryrefslogtreecommitdiff
path: root/src/bin/main.c
blob: 5c37f2a819526b08cf4d85a11a625fddd4d2c461 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#include "launcher.h"

static void
launcher_quit(void *data EINA_UNUSED,
              Evas_Object *obj EINA_UNUSED,
              void *event_info EINA_UNUSED)
{
   elm_exit();
}


Eina_Bool
launcher_game_add(void *data,
                  int type EINA_UNUSED,
                  void *event)
{
   Launcher *launcher;
   Vog_Game *va;

   launcher = data;
   va = event;

   DBG("launcher[%p] va[%p][%s]", launcher, va, va->name);

   return EINA_TRUE;
}

EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Launcher *launcher;

   eina_init();
   ecore_init();
   vog_init();

   l_log_dom_global = eina_log_domain_register("vog", EINA_COLOR_YELLOW);

   launcher = calloc(1, sizeof(Launcher));
   launcher->vog = vog_new();
   launcher->ev.vega = ecore_event_handler_add(VOG_EVENT_GAME_ADD,
                                               launcher_game_add,
                                               launcher);

   launcher->gui.win = elm_win_util_standard_add("Vog", "Vog");
   evas_object_smart_callback_add(launcher->gui.win, "delete,request",
                                  launcher_quit, launcher);

   launcher->gui.bg = elm_bg_add(launcher->gui.win);
   evas_object_size_hint_weight_set(launcher->gui.bg,
                                    EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(launcher->gui.win, launcher->gui.bg);
   evas_object_show(launcher->gui.bg);

   launcher->gui.sc = elm_scroller_add(launcher->gui.win);
   elm_scroller_bounce_set(launcher->gui.sc, EINA_TRUE, EINA_FALSE);
   elm_scroller_policy_set(launcher->gui.sc,
                           ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
   evas_object_size_hint_weight_set(launcher->gui.sc,
                                    EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_fill_set(launcher->gui.sc,
                                  EVAS_HINT_FILL, EVAS_HINT_FILL);

   launcher->gui.table = elm_table_add(launcher->gui.win);
   elm_win_resize_object_add(launcher->gui.win, launcher->gui.table);
   evas_object_show(launcher->gui.table);
   elm_table_padding_set(launcher->gui.table, 5, 5);
   elm_table_homogeneous_set(launcher->gui.table, EINA_TRUE);

   evas_object_show(launcher->gui.win);
   elm_run();
   elm_shutdown();
   vog_shutdown();
   ecore_shutdown();
   eina_shutdown();
   return 0;
}
ELM_MAIN()