From aklikins@eos.ncsu.edu Fri Apr 18 13:47:12 1997 Date: Fri, 18 Apr 1997 13:45:19 -0400 From: Adrian Karstan Likins To: xach@mint.net Subject: patch:offset improvement if you have grabbed .99.8 and played with it much you probably noticed t hat the offset dialog is a little bit mucked up. Well, thats my fault folks. It' s was my patch that added the by(x/2),(y/2) option and unfortuanaelty made the d ialog look a little bit broken. I just sort of made the patch to maek things a l ittle easier on myself and didnt really expect it to get included with the dist. But seeing that now it has, I guess i need to try to fix it. Anyway, this inclu des two paches. One is to restore channel_ops.c to the way it was in .99.7, and another to fixed up the one in .99.8 so it works a litle better. SO yo can have it boths ways if you like. :) Adrian Likins. patch 1 ( upgrade to newest version of patch) --- channel_ops.c Thu Apr 17 20:18:24 1997 +++ channel_ops.c.new Fri Apr 18 09:52:53 1997 @@ -91,6 +91,7 @@ GtkWidget *button; GtkWidget *label; GtkWidget *check; + GtkWidget *check2; GtkWidget *toggle; GtkWidget *vbox; GtkWidget *toggle_vbox; @@ -166,9 +167,9 @@ gtk_widget_show (check); /* the by half height and half width offtion */ - check = gtk_check_button_new_with_label ("Offset by (x/2),(y/2)"); - gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE,0); - gtk_widget_show (check); + check2 = gtk_check_button_new_with_label ("Offset by (x/2),(y/2)"); + gtk_box_pack_start (GTK_BOX (vbox), check2, FALSE, FALSE,0); + gtk_widget_show (check2); /* The fill options */ off_d->fill_options = gtk_frame_new ("Fill Options"); @@ -212,10 +213,12 @@ /* Hook up the by half */ - gtk_signal_connect (GTK_OBJECT (check), "toggled", + gtk_signal_connect (GTK_OBJECT (check2), "toggled", (GtkSignalFunc) offset_halfheight_update, off_d); - gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (check), off_d->half_height); + + gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (check2), off_d->half_height); + } static GImage * @@ -661,7 +664,8 @@ else off_d->half_height = FALSE; - gtk_widget_set_sensitive (off_d->fill_options, !off_d->half_height); +/* gtk_widget_set_sensitive (off_d->fill_options, !off_d->half_height); +*/ } ==================================================================== end of patch one ( the patch to the newer version) ====================================================================== patch two ( patch to retro patch channel_ops ================================================== --- channel_ops.c Thu Apr 17 20:18:24 1997 +++ channel_ops.c.orig Fri Apr 18 09:53:06 1997 @@ -40,7 +40,6 @@ GtkWidget *off_y_entry; int wrap_around; - int half_height; int transparent; int background; int gimage_id; @@ -53,7 +52,6 @@ int drawable, int wrap_around, int fill_type, - int half_height, int offset_x, int offset_y); @@ -65,8 +63,6 @@ gpointer data); static void offset_wraparound_update (GtkWidget *widget, gpointer data); -static void offset_halfheight_update (GtkWidget *widget, - gpointer data); static Argument * channel_ops_duplicate_invoker (Argument *args); static Argument * channel_ops_offset_invoker (Argument *args); @@ -104,7 +100,6 @@ off_d = g_new (OffsetDialog, 1); off_d->wrap_around = TRUE; - off_d->half_height = TRUE; off_d->transparent = drawable_has_alpha (drawable_id); off_d->background = !off_d->transparent; off_d->gimage_id = gimage->ID; @@ -164,11 +159,6 @@ check = gtk_check_button_new_with_label ("Wrap-Around"); gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); gtk_widget_show (check); - - /* the by half height and half width offtion */ - check = gtk_check_button_new_with_label ("Offset by (x/2),(y/2)"); - gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE,0); - gtk_widget_show (check); /* The fill options */ off_d->fill_options = gtk_frame_new ("Fill Options"); @@ -209,13 +199,6 @@ (GtkSignalFunc) offset_wraparound_update, off_d); gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (check), off_d->wrap_around); - - - /* Hook up the by half */ - gtk_signal_connect (GTK_OBJECT (check), "toggled", - (GtkSignalFunc) offset_halfheight_update, - off_d); - gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (check), off_d->half_height); } static GImage * @@ -339,7 +322,6 @@ offset (GImage *gimage, int drawable, int wrap_around, - int half_height, int fill_type, int offset_x, int offset_y) @@ -367,12 +349,6 @@ offset_y = BOUNDS (offset_y, -height, height); } - if (half_height) - { - offset_x = width/2; - offset_y = height/2; - } - if (offset_x == 0 && offset_y == 0) return; @@ -600,7 +576,7 @@ else fill_type = OFFSET_BACKGROUND; - offset (gimage, drawable_id, off_d->wrap_around,off_d->half_height, fill_ type, offset_x, offset_y); + offset (gimage, drawable_id, off_d->wrap_around, fill_type, offset_x, off set_y); gdisplays_flush (); } @@ -649,22 +625,6 @@ gtk_widget_set_sensitive (off_d->fill_options, !off_d->wrap_around); } -static void -offset_halfheight_update (GtkWidget *widget, - gpointer data) -{ - OffsetDialog *off_d; - - off_d = (OffsetDialog *) data; - if (GTK_TOGGLE_BUTTON (widget)->active) - off_d->half_height = TRUE; - else - off_d->half_height = FALSE; - - gtk_widget_set_sensitive (off_d->fill_options, !off_d->half_height); -} - - /* * Procedure database functions and data structures @@ -802,7 +762,6 @@ GImage *gimage; int drawable_id; int wrap_around; - int half_height; int fill_type; int offset_x; int offset_y; @@ -837,7 +796,7 @@ } if (success) - offset (gimage, drawable_id, wrap_around, half_height, fill_type, offset_x, offset_y); + offset (gimage, drawable_id, wrap_around, fill_type, offset_x, offset_y); return procedural_db_return_args (&channel_ops_offset_proc, success); } -- ******************************************************************************** This is my sig. There are many like it, but this one is mine. Adrian Likins aklikins@eos.ncsu.edu http://www4.ncsu.edu/eos/users/a/aklikins/pub/adrian.html