From cc93882d8f6e8763323261ee2c8a08aba0d6d394 Mon Sep 17 00:00:00 2001 From: niten Date: Sat, 15 Apr 2023 03:43:42 -0700 Subject: [PATCH] Oops, checkin java code too --- src/java/org/freedesktop/Notifications.java | 47 +++++++++++++++++++++ src/java/org/freedesktop/Quad.java | 22 ++++++++++ 2 files changed, 69 insertions(+) create mode 100644 src/java/org/freedesktop/Notifications.java create mode 100644 src/java/org/freedesktop/Quad.java diff --git a/src/java/org/freedesktop/Notifications.java b/src/java/org/freedesktop/Notifications.java new file mode 100644 index 0000000..2944c6c --- /dev/null +++ b/src/java/org/freedesktop/Notifications.java @@ -0,0 +1,47 @@ +package org.freedesktop; + +import java.util.List; +import java.util.Map; +import org.freedesktop.dbus.DBusInterface; +import org.freedesktop.dbus.DBusSignal; +import org.freedesktop.dbus.UInt32; +import org.freedesktop.dbus.Variant; +import org.freedesktop.dbus.exceptions.DBusException; + +public interface Notifications extends DBusInterface { + public static class ActionInvoked extends DBusSignal { + public final UInt32 id; + public final String action_key; + + public ActionInvoked(String path, UInt32 id, String action_key) throws DBusException { + super(path, id, action_key); + this.id = id; + this.action_key = action_key; + } + } + + public static class NotificationClosed extends DBusSignal { + public final UInt32 id; + public final UInt32 reason; + + public NotificationClosed(String path, UInt32 id, UInt32 reason) throws DBusException { + super(path, id, reason); + this.id = id; + this.reason = reason; + } + } + + public void CloseNotification(UInt32 id); + public List GetCapabilities(); + public Quad GetServerInformation(); + + public UInt32 Notify( + String app_name, + UInt32 replaces_id, + String app_icon, + String summary, + String body, + List actions, + Map> hints, + int expire_timeout); +} diff --git a/src/java/org/freedesktop/Quad.java b/src/java/org/freedesktop/Quad.java new file mode 100644 index 0000000..09108ad --- /dev/null +++ b/src/java/org/freedesktop/Quad.java @@ -0,0 +1,22 @@ +package org.freedesktop; + +import org.freedesktop.dbus.Position; +import org.freedesktop.dbus.Tuple; + +public final class Quad extends Tuple { + @Position(0) + public final A a; + @Position(1) + public final B b; + @Position(3) + public final C c; + @Position(4) + public final D d; + + public Quad(A a, B b, C c, D d) { + this.a = a; + this.b = b; + this.c = c; + this.d = d; + } +}