From 09e6e30a77729da084399078d0a8f9434ca44b02 Mon Sep 17 00:00:00 2001 From: "Adam D. Moss" Date: Tue, 1 Sep 1998 22:12:45 +0000 Subject: [PATCH] New plugin to slice an image up along its Guides. * plug-ins/guillotine/Makefile.am configure.in plug-ins/guillotine/guillotine.c plug-ins/Makefile.am: New plugin to slice an image up along its Guides. * app/gimage_cmds.c: Fixes. --- ChangeLog | 8 ++++++++ app/gimage_cmds.c | 35 ++++++++++++++++++++--------------- configure.in | 1 + plug-ins/Makefile.am | 1 + 4 files changed, 30 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index caf9037aa6..5d95a4a962 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Tue Sep 1 23:00:42 BST 1998 Adam D. Moss + + * plug-ins/guillotine/Makefile.am configure.in + plug-ins/guillotine/guillotine.c plug-ins/Makefile.am: + New plugin to slice an image up along its Guides. + + * app/gimage_cmds.c: Fixes. + Tue Sep 1 19:19:57 BST 1998 Adam D. Moss * app/gimage_cmds.c app/gimage_cmds.h app/gimpimage.c diff --git a/app/gimage_cmds.c b/app/gimage_cmds.c index a48f52e6d8..2fa63a10f8 100644 --- a/app/gimage_cmds.c +++ b/app/gimage_cmds.c @@ -3851,7 +3851,7 @@ gimp_image_findnext_guide_invoker (Argument *args) int success = TRUE; int int_value; int guide_id; - int rtn_guide_id; + int rtn_guide_id = 0; GImage *gimage; GList *guides; Argument *return_args; @@ -3884,7 +3884,7 @@ gimp_image_findnext_guide_invoker (Argument *args) ((Guide*)guides->data)->position < 0) guides = g_list_next(guides); - if (guides) + if (guides) /* didn't just come to end of list */ rtn_guide_id = ((Guide*)guides->data)->guide_ID; } else @@ -3896,6 +3896,8 @@ gimp_image_findnext_guide_invoker (Argument *args) if ((((Guide*)guides->data)->guide_ID == guide_id) && (((Guide*)guides->data)->position>=0) ) { + GList* tmplist; + /*printf("Gotcha at %p: %d, %d, %d\n", ((Guide*)guides->data), ((Guide*)guides->data)->position, @@ -3904,20 +3906,23 @@ gimp_image_findnext_guide_invoker (Argument *args) );*/ success = TRUE; - if (g_list_next(guides) == NULL) - { - rtn_guide_id = 0; - } - else - { - GList* tmplist; - tmplist = g_list_next(guides); - rtn_guide_id = ((Guide*)tmplist->data)->guide_ID; - goto got_it; + tmplist = g_list_next(guides); + + rtn_guide_id = 0; + + while ((tmplist != NULL) && + (((Guide*)tmplist->data)->position < 0) ) + { + tmplist = g_list_next(tmplist); } + + if (tmplist != NULL) + rtn_guide_id = ((Guide*)tmplist->data)->guide_ID; + + goto got_it; } - + guides = g_list_next(guides); } } @@ -3993,7 +3998,7 @@ gimp_image_get_guide_orientation_invoker (Argument *args) int success = TRUE; int int_value; int guide_id; - int rtn_orientation; + int rtn_orientation = 0; GImage *gimage; GList *guides; Argument *return_args; @@ -4110,7 +4115,7 @@ gimp_image_get_guide_position_invoker (Argument *args) int success = TRUE; int int_value; int guide_id; - int rtn_position; + int rtn_position = -1; GImage *gimage; GList *guides; Argument *return_args; diff --git a/configure.in b/configure.in index 901f544153..576011f8e2 100644 --- a/configure.in +++ b/configure.in @@ -540,6 +540,7 @@ plug-ins/gqbist/Makefile plug-ins/gradmap/Makefile plug-ins/grid/Makefile plug-ins/gtm/Makefile +plug-ins/guillotine/Makefile plug-ins/gz/Makefile plug-ins/header/Makefile plug-ins/hot/Makefile diff --git a/plug-ins/Makefile.am b/plug-ins/Makefile.am index 160c6738ef..87338575e9 100644 --- a/plug-ins/Makefile.am +++ b/plug-ins/Makefile.am @@ -67,6 +67,7 @@ SUBDIRS = \ gradmap \ grid \ gtm \ + guillotine \ gz \ header \ hot \