summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-09-12 16:10:50 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-09-12 16:10:50 (GMT)
commit41e89bb5ed1a9d38d1ece1310ef708daad54a9a9 (patch)
tree729117779ef76f28bff02413ce74daac46ccc565 /SwifTools/Dock
parentde0cdc61015f86a334bc4c0589bafe0bfdf89786 (diff)
downloadswift-41e89bb5ed1a9d38d1ece1310ef708daad54a9a9.zip
swift-41e89bb5ed1a9d38d1ece1310ef708daad54a9a9.tar.bz2
Moved application message display around.
Diffstat (limited to 'SwifTools/Dock')
-rw-r--r--SwifTools/Dock/Dock.cpp14
-rw-r--r--SwifTools/Dock/Dock.h18
-rw-r--r--SwifTools/Dock/MacOSXDock.h21
-rw-r--r--SwifTools/Dock/MacOSXDock.mm20
-rw-r--r--SwifTools/Dock/NullDock.h19
-rw-r--r--SwifTools/Dock/SConscript13
6 files changed, 105 insertions, 0 deletions
diff --git a/SwifTools/Dock/Dock.cpp b/SwifTools/Dock/Dock.cpp
new file mode 100644
index 0000000..77bcd84
--- /dev/null
+++ b/SwifTools/Dock/Dock.cpp
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2010 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#include "SwifTools/Dock/Dock.h"
+
+namespace Swift {
+
+Dock::~Dock() {
+}
+
+}
diff --git a/SwifTools/Dock/Dock.h b/SwifTools/Dock/Dock.h
new file mode 100644
index 0000000..a1c652d
--- /dev/null
+++ b/SwifTools/Dock/Dock.h
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2010 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#pragma once
+
+namespace Swift {
+ class String;
+
+ class Dock {
+ public:
+ virtual ~Dock();
+
+ virtual void setMessage(const String& message) = 0;
+ };
+}
diff --git a/SwifTools/Dock/MacOSXDock.h b/SwifTools/Dock/MacOSXDock.h
new file mode 100644
index 0000000..e9667a6
--- /dev/null
+++ b/SwifTools/Dock/MacOSXDock.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2010 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#pragma once
+
+#include "SwifTools/Dock/Dock.h"
+
+namespace Swift {
+ class String;
+ class CocoaApplication;
+
+ class MacOSXDock : public Dock {
+ public:
+ MacOSXDock(CocoaApplication* application);
+
+ void setMessage(const String& label);
+ };
+}
diff --git a/SwifTools/Dock/MacOSXDock.mm b/SwifTools/Dock/MacOSXDock.mm
new file mode 100644
index 0000000..d2a06b3
--- /dev/null
+++ b/SwifTools/Dock/MacOSXDock.mm
@@ -0,0 +1,20 @@
+#include "SwifTools/Dock/MacOSXDock.h"
+
+#include <AppKit/AppKit.h>
+#include <Cocoa/Cocoa.h>
+
+#include "Swiften/Base/String.h"
+
+namespace Swift {
+
+MacOSXDock::MacOSXDock(CocoaApplication*) {
+}
+
+void MacOSXDock::setMessage(const String& label) {
+ NSString *labelString = [[NSString alloc] initWithUTF8String: label.getUTF8Data()];
+ [[NSApp dockTile] setBadgeLabel: labelString];
+ [labelString release];
+ [NSApp requestUserAttention: NSInformationalRequest];
+}
+
+}
diff --git a/SwifTools/Dock/NullDock.h b/SwifTools/Dock/NullDock.h
new file mode 100644
index 0000000..f2d27b7
--- /dev/null
+++ b/SwifTools/Dock/NullDock.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2010 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#pragma once
+
+#include "SwifTools/Dock/Dock.h"
+
+namespace Swift {
+ class NullDock : public Dock {
+ public:
+ NullDock() {}
+
+ virtual void setMessage(const String&) {
+ }
+ };
+}
diff --git a/SwifTools/Dock/SConscript b/SwifTools/Dock/SConscript
new file mode 100644
index 0000000..94797cb
--- /dev/null
+++ b/SwifTools/Dock/SConscript
@@ -0,0 +1,13 @@
+Import("swiftools_env")
+
+sources = [
+ "Dock.cpp",
+ ]
+
+if swiftools_env["PLATFORM"] == "darwin" and swiftools_env["target"] == "native" :
+ sources += [
+ "MacOSXDock.mm",
+ ]
+
+objects = swiftools_env.StaticObject(sources)
+swiftools_env.Append(SWIFTOOLS_OBJECTS = objects)