From 94d05dfaf8e86a1a434396b8414634d93c5d6963 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Tue, 14 May 2002 20:52:59 +0000 Subject: [PATCH] Set the width of the layout to the actual wrap width (our requisition) not Tue May 14 16:44:09 2002 Owen Taylor * gtk/gtklabel.c (gtk_label_ensure_layout): Set the width of the layout to the actual wrap width (our requisition) not the width we set when calculating the width. This results in the lines being justified within the correct area. (#79157, Anders Carlsson) * gtk/gtkaccelgroup.c gtk/gtkmarshelers.list: Corrected registered parameter types of "accel_activate" and "accel_changed" signals. (Patch from Murray Cumming, #78798) * gtk/gtkrc.c (gtk_rc_make_default_dir): Switch binary-version and type to correspond to the current ordering in _gtk_get_module_path. (#78746, Sergey Kuzminov) * gtk/gtkrc.c (gtk_rc_get_module_dir): Add docs pointing to the GTK_PATH documentation. * gtk/Makefile.am (uninstall-local): Delete key themes as well. (#81286, Kristian Rietveld.) --- ChangeLog | 23 +++++++++++++++++++++++ ChangeLog.pre-2-10 | 23 +++++++++++++++++++++++ ChangeLog.pre-2-2 | 23 +++++++++++++++++++++++ ChangeLog.pre-2-4 | 23 +++++++++++++++++++++++ ChangeLog.pre-2-6 | 23 +++++++++++++++++++++++ ChangeLog.pre-2-8 | 23 +++++++++++++++++++++++ docs/reference/gtk/tmpl/gtkrc.sgml | 4 +--- gtk/Makefile.am | 2 ++ gtk/gtkaccelgroup.c | 8 ++++---- gtk/gtklabel.c | 5 +++-- gtk/gtkmarshalers.list | 4 ++-- gtk/gtkrc.c | 14 ++++++++++++-- 12 files changed, 162 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index c0d4b47f2d..c51edfd46b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +Tue May 14 16:44:09 2002 Owen Taylor + + * gtk/gtklabel.c (gtk_label_ensure_layout): Set + the width of the layout to the actual wrap width + (our requisition) not the width we set when calculating + the width. This results in the lines being justified + within the correct area. (#79157, Anders Carlsson) + + * gtk/gtkaccelgroup.c gtk/gtkmarshelers.list: Corrected + registered parameter types of "accel_activate" and + "accel_changed" signals. (Patch from Murray Cumming, #78798) + + * gtk/gtkrc.c (gtk_rc_make_default_dir): Switch + binary-version and type to correspond to the + current ordering in _gtk_get_module_path. + (#78746, Sergey Kuzminov) + + * gtk/gtkrc.c (gtk_rc_get_module_dir): Add docs + pointing to the GTK_PATH documentation. + + * gtk/Makefile.am (uninstall-local): Delete + key themes as well. (#81286, Kristian Rietveld.) + Tue May 14 15:09:33 2002 Owen Taylor * gdk/x11/gdkkeys-x11.c: Try adding a #ifndef/#define diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index c0d4b47f2d..c51edfd46b 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,26 @@ +Tue May 14 16:44:09 2002 Owen Taylor + + * gtk/gtklabel.c (gtk_label_ensure_layout): Set + the width of the layout to the actual wrap width + (our requisition) not the width we set when calculating + the width. This results in the lines being justified + within the correct area. (#79157, Anders Carlsson) + + * gtk/gtkaccelgroup.c gtk/gtkmarshelers.list: Corrected + registered parameter types of "accel_activate" and + "accel_changed" signals. (Patch from Murray Cumming, #78798) + + * gtk/gtkrc.c (gtk_rc_make_default_dir): Switch + binary-version and type to correspond to the + current ordering in _gtk_get_module_path. + (#78746, Sergey Kuzminov) + + * gtk/gtkrc.c (gtk_rc_get_module_dir): Add docs + pointing to the GTK_PATH documentation. + + * gtk/Makefile.am (uninstall-local): Delete + key themes as well. (#81286, Kristian Rietveld.) + Tue May 14 15:09:33 2002 Owen Taylor * gdk/x11/gdkkeys-x11.c: Try adding a #ifndef/#define diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index c0d4b47f2d..c51edfd46b 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,26 @@ +Tue May 14 16:44:09 2002 Owen Taylor + + * gtk/gtklabel.c (gtk_label_ensure_layout): Set + the width of the layout to the actual wrap width + (our requisition) not the width we set when calculating + the width. This results in the lines being justified + within the correct area. (#79157, Anders Carlsson) + + * gtk/gtkaccelgroup.c gtk/gtkmarshelers.list: Corrected + registered parameter types of "accel_activate" and + "accel_changed" signals. (Patch from Murray Cumming, #78798) + + * gtk/gtkrc.c (gtk_rc_make_default_dir): Switch + binary-version and type to correspond to the + current ordering in _gtk_get_module_path. + (#78746, Sergey Kuzminov) + + * gtk/gtkrc.c (gtk_rc_get_module_dir): Add docs + pointing to the GTK_PATH documentation. + + * gtk/Makefile.am (uninstall-local): Delete + key themes as well. (#81286, Kristian Rietveld.) + Tue May 14 15:09:33 2002 Owen Taylor * gdk/x11/gdkkeys-x11.c: Try adding a #ifndef/#define diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index c0d4b47f2d..c51edfd46b 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,26 @@ +Tue May 14 16:44:09 2002 Owen Taylor + + * gtk/gtklabel.c (gtk_label_ensure_layout): Set + the width of the layout to the actual wrap width + (our requisition) not the width we set when calculating + the width. This results in the lines being justified + within the correct area. (#79157, Anders Carlsson) + + * gtk/gtkaccelgroup.c gtk/gtkmarshelers.list: Corrected + registered parameter types of "accel_activate" and + "accel_changed" signals. (Patch from Murray Cumming, #78798) + + * gtk/gtkrc.c (gtk_rc_make_default_dir): Switch + binary-version and type to correspond to the + current ordering in _gtk_get_module_path. + (#78746, Sergey Kuzminov) + + * gtk/gtkrc.c (gtk_rc_get_module_dir): Add docs + pointing to the GTK_PATH documentation. + + * gtk/Makefile.am (uninstall-local): Delete + key themes as well. (#81286, Kristian Rietveld.) + Tue May 14 15:09:33 2002 Owen Taylor * gdk/x11/gdkkeys-x11.c: Try adding a #ifndef/#define diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index c0d4b47f2d..c51edfd46b 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,26 @@ +Tue May 14 16:44:09 2002 Owen Taylor + + * gtk/gtklabel.c (gtk_label_ensure_layout): Set + the width of the layout to the actual wrap width + (our requisition) not the width we set when calculating + the width. This results in the lines being justified + within the correct area. (#79157, Anders Carlsson) + + * gtk/gtkaccelgroup.c gtk/gtkmarshelers.list: Corrected + registered parameter types of "accel_activate" and + "accel_changed" signals. (Patch from Murray Cumming, #78798) + + * gtk/gtkrc.c (gtk_rc_make_default_dir): Switch + binary-version and type to correspond to the + current ordering in _gtk_get_module_path. + (#78746, Sergey Kuzminov) + + * gtk/gtkrc.c (gtk_rc_get_module_dir): Add docs + pointing to the GTK_PATH documentation. + + * gtk/Makefile.am (uninstall-local): Delete + key themes as well. (#81286, Kristian Rietveld.) + Tue May 14 15:09:33 2002 Owen Taylor * gdk/x11/gdkkeys-x11.c: Try adding a #ifndef/#define diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index c0d4b47f2d..c51edfd46b 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,26 @@ +Tue May 14 16:44:09 2002 Owen Taylor + + * gtk/gtklabel.c (gtk_label_ensure_layout): Set + the width of the layout to the actual wrap width + (our requisition) not the width we set when calculating + the width. This results in the lines being justified + within the correct area. (#79157, Anders Carlsson) + + * gtk/gtkaccelgroup.c gtk/gtkmarshelers.list: Corrected + registered parameter types of "accel_activate" and + "accel_changed" signals. (Patch from Murray Cumming, #78798) + + * gtk/gtkrc.c (gtk_rc_make_default_dir): Switch + binary-version and type to correspond to the + current ordering in _gtk_get_module_path. + (#78746, Sergey Kuzminov) + + * gtk/gtkrc.c (gtk_rc_get_module_dir): Add docs + pointing to the GTK_PATH documentation. + + * gtk/Makefile.am (uninstall-local): Delete + key themes as well. (#81286, Kristian Rietveld.) + Tue May 14 15:09:33 2002 Owen Taylor * gdk/x11/gdkkeys-x11.c: Try adding a #ifndef/#define diff --git a/docs/reference/gtk/tmpl/gtkrc.sgml b/docs/reference/gtk/tmpl/gtkrc.sgml index 843af11205..36b0dbf6d5 100644 --- a/docs/reference/gtk/tmpl/gtkrc.sgml +++ b/docs/reference/gtk/tmpl/gtkrc.sgml @@ -792,11 +792,9 @@ otherwise %NULL. -Returns the directory in which GTK+ will look for -theme engines. -@Returns: The directory. (Must be freed with g_free()) +@Returns: diff --git a/gtk/Makefile.am b/gtk/Makefile.am index 817a7bdacb..da26d76b67 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -573,6 +573,8 @@ install-data-local: install-ms-lib install-libtool-import-lib uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib rm -f $(DESTDIR)$(datadir)/themes/Default/gtk-2.0/gtkrc + rm -f $(DESTDIR)$(datadir)/themes/Default/gtk-2.0-key/gtkrc + rm -f $(DESTDIR)$(datadir)/themes/Emacs/gtk-2.0-key/gtkrc DEPS = $(gtktargetlib) $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la $(top_builddir)/gdk/$(gdktargetlib) diff --git a/gtk/gtkaccelgroup.c b/gtk/gtkaccelgroup.c index 4cf27e5c9b..d6cb323e98 100644 --- a/gtk/gtkaccelgroup.c +++ b/gtk/gtkaccelgroup.c @@ -119,15 +119,15 @@ gtk_accel_group_class_init (GtkAccelGroupClass *class) G_SIGNAL_DETAILED, 0, accel_activate_accumulator, NULL, - _gtk_marshal_BOOLEAN__OBJECT_UINT_UINT, - G_TYPE_BOOLEAN, 3, G_TYPE_OBJECT, G_TYPE_UINT, G_TYPE_UINT); + _gtk_marshal_BOOLEAN__OBJECT_UINT_FLAGS, + G_TYPE_BOOLEAN, 3, G_TYPE_OBJECT, G_TYPE_UINT, GDK_TYPE_MODIFIER_TYPE); signal_accel_changed = g_signal_new ("accel_changed", G_OBJECT_CLASS_TYPE (class), G_SIGNAL_RUN_FIRST | G_SIGNAL_DETAILED, G_STRUCT_OFFSET (GtkAccelGroupClass, accel_changed), NULL, NULL, - _gtk_marshal_VOID__UINT_UINT_BOXED, - G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_CLOSURE); + _gtk_marshal_VOID__UINT_FLAGS_BOXED, + G_TYPE_NONE, 3, G_TYPE_UINT, GDK_TYPE_MODIFIER_TYPE, G_TYPE_CLOSURE); } static void diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index bafd83c75b..203cb0fc97 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -1443,6 +1443,7 @@ gtk_label_ensure_layout (GtkLabel *label) pango_layout_set_width (label->layout, width); pango_layout_get_extents (label->layout, NULL, &logical_rect); + width = logical_rect.width; height = logical_rect.height; /* Unfortunately, the above may leave us with a very unbalanced looking paragraph, @@ -1461,7 +1462,7 @@ gtk_label_ensure_layout (GtkLabel *label) pango_layout_get_extents (label->layout, NULL, &logical_rect); if (logical_rect.height <= height) - width = perfect_width; + width = logical_rect.width; else { gint mid_width = (perfect_width + width) / 2; @@ -1472,7 +1473,7 @@ gtk_label_ensure_layout (GtkLabel *label) pango_layout_get_extents (label->layout, NULL, &logical_rect); if (logical_rect.height <= height) - width = mid_width; + width = logical_rect.width; } } } diff --git a/gtk/gtkmarshalers.list b/gtk/gtkmarshalers.list index d1dd2070f9..b0fa87862d 100644 --- a/gtk/gtkmarshalers.list +++ b/gtk/gtkmarshalers.list @@ -25,7 +25,7 @@ BOOLEAN:BOXED BOOLEAN:BOXED,BOXED BOOLEAN:ENUM BOOLEAN:ENUM,INT -BOOLEAN:OBJECT,UINT,UINT +BOOLEAN:OBJECT,UINT,FLAGS BOOLEAN:OBJECT,INT,INT,UINT BOOLEAN:OBJECT,STRING,STRING,BOXED BOOLEAN:OBJECT,BOXED,BOXED @@ -81,8 +81,8 @@ VOID:POINTER,UINT VOID:STRING VOID:STRING,STRING VOID:STRING,INT,POINTER +VOID:UINT,FLAGS,BOXED VOID:UINT,UINT -VOID:UINT,UINT,BOXED VOID:UINT,STRING VOID:UINT,BOXED,UINT,FLAGS,FLAGS VOID:UINT,OBJECT,UINT,FLAGS,FLAGS diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c index 8c479b496f..a8b424b0ce 100644 --- a/gtk/gtkrc.c +++ b/gtk/gtkrc.c @@ -299,9 +299,9 @@ gtk_rc_make_default_dir (const gchar *type) var = g_getenv ("GTK_EXE_PREFIX"); if (var) - path = g_build_filename (var, "lib", "gtk-2.0", type, GTK_BINARY_VERSION, NULL); + path = g_build_filename (var, "lib", "gtk-2.0", GTK_BINARY_VERSION, type, NULL); else - path = g_build_filename (GTK_LIBDIR, "gtk-2.0", type, GTK_BINARY_VERSION, NULL); + path = g_build_filename (GTK_LIBDIR, "gtk-2.0", GTK_BINARY_VERSION, type, NULL); return path; } @@ -367,6 +367,16 @@ gtk_rc_get_theme_dir (void) return path; } +/** + * gtk_rc_get_module_dir: + * + * Returns a directory in which GTK+ looks for theme engines. + * For full information about the search for theme engines, + * see the docs for GTK_PATH in + * . + * + * return value: the directory. (Must be freed with g_free()) + **/ gchar * gtk_rc_get_module_dir (void) {