Evas_Object *slideshow_create()
{
    _win = elm_win_add(win, "Slide show", ELM_WIN_BASIC);
    elm_win_autodel_set(_win, 1);
    elm_win_fullscreen_set(_win, 1);

    eyelight_smart = eyelight_object_add(evas_object_evas_get(_win));
    eyelight_object_presentation_file_set(eyelight_smart, eyelight_object_presentation_file_get(pres));
    evas_object_show(eyelight_smart);

    elm_win_resize_object_add(_win, eyelight_smart);

    container= evas_object_rectangle_add(evas_object_evas_get(_win));
    evas_object_color_set(container,0,0,0,0);
    evas_object_event_callback_add(container,EVAS_CALLBACK_KEY_DOWN, _slide_cb, NULL);
    evas_object_event_callback_add(container,EVAS_CALLBACK_MOUSE_MOVE, _mouse_event_cb, NULL);
    evas_object_event_callback_add(container,EVAS_CALLBACK_MOUSE_IN, _mouse_event_cb, NULL);
    evas_object_repeat_events_set(container,1);
    evas_object_show(container);
    elm_win_resize_object_add(_win, container);


    evas_object_raise(container);


    evas_object_show(_win);
    return _win;
}
Beispiel #2
0
EAPI int elm_main(int argc, char **argv) {
	Evas_Object *win=NULL, *bg=NULL, *pattern=NULL, *edje=NULL, *object=NULL, *item=NULL;
	Ecore_X_Window xwin, rootxwin;
	char theme[PATH_MAX];

	setlocale(LC_ALL, "");
	bindtextdomain(PACKAGE, LOCALEDIR);
	textdomain(PACKAGE);

	win = elm_win_add(NULL, "e_pattern_lock", ELM_WIN_BASIC);
	elm_win_autodel_set(win, EINA_TRUE);
	elm_win_maximized_set(win, EINA_TRUE); // change to full screen and above everything for lockscreen effect
	evas_object_size_hint_min_set(win, 480, 480);
	evas_object_size_hint_max_set(win, 640, 640);
	elm_win_fullscreen_set(win, EINA_TRUE);
	elm_win_sticky_set(win, EINA_TRUE);
	elm_win_keyboard_mode_set(win, ELM_WIN_KEYBOARD_OFF);
	elm_win_layer_set(win, INT_MAX);

	xwin = elm_win_xwindow_get(win);
	rootxwin = ecore_x_window_root_get(xwin);
	ecore_x_pointer_grab(xwin);
	ecore_x_keyboard_grab(rootxwin);

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

	snprintf(theme, sizeof(theme), "%s/themes/default.edj", PKGDATADIR);
    elm_theme_extension_add(NULL, theme);
    elm_theme_overlay_add(NULL, theme);

	pattern = elm_layout_add(win);

		elm_layout_file_set(pattern, theme, "e_lock/table/default");
		evas_object_size_hint_weight_set(pattern, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
		evas_object_size_hint_align_set(pattern, EVAS_HINT_FILL, EVAS_HINT_FILL);
		elm_win_resize_object_add(win, pattern);

		edje = elm_layout_edje_get(pattern);

		set_event_cbs(0, 0, "top_left");    set_event_cbs(1, 0, "top");    set_event_cbs(2, 0, "top_right");
		set_event_cbs(0, 1, "left");        set_event_cbs(1, 1, "center"); set_event_cbs(2, 1, "right");
		set_event_cbs(0, 2, "bottom_left"); set_event_cbs(1, 2, "bottom"); set_event_cbs(2, 2, "bottom_right");

	evas_object_show(pattern);

	evas_object_show(win);

    elm_run();

    elm_shutdown();

	return(0);
}
int
idle_screen_view_init()
{
	Evas_Object *win;
	int ret;

	ret = ui_utils_view_init(VIEW_PTR(view), ELM_WIN_BASIC, D_("Idle_Screen"),
				NULL, NULL, NULL);
	if (ret) {
		g_critical("Failed to init idle screen");
		return ret;
	}

	ui_utils_view_delete_callback_set(VIEW_PTR(view), _delete_cb);
	ui_utils_view_layout_set(VIEW_PTR(view), IDLE_SCREEN_THEME,
				"phoneui/idle_screen/idle_screen");

	edje_object_signal_emit(ui_utils_view_layout_get(VIEW_PTR(view)),
				"clock_init", "");

	win = ui_utils_view_window_get(VIEW_PTR(view));

	_set_edje_size();

	elm_win_fullscreen_set(win, 1);
	elm_win_layer_set(win, 200);
	elm_win_keyboard_mode_set(win, ELM_WIN_KEYBOARD_OFF);
	evas_object_show(view.wallpaper);

	edje_object_signal_callback_add(ui_utils_view_layout_get(VIEW_PTR(view)), "unlockScreen",
					"slider", idle_screen_view_hide,
					NULL);

	phoneui_info_register_and_request_resource_status(_resource_status, NULL);
	phoneui_info_register_and_request_network_status(_network_status, NULL);
	phoneui_info_register_and_request_signal_strength(_signal_strength, NULL);
	phoneui_info_register_backlight_power(_backlight_power, NULL);
	phoneui_info_register_and_request_pdp_context_status(_pdp_context_status, NULL);
	phoneui_info_register_and_request_profile_changes(_profile_change, NULL);
	phoneui_info_register_and_request_capacity_changes(_capacity_change, NULL);
	phoneui_info_register_and_request_missed_calls(_missed_calls, NULL);
	phoneui_info_register_and_request_unread_messages(_unread_messages, NULL);
	phoneui_info_register_and_request_unfinished_tasks(_unfinished_tasks, NULL);

	return 0;
}
Beispiel #4
0
static Eina_Bool
_input_events_cb(void *data, enna_input event)
{
    Smart_Data *sd = data;

    if (!sd) return ENNA_EVENT_CONTINUE;

    if (event == ENNA_INPUT_FULLSCREEN)
    {
        enna->run_fullscreen = ~enna->run_fullscreen;
        elm_win_fullscreen_set(enna->win, enna->run_fullscreen);
        return ENNA_EVENT_BLOCK;
    }

    /* check for volume control bindings */
    if (event == ENNA_INPUT_MUTE)
    {
      enna_mediaplayer_mute();
      enna_volume_notification_show(sd->o_volume);
      return ENNA_EVENT_BLOCK;
    }
    else if (event == ENNA_INPUT_VOLPLUS)
    {
      enna_mediaplayer_default_increase_volume();
      enna_volume_notification_show(sd->o_volume);
      return ENNA_EVENT_BLOCK;
    }
    else if (event == ENNA_INPUT_VOLMINUS)
    {
      enna_mediaplayer_default_decrease_volume();
      enna_volume_notification_show(sd->o_volume);
      return ENNA_EVENT_BLOCK;
    }

    if (sd->visible)
    {
        switch (event)
        {
            case ENNA_INPUT_RIGHT:
            case ENNA_INPUT_LEFT:
            case ENNA_INPUT_UP:
            case ENNA_INPUT_DOWN:
            case ENNA_INPUT_OK:
                enna_box_input_feed(sd->o_menu, event);
                return ENNA_EVENT_BLOCK;
                break;
            case ENNA_INPUT_BACK:
                return ENNA_EVENT_BLOCK;
            default:
                break;
        }
    }
    else if (event == ENNA_INPUT_HOME)
    {
        enna_content_hide();
        enna_mainmenu_show(sd->o_menu);
        return ENNA_EVENT_BLOCK;
    }
    if (!sd->visible)
    {
        Enna_File *f = enna_mainmenu_selected_activity_get(sd->o_menu);
        enna_activity_event(enna_activity_get(f->name), event);
    }

    return ENNA_EVENT_CONTINUE;
}
Beispiel #5
0
ApplicationMain::ApplicationMain(int argc, char **argv)
{
    cInfo() <<  "Calaos Home, starting...";

    if (system("killall -9 eskiss 2> /dev/null") == -1)
        cCritical() <<  "Error forking !";

    //init random generator
    srand(time(NULL));

    //Init SSL and CURL
    SSL_load_error_strings();
    SSL_library_init();
    curl_global_init(CURL_GLOBAL_ALL);

    char *themefile = argvOptionParam(argv, argv + argc, "--theme");
    if (themefile)
    {
        ApplicationMain::theme = themefile;
        cInfo() <<  "Using specified theme file: " << ApplicationMain::getTheme();
    }
    else
    {
        ApplicationMain::theme = Prefix::Instance().dataDirectoryGet() + "/default.edj";
        if (ecore_file_exists(ApplicationMain::theme.c_str()))
            cInfo() << "Using theme file " << theme;
        else
            cError() << theme << " Not found!";
    }

    //Init efl core
    if (!eina_init())
        throw (runtime_error("Unable to init Eina"));
    if (!ecore_init())
        throw (runtime_error("Unable to init Ecore"));
    if (!ecore_con_init())
        throw (runtime_error("Unable to init Ecore-Con"));
    if (!ecore_con_url_init())
        throw (runtime_error("Unable to init Ecore-Con-Url"));
    if (!evas_init())
        throw (runtime_error("Unable to init Evas"));
    if (!ecore_evas_init())
        throw (runtime_error("Unable to init Ecore-Evas"));
    if (!edje_init())
        throw (runtime_error("Unable to init Edje"));

    edje_frametime_set(1.0 / 60.0);
    edje_scale_set(1.0);

    if (!elm_init(argc, argv))
        throw (runtime_error("Unable to init Elementary"));

    //Load Calaos specific ELM extensions
    elm_theme_extension_add(NULL, ApplicationMain::getTheme());

    //Create the main window
    window = elm_win_add(NULL, "calaos-home", ELM_WIN_BASIC);
    elm_win_title_set(window, "Calaos Home");
    elm_win_borderless_set(window, true);

    bool bFullscreen = argvOptionCheck(argv, argv + argc, "--fullscreen");
    elm_win_fullscreen_set(window, bFullscreen);

    //Automatically quit main loop when the window is closed
    elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
    elm_win_autodel_set(window, true);

    if (argvOptionCheck(argv, argv + argc, "--set-elm-config"))
    {
        //force setting the correct elementary options for touchscreen
        elm_config_finger_size_set(10);
        elm_config_scroll_bounce_enabled_set(true);
        elm_config_scroll_thumbscroll_enabled_set(true);
        elm_config_scroll_thumbscroll_threshold_set(24);
        elm_config_scroll_thumbscroll_momentum_threshold_set(100.0);
        elm_config_scroll_bounce_friction_set(0.5);
        elm_config_scroll_page_scroll_friction_set(0.5);
        elm_config_scroll_bring_in_scroll_friction_set(0.5);
        elm_config_scroll_zoom_friction_set(0.5);
        elm_config_scroll_thumbscroll_friction_set(1.0);
        elm_config_scroll_thumbscroll_border_friction_set(0.5);
        elm_config_scroll_thumbscroll_sensitivity_friction_set(0.25);
    }

    evas_object_event_callback_add(window, EVAS_CALLBACK_RESIZE, _window_resize_cb, this);
    evas = evas_object_evas_get(window);

    Evas_Object *bg = elm_bg_add(window);
    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    elm_win_resize_object_add(window, bg);
    evas_object_show(bg);
    evas_object_size_hint_min_set(bg, 200, 200);
    elm_bg_color_set(bg, 0, 0, 0);

    layout = elm_layout_add(window);
    if (!elm_layout_file_set(layout, ApplicationMain::getTheme(), EDJE_GROUP_MAIN_LAYOUT))
    {
        string e = "Unable to find group \"";
        e += EDJE_GROUP_MAIN_LAYOUT;
        e += "\" in theme \"";
        e += ApplicationMain::getTheme();
        e += "\"";
        throw (runtime_error(e));
    }

    //create the screen suspend object and put it on the canvas
    ScreenSuspendView *screen_suspend = new ScreenSuspendView(evas, window);
    screen_suspend->Show();
    screen_suspend->setAutoDelete(true);

    evas_object_size_hint_weight_set(layout, 1.0, 1.0);
    evas_object_show(layout);

    evas_object_resize(window, 1024, 768);
    evas_object_show(window);
    ecore_evas_focus_set(ecore_evas_ecore_evas_get(evas_object_evas_get(window)), true);

    Resize();

    try
    {
        controller = new ApplicationController(evas, layout);
    }
    catch(exception const& e)
    {
        cCritical() <<  "Can't create ApplicationController";
        throw;
    }
}