+Thu Apr 9 14:24:35 1998 Owen Taylor <owt1@cornell.edu>
+
+ (Found by Mattias.Gronlund" <Mattias.Gronlund@sa.erisoft.se>)
+
+ * gtk/gtkcurve.c (gtk_curve_interpolate): Added a
+ missing g_free.
+
+ * gtk/gtkcurve.c (gtk_curve_graph_events): Limits
+ were off by one, resulting in writing past array
+ bounds. Removed some unused code.
+
+ * gdk/gdk.c (gdk_dnd_drag_begin): The event structure
+ used for gdk_event_put should be a GdkEvent, not a
+ subtype, since it will all be copied.
+
+ * gtk/gtkcolorsel.c: Added a unrealize handler that
+ unref's the GC's that were created.
+
+ * gtk/testgtk.c (clist_warning_test): ref and sink
+ child because it may never be added to anything.
+
Wed Apr 8 20:50:02 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkwindow.c (gtk_window_set_hints): Removed unsed
+Thu Apr 9 14:24:35 1998 Owen Taylor <owt1@cornell.edu>
+
+ (Found by Mattias.Gronlund" <Mattias.Gronlund@sa.erisoft.se>)
+
+ * gtk/gtkcurve.c (gtk_curve_interpolate): Added a
+ missing g_free.
+
+ * gtk/gtkcurve.c (gtk_curve_graph_events): Limits
+ were off by one, resulting in writing past array
+ bounds. Removed some unused code.
+
+ * gdk/gdk.c (gdk_dnd_drag_begin): The event structure
+ used for gdk_event_put should be a GdkEvent, not a
+ subtype, since it will all be copied.
+
+ * gtk/gtkcolorsel.c: Added a unrealize handler that
+ unref's the GC's that were created.
+
+ * gtk/testgtk.c (clist_warning_test): ref and sink
+ child because it may never be added to anything.
+
Wed Apr 8 20:50:02 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkwindow.c (gtk_window_set_hints): Removed unsed
+Thu Apr 9 14:24:35 1998 Owen Taylor <owt1@cornell.edu>
+
+ (Found by Mattias.Gronlund" <Mattias.Gronlund@sa.erisoft.se>)
+
+ * gtk/gtkcurve.c (gtk_curve_interpolate): Added a
+ missing g_free.
+
+ * gtk/gtkcurve.c (gtk_curve_graph_events): Limits
+ were off by one, resulting in writing past array
+ bounds. Removed some unused code.
+
+ * gdk/gdk.c (gdk_dnd_drag_begin): The event structure
+ used for gdk_event_put should be a GdkEvent, not a
+ subtype, since it will all be copied.
+
+ * gtk/gtkcolorsel.c: Added a unrealize handler that
+ unref's the GC's that were created.
+
+ * gtk/testgtk.c (clist_warning_test): ref and sink
+ child because it may never be added to anything.
+
Wed Apr 8 20:50:02 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkwindow.c (gtk_window_set_hints): Removed unsed
+Thu Apr 9 14:24:35 1998 Owen Taylor <owt1@cornell.edu>
+
+ (Found by Mattias.Gronlund" <Mattias.Gronlund@sa.erisoft.se>)
+
+ * gtk/gtkcurve.c (gtk_curve_interpolate): Added a
+ missing g_free.
+
+ * gtk/gtkcurve.c (gtk_curve_graph_events): Limits
+ were off by one, resulting in writing past array
+ bounds. Removed some unused code.
+
+ * gdk/gdk.c (gdk_dnd_drag_begin): The event structure
+ used for gdk_event_put should be a GdkEvent, not a
+ subtype, since it will all be copied.
+
+ * gtk/gtkcolorsel.c: Added a unrealize handler that
+ unref's the GC's that were created.
+
+ * gtk/testgtk.c (clist_warning_test): ref and sink
+ child because it may never be added to anything.
+
Wed Apr 8 20:50:02 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkwindow.c (gtk_window_set_hints): Removed unsed
+Thu Apr 9 14:24:35 1998 Owen Taylor <owt1@cornell.edu>
+
+ (Found by Mattias.Gronlund" <Mattias.Gronlund@sa.erisoft.se>)
+
+ * gtk/gtkcurve.c (gtk_curve_interpolate): Added a
+ missing g_free.
+
+ * gtk/gtkcurve.c (gtk_curve_graph_events): Limits
+ were off by one, resulting in writing past array
+ bounds. Removed some unused code.
+
+ * gdk/gdk.c (gdk_dnd_drag_begin): The event structure
+ used for gdk_event_put should be a GdkEvent, not a
+ subtype, since it will all be copied.
+
+ * gtk/gtkcolorsel.c: Added a unrealize handler that
+ unref's the GC's that were created.
+
+ * gtk/testgtk.c (clist_warning_test): ref and sink
+ child because it may never be added to anything.
+
Wed Apr 8 20:50:02 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkwindow.c (gtk_window_set_hints): Removed unsed
+Thu Apr 9 14:24:35 1998 Owen Taylor <owt1@cornell.edu>
+
+ (Found by Mattias.Gronlund" <Mattias.Gronlund@sa.erisoft.se>)
+
+ * gtk/gtkcurve.c (gtk_curve_interpolate): Added a
+ missing g_free.
+
+ * gtk/gtkcurve.c (gtk_curve_graph_events): Limits
+ were off by one, resulting in writing past array
+ bounds. Removed some unused code.
+
+ * gdk/gdk.c (gdk_dnd_drag_begin): The event structure
+ used for gdk_event_put should be a GdkEvent, not a
+ subtype, since it will all be copied.
+
+ * gtk/gtkcolorsel.c: Added a unrealize handler that
+ unref's the GC's that were created.
+
+ * gtk/testgtk.c (clist_warning_test): ref and sink
+ child because it may never be added to anything.
+
Wed Apr 8 20:50:02 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkwindow.c (gtk_window_set_hints): Removed unsed
+Thu Apr 9 14:24:35 1998 Owen Taylor <owt1@cornell.edu>
+
+ (Found by Mattias.Gronlund" <Mattias.Gronlund@sa.erisoft.se>)
+
+ * gtk/gtkcurve.c (gtk_curve_interpolate): Added a
+ missing g_free.
+
+ * gtk/gtkcurve.c (gtk_curve_graph_events): Limits
+ were off by one, resulting in writing past array
+ bounds. Removed some unused code.
+
+ * gdk/gdk.c (gdk_dnd_drag_begin): The event structure
+ used for gdk_event_put should be a GdkEvent, not a
+ subtype, since it will all be copied.
+
+ * gtk/gtkcolorsel.c: Added a unrealize handler that
+ unref's the GC's that were created.
+
+ * gtk/testgtk.c (clist_warning_test): ref and sink
+ child because it may never be added to anything.
+
Wed Apr 8 20:50:02 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkwindow.c (gtk_window_set_hints): Removed unsed
every widget realization involves a XGetGeometry and a
XGetWindowAttributes. And every GdkWindow destruction
involves a XQueryTree.
+
+ * Scrolled windows need to be smarter about when they size-request/allocate
+ their children.
\ No newline at end of file
static void
gdk_dnd_drag_begin (GdkWindow *initial_window)
{
- GdkEventDragBegin tev;
+ GdkEvent tev;
GDK_NOTE(DND, g_print("------- STARTING DRAG from %p\n", initial_window));
tev.type = GDK_DRAG_BEGIN;
- tev.window = initial_window;
- tev.u.allflags = 0;
- tev.u.flags.protocol_version = DND_PROTOCOL_VERSION;
+ tev.dragbegin.window = initial_window;
+ tev.dragbegin.u.allflags = 0;
+ tev.dragbegin.u.flags.protocol_version = DND_PROTOCOL_VERSION;
- gdk_event_put ((GdkEvent *) &tev);
+ gdk_event_put (&tev);
}
static void
GdkPoint coords)
{
GdkWindowPrivate *wp;
- GdkEventDragRequest tev;
+ GdkEvent tev;
int i;
- tev.type = GDK_DRAG_REQUEST;
- tev.drop_coords = coords;
- tev.requestor = dest;
- tev.u.allflags = 0;
- tev.u.flags.protocol_version = DND_PROTOCOL_VERSION;
- tev.isdrop = 1;
+ tev.dragrequest.type = GDK_DRAG_REQUEST;
+ tev.dragrequest.drop_coords = coords;
+ tev.dragrequest.requestor = dest;
+ tev.dragrequest.u.allflags = 0;
+ tev.dragrequest.u.flags.protocol_version = DND_PROTOCOL_VERSION;
+ tev.dragrequest.isdrop = 1;
for (i = 0; i < gdk_dnd.drag_numwindows; i++)
{
wp = (GdkWindowPrivate *) gdk_dnd.drag_startwindows[i];
if (wp->dnd_drag_accepted)
{
- tev.window = (GdkWindow *) wp;
- tev.u.flags.delete_data = wp->dnd_drag_destructive_op;
- tev.timestamp = gdk_dnd.last_drop_time;
- tev.data_type =
+ tev.dragrequest.window = (GdkWindow *) wp;
+ tev.dragrequest.u.flags.delete_data = wp->dnd_drag_destructive_op;
+ tev.dragrequest.timestamp = gdk_dnd.last_drop_time;
+ tev.dragrequest.data_type =
gdk_atom_name(wp->dnd_drag_data_type);
- gdk_event_put((GdkEvent *) &tev);
+ gdk_event_put(&tev);
}
}
}
static void
gdk_dnd_drag_begin (GdkWindow *initial_window)
{
- GdkEventDragBegin tev;
+ GdkEvent tev;
GDK_NOTE(DND, g_print("------- STARTING DRAG from %p\n", initial_window));
tev.type = GDK_DRAG_BEGIN;
- tev.window = initial_window;
- tev.u.allflags = 0;
- tev.u.flags.protocol_version = DND_PROTOCOL_VERSION;
+ tev.dragbegin.window = initial_window;
+ tev.dragbegin.u.allflags = 0;
+ tev.dragbegin.u.flags.protocol_version = DND_PROTOCOL_VERSION;
- gdk_event_put ((GdkEvent *) &tev);
+ gdk_event_put (&tev);
}
static void
GdkPoint coords)
{
GdkWindowPrivate *wp;
- GdkEventDragRequest tev;
+ GdkEvent tev;
int i;
- tev.type = GDK_DRAG_REQUEST;
- tev.drop_coords = coords;
- tev.requestor = dest;
- tev.u.allflags = 0;
- tev.u.flags.protocol_version = DND_PROTOCOL_VERSION;
- tev.isdrop = 1;
+ tev.dragrequest.type = GDK_DRAG_REQUEST;
+ tev.dragrequest.drop_coords = coords;
+ tev.dragrequest.requestor = dest;
+ tev.dragrequest.u.allflags = 0;
+ tev.dragrequest.u.flags.protocol_version = DND_PROTOCOL_VERSION;
+ tev.dragrequest.isdrop = 1;
for (i = 0; i < gdk_dnd.drag_numwindows; i++)
{
wp = (GdkWindowPrivate *) gdk_dnd.drag_startwindows[i];
if (wp->dnd_drag_accepted)
{
- tev.window = (GdkWindow *) wp;
- tev.u.flags.delete_data = wp->dnd_drag_destructive_op;
- tev.timestamp = gdk_dnd.last_drop_time;
- tev.data_type =
+ tev.dragrequest.window = (GdkWindow *) wp;
+ tev.dragrequest.u.flags.delete_data = wp->dnd_drag_destructive_op;
+ tev.dragrequest.timestamp = gdk_dnd.last_drop_time;
+ tev.dragrequest.data_type =
gdk_atom_name(wp->dnd_drag_data_type);
- gdk_event_put((GdkEvent *) &tev);
+ gdk_event_put(&tev);
}
}
}
static void gtk_color_selection_opacity_updater (GtkWidget *widget,
gpointer data);
static void gtk_color_selection_realize (GtkWidget *widget);
+static void gtk_color_selection_unrealize (GtkWidget *widget);
static void gtk_color_selection_finalize (GtkObject *object);
static void gtk_color_selection_color_changed (GtkColorSelection *colorsel);
static void gtk_color_selection_update_input (GtkWidget *scale,
object_class->finalize = gtk_color_selection_finalize;
widget_class->realize = gtk_color_selection_realize;
+ widget_class->unrealize = gtk_color_selection_unrealize;
}
static void
colorsel);
}
+static void
+gtk_color_selection_unrealize (GtkWidget *widget)
+{
+ GtkColorSelection *colorsel;
+
+ g_return_if_fail (widget != NULL);
+ g_return_if_fail (GTK_IS_COLOR_SELECTION (widget));
+
+ colorsel = GTK_COLOR_SELECTION (widget);
+
+ if (colorsel->value_gc != NULL)
+ {
+ gdk_gc_unref (colorsel->value_gc);
+ colorsel->value_gc = NULL;
+ }
+ if (colorsel->wheel_gc != NULL)
+ {
+ gdk_gc_unref (colorsel->wheel_gc);
+ colorsel->wheel_gc = NULL;
+ }
+ if (colorsel->sample_gc != NULL)
+ {
+ gdk_gc_unref (colorsel->sample_gc);
+ colorsel->sample_gc = NULL;
+ }
+
+ (* GTK_WIDGET_CLASS (color_selection_parent_class)->unrealize) (widget);
+}
+
static void
gtk_color_selection_finalize (GtkObject *object)
{
#include "gtksignal.h"
#include "gtktable.h"
-#define BOUNDS(a,x,y) (((a) < (x)) ? (x) : (((a) > (y)) ? (y) : (a)))
#define RADIUS 3 /* radius of the control points */
#define MIN_DISTANCE 8 /* min distance between control points */
c->point[i].y = RADIUS + height
- project (vector[i], c->min_y, c->max_y, height);
}
+
+ g_free (vector);
}
static void
/* get the pointer position */
gdk_window_get_pointer (w->window, &tx, &ty, NULL);
- x = BOUNDS ((tx - RADIUS), 0, width);
- y = BOUNDS ((ty - RADIUS), 0, height);
+ x = CLAMP ((tx - RADIUS), 0, width-1);
+ y = CLAMP ((ty - RADIUS), 0, height-1);
min_x = c->min_x;
case GDK_MOTION_NOTIFY:
mevent = (GdkEventMotion *) event;
- if (mevent->is_hint)
- {
- mevent->x = tx;
- mevent->y = ty;
- }
+
switch (c->curve_type)
{
case GTK_CURVE_TYPE_LINEAR:
static gboolean add_remove = FALSE;
add_remove = !add_remove;
+
child = gtk_label_new ("Test");
+ gtk_widget_ref (child);
+ gtk_object_sink (child);
+
if (add_remove)
gtk_container_add (GTK_CONTAINER (clist), child);
else
gtk_container_remove (GTK_CONTAINER (clist), child);
child->parent = NULL;
}
+
gtk_widget_destroy (child);
+ gtk_widget_unref (child);
}
static void
static gboolean add_remove = FALSE;
add_remove = !add_remove;
+
child = gtk_label_new ("Test");
+ gtk_widget_ref (child);
+ gtk_object_sink (child);
+
if (add_remove)
gtk_container_add (GTK_CONTAINER (clist), child);
else
gtk_container_remove (GTK_CONTAINER (clist), child);
child->parent = NULL;
}
+
gtk_widget_destroy (child);
+ gtk_widget_unref (child);
}
static void