mouse zoom focus; mouse scrubbing becomes mouse shuttling; use nframes64_t more; add mouse_frame() method to get mouse position & whether its in one of the two canvases; add color_from_style() utility function (though its not used)

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2595 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2007-11-05 21:35:47 +00:00
parent d3755ba3b3
commit a80aaeba79
11 changed files with 205 additions and 184 deletions

View file

@ -22,6 +22,7 @@
#include <fstream>
#include <sys/stat.h>
#include <libart_lgpl/art_misc.h>
#include <gtkmm/rc.h>
#include <gtkmm/window.h>
#include <gtkmm/combo.h>
#include <gtkmm/label.h>
@ -322,6 +323,61 @@ rgba_from_style (string style, uint32_t r, uint32_t g, uint32_t b, uint32_t a, s
}
}
Gdk::Color
color_from_style (string widget_style_name, int state, string attr)
{
GtkStyle* style;
style = gtk_rc_get_style_by_paths (gtk_settings_get_default(),
widget_style_name.c_str(),
0, G_TYPE_NONE);
if (!style) {
error << string_compose (_("no style found for %1, using red"), style) << endmsg;
return Gdk::Color ("red");
}
cerr << "got style for " << widget_style_name << endl;
if (attr == "fg") {
return Gdk::Color (&style->fg[state]);
}
if (attr == "bg") {
cerr << "returning color from bg\n";
return Gdk::Color (&style->bg[state]);
}
if (attr == "light") {
return Gdk::Color (&style->light[state]);
}
if (attr == "dark") {
return Gdk::Color (&style->dark[state]);
}
if (attr == "mid") {
return Gdk::Color (&style->mid[state]);
}
if (attr == "text") {
return Gdk::Color (&style->text[state]);
}
if (attr == "base") {
return Gdk::Color (&style->base[state]);
}
if (attr == "text_aa") {
return Gdk::Color (&style->text_aa[state]);
}
error << string_compose (_("unknown style attribute %1 requested for color; using \"red\""), attr) << endmsg;
return Gdk::Color ("red");
}
bool
canvas_item_visible (ArdourCanvas::Item* item)
{