After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 597029 - Improve StThemeNode allocation convenience functions
Improve StThemeNode allocation convenience functions
Status: RESOLVED WONTFIX
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2009-10-01 18:28 UTC by Owen Taylor
Modified: 2011-02-08 18:42 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Owen Taylor 2009-10-01 18:28:09 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.
Comment 1 Dan Winship 2011-02-08 18:42:33 UTC
we have managed to survive more than a year with these names, so I guess they weren't that bad after all