Skip to content

Commit

Permalink
Merge pull request #33 from Sweets/tiramisu-vala
Browse files Browse the repository at this point in the history
Tiramisu vala
  • Loading branch information
Sweets authored Oct 17, 2021
2 parents 76932bb + 47de107 commit 29f0597
Show file tree
Hide file tree
Showing 12 changed files with 214 additions and 829 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
TARGET = tiramisu
SRC := src/tiramisu.c src/events.c src/notification.c
SRC := src/notification.vala src/dbus.vala src/tiramisu.vala

PREFIX ?= /usr/local
INSTALL = install -Dm755
RM ?= rm -f

CC = valac
CFLAGS += -Wall -Wno-unused-value
IFLAGS = `pkg-config --cflags glib-2.0 gio-2.0`
IFLAGS = --pkg gio-2.0
LFLAGS = `pkg-config --libs glib-2.0 gio-2.0`

all: $(TARGET)

$(TARGET): $(SRC)
$(CC) $(CFLAGS) $(IFLAGS) $(SRC) $(LFLAGS) $(LDFLAGS) -o $(TARGET)
$(CC) $(IFLAGS) $(SRC) -d ./build -o $(TARGET)
# $(CC) $(CFLAGS) $(IFLAGS) $(SRC) $(LFLAGS) $(LDFLAGS) -o $(TARGET)

install: $(TARGET)
mkdir -p $(DESTDIR)$(PREFIX)/bin
Expand Down
44 changes: 44 additions & 0 deletions src/dbus.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[DBus (name = "org.freedesktop.Notifications")]
public class NotificationDaemon : Object {
[DBus (name = "GetServerInformation")]
public void get_server_information(out string name,
out string vendor, out string version, out string spec_version)
throws DBusError, IOError {
name = "tiramisu";
vendor = "Sweets";
version = "1.2";
spec_version = "1.2";
}

[DBus (name = "GetCapabilities")]
public string[] get_capabilities() throws DBusError, IOError {
return {"body"};
}

[DBus (name = "Notify")]
public uint Notify(string app_name, uint replaces_id, string app_icon,
string summary, string body, string[] actions,
GLib.HashTable<string, GLib.Variant> hints,
int expire_timeout) throws DBusError, IOError {

Notification.output(app_name, replaces_id, app_icon, summary,
body, actions, hints, expire_timeout);

return 0;
}

[DBus (name = "CloseNotification")]
public void close_notification(uint id) throws DBusError, IOError {
// close notification
}

[DBus (name = "NotificationClosed")]
public void notification_closed(uint id,
uint reason) throws DBusError, IOError {
// notification was closed
}


// action_invoked
}

92 changes: 0 additions & 92 deletions src/events.c

This file was deleted.

8 changes: 0 additions & 8 deletions src/events.h

This file was deleted.

Loading

0 comments on commit 29f0597

Please sign in to comment.