2014-01-20 03:34:48 -08:00
|
|
|
#include <Elementary.h>
|
|
|
|
#include "main.h"
|
2014-01-27 20:49:28 -08:00
|
|
|
#include "win.h"
|
|
|
|
#include "winvid.h"
|
2014-02-15 21:33:14 -08:00
|
|
|
#include "winlist.h"
|
2014-03-08 23:09:05 -08:00
|
|
|
#include "config.h"
|
2014-01-20 03:34:48 -08:00
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_cb_show_timeout(void *data)
|
|
|
|
{
|
|
|
|
Evas_Object *win = data;
|
|
|
|
Inf *inf = evas_object_data_get(win, "inf");
|
|
|
|
|
|
|
|
inf->show_timeout = NULL;
|
|
|
|
evas_object_show(win);
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2014-02-15 21:33:14 -08:00
|
|
|
static void
|
|
|
|
_cb_resize(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
win_list_size_update(obj);
|
|
|
|
}
|
|
|
|
|
2014-01-20 03:34:48 -08:00
|
|
|
EAPI_MAIN int
|
|
|
|
elm_main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
Evas_Object *win;
|
|
|
|
char buf[4096];
|
|
|
|
const char *f;
|
|
|
|
Eina_List *list = NULL;
|
|
|
|
int i;
|
|
|
|
Inf *inf;
|
2014-03-08 23:09:05 -08:00
|
|
|
Config *config;
|
2014-08-04 01:15:30 -07:00
|
|
|
|
|
|
|
elm_need_efreet();
|
2014-03-08 23:09:05 -08:00
|
|
|
config_init();
|
|
|
|
config = config_get();
|
2014-01-20 03:34:48 -08:00
|
|
|
for (i = 1; i < argc; i++)
|
2014-03-08 23:09:05 -08:00
|
|
|
{
|
|
|
|
if ((!strcmp(argv[i], "-h")) ||
|
|
|
|
(!strcmp(argv[i], "-help")) ||
|
|
|
|
(!strcmp(argv[i], "--help")))
|
|
|
|
{
|
|
|
|
printf("Usage: rage [OPTIONS] [file1] [file2] [...]\n"
|
|
|
|
" Where OPTIONS can ben"
|
|
|
|
" -e ENGINE\n"
|
|
|
|
" ENGINE is one of gstreamer1, xine or vlc\n"
|
2014-07-12 07:08:49 -07:00
|
|
|
" The default is gstreamer1\n"
|
2014-03-08 23:09:05 -08:00
|
|
|
" -h | -help | --help\n"
|
|
|
|
" This help\n");
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
else if (!strcmp(argv[i], "-e"))
|
|
|
|
{
|
|
|
|
if (i < (argc - 1))
|
|
|
|
{
|
|
|
|
i++;
|
|
|
|
eina_stringshare_del(config->emotion_engine);
|
|
|
|
config->emotion_engine = eina_stringshare_add(argv[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
list = eina_list_append(list, eina_stringshare_add(argv[i]));
|
|
|
|
}
|
2014-08-04 01:15:30 -07:00
|
|
|
|
2014-01-20 03:34:48 -08:00
|
|
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
|
|
|
elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR);
|
|
|
|
elm_app_compile_data_dir_set(PACKAGE_DATA_DIR);
|
|
|
|
elm_app_info_set(elm_main, "rage", "themes/default.edj");
|
2014-03-08 21:30:51 -08:00
|
|
|
|
|
|
|
#if (ELM_VERSION_MAJOR > 1) || (ELM_VERSION_MINOR >= 10)
|
|
|
|
elm_config_accel_preference_set("accel");
|
|
|
|
#endif
|
|
|
|
|
2014-01-20 03:34:48 -08:00
|
|
|
snprintf(buf, sizeof(buf), "%s/themes/default.edj", elm_app_data_dir_get());
|
|
|
|
elm_theme_overlay_add(NULL, buf);
|
|
|
|
|
|
|
|
win = win_add();
|
2014-08-05 22:56:38 -07:00
|
|
|
if (!win)
|
|
|
|
{
|
|
|
|
printf("ERROR - cannto create window!\n");
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
2014-02-15 21:33:14 -08:00
|
|
|
evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE, _cb_resize, NULL);
|
2014-01-20 03:34:48 -08:00
|
|
|
evas_object_resize(win, 320, 200);
|
2014-08-04 01:15:30 -07:00
|
|
|
|
2014-01-20 03:34:48 -08:00
|
|
|
win_video_init(win);
|
|
|
|
win_video_file_list_set(win, list);
|
|
|
|
EINA_LIST_FREE(list, f) eina_stringshare_del(f);
|
2014-08-04 01:15:30 -07:00
|
|
|
|
2014-01-20 03:34:48 -08:00
|
|
|
inf = evas_object_data_get(win, "inf");
|
2014-02-22 06:56:50 -08:00
|
|
|
if (argc <= 1)
|
|
|
|
{
|
|
|
|
elm_layout_signal_emit(inf->lay, "about,show", "rage");
|
|
|
|
elm_layout_signal_emit(inf->lay, "state,novideo", "rage");
|
|
|
|
evas_object_show(win);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
inf->show_timeout = ecore_timer_add(10.0, _cb_show_timeout, win);
|
|
|
|
}
|
2014-08-04 01:15:30 -07:00
|
|
|
|
2014-01-20 03:34:48 -08:00
|
|
|
elm_run();
|
|
|
|
|
2014-08-05 22:56:38 -07:00
|
|
|
end:
|
2014-03-08 23:09:05 -08:00
|
|
|
config_shutdown();
|
2014-01-20 03:34:48 -08:00
|
|
|
elm_shutdown();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
ELM_MAIN()
|