3 #include <pbd/failed_constructor.h>
4 #include <pbd/file_utils.h>
5 #include <ardour/ardour.h>
6 #include <ardour/filesystem_paths.h>
15 using namespace ARDOUR;
17 Splash* Splash::the_splash = 0;
21 sys::path splash_file;
23 if (!find_file_in_search_path (ardour_search_path(), "splash.png", splash_file)) {
24 throw failed_constructor();
28 pixbuf = Gdk::Pixbuf::create_from_file (splash_file.to_string());
32 throw failed_constructor();
35 darea.set_size_request (pixbuf->get_width(), pixbuf->get_height());
36 set_keep_above (true);
37 set_position (WIN_POS_CENTER);
38 darea.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
40 layout = create_pango_layout ("");
42 string i18n = _("Ardour loading ...");
46 layout->set_markup (str);
49 darea.signal_expose_event().connect (mem_fun (*this, &Splash::expose));
59 set_keep_above (false);
65 Window::on_realize ();
66 get_window()->set_decorations (Gdk::WMDecoration(0));
67 layout->set_font_description (get_style()->get_font());
72 Splash::on_button_release_event (GdkEventButton* ev)
79 Splash::expose (GdkEventExpose* ev)
81 RefPtr<Gdk::Window> window = darea.get_window();
83 window->draw_pixbuf (get_style()->get_bg_gc (STATE_NORMAL), pixbuf,
84 ev->area.x, ev->area.y,
85 ev->area.x, ev->area.y,
86 ev->area.width, ev->area.height,
87 Gdk::RGB_DITHER_NONE, 0, 0);
89 Glib::RefPtr<Gtk::Style> style = darea.get_style();
90 Glib::RefPtr<Gdk::GC> white = style->get_white_gc();
92 window->draw_layout (white, 10, pixbuf->get_height() - 30, layout);
98 Splash::message (const string& msg)
104 layout->set_markup (str);
106 get_window()->process_updates (true);