[gimp] Bug 658477 - add PDB support for more paint and ink options



commit b952f80be001903d2042b871d99989a89426dd55
Author: Michael Natterer <mitch gimp org>
Date:   Thu Mar 1 12:58:26 2012 +0100

    Bug 658477 - add PDB support for more paint and ink options
    
    Apply heavily modified patch from Es Swartz which adds PDB API for
    brush size, angle and aspect ratio, as well as a full interface for
    ink. Changed to patch to add all procedures to the "context" group
    instead of creating new PDB groups, properly use the new
    GimpPDBContext APIs for paint options, and did some general cleanup.
    (Warning, completely untested).

 app/paint/paint-enums.h      |    2 +-
 app/pdb/context-cmds.c       | 1293 +++++++++++++++++++++++++++++++++++++++++-
 app/pdb/gimppdbcontext.c     |   22 +
 app/pdb/gimppdbcontext.h     |    1 +
 app/pdb/internal-procs.c     |    2 +-
 libgimp/gimp.def             |   23 +
 libgimp/gimpcontext_pdb.c    |  704 +++++++++++++++++++++++
 libgimp/gimpcontext_pdb.h    |  133 +++--
 libgimp/gimpenums.c.tail     |    2 +
 libgimp/gimpenums.h          |   12 +
 tools/pdbgen/enums.pl        |   10 +
 tools/pdbgen/pdb/context.pdb |  718 +++++++++++++++++++++++-
 tools/pdbgen/stddefs.pdb     |    4 +
 13 files changed, 2851 insertions(+), 75 deletions(-)
---
diff --git a/app/paint/paint-enums.h b/app/paint/paint-enums.h
index 1bfcd81..d8551e9 100644
--- a/app/paint/paint-enums.h
+++ b/app/paint/paint-enums.h
@@ -86,7 +86,7 @@ typedef enum
 
 GType gimp_ink_blob_type_get_type (void) G_GNUC_CONST;
 
