return Pango::FontDescription (pfd); /* make a copy */
}
-uint32_t
-ARDOUR_UI_UTILS::rgba_from_style (string style, uint32_t r, uint32_t g, uint32_t b, uint32_t a, string attr, int state, bool rgba)
-{
- /* In GTK+2, styles aren't set up correctly if the widget is not
- attached to a toplevel window that has a screen pointer.
- */
-
- static Gtk::Window* window = 0;
-
- if (window == 0) {
- window = new Window (WINDOW_TOPLEVEL);
- }
-
- Gtk::Label foo;
-
- window->add (foo);
-
- foo.set_name (style);
- foo.ensure_style ();
-
- GtkRcStyle* rc = foo.get_style()->gobj()->rc_style;
-
- if (rc) {
- if (attr == "fg") {
- r = rc->fg[state].red / 257;
- g = rc->fg[state].green / 257;
- b = rc->fg[state].blue / 257;
-
- /* what a hack ... "a" is for "active" */
- if (state == Gtk::STATE_NORMAL && rgba) {
- a = rc->fg[GTK_STATE_ACTIVE].red / 257;
- }
- } else if (attr == "bg") {
- r = g = b = 0;
- r = rc->bg[state].red / 257;
- g = rc->bg[state].green / 257;
- b = rc->bg[state].blue / 257;
- } else if (attr == "base") {
- r = rc->base[state].red / 257;
- g = rc->base[state].green / 257;
- b = rc->base[state].blue / 257;
- } else if (attr == "text") {
- r = rc->text[state].red / 257;
- g = rc->text[state].green / 257;
- b = rc->text[state].blue / 257;
- }
- } else {
- warning << string_compose (_("missing RGBA style for \"%1\""), style) << endl;
- }
-
- window->remove ();
-
- if (state == Gtk::STATE_NORMAL && rgba) {
- return (uint32_t) RGBA_TO_UINT(r,g,b,a);
- } else {
- return (uint32_t) RGBA_TO_UINT(r,g,b,255);
- }
-}
-
-bool
-ARDOUR_UI_UTILS::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;
-}
-
void
ARDOUR_UI_UTILS::set_color_from_rgb (Gdk::Color& c, uint32_t rgb)
{
#endif
- DEBUG_TRACE (DEBUG::Accelerators, string_compose ("Win = %1 focus = %7 Key event: code = %2 state = %3 special handling ? %4 magic widget focus ? %5 allow_activation ? %6\n",
+ DEBUG_TRACE (DEBUG::Accelerators, string_compose ("Win = %1 focus = %7 (%8) Key event: code = %2 state = %3 special handling ? %4 magic widget focus ? %5 allow_activation ? %6\n",
win,
ev->keyval,
ev->state,
special_handling_of_unmodified_accelerators,
Keyboard::some_magic_widget_has_focus(),
allow_activating,
- focus));
+ focus,
+ (focus ? gtk_widget_get_name (focus) : "no focus widget")));
/* This exists to allow us to override the way GTK handles
key events. The normal sequence is:
spath.add_subdirectory_to_paths ("icons");
spath.add_subdirectory_to_paths (icon_set);
+ find_file (spath, name, data_file_path);
+ } else {
+ spath.add_subdirectory_to_paths ("icons");
find_file (spath, name, data_file_path);
}
if (!find_file (def, name, data_file_path)) {
fatal << string_compose (_("cannot find icon image for %1 using %2"), name, spath.to_string()) << endmsg;
- /*NOTREACHED*/
+ abort(); /*NOTREACHED*/
}
}