Eina_Bool panel_light_coord_step_set(Evas_Object *navigation, int step) { Panel_Struct *pobject = NULL; pobject = evas_object_data_get(navigation, pb); elm_spinner_step_set(pobject->lspX, step); elm_spinner_step_set(pobject->lspY, step); elm_spinner_step_set(pobject->lspZ, step); return EINA_TRUE; }
Eina_Bool panel_camera_angle_step_set(Evas_Object *navigation, int step) { Panel_Struct *pobject = NULL; pobject = evas_object_data_get(navigation, pb); elm_spinner_step_set(pobject->cspangle, step); return EINA_TRUE; }
/* externally accessible functions */ Evas_Object * enna_photo_slideshow_add(Evas_Object *parent) { Smart_Data *sd; Evas_Object *bx, *bt, *ic; Evas_Coord w, h; sd = calloc(1, sizeof(Smart_Data)); sd->delay = enna_config->slideshow_delay; sd->layout = elm_layout_add(parent); elm_layout_file_set(sd->layout, enna_config_theme_get(), "enna/slideshow"); evas_object_size_hint_weight_set(sd->layout, 1.0, 1.0); evas_object_show(sd->layout); sd->slideshow = elm_slideshow_add(sd->layout); elm_slideshow_transition_set(sd->slideshow, "horizontal"); elm_slideshow_loop_set(sd->slideshow, 1); // sd->controls = elm_notify_add(sd->layout); // elm_notify_orient_set(sd->controls, ELM_NOTIFY_ORIENT_BOTTOM); evas_object_geometry_get(enna->layout, NULL, NULL, &w, &h); evas_object_move(sd->controls, 0, 0); evas_object_resize(sd->controls, w, h); //elm_object_style_set(sd->controls, "enna_bottom"); /* Fixme : add a config value */ // elm_notify_timeout_set(sd->controls, 10); bx = elm_box_add(sd->layout); elm_box_horizontal_set(bx, 1); // elm_notify_content_set(sd->controls, bx); evas_object_show(bx); evas_object_event_callback_add(bx, EVAS_CALLBACK_MOUSE_IN, _mouse_in, sd); evas_object_event_callback_add(bx, EVAS_CALLBACK_MOUSE_OUT, _mouse_out, sd); ELM_ADD ("icon/mp_prev", _button_clicked_prev_cb); ELM_ADD ("icon/mp_pause", _button_clicked_play_cb); sd->btplay = bt; ELM_ADD ("icon/mp_next", _button_clicked_next_cb); ELM_ADD ("icon/mp_stop", _button_clicked_stop_cb); sd->spin = elm_spinner_add(bx); elm_spinner_label_format_set(sd->spin, "%2.f secs."); evas_object_smart_callback_add(sd->spin, "changed", _spin, sd); elm_spinner_step_set(sd->spin, 1); elm_spinner_min_max_set(sd->spin, 1, 100); elm_spinner_value_set(sd->spin, sd->delay); elm_box_pack_end(bx, sd->spin); evas_object_show(sd->spin); #ifdef FEATURE_ROTATION ELM_ADD ("icon/rotate_ccw", _button_clicked_rotate_ccw_cb); ELM_ADD ("icon/rotate_cw", _button_clicked_rotate_cw_cb); #endif /* FEATURE_ROTATION */ evas_object_show(sd->layout); evas_object_show(sd->slideshow); elm_layout_content_set(sd->layout, "enna.content.swallow", sd->slideshow); evas_object_data_set(sd->layout, "sd", sd); sd->state = 4; /* Catch mouse wheel event */ evas_object_event_callback_add(sd->layout, EVAS_CALLBACK_MOUSE_WHEEL, _mouse_wheel_cb, sd); /* connect to the input signal */ sd->listener = enna_input_listener_add("slideshow", _input_events_cb, sd->layout); enna_input_listener_demote(sd->listener); evas_object_event_callback_add(sd->layout, EVAS_CALLBACK_MOUSE_UP, _controls_show, sd); evas_object_event_callback_add(sd->layout, EVAS_CALLBACK_MOUSE_MOVE, _controls_show, sd); evas_object_event_callback_add(sd->layout, EVAS_CALLBACK_DEL, _sd_del, sd); return sd->layout; }
Evas_Object * init_panel_camera_light(Evas_Object *win, Eo *camera_node, Eo *light_node, double posX, double posY) { Evas_Object *nnavig = NULL, *bx_navigall = NULL; Evas_Object *bx_navigcamup = NULL, *bx_navigcamlow = NULL, *bx_navigligthup = NULL, *bx_navigligthlow = NULL; Evas_Object *spX = NULL, *spY = NULL, *spZ = NULL; Evas_Object *spangle = NULL, *spaX = NULL, *spaY = NULL, *spaZ = NULL; Evas_Object *splX = NULL, *splY = NULL, *splZ = NULL; Evas_Object *splangle = NULL, *splaX = NULL, *splaY = NULL, *splaZ = NULL; Evas_Object *separator = NULL; Axis_Key *camera_xyz = NULL, *light_xyz = NULL; Panel_Struct *pobject = NULL; Evas_Real px = 0, py = 0, pz = 0; if (ELM_WIN_UNKNOWN == elm_win_type_get(win)) { fprintf(stdout, "Not appropriate parent object - at %s line %d\n", __FILE__, __LINE__); return NULL; } if (!_alloc_memory(&camera_xyz, &pobject, &light_xyz)) return NULL; /*Navigation panel layout*/ bx_navigall = elm_box_add(win); elm_box_homogeneous_set(bx_navigall, EINA_TRUE); evas_object_show(bx_navigall); bx_navigcamup = elm_box_add(win); elm_box_horizontal_set(bx_navigcamup, EINA_TRUE); elm_box_homogeneous_set(bx_navigcamup, EINA_TRUE); elm_box_pack_end(bx_navigall, bx_navigcamup); evas_object_show(bx_navigcamup); bx_navigcamlow = elm_box_add(win); elm_box_horizontal_set(bx_navigcamlow, EINA_TRUE); elm_box_homogeneous_set(bx_navigcamlow, EINA_TRUE); elm_box_pack_end(bx_navigall, bx_navigcamlow); evas_object_show(bx_navigcamlow); separator = elm_separator_add(win); elm_separator_horizontal_set(separator, EINA_TRUE); elm_box_pack_end(bx_navigall, separator); evas_object_show(separator); bx_navigligthup = elm_box_add(win); elm_box_horizontal_set(bx_navigligthup, EINA_TRUE); elm_box_homogeneous_set(bx_navigligthup, EINA_TRUE); elm_box_pack_end(bx_navigall, bx_navigligthup); evas_object_show(bx_navigligthup); bx_navigligthlow = elm_box_add(win); elm_box_horizontal_set(bx_navigligthlow, EINA_TRUE); elm_box_homogeneous_set(bx_navigligthlow, EINA_TRUE); elm_box_pack_end(bx_navigall, bx_navigligthlow); evas_object_show(bx_navigligthlow); /*Set UI panel for changing camera and light*/ /*Init sp camera by default*/ spX = elm_spinner_add(win); elm_spinner_editable_set(spX, EINA_TRUE); elm_spinner_min_max_set(spX, -COORDRANGE, COORDRANGE); elm_spinner_label_format_set(spX, "camera X: %1.0f"); elm_spinner_step_set(spX, 1.0); pobject->cspX = spX; elm_box_pack_end(bx_navigcamup, spX); evas_object_show(spX); evas_object_smart_callback_add(spX, "changed", _camera_light_changeX_cb, camera_node); spY = elm_spinner_add(win); elm_spinner_editable_set(spY, EINA_TRUE); elm_spinner_min_max_set(spY, -COORDRANGE, COORDRANGE); elm_spinner_label_format_set(spY, "camera Y: %1.0f"); elm_spinner_step_set(spY, 1.0); pobject->cspY = spY; elm_box_pack_end(bx_navigcamup, spY); evas_object_show(spY); evas_object_smart_callback_add(spY, "changed", _camera_light_changeY_cb, camera_node); spZ = elm_spinner_add(win); elm_spinner_editable_set(spZ, EINA_TRUE); elm_spinner_min_max_set(spZ, -COORDRANGE, COORDRANGE); elm_spinner_label_format_set(spZ, "camera Z: %1.0f"); elm_spinner_step_set(spY, 1.0); pobject->cspZ = spZ; elm_box_pack_end(bx_navigcamup, spZ); evas_object_show(spZ); evas_object_smart_callback_add(spZ, "changed", _camera_light_changeZ_cb, camera_node); eo_do(camera_node, evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_PARENT, &px, &py, &pz)); elm_spinner_value_set(spX, px); elm_spinner_value_set(spY, py); elm_spinner_value_set(spZ, pz); spangle = elm_spinner_add(win); elm_spinner_editable_set(spangle, EINA_TRUE); elm_spinner_min_max_set(spangle, 0.0, ANGLERANGE); elm_spinner_label_format_set(spangle, "angle: %1.0f"); elm_spinner_step_set(spangle, 1.0); pobject->cspangle = spangle; evas_object_data_set(spangle, axiskeys, camera_xyz); elm_box_pack_end(bx_navigcamlow, spangle); elm_spinner_value_set(spangle, 0.0); evas_object_show(spangle); evas_object_smart_callback_add(spangle, "changed", _camera_light_angle_change_cb, camera_node); spaX = elm_spinner_add(win); elm_spinner_min_max_set(spaX, 0.0, 1.0); elm_spinner_label_format_set(spaX, "axisX: %1.0f"); elm_spinner_step_set(spaX, 1.0); elm_box_pack_end(bx_navigcamlow, spaX); evas_object_show(spaX); evas_object_smart_callback_add(spaX, "changed", _camera_light_axisX_change_cb, spangle); spaY = elm_spinner_add(win); elm_spinner_min_max_set(spaY, 0.0, 1.0); elm_spinner_label_format_set(spaY, "axisY: %1.0f"); elm_spinner_step_set(spaY, 1.0); elm_box_pack_end(bx_navigcamlow, spaY); evas_object_show(spaY); evas_object_smart_callback_add(spaY, "changed", _camera_light_axisY_change_cb, spangle); spaZ = elm_spinner_add(win); elm_spinner_min_max_set(spaZ, 0.0, 1.0); elm_spinner_label_format_set(spaZ, "axisZ: %1.0f"); elm_spinner_step_set(spaZ, 1.0); elm_box_pack_end(bx_navigcamlow, spaZ); evas_object_show(spaZ); evas_object_smart_callback_add(spaZ, "changed", _camera_light_axisZ_change_cb, spangle); /*Init spl light by default*/ splX = elm_spinner_add(win); elm_spinner_editable_set(splX, EINA_TRUE); elm_spinner_min_max_set(splX, -COORDRANGE, COORDRANGE); elm_spinner_label_format_set(splX, "light X: %1.0f"); elm_spinner_step_set(splX, 1.0); pobject->lspX = splX; elm_box_pack_end(bx_navigligthup, splX); evas_object_show(splX); evas_object_smart_callback_add(splX, "changed", _camera_light_changeX_cb, light_node); splY = elm_spinner_add(win); elm_spinner_editable_set(splY, EINA_TRUE); elm_spinner_min_max_set(splY, -COORDRANGE, COORDRANGE); elm_spinner_label_format_set(splY, "light Y: %1.0f"); elm_spinner_step_set(splY, 1.0); pobject->lspY = splY; elm_box_pack_end(bx_navigligthup, splY); evas_object_show(splY); evas_object_smart_callback_add(splY, "changed", _camera_light_changeY_cb, light_node); splZ = elm_spinner_add(win); elm_spinner_editable_set(splZ, EINA_TRUE); elm_spinner_min_max_set(splZ, -COORDRANGE, COORDRANGE); elm_spinner_label_format_set(splZ, "light Z: %1.0f"); elm_spinner_step_set(splY, 1.0); pobject->lspZ = splZ; elm_box_pack_end(bx_navigligthup, splZ); evas_object_show(splZ); evas_object_smart_callback_add(splZ, "changed", _camera_light_changeZ_cb, light_node); eo_do(light_node, evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_PARENT, &px, &py, &pz)); elm_spinner_value_set(splX, px); elm_spinner_value_set(splY, py); elm_spinner_value_set(splZ, pz); splangle = elm_spinner_add(win); elm_spinner_editable_set(splangle, EINA_TRUE); elm_spinner_min_max_set(splangle, 0.0, ANGLERANGE); elm_spinner_label_format_set(splangle, "angle: %1.0f"); elm_spinner_step_set(splangle, 1.0); pobject->lspangle = splangle; evas_object_data_set(splangle, axiskeys, light_xyz); elm_box_pack_end(bx_navigligthlow, splangle); elm_spinner_value_set(splangle, 0.0); evas_object_show(splangle); evas_object_smart_callback_add(splangle, "changed", _camera_light_angle_change_cb, light_node); splaX = elm_spinner_add(win); elm_spinner_min_max_set(splaX, 0.0, 1.0); elm_spinner_label_format_set(splaX, "axisX: %1.0f"); elm_spinner_step_set(splaX, 1.0); elm_box_pack_end(bx_navigligthlow, splaX); evas_object_show(splaX); evas_object_smart_callback_add(splaX, "changed", _camera_light_axisX_change_cb, splangle); splaY = elm_spinner_add(win); elm_spinner_min_max_set(splaY, 0.0, 1.0); elm_spinner_label_format_set(splaY, "axisY: %1.0f"); elm_spinner_step_set(splaY, 1.0); elm_box_pack_end(bx_navigligthlow, splaY); evas_object_show(splaY); evas_object_smart_callback_add(splaY, "changed", _camera_light_axisY_change_cb, splangle); splaZ = elm_spinner_add(win); elm_spinner_min_max_set(splaZ, 0.0, 1.0); elm_spinner_label_format_set(splaZ, "axisZ: %1.0f"); elm_spinner_step_set(splaZ, 1.0); elm_box_pack_end(bx_navigligthlow, splaZ); evas_object_show(splaZ); evas_object_smart_callback_add(spaZ, "changed", _camera_light_axisZ_change_cb, splangle); nnavig = elm_notify_add(win); elm_object_content_set(nnavig, bx_navigall); elm_notify_align_set(nnavig, posX, posY); evas_object_data_set(nnavig, pb, pobject); return nnavig; }
void ActivityScheduleScenarioView::showTimeSelection(void *data) { int *user_data = reinterpret_cast<int *>(data); if (editState == EDIT_START_OFFSET && user_data) { editStatesHist.push(editState); if (*user_data == 0) { edit_range.start_offset = 0; edit_range.shour = "0"; edit_range.smin = "0"; edit_range.ssec = "0"; if (cycle) { editState = EDIT_END_TYPE; createTimeSelectTypeList(NULL, NULL, "", ""); return; } else { editState = EDIT_WEEK; showWeekSelection(NULL, NULL, "", ""); return; } } else if (*user_data == 1) { edit_range.start_offset = 1; editState = EDIT_START_TIME_OFFSET; } else if (*user_data == 2) { edit_range.start_offset = -1; editState = EDIT_START_TIME_OFFSET; } } if (editState == EDIT_END_OFFSET && user_data) { editStatesHist.push(editState); if (*user_data == 0) { edit_range.end_offset = 0; edit_range.ehour = "0"; edit_range.emin = "0"; edit_range.esec = "0"; editState = EDIT_WEEK; showWeekSelection(NULL, NULL, "", ""); return; } else if (*user_data == 1) { edit_range.end_offset = 1; editState = EDIT_END_TIME_OFFSET; } else if (*user_data == 2) { edit_range.end_offset = -1; editState = EDIT_END_TIME_OFFSET; } } EdjeObject *page = new EdjeObject(ApplicationMain::getTheme(), evas); page->LoadEdje("calaos/popup/page/time_schedule"); page->setAutoDelete(true); page->addCallback("button.back", "pressed", sigc::mem_fun(*this, &ActivityScheduleScenarioView::buttonBackClick)); if (cycle && editState < EDIT_END_TYPE) page->addCallback("button.valid", "pressed", sigc::mem_fun(*this, &ActivityScheduleScenarioView::createTimeSelectTypeList)); else page->addCallback("button.valid", "pressed", sigc::mem_fun(*this, &ActivityScheduleScenarioView::showWeekSelection)); string t; if (editState == EDIT_START_TIME) t = _("<b>Choose a scheduling</b><br><light_blue><small>Start time of scenario</small></light_blue>"); else if (editState == EDIT_END_TIME) t = _("<b>Choose a scheduling</b><br><light_blue><small>End time of scenario</small></light_blue>"); else if (editState == EDIT_START_TIME_OFFSET) t = _("<b>Choose a time shift</b><br><light_blue><small>Shifting start of scenario</small></light_blue>"); else if (editState == EDIT_END_TIME_OFFSET) t = _("<b>Choose a time shift</b><br><light_blue><small>Shifteng end of scenario</small></light_blue>"); page->setPartText("text", t); int hour_value, min_value, sec_value; Evas_Object **spin_hour = NULL, **spin_min = NULL, **spin_sec = NULL; if (editState == EDIT_START_TIME || editState == EDIT_START_TIME_OFFSET) { from_string(edit_range.shour, hour_value); from_string(edit_range.smin, min_value); from_string(edit_range.ssec, sec_value); spin_hour = &spin_start_hours; spin_min = &spin_start_min; spin_sec = &spin_start_sec; } else if (editState == EDIT_END_TIME || editState == EDIT_END_TIME_OFFSET) { from_string(edit_range.ehour, hour_value); from_string(edit_range.emin, min_value); from_string(edit_range.esec, sec_value); spin_hour = &spin_end_hours; spin_min = &spin_end_min; spin_sec = &spin_end_sec; } *spin_hour = elm_spinner_add(parent); elm_object_style_set(*spin_hour, "calaos/time/vertical"); elm_spinner_label_format_set(*spin_hour, _("%.0f<br><subtitle>Hours</subtitle>")); elm_spinner_min_max_set(*spin_hour, 0, 99); elm_spinner_step_set(*spin_hour, 1); elm_spinner_interval_set(*spin_hour, 0.15); elm_spinner_value_set(*spin_hour, hour_value); evas_object_show(*spin_hour); page->Swallow(*spin_hour, "spinner.hours", true); *spin_min = elm_spinner_add(parent); elm_object_style_set(*spin_min, "calaos/time/vertical"); elm_spinner_label_format_set(*spin_min, _("%.0f<br><subtitle>Min.</subtitle>")); elm_spinner_min_max_set(*spin_min, 0, 59); elm_spinner_step_set(*spin_min, 1); elm_spinner_interval_set(*spin_min, 0.15); elm_spinner_value_set(*spin_min, min_value); evas_object_show(*spin_min); page->Swallow(*spin_min, "spinner.minutes", true); *spin_sec = elm_spinner_add(parent); elm_object_style_set(*spin_sec, "calaos/time/vertical"); elm_spinner_label_format_set(*spin_sec, _("%.0f<br><subtitle>Sec.</subtitle>")); elm_spinner_min_max_set(*spin_sec, 0, 59); elm_spinner_step_set(*spin_sec, 1); elm_spinner_interval_set(*spin_sec, 0.15); elm_spinner_value_set(*spin_sec, sec_value); evas_object_show(*spin_sec); page->Swallow(*spin_sec, "spinner.seconds", true); evas_object_size_hint_min_set(page->getEvasObject(), 300, 300); page->Show(); elm_naviframe_item_push(pager_popup, NULL, NULL, NULL, page->getEvasObject(), "calaos"); }