Renaming GimpDynamicsOptions to GimpDynamics and moving from paint/ to core/. A BIG change.

This commit is contained in:
Alexia Death 2009-08-20 04:25:26 +03:00
parent 9fa9f41106
commit 93f8216881
12 changed files with 206 additions and 203 deletions

View File

@ -167,6 +167,8 @@ libappcore_a_sources = \
gimpdrawablestack.h \
gimpdrawableundo.c \
gimpdrawableundo.h \
gimpdynamics.c \
gimpdynamics.h \
gimperror.c \
gimperror.h \
gimpfilloptions.c \

View File

@ -75,7 +75,7 @@
#include "gimptemplate.h"
#include "gimptoolinfo.h"
#include "paint/gimpdynamicsoptions.h"
#include "gimpdynamics.h"
#include "gimp-intl.h"
@ -589,11 +589,11 @@ gimp_real_initialize (Gimp *gimp,
gimp->dynamics_factory =
gimp_data_factory_new (gimp,
GIMP_TYPE_DYNAMICS_OPTIONS,
GIMP_TYPE_DYNAMICS,
"dynamics-path", "dynamics-path-writable",
dynamics_loader_entries,
G_N_ELEMENTS (dynamics_loader_entries),
gimp_dynamics_options_new,
gimp_dynamics_new,
gimp_dynamics_get_standard);
gimp_object_set_static_name (GIMP_OBJECT (gimp->dynamics_factory),
"dynamics factory");

View File

@ -134,7 +134,7 @@ struct _GimpClass
/* emitted if an image is loaded and opened with a display */
void (* image_opened) (Gimp *gimp,
const gchar *uri);
const gchar *uri);
};
@ -203,7 +203,7 @@ void gimp_message_literal (Gimp *gimp,
const gchar *message);
void gimp_image_opened (Gimp *gimp,
const gchar *uri);
const gchar *uri);
gboolean gimp_use_gegl (Gimp *gimp);

View File

