Пример #1
0
void
view_color_management_reset_cmd_callback (GtkAction *action,
                                          gpointer   data)
{
  GimpDisplayShell *shell;
  GimpColorConfig  *global_config;
  GimpColorConfig  *shell_config;
  return_if_no_shell (shell, data);

  global_config = GIMP_CORE_CONFIG (shell->display->config)->color_management;
  shell_config  = gimp_display_shell_get_color_config (shell);

  gimp_config_copy (GIMP_CONFIG (global_config),
                    GIMP_CONFIG (shell_config),
                    0);
  shell->color_config_set = FALSE;
}
Пример #2
0
static void
gimp_core_config_finalize (GObject *object)
{
  GimpCoreConfig *core_config = GIMP_CORE_CONFIG (object);

  g_free (core_config->language);
  g_free (core_config->plug_in_path);
  g_free (core_config->module_path);
  g_free (core_config->interpreter_path);
  g_free (core_config->environ_path);
  g_free (core_config->brush_path);
  g_free (core_config->brush_path_writable);
  g_free (core_config->dynamics_path);
  g_free (core_config->dynamics_path_writable);
  g_free (core_config->pattern_path);
  g_free (core_config->pattern_path_writable);
  g_free (core_config->palette_path);
  g_free (core_config->palette_path_writable);
  g_free (core_config->gradient_path);
  g_free (core_config->gradient_path_writable);
  g_free (core_config->tool_preset_path);
  g_free (core_config->tool_preset_path_writable);
  g_free (core_config->font_path);
  g_free (core_config->font_path_writable);
  g_free (core_config->default_brush);
  g_free (core_config->default_dynamics);
  g_free (core_config->default_pattern);
  g_free (core_config->default_palette);
  g_free (core_config->default_gradient);
  g_free (core_config->default_tool_preset);
  g_free (core_config->default_font);
  g_free (core_config->plug_in_rc_path);

  if (core_config->default_image)
    g_object_unref (core_config->default_image);

  if (core_config->default_grid)
    g_object_unref (core_config->default_grid);

  if (core_config->color_management)
    g_object_unref (core_config->color_management);

  G_OBJECT_CLASS (parent_class)->finalize (object);
}
Пример #3
0
void
gimp_load_config (Gimp  *gimp,
                  GFile *alternate_system_gimprc,
                  GFile *alternate_gimprc)
{
  GimpRc *gimprc;

  g_return_if_fail (GIMP_IS_GIMP (gimp));
  g_return_if_fail (alternate_system_gimprc == NULL ||
                    G_IS_FILE (alternate_system_gimprc));
  g_return_if_fail (alternate_gimprc == NULL ||
                    G_IS_FILE (alternate_gimprc));
  g_return_if_fail (gimp->config == NULL);
  g_return_if_fail (gimp->edit_config == NULL);

  if (gimp->be_verbose)
    g_print ("INIT: %s\n", G_STRFUNC);

  /*  this needs to be done before gimprc loading because gimprc can
   *  use user defined units
   */
  gimp_unitrc_load (gimp);

  gimprc = gimp_rc_new (alternate_system_gimprc,
                        alternate_gimprc,
                        gimp->be_verbose);

  gimp->config = GIMP_CORE_CONFIG (gimprc);

  gimp->edit_config = gimp_config_duplicate (GIMP_CONFIG (gimp->config));

  g_signal_connect_object (gimp->config, "notify",
                           G_CALLBACK (gimp_global_config_notify),
                           gimp->edit_config, 0);
  g_signal_connect_object (gimp->edit_config, "notify",
                           G_CALLBACK (gimp_edit_config_notify),
                           gimp->config, 0);
}
Пример #4
0
void
gimp_display_shell_disconnect (GimpDisplayShell *shell)
{
    GimpImage     *image;
    GimpContainer *vectors;
    GList         *list;

    g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
    g_return_if_fail (GIMP_IS_DISPLAY (shell->display));

    image = gimp_display_get_image (shell->display);

    g_return_if_fail (GIMP_IS_IMAGE (image));

    vectors = gimp_image_get_vectors (image);

    gimp_display_shell_icon_update_stop (shell);

    gimp_canvas_layer_boundary_set_layer (GIMP_CANVAS_LAYER_BOUNDARY (shell->layer_boundary),
                                          NULL);

    g_signal_handlers_disconnect_by_func (GIMP_CORE_CONFIG (shell->display->config)->color_management,
                                          gimp_display_shell_color_config_notify_handler,
                                          shell);

    g_signal_handlers_disconnect_by_func (shell->display->config,
                                          gimp_display_shell_quality_notify_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (shell->display->config,
                                          gimp_display_shell_ants_speed_notify_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (shell->display->config->default_fullscreen_view,
                                          gimp_display_shell_padding_notify_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (shell->display->config->default_view,
                                          gimp_display_shell_padding_notify_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (shell->display->config,
                                          gimp_display_shell_monitor_res_notify_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (shell->display->config,
                                          gimp_display_shell_nav_size_notify_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (shell->display->config,
                                          gimp_display_shell_title_notify_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (shell->display->config,
                                          gimp_display_shell_check_notify_handler,
                                          shell);

    g_signal_handlers_disconnect_by_func (vectors,
                                          gimp_display_shell_vectors_remove_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (vectors,
                                          gimp_display_shell_vectors_add_handler,
                                          shell);

    gimp_tree_handler_disconnect (shell->vectors_visible_handler);
    shell->vectors_visible_handler = NULL;

    gimp_tree_handler_disconnect (shell->vectors_thaw_handler);
    shell->vectors_thaw_handler = NULL;

    gimp_tree_handler_disconnect (shell->vectors_freeze_handler);
    shell->vectors_freeze_handler = NULL;

    g_signal_handlers_disconnect_by_func (image,
                                          gimp_display_shell_active_vectors_handler,
                                          shell);

    for (list = gimp_item_stack_get_item_iter (GIMP_ITEM_STACK (vectors));
            list;
            list = g_list_next (list))
    {
        gimp_canvas_proxy_group_remove_item (GIMP_CANVAS_PROXY_GROUP (shell->vectors),
                                             list->data);
    }

    g_signal_handlers_disconnect_by_func (image,
                                          gimp_display_shell_exported_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (image,
                                          gimp_display_shell_saved_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (image,
                                          gimp_display_shell_profile_changed_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (image,
                                          gimp_display_shell_precision_changed_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (image,
                                          gimp_display_shell_invalidate_preview_handler,
                                          shell);

    g_signal_handlers_disconnect_by_func (image,
                                          gimp_display_shell_guide_add_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (image,
                                          gimp_display_shell_guide_remove_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (image,
                                          gimp_display_shell_guide_move_handler,
                                          shell);
    for (list = gimp_image_get_guides (image);
            list;
            list = g_list_next (list))
    {
        gimp_canvas_proxy_group_remove_item (GIMP_CANVAS_PROXY_GROUP (shell->guides),
                                             list->data);
    }

    g_signal_handlers_disconnect_by_func (image,
                                          gimp_display_shell_sample_point_add_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (image,
                                          gimp_display_shell_sample_point_remove_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (image,
                                          gimp_display_shell_sample_point_move_handler,
                                          shell);
    for (list = gimp_image_get_sample_points (image);
            list;
            list = g_list_next (list))
    {
        gimp_canvas_proxy_group_remove_item (GIMP_CANVAS_PROXY_GROUP (shell->sample_points),
                                             list->data);
    }

    g_signal_handlers_disconnect_by_func (image,
                                          gimp_display_shell_quick_mask_changed_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (image,
                                          gimp_display_shell_resolution_changed_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (image,
                                          gimp_display_shell_size_changed_detailed_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (image,
                                          gimp_display_shell_selection_invalidate_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (image,
                                          gimp_display_shell_name_changed_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (gimp_image_get_grid (image),
                                          gimp_display_shell_grid_notify_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (image,
                                          gimp_display_shell_undo_event_handler,
                                          shell);
    g_signal_handlers_disconnect_by_func (image,
                                          gimp_display_shell_clean_dirty_handler,
                                          shell);
}
Пример #5
0
void
gimp_display_shell_connect (GimpDisplayShell *shell)
{
    GimpImage     *image;
    GimpContainer *vectors;
    GList         *list;

    g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
    g_return_if_fail (GIMP_IS_DISPLAY (shell->display));

    image   = gimp_display_get_image (shell->display);
    vectors = gimp_image_get_vectors (image);

    g_return_if_fail (GIMP_IS_IMAGE (image));

    g_signal_connect (image, "clean",
                      G_CALLBACK (gimp_display_shell_clean_dirty_handler),
                      shell);
    g_signal_connect (image, "dirty",
                      G_CALLBACK (gimp_display_shell_clean_dirty_handler),
                      shell);
    g_signal_connect (image, "undo-event",
                      G_CALLBACK (gimp_display_shell_undo_event_handler),
                      shell);

    g_signal_connect (gimp_image_get_grid (image), "notify",
                      G_CALLBACK (gimp_display_shell_grid_notify_handler),
                      shell);
    g_object_set (shell->grid, "grid", gimp_image_get_grid (image), NULL);

    g_signal_connect (image, "name-changed",
                      G_CALLBACK (gimp_display_shell_name_changed_handler),
                      shell);
    g_signal_connect (image, "selection-invalidate",
                      G_CALLBACK (gimp_display_shell_selection_invalidate_handler),
                      shell);
    g_signal_connect (image, "size-changed-detailed",
                      G_CALLBACK (gimp_display_shell_size_changed_detailed_handler),
                      shell);
    g_signal_connect (image, "resolution-changed",
                      G_CALLBACK (gimp_display_shell_resolution_changed_handler),
                      shell);
    g_signal_connect (image, "quick-mask-changed",
                      G_CALLBACK (gimp_display_shell_quick_mask_changed_handler),
                      shell);

    g_signal_connect (image, "guide-added",
                      G_CALLBACK (gimp_display_shell_guide_add_handler),
                      shell);
    g_signal_connect (image, "guide-removed",
                      G_CALLBACK (gimp_display_shell_guide_remove_handler),
                      shell);
    g_signal_connect (image, "guide-moved",
                      G_CALLBACK (gimp_display_shell_guide_move_handler),
                      shell);
    for (list = gimp_image_get_guides (image);
            list;
            list = g_list_next (list))
    {
        gimp_display_shell_guide_add_handler (image, list->data, shell);
    }

    g_signal_connect (image, "sample-point-added",
                      G_CALLBACK (gimp_display_shell_sample_point_add_handler),
                      shell);
    g_signal_connect (image, "sample-point-removed",
                      G_CALLBACK (gimp_display_shell_sample_point_remove_handler),
                      shell);
    g_signal_connect (image, "sample-point-moved",
                      G_CALLBACK (gimp_display_shell_sample_point_move_handler),
                      shell);
    for (list = gimp_image_get_sample_points (image);
            list;
            list = g_list_next (list))
    {
        gimp_display_shell_sample_point_add_handler (image, list->data, shell);
    }

    g_signal_connect (image, "invalidate-preview",
                      G_CALLBACK (gimp_display_shell_invalidate_preview_handler),
                      shell);
    g_signal_connect (image, "precision-changed",
                      G_CALLBACK (gimp_display_shell_precision_changed_handler),
                      shell);
    g_signal_connect (image, "profile-changed",
                      G_CALLBACK (gimp_display_shell_profile_changed_handler),
                      shell);
    g_signal_connect (image, "precision-changed",
                      G_CALLBACK (gimp_display_shell_precision_changed_handler),
                      shell);
    g_signal_connect (image, "saved",
                      G_CALLBACK (gimp_display_shell_saved_handler),
                      shell);
    g_signal_connect (image, "exported",
                      G_CALLBACK (gimp_display_shell_exported_handler),
                      shell);

    g_signal_connect (image, "active-vectors-changed",
                      G_CALLBACK (gimp_display_shell_active_vectors_handler),
                      shell);

    shell->vectors_freeze_handler =
        gimp_tree_handler_connect (vectors, "freeze",
                                   G_CALLBACK (gimp_display_shell_vectors_freeze_handler),
                                   shell);
    shell->vectors_thaw_handler =
        gimp_tree_handler_connect (vectors, "thaw",
                                   G_CALLBACK (gimp_display_shell_vectors_thaw_handler),
                                   shell);
    shell->vectors_visible_handler =
        gimp_tree_handler_connect (vectors, "visibility-changed",
                                   G_CALLBACK (gimp_display_shell_vectors_visible_handler),
                                   shell);

    g_signal_connect (vectors, "add",
                      G_CALLBACK (gimp_display_shell_vectors_add_handler),
                      shell);
    g_signal_connect (vectors, "remove",
                      G_CALLBACK (gimp_display_shell_vectors_remove_handler),
                      shell);
    for (list = gimp_item_stack_get_item_iter (GIMP_ITEM_STACK (vectors));
            list;
            list = g_list_next (list))
    {
        gimp_display_shell_vectors_add_handler (vectors, list->data, shell);
    }

    g_signal_connect (shell->display->config,
                      "notify::transparency-size",
                      G_CALLBACK (gimp_display_shell_check_notify_handler),
                      shell);
    g_signal_connect (shell->display->config,
                      "notify::transparency-type",
                      G_CALLBACK (gimp_display_shell_check_notify_handler),
                      shell);

    g_signal_connect (shell->display->config,
                      "notify::image-title-format",
                      G_CALLBACK (gimp_display_shell_title_notify_handler),
                      shell);
    g_signal_connect (shell->display->config,
                      "notify::image-status-format",
                      G_CALLBACK (gimp_display_shell_title_notify_handler),
                      shell);
    g_signal_connect (shell->display->config,
                      "notify::navigation-preview-size",
                      G_CALLBACK (gimp_display_shell_nav_size_notify_handler),
                      shell);
    g_signal_connect (shell->display->config,
                      "notify::monitor-resolution-from-windowing-system",
                      G_CALLBACK (gimp_display_shell_monitor_res_notify_handler),
                      shell);
    g_signal_connect (shell->display->config,
                      "notify::monitor-xresolution",
                      G_CALLBACK (gimp_display_shell_monitor_res_notify_handler),
                      shell);
    g_signal_connect (shell->display->config,
                      "notify::monitor-yresolution",
                      G_CALLBACK (gimp_display_shell_monitor_res_notify_handler),
                      shell);

    g_signal_connect (shell->display->config->default_view,
                      "notify::padding-mode",
                      G_CALLBACK (gimp_display_shell_padding_notify_handler),
                      shell);
    g_signal_connect (shell->display->config->default_view,
                      "notify::padding-color",
                      G_CALLBACK (gimp_display_shell_padding_notify_handler),
                      shell);
    g_signal_connect (shell->display->config->default_fullscreen_view,
                      "notify::padding-mode",
                      G_CALLBACK (gimp_display_shell_padding_notify_handler),
                      shell);
    g_signal_connect (shell->display->config->default_fullscreen_view,
                      "notify::padding-color",
                      G_CALLBACK (gimp_display_shell_padding_notify_handler),
                      shell);

    g_signal_connect (shell->display->config,
                      "notify::marching-ants-speed",
                      G_CALLBACK (gimp_display_shell_ants_speed_notify_handler),
                      shell);

    g_signal_connect (shell->display->config,
                      "notify::zoom-quality",
                      G_CALLBACK (gimp_display_shell_quality_notify_handler),
                      shell);

    g_signal_connect (GIMP_CORE_CONFIG (shell->display->config)->color_management,
                      "notify",
                      G_CALLBACK (gimp_display_shell_color_config_notify_handler),
                      shell);

    gimp_display_shell_invalidate_preview_handler (image, shell);
    gimp_display_shell_quick_mask_changed_handler (image, shell);
    gimp_display_shell_profile_changed_handler    (GIMP_COLOR_MANAGED (image),
            shell);

    gimp_canvas_layer_boundary_set_layer (GIMP_CANVAS_LAYER_BOUNDARY (shell->layer_boundary),
                                          gimp_image_get_active_layer (image));
}
Пример #6
0
static void
gimp_core_config_set_property (GObject      *object,
                               guint         property_id,
                               const GValue *value,
                               GParamSpec   *pspec)
{
  GimpCoreConfig *core_config = GIMP_CORE_CONFIG (object);

  switch (property_id)
    {
    case PROP_LANGUAGE:
      g_free (core_config->language);
      core_config->language = g_value_dup_string (value);
      break;
    case PROP_INTERPOLATION_TYPE:
      core_config->interpolation_type = g_value_get_enum (value);
      break;
    case PROP_DEFAULT_THRESHOLD:
      core_config->default_threshold = g_value_get_int (value);
      break;
    case PROP_PLUG_IN_PATH:
      g_free (core_config->plug_in_path);
      core_config->plug_in_path = g_value_dup_string (value);
      break;
    case PROP_MODULE_PATH:
      g_free (core_config->module_path);
      core_config->module_path = g_value_dup_string (value);
      break;
    case PROP_INTERPRETER_PATH:
      g_free (core_config->interpreter_path);
      core_config->interpreter_path = g_value_dup_string (value);
      break;
    case PROP_ENVIRON_PATH:
      g_free (core_config->environ_path);
      core_config->environ_path = g_value_dup_string (value);
      break;
    case PROP_BRUSH_PATH:
      g_free (core_config->brush_path);
      core_config->brush_path = g_value_dup_string (value);
      break;
    case PROP_BRUSH_PATH_WRITABLE:
      g_free (core_config->brush_path_writable);
      core_config->brush_path_writable = g_value_dup_string (value);
      break;
    case PROP_DYNAMICS_PATH:
      g_free (core_config->dynamics_path);
      core_config->dynamics_path = g_value_dup_string (value);
      break;
    case PROP_DYNAMICS_PATH_WRITABLE:
      g_free (core_config->dynamics_path_writable);
      core_config->dynamics_path_writable = g_value_dup_string (value);
      break;
    case PROP_MYPAINT_BRUSH_PATH:
      g_free (core_config->mypaint_brush_path);
      core_config->mypaint_brush_path = g_value_dup_string (value);
      break;
    case PROP_MYPAINT_BRUSH_PATH_WRITABLE:
      g_free (core_config->mypaint_brush_path_writable);
      core_config->mypaint_brush_path_writable = g_value_dup_string (value);
      break;
    case PROP_PATTERN_PATH:
      g_free (core_config->pattern_path);
      core_config->pattern_path = g_value_dup_string (value);
      break;
    case PROP_PATTERN_PATH_WRITABLE:
      g_free (core_config->pattern_path_writable);
      core_config->pattern_path_writable = g_value_dup_string (value);
      break;
    case PROP_PALETTE_PATH:
      g_free (core_config->palette_path);
      core_config->palette_path = g_value_dup_string (value);
      break;
    case PROP_PALETTE_PATH_WRITABLE:
      g_free (core_config->palette_path_writable);
      core_config->palette_path_writable = g_value_dup_string (value);
      break;
    case PROP_GRADIENT_PATH:
      g_free (core_config->gradient_path);
      core_config->gradient_path = g_value_dup_string (value);
      break;
    case PROP_GRADIENT_PATH_WRITABLE:
      g_free (core_config->gradient_path_writable);
      core_config->gradient_path_writable = g_value_dup_string (value);
      break;
    case PROP_TOOL_PRESET_PATH:
      g_free (core_config->tool_preset_path);
      core_config->tool_preset_path = g_value_dup_string (value);
      break;
    case PROP_TOOL_PRESET_PATH_WRITABLE:
      g_free (core_config->tool_preset_path_writable);
      core_config->tool_preset_path_writable = g_value_dup_string (value);
      break;
    case PROP_FONT_PATH:
      g_free (core_config->font_path);
      core_config->font_path = g_value_dup_string (value);
      break;
    case PROP_FONT_PATH_WRITABLE:
      g_free (core_config->font_path_writable);
      core_config->font_path_writable = g_value_dup_string (value);
      break;
    case PROP_DEFAULT_BRUSH:
      g_free (core_config->default_brush);
      core_config->default_brush = g_value_dup_string (value);
      break;
    case PROP_DEFAULT_DYNAMICS:
      g_free (core_config->default_dynamics);
      core_config->default_dynamics = g_value_dup_string (value);
      break;
    case PROP_DEFAULT_MYPAINT_BRUSH:
      g_free (core_config->default_mypaint_brush);
      core_config->default_mypaint_brush = g_value_dup_string (value);
      break;
    case PROP_DEFAULT_PATTERN:
      g_free (core_config->default_pattern);
      core_config->default_pattern = g_value_dup_string (value);
      break;
    case PROP_DEFAULT_PALETTE:
      g_free (core_config->default_palette);
      core_config->default_palette = g_value_dup_string (value);
      break;
    case PROP_DEFAULT_GRADIENT:
      g_free (core_config->default_gradient);
      core_config->default_gradient = g_value_dup_string (value);
      break;
    case PROP_DEFAULT_TOOL_PRESET:
      g_free (core_config->default_tool_preset);
      core_config->default_tool_preset = g_value_dup_string (value);
      break;
    case PROP_DEFAULT_FONT:
      g_free (core_config->default_font);
      core_config->default_font = g_value_dup_string (value);
      break;
    case PROP_GLOBAL_BRUSH:
      core_config->global_brush = g_value_get_boolean (value);
      break;
    case PROP_GLOBAL_DYNAMICS:
      core_config->global_dynamics = g_value_get_boolean (value);
      break;
    case PROP_GLOBAL_PATTERN:
      core_config->global_pattern = g_value_get_boolean (value);
      break;
    case PROP_GLOBAL_PALETTE:
      core_config->global_palette = g_value_get_boolean (value);
      break;
    case PROP_GLOBAL_GRADIENT:
      core_config->global_gradient = g_value_get_boolean (value);
      break;
    case PROP_GLOBAL_FONT:
      core_config->global_font = g_value_get_boolean (value);
      break;
    case PROP_DEFAULT_IMAGE:
      if (g_value_get_object (value))
        gimp_config_sync (g_value_get_object (value) ,
                          G_OBJECT (core_config->default_image), 0);
      break;
    case PROP_DEFAULT_GRID:
      if (g_value_get_object (value))
        gimp_config_sync (g_value_get_object (value),
                          G_OBJECT (core_config->default_grid), 0);
      break;
    case PROP_FILTER_HISTORY_SIZE:
      core_config->filter_history_size = g_value_get_int (value);
      break;
    case PROP_UNDO_LEVELS:
      core_config->levels_of_undo = g_value_get_int (value);
      break;
    case PROP_UNDO_SIZE:
      core_config->undo_size = g_value_get_uint64 (value);
      break;
    case PROP_UNDO_PREVIEW_SIZE:
      core_config->undo_preview_size = g_value_get_enum (value);
      break;
    case PROP_PLUGINRC_PATH:
      g_free (core_config->plug_in_rc_path);
      core_config->plug_in_rc_path = g_value_dup_string (value);
      break;
    case PROP_LAYER_PREVIEWS:
      core_config->layer_previews = g_value_get_boolean (value);
      break;
    case PROP_GROUP_LAYER_PREVIEWS:
      core_config->group_layer_previews = g_value_get_boolean (value);
      break;
    case PROP_LAYER_PREVIEW_SIZE:
      core_config->layer_preview_size = g_value_get_enum (value);
      break;
    case PROP_THUMBNAIL_SIZE:
      core_config->thumbnail_size = g_value_get_enum (value);
      break;
    case PROP_THUMBNAIL_FILESIZE_LIMIT:
      core_config->thumbnail_filesize_limit = g_value_get_uint64 (value);
      break;
    case PROP_COLOR_MANAGEMENT:
      if (g_value_get_object (value))
        gimp_config_sync (g_value_get_object (value),
                          G_OBJECT (core_config->color_management), 0);
      break;
    case PROP_SAVE_DOCUMENT_HISTORY:
      core_config->save_document_history = g_value_get_boolean (value);
      break;
    case PROP_QUICK_MASK_COLOR:
      gimp_value_get_rgb (value, &core_config->quick_mask_color);
      break;
    case PROP_IMPORT_PROMOTE_FLOAT:
      core_config->import_promote_float = g_value_get_boolean (value);
      break;
    case PROP_IMPORT_PROMOTE_DITHER:
      core_config->import_promote_dither = g_value_get_boolean (value);
      break;
    case PROP_IMPORT_ADD_ALPHA:
      core_config->import_add_alpha = g_value_get_boolean (value);
      break;
    case PROP_IMPORT_RAW_PLUG_IN:
      g_free (core_config->import_raw_plug_in);
      core_config->import_raw_plug_in = g_value_dup_string (value);
      break;
    case PROP_EXPORT_FILE_TYPE:
      core_config->export_file_type = g_value_get_enum (value);
      break;
    case PROP_EXPORT_COLOR_PROFILE:
      core_config->export_color_profile = g_value_get_boolean (value);
      break;
    case PROP_EXPORT_METADATA_EXIF:
      core_config->export_metadata_exif = g_value_get_boolean (value);
      break;
    case PROP_EXPORT_METADATA_XMP:
      core_config->export_metadata_xmp = g_value_get_boolean (value);
      break;
    case PROP_EXPORT_METADATA_IPTC:
      core_config->export_metadata_iptc = g_value_get_boolean (value);
      break;
    case PROP_DEBUG_POLICY:
      core_config->debug_policy = g_value_get_enum (value);
      break;

    case PROP_INSTALL_COLORMAP:
    case PROP_MIN_COLORS:
      /*  ignored  */
      break;

    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
      break;
    }
}
Пример #7
0
static void
gimp_core_config_get_property (GObject    *object,
                               guint       property_id,
                               GValue     *value,
                               GParamSpec *pspec)
{
  GimpCoreConfig *core_config = GIMP_CORE_CONFIG (object);

  switch (property_id)
    {
    case PROP_LANGUAGE:
      g_value_set_string (value, core_config->language);
      break;
    case PROP_INTERPOLATION_TYPE:
      g_value_set_enum (value, core_config->interpolation_type);
      break;
    case PROP_DEFAULT_THRESHOLD:
      g_value_set_int (value, core_config->default_threshold);
      break;
    case PROP_PLUG_IN_PATH:
      g_value_set_string (value, core_config->plug_in_path);
      break;
    case PROP_MODULE_PATH:
      g_value_set_string (value, core_config->module_path);
      break;
    case PROP_INTERPRETER_PATH:
      g_value_set_string (value, core_config->interpreter_path);
      break;
    case PROP_ENVIRON_PATH:
      g_value_set_string (value, core_config->environ_path);
      break;
    case PROP_BRUSH_PATH:
      g_value_set_string (value, core_config->brush_path);
      break;
    case PROP_BRUSH_PATH_WRITABLE:
      g_value_set_string (value, core_config->brush_path_writable);
      break;
    case PROP_DYNAMICS_PATH:
      g_value_set_string (value, core_config->dynamics_path);
      break;
    case PROP_DYNAMICS_PATH_WRITABLE:
      g_value_set_string (value, core_config->dynamics_path_writable);
      break;
    case PROP_MYPAINT_BRUSH_PATH:
      g_value_set_string (value, core_config->mypaint_brush_path);
      break;
    case PROP_MYPAINT_BRUSH_PATH_WRITABLE:
      g_value_set_string (value, core_config->mypaint_brush_path_writable);
      break;
    case PROP_PATTERN_PATH:
      g_value_set_string (value, core_config->pattern_path);
      break;
    case PROP_PATTERN_PATH_WRITABLE:
      g_value_set_string (value, core_config->pattern_path_writable);
      break;
    case PROP_PALETTE_PATH:
      g_value_set_string (value, core_config->palette_path);
      break;
    case PROP_PALETTE_PATH_WRITABLE:
      g_value_set_string (value, core_config->palette_path_writable);
      break;
    case PROP_GRADIENT_PATH:
      g_value_set_string (value, core_config->gradient_path);
      break;
    case PROP_GRADIENT_PATH_WRITABLE:
      g_value_set_string (value, core_config->gradient_path_writable);
      break;
    case PROP_TOOL_PRESET_PATH:
      g_value_set_string (value, core_config->tool_preset_path);
      break;
    case PROP_TOOL_PRESET_PATH_WRITABLE:
      g_value_set_string (value, core_config->tool_preset_path_writable);
      break;
    case PROP_FONT_PATH:
      g_value_set_string (value, core_config->font_path);
      break;
    case PROP_FONT_PATH_WRITABLE:
      g_value_set_string (value, core_config->font_path_writable);
      break;
    case PROP_DEFAULT_BRUSH:
      g_value_set_string (value, core_config->default_brush);
      break;
    case PROP_DEFAULT_DYNAMICS:
      g_value_set_string (value, core_config->default_dynamics);
      break;
    case PROP_DEFAULT_MYPAINT_BRUSH:
      g_value_set_string (value, core_config->default_mypaint_brush);
      break;
    case PROP_DEFAULT_PATTERN:
      g_value_set_string (value, core_config->default_pattern);
      break;
    case PROP_DEFAULT_PALETTE:
      g_value_set_string (value, core_config->default_palette);
      break;
    case PROP_DEFAULT_GRADIENT:
      g_value_set_string (value, core_config->default_gradient);
      break;
    case PROP_DEFAULT_TOOL_PRESET:
      g_value_set_string (value, core_config->default_tool_preset);
      break;
    case PROP_DEFAULT_FONT:
      g_value_set_string (value, core_config->default_font);
      break;
    case PROP_GLOBAL_BRUSH:
      g_value_set_boolean (value, core_config->global_brush);
      break;
    case PROP_GLOBAL_DYNAMICS:
      g_value_set_boolean (value, core_config->global_dynamics);
      break;
    case PROP_GLOBAL_PATTERN:
      g_value_set_boolean (value, core_config->global_pattern);
      break;
    case PROP_GLOBAL_PALETTE:
      g_value_set_boolean (value, core_config->global_palette);
      break;
    case PROP_GLOBAL_GRADIENT:
      g_value_set_boolean (value, core_config->global_gradient);
      break;
    case PROP_GLOBAL_FONT:
      g_value_set_boolean (value, core_config->global_font);
      break;
    case PROP_DEFAULT_IMAGE:
      g_value_set_object (value, core_config->default_image);
      break;
    case PROP_DEFAULT_GRID:
      g_value_set_object (value, core_config->default_grid);
      break;
    case PROP_FILTER_HISTORY_SIZE:
      g_value_set_int (value, core_config->filter_history_size);
      break;
    case PROP_UNDO_LEVELS:
      g_value_set_int (value, core_config->levels_of_undo);
      break;
    case PROP_UNDO_SIZE:
      g_value_set_uint64 (value, core_config->undo_size);
      break;
    case PROP_UNDO_PREVIEW_SIZE:
      g_value_set_enum (value, core_config->undo_preview_size);
      break;
    case PROP_PLUGINRC_PATH:
      g_value_set_string (value, core_config->plug_in_rc_path);
      break;
    case PROP_LAYER_PREVIEWS:
      g_value_set_boolean (value, core_config->layer_previews);
      break;
    case PROP_LAYER_PREVIEW_SIZE:
      g_value_set_enum (value, core_config->layer_preview_size);
      break;
    case PROP_THUMBNAIL_SIZE:
      g_value_set_enum (value, core_config->thumbnail_size);
      break;
    case PROP_THUMBNAIL_FILESIZE_LIMIT:
      g_value_set_uint64 (value, core_config->thumbnail_filesize_limit);
      break;
    case PROP_COLOR_MANAGEMENT:
      g_value_set_object (value, core_config->color_management);
      break;
    case PROP_COLOR_PROFILE_POLICY:
      g_value_set_enum (value, core_config->color_profile_policy);
      break;
    case PROP_SAVE_DOCUMENT_HISTORY:
      g_value_set_boolean (value, core_config->save_document_history);
      break;
    case PROP_QUICK_MASK_COLOR:
      gimp_value_set_rgb (value, &core_config->quick_mask_color);
      break;

    case PROP_INSTALL_COLORMAP:
    case PROP_MIN_COLORS:
      /*  ignored  */
      break;

    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
      break;
    }
}