diff --git a/gtk/gtkdebug.h b/gtk/gtkdebug.h index 2190973239..3798bc4ad9 100644 --- a/gtk/gtkdebug.h +++ b/gtk/gtkdebug.h @@ -36,18 +36,19 @@ G_BEGIN_DECLS typedef enum { - GTK_DEBUG_MISC = 1 << 0, - GTK_DEBUG_PLUGSOCKET = 1 << 1, - GTK_DEBUG_TEXT = 1 << 2, - GTK_DEBUG_TREE = 1 << 3, - GTK_DEBUG_UPDATES = 1 << 4, - GTK_DEBUG_KEYBINDINGS = 1 << 5, - GTK_DEBUG_MULTIHEAD = 1 << 6, - GTK_DEBUG_MODULES = 1 << 7, - GTK_DEBUG_GEOMETRY = 1 << 8, - GTK_DEBUG_ICONTHEME = 1 << 9, - GTK_DEBUG_PRINTING = 1 << 10, - GTK_DEBUG_BUILDER = 1 << 11 + GTK_DEBUG_MISC = 1 << 0, + GTK_DEBUG_PLUGSOCKET = 1 << 1, + GTK_DEBUG_TEXT = 1 << 2, + GTK_DEBUG_TREE = 1 << 3, + GTK_DEBUG_UPDATES = 1 << 4, + GTK_DEBUG_KEYBINDINGS = 1 << 5, + GTK_DEBUG_MULTIHEAD = 1 << 6, + GTK_DEBUG_MODULES = 1 << 7, + GTK_DEBUG_GEOMETRY = 1 << 8, + GTK_DEBUG_ICONTHEME = 1 << 9, + GTK_DEBUG_PRINTING = 1 << 10, + GTK_DEBUG_BUILDER = 1 << 11, + GTK_DEBUG_EXTENDED_LAYOUT = 1 << 12, } GtkDebugFlag; #ifdef G_ENABLE_DEBUG diff --git a/gtk/gtkextendedlayout.c b/gtk/gtkextendedlayout.c index 96e071b07d..92a1c640cf 100644 --- a/gtk/gtkextendedlayout.c +++ b/gtk/gtkextendedlayout.c @@ -28,9 +28,6 @@ #include "gtkintl.h" #include "gtkalias.h" - -#define DEBUG_EXTENDED_LAYOUT 0 - /* With extended layout, a widget may be requested * its width for 2 or maximum 3 heights in one resize */ @@ -251,16 +248,15 @@ compute_size_for_orientation (GtkExtendedLayout *layout, g_assert (cached_size->minimum_size <= cached_size->natural_size); -#if DEBUG_EXTENDED_LAYOUT - g_print ("[%p] %s\t%s: %d is minimum %d and natural: %d (hit cache: %s)\n", - layout, G_OBJECT_TYPE_NAME (layout), - orientation == GTK_SIZE_GROUP_HORIZONTAL ? - "width for height" : "height for width" , - for_size, - cached_size->minimum_size, - cached_size->natural_size, - found_in_cache ? "yes" : "no"); -#endif + GTK_NOTE (EXTENDED_LAYOUT, + g_print ("[%p] %s\t%s: %d is minimum %d and natural: %d (hit cache: %s)\n", + layout, G_OBJECT_TYPE_NAME (layout), + orientation == GTK_SIZE_GROUP_HORIZONTAL ? + "width for height" : "height for width" , + for_size, + cached_size->minimum_size, + cached_size->natural_size, + found_in_cache ? "yes" : "no")); } @@ -402,24 +398,11 @@ gtk_extended_layout_get_desired_size (GtkExtendedLayout *layout, { gtk_extended_layout_get_desired_width (layout, &min_width, &nat_width); gtk_extended_layout_get_height_for_width (layout, min_width, &min_height, &nat_height); - -#if DEBUG_EXTENDED_LAYOUT - g_message ("%s get_desired_size min height: %d for natural width: %d", - G_OBJECT_TYPE_NAME (layout), - min_height, nat_width); -#endif - } else { gtk_extended_layout_get_desired_height (layout, &min_height, &nat_height); gtk_extended_layout_get_width_for_height (layout, min_height, &min_width, &nat_width); - -#if DEBUG_EXTENDED_LAYOUT - g_message ("%s get_desired_size min width: %d for natural height: %d", - G_OBJECT_TYPE_NAME (layout), - min_width, nat_height); -#endif } if (minimum_size) diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index 641e19b422..dc34e9e4a2 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -235,7 +235,8 @@ static const GDebugKey gtk_debug_keys[] = { {"geometry", GTK_DEBUG_GEOMETRY}, {"icontheme", GTK_DEBUG_ICONTHEME}, {"printing", GTK_DEBUG_PRINTING}, - {"builder", GTK_DEBUG_BUILDER} + {"builder", GTK_DEBUG_BUILDER}, + {"extended-layout", GTK_DEBUG_EXTENDED_LAYOUT}, }; #endif /* G_ENABLE_DEBUG */