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;
19 sys::path splash_file;
21 if (!find_file_in_search_path (ardour_search_path(), "splash.png", splash_file)) {
22 throw failed_constructor();
26 pixbuf = Gdk::Pixbuf::create_from_file (splash_file.to_string());
30 throw failed_constructor();
33 darea.set_size_request (pixbuf->get_width(), pixbuf->get_height());
34 set_type_hint (Gdk::WINDOW_TYPE_HINT_SPLASHSCREEN);
35 set_keep_above (true);
36 set_position (WIN_POS_CENTER);
37 darea.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
39 layout = create_pango_layout ("");
42 darea.signal_expose_event().connect (mem_fun (*this, &Splash::expose));
50 Window::on_realize ();
51 layout->set_font_description (get_style()->get_font());
56 Splash::on_button_release_event (GdkEventButton* ev)
63 Splash::expose (GdkEventExpose* ev)
65 RefPtr<Gdk::Window> window = darea.get_window();
67 window->draw_pixbuf (get_style()->get_bg_gc (STATE_NORMAL), pixbuf,
68 ev->area.x, ev->area.y,
69 ev->area.x, ev->area.y,
70 ev->area.width, ev->area.height,
71 Gdk::RGB_DITHER_NONE, 0, 0);
73 Glib::RefPtr<Gtk::Style> style = darea.get_style();
74 Glib::RefPtr<Gdk::GC> white = style->get_white_gc();
76 window->draw_layout (white, 10, pixbuf->get_height() - 30, layout);
82 Splash::message (const string& msg)
88 layout->set_markup (str);
90 get_window()->process_updates (true);