GNOME Bugzilla – Bug 597029
Improve StThemeNode allocation convenience functions
Last modified: 2011-02-08 18:42:33 UTC
/* Helpers for get_preferred_width()/get_preferred_height() ClutterActor vfuncs */ void st_theme_node_adjust_for_height (StThemeNode *node, float *for_height); void st_theme_node_adjust_preferred_width (StThemeNode *node, float *min_width_p, float *natural_width_p); void st_theme_node_adjust_for_width (StThemeNode *node, float *for_width); void st_theme_node_adjust_preferred_height (StThemeNode *node, float *min_height_p, float *natural_height_p); Do not result in very readable code: st_theme_node_adjust_for_height (theme_node, &for_height); Does that adjust the theme node for a height? or? is pretty opaque in what it does. Various suggestions in bug 595993. I think my favorite idea at this point is: float st_theme_node_get_content_height (StThemeNode *node, float total_height); void st_theme_node_get_preferred_width (StThemeNode *node, float content_min_width, float content_natural_width, float *min_width_p, float *natural_width_p); float st_theme_node_get_content_width (StThemeNode *node, float total_width); void st_theme_node_get_preferred_height (StThemeNode *node, float content_min_height, float content_natural_height, float *min_width_p, float *natural_width_p); Though to really get the readability increase from that, you need to add extra locals content_height, content_min_width, content_natural_width, so it's bit of typing to fix everything up.
we have managed to survive more than a year with these names, so I guess they weren't that bad after all