mirror of https://github.com/GNOME/gimp.git
Bill Skaggs <weskaggs@primate.ucdavis.edu>
Merged 24822:24845 from trunk. svn path=/branches/weskaggs/; revision=24846
This commit is contained in:
parent
d6d8f88498
commit
b3b75aa36c
|
@ -1,3 +1,7 @@
|
||||||
|
2008-02-09 Bill Skaggs <weskaggs@primate.ucdavis.edu>
|
||||||
|
|
||||||
|
Merged 24822:24845 from trunk.
|
||||||
|
|
||||||
2008-02-09 Bill Skaggs <weskaggs@primate.ucdavis.edu>
|
2008-02-09 Bill Skaggs <weskaggs@primate.ucdavis.edu>
|
||||||
|
|
||||||
Initial implementation of two-column docks. Needs
|
Initial implementation of two-column docks. Needs
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <gegl.h>
|
||||||
|
|
||||||
#include "libgimpbase/gimpbase.h"
|
#include "libgimpbase/gimpbase.h"
|
||||||
#include "libgimpconfig/gimpconfig.h"
|
#include "libgimpconfig/gimpconfig.h"
|
||||||
|
|
|
@ -27,14 +27,23 @@
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
#define _WIN32_WINNT 0x0500
|
#define _WIN32_WINNT 0x0500
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <process.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "base-utils.h"
|
#include "base-utils.h"
|
||||||
|
|
||||||
|
|
||||||
#define NUM_PROCESSORS_DEFAULT 1
|
#define NUM_PROCESSORS_DEFAULT 1
|
||||||
|
|
||||||
|
|
||||||
/* public functions */
|
/* public functions */
|
||||||
|
|
||||||
|
GPid
|
||||||
|
get_pid (void)
|
||||||
|
{
|
||||||
|
return getpid ();
|
||||||
|
}
|
||||||
|
|
||||||
gint
|
gint
|
||||||
get_number_of_processors (void)
|
get_number_of_processors (void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#define __BASE_H__
|
#define __BASE_H__
|
||||||
|
|
||||||
|
|
||||||
|
GPid get_pid (void);
|
||||||
gint get_number_of_processors (void);
|
gint get_number_of_processors (void);
|
||||||
guint64 get_physical_memory_size (void);
|
guint64 get_physical_memory_size (void);
|
||||||
|
|
||||||
|
|
|
@ -21,18 +21,12 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
#include <glib/gstdio.h>
|
#include <glib/gstdio.h>
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
#include <process.h> /* for _getpid() */
|
|
||||||
#include "libgimpbase/gimpwin32-io.h"
|
#include "libgimpbase/gimpwin32-io.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -35,8 +35,6 @@
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "libgimpbase/gimpwin32-io.h"
|
#include "libgimpbase/gimpwin32-io.h"
|
||||||
#include <process.h>
|
|
||||||
#define getpid _getpid
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "base-types.h"
|
#include "base-types.h"
|
||||||
|
@ -48,6 +46,7 @@
|
||||||
#define _O_TEMPORARY 0
|
#define _O_TEMPORARY 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "base-utils.h"
|
||||||
#include "tile.h"
|
#include "tile.h"
|
||||||
#include "tile-rowhints.h"
|
#include "tile-rowhints.h"
|
||||||
#include "tile-swap.h"
|
#include "tile-swap.h"
|
||||||
|
@ -169,7 +168,7 @@ tile_swap_init (const gchar *path)
|
||||||
g_return_if_fail (path != NULL);
|
g_return_if_fail (path != NULL);
|
||||||
|
|
||||||
dirname = gimp_config_path_expand (path, TRUE, NULL);
|
dirname = gimp_config_path_expand (path, TRUE, NULL);
|
||||||
basename = g_strdup_printf ("gimpswap.%lu", (unsigned long) getpid ());
|
basename = g_strdup_printf ("gimpswap.%lu", (unsigned long) get_pid ());
|
||||||
|
|
||||||
/* create the swap directory if it doesn't exist */
|
/* create the swap directory if it doesn't exist */
|
||||||
if (! g_file_test (dirname, G_FILE_TEST_EXISTS))
|
if (! g_file_test (dirname, G_FILE_TEST_EXISTS))
|
||||||
|
|
|
@ -26,18 +26,6 @@
|
||||||
#include <langinfo.h>
|
#include <langinfo.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <glib.h>
|
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
|
||||||
#include <process.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
#include <gobject/gvaluecollector.h>
|
#include <gobject/gvaluecollector.h>
|
||||||
|
|
||||||
|
@ -48,6 +36,8 @@
|
||||||
|
|
||||||
#include "core-types.h"
|
#include "core-types.h"
|
||||||
|
|
||||||
|
#include "base/base-utils.h"
|
||||||
|
|
||||||
#include "config/gimpbaseconfig.h"
|
#include "config/gimpbaseconfig.h"
|
||||||
|
|
||||||
#include "gimp.h"
|
#include "gimp.h"
|
||||||
|
@ -491,7 +481,7 @@ gimp_get_temp_filename (Gimp *gimp,
|
||||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
||||||
|
|
||||||
if (id == 0)
|
if (id == 0)
|
||||||
pid = getpid ();
|
pid = get_pid ();
|
||||||
|
|
||||||
if (extension)
|
if (extension)
|
||||||
basename = g_strdup_printf ("gimp-temp-%d%d.%s", pid, id++, extension);
|
basename = g_strdup_printf ("gimp-temp-%d%d.%s", pid, id++, extension);
|
||||||
|
|
|
@ -331,18 +331,18 @@ gimp_curve_reset (GimpCurve *curve,
|
||||||
curve->curve_type = GIMP_CURVE_SMOOTH;
|
curve->curve_type = GIMP_CURVE_SMOOTH;
|
||||||
|
|
||||||
for (i = 0; i < 256; i++)
|
for (i = 0; i < 256; i++)
|
||||||
curve->curve[i] = i;
|
curve->curve[i] = (gdouble) i / 255.0;
|
||||||
|
|
||||||
for (i = 0; i < GIMP_CURVE_NUM_POINTS; i++)
|
for (i = 0; i < GIMP_CURVE_NUM_POINTS; i++)
|
||||||
{
|
{
|
||||||
curve->points[i][0] = -1;
|
curve->points[i].x = -1.0;
|
||||||
curve->points[i][1] = -1;
|
curve->points[i].y = -1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
curve->points[0][0] = 0;
|
curve->points[0].x = 0.0;
|
||||||
curve->points[0][1] = 0;
|
curve->points[0].y = 0.0;
|
||||||
curve->points[GIMP_CURVE_NUM_POINTS - 1][0] = 255;
|
curve->points[GIMP_CURVE_NUM_POINTS - 1].x = 1.0;
|
||||||
curve->points[GIMP_CURVE_NUM_POINTS - 1][1] = 255;
|
curve->points[GIMP_CURVE_NUM_POINTS - 1].y = 1.0;
|
||||||
|
|
||||||
g_object_freeze_notify (G_OBJECT (curve));
|
g_object_freeze_notify (G_OBJECT (curve));
|
||||||
|
|
||||||
|
@ -371,18 +371,17 @@ gimp_curve_set_curve_type (GimpCurve *curve,
|
||||||
|
|
||||||
if (curve_type == GIMP_CURVE_SMOOTH)
|
if (curve_type == GIMP_CURVE_SMOOTH)
|
||||||
{
|
{
|
||||||
gint i;
|
gint i;
|
||||||
gint32 index;
|
|
||||||
|
|
||||||
/* pick representative points from the curve and make them
|
/* pick representative points from the curve and make them
|
||||||
* control points
|
* control points
|
||||||
*/
|
*/
|
||||||
for (i = 0; i <= 8; i++)
|
for (i = 0; i <= 8; i++)
|
||||||
{
|
{
|
||||||
index = CLAMP0255 (i * 32);
|
gint32 index = CLAMP0255 (i * 32);
|
||||||
|
|
||||||
curve->points[i * 2][0] = index;
|
curve->points[i * 2].x = (gdouble) index / 255.0;
|
||||||
curve->points[i * 2][1] = curve->curve[index];
|
curve->points[i * 2].y = curve->curve[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (curve), "points");
|
g_object_notify (G_OBJECT (curve), "points");
|
||||||
|
@ -404,30 +403,30 @@ gimp_curve_get_curve_type (GimpCurve *curve)
|
||||||
return curve->curve_type;
|
return curve->curve_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MIN_DISTANCE 8
|
#define MIN_DISTANCE (8.0 / 255.0)
|
||||||
|
|
||||||
gint
|
gint
|
||||||
gimp_curve_get_closest_point (GimpCurve *curve,
|
gimp_curve_get_closest_point (GimpCurve *curve,
|
||||||
gint x)
|
gdouble x)
|
||||||
{
|
{
|
||||||
gint closest_point = 0;
|
gint closest_point = 0;
|
||||||
gint distance = G_MAXINT;
|
gdouble distance = G_MAXDOUBLE;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_CURVE (curve), 0);
|
g_return_val_if_fail (GIMP_IS_CURVE (curve), 0);
|
||||||
|
|
||||||
for (i = 0; i < GIMP_CURVE_NUM_POINTS; i++)
|
for (i = 0; i < GIMP_CURVE_NUM_POINTS; i++)
|
||||||
{
|
{
|
||||||
if (curve->points[i][0] != -1)
|
if (curve->points[i].x >= 0.0 &&
|
||||||
if (abs (x - curve->points[i][0]) < distance)
|
fabs (x - curve->points[i].x) < distance)
|
||||||
{
|
{
|
||||||
distance = abs (x - curve->points[i][0]);
|
distance = fabs (x - curve->points[i].x);
|
||||||
closest_point = i;
|
closest_point = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (distance > MIN_DISTANCE)
|
if (distance > MIN_DISTANCE)
|
||||||
closest_point = (x + 8) / 16;
|
closest_point = ((gint) (x * 255.999) + 8) / 16;
|
||||||
|
|
||||||
return closest_point;
|
return closest_point;
|
||||||
}
|
}
|
||||||
|
@ -435,8 +434,8 @@ gimp_curve_get_closest_point (GimpCurve *curve,
|
||||||
void
|
void
|
||||||
gimp_curve_set_point (GimpCurve *curve,
|
gimp_curve_set_point (GimpCurve *curve,
|
||||||
gint point,
|
gint point,
|
||||||
gint x,
|
gdouble x,
|
||||||
gint y)
|
gdouble y)
|
||||||
{
|
{
|
||||||
g_return_if_fail (GIMP_IS_CURVE (curve));
|
g_return_if_fail (GIMP_IS_CURVE (curve));
|
||||||
|
|
||||||
|
@ -445,8 +444,8 @@ gimp_curve_set_point (GimpCurve *curve,
|
||||||
|
|
||||||
g_object_freeze_notify (G_OBJECT (curve));
|
g_object_freeze_notify (G_OBJECT (curve));
|
||||||
|
|
||||||
curve->points[point][0] = x;
|
curve->points[point].x = x;
|
||||||
curve->points[point][1] = y;
|
curve->points[point].y = y;
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (curve), "points");
|
g_object_notify (G_OBJECT (curve), "points");
|
||||||
|
|
||||||
|
@ -458,7 +457,7 @@ gimp_curve_set_point (GimpCurve *curve,
|
||||||
void
|
void
|
||||||
gimp_curve_move_point (GimpCurve *curve,
|
gimp_curve_move_point (GimpCurve *curve,
|
||||||
gint point,
|
gint point,
|
||||||
gint y)
|
gdouble y)
|
||||||
{
|
{
|
||||||
g_return_if_fail (GIMP_IS_CURVE (curve));
|
g_return_if_fail (GIMP_IS_CURVE (curve));
|
||||||
|
|
||||||
|
@ -467,7 +466,7 @@ gimp_curve_move_point (GimpCurve *curve,
|
||||||
|
|
||||||
g_object_freeze_notify (G_OBJECT (curve));
|
g_object_freeze_notify (G_OBJECT (curve));
|
||||||
|
|
||||||
curve->points[point][1] = y;
|
curve->points[point].y = y;
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (curve), "points");
|
g_object_notify (G_OBJECT (curve), "points");
|
||||||
|
|
||||||
|
@ -478,8 +477,8 @@ gimp_curve_move_point (GimpCurve *curve,
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_curve_set_curve (GimpCurve *curve,
|
gimp_curve_set_curve (GimpCurve *curve,
|
||||||
gint x,
|
gdouble x,
|
||||||
gint y)
|
gdouble y)
|
||||||
{
|
{
|
||||||
g_return_if_fail (GIMP_IS_CURVE (curve));
|
g_return_if_fail (GIMP_IS_CURVE (curve));
|
||||||
|
|
||||||
|
@ -488,7 +487,7 @@ gimp_curve_set_curve (GimpCurve *curve,
|
||||||
|
|
||||||
g_object_freeze_notify (G_OBJECT (curve));
|
g_object_freeze_notify (G_OBJECT (curve));
|
||||||
|
|
||||||
curve->curve[x] = y;
|
curve->curve[(gint) (x * 255.999)] = y;
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (curve), "curve");
|
g_object_notify (G_OBJECT (curve), "curve");
|
||||||
|
|
||||||
|
@ -497,14 +496,45 @@ gimp_curve_set_curve (GimpCurve *curve,
|
||||||
gimp_data_dirty (GIMP_DATA (curve));
|
gimp_data_dirty (GIMP_DATA (curve));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gdouble
|
||||||
|
gimp_curve_map (GimpCurve *curve,
|
||||||
|
gdouble x)
|
||||||
|
{
|
||||||
|
gdouble value;
|
||||||
|
|
||||||
|
g_return_val_if_fail (GIMP_IS_CURVE (curve), 0.0);
|
||||||
|
|
||||||
|
if (x < 0.0)
|
||||||
|
{
|
||||||
|
value = curve->curve[0];
|
||||||
|
}
|
||||||
|
else if (x >= 1.0)
|
||||||
|
{
|
||||||
|
value = curve->curve[255];
|
||||||
|
}
|
||||||
|
else /* interpolate the curve */
|
||||||
|
{
|
||||||
|
gint index = floor (x * 255.0);
|
||||||
|
gdouble f = x * 255.0 - index;
|
||||||
|
|
||||||
|
value = ((1.0 - f) * curve->curve[index ] +
|
||||||
|
f * curve->curve[index + 1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_curve_get_uchar (GimpCurve *curve,
|
gimp_curve_get_uchar (GimpCurve *curve,
|
||||||
guchar *dest_array)
|
guchar *dest_array)
|
||||||
{
|
{
|
||||||
|
gint i;
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_CURVE (curve));
|
g_return_if_fail (GIMP_IS_CURVE (curve));
|
||||||
g_return_if_fail (dest_array != NULL);
|
g_return_if_fail (dest_array != NULL);
|
||||||
|
|
||||||
memcpy (dest_array, curve->curve, 256);
|
for (i = 0; i < 256; i++)
|
||||||
|
dest_array[i] = curve->curve[i] * 255.999;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -527,17 +557,17 @@ gimp_curve_calculate (GimpCurve *curve)
|
||||||
/* cycle through the curves */
|
/* cycle through the curves */
|
||||||
num_pts = 0;
|
num_pts = 0;
|
||||||
for (i = 0; i < GIMP_CURVE_NUM_POINTS; i++)
|
for (i = 0; i < GIMP_CURVE_NUM_POINTS; i++)
|
||||||
if (curve->points[i][0] != -1)
|
if (curve->points[i].x >= 0.0)
|
||||||
points[num_pts++] = i;
|
points[num_pts++] = i;
|
||||||
|
|
||||||
/* Initialize boundary curve points */
|
/* Initialize boundary curve points */
|
||||||
if (num_pts != 0)
|
if (num_pts != 0)
|
||||||
{
|
{
|
||||||
for (i = 0; i < curve->points[points[0]][0]; i++)
|
for (i = 0; i < (gint) (curve->points[points[0]].x * 255.999); i++)
|
||||||
curve->curve[i] = curve->points[points[0]][1];
|
curve->curve[i] = curve->points[points[0]].y;
|
||||||
|
|
||||||
for (i = curve->points[points[num_pts - 1]][0]; i < 256; i++)
|
for (i = (gint) (curve->points[points[num_pts - 1]].x * 255.999); i < 256; i++)
|
||||||
curve->curve[i] = curve->points[points[num_pts - 1]][1];
|
curve->curve[i] = curve->points[points[num_pts - 1]].y;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < num_pts - 1; i++)
|
for (i = 0; i < num_pts - 1; i++)
|
||||||
|
@ -553,10 +583,10 @@ gimp_curve_calculate (GimpCurve *curve)
|
||||||
/* ensure that the control points are used exactly */
|
/* ensure that the control points are used exactly */
|
||||||
for (i = 0; i < num_pts; i++)
|
for (i = 0; i < num_pts; i++)
|
||||||
{
|
{
|
||||||
gint x = curve->points[points[i]][0];
|
gdouble x = curve->points[points[i]].x;
|
||||||
gint y = curve->points[points[i]][1];
|
gdouble y = curve->points[points[i]].y;
|
||||||
|
|
||||||
curve->curve[x] = y;
|
curve->curve[(gint) (x * 255.999)] = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (curve), "curve");
|
g_object_notify (G_OBJECT (curve), "curve");
|
||||||
|
@ -591,10 +621,10 @@ gimp_curve_plot (GimpCurve *curve,
|
||||||
gdouble slope;
|
gdouble slope;
|
||||||
|
|
||||||
/* the outer control points for the bezier curve. */
|
/* the outer control points for the bezier curve. */
|
||||||
x0 = curve->points[p2][0];
|
x0 = curve->points[p2].x;
|
||||||
y0 = curve->points[p2][1];
|
y0 = curve->points[p2].y;
|
||||||
x3 = curve->points[p3][0];
|
x3 = curve->points[p3].x;
|
||||||
y3 = curve->points[p3][1];
|
y3 = curve->points[p3].y;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* the x values of the inner control points are fixed at
|
* the x values of the inner control points are fixed at
|
||||||
|
@ -625,8 +655,8 @@ gimp_curve_plot (GimpCurve *curve,
|
||||||
* the control handle of the right tangent, to ensure that the curve
|
* the control handle of the right tangent, to ensure that the curve
|
||||||
* does not have an inflection point.
|
* does not have an inflection point.
|
||||||
*/
|
*/
|
||||||
slope = (curve->points[p4][1] - y0) /
|
slope = (curve->points[p4].y - y0) /
|
||||||
(curve->points[p4][0] - x0);
|
(curve->points[p4].x - x0);
|
||||||
|
|
||||||
y2 = y3 - slope * dx / 3.0;
|
y2 = y3 - slope * dx / 3.0;
|
||||||
y1 = y0 + (y2 - y0) / 2.0;
|
y1 = y0 + (y2 - y0) / 2.0;
|
||||||
|
@ -634,8 +664,8 @@ gimp_curve_plot (GimpCurve *curve,
|
||||||
else if (p1 != p2 && p3 == p4)
|
else if (p1 != p2 && p3 == p4)
|
||||||
{
|
{
|
||||||
/* see previous case */
|
/* see previous case */
|
||||||
slope = (y3 - curve->points[p1][1]) /
|
slope = (y3 - curve->points[p1].y) /
|
||||||
(x3 - curve->points[p1][0]);
|
(x3 - curve->points[p1].x);
|
||||||
|
|
||||||
y1 = y0 + slope * dx / 3.0;
|
y1 = y0 + slope * dx / 3.0;
|
||||||
y2 = y3 + (y1 - y3) / 2.0;
|
y2 = y3 + (y1 - y3) / 2.0;
|
||||||
|
@ -646,13 +676,13 @@ gimp_curve_plot (GimpCurve *curve,
|
||||||
* parallel to the line between the opposite endpoint and the adjacent
|
* parallel to the line between the opposite endpoint and the adjacent
|
||||||
* neighbor.
|
* neighbor.
|
||||||
*/
|
*/
|
||||||
slope = (y3 - curve->points[p1][1]) /
|
slope = (y3 - curve->points[p1].y) /
|
||||||
(x3 - curve->points[p1][0]);
|
(x3 - curve->points[p1].x);
|
||||||
|
|
||||||
y1 = y0 + slope * dx / 3.0;
|
y1 = y0 + slope * dx / 3.0;
|
||||||
|
|
||||||
slope = (curve->points[p4][1] - y0) /
|
slope = (curve->points[p4].y - y0) /
|
||||||
(curve->points[p4][0] - x0);
|
(curve->points[p4].x - x0);
|
||||||
|
|
||||||
y2 = y3 - slope * dx / 3.0;
|
y2 = y3 - slope * dx / 3.0;
|
||||||
}
|
}
|
||||||
|
@ -661,14 +691,14 @@ gimp_curve_plot (GimpCurve *curve,
|
||||||
* finally calculate the y(t) values for the given bezier values. We can
|
* finally calculate the y(t) values for the given bezier values. We can
|
||||||
* use homogenously distributed values for t, since x(t) increases linearily.
|
* use homogenously distributed values for t, since x(t) increases linearily.
|
||||||
*/
|
*/
|
||||||
for (i = 0; i <= dx; i++)
|
for (i = 0; i <= (gint) (dx * 255.999); i++)
|
||||||
{
|
{
|
||||||
t = i / dx;
|
t = i / dx / 255.0;
|
||||||
y = y0 * (1-t) * (1-t) * (1-t) +
|
y = y0 * (1-t) * (1-t) * (1-t) +
|
||||||
3 * y1 * (1-t) * (1-t) * t +
|
3 * y1 * (1-t) * (1-t) * t +
|
||||||
3 * y2 * (1-t) * t * t +
|
3 * y2 * (1-t) * t * t +
|
||||||
y3 * t * t * t;
|
y3 * t * t * t;
|
||||||
|
|
||||||
curve->curve[ROUND(x0) + i] = CLAMP0255 (ROUND (y));
|
curve->curve[(gint) (x0 * 255.999) + i] = CLAMP (y, 0.0, 1.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "gimpdata.h"
|
#include "gimpdata.h"
|
||||||
|
#include "libgimpmath/gimpvector.h"
|
||||||
|
|
||||||
|
|
||||||
#define GIMP_CURVE_NUM_POINTS 17 /* TODO: get rid of this limit */
|
#define GIMP_CURVE_NUM_POINTS 17 /* TODO: get rid of this limit */
|
||||||
|
@ -42,8 +43,8 @@ struct _GimpCurve
|
||||||
|
|
||||||
GimpCurveType curve_type;
|
GimpCurveType curve_type;
|
||||||
|
|
||||||
gint points[GIMP_CURVE_NUM_POINTS][2];
|
GimpVector2 points[GIMP_CURVE_NUM_POINTS];
|
||||||
guchar curve[256];
|
gdouble curve[256];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GimpCurveClass
|
struct _GimpCurveClass
|
||||||
|
@ -65,18 +66,21 @@ void gimp_curve_set_curve_type (GimpCurve *curve,
|
||||||
GimpCurveType gimp_curve_get_curve_type (GimpCurve *curve);
|
GimpCurveType gimp_curve_get_curve_type (GimpCurve *curve);
|
||||||
|
|
||||||
gint gimp_curve_get_closest_point (GimpCurve *curve,
|
gint gimp_curve_get_closest_point (GimpCurve *curve,
|
||||||
gint x);
|
gdouble x);
|
||||||
void gimp_curve_set_point (GimpCurve *curve,
|
void gimp_curve_set_point (GimpCurve *curve,
|
||||||
gint point,
|
gint point,
|
||||||
gint x,
|
gdouble x,
|
||||||
gint y);
|
gdouble y);
|
||||||
void gimp_curve_move_point (GimpCurve *curve,
|
void gimp_curve_move_point (GimpCurve *curve,
|
||||||
gint point,
|
gint point,
|
||||||
gint y);
|
gdouble y);
|
||||||
|
|
||||||
void gimp_curve_set_curve (GimpCurve *curve,
|
void gimp_curve_set_curve (GimpCurve *curve,
|
||||||
gint x,
|
gdouble x,
|
||||||
gint y);
|
gdouble y);
|
||||||
|
|
||||||
|
gdouble gimp_curve_map (GimpCurve *curve,
|
||||||
|
gdouble x);
|
||||||
|
|
||||||
void gimp_curve_get_uchar (GimpCurve *curve,
|
void gimp_curve_get_uchar (GimpCurve *curve,
|
||||||
guchar *dest_array);
|
guchar *dest_array);
|
||||||
|
|
|
@ -128,7 +128,9 @@ gimp_drawable_curves_explicit (GimpDrawable *drawable,
|
||||||
gimp_curve_set_curve_type (curve, GIMP_CURVE_SMOOTH);
|
gimp_curve_set_curve_type (curve, GIMP_CURVE_SMOOTH);
|
||||||
|
|
||||||
for (i = 0; i < 256; i++)
|
for (i = 0; i < 256; i++)
|
||||||
gimp_curve_set_curve (curve, i, points[i]);
|
gimp_curve_set_curve (curve,
|
||||||
|
(gdouble) i / 255.0,
|
||||||
|
(gdouble) points[i] / 255.0);
|
||||||
|
|
||||||
gimp_data_thaw (GIMP_DATA (curve));
|
gimp_data_thaw (GIMP_DATA (curve));
|
||||||
|
|
||||||
|
|
|
@ -465,16 +465,24 @@ gimp_image_map_apply (GimpImageMap *image_map,
|
||||||
g_object_unref (sink_operation);
|
g_object_unref (sink_operation);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gegl_node_get_pad (image_map->operation, "input"))
|
if (gegl_node_get_pad (image_map->operation, "input") &&
|
||||||
|
gegl_node_get_pad (image_map->operation, "output"))
|
||||||
{
|
{
|
||||||
|
/* if there are input and output pads we probably have a
|
||||||
|
* filter OP, connect it on both ends.
|
||||||
|
*/
|
||||||
gegl_node_link_many (image_map->input,
|
gegl_node_link_many (image_map->input,
|
||||||
image_map->shift,
|
image_map->shift,
|
||||||
image_map->operation,
|
image_map->operation,
|
||||||
image_map->output,
|
image_map->output,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
else
|
else if (gegl_node_get_pad (image_map->operation, "output"))
|
||||||
{
|
{
|
||||||
|
/* if there is only an output pad we probably have a
|
||||||
|
* source OP, blend its result on top of the original
|
||||||
|
* pixels.
|
||||||
|
*/
|
||||||
GeglNode *over = gegl_node_new_child (image_map->gegl,
|
GeglNode *over = gegl_node_new_child (image_map->gegl,
|
||||||
"operation", "over",
|
"operation", "over",
|
||||||
NULL);
|
NULL);
|
||||||
|
@ -488,6 +496,15 @@ gimp_image_map_apply (GimpImageMap *image_map,
|
||||||
gegl_node_connect_to (image_map->operation, "output",
|
gegl_node_connect_to (image_map->operation, "output",
|
||||||
over, "aux");
|
over, "aux");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* otherwise we just construct a silly nop pipleline
|
||||||
|
*/
|
||||||
|
gegl_node_link_many (image_map->input,
|
||||||
|
image_map->shift,
|
||||||
|
image_map->output,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gegl_node_set (image_map->input,
|
gegl_node_set (image_map->input,
|
||||||
|
|
|
@ -296,7 +296,7 @@ tips_parser_end_element (GMarkupParseContext *context,
|
||||||
switch (parser->state)
|
switch (parser->state)
|
||||||
{
|
{
|
||||||
case TIPS_START:
|
case TIPS_START:
|
||||||
g_warning ("tips_parser: This shouldn't happen.\n");
|
g_warning ("%s: shouldn't get here", G_STRLOC);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TIPS_IN_TIPS:
|
case TIPS_IN_TIPS:
|
||||||
|
|
|
@ -373,7 +373,9 @@ gimp_curves_config_load_cruft (GimpCurvesConfig *config,
|
||||||
gimp_curve_set_curve_type (curve, GIMP_CURVE_SMOOTH);
|
gimp_curve_set_curve_type (curve, GIMP_CURVE_SMOOTH);
|
||||||
|
|
||||||
for (j = 0; j < GIMP_CURVE_NUM_POINTS; j++)
|
for (j = 0; j < GIMP_CURVE_NUM_POINTS; j++)
|
||||||
gimp_curve_set_point (curve, j, index[i][j], value[i][j]);
|
gimp_curve_set_point (curve, j,
|
||||||
|
(gdouble) index[i][j] / 255.0,
|
||||||
|
(gdouble) value[i][j] / 255.0);
|
||||||
|
|
||||||
gimp_data_thaw (GIMP_DATA (curve));
|
gimp_data_thaw (GIMP_DATA (curve));
|
||||||
}
|
}
|
||||||
|
@ -387,9 +389,8 @@ gboolean
|
||||||
gimp_curves_config_save_cruft (GimpCurvesConfig *config,
|
gimp_curves_config_save_cruft (GimpCurvesConfig *config,
|
||||||
gpointer fp)
|
gpointer fp)
|
||||||
{
|
{
|
||||||
FILE *file = fp;
|
FILE *file = fp;
|
||||||
gint i, j;
|
gint i;
|
||||||
gint32 index;
|
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_CURVES_CONFIG (config), FALSE);
|
g_return_val_if_fail (GIMP_IS_CURVES_CONFIG (config), FALSE);
|
||||||
g_return_val_if_fail (file != NULL, FALSE);
|
g_return_val_if_fail (file != NULL, FALSE);
|
||||||
|
@ -399,6 +400,7 @@ gimp_curves_config_save_cruft (GimpCurvesConfig *config,
|
||||||
for (i = 0; i < 5; i++)
|
for (i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
GimpCurve *curve = config->curve[i];
|
GimpCurve *curve = config->curve[i];
|
||||||
|
gint j;
|
||||||
|
|
||||||
if (curve->curve_type == GIMP_CURVE_FREE)
|
if (curve->curve_type == GIMP_CURVE_FREE)
|
||||||
{
|
{
|
||||||
|
@ -407,17 +409,17 @@ gimp_curves_config_save_cruft (GimpCurvesConfig *config,
|
||||||
*/
|
*/
|
||||||
for (j = 0; j <= 8; j++)
|
for (j = 0; j <= 8; j++)
|
||||||
{
|
{
|
||||||
index = CLAMP0255 (j * 32);
|
gint32 index = CLAMP0255 (j * 32);
|
||||||
|
|
||||||
curve->points[j * 2][0] = index;
|
curve->points[j * 2].x = (gdouble) index / 255.0;
|
||||||
curve->points[j * 2][1] = curve->curve[index];
|
curve->points[j * 2].y = curve->curve[index];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (j = 0; j < GIMP_CURVE_NUM_POINTS; j++)
|
for (j = 0; j < GIMP_CURVE_NUM_POINTS; j++)
|
||||||
fprintf (file, "%d %d ",
|
fprintf (file, "%d %d ",
|
||||||
curve->points[j][0],
|
(gint) (curve->points[j].x * 255.999),
|
||||||
curve->points[j][1]);
|
(gint) (curve->points[j].y * 255.999));
|
||||||
|
|
||||||
fprintf (file, "\n");
|
fprintf (file, "\n");
|
||||||
}
|
}
|
||||||
|
@ -442,11 +444,13 @@ gimp_curves_config_to_cruft (GimpCurvesConfig *config,
|
||||||
channel <= GIMP_HISTOGRAM_ALPHA;
|
channel <= GIMP_HISTOGRAM_ALPHA;
|
||||||
channel++)
|
channel++)
|
||||||
{
|
{
|
||||||
gimp_curve_get_uchar (config->curve[channel], cruft->curve[channel]);
|
gimp_curve_get_uchar (config->curve[channel],
|
||||||
|
cruft->curve[channel]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! is_color)
|
if (! is_color)
|
||||||
{
|
{
|
||||||
gimp_curve_get_uchar (config->curve[GIMP_HISTOGRAM_ALPHA], cruft->curve[1]);
|
gimp_curve_get_uchar (config->curve[GIMP_HISTOGRAM_ALPHA],
|
||||||
|
cruft->curve[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,30 +75,6 @@ gimp_operation_curves_init (GimpOperationCurves *self)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline gdouble
|
|
||||||
gimp_operation_curves_map (gdouble value,
|
|
||||||
GimpCurve *curve)
|
|
||||||
{
|
|
||||||
if (value < 0.0)
|
|
||||||
{
|
|
||||||
value = curve->curve[0] / 255.0;
|
|
||||||
}
|
|
||||||
else if (value >= 1.0)
|
|
||||||
{
|
|
||||||
value = curve->curve[255] / 255.0;
|
|
||||||
}
|
|
||||||
else /* interpolate the curve */
|
|
||||||
{
|
|
||||||
gint index = floor (value * 255.0);
|
|
||||||
gdouble f = value * 255.0 - index;
|
|
||||||
|
|
||||||
value = ((1.0 - f) * curve->curve[index ] +
|
|
||||||
f * curve->curve[index + 1] ) / 255.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gimp_operation_curves_process (GeglOperation *operation,
|
gimp_operation_curves_process (GeglOperation *operation,
|
||||||
void *in_buf,
|
void *in_buf,
|
||||||
|
@ -121,13 +97,11 @@ gimp_operation_curves_process (GeglOperation *operation,
|
||||||
{
|
{
|
||||||
gdouble value;
|
gdouble value;
|
||||||
|
|
||||||
value = gimp_operation_curves_map (src[channel],
|
value = gimp_curve_map (config->curve[channel + 1], src[channel]);
|
||||||
config->curve[channel + 1]);
|
|
||||||
|
|
||||||
/* don't apply the overall curve to the alpha channel */
|
/* don't apply the overall curve to the alpha channel */
|
||||||
if (channel != ALPHA_PIX)
|
if (channel != ALPHA_PIX)
|
||||||
value = gimp_operation_curves_map (value,
|
value = gimp_curve_map (config->curve[0], value);
|
||||||
config->curve[0]);
|
|
||||||
|
|
||||||
dest[channel] = value;
|
dest[channel] = value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ static void gimp_operation_tile_source_set_property (GObject *object,
|
||||||
|
|
||||||
static void gimp_operation_tile_source_prepare (GeglOperation *operation);
|
static void gimp_operation_tile_source_prepare (GeglOperation *operation);
|
||||||
static GeglRectangle
|
static GeglRectangle
|
||||||
gimp_operation_tile_source_get_defined_region (GeglOperation *operation);
|
gimp_operation_tile_source_get_bounding_box (GeglOperation *operation);
|
||||||
static gboolean gimp_operation_tile_source_process (GeglOperation *operation,
|
static gboolean gimp_operation_tile_source_process (GeglOperation *operation,
|
||||||
GeglNodeContext *context,
|
GeglNodeContext *context,
|
||||||
GeglBuffer *output,
|
GeglBuffer *output,
|
||||||
|
@ -81,8 +81,8 @@ gimp_operation_tile_source_class_init (GimpOperationTileSourceClass *klass)
|
||||||
|
|
||||||
operation_class->name = "gimp-tilemanager-source";
|
operation_class->name = "gimp-tilemanager-source";
|
||||||
operation_class->prepare = gimp_operation_tile_source_prepare;
|
operation_class->prepare = gimp_operation_tile_source_prepare;
|
||||||
operation_class->get_defined_region = gimp_operation_tile_source_get_defined_region;
|
operation_class->get_bounding_box = gimp_operation_tile_source_get_bounding_box;
|
||||||
operation_class->adjust_result_region = NULL; /* the default source is
|
operation_class->get_cached_region = NULL; /* the default source is
|
||||||
expanding to agressivly
|
expanding to agressivly
|
||||||
make use of available caching,
|
make use of available caching,
|
||||||
this behavior is at least a
|
this behavior is at least a
|
||||||
|
@ -197,7 +197,7 @@ gimp_operation_tile_source_prepare (GeglOperation *operation)
|
||||||
}
|
}
|
||||||
|
|
||||||
static GeglRectangle
|
static GeglRectangle
|
||||||
gimp_operation_tile_source_get_defined_region (GeglOperation *operation)
|
gimp_operation_tile_source_get_bounding_box (GeglOperation *operation)
|
||||||
{
|
{
|
||||||
GimpOperationTileSource *self = GIMP_OPERATION_TILE_SOURCE (operation);
|
GimpOperationTileSource *self = GIMP_OPERATION_TILE_SOURCE (operation);
|
||||||
GeglRectangle result = { 0, };
|
GeglRectangle result = { 0, };
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
|
|
||||||
#include "base/pixel-region.h"
|
#include "base/pixel-region.h"
|
||||||
#include "base/temp-buf.h"
|
#include "base/temp-buf.h"
|
||||||
#include "base/tile-manager.h"
|
|
||||||
|
|
||||||
#include "paint-funcs/paint-funcs.h"
|
#include "paint-funcs/paint-funcs.h"
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
|
|
||||||
#include "base/pixel-region.h"
|
#include "base/pixel-region.h"
|
||||||
#include "base/temp-buf.h"
|
#include "base/temp-buf.h"
|
||||||
#include "base/tile-manager.h"
|
|
||||||
|
|
||||||
#include "core/gimppickable.h"
|
#include "core/gimppickable.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
|
|
|
@ -28,8 +28,6 @@
|
||||||
|
|
||||||
#include "base/pixel-region.h"
|
#include "base/pixel-region.h"
|
||||||
#include "base/temp-buf.h"
|
#include "base/temp-buf.h"
|
||||||
#include "base/tile.h"
|
|
||||||
#include "base/tile-manager.h"
|
|
||||||
|
|
||||||
#include "paint-funcs/paint-funcs.h"
|
#include "paint-funcs/paint-funcs.h"
|
||||||
|
|
||||||
|
|
|
@ -25,9 +25,6 @@
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "base/temp-buf.h"
|
#include "base/temp-buf.h"
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
|
@ -35,8 +32,11 @@
|
||||||
#include "core/gimpbrushgenerated.h"
|
#include "core/gimpbrushgenerated.h"
|
||||||
#include "core/gimpcontext.h"
|
#include "core/gimpcontext.h"
|
||||||
#include "core/gimpdatafactory.h"
|
#include "core/gimpdatafactory.h"
|
||||||
#include "gimppdb-utils.h"
|
#include "core/gimpparamspecs.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimppdb-utils.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -452,171 +452,6 @@ brush_get_shape_invoker (GimpProcedure *procedure,
|
||||||
return return_vals;
|
return return_vals;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GValueArray *
|
|
||||||
brush_get_radius_invoker (GimpProcedure *procedure,
|
|
||||||
Gimp *gimp,
|
|
||||||
GimpContext *context,
|
|
||||||
GimpProgress *progress,
|
|
||||||
const GValueArray *args,
|
|
||||||
GError **error)
|
|
||||||
{
|
|
||||||
gboolean success = TRUE;
|
|
||||||
GValueArray *return_vals;
|
|
||||||
const gchar *name;
|
|
||||||
gdouble radius = 0.0;
|
|
||||||
|
|
||||||
name = g_value_get_string (&args->values[0]);
|
|
||||||
|
|
||||||
if (success)
|
|
||||||
{
|
|
||||||
GimpBrush *brush = gimp_pdb_get_generated_brush (gimp, name, FALSE, error);
|
|
||||||
|
|
||||||
if (brush)
|
|
||||||
radius = GIMP_BRUSH_GENERATED (brush)->radius;
|
|
||||||
else
|
|
||||||
success = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return_vals = gimp_procedure_get_return_values (procedure, success);
|
|
||||||
|
|
||||||
if (success)
|
|
||||||
g_value_set_double (&return_vals->values[1], radius);
|
|
||||||
|
|
||||||
return return_vals;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GValueArray *
|
|
||||||
brush_get_spikes_invoker (GimpProcedure *procedure,
|
|
||||||
Gimp *gimp,
|
|
||||||
GimpContext *context,
|
|
||||||
GimpProgress *progress,
|
|
||||||
const GValueArray *args,
|
|
||||||
GError **error)
|
|
||||||
{
|
|
||||||
gboolean success = TRUE;
|
|
||||||
GValueArray *return_vals;
|
|
||||||
const gchar *name;
|
|
||||||
gint32 spikes = 0;
|
|
||||||
|
|
||||||
name = g_value_get_string (&args->values[0]);
|
|
||||||
|
|
||||||
if (success)
|
|
||||||
{
|
|
||||||
GimpBrush *brush = gimp_pdb_get_generated_brush (gimp, name, FALSE, error);
|
|
||||||
|
|
||||||
if (brush)
|
|
||||||
spikes = GIMP_BRUSH_GENERATED (brush)->spikes;
|
|
||||||
else
|
|
||||||
success = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return_vals = gimp_procedure_get_return_values (procedure, success);
|
|
||||||
|
|
||||||
if (success)
|
|
||||||
g_value_set_int (&return_vals->values[1], spikes);
|
|
||||||
|
|
||||||
return return_vals;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GValueArray *
|
|
||||||
brush_get_hardness_invoker (GimpProcedure *procedure,
|
|
||||||
Gimp *gimp,
|
|
||||||
GimpContext *context,
|
|
||||||
GimpProgress *progress,
|
|
||||||
const GValueArray *args,
|
|
||||||
GError **error)
|
|
||||||
{
|
|
||||||
gboolean success = TRUE;
|
|
||||||
GValueArray *return_vals;
|
|
||||||
const gchar *name;
|
|
||||||
gdouble hardness = 0.0;
|
|
||||||
|
|
||||||
name = g_value_get_string (&args->values[0]);
|
|
||||||
|
|
||||||
if (success)
|
|
||||||
{
|
|
||||||
GimpBrush *brush = gimp_pdb_get_generated_brush (gimp, name, FALSE, error);
|
|
||||||
|
|
||||||
if (brush)
|
|
||||||
hardness = GIMP_BRUSH_GENERATED (brush)->hardness;
|
|
||||||
else
|
|
||||||
success = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return_vals = gimp_procedure_get_return_values (procedure, success);
|
|
||||||
|
|
||||||
if (success)
|
|
||||||
g_value_set_double (&return_vals->values[1], hardness);
|
|
||||||
|
|
||||||
return return_vals;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GValueArray *
|
|
||||||
brush_get_aspect_ratio_invoker (GimpProcedure *procedure,
|
|
||||||
Gimp *gimp,
|
|
||||||
GimpContext *context,
|
|
||||||
GimpProgress *progress,
|
|
||||||
const GValueArray *args,
|
|
||||||
GError **error)
|
|
||||||
{
|
|
||||||
gboolean success = TRUE;
|
|
||||||
GValueArray *return_vals;
|
|
||||||
const gchar *name;
|
|
||||||
gdouble aspect_ratio = 0.0;
|
|
||||||
|
|
||||||
name = g_value_get_string (&args->values[0]);
|
|
||||||
|
|
||||||
if (success)
|
|
||||||
{
|
|
||||||
GimpBrush *brush = gimp_pdb_get_generated_brush (gimp, name, FALSE, error);
|
|
||||||
|
|
||||||
if (brush)
|
|
||||||
aspect_ratio = GIMP_BRUSH_GENERATED (brush)->aspect_ratio;
|
|
||||||
else
|
|
||||||
success = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return_vals = gimp_procedure_get_return_values (procedure, success);
|
|
||||||
|
|
||||||
if (success)
|
|
||||||
g_value_set_double (&return_vals->values[1], aspect_ratio);
|
|
||||||
|
|
||||||
return return_vals;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GValueArray *
|
|
||||||
brush_get_angle_invoker (GimpProcedure *procedure,
|
|
||||||
Gimp *gimp,
|
|
||||||
GimpContext *context,
|
|
||||||
GimpProgress *progress,
|
|
||||||
const GValueArray *args,
|
|
||||||
GError **error)
|
|
||||||
{
|
|
||||||
gboolean success = TRUE;
|
|
||||||
GValueArray *return_vals;
|
|
||||||
const gchar *name;
|
|
||||||
gdouble angle = 0.0;
|
|
||||||
|
|
||||||
name = g_value_get_string (&args->values[0]);
|
|
||||||
|
|
||||||
if (success)
|
|
||||||
{
|
|
||||||
GimpBrush *brush = gimp_pdb_get_generated_brush (gimp, name, FALSE, error);
|
|
||||||
|
|
||||||
if (brush)
|
|
||||||
angle = GIMP_BRUSH_GENERATED (brush)->angle;
|
|
||||||
else
|
|
||||||
success = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return_vals = gimp_procedure_get_return_values (procedure, success);
|
|
||||||
|
|
||||||
if (success)
|
|
||||||
g_value_set_double (&return_vals->values[1], angle);
|
|
||||||
|
|
||||||
return return_vals;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
brush_set_shape_invoker (GimpProcedure *procedure,
|
brush_set_shape_invoker (GimpProcedure *procedure,
|
||||||
Gimp *gimp,
|
Gimp *gimp,
|
||||||
|
@ -656,6 +491,39 @@ brush_set_shape_invoker (GimpProcedure *procedure,
|
||||||
return return_vals;
|
return return_vals;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GValueArray *
|
||||||
|
brush_get_radius_invoker (GimpProcedure *procedure,
|
||||||
|
Gimp *gimp,
|
||||||
|
GimpContext *context,
|
||||||
|
GimpProgress *progress,
|
||||||
|
const GValueArray *args,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
gboolean success = TRUE;
|
||||||
|
GValueArray *return_vals;
|
||||||
|
const gchar *name;
|
||||||
|
gdouble radius = 0.0;
|
||||||
|
|
||||||
|
name = g_value_get_string (&args->values[0]);
|
||||||
|
|
||||||
|
if (success)
|
||||||
|
{
|
||||||
|
GimpBrush *brush = gimp_pdb_get_generated_brush (gimp, name, FALSE, error);
|
||||||
|
|
||||||
|
if (brush)
|
||||||
|
radius = GIMP_BRUSH_GENERATED (brush)->radius;
|
||||||
|
else
|
||||||
|
success = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return_vals = gimp_procedure_get_return_values (procedure, success);
|
||||||
|
|
||||||
|
if (success)
|
||||||
|
g_value_set_double (&return_vals->values[1], radius);
|
||||||
|
|
||||||
|
return return_vals;
|
||||||
|
}
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
brush_set_radius_invoker (GimpProcedure *procedure,
|
brush_set_radius_invoker (GimpProcedure *procedure,
|
||||||
Gimp *gimp,
|
Gimp *gimp,
|
||||||
|
@ -695,6 +563,39 @@ brush_set_radius_invoker (GimpProcedure *procedure,
|
||||||
return return_vals;
|
return return_vals;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GValueArray *
|
||||||
|
brush_get_spikes_invoker (GimpProcedure *procedure,
|
||||||
|
Gimp *gimp,
|
||||||
|
GimpContext *context,
|
||||||
|
GimpProgress *progress,
|
||||||
|
const GValueArray *args,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
gboolean success = TRUE;
|
||||||
|
GValueArray *return_vals;
|
||||||
|
const gchar *name;
|
||||||
|
gint32 spikes = 0;
|
||||||
|
|
||||||
|
name = g_value_get_string (&args->values[0]);
|
||||||
|
|
||||||
|
if (success)
|
||||||
|
{
|
||||||
|
GimpBrush *brush = gimp_pdb_get_generated_brush (gimp, name, FALSE, error);
|
||||||
|
|
||||||
|
if (brush)
|
||||||
|
spikes = GIMP_BRUSH_GENERATED (brush)->spikes;
|
||||||
|
else
|
||||||
|
success = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return_vals = gimp_procedure_get_return_values (procedure, success);
|
||||||
|
|
||||||
|
if (success)
|
||||||
|
g_value_set_int (&return_vals->values[1], spikes);
|
||||||
|
|
||||||
|
return return_vals;
|
||||||
|
}
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
brush_set_spikes_invoker (GimpProcedure *procedure,
|
brush_set_spikes_invoker (GimpProcedure *procedure,
|
||||||
Gimp *gimp,
|
Gimp *gimp,
|
||||||
|
@ -734,6 +635,39 @@ brush_set_spikes_invoker (GimpProcedure *procedure,
|
||||||
return return_vals;
|
return return_vals;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GValueArray *
|
||||||
|
brush_get_hardness_invoker (GimpProcedure *procedure,
|
||||||
|
Gimp *gimp,
|
||||||
|
GimpContext *context,
|
||||||
|
GimpProgress *progress,
|
||||||
|
const GValueArray *args,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
gboolean success = TRUE;
|
||||||
|
GValueArray *return_vals;
|
||||||
|
const gchar *name;
|
||||||
|
gdouble hardness = 0.0;
|
||||||
|
|
||||||
|
name = g_value_get_string (&args->values[0]);
|
||||||
|
|
||||||
|
if (success)
|
||||||
|
{
|
||||||
|
GimpBrush *brush = gimp_pdb_get_generated_brush (gimp, name, FALSE, error);
|
||||||
|
|
||||||
|
if (brush)
|
||||||
|
hardness = GIMP_BRUSH_GENERATED (brush)->hardness;
|
||||||
|
else
|
||||||
|
success = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return_vals = gimp_procedure_get_return_values (procedure, success);
|
||||||
|
|
||||||
|
if (success)
|
||||||
|
g_value_set_double (&return_vals->values[1], hardness);
|
||||||
|
|
||||||
|
return return_vals;
|
||||||
|
}
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
brush_set_hardness_invoker (GimpProcedure *procedure,
|
brush_set_hardness_invoker (GimpProcedure *procedure,
|
||||||
Gimp *gimp,
|
Gimp *gimp,
|
||||||
|
@ -773,6 +707,39 @@ brush_set_hardness_invoker (GimpProcedure *procedure,
|
||||||
return return_vals;
|
return return_vals;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GValueArray *
|
||||||
|
brush_get_aspect_ratio_invoker (GimpProcedure *procedure,
|
||||||
|
Gimp *gimp,
|
||||||
|
GimpContext *context,
|
||||||
|
GimpProgress *progress,
|
||||||
|
const GValueArray *args,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
gboolean success = TRUE;
|
||||||
|
GValueArray *return_vals;
|
||||||
|
const gchar *name;
|
||||||
|
gdouble aspect_ratio = 0.0;
|
||||||
|
|
||||||
|
name = g_value_get_string (&args->values[0]);
|
||||||
|
|
||||||
|
if (success)
|
||||||
|
{
|
||||||
|
GimpBrush *brush = gimp_pdb_get_generated_brush (gimp, name, FALSE, error);
|
||||||
|
|
||||||
|
if (brush)
|
||||||
|
aspect_ratio = GIMP_BRUSH_GENERATED (brush)->aspect_ratio;
|
||||||
|
else
|
||||||
|
success = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return_vals = gimp_procedure_get_return_values (procedure, success);
|
||||||
|
|
||||||
|
if (success)
|
||||||
|
g_value_set_double (&return_vals->values[1], aspect_ratio);
|
||||||
|
|
||||||
|
return return_vals;
|
||||||
|
}
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
brush_set_aspect_ratio_invoker (GimpProcedure *procedure,
|
brush_set_aspect_ratio_invoker (GimpProcedure *procedure,
|
||||||
Gimp *gimp,
|
Gimp *gimp,
|
||||||
|
@ -812,6 +779,39 @@ brush_set_aspect_ratio_invoker (GimpProcedure *procedure,
|
||||||
return return_vals;
|
return return_vals;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GValueArray *
|
||||||
|
brush_get_angle_invoker (GimpProcedure *procedure,
|
||||||
|
Gimp *gimp,
|
||||||
|
GimpContext *context,
|
||||||
|
GimpProgress *progress,
|
||||||
|
const GValueArray *args,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
gboolean success = TRUE;
|
||||||
|
GValueArray *return_vals;
|
||||||
|
const gchar *name;
|
||||||
|
gdouble angle = 0.0;
|
||||||
|
|
||||||
|
name = g_value_get_string (&args->values[0]);
|
||||||
|
|
||||||
|
if (success)
|
||||||
|
{
|
||||||
|
GimpBrush *brush = gimp_pdb_get_generated_brush (gimp, name, FALSE, error);
|
||||||
|
|
||||||
|
if (brush)
|
||||||
|
angle = GIMP_BRUSH_GENERATED (brush)->angle;
|
||||||
|
else
|
||||||
|
success = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return_vals = gimp_procedure_get_return_values (procedure, success);
|
||||||
|
|
||||||
|
if (success)
|
||||||
|
g_value_set_double (&return_vals->values[1], angle);
|
||||||
|
|
||||||
|
return return_vals;
|
||||||
|
}
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
brush_set_angle_invoker (GimpProcedure *procedure,
|
brush_set_angle_invoker (GimpProcedure *procedure,
|
||||||
Gimp *gimp,
|
Gimp *gimp,
|
||||||
|
@ -1238,151 +1238,6 @@ register_brush_procs (GimpPDB *pdb)
|
||||||
gimp_pdb_register_procedure (pdb, procedure);
|
gimp_pdb_register_procedure (pdb, procedure);
|
||||||
g_object_unref (procedure);
|
g_object_unref (procedure);
|
||||||
|
|
||||||
/*
|
|
||||||
* gimp-brush-get-radius
|
|
||||||
*/
|
|
||||||
procedure = gimp_procedure_new (brush_get_radius_invoker);
|
|
||||||
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-brush-get-radius");
|
|
||||||
gimp_procedure_set_static_strings (procedure,
|
|
||||||
"gimp-brush-get-radius",
|
|
||||||
"Get the radius of a generated brush.",
|
|
||||||
"This procedure gets the radius value for a generated brush. If called for any other type of brush, it does not succeed.",
|
|
||||||
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
|
|
||||||
"Bill Skaggs",
|
|
||||||
"2004",
|
|
||||||
NULL);
|
|
||||||
gimp_procedure_add_argument (procedure,
|
|
||||||
gimp_param_spec_string ("name",
|
|
||||||
"name",
|
|
||||||
"The brush name",
|
|
||||||
FALSE, FALSE, TRUE,
|
|
||||||
NULL,
|
|
||||||
GIMP_PARAM_READWRITE));
|
|
||||||
gimp_procedure_add_return_value (procedure,
|
|
||||||
g_param_spec_double ("radius",
|
|
||||||
"radius",
|
|
||||||
"The radius of the brush in pixels",
|
|
||||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
|
||||||
GIMP_PARAM_READWRITE));
|
|
||||||
gimp_pdb_register_procedure (pdb, procedure);
|
|
||||||
g_object_unref (procedure);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* gimp-brush-get-spikes
|
|
||||||
*/
|
|
||||||
procedure = gimp_procedure_new (brush_get_spikes_invoker);
|
|
||||||
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-brush-get-spikes");
|
|
||||||
gimp_procedure_set_static_strings (procedure,
|
|
||||||
"gimp-brush-get-spikes",
|
|
||||||
"Get the number of spikes for a generated brush.",
|
|
||||||
"This procedure gets the number of spikes for a generated brush. If called for any other type of brush, it does not succeed.",
|
|
||||||
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
|
|
||||||
"Bill Skaggs",
|
|
||||||
"2004",
|
|
||||||
NULL);
|
|
||||||
gimp_procedure_add_argument (procedure,
|
|
||||||
gimp_param_spec_string ("name",
|
|
||||||
"name",
|
|
||||||
"The brush name",
|
|
||||||
FALSE, FALSE, TRUE,
|
|
||||||
NULL,
|
|
||||||
GIMP_PARAM_READWRITE));
|
|
||||||
gimp_procedure_add_return_value (procedure,
|
|
||||||
gimp_param_spec_int32 ("spikes",
|
|
||||||
"spikes",
|
|
||||||
"The number of spikes on the brush.",
|
|
||||||
G_MININT32, G_MAXINT32, 0,
|
|
||||||
GIMP_PARAM_READWRITE));
|
|
||||||
gimp_pdb_register_procedure (pdb, procedure);
|
|
||||||
g_object_unref (procedure);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* gimp-brush-get-hardness
|
|
||||||
*/
|
|
||||||
procedure = gimp_procedure_new (brush_get_hardness_invoker);
|
|
||||||
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-brush-get-hardness");
|
|
||||||
gimp_procedure_set_static_strings (procedure,
|
|
||||||
"gimp-brush-get-hardness",
|
|
||||||
"Get the hardness of a generated brush.",
|
|
||||||
"This procedure gets the hardness of a generated brush. The hardness of a brush is the amount its intensity fades at the outside edge. If called for any other type of brush, the function does not succeed.",
|
|
||||||
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
|
|
||||||
"Bill Skaggs",
|
|
||||||
"2004",
|
|
||||||
NULL);
|
|
||||||
gimp_procedure_add_argument (procedure,
|
|
||||||
gimp_param_spec_string ("name",
|
|
||||||
"name",
|
|
||||||
"The brush name",
|
|
||||||
FALSE, FALSE, TRUE,
|
|
||||||
NULL,
|
|
||||||
GIMP_PARAM_READWRITE));
|
|
||||||
gimp_procedure_add_return_value (procedure,
|
|
||||||
g_param_spec_double ("hardness",
|
|
||||||
"hardness",
|
|
||||||
"The hardness of the brush.",
|
|
||||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
|
||||||
GIMP_PARAM_READWRITE));
|
|
||||||
gimp_pdb_register_procedure (pdb, procedure);
|
|
||||||
g_object_unref (procedure);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* gimp-brush-get-aspect-ratio
|
|
||||||
*/
|
|
||||||
procedure = gimp_procedure_new (brush_get_aspect_ratio_invoker);
|
|
||||||
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-brush-get-aspect-ratio");
|
|
||||||
gimp_procedure_set_static_strings (procedure,
|
|
||||||
"gimp-brush-get-aspect-ratio",
|
|
||||||
"Get the aspect ratio of a generated brush.",
|
|
||||||
"This procedure gets the aspect ratio of a generated brush. If called for any other type of brush, it does not succeed.",
|
|
||||||
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
|
|
||||||
"Bill Skaggs",
|
|
||||||
"2004",
|
|
||||||
NULL);
|
|
||||||
gimp_procedure_add_argument (procedure,
|
|
||||||
gimp_param_spec_string ("name",
|
|
||||||
"name",
|
|
||||||
"The brush name",
|
|
||||||
FALSE, FALSE, TRUE,
|
|
||||||
NULL,
|
|
||||||
GIMP_PARAM_READWRITE));
|
|
||||||
gimp_procedure_add_return_value (procedure,
|
|
||||||
g_param_spec_double ("aspect-ratio",
|
|
||||||
"aspect ratio",
|
|
||||||
"The aspect ratio of the brush.",
|
|
||||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
|
||||||
GIMP_PARAM_READWRITE));
|
|
||||||
gimp_pdb_register_procedure (pdb, procedure);
|
|
||||||
g_object_unref (procedure);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* gimp-brush-get-angle
|
|
||||||
*/
|
|
||||||
procedure = gimp_procedure_new (brush_get_angle_invoker);
|
|
||||||
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-brush-get-angle");
|
|
||||||
gimp_procedure_set_static_strings (procedure,
|
|
||||||
"gimp-brush-get-angle",
|
|
||||||
"Get the rotation angle of a generated brush.",
|
|
||||||
"This procedure gets the angle of rotation for a generated brush. If called for any other type of brush, it does not succeed.",
|
|
||||||
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
|
|
||||||
"Bill Skaggs",
|
|
||||||
"2004",
|
|
||||||
NULL);
|
|
||||||
gimp_procedure_add_argument (procedure,
|
|
||||||
gimp_param_spec_string ("name",
|
|
||||||
"name",
|
|
||||||
"The brush name",
|
|
||||||
FALSE, FALSE, TRUE,
|
|
||||||
NULL,
|
|
||||||
GIMP_PARAM_READWRITE));
|
|
||||||
gimp_procedure_add_return_value (procedure,
|
|
||||||
g_param_spec_double ("angle",
|
|
||||||
"angle",
|
|
||||||
"The rotation angle of the brush.",
|
|
||||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
|
||||||
GIMP_PARAM_READWRITE));
|
|
||||||
gimp_pdb_register_procedure (pdb, procedure);
|
|
||||||
g_object_unref (procedure);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* gimp-brush-set-shape
|
* gimp-brush-set-shape
|
||||||
*/
|
*/
|
||||||
|
@ -1420,6 +1275,35 @@ register_brush_procs (GimpPDB *pdb)
|
||||||
gimp_pdb_register_procedure (pdb, procedure);
|
gimp_pdb_register_procedure (pdb, procedure);
|
||||||
g_object_unref (procedure);
|
g_object_unref (procedure);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* gimp-brush-get-radius
|
||||||
|
*/
|
||||||
|
procedure = gimp_procedure_new (brush_get_radius_invoker);
|
||||||
|
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-brush-get-radius");
|
||||||
|
gimp_procedure_set_static_strings (procedure,
|
||||||
|
"gimp-brush-get-radius",
|
||||||
|
"Get the radius of a generated brush.",
|
||||||
|
"This procedure gets the radius value for a generated brush. If called for any other type of brush, it does not succeed.",
|
||||||
|
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
|
||||||
|
"Bill Skaggs",
|
||||||
|
"2004",
|
||||||
|
NULL);
|
||||||
|
gimp_procedure_add_argument (procedure,
|
||||||
|
gimp_param_spec_string ("name",
|
||||||
|
"name",
|
||||||
|
"The brush name",
|
||||||
|
FALSE, FALSE, TRUE,
|
||||||
|
NULL,
|
||||||
|
GIMP_PARAM_READWRITE));
|
||||||
|
gimp_procedure_add_return_value (procedure,
|
||||||
|
g_param_spec_double ("radius",
|
||||||
|
"radius",
|
||||||
|
"The radius of the brush in pixels",
|
||||||
|
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||||
|
GIMP_PARAM_READWRITE));
|
||||||
|
gimp_pdb_register_procedure (pdb, procedure);
|
||||||
|
g_object_unref (procedure);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* gimp-brush-set-radius
|
* gimp-brush-set-radius
|
||||||
*/
|
*/
|
||||||
|
@ -1455,6 +1339,35 @@ register_brush_procs (GimpPDB *pdb)
|
||||||
gimp_pdb_register_procedure (pdb, procedure);
|
gimp_pdb_register_procedure (pdb, procedure);
|
||||||
g_object_unref (procedure);
|
g_object_unref (procedure);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* gimp-brush-get-spikes
|
||||||
|
*/
|
||||||
|
procedure = gimp_procedure_new (brush_get_spikes_invoker);
|
||||||
|
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-brush-get-spikes");
|
||||||
|
gimp_procedure_set_static_strings (procedure,
|
||||||
|
"gimp-brush-get-spikes",
|
||||||
|
"Get the number of spikes for a generated brush.",
|
||||||
|
"This procedure gets the number of spikes for a generated brush. If called for any other type of brush, it does not succeed.",
|
||||||
|
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
|
||||||
|
"Bill Skaggs",
|
||||||
|
"2004",
|
||||||
|
NULL);
|
||||||
|
gimp_procedure_add_argument (procedure,
|
||||||
|
gimp_param_spec_string ("name",
|
||||||
|
"name",
|
||||||
|
"The brush name",
|
||||||
|
FALSE, FALSE, TRUE,
|
||||||
|
NULL,
|
||||||
|
GIMP_PARAM_READWRITE));
|
||||||
|
gimp_procedure_add_return_value (procedure,
|
||||||
|
gimp_param_spec_int32 ("spikes",
|
||||||
|
"spikes",
|
||||||
|
"The number of spikes on the brush.",
|
||||||
|
G_MININT32, G_MAXINT32, 0,
|
||||||
|
GIMP_PARAM_READWRITE));
|
||||||
|
gimp_pdb_register_procedure (pdb, procedure);
|
||||||
|
g_object_unref (procedure);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* gimp-brush-set-spikes
|
* gimp-brush-set-spikes
|
||||||
*/
|
*/
|
||||||
|
@ -1490,6 +1403,35 @@ register_brush_procs (GimpPDB *pdb)
|
||||||
gimp_pdb_register_procedure (pdb, procedure);
|
gimp_pdb_register_procedure (pdb, procedure);
|
||||||
g_object_unref (procedure);
|
g_object_unref (procedure);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* gimp-brush-get-hardness
|
||||||
|
*/
|
||||||
|
procedure = gimp_procedure_new (brush_get_hardness_invoker);
|
||||||
|
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-brush-get-hardness");
|
||||||
|
gimp_procedure_set_static_strings (procedure,
|
||||||
|
"gimp-brush-get-hardness",
|
||||||
|
"Get the hardness of a generated brush.",
|
||||||
|
"This procedure gets the hardness of a generated brush. The hardness of a brush is the amount its intensity fades at the outside edge. If called for any other type of brush, the function does not succeed.",
|
||||||
|
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
|
||||||
|
"Bill Skaggs",
|
||||||
|
"2004",
|
||||||
|
NULL);
|
||||||
|
gimp_procedure_add_argument (procedure,
|
||||||
|
gimp_param_spec_string ("name",
|
||||||
|
"name",
|
||||||
|
"The brush name",
|
||||||
|
FALSE, FALSE, TRUE,
|
||||||
|
NULL,
|
||||||
|
GIMP_PARAM_READWRITE));
|
||||||
|
gimp_procedure_add_return_value (procedure,
|
||||||
|
g_param_spec_double ("hardness",
|
||||||
|
"hardness",
|
||||||
|
"The hardness of the brush.",
|
||||||
|
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||||
|
GIMP_PARAM_READWRITE));
|
||||||
|
gimp_pdb_register_procedure (pdb, procedure);
|
||||||
|
g_object_unref (procedure);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* gimp-brush-set-hardness
|
* gimp-brush-set-hardness
|
||||||
*/
|
*/
|
||||||
|
@ -1525,6 +1467,35 @@ register_brush_procs (GimpPDB *pdb)
|
||||||
gimp_pdb_register_procedure (pdb, procedure);
|
gimp_pdb_register_procedure (pdb, procedure);
|
||||||
g_object_unref (procedure);
|
g_object_unref (procedure);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* gimp-brush-get-aspect-ratio
|
||||||
|
*/
|
||||||
|
procedure = gimp_procedure_new (brush_get_aspect_ratio_invoker);
|
||||||
|
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-brush-get-aspect-ratio");
|
||||||
|
gimp_procedure_set_static_strings (procedure,
|
||||||
|
"gimp-brush-get-aspect-ratio",
|
||||||
|
"Get the aspect ratio of a generated brush.",
|
||||||
|
"This procedure gets the aspect ratio of a generated brush. If called for any other type of brush, it does not succeed.",
|
||||||
|
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
|
||||||
|
"Bill Skaggs",
|
||||||
|
"2004",
|
||||||
|
NULL);
|
||||||
|
gimp_procedure_add_argument (procedure,
|
||||||
|
gimp_param_spec_string ("name",
|
||||||
|
"name",
|
||||||
|
"The brush name",
|
||||||
|
FALSE, FALSE, TRUE,
|
||||||
|
NULL,
|
||||||
|
GIMP_PARAM_READWRITE));
|
||||||
|
gimp_procedure_add_return_value (procedure,
|
||||||
|
g_param_spec_double ("aspect-ratio",
|
||||||
|
"aspect ratio",
|
||||||
|
"The aspect ratio of the brush.",
|
||||||
|
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||||
|
GIMP_PARAM_READWRITE));
|
||||||
|
gimp_pdb_register_procedure (pdb, procedure);
|
||||||
|
g_object_unref (procedure);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* gimp-brush-set-aspect-ratio
|
* gimp-brush-set-aspect-ratio
|
||||||
*/
|
*/
|
||||||
|
@ -1560,6 +1531,35 @@ register_brush_procs (GimpPDB *pdb)
|
||||||
gimp_pdb_register_procedure (pdb, procedure);
|
gimp_pdb_register_procedure (pdb, procedure);
|
||||||
g_object_unref (procedure);
|
g_object_unref (procedure);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* gimp-brush-get-angle
|
||||||
|
*/
|
||||||
|
procedure = gimp_procedure_new (brush_get_angle_invoker);
|
||||||
|
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-brush-get-angle");
|
||||||
|
gimp_procedure_set_static_strings (procedure,
|
||||||
|
"gimp-brush-get-angle",
|
||||||
|
"Get the rotation angle of a generated brush.",
|
||||||
|
"This procedure gets the angle of rotation for a generated brush. If called for any other type of brush, it does not succeed.",
|
||||||
|
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
|
||||||
|
"Bill Skaggs",
|
||||||
|
"2004",
|
||||||
|
NULL);
|
||||||
|
gimp_procedure_add_argument (procedure,
|
||||||
|
gimp_param_spec_string ("name",
|
||||||
|
"name",
|
||||||
|
"The brush name",
|
||||||
|
FALSE, FALSE, TRUE,
|
||||||
|
NULL,
|
||||||
|
GIMP_PARAM_READWRITE));
|
||||||
|
gimp_procedure_add_return_value (procedure,
|
||||||
|
g_param_spec_double ("angle",
|
||||||
|
"angle",
|
||||||
|
"The rotation angle of the brush.",
|
||||||
|
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||||
|
GIMP_PARAM_READWRITE));
|
||||||
|
gimp_pdb_register_procedure (pdb, procedure);
|
||||||
|
g_object_unref (procedure);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* gimp-brush-set-angle
|
* gimp-brush-set-angle
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -20,17 +20,16 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpdatafactory.h"
|
#include "core/gimpdatafactory.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,9 +25,6 @@
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "base/temp-buf.h"
|
#include "base/temp-buf.h"
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
|
@ -35,8 +32,11 @@
|
||||||
#include "core/gimpcontainer-filter.h"
|
#include "core/gimpcontainer-filter.h"
|
||||||
#include "core/gimpcontext.h"
|
#include "core/gimpcontext.h"
|
||||||
#include "core/gimpdatafactory.h"
|
#include "core/gimpdatafactory.h"
|
||||||
#include "gimppdb-utils.h"
|
#include "core/gimpparamspecs.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimppdb-utils.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,16 +25,16 @@
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpbuffer.h"
|
#include "core/gimpbuffer.h"
|
||||||
#include "core/gimpcontainer-filter.h"
|
#include "core/gimpcontainer-filter.h"
|
||||||
#include "core/gimpcontainer.h"
|
#include "core/gimpcontainer.h"
|
||||||
#include "gimppdb-utils.h"
|
#include "core/gimpparamspecs.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimppdb-utils.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,24 +20,24 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "libgimpbase/gimpbase.h"
|
#include "libgimpbase/gimpbase.h"
|
||||||
#include "libgimpcolor/gimpcolor.h"
|
#include "libgimpcolor/gimpcolor.h"
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimpchannel-combine.h"
|
#include "core/gimpchannel-combine.h"
|
||||||
#include "core/gimpchannel.h"
|
#include "core/gimpchannel.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "gimp-intl.h"
|
#include "core/gimpparamspecs.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
channel_new_invoker (GimpProcedure *procedure,
|
channel_new_invoker (GimpProcedure *procedure,
|
||||||
|
|
|
@ -20,14 +20,9 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <gegl.h>
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "base/gimphistogram.h"
|
#include "base/gimphistogram.h"
|
||||||
#include "core/gimpdrawable-brightness-contrast.h"
|
#include "core/gimpdrawable-brightness-contrast.h"
|
||||||
|
@ -43,11 +38,15 @@
|
||||||
#include "core/gimpdrawable-posterize.h"
|
#include "core/gimpdrawable-posterize.h"
|
||||||
#include "core/gimpdrawable-threshold.h"
|
#include "core/gimpdrawable-threshold.h"
|
||||||
#include "core/gimpdrawable.h"
|
#include "core/gimpdrawable.h"
|
||||||
#include "gimp-intl.h"
|
#include "core/gimpparamspecs.h"
|
||||||
#include "gimppdb-utils.h"
|
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimppdb-utils.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
brightness_contrast_invoker (GimpProcedure *procedure,
|
brightness_contrast_invoker (GimpProcedure *procedure,
|
||||||
|
|
|
@ -20,25 +20,24 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "libgimpcolor/gimpcolor.h"
|
#include "libgimpcolor/gimpcolor.h"
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpcontainer.h"
|
#include "core/gimpcontainer.h"
|
||||||
#include "core/gimpcontext.h"
|
#include "core/gimpcontext.h"
|
||||||
#include "core/gimpdatafactory.h"
|
#include "core/gimpdatafactory.h"
|
||||||
#include "gimppdb-utils.h"
|
#include "core/gimpparamspecs.h"
|
||||||
#include "plug-in/gimpplugin-context.h"
|
#include "plug-in/gimpplugin-context.h"
|
||||||
#include "plug-in/gimpplugin.h"
|
#include "plug-in/gimpplugin.h"
|
||||||
#include "plug-in/gimppluginmanager.h"
|
#include "plug-in/gimppluginmanager.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimppdb-utils.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -80,6 +79,29 @@ context_pop_invoker (GimpProcedure *procedure,
|
||||||
return gimp_procedure_get_return_values (procedure, success);
|
return gimp_procedure_get_return_values (procedure, success);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GValueArray *
|
||||||
|
context_list_paint_methods_invoker (GimpProcedure *procedure,
|
||||||
|
Gimp *gimp,
|
||||||
|
GimpContext *context,
|
||||||
|
GimpProgress *progress,
|
||||||
|
const GValueArray *args,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
GValueArray *return_vals;
|
||||||
|
gint32 num_paint_methods = 0;
|
||||||
|
gchar **paint_methods = NULL;
|
||||||
|
|
||||||
|
paint_methods = gimp_container_get_name_array (gimp->paint_info_list,
|
||||||
|
&num_paint_methods);
|
||||||
|
|
||||||
|
return_vals = gimp_procedure_get_return_values (procedure, TRUE);
|
||||||
|
|
||||||
|
g_value_set_int (&return_vals->values[1], num_paint_methods);
|
||||||
|
gimp_value_take_stringarray (&return_vals->values[2], paint_methods, num_paint_methods);
|
||||||
|
|
||||||
|
return return_vals;
|
||||||
|
}
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
context_get_paint_method_invoker (GimpProcedure *procedure,
|
context_get_paint_method_invoker (GimpProcedure *procedure,
|
||||||
Gimp *gimp,
|
Gimp *gimp,
|
||||||
|
@ -133,29 +155,6 @@ context_set_paint_method_invoker (GimpProcedure *procedure,
|
||||||
return gimp_procedure_get_return_values (procedure, success);
|
return gimp_procedure_get_return_values (procedure, success);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GValueArray *
|
|
||||||
context_list_paint_methods_invoker (GimpProcedure *procedure,
|
|
||||||
Gimp *gimp,
|
|
||||||
GimpContext *context,
|
|
||||||
GimpProgress *progress,
|
|
||||||
const GValueArray *args,
|
|
||||||
GError **error)
|
|
||||||
{
|
|
||||||
GValueArray *return_vals;
|
|
||||||
gint32 num_paint_methods = 0;
|
|
||||||
gchar **paint_methods = NULL;
|
|
||||||
|
|
||||||
paint_methods = gimp_container_get_name_array (gimp->paint_info_list,
|
|
||||||
&num_paint_methods);
|
|
||||||
|
|
||||||
return_vals = gimp_procedure_get_return_values (procedure, TRUE);
|
|
||||||
|
|
||||||
g_value_set_int (&return_vals->values[1], num_paint_methods);
|
|
||||||
gimp_value_take_stringarray (&return_vals->values[2], paint_methods, num_paint_methods);
|
|
||||||
|
|
||||||
return return_vals;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
context_get_foreground_invoker (GimpProcedure *procedure,
|
context_get_foreground_invoker (GimpProcedure *procedure,
|
||||||
Gimp *gimp,
|
Gimp *gimp,
|
||||||
|
@ -646,6 +645,33 @@ register_context_procs (GimpPDB *pdb)
|
||||||
gimp_pdb_register_procedure (pdb, procedure);
|
gimp_pdb_register_procedure (pdb, procedure);
|
||||||
g_object_unref (procedure);
|
g_object_unref (procedure);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* gimp-context-list-paint-methods
|
||||||
|
*/
|
||||||
|
procedure = gimp_procedure_new (context_list_paint_methods_invoker);
|
||||||
|
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-context-list-paint-methods");
|
||||||
|
gimp_procedure_set_static_strings (procedure,
|
||||||
|
"gimp-context-list-paint-methods",
|
||||||
|
"Lists the available paint methods.",
|
||||||
|
"This procedure lists the names of the available paint methods. Any of the results can be used for 'gimp-context-set-paint-method'.",
|
||||||
|
"Simon Budig",
|
||||||
|
"Simon Budig",
|
||||||
|
"2007",
|
||||||
|
NULL);
|
||||||
|
gimp_procedure_add_return_value (procedure,
|
||||||
|
gimp_param_spec_int32 ("num-paint-methods",
|
||||||
|
"num paint methods",
|
||||||
|
"The number of the available paint methods",
|
||||||
|
0, G_MAXINT32, 0,
|
||||||
|
GIMP_PARAM_READWRITE));
|
||||||
|
gimp_procedure_add_return_value (procedure,
|
||||||
|
gimp_param_spec_string_array ("paint-methods",
|
||||||
|
"paint methods",
|
||||||
|
"The names of the available paint methods",
|
||||||
|
GIMP_PARAM_READWRITE));
|
||||||
|
gimp_pdb_register_procedure (pdb, procedure);
|
||||||
|
g_object_unref (procedure);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* gimp-context-get-paint-method
|
* gimp-context-get-paint-method
|
||||||
*/
|
*/
|
||||||
|
@ -692,33 +718,6 @@ register_context_procs (GimpPDB *pdb)
|
||||||
gimp_pdb_register_procedure (pdb, procedure);
|
gimp_pdb_register_procedure (pdb, procedure);
|
||||||
g_object_unref (procedure);
|
g_object_unref (procedure);
|
||||||
|
|
||||||
/*
|
|
||||||
* gimp-context-list-paint-methods
|
|
||||||
*/
|
|
||||||
procedure = gimp_procedure_new (context_list_paint_methods_invoker);
|
|
||||||
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-context-list-paint-methods");
|
|
||||||
gimp_procedure_set_static_strings (procedure,
|
|
||||||
"gimp-context-list-paint-methods",
|
|
||||||
"Lists the available paint methods.",
|
|
||||||
"This procedure lists the names of the available paint methods. Any of the results can be used for 'gimp-context-set-paint-method'.",
|
|
||||||
"Simon Budig",
|
|
||||||
"Simon Budig",
|
|
||||||
"2007",
|
|
||||||
NULL);
|
|
||||||
gimp_procedure_add_return_value (procedure,
|
|
||||||
gimp_param_spec_int32 ("num-paint-methods",
|
|
||||||
"num paint methods",
|
|
||||||
"The number of the available paint methods",
|
|
||||||
0, G_MAXINT32, 0,
|
|
||||||
GIMP_PARAM_READWRITE));
|
|
||||||
gimp_procedure_add_return_value (procedure,
|
|
||||||
gimp_param_spec_string_array ("paint-methods",
|
|
||||||
"paint methods",
|
|
||||||
"The names of the available paint methods",
|
|
||||||
GIMP_PARAM_READWRITE));
|
|
||||||
gimp_pdb_register_procedure (pdb, procedure);
|
|
||||||
g_object_unref (procedure);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* gimp-context-get-foreground
|
* gimp-context-get-foreground
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -20,19 +20,17 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
|
||||||
#include "core/gimpimage-convert.h"
|
#include "core/gimpimage-convert.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "gimppdb-utils.h"
|
#include "core/gimpparamspecs.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimppdb-utils.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,18 +20,17 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpcontainer.h"
|
#include "core/gimpcontainer.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,13 +20,9 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "base/temp-buf.h"
|
#include "base/temp-buf.h"
|
||||||
#include "base/tile-manager.h"
|
#include "base/tile-manager.h"
|
||||||
|
@ -40,13 +36,17 @@
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "core/gimplayer.h"
|
#include "core/gimplayer.h"
|
||||||
#include "core/gimplayermask.h"
|
#include "core/gimplayermask.h"
|
||||||
#include "gimp-intl.h"
|
#include "core/gimpparamspecs.h"
|
||||||
#include "gimppdb-utils.h"
|
|
||||||
#include "plug-in/gimpplugin.h"
|
#include "plug-in/gimpplugin.h"
|
||||||
#include "plug-in/gimppluginmanager.h"
|
#include "plug-in/gimppluginmanager.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimppdb-utils.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
drawable_is_valid_invoker (GimpProcedure *procedure,
|
drawable_is_valid_invoker (GimpProcedure *procedure,
|
||||||
|
|
|
@ -20,15 +20,11 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "libgimpmath/gimpmath.h"
|
#include "libgimpmath/gimpmath.h"
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "config/gimpcoreconfig.h"
|
#include "config/gimpcoreconfig.h"
|
||||||
#include "core/gimp-transform-utils.h"
|
#include "core/gimp-transform-utils.h"
|
||||||
|
@ -36,12 +32,16 @@
|
||||||
#include "core/gimpdrawable-transform.h"
|
#include "core/gimpdrawable-transform.h"
|
||||||
#include "core/gimpdrawable.h"
|
#include "core/gimpdrawable.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
#include "core/gimpprogress.h"
|
#include "core/gimpprogress.h"
|
||||||
#include "gimp-intl.h"
|
|
||||||
#include "gimppdb-utils.h"
|
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimppdb-utils.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
drawable_transform_flip_simple_invoker (GimpProcedure *procedure,
|
drawable_transform_flip_simple_invoker (GimpProcedure *procedure,
|
||||||
|
|
|
@ -25,9 +25,6 @@
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp-edit.h"
|
#include "core/gimp-edit.h"
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
|
@ -37,14 +34,18 @@
|
||||||
#include "core/gimpdrawable.h"
|
#include "core/gimpdrawable.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "core/gimplayer.h"
|
#include "core/gimplayer.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
#include "core/gimpprogress.h"
|
#include "core/gimpprogress.h"
|
||||||
#include "core/gimpstrokedesc.h"
|
#include "core/gimpstrokedesc.h"
|
||||||
#include "gimp-intl.h"
|
|
||||||
#include "gimppdb-utils.h"
|
|
||||||
#include "vectors/gimpvectors.h"
|
#include "vectors/gimpvectors.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimppdb-utils.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
edit_cut_invoker (GimpProcedure *procedure,
|
edit_cut_invoker (GimpProcedure *procedure,
|
||||||
|
|
|
@ -28,14 +28,12 @@
|
||||||
#include "libgimpconfig/gimpconfig.h"
|
#include "libgimpconfig/gimpconfig.h"
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp-utils.h"
|
#include "core/gimp-utils.h"
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "core/gimplayer.h"
|
#include "core/gimplayer.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
#include "file/file-open.h"
|
#include "file/file-open.h"
|
||||||
#include "file/file-procedure.h"
|
#include "file/file-procedure.h"
|
||||||
#include "file/file-save.h"
|
#include "file/file-save.h"
|
||||||
|
@ -43,6 +41,8 @@
|
||||||
#include "plug-in/gimppluginmanager-file.h"
|
#include "plug-in/gimppluginmanager-file.h"
|
||||||
#include "plug-in/gimppluginmanager.h"
|
#include "plug-in/gimppluginmanager.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,23 +20,23 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimpdrawable.h"
|
#include "core/gimpdrawable.h"
|
||||||
#include "core/gimplayer-floating-sel.h"
|
#include "core/gimplayer-floating-sel.h"
|
||||||
#include "core/gimplayer.h"
|
#include "core/gimplayer.h"
|
||||||
#include "gimp-intl.h"
|
#include "core/gimpparamspecs.h"
|
||||||
#include "gimppdb-utils.h"
|
|
||||||
#include "gimppdberror.h"
|
#include "gimppdberror.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimppdb-utils.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
floating_sel_remove_invoker (GimpProcedure *procedure,
|
floating_sel_remove_invoker (GimpProcedure *procedure,
|
||||||
|
|
|
@ -20,16 +20,15 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,19 +20,18 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpcontainer-filter.h"
|
#include "core/gimpcontainer-filter.h"
|
||||||
#include "core/gimpcontainer.h"
|
#include "core/gimpcontainer.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
#include "text/gimp-fonts.h"
|
#include "text/gimp-fonts.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -29,15 +29,15 @@
|
||||||
#include "libgimpmodule/gimpmodule.h"
|
#include "libgimpmodule/gimpmodule.h"
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "config/gimprc.h"
|
#include "config/gimprc.h"
|
||||||
#include "core/gimp-utils.h"
|
#include "core/gimp-utils.h"
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
#include "core/gimptemplate.h"
|
#include "core/gimptemplate.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,16 +27,16 @@
|
||||||
#include "libgimpcolor/gimpcolor.h"
|
#include "libgimpcolor/gimpcolor.h"
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpcontext.h"
|
#include "core/gimpcontext.h"
|
||||||
#include "core/gimpdatafactory.h"
|
#include "core/gimpdatafactory.h"
|
||||||
#include "core/gimpgradient.h"
|
#include "core/gimpgradient.h"
|
||||||
#include "gimppdb-utils.h"
|
#include "core/gimpparamspecs.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimppdb-utils.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,18 +20,17 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpdatafactory.h"
|
#include "core/gimpdatafactory.h"
|
||||||
#include "core/gimpgradient.h"
|
#include "core/gimpgradient.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,17 +25,17 @@
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpcontainer-filter.h"
|
#include "core/gimpcontainer-filter.h"
|
||||||
#include "core/gimpcontext.h"
|
#include "core/gimpcontext.h"
|
||||||
#include "core/gimpdatafactory.h"
|
#include "core/gimpdatafactory.h"
|
||||||
#include "core/gimpgradient.h"
|
#include "core/gimpgradient.h"
|
||||||
#include "gimppdb-utils.h"
|
#include "core/gimpparamspecs.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimppdb-utils.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,21 +20,20 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "libgimpbase/gimpbaseenums.h"
|
#include "libgimpbase/gimpbaseenums.h"
|
||||||
#include "libgimpcolor/gimpcolor.h"
|
#include "libgimpcolor/gimpcolor.h"
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimpgrid.h"
|
#include "core/gimpgrid.h"
|
||||||
#include "core/gimpimage-grid.h"
|
#include "core/gimpimage-grid.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,19 +20,18 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimpguide.h"
|
#include "core/gimpguide.h"
|
||||||
#include "core/gimpimage-guides.h"
|
#include "core/gimpimage-guides.h"
|
||||||
#include "core/gimpimage-undo-push.h"
|
#include "core/gimpimage-undo-push.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,19 +20,18 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
#include "plug-in/gimpplugin.h"
|
#include "plug-in/gimpplugin.h"
|
||||||
#include "plug-in/gimppluginmanager-help-domain.h"
|
#include "plug-in/gimppluginmanager-help-domain.h"
|
||||||
#include "plug-in/gimppluginmanager.h"
|
#include "plug-in/gimppluginmanager.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "libgimpbase/gimpbase.h"
|
#include "libgimpbase/gimpbase.h"
|
||||||
|
@ -28,9 +27,6 @@
|
||||||
#include "libgimpmath/gimpmath.h"
|
#include "libgimpmath/gimpmath.h"
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "base/temp-buf.h"
|
#include "base/temp-buf.h"
|
||||||
#include "config/gimpcoreconfig.h"
|
#include "config/gimpcoreconfig.h"
|
||||||
|
@ -50,15 +46,19 @@
|
||||||
#include "core/gimplayer.h"
|
#include "core/gimplayer.h"
|
||||||
#include "core/gimplayermask.h"
|
#include "core/gimplayermask.h"
|
||||||
#include "core/gimplist.h"
|
#include "core/gimplist.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
#include "core/gimppickable.h"
|
#include "core/gimppickable.h"
|
||||||
#include "core/gimpselection.h"
|
#include "core/gimpselection.h"
|
||||||
#include "core/gimpunit.h"
|
#include "core/gimpunit.h"
|
||||||
#include "gimp-intl.h"
|
|
||||||
#include "gimppdberror.h"
|
#include "gimppdberror.h"
|
||||||
#include "vectors/gimpvectors.h"
|
#include "vectors/gimpvectors.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
#if defined (HAVE_FINITE)
|
#if defined (HAVE_FINITE)
|
||||||
#define FINITE(x) finite(x)
|
#define FINITE(x) finite(x)
|
||||||
|
|
|
@ -20,15 +20,11 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "libgimpbase/gimpbase.h"
|
#include "libgimpbase/gimpbase.h"
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "config/gimpcoreconfig.h"
|
#include "config/gimpcoreconfig.h"
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
|
@ -38,11 +34,15 @@
|
||||||
#include "core/gimpitem-linked.h"
|
#include "core/gimpitem-linked.h"
|
||||||
#include "core/gimplayer.h"
|
#include "core/gimplayer.h"
|
||||||
#include "core/gimplayermask.h"
|
#include "core/gimplayermask.h"
|
||||||
#include "gimp-intl.h"
|
#include "core/gimpparamspecs.h"
|
||||||
#include "gimppdb-utils.h"
|
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimppdb-utils.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
layer_new_invoker (GimpProcedure *procedure,
|
layer_new_invoker (GimpProcedure *procedure,
|
||||||
|
|
|
@ -25,17 +25,18 @@
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "gimp-intl.h"
|
#include "core/gimpparamspecs.h"
|
||||||
#include "plug-in/gimpplugin.h"
|
#include "plug-in/gimpplugin.h"
|
||||||
#include "plug-in/gimppluginmanager.h"
|
#include "plug-in/gimppluginmanager.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
message_invoker (GimpProcedure *procedure,
|
message_invoker (GimpProcedure *procedure,
|
||||||
|
|
|
@ -20,30 +20,18 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <glib.h>
|
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
|
||||||
#include <process.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "libgimpbase/gimpbase.h"
|
#include "libgimpbase/gimpbase.h"
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
#include "base/base-utils.h"
|
||||||
|
#include "core/gimp.h"
|
||||||
#include "core/gimpparamspecs.h"
|
#include "core/gimpparamspecs.h"
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -77,7 +65,7 @@ getpid_invoker (GimpProcedure *procedure,
|
||||||
GValueArray *return_vals;
|
GValueArray *return_vals;
|
||||||
gint32 pid = 0;
|
gint32 pid = 0;
|
||||||
|
|
||||||
pid = getpid ();
|
pid = get_pid ();
|
||||||
|
|
||||||
return_vals = gimp_procedure_get_return_values (procedure, TRUE);
|
return_vals = gimp_procedure_get_return_values (procedure, TRUE);
|
||||||
g_value_set_int (&return_vals->values[1], pid);
|
g_value_set_int (&return_vals->values[1], pid);
|
||||||
|
|
|
@ -20,24 +20,22 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "libgimpmath/gimpmath.h"
|
#include "libgimpmath/gimpmath.h"
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
|
||||||
#include "core/gimpdrawable.h"
|
#include "core/gimpdrawable.h"
|
||||||
#include "core/gimppaintinfo.h"
|
#include "core/gimppaintinfo.h"
|
||||||
#include "gimppdb-utils.h"
|
#include "core/gimpparamspecs.h"
|
||||||
#include "paint/gimppaintcore-stroke.h"
|
#include "paint/gimppaintcore-stroke.h"
|
||||||
#include "paint/gimppaintcore.h"
|
#include "paint/gimppaintcore.h"
|
||||||
#include "paint/gimppaintoptions.h"
|
#include "paint/gimppaintoptions.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimppdb-utils.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,16 +27,16 @@
|
||||||
#include "libgimpcolor/gimpcolor.h"
|
#include "libgimpcolor/gimpcolor.h"
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpcontext.h"
|
#include "core/gimpcontext.h"
|
||||||
#include "core/gimpdatafactory.h"
|
#include "core/gimpdatafactory.h"
|
||||||
#include "core/gimppalette.h"
|
#include "core/gimppalette.h"
|
||||||
#include "gimppdb-utils.h"
|
#include "core/gimpparamspecs.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimppdb-utils.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,17 +20,16 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpdatafactory.h"
|
#include "core/gimpdatafactory.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,17 +27,17 @@
|
||||||
#include "libgimpcolor/gimpcolor.h"
|
#include "libgimpcolor/gimpcolor.h"
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpcontainer-filter.h"
|
#include "core/gimpcontainer-filter.h"
|
||||||
#include "core/gimpcontext.h"
|
#include "core/gimpcontext.h"
|
||||||
#include "core/gimpdatafactory.h"
|
#include "core/gimpdatafactory.h"
|
||||||
#include "core/gimppalette.h"
|
#include "core/gimppalette.h"
|
||||||
#include "gimppdb-utils.h"
|
#include "core/gimpparamspecs.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimppdb-utils.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,21 +20,20 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "libgimpbase/gimpbase.h"
|
#include "libgimpbase/gimpbase.h"
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp-parasites.h"
|
#include "core/gimp-parasites.h"
|
||||||
#include "core/gimpdrawable.h"
|
#include "core/gimpdrawable.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
#include "vectors/gimpvectors.h"
|
#include "vectors/gimpvectors.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,24 +27,24 @@
|
||||||
#include "libgimpmath/gimpmath.h"
|
#include "libgimpmath/gimpmath.h"
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
|
||||||
#include "core/gimpchannel-select.h"
|
#include "core/gimpchannel-select.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "core/gimplist.h"
|
#include "core/gimplist.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
#include "core/gimpstrokedesc.h"
|
#include "core/gimpstrokedesc.h"
|
||||||
#include "gimp-intl.h"
|
|
||||||
#include "vectors/gimpanchor.h"
|
#include "vectors/gimpanchor.h"
|
||||||
#include "vectors/gimpbezierstroke.h"
|
#include "vectors/gimpbezierstroke.h"
|
||||||
#include "vectors/gimpvectors-compat.h"
|
#include "vectors/gimpvectors-compat.h"
|
||||||
#include "vectors/gimpvectors-import.h"
|
#include "vectors/gimpvectors-import.h"
|
||||||
#include "vectors/gimpvectors.h"
|
#include "vectors/gimpvectors.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
path_list_invoker (GimpProcedure *procedure,
|
path_list_invoker (GimpProcedure *procedure,
|
||||||
|
|
|
@ -25,17 +25,16 @@
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "base/temp-buf.h"
|
#include "base/temp-buf.h"
|
||||||
#include "core/gimp.h"
|
|
||||||
#include "core/gimpcontext.h"
|
#include "core/gimpcontext.h"
|
||||||
#include "core/gimpdatafactory.h"
|
#include "core/gimpdatafactory.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
#include "core/gimppattern.h"
|
#include "core/gimppattern.h"
|
||||||
#include "gimppdb-utils.h"
|
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimppdb-utils.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,17 +20,16 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpdatafactory.h"
|
#include "core/gimpdatafactory.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,18 +25,18 @@
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "base/temp-buf.h"
|
#include "base/temp-buf.h"
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpcontainer-filter.h"
|
#include "core/gimpcontainer-filter.h"
|
||||||
#include "core/gimpcontext.h"
|
#include "core/gimpcontext.h"
|
||||||
#include "core/gimpdatafactory.h"
|
#include "core/gimpdatafactory.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
#include "core/gimppattern.h"
|
#include "core/gimppattern.h"
|
||||||
#include "gimppdb-utils.h"
|
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimppdb-utils.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,11 +28,9 @@
|
||||||
#include "libgimpbase/gimpbase.h"
|
#include "libgimpbase/gimpbase.h"
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
#include "plug-in/gimpplugin.h"
|
#include "plug-in/gimpplugin.h"
|
||||||
#include "plug-in/gimpplugindef.h"
|
#include "plug-in/gimpplugindef.h"
|
||||||
#include "plug-in/gimppluginmanager-menu-branch.h"
|
#include "plug-in/gimppluginmanager-menu-branch.h"
|
||||||
|
@ -40,6 +38,8 @@
|
||||||
#include "plug-in/gimppluginmanager.h"
|
#include "plug-in/gimppluginmanager.h"
|
||||||
#include "plug-in/gimppluginprocedure.h"
|
#include "plug-in/gimppluginprocedure.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,22 +20,21 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "libgimpbase/gimpbase.h"
|
#include "libgimpbase/gimpbase.h"
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpparamspecs-desc.h"
|
#include "core/gimpparamspecs-desc.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
#include "gimp-pdb-compat.h"
|
#include "gimp-pdb-compat.h"
|
||||||
#include "gimppdb-query.h"
|
#include "gimppdb-query.h"
|
||||||
#include "plug-in/gimppluginmanager-data.h"
|
#include "plug-in/gimppluginmanager-data.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,19 +20,18 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
#include "plug-in/gimpplugin-progress.h"
|
#include "plug-in/gimpplugin-progress.h"
|
||||||
#include "plug-in/gimpplugin.h"
|
#include "plug-in/gimpplugin.h"
|
||||||
#include "plug-in/gimppluginmanager.h"
|
#include "plug-in/gimppluginmanager.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,26 +20,26 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimpchannel-select.h"
|
#include "core/gimpchannel-select.h"
|
||||||
#include "core/gimpchannel.h"
|
#include "core/gimpchannel.h"
|
||||||
#include "core/gimpdrawable.h"
|
#include "core/gimpdrawable.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "core/gimplayer.h"
|
#include "core/gimplayer.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
#include "core/gimppickable.h"
|
#include "core/gimppickable.h"
|
||||||
#include "core/gimpselection.h"
|
#include "core/gimpselection.h"
|
||||||
#include "gimp-intl.h"
|
|
||||||
#include "gimppdb-utils.h"
|
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimppdb-utils.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
selection_bounds_invoker (GimpProcedure *procedure,
|
selection_bounds_invoker (GimpProcedure *procedure,
|
||||||
|
|
|
@ -20,24 +20,24 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "libgimpbase/gimpbase.h"
|
#include "libgimpbase/gimpbase.h"
|
||||||
#include "libgimpcolor/gimpcolor.h"
|
#include "libgimpcolor/gimpcolor.h"
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimpchannel-select.h"
|
#include "core/gimpchannel-select.h"
|
||||||
#include "core/gimpdrawable.h"
|
#include "core/gimpdrawable.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "gimp-intl.h"
|
#include "core/gimpparamspecs.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
by_color_select_invoker (GimpProcedure *procedure,
|
by_color_select_invoker (GimpProcedure *procedure,
|
||||||
|
|
|
@ -20,22 +20,21 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "libgimpbase/gimpbase.h"
|
#include "libgimpbase/gimpbase.h"
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimpdrawable.h"
|
#include "core/gimpdrawable.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "core/gimplayer.h"
|
#include "core/gimplayer.h"
|
||||||
#include "gimppdb-utils.h"
|
#include "core/gimpparamspecs.h"
|
||||||
#include "text/gimptext-compat.h"
|
#include "text/gimptext-compat.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimppdb-utils.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,15 +20,11 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "libgimpmath/gimpmath.h"
|
#include "libgimpmath/gimpmath.h"
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "config/gimpcoreconfig.h"
|
#include "config/gimpcoreconfig.h"
|
||||||
#include "core/gimp-transform-utils.h"
|
#include "core/gimp-transform-utils.h"
|
||||||
|
@ -36,12 +32,16 @@
|
||||||
#include "core/gimpdrawable-transform.h"
|
#include "core/gimpdrawable-transform.h"
|
||||||
#include "core/gimpdrawable.h"
|
#include "core/gimpdrawable.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
#include "core/gimpprogress.h"
|
#include "core/gimpprogress.h"
|
||||||
#include "gimp-intl.h"
|
|
||||||
#include "gimppdb-utils.h"
|
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimppdb-utils.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
flip_invoker (GimpProcedure *procedure,
|
flip_invoker (GimpProcedure *procedure,
|
||||||
|
|
|
@ -20,21 +20,20 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpimage-undo.h"
|
#include "core/gimpimage-undo.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
#include "plug-in/gimpplugin-cleanup.h"
|
#include "plug-in/gimpplugin-cleanup.h"
|
||||||
#include "plug-in/gimpplugin.h"
|
#include "plug-in/gimpplugin.h"
|
||||||
#include "plug-in/gimppluginmanager.h"
|
#include "plug-in/gimppluginmanager.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,18 +20,17 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "libgimpbase/gimpbase.h"
|
#include "libgimpbase/gimpbase.h"
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
|
#include "core/gimpparamspecs.h"
|
||||||
#include "core/gimpunit.h"
|
#include "core/gimpunit.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,15 +25,11 @@
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "pdb-types.h"
|
#include "pdb-types.h"
|
||||||
#include "gimppdb.h"
|
|
||||||
#include "gimpprocedure.h"
|
|
||||||
#include "core/gimpparamspecs.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
|
||||||
#include "core/gimpchannel-select.h"
|
#include "core/gimpchannel-select.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "core/gimplist.h"
|
#include "core/gimplist.h"
|
||||||
#include "gimp-intl.h"
|
#include "core/gimpparamspecs.h"
|
||||||
#include "vectors/gimpanchor.h"
|
#include "vectors/gimpanchor.h"
|
||||||
#include "vectors/gimpbezierstroke.h"
|
#include "vectors/gimpbezierstroke.h"
|
||||||
#include "vectors/gimpstroke-new.h"
|
#include "vectors/gimpstroke-new.h"
|
||||||
|
@ -41,8 +37,12 @@
|
||||||
#include "vectors/gimpvectors-import.h"
|
#include "vectors/gimpvectors-import.h"
|
||||||
#include "vectors/gimpvectors.h"
|
#include "vectors/gimpvectors.h"
|
||||||
|
|
||||||
|
#include "gimppdb.h"
|
||||||
|
#include "gimpprocedure.h"
|
||||||
#include "internal_procs.h"
|
#include "internal_procs.h"
|
||||||
|
|
||||||
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
vectors_is_valid_invoker (GimpProcedure *procedure,
|
vectors_is_valid_invoker (GimpProcedure *procedure,
|
||||||
|
|
|
@ -64,6 +64,7 @@
|
||||||
|
|
||||||
#include "plug-in-types.h"
|
#include "plug-in-types.h"
|
||||||
|
|
||||||
|
#include "base/base-utils.h"
|
||||||
#include "base/tile.h"
|
#include "base/tile.h"
|
||||||
|
|
||||||
#include "gimppluginshm.h"
|
#include "gimppluginshm.h"
|
||||||
|
@ -180,7 +181,7 @@ gimp_plug_in_shm_new (void)
|
||||||
gint shm_fd;
|
gint shm_fd;
|
||||||
|
|
||||||
/* Our shared memory id will be our process ID */
|
/* Our shared memory id will be our process ID */
|
||||||
pid = getpid ();
|
pid = get_pid ();
|
||||||
|
|
||||||
/* From the id, derive the file map name */
|
/* From the id, derive the file map name */
|
||||||
g_snprintf (shm_handle, sizeof (shm_handle), "/gimp-shm-%d", pid);
|
g_snprintf (shm_handle, sizeof (shm_handle), "/gimp-shm-%d", pid);
|
||||||
|
|
|
@ -106,14 +106,14 @@ gimp_text_gdyntext_parasite_name (void)
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
TEXT = 0,
|
TEXT = 0,
|
||||||
ANTIALIAS = 1,
|
ANTIALIAS = 1,
|
||||||
ALIGNMENT = 2,
|
ALIGNMENT = 2,
|
||||||
ROTATION = 3,
|
ROTATION = 3,
|
||||||
LINE_SPACING = 4,
|
LINE_SPACING = 4,
|
||||||
COLOR = 5,
|
COLOR = 5,
|
||||||
LAYER_ALIGNMENT = 6,
|
LAYER_ALIGNMENT = 6,
|
||||||
XLFD = 7,
|
XLFD = 7,
|
||||||
NUM_PARAMS
|
NUM_PARAMS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -178,8 +178,8 @@ gimp_curves_tool_init (GimpCurvesTool *tool)
|
||||||
|
|
||||||
tool->lut = gimp_lut_new ();
|
tool->lut = gimp_lut_new ();
|
||||||
|
|
||||||
for (i = 0; i < G_N_ELEMENTS (tool->col_value); i++)
|
for (i = 0; i < G_N_ELEMENTS (tool->picked_color); i++)
|
||||||
tool->col_value[i] = -1;
|
tool->picked_color[i] = -1.0;
|
||||||
|
|
||||||
im_tool->apply_func = (GimpImageMapApplyFunc) gimp_lut_process;
|
im_tool->apply_func = (GimpImageMapApplyFunc) gimp_lut_process;
|
||||||
im_tool->apply_data = tool->lut;
|
im_tool->apply_data = tool->lut;
|
||||||
|
@ -248,19 +248,16 @@ gimp_curves_tool_button_release (GimpTool *tool,
|
||||||
if (state & GDK_SHIFT_MASK)
|
if (state & GDK_SHIFT_MASK)
|
||||||
{
|
{
|
||||||
GimpCurve *curve = config->curve[config->channel];
|
GimpCurve *curve = config->curve[config->channel];
|
||||||
|
gdouble value = c_tool->picked_color[config->channel];
|
||||||
gint closest;
|
gint closest;
|
||||||
|
|
||||||
closest =
|
closest = gimp_curve_get_closest_point (curve, value);
|
||||||
gimp_curve_get_closest_point (curve,
|
|
||||||
c_tool->col_value[config->channel]);
|
|
||||||
|
|
||||||
gimp_curve_view_set_selected (GIMP_CURVE_VIEW (c_tool->graph),
|
gimp_curve_view_set_selected (GIMP_CURVE_VIEW (c_tool->graph),
|
||||||
closest);
|
closest);
|
||||||
|
|
||||||
gimp_curve_set_point (curve,
|
gimp_curve_set_point (curve, closest,
|
||||||
closest,
|
value, gimp_curve_map (curve, value));
|
||||||
c_tool->col_value[config->channel],
|
|
||||||
curve->curve[c_tool->col_value[config->channel]]);
|
|
||||||
}
|
}
|
||||||
else if (state & GDK_CONTROL_MASK)
|
else if (state & GDK_CONTROL_MASK)
|
||||||
{
|
{
|
||||||
|
@ -269,19 +266,16 @@ gimp_curves_tool_button_release (GimpTool *tool,
|
||||||
for (i = 0; i < 5; i++)
|
for (i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
GimpCurve *curve = config->curve[i];
|
GimpCurve *curve = config->curve[i];
|
||||||
|
gdouble value = c_tool->picked_color[i];
|
||||||
gint closest;
|
gint closest;
|
||||||
|
|
||||||
closest =
|
closest = gimp_curve_get_closest_point (curve, value);
|
||||||
gimp_curve_get_closest_point (curve,
|
|
||||||
c_tool->col_value[i]);
|
|
||||||
|
|
||||||
gimp_curve_view_set_selected (GIMP_CURVE_VIEW (c_tool->graph),
|
gimp_curve_view_set_selected (GIMP_CURVE_VIEW (c_tool->graph),
|
||||||
closest);
|
closest);
|
||||||
|
|
||||||
gimp_curve_set_point (curve,
|
gimp_curve_set_point (curve, closest,
|
||||||
closest,
|
value, gimp_curve_map (curve, value));
|
||||||
c_tool->col_value[i],
|
|
||||||
curve->curve[c_tool->col_value[i]]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,26 +335,21 @@ gimp_curves_tool_color_picked (GimpColorTool *color_tool,
|
||||||
{
|
{
|
||||||
GimpCurvesTool *tool = GIMP_CURVES_TOOL (color_tool);
|
GimpCurvesTool *tool = GIMP_CURVES_TOOL (color_tool);
|
||||||
GimpDrawable *drawable;
|
GimpDrawable *drawable;
|
||||||
guchar r, g, b, a;
|
|
||||||
|
|
||||||
drawable = GIMP_IMAGE_MAP_TOOL (tool)->drawable;
|
drawable = GIMP_IMAGE_MAP_TOOL (tool)->drawable;
|
||||||
|
|
||||||
gimp_rgba_get_uchar (color, &r, &g, &b, &a);
|
tool->picked_color[GIMP_HISTOGRAM_RED] = color->r;
|
||||||
|
tool->picked_color[GIMP_HISTOGRAM_GREEN] = color->g;
|
||||||
tool->col_value[GIMP_HISTOGRAM_RED] = r;
|
tool->picked_color[GIMP_HISTOGRAM_BLUE] = color->b;
|
||||||
tool->col_value[GIMP_HISTOGRAM_GREEN] = g;
|
|
||||||
tool->col_value[GIMP_HISTOGRAM_BLUE] = b;
|
|
||||||
|
|
||||||
if (gimp_drawable_has_alpha (drawable))
|
if (gimp_drawable_has_alpha (drawable))
|
||||||
tool->col_value[GIMP_HISTOGRAM_ALPHA] = a;
|
tool->picked_color[GIMP_HISTOGRAM_ALPHA] = color->a;
|
||||||
|
|
||||||
if (gimp_drawable_is_indexed (drawable))
|
tool->picked_color[GIMP_HISTOGRAM_VALUE] = MAX (MAX (color->r, color->g),
|
||||||
tool->col_value[GIMP_HISTOGRAM_ALPHA] = color_index;
|
color->b);
|
||||||
|
|
||||||
tool->col_value[GIMP_HISTOGRAM_VALUE] = MAX (MAX (r, g), b);
|
|
||||||
|
|
||||||
gimp_curve_view_set_xpos (GIMP_CURVE_VIEW (tool->graph),
|
gimp_curve_view_set_xpos (GIMP_CURVE_VIEW (tool->graph),
|
||||||
tool->col_value[tool->config->channel]);
|
tool->picked_color[tool->config->channel]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GeglNode *
|
static GeglNode *
|
||||||
|
@ -641,29 +630,35 @@ gimp_curves_tool_config_notify (GObject *object,
|
||||||
|
|
||||||
switch (config->channel)
|
switch (config->channel)
|
||||||
{
|
{
|
||||||
|
guchar r[256];
|
||||||
|
guchar g[256];
|
||||||
|
guchar b[256];
|
||||||
|
|
||||||
case GIMP_HISTOGRAM_VALUE:
|
case GIMP_HISTOGRAM_VALUE:
|
||||||
case GIMP_HISTOGRAM_ALPHA:
|
case GIMP_HISTOGRAM_ALPHA:
|
||||||
case GIMP_HISTOGRAM_RGB:
|
case GIMP_HISTOGRAM_RGB:
|
||||||
|
gimp_curve_get_uchar (curve, r);
|
||||||
|
|
||||||
gimp_color_bar_set_buffers (GIMP_COLOR_BAR (tool->xrange),
|
gimp_color_bar_set_buffers (GIMP_COLOR_BAR (tool->xrange),
|
||||||
curve->curve,
|
r, r, r);
|
||||||
curve->curve,
|
|
||||||
curve->curve);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_HISTOGRAM_RED:
|
case GIMP_HISTOGRAM_RED:
|
||||||
case GIMP_HISTOGRAM_GREEN:
|
case GIMP_HISTOGRAM_GREEN:
|
||||||
case GIMP_HISTOGRAM_BLUE:
|
case GIMP_HISTOGRAM_BLUE:
|
||||||
|
gimp_curve_get_uchar (config->curve[GIMP_HISTOGRAM_RED], r);
|
||||||
|
gimp_curve_get_uchar (config->curve[GIMP_HISTOGRAM_GREEN], g);
|
||||||
|
gimp_curve_get_uchar (config->curve[GIMP_HISTOGRAM_BLUE], b);
|
||||||
|
|
||||||
gimp_color_bar_set_buffers (GIMP_COLOR_BAR (tool->xrange),
|
gimp_color_bar_set_buffers (GIMP_COLOR_BAR (tool->xrange),
|
||||||
config->curve[GIMP_HISTOGRAM_RED]->curve,
|
r, g, b);
|
||||||
config->curve[GIMP_HISTOGRAM_GREEN]->curve,
|
|
||||||
config->curve[GIMP_HISTOGRAM_BLUE]->curve);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_histogram_view_set_channel (GIMP_HISTOGRAM_VIEW (tool->graph),
|
gimp_histogram_view_set_channel (GIMP_HISTOGRAM_VIEW (tool->graph),
|
||||||
config->channel);
|
config->channel);
|
||||||
gimp_curve_view_set_xpos (GIMP_CURVE_VIEW (tool->graph),
|
gimp_curve_view_set_xpos (GIMP_CURVE_VIEW (tool->graph),
|
||||||
tool->col_value[config->channel]);
|
tool->picked_color[config->channel]);
|
||||||
|
|
||||||
gimp_color_bar_set_channel (GIMP_COLOR_BAR (tool->yrange),
|
gimp_color_bar_set_channel (GIMP_COLOR_BAR (tool->yrange),
|
||||||
config->channel);
|
config->channel);
|
||||||
|
|
|
@ -41,7 +41,7 @@ struct _GimpCurvesTool
|
||||||
GimpLut *lut;
|
GimpLut *lut;
|
||||||
|
|
||||||
/* dialog */
|
/* dialog */
|
||||||
gint col_value[5];
|
gdouble picked_color[5];
|
||||||
|
|
||||||
GtkWidget *channel_menu;
|
GtkWidget *channel_menu;
|
||||||
GtkWidget *xrange;
|
GtkWidget *xrange;
|
||||||
|
|
|
@ -350,6 +350,17 @@ gimp_param_spec_duplicate (GParamSpec *pspec)
|
||||||
spec->default_value,
|
spec->default_value,
|
||||||
pspec->flags);
|
pspec->flags);
|
||||||
}
|
}
|
||||||
|
else if (G_IS_PARAM_SPEC_ENUM (pspec))
|
||||||
|
{
|
||||||
|
GParamSpecEnum *spec = G_PARAM_SPEC_ENUM (pspec);
|
||||||
|
|
||||||
|
return g_param_spec_enum (pspec->name,
|
||||||
|
g_param_spec_get_nick (pspec),
|
||||||
|
g_param_spec_get_blurb (pspec),
|
||||||
|
G_TYPE_FROM_CLASS (spec->enum_class),
|
||||||
|
spec->default_value,
|
||||||
|
pspec->flags);
|
||||||
|
}
|
||||||
else if (G_IS_PARAM_SPEC_DOUBLE (pspec))
|
else if (G_IS_PARAM_SPEC_DOUBLE (pspec))
|
||||||
{
|
{
|
||||||
GParamSpecDouble *spec = G_PARAM_SPEC_DOUBLE (pspec);
|
GParamSpecDouble *spec = G_PARAM_SPEC_DOUBLE (pspec);
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
## Process this file with automake to produce Makefile.in
|
## Process this file with automake to produce Makefile.in
|
||||||
|
|
||||||
AM_CPPFLAGS = \
|
AM_CPPFLAGS = \
|
||||||
|
-DISO_CODES_LOCATION=\"$(ISO_CODES_LOCATION)\" \
|
||||||
|
-DISO_CODES_LOCALEDIR=\"$(ISO_CODES_LOCALEDIR)\" \
|
||||||
-DG_LOG_DOMAIN=\"Gimp-Widgets\"
|
-DG_LOG_DOMAIN=\"Gimp-Widgets\"
|
||||||
|
|
||||||
INCLUDES = \
|
INCLUDES = \
|
||||||
|
@ -189,6 +191,10 @@ libappwidgets_a_sources = \
|
||||||
gimpimageview.h \
|
gimpimageview.h \
|
||||||
gimpitemtreeview.c \
|
gimpitemtreeview.c \
|
||||||
gimpitemtreeview.h \
|
gimpitemtreeview.h \
|
||||||
|
gimplanguagestore.c \
|
||||||
|
gimplanguagestore.h \
|
||||||
|
gimplanguagestore-parser.c \
|
||||||
|
gimplanguagestore-parser.h \
|
||||||
gimplayertreeview.c \
|
gimplayertreeview.c \
|
||||||
gimplayertreeview.h \
|
gimplayertreeview.h \
|
||||||
gimpmenudock.c \
|
gimpmenudock.c \
|
||||||
|
|
|
@ -68,6 +68,11 @@ static gboolean gimp_curve_view_leave_notify (GtkWidget *widget,
|
||||||
static gboolean gimp_curve_view_key_press (GtkWidget *widget,
|
static gboolean gimp_curve_view_key_press (GtkWidget *widget,
|
||||||
GdkEventKey *kevent);
|
GdkEventKey *kevent);
|
||||||
|
|
||||||
|
static void gimp_curve_view_set_cursor (GimpCurveView *view,
|
||||||
|
gdouble x,
|
||||||
|
gdouble y);
|
||||||
|
static void gimp_curve_view_unset_cursor (GimpCurveView *view);
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (GimpCurveView, gimp_curve_view,
|
G_DEFINE_TYPE (GimpCurveView, gimp_curve_view,
|
||||||
GIMP_TYPE_HISTOGRAM_VIEW)
|
GIMP_TYPE_HISTOGRAM_VIEW)
|
||||||
|
@ -117,11 +122,12 @@ gimp_curve_view_init (GimpCurveView *view)
|
||||||
{
|
{
|
||||||
view->curve = NULL;
|
view->curve = NULL;
|
||||||
view->selected = 0;
|
view->selected = 0;
|
||||||
view->last = 0;
|
view->last_x = 0.0;
|
||||||
|
view->last_y = 0.0;
|
||||||
view->cursor_type = -1;
|
view->cursor_type = -1;
|
||||||
view->xpos = -1;
|
view->xpos = -1.0;
|
||||||
view->cursor_x = -1;
|
view->cursor_x = -1.0;
|
||||||
view->cursor_y = -1;
|
view->cursor_y = -1.0;
|
||||||
|
|
||||||
GTK_WIDGET_SET_FLAGS (view, GTK_CAN_FOCUS);
|
GTK_WIDGET_SET_FLAGS (view, GTK_CAN_FOCUS);
|
||||||
|
|
||||||
|
@ -307,21 +313,23 @@ gimp_curve_view_draw_point (GimpCurveView *view,
|
||||||
gint height,
|
gint height,
|
||||||
gint border)
|
gint border)
|
||||||
{
|
{
|
||||||
gint x, y;
|
gdouble x, y;
|
||||||
|
|
||||||
x = view->curve->points[i][0];
|
x = view->curve->points[i].x;
|
||||||
if (x < 0)
|
y = 1.0 - view->curve->points[i].y;
|
||||||
|
|
||||||
|
if (x < 0.0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
y = 255 - view->curve->points[i][1];
|
#define RADIUS 3
|
||||||
|
|
||||||
cairo_move_to (cr,
|
cairo_move_to (cr,
|
||||||
border + (gdouble) width * x / 256.0,
|
border + (gdouble) width * x + RADIUS,
|
||||||
border + (gdouble) height * y / 256.0);
|
border + (gdouble) height * y);
|
||||||
cairo_arc (cr,
|
cairo_arc (cr,
|
||||||
border + (gdouble) width * x / 256.0,
|
border + (gdouble) width * x,
|
||||||
border + (gdouble) height * y / 256.0,
|
border + (gdouble) height * y,
|
||||||
3,
|
RADIUS,
|
||||||
0, 2 * G_PI);
|
0, 2 * G_PI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,7 +343,7 @@ gimp_curve_view_expose (GtkWidget *widget,
|
||||||
gint border;
|
gint border;
|
||||||
gint width;
|
gint width;
|
||||||
gint height;
|
gint height;
|
||||||
gint x, y;
|
gdouble x, y;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
|
GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
|
||||||
|
@ -345,8 +353,8 @@ gimp_curve_view_expose (GtkWidget *widget,
|
||||||
|
|
||||||
border = GIMP_HISTOGRAM_VIEW (view)->border_width;
|
border = GIMP_HISTOGRAM_VIEW (view)->border_width;
|
||||||
|
|
||||||
width = widget->allocation.width - 2 * border;
|
width = widget->allocation.width - 2 * border - 1;
|
||||||
height = widget->allocation.height - 2 * border;
|
height = widget->allocation.height - 2 * border - 1;
|
||||||
|
|
||||||
cr = gdk_cairo_create (widget->window);
|
cr = gdk_cairo_create (widget->window);
|
||||||
|
|
||||||
|
@ -361,26 +369,26 @@ gimp_curve_view_expose (GtkWidget *widget,
|
||||||
/* Draw the curve */
|
/* Draw the curve */
|
||||||
gdk_cairo_set_source_color (cr, &style->text[GTK_STATE_NORMAL]);
|
gdk_cairo_set_source_color (cr, &style->text[GTK_STATE_NORMAL]);
|
||||||
|
|
||||||
x = 0;
|
x = 0.0;
|
||||||
y = 255 - view->curve->curve[x];
|
y = 1.0 - gimp_curve_map (view->curve, 0.0);
|
||||||
|
|
||||||
cairo_move_to (cr,
|
cairo_move_to (cr,
|
||||||
border + (gdouble) width * x / 256.0,
|
border + (gdouble) width * x,
|
||||||
border + (gdouble) height * y / 256.0);
|
border + (gdouble) height * y);
|
||||||
|
|
||||||
for (i = 0; i < 256; i++)
|
for (i = 1; i < 256; i++)
|
||||||
{
|
{
|
||||||
x = i;
|
x = (gdouble) i / 255.0;
|
||||||
y = 255 - view->curve->curve[x];
|
y = 1.0 - gimp_curve_map (view->curve, x);
|
||||||
|
|
||||||
cairo_line_to (cr,
|
cairo_line_to (cr,
|
||||||
border + (gdouble) width * x / 256.0,
|
border + (gdouble) width * x,
|
||||||
border + (gdouble) height * y / 256.0);
|
border + (gdouble) height * y);
|
||||||
}
|
}
|
||||||
|
|
||||||
cairo_stroke (cr);
|
cairo_stroke (cr);
|
||||||
|
|
||||||
if (view->curve->curve_type == GIMP_CURVE_SMOOTH)
|
if (gimp_curve_get_curve_type (view->curve) == GIMP_CURVE_SMOOTH)
|
||||||
{
|
{
|
||||||
gdk_cairo_set_source_color (cr, &style->text[GTK_STATE_NORMAL]);
|
gdk_cairo_set_source_color (cr, &style->text[GTK_STATE_NORMAL]);
|
||||||
|
|
||||||
|
@ -404,44 +412,46 @@ gimp_curve_view_expose (GtkWidget *widget,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (view->xpos >= 0)
|
if (view->xpos >= 0.0)
|
||||||
{
|
{
|
||||||
|
gint layout_x;
|
||||||
|
gint layout_y;
|
||||||
gchar buf[32];
|
gchar buf[32];
|
||||||
|
|
||||||
gdk_cairo_set_source_color (cr, &style->text[GTK_STATE_NORMAL]);
|
gdk_cairo_set_source_color (cr, &style->text[GTK_STATE_NORMAL]);
|
||||||
|
|
||||||
/* draw the color line */
|
/* draw the color line */
|
||||||
cairo_move_to (cr,
|
cairo_move_to (cr,
|
||||||
border + ROUND ((gdouble) width * view->xpos / 256.0),
|
border + ROUND ((gdouble) width * view->xpos),
|
||||||
border);
|
border);
|
||||||
cairo_line_to (cr,
|
cairo_line_to (cr,
|
||||||
border + ROUND ((gdouble) width * view->xpos / 256.0),
|
border + ROUND ((gdouble) width * view->xpos),
|
||||||
border + height - 1);
|
border + height - 1);
|
||||||
cairo_stroke (cr);
|
cairo_stroke (cr);
|
||||||
|
|
||||||
/* and xpos indicator */
|
/* and xpos indicator */
|
||||||
g_snprintf (buf, sizeof (buf), "x:%d", view->xpos);
|
g_snprintf (buf, sizeof (buf), "x:%d", (gint) (view->xpos * 255.999));
|
||||||
|
|
||||||
if (! view->xpos_layout)
|
if (! view->xpos_layout)
|
||||||
view->xpos_layout = gtk_widget_create_pango_layout (widget, NULL);
|
view->xpos_layout = gtk_widget_create_pango_layout (widget, NULL);
|
||||||
|
|
||||||
pango_layout_set_text (view->xpos_layout, buf, -1);
|
pango_layout_set_text (view->xpos_layout, buf, -1);
|
||||||
pango_layout_get_pixel_size (view->xpos_layout, &x, &y);
|
pango_layout_get_pixel_size (view->xpos_layout, &layout_x, &layout_y);
|
||||||
|
|
||||||
if (view->xpos < 127)
|
if (view->xpos < 0.5)
|
||||||
x = border;
|
layout_x = border;
|
||||||
else
|
else
|
||||||
x = -(x + border);
|
layout_x = -(layout_x + border);
|
||||||
|
|
||||||
cairo_move_to (cr,
|
cairo_move_to (cr,
|
||||||
border + (gdouble) width * view->xpos / 256.0 + x,
|
border + (gdouble) width * view->xpos + layout_x,
|
||||||
border + height - border - y);
|
border + height - border - layout_y);
|
||||||
pango_cairo_show_layout (cr, view->xpos_layout);
|
pango_cairo_show_layout (cr, view->xpos_layout);
|
||||||
cairo_fill (cr);
|
cairo_fill (cr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (view->cursor_x >= 0 && view->cursor_x <= 255 &&
|
if (view->cursor_x >= 0.0 && view->cursor_x <= 1.0 &&
|
||||||
view->cursor_y >= 0 && view->cursor_y <= 255)
|
view->cursor_y >= 0.0 && view->cursor_y <= 1.0)
|
||||||
{
|
{
|
||||||
gchar buf[32];
|
gchar buf[32];
|
||||||
gint w, h;
|
gint w, h;
|
||||||
|
@ -470,7 +480,8 @@ gimp_curve_view_expose (GtkWidget *widget,
|
||||||
cairo_stroke (cr);
|
cairo_stroke (cr);
|
||||||
|
|
||||||
g_snprintf (buf, sizeof (buf), "x:%3d y:%3d",
|
g_snprintf (buf, sizeof (buf), "x:%3d y:%3d",
|
||||||
view->cursor_x, 255 - view->cursor_y);
|
(gint) (view->cursor_x * 255.999),
|
||||||
|
(gint) ((1.0 - view->cursor_y) * 255.999));
|
||||||
pango_layout_set_text (view->cursor_layout, buf, -1);
|
pango_layout_set_text (view->cursor_layout, buf, -1);
|
||||||
|
|
||||||
gdk_cairo_set_source_color (cr, &style->base[GTK_STATE_NORMAL]);
|
gdk_cairo_set_source_color (cr, &style->base[GTK_STATE_NORMAL]);
|
||||||
|
@ -512,7 +523,8 @@ gimp_curve_view_button_press (GtkWidget *widget,
|
||||||
GimpCurve *curve = view->curve;
|
GimpCurve *curve = view->curve;
|
||||||
gint border;
|
gint border;
|
||||||
gint width, height;
|
gint width, height;
|
||||||
gint x, y;
|
gdouble x;
|
||||||
|
gdouble y;
|
||||||
gint closest_point;
|
gint closest_point;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
|
@ -523,11 +535,11 @@ gimp_curve_view_button_press (GtkWidget *widget,
|
||||||
width = widget->allocation.width - 2 * border;
|
width = widget->allocation.width - 2 * border;
|
||||||
height = widget->allocation.height - 2 * border;
|
height = widget->allocation.height - 2 * border;
|
||||||
|
|
||||||
x = ROUND (((gdouble) (bevent->x - border) / (gdouble) width) * 255.0);
|
x = (gdouble) (bevent->x - border) / (gdouble) width;
|
||||||
y = ROUND (((gdouble) (bevent->y - border) / (gdouble) height) * 255.0);
|
y = (gdouble) (bevent->y - border) / (gdouble) height;
|
||||||
|
|
||||||
x = CLAMP0255 (x);
|
x = CLAMP (x, 0.0, 1.0);
|
||||||
y = CLAMP0255 (y);
|
y = CLAMP (y, 0.0, 1.0);
|
||||||
|
|
||||||
closest_point = gimp_curve_get_closest_point (curve, x);
|
closest_point = gimp_curve_get_closest_point (curve, x);
|
||||||
|
|
||||||
|
@ -535,36 +547,36 @@ gimp_curve_view_button_press (GtkWidget *widget,
|
||||||
|
|
||||||
set_cursor (view, GDK_TCROSS);
|
set_cursor (view, GDK_TCROSS);
|
||||||
|
|
||||||
switch (curve->curve_type)
|
switch (gimp_curve_get_curve_type (curve))
|
||||||
{
|
{
|
||||||
case GIMP_CURVE_SMOOTH:
|
case GIMP_CURVE_SMOOTH:
|
||||||
/* determine the leftmost and rightmost points */
|
/* determine the leftmost and rightmost points */
|
||||||
view->leftmost = -1;
|
view->leftmost = -1.0;
|
||||||
for (i = closest_point - 1; i >= 0; i--)
|
for (i = closest_point - 1; i >= 0; i--)
|
||||||
if (curve->points[i][0] != -1)
|
if (curve->points[i].x >= 0.0)
|
||||||
{
|
{
|
||||||
view->leftmost = curve->points[i][0];
|
view->leftmost = curve->points[i].x;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
view->rightmost = 256;
|
view->rightmost = 2.0;
|
||||||
for (i = closest_point + 1; i < GIMP_CURVE_NUM_POINTS; i++)
|
for (i = closest_point + 1; i < GIMP_CURVE_NUM_POINTS; i++)
|
||||||
if (curve->points[i][0] != -1)
|
if (curve->points[i].x >= 0.0)
|
||||||
{
|
{
|
||||||
view->rightmost = curve->points[i][0];
|
view->rightmost = curve->points[i].x;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_curve_view_set_selected (view, closest_point);
|
gimp_curve_view_set_selected (view, closest_point);
|
||||||
|
|
||||||
gimp_curve_set_point (curve, view->selected, x, 255 - y);
|
gimp_curve_set_point (curve, view->selected, x, 1.0 - y);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_CURVE_FREE:
|
case GIMP_CURVE_FREE:
|
||||||
gimp_curve_view_set_selected (view, x);
|
view->last_x = x;
|
||||||
view->last = y;
|
view->last_y = y;
|
||||||
|
|
||||||
gimp_curve_set_curve (curve, x, 255 - y);
|
gimp_curve_set_curve (curve, x, 1.0 - y);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -599,9 +611,9 @@ gimp_curve_view_motion_notify (GtkWidget *widget,
|
||||||
GimpCursorType new_cursor = GDK_X_CURSOR;
|
GimpCursorType new_cursor = GDK_X_CURSOR;
|
||||||
gint border;
|
gint border;
|
||||||
gint width, height;
|
gint width, height;
|
||||||
gint x, y;
|
gdouble x;
|
||||||
|
gdouble y;
|
||||||
gint closest_point;
|
gint closest_point;
|
||||||
gint i;
|
|
||||||
|
|
||||||
if (! curve)
|
if (! curve)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -610,20 +622,20 @@ gimp_curve_view_motion_notify (GtkWidget *widget,
|
||||||
width = widget->allocation.width - 2 * border;
|
width = widget->allocation.width - 2 * border;
|
||||||
height = widget->allocation.height - 2 * border;
|
height = widget->allocation.height - 2 * border;
|
||||||
|
|
||||||
x = ROUND (((gdouble) (mevent->x - border) / (gdouble) width) * 255.0);
|
x = (gdouble) (mevent->x - border) / (gdouble) width;
|
||||||
y = ROUND (((gdouble) (mevent->y - border) / (gdouble) height) * 255.0);
|
y = (gdouble) (mevent->y - border) / (gdouble) height;
|
||||||
|
|
||||||
x = CLAMP0255 (x);
|
x = CLAMP (x, 0.0, 1.0);
|
||||||
y = CLAMP0255 (y);
|
y = CLAMP (y, 0.0, 1.0);
|
||||||
|
|
||||||
closest_point = gimp_curve_get_closest_point (curve, x);
|
closest_point = gimp_curve_get_closest_point (curve, x);
|
||||||
|
|
||||||
switch (curve->curve_type)
|
switch (gimp_curve_get_curve_type (curve))
|
||||||
{
|
{
|
||||||
case GIMP_CURVE_SMOOTH:
|
case GIMP_CURVE_SMOOTH:
|
||||||
if (! view->grabbed) /* If no point is grabbed... */
|
if (! view->grabbed) /* If no point is grabbed... */
|
||||||
{
|
{
|
||||||
if (curve->points[closest_point][0] != -1)
|
if (curve->points[closest_point].x >= 0.0)
|
||||||
new_cursor = GDK_FLEUR;
|
new_cursor = GDK_FLEUR;
|
||||||
else
|
else
|
||||||
new_cursor = GDK_TCROSS;
|
new_cursor = GDK_TCROSS;
|
||||||
|
@ -634,15 +646,15 @@ gimp_curve_view_motion_notify (GtkWidget *widget,
|
||||||
|
|
||||||
gimp_data_freeze (GIMP_DATA (curve));
|
gimp_data_freeze (GIMP_DATA (curve));
|
||||||
|
|
||||||
gimp_curve_set_point (curve, view->selected, -1, -1);
|
gimp_curve_set_point (curve, view->selected, -1.0, -1.0);
|
||||||
|
|
||||||
if (x > view->leftmost && x < view->rightmost)
|
if (x > view->leftmost && x < view->rightmost)
|
||||||
{
|
{
|
||||||
closest_point = (x + 8) / 16;
|
closest_point = ((gint) (x * 255.999) + 8) / 16;
|
||||||
if (curve->points[closest_point][0] == -1)
|
if (curve->points[closest_point].x < 0.0)
|
||||||
gimp_curve_view_set_selected (view, closest_point);
|
gimp_curve_view_set_selected (view, closest_point);
|
||||||
|
|
||||||
gimp_curve_set_point (curve, view->selected, x, 255 - y);
|
gimp_curve_set_point (curve, view->selected, x, 1.0 - y);
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_data_thaw (GIMP_DATA (curve));
|
gimp_data_thaw (GIMP_DATA (curve));
|
||||||
|
@ -652,40 +664,44 @@ gimp_curve_view_motion_notify (GtkWidget *widget,
|
||||||
case GIMP_CURVE_FREE:
|
case GIMP_CURVE_FREE:
|
||||||
if (view->grabbed)
|
if (view->grabbed)
|
||||||
{
|
{
|
||||||
gint x1, x2, y1, y2;
|
gdouble x1, x2;
|
||||||
|
gdouble y1, y2;
|
||||||
|
|
||||||
if (view->selected > x)
|
if (view->last_x > x)
|
||||||
{
|
{
|
||||||
x1 = x;
|
x1 = x;
|
||||||
x2 = view->selected;
|
x2 = view->last_x;
|
||||||
y1 = y;
|
y1 = y;
|
||||||
y2 = view->last;
|
y2 = view->last_y;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
x1 = view->selected;
|
x1 = view->last_x;
|
||||||
x2 = x;
|
x2 = x;
|
||||||
y1 = view->last;
|
y1 = view->last_y;
|
||||||
y2 = y;
|
y2 = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x2 != x1)
|
if (x2 != x1)
|
||||||
{
|
{
|
||||||
|
gint i;
|
||||||
|
|
||||||
gimp_data_freeze (GIMP_DATA (curve));
|
gimp_data_freeze (GIMP_DATA (curve));
|
||||||
|
|
||||||
for (i = x1; i <= x2; i++)
|
for (i = (gint) (x1 * 255.999); i <= (gint) (x2 * 255.999); i++)
|
||||||
gimp_curve_set_curve (curve, i,
|
gimp_curve_set_curve (curve,
|
||||||
255 - (y1 + ((y2 - y1) * (i - x1)) / (x2 - x1)));
|
(gdouble) i / 255.0,
|
||||||
|
1.0 - (y1 + ((y2 - y1) * ((gdouble) i / 255.0 - x1)) / (x2 - x1)));
|
||||||
|
|
||||||
gimp_data_thaw (GIMP_DATA (curve));
|
gimp_data_thaw (GIMP_DATA (curve));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gimp_curve_set_curve (curve, x, 255 - y);
|
gimp_curve_set_curve (curve, x, 1.0 - y);
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_curve_view_set_selected (view, x);
|
view->last_x = x;
|
||||||
view->last = y;
|
view->last_y = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mevent->state & GDK_BUTTON1_MASK)
|
if (mevent->state & GDK_BUTTON1_MASK)
|
||||||
|
@ -709,7 +725,7 @@ gimp_curve_view_leave_notify (GtkWidget *widget,
|
||||||
{
|
{
|
||||||
GimpCurveView *view = GIMP_CURVE_VIEW (widget);
|
GimpCurveView *view = GIMP_CURVE_VIEW (widget);
|
||||||
|
|
||||||
gimp_curve_view_set_cursor (view, -1, -1);
|
gimp_curve_view_unset_cursor (view);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -721,10 +737,11 @@ gimp_curve_view_key_press (GtkWidget *widget,
|
||||||
GimpCurveView *view = GIMP_CURVE_VIEW (widget);
|
GimpCurveView *view = GIMP_CURVE_VIEW (widget);
|
||||||
GimpCurve *curve = view->curve;
|
GimpCurve *curve = view->curve;
|
||||||
gint i = view->selected;
|
gint i = view->selected;
|
||||||
gint y = curve->points[i][1];
|
gdouble y = curve->points[i].y;
|
||||||
gboolean retval = FALSE;
|
gboolean retval = FALSE;
|
||||||
|
|
||||||
if (view->grabbed || ! curve || curve->curve_type == GIMP_CURVE_FREE)
|
if (view->grabbed || ! curve ||
|
||||||
|
gimp_curve_get_curve_type (curve) == GIMP_CURVE_FREE)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
switch (kevent->keyval)
|
switch (kevent->keyval)
|
||||||
|
@ -732,7 +749,7 @@ gimp_curve_view_key_press (GtkWidget *widget,
|
||||||
case GDK_Left:
|
case GDK_Left:
|
||||||
for (i = i - 1; i >= 0 && ! retval; i--)
|
for (i = i - 1; i >= 0 && ! retval; i--)
|
||||||
{
|
{
|
||||||
if (curve->points[i][0] != -1)
|
if (curve->points[i].x >= 0.0)
|
||||||
{
|
{
|
||||||
gimp_curve_view_set_selected (view, i);
|
gimp_curve_view_set_selected (view, i);
|
||||||
|
|
||||||
|
@ -744,7 +761,7 @@ gimp_curve_view_key_press (GtkWidget *widget,
|
||||||
case GDK_Right:
|
case GDK_Right:
|
||||||
for (i = i + 1; i < GIMP_CURVE_NUM_POINTS && ! retval; i++)
|
for (i = i + 1; i < GIMP_CURVE_NUM_POINTS && ! retval; i++)
|
||||||
{
|
{
|
||||||
if (curve->points[i][0] != -1)
|
if (curve->points[i].x >= 0.0)
|
||||||
{
|
{
|
||||||
gimp_curve_view_set_selected (view, i);
|
gimp_curve_view_set_selected (view, i);
|
||||||
|
|
||||||
|
@ -754,11 +771,12 @@ gimp_curve_view_key_press (GtkWidget *widget,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GDK_Up:
|
case GDK_Up:
|
||||||
if (y < 255)
|
if (y < 1.0)
|
||||||
{
|
{
|
||||||
y = y + (kevent->state & GDK_SHIFT_MASK ? 16 : 1);
|
y = y + (kevent->state & GDK_SHIFT_MASK ?
|
||||||
|
(16.0 / 255.0) : (1.0 / 255.0));
|
||||||
|
|
||||||
gimp_curve_move_point (curve, i, CLAMP0255 (y));
|
gimp_curve_move_point (curve, i, CLAMP (y, 0.0, 1.0));
|
||||||
|
|
||||||
retval = TRUE;
|
retval = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -767,9 +785,10 @@ gimp_curve_view_key_press (GtkWidget *widget,
|
||||||
case GDK_Down:
|
case GDK_Down:
|
||||||
if (y > 0)
|
if (y > 0)
|
||||||
{
|
{
|
||||||
y = y - (kevent->state & GDK_SHIFT_MASK ? 16 : 1);
|
y = y - (kevent->state & GDK_SHIFT_MASK ?
|
||||||
|
(16.0 / 255.0) : (1.0 / 255.0));
|
||||||
|
|
||||||
gimp_curve_move_point (curve, i, CLAMP0255 (y));
|
gimp_curve_move_point (curve, i, CLAMP (y, 0.0, 1.0));
|
||||||
|
|
||||||
retval = TRUE;
|
retval = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -848,7 +867,7 @@ gimp_curve_view_set_selected (GimpCurveView *view,
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_curve_view_set_xpos (GimpCurveView *view,
|
gimp_curve_view_set_xpos (GimpCurveView *view,
|
||||||
gint x)
|
gdouble x)
|
||||||
{
|
{
|
||||||
g_return_if_fail (GIMP_IS_CURVE_VIEW (view));
|
g_return_if_fail (GIMP_IS_CURVE_VIEW (view));
|
||||||
|
|
||||||
|
@ -857,15 +876,25 @@ gimp_curve_view_set_xpos (GimpCurveView *view,
|
||||||
gtk_widget_queue_draw (GTK_WIDGET (view));
|
gtk_widget_queue_draw (GTK_WIDGET (view));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
gimp_curve_view_set_cursor (GimpCurveView *view,
|
|
||||||
gint x,
|
|
||||||
gint y)
|
|
||||||
{
|
|
||||||
g_return_if_fail (GIMP_IS_CURVE_VIEW (view));
|
|
||||||
|
|
||||||
|
/* private functions */
|
||||||
|
|
||||||
|
static void
|
||||||
|
gimp_curve_view_set_cursor (GimpCurveView *view,
|
||||||
|
gdouble x,
|
||||||
|
gdouble y)
|
||||||
|
{
|
||||||
view->cursor_x = x;
|
view->cursor_x = x;
|
||||||
view->cursor_y = y;
|
view->cursor_y = y;
|
||||||
|
|
||||||
gtk_widget_queue_draw (GTK_WIDGET (view));
|
gtk_widget_queue_draw (GTK_WIDGET (view));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gimp_curve_view_unset_cursor (GimpCurveView *view)
|
||||||
|
{
|
||||||
|
view->cursor_x = -1.0;
|
||||||
|
view->cursor_y = -1.0;
|
||||||
|
|
||||||
|
gtk_widget_queue_draw (GTK_WIDGET (view));
|
||||||
|
}
|
||||||
|
|
|
@ -44,18 +44,19 @@ struct _GimpCurveView
|
||||||
gint grid_columns;
|
gint grid_columns;
|
||||||
|
|
||||||
gint selected;
|
gint selected;
|
||||||
gint last;
|
gdouble last_x;
|
||||||
gint leftmost;
|
gdouble last_y;
|
||||||
gint rightmost;
|
gdouble leftmost;
|
||||||
|
gdouble rightmost;
|
||||||
gboolean grabbed;
|
gboolean grabbed;
|
||||||
|
|
||||||
GdkCursorType cursor_type;
|
GdkCursorType cursor_type;
|
||||||
|
|
||||||
gint xpos;
|
gdouble xpos;
|
||||||
PangoLayout *xpos_layout;
|
PangoLayout *xpos_layout;
|
||||||
|
|
||||||
gint cursor_x;
|
gdouble cursor_x;
|
||||||
gint cursor_y;
|
gdouble cursor_y;
|
||||||
PangoLayout *cursor_layout;
|
PangoLayout *cursor_layout;
|
||||||
PangoRectangle cursor_rect;
|
PangoRectangle cursor_rect;
|
||||||
};
|
};
|
||||||
|
@ -77,10 +78,7 @@ GimpCurve * gimp_curve_view_get_curve (GimpCurveView *view);
|
||||||
void gimp_curve_view_set_selected (GimpCurveView *view,
|
void gimp_curve_view_set_selected (GimpCurveView *view,
|
||||||
gint selected);
|
gint selected);
|
||||||
void gimp_curve_view_set_xpos (GimpCurveView *view,
|
void gimp_curve_view_set_xpos (GimpCurveView *view,
|
||||||
gint x);
|
gdouble x);
|
||||||
void gimp_curve_view_set_cursor (GimpCurveView *view,
|
|
||||||
gint x,
|
|
||||||
gint y);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_CURVE_VIEW_H__ */
|
#endif /* __GIMP_CURVE_VIEW_H__ */
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
#include "widgets-types.h"
|
#include "widgets-types.h"
|
||||||
|
|
||||||
#include "base/gimphistogram.h"
|
#include "base/gimphistogram.h"
|
||||||
#include "base/pixel-region.h"
|
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpdrawable.h"
|
#include "core/gimpdrawable.h"
|
||||||
|
|
|
@ -0,0 +1,241 @@
|
||||||
|
/* GIMP - The GNU Image Manipulation Program
|
||||||
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||||
|
*
|
||||||
|
* gimplanguagestore-parser.c
|
||||||
|
* Copyright (C) 2008 Sven Neumann <sven@gimp.org>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
#include "widgets-types.h"
|
||||||
|
|
||||||
|
#include "config/gimpxmlparser.h"
|
||||||
|
|
||||||
|
#include "gimplanguagestore.h"
|
||||||
|
#include "gimplanguagestore-parser.h"
|
||||||
|
|
||||||
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
ISO_CODES_START,
|
||||||
|
ISO_CODES_IN_ENTRIES,
|
||||||
|
ISO_CODES_IN_ENTRY,
|
||||||
|
ISO_CODES_IN_UNKNOWN
|
||||||
|
} IsoCodesParserState;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
IsoCodesParserState state;
|
||||||
|
IsoCodesParserState last_known_state;
|
||||||
|
gint unknown_depth;
|
||||||
|
GimpLanguageStore *store;
|
||||||
|
} IsoCodesParser;
|
||||||
|
|
||||||
|
|
||||||
|
static void iso_codes_parser_start_element (GMarkupParseContext *context,
|
||||||
|
const gchar *element_name,
|
||||||
|
const gchar **attribute_names,
|
||||||
|
const gchar **attribute_values,
|
||||||
|
gpointer user_data,
|
||||||
|
GError **error);
|
||||||
|
static void iso_codes_parser_end_element (GMarkupParseContext *context,
|
||||||
|
const gchar *element_name,
|
||||||
|
gpointer user_data,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
static void iso_codes_parser_start_unknown (IsoCodesParser *parser);
|
||||||
|
static void iso_codes_parser_end_unknown (IsoCodesParser *parser);
|
||||||
|
|
||||||
|
|
||||||
|
static const GMarkupParser markup_parser =
|
||||||
|
{
|
||||||
|
iso_codes_parser_start_element,
|
||||||
|
iso_codes_parser_end_element,
|
||||||
|
NULL, /* characters */
|
||||||
|
NULL, /* passthrough */
|
||||||
|
NULL /* error */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
gimp_language_store_populate (GimpLanguageStore *store,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_ISO_CODES
|
||||||
|
GimpXmlParser *xml_parser;
|
||||||
|
gchar *filename;
|
||||||
|
gboolean success;
|
||||||
|
IsoCodesParser parser = { 0, };
|
||||||
|
|
||||||
|
g_return_val_if_fail (GIMP_IS_LANGUAGE_STORE (store), FALSE);
|
||||||
|
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||||
|
|
||||||
|
bindtextdomain ("iso_639", ISO_CODES_LOCALEDIR);
|
||||||
|
|
||||||
|
parser.store = g_object_ref (store);
|
||||||
|
|
||||||
|
xml_parser = gimp_xml_parser_new (&markup_parser, &parser);
|
||||||
|
|
||||||
|
filename = g_build_filename (ISO_CODES_LOCATION, "iso_639.xml", NULL);
|
||||||
|
|
||||||
|
success = gimp_xml_parser_parse_file (xml_parser, filename, error);
|
||||||
|
|
||||||
|
g_free (filename);
|
||||||
|
|
||||||
|
gimp_xml_parser_free (xml_parser);
|
||||||
|
g_object_unref (parser.store);
|
||||||
|
|
||||||
|
return success;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
iso_codes_parser_entry (IsoCodesParser *parser,
|
||||||
|
const gchar **names,
|
||||||
|
const gchar **values)
|
||||||
|
{
|
||||||
|
const gchar *lang = NULL;
|
||||||
|
const gchar *code = NULL;
|
||||||
|
|
||||||
|
while (*names && *values)
|
||||||
|
{
|
||||||
|
if (strcmp (*names, "name") == 0)
|
||||||
|
{
|
||||||
|
lang = *values;
|
||||||
|
}
|
||||||
|
else if (strcmp (*names, "iso_639_1_code") == 0)
|
||||||
|
{
|
||||||
|
code = *values;
|
||||||
|
}
|
||||||
|
|
||||||
|
names++;
|
||||||
|
values++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lang && *lang && code && *code)
|
||||||
|
{
|
||||||
|
const gchar *semicolon;
|
||||||
|
|
||||||
|
lang = dgettext ("iso_639", lang);
|
||||||
|
|
||||||
|
/* there might be several language names; use the first one */
|
||||||
|
semicolon = strchr (lang, ';');
|
||||||
|
|
||||||
|
if (semicolon)
|
||||||
|
{
|
||||||
|
gchar *first = g_strndup (lang, semicolon - lang);
|
||||||
|
|
||||||
|
gimp_language_store_add (parser->store, first, code);
|
||||||
|
g_free (first);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gimp_language_store_add (parser->store, lang, code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
iso_codes_parser_start_element (GMarkupParseContext *context,
|
||||||
|
const gchar *element_name,
|
||||||
|
const gchar **attribute_names,
|
||||||
|
const gchar **attribute_values,
|
||||||
|
gpointer user_data,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
IsoCodesParser *parser = user_data;
|
||||||
|
|
||||||
|
switch (parser->state)
|
||||||
|
{
|
||||||
|
case ISO_CODES_START:
|
||||||
|
if (strcmp (element_name, "iso_639_entries") == 0)
|
||||||
|
{
|
||||||
|
parser->state = ISO_CODES_IN_ENTRIES;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case ISO_CODES_IN_ENTRIES:
|
||||||
|
if (strcmp (element_name, "iso_639_entry") == 0)
|
||||||
|
{
|
||||||
|
parser->state = ISO_CODES_IN_ENTRY;
|
||||||
|
iso_codes_parser_entry (parser, attribute_names, attribute_values);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case ISO_CODES_IN_ENTRY:
|
||||||
|
case ISO_CODES_IN_UNKNOWN:
|
||||||
|
iso_codes_parser_start_unknown (parser);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
iso_codes_parser_end_element (GMarkupParseContext *context,
|
||||||
|
const gchar *element_name,
|
||||||
|
gpointer user_data,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
IsoCodesParser *parser = user_data;
|
||||||
|
|
||||||
|
switch (parser->state)
|
||||||
|
{
|
||||||
|
case ISO_CODES_START:
|
||||||
|
g_warning ("%s: shouldn't get here", G_STRLOC);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ISO_CODES_IN_ENTRIES:
|
||||||
|
parser->state = ISO_CODES_START;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ISO_CODES_IN_ENTRY:
|
||||||
|
parser->state = ISO_CODES_IN_ENTRIES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ISO_CODES_IN_UNKNOWN:
|
||||||
|
iso_codes_parser_end_unknown (parser);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
iso_codes_parser_start_unknown (IsoCodesParser *parser)
|
||||||
|
{
|
||||||
|
if (parser->unknown_depth == 0)
|
||||||
|
parser->last_known_state = parser->state;
|
||||||
|
|
||||||
|
parser->state = ISO_CODES_IN_UNKNOWN;
|
||||||
|
parser->unknown_depth++;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
iso_codes_parser_end_unknown (IsoCodesParser *parser)
|
||||||
|
{
|
||||||
|
g_assert (parser->unknown_depth > 0 && parser->state == ISO_CODES_IN_UNKNOWN);
|
||||||
|
|
||||||
|
parser->unknown_depth--;
|
||||||
|
|
||||||
|
if (parser->unknown_depth == 0)
|
||||||
|
parser->state = parser->last_known_state;
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
/* GIMP - The GNU Image Manipulation Program
|
||||||
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||||
|
*
|
||||||
|
* gimplanguagestore-parser.h
|
||||||
|
* Copyright (C) 2008 Sven Neumann <sven@gimp.org>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __GIMP_LANGUAGE_STORE_PARSER_H__
|
||||||
|
#define __GIMP_LANGUAGE_STORE_PARSER_H__
|
||||||
|
|
||||||
|
|
||||||
|
gboolean gimp_language_store_populate (GimpLanguageStore *store,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __GIMP_LANGUAGE_STORE_PARSER_H__ */
|
|
@ -0,0 +1,140 @@
|
||||||
|
/* GIMP - The GNU Image Manipulation Program
|
||||||
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||||
|
*
|
||||||
|
* gimplanguagestore.c
|
||||||
|
* Copyright (C) 2008 Sven Neumann <sven@gimp.org>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
#include "widgets-types.h"
|
||||||
|
|
||||||
|
#include "gimplanguagestore.h"
|
||||||
|
#include "gimplanguagestore-parser.h"
|
||||||
|
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
PROP_0,
|
||||||
|
PROP_TRANSLATIONS
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static void gimp_language_store_set_property (GObject *object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue *value,
|
||||||
|
GParamSpec *pspec);
|
||||||
|
static void gimp_language_store_get_property (GObject *object,
|
||||||
|
guint property_id,
|
||||||
|
GValue *value,
|
||||||
|
GParamSpec *pspec);
|
||||||
|
|
||||||
|
G_DEFINE_TYPE (GimpLanguageStore, gimp_language_store, GTK_TYPE_LIST_STORE)
|
||||||
|
|
||||||
|
static void
|
||||||
|
gimp_language_store_class_init (GimpLanguageStoreClass *klass)
|
||||||
|
{
|
||||||
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
|
object_class->set_property = gimp_language_store_set_property;
|
||||||
|
object_class->get_property = gimp_language_store_get_property;
|
||||||
|
|
||||||
|
g_object_class_install_property (object_class, PROP_TRANSLATIONS,
|
||||||
|
g_param_spec_boolean ("translations",
|
||||||
|
NULL, NULL,
|
||||||
|
FALSE,
|
||||||
|
GIMP_PARAM_READWRITE |
|
||||||
|
G_PARAM_CONSTRUCT_ONLY));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gimp_language_store_init (GimpLanguageStore *store)
|
||||||
|
{
|
||||||
|
GType column_types[2] = { G_TYPE_STRING, G_TYPE_STRING };
|
||||||
|
|
||||||
|
gtk_list_store_set_column_types (GTK_LIST_STORE (store),
|
||||||
|
G_N_ELEMENTS (column_types), column_types);
|
||||||
|
|
||||||
|
gimp_language_store_populate (store, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gimp_language_store_set_property (GObject *object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue *value,
|
||||||
|
GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
GimpLanguageStore *store = GIMP_LANGUAGE_STORE (object);
|
||||||
|
|
||||||
|
switch (property_id)
|
||||||
|
{
|
||||||
|
case PROP_TRANSLATIONS:
|
||||||
|
store->translations = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gimp_language_store_get_property (GObject *object,
|
||||||
|
guint property_id,
|
||||||
|
GValue *value,
|
||||||
|
GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
GimpLanguageStore *store = GIMP_LANGUAGE_STORE (object);
|
||||||
|
|
||||||
|
switch (property_id)
|
||||||
|
{
|
||||||
|
case PROP_TRANSLATIONS:
|
||||||
|
g_value_set_boolean (value, store->translations);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GtkListStore *
|
||||||
|
gimp_language_store_new (gboolean translations)
|
||||||
|
{
|
||||||
|
return g_object_new (GIMP_TYPE_LANGUAGE_STORE,
|
||||||
|
"translations", translations,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gimp_language_store_add (GimpLanguageStore *store,
|
||||||
|
const gchar *lang,
|
||||||
|
const gchar *code)
|
||||||
|
{
|
||||||
|
GtkTreeIter iter;
|
||||||
|
|
||||||
|
g_return_if_fail (GIMP_IS_LANGUAGE_STORE (store));
|
||||||
|
g_return_if_fail (lang != NULL && code != NULL);
|
||||||
|
|
||||||
|
gtk_list_store_append (GTK_LIST_STORE (store), &iter);
|
||||||
|
gtk_list_store_set (GTK_LIST_STORE (store), &iter,
|
||||||
|
GIMP_LANGUAGE_STORE_LANGUAGE, lang,
|
||||||
|
GIMP_LANGUAGE_STORE_ISO_639_1, code,
|
||||||
|
-1);
|
||||||
|
}
|
|
@ -0,0 +1,64 @@
|
||||||
|
/* GIMP - The GNU Image Manipulation Program
|
||||||
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||||
|
*
|
||||||
|
* gimplanguagestore.h
|
||||||
|
* Copyright (C) 2008 Sven Neumann <sven@gimp.org>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __GIMP_LANGUAGE_STORE_H__
|
||||||
|
#define __GIMP_LANGUAGE_STORE_H__
|
||||||
|
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
GIMP_LANGUAGE_STORE_LANGUAGE,
|
||||||
|
GIMP_LANGUAGE_STORE_ISO_639_1
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#define GIMP_TYPE_LANGUAGE_STORE (gimp_language_store_get_type ())
|
||||||
|
#define GIMP_LANGUAGE_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_LANGUAGE_STORE, GimpLanguageStore))
|
||||||
|
#define GIMP_LANGUAGE_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LANGUAGE_STORE, GimpLanguageStoreClass))
|
||||||
|
#define GIMP_IS_LANGUAGE_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_LANGUAGE_STORE))
|
||||||
|
#define GIMP_IS_LANGUAGE_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LANGUAGE_STORE))
|
||||||
|
#define GIMP_LANGUAGE_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_LANGUAGE_STORE, GimpLanguageStoreClass))
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct _GimpLanguageStoreClass GimpLanguageStoreClass;
|
||||||
|
|
||||||
|
struct _GimpLanguageStoreClass
|
||||||
|
{
|
||||||
|
GtkListStoreClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _GimpLanguageStore
|
||||||
|
{
|
||||||
|
GtkListStore parent_instance;
|
||||||
|
|
||||||
|
gboolean translations;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
GType gimp_language_store_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
GtkListStore * gimp_language_store_new (gboolean translations);
|
||||||
|
void gimp_language_store_add (GimpLanguageStore *store,
|
||||||
|
const gchar *lang,
|
||||||
|
const gchar *code);
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __GIMP_LANGUAGE_STORE_H__ */
|
|
@ -792,6 +792,11 @@ gimp_prop_table_new (GObject *config,
|
||||||
widget = gimp_prop_check_button_new (config, pspec->name,
|
widget = gimp_prop_check_button_new (config, pspec->name,
|
||||||
g_param_spec_get_nick (pspec));
|
g_param_spec_get_nick (pspec));
|
||||||
}
|
}
|
||||||
|
else if (G_IS_PARAM_SPEC_ENUM (pspec))
|
||||||
|
{
|
||||||
|
widget = gimp_prop_enum_combo_box_new (config, pspec->name, 0, 0);
|
||||||
|
label = g_param_spec_get_nick (pspec);
|
||||||
|
}
|
||||||
else if (G_IS_PARAM_SPEC_INT (pspec) ||
|
else if (G_IS_PARAM_SPEC_INT (pspec) ||
|
||||||
G_IS_PARAM_SPEC_UINT (pspec) ||
|
G_IS_PARAM_SPEC_UINT (pspec) ||
|
||||||
G_IS_PARAM_SPEC_FLOAT (pspec) ||
|
G_IS_PARAM_SPEC_FLOAT (pspec) ||
|
||||||
|
|
|
@ -18,24 +18,16 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#ifdef HAVE_UNISTD_H
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
|
||||||
#include <process.h> /* getpid() : defined from _getpid by GLib */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "libgimpcolor/gimpcolor.h"
|
#include "libgimpcolor/gimpcolor.h"
|
||||||
|
|
||||||
#include "widgets-types.h"
|
#include "widgets-types.h"
|
||||||
|
|
||||||
|
#include "base/base-utils.h"
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpbrush.h"
|
#include "core/gimpbrush.h"
|
||||||
#include "core/gimpcontainer.h"
|
#include "core/gimpcontainer.h"
|
||||||
|
@ -365,7 +357,7 @@ gimp_selection_data_set_image (GtkSelectionData *selection,
|
||||||
g_return_if_fail (selection != NULL);
|
g_return_if_fail (selection != NULL);
|
||||||
g_return_if_fail (GIMP_IS_IMAGE (image));
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
||||||
|
|
||||||
str = g_strdup_printf ("%d:%d", getpid (), gimp_image_get_ID (image));
|
str = g_strdup_printf ("%d:%d", get_pid (), gimp_image_get_ID (image));
|
||||||
|
|
||||||
gtk_selection_data_set (selection, selection->target,
|
gtk_selection_data_set (selection, selection->target,
|
||||||
8, (guchar *) str, strlen (str) + 1);
|
8, (guchar *) str, strlen (str) + 1);
|
||||||
|
@ -390,7 +382,7 @@ gimp_selection_data_get_image (GtkSelectionData *selection,
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (sscanf (str, "%i:%i", &pid, &ID) == 2 &&
|
if (sscanf (str, "%i:%i", &pid, &ID) == 2 &&
|
||||||
pid == getpid ())
|
pid == get_pid ())
|
||||||
{
|
{
|
||||||
image = gimp_image_get_by_ID (gimp, ID);
|
image = gimp_image_get_by_ID (gimp, ID);
|
||||||
}
|
}
|
||||||
|
@ -410,7 +402,7 @@ gimp_selection_data_set_component (GtkSelectionData *selection,
|
||||||
g_return_if_fail (selection != NULL);
|
g_return_if_fail (selection != NULL);
|
||||||
g_return_if_fail (GIMP_IS_IMAGE (image));
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
||||||
|
|
||||||
str = g_strdup_printf ("%d:%d:%d", getpid (), gimp_image_get_ID (image),
|
str = g_strdup_printf ("%d:%d:%d", get_pid (), gimp_image_get_ID (image),
|
||||||
(gint) channel);
|
(gint) channel);
|
||||||
|
|
||||||
gtk_selection_data_set (selection, selection->target,
|
gtk_selection_data_set (selection, selection->target,
|
||||||
|
@ -441,7 +433,7 @@ gimp_selection_data_get_component (GtkSelectionData *selection,
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (sscanf (str, "%i:%i:%i", &pid, &ID, &ch) == 3 &&
|
if (sscanf (str, "%i:%i:%i", &pid, &ID, &ch) == 3 &&
|
||||||
pid == getpid ())
|
pid == get_pid ())
|
||||||
{
|
{
|
||||||
image = gimp_image_get_by_ID (gimp, ID);
|
image = gimp_image_get_by_ID (gimp, ID);
|
||||||
|
|
||||||
|
@ -463,7 +455,7 @@ gimp_selection_data_set_item (GtkSelectionData *selection,
|
||||||
g_return_if_fail (selection != NULL);
|
g_return_if_fail (selection != NULL);
|
||||||
g_return_if_fail (GIMP_IS_ITEM (item));
|
g_return_if_fail (GIMP_IS_ITEM (item));
|
||||||
|
|
||||||
str = g_strdup_printf ("%d:%d", getpid (), gimp_item_get_ID (item));
|
str = g_strdup_printf ("%d:%d", get_pid (), gimp_item_get_ID (item));
|
||||||
|
|
||||||
gtk_selection_data_set (selection, selection->target,
|
gtk_selection_data_set (selection, selection->target,
|
||||||
8, (guchar *) str, strlen (str) + 1);
|
8, (guchar *) str, strlen (str) + 1);
|
||||||
|
@ -488,7 +480,7 @@ gimp_selection_data_get_item (GtkSelectionData *selection,
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (sscanf (str, "%i:%i", &pid, &ID) == 2 &&
|
if (sscanf (str, "%i:%i", &pid, &ID) == 2 &&
|
||||||
pid == getpid ())
|
pid == get_pid ())
|
||||||
{
|
{
|
||||||
item = gimp_item_get_by_ID (gimp, ID);
|
item = gimp_item_get_by_ID (gimp, ID);
|
||||||
}
|
}
|
||||||
|
@ -513,7 +505,7 @@ gimp_selection_data_set_object (GtkSelectionData *selection,
|
||||||
{
|
{
|
||||||
gchar *str;
|
gchar *str;
|
||||||
|
|
||||||
str = g_strdup_printf ("%d:%p:%s", getpid (), object, name);
|
str = g_strdup_printf ("%d:%p:%s", get_pid (), object, name);
|
||||||
gtk_selection_data_set (selection, selection->target,
|
gtk_selection_data_set (selection, selection->target,
|
||||||
8, (guchar *) str, strlen (str) + 1);
|
8, (guchar *) str, strlen (str) + 1);
|
||||||
g_free (str);
|
g_free (str);
|
||||||
|
@ -680,7 +672,7 @@ gimp_selection_data_get_object (GtkSelectionData *selection,
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (sscanf (str, "%i:%p:%n", &pid, &object_addr, &name_offset) >= 2 &&
|
if (sscanf (str, "%i:%p:%n", &pid, &object_addr, &name_offset) >= 2 &&
|
||||||
pid == getpid () && name_offset > 0)
|
pid == get_pid () && name_offset > 0)
|
||||||
{
|
{
|
||||||
gchar *name = str + name_offset;
|
gchar *name = str + name_offset;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||||
*
|
*
|
||||||
* GimpTextEditor
|
* GimpTextEditor
|
||||||
* Copyright (C) 2002-2003 Sven Neumann <sven@gimp.org>
|
* Copyright (C) 2002-2003, 2008 Sven Neumann <sven@gimp.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -31,6 +31,7 @@
|
||||||
|
|
||||||
#include "gimphelp-ids.h"
|
#include "gimphelp-ids.h"
|
||||||
#include "gimpmenufactory.h"
|
#include "gimpmenufactory.h"
|
||||||
|
#include "gimplanguagestore.h"
|
||||||
#include "gimptexteditor.h"
|
#include "gimptexteditor.h"
|
||||||
#include "gimpuimanager.h"
|
#include "gimpuimanager.h"
|
||||||
|
|
||||||
|
@ -45,12 +46,14 @@ enum
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static void gimp_text_editor_finalize (GObject *object);
|
static void gimp_text_editor_finalize (GObject *object);
|
||||||
|
|
||||||
static void gimp_text_editor_text_changed (GtkTextBuffer *buffer,
|
static GtkWidget * gimp_text_editor_language_entry_new (void);
|
||||||
GimpTextEditor *editor);
|
|
||||||
static void gimp_text_editor_font_toggled (GtkToggleButton *button,
|
static void gimp_text_editor_text_changed (GtkTextBuffer *buffer,
|
||||||
GimpTextEditor *editor);
|
GimpTextEditor *editor);
|
||||||
|
static void gimp_text_editor_font_toggled (GtkToggleButton *button,
|
||||||
|
GimpTextEditor *editor);
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (GimpTextEditor, gimp_text_editor, GIMP_TYPE_DIALOG)
|
G_DEFINE_TYPE (GimpTextEditor, gimp_text_editor, GIMP_TYPE_DIALOG)
|
||||||
|
@ -163,9 +166,33 @@ gimp_text_editor_new (const gchar *title,
|
||||||
|
|
||||||
if (toolbar)
|
if (toolbar)
|
||||||
{
|
{
|
||||||
|
GtkToolItem *item;
|
||||||
|
GtkWidget *hbox;
|
||||||
|
GtkWidget *label;
|
||||||
|
GtkWidget *entry;
|
||||||
|
|
||||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (editor)->vbox), toolbar,
|
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (editor)->vbox), toolbar,
|
||||||
FALSE, FALSE, 0);
|
FALSE, FALSE, 0);
|
||||||
gtk_widget_show (toolbar);
|
gtk_widget_show (toolbar);
|
||||||
|
|
||||||
|
item = gtk_tool_item_new ();
|
||||||
|
gtk_tool_item_set_expand (item, TRUE);
|
||||||
|
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
|
||||||
|
gtk_widget_show (GTK_WIDGET (item));
|
||||||
|
|
||||||
|
hbox = gtk_hbox_new (FALSE, 6);
|
||||||
|
gtk_container_add (GTK_CONTAINER (item), hbox);
|
||||||
|
gtk_widget_show (hbox);
|
||||||
|
|
||||||
|
label = gtk_label_new_with_mnemonic (_("_Language:"));
|
||||||
|
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
||||||
|
gtk_widget_show (label);
|
||||||
|
|
||||||
|
entry = gimp_text_editor_language_entry_new ();
|
||||||
|
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
|
||||||
|
gtk_widget_show (entry);
|
||||||
|
|
||||||
|
gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
|
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
|
||||||
|
@ -197,7 +224,7 @@ gimp_text_editor_new (const gchar *title,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_widget_set_size_request (editor->view, 128, 64);
|
gtk_widget_set_size_request (editor->view, 150, 64);
|
||||||
|
|
||||||
editor->font_toggle =
|
editor->font_toggle =
|
||||||
gtk_check_button_new_with_mnemonic (_("_Use selected font"));
|
gtk_check_button_new_with_mnemonic (_("_Use selected font"));
|
||||||
|
@ -323,6 +350,30 @@ gimp_text_editor_get_font_name (GimpTextEditor *editor)
|
||||||
|
|
||||||
/* private functions */
|
/* private functions */
|
||||||
|
|
||||||
|
static GtkWidget *
|
||||||
|
gimp_text_editor_language_entry_new (void)
|
||||||
|
{
|
||||||
|
GtkWidget *entry;
|
||||||
|
GtkListStore *store;
|
||||||
|
GtkEntryCompletion *completion;
|
||||||
|
|
||||||
|
entry = gtk_entry_new ();
|
||||||
|
|
||||||
|
completion = gtk_entry_completion_new ();
|
||||||
|
gtk_entry_completion_set_text_column (completion,
|
||||||
|
GIMP_LANGUAGE_STORE_LANGUAGE);
|
||||||
|
gtk_entry_completion_set_inline_completion (completion, TRUE);
|
||||||
|
|
||||||
|
store = gimp_language_store_new (FALSE);
|
||||||
|
gtk_entry_completion_set_model (completion, GTK_TREE_MODEL (store));
|
||||||
|
g_object_unref (store);
|
||||||
|
|
||||||
|
gtk_entry_set_completion (GTK_ENTRY (entry), completion);
|
||||||
|
g_object_unref (completion);
|
||||||
|
|
||||||
|
return entry;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_text_editor_text_changed (GtkTextBuffer *buffer,
|
gimp_text_editor_text_changed (GtkTextBuffer *buffer,
|
||||||
GimpTextEditor *editor)
|
GimpTextEditor *editor)
|
||||||
|
|
|
@ -209,6 +209,7 @@ typedef struct _GimpCellRendererViewable GimpCellRendererViewable;
|
||||||
/* misc utilities & constructors */
|
/* misc utilities & constructors */
|
||||||
|
|
||||||
typedef struct _GimpDialogFactory GimpDialogFactory;
|
typedef struct _GimpDialogFactory GimpDialogFactory;
|
||||||
|
typedef struct _GimpLanguageStore GimpLanguageStore;
|
||||||
typedef struct _GimpUnitStore GimpUnitStore;
|
typedef struct _GimpUnitStore GimpUnitStore;
|
||||||
typedef struct _GimpUnitComboBox GimpUnitComboBox;
|
typedef struct _GimpUnitComboBox GimpUnitComboBox;
|
||||||
|
|
||||||
|
|
20
configure.in
20
configure.in
|
@ -155,6 +155,10 @@ AM_MAINTAINER_MODE
|
||||||
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
|
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
|
||||||
|
|
||||||
|
|
||||||
|
# Check for pkg-config
|
||||||
|
PKG_PROG_PKG_CONFIG(0.16)
|
||||||
|
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
# Check target architecture
|
# Check target architecture
|
||||||
###########################
|
###########################
|
||||||
|
@ -401,6 +405,21 @@ AC_PROG_INTLTOOL
|
||||||
AM_GLIB_GNU_GETTEXT
|
AM_GLIB_GNU_GETTEXT
|
||||||
|
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([for iso-codes])
|
||||||
|
PKG_CHECK_EXISTS(iso-codes,
|
||||||
|
have_iso_codes="yes"
|
||||||
|
AC_DEFINE(HAVE_ISO_CODES, 1,
|
||||||
|
[Define to 1 if the iso-codes package is available])
|
||||||
|
ISO_CODES_PREFIX=`$PKG_CONFIG --variable=prefix iso-codes`
|
||||||
|
ISO_CODES_LOCATION="$ISO_CODES_PREFIX/share/xml/iso-codes"
|
||||||
|
ISO_CODES_LOCALEDIR="$ISO_CODES_PREFIX/$DATADIRNAME/locale",
|
||||||
|
have_iso_codes="no (iso-codes package not found)")
|
||||||
|
AC_MSG_RESULT($have_iso_codes)
|
||||||
|
|
||||||
|
AC_SUBST(ISO_CODES_LOCATION)
|
||||||
|
AC_SUBST(ISO_CODES_LOCALEDIR)
|
||||||
|
|
||||||
|
|
||||||
###############################
|
###############################
|
||||||
# Checks for required libraries
|
# Checks for required libraries
|
||||||
###############################
|
###############################
|
||||||
|
@ -2063,6 +2082,7 @@ Extra Binaries:
|
||||||
|
|
||||||
Optional Features:
|
Optional Features:
|
||||||
D-Bus service: $have_dbus_glib
|
D-Bus service: $have_dbus_glib
|
||||||
|
Language selection: $have_iso_codes
|
||||||
|
|
||||||
Optional Plug-Ins:
|
Optional Plug-Ins:
|
||||||
Ascii Art: $have_libaa
|
Ascii Art: $have_libaa
|
||||||
|
|
|
@ -461,172 +461,6 @@ gimp_brush_get_shape (const gchar *name)
|
||||||
return shape;
|
return shape;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* gimp_brush_get_radius:
|
|
||||||
* @name: The brush name.
|
|
||||||
*
|
|
||||||
* Get the radius of a generated brush.
|
|
||||||
*
|
|
||||||
* This procedure gets the radius value for a generated brush. If
|
|
||||||
* called for any other type of brush, it does not succeed.
|
|
||||||
*
|
|
||||||
* Returns: The radius of the brush in pixels.
|
|
||||||
*
|
|
||||||
* Since: GIMP 2.4
|
|
||||||
*/
|
|
||||||
gdouble
|
|
||||||
gimp_brush_get_radius (const gchar *name)
|
|
||||||
{
|
|
||||||
GimpParam *return_vals;
|
|
||||||
gint nreturn_vals;
|
|
||||||
gdouble radius = 0.0;
|
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp-brush-get-radius",
|
|
||||||
&nreturn_vals,
|
|
||||||
GIMP_PDB_STRING, name,
|
|
||||||
GIMP_PDB_END);
|
|
||||||
|
|
||||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
||||||
radius = return_vals[1].data.d_float;
|
|
||||||
|
|
||||||
gimp_destroy_params (return_vals, nreturn_vals);
|
|
||||||
|
|
||||||
return radius;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gimp_brush_get_spikes:
|
|
||||||
* @name: The brush name.
|
|
||||||
*
|
|
||||||
* Get the number of spikes for a generated brush.
|
|
||||||
*
|
|
||||||
* This procedure gets the number of spikes for a generated brush. If
|
|
||||||
* called for any other type of brush, it does not succeed.
|
|
||||||
*
|
|
||||||
* Returns: The number of spikes on the brush.
|
|
||||||
*
|
|
||||||
* Since: GIMP 2.4
|
|
||||||
*/
|
|
||||||
gint
|
|
||||||
gimp_brush_get_spikes (const gchar *name)
|
|
||||||
{
|
|
||||||
GimpParam *return_vals;
|
|
||||||
gint nreturn_vals;
|
|
||||||
gint spikes = 0;
|
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp-brush-get-spikes",
|
|
||||||
&nreturn_vals,
|
|
||||||
GIMP_PDB_STRING, name,
|
|
||||||
GIMP_PDB_END);
|
|
||||||
|
|
||||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
||||||
spikes = return_vals[1].data.d_int32;
|
|
||||||
|
|
||||||
gimp_destroy_params (return_vals, nreturn_vals);
|
|
||||||
|
|
||||||
return spikes;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gimp_brush_get_hardness:
|
|
||||||
* @name: The brush name.
|
|
||||||
*
|
|
||||||
* Get the hardness of a generated brush.
|
|
||||||
*
|
|
||||||
* This procedure gets the hardness of a generated brush. The hardness
|
|
||||||
* of a brush is the amount its intensity fades at the outside edge. If
|
|
||||||
* called for any other type of brush, the function does not succeed.
|
|
||||||
*
|
|
||||||
* Returns: The hardness of the brush.
|
|
||||||
*
|
|
||||||
* Since: GIMP 2.4
|
|
||||||
*/
|
|
||||||
gdouble
|
|
||||||
gimp_brush_get_hardness (const gchar *name)
|
|
||||||
{
|
|
||||||
GimpParam *return_vals;
|
|
||||||
gint nreturn_vals;
|
|
||||||
gdouble hardness = 0.0;
|
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp-brush-get-hardness",
|
|
||||||
&nreturn_vals,
|
|
||||||
GIMP_PDB_STRING, name,
|
|
||||||
GIMP_PDB_END);
|
|
||||||
|
|
||||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
||||||
hardness = return_vals[1].data.d_float;
|
|
||||||
|
|
||||||
gimp_destroy_params (return_vals, nreturn_vals);
|
|
||||||
|
|
||||||
return hardness;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gimp_brush_get_aspect_ratio:
|
|
||||||
* @name: The brush name.
|
|
||||||
*
|
|
||||||
* Get the aspect ratio of a generated brush.
|
|
||||||
*
|
|
||||||
* This procedure gets the aspect ratio of a generated brush. If called
|
|
||||||
* for any other type of brush, it does not succeed.
|
|
||||||
*
|
|
||||||
* Returns: The aspect ratio of the brush.
|
|
||||||
*
|
|
||||||
* Since: GIMP 2.4
|
|
||||||
*/
|
|
||||||
gdouble
|
|
||||||
gimp_brush_get_aspect_ratio (const gchar *name)
|
|
||||||
{
|
|
||||||
GimpParam *return_vals;
|
|
||||||
gint nreturn_vals;
|
|
||||||
gdouble aspect_ratio = 0.0;
|
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp-brush-get-aspect-ratio",
|
|
||||||
&nreturn_vals,
|
|
||||||
GIMP_PDB_STRING, name,
|
|
||||||
GIMP_PDB_END);
|
|
||||||
|
|
||||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
||||||
aspect_ratio = return_vals[1].data.d_float;
|
|
||||||
|
|
||||||
gimp_destroy_params (return_vals, nreturn_vals);
|
|
||||||
|
|
||||||
return aspect_ratio;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gimp_brush_get_angle:
|
|
||||||
* @name: The brush name.
|
|
||||||
*
|
|
||||||
* Get the rotation angle of a generated brush.
|
|
||||||
*
|
|
||||||
* This procedure gets the angle of rotation for a generated brush. If
|
|
||||||
* called for any other type of brush, it does not succeed.
|
|
||||||
*
|
|
||||||
* Returns: The rotation angle of the brush.
|
|
||||||
*
|
|
||||||
* Since: GIMP 2.4
|
|
||||||
*/
|
|
||||||
gdouble
|
|
||||||
gimp_brush_get_angle (const gchar *name)
|
|
||||||
{
|
|
||||||
GimpParam *return_vals;
|
|
||||||
gint nreturn_vals;
|
|
||||||
gdouble angle = 0.0;
|
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp-brush-get-angle",
|
|
||||||
&nreturn_vals,
|
|
||||||
GIMP_PDB_STRING, name,
|
|
||||||
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_brush_set_shape:
|
* gimp_brush_set_shape:
|
||||||
* @name: The brush name.
|
* @name: The brush name.
|
||||||
|
@ -667,6 +501,39 @@ gimp_brush_set_shape (const gchar *name,
|
||||||
return shape_out;
|
return shape_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gimp_brush_get_radius:
|
||||||
|
* @name: The brush name.
|
||||||
|
*
|
||||||
|
* Get the radius of a generated brush.
|
||||||
|
*
|
||||||
|
* This procedure gets the radius value for a generated brush. If
|
||||||
|
* called for any other type of brush, it does not succeed.
|
||||||
|
*
|
||||||
|
* Returns: The radius of the brush in pixels.
|
||||||
|
*
|
||||||
|
* Since: GIMP 2.4
|
||||||
|
*/
|
||||||
|
gdouble
|
||||||
|
gimp_brush_get_radius (const gchar *name)
|
||||||
|
{
|
||||||
|
GimpParam *return_vals;
|
||||||
|
gint nreturn_vals;
|
||||||
|
gdouble radius = 0.0;
|
||||||
|
|
||||||
|
return_vals = gimp_run_procedure ("gimp-brush-get-radius",
|
||||||
|
&nreturn_vals,
|
||||||
|
GIMP_PDB_STRING, name,
|
||||||
|
GIMP_PDB_END);
|
||||||
|
|
||||||
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
|
radius = return_vals[1].data.d_float;
|
||||||
|
|
||||||
|
gimp_destroy_params (return_vals, nreturn_vals);
|
||||||
|
|
||||||
|
return radius;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_brush_set_radius:
|
* gimp_brush_set_radius:
|
||||||
* @name: The brush name.
|
* @name: The brush name.
|
||||||
|
@ -703,6 +570,39 @@ gimp_brush_set_radius (const gchar *name,
|
||||||
return radius_out;
|
return radius_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gimp_brush_get_spikes:
|
||||||
|
* @name: The brush name.
|
||||||
|
*
|
||||||
|
* Get the number of spikes for a generated brush.
|
||||||
|
*
|
||||||
|
* This procedure gets the number of spikes for a generated brush. If
|
||||||
|
* called for any other type of brush, it does not succeed.
|
||||||
|
*
|
||||||
|
* Returns: The number of spikes on the brush.
|
||||||
|
*
|
||||||
|
* Since: GIMP 2.4
|
||||||
|
*/
|
||||||
|
gint
|
||||||
|
gimp_brush_get_spikes (const gchar *name)
|
||||||
|
{
|
||||||
|
GimpParam *return_vals;
|
||||||
|
gint nreturn_vals;
|
||||||
|
gint spikes = 0;
|
||||||
|
|
||||||
|
return_vals = gimp_run_procedure ("gimp-brush-get-spikes",
|
||||||
|
&nreturn_vals,
|
||||||
|
GIMP_PDB_STRING, name,
|
||||||
|
GIMP_PDB_END);
|
||||||
|
|
||||||
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
|
spikes = return_vals[1].data.d_int32;
|
||||||
|
|
||||||
|
gimp_destroy_params (return_vals, nreturn_vals);
|
||||||
|
|
||||||
|
return spikes;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_brush_set_spikes:
|
* gimp_brush_set_spikes:
|
||||||
* @name: The brush name.
|
* @name: The brush name.
|
||||||
|
@ -739,6 +639,40 @@ gimp_brush_set_spikes (const gchar *name,
|
||||||
return spikes_out;
|
return spikes_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gimp_brush_get_hardness:
|
||||||
|
* @name: The brush name.
|
||||||
|
*
|
||||||
|
* Get the hardness of a generated brush.
|
||||||
|
*
|
||||||
|
* This procedure gets the hardness of a generated brush. The hardness
|
||||||
|
* of a brush is the amount its intensity fades at the outside edge. If
|
||||||
|
* called for any other type of brush, the function does not succeed.
|
||||||
|
*
|
||||||
|
* Returns: The hardness of the brush.
|
||||||
|
*
|
||||||
|
* Since: GIMP 2.4
|
||||||
|
*/
|
||||||
|
gdouble
|
||||||
|
gimp_brush_get_hardness (const gchar *name)
|
||||||
|
{
|
||||||
|
GimpParam *return_vals;
|
||||||
|
gint nreturn_vals;
|
||||||
|
gdouble hardness = 0.0;
|
||||||
|
|
||||||
|
return_vals = gimp_run_procedure ("gimp-brush-get-hardness",
|
||||||
|
&nreturn_vals,
|
||||||
|
GIMP_PDB_STRING, name,
|
||||||
|
GIMP_PDB_END);
|
||||||
|
|
||||||
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
|
hardness = return_vals[1].data.d_float;
|
||||||
|
|
||||||
|
gimp_destroy_params (return_vals, nreturn_vals);
|
||||||
|
|
||||||
|
return hardness;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_brush_set_hardness:
|
* gimp_brush_set_hardness:
|
||||||
* @name: The brush name.
|
* @name: The brush name.
|
||||||
|
@ -775,6 +709,39 @@ gimp_brush_set_hardness (const gchar *name,
|
||||||
return hardness_out;
|
return hardness_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gimp_brush_get_aspect_ratio:
|
||||||
|
* @name: The brush name.
|
||||||
|
*
|
||||||
|
* Get the aspect ratio of a generated brush.
|
||||||
|
*
|
||||||
|
* This procedure gets the aspect ratio of a generated brush. If called
|
||||||
|
* for any other type of brush, it does not succeed.
|
||||||
|
*
|
||||||
|
* Returns: The aspect ratio of the brush.
|
||||||
|
*
|
||||||
|
* Since: GIMP 2.4
|
||||||
|
*/
|
||||||
|
gdouble
|
||||||
|
gimp_brush_get_aspect_ratio (const gchar *name)
|
||||||
|
{
|
||||||
|
GimpParam *return_vals;
|
||||||
|
gint nreturn_vals;
|
||||||
|
gdouble aspect_ratio = 0.0;
|
||||||
|
|
||||||
|
return_vals = gimp_run_procedure ("gimp-brush-get-aspect-ratio",
|
||||||
|
&nreturn_vals,
|
||||||
|
GIMP_PDB_STRING, name,
|
||||||
|
GIMP_PDB_END);
|
||||||
|
|
||||||
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||||
|
aspect_ratio = return_vals[1].data.d_float;
|
||||||
|
|
||||||
|
gimp_destroy_params (return_vals, nreturn_vals);
|
||||||
|
|
||||||
|
return aspect_ratio;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_brush_set_aspect_ratio:
|
* gimp_brush_set_aspect_ratio:
|
||||||
* @name: The brush name.
|
* @name: The brush name.
|
||||||
|
@ -811,6 +778,39 @@ gimp_brush_set_aspect_ratio (const gchar *name,
|
||||||
return aspect_ratio_out;
|
return aspect_ratio_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gimp_brush_get_angle:
|
||||||
|
* @name: The brush name.
|
||||||
|
*
|
||||||
|
* Get the rotation angle of a generated brush.
|
||||||
|
*
|
||||||
|
* This procedure gets the angle of rotation for a generated brush. If
|
||||||
|
* called for any other type of brush, it does not succeed.
|
||||||
|
*
|
||||||
|
* Returns: The rotation angle of the brush.
|
||||||
|
*
|
||||||
|
* Since: GIMP 2.4
|
||||||
|
*/
|
||||||
|
gdouble
|
||||||
|
gimp_brush_get_angle (const gchar *name)
|
||||||
|
{
|
||||||
|
GimpParam *return_vals;
|
||||||
|
gint nreturn_vals;
|
||||||
|
gdouble angle = 0.0;
|
||||||
|
|
||||||
|
return_vals = gimp_run_procedure ("gimp-brush-get-angle",
|
||||||
|
&nreturn_vals,
|
||||||
|
GIMP_PDB_STRING, name,
|
||||||
|
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_brush_set_angle:
|
* gimp_brush_set_angle:
|
||||||
* @name: The brush name.
|
* @name: The brush name.
|
||||||
|
|
|
@ -55,21 +55,21 @@ gboolean gimp_brush_get_spacing (const gchar *n
|
||||||
gboolean gimp_brush_set_spacing (const gchar *name,
|
gboolean gimp_brush_set_spacing (const gchar *name,
|
||||||
gint spacing);
|
gint spacing);
|
||||||
GimpBrushGeneratedShape gimp_brush_get_shape (const gchar *name);
|
GimpBrushGeneratedShape gimp_brush_get_shape (const gchar *name);
|
||||||
gdouble gimp_brush_get_radius (const gchar *name);
|
|
||||||
gint gimp_brush_get_spikes (const gchar *name);
|
|
||||||
gdouble gimp_brush_get_hardness (const gchar *name);
|
|
||||||
gdouble gimp_brush_get_aspect_ratio (const gchar *name);
|
|
||||||
gdouble gimp_brush_get_angle (const gchar *name);
|
|
||||||
GimpBrushGeneratedShape gimp_brush_set_shape (const gchar *name,
|
GimpBrushGeneratedShape gimp_brush_set_shape (const gchar *name,
|
||||||
GimpBrushGeneratedShape shape_in);
|
GimpBrushGeneratedShape shape_in);
|
||||||
|
gdouble gimp_brush_get_radius (const gchar *name);
|
||||||
gdouble gimp_brush_set_radius (const gchar *name,
|
gdouble gimp_brush_set_radius (const gchar *name,
|
||||||
gdouble radius_in);
|
gdouble radius_in);
|
||||||
|
gint gimp_brush_get_spikes (const gchar *name);
|
||||||
gint gimp_brush_set_spikes (const gchar *name,
|
gint gimp_brush_set_spikes (const gchar *name,
|
||||||
gint spikes_in);
|
gint spikes_in);
|
||||||
|
gdouble gimp_brush_get_hardness (const gchar *name);
|
||||||
gdouble gimp_brush_set_hardness (const gchar *name,
|
gdouble gimp_brush_set_hardness (const gchar *name,
|
||||||
gdouble hardness_in);
|
gdouble hardness_in);
|
||||||
|
gdouble gimp_brush_get_aspect_ratio (const gchar *name);
|
||||||
gdouble gimp_brush_set_aspect_ratio (const gchar *name,
|
gdouble gimp_brush_set_aspect_ratio (const gchar *name,
|
||||||
gdouble aspect_ratio_in);
|
gdouble aspect_ratio_in);
|
||||||
|
gdouble gimp_brush_get_angle (const gchar *name);
|
||||||
gdouble gimp_brush_set_angle (const gchar *name,
|
gdouble gimp_brush_set_angle (const gchar *name,
|
||||||
gdouble angle_in);
|
gdouble angle_in);
|
||||||
|
|
||||||
|
|
|
@ -88,6 +88,51 @@ gimp_context_pop (void)
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gimp_context_list_paint_methods:
|
||||||
|
* @num_paint_methods: The number of the available paint methods.
|
||||||
|
* @paint_methods: The names of the available paint methods.
|
||||||
|
*
|
||||||
|
* Lists the available paint methods.
|
||||||
|
*
|
||||||
|
* This procedure lists the names of the available paint methods. Any
|
||||||
|
* of the results can be used for gimp_context_set_paint_method().
|
||||||
|
*
|
||||||
|
* Returns: TRUE on success.
|
||||||
|
*
|
||||||
|
* Since: GIMP 2.4
|
||||||
|
*/
|
||||||
|
gboolean
|
||||||
|
gimp_context_list_paint_methods (gint *num_paint_methods,
|
||||||
|
gchar ***paint_methods)
|
||||||
|
{
|
||||||
|
GimpParam *return_vals;
|
||||||
|
gint nreturn_vals;
|
||||||
|
gboolean success = TRUE;
|
||||||
|
gint i;
|
||||||
|
|
||||||
|
return_vals = gimp_run_procedure ("gimp-context-list-paint-methods",
|
||||||
|
&nreturn_vals,
|
||||||
|
GIMP_PDB_END);
|
||||||
|
|
||||||
|
*num_paint_methods = 0;
|
||||||
|
*paint_methods = NULL;
|
||||||
|
|
||||||
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||||
|
|
||||||
|
if (success)
|
||||||
|
{
|
||||||
|
*num_paint_methods = return_vals[1].data.d_int32;
|
||||||
|
*paint_methods = g_new (gchar *, *num_paint_methods);
|
||||||
|
for (i = 0; i < *num_paint_methods; i++)
|
||||||
|
(*paint_methods)[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
gimp_destroy_params (return_vals, nreturn_vals);
|
||||||
|
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_context_get_paint_method:
|
* gimp_context_get_paint_method:
|
||||||
*
|
*
|
||||||
|
@ -155,51 +200,6 @@ gimp_context_set_paint_method (const gchar *name)
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* gimp_context_list_paint_methods:
|
|
||||||
* @num_paint_methods: The number of the available paint methods.
|
|
||||||
* @paint_methods: The names of the available paint methods.
|
|
||||||
*
|
|
||||||
* Lists the available paint methods.
|
|
||||||
*
|
|
||||||
* This procedure lists the names of the available paint methods. Any
|
|
||||||
* of the results can be used for gimp_context_set_paint_method().
|
|
||||||
*
|
|
||||||
* Returns: TRUE on success.
|
|
||||||
*
|
|
||||||
* Since: GIMP 2.4
|
|
||||||
*/
|
|
||||||
gboolean
|
|
||||||
gimp_context_list_paint_methods (gint *num_paint_methods,
|
|
||||||
gchar ***paint_methods)
|
|
||||||
{
|
|
||||||
GimpParam *return_vals;
|
|
||||||
gint nreturn_vals;
|
|
||||||
gboolean success = TRUE;
|
|
||||||
gint i;
|
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp-context-list-paint-methods",
|
|
||||||
&nreturn_vals,
|
|
||||||
GIMP_PDB_END);
|
|
||||||
|
|
||||||
*num_paint_methods = 0;
|
|
||||||
*paint_methods = NULL;
|
|
||||||
|
|
||||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
||||||
|
|
||||||
if (success)
|
|
||||||
{
|
|
||||||
*num_paint_methods = return_vals[1].data.d_int32;
|
|
||||||
*paint_methods = g_new (gchar *, *num_paint_methods);
|
|
||||||
for (i = 0; i < *num_paint_methods; i++)
|
|
||||||
(*paint_methods)[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
gimp_destroy_params (return_vals, nreturn_vals);
|
|
||||||
|
|
||||||
return success;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_context_get_foreground:
|
* gimp_context_get_foreground:
|
||||||
* @foreground: The foreground color.
|
* @foreground: The foreground color.
|
||||||
|
|
|
@ -31,10 +31,10 @@ G_BEGIN_DECLS
|
||||||
|
|
||||||
gboolean gimp_context_push (void);
|
gboolean gimp_context_push (void);
|
||||||
gboolean gimp_context_pop (void);
|
gboolean gimp_context_pop (void);
|
||||||
gchar* gimp_context_get_paint_method (void);
|
|
||||||
gboolean gimp_context_set_paint_method (const gchar *name);
|
|
||||||
gboolean gimp_context_list_paint_methods (gint *num_paint_methods,
|
gboolean gimp_context_list_paint_methods (gint *num_paint_methods,
|
||||||
gchar ***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_get_foreground (GimpRGB *foreground);
|
||||||
gboolean gimp_context_set_foreground (const GimpRGB *foreground);
|
gboolean gimp_context_set_foreground (const GimpRGB *foreground);
|
||||||
gboolean gimp_context_get_background (GimpRGB *background);
|
gboolean gimp_context_get_background (GimpRGB *background);
|
||||||
|
|
|
@ -5,6 +5,7 @@ EXPORTS
|
||||||
gimp_config_build_data_path
|
gimp_config_build_data_path
|
||||||
gimp_config_build_plug_in_path
|
gimp_config_build_plug_in_path
|
||||||
gimp_config_build_writable_path
|
gimp_config_build_writable_path
|
||||||
|
gimp_config_copy
|
||||||
gimp_config_deserialize_file
|
gimp_config_deserialize_file
|
||||||
gimp_config_deserialize_properties
|
gimp_config_deserialize_properties
|
||||||
gimp_config_deserialize_property
|
gimp_config_deserialize_property
|
||||||
|
|
|
@ -57,6 +57,7 @@ typedef struct
|
||||||
gint waveform;
|
gint waveform;
|
||||||
gboolean antialias;
|
gboolean antialias;
|
||||||
gboolean tile;
|
gboolean tile;
|
||||||
|
gint phase_shift;
|
||||||
} RippleValues;
|
} RippleValues;
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,7 +100,8 @@ static RippleValues rvals =
|
||||||
WRAP, /* edges */
|
WRAP, /* edges */
|
||||||
SINE, /* waveform */
|
SINE, /* waveform */
|
||||||
TRUE, /* antialias */
|
TRUE, /* antialias */
|
||||||
FALSE /* tile */
|
FALSE, /* tile */
|
||||||
|
0 /* phase shift */
|
||||||
};
|
};
|
||||||
|
|
||||||
/***** Functions *****/
|
/***** Functions *****/
|
||||||
|
@ -603,7 +605,7 @@ ripple_dialog (GimpDrawable *drawable)
|
||||||
|
|
||||||
gtk_widget_show (table);
|
gtk_widget_show (table);
|
||||||
|
|
||||||
table = gtk_table_new (2, 3, FALSE);
|
table = gtk_table_new (3, 3, FALSE);
|
||||||
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
|
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
|
||||||
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
|
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
|
||||||
gtk_box_pack_start (GTK_BOX (main_vbox), table, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (main_vbox), table, FALSE, FALSE, 0);
|
||||||
|
@ -634,6 +636,19 @@ ripple_dialog (GimpDrawable *drawable)
|
||||||
G_CALLBACK (gimp_preview_invalidate),
|
G_CALLBACK (gimp_preview_invalidate),
|
||||||
preview);
|
preview);
|
||||||
|
|
||||||
|
/* Phase Shift */
|
||||||
|
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||||
|
_("Phase _shift:"), SCALE_WIDTH, 0,
|
||||||
|
rvals.phase_shift, 0, 360, 1, 15, 0,
|
||||||
|
TRUE, 0, 0,
|
||||||
|
NULL, NULL);
|
||||||
|
g_signal_connect (scale_data, "value-changed",
|
||||||
|
G_CALLBACK (gimp_int_adjustment_update),
|
||||||
|
&rvals.phase_shift);
|
||||||
|
g_signal_connect_swapped (scale_data, "value-changed",
|
||||||
|
G_CALLBACK (gimp_preview_invalidate),
|
||||||
|
preview);
|
||||||
|
|
||||||
gtk_widget_show (frame);
|
gtk_widget_show (frame);
|
||||||
gtk_widget_show (table);
|
gtk_widget_show (table);
|
||||||
gtk_widget_show (dialog);
|
gtk_widget_show (dialog);
|
||||||
|
@ -680,15 +695,20 @@ average_two_pixels (guchar *dest,
|
||||||
static gdouble
|
static gdouble
|
||||||
displace_amount (gint location)
|
displace_amount (gint location)
|
||||||
{
|
{
|
||||||
|
gdouble phi = rvals.phase_shift / 360.0;
|
||||||
|
gdouble lambda;
|
||||||
|
|
||||||
switch (rvals.waveform)
|
switch (rvals.waveform)
|
||||||
{
|
{
|
||||||
case SINE:
|
case SINE:
|
||||||
return (rvals.amplitude *
|
return (rvals.amplitude *
|
||||||
sin (location * (2 * G_PI) / (gdouble) rvals.period));
|
sin (2 * G_PI * (location / (gdouble) rvals.period - phi)));
|
||||||
|
|
||||||
case SAWTOOTH:
|
case SAWTOOTH:
|
||||||
return (rvals.amplitude *
|
lambda = location % rvals.period - phi * rvals.period;
|
||||||
(fabs ((((location % rvals.period) /
|
if (lambda < 0)
|
||||||
(gdouble) rvals.period) * 4) - 2) - 1));
|
lambda += rvals.period;
|
||||||
|
return (rvals.amplitude * (fabs (((lambda / rvals.period) * 4) - 2) - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0.0;
|
return 0.0;
|
||||||
|
|
|
@ -669,6 +669,8 @@ GPL
|
||||||
|
|
||||||
foreach (@{$main::grp{$group}->{headers}}) { $out->{headers}->{$_}++ }
|
foreach (@{$main::grp{$group}->{headers}}) { $out->{headers}->{$_}++ }
|
||||||
|
|
||||||
|
$out->{headers}->{"\"core/gimpparamspecs.h\""}++;
|
||||||
|
|
||||||
my @headers = sort {
|
my @headers = sort {
|
||||||
my ($x, $y) = ($a, $b);
|
my ($x, $y) = ($a, $b);
|
||||||
foreach ($x, $y) {
|
foreach ($x, $y) {
|
||||||
|
@ -681,30 +683,22 @@ GPL
|
||||||
}
|
}
|
||||||
$x cmp $y;
|
$x cmp $y;
|
||||||
} keys %{$out->{headers}};
|
} keys %{$out->{headers}};
|
||||||
my $headers = ""; my $lib = 0; my $seen = 0; my $nl = 0;
|
|
||||||
my $sys = 0; my $base = 0;
|
my $headers = "";
|
||||||
|
my $lib = 0;
|
||||||
|
my $seen = 0;
|
||||||
|
my $sys = 0;
|
||||||
|
my $base = 0;
|
||||||
|
my $intl = 0;
|
||||||
|
my $utils = 0;
|
||||||
|
|
||||||
foreach (@headers) {
|
foreach (@headers) {
|
||||||
$headers .= "\n" if $nl;
|
|
||||||
$nl = 0;
|
|
||||||
|
|
||||||
if ($_ eq '<unistd.h>') {
|
|
||||||
$headers .= "\n" if $seen;
|
|
||||||
$headers .= "#ifdef HAVE_UNISTD_H\n";
|
|
||||||
}
|
|
||||||
if ($_ eq '<process.h>') {
|
|
||||||
$headers .= "\n" if $seen;
|
|
||||||
$headers .= "#include <glib.h>\n\n";
|
|
||||||
$headers .= "#ifdef G_OS_WIN32\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$seen++ if /^</;
|
$seen++ if /^</;
|
||||||
|
|
||||||
if ($sys == 0 && !/^</) {
|
if ($sys == 0 && !/^</) {
|
||||||
$sys = 1;
|
$sys = 1;
|
||||||
$headers .= "\n";
|
$headers .= "\n" if $seen;
|
||||||
$headers .= '#include <glib-object.h>';
|
$headers .= "#include <glib-object.h>\n\n";
|
||||||
$headers .= "\n\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$seen = 0 if !/^</;
|
$seen = 0 if !/^</;
|
||||||
|
@ -718,36 +712,28 @@ GPL
|
||||||
|
|
||||||
if ($sys == 1 && $base == 0) {
|
if ($sys == 1 && $base == 0) {
|
||||||
$base = 1;
|
$base = 1;
|
||||||
|
$headers .= "#include \"pdb-types.h\"\n\n";
|
||||||
$headers .= '#include "pdb-types.h"';
|
|
||||||
$headers .= "\n";
|
|
||||||
$headers .= '#include "gimppdb.h"';
|
|
||||||
$headers .= "\n";
|
|
||||||
$headers .= '#include "gimpprocedure.h"';
|
|
||||||
$headers .= "\n";
|
|
||||||
$headers .= '#include "core/gimpparamspecs.h"';
|
|
||||||
$headers .= "\n\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$headers .= "#include $_\n";
|
if (/gimp-intl/) {
|
||||||
|
$intl = 1;
|
||||||
if ($_ eq '<unistd.h>') {
|
}
|
||||||
$headers .= "#endif\n";
|
elsif (/gimppdb-utils/) {
|
||||||
$seen = 0;
|
$utils = 1;
|
||||||
$nl = 1;
|
}
|
||||||
}
|
else {
|
||||||
|
$headers .= "#include $_\n";
|
||||||
if ($_ eq '<process.h>') {
|
|
||||||
$headers .= "#endif\n";
|
|
||||||
$seen = 0;
|
|
||||||
$nl = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$headers .= "\n" if $_ eq '"config.h"';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$headers .= "\n#include \"internal_procs.h\"\n";
|
$headers .= "\n";
|
||||||
|
$headers .= "#include \"gimppdb.h\"\n";
|
||||||
|
$headers .= "#include \"gimppdb-utils.h\"\n" if $utils;
|
||||||
|
$headers .= "#include \"gimpprocedure.h\"\n";
|
||||||
|
$headers .= "#include \"internal_procs.h\"\n";
|
||||||
|
|
||||||
|
$headers .= "\n#include \"gimp-intl.h\"\n" if $intl;
|
||||||
|
|
||||||
my $extra = {};
|
my $extra = {};
|
||||||
if (exists $main::grp{$group}->{extra}->{app}) {
|
if (exists $main::grp{$group}->{extra}->{app}) {
|
||||||
|
|
|
@ -845,16 +845,21 @@ CODE
|
||||||
"core/gimpdatafactory.h"
|
"core/gimpdatafactory.h"
|
||||||
"gimppdb-utils.h");
|
"gimppdb-utils.h");
|
||||||
|
|
||||||
@procs = qw(brush_new brush_duplicate brush_is_generated
|
@procs = qw(brush_new
|
||||||
brush_rename brush_delete brush_is_editable
|
brush_duplicate
|
||||||
brush_get_info brush_get_pixels
|
brush_is_generated
|
||||||
|
brush_rename
|
||||||
|
brush_delete
|
||||||
|
brush_is_editable
|
||||||
|
brush_get_info
|
||||||
|
brush_get_pixels
|
||||||
brush_get_spacing brush_set_spacing
|
brush_get_spacing brush_set_spacing
|
||||||
brush_get_shape brush_get_radius
|
brush_get_shape brush_set_shape
|
||||||
brush_get_spikes brush_get_hardness
|
brush_get_radius brush_set_radius
|
||||||
brush_get_aspect_ratio brush_get_angle
|
brush_get_spikes brush_set_spikes
|
||||||
brush_set_shape brush_set_radius
|
brush_get_hardness brush_set_hardness
|
||||||
brush_set_spikes brush_set_hardness
|
brush_get_aspect_ratio brush_set_aspect_ratio
|
||||||
brush_set_aspect_ratio brush_set_angle);
|
brush_get_angle brush_set_angle);
|
||||||
|
|
||||||
%exports = (app => [@procs], lib => [@procs]);
|
%exports = (app => [@procs], lib => [@procs]);
|
||||||
|
|
||||||
|
|
|
@ -120,9 +120,12 @@ CODE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@headers = qw("core/gimp.h" "core/gimpdatafactory.h");
|
@headers = qw("core/gimp.h"
|
||||||
|
"core/gimpdatafactory.h");
|
||||||
|
|
||||||
@procs = qw(brushes_popup brushes_close_popup brushes_set_popup);
|
@procs = qw(brushes_popup
|
||||||
|
brushes_close_popup
|
||||||
|
brushes_set_popup);
|
||||||
|
|
||||||
%exports = (app => [@procs], lib => [@procs]);
|
%exports = (app => [@procs], lib => [@procs]);
|
||||||
|
|
||||||
|
|
|
@ -206,7 +206,8 @@ CODE
|
||||||
"core/gimpdatafactory.h"
|
"core/gimpdatafactory.h"
|
||||||
"gimppdb-utils.h");
|
"gimppdb-utils.h");
|
||||||
|
|
||||||
@procs = qw(brushes_refresh brushes_get_list
|
@procs = qw(brushes_refresh
|
||||||
|
brushes_get_list
|
||||||
brushes_get_brush
|
brushes_get_brush
|
||||||
brushes_get_spacing brushes_set_spacing
|
brushes_get_spacing brushes_set_spacing
|
||||||
brushes_get_brush_data);
|
brushes_get_brush_data);
|
||||||
|
|
|
@ -239,9 +239,12 @@ CODE
|
||||||
"gimppdb-utils.h");
|
"gimppdb-utils.h");
|
||||||
|
|
||||||
@procs = qw(buffers_get_list
|
@procs = qw(buffers_get_list
|
||||||
buffer_rename buffer_delete
|
buffer_rename
|
||||||
buffer_get_width buffer_get_height
|
buffer_delete
|
||||||
buffer_get_bytes buffer_get_image_type);
|
buffer_get_width
|
||||||
|
buffer_get_height
|
||||||
|
buffer_get_bytes
|
||||||
|
buffer_get_image_type);
|
||||||
|
|
||||||
%exports = (app => [@procs], lib => [@procs]);
|
%exports = (app => [@procs], lib => [@procs]);
|
||||||
|
|
||||||
|
|
|
@ -344,7 +344,9 @@ CODE
|
||||||
|
|
||||||
@headers = qw("libgimpbase/gimpbase.h");
|
@headers = qw("libgimpbase/gimpbase.h");
|
||||||
|
|
||||||
@procs = qw(channel_new channel_new_from_component channel_copy
|
@procs = qw(channel_new
|
||||||
|
channel_new_from_component
|
||||||
|
channel_copy
|
||||||
channel_combine_masks
|
channel_combine_masks
|
||||||
channel_get_show_masked channel_set_show_masked
|
channel_get_show_masked channel_set_show_masked
|
||||||
channel_get_opacity channel_set_opacity
|
channel_get_opacity channel_set_opacity
|
||||||
|
|
|
@ -684,8 +684,7 @@ CODE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@headers = qw(<gegl.h>
|
@headers = qw("core/gimpdrawable.h"
|
||||||
"core/gimpdrawable.h"
|
|
||||||
"gimppdb-utils.h"
|
"gimppdb-utils.h"
|
||||||
"gimp-intl.h");
|
"gimp-intl.h");
|
||||||
|
|
||||||
|
|
|
@ -717,11 +717,12 @@ CODE
|
||||||
"gimppdb-utils.h");
|
"gimppdb-utils.h");
|
||||||
|
|
||||||
@procs = qw(context_push context_pop
|
@procs = qw(context_push context_pop
|
||||||
context_get_paint_method context_set_paint_method
|
|
||||||
context_list_paint_methods
|
context_list_paint_methods
|
||||||
|
context_get_paint_method context_set_paint_method
|
||||||
context_get_foreground context_set_foreground
|
context_get_foreground context_set_foreground
|
||||||
context_get_background context_set_background
|
context_get_background context_set_background
|
||||||
context_set_default_colors context_swap_colors
|
context_set_default_colors
|
||||||
|
context_swap_colors
|
||||||
context_get_opacity context_set_opacity
|
context_get_opacity context_set_opacity
|
||||||
context_get_paint_mode context_set_paint_mode
|
context_get_paint_mode context_set_paint_mode
|
||||||
context_get_brush context_set_brush
|
context_get_brush context_set_brush
|
||||||
|
|
|
@ -183,8 +183,7 @@ CODE
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@headers = qw("core/gimp.h"
|
@headers = qw("core/gimpimage.h"
|
||||||
"core/gimpimage.h"
|
|
||||||
"core/gimpimage-convert.h"
|
"core/gimpimage-convert.h"
|
||||||
"gimppdb-utils.h");
|
"gimppdb-utils.h");
|
||||||
|
|
||||||
|
|
|
@ -210,9 +210,12 @@ CODE
|
||||||
|
|
||||||
@headers = qw("core/gimp.h");
|
@headers = qw("core/gimp.h");
|
||||||
|
|
||||||
@procs = qw(display_is_valid display_new display_delete
|
@procs = qw(display_is_valid
|
||||||
|
display_new
|
||||||
|
display_delete
|
||||||
display_get_window_handle
|
display_get_window_handle
|
||||||
displays_flush displays_reconnect);
|
displays_flush
|
||||||
|
displays_reconnect);
|
||||||
|
|
||||||
%exports = (app => [@procs], lib => [@procs]);
|
%exports = (app => [@procs], lib => [@procs]);
|
||||||
|
|
||||||
|
|
|
@ -1279,18 +1279,25 @@ CODE
|
||||||
drawable_is_layer drawable_is_layer_mask drawable_is_channel
|
drawable_is_layer drawable_is_layer_mask drawable_is_channel
|
||||||
drawable_type drawable_type_with_alpha drawable_has_alpha
|
drawable_type drawable_type_with_alpha drawable_has_alpha
|
||||||
drawable_is_rgb drawable_is_gray drawable_is_indexed
|
drawable_is_rgb drawable_is_gray drawable_is_indexed
|
||||||
drawable_bpp drawable_width drawable_height drawable_offsets
|
drawable_bpp
|
||||||
|
drawable_width
|
||||||
|
drawable_height
|
||||||
|
drawable_offsets
|
||||||
drawable_delete
|
drawable_delete
|
||||||
drawable_get_image drawable_set_image
|
drawable_get_image drawable_set_image
|
||||||
drawable_get_name drawable_set_name
|
drawable_get_name drawable_set_name
|
||||||
drawable_get_visible drawable_set_visible
|
drawable_get_visible drawable_set_visible
|
||||||
drawable_get_linked drawable_set_linked
|
drawable_get_linked drawable_set_linked
|
||||||
drawable_get_tattoo drawable_set_tattoo
|
drawable_get_tattoo drawable_set_tattoo
|
||||||
drawable_mask_bounds drawable_mask_intersect
|
drawable_mask_bounds
|
||||||
drawable_merge_shadow drawable_update
|
drawable_mask_intersect
|
||||||
|
drawable_merge_shadow
|
||||||
|
drawable_update
|
||||||
drawable_get_pixel drawable_set_pixel
|
drawable_get_pixel drawable_set_pixel
|
||||||
drawable_fill drawable_offset
|
drawable_fill
|
||||||
drawable_thumbnail drawable_sub_thumbnail
|
drawable_offset
|
||||||
|
drawable_thumbnail
|
||||||
|
drawable_sub_thumbnail
|
||||||
drawable_foreground_extract);
|
drawable_foreground_extract);
|
||||||
|
|
||||||
%exports = (app => [@procs], lib => [@procs]);
|
%exports = (app => [@procs], lib => [@procs]);
|
||||||
|
|
|
@ -1037,15 +1037,21 @@ CODE
|
||||||
"gimp-intl.h");
|
"gimp-intl.h");
|
||||||
|
|
||||||
@procs = qw(drawable_transform_flip_simple
|
@procs = qw(drawable_transform_flip_simple
|
||||||
drawable_transform_flip drawable_transform_flip_default
|
drawable_transform_flip
|
||||||
|
drawable_transform_flip_default
|
||||||
drawable_transform_perspective
|
drawable_transform_perspective
|
||||||
drawable_transform_perspective_default
|
drawable_transform_perspective_default
|
||||||
drawable_transform_rotate_simple
|
drawable_transform_rotate_simple
|
||||||
drawable_transform_rotate drawable_transform_rotate_default
|
drawable_transform_rotate
|
||||||
drawable_transform_scale drawable_transform_scale_default
|
drawable_transform_rotate_default
|
||||||
drawable_transform_shear drawable_transform_shear_default
|
drawable_transform_scale
|
||||||
drawable_transform_2d drawable_transform_2d_default
|
drawable_transform_scale_default
|
||||||
drawable_transform_matrix drawable_transform_matrix_default);
|
drawable_transform_shear
|
||||||
|
drawable_transform_shear_default
|
||||||
|
drawable_transform_2d
|
||||||
|
drawable_transform_2d_default
|
||||||
|
drawable_transform_matrix
|
||||||
|
drawable_transform_matrix_default);
|
||||||
|
|
||||||
%exports = (app => [@procs], lib => [@procs]);
|
%exports = (app => [@procs], lib => [@procs]);
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue