/* Increases the spinner's value by "increment" */ static void _etk_spinner_spin(Etk_Spinner *spinner, double increment) { Etk_Range *range; double value; if (!(range = ETK_RANGE(spinner))) return; if (spinner->wrap) { if (range->value == range->lower && increment < 0) value = range->upper; else if (range->value == range->upper && increment > 0) value = range->lower; else value = range->value + increment; } else value = range->value + increment; if (spinner->snap_to_ticks) value = _etk_spinner_value_snap(spinner, value); etk_range_value_set(range, value); spinner->successive_steps++; }
void bootpanel_update_timeout(boot_panel* pnl) { int timeout; EXALT_ASSERT_RETURN_VOID(pnl!=NULL); timeout = exalt_dbus_bootprocess_timeout_get(exalt_conn); etk_range_value_set(ETK_RANGE(pnl->slider),timeout); }
void emphasis_configgui_autoset(Emphasis_Config_Gui *configgui) { Emphasis_Config *config; config = config_load(); if(config->port) { etk_range_value_set(ETK_RANGE(configgui->port), config->port); } if(config->hostname) { etk_entry_text_set(ETK_ENTRY(configgui->hostname), config->hostname); } if(config->password) { etk_entry_text_set(ETK_ENTRY(configgui->password), config->password); } if(!mpc_assert_status(MPD_PLAYER_STOP) || mpc_get_crossfade()) { etk_range_value_set(ETK_RANGE(configgui->xfade), mpc_get_crossfade()); } else { etk_range_value_set(ETK_RANGE(configgui->xfade), config->crossfade); } etk_toggle_button_active_set(ETK_TOGGLE_BUTTON(configgui->stop), config->stop_on_exit); etk_toggle_button_active_set(ETK_TOGGLE_BUTTON(configgui->aspect), config->keep_aspect); config_free(config); }
/* Called when the step-increment of the spinner is changed: * We correct the value if the "snap-to-ticks" setting is on */ static void _etk_spinner_step_increment_changed_cb(Etk_Object *object, const char *property_name, void *data) { Etk_Spinner *spinner; double value; if (!(spinner = ETK_SPINNER(object))) return; if (spinner->snap_to_ticks) { value = etk_range_value_get(ETK_RANGE(spinner)); value = _etk_spinner_value_snap(spinner, value); etk_range_value_set(ETK_RANGE(spinner), value); } }
/** * @brief Sets whether or not the value of the spinner should be automatically * corrected to the nearest step-increment * @param spinner a spinner * @param snap_to_ticks ETK_TRUE if you want the value to be corrected, ETK_FALSE otherwise */ void etk_spinner_snap_to_ticks_set(Etk_Spinner *spinner, Etk_Bool snap_to_ticks) { if (!spinner || spinner->snap_to_ticks == snap_to_ticks) return; spinner->snap_to_ticks = snap_to_ticks; if (snap_to_ticks) { double new_value; new_value = _etk_spinner_value_snap(spinner, etk_range_value_get(ETK_RANGE(spinner))); etk_range_value_set(ETK_RANGE(spinner), new_value); } etk_object_notify(ETK_OBJECT(spinner), "snap-to-ticks"); }
/* Updates the value of the spinner from its text */ static void _etk_spinner_update_value_from_text(Etk_Spinner *spinner) { const char *text; float value; if (!spinner || !spinner->editable_object) return; text = etk_editable_text_get(spinner->editable_object); if (sscanf(text, "%f", &value) != 1) value = 0.0; if (spinner->snap_to_ticks) value = _etk_spinner_value_snap(spinner, value); if (!etk_range_value_set(ETK_RANGE(spinner), value)) _etk_spinner_update_text_from_value(spinner); }
/* Default handler for the "value-changed" signal of a spinner */ static Etk_Bool _etk_spinner_value_changed_handler(Etk_Range *range, double value) { Etk_Spinner *spinner; if (!(spinner = ETK_SPINNER(range))) return ETK_TRUE; if (spinner->snap_to_ticks) { double new_value; new_value = _etk_spinner_value_snap(spinner, value); if (value != range->lower && value != range->upper && value != value) etk_range_value_set(ETK_RANGE(spinner), new_value); } _etk_spinner_update_text_from_value(spinner); return ETK_TRUE; }
void image_frame_update(void) { //Etk_Combobox_Item *item = NULL; const char *im; //Stop signal propagation etk_signal_block("value-changed",ETK_OBJECT(UI_BorderLeftSpinner), ETK_CALLBACK(_image_border_spinners_value_changed_cb), (void*)BORDER_LEFT); etk_signal_block("value-changed",ETK_OBJECT(UI_BorderRightSpinner), ETK_CALLBACK(_image_border_spinners_value_changed_cb), (void*)BORDER_RIGHT); etk_signal_block("value-changed",ETK_OBJECT(UI_BorderTopSpinner), ETK_CALLBACK(_image_border_spinners_value_changed_cb), (void*)BORDER_TOP); etk_signal_block("value-changed",ETK_OBJECT(UI_BorderBottomSpinner), ETK_CALLBACK(_image_border_spinners_value_changed_cb), (void*)BORDER_BOTTOM); etk_signal_block("value-changed",ETK_OBJECT(UI_ImageAlphaSlider), ETK_CALLBACK(_image_AlphaSlider_value_changed_cb), NULL); etk_signal_block("icon-selected", ETK_OBJECT(UI_ImageBrowserIconbox), ETK_CALLBACK(_image_browser_iconbox_selected_cb), NULL); etk_signal_block("toggled", ETK_OBJECT(UI_BorderMiddleCheck), ETK_CALLBACK(_image_BorderMiddleCheck_toggled_cb), NULL); if (!etk_string_length_get(Cur.state)) return; if (!etk_string_length_get(Cur.part)) return; image_tweenlist_populate(); etk_widget_disabled_set(UI_DeleteTweenButton, TRUE); etk_widget_disabled_set(UI_MoveDownTweenButton, TRUE); etk_widget_disabled_set(UI_MoveUpTweenButton, TRUE); /* Update Image Browser */ image_browser_update(); //Set the images label for normal image im = edje_edit_state_image_get(edje_o, Cur.part->string, Cur.state->string); if (im) { etk_label_set(ETK_LABEL(UI_ImageNameLabel), im); edje_edit_string_free(im); } else { etk_label_set(ETK_LABEL(UI_ImageNameLabel), "none"); } //Set alpha and borders int alpha, t, l, r, b; edje_edit_state_color_get(edje_o, Cur.part->string, Cur.state->string, NULL, NULL, NULL, &alpha); edje_edit_state_image_border_get(edje_o, Cur.part->string, Cur.state->string, &l, &r, &t, &b); etk_range_value_set(ETK_RANGE(UI_ImageAlphaSlider), alpha); etk_range_value_set(ETK_RANGE(UI_BorderLeftSpinner), l); etk_range_value_set(ETK_RANGE(UI_BorderRightSpinner), r); etk_range_value_set(ETK_RANGE(UI_BorderTopSpinner), t); etk_range_value_set(ETK_RANGE(UI_BorderBottomSpinner), b); etk_toggle_button_active_set(ETK_TOGGLE_BUTTON(UI_BorderMiddleCheck), edje_edit_state_image_border_fill_get(edje_o, Cur.part->string, Cur.state->string)); //ReEnable Signal Propagation etk_signal_unblock("value-changed", ETK_OBJECT(UI_BorderLeftSpinner), _image_border_spinners_value_changed_cb, (void*)BORDER_LEFT); etk_signal_unblock("value-changed", ETK_OBJECT(UI_BorderRightSpinner), _image_border_spinners_value_changed_cb, (void*)BORDER_RIGHT); etk_signal_unblock("value-changed", ETK_OBJECT(UI_BorderTopSpinner), _image_border_spinners_value_changed_cb, (void*)BORDER_TOP); etk_signal_unblock("value-changed", ETK_OBJECT(UI_BorderBottomSpinner), _image_border_spinners_value_changed_cb, (void*)BORDER_BOTTOM); etk_signal_unblock("value-changed", ETK_OBJECT(UI_ImageAlphaSlider), _image_AlphaSlider_value_changed_cb, NULL); etk_signal_unblock("icon-selected", ETK_OBJECT(UI_ImageBrowserIconbox), ETK_CALLBACK(_image_browser_iconbox_selected_cb), NULL); etk_signal_unblock("toggled", ETK_OBJECT(UI_BorderMiddleCheck), ETK_CALLBACK(_image_BorderMiddleCheck_toggled_cb), NULL); }
void gradient_frame_update(void) { const char *type; char *p; int i; int alpha; Etk_Combobox_Item *item; //Disable signal propagation etk_signal_block("item-activated", ETK_OBJECT(UI_GradientTypeComboBox), ETK_CALLBACK(_gradient_type_combo_activated_cb), NULL); etk_signal_block("item-activated", ETK_OBJECT(UI_GradientSpectraComboBox), ETK_CALLBACK(_gradient_spectra_combo_activated_cb), NULL); etk_signal_block("value-changed", ETK_OBJECT(UI_GradientAlphaSlider), ETK_CALLBACK(_image_AlphaSlider_value_changed_cb), NULL); etk_signal_block("value-changed", ETK_OBJECT(UI_GradientAngleSlider), ETK_CALLBACK(_gradient_AngleSlider_value_changed_cb), NULL); etk_signal_block("value-changed", ETK_OBJECT(UI_GradientRel1XSpinner), ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), (void *)REL1X_SPINNER); etk_signal_block("value-changed", ETK_OBJECT(UI_GradientRel1YSpinner), ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), (void *)REL1Y_SPINNER); etk_signal_block("value-changed", ETK_OBJECT(UI_GradientRel2XSpinner), ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), (void *)REL2X_SPINNER); etk_signal_block("value-changed", ETK_OBJECT(UI_GradientRel2YSpinner), ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), (void *)REL2Y_SPINNER); etk_signal_block("value-changed", ETK_OBJECT(UI_GradientRel1XOffsetSpinner), ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), (void *)REL1XO_SPINNER); etk_signal_block("value-changed", ETK_OBJECT(UI_GradientRel1YOffsetSpinner), ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), (void *)REL1YO_SPINNER); etk_signal_block("value-changed", ETK_OBJECT(UI_GradientRel2XOffsetSpinner), ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), (void *)REL2XO_SPINNER); etk_signal_block("value-changed", ETK_OBJECT(UI_GradientRel2YOffsetSpinner), ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), (void *)REL2YO_SPINNER); //Set Gradient Type Combo type = edje_edit_state_gradient_type_get(edje_o, Cur.part->string, Cur.state->string); if (type) { i=0; while ((item = etk_combobox_nth_item_get(ETK_COMBOBOX(UI_GradientTypeComboBox), i))) { p = etk_combobox_item_field_get(item, 1); if (strcmp(p, type) == 0) etk_combobox_active_item_set(ETK_COMBOBOX(UI_GradientTypeComboBox), item); i++; } edje_edit_string_free(type); } else etk_combobox_active_item_set(ETK_COMBOBOX(UI_GradientTypeComboBox), etk_combobox_nth_item_get(ETK_COMBOBOX(UI_GradientTypeComboBox), 0)); //Set Gradient Spectra Combo type = edje_edit_state_gradient_spectra_get(edje_o, Cur.part->string, Cur.state->string); if (type) { i=0; while ((item = etk_combobox_nth_item_get(ETK_COMBOBOX(UI_GradientSpectraComboBox), i))) { p = etk_combobox_item_field_get(item, 1); if (strcmp(p, type) == 0) { etk_combobox_active_item_set(ETK_COMBOBOX(UI_GradientSpectraComboBox), item); break; } i++; } edje_edit_string_free(type); } else etk_combobox_active_item_set(ETK_COMBOBOX(UI_GradientSpectraComboBox), etk_combobox_nth_item_get(ETK_COMBOBOX(UI_GradientSpectraComboBox), 0)); //Set alpha slider edje_edit_state_color_get(edje_o, Cur.part->string, Cur.state->string, NULL, NULL, NULL, &alpha); etk_range_value_set(ETK_RANGE(UI_GradientAlphaSlider), alpha); //Set Angle slider etk_range_value_set(ETK_RANGE(UI_GradientAngleSlider), edje_edit_state_gradient_angle_get(edje_o, Cur.part->string, Cur.state->string)); //Update Rels spinners etk_range_value_set(ETK_RANGE(UI_GradientRel1XSpinner), edje_edit_state_gradient_rel1_relative_x_get(edje_o, Cur.part->string, Cur.state->string)); etk_range_value_set(ETK_RANGE(UI_GradientRel1YSpinner), edje_edit_state_gradient_rel1_relative_y_get(edje_o, Cur.part->string, Cur.state->string)); etk_range_value_set(ETK_RANGE(UI_GradientRel1XOffsetSpinner), edje_edit_state_gradient_rel1_offset_x_get(edje_o, Cur.part->string, Cur.state->string)); etk_range_value_set(ETK_RANGE(UI_GradientRel1YOffsetSpinner), edje_edit_state_gradient_rel1_offset_y_get(edje_o, Cur.part->string, Cur.state->string)); etk_range_value_set(ETK_RANGE(UI_GradientRel2XSpinner), edje_edit_state_gradient_rel2_relative_x_get(edje_o, Cur.part->string, Cur.state->string)); etk_range_value_set(ETK_RANGE(UI_GradientRel2YSpinner), edje_edit_state_gradient_rel2_relative_y_get(edje_o, Cur.part->string, Cur.state->string)); etk_range_value_set(ETK_RANGE(UI_GradientRel2XOffsetSpinner), edje_edit_state_gradient_rel2_offset_x_get(edje_o, Cur.part->string, Cur.state->string)); etk_range_value_set(ETK_RANGE(UI_GradientRel2YOffsetSpinner), edje_edit_state_gradient_rel2_offset_y_get(edje_o, Cur.part->string, Cur.state->string)); //Reenable signal propagation etk_signal_unblock("item-activated", ETK_OBJECT(UI_GradientTypeComboBox), ETK_CALLBACK(_gradient_type_combo_activated_cb), NULL); etk_signal_unblock("item-activated", ETK_OBJECT(UI_GradientSpectraComboBox), ETK_CALLBACK(_gradient_spectra_combo_activated_cb), NULL); etk_signal_unblock("value-changed", ETK_OBJECT(UI_GradientAlphaSlider), ETK_CALLBACK(_image_AlphaSlider_value_changed_cb), NULL); etk_signal_unblock("value-changed", ETK_OBJECT(UI_GradientAngleSlider), ETK_CALLBACK(_gradient_AngleSlider_value_changed_cb), NULL); etk_signal_unblock("value-changed", ETK_OBJECT(UI_GradientRel1XSpinner), ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), (void *)REL1X_SPINNER); etk_signal_unblock("value-changed", ETK_OBJECT(UI_GradientRel1YSpinner), ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), (void *)REL1Y_SPINNER); etk_signal_unblock("value-changed", ETK_OBJECT(UI_GradientRel2XSpinner), ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), (void *)REL2X_SPINNER); etk_signal_unblock("value-changed", ETK_OBJECT(UI_GradientRel2YSpinner), ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), (void *)REL2Y_SPINNER); etk_signal_unblock("value-changed", ETK_OBJECT(UI_GradientRel1XOffsetSpinner), ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), (void *)REL1XO_SPINNER); etk_signal_unblock("value-changed", ETK_OBJECT(UI_GradientRel1YOffsetSpinner), ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), (void *)REL1YO_SPINNER); etk_signal_unblock("value-changed", ETK_OBJECT(UI_GradientRel2XOffsetSpinner), ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), (void *)REL2XO_SPINNER); etk_signal_unblock("value-changed", ETK_OBJECT(UI_GradientRel2YOffsetSpinner), ETK_CALLBACK(_gradient_RelSpinners_value_changed_cb), (void *)REL2YO_SPINNER); }
void state_frame_update(void) { const char* cc; //Stop signal propagation etk_signal_block("text-changed", ETK_OBJECT(UI_StateEntry), _group_NamesEntry_text_changed_cb, NULL); etk_signal_block("value-changed", ETK_OBJECT(UI_AspectMinSpinner), ETK_CALLBACK(_state_AspectSpinner_value_changed_cb), NULL); etk_signal_block("value-changed", ETK_OBJECT(UI_AspectMaxSpinner), ETK_CALLBACK(_state_AspectSpinner_value_changed_cb), NULL); etk_signal_block("active-item-changed", ETK_OBJECT(UI_AspectComboBox), ETK_CALLBACK(_state_AspectComboBox_changed_cb), NULL); etk_signal_block("value-changed", ETK_OBJECT(UI_StateMinWSpinner), ETK_CALLBACK(_state_MinMaxSpinner_value_changed_cb), NULL); etk_signal_block("value-changed", ETK_OBJECT(UI_StateMinHSpinner), ETK_CALLBACK(_state_MinMaxSpinner_value_changed_cb), NULL); etk_signal_block("value-changed", ETK_OBJECT(UI_StateMaxWSpinner), ETK_CALLBACK(_state_MinMaxSpinner_value_changed_cb), NULL); etk_signal_block("value-changed", ETK_OBJECT(UI_StateMaxHSpinner), ETK_CALLBACK(_state_MinMaxSpinner_value_changed_cb), NULL); etk_signal_block("value-changed", ETK_OBJECT(UI_StateAlignVSpinner), ETK_CALLBACK(_text_FontAlignSpinner_value_changed_cb), (void*)STATE_ALIGNV_SPINNER); etk_signal_block("value-changed", ETK_OBJECT(UI_StateAlignHSpinner), ETK_CALLBACK(_text_FontAlignSpinner_value_changed_cb), (void*)STATE_ALIGNH_SPINNER); etk_signal_block("toggled", ETK_OBJECT(UI_StateVisibleCheck), ETK_CALLBACK(_state_VisibleCheck_toggled_cb), NULL); etk_signal_block("text-changed", ETK_OBJECT(UI_StateCCEntry), ETK_CALLBACK(_state_CCEntry_text_changed_cb), NULL); if (etk_string_length_get(Cur.state)) { //Set description name & index etk_entry_text_set(ETK_ENTRY(UI_StateEntry),Cur.state->string); etk_widget_hide(ETK_WIDGET(UI_StateEntryImage)); if (!strcmp(Cur.state->string, "default 0.00")) etk_widget_disabled_set(ETK_WIDGET(UI_StateEntry), ETK_TRUE); else etk_widget_disabled_set(ETK_WIDGET(UI_StateEntry), ETK_FALSE); //Set aspect min & max etk_range_value_set(ETK_RANGE(UI_AspectMinSpinner), edje_edit_state_aspect_min_get(edje_o, Cur.part->string, Cur.state->string)); etk_range_value_set(ETK_RANGE(UI_AspectMaxSpinner), edje_edit_state_aspect_max_get(edje_o, Cur.part->string, Cur.state->string)); //Set aspect pref Combo etk_combobox_active_item_set(ETK_COMBOBOX(UI_AspectComboBox), etk_combobox_nth_item_get(ETK_COMBOBOX(UI_AspectComboBox), edje_edit_state_aspect_pref_get(edje_o, Cur.part->string, Cur.state->string))); //Set min e max size etk_range_value_set(ETK_RANGE(UI_StateMinWSpinner), edje_edit_state_min_w_get(edje_o, Cur.part->string, Cur.state->string)); etk_range_value_set(ETK_RANGE(UI_StateMinHSpinner), edje_edit_state_min_h_get(edje_o, Cur.part->string, Cur.state->string)); etk_range_value_set(ETK_RANGE(UI_StateMaxWSpinner), edje_edit_state_max_w_get(edje_o, Cur.part->string, Cur.state->string)); etk_range_value_set(ETK_RANGE(UI_StateMaxHSpinner), edje_edit_state_max_h_get(edje_o, Cur.part->string, Cur.state->string)); //Set description align & valign etk_range_value_set(ETK_RANGE(UI_StateAlignHSpinner), edje_edit_state_align_x_get(edje_o, Cur.part->string, Cur.state->string)); etk_range_value_set(ETK_RANGE(UI_StateAlignVSpinner), edje_edit_state_align_y_get(edje_o, Cur.part->string, Cur.state->string)); //Set visible checkbox etk_toggle_button_active_set(ETK_TOGGLE_BUTTON(UI_StateVisibleCheck), edje_edit_state_visible_get(edje_o, Cur.part->string, Cur.state->string)); //Set Color Class Entry cc = edje_edit_state_color_class_get(edje_o, Cur.part->string, Cur.state->string); etk_entry_text_set(ETK_ENTRY(UI_StateCCEntry), cc); edje_edit_string_free(cc); } //ReEnable Signal Propagation etk_signal_unblock("text-changed", ETK_OBJECT(UI_StateEntry), _group_NamesEntry_text_changed_cb, NULL); etk_signal_unblock("value-changed", ETK_OBJECT(UI_AspectMinSpinner), ETK_CALLBACK(_state_AspectSpinner_value_changed_cb), NULL); etk_signal_unblock("value-changed", ETK_OBJECT(UI_AspectMaxSpinner), ETK_CALLBACK(_state_AspectSpinner_value_changed_cb), NULL); etk_signal_unblock("active-item-changed", ETK_OBJECT(UI_AspectComboBox), ETK_CALLBACK(_state_AspectComboBox_changed_cb), NULL); etk_signal_unblock("value-changed", ETK_OBJECT(UI_StateMinWSpinner), ETK_CALLBACK(_state_MinMaxSpinner_value_changed_cb), NULL); etk_signal_unblock("value-changed", ETK_OBJECT(UI_StateMinHSpinner), ETK_CALLBACK(_state_MinMaxSpinner_value_changed_cb), NULL); etk_signal_unblock("value-changed", ETK_OBJECT(UI_StateMaxWSpinner), ETK_CALLBACK(_state_MinMaxSpinner_value_changed_cb), NULL); etk_signal_unblock("value-changed", ETK_OBJECT(UI_StateMaxHSpinner), ETK_CALLBACK(_state_MinMaxSpinner_value_changed_cb), NULL); etk_signal_unblock("value-changed", ETK_OBJECT(UI_StateAlignVSpinner), ETK_CALLBACK(_text_FontAlignSpinner_value_changed_cb), (void*)STATE_ALIGNV_SPINNER); etk_signal_unblock("value-changed", ETK_OBJECT(UI_StateAlignHSpinner), ETK_CALLBACK(_text_FontAlignSpinner_value_changed_cb), (void*)STATE_ALIGNH_SPINNER); etk_signal_unblock("toggled", ETK_OBJECT(UI_StateVisibleCheck), ETK_CALLBACK(_state_VisibleCheck_toggled_cb), NULL); etk_signal_unblock("text-changed", ETK_OBJECT(UI_StateCCEntry), ETK_CALLBACK(_state_CCEntry_text_changed_cb), NULL); }
/** * @brief Set the volume slider to the value position * @param value A vol value in percent * @param gui A Emphasis_Gui */ void emphasis_player_vol_slider_set(Emphasis_Player_Gui *player, int value) { etk_range_value_set(ETK_RANGE(player->full.sound_slider) , (double) value); etk_range_value_set(ETK_RANGE(player->small.sound_slider), (double) value); }