summaryrefslogtreecommitdiff
path: root/gtk2_ardour/splash.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-01-18 00:09:55 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-01-18 00:09:55 +0000
commit574db5d874f3a9c7645c91d9ffe71c869880aa07 (patch)
treea913d1f8465a7368f80b5012c2aba2177e428aea /gtk2_ardour/splash.cc
parent03d2616dbc03ecb18b78d28d3ab3dc302f77eaed (diff)
audun's waveview outline patch; some diskstream fixes; real splash screen; more reorganization of new session dialog use; about is not marked as a splashscreen anymore (help out KDE users)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2935 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/splash.cc')
-rw-r--r--gtk2_ardour/splash.cc55
1 files changed, 55 insertions, 0 deletions
diff --git a/gtk2_ardour/splash.cc b/gtk2_ardour/splash.cc
new file mode 100644
index 0000000000..4da01783c5
--- /dev/null
+++ b/gtk2_ardour/splash.cc
@@ -0,0 +1,55 @@
+#include <string>
+
+#include <pbd/failed_constructor.h>
+#include <ardour/ardour.h>
+
+#include "splash.h"
+
+using namespace Gtk;
+using namespace Glib;
+using namespace std;
+using namespace ARDOUR;
+
+Splash::Splash ()
+{
+ string path = find_data_file ("splash.png");
+
+ if (path.empty()) {
+ throw failed_constructor();
+ }
+
+ try {
+ pixbuf = Gdk::Pixbuf::create_from_file (path);
+ }
+
+ catch (...) {
+ throw failed_constructor();
+ }
+
+ set_size_request (pixbuf->get_width(), pixbuf->get_height());
+ set_type_hint (Gdk::WINDOW_TYPE_HINT_SPLASHSCREEN);
+ set_keep_above (true);
+ set_position (WIN_POS_CENTER);
+ add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
+}
+
+bool
+Splash::on_button_release_event (GdkEventButton* ev)
+{
+ hide ();
+}
+
+bool
+Splash::on_expose_event (GdkEventExpose* ev)
+{
+ RefPtr<Gdk::Window> window = get_window();
+
+ Window::on_expose_event (ev);
+
+ window->draw_pixbuf (get_style()->get_bg_gc (STATE_NORMAL), pixbuf,
+ ev->area.x, ev->area.y,
+ ev->area.x, ev->area.y,
+ ev->area.width, ev->area.height,
+ Gdk::RGB_DITHER_NONE, 0, 0);
+ return true;
+}