gimppaintoptions.h 6.93 KB
Newer Older
1
/* GIMP - The GNU Image Manipulation Program
2 3
 * Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
 *
4
 * This program is free software: you can redistribute it and/or modify
5
 * it under the terms of the GNU General Public License as published by
6
 * the Free Software Foundation; either version 3 of the License, or
7 8 9 10 11 12 13 14
 * (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
15
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
16 17 18 19 20 21
 */

#ifndef __GIMP_PAINT_OPTIONS_H__
#define __GIMP_PAINT_OPTIONS_H__


22 23 24
#include "core/gimptooloptions.h"


25 26 27 28 29 30 31
#define GIMP_PAINT_OPTIONS_CONTEXT_MASK GIMP_CONTEXT_PROP_MASK_FOREGROUND | \
                                        GIMP_CONTEXT_PROP_MASK_BACKGROUND | \
                                        GIMP_CONTEXT_PROP_MASK_OPACITY    | \
                                        GIMP_CONTEXT_PROP_MASK_PAINT_MODE | \
                                        GIMP_CONTEXT_PROP_MASK_BRUSH      | \
                                        GIMP_CONTEXT_PROP_MASK_DYNAMICS   | \
                                        GIMP_CONTEXT_PROP_MASK_PALETTE
32 33


34 35 36 37
typedef struct _GimpJitterOptions        GimpJitterOptions;
typedef struct _GimpFadeOptions          GimpFadeOptions;
typedef struct _GimpGradientPaintOptions GimpGradientPaintOptions;
typedef struct _GimpSmoothingOptions     GimpSmoothingOptions;
38

39 40 41 42 43
struct _GimpJitterOptions
{
  gboolean  use_jitter;
  gdouble   jitter_amount;
};
44

45
struct _GimpFadeOptions
46
{
47 48 49 50
  gboolean        fade_reverse;
  gdouble         fade_length;
  GimpUnit        fade_unit;
  GimpRepeatMode  fade_repeat;
51
};
52

53
struct _GimpGradientPaintOptions
54
{
55 56
  gboolean                    gradient_reverse;
  GimpGradientBlendColorSpace gradient_blend_color_space;
57
  GimpRepeatMode              gradient_repeat; /* only used by gradient tool */
58 59
};

60 61 62
struct _GimpSmoothingOptions
{
  gboolean use_smoothing;
63
  gint     smoothing_quality;
64 65 66
  gdouble  smoothing_factor;
};

67

68 69 70 71 72 73 74 75 76 77
#define GIMP_TYPE_PAINT_OPTIONS            (gimp_paint_options_get_type ())
#define GIMP_PAINT_OPTIONS(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PAINT_OPTIONS, GimpPaintOptions))
#define GIMP_PAINT_OPTIONS_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PAINT_OPTIONS, GimpPaintOptionsClass))
#define GIMP_IS_PAINT_OPTIONS(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_PAINT_OPTIONS))
#define GIMP_IS_PAINT_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PAINT_OPTIONS))
#define GIMP_PAINT_OPTIONS_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_PAINT_OPTIONS, GimpPaintOptionsClass))


typedef struct _GimpPaintOptionsClass GimpPaintOptionsClass;

78 79
struct _GimpPaintOptions
{
80
  GimpToolOptions           parent_instance;
81

82 83
  GimpPaintInfo            *paint_info;

84 85
  gboolean                  use_applicator;

86 87
  GimpBrush                *brush; /* weak-refed storage for the GUI */

88
  gdouble                   brush_size;
89
  gdouble                   brush_angle;
90
  gdouble                   brush_aspect_ratio;
91
  gdouble                   brush_spacing;
92 93
  gdouble                   brush_hardness;
  gdouble                   brush_force;
94

95 96 97 98 99 100
  gboolean                  brush_link_size;
  gboolean                  brush_link_aspect_ratio;
  gboolean                  brush_link_angle;
  gboolean                  brush_link_spacing;
  gboolean                  brush_link_hardness;

101 102
  gboolean                  brush_lock_to_view;

103 104
  GimpPaintApplicationMode  application_mode;
  GimpPaintApplicationMode  application_mode_save;
105

106 107
  gboolean                  hard;

108
  GimpJitterOptions        *jitter_options;
109

110
  gboolean                  dynamics_expanded;
111
  GimpFadeOptions          *fade_options;
112
  GimpGradientPaintOptions *gradient_options;
113
  GimpSmoothingOptions     *smoothing_options;
114 115 116

  GimpViewType              brush_view_type;
  GimpViewSize              brush_view_size;
117 118
  GimpViewType              dynamics_view_type;
  GimpViewSize              dynamics_view_size;
119 120 121 122
  GimpViewType              pattern_view_type;
  GimpViewSize              pattern_view_size;
  GimpViewType              gradient_view_type;
  GimpViewSize              gradient_view_size;
123 124
};

125 126 127 128
struct _GimpPaintOptionsClass
{
  GimpToolOptionsClass  parent_instance;
};
129 130


131
GType    gimp_paint_options_get_type (void) G_GNUC_CONST;
132

133 134
GimpPaintOptions *
         gimp_paint_options_new                (GimpPaintInfo       *paint_info);
135

136 137 138
gdouble  gimp_paint_options_get_fade           (GimpPaintOptions    *options,
                                                GimpImage           *image,
                                                gdouble              pixel_dist);
139

140 141
gdouble  gimp_paint_options_get_jitter         (GimpPaintOptions    *options,
                                                GimpImage           *image);
142

143 144 145 146 147
gboolean gimp_paint_options_get_gradient_color (GimpPaintOptions    *options,
                                                GimpImage           *image,
                                                gdouble              grad_point,
                                                gdouble              pixel_dist,
                                                GimpRGB             *color);
148

149
GimpBrushApplicationMode
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
         gimp_paint_options_get_brush_mode     (GimpPaintOptions    *options);

void     gimp_paint_options_set_default_brush_size
                                               (GimpPaintOptions    *options,
                                                GimpBrush           *brush);
void     gimp_paint_options_set_default_brush_angle
                                               (GimpPaintOptions    *options,
                                                GimpBrush           *brush);
void     gimp_paint_options_set_default_brush_aspect_ratio
                                               (GimpPaintOptions    *options,
                                                GimpBrush           *brush);
void     gimp_paint_options_set_default_brush_spacing
                                               (GimpPaintOptions    *options,
                                                GimpBrush           *brush);

void     gimp_paint_options_set_default_brush_hardness
                                               (GimpPaintOptions    *options,
                                                GimpBrush           *brush);

gboolean gimp_paint_options_is_prop            (const gchar         *prop_name,
                                                GimpContextPropMask  prop_mask);
void     gimp_paint_options_copy_props         (GimpPaintOptions    *src,
                                                GimpPaintOptions    *dest,
                                                GimpContextPropMask  prop_mask);
174

175 176

#endif  /*  __GIMP_PAINT_OPTIONS_H__  */