diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-08-05 14:22:32 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-08-05 14:22:32 -0400 |
commit | 616f2a0370a10dcc7372a95f6bca9f5a45698980 (patch) | |
tree | b07badccad237cc66d0668482ad65cedefdee23f /gtk2_ardour/utils.cc | |
parent | 499b7fcfa9f3e8535a4500143a9d7af7b67c6984 (diff) | |
parent | 38e4f7bd1ba2ec9ae37dbb384da449f894cd8564 (diff) |
fix conflicts after merge with master
Diffstat (limited to 'gtk2_ardour/utils.cc')
-rw-r--r-- | gtk2_ardour/utils.cc | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index 6c2330414d..8b05eb7108 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -302,6 +302,53 @@ rgba_from_style (string style, uint32_t r, uint32_t g, uint32_t b, uint32_t a, s } bool +rgba_p_from_style (string style, float *r, float *g, float *b, string attr, int state) +{ + static Gtk::Window* window = 0; + assert (r && g && b); + + if (window == 0) { + window = new Window (WINDOW_TOPLEVEL); + } + + Gtk::EventBox foo; + + window->add (foo); + + foo.set_name (style); + foo.ensure_style (); + + GtkRcStyle* rc = foo.get_style()->gobj()->rc_style; + + if (!rc) { + warning << string_compose (_("missing RGBA style for \"%1\""), style) << endl; + return false; + } + if (attr == "fg") { + *r = rc->fg[state].red / 65535.0; + *g = rc->fg[state].green / 65535.0; + *b = rc->fg[state].blue / 65535.0; + } else if (attr == "bg") { + *r = rc->bg[state].red / 65535.0; + *g = rc->bg[state].green / 65535.0; + *b = rc->bg[state].blue / 65535.0; + } else if (attr == "base") { + *r = rc->base[state].red / 65535.0; + *g = rc->base[state].green / 65535.0; + *b = rc->base[state].blue / 65535.0; + } else if (attr == "text") { + *r = rc->text[state].red / 65535.0; + *g = rc->text[state].green / 65535.0; + *b = rc->text[state].blue / 65535.0; + } else { + return false; + } + + window->remove (); + return true; +} + +bool canvas_item_visible (ArdourCanvas::Item* item) { return (item->gobj()->object.flags & GNOME_CANVAS_ITEM_VISIBLE) ? true : false; |