moved gain rail and sliders to files. The previously unused 'from_files' portion of Pix::generate () had to ported to gtk2 as well.

git-svn-id: svn://localhost/trunk/ardour2@389 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Doug McLain 2006-03-14 05:44:35 +00:00
parent af70789773
commit 191f323957
5 changed files with 14 additions and 58 deletions

View file

@ -63,47 +63,3 @@ static const gchar speaker_cursor_mask_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0x3f, 0xff,
0xff, 0xff, 0xff, 0xff, 0x00, 0xfc, 0x00, 0xfc, 0x00, 0xf0, 0x00, 0xf0,
0x00, 0xc0, 0x00, 0xc0 };
/* XPM */
static const gchar * right_arrow_xpm[] = {
"12 15 3 1",
" c None",
". c #000000",
"+ c #FFFFFF",
" .+.. ",
" .++.. ",
" .+++.. ",
" ..+++.. ",
" ..+++.. ",
" ..+++.. ",
" ..+++.. ",
" ..+++. ",
" ..+++.. ",
" ..+++.. ",
" ..+++.. ",
" ..+++.. ",
" .+++.. ",
" .++.. ",
" .+.. "};
/* XPM */
static const gchar * left_arrow_xpm[] = {
"12 15 3 1",
" c None",
". c #000000",
"+ c #FFFFFF",
" ..+. ",
" ..++. ",
" ..+++. ",
" ..+++.. ",
" ..+++.. ",
" ..+++.. ",
" ..+++.. ",
" .+++.. ",
" ..+++.. ",
" ..+++.. ",
" ..+++.. ",
" ..+++.. ",
" ..+++. ",
" ..++. ",
" ..+. "};

View file

@ -62,12 +62,7 @@ map<string,Glib::RefPtr<Gdk::Pixmap> > GainMeter::metric_pixmaps;
int
GainMeter::setup_slider_pix ()
{
vector<const char **> xpms;
xpms.push_back (vslider_rail_xpm);
xpms.push_back (vslider_slider_xpm);
if ((slider_pix = get_pix ("sliders", xpms, false)) == 0) {
if ((slider_pix = get_pix (ARDOUR::find_data_file("pixmaps"), "vslider02", false)) == 0) {
error << _("Cannot create slider pixmaps") << endmsg;
return -1;
}

View file

@ -1,5 +1,5 @@
/* XPM */
static const char * vslider_rail_xpm[] = {
static char * vslider_rail_xpm[] = {
"3 200 4 1",
" c None",
". c #000000",

View file

@ -1,5 +1,5 @@
/* XPM */
static const char * vslider_slider_xpm[] = {
static char * vslider02_slider_xpm[] = {
"15 32 176 2",
" c None",
". c #999991",

View file

@ -19,7 +19,8 @@
*/
#include <algorithm>
#include <iostream>
#include <gtkmm/window.h>
#include <gdkmm.h>
#include <gdkmm/pixmap.h>
@ -140,12 +141,16 @@ Pix::generate ()
for (int i = 0; i < pixmap_count; i++) {
if (from_files) {
string *strp;
strp = (*files)[i];
const char* str(strp->c_str());
static Gtk::Button* button = 0;
static const Gdk::Color color;
pixmaps[i] = Gdk::Pixmap::create_from_xpm (Gdk::Colormap::get_system(),
bitmaps[i], &str);
if (button == 0) {
button = new Gtk::Button ("blah"); //bogus button to extract a Gdk::Drawable from
}
const Glib::RefPtr<const Gdk::Drawable> drawable = button->get_window();
pixmaps[i] = Gdk::Pixmap::create_from_xpm (drawable, Gdk::Colormap::get_system(),
bitmaps[i], color, *(*files)[i]);
} else {
gchar **xpm;
xpm = const_cast<gchar **> (data[i]);