StThemeNode: use (out caller-allocates) on ClutterColor-returning methods

Properly annotate the themenode methods that return ClutterColors, and
update their JS callers to take advantage of that.

https://bugzilla.gnome.org/show_bug.cgi?id=642295
This commit is contained in:
Dan Winship
2011-02-14 09:20:22 -05:00
parent 688b9697c8
commit 1224e959b6
5 changed files with 45 additions and 25 deletions

View File

@ -89,8 +89,7 @@ URLHighlighter.prototype = {
this.actor = new St.Label({ reactive: true, style_class: 'url-highlighter' });
this._linkColor = '#ccccff';
this.actor.connect('style-changed', Lang.bind(this, function() {
let color = new Clutter.Color();
let hasColor = this.actor.get_theme_node().get_color('link-color', color);
let [hasColor, color] = this.actor.get_theme_node().lookup_color('link-color', false);
if (hasColor) {
let linkColor = color.to_string().substr(0, 7);
if (linkColor != this._linkColor) {