-typedef enum  /*< pdb-skip >*/
+typedef enum
 {
   GIMP_INK_BLOB_TYPE_CIRCLE,  /*< desc="Circle"  >*/
   GIMP_INK_BLOB_TYPE_SQUARE,  /*< desc="Square"  >*/
diff --git a/app/pdb/context-cmds.c b/app/pdb/context-cmds.c
index 9e8777b..5d7d757 100644
--- a/app/pdb/context-cmds.c
+++ b/app/pdb/context-cmds.c
@@ -28,7 +28,9 @@
 
 #include "pdb-types.h"
 
+#include "base/temp-buf.h"
 #include "core/gimp.h"
+#include "core/gimpbrush.h"
 #include "core/gimpcontainer.h"
 #include "core/gimpdatafactory.h"
 #include "core/gimpparamspecs.h"
@@ -424,6 +426,233 @@ context_set_brush_invoker (GimpProcedure      *procedure,
 }
 
 static GValueArray *
+context_get_brush_size_invoker (GimpProcedure      *procedure,
+                                Gimp               *gimp,
+                                GimpContext        *context,
+                                GimpProgress       *progress,
+                                const GValueArray  *args,
+                                GError            **error)
+{
+  gboolean success = TRUE;
+  gdouble size;
+
+  size = g_value_get_double (&args->values[0]);
+
+  if (success)
+    {
+      /* all options should have the same value, so pick a random one */
+      GimpPaintOptions *options =
+        gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                            "gimp-paintbrush");
+
+      if (options)
+        g_object_get (options,
+                      "brush-size", &size,
+                       NULL);
+      else
+        success = FALSE;
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+context_set_brush_size_invoker (GimpProcedure      *procedure,
+                                Gimp               *gimp,
+                                GimpContext        *context,
+                                GimpProgress       *progress,
+                                const GValueArray  *args,
+                                GError            **error)
+{
+  gboolean success = TRUE;
+  gdouble size;
+
+  size = g_value_get_double (&args->values[0]);
+
+  if (success)
+    {
+      GList *options;
+      GList *list;
+
+      options = gimp_pdb_context_get_brush_options (GIMP_PDB_CONTEXT (context));
+
+      for (list = options; list; list = g_list_next (list))
+        g_object_set (list->data,
+                      "brush-size", (gdouble) size,
+                       NULL);
+
+      g_list_free (options);
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+context_set_brush_default_size_invoker (GimpProcedure      *procedure,
+                                        Gimp               *gimp,
+                                        GimpContext        *context,
+                                        GimpProgress       *progress,
+                                        const GValueArray  *args,
+                                        GError            **error)
+{
+  gboolean success = TRUE;
+  GimpBrush *brush = gimp_context_get_brush (context);
+
+  if (brush)
+    {
+      GList *options;
+      GList *list;
+
+      options = gimp_pdb_context_get_brush_options (GIMP_PDB_CONTEXT (context));
+
+      for (list = options; list; list = g_list_next (list))
+        g_object_set (list->data,
+                      "brush-size", (gdouble) MAX (brush->mask->width,
+                                                   brush->mask->height),
+                      NULL);
+
+      g_list_free (options);
+    }
+  else
+    {
+      success = FALSE;
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+context_get_brush_aspect_ratio_invoker (GimpProcedure      *procedure,
+                                        Gimp               *gimp,
+                                        GimpContext        *context,
+                                        GimpProgress       *progress,
+                                        const GValueArray  *args,
+                                        GError            **error)
+{
+  gboolean success = TRUE;
+  gdouble aspect;
+
+  aspect = g_value_get_double (&args->values[0]);
+
+  if (success)
+    {
+      /* all options should have the same value, so pick a random one */
+      GimpPaintOptions *options =
+        gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                            "gimp-paintbrush");
+
+      if (options)
+        g_object_get (options,
+                      "brush-aspect-ratio", &aspect,
+                      NULL);
+      else
+        success = FALSE;
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+context_set_brush_aspect_ratio_invoker (GimpProcedure      *procedure,
+                                        Gimp               *gimp,
+                                        GimpContext        *context,
+                                        GimpProgress       *progress,
+                                        const GValueArray  *args,
+                                        GError            **error)
+{
+  gboolean success = TRUE;
+  gdouble aspect;
+
+  aspect = g_value_get_double (&args->values[0]);
+
+  if (success)
+    {
+      GList *options;
+      GList *list;
+
+      options = gimp_pdb_context_get_brush_options (GIMP_PDB_CONTEXT (context));
+
+      for (list = options; list; list = g_list_next (list))
+        g_object_set (list->data,
+                      "brush-aspect-ratio", (gdouble) aspect,
+                       NULL);
+
+      g_list_free (options);
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+context_get_brush_angle_invoker (GimpProcedure      *procedure,
+                                 Gimp               *gimp,
+                                 GimpContext        *context,
+                                 GimpProgress       *progress,
+                                 const GValueArray  *args,
+                                 GError            **error)
+{
+  gboolean success = TRUE;
+  gdouble angle;
+
+  angle = g_value_get_double (&args->values[0]);
+
+  if (success)
+    {
+      /* all options should have the same value, so pick a random one */
+      GimpPaintOptions *options =
+        gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                            "gimp-paintbrush");
+
+      if (options)
+        g_object_get (options,
+                      "brush-angle", &angle,
+                      NULL);
+      else
+        success = FALSE;
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+context_set_brush_angle_invoker (GimpProcedure      *procedure,
+                                 Gimp               *gimp,
+                                 GimpContext        *context,
+                                 GimpProgress       *progress,
+                                 const GValueArray  *args,
+                                 GError            **error)
+{
+  gboolean success = TRUE;
+  gdouble angle;
+
+  angle = g_value_get_double (&args->values[0]);
+
+  if (success)
+    {
+      GList *options;
+      GList *list;
+
+      options = gimp_pdb_context_get_brush_options (GIMP_PDB_CONTEXT (context));
+
+      for (list = options; list; list = g_list_next (list))
+        g_object_set (list->data,
+                      "brush-angle", (gdouble) angle,
+                       NULL);
+
+      g_list_free (options);
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
 context_get_dynamics_invoker (GimpProcedure      *procedure,
                               Gimp               *gimp,
                               GimpContext        *context,
@@ -1215,34 +1444,541 @@ context_get_transform_recursion_invoker (GimpProcedure      *procedure,
   GValueArray *return_vals;
   gint32 transform_recursion = 0;
 
-  g_object_get (context,
-                "transform-recursion", &transform_recursion,
-                NULL);
+  g_object_get (context,
+                "transform-recursion", &transform_recursion,
+                NULL);
+
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
+  g_value_set_int (&return_vals->values[1], transform_recursion);
+
+  return return_vals;
+}
+
+static GValueArray *
+context_set_transform_recursion_invoker (GimpProcedure      *procedure,
+                                         Gimp               *gimp,
+                                         GimpContext        *context,
+                                         GimpProgress       *progress,
+                                         const GValueArray  *args,
+                                         GError            **error)
+{
+  gboolean success = TRUE;
+  gint32 transform_recursion;
+
+  transform_recursion = g_value_get_int (&args->values[0]);
+
+  if (success)
+    {
+      g_object_set (context,
+                    "transform-recursion", transform_recursion,
+                    NULL);
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+context_get_ink_size_invoker (GimpProcedure      *procedure,
+                              Gimp               *gimp,
+                              GimpContext        *context,
+                              GimpProgress       *progress,
+                              const GValueArray  *args,
+                              GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  gdouble size = 0.0;
+
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_get (options,
+                  "size", &size,
+                  NULL);
+  else
+    success = FALSE;
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    g_value_set_double (&return_vals->values[1], size);
+
+  return return_vals;
+}
+
+static GValueArray *
+context_set_ink_size_invoker (GimpProcedure      *procedure,
+                              Gimp               *gimp,
+                              GimpContext        *context,
+                              GimpProgress       *progress,
+                              const GValueArray  *args,
+                              GError            **error)
+{
+  gboolean success = TRUE;
+  gdouble size;
+
+  size = g_value_get_double (&args->values[0]);
+
+  if (success)
+    {
+      GimpPaintOptions *options =
+        gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                            "gimp-ink");
+
+      if (options)
+        g_object_set (options,
+                      "size", size,
+                      NULL);
+      else
+        success = FALSE;
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+context_get_ink_angle_invoker (GimpProcedure      *procedure,
+                               Gimp               *gimp,
+                               GimpContext        *context,
+                               GimpProgress       *progress,
+                               const GValueArray  *args,
+                               GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  gdouble angle = 0.0;
+
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_get (options,
+                  "tilt-angle", &angle,
+                  NULL);
+  else
+    success = FALSE;
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    g_value_set_double (&return_vals->values[1], angle);
+
+  return return_vals;
+}
+
+static GValueArray *
+context_set_ink_angle_invoker (GimpProcedure      *procedure,
+                               Gimp               *gimp,
+                               GimpContext        *context,
+                               GimpProgress       *progress,
+                               const GValueArray  *args,
+                               GError            **error)
+{
+  gboolean success = TRUE;
+  gdouble angle;
+
+  angle = g_value_get_double (&args->values[0]);
+
+  if (success)
+    {
+      GimpPaintOptions *options =
+        gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                            "gimp-ink");
+
+      if (options)
+        g_object_set (options,
+                      "tilt-angle", angle,
+                      NULL);
+      else
+        success = FALSE;
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+context_get_ink_size_sensitivity_invoker (GimpProcedure      *procedure,
+                                          Gimp               *gimp,
+                                          GimpContext        *context,
+                                          GimpProgress       *progress,
+                                          const GValueArray  *args,
+                                          GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  gdouble size = 0.0;
+
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_get (options,
+                  "size-sensitivity", &size,
+                  NULL);
+  else
+    success = FALSE;
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    g_value_set_double (&return_vals->values[1], size);
+
+  return return_vals;
+}
+
+static GValueArray *
+context_set_ink_size_sensitivity_invoker (GimpProcedure      *procedure,
+                                          Gimp               *gimp,
+                                          GimpContext        *context,
+                                          GimpProgress       *progress,
+                                          const GValueArray  *args,
+                                          GError            **error)
+{
+  gboolean success = TRUE;
+  gdouble size;
+
+  size = g_value_get_double (&args->values[0]);
+
+  if (success)
+    {
+      GimpPaintOptions *options =
+        gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                            "gimp-ink");
+
+      if (options)
+        g_object_set (options,
+                      "size-sensitivity", size,
+                      NULL);
+      else
+        success = FALSE;
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+context_get_ink_tilt_sensitivity_invoker (GimpProcedure      *procedure,
+                                          Gimp               *gimp,
+                                          GimpContext        *context,
+                                          GimpProgress       *progress,
+                                          const GValueArray  *args,
+                                          GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  gdouble tilt = 0.0;
+
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_get (options,
+                  "tilt-sensitivity", &tilt,
+                  NULL);
+  else
+    success = FALSE;
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    g_value_set_double (&return_vals->values[1], tilt);
+
+  return return_vals;
+}
+
+static GValueArray *
+context_set_ink_tilt_sensitivity_invoker (GimpProcedure      *procedure,
+                                          Gimp               *gimp,
+                                          GimpContext        *context,
+                                          GimpProgress       *progress,
+                                          const GValueArray  *args,
+                                          GError            **error)
+{
+  gboolean success = TRUE;
+  gdouble tilt;
+
+  tilt = g_value_get_double (&args->values[0]);
+
+  if (success)
+    {
+      GimpPaintOptions *options =
+        gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                            "gimp-ink");
+
+      if (options)
+        g_object_set (options,
+                      "tilt-sensitivity", tilt,
+                      NULL);
+      else
+        success = FALSE;
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+context_get_ink_speed_sensitivity_invoker (GimpProcedure      *procedure,
+                                           Gimp               *gimp,
+                                           GimpContext        *context,
+                                           GimpProgress       *progress,
+                                           const GValueArray  *args,
+                                           GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  gdouble speed = 0.0;
+
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_get (options,
+                  "vel-sensitivity", &speed,
+                  NULL);
+  else
+    success = FALSE;
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    g_value_set_double (&return_vals->values[1], speed);
+
+  return return_vals;
+}
+
+static GValueArray *
+context_set_ink_speed_sensitivity_invoker (GimpProcedure      *procedure,
+                                           Gimp               *gimp,
+                                           GimpContext        *context,
+                                           GimpProgress       *progress,
+                                           const GValueArray  *args,
+                                           GError            **error)
+{
+  gboolean success = TRUE;
+  gdouble speed;
+
+  speed = g_value_get_double (&args->values[0]);
+
+  if (success)
+    {
+      GimpPaintOptions *options =
+        gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                            "gimp-ink");
+
+      if (options)
+        g_object_set (options,
+                      "vel-sensitivity", speed,
+                      NULL);
+      else
+        success = FALSE;
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+context_get_ink_blob_type_invoker (GimpProcedure      *procedure,
+                                   Gimp               *gimp,
+                                   GimpContext        *context,
+                                   GimpProgress       *progress,
+                                   const GValueArray  *args,
+                                   GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  gint32 type = 0;
+
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_get (options,
+                  "blob-type", &type,
+                  NULL);
+  else
+    success = FALSE;
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    g_value_set_enum (&return_vals->values[1], type);
+
+  return return_vals;
+}
+
+static GValueArray *
+context_set_ink_blob_type_invoker (GimpProcedure      *procedure,
+                                   Gimp               *gimp,
+                                   GimpContext        *context,
+                                   GimpProgress       *progress,
+                                   const GValueArray  *args,
+                                   GError            **error)
+{
+  gboolean success = TRUE;
+  gint32 type;
+
+  type = g_value_get_enum (&args->values[0]);
+
+  if (success)
+    {
+      GimpPaintOptions *options =
+        gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                            "gimp-ink");
+
+      if (options)
+        g_object_set (options,
+                      "blob-type", type,
+                      NULL);
+      else
+        success = FALSE;
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+context_get_ink_blob_aspect_ratio_invoker (GimpProcedure      *procedure,
+                                           Gimp               *gimp,
+                                           GimpContext        *context,
+                                           GimpProgress       *progress,
+                                           const GValueArray  *args,
+                                           GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  gdouble aspect = 0.0;
+
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_get (options,
+                  "blob-aspect", &aspect,
+                  NULL);
+  else
+    success = FALSE;
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    g_value_set_double (&return_vals->values[1], aspect);
+
+  return return_vals;
+}
+
+static GValueArray *
+context_set_ink_blob_aspect_ratio_invoker (GimpProcedure      *procedure,
+                                           Gimp               *gimp,
+                                           GimpContext        *context,
+                                           GimpProgress       *progress,
+                                           const GValueArray  *args,
+                                           GError            **error)
+{
+  gboolean success = TRUE;
+  gdouble aspect;
+
+  aspect = g_value_get_double (&args->values[0]);
+
+  if (success)
+    {
+      GimpPaintOptions *options =
+        gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                            "gimp-ink");
+
+      if (options)
+        g_object_set (options,
+                      "blob-aspect", aspect,
+                      NULL);
+      else
+        success = FALSE;
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+context_get_ink_blob_angle_invoker (GimpProcedure      *procedure,
+                                    Gimp               *gimp,
+                                    GimpContext        *context,
+                                    GimpProgress       *progress,
+                                    const GValueArray  *args,
+                                    GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  gdouble angle = 0.0;
+
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    {
+      g_object_get (options,
+                    "blob-angle", &angle,
+                    NULL);
+      angle *= (180-0 / G_PI);
+    }
+  else
+    success = FALSE;
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
 
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
-  g_value_set_int (&return_vals->values[1], transform_recursion);
+  if (success)
+    g_value_set_double (&return_vals->values[1], angle);
 
   return return_vals;
 }
 
 static GValueArray *
-context_set_transform_recursion_invoker (GimpProcedure      *procedure,
-                                         Gimp               *gimp,
-                                         GimpContext        *context,
-                                         GimpProgress       *progress,
-                                         const GValueArray  *args,
-                                         GError            **error)
+context_set_ink_blob_angle_invoker (GimpProcedure      *procedure,
+                                    Gimp               *gimp,
+                                    GimpContext        *context,
+                                    GimpProgress       *progress,
+                                    const GValueArray  *args,
+                                    GError            **error)
 {
   gboolean success = TRUE;
-  gint32 transform_recursion;
+  gdouble angle;
 
-  transform_recursion = g_value_get_int (&args->values[0]);
+  angle = g_value_get_double (&args->values[0]);
 
   if (success)
     {
-      g_object_set (context,
-                    "transform-recursion", transform_recursion,
-                    NULL);
+      GimpPaintOptions *options =
+        gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                            "gimp-ink");
+
+      if (options)
+        g_object_set (options,
+                      "blob-angle", (gdouble) angle * G_PI / 180.0,
+                      NULL);
+      else
+        success = FALSE;
     }
 
   return gimp_procedure_get_return_values (procedure, success,
@@ -1654,6 +2390,161 @@ register_context_procs (GimpPDB *pdb)
   g_object_unref (procedure);
 
   /*
+   * gimp-context-get-brush-size
+   */
+  procedure = gimp_procedure_new (context_get_brush_size_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-get-brush-size");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-get-brush-size",
+                                     "Get brush size in pixels.",
+                                     "Get the brush size in pixels for brush based paint tools.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_double ("size",
+                                                    "size",
+                                                    "brush size in pixels",
+                                                    0, G_MAXDOUBLE, 0,
+                                                    GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-context-set-brush-size
+   */
+  procedure = gimp_procedure_new (context_set_brush_size_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-set-brush-size");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-set-brush-size",
+                                     "Set brush size in pixels.",
+                                     "Set the brush size in pixels for brush based paint tools.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_double ("size",
+                                                    "size",
+                                                    "brush size in pixels",
+                                                    0, G_MAXDOUBLE, 0,
+                                                    GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-context-set-brush-default-size
+   */
+  procedure = gimp_procedure_new (context_set_brush_default_size_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-set-brush-default-size");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-set-brush-default-size",
+                                     "Set brush size to its default.",
+                                     "Set the brush size to the default (max of width and height) for paintbrush, airbrush, or pencil tools.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-context-get-brush-aspect-ratio
+   */
+  procedure = gimp_procedure_new (context_get_brush_aspect_ratio_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-get-brush-aspect-ratio");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-get-brush-aspect-ratio",
+                                     "Get brush aspect ratio.",
+                                     "Set the aspect ratio for brush based paint tools.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_double ("aspect",
+                                                    "aspect",
+                                                    "aspect ratio",
+                                                    -20, 20, -20,
+                                                    GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-context-set-brush-aspect-ratio
+   */
+  procedure = gimp_procedure_new (context_set_brush_aspect_ratio_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-set-brush-aspect-ratio");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-set-brush-aspect-ratio",
+                                     "Set brush aspect ratio.",
+                                     "Set the aspect ratio for brush based paint tools.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_double ("aspect",
+                                                    "aspect",
+                                                    "aspect ratio",
+                                                    -20, 20, -20,
+                                                    GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-context-get-brush-angle
+   */
+  procedure = gimp_procedure_new (context_get_brush_angle_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-get-brush-angle");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-get-brush-angle",
+                                     "Get brush angle in degrees.",
+                                     "Set the angle in degrees for brush based paint tools.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_double ("angle",
+                                                    "angle",
+                                                    "angle in degrees",
+                                                    -180, 180, -180,
+                                                    GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-context-set-brush-angle
+   */
+  procedure = gimp_procedure_new (context_set_brush_angle_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-set-brush-angle");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-set-brush-angle",
+                                     "Set brush angle in degrees.",
+                                     "Set the angle in degrees for brush based paint tools.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_double ("angle",
+                                                    "angle",
+                                                    "angle in degrees",
+                                                    -180, 180, -180,
+                                                    GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
    * gimp-context-get-dynamics
    */
   procedure = gimp_procedure_new (context_get_dynamics_invoker);
@@ -2464,4 +3355,374 @@ register_context_procs (GimpPDB *pdb)
                                                       GIMP_PARAM_READWRITE));
   gimp_pdb_register_procedure (pdb, procedure);
   g_object_unref (procedure);
+
+  /*
+   * gimp-context-get-ink-size
+   */
+  procedure = gimp_procedure_new (context_get_ink_size_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-get-ink-size");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-get-ink-size",
+                                     "Get ink blob size in pixels.",
+                                     "Get the ink blob size in pixels for ink tool.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_double ("size",
+                                                        "size",
+                                                        "ink blob size in pixels",
+                                                        0, 200, 0,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-context-set-ink-size
+   */
+  procedure = gimp_procedure_new (context_set_ink_size_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-set-ink-size");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-set-ink-size",
+                                     "Set ink blob size in pixels.",
+                                     "Set the ink blob size in pixels for ink tool.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_double ("size",
+                                                    "size",
+                                                    "ink blob size in pixels",
+                                                    0, 200, 0,
+                                                    GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-context-get-ink-angle
+   */
+  procedure = gimp_procedure_new (context_get_ink_angle_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-get-ink-angle");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-get-ink-angle",
+                                     "Get ink angle in degrees.",
+                                     "Get the ink angle in degrees for ink tool.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_double ("angle",
+                                                        "angle",
+                                                        "ink angle in degrees",
+                                                        -90, 90, -90,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-context-set-ink-angle
+   */
+  procedure = gimp_procedure_new (context_set_ink_angle_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-set-ink-angle");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-set-ink-angle",
+                                     "Set ink angle in degrees.",
+                                     "Set the ink angle in degrees for ink tool.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_double ("angle",
+                                                    "angle",
+                                                    "ink angle in degrees",
+                                                    -90, 90, -90,
+                                                    GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-context-get-ink-size-sensitivity
+   */
+  procedure = gimp_procedure_new (context_get_ink_size_sensitivity_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-get-ink-size-sensitivity");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-get-ink-size-sensitivity",
+                                     "Get ink size sensitivity.",
+                                     "Get the ink size sensitivity for ink tool.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_double ("size",
+                                                        "size",
+                                                        "ink size sensitivity",
+                                                        0, 1, 0,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-context-set-ink-size-sensitivity
+   */
+  procedure = gimp_procedure_new (context_set_ink_size_sensitivity_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-set-ink-size-sensitivity");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-set-ink-size-sensitivity",
+                                     "Set ink size sensitivity.",
+                                     "Set the ink size sensitivity for ink tool.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_double ("size",
+                                                    "size",
+                                                    "ink size sensitivity",
+                                                    0, 1, 0,
+                                                    GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-context-get-ink-tilt-sensitivity
+   */
+  procedure = gimp_procedure_new (context_get_ink_tilt_sensitivity_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-get-ink-tilt-sensitivity");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-get-ink-tilt-sensitivity",
+                                     "Get ink tilt sensitivity.",
+                                     "Get the ink tilt sensitivity for ink tool.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_double ("tilt",
+                                                        "tilt",
+                                                        "ink tilt sensitivity",
+                                                        0, 1, 0,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-context-set-ink-tilt-sensitivity
+   */
+  procedure = gimp_procedure_new (context_set_ink_tilt_sensitivity_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-set-ink-tilt-sensitivity");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-set-ink-tilt-sensitivity",
+                                     "Set ink tilt sensitivity.",
+                                     "Set the ink tilt sensitivity for ink tool.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_double ("tilt",
+                                                    "tilt",
+                                                    "ink tilt sensitivity",
+                                                    0, 1, 0,
+                                                    GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-context-get-ink-speed-sensitivity
+   */
+  procedure = gimp_procedure_new (context_get_ink_speed_sensitivity_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-get-ink-speed-sensitivity");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-get-ink-speed-sensitivity",
+                                     "Get ink speed sensitivity.",
+                                     "Get the ink speed sensitivity for ink tool.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_double ("speed",
+                                                        "speed",
+                                                        "ink speed sensitivity",
+                                                        0, 1, 0,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-context-set-ink-speed-sensitivity
+   */
+  procedure = gimp_procedure_new (context_set_ink_speed_sensitivity_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-set-ink-speed-sensitivity");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-set-ink-speed-sensitivity",
+                                     "Set ink speed sensitivity.",
+                                     "Set the ink speed sensitivity for ink tool.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_double ("speed",
+                                                    "speed",
+                                                    "ink speed sensitivity",
+                                                    0, 1, 0,
+                                                    GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-context-get-ink-blob-type
+   */
+  procedure = gimp_procedure_new (context_get_ink_blob_type_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-get-ink-blob-type");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-get-ink-blob-type",
+                                     "Get ink blob type.",
+                                     "Get the ink blob type for ink tool.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_enum ("type",
+                                                      "type",
+                                                      "Ink blob type",
+                                                      GIMP_TYPE_INK_BLOB_TYPE,
+                                                      GIMP_INK_BLOB_TYPE_CIRCLE,
+                                                      GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-context-set-ink-blob-type
+   */
+  procedure = gimp_procedure_new (context_set_ink_blob_type_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-set-ink-blob-type");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-set-ink-blob-type",
+                                     "Set ink blob type.",
+                                     "Set the ink blob type for ink tool.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_enum ("type",
+                                                  "type",
+                                                  "Ink blob type",
+                                                  GIMP_TYPE_INK_BLOB_TYPE,
+                                                  GIMP_INK_BLOB_TYPE_CIRCLE,
+                                                  GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-context-get-ink-blob-aspect-ratio
+   */
+  procedure = gimp_procedure_new (context_get_ink_blob_aspect_ratio_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-get-ink-blob-aspect-ratio");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-get-ink-blob-aspect-ratio",
+                                     "Get ink blob aspect ratio.",
+                                     "Get the ink blob aspect ratio for ink tool.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_double ("aspect",
+                                                        "aspect",
+                                                        "ink blob aspect ratio",
+                                                        1, 10, 1,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-context-set-ink-blob-aspect-ratio
+   */
+  procedure = gimp_procedure_new (context_set_ink_blob_aspect_ratio_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-set-ink-blob-aspect-ratio");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-set-ink-blob-aspect-ratio",
+                                     "Set ink blob aspect ratio.",
+                                     "Set the ink blob aspect ratio for ink tool.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_double ("aspect",
+                                                    "aspect",
+                                                    "ink blob aspect ratio",
+                                                    1, 10, 1,
+                                                    GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-context-get-ink-blob-angle
+   */
+  procedure = gimp_procedure_new (context_get_ink_blob_angle_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-get-ink-blob-angle");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-get-ink-blob-angle",
+                                     "Get ink blob angle in degrees.",
+                                     "Get the ink blob angle in degrees for ink tool.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_double ("angle",
+                                                        "angle",
+                                                        "ink blob angle in degrees",
+                                                        -180, 180, -180,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-context-set-ink-blob-angle
+   */
+  procedure = gimp_procedure_new (context_set_ink_blob_angle_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-context-set-ink-blob-angle");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-context-set-ink-blob-angle",
+                                     "Set ink blob angle in degrees.",
+                                     "Set the ink blob angle in degrees for ink tool.",
+                                     "Ed Swartz",
+                                     "Ed Swartz",
+                                     "2012",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_double ("angle",
+                                                    "angle",
+                                                    "ink blob angle in degrees",
+                                                    -180, 180, -180,
+                                                    GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
 }
diff --git a/app/pdb/gimppdbcontext.c b/app/pdb/gimppdbcontext.c
index 138fbda..9b848ec 100644
--- a/app/pdb/gimppdbcontext.c
+++ b/app/pdb/gimppdbcontext.c
@@ -31,6 +31,7 @@
 #include "core/gimplist.h"
 #include "core/gimppaintinfo.h"
 
+#include "paint/gimpbrushcore.h"
 #include "paint/gimppaintoptions.h"
 
 #include "gimppdbcontext.h"
@@ -394,3 +395,24 @@ gimp_pdb_context_get_paint_options (GimpPDBContext *context,
   return (GimpPaintOptions *)
     gimp_container_get_child_by_name (context->paint_options_list, name);
 }
+
+GList *
+gimp_pdb_context_get_brush_options (GimpPDBContext *context)
+{
+  GList *brush_options = NULL;
+  GList *list;
+
+  g_return_val_if_fail (GIMP_IS_PDB_CONTEXT (context), NULL);
+
+  for (list = GIMP_LIST (context->paint_options_list)->list;
+       list;
+       list = g_list_next (list))
+    {
+      GimpPaintOptions *options = list->data;
+
+      if (g_type_is_a (options->paint_info->paint_type, GIMP_TYPE_BRUSH_CORE))
+        brush_options = g_list_prepend (brush_options, options);
+    }
+
+  return g_list_reverse (brush_options);
+}
diff --git a/app/pdb/gimppdbcontext.h b/app/pdb/gimppdbcontext.h
index 810304f..41a1e05 100644
--- a/app/pdb/gimppdbcontext.h
+++ b/app/pdb/gimppdbcontext.h
@@ -70,6 +70,7 @@ GimpContext      * gimp_pdb_context_new               (Gimp           *gimp,
 
 GimpPaintOptions * gimp_pdb_context_get_paint_options (GimpPDBContext *context,
                                                        const gchar    *name);
+GList            * gimp_pdb_context_get_brush_options (GimpPDBContext *context);
 
 
 #endif  /*  __GIMP_PDB_CONTEXT_H__  */
diff --git a/app/pdb/internal-procs.c b/app/pdb/internal-procs.c
index 8534e58..0d0e9ed 100644
--- a/app/pdb/internal-procs.c
+++ b/app/pdb/internal-procs.c
@@ -28,7 +28,7 @@
 #include "internal-procs.h"
 
 
-/* 640 procedures registered total */
+/* 663 procedures registered total */
 
 void
 internal_procs_init (GimpPDB *pdb)
diff --git a/libgimp/gimp.def b/libgimp/gimp.def
index 37c1436..d9049e8 100644
--- a/libgimp/gimp.def
+++ b/libgimp/gimp.def
@@ -72,12 +72,23 @@ EXPORTS
 	gimp_context_get_antialias
 	gimp_context_get_background
 	gimp_context_get_brush
+	gimp_context_get_brush_angle
+	gimp_context_get_brush_aspect_ratio
+	gimp_context_get_brush_size
 	gimp_context_get_dynamics
 	gimp_context_get_feather
 	gimp_context_get_feather_radius
 	gimp_context_get_font
 	gimp_context_get_foreground
 	gimp_context_get_gradient
+	gimp_context_get_ink_angle
+	gimp_context_get_ink_blob_angle
+	gimp_context_get_ink_blob_aspect_ratio
+	gimp_context_get_ink_blob_type
+	gimp_context_get_ink_size
+	gimp_context_get_ink_size_sensitivity
+	gimp_context_get_ink_speed_sensitivity
+	gimp_context_get_ink_tilt_sensitivity
 	gimp_context_get_interpolation
 	gimp_context_get_opacity
 	gimp_context_get_paint_method
@@ -98,6 +109,10 @@ EXPORTS
 	gimp_context_set_antialias
 	gimp_context_set_background
 	gimp_context_set_brush
+	gimp_context_set_brush_angle
+	gimp_context_set_brush_aspect_ratio
+	gimp_context_set_brush_default_size
+	gimp_context_set_brush_size
 	gimp_context_set_default_colors
 	gimp_context_set_defaults
 	gimp_context_set_dynamics
@@ -106,6 +121,14 @@ EXPORTS
 	gimp_context_set_font
 	gimp_context_set_foreground
 	gimp_context_set_gradient
+	gimp_context_set_ink_angle
+	gimp_context_set_ink_blob_angle
+	gimp_context_set_ink_blob_aspect_ratio
+	gimp_context_set_ink_blob_type
+	gimp_context_set_ink_size
+	gimp_context_set_ink_size_sensitivity
+	gimp_context_set_ink_speed_sensitivity
+	gimp_context_set_ink_tilt_sensitivity
 	gimp_context_set_interpolation
 	gimp_context_set_opacity
 	gimp_context_set_paint_method
diff --git a/libgimp/gimpcontext_pdb.c b/libgimp/gimpcontext_pdb.c
index fc64d30..a1b1b96 100644
--- a/libgimp/gimpcontext_pdb.c
+++ b/libgimp/gimpcontext_pdb.c
@@ -635,6 +635,222 @@ gimp_context_set_brush (const gchar *name)
 }
 
 /**
+ * gimp_context_get_brush_size:
+ * @size: brush size in pixels.
+ *
+ * Get brush size in pixels.
+ *
+ * Get the brush size in pixels for brush based paint tools.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.8
+ **/
+gboolean
+gimp_context_get_brush_size (gdouble size)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-context-get-brush-size",
+                                    &nreturn_vals,
+                                    GIMP_PDB_FLOAT, size,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
+ * gimp_context_set_brush_size:
+ * @size: brush size in pixels.
+ *
+ * Set brush size in pixels.
+ *
+ * Set the brush size in pixels for brush based paint tools.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.8
+ **/
+gboolean
+gimp_context_set_brush_size (gdouble size)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-context-set-brush-size",
+                                    &nreturn_vals,
+                                    GIMP_PDB_FLOAT, size,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
+ * gimp_context_set_brush_default_size:
+ *
+ * Set brush size to its default.
+ *
+ * Set the brush size to the default (max of width and height) for
+ * paintbrush, airbrush, or pencil tools.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.8
+ **/
+gboolean
+gimp_context_set_brush_default_size (void)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-context-set-brush-default-size",
+                                    &nreturn_vals,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
+ * gimp_context_get_brush_aspect_ratio:
+ * @aspect: aspect ratio.
+ *
+ * Get brush aspect ratio.
+ *
+ * Set the aspect ratio for brush based paint tools.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.8
+ **/
+gboolean
+gimp_context_get_brush_aspect_ratio (gdouble aspect)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-context-get-brush-aspect-ratio",
+                                    &nreturn_vals,
+                                    GIMP_PDB_FLOAT, aspect,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
+ * gimp_context_set_brush_aspect_ratio:
+ * @aspect: aspect ratio.
+ *
+ * Set brush aspect ratio.
+ *
+ * Set the aspect ratio for brush based paint tools.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.8
+ **/
+gboolean
+gimp_context_set_brush_aspect_ratio (gdouble aspect)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-context-set-brush-aspect-ratio",
+                                    &nreturn_vals,
+                                    GIMP_PDB_FLOAT, aspect,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
+ * gimp_context_get_brush_angle:
+ * @angle: angle in degrees.
+ *
+ * Get brush angle in degrees.
+ *
+ * Set the angle in degrees for brush based paint tools.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.8
+ **/
+gboolean
+gimp_context_get_brush_angle (gdouble angle)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-context-get-brush-angle",
+                                    &nreturn_vals,
+                                    GIMP_PDB_FLOAT, angle,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
+ * gimp_context_set_brush_angle:
+ * @angle: angle in degrees.
+ *
+ * Set brush angle in degrees.
+ *
+ * Set the angle in degrees for brush based paint tools.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.8
+ **/
+gboolean
+gimp_context_set_brush_angle (gdouble angle)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-context-set-brush-angle",
+                                    &nreturn_vals,
+                                    GIMP_PDB_FLOAT, angle,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
  * gimp_context_get_dynamics:
  *
  * Retrieve the currently active paint dynamics.
@@ -1790,3 +2006,491 @@ gimp_context_set_transform_recursion (gint transform_recursion)
 
   return success;
 }
+
+/**
+ * gimp_context_get_ink_size:
+ *
+ * Get ink blob size in pixels.
+ *
+ * Get the ink blob size in pixels for ink tool.
+ *
+ * Returns: ink blob size in pixels.
+ *
+ * Since: GIMP 2.8
+ **/
+gdouble
+gimp_context_get_ink_size (void)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gdouble size = 0.0;
+
+  return_vals = gimp_run_procedure ("gimp-context-get-ink-size",
+                                    &nreturn_vals,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    size = return_vals[1].data.d_float;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return size;
+}
+
+/**
+ * gimp_context_set_ink_size:
+ * @size: ink blob size in pixels.
+ *
+ * Set ink blob size in pixels.
+ *
+ * Set the ink blob size in pixels for ink tool.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.8
+ **/
+gboolean
+gimp_context_set_ink_size (gdouble size)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-context-set-ink-size",
+                                    &nreturn_vals,
+                                    GIMP_PDB_FLOAT, size,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
+ * gimp_context_get_ink_angle:
+ *
+ * Get ink angle in degrees.
+ *
+ * Get the ink angle in degrees for ink tool.
+ *
+ * Returns: ink angle in degrees.
+ *
+ * Since: GIMP 2.8
+ **/
+gdouble
+gimp_context_get_ink_angle (void)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gdouble angle = 0.0;
+
+  return_vals = gimp_run_procedure ("gimp-context-get-ink-angle",
+                                    &nreturn_vals,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    angle = return_vals[1].data.d_float;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return angle;
+}
+
+/**
+ * gimp_context_set_ink_angle:
+ * @angle: ink angle in degrees.
+ *
+ * Set ink angle in degrees.
+ *
+ * Set the ink angle in degrees for ink tool.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.8
+ **/
+gboolean
+gimp_context_set_ink_angle (gdouble angle)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-context-set-ink-angle",
+                                    &nreturn_vals,
+                                    GIMP_PDB_FLOAT, angle,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
+ * gimp_context_get_ink_size_sensitivity:
+ *
+ * Get ink size sensitivity.
+ *
+ * Get the ink size sensitivity for ink tool.
+ *
+ * Returns: ink size sensitivity.
+ *
+ * Since: GIMP 2.8
+ **/
+gdouble
+gimp_context_get_ink_size_sensitivity (void)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gdouble size = 0.0;
+
+  return_vals = gimp_run_procedure ("gimp-context-get-ink-size-sensitivity",
+                                    &nreturn_vals,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    size = return_vals[1].data.d_float;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return size;
+}
+
+/**
+ * gimp_context_set_ink_size_sensitivity:
+ * @size: ink size sensitivity.
+ *
+ * Set ink size sensitivity.
+ *
+ * Set the ink size sensitivity for ink tool.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.8
+ **/
+gboolean
+gimp_context_set_ink_size_sensitivity (gdouble size)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-context-set-ink-size-sensitivity",
+                                    &nreturn_vals,
+                                    GIMP_PDB_FLOAT, size,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
+ * gimp_context_get_ink_tilt_sensitivity:
+ *
+ * Get ink tilt sensitivity.
+ *
+ * Get the ink tilt sensitivity for ink tool.
+ *
+ * Returns: ink tilt sensitivity.
+ *
+ * Since: GIMP 2.8
+ **/
+gdouble
+gimp_context_get_ink_tilt_sensitivity (void)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gdouble tilt = 0.0;
+
+  return_vals = gimp_run_procedure ("gimp-context-get-ink-tilt-sensitivity",
+                                    &nreturn_vals,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    tilt = return_vals[1].data.d_float;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return tilt;
+}
+
+/**
+ * gimp_context_set_ink_tilt_sensitivity:
+ * @tilt: ink tilt sensitivity.
+ *
+ * Set ink tilt sensitivity.
+ *
+ * Set the ink tilt sensitivity for ink tool.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.8
+ **/
+gboolean
+gimp_context_set_ink_tilt_sensitivity (gdouble tilt)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-context-set-ink-tilt-sensitivity",
+                                    &nreturn_vals,
+                                    GIMP_PDB_FLOAT, tilt,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
+ * gimp_context_get_ink_speed_sensitivity:
+ *
+ * Get ink speed sensitivity.
+ *
+ * Get the ink speed sensitivity for ink tool.
+ *
+ * Returns: ink speed sensitivity.
+ *
+ * Since: GIMP 2.8
+ **/
+gdouble
+gimp_context_get_ink_speed_sensitivity (void)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gdouble speed = 0.0;
+
+  return_vals = gimp_run_procedure ("gimp-context-get-ink-speed-sensitivity",
+                                    &nreturn_vals,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    speed = return_vals[1].data.d_float;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return speed;
+}
+
+/**
+ * gimp_context_set_ink_speed_sensitivity:
+ * @speed: ink speed sensitivity.
+ *
+ * Set ink speed sensitivity.
+ *
+ * Set the ink speed sensitivity for ink tool.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.8
+ **/
+gboolean
+gimp_context_set_ink_speed_sensitivity (gdouble speed)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-context-set-ink-speed-sensitivity",
+                                    &nreturn_vals,
+                                    GIMP_PDB_FLOAT, speed,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
+ * gimp_context_get_ink_blob_type:
+ *
+ * Get ink blob type.
+ *
+ * Get the ink blob type for ink tool.
+ *
+ * Returns: Ink blob type.
+ *
+ * Since: GIMP 2.8
+ **/
+GimpInkBlobType
+gimp_context_get_ink_blob_type (void)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  GimpInkBlobType type = 0;
+
+  return_vals = gimp_run_procedure ("gimp-context-get-ink-blob-type",
+                                    &nreturn_vals,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    type = return_vals[1].data.d_int32;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return type;
+}
+
+/**
+ * gimp_context_set_ink_blob_type:
+ * @type: Ink blob type.
+ *
+ * Set ink blob type.
+ *
+ * Set the ink blob type for ink tool.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.8
+ **/
+gboolean
+gimp_context_set_ink_blob_type (GimpInkBlobType type)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-context-set-ink-blob-type",
+                                    &nreturn_vals,
+                                    GIMP_PDB_INT32, type,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
+ * gimp_context_get_ink_blob_aspect_ratio:
+ *
+ * Get ink blob aspect ratio.
+ *
+ * Get the ink blob aspect ratio for ink tool.
+ *
+ * Returns: ink blob aspect ratio.
+ *
+ * Since: GIMP 2.8
+ **/
+gdouble
+gimp_context_get_ink_blob_aspect_ratio (void)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gdouble aspect = 0.0;
+
+  return_vals = gimp_run_procedure ("gimp-context-get-ink-blob-aspect-ratio",
+                                    &nreturn_vals,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    aspect = return_vals[1].data.d_float;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return aspect;
+}
+
+/**
+ * gimp_context_set_ink_blob_aspect_ratio:
+ * @aspect: ink blob aspect ratio.
+ *
+ * Set ink blob aspect ratio.
+ *
+ * Set the ink blob aspect ratio for ink tool.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.8
+ **/
+gboolean
+gimp_context_set_ink_blob_aspect_ratio (gdouble aspect)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-context-set-ink-blob-aspect-ratio",
+                                    &nreturn_vals,
+                                    GIMP_PDB_FLOAT, aspect,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
+ * gimp_context_get_ink_blob_angle:
+ *
+ * Get ink blob angle in degrees.
+ *
+ * Get the ink blob angle in degrees for ink tool.
+ *
+ * Returns: ink blob angle in degrees.
+ *
+ * Since: GIMP 2.8
+ **/
+gdouble
+gimp_context_get_ink_blob_angle (void)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gdouble angle = 0.0;
+
+  return_vals = gimp_run_procedure ("gimp-context-get-ink-blob-angle",
+                                    &nreturn_vals,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    angle = return_vals[1].data.d_float;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return angle;
+}
+
+/**
+ * gimp_context_set_ink_blob_angle:
+ * @angle: ink blob angle in degrees.
+ *
+ * Set ink blob angle in degrees.
+ *
+ * Set the ink blob angle in degrees for ink tool.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.8
+ **/
+gboolean
+gimp_context_set_ink_blob_angle (gdouble angle)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-context-set-ink-blob-angle",
+                                    &nreturn_vals,
+                                    GIMP_PDB_FLOAT, angle,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
diff --git a/libgimp/gimpcontext_pdb.h b/libgimp/gimpcontext_pdb.h
index c84f584..4c36eb3 100644
--- a/libgimp/gimpcontext_pdb.h
+++ b/libgimp/gimpcontext_pdb.h
@@ -32,61 +32,84 @@ G_BEGIN_DECLS
 /* For information look into the C source or the html documentation */
 
 
-gboolean               gimp_context_push                     (void);
-gboolean               gimp_context_pop                      (void);
-gboolean               gimp_context_set_defaults             (void);
-gboolean               gimp_context_list_paint_methods       (gint                     *num_paint_methods,
-                                                              gchar                  ***paint_methods);
-gchar*                 gimp_context_get_paint_method         (void);
-gboolean               gimp_context_set_paint_method         (const gchar              *name);
-gboolean               gimp_context_get_foreground           (GimpRGB                  *foreground);
-gboolean               gimp_context_set_foreground           (const GimpRGB            *foreground);
-gboolean               gimp_context_get_background           (GimpRGB                  *background);
-gboolean               gimp_context_set_background           (const GimpRGB            *background);
-gboolean               gimp_context_set_default_colors       (void);
-gboolean               gimp_context_swap_colors              (void);
-gdouble                gimp_context_get_opacity              (void);
-gboolean               gimp_context_set_opacity              (gdouble                   opacity);
-GimpLayerModeEffects   gimp_context_get_paint_mode           (void);
-gboolean               gimp_context_set_paint_mode           (GimpLayerModeEffects      paint_mode);
-gchar*                 gimp_context_get_brush                (void);
-gboolean               gimp_context_set_brush                (const gchar              *name);
-gchar*                 gimp_context_get_dynamics             (void);
-gboolean               gimp_context_set_dynamics             (const gchar              *name);
-gchar*                 gimp_context_get_pattern              (void);
-gboolean               gimp_context_set_pattern              (const gchar              *name);
-gchar*                 gimp_context_get_gradient             (void);
-gboolean               gimp_context_set_gradient             (const gchar              *name);
-gchar*                 gimp_context_get_palette              (void);
-gboolean               gimp_context_set_palette              (const gchar              *name);
-gchar*                 gimp_context_get_font                 (void);
-gboolean               gimp_context_set_font                 (const gchar              *name);
-gboolean               gimp_context_get_antialias            (void);
-gboolean               gimp_context_set_antialias            (gboolean                  antialias);
-gboolean               gimp_context_get_feather              (void);
-gboolean               gimp_context_set_feather              (gboolean                  feather);
-gboolean               gimp_context_get_feather_radius       (gdouble                  *feather_radius_x,
-                                                              gdouble                  *feather_radius_y);
-gboolean               gimp_context_set_feather_radius       (gdouble                   feather_radius_x,
-                                                              gdouble                   feather_radius_y);
-gboolean               gimp_context_get_sample_merged        (void);
-gboolean               gimp_context_set_sample_merged        (gboolean                  sample_merged);
-GimpSelectCriterion    gimp_context_get_sample_criterion     (void);
-gboolean               gimp_context_set_sample_criterion     (GimpSelectCriterion       sample_criterion);
-gdouble                gimp_context_get_sample_threshold     (void);
-gboolean               gimp_context_set_sample_threshold     (gdouble                   sample_threshold);
-gint                   gimp_context_get_sample_threshold_int (void);
-gboolean               gimp_context_set_sample_threshold_int (gint                      sample_threshold);
-gboolean               gimp_context_get_sample_transparent   (void);
-gboolean               gimp_context_set_sample_transparent   (gboolean                  sample_transparent);
-GimpInterpolationType  gimp_context_get_interpolation        (void);
-gboolean               gimp_context_set_interpolation        (GimpInterpolationType     interpolation);
-GimpTransformDirection gimp_context_get_transform_direction  (void);
-gboolean               gimp_context_set_transform_direction  (GimpTransformDirection    transform_direction);
-GimpTransformResize    gimp_context_get_transform_resize     (void);
-gboolean               gimp_context_set_transform_resize     (GimpTransformResize       transform_resize);
-gint                   gimp_context_get_transform_recursion  (void);
-gboolean               gimp_context_set_transform_recursion  (gint                      transform_recursion);
+gboolean               gimp_context_push                      (void);
+gboolean               gimp_context_pop                       (void);
+gboolean               gimp_context_set_defaults              (void);
+gboolean               gimp_context_list_paint_methods        (gint                     *num_paint_methods,
+                                                               gchar                  ***paint_methods);
+gchar*                 gimp_context_get_paint_method          (void);
+gboolean               gimp_context_set_paint_method          (const gchar              *name);
+gboolean               gimp_context_get_foreground            (GimpRGB                  *foreground);
+gboolean               gimp_context_set_foreground            (const GimpRGB            *foreground);
+gboolean               gimp_context_get_background            (GimpRGB                  *background);
+gboolean               gimp_context_set_background            (const GimpRGB            *background);
+gboolean               gimp_context_set_default_colors        (void);
+gboolean               gimp_context_swap_colors               (void);
+gdouble                gimp_context_get_opacity               (void);
+gboolean               gimp_context_set_opacity               (gdouble                   opacity);
+GimpLayerModeEffects   gimp_context_get_paint_mode            (void);
+gboolean               gimp_context_set_paint_mode            (GimpLayerModeEffects      paint_mode);
+gchar*                 gimp_context_get_brush                 (void);
+gboolean               gimp_context_set_brush                 (const gchar              *name);
+gboolean               gimp_context_get_brush_size            (gdouble                   size);
+gboolean               gimp_context_set_brush_size            (gdouble                   size);
+gboolean               gimp_context_set_brush_default_size    (void);
+gboolean               gimp_context_get_brush_aspect_ratio    (gdouble                   aspect);
+gboolean               gimp_context_set_brush_aspect_ratio    (gdouble                   aspect);
+gboolean               gimp_context_get_brush_angle           (gdouble                   angle);
+gboolean               gimp_context_set_brush_angle           (gdouble                   angle);
+gchar*                 gimp_context_get_dynamics              (void);
+gboolean               gimp_context_set_dynamics              (const gchar              *name);
+gchar*                 gimp_context_get_pattern               (void);
+gboolean               gimp_context_set_pattern               (const gchar              *name);
+gchar*                 gimp_context_get_gradient              (void);
+gboolean               gimp_context_set_gradient              (const gchar              *name);
+gchar*                 gimp_context_get_palette               (void);
+gboolean               gimp_context_set_palette               (const gchar              *name);
+gchar*                 gimp_context_get_font                  (void);
+gboolean               gimp_context_set_font                  (const gchar              *name);
+gboolean               gimp_context_get_antialias             (void);
+gboolean               gimp_context_set_antialias             (gboolean                  antialias);
+gboolean               gimp_context_get_feather               (void);
+gboolean               gimp_context_set_feather               (gboolean                  feather);
+gboolean               gimp_context_get_feather_radius        (gdouble                  *feather_radius_x,
+                                                               gdouble                  *feather_radius_y);
+gboolean               gimp_context_set_feather_radius        (gdouble                   feather_radius_x,
+                                                               gdouble                   feather_radius_y);
+gboolean               gimp_context_get_sample_merged         (void);
+gboolean               gimp_context_set_sample_merged         (gboolean                  sample_merged);
+GimpSelectCriterion    gimp_context_get_sample_criterion      (void);
+gboolean               gimp_context_set_sample_criterion      (GimpSelectCriterion       sample_criterion);
+gdouble                gimp_context_get_sample_threshold      (void);
+gboolean               gimp_context_set_sample_threshold      (gdouble                   sample_threshold);
+gint                   gimp_context_get_sample_threshold_int  (void);
+gboolean               gimp_context_set_sample_threshold_int  (gint                      sample_threshold);
+gboolean               gimp_context_get_sample_transparent    (void);
+gboolean               gimp_context_set_sample_transparent    (gboolean                  sample_transparent);
+GimpInterpolationType  gimp_context_get_interpolation         (void);
+gboolean               gimp_context_set_interpolation         (GimpInterpolationType     interpolation);
+GimpTransformDirection gimp_context_get_transform_direction   (void);
+gboolean               gimp_context_set_transform_direction   (GimpTransformDirection    transform_direction);
+GimpTransformResize    gimp_context_get_transform_resize      (void);
+gboolean               gimp_context_set_transform_resize      (GimpTransformResize       transform_resize);
+gint                   gimp_context_get_transform_recursion   (void);
+gboolean               gimp_context_set_transform_recursion   (gint                      transform_recursion);
+gdouble                gimp_context_get_ink_size              (void);
+gboolean               gimp_context_set_ink_size              (gdouble                   size);
+gdouble                gimp_context_get_ink_angle             (void);
+gboolean               gimp_context_set_ink_angle             (gdouble                   angle);
+gdouble                gimp_context_get_ink_size_sensitivity  (void);
+gboolean               gimp_context_set_ink_size_sensitivity  (gdouble                   size);
+gdouble                gimp_context_get_ink_tilt_sensitivity  (void);
+gboolean               gimp_context_set_ink_tilt_sensitivity  (gdouble                   tilt);
+gdouble                gimp_context_get_ink_speed_sensitivity (void);
+gboolean               gimp_context_set_ink_speed_sensitivity (gdouble                   speed);
+GimpInkBlobType        gimp_context_get_ink_blob_type         (void);
+gboolean               gimp_context_set_ink_blob_type         (GimpInkBlobType           type);
+gdouble                gimp_context_get_ink_blob_aspect_ratio (void);
+gboolean               gimp_context_set_ink_blob_aspect_ratio (gdouble                   aspect);
+gdouble                gimp_context_get_ink_blob_angle        (void);
+gboolean               gimp_context_set_ink_blob_angle        (gdouble                   angle);
 
 
 G_END_DECLS
diff --git a/libgimp/gimpenums.c.tail b/libgimp/gimpenums.c.tail
index 333b47c..d5e0bac 100644
--- a/libgimp/gimpenums.c.tail
+++ b/libgimp/gimpenums.c.tail
@@ -28,6 +28,7 @@ static const GimpGetTypeFunc get_type_funcs[] =
   gimp_icon_type_get_type,
   gimp_image_base_type_get_type,
   gimp_image_type_get_type,
+  gimp_ink_blob_type_get_type,
   gimp_interpolation_type_get_type,
   gimp_layer_mode_effects_get_type,
   gimp_mask_apply_mode_get_type,
@@ -84,6 +85,7 @@ static const gchar * const type_names[] =
   "GimpIconType",
   "GimpImageBaseType",
   "GimpImageType",
+  "GimpInkBlobType",
   "GimpInterpolationType",
   "GimpLayerModeEffects",
   "GimpMaskApplyMode",
diff --git a/libgimp/gimpenums.h b/libgimp/gimpenums.h
index d52c978..70a6107 100644
--- a/libgimp/gimpenums.h
+++ b/libgimp/gimpenums.h
@@ -167,6 +167,18 @@ typedef enum
 } GimpHueRange;
 
 
+#define GIMP_TYPE_INK_BLOB_TYPE (gimp_ink_blob_type_get_type ())
+
+GType gimp_ink_blob_type_get_type (void) G_GNUC_CONST;
+
+typedef enum
+{
+  GIMP_INK_BLOB_TYPE_CIRCLE,
+  GIMP_INK_BLOB_TYPE_SQUARE,
+  GIMP_INK_BLOB_TYPE_DIAMOND
+} GimpInkBlobType;
+
+
 #define GIMP_TYPE_LAYER_MODE_EFFECTS (gimp_layer_mode_effects_get_type ())
 
 GType gimp_layer_mode_effects_get_type (void) G_GNUC_CONST;
diff --git a/tools/pdbgen/enums.pl b/tools/pdbgen/enums.pl
index 68568d2..d100aaa 100644
--- a/tools/pdbgen/enums.pl
+++ b/tools/pdbgen/enums.pl
@@ -622,6 +622,16 @@ package Gimp::CodeGen::enums;
 	  symbols => [ qw(GIMP_BLUR_CONVOLVE GIMP_SHARPEN_CONVOLVE) ],
 	  mapping => { GIMP_BLUR_CONVOLVE => '0',
 		       GIMP_SHARPEN_CONVOLVE => '1' }
+	},
+    GimpInkBlobType =>
+	{ contig => 1,
+	  header => 'paint/paint-enums.h',
+	  symbols => [ qw(GIMP_INK_BLOB_TYPE_CIRCLE
+			  GIMP_INK_BLOB_TYPE_SQUARE
+			  GIMP_INK_BLOB_TYPE_DIAMOND) ],
+	  mapping => { GIMP_INK_BLOB_TYPE_CIRCLE => '0',
+		       GIMP_INK_BLOB_TYPE_SQUARE => '1',
+		       GIMP_INK_BLOB_TYPE_DIAMOND => '2' }
 	}
 );
 
diff --git a/tools/pdbgen/pdb/context.pdb b/tools/pdbgen/pdb/context.pdb
index 9c61197..650baa7 100644
--- a/tools/pdbgen/pdb/context.pdb
+++ b/tools/pdbgen/pdb/context.pdb
@@ -487,6 +487,224 @@ CODE
     );
 }
 
+sub context_get_brush_size {
+    $blurb = 'Get brush size in pixels.';
+    $help = 'Get the brush size in pixels for brush based paint tools.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @inargs = (
+        { name => "size", type => "0 < float",
+          desc => "brush size in pixels" }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  /* all options should have the same value, so pick a random one */
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-paintbrush");
+
+  if (options)
+    g_object_get (options,
+                  "brush-size", &size,
+                   NULL);
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
+sub context_set_brush_size {
+    $blurb = 'Set brush size in pixels.';
+    $help = 'Set the brush size in pixels for brush based paint tools.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @inargs = (
+        { name => "size", type => "0 < float",
+          desc => "brush size in pixels" }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  GList *options;
+  GList *list;
+
+  options = gimp_pdb_context_get_brush_options (GIMP_PDB_CONTEXT (context));
+
+  for (list = options; list; list = g_list_next (list))
+    g_object_set (list->data,
+                  "brush-size", (gdouble) size,
+                   NULL);
+
+  g_list_free (options);
+}
+CODE
+    );
+}
+
+sub context_set_brush_default_size {
+    $blurb = 'Set brush size to its default.';
+    $help = <<'HELP';
+Set the brush size to the default (max of width and height) for
+paintbrush, airbrush, or pencil tools.
+HELP
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    %invoke = (
+	code => <<'CODE'
+{
+  GimpBrush *brush = gimp_context_get_brush (context);
+
+  if (brush)
+    {
+      GList *options;
+      GList *list;
+
+      options = gimp_pdb_context_get_brush_options (GIMP_PDB_CONTEXT (context));
+
+      for (list = options; list; list = g_list_next (list))
+        g_object_set (list->data,
+                      "brush-size", (gdouble) MAX (brush->mask->width,
+                                                   brush->mask->height),
+                      NULL);
+
+      g_list_free (options);
+    }
+  else
+    {
+      success = FALSE;
+    }
+}
+CODE
+    );
+}
+
+sub context_set_brush_aspect_ratio {
+    $blurb = 'Set brush aspect ratio.';
+    $help = 'Set the aspect ratio for brush based paint tools.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @inargs = (
+        { name => "aspect", type => "-20 <= float <= 20",
+          desc => "aspect ratio" }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  GList *options;
+  GList *list;
+
+  options = gimp_pdb_context_get_brush_options (GIMP_PDB_CONTEXT (context));
+
+  for (list = options; list; list = g_list_next (list))
+    g_object_set (list->data,
+                  "brush-aspect-ratio", (gdouble) aspect,
+                   NULL);
+
+  g_list_free (options);
+}
+CODE
+    );
+}
+
+sub context_get_brush_aspect_ratio {
+    $blurb = 'Get brush aspect ratio.';
+    $help = 'Set the aspect ratio for brush based paint tools.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @inargs = (
+        { name => "aspect", type => "-20 <= float <= 20",
+          desc => "aspect ratio" }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  /* all options should have the same value, so pick a random one */
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-paintbrush");
+
+  if (options)
+    g_object_get (options,
+                  "brush-aspect-ratio", &aspect,
+                  NULL);
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
+sub context_set_brush_angle {
+    $blurb = 'Set brush angle in degrees.';
+    $help = 'Set the angle in degrees for brush based paint tools.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @inargs = (
+	{ name => "angle", type => "-180 <= float <= 180",
+	  desc => "angle in degrees" }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  GList *options;
+  GList *list;
+
+  options = gimp_pdb_context_get_brush_options (GIMP_PDB_CONTEXT (context));
+
+  for (list = options; list; list = g_list_next (list))
+    g_object_set (list->data,
+                  "brush-angle", (gdouble) angle,
+                   NULL);
+
+  g_list_free (options);
+}
+CODE
+    );
+}
+
+sub context_get_brush_angle {
+    $blurb = 'Get brush angle in degrees.';
+    $help = 'Set the angle in degrees for brush based paint tools.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @inargs = (
+	{ name => "angle", type => "-180 <= float <= 180",
+	  desc => "angle in degrees" }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  /* all options should have the same value, so pick a random one */
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-paintbrush");
+
+  if (options)
+    g_object_get (options,
+                  "brush-angle", &angle,
+                  NULL);
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
 sub context_get_dynamics {
     $blurb = 'Retrieve the currently active paint dynamics.';
 
@@ -1495,7 +1713,491 @@ CODE
     );
 }
 
- headers = qw("core/gimp.h"
+sub context_get_ink_size {
+    $blurb = 'Get ink blob size in pixels.';
+    $help = 'Get the ink blob size in pixels for ink tool.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @outargs = (
+        { name => "size", type => "0 <= float <= 200",
+          desc => "ink blob size in pixels" }
+    );
+
+    %invoke = (
+        code => <<'CODE'
+{
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_get (options,
+                  "size", &size,
+                  NULL);
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
+
+sub context_set_ink_size {
+    $blurb = 'Set ink blob size in pixels.';
+    $help = 'Set the ink blob size in pixels for ink tool.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @inargs = (
+        { name => "size", type => "0 <= float <= 200",
+          desc => "ink blob size in pixels" }
+    );
+
+    %invoke = (
+        code => <<'CODE'
+{
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_set (options,
+                  "size", size,
+                  NULL);
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
+
+sub context_get_ink_angle {
+    $blurb = 'Get ink angle in degrees.';
+    $help = 'Get the ink angle in degrees for ink tool.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @outargs = (
+        { name => "angle", type => "-90 <= float <= 90",
+          desc => "ink angle in degrees" }
+    );
+
+    %invoke = (
+    code => <<'CODE'
+{
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_get (options,
+                  "tilt-angle", &angle,
+                  NULL);
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
+
+sub context_set_ink_angle {
+    $blurb = 'Set ink angle in degrees.';
+    $help = 'Set the ink angle in degrees for ink tool.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @inargs = (
+        { name => "angle", type => "-90 <= float <= 90",
+          desc => "ink angle in degrees" }
+    );
+
+    %invoke = (
+    code => <<'CODE'
+{
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_set (options,
+                  "tilt-angle", angle,
+                  NULL);
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
+
+sub context_get_ink_size_sensitivity {
+    $blurb = 'Get ink size sensitivity.';
+    $help = 'Get the ink size sensitivity for ink tool.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @outargs = (
+        { name => "size", type => "0 <= float <= 1",
+          desc => "ink size sensitivity" }
+    );
+
+    %invoke = (
+    code => <<'CODE'
+{
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_get (options,
+                  "size-sensitivity", &size,
+                  NULL);
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
+
+sub context_set_ink_size_sensitivity {
+    $blurb = 'Set ink size sensitivity.';
+    $help = 'Set the ink size sensitivity for ink tool.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @inargs = (
+        { name => "size", type => "0 <= float <= 1",
+          desc => "ink size sensitivity" }
+    );
+
+    %invoke = (
+    code => <<'CODE'
+{
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_set (options,
+                  "size-sensitivity", size,
+                  NULL);
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
+
+sub context_get_ink_tilt_sensitivity {
+    $blurb = 'Get ink tilt sensitivity.';
+    $help = 'Get the ink tilt sensitivity for ink tool.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @outargs = (
+        { name => "tilt", type => "0 <= float <= 1",
+          desc => "ink tilt sensitivity" }
+    );
+
+    %invoke = (
+    code => <<'CODE'
+{
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_get (options,
+                  "tilt-sensitivity", &tilt,
+                  NULL);
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
+
+sub context_set_ink_tilt_sensitivity {
+    $blurb = 'Set ink tilt sensitivity.';
+    $help = 'Set the ink tilt sensitivity for ink tool.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @inargs = (
+        { name => "tilt", type => "0 <= float <= 1",
+          desc => "ink tilt sensitivity" }
+    );
+
+    %invoke = (
+    code => <<'CODE'
+{
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_set (options,
+                  "tilt-sensitivity", tilt,
+                  NULL);
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
+
+sub context_get_ink_speed_sensitivity {
+    $blurb = 'Get ink speed sensitivity.';
+    $help = 'Get the ink speed sensitivity for ink tool.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @outargs = (
+        { name => "speed", type => "0 <= float <= 1",
+          desc => "ink speed sensitivity" }
+    );
+
+    %invoke = (
+    code => <<'CODE'
+{
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_get (options,
+                  "vel-sensitivity", &speed,
+                  NULL);
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
+
+sub context_set_ink_speed_sensitivity {
+    $blurb = 'Set ink speed sensitivity.';
+    $help = 'Set the ink speed sensitivity for ink tool.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @inargs = (
+        { name => "speed", type => "0 <= float <= 1",
+          desc => "ink speed sensitivity" }
+    );
+
+    %invoke = (
+    code => <<'CODE'
+{
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_set (options,
+                  "vel-sensitivity", speed,
+                  NULL);
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
+
+sub context_get_ink_blob_type {
+    $blurb = 'Get ink blob type.';
+    $help = 'Get the ink blob type for ink tool.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @outargs = (
+        { name => "type", type => "enum GimpInkBlobType",
+          desc => "Ink blob type" }
+    );
+
+    %invoke = (
+    code => <<'CODE'
+{
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_get (options,
+                  "blob-type", &type,
+                  NULL);
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
+
+sub context_set_ink_blob_type {
+    $blurb = 'Set ink blob type.';
+    $help = 'Set the ink blob type for ink tool.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @inargs = (
+        { name => "type", type => "enum GimpInkBlobType",
+          desc => "Ink blob type" }
+    );
+
+    %invoke = (
+    code => <<'CODE'
+{
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_set (options,
+                  "blob-type", type,
+                  NULL);
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
+
+sub context_get_ink_blob_aspect_ratio {
+    $blurb = 'Get ink blob aspect ratio.';
+    $help = 'Get the ink blob aspect ratio for ink tool.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @outargs = (
+        { name => "aspect", type => "1 <= float <= 10",
+          desc => "ink blob aspect ratio" }
+    );
+
+    %invoke = (
+    code => <<'CODE'
+{
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_get (options,
+                  "blob-aspect", &aspect,
+                  NULL);
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
+
+sub context_set_ink_blob_aspect_ratio {
+    $blurb = 'Set ink blob aspect ratio.';
+    $help = 'Set the ink blob aspect ratio for ink tool.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @inargs = (
+        { name => "aspect", type => "1 <= float <= 10",
+          desc => "ink blob aspect ratio" }
+    );
+
+    %invoke = (
+    code => <<'CODE'
+{
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_set (options,
+                  "blob-aspect", aspect,
+                  NULL);
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
+
+sub context_get_ink_blob_angle {
+    $blurb = 'Get ink blob angle in degrees.';
+    $help = 'Get the ink blob angle in degrees for ink tool.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @outargs = (
+        { name => "angle", type => "-180 <= float <= 180",
+          desc => "ink blob angle in degrees" }
+    );
+
+    %invoke = (
+    code => <<'CODE'
+{
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    {
+      g_object_get (options,
+		    "blob-angle", &angle,
+		    NULL);
+      angle *= (180-0 / G_PI);
+    }
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
+
+sub context_set_ink_blob_angle {
+    $blurb = 'Set ink blob angle in degrees.';
+    $help = 'Set the ink blob angle in degrees for ink tool.';
+
+    &ejs_pdb_misc('2012', '2.8');
+
+    @inargs = (
+        { name => "angle", type => "-180 <= float <= 180",
+          desc => "ink blob angle in degrees" }
+    );
+
+    %invoke = (
+    code => <<'CODE'
+{
+  GimpPaintOptions *options =
+    gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
+                                        "gimp-ink");
+
+  if (options)
+    g_object_set (options,
+                  "blob-angle", (gdouble) angle * G_PI / 180.0,
+                  NULL);
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
+ headers = qw("base/temp-buf.h"
+              "core/gimp.h"
+              "core/gimpbrush.h"
               "core/gimpcontainer.h"
               "core/gimpdatafactory.h"
               "libgimpconfig/gimpconfig.h"
@@ -1515,6 +2217,10 @@ CODE
             context_get_opacity context_set_opacity
             context_get_paint_mode context_set_paint_mode
             context_get_brush context_set_brush
+            context_get_brush_size
+            context_set_brush_size context_set_brush_default_size
+            context_get_brush_aspect_ratio context_set_brush_aspect_ratio
+            context_get_brush_angle context_set_brush_angle
             context_get_dynamics context_set_dynamics
             context_get_pattern context_set_pattern
             context_get_gradient context_set_gradient
@@ -1531,7 +2237,15 @@ CODE
             context_get_interpolation context_set_interpolation
             context_get_transform_direction context_set_transform_direction
             context_get_transform_resize context_set_transform_resize
-            context_get_transform_recursion context_set_transform_recursion);
+            context_get_transform_recursion context_set_transform_recursion
+            context_get_ink_size context_set_ink_size
+            context_get_ink_angle context_set_ink_angle
+            context_get_ink_size_sensitivity context_set_ink_size_sensitivity
+            context_get_ink_tilt_sensitivity context_set_ink_tilt_sensitivity
+            context_get_ink_speed_sensitivity context_set_ink_speed_sensitivity
+            context_get_ink_blob_type context_set_ink_blob_type
+            context_get_ink_blob_aspect_ratio context_set_ink_blob_aspect_ratio
+            context_get_ink_blob_angle context_set_ink_blob_angle);
 
 %exports = (app => [ procs], lib => [ procs]);
 
diff --git a/tools/pdbgen/stddefs.pdb b/tools/pdbgen/stddefs.pdb
index 343aa5c..dbd638d 100644
--- a/tools/pdbgen/stddefs.pdb
+++ b/tools/pdbgen/stddefs.pdb
@@ -69,6 +69,10 @@ sub david_pdb_misc {
     contrib_pdb_misc('David Gowers', '', @_);
 }
 
+sub ejs_pdb_misc {
+    contrib_pdb_misc('Ed Swartz', '', @_);
+}
+
 sub federico_pdb_misc {
     contrib_pdb_misc('Federico Mena Quintero', '', @_);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]