mirror of https://github.com/GNOME/gimp.git
Fixed loading for dynamics and made them actually accessible
This commit is contained in:
parent
e75d44c77c
commit
cd36753f17
|
@ -593,7 +593,7 @@ gimp_real_initialize (Gimp *gimp,
|
||||||
gimp->dynamics_factory =
|
gimp->dynamics_factory =
|
||||||
gimp_data_factory_new (gimp,
|
gimp_data_factory_new (gimp,
|
||||||
GIMP_TYPE_DYNAMICS,
|
GIMP_TYPE_DYNAMICS,
|
||||||
"dynamics-path", "dynamics-path-writable",
|
"brush-path", "brush-path-writable",
|
||||||
dynamics_loader_entries,
|
dynamics_loader_entries,
|
||||||
G_N_ELEMENTS (dynamics_loader_entries),
|
G_N_ELEMENTS (dynamics_loader_entries),
|
||||||
gimp_dynamics_new,
|
gimp_dynamics_new,
|
||||||
|
@ -700,6 +700,7 @@ gimp_real_exit (Gimp *gimp,
|
||||||
gimp_tag_cache_save (gimp->tag_cache);
|
gimp_tag_cache_save (gimp->tag_cache);
|
||||||
|
|
||||||
gimp_data_factory_data_save (gimp->brush_factory);
|
gimp_data_factory_data_save (gimp->brush_factory);
|
||||||
|
gimp_data_factory_data_save (gimp->dynamics_factory);
|
||||||
gimp_data_factory_data_save (gimp->pattern_factory);
|
gimp_data_factory_data_save (gimp->pattern_factory);
|
||||||
gimp_data_factory_data_save (gimp->gradient_factory);
|
gimp_data_factory_data_save (gimp->gradient_factory);
|
||||||
gimp_data_factory_data_save (gimp->palette_factory);
|
gimp_data_factory_data_save (gimp->palette_factory);
|
||||||
|
@ -921,33 +922,37 @@ gimp_restore (Gimp *gimp,
|
||||||
status_callback (NULL, _("Brushes"), 0.1);
|
status_callback (NULL, _("Brushes"), 0.1);
|
||||||
gimp_data_factory_data_init (gimp->brush_factory, gimp->no_data);
|
gimp_data_factory_data_init (gimp->brush_factory, gimp->no_data);
|
||||||
|
|
||||||
|
/* initialize the list of gimp dynamics */
|
||||||
|
status_callback (NULL, _("Dynamics"), 0.2);
|
||||||
|
gimp_data_factory_data_init (gimp->dynamics_factory, gimp->no_data);
|
||||||
|
|
||||||
/* initialize the list of gimp patterns */
|
/* initialize the list of gimp patterns */
|
||||||
status_callback (NULL, _("Patterns"), 0.2);
|
status_callback (NULL, _("Patterns"), 0.3);
|
||||||
gimp_data_factory_data_init (gimp->pattern_factory, gimp->no_data);
|
gimp_data_factory_data_init (gimp->pattern_factory, gimp->no_data);
|
||||||
|
|
||||||
/* initialize the list of gimp palettes */
|
/* initialize the list of gimp palettes */
|
||||||
status_callback (NULL, _("Palettes"), 0.3);
|
status_callback (NULL, _("Palettes"), 0.4);
|
||||||
gimp_data_factory_data_init (gimp->palette_factory, gimp->no_data);
|
gimp_data_factory_data_init (gimp->palette_factory, gimp->no_data);
|
||||||
|
|
||||||
/* initialize the list of gimp gradients */
|
/* initialize the list of gimp gradients */
|
||||||
status_callback (NULL, _("Gradients"), 0.4);
|
status_callback (NULL, _("Gradients"), 0.5);
|
||||||
gimp_data_factory_data_init (gimp->gradient_factory, gimp->no_data);
|
gimp_data_factory_data_init (gimp->gradient_factory, gimp->no_data);
|
||||||
|
|
||||||
/* initialize the list of fonts */
|
/* initialize the list of fonts */
|
||||||
status_callback (NULL, _("Fonts (this may take a while)"), 0.5);
|
status_callback (NULL, _("Fonts (this may take a while)"), 0.6);
|
||||||
if (! gimp->no_fonts)
|
if (! gimp->no_fonts)
|
||||||
gimp_fonts_load (gimp);
|
gimp_fonts_load (gimp);
|
||||||
|
|
||||||
/* initialize the template list */
|
/* initialize the template list */
|
||||||
status_callback (NULL, _("Templates"), 0.6);
|
status_callback (NULL, _("Templates"), 0.7);
|
||||||
gimp_templates_load (gimp);
|
gimp_templates_load (gimp);
|
||||||
|
|
||||||
/* initialize the module list */
|
/* initialize the module list */
|
||||||
status_callback (NULL, _("Modules"), 0.7);
|
status_callback (NULL, _("Modules"), 0.8);
|
||||||
gimp_modules_load (gimp);
|
gimp_modules_load (gimp);
|
||||||
|
|
||||||
/* update tag cache */
|
/* update tag cache */
|
||||||
status_callback (NULL, _("Updating tag cache"), 0.8);
|
status_callback (NULL, _("Updating tag cache"), 0.9);
|
||||||
gimp_tag_cache_load (gimp->tag_cache);
|
gimp_tag_cache_load (gimp->tag_cache);
|
||||||
gimp_tag_cache_add_container (gimp->tag_cache,
|
gimp_tag_cache_add_container (gimp->tag_cache,
|
||||||
gimp_data_factory_get_container (gimp->brush_factory));
|
gimp_data_factory_get_container (gimp->brush_factory));
|
||||||
|
|
|
@ -164,10 +164,10 @@ static void gimp_context_real_set_brush (GimpContext *context,
|
||||||
|
|
||||||
/* dynamics */
|
/* dynamics */
|
||||||
|
|
||||||
static void gimp_context_dynamics_dirty (GimpDynamicsOptions *dynamics,
|
static void gimp_context_dynamics_dirty (GimpDynamics *dynamics,
|
||||||
GimpContext *context);
|
GimpContext *context);
|
||||||
static void gimp_context_dynamics_removed (GimpContainer *container,
|
static void gimp_context_dynamics_removed (GimpContainer *container,
|
||||||
GimpDynamicsOptions *dynamics,
|
GimpDynamics *dynamics,
|
||||||
GimpContext *context);
|
GimpContext *context);
|
||||||
static void gimp_context_dynamics_list_thaw (GimpContainer *container,
|
static void gimp_context_dynamics_list_thaw (GimpContainer *container,
|
||||||
GimpContext *context);
|
GimpContext *context);
|
||||||
|
@ -351,7 +351,7 @@ static guint gimp_context_signals[LAST_SIGNAL] = { 0 };
|
||||||
static GimpToolInfo *standard_tool_info = NULL;
|
static GimpToolInfo *standard_tool_info = NULL;
|
||||||
static GimpPaintInfo *standard_paint_info = NULL;
|
static GimpPaintInfo *standard_paint_info = NULL;
|
||||||
static GimpBrush *standard_brush = NULL;
|
static GimpBrush *standard_brush = NULL;
|
||||||
static GimpDynamicsOptions *standard_dynamics = NULL;
|
static GimpDynamics *standard_dynamics = NULL;
|
||||||
static GimpPattern *standard_pattern = NULL;
|
static GimpPattern *standard_pattern = NULL;
|
||||||
static GimpGradient *standard_gradient = NULL;
|
static GimpGradient *standard_gradient = NULL;
|
||||||
static GimpPalette *standard_palette = NULL;
|
static GimpPalette *standard_palette = NULL;
|
||||||
|
@ -2491,6 +2491,7 @@ GimpDynamics *
|
||||||
gimp_context_get_dynamics (GimpContext *context)
|
gimp_context_get_dynamics (GimpContext *context)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||||
|
g_return_val_if_fail (GIMP_IS_DYNAMICS (context->dynamics), NULL);
|
||||||
|
|
||||||
return context->dynamics;
|
return context->dynamics;
|
||||||
}
|
}
|
||||||
|
@ -2503,6 +2504,7 @@ gimp_context_set_dynamics (GimpContext *context,
|
||||||
g_return_if_fail (! dynamics || GIMP_IS_DYNAMICS (dynamics));
|
g_return_if_fail (! dynamics || GIMP_IS_DYNAMICS (dynamics));
|
||||||
context_find_defined (context, GIMP_CONTEXT_PROP_DYNAMICS);
|
context_find_defined (context, GIMP_CONTEXT_PROP_DYNAMICS);
|
||||||
|
|
||||||
|
printf("setting&OK\n");
|
||||||
gimp_context_real_set_dynamics (context, dynamics);
|
gimp_context_real_set_dynamics (context, dynamics);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2517,7 +2519,7 @@ gimp_context_dynamics_changed (GimpContext *context)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_context_dynamics_dirty (GimpDynamicsOptions *dynamics,
|
gimp_context_dynamics_dirty (GimpDynamics *dynamics,
|
||||||
GimpContext *context)
|
GimpContext *context)
|
||||||
{
|
{
|
||||||
g_free (context->dynamics_name);
|
g_free (context->dynamics_name);
|
||||||
|
@ -2525,7 +2527,7 @@ gimp_context_dynamics_dirty (GimpDynamicsOptions *dynamics,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gimp_context_dynamics_removed (GimpContainer *container,
|
static void gimp_context_dynamics_removed (GimpContainer *container,
|
||||||
GimpDynamicsOptions *dynamics,
|
GimpDynamics *dynamics,
|
||||||
GimpContext *context)
|
GimpContext *context)
|
||||||
{
|
{
|
||||||
if (dynamics == context->dynamics)
|
if (dynamics == context->dynamics)
|
||||||
|
@ -2546,7 +2548,7 @@ static void gimp_context_dynamics_removed (GimpContainer *container,
|
||||||
static void gimp_context_dynamics_list_thaw (GimpContainer *container,
|
static void gimp_context_dynamics_list_thaw (GimpContainer *container,
|
||||||
GimpContext *context)
|
GimpContext *context)
|
||||||
{
|
{
|
||||||
GimpDynamicsOptions *dynamics;
|
GimpDynamics *dynamics;
|
||||||
/*
|
/*
|
||||||
if (! context->dynamics_name)
|
if (! context->dynamics_name)
|
||||||
context->dynamics_name = g_strdup (context->gimp->config->default_dynamics);
|
context->dynamics_name = g_strdup (context->gimp->config->default_dynamics);
|
||||||
|
@ -2563,11 +2565,18 @@ static void
|
||||||
gimp_context_real_set_dynamics (GimpContext *context,
|
gimp_context_real_set_dynamics (GimpContext *context,
|
||||||
GimpDynamics *dynamics)
|
GimpDynamics *dynamics)
|
||||||
{
|
{
|
||||||
|
g_return_val_if_fail (GIMP_IS_DYNAMICS (dynamics), NULL);
|
||||||
|
|
||||||
if (! standard_dynamics)
|
if (! standard_dynamics)
|
||||||
|
{
|
||||||
standard_dynamics = GIMP_DYNAMICS (gimp_dynamics_get_standard ());
|
standard_dynamics = GIMP_DYNAMICS (gimp_dynamics_get_standard ());
|
||||||
|
}
|
||||||
|
|
||||||
if (context->dynamics == dynamics)
|
if (context->dynamics == dynamics)
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (context->dynamics_name && dynamics != standard_dynamics)
|
if (context->dynamics_name && dynamics != standard_dynamics)
|
||||||
{
|
{
|
||||||
|
@ -2575,7 +2584,7 @@ gimp_context_real_set_dynamics (GimpContext *context,
|
||||||
context->dynamics_name = NULL;
|
context->dynamics_name = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* disconnect from the old brush's signals */
|
/* disconnect from the old 's signals */
|
||||||
if (context->dynamics)
|
if (context->dynamics)
|
||||||
{
|
{
|
||||||
g_signal_handlers_disconnect_by_func (context->dynamics,
|
g_signal_handlers_disconnect_by_func (context->dynamics,
|
||||||
|
@ -2586,6 +2595,7 @@ gimp_context_real_set_dynamics (GimpContext *context,
|
||||||
|
|
||||||
context->dynamics = dynamics;
|
context->dynamics = dynamics;
|
||||||
|
|
||||||
|
|
||||||
if (dynamics)
|
if (dynamics)
|
||||||
{
|
{
|
||||||
g_object_ref (dynamics);
|
g_object_ref (dynamics);
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
#include "paint/paint-types.h"
|
#include "paint/paint-types.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "gimp.h"
|
#include "gimp.h"
|
||||||
#include "gimpimage.h"
|
#include "gimpimage.h"
|
||||||
#include "gimpcurve.h"
|
#include "gimpcurve.h"
|
||||||
|
@ -842,27 +841,9 @@ static void
|
||||||
gimp_dynamics_notify (GObject *object,
|
gimp_dynamics_notify (GObject *object,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
GimpDynamics *options = GIMP_DYNAMICS (object);
|
GimpDynamics *options = GIMP_DYNAMICS (object);
|
||||||
|
|
||||||
if (pspec->param_id == PROP_USE_GRADIENT)
|
|
||||||
{
|
|
||||||
if (options->gradient_options->use_gradient)
|
|
||||||
{
|
|
||||||
options->application_mode_save = options->application_mode;
|
|
||||||
options->application_mode = GIMP_PAINT_INCREMENTAL;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
options->application_mode = options->application_mode_save;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_object_notify (object, "application-mode");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (G_OBJECT_CLASS (parent_class)->notify)
|
|
||||||
G_OBJECT_CLASS (parent_class)->notify (object, pspec);
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -378,12 +378,7 @@ gimp_brush_core_start (GimpPaintCore *paint_core,
|
||||||
GimpBrush *brush;
|
GimpBrush *brush;
|
||||||
core->dynamics = gimp_context_get_dynamics (GIMP_CONTEXT (paint_options));
|
core->dynamics = gimp_context_get_dynamics (GIMP_CONTEXT (paint_options));
|
||||||
|
|
||||||
/* If context does not have dynamics object for us, lets get standard*/
|
printf("PC: %d\n", GIMP_CONTEXT (paint_options));
|
||||||
if (!core->dynamics)
|
|
||||||
{
|
|
||||||
core->dynamics = GIMP_DYNAMICS(gimp_dynamics_get_standard());
|
|
||||||
gimp_context_set_dynamics (GIMP_CONTEXT (paint_options), core->dynamics);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
brush = gimp_context_get_brush (GIMP_CONTEXT (paint_options));
|
brush = gimp_context_get_brush (GIMP_CONTEXT (paint_options));
|
||||||
|
|
|
@ -172,14 +172,6 @@ gimp_paint_options_class_init (GimpPaintOptionsClass *klass)
|
||||||
"jitter-amount", NULL,
|
"jitter-amount", NULL,
|
||||||
0.0, 50.0, DEFAULT_JITTER_AMOUNT,
|
0.0, 50.0, DEFAULT_JITTER_AMOUNT,
|
||||||
GIMP_PARAM_STATIC_STRINGS);
|
GIMP_PARAM_STATIC_STRINGS);
|
||||||
/*(object_class, PROP_RANDOM_ASPECT_RATIO,
|
|
||||||
"random-aspect-ratio", NULL,
|
|
||||||
DEFAULT_RANDOM_ASPECT_RATIO,
|
|
||||||
GIMP_PARAM_STATIC_STRINGS);
|
|
||||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_FADING_ASPECT_RATIO,
|
|
||||||
"fading-aspect-ratio", NULL,
|
|
||||||
DEFAULT_FADING_ASPECT_RATIO,
|
|
||||||
GIMP_PARAM_STATIC_STRINGS);*/
|
|
||||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_USE_GRADIENT,
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_USE_GRADIENT,
|
||||||
"use-gradient", NULL,
|
"use-gradient", NULL,
|
||||||
DEFAULT_USE_GRADIENT,
|
DEFAULT_USE_GRADIENT,
|
||||||
|
|
|
@ -37,6 +37,8 @@
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpcontext.h"
|
#include "core/gimpcontext.h"
|
||||||
|
|
||||||
|
#include "libgimpconfig/gimpconfig.h"
|
||||||
|
|
||||||
#include "gimpdocked.h"
|
#include "gimpdocked.h"
|
||||||
#include "gimpview.h"
|
#include "gimpview.h"
|
||||||
#include "gimpviewrenderer.h"
|
#include "gimpviewrenderer.h"
|
||||||
|
@ -90,9 +92,9 @@ static void gimp_dynamics_editor_set_data (GimpDataEditor *editor,
|
||||||
|
|
||||||
static void gimp_dynamics_editor_set_context (GimpDocked *docked,
|
static void gimp_dynamics_editor_set_context (GimpDocked *docked,
|
||||||
GimpContext *context);
|
GimpContext *context);
|
||||||
|
/*
|
||||||
static void gimp_dynamics_editor_update_dynamics(GtkAdjustment *adjustment,
|
static void gimp_dynamics_editor_update_dynamics(GtkAdjustment *adjustment,
|
||||||
GimpDynamicsEditor *editor);
|
GimpDynamicsEditor *editor);*/
|
||||||
|
|
||||||
static void gimp_dynamics_editor_notify_dynamics (GimpDynamics *options,
|
static void gimp_dynamics_editor_notify_dynamics (GimpDynamics *options,
|
||||||
GParamSpec *pspec,
|
GParamSpec *pspec,
|
||||||
|
@ -152,10 +154,7 @@ gimp_dynamics_editor_set_data (GimpDataEditor *editor,
|
||||||
GimpData *data)
|
GimpData *data)
|
||||||
{
|
{
|
||||||
GimpDynamicsEditor *dynamics_editor = GIMP_DYNAMICS_EDITOR (editor);
|
GimpDynamicsEditor *dynamics_editor = GIMP_DYNAMICS_EDITOR (editor);
|
||||||
//GimpBrushGeneratedShape shape = GIMP_BRUSH_GENERATED_CIRCLE;
|
|
||||||
//gdouble radius = 0.0;
|
|
||||||
|
|
||||||
gboolean pressure_hardness = DEFAULT_PRESSURE_HARDNESS;
|
|
||||||
|
|
||||||
if (editor->data)
|
if (editor->data)
|
||||||
g_signal_handlers_disconnect_by_func (editor->data,
|
g_signal_handlers_disconnect_by_func (editor->data,
|
||||||
|
@ -174,10 +173,7 @@ gimp_dynamics_editor_set_data (GimpDataEditor *editor,
|
||||||
if (editor->data && GIMP_IS_DYNAMICS (editor->data))
|
if (editor->data && GIMP_IS_DYNAMICS (editor->data))
|
||||||
{
|
{
|
||||||
GimpDynamics *options = GIMP_DYNAMICS (editor->data);
|
GimpDynamics *options = GIMP_DYNAMICS (editor->data);
|
||||||
// dynamics_editor->pressure_hardness_data = options->hardness_dynamics->pressure;
|
|
||||||
}
|
}
|
||||||
//gtk_adjustment_set_value (dynamics_editor->pressure_hardness_data, pressure_hardness );
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -186,99 +182,17 @@ gimp_dynamics_editor_notify_dynamics (GimpDynamics *options,
|
||||||
GParamSpec *pspec,
|
GParamSpec *pspec,
|
||||||
GimpDynamicsEditor *editor)
|
GimpDynamicsEditor *editor)
|
||||||
{
|
{
|
||||||
GtkAdjustment *adj = NULL;
|
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (editor);
|
||||||
gdouble value = 0.0;
|
|
||||||
/*
|
|
||||||
if (! strcmp (pspec->name, "pressure-hardness"))
|
|
||||||
{
|
|
||||||
g_signal_handlers_block_by_func (editor->pressure_hardness_data,
|
|
||||||
gimp_brush_editor_update_shape,
|
|
||||||
editor);
|
|
||||||
|
|
||||||
gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (editor->shape_group),
|
g_return_val_if_fail (GIMP_IS_CONTEXT (data_editor->context), NULL);
|
||||||
brush->shape);
|
|
||||||
|
|
||||||
g_signal_handlers_unblock_by_func (editor->shape_group,
|
GimpDynamics *context_dyn = gimp_get_user_context(data_editor->context->gimp)->dynamics;
|
||||||
gimp_brush_editor_update_shape,
|
|
||||||
editor);
|
|
||||||
|
|
||||||
adj = editor->radius_data;
|
g_return_val_if_fail (GIMP_IS_DYNAMICS (context_dyn), NULL);
|
||||||
value = brush->radius;
|
|
||||||
}
|
|
||||||
else if (! strcmp (pspec->name, "radius"))
|
|
||||||
{
|
|
||||||
adj = editor->radius_data;
|
|
||||||
value = brush->radius;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
if (adj)
|
|
||||||
{
|
|
||||||
g_signal_handlers_block_by_func (adj,
|
|
||||||
gimp_dynamics_editor_update_dynamics,
|
|
||||||
editor);
|
|
||||||
|
|
||||||
gtk_adjustment_set_value (adj, value);
|
gimp_config_copy(options, context_dyn, 0);
|
||||||
|
printf("SET to context %d\n", gimp_get_user_context(data_editor->context->gimp));
|
||||||
|
|
||||||
g_signal_handlers_unblock_by_func (adj,
|
|
||||||
gimp_dynamics_editor_update_dynamics,
|
|
||||||
editor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
gimp_dynamics_editor_update_dynamics (GtkAdjustment *adjustment,
|
|
||||||
GimpDynamicsEditor *editor)
|
|
||||||
{
|
|
||||||
GimpDynamics *dynamics;
|
|
||||||
gboolean pressure_hardness;
|
|
||||||
/*gint spikes;
|
|
||||||
gdouble hardness;
|
|
||||||
gdouble ratio;
|
|
||||||
gdouble angle;
|
|
||||||
gdouble spacing;
|
|
||||||
*/
|
|
||||||
if (! GIMP_IS_DYNAMICS (GIMP_DATA_EDITOR (editor)->data))
|
|
||||||
return;
|
|
||||||
|
|
||||||
dynamics = GIMP_DYNAMICS (GIMP_DATA_EDITOR (editor)->data);
|
|
||||||
|
|
||||||
//pressure_hardness = gtk_adjustment_get_value (editor->pressure_hardness_data);
|
|
||||||
/*spikes = ROUND (gtk_adjustment_get_value (editor->spikes_data));
|
|
||||||
hardness = gtk_adjustment_get_value (editor->hardness_data);
|
|
||||||
ratio = gtk_adjustment_get_value (editor->aspect_ratio_data);
|
|
||||||
angle = gtk_adjustment_get_value (editor->angle_data);
|
|
||||||
spacing = gtk_adjustment_get_value (editor->spacing_data);
|
|
||||||
*/
|
|
||||||
if (pressure_hardness != DEFAULT_PRESSURE_HARDNESS)
|
|
||||||
/*||
|
|
||||||
spikes != gimp_brush_generated_get_spikes (brush) ||
|
|
||||||
hardness != gimp_brush_generated_get_hardness (brush) ||
|
|
||||||
ratio != gimp_brush_generated_get_aspect_ratio (brush) ||
|
|
||||||
angle != gimp_brush_generated_get_angle (brush) ||
|
|
||||||
spacing != gimp_brush_get_spacing (GIMP_BRUSH (brush)))
|
|
||||||
*/{
|
|
||||||
g_signal_handlers_block_by_func (dynamics,
|
|
||||||
gimp_dynamics_editor_notify_dynamics,
|
|
||||||
editor);
|
|
||||||
|
|
||||||
gimp_data_freeze (GIMP_DATA (dynamics));
|
|
||||||
g_object_freeze_notify (G_OBJECT (dynamics));
|
|
||||||
/*
|
|
||||||
gimp_brush_generated_set_radius (brush, radius);
|
|
||||||
gimp_brush_generated_set_spikes (brush, spikes);
|
|
||||||
gimp_brush_generated_set_hardness (brush, hardness);
|
|
||||||
gimp_brush_generated_set_aspect_ratio (brush, ratio);
|
|
||||||
gimp_brush_generated_set_angle (brush, angle);
|
|
||||||
gimp_brush_set_spacing (GIMP_BRUSH (brush), spacing);
|
|
||||||
*/
|
|
||||||
g_object_thaw_notify (G_OBJECT (dynamics));
|
|
||||||
gimp_data_thaw (GIMP_DATA (dynamics));
|
|
||||||
|
|
||||||
g_signal_handlers_unblock_by_func (dynamics,
|
|
||||||
gimp_dynamics_editor_notify_dynamics,
|
|
||||||
editor);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -316,6 +230,11 @@ gimp_dynamics_editor_new (GimpContext *context,
|
||||||
"data", gimp_context_get_dynamics (context),
|
"data", gimp_context_get_dynamics (context),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
|
||||||
|
g_signal_connect (editor->dynamics_model, "notify",
|
||||||
|
G_CALLBACK (gimp_dynamics_editor_notify_dynamics),
|
||||||
|
editor);
|
||||||
|
|
||||||
return editor;
|
return editor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,18 +261,20 @@ gimp_dynamics_editor_init (GimpDynamicsEditor *editor)
|
||||||
|
|
||||||
GimpDynamics *dynamics = editor->dynamics_model;
|
GimpDynamics *dynamics = editor->dynamics_model;
|
||||||
|
|
||||||
|
GtkWidget *frame;
|
||||||
|
GtkWidget *box;
|
||||||
|
|
||||||
GtkWidget *vbox;
|
GtkWidget *vbox;
|
||||||
GtkWidget *table;
|
GtkWidget *table;
|
||||||
GtkWidget *label;
|
GtkWidget *label;
|
||||||
gint n_dynamics = 0;
|
gint n_dynamics = 0;
|
||||||
GtkWidget *dynamics_labels[7];
|
GtkWidget *dynamics_labels[7];
|
||||||
//GObject *config = get_config_value (editor);
|
|
||||||
//GObject *config = G_OBJECT(editor->data);
|
|
||||||
GObject *config = G_OBJECT(dynamics);
|
GObject *config = G_OBJECT(dynamics);
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 6);
|
frame = gtk_frame_new (NULL);
|
||||||
gtk_box_pack_start (GTK_BOX (data_editor), vbox, TRUE, TRUE, 0);
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||||
gtk_widget_show (vbox);
|
gtk_box_pack_start (GTK_BOX (editor), frame, TRUE, TRUE, 0);
|
||||||
|
gtk_widget_show (frame);
|
||||||
|
|
||||||
data_editor->view = gimp_view_new_full_by_types (NULL,
|
data_editor->view = gimp_view_new_full_by_types (NULL,
|
||||||
GIMP_TYPE_VIEW,
|
GIMP_TYPE_VIEW,
|
||||||
|
@ -361,11 +282,19 @@ gimp_dynamics_editor_init (GimpDynamicsEditor *editor)
|
||||||
DYNAMICS_VIEW_SIZE,
|
DYNAMICS_VIEW_SIZE,
|
||||||
DYNAMICS_VIEW_SIZE, 0,
|
DYNAMICS_VIEW_SIZE, 0,
|
||||||
FALSE, FALSE, TRUE);
|
FALSE, FALSE, TRUE);
|
||||||
|
|
||||||
gtk_widget_set_size_request (data_editor->view, -1, DYNAMICS_VIEW_SIZE);
|
gtk_widget_set_size_request (data_editor->view, -1, DYNAMICS_VIEW_SIZE);
|
||||||
gimp_view_set_expand (GIMP_VIEW (data_editor->view), TRUE);
|
gimp_view_set_expand (GIMP_VIEW (data_editor->view), TRUE);
|
||||||
gtk_container_add (GTK_CONTAINER (vbox), data_editor->view);
|
gtk_container_add (GTK_CONTAINER (frame), data_editor->view);
|
||||||
gtk_widget_show (data_editor->view);
|
gtk_widget_show (data_editor->view);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
vbox = gtk_vbox_new (FALSE, 6);
|
||||||
|
gtk_container_add (GTK_CONTAINER (data_editor->view), vbox);
|
||||||
|
//gtk_box_pack_start (GTK_BOX (data_editor), vbox, TRUE, TRUE, 0);
|
||||||
|
gtk_widget_show (vbox);
|
||||||
|
|
||||||
//n_dynamics = 5;
|
//n_dynamics = 5;
|
||||||
|
|
||||||
dynamics_labels[n_dynamics] = gtk_label_new (_("Opacity"));
|
dynamics_labels[n_dynamics] = gtk_label_new (_("Opacity"));
|
||||||
|
|
Loading…
Reference in New Issue