Added GTK_DEBUG_EXTENDED_LAYOUT flag and use that for debuggin in gtkextendedlayout.c

This commit is contained in:
Tristan Van Berkom 2010-04-18 20:14:13 -04:00
parent 6dc5cdb981
commit e997ac37a7
3 changed files with 24 additions and 39 deletions

View File

@ -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

View File

@ -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)

View File

@ -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 */