3 #include <pbd/failed_constructor.h>
4 #include <ardour/ardour.h>
13 using namespace ARDOUR;
15 Splash* Splash::the_splash = 0;
19 string path = find_data_file ("splash.png");
22 throw failed_constructor();
26 pixbuf = Gdk::Pixbuf::create_from_file (path);
30 throw failed_constructor();
33 darea.set_size_request (pixbuf->get_width(), pixbuf->get_height());
34 set_keep_above (true);
35 set_position (WIN_POS_CENTER);
36 darea.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
38 layout = create_pango_layout ("");
40 string i18n = _("Ardour loading ...");
44 layout->set_markup (str);
47 darea.signal_expose_event().connect (mem_fun (*this, &Splash::expose));
57 set_keep_above (false);
63 Window::on_realize ();
64 get_window()->set_decorations (Gdk::WMDecoration(0));
65 layout->set_font_description (get_style()->get_font());
70 Splash::on_button_release_event (GdkEventButton* ev)
77 Splash::expose (GdkEventExpose* ev)
79 RefPtr<Gdk::Window> window = darea.get_window();
81 window->draw_pixbuf (get_style()->get_bg_gc (STATE_NORMAL), pixbuf,
82 ev->area.x, ev->area.y,
83 ev->area.x, ev->area.y,
84 ev->area.width, ev->area.height,
85 Gdk::RGB_DITHER_NONE, 0, 0);
87 Glib::RefPtr<Gtk::Style> style = darea.get_style();
88 Glib::RefPtr<Gdk::GC> white = style->get_white_gc();
90 window->draw_layout (white, 10, pixbuf->get_height() - 30, layout);
96 Splash::message (const string& msg)
102 layout->set_markup (str);
104 get_window()->process_updates (true);