From 1b656e0ddef81edfaf95aa766716d9e6179abb46 Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Mon, 23 Feb 1998 11:14:27 +0000 Subject: [PATCH] TODO updates (major ones ;). have the send_event field in all GdkEvents. gtkmenu.c, gtkacceleratortable.c, gtkwindow.c: unreference accelerator_table. gtk_object_query_args: removed seq_ids again, must have been quite tired when i commited that change ;) gtkoptionmenu.c: assure GTK_BIN()->child is empty when reparenting a menu_items child. gtkwindow.c: fixed some memory leaks. -timj --- NEWS | 1 + TODO | 162 +++++++++++++++++++++++-------------------- gdk/gdktypes.h | 19 +++++ gtk/gtkmenu.c | 11 +-- gtk/gtkmenufactory.c | 5 +- gtk/gtkobject.c | 7 -- gtk/gtkobject.h | 1 - gtk/gtkoptionmenu.c | 3 + gtk/gtkwindow.c | 30 ++++++-- 9 files changed, 138 insertions(+), 101 deletions(-) diff --git a/NEWS b/NEWS index 16db9dfb19..7d15299af7 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ Forthcoming Changes for GTK+ 0.99.4: * Reference counting revolution integrated. Refer to docs/refcounting.txt on this issue. +* Implementation of a decent debugging system, see docs/debugging.txt. * Additions on the signal code for querying information about certain signals, and pending handlers of signals. * Support for user signals, and major changes to internal signal handler diff --git a/TODO b/TODO index 8301b5e0af..8b909df174 100644 --- a/TODO +++ b/TODO @@ -1,95 +1,105 @@ - TODO BEFORE GTK 1.0 ------------------- -BUGS ----- - * Fix focus activation of list items. Does list item activation have to be - completely reorganized? - - * Lists should scroll to center the recently selected item if it isn't - visible. - - * Notebook: there are a few cosmetic problems left - +Bugs: * Vertical scrollbar: the expose event looks hosed and is causing quite a bit of flickering + * signal parameters don't seem to get refreshed on recursive invokations + of GTK_NO_RECURSE signals, which causes the restarted emissions to loose + their actual point, i.e. parameter changes on the restarted emission, + needs further investigation. + + * the GtkText widget needs to be fixed, that means no segfaults, full editing + facilities, omit the background pixmap for now. + + * Widget redrawing when the window resizes sometimes messes up. + GtkWindows allow_shrink is buggy since we let all kinds of configure events + pass from Gdk to Gtk. + GtkLabels sometimes redraw without clearing up the underlying background on + window resizes. + + * delay dnd settings to take effect once a widget is realized, this is + to avoid force realizations. i think this goes along with owens dnd + changes? + -timj + The way DND data types are set in GtkWidget really needs to be fixed. + This is pretty high on my priority list, and I'll get to it as soon as + the column list widget is done. The correct way dnd data needs to be set + is to have a additional keyed data type with GtkWidget, which is applied to + the widget's window upon realize. + There also needs to be a way to set dnd-data on widget windows which are + not the main window (for widgets that create more than one window). + -Jay Painter + DnD seems to work for me, but yes, there needs to be some sort of + gtk_widget layer that makes it easier... Also, adding support for drop + zones might be nice. + -Elliot + This one is reproducabel for me: + testgtk --sync + popup colorselection + drag/drop works + start up preview color + drag works but not dropping + end preview color + drag/drop works + start up prewiev color + segfault in malloc + -timj + +Additions: + * Lists should scroll to center the recently selected item if it isn't + visible. + + * enforce invariants on *_RESIZE* and *_REDRAW* flags. + + * asure that child widgets are really get gtk_widget_destroy()ed in their + parents destroy handler, and not just unparented or somesuch. + + * GtkToolTips: + allocate GtkTooltipsData from memchunks + look into incorporation of old/gtk-dairiki-971208-[01].patch.gz + + * Make widget attributes configurable after the widget is created (timj). + + * Implementation of owens widget style proposal. + + * Are there still some GtkCList changes outstanding? (Jay Painter) + GtkCList is derived from GtkContainer but doesn't implement the + need_resize, focus, add and remove methods from containers. + it should at least issue a warning upon invokation of not supported + member functions. + + * GtkTree and GtkList should express in their *_add implementations, + that they expect GtkListItems/GtkTreeItems as children. Similar + things might apply to other containers. + + +TODO AFTER GTK 1.0 +------------------ + + * Make all widget attributes configurable after the widget is created (timj). + * Make sure a widget added to a list is a list item and a widget added to a menu is a menu item, etc. GTK_BASIC was a first attempt at this, but it fails with subsequent container_add()s. maybe have another GTK_PARENT_BASIC (similar to GTK_PARENT_SENSITIVE) flag, to prevent tree iterations upon every container addition. - - * GtkMenu needs to properly unref() accelerator tables upon destroy. - * Using gtk_container_add() on an option menu to add a label works, but then - gtk_option_menu_button_press() segfaults. This is supposed to fail while - adding due to a g_return_if_fail (GTK_IS_MENU_ITEM (child)); - - * enforce invariants on *_RESIZE* and *_REDRAW* flags. - - - -NEW FEATURES ------------- * gdk_expose_compress: ala-Xt, this would really help for opaque moves and such -WIDGETS -------- - * Column-list (Jay Painter) - * Text widget (needs to be finished) * Entry should have a password mode (and it should show stars - for user feedback) + for user feedback). -DND ---- - It seems to be having problems again. The way DND data types are set in - GtkWidget really needs to be fixed. This is pretty high on my priority - list, and I'll get to it as soon as the column list widget is done. The - correct way dnd data needs to be set is to have a additional keyed data - type with GtkWidget, which is applied to the widget's window upon realize. - There also needs to be a way to set dnd-data on widget windows which are - not the main window (for widgets that create more than one window). - -Jay Painter - DnD seems to work for me, but yes, there needs to be some sort of - gtk_widget layer that makes it easier... Also, adding support for drop - zones might be nice. - -- Elliot - This one is reproducabel for me: - testgtk --sync - popup colorselection - drag/drop works - start up preview color - drag works but not dropping - end preview color - drag/drop works - start up prewiev color - segfault in malloc - -timj + * More dialogs? Print, GtkFontSelector, maybe others... -OTHER ------ - * Documentation + * Multiple document interface (MDI)? - -PLANNED FOR GTK AFTER 1.0 -------------------------- -(add your thoughts here) - -============================================================================ -Other stuff todo, as of yet not categorized into the above: - --Widget redrawing when the window resizes sometimes messes up. - --More dialogs? Print, font, etc? - --Multiple document interface (MDI)? - --Support another widget style? Should be possible using GtkStyle's, but - there may be some work needed to remove any style dependencies in widget - code. Maybe GtkStyle's should have 'draw_push_button', 'draw_check_button', - etc, functions to draw the various widgets. - --Make all widget attributes configurable after the widget is created. + * Support another widget style? Should be possible using GtkStyle's, but + there may be some work needed to remove any style dependencies in widget + code. Maybe GtkStyle's should have 'draw_push_button', 'draw_check_button', + etc, functions to draw the various widgets. + This will be covered by upcoming themability, raster is working on it. + + * More work on Documentation diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h index e864dd5966..4ea12a4590 100644 --- a/gdk/gdktypes.h +++ b/gdk/gdktypes.h @@ -869,6 +869,7 @@ struct _GdkEventExpose { GdkEventType type; GdkWindow *window; + gint8 send_event; GdkRectangle area; gint count; /* If non-zero, how many more events follow. */ }; @@ -877,6 +878,7 @@ struct _GdkEventNoExpose { GdkEventType type; GdkWindow *window; + gint8 send_event; /* XXX: does anyone need the X major_code or minor_code fields? */ }; @@ -884,6 +886,7 @@ struct _GdkEventVisibility { GdkEventType type; GdkWindow *window; + gint8 send_event; GdkVisibilityState state; }; @@ -891,6 +894,7 @@ struct _GdkEventMotion { GdkEventType type; GdkWindow *window; + gint8 send_event; guint32 time; gdouble x; gdouble y; @@ -908,6 +912,7 @@ struct _GdkEventButton { GdkEventType type; GdkWindow *window; + gint8 send_event; guint32 time; gdouble x; gdouble y; @@ -925,6 +930,7 @@ struct _GdkEventKey { GdkEventType type; GdkWindow *window; + gint8 send_event; guint32 time; guint state; guint keyval; @@ -936,6 +942,7 @@ struct _GdkEventCrossing { GdkEventType type; GdkWindow *window; + gint8 send_event; GdkWindow *subwindow; GdkNotifyType detail; }; @@ -944,6 +951,7 @@ struct _GdkEventFocus { GdkEventType type; GdkWindow *window; + gint8 send_event; gint16 in; }; @@ -951,6 +959,7 @@ struct _GdkEventConfigure { GdkEventType type; GdkWindow *window; + gint8 send_event; gint16 x, y; gint16 width; gint16 height; @@ -960,6 +969,7 @@ struct _GdkEventProperty { GdkEventType type; GdkWindow *window; + gint8 send_event; GdkAtom atom; guint32 time; guint state; @@ -969,6 +979,7 @@ struct _GdkEventSelection { GdkEventType type; GdkWindow *window; + gint8 send_event; GdkAtom selection; GdkAtom target; GdkAtom property; @@ -983,6 +994,7 @@ struct _GdkEventProximity { GdkEventType type; GdkWindow *window; + gint8 send_event; guint32 time; GdkInputSource source; guint32 deviceid; @@ -992,6 +1004,7 @@ struct _GdkEventDragRequest { GdkEventType type; GdkWindow *window; + gint8 send_event; guint32 requestor; union { struct { @@ -1017,6 +1030,7 @@ struct _GdkEventDragBegin { GdkEventType type; GdkWindow *window; + gint8 send_event; union { struct { guint protocol_version:4; @@ -1030,6 +1044,7 @@ struct _GdkEventDropEnter { GdkEventType type; GdkWindow *window; + gint8 send_event; guint32 requestor; union { struct { @@ -1046,6 +1061,7 @@ struct _GdkEventDropLeave { GdkEventType type; GdkWindow *window; + gint8 send_event; guint32 requestor; union { struct { @@ -1060,6 +1076,7 @@ struct _GdkEventDropDataAvailable { GdkEventType type; GdkWindow *window; + gint8 send_event; guint32 requestor; union { struct { @@ -1078,6 +1095,7 @@ struct _GdkEventClient { GdkEventType type; GdkWindow *window; + gint8 send_event; GdkAtom message_type; gushort data_format; union { @@ -1091,6 +1109,7 @@ struct _GdkEventOther { GdkEventType type; GdkWindow *window; + gint8 send_event; GdkXEvent *xevent; }; diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index 1db8b2d4e4..2f1f7c347c 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -135,11 +135,6 @@ gtk_menu_init (GtkMenu *menu) menu->position_func_data = NULL; GTK_MENU_SHELL (menu)->menu_flag = TRUE; - - /* we don't need to register as toplevel anymore, - * since there is the attach/detach functionality in place. - * gtk_container_register_toplevel (GTK_CONTAINER (menu)); - */ } static void @@ -156,9 +151,7 @@ gtk_menu_destroy (GtkObject *object) if (data) gtk_menu_detach (GTK_MENU (object)); - /* we don't need this: - * gtk_container_unregister_toplevel (GTK_CONTAINER (object)); - */ + gtk_menu_set_accelerator_table (GTK_MENU (object), NULL); if (GTK_OBJECT_CLASS (parent_class)->destroy) (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); @@ -191,7 +184,7 @@ gtk_menu_attach_to_widget (GtkMenu *menu, return; } - gtk_widget_ref (menu); + gtk_widget_ref (GTK_WIDGET (menu)); gtk_object_sink (GTK_OBJECT (menu)); data = g_new (GtkMenuAttachData, 1); diff --git a/gtk/gtkmenufactory.c b/gtk/gtkmenufactory.c index 02c748c84e..7e0f5b7a38 100644 --- a/gtk/gtkmenufactory.c +++ b/gtk/gtkmenufactory.c @@ -87,7 +87,10 @@ gtk_menu_factory_destroy (GtkMenuFactory *factory) } if (factory->table) - gtk_accelerator_table_unref (factory->table); + { + gtk_accelerator_table_unref (factory->table); + factory->table = NULL; + } if (factory->widget) gtk_widget_unref (factory->widget); diff --git a/gtk/gtkobject.c b/gtk/gtkobject.c index b854634c89..3699f10dc1 100644 --- a/gtk/gtkobject.c +++ b/gtk/gtkobject.c @@ -713,7 +713,6 @@ gtk_query_arg_foreach (gpointer key, GtkArg* gtk_object_query_args (GtkType class_type, guint32 **arg_flags, - guint **seq_ids, guint *nargs) { GtkArg *args; @@ -721,8 +720,6 @@ gtk_object_query_args (GtkType class_type, if (arg_flags) *arg_flags = NULL; - if (seq_ids) - *seq_ids = NULL; g_return_val_if_fail (nargs != NULL, NULL); *nargs = 0; g_return_val_if_fail (gtk_type_is_a (class_type, gtk_object_get_type ()), NULL); @@ -757,8 +754,6 @@ gtk_object_query_args (GtkType class_type, *nargs = len; if (arg_flags) *arg_flags = g_new (guint32, len); - if (seq_ids) - *seq_ids = g_new (guint, len); do { @@ -773,8 +768,6 @@ gtk_object_query_args (GtkType class_type, args[info->seq_id - 1].name = info->name; if (arg_flags) (*arg_flags)[info->seq_id - 1] = info->arg_flags; - if (seq_ids) - (*seq_ids)[info->seq_id - 1] = info->seq_id; } while (list); diff --git a/gtk/gtkobject.h b/gtk/gtkobject.h index e6f83329f3..e7ac103849 100644 --- a/gtk/gtkobject.h +++ b/gtk/gtkobject.h @@ -255,7 +255,6 @@ void gtk_object_setv (GtkObject *object, */ GtkArg* gtk_object_query_args (GtkType class_type, guint32 **arg_flags, - guint **seq_ids, guint *nargs); void gtk_object_add_arg_type (const gchar *arg_name, diff --git a/gtk/gtkoptionmenu.c b/gtk/gtkoptionmenu.c index 93d3236e2c..ad59e8faf7 100644 --- a/gtk/gtkoptionmenu.c +++ b/gtk/gtkoptionmenu.c @@ -459,6 +459,9 @@ gtk_option_menu_update_contents (GtkOptionMenu *option_menu) if (child) { gtk_container_block_resize (GTK_CONTAINER (option_menu)); + if (GTK_BUTTON (option_menu)->child) + gtk_container_remove (GTK_CONTAINER (option_menu), + GTK_BUTTON (option_menu)->child); if (GTK_WIDGET (option_menu)->state != child->state) gtk_widget_set_state (child, GTK_WIDGET (option_menu)->state); gtk_widget_reparent (child, GTK_WIDGET (option_menu)); diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 016e76a95a..7c2b3534a9 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -327,12 +327,10 @@ gtk_window_set_wmclass (GtkWindow *window, g_return_if_fail (window != NULL); g_return_if_fail (GTK_IS_WINDOW (window)); - if (window->wmclass_name) - g_free (window->wmclass_name); + g_free (window->wmclass_name); window->wmclass_name = g_strdup (wmclass_name); - if (window->wmclass_class) - g_free (window->wmclass_class); + g_free (window->wmclass_class); window->wmclass_class = g_strdup (wmclass_class); if (GTK_WIDGET_REALIZED (window)) @@ -402,12 +400,21 @@ void gtk_window_remove_accelerator_table (GtkWindow *window, GtkAcceleratorTable *table) { + GList *list; + g_return_if_fail (window != NULL); g_return_if_fail (GTK_IS_WINDOW (window)); - window->accelerator_tables = g_list_remove (window->accelerator_tables, - table); - gtk_accelerator_table_unref (table); + for (list = window->accelerator_tables; list; list = list->next) + { + if (list->data == table) + { + gtk_accelerator_table_unref (table); + window->accelerator_tables = g_list_remove_link (window->accelerator_tables, list); + g_list_free_1 (list); + break; + } + } } void @@ -486,11 +493,18 @@ gtk_window_marshal_signal_2 (GtkObject *object, static void gtk_window_destroy (GtkObject *object) { + GList *list; + g_return_if_fail (object != NULL); g_return_if_fail (GTK_IS_WINDOW (object)); gtk_container_unregister_toplevel (GTK_CONTAINER (object)); + for (list = GTK_WINDOW (object)->accelerator_tables; list; list = list->next) + gtk_accelerator_table_unref (list->data); + g_list_free (GTK_WINDOW (object)->accelerator_tables); + GTK_WINDOW (object)->accelerator_tables = NULL; + if (GTK_OBJECT_CLASS (parent_class)->destroy) (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } @@ -505,6 +519,8 @@ gtk_window_finalize (GtkObject *object) window = GTK_WINDOW (object); g_free (window->title); + g_free (window->wmclass_name); + g_free (window->wmclass_class); GTK_OBJECT_CLASS(parent_class)->finalize (object); }