@ -47,7 +47,8 @@
#include "gimptemplate.h"
#include "gimptoolinfo.h"
#include "paint/gimpdynamicsoptions.h"
#include "gimpdynamics.h"
#include "text/gimpfont.h"
#include "gimp-intl.h"
@ -171,7 +172,7 @@ static void gimp_context_dynamics_removed (GimpContainer *container,
static void gimp_context_dynamics_list_thaw (GimpContainer *container,
GimpContext *context);
static void gimp_context_real_set_dynamics (GimpContext *context,
GimpDynamicsOptions *dynamics);
GimpDynamics *dynamics);
/* pattern */
static void gimp_context_pattern_dirty (GimpPattern *pattern,
@ -466,7 +467,7 @@ gimp_context_class_init (GimpContextClass *klass)
NULL, NULL,
gimp_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
GIMP_TYPE_DYNAMICS_OPTIONS);
GIMP_TYPE_DYNAMICS);
gimp_context_signals[PATTERN_CHANGED] =
g_signal_new ("pattern-changed",
@ -568,7 +569,7 @@ gimp_context_class_init (GimpContextClass *klass)
gimp_context_prop_types[GIMP_CONTEXT_PROP_TOOL] = GIMP_TYPE_TOOL_INFO;
gimp_context_prop_types[GIMP_CONTEXT_PROP_PAINT_INFO] = GIMP_TYPE_PAINT_INFO;
gimp_context_prop_types[GIMP_CONTEXT_PROP_BRUSH] = GIMP_TYPE_BRUSH;
gimp_context_prop_types[GIMP_CONTEXT_PROP_DYNAMICS] = GIMP_TYPE_DYNAMICS_OPTIONS;
gimp_context_prop_types[GIMP_CONTEXT_PROP_DYNAMICS] = GIMP_TYPE_DYNAMICS;
gimp_context_prop_types[GIMP_CONTEXT_PROP_PATTERN] = GIMP_TYPE_PATTERN;
gimp_context_prop_types[GIMP_CONTEXT_PROP_GRADIENT] = GIMP_TYPE_GRADIENT;
gimp_context_prop_types[GIMP_CONTEXT_PROP_PALETTE] = GIMP_TYPE_PALETTE;
@ -642,7 +643,7 @@ gimp_context_class_init (GimpContextClass *klass)
GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, GIMP_CONTEXT_PROP_DYNAMICS,
gimp_context_prop_names[GIMP_CONTEXT_PROP_DYNAMICS],
NULL,
GIMP_TYPE_DYNAMICS_OPTIONS,
GIMP_TYPE_DYNAMICS,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, GIMP_CONTEXT_PROP_PATTERN,
@ -2499,7 +2500,7 @@ gimp_context_set_dynamics (GimpContext *context,
GimpDynamicsOptions *dynamics)
{
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (! dynamics || GIMP_IS_DYNAMICS_OPTIONS (dynamics));
g_return_if_fail (! dynamics || GIMP_IS_DYNAMICS (dynamics));
context_find_defined (context, GIMP_CONTEXT_PROP_DYNAMICS);
gimp_context_real_set_dynamics (context, dynamics);
@ -2560,10 +2561,10 @@ static void gimp_context_dynamics_list_thaw (GimpContainer *container,
static void
gimp_context_real_set_dynamics (GimpContext *context,
GimpDynamicsOptions *dynamics)
GimpDynamics *dynamics)
{
if (! standard_dynamics)
standard_dynamics = GIMP_DYNAMICS_OPTIONS (gimp_dynamics_get_standard ());
standard_dynamics = GIMP_DYNAMICS (gimp_dynamics_get_standard ());
if (context->dynamics == dynamics)
return;

View File

@ -23,7 +23,7 @@
#include "gimpobject.h"
#include "gimpdynamics.h"
#define GIMP_TYPE_CONTEXT (gimp_context_get_type ())
#define GIMP_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_CONTEXT, GimpContext))
@ -64,7 +64,7 @@ struct _GimpContext
GimpBrush *brush;
gchar *brush_name;
GimpDynamicsOptions *dynamics;
GimpDynamics *dynamics;
gchar *dynamics_name;
GimpPattern *pattern;

View File

@ -23,17 +23,17 @@
#include "libgimpmath/gimpmath.h"
#include "libgimpconfig/gimpconfig.h"
#include "paint-types.h"
#include "paint/paint-types.h"
#include "core/gimp.h"
#include "core/gimpimage.h"
#include "core/gimpcurve.h"
#include "gimp.h"
#include "gimpimage.h"
#include "gimpcurve.h"
#include "gimpdynamicsoptions.h"
#include "gimpdynamics.h"
#include "core/gimpdata.h"
#include "gimpdata.h"
#include "gimp-intl.h"
@ -140,50 +140,50 @@ enum
PROP_FADING_ANGLE,
};
static void gimp_dynamics_options_class_init (GimpDynamicsOptionsClass *klass);
static void gimp_dynamics_class_init (GimpDynamicsClass *klass);
static void gimp_dynamics_options_finalize (GObject *object);
static void gimp_dynamics_finalize (GObject *object);
static void gimp_dynamics_options_notify (GObject *object,
static void gimp_dynamics_notify (GObject *object,
GParamSpec *pspec);
static void gimp_dynamics_options_set_property (GObject *object,
static void gimp_dynamics_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_dynamics_options_get_property (GObject *object,
static void gimp_dynamics_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_dynamics_options_curves_init (GimpDynamicOutputOptions *dynamics);
static void gimp_dynamics_curves_init (GimpDynamicsOutput *dynamics);
static void gimp_dynamics_options_curves_finalize (GimpDynamicOutputOptions *dynamics);
static void gimp_dynamics_curves_finalize (GimpDynamicsOutput *dynamics);
/*
G_DEFINE_TYPE_WITH_CODE (GimpDynamicsOptions, gimp_dynamics_options, GIMP_TYPE_DATA,
G_DEFINE_TYPE_WITH_CODE (GimpDynamics, gimp_dynamics, GIMP_TYPE_DATA,
G_IMPLEMENT_INTERFACE (GIMP_TYPE_DOCKED,
gimp_dynamics_editor_docked_iface_init))
*/
G_DEFINE_TYPE (GimpDynamicsOptions, gimp_dynamics_options,
G_DEFINE_TYPE (GimpDynamics, gimp_dynamics,
GIMP_TYPE_DATA)
#define parent_class gimp_dynamics_options_parent_class
#define parent_class gimp_dynamics_parent_class
static void
gimp_dynamics_options_class_init (GimpDynamicsOptionsClass *klass)
gimp_dynamics_class_init (GimpDynamicsClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gimp_dynamics_options_finalize;
object_class->set_property = gimp_dynamics_options_set_property;
object_class->get_property = gimp_dynamics_options_get_property;
object_class->notify = gimp_dynamics_options_notify;
object_class->finalize = gimp_dynamics_finalize;
object_class->set_property = gimp_dynamics_set_property;
object_class->get_property = gimp_dynamics_get_property;
object_class->notify = gimp_dynamics_notify;
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_RANDOM_ASPECT_RATIO,
@ -363,65 +363,65 @@ gimp_dynamics_options_class_init (GimpDynamicsOptionsClass *klass)
}
static void
gimp_dynamics_options_init (GimpDynamicsOptions *options)
gimp_dynamics_init (GimpDynamics *options)
{
options->opacity_dynamics = g_slice_new0 (GimpDynamicOutputOptions);
gimp_dynamics_options_curves_init(options->opacity_dynamics);
options->opacity_dynamics = g_slice_new0 (GimpDynamicsOutput);
gimp_dynamics_curves_init(options->opacity_dynamics);
options->hardness_dynamics = g_slice_new0 (GimpDynamicOutputOptions);
gimp_dynamics_options_curves_init(options->hardness_dynamics);
options->hardness_dynamics = g_slice_new0 (GimpDynamicsOutput);
gimp_dynamics_curves_init(options->hardness_dynamics);
options->rate_dynamics = g_slice_new0 (GimpDynamicOutputOptions);
gimp_dynamics_options_curves_init(options->rate_dynamics);
options->rate_dynamics = g_slice_new0 (GimpDynamicsOutput);
gimp_dynamics_curves_init(options->rate_dynamics);
options->size_dynamics = g_slice_new0 (GimpDynamicOutputOptions);
gimp_dynamics_options_curves_init(options->size_dynamics);
options->size_dynamics = g_slice_new0 (GimpDynamicsOutput);
gimp_dynamics_curves_init(options->size_dynamics);
options->aspect_ratio_dynamics = g_slice_new0 (GimpDynamicOutputOptions);
gimp_dynamics_options_curves_init(options->aspect_ratio_dynamics);
options->aspect_ratio_dynamics = g_slice_new0 (GimpDynamicsOutput);
gimp_dynamics_curves_init(options->aspect_ratio_dynamics);
options->color_dynamics = g_slice_new0 (GimpDynamicOutputOptions);
gimp_dynamics_options_curves_init(options->color_dynamics);
options->color_dynamics = g_slice_new0 (GimpDynamicsOutput);
gimp_dynamics_curves_init(options->color_dynamics);
options->angle_dynamics = g_slice_new0 (GimpDynamicOutputOptions);
gimp_dynamics_options_curves_init(options->angle_dynamics);
options->angle_dynamics = g_slice_new0 (GimpDynamicsOutput);
gimp_dynamics_curves_init(options->angle_dynamics);
}
static void
gimp_dynamics_options_finalize (GObject *object)
gimp_dynamics_finalize (GObject *object)
{
GimpDynamicsOptions *options = GIMP_DYNAMICS_OPTIONS (object);
GimpDynamics *options = GIMP_DYNAMICS (object);
gimp_dynamics_options_curves_finalize (options->opacity_dynamics);
g_slice_free (GimpDynamicOutputOptions, options->opacity_dynamics);
gimp_dynamics_curves_finalize (options->opacity_dynamics);
g_slice_free (GimpDynamicsOutput, options->opacity_dynamics);
gimp_dynamics_options_curves_finalize (options->hardness_dynamics);
g_slice_free (GimpDynamicOutputOptions, options->hardness_dynamics);
gimp_dynamics_curves_finalize (options->hardness_dynamics);
g_slice_free (GimpDynamicsOutput, options->hardness_dynamics);
gimp_dynamics_options_curves_finalize (options->rate_dynamics);
g_slice_free (GimpDynamicOutputOptions, options->rate_dynamics);
gimp_dynamics_curves_finalize (options->rate_dynamics);
g_slice_free (GimpDynamicsOutput, options->rate_dynamics);
gimp_dynamics_options_curves_finalize (options->size_dynamics);
g_slice_free (GimpDynamicOutputOptions, options->size_dynamics);
gimp_dynamics_curves_finalize (options->size_dynamics);
g_slice_free (GimpDynamicsOutput, options->size_dynamics);
gimp_dynamics_options_curves_finalize (options->aspect_ratio_dynamics);
g_slice_free (GimpDynamicOutputOptions, options->aspect_ratio_dynamics);
gimp_dynamics_curves_finalize (options->aspect_ratio_dynamics);
g_slice_free (GimpDynamicsOutput, options->aspect_ratio_dynamics);
gimp_dynamics_options_curves_finalize (options->color_dynamics);
g_slice_free (GimpDynamicOutputOptions, options->color_dynamics);
gimp_dynamics_curves_finalize (options->color_dynamics);
g_slice_free (GimpDynamicsOutput, options->color_dynamics);
gimp_dynamics_options_curves_finalize (options->angle_dynamics);
g_slice_free (GimpDynamicOutputOptions, options->angle_dynamics);
gimp_dynamics_curves_finalize (options->angle_dynamics);
g_slice_free (GimpDynamicsOutput, options->angle_dynamics);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gimp_dynamics_options_curves_init (GimpDynamicOutputOptions *dynamics)
gimp_dynamics_curves_init (GimpDynamicsOutput *dynamics)
{
dynamics->pressure_curve = g_object_new (GIMP_TYPE_CURVE,
"name", "Pressure curve",
@ -444,7 +444,7 @@ gimp_dynamics_options_curves_init (GimpDynamicOutputOptions *dynamics)
}
static void
gimp_dynamics_options_curves_finalize (GimpDynamicOutputOptions *dynamics)
gimp_dynamics_curves_finalize (GimpDynamicsOutput *dynamics)
{
g_object_unref(dynamics->pressure_curve);
@ -462,20 +462,20 @@ gimp_dynamics_options_curves_finalize (GimpDynamicOutputOptions *dynamics)
static void
gimp_dynamics_options_set_property (GObject *object,
gimp_dynamics_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
GimpDynamicsOptions *options = GIMP_DYNAMICS_OPTIONS (object);
GimpDynamics *options = GIMP_DYNAMICS (object);
GimpDynamicOutputOptions *opacity_dynamics = options->opacity_dynamics;
GimpDynamicOutputOptions *hardness_dynamics = options->hardness_dynamics;
GimpDynamicOutputOptions *rate_dynamics = options->rate_dynamics;
GimpDynamicOutputOptions *size_dynamics = options->size_dynamics;
GimpDynamicOutputOptions *aspect_ratio_dynamics = options->aspect_ratio_dynamics;
GimpDynamicOutputOptions *color_dynamics = options->color_dynamics;
GimpDynamicOutputOptions *angle_dynamics = options->angle_dynamics;
GimpDynamicsOutput *opacity_dynamics = options->opacity_dynamics;
GimpDynamicsOutput *hardness_dynamics = options->hardness_dynamics;
GimpDynamicsOutput *rate_dynamics = options->rate_dynamics;
GimpDynamicsOutput *size_dynamics = options->size_dynamics;
GimpDynamicsOutput *aspect_ratio_dynamics = options->aspect_ratio_dynamics;
GimpDynamicsOutput *color_dynamics = options->color_dynamics;
GimpDynamicsOutput *angle_dynamics = options->angle_dynamics;
switch (property_id)
{
@ -660,19 +660,19 @@ gimp_dynamics_options_set_property (GObject *object,
static void
gimp_dynamics_options_get_property (GObject *object,
gimp_dynamics_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
GimpDynamicsOptions *options = GIMP_DYNAMICS_OPTIONS (object);
GimpDynamicOutputOptions *opacity_dynamics = options->opacity_dynamics;
GimpDynamicOutputOptions *hardness_dynamics = options->hardness_dynamics;
GimpDynamicOutputOptions *rate_dynamics = options->rate_dynamics;
GimpDynamicOutputOptions *size_dynamics = options->size_dynamics;
GimpDynamicOutputOptions *aspect_ratio_dynamics = options->aspect_ratio_dynamics;
GimpDynamicOutputOptions *color_dynamics = options->color_dynamics;
GimpDynamicOutputOptions *angle_dynamics = options->angle_dynamics;
GimpDynamics *options = GIMP_DYNAMICS (object);
GimpDynamicsOutput *opacity_dynamics = options->opacity_dynamics;
GimpDynamicsOutput *hardness_dynamics = options->hardness_dynamics;
GimpDynamicsOutput *rate_dynamics = options->rate_dynamics;
GimpDynamicsOutput *size_dynamics = options->size_dynamics;
GimpDynamicsOutput *aspect_ratio_dynamics = options->aspect_ratio_dynamics;
GimpDynamicsOutput *color_dynamics = options->color_dynamics;
GimpDynamicsOutput *angle_dynamics = options->angle_dynamics;
switch (property_id)
{
@ -856,11 +856,11 @@ gimp_dynamics_options_get_property (GObject *object,
static void
gimp_dynamics_options_notify (GObject *object,
gimp_dynamics_notify (GObject *object,
GParamSpec *pspec)
{
/*
GimpDynamicsOptions *options = GIMP_DYNAMICS_OPTIONS (object);
GimpDynamics *options = GIMP_DYNAMICS (object);
if (pspec->param_id == PROP_USE_GRADIENT)
{
@ -884,11 +884,11 @@ gimp_dynamics_options_notify (GObject *object,
}
GimpData *
gimp_dynamics_options_new (const gchar *name)
gimp_dynamics_new (const gchar *name)
{
GimpDynamicsOptions *options;
GimpDynamics *options;
options = g_object_new (GIMP_TYPE_DYNAMICS_OPTIONS,
options = g_object_new (GIMP_TYPE_DYNAMICS,
"name", name,
NULL);
@ -903,7 +903,7 @@ gimp_dynamics_get_standard (void)
if (! standard_dynamics)
{
standard_dynamics = gimp_dynamics_options_new ("Standard");
standard_dynamics = gimp_dynamics_new ("Standard");
standard_dynamics->dirty = FALSE;
gimp_data_make_internal (standard_dynamics,
@ -916,7 +916,7 @@ gimp_dynamics_get_standard (void)
}
gdouble
gimp_dynamics_options_get_output_val (GimpDynamicOutputOptions *output, GimpCoords *coords)
gimp_dynamics_get_output_val (GimpDynamicsOutput *output, GimpCoords *coords)
{
printf("Dynamics queried...");
return 1;

92
app/core/gimpdynamics.h Normal file
View File

@ -0,0 +1,92 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_DYNAMICS_H__
#define __GIMP_DYNAMICS_H__
#include "core/gimpdata.h"
#include "gimpcurve.h"
typedef struct _GimpDynamicsOutput GimpDynamicsOutput;
struct _GimpDynamicsOutput
{
gboolean pressure;
gboolean velocity;
gboolean direction;
gboolean tilt;
gboolean random;
gboolean fade;
gdouble fade_length;
GimpCurve* pressure_curve;
GimpCurve* velocity_curve;
GimpCurve* direction_curve;
GimpCurve* tilt_curve;
GimpCurve* random_curve;
GimpCurve* fade_curve;
};
#define GIMP_PAINT_PRESSURE_SCALE 1.5
#define GIMP_PAINT_VELOCITY_SCALE 1.0
#define GIMP_TYPE_DYNAMICS (gimp_dynamics_get_type ())
#define GIMP_DYNAMICS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_DYNAMICS, GimpDynamics))
#define GIMP_DYNAMICS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_DYNAMICS, GimpDynamicsClass))
#define GIMP_IS_DYNAMICS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_DYNAMICS))
#define GIMP_IS_DYNAMICS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_DYNAMICS))
#define GIMP_DYNAMICS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_DYNAMICS, GimpDynamicsClass))
typedef struct _GimpDynamics GimpDynamics;
struct _GimpDynamics
{
GimpDataClass parent_instance;
GimpDynamicsOutput* opacity_dynamics;
GimpDynamicsOutput* hardness_dynamics;
GimpDynamicsOutput* rate_dynamics;
GimpDynamicsOutput* size_dynamics;
GimpDynamicsOutput* aspect_ratio_dynamics;
GimpDynamicsOutput* color_dynamics;
GimpDynamicsOutput* angle_dynamics;
};
typedef struct _GimpDynamicsClass GimpDynamicsClass;
struct _GimpDynamicsClass
{
GimpDataClass parent_instance;
};
GType gimp_dynamics_get_type (void) G_GNUC_CONST;
GimpData * gimp_dynamics_new (const gchar *name);
GimpData * gimp_dynamics_get_standard (void);
gdouble gimp_dynamics_get_output_val (GimpDynamicsOutput *output, GimpCoords *coords);
#endif /* __GIMP_DYNAMICS_OPTIONS_H__ */

View File

@ -60,8 +60,6 @@ libapppaint_a_sources = \
gimppaintcoreundo.h \
gimppaintoptions.c \
gimppaintoptions.h \
gimpdynamicsoptions.c \
gimpdynamicsoptions.h \
gimppencil.c \
gimppencil.h \
gimppenciloptions.c \

View File

@ -36,11 +36,12 @@
#include "core/gimperror.h"
#include "core/gimpimage.h"
#include "core/gimpmarshal.h"
#include "core/gimpdynamics.h"
#include "gimpbrushcore.h"
#include "gimpbrushcore-kernels.h"
#include "gimppaintoptions.h"
#include "gimpdynamicsoptions.h"
#include "gimp-intl.h"
@ -87,8 +88,8 @@ static TempBuf *gimp_brush_core_get_paint_area (GimpPaintCore *paint_core
static void gimp_brush_core_real_set_brush (GimpBrushCore *core,
GimpBrush *brush);
static void gimp_brush_core_real_set_dynamics (GimpBrushCore *core,
GimpDynamicsOptions *dynamics);
static void gimp_brush_core_real_set_dynamics (GimpBrushCore *core,
GimpDynamics *dynamics);
static inline void rotate_pointers (gulong **p,
guint32 n);
@ -160,7 +161,7 @@ gimp_brush_core_class_init (GimpBrushCoreClass *klass)
NULL, NULL,
gimp_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
GIMP_TYPE_DYNAMICS_OPTIONS);
GIMP_TYPE_DYNAMICS);
object_class->finalize = gimp_brush_core_finalize;
@ -744,7 +745,7 @@ gimp_brush_core_get_paint_area (GimpPaintCore *paint_core,
core->scale = paint_options->brush_scale;
if (core->dynamics)
{
core->scale *= gimp_dynamics_options_get_output_val(core->dynamics->size_dynamics, coords);
core->scale *= gimp_dynamics_get_output_val(core->dynamics->size_dynamics, coords);
}
core->angle = paint_options->brush_angle; /* gimp_paint_options_get_dynamic_angle (paint_options, coords,
@ -825,7 +826,7 @@ gimp_brush_core_real_set_brush (GimpBrushCore *core,
static void
gimp_brush_core_real_set_dynamics (GimpBrushCore *core,
GimpDynamicsOptions *dynamics)
GimpDynamics *dynamics)
{
if (core->dynamics)
{
@ -849,11 +850,11 @@ gimp_brush_core_set_brush (GimpBrushCore *core,
}
void
gimp_brush_core_set_dynamics (GimpBrushCore *core,
GimpDynamicsOptions *dynamics)
gimp_brush_core_set_dynamics (GimpBrushCore *core,
GimpDynamics *dynamics)
{
g_return_if_fail (GIMP_IS_BRUSH_CORE (core));
g_return_if_fail (dynamics == NULL || GIMP_IS_DYNAMICS_OPTIONS (dynamics));
g_return_if_fail (dynamics == NULL || GIMP_IS_DYNAMICS (dynamics));
g_signal_emit (core, core_signals[SET_DYNAMICS], 0, dynamics);
}

View File

@ -20,7 +20,7 @@
#include "gimppaintcore.h"
#include "core/gimpdynamics.h"
#define BRUSH_CORE_SUBSAMPLE 4
#define BRUSH_CORE_SOLID_SUBSAMPLE 2
@ -43,7 +43,7 @@ struct _GimpBrushCore
GimpBrush *main_brush;
GimpBrush *brush;
GimpDynamicsOptions *dynamics;
GimpDynamics *dynamics;
gdouble spacing;
gdouble scale;
gdouble angle;
@ -101,7 +101,7 @@ struct _GimpBrushCoreClass
void (* set_brush) (GimpBrushCore *core,
GimpBrush *brush);
void (* set_dynamics) (GimpBrushCore *core,
GimpDynamicsOptions *brush);
GimpDynamics *brush);
};
@ -112,7 +112,7 @@ void gimp_brush_core_set_brush (GimpBrushCore *core,
GimpBrush *brush);
void gimp_brush_core_set_dynamics (GimpBrushCore *core,
GimpDynamicsOptions *dynamics);
GimpDynamics *dynamics);
void gimp_brush_core_create_bound_segs (GimpBrushCore *core,
GimpPaintOptions *options);

View File

@ -1,91 +0,0 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_DYNAMICS_OPTIONS_H__
#define __GIMP_DYNAMICS_OPTIONS_H__
#include "gimppaintoptions.h"
#include "core/gimpdata.h"
typedef struct _GimpDynamicOutputOptions GimpDynamicOutputOptions;
struct _GimpDynamicOutputOptions
{
gboolean pressure;
gboolean velocity;
gboolean direction;
gboolean tilt;
gboolean random;
gboolean fade;
gdouble fade_length;
GimpCurve* pressure_curve;
GimpCurve* velocity_curve;
GimpCurve* direction_curve;
GimpCurve* tilt_curve;
GimpCurve* random_curve;
GimpCurve* fade_curve;
};
#define GIMP_PAINT_PRESSURE_SCALE 1.5
#define GIMP_PAINT_VELOCITY_SCALE 1.0
#define GIMP_TYPE_DYNAMICS_OPTIONS (gimp_dynamics_options_get_type ())
#define GIMP_DYNAMICS_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_DYNAMICS_OPTIONS, GimpDynamicsOptions))
#define GIMP_DYNAMICS_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_DYNAMICS_OPTIONS, GimpDynamicsOptionsClass))
#define GIMP_IS_DYNAMICS_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_DYNAMICS_OPTIONS))
#define GIMP_IS_DYNAMICS_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_DYNAMICS_OPTIONS))
#define GIMP_DYNAMICS_OPTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_DYNAMICS_OPTIONS, GimpDynamicsOptionsClass))
typedef struct _GimpDynamicsOptionsClass GimpDynamicsOptionsClass;
struct _GimpDynamicsOptions
{
GimpDataClass parent_instance;
GimpDynamicOutputOptions* opacity_dynamics;
GimpDynamicOutputOptions* hardness_dynamics;
GimpDynamicOutputOptions* rate_dynamics;
GimpDynamicOutputOptions* size_dynamics;
GimpDynamicOutputOptions* aspect_ratio_dynamics;
GimpDynamicOutputOptions* color_dynamics;
GimpDynamicOutputOptions* angle_dynamics;
};
struct _GimpDynamicsOptionsClass
{
GimpDataClass parent_instance;
};
GType gimp_dynamics_options_get_type (void) G_GNUC_CONST;
GimpData * gimp_dynamics_options_new (const gchar *name);
GimpData * gimp_dynamics_get_standard (void);
gdouble gimp_dynamics_options_get_output_val (GimpDynamicOutputOptions *output, GimpCoords *coords);
#endif /* __GIMP_DYNAMICS_OPTIONS_H__ */

View File

@ -43,7 +43,7 @@
#include "gimpmenufactory.h"
#include "widgets/gimpdynamicseditor.h"
#include "paint/gimpdynamicsoptions.h"
#include "core/gimpdynamics.h"
#include "core/gimpbrush.h"
//To do:
// discard unneeded ones.
@ -194,7 +194,7 @@ gimp_dynamics_editor_init (GimpDynamicsEditor *editor)
data_editor->view = gimp_view_new_full_by_types (NULL,
GIMP_TYPE_VIEW,
GIMP_TYPE_DYNAMICS_OPTIONS,
GIMP_TYPE_DYNAMICS,
DYNAMICS_VIEW_SIZE,
DYNAMICS_VIEW_SIZE, 0,
FALSE, FALSE, TRUE);
@ -286,7 +286,7 @@ gimp_dynamics_editor_new (GimpContext *context,
"data", gimp_context_get_dynamics (context),
NULL);
/*
GtkWidget *vbox;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *menu;
GtkWidget *label;