static GValueArray * image_find_next_guide_invoker (GimpProcedure *procedure, Gimp *gimp, GimpContext *context, GimpProgress *progress, const GValueArray *args) { gboolean success = TRUE; GValueArray *return_vals; GimpImage *image; gint32 guide; gint32 next_guide = 0; image = gimp_value_get_image (&args->values[0], gimp); guide = g_value_get_uint (&args->values[1]); if (success) { GimpGuide *g = gimp_image_get_next_guide (image, guide, &success); if (g) next_guide = gimp_guide_get_ID (g); } return_vals = gimp_procedure_get_return_values (procedure, success); if (success) g_value_set_uint (&return_vals->values[1], next_guide); return return_vals; }
static GimpValueArray * image_find_next_guide_invoker (GimpProcedure *procedure, Gimp *gimp, GimpContext *context, GimpProgress *progress, const GimpValueArray *args, GError **error) { gboolean success = TRUE; GimpValueArray *return_vals; GimpImage *image; gint32 guide; gint32 next_guide = 0; image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp); guide = g_value_get_uint (gimp_value_array_index (args, 1)); if (success) { GimpGuide *g = gimp_image_get_next_guide (image, guide, &success); if (g) next_guide = gimp_guide_get_ID (g); } return_vals = gimp_procedure_get_return_values (procedure, success, error ? *error : NULL); if (success) g_value_set_uint (gimp_value_array_index (return_vals, 1), next_guide); return return_vals; }
static GimpValueArray * image_find_next_guide_invoker (GimpProcedure *procedure, Gimp *gimp, GimpContext *context, GimpProgress *progress, const GimpValueArray *args, GError **error) { gboolean success = TRUE; GimpValueArray *return_vals; GimpImage *image; gint32 guide; gint32 next_guide = 0; image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp); guide = g_value_get_uint (gimp_value_array_index (args, 1)); if (success) { GimpGuide *g = gimp_image_get_next_guide (image, guide, &success); if (g) next_guide = gimp_guide_get_ID (g); if (! success) g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT, _("Image '%s' (%d) does not contain guide with ID %d"), gimp_image_get_display_name (image), gimp_image_get_ID (image), guide); } return_vals = gimp_procedure_get_return_values (procedure, success, error ? *error : NULL); if (success) g_value_set_uint (gimp_value_array_index (return_vals, 1), next_guide); return return_vals; }
static GimpValueArray * image_add_vguide_invoker (GimpProcedure *procedure, Gimp *gimp, GimpContext *context, GimpProgress *progress, const GimpValueArray *args, GError **error) { gboolean success = TRUE; GimpValueArray *return_vals; GimpImage *image; gint32 xposition; gint32 guide = 0; image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp); xposition = g_value_get_int (gimp_value_array_index (args, 1)); if (success) { if (xposition <= gimp_image_get_width (image)) { GimpGuide *g; g = gimp_image_add_vguide (image, xposition, TRUE); guide = gimp_guide_get_ID (g); } else success = FALSE; } return_vals = gimp_procedure_get_return_values (procedure, success, error ? *error : NULL); if (success) g_value_set_uint (gimp_value_array_index (return_vals, 1), guide); return return_vals; }
static GValueArray * image_add_vguide_invoker (GimpProcedure *procedure, Gimp *gimp, GimpContext *context, GimpProgress *progress, const GValueArray *args) { gboolean success = TRUE; GValueArray *return_vals; GimpImage *image; gint32 xposition; gint32 guide = 0; image = gimp_value_get_image (&args->values[0], gimp); xposition = g_value_get_int (&args->values[1]); if (success) { if (xposition <= image->width) { GimpGuide *g; g = gimp_image_add_vguide (image, xposition, TRUE); guide = gimp_guide_get_ID (g); } else success = FALSE; } return_vals = gimp_procedure_get_return_values (procedure, success); if (success) g_value_set_uint (&return_vals->values[1], guide); return return_vals; }