Ejemplo n.º 1
0
gboolean
base_init (GimpBaseConfig *config,
           gboolean        be_verbose,
           gboolean        use_cpu_accel)
{
  gboolean  swap_is_ok;
  gchar    *temp_dir;

  g_return_val_if_fail (GIMP_IS_BASE_CONFIG (config), FALSE);
  g_return_val_if_fail (base_config == NULL, FALSE);

  base_config = g_object_ref (config);

  tile_cache_init (config->tile_cache_size);
  g_signal_connect (config, "notify::tile-cache-size",
                    G_CALLBACK (base_tile_cache_size_notify),
                    NULL);

  if (! config->swap_path || ! *config->swap_path)
    gimp_config_reset_property (G_OBJECT (config), "swap-path");

  base_toast_old_swap_files (config->swap_path);

  tile_swap_init (config->swap_path);

  swap_is_ok = tile_swap_test ();

  /*  create the temp directory if it doesn't exist  */
  if (! config->temp_path || ! *config->temp_path)
    gimp_config_reset_property (G_OBJECT (config), "temp-path");

  temp_dir = gimp_config_path_expand (config->temp_path, TRUE, NULL);

  if (! g_file_test (temp_dir, G_FILE_TEST_EXISTS))
    g_mkdir_with_parents (temp_dir,
                          S_IRUSR | S_IXUSR | S_IWUSR |
                          S_IRGRP | S_IXGRP |
                          S_IROTH | S_IXOTH);

  g_free (temp_dir);

  pixel_processor_init (config->num_processors);
  g_signal_connect (config, "notify::num-processors",
                    G_CALLBACK (base_num_processors_notify),
                    NULL);

  gimp_composite_init (be_verbose, use_cpu_accel);

  paint_funcs_setup ();

  return swap_is_ok;
}
Ejemplo n.º 2
0
void
gimp_color_balance_config_reset_range (GimpColorBalanceConfig *config)
{
    g_return_if_fail (GIMP_IS_COLOR_BALANCE_CONFIG (config));

    g_object_freeze_notify (G_OBJECT (config));

    gimp_config_reset_property (G_OBJECT (config), "cyan-red");
    gimp_config_reset_property (G_OBJECT (config), "magenta-green");
    gimp_config_reset_property (G_OBJECT (config), "yellow-blue");

    g_object_thaw_notify (G_OBJECT (config));
}
Ejemplo n.º 3
0
void
gimp_hue_saturation_config_reset_range (GimpHueSaturationConfig *config)
{
  g_return_if_fail (GIMP_IS_HUE_SATURATION_CONFIG (config));

  g_object_freeze_notify (G_OBJECT (config));

  gimp_config_reset_property (G_OBJECT (config), "hue");
  gimp_config_reset_property (G_OBJECT (config), "saturation");
  gimp_config_reset_property (G_OBJECT (config), "lightness");

  g_object_thaw_notify (G_OBJECT (config));
}
Ejemplo n.º 4
0
void
gimp_levels_config_reset_channel (GimpLevelsConfig *config)
{
  g_return_if_fail (GIMP_IS_LEVELS_CONFIG (config));

  g_object_freeze_notify (G_OBJECT (config));

  gimp_config_reset_property (G_OBJECT (config), "gamma");
  gimp_config_reset_property (G_OBJECT (config), "low-input");
  gimp_config_reset_property (G_OBJECT (config), "high-input");
  gimp_config_reset_property (G_OBJECT (config), "low-output");
  gimp_config_reset_property (G_OBJECT (config), "high-output");

  g_object_thaw_notify (G_OBJECT (config));
}
Ejemplo n.º 5
0
static void
gimp_hue_saturation_config_reset (GimpConfig *config)
{
  GimpHueSaturationConfig *hs_config = GIMP_HUE_SATURATION_CONFIG (config);
  GimpHueRange             range;

  for (range = GIMP_HUE_RANGE_ALL; range <= GIMP_HUE_RANGE_MAGENTA; range++)
    {
      hs_config->range = range;
      gimp_hue_saturation_config_reset_range (hs_config);
    }

  gimp_config_reset_property (G_OBJECT (config), "range");
  gimp_config_reset_property (G_OBJECT (config), "overlap");
}
Ejemplo n.º 6
0
static void
gimp_color_balance_config_reset (GimpConfig *config)
{
    GimpColorBalanceConfig *cb_config = GIMP_COLOR_BALANCE_CONFIG (config);
    GimpTransferMode        range;

    for (range = GIMP_TRANSFER_SHADOWS;
            range <= GIMP_TRANSFER_HIGHLIGHTS;
            range++)
    {
        cb_config->range = range;
        gimp_color_balance_config_reset_range (cb_config);
    }

    gimp_config_reset_property (G_OBJECT (config), "range");
    gimp_config_reset_property (G_OBJECT (config), "preserve-luminosity");
}
Ejemplo n.º 7
0
static void
gimp_levels_config_reset (GimpConfig *config)
{
  GimpLevelsConfig     *l_config = GIMP_LEVELS_CONFIG (config);
  GimpHistogramChannel  channel;

  for (channel = GIMP_HISTOGRAM_VALUE;
       channel <= GIMP_HISTOGRAM_ALPHA;
       channel++)
    {
      l_config->channel = channel;
      gimp_levels_config_reset_channel (l_config);
    }

  gimp_config_reset_property (G_OBJECT (config), "channel");
}
Ejemplo n.º 8
0
static void
gimp_curves_config_reset (GimpConfig *config)
{
  GimpCurvesConfig     *c_config = GIMP_CURVES_CONFIG (config);
  GimpHistogramChannel  channel;

  for (channel = GIMP_HISTOGRAM_VALUE;
       channel <= GIMP_HISTOGRAM_ALPHA;
       channel++)
    {
      c_config->channel = channel;
      gimp_curves_config_reset_channel (c_config);
    }

  gimp_config_reset_property (G_OBJECT (config), "channel");
}
Ejemplo n.º 9
0
static void
gimp_text_options_reset (GimpConfig *config)
{
  GObject *object = G_OBJECT (config);

  /*  implement reset() ourselves because the default impl would
   *  reset *all* properties, including all rectangle properties
   *  of the text box
   */

  /* context */
  gimp_config_reset_property (object, "font");
  gimp_config_reset_property (object, "foreground");

  /* text options */
  gimp_config_reset_property (object, "font-size");
  gimp_config_reset_property (object, "font-size-unit");
  gimp_config_reset_property (object, "antialias");
  gimp_config_reset_property (object, "hint-style");
  gimp_config_reset_property (object, "language");
  gimp_config_reset_property (object, "base-direction");
  gimp_config_reset_property (object, "justify");
  gimp_config_reset_property (object, "indent");
  gimp_config_reset_property (object, "line-spacing");
  gimp_config_reset_property (object, "letter-spacing");
  gimp_config_reset_property (object, "box-mode");
  gimp_config_reset_property (object, "use-editor");
}