static void reset_button_clicked(GtkButton *button, gpointer user_data) { CtkDisplayDeviceDfp *ctk_display_device_dfp = CTK_DISPLAY_DEVICE_DFP(user_data); gint value; ctk_image_sliders_reset (CTK_IMAGE_SLIDERS(ctk_display_device_dfp->image_sliders)); /* * if scaling is active, send the default scaling value to the * server and update the radio button group */ if (ctk_display_device_dfp->active_attributes & __SCALING) { value = MAKE_SCALING_VALUE(ctk_display_device_dfp->default_scaling_target, ctk_display_device_dfp->default_scaling_method); NvCtrlSetDisplayAttribute(ctk_display_device_dfp->handle, ctk_display_device_dfp->display_device_mask, NV_CTRL_GPU_SCALING, value); dfp_scaling_setup(ctk_display_device_dfp); } /* Reset the color configuration */ if (ctk_display_device_dfp->color_controls) { ctk_color_controls_reset (CTK_COLOR_CONTROLS(ctk_display_device_dfp->color_controls)); } /* Reset the dithering configuration */ if (ctk_display_device_dfp->dithering_controls) { ctk_dithering_controls_reset (CTK_DITHERING_CONTROLS(ctk_display_device_dfp->dithering_controls)); } /* Update the reset button */ gtk_widget_set_sensitive(ctk_display_device_dfp->reset_button, FALSE); /* status bar message */ ctk_config_statusbar_message(ctk_display_device_dfp->ctk_config, "Reset hardware defaults for %s.", ctk_display_device_dfp->name); } /* reset_button_clicked() */
static void reset_button_clicked(GtkButton *button, gpointer user_data) { CtkDisplayDevice *ctk_object = CTK_DISPLAY_DEVICE(user_data); /* Disable the reset button here and allow the controls below to (re)enable * it if need be,. */ gtk_widget_set_sensitive(ctk_object->reset_button, FALSE); ctk_color_controls_reset(CTK_COLOR_CONTROLS(ctk_object->color_controls)); ctk_dithering_controls_reset (CTK_DITHERING_CONTROLS(ctk_object->dithering_controls)); ctk_image_sliders_reset(CTK_IMAGE_SLIDERS(ctk_object->image_sliders)); ctk_config_statusbar_message(ctk_object->ctk_config, "Reset hardware defaults for %s.", ctk_object->name); } /* reset_button_clicked() */