Example #1
0
static void alpha_change(GtkWidget *w, gpointer data) {
	GList *wins;
	int imalpha = gtk_range_get_value(GTK_RANGE(w));

	for (wins = pidgin_conv_windows_get_list(); wins; wins = wins->next) {
		PidginConvWindow *win = wins->data;
		set_wintrans(win->window, imalpha, TRUE,
			purple_prefs_get_bool(OPT_WINTRANS_IM_ONTOP));
	}
}
Example #2
0
static void change_alpha(GtkWidget *w, gpointer data) {
	int alpha = gtk_range_get_value(GTK_RANGE(w));
	purple_prefs_set_int(OPT_WINTRANS_IM_ALPHA, alpha);

	/* If we're in no-transparency on focus mode,
	 * don't take effect immediately */
	if (!purple_prefs_get_bool(OPT_WINTRANS_IM_ONFOCUS))
		set_wintrans(GTK_WIDGET(data), alpha, TRUE,
			purple_prefs_get_bool(OPT_WINTRANS_IM_ONTOP));
}
void ColorVisionDeficiencyConfig::applyConfig(dynvSystem *dynv){
	dynv_set_float(dynv, "strength", gtk_range_get_value(GTK_RANGE(strength)) / 100.0f);

	GtkTreeIter iter;
	if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(type), &iter)) {
		GtkTreeModel* model = gtk_combo_box_get_model(GTK_COMBO_BOX(type));
		ColorVisionDeficiency::DeficiencyType type_id;
		gtk_tree_model_get(model, &iter, 1, &type_id, -1);
		dynv_set_string(dynv, "type", ColorVisionDeficiency::deficiency_type_string[type_id]);
	}
}
Example #4
0
/*
 * #############################################################################
 * ######################## Start Main Window Related Functions ################
 * #############################################################################
 */
void
on_GOP_selector_value_changed          (GtkRange        *range,
                                        gpointer         user_data)
{
    uint32_t GOP;

    GOP = (uint32_t) gtk_range_get_value(range);
    gtk_spin_button_set_value(GTK_SPIN_BUTTON(GOP_selector_spinbutton), (gdouble)GOP);

    slider_updated_actions(GOP);
}
Example #5
0
static void
value_changed_callback (GtkWidget * widget, GstElement * volume)
{
  gdouble value;
  gdouble level;

  value = gtk_range_get_value (GTK_RANGE (widget));
  level = exp (value / 20.0 * M_LN10);
  g_print ("Value: %f dB, level: %f\n", value, level);
  g_object_set (volume, "volume", level, NULL);
}
Example #6
0
void fScrollCB(::GtkRange* pRange, gpointer pUserData)
{
	TUserData  l_oUserData;
	l_oUserData.pUserData=pUserData;
	gdouble l_oNewValue = gtk_range_get_value(pRange);
	g_pAnalogServer->channels()[l_oUserData.iData]=l_oNewValue;

#if defined _DEBUG
	std::cout << "Channel " << (int)(pUserData) << " value changed to " << l_oNewValue << "\n";
#endif
}
Example #7
0
static void cb_change(GtkRange *range,gSlider *data)
{
	int new_value = gtk_range_get_value(GTK_RANGE(data->widget));

	if (data->_value == new_value)
		return;
	
	data->_value = new_value;
	if (data->onChange) 
		data->onChange(data);
}
static void
panel_properties_dialog_update_background_opacity (PanelPropertiesDialog *dialog,
						   gint                   opacity)
{
	gdouble percentage;

	percentage = ((gdouble) (opacity * 100)) / 65535;

	if ((int) gtk_range_get_value (GTK_RANGE (dialog->opacity_scale)) != (int) percentage)
		gtk_range_set_value (GTK_RANGE (dialog->opacity_scale), percentage);
}
Example #9
0
void partMover::slider_release(GtkRange *range, gtkClassData* currentClassData)
{	
  partMover *currentPart = currentClassData->partPointer;
  int * joint = currentClassData->indexPointer;
  bool *POS_UPDATE = currentPart->CURRENT_POS_UPDATE;
  IPositionControl *ipos = currentPart->pos;
  IPidControl      *ipid = currentPart->pid;
  GtkWidget **sliderVel = currentPart->sliderVelArray;

  double val = gtk_range_get_value(range);
  double valVel = gtk_range_get_value((GtkRange *)sliderVel[*joint]);

  if (!POS_UPDATE[*joint])
    {
      ipos->setRefSpeed(*joint, valVel);
      ipos->positionMove(*joint, val);
      //ipid->setReference(*joint, val);
    }
  return;
}
Example #10
0
void OnScrollbarChange(GtkWidget *pWidget, gpointer data) {

  /* Recuperation de la valeur de la scrollbar */
  gint iValue = gtk_range_get_value(GTK_RANGE(pWidget));
  /* Creation du nouveau label */
  gchar* sLabel = g_strdup_printf("%d %%", iValue);
  /* Modification du label */
  gtk_label_set_text(GTK_LABEL(data), sLabel);
  /* Liberation memoire */
  g_free(sLabel);
}
Example #11
0
void gui_siesta_mode_prev(GtkWidget *w, gpointer dialog)
{
    gdouble m;
    gpointer slider;

    slider = dialog_child_get(dialog, "phonon_slider");

    m = gtk_range_get_value(GTK_RANGE(slider));
    m--;
    gtk_range_set_value(GTK_RANGE(slider), m);
}
Example #12
0
/**
 * \fn void set_perspective()
 * \brief Function to set the view perspective.
 */
void
set_perspective ()
{
  float k1, k2;
  phid = gtk_range_get_value (GTK_RANGE (dialog_simulator->hscale));
  thetad = gtk_range_get_value (GTK_RANGE (dialog_simulator->vscale));
  phi = phid * M_PI / 180.;
  theta = thetad * M_PI / 180.;
  if (fractal_3D)
    {
      perspective (0, 0, 0, &k1, &k2);
      xmin = k1;
      perspective (length, width, 0, &k1, &k2);
      xmax = k1;
      perspective (length, 0, 0, &k1, &k2);
      ymin = k2;
      perspective (0, width, height, &k1, &k2);
      ymax = k2;
    }
  draw ();
}
Example #13
0
static void set_qual(GtkWidget *widget, gpointer data)
{
	struct v4l2_jpegcompression jc;

	memset(&jc, 0, sizeof jc);
	jc.quality = gtk_range_get_value(GTK_RANGE(widget));
	if (ioctl(fd, VIDIOC_S_JPEGCOMP, &jc) < 0) {
		fprintf(stderr, "set JPEG quality error %d, %s\n",
				errno, strerror(errno));
		gtk_widget_set_state(widget, GTK_STATE_INSENSITIVE);
	}
}
Example #14
0
void on_float_range_changed(GtkRange * range, CappletData *capp)
{
    const char *name;

    if (capplet_ignore_changes)
        return;
    name = gtk_buildable_get_name(GTK_BUILDABLE(range));
    if (name)
    {
        capplet_set_float(capp->options, name, gtk_range_get_value(range));
    }
}
Example #15
0
void update_reverb()
{
	union indexed_reverb_properties properties;
	int i;

	for (i = 0; i < nProps; i++)
		properties.array[i] = gtk_range_get_value(props[i].value);

	FMOD_System_SetReverbProperties(fsystem, 0, &properties.reverb);

	print_preset_squeak();
}
Example #16
0
static void
value_changed_cb (GtkWidget * w, gpointer data)
{
  if (options.scale_data.print_partial)
    g_print ("%.0f\n", gtk_range_get_value (GTK_RANGE (scale)));

  if (options.scale_data.buttons)
    {
      gdouble v = gtk_range_get_value (GTK_RANGE (scale));

      if (v >= options.scale_data.max_value)
        gtk_widget_set_sensitive (plus_btn, FALSE);
      else
        gtk_widget_set_sensitive (plus_btn, TRUE);

      if (v <= options.scale_data.min_value)
        gtk_widget_set_sensitive (minus_btn, FALSE);
      else
        gtk_widget_set_sensitive (minus_btn, TRUE);
    }
}
Example #17
0
static void set_ctrl(GtkWidget *widget, gpointer data)
{
	struct v4l2_control ctrl;
	long id;

	id = (long) data;
	ctrl.id = id;
	ctrl.value = gtk_range_get_value(GTK_RANGE(widget));
	if (ioctl(fd, VIDIOC_S_CTRL, &ctrl) < 0)
		fprintf(stderr, "set control error %d, %s\n",
				errno, strerror(errno));
}
Example #18
0
static void set_value(GtkWidget * widget, gpointer data)
{
  GdkRegion *region;

  GtkRange *range = (GtkRange *) widget;
  GtkWidget *cpu = (GtkWidget *) data;
  GTK_CPU(cpu)->sel = gtk_range_get_value(range);

  region = gdk_drawable_get_clip_region(cpu->window);
  gdk_window_invalidate_region(cpu->window, region, TRUE);
  gdk_window_process_updates(cpu->window, TRUE);
}
Example #19
0
void lamixer_volboxr_changed(GtkObject *adjustment, VolBox *volumebox)
{
	long rangevalue_left,rangevalue_right,increment;

	rangevalue_right = gtk_range_get_value(GTK_RANGE(adjustment));

	if (volumebox->type == 1) {
		snd_mixer_selem_set_playback_volume (volumebox->volelem, SND_MIXER_SCHN_FRONT_RIGHT, rangevalue_right);
	}
	else if (volumebox->type == 2) {
		snd_mixer_selem_set_capture_volume (volumebox->volelem, SND_MIXER_SCHN_FRONT_RIGHT, rangevalue_right);
	}

	if ((volumebox->lockswitch != NULL) && (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(volumebox->lockswitch)))) {

		if (volumebox->type == 1) {
			snd_mixer_selem_get_playback_volume (volumebox->volelem, SND_MIXER_SCHN_FRONT_LEFT, &rangevalue_left);
		}
		else if (volumebox->type == 2) {
			snd_mixer_selem_get_capture_volume (volumebox->volelem, SND_MIXER_SCHN_FRONT_LEFT, &rangevalue_left);
		}

		//TODO: Percent increment will be better?
		increment = rangevalue_right-volumebox->rcurval;

		if ( ((rangevalue_left<volumebox->maxrange) && (rangevalue_left>volumebox->minrange)) || \
		    ((rangevalue_left==volumebox->maxrange) && (increment<0)) || ((rangevalue_left==volumebox->minrange) && (increment>0)) ) {

				if (((rangevalue_left+increment)<=(long)volumebox->maxrange) && ((rangevalue_left+increment)>=(long)volumebox->minrange)) {
					rangevalue_left = rangevalue_left+increment;
				}
				else {
					if ((rangevalue_left+increment) < ((long)volumebox->minrange)) {
						rangevalue_left = volumebox->minrange;
					}
					else {
						rangevalue_left = volumebox->maxrange;
					}
				}
				g_signal_handler_block(G_OBJECT(volumebox->volbar), volumebox->hsignalid);
				gtk_range_set_value(GTK_RANGE(volumebox->volbar), rangevalue_left);
				if (volumebox->type == 1) {
					snd_mixer_selem_set_playback_volume (volumebox->volelem, SND_MIXER_SCHN_FRONT_LEFT, rangevalue_left);
				}
				else if (volumebox->type == 2) {
					snd_mixer_selem_set_capture_volume (volumebox->volelem, SND_MIXER_SCHN_FRONT_LEFT, rangevalue_left);
				}
				volumebox->curval = rangevalue_left;
				g_signal_handler_unblock(G_OBJECT(volumebox->volbar), volumebox->hsignalid);
			}
	}
	volumebox->rcurval = rangevalue_right;
}
Example #20
0
static void _lib_lighttable_zoom_slider_changed(GtkRange *range, gpointer user_data)
{
  dt_lib_module_t *self = (dt_lib_module_t *)user_data;
  dt_lib_tool_lighttable_t *d = (dt_lib_tool_lighttable_t *)self->data;

  const int i = gtk_range_get_value(range);
  dt_conf_set_int("plugins/lighttable/images_in_row", i);
  gchar *i_as_str = g_strdup_printf("%d", i);
  gtk_entry_set_text(GTK_ENTRY(d->zoom_entry), i_as_str);
  g_free(i_as_str);
  dt_control_queue_redraw_center();
}
Example #21
0
/* on_value_changed */
void on_value_changed(GtkWidget * widget, gpointer data)
{
	Mixer * mixer = data;
	gdouble value;

#ifdef DEBUG
	fprintf(stderr, "DEBUG: %s(%p, %lf, %p)\n", __func__, (void*)widget,
			value, (void*)data);
#endif
	value = gtk_range_get_value(GTK_RANGE(widget));
	mixer_set_value(mixer, widget, value);
}
Example #22
0
void
on_preferences_run_speed_slider_value_changed
                                        (GtkRange        *range,
                                        gpointer         user_data)
{
    gdouble value;
    GtkSpinButton *spinner;
    
    value = gtk_range_get_value(range);
    spinner = GTK_SPIN_BUTTON(lookup_widget(GTK_WIDGET(preferences_window), "default_run_speed_spinner" ));
    gtk_spin_button_set_value(spinner, value);
}
Example #23
0
void NedMidiImportDialog::OnClose(GtkDialog *dialog, gint result, gpointer data) {
	char *s;
	NedMidiImportDialog *midi_import_dialog = (NedMidiImportDialog *) data;
	/*
	printf("current folder = %s, filename = %s\n", gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(midi_import_dialog->m_file_chooser)),
		gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(midi_import_dialog->m_file_chooser)));
	*/
	switch (result) {
		case GTK_RESPONSE_ACCEPT:
			midi_import_dialog->m_state = TRUE;
			if (*(midi_import_dialog->m_last_folder) != NULL) {
				free(*(midi_import_dialog->m_last_folder));
				*(midi_import_dialog->m_last_folder) = NULL;
			}
			if (*(midi_import_dialog->m_filename) != NULL) {
				free(*(midi_import_dialog->m_filename));
				*(midi_import_dialog->m_filename) = NULL;
			}
			s = gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(midi_import_dialog->m_file_chooser));
			if (strlen(s) > 0) {
				*(midi_import_dialog->m_last_folder) = strdup(s);
			}
			s = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(midi_import_dialog->m_file_chooser));
			if (strlen(s) > 0) {
				*(midi_import_dialog->m_filename) = strdup(s);
			}

		break;
		default:
			midi_import_dialog->m_state = FALSE;
		break;
	}
	midi_import_dialog->m_with_triplets = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(midi_import_dialog->m_with_triplet_button));
	midi_import_dialog->m_tempo_change_density = (int) gtk_range_get_value(GTK_RANGE(midi_import_dialog->m_tempo_change_density_scale));
	midi_import_dialog->m_volume_change_density = (int) gtk_range_get_value(GTK_RANGE(midi_import_dialog->m_volume_change_density_scale));
	midi_import_dialog->m_force_piano = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(midi_import_dialog->m_force_piano_button));
	midi_import_dialog->m_sort_instruments = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(midi_import_dialog->m_sort_instruments_button));
	midi_import_dialog->m_dont_split = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(midi_import_dialog->m_dont_split_button));
	gtk_widget_destroy (GTK_WIDGET(dialog));
}
Example #24
0
static void
DepthChanged(GtkRange * pr, rollswidget * prw)
{
    GtkWidget *pNewRolls;
    int n;

    if (!fScrollComplete)
        return;

    if (fInterrupt) {           /* Stop recursion on cancel */
        fInterrupt = FALSE;
        return;
    }

    n = (int) gtk_range_get_value(pr);
    if (n == prw->nDepth)
        return;

    pwOldGrab = pwGrab;
    pwGrab = prw->pDialog;

    gtk_widget_set_sensitive(DialogArea(prw->pDialog, DA_BUTTONS), FALSE);
    gtk_widget_set_sensitive(prw->pScale, FALSE);
    gtk_widget_set_sensitive(prw->pCancel, TRUE);

    pNewRolls = RollsTree(n, prw->pec, prw->pms);

    if (pNewRolls) {
        if (prw->ptv) {
            gtk_widget_destroy(GTK_WIDGET(prw->ptv));
            prw->ptv = NULL;
        }
        prw->ptv = pNewRolls;

        gtk_container_add(GTK_CONTAINER(prw->psw), prw->ptv);
        prw->nDepth = n;
    } else {
        if (!prw->closing)
            gtk_range_set_value(GTK_RANGE(prw->pScale), (double) prw->nDepth);
    }

    pwGrab = pwOldGrab;
    if (!prw->closing) {
        gtk_widget_set_sensitive(DialogArea(prw->pDialog, DA_BUTTONS), TRUE);
        gtk_widget_set_sensitive(prw->pScale, TRUE);
        gtk_widget_set_sensitive(prw->pCancel, FALSE);

        gtk_widget_show_all(GTK_WIDGET(prw->psw));
    } else {                    /* dialog is waiting to close */
        gtk_widget_destroy(prw->pDialog);
    }
}
Example #25
0
static void
#if GTK_CHECK_VERSION(2,12,0)
pidgin_media_output_volume_changed(GtkScaleButton *range, double value,
		PurpleMedia *media)
{
	double val = (double)value * 100.0;
#else
pidgin_media_output_volume_changed(GtkRange *range, PurpleMedia *media)
{
	double val = (double)gtk_range_get_value(GTK_RANGE(range));
#endif
	purple_media_set_output_volume(media, NULL, NULL, val);
}
gboolean browser_scroll_event(GtkWidget *widget, GdkEventScroll *event, gpointer user_data)
{
	int width = (widget->allocation.width / browser_columns) / 2;
	int top = gtk_range_get_value(GTK_RANGE(browse_vscroll));

	if (event->direction == GDK_SCROLL_UP)
		gtk_range_set_value(GTK_RANGE(browse_vscroll), top - width);
	else if (event->direction = GDK_SCROLL_DOWN)
		gtk_range_set_value(GTK_RANGE(browse_vscroll), top + width);

	gdk_window_invalidate_rect(widget->window, &widget->allocation, false);
	return false;
}
static void vscroll_volume_value_changed(GtkWidget* widget, gpointer data)	{
	double value = VSCROLL_VOLUME_MAX - gtk_range_get_value(GTK_RANGE(vscroll_volume));
	volume = VOLUME_MAX/VSCROLL_VOLUME_MAX*value;
	//pthread_t thread_change_volume;
	//pthread_create(&thread_change_volume, NULL, &change_volume, NULL);
	//with thread there are problems because of too many threads (when scrolling the scrollbar fast)
	//-> next timer program that the thread will wait or something like that so that the main loop doesn't 
	//has to make the complicated system call with amixer!!
	//then the call of change_volume has to be changed for threads (void*) function(void*)
	if(mute==FALSE)	{
		change_volume(volume);
	}
}
Example #28
0
static void
event_input_rate_changed (GtkRange *range, gpointer data)
{
    char text[256];
    GtkLabel *label = GTK_LABEL (data);
    double value = gtk_range_get_value (range) / 32040.0 * 60.09881389744051;

    snprintf (text, 256, "%.4f hz", value);

    gtk_label_set_text (label, text);

    return;
}
Example #29
0
void NedSpacementDialog::OnClose(GtkDialog *dialog, gint result, gpointer data) {
	NedSpacementDialog *space_dialog = (NedSpacementDialog *) data;
	switch (result) {
		case GTK_RESPONSE_ACCEPT:
			space_dialog->m_state = TRUE;
		break;
		default:
			space_dialog->m_state = FALSE;
		break;
	}
	space_dialog->m_spacement = gtk_range_get_value(GTK_RANGE(space_dialog->m_spacement_slider));
	gtk_widget_destroy (GTK_WIDGET(dialog));
}
static void
autoraise_delay_value_changed_callback (GtkWidget *slider,
                                        void      *data)
{
        MateWMSettings new_settings;

        new_settings.flags = MATE_WM_SETTING_AUTORAISE_DELAY;
        new_settings.autoraise_delay =
                gtk_range_get_value (GTK_RANGE (slider)) * 1000;

        if (current_wm != NULL && new_settings.autoraise_delay != settings->autoraise_delay)
                mate_window_manager_change_settings (current_wm, &new_settings);
}