Compare commits
No commits in common. "master" and "abderrahim/fix-pkg-config" have entirely different histories.
master
...
abderrahim
|
@ -1,37 +1,42 @@
|
||||||
variables:
|
|
||||||
DEBIAN_FRONTEND: noninteractive
|
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
|
|
||||||
build:ubuntu:
|
.base_build_template: &base_build
|
||||||
stage: build
|
stage: build
|
||||||
image: ubuntu:devel
|
image: ubuntu:devel
|
||||||
|
|
||||||
|
.ubuntu_deps_install_template: &ubuntu_deps_install
|
||||||
|
apt-get update &&
|
||||||
|
apt-get install -q -y --no-install-recommends
|
||||||
|
gobject-introspection
|
||||||
|
gtk-doc-tools
|
||||||
|
libgdk-pixbuf2.0-dev
|
||||||
|
libgirepository1.0-dev
|
||||||
|
libglib2.0-dev
|
||||||
|
libgtk-3-dev
|
||||||
|
libpopt-dev
|
||||||
|
xmlto
|
||||||
|
|
||||||
|
build:ubuntu:autogen:
|
||||||
|
<<: *base_build
|
||||||
before_script:
|
before_script:
|
||||||
- apt-get update &&
|
- *ubuntu_deps_install
|
||||||
|
- apt-get install -q -y --no-install-recommends
|
||||||
|
gnome-common
|
||||||
|
script:
|
||||||
|
- ./autogen.sh --enable-gtk-doc=yes
|
||||||
|
- make
|
||||||
|
- make distcheck
|
||||||
|
|
||||||
|
build:ubuntu:meson:
|
||||||
|
<<: *base_build
|
||||||
|
before_script:
|
||||||
|
- *ubuntu_deps_install
|
||||||
- apt-get install -q -y --no-install-recommends
|
- apt-get install -q -y --no-install-recommends
|
||||||
gobject-introspection
|
|
||||||
gtk-doc-tools
|
|
||||||
libgdk-pixbuf2.0-dev
|
|
||||||
libgirepository1.0-dev
|
|
||||||
libglib2.0-dev
|
|
||||||
libgtk-3-dev
|
|
||||||
libpopt-dev
|
|
||||||
xmlto
|
|
||||||
ninja-build
|
ninja-build
|
||||||
python3-pip
|
python3-pip
|
||||||
python3-setuptools
|
python3-setuptools
|
||||||
xsltproc
|
|
||||||
docbook-xsl-ns
|
|
||||||
- pip3 install meson
|
- pip3 install meson
|
||||||
script:
|
script:
|
||||||
- meson _build -Ddocbook_docs=enabled
|
- meson _build -Dgtk_doc=true -Ddocbook_docs=enabled -Dtests=true
|
||||||
- ninja -C _build install
|
- ninja -C _build
|
||||||
artifacts:
|
|
||||||
expose_as: "Build artifacts"
|
|
||||||
paths:
|
|
||||||
- _build/docs/notification-spec.html
|
|
||||||
- _build/docs/reference/html
|
|
||||||
- _build/docs/reference/html/index.html
|
|
||||||
- _build/meson-logs
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,984 @@
|
||||||
|
Sun Jun 14 14:50:00 UTC 2009 Andre Klapper <a9016009@gmx.de>
|
||||||
|
* libnotify/notification.c:
|
||||||
|
- Remove deprecated GLib symbols.
|
||||||
|
|
||||||
|
========================= 0.4.5 =========================
|
||||||
|
|
||||||
|
Thu Nov 20 03:16:53 PST 2008 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* docs/reference/tmpl/notification.sgml:
|
||||||
|
* ChangeLog:
|
||||||
|
* configure.ac:
|
||||||
|
* NEWS:
|
||||||
|
- Bump to version 0.4.5.
|
||||||
|
|
||||||
|
Thu Sep 25 18:45:41 PDT 2008 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notification.c:
|
||||||
|
* libnotify/notification.h:
|
||||||
|
- Prevent a backwards-compatibility breakage introduced where the
|
||||||
|
"reason" code was added to the "closed" signal. This meant that
|
||||||
|
existing signal handlers that passed extra data would break. We now
|
||||||
|
require that you call notify_notification_get_closed_reason() to get
|
||||||
|
this data.
|
||||||
|
|
||||||
|
Thu Sep 25 18:05:38 PDT 2008 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notification.h:
|
||||||
|
* NEWS:
|
||||||
|
- Fixed a breakage where we were including gtkversion.h directly.
|
||||||
|
Reported by Richard Hughes.
|
||||||
|
|
||||||
|
Tue Mar 18 21:51:32 PDT 2008 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notification.c:
|
||||||
|
* libnotify/notification.h:
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* libnotify/notify-marshal.list:
|
||||||
|
* NEWS:
|
||||||
|
- Add support for sending the closed reason in the signal handler.
|
||||||
|
Closes ticket #139.
|
||||||
|
|
||||||
|
Sat Aug 25 18:08:01 PDT 2007 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* tools/notify-send.c:
|
||||||
|
- Relicense notify-send under the LGPL in order to keep licensing
|
||||||
|
simple and to allow reuse in more projects. Fixes bug #124.
|
||||||
|
|
||||||
|
Sun Apr 29 02:45:20 PDT 2007 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* configure.ac:
|
||||||
|
- Bump to version 0.4.4.90.
|
||||||
|
|
||||||
|
Sun Apr 29 00:39:32 PDT 2007 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* docs/reference/tmpl/notification.sgml:
|
||||||
|
* libnotify/notification.c:
|
||||||
|
- Patch by Lucas Rocha to add GObject property accessors for
|
||||||
|
notification IDs.
|
||||||
|
|
||||||
|
========================= 0.4.4 =========================
|
||||||
|
|
||||||
|
Tue Feb 27 21:11:36 PST 2007 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* NEWS:
|
||||||
|
* configure.ac:
|
||||||
|
- Bump to version 0.4.4.
|
||||||
|
|
||||||
|
Thu Feb 15 03:10:39 PST 2007 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* NEWS:
|
||||||
|
- Update with all the fixes in this release.
|
||||||
|
|
||||||
|
Thu Feb 15 02:44:16 PST 2007 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notification.c:
|
||||||
|
- Prevent a crash when the handler for a notification's closed signal
|
||||||
|
removes the last reference to the notification. We attempted to set
|
||||||
|
the ID of the notification after emitting this signal, but the
|
||||||
|
notification was destroyed already. So, keep a reference while doing
|
||||||
|
all this. This fixes bug #116.
|
||||||
|
|
||||||
|
Thu Feb 15 02:29:01 PST 2007 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
- Get rid of format_func.
|
||||||
|
|
||||||
|
Thu Feb 15 02:06:11 PST 2007 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notification.c:
|
||||||
|
- Fix some memory leaks when appending data to a message. Scary,
|
||||||
|
horrible, traumatizing memory leaks. Actually it's pretty bad,
|
||||||
|
though, so new release coming up soon. This fixes bug #112.
|
||||||
|
|
||||||
|
Thu Feb 15 01:58:52 PST 2007 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* tests/test-image.c:
|
||||||
|
- Use a more common (I hope) icontheme icon for the test.
|
||||||
|
|
||||||
|
Thu Feb 15 00:52:56 PST 2007 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notification.c:
|
||||||
|
- Fix a bug in notify_notification_add_action where the function
|
||||||
|
to free the user data was never called, causing memory leaks.
|
||||||
|
This fixes bug #119.
|
||||||
|
|
||||||
|
Mon Nov 13 23:42:07 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* tests/Makefile.am:
|
||||||
|
A tests/test-size-changes.c:
|
||||||
|
* tests/test-default-action.c:
|
||||||
|
- Added a test program that displays three notifications and then
|
||||||
|
changes the amount of text in one of them.
|
||||||
|
|
||||||
|
Sun Nov 05 12:06:01 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
- Patch by Giacomo Lozito to fix a problem where the dbus proxy was
|
||||||
|
not being freed on notify_uninit, which led to problems when libnotify
|
||||||
|
was used in a loadable module. This fixes bug #92.
|
||||||
|
|
||||||
|
Sun Nov 05 11:54:10 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* configure.ac:
|
||||||
|
* NEWS:
|
||||||
|
- Bump to version 0.4.3.90.
|
||||||
|
|
||||||
|
Sun Nov 05 11:50:44 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notification.c:
|
||||||
|
- Patch by jylefort to only reset a notification's ID to 0 if it
|
||||||
|
was the notification closed. This fixes bug #94.
|
||||||
|
|
||||||
|
========================= 0.4.3 =========================
|
||||||
|
|
||||||
|
Sun Oct 08 13:21:20 EDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* configure.ac:
|
||||||
|
* NEWS:
|
||||||
|
- Bump the version to 0.4.3.
|
||||||
|
- Add the release datestamp.
|
||||||
|
|
||||||
|
Sun Sep 03 23:48:29 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notification.c:
|
||||||
|
* NEWS:
|
||||||
|
- Patch by lucasr to fix an invalid assertion in
|
||||||
|
notify_notification_new_with_status_icon. This closes bug #85.
|
||||||
|
|
||||||
|
Sun Sep 03 23:44:01 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* NEWS:
|
||||||
|
- Patch by berndth to stop using g_atexit, as this can fail in the
|
||||||
|
case of a dynamically loaded module. Applications should now call
|
||||||
|
notify_uninit() on exit or on plugin unload. This closes bug #86.
|
||||||
|
|
||||||
|
Mon Jul 31 19:40:10 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notification.c:
|
||||||
|
- Emit the property change notification for "status-icon" and not
|
||||||
|
"attach-icon". This closes bug #81.
|
||||||
|
|
||||||
|
Sat Jul 29 03:02:18 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notification.c:
|
||||||
|
- Patch by Ed Catmur to reset a notification's ID if
|
||||||
|
notify_notification_show() is called on a notification that had
|
||||||
|
already been closed. This causes the notification to receive a new
|
||||||
|
ID. This closes ticket #78.
|
||||||
|
|
||||||
|
Thu Jul 13 00:44:29 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* configure.ac:
|
||||||
|
- Patch by compnerd to check for glib 2.6+ during configure, as that
|
||||||
|
is now required. This closes ticket #69.
|
||||||
|
|
||||||
|
Thu Jul 13 00:41:16 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notification.c:
|
||||||
|
* AUTHORS:
|
||||||
|
* configure.ac:
|
||||||
|
- Patch by mderezynski to send an array of UCHARs as expected by
|
||||||
|
notification-daemon rather than an array of CHARs. This closes
|
||||||
|
ticket #68.
|
||||||
|
- Bump to version 0.4.2.90.
|
||||||
|
|
||||||
|
========================= 0.4.2 =========================
|
||||||
|
|
||||||
|
Sat Jun 17 19:17:05 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/internal.h:
|
||||||
|
* libnotify/notify.h:
|
||||||
|
* configure.ac:
|
||||||
|
- Add G_BEGIN_DECLS and G_END_DECLS to notify.h, so that libnotify can
|
||||||
|
be used in C++ applications properly.
|
||||||
|
- Bump to version 0.4.2.
|
||||||
|
|
||||||
|
========================= 0.4.1 =========================
|
||||||
|
|
||||||
|
Sat Jun 17 18:17:28 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* Makefile.am:
|
||||||
|
* NEWS:
|
||||||
|
D libnotify.spec.in:
|
||||||
|
* configure.ac:
|
||||||
|
- Fix make distcheck and remove the old RPM spec file.
|
||||||
|
- Update the news.
|
||||||
|
- Bump the version to 0.4.1.
|
||||||
|
|
||||||
|
Thu Jun 15 02:14:14 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notification.c:
|
||||||
|
- Fix a build error on gtk 2.9.2+. This fixes bug #65.
|
||||||
|
|
||||||
|
Tue Jun 06 12:44:48 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* docs/reference/tmpl/notification.sgml:
|
||||||
|
* libnotify/notification.h:
|
||||||
|
- Small random fixes.
|
||||||
|
|
||||||
|
Tue Jun 06 01:45:46 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* docs/reference/libnotify-docs.sgml:
|
||||||
|
* docs/reference/tmpl/libnotify-docs.sgml:
|
||||||
|
- Fix up some references to files.
|
||||||
|
|
||||||
|
Tue Jun 06 01:29:20 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* docs/reference/libnotify-sections.txt:
|
||||||
|
* docs/reference/tmpl/notification.sgml:
|
||||||
|
* docs/reference/tmpl/notify.sgml:
|
||||||
|
* libnotify/notification.c:
|
||||||
|
* libnotify/notification.h:
|
||||||
|
- Provide more documentation.
|
||||||
|
|
||||||
|
Tue Jun 06 00:27:50 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* docs/reference/tmpl/notification.sgml:
|
||||||
|
* libnotify/notification.c:
|
||||||
|
* libnotify/notification.h:
|
||||||
|
- Update notify_notification_set_geometry_hints() to take a x, y
|
||||||
|
instead of a GdkRectangle. We don't need the width and height
|
||||||
|
information.
|
||||||
|
|
||||||
|
Tue Jun 06 00:14:00 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
A docs/reference/libnotify-docs.sgml:
|
||||||
|
A docs/reference/libnotify-overrides.txt:
|
||||||
|
A docs/reference/libnotify-sections.txt:
|
||||||
|
A docs/reference/tmpl:
|
||||||
|
A docs/reference/tmpl/libnotify-docs.sgml:
|
||||||
|
A docs/reference/tmpl/libnotify-unused.sgml:
|
||||||
|
A docs/reference/tmpl/notification.sgml:
|
||||||
|
A docs/reference/tmpl/notify.sgml:
|
||||||
|
A docs/reference/Makefile.am:
|
||||||
|
A docs/Makefile.am:
|
||||||
|
* libnotify/notification.c:
|
||||||
|
* libnotify/notification.h:
|
||||||
|
* libnotify/notify.c:
|
||||||
|
D Doxyfile.in:
|
||||||
|
* Makefile.am:
|
||||||
|
* autogen.sh:
|
||||||
|
* configure.ac:
|
||||||
|
- Add some gtk-doc documentation.
|
||||||
|
|
||||||
|
Sun Jun 04 17:44:27 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notification.c:
|
||||||
|
* libnotify/notification.h:
|
||||||
|
- Patch by chpe to add support for using the new GtkStatusIcon in
|
||||||
|
GTK+ 2.9.x. These functions are #ifdef'd to only be provided in
|
||||||
|
supported versions of GTK. The patch also added support for GObject
|
||||||
|
properties on the NotifyNotification objects. This closes ticket #60.
|
||||||
|
|
||||||
|
Sun Jun 04 16:12:05 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
- Set _initted to FALSE in notify_uninit(), so that notify_is_initted()
|
||||||
|
won't return TRUE.
|
||||||
|
|
||||||
|
Fri Jun 02 15:56:05 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* AUTHORS:
|
||||||
|
* configure.ac:
|
||||||
|
* libnotify.pc.in:
|
||||||
|
- Improve libnotify.pc by pushing dependencies into Requires: instead of
|
||||||
|
Cflags: and Libs:. This closes ticket #58.
|
||||||
|
- Bump the version to 0.4.0.90.
|
||||||
|
|
||||||
|
========================= 0.4.0 =========================
|
||||||
|
|
||||||
|
Wed Apr 26 01:15:20 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* tests/Makefile.am:
|
||||||
|
- Bundle applet-critical.png.
|
||||||
|
|
||||||
|
Wed Apr 26 01:07:34 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* tests/test-replace.c:
|
||||||
|
- Set the second, replaced notification to have a default expiration.
|
||||||
|
|
||||||
|
Tue Apr 25 23:52:42 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/Makefile.am:
|
||||||
|
* libnotify/notify.h:
|
||||||
|
* NEWS:
|
||||||
|
* configure.ac:
|
||||||
|
- Add GTypes for the enums.
|
||||||
|
- Bump to version 0.4.0.
|
||||||
|
|
||||||
|
Fri Apr 21 15:35:40 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* tools/notify-send.c:
|
||||||
|
- Use fprintf instead of g_warning.
|
||||||
|
|
||||||
|
Fri Apr 21 14:38:04 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* AUTHORS:
|
||||||
|
- Add some names to the patch writers list.
|
||||||
|
|
||||||
|
Fri Apr 21 14:35:30 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* tests/test-server-info.c:
|
||||||
|
* NEWS:
|
||||||
|
- Patch by jensgr to fix some C99 usage in the tests code.
|
||||||
|
|
||||||
|
Fri Apr 21 14:21:47 PDT 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* tools/Makefile.am:
|
||||||
|
* tools/notify-send.c:
|
||||||
|
* NEWS:
|
||||||
|
* configure.ac:
|
||||||
|
- Patch by M.S. to switch notify-send to use GOption instead of popt,
|
||||||
|
to add -v, --version, -h, and --hint options, and to rename
|
||||||
|
-T, --type to -c, --category. This also fixes assertions when calling
|
||||||
|
notify-send "". This closes ticket #41.
|
||||||
|
|
||||||
|
Mon Mar 20 14:12:15 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* tools/notify-send.c:
|
||||||
|
- Change the help for notify-send to indicate that --expire-timeout
|
||||||
|
requires milliseconds, not seconds. This fixes bug #28.
|
||||||
|
- Fixed the short flag for --type to be -T. This fixes bug #18.
|
||||||
|
|
||||||
|
Sat Mar 18 14:47:53 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* tools/notify-send.c:
|
||||||
|
- Fix notify-send on PPC.
|
||||||
|
|
||||||
|
Sat Feb 04 17:18:38 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notification.c:
|
||||||
|
- Don't complain about an unknown action when the action is "default"
|
||||||
|
|
||||||
|
Sat Feb 04 13:29:22 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
A tests/test-xy-actions.c:
|
||||||
|
* tests/Makefile.am:
|
||||||
|
- Add test-xy-actions.
|
||||||
|
|
||||||
|
Sat Feb 04 12:41:03 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* tests/test-multi-actions.c:
|
||||||
|
- Running out of disk space is a critical notification. Set the
|
||||||
|
urgency level in test-multi-actions.
|
||||||
|
|
||||||
|
Sat Feb 04 02:04:13 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* tests/test-urgency.c:
|
||||||
|
- It's a good thing to actually set the urgency levels in the
|
||||||
|
urgency test.
|
||||||
|
|
||||||
|
Sat Feb 04 01:47:00 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
A tests/test-urgency.c:
|
||||||
|
* tests/Makefile.am:
|
||||||
|
- Add a test-urgency testcase.
|
||||||
|
|
||||||
|
Sun Jan 29 13:26:31 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* Doxyfile.in:
|
||||||
|
* libnotify/notification.c:
|
||||||
|
* libnotify/notification.h:
|
||||||
|
- More Doxygen happiness. Still no NotifyNotification docs yet though.
|
||||||
|
|
||||||
|
Sun Jan 29 13:17:43 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notify.h:
|
||||||
|
- Make Doxygen happy.
|
||||||
|
|
||||||
|
========================= 0.3.2 =========================
|
||||||
|
|
||||||
|
Mon Jan 23 01:31:59 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notification.h:
|
||||||
|
- Removed notify_notification_{ref,unref} from notification.h.
|
||||||
|
|
||||||
|
Mon Jan 23 01:30:45 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/Makefile.am:
|
||||||
|
- Make distcheck happy.
|
||||||
|
|
||||||
|
Mon Jan 23 01:20:36 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* docs/ChangeLog:
|
||||||
|
* NEWS:
|
||||||
|
* configure.ac:
|
||||||
|
- Bumped the version to 0.3.2.
|
||||||
|
- Added news.
|
||||||
|
|
||||||
|
Mon Jan 23 01:10:23 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/internal.h:
|
||||||
|
* libnotify/notification.c:
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* tests/test-replace-widget.c:
|
||||||
|
- Make a best attempt at clearing away notifications that require
|
||||||
|
actions or that exist until clicked when the calling application
|
||||||
|
exits. This doesn't always work.
|
||||||
|
|
||||||
|
Sun Jan 22 23:46:27 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* docs/notification-spec.xml:
|
||||||
|
- Fix some errors in the spec file. Some pieces were not updated when
|
||||||
|
the specification was changed, and some pieces were invalid XML.
|
||||||
|
|
||||||
|
Sun Jan 22 13:21:52 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notification.c:
|
||||||
|
- Raw images are broken in D-BUS versions less than 0.60. Don't crash
|
||||||
|
under this case, and warn the user.
|
||||||
|
|
||||||
|
Sat Jan 21 00:37:03 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/internal.h:
|
||||||
|
* libnotify/notification.c:
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* tests/test-image.c:
|
||||||
|
- Use one D-BUS connection, one GProxy, total. This is better than the
|
||||||
|
one per notification, and fixes a few bugs.
|
||||||
|
|
||||||
|
Fri Jan 20 20:49:31 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
- Some small code cleanups.
|
||||||
|
|
||||||
|
Fri Jan 20 02:19:29 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notification.c:
|
||||||
|
* libnotify/notification.h:
|
||||||
|
* tests/test-basic.c:
|
||||||
|
* tools/notify-send.c:
|
||||||
|
- Remove notify_notification_show_and_forget(). It's less confusing to
|
||||||
|
have one show function, and require that the user unref. It also
|
||||||
|
simplifies the code quite a bit.
|
||||||
|
|
||||||
|
Fri Jan 20 02:10:50 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notification.c:
|
||||||
|
* libnotify/notification.h:
|
||||||
|
* tests/test-default-action.c:
|
||||||
|
* tests/test-multi-actions.c:
|
||||||
|
- Implement per-action user data.
|
||||||
|
|
||||||
|
Fri Jan 20 01:59:26 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* docs/notification-spec.xml:
|
||||||
|
* libnotify/notification.c:
|
||||||
|
* libnotify/notification.h:
|
||||||
|
* tests/test-default-action.c:
|
||||||
|
* tests/test-image.c:
|
||||||
|
* tests/test-multi-actions.c:
|
||||||
|
* tools/notify-send.c:
|
||||||
|
- Fix some weird argument ordering in the calls to
|
||||||
|
dbus_g_proxy_call_*().
|
||||||
|
- Re-order the arguments as per the spec.
|
||||||
|
- Change NOTIFY_TIMEOUT_* to NOTIFY_EXPIRES_*.
|
||||||
|
- Update the spec to 0.9.
|
||||||
|
|
||||||
|
Fri Jan 20 01:37:42 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notification.c:
|
||||||
|
* libnotify/notification.h:
|
||||||
|
* libnotify/notify.c:
|
||||||
|
- Clean up a lot of the API. Several functions returned gboolean when
|
||||||
|
there was very little point in doing so.
|
||||||
|
- Add assertions to all the functions.
|
||||||
|
- Remove the notify_notification_{set,get}_user_data() functions. These
|
||||||
|
are useless, since this is a GObject, and we get it for free.
|
||||||
|
|
||||||
|
Thu Jan 19 22:07:41 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
A libnotify/internal.h:
|
||||||
|
A libnotify/notification.c:
|
||||||
|
A libnotify/notification.h:
|
||||||
|
D libnotify/notifycommon.h:
|
||||||
|
D libnotify/notifynotification.c:
|
||||||
|
D libnotify/notifynotification.h:
|
||||||
|
* libnotify/Makefile.am:
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* libnotify/notify.h:
|
||||||
|
- Do some rearranging of the files in libnotify, and include things
|
||||||
|
properly so people can actually use the library without fudging with
|
||||||
|
include paths.
|
||||||
|
|
||||||
|
Thu Jan 19 21:56:29 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/Makefile.am:
|
||||||
|
D libnotify/dbus-compat.h:
|
||||||
|
* libnotify/notify.c:
|
||||||
|
- Get rid of dbus-compat.h.
|
||||||
|
|
||||||
|
Thu Jan 19 21:55:08 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/dbus-compat.h:
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* libnotify/notifycommon.h:
|
||||||
|
* libnotify/notify.h:
|
||||||
|
* libnotify/notifynotification.c:
|
||||||
|
* libnotify/notifynotification.h:
|
||||||
|
- Fixed the coding style.
|
||||||
|
|
||||||
|
Thu Jan 19 01:34:57 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* tools/notify-send.c:
|
||||||
|
- Make notify-send work again when a body isn't specified.
|
||||||
|
|
||||||
|
Wed Jan 18 22:24:10 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notifynotification.h:
|
||||||
|
* tests/test-xy-stress.c:
|
||||||
|
- Remove the config.h include from notifynotification.h.
|
||||||
|
|
||||||
|
Sun Jan 15 17:52:39 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* docs/notification-spec.xml:
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* libnotify/notify.h:
|
||||||
|
* libnotify/notifynotification.c:
|
||||||
|
* tests/Makefile.am:
|
||||||
|
A tests/test-server-info.c:
|
||||||
|
* tests/test-xy.c:
|
||||||
|
- Add back notify_get_server_info() and notify_get_server_caps().
|
||||||
|
|
||||||
|
Thu Jan 12 2006 John (J5) Palmieri <johnp@redhat.com>
|
||||||
|
|
||||||
|
* libnotify/notifynotification.c (notify_notification_set_user_data):
|
||||||
|
fix free function addition
|
||||||
|
(notify_notification_get_user_data): added method for actually
|
||||||
|
getting the user data (fd.o bug# 5418)
|
||||||
|
- patches provided by Duarte Henriques
|
||||||
|
<duarte.henriques at gmail dot com>
|
||||||
|
|
||||||
|
|
||||||
|
Tue Jan 10 23:33:47 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* configure.ac:
|
||||||
|
- Require D-BUS 0.36+.
|
||||||
|
|
||||||
|
Tue Jan 10 22:55:35 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* tests/test-default-action.c:
|
||||||
|
* tools/notify-send.c:
|
||||||
|
- Fix some C99 usage.
|
||||||
|
|
||||||
|
Tue Jan 10 16:20:27 MST 2006 David Trowbridge <trowbrds@gmail.com>
|
||||||
|
|
||||||
|
* libnotify/Makefile.am:
|
||||||
|
- Make sure marshal files actually get built
|
||||||
|
|
||||||
|
Mon Jan 09 11:13:15 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/Makefile.am:
|
||||||
|
* libnotify/Makefile.in:
|
||||||
|
A libnotify/notify-marshal.list:
|
||||||
|
D libnotify/notifymarshal.c:
|
||||||
|
D libnotify/notifymarshal.h:
|
||||||
|
* libnotify/notifynotification.c:
|
||||||
|
* configure.ac:
|
||||||
|
- Generate the marshal files automatically. We shouldn't be doing it
|
||||||
|
by hand.
|
||||||
|
|
||||||
|
Mon Jan 09 10:15:57 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/Makefile.in:
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* libnotify/notifynotification.c:
|
||||||
|
* tests/test-default-action.c:
|
||||||
|
* tests/test-image.c:
|
||||||
|
* tests/test-multi-actions.c:
|
||||||
|
* tests/test-replace-widget.c:
|
||||||
|
* tests/test-xy-stress.c:
|
||||||
|
- Clean up lots of warnings.
|
||||||
|
|
||||||
|
========================= 0.3.0 =========================
|
||||||
|
|
||||||
|
Tue Dec 13 2005 John (J5) Palmieri <johnp@redhat.com>
|
||||||
|
|
||||||
|
* Release 0.3.0
|
||||||
|
|
||||||
|
* tests/Makefile.am, tools/Makefile.am: patch from Rodney
|
||||||
|
Dawes <dobey at novell.com> fixing make distcheck
|
||||||
|
|
||||||
|
* tools/notify-send.c: use show_and_forget
|
||||||
|
|
||||||
|
Fri Dec 09 2005 John (J5) Palmieri <johnp@redhat.com>
|
||||||
|
|
||||||
|
* libnotify/notifymarshal.[c|h]: new files where GLib callback
|
||||||
|
marshalers are added
|
||||||
|
|
||||||
|
* libnotify/notifynotification.c (notify_notifiaction_init): Add a
|
||||||
|
marshaller for signals with uint, string parameters
|
||||||
|
(_gslist_to_string_array): new internal method that coverts
|
||||||
|
a GSList to a NULL terminated array of strings
|
||||||
|
(_notify_notification_show_internal): send the actions list as an
|
||||||
|
array of strings, not a GSList which does not work with the bindings
|
||||||
|
|
||||||
|
* libnotify/Makefile.am: notifymarshal.[c|h] added
|
||||||
|
|
||||||
|
* tests/test-multi-actions.c: working example of using actions
|
||||||
|
|
||||||
|
|
||||||
|
Fri Dec 02 2005 John (J5) Palmieri <johnp@redhat.com>
|
||||||
|
|
||||||
|
* libnotify/notifynotification.c (notify_notification_add_action):
|
||||||
|
implement adding actions
|
||||||
|
(_action_signal_handler): handle actions coming from the server
|
||||||
|
(notify_notifcation_clear_actions): new method for clearning out
|
||||||
|
the actions list and hash
|
||||||
|
|
||||||
|
Fri Dec 02 2005 John (J5) Palmieri <johnp@redhat.com>
|
||||||
|
|
||||||
|
* libnotify/notifynotification.c (notify_notification_show_and_forget):
|
||||||
|
new method that shows and then unrefs the NotifyNotification object.
|
||||||
|
use this if you just want to fire off a quick notification.
|
||||||
|
|
||||||
|
* various compiler warning cleanups
|
||||||
|
|
||||||
|
Fri Dec 02 2005 John (J5) Palmieri <johnp@redhat.com>
|
||||||
|
|
||||||
|
* libnotify/notifynotification.c (SIGNAL_TYPE_CLOSED): "closed" glib
|
||||||
|
signal added
|
||||||
|
(notify_notification_clear_hints): New API for clearing out the
|
||||||
|
hints hash
|
||||||
|
(notify_notification_ref, notify_notification_unref): removed - use
|
||||||
|
g_object_ref/unref
|
||||||
|
|
||||||
|
* tests/*: Various changes to the test binaries
|
||||||
|
|
||||||
|
Thu Nov 10 14:00:00 EST 2005 John (J5) Palmieri <johnp@redhat.com>
|
||||||
|
|
||||||
|
* Complete rewrite and first import to libnotify-ng module in SVN
|
||||||
|
|
||||||
|
Mon Jul 04 02:13:56 PDT 2005 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* tests/Makefile.am:
|
||||||
|
* tests/test-markup.c:
|
||||||
|
A tests/test-xy-stress.c:
|
||||||
|
* configure.ac:
|
||||||
|
- Conditionally build gdk-dependent test apps if we have gdk.
|
||||||
|
- Added a X, Y stress test that will be used to help test
|
||||||
|
accurately positioning the arrows.
|
||||||
|
|
||||||
|
Thu Jun 30 21:09:18 PDT 2005 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* tests/Makefile.am:
|
||||||
|
- Don't install the test programs during make install.
|
||||||
|
|
||||||
|
Thu Jun 30 21:03:30 PDT 2005 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* libnotify/notify.h:
|
||||||
|
* tests/test-animation.c:
|
||||||
|
* tests/test-basic.c:
|
||||||
|
* tests/test-default-action.c:
|
||||||
|
* tests/test-error.c:
|
||||||
|
* tests/test-image.c:
|
||||||
|
* tests/test-markup.c:
|
||||||
|
* tests/test-multi-actions.c:
|
||||||
|
* tests/test-replace.c:
|
||||||
|
* tools/notify-send.c:
|
||||||
|
- Added support for hints in the API.
|
||||||
|
|
||||||
|
Mon Jun 20 06:13:02 PDT 2005 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
- Be a little better at not crashing. Just a bit better. There's
|
||||||
|
still another crash I'm trying to track down.
|
||||||
|
|
||||||
|
Mon Jun 20 04:53:29 PDT 2005 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
- Close the right container in D-BUS 0.3x.
|
||||||
|
|
||||||
|
Mon Jun 20 02:49:27 PDT 2005 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/Makefile.am:
|
||||||
|
A libnotify/dbus-compat.h:
|
||||||
|
- Add dbus-compat.h.
|
||||||
|
|
||||||
|
Mon Jun 20 02:43:26 PDT 2005 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* configure.ac:
|
||||||
|
- Add support for compiling under D-BUS 0.3x. Actually running
|
||||||
|
has not yet been tested!
|
||||||
|
|
||||||
|
Fri Apr 01 09:21:26 PST 2005 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
- Updated to work with 0.6 of the notification spec.
|
||||||
|
|
||||||
|
Sat Nov 06 15:40:48 PST 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.h:
|
||||||
|
- Move our TODO list to the Doxygen @todo commands, so we'll get it
|
||||||
|
in a nice little page of its own in the API docs.
|
||||||
|
|
||||||
|
Sat Nov 06 15:35:52 PST 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.h:
|
||||||
|
- Move the emacs mode string out of the Doxygen comment and into its
|
||||||
|
own.
|
||||||
|
|
||||||
|
Sat Nov 06 15:11:53 PST 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.h:
|
||||||
|
A Doxyfile.in:
|
||||||
|
* Makefile.am:
|
||||||
|
* configure.ac:
|
||||||
|
- Add a Doxyfile.in and update things so we can get doxygen
|
||||||
|
docs.
|
||||||
|
|
||||||
|
Wed Nov 03 23:39:23 PST 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
- Use glib's memory allocation stuff instead of libc's.
|
||||||
|
|
||||||
|
Wed Nov 03 23:34:10 PST 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* libnotify/notify.h:
|
||||||
|
* tests/test-animation.c:
|
||||||
|
* tests/test-image.c:
|
||||||
|
- Patch from Mike Hearn to do a bunch of stuff, like handling icons
|
||||||
|
and animations better.
|
||||||
|
|
||||||
|
Wed Nov 03 01:19:42 PST 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* configure.ac:
|
||||||
|
A libnotify.spec.in:
|
||||||
|
- Fix make distcheck.
|
||||||
|
|
||||||
|
Wed Sep 29 22:34:03 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* tools/notify-send.c:
|
||||||
|
- Don't flush the D-BUS connection, and make sure we disconnect from it.
|
||||||
|
|
||||||
|
Wed Sep 29 21:53:15 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* libnotify/notify.h:
|
||||||
|
* tests/test-animation.c:
|
||||||
|
* tests/test-basic.c:
|
||||||
|
* tests/test-default-action.c:
|
||||||
|
* tests/test-error.c:
|
||||||
|
* tests/test-image.c:
|
||||||
|
* tests/test-markup.c:
|
||||||
|
* tests/test-multi-actions.c:
|
||||||
|
* tests/test-replace.c:
|
||||||
|
* tools/notify-send.c:
|
||||||
|
- Updated to match the spec.
|
||||||
|
|
||||||
|
Sat Sep 25 12:59:26 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* tests/test-animation.c:
|
||||||
|
* tests/test-default-action.c:
|
||||||
|
- Fixed to compile.
|
||||||
|
|
||||||
|
Wed Sep 01 00:39:23 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* docs/ChangeLog:
|
||||||
|
* SPECIFICATION:
|
||||||
|
- Moved specification documentation.
|
||||||
|
- Moved specification ChangeLog.
|
||||||
|
|
||||||
|
Wed Sep 01 00:30:53 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* docs/notification-spec.xml:
|
||||||
|
- Finishing adding the rest of the signals to the spec.
|
||||||
|
|
||||||
|
Sun Aug 29 22:27:42 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
A docs/notification-spec.ps:
|
||||||
|
A docs/notification-spec.xml:
|
||||||
|
- Added the notification spec in docbook format. It's not finished.
|
||||||
|
I'm just tired of working on it.
|
||||||
|
|
||||||
|
Wed Jul 14 02:11:48 GMT 2004 Mike Hearn <mike@navi.cx>
|
||||||
|
* libnotify/notify.c: Use pointers instead of GINT_TO_POINTER
|
||||||
|
* tools/test-replace.c: Test replacing notifications
|
||||||
|
|
||||||
|
Tue Jul 13 23:58:54 GMT 2004 Mike Hearn <mike@navi.cx>
|
||||||
|
* SPECIFICATION: CloseNotification sends NotificationClosed signal.
|
||||||
|
|
||||||
|
Mon Jul 5 00:12:03 GMT 2004 Mike Hearn <mike@navi.cx>
|
||||||
|
* tools/notify-send.c (main): Treat expiry times < current time
|
||||||
|
as timeouts from current instant
|
||||||
|
|
||||||
|
Sun Jul 4 22:54:44 GMT 2004 Mike Hearn <mike@navi.cx>
|
||||||
|
* libnotify/notify.c: Use a direct hash rather than an int hash
|
||||||
|
|
||||||
|
Sun Jul 04 14:32:46 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
- Don't make IDs of 0 bad. They just want to be loved, too.
|
||||||
|
|
||||||
|
Sun Jul 04 14:08:59 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* libnotify/notify.h:
|
||||||
|
* tools/notify-send.c:
|
||||||
|
* SPECIFICATION:
|
||||||
|
- Changed timeouts to expire times.
|
||||||
|
- Install notify-send.
|
||||||
|
|
||||||
|
Sun Jul 04 13:46:32 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* tools/notify-send.c:
|
||||||
|
- Don't initialize the library until we're ready to talk to it.
|
||||||
|
|
||||||
|
Sun Jul 04 13:34:14 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* SPECIFICATION:
|
||||||
|
- Added the urgency level to the spec, and made it a byte.
|
||||||
|
|
||||||
|
Sun Jul 04 13:28:51 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
A tools/:
|
||||||
|
R tests/:
|
||||||
|
* Makefile.am:
|
||||||
|
* configure.ac:
|
||||||
|
- Renamed tests to tools.
|
||||||
|
|
||||||
|
Sun Jul 04 13:28:00 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* tests/Makefile.am:
|
||||||
|
A tests/notify-send.c:
|
||||||
|
- Added the notify-send tool.
|
||||||
|
|
||||||
|
Sat Jul 03 12:35:35 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* libnotify/notify.h:
|
||||||
|
- Added support for GetCapabilities.
|
||||||
|
|
||||||
|
Sat Jul 03 12:27:58 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* libnotify/notify.h:
|
||||||
|
- Add support for GetServerInformation.
|
||||||
|
|
||||||
|
Sat Jul 03 12:21:05 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
- Remove the application info sent on calls to Notify for now,
|
||||||
|
until/if something gets added to the spec about it.
|
||||||
|
|
||||||
|
Sat Jul 03 12:14:48 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* libnotify/notify.h:
|
||||||
|
- Removed the last of the request implementation.
|
||||||
|
- More work toward migrating the code to the specification.
|
||||||
|
- Simplified the action implementation a little bit.
|
||||||
|
|
||||||
|
Sat Jul 03 11:26:03 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* libnotify/notify.h:
|
||||||
|
- Cleaned up some things and updated some stuff to be compliant with
|
||||||
|
the spec. More will come soon.
|
||||||
|
|
||||||
|
Thu Jul 1 23:46:28 GMT 2004 Mike Hearn <mike@navi.cx>
|
||||||
|
* SPECIFICATION: Add info on icons/sounds, add some
|
||||||
|
protocol requests. Change "buttons" in the overview to "actions".
|
||||||
|
|
||||||
|
Wed Jun 30 14:03:51 GMT 2004 Mike Hearn <mike@navi.cx>
|
||||||
|
* SPECIFICATION: Initial version
|
||||||
|
|
||||||
|
Wed Jun 30 13:28:18 GMT 2004 Mike Hearn <mike@navi.cx>
|
||||||
|
* libnotify/notify.[ch]: Add file variables for emacs to match
|
||||||
|
the settings Christian is using.
|
||||||
|
|
||||||
|
Wed Jun 30 02:53:36 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
- Free up the handle memory for a closed notification.
|
||||||
|
|
||||||
|
Tue Jun 29 19:33:43 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* libnotify/notify.h:
|
||||||
|
- Due to the new icon struct, a lot of redundant functions have now
|
||||||
|
been removed.
|
||||||
|
|
||||||
|
Tue Jun 29 19:26:58 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* libnotify/notify.h:
|
||||||
|
- Added a NotifyIcon struct and the beginnings of the API.
|
||||||
|
|
||||||
|
Tue Jun 29 18:49:38 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* libnotify/notify.h:
|
||||||
|
- Replaced the guint32 ID numbers that were passed around to represent
|
||||||
|
notifications and requests and replaced them with an opaque data
|
||||||
|
structure that abstracts that and other stuff.
|
||||||
|
|
||||||
|
Tue Jun 29 18:21:05 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
- Changed 8 space to 4 space tabs.
|
||||||
|
|
||||||
|
Tue Jun 29 14:49:51 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
- Patch by Mike Hearn to add a print_error() function for dumping
|
||||||
|
extra info when we have an error.
|
||||||
|
|
||||||
|
Sun Jun 27 21:50:33 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* configure.ac:
|
||||||
|
- Pass 0.0.1 as the version number to AC_INIT().
|
||||||
|
|
||||||
|
Sun Jun 27 21:39:13 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
- Added support for the NotificationClosed and RequestClosed signals,
|
||||||
|
along with request callbacks. I wonder if any of this works.
|
||||||
|
|
||||||
|
Sun Jun 27 20:23:00 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
- Keep track of request IDs so that we can do callback stuff in a bit.
|
||||||
|
|
||||||
|
Sun Jun 27 20:02:09 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
- Send the list of button texts as a string array, rather than appending
|
||||||
|
each one individually.
|
||||||
|
|
||||||
|
Sun Jun 27 18:30:19 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* libnotify/notify.h:
|
||||||
|
- Split notify_close() into notify_close_notification() and
|
||||||
|
notify_close_request().
|
||||||
|
- Implement notify_send_request() and
|
||||||
|
notify_send_request_with_icon_data(), and add versions of those
|
||||||
|
functions that take a va_list for the buttons.
|
||||||
|
|
||||||
|
Sun Jun 27 16:46:32 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
- Added a utility function for doing most of the D-BUS message
|
||||||
|
creation.
|
||||||
|
- Implemented notify_close_notification() and notify_close_request().
|
||||||
|
|
||||||
|
Sun Jun 27 16:38:42 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
- Make sure we include our config.h if we have one.
|
||||||
|
|
||||||
|
Sun Jun 27 16:37:30 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* libnotify/notify.h:
|
||||||
|
- Added the initial header file and connection code.
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
|
||||||
|
|
||||||
|
SUBDIRS = libnotify docs tools
|
||||||
|
if TESTS_ENABLED
|
||||||
|
SUBDIRS += tests
|
||||||
|
endif
|
||||||
|
|
||||||
|
pcdata_DATA = libnotify.pc
|
||||||
|
pcdatadir = $(libdir)/pkgconfig
|
||||||
|
|
||||||
|
EXTRA_DIST = \
|
||||||
|
AUTHORS NEWS INSTALL COPYING README \
|
||||||
|
ChangeLog \
|
||||||
|
autogen.sh \
|
||||||
|
configure.ac \
|
||||||
|
libnotify.pc.in
|
||||||
|
|
||||||
|
$(OBJECTS): libtool
|
||||||
|
libtool: $(LIBTOOL_DEPS)
|
||||||
|
$(SHELL) ./config.status --recheck
|
||||||
|
|
||||||
|
doxygen:
|
||||||
|
@echo "Running doxygen..."
|
||||||
|
@doxygen Doxyfile
|
||||||
|
|
||||||
|
DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
|
||||||
|
|
||||||
|
MAINTAINERCLEANFILES = \
|
||||||
|
$(srcdir)/INSTALL \
|
||||||
|
$(srcdir)/aclocal.m4 \
|
||||||
|
$(srcdir)/autoscan.log \
|
||||||
|
$(srcdir)/compile \
|
||||||
|
$(srcdir)/config.guess \
|
||||||
|
$(srcdir)/config.h.in \
|
||||||
|
$(srcdir)/config.sub \
|
||||||
|
$(srcdir)/configure.scan \
|
||||||
|
$(srcdir)/depcomp \
|
||||||
|
$(srcdir)/install-sh \
|
||||||
|
$(srcdir)/ltmain.sh \
|
||||||
|
$(srcdir)/missing \
|
||||||
|
$(srcdir)/mkinstalldirs \
|
||||||
|
$(srcdir)/omf.make \
|
||||||
|
$(srcdir)/xmldocs.make \
|
||||||
|
$(srcdir)/gtk-doc.make \
|
||||||
|
$(srcdir)/ChangeLog \
|
||||||
|
`find "$(srcdir)" -type f -name Makefile.in -print`
|
||||||
|
|
||||||
|
|
||||||
|
-include $(top_srcdir)/git.mk
|
87
NEWS
87
NEWS
|
@ -1,90 +1,3 @@
|
||||||
New in 0.8.1
|
|
||||||
============
|
|
||||||
|
|
||||||
* Keep version of bindings at 0.7 (#27) [Marco]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Marco Trevisan
|
|
||||||
|
|
||||||
New in 0.8.0
|
|
||||||
============
|
|
||||||
|
|
||||||
* Use Desktop Portal Notification when running confined (snap and flatpak)
|
|
||||||
Now the library acts like a wrapper in such scenario, with some limited
|
|
||||||
capabilities, but this will enforce security and user control over the
|
|
||||||
allowed notifications. [Marco]
|
|
||||||
* notify-send: Handles SIGINT gracefully, closing waiting notification [Marco]
|
|
||||||
* Use NotifyClosedReason enum as closed reason return value [Marco]
|
|
||||||
* Bump dependency on GLib 2.38 [Marco]
|
|
||||||
* Various introspection docs improvements and fixes [Marco]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Marco Trevisan
|
|
||||||
|
|
||||||
New in 0.7.12
|
|
||||||
=============
|
|
||||||
|
|
||||||
* docs/notify-send: Add --transient option to manpage [Marco]
|
|
||||||
* notify-send: Move server capabilities check to a separate function [Marco]
|
|
||||||
* notify-send: Add debug message about server not supporting persistence
|
|
||||||
[Marco]
|
|
||||||
* notification: Include sender-pid hint by default if not provided [Marco]
|
|
||||||
* Delete unused notifynotification.xml [Patrick; !25]
|
|
||||||
* notification: Bookend calling NotifyActionCallback with temporary ref
|
|
||||||
[Logan; #25, !26]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Marco Trevisan, Patrick Griffis, Logan Rathbone
|
|
||||||
|
|
||||||
New in 0.7.11
|
|
||||||
=============
|
|
||||||
* Fix potential build errors with old glib version we require
|
|
||||||
* notify-send: Add support for boolean hints
|
|
||||||
* notify-send: Support passing any hint value, by parsing variant strings
|
|
||||||
* notify-send: Add explicit option to create transient notifications
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Marco Trevisan
|
|
||||||
|
|
||||||
New in 0.7.10
|
|
||||||
=============
|
|
||||||
* notify-send: Support commas in icon filenames [Thorsten; !15]
|
|
||||||
* notify-send: Give failing exit code if showing notification fails [Ray, !13]
|
|
||||||
* notify-send: Support for replacing an existing notification [Paul; !17]
|
|
||||||
* notify-send: Add option to wait until notification has been closed [Ben; !18]
|
|
||||||
* notify-send: Add support for notification actions and responses [Ben; !18]
|
|
||||||
* notification: Send the application ID when possible [Corentin; !1]
|
|
||||||
* notification: Use g_memdup2 when available [Marco; !22]
|
|
||||||
* notification: Improve SNAP detection and confined desktop ID [Marco; !23]
|
|
||||||
* notification: Add support for getting actions activation token [Marco; !24]
|
|
||||||
* notify: Use application ID if any to set the fallback app name [Marco; !18]
|
|
||||||
* Build fixes and improvements [Marco; !22]
|
|
||||||
* Docs updates [Boris, David; !14, !20]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Marco Trevisan, Boris Shtrasman, Matthias Sweertvaegher, Thorsten Wißmann,
|
|
||||||
Ray Strode, Maximiliano Sandoval R, David King, Corentin Noël, Paul Collins,
|
|
||||||
Matthias Sweertvaegher, Ben Blain
|
|
||||||
|
|
||||||
New in 0.7.9
|
|
||||||
============
|
|
||||||
* Fixed linking in darwin [Iain, Marco; !5]
|
|
||||||
* Added man page for notify-send [Jan; !6]
|
|
||||||
* Dropped autotools [Jan; !11]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Iain Lane, Jan Tojnar, Marco Trevisan
|
|
||||||
|
|
||||||
New in 0.7.8
|
|
||||||
============
|
|
||||||
* Support meson build system [Marco; !3]
|
|
||||||
* notify-send: Support full URLs as hint values [Marco; !4]
|
|
||||||
* Mic. bug fixes [Ting-Wei, Florian; #760438, !8]
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
Emmanuele Bassi, Abderrahim Kitouni, Ting-Wei Lan, Iain Lane, Florian Müllner,
|
|
||||||
Jan Tojnar, Marco Trevisan (Treviño), Marco Trevisan
|
|
||||||
|
|
||||||
New in 0.7.7
|
New in 0.7.7
|
||||||
============
|
============
|
||||||
|
|
||||||
|
|
20
README.md
20
README.md
|
@ -1,20 +0,0 @@
|
||||||
# libnotify
|
|
||||||
|
|
||||||
## Description
|
|
||||||
|
|
||||||
libnotify is a library for sending desktop notifications to a notification
|
|
||||||
daemon, as defined in the [org.freedesktop.Notifications][fdo-spec] Desktop
|
|
||||||
Specification. These notifications can be used to inform the user about an event
|
|
||||||
or display some form of information without getting in the user's way.
|
|
||||||
|
|
||||||
It is also a simple wrapper to send cross-desktop Notifications for sandboxed
|
|
||||||
applications using the [XDG Portal Notification API][portal].
|
|
||||||
|
|
||||||
## Notice
|
|
||||||
|
|
||||||
For GLib based applications the [GNotification][gnotif] API should be used
|
|
||||||
instead.
|
|
||||||
|
|
||||||
[fdo-spec]: https://specifications.freedesktop.org/notification-spec/notification-spec-latest.html
|
|
||||||
[gnotif]: https://docs.gtk.org/gio/class.Notification.html
|
|
||||||
[portal]: https://github.com/flatpak/xdg-desktop-portal/blob/main/data/org.freedesktop.portal.Notification.xml
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# Run this to generate all the initial makefiles, etc.
|
||||||
|
|
||||||
|
srcdir=`dirname $0`
|
||||||
|
test -z "$srcdir" && srcdir=.
|
||||||
|
|
||||||
|
PKG_NAME="libnotify"
|
||||||
|
|
||||||
|
(test -f $srcdir/configure.ac \
|
||||||
|
&& test -d $srcdir/libnotify) || {
|
||||||
|
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
|
||||||
|
echo " top-level $PKG_NAME directory"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
which gnome-autogen.sh || {
|
||||||
|
echo "You need to install gnome-common."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
. gnome-autogen.sh
|
|
@ -0,0 +1,223 @@
|
||||||
|
dnl Process this file with autoconf to create configure.
|
||||||
|
|
||||||
|
dnl ################################################################
|
||||||
|
dnl # Initialize autoconf
|
||||||
|
dnl ################################################################
|
||||||
|
AC_INIT([libnotify],
|
||||||
|
[0.7.7],
|
||||||
|
[https://gitlab.gnome.org/GNOME/libnotify/issues],
|
||||||
|
[libnotify])
|
||||||
|
AC_PREREQ([2.63])
|
||||||
|
|
||||||
|
AC_CONFIG_HEADERS([config.h])
|
||||||
|
AC_CONFIG_SRCDIR([configure.ac])
|
||||||
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
|
AC_CONFIG_AUX_DIR([build-aux])
|
||||||
|
|
||||||
|
dnl ################################################################
|
||||||
|
dnl # Version information
|
||||||
|
dnl ################################################################
|
||||||
|
LIBNOTIFY_MAJOR_VERSION=0
|
||||||
|
LIBNOTIFY_MINOR_VERSION=7
|
||||||
|
LIBNOTIFY_MICRO_VERSION=7
|
||||||
|
LIBNOTIFY_DEVEL_VERSION=0
|
||||||
|
|
||||||
|
AC_SUBST(LIBNOTIFY_MAJOR_VERSION)
|
||||||
|
AC_SUBST(LIBNOTIFY_MINOR_VERSION)
|
||||||
|
AC_SUBST(LIBNOTIFY_MICRO_VERSION)
|
||||||
|
|
||||||
|
LIBNOTIFY_VERSION=$LIBNOTIFY_MAJOR_VERSION.$LIBNOTIFY_MINOR_VERSION.$LIBNOTIFY_MICRO_VERSION
|
||||||
|
|
||||||
|
if test "x$LIBNOTIFY_DEVEL_VERSION" != "x0"; then
|
||||||
|
LIBNOTIFY_VERSION=$LIBNOTIFY_VERSION.$LIBNOTIFY_DEVEL_VERSION
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_DEFINE_UNQUOTED(LIBNOTIFY_MAJOR_VERSION, $LIBNOTIFY_MAJOR_VERSION,
|
||||||
|
[libnotify major version.])
|
||||||
|
AC_DEFINE_UNQUOTED(LIBNOTIFY_MINOR_VERSION, $LIBNOTIFY_MINOR_VERSION,
|
||||||
|
[libnotify minor version.])
|
||||||
|
AC_DEFINE_UNQUOTED(LIBNOTIFY_MICRO_VERSION, $LIBNOTIFY_MICRO_VERSION,
|
||||||
|
[libnotify micro version.])
|
||||||
|
AC_DEFINE_UNQUOTED(LIBNOTIFY_VERSION, "$LIBNOTIFY_VERSION",
|
||||||
|
[libnotify version.])
|
||||||
|
|
||||||
|
|
||||||
|
dnl ################################################################
|
||||||
|
dnl # libtool versioning
|
||||||
|
dnl ################################################################
|
||||||
|
dnl #
|
||||||
|
dnl # +1 : 0 : +1 == new interface that does not break old one.
|
||||||
|
dnl # +1 : 0 : 0 == removed an interface. Breaks old apps.
|
||||||
|
dnl # ? : +1 : ? == internal changes that doesn't break anything.
|
||||||
|
dnl #
|
||||||
|
dnl # CURRENT : REVISION : AGE
|
||||||
|
dnl #
|
||||||
|
LT_CURRENT=4
|
||||||
|
LT_REVISION=0
|
||||||
|
LT_AGE=0
|
||||||
|
|
||||||
|
LT_RELEASE=$LIBNOTIFY_MAJOR_VERSION.$LIBNOTIFY_MINOR_VERSION.$LIBNOTIFY_MICRO_VERSION
|
||||||
|
|
||||||
|
AC_SUBST(LT_RELEASE)
|
||||||
|
AC_SUBST(LT_CURRENT)
|
||||||
|
AC_SUBST(LT_REVISION)
|
||||||
|
AC_SUBST(LT_AGE)
|
||||||
|
|
||||||
|
dnl ################################################################
|
||||||
|
dnl # Initialize automake
|
||||||
|
dnl ################################################################
|
||||||
|
AM_INIT_AUTOMAKE([1.10 no-dist-gzip dist-bzip2])
|
||||||
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||||
|
|
||||||
|
dnl ################################################################
|
||||||
|
dnl # Check for some standard stuff.
|
||||||
|
dnl ################################################################
|
||||||
|
AC_PROG_CC
|
||||||
|
AC_PROG_CPP
|
||||||
|
AC_PROG_MAKE_SET
|
||||||
|
AC_PROG_LN_S
|
||||||
|
AC_PROG_INSTALL
|
||||||
|
|
||||||
|
AC_C_CONST
|
||||||
|
AC_TYPE_SIZE_T
|
||||||
|
AC_EXEEXT
|
||||||
|
|
||||||
|
# Initialize libtool
|
||||||
|
LT_PREREQ([2.2])
|
||||||
|
LT_INIT
|
||||||
|
|
||||||
|
REQ_GTK_VERSION=2.90
|
||||||
|
REQ_GLIB_VERSION=2.26.0
|
||||||
|
|
||||||
|
pkg_modules="gdk-pixbuf-2.0 glib-2.0 >= $REQ_GLIB_VERSION gio-2.0 >= $REQ_GLIB_VERSION"
|
||||||
|
AC_SUBST([pkg_modules])
|
||||||
|
PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
|
||||||
|
|
||||||
|
tests_modules="gtk+-3.0 >= $REQ_GTK_VERSION"
|
||||||
|
AC_ARG_ENABLE(tests,
|
||||||
|
[AS_HELP_STRING([--disable-tests],
|
||||||
|
[Do not build tests])],
|
||||||
|
,enable_tests=yes)
|
||||||
|
if test x$enable_tests = xyes ; then
|
||||||
|
PKG_CHECK_MODULES(TESTS, [$tests_modules])
|
||||||
|
fi
|
||||||
|
AM_CONDITIONAL(TESTS_ENABLED, test x$enable_tests = xyes)
|
||||||
|
|
||||||
|
GLIB_GENMARSHAL=`${PKG_CONFIG} --variable=glib_genmarshal glib-2.0`
|
||||||
|
AC_SUBST(GLIB_GENMARSHAL)
|
||||||
|
|
||||||
|
GOBJECT_INTROSPECTION_CHECK([0.9.12])
|
||||||
|
|
||||||
|
dnl ################################################################
|
||||||
|
dnl # Set up gtk-doc
|
||||||
|
dnl ################################################################
|
||||||
|
GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
|
||||||
|
|
||||||
|
dnl ---------------------------------------------------------------------------
|
||||||
|
dnl - DocBook Documentation
|
||||||
|
dnl ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(docbook-docs,
|
||||||
|
[AS_HELP_STRING([--enable-docbook-docs],
|
||||||
|
[build documentation (requires xmlto)])],
|
||||||
|
enable_docbook_docs=$enableval,enable_docbook_docs=no)
|
||||||
|
AC_PATH_PROG(XMLTO, xmlto, no)
|
||||||
|
AC_MSG_CHECKING([whether to build DocBook documentation])
|
||||||
|
if test x$XMLTO = xno ; then
|
||||||
|
have_docbook=no
|
||||||
|
else
|
||||||
|
have_docbook=yes
|
||||||
|
fi
|
||||||
|
if test x$enable_docbook_docs = xauto ; then
|
||||||
|
if test x$have_docbook = xno ; then
|
||||||
|
enable_docbook_docs=no
|
||||||
|
else
|
||||||
|
enable_docbook_docs=yes
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if test x$enable_docbook_docs = xyes; then
|
||||||
|
if test x$have_docbook = xno; then
|
||||||
|
AC_MSG_ERROR([Building DocBook docs explicitly required, but DocBook not found])
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
AM_CONDITIONAL(DOCBOOK_DOCS_ENABLED, test x$enable_docbook_docs = xyes)
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
|
||||||
|
AC_ARG_VAR([XMLTO],[Define/override the `xmlto' location.])
|
||||||
|
AC_ARG_VAR([XMLTO_FLAGS],[Define/override `xmlto' options, like `--skip-validation'.])
|
||||||
|
|
||||||
|
|
||||||
|
# Turn on the additional warnings last
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(more-warnings,
|
||||||
|
AS_HELP_STRING([--enable-more-warnings],
|
||||||
|
[Maximum compiler warnings]),
|
||||||
|
set_more_warnings="$enableval",[
|
||||||
|
if test -d $srcdir/.git; then
|
||||||
|
set_more_warnings=yes
|
||||||
|
else
|
||||||
|
set_more_warnings=no
|
||||||
|
fi])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(for more warnings)
|
||||||
|
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
CFLAGS="\
|
||||||
|
-Wall \
|
||||||
|
-Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
|
||||||
|
-Wnested-externs -Wpointer-arith \
|
||||||
|
-Wcast-align -Wsign-compare -Wp,-D_FORTIFY_SOURCE=2 \
|
||||||
|
$CFLAGS"
|
||||||
|
|
||||||
|
for option in -Wno-strict-aliasing -Wno-sign-compare; do
|
||||||
|
SAVE_CFLAGS="$CFLAGS"
|
||||||
|
CFLAGS="$CFLAGS $option"
|
||||||
|
AC_MSG_CHECKING([whether gcc understands $option])
|
||||||
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||||
|
[has_option=yes],
|
||||||
|
[has_option=no])
|
||||||
|
if test $has_option = no; then
|
||||||
|
CFLAGS="$SAVE_CFLAGS"
|
||||||
|
fi
|
||||||
|
AC_MSG_RESULT($has_option)
|
||||||
|
unset has_option
|
||||||
|
unset SAVE_CFLAGS
|
||||||
|
done
|
||||||
|
unset option
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_SUBST(CFLAGS)
|
||||||
|
|
||||||
|
dnl ################################################################
|
||||||
|
dnl # Output the Makefiles
|
||||||
|
dnl ################################################################
|
||||||
|
AC_CONFIG_FILES([
|
||||||
|
Makefile
|
||||||
|
docs/Makefile
|
||||||
|
docs/reference/Makefile
|
||||||
|
libnotify.pc
|
||||||
|
libnotify/Makefile
|
||||||
|
libnotify/notify-features.h
|
||||||
|
tests/Makefile
|
||||||
|
tools/Makefile
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_OUTPUT
|
||||||
|
|
||||||
|
echo "
|
||||||
|
$PACKAGE $VERSION
|
||||||
|
========================
|
||||||
|
|
||||||
|
prefix: ${prefix}
|
||||||
|
exec_prefix: ${exec_prefix}
|
||||||
|
bindir: ${bindir}
|
||||||
|
datadir: ${datadir}
|
||||||
|
source code location: ${srcdir}
|
||||||
|
cflags: ${CFLAGS}
|
||||||
|
|
||||||
|
Build tests: ${enable_tests}
|
||||||
|
Build docs: ${enable_docbook_docs}
|
||||||
|
|
||||||
|
"
|
|
@ -0,0 +1,26 @@
|
||||||
|
NULL =
|
||||||
|
|
||||||
|
SUBDIRS = reference
|
||||||
|
|
||||||
|
SPEC_XML_FILES = \
|
||||||
|
config.xsl \
|
||||||
|
notification-spec.xml \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
if DOCBOOK_DOCS_ENABLED
|
||||||
|
|
||||||
|
htmldocdir = $(docdir)/spec
|
||||||
|
htmldoc_DATA = notification-spec.html
|
||||||
|
|
||||||
|
notification-spec.html: $(SPEC_XML_FILES)
|
||||||
|
$(XMLTO) $(XMLTO_FLAGS) xhtml-nochunks -m config.xsl notification-spec.xml
|
||||||
|
|
||||||
|
endif # DOCBOOK_DOCS_ENABLED
|
||||||
|
|
||||||
|
|
||||||
|
EXTRA_DIST = \
|
||||||
|
ChangeLog \
|
||||||
|
$(SPEC_XML_FILES) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
-include $(top_srcdir)/git.mk
|
|
@ -3,5 +3,4 @@
|
||||||
xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
||||||
version="1.0">
|
version="1.0">
|
||||||
<xsl:param name="html.stylesheet" select="'docbook.css'"/>
|
<xsl:param name="html.stylesheet" select="'docbook.css'"/>
|
||||||
<xsl:param name="generate.consistent.ids" select="1"/>
|
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
|
|
@ -25,16 +25,3 @@ endif
|
||||||
if get_option('gtk_doc')
|
if get_option('gtk_doc')
|
||||||
subdir('reference')
|
subdir('reference')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if get_option('man')
|
|
||||||
manpages = ['notify-send']
|
|
||||||
|
|
||||||
foreach page : manpages
|
|
||||||
custom_target(page + '-man',
|
|
||||||
input: page + '.xml',
|
|
||||||
output: page + '.1',
|
|
||||||
command: xsltproc_command,
|
|
||||||
install: true,
|
|
||||||
install_dir: man1dir)
|
|
||||||
endforeach
|
|
||||||
endif
|
|
||||||
|
|
|
@ -1272,65 +1272,6 @@
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
</sect3>
|
</sect3>
|
||||||
|
|
||||||
<sect3 id="signal-activation-token">
|
|
||||||
<title><literal>org.freedesktop.Notifications.ActivationToken</literal></title>
|
|
||||||
<funcsynopsis>
|
|
||||||
<funcprototype>
|
|
||||||
<funcdef>
|
|
||||||
<function>org.freedesktop.Notifications.ActivationToken</function>
|
|
||||||
</funcdef>
|
|
||||||
<paramdef>UINT32 <parameter>id</parameter></paramdef>
|
|
||||||
<paramdef>STRING <parameter>activation_token</parameter></paramdef>
|
|
||||||
</funcprototype>
|
|
||||||
</funcsynopsis>
|
|
||||||
<para>
|
|
||||||
This signal can be emitted before a <literal>ActionInvoked</literal>
|
|
||||||
signal. It carries an activation token that can be used to activate a
|
|
||||||
toplevel.
|
|
||||||
</para>
|
|
||||||
<table>
|
|
||||||
<title>ActivationToken Parameters</title>
|
|
||||||
<tgroup cols="2">
|
|
||||||
<thead>
|
|
||||||
<row>
|
|
||||||
<entry>Name</entry>
|
|
||||||
<entry>Type</entry>
|
|
||||||
<entry>Description</entry>
|
|
||||||
</row>
|
|
||||||
</thead>
|
|
||||||
<tbody valign="top">
|
|
||||||
<row>
|
|
||||||
<entry><parameter>id</parameter></entry>
|
|
||||||
<entry>UINT32</entry>
|
|
||||||
<entry>
|
|
||||||
The ID of the notification emitting the <literal>ActionInvoked</literal>
|
|
||||||
signal.
|
|
||||||
</entry>
|
|
||||||
</row>
|
|
||||||
<row>
|
|
||||||
<entry><parameter>activation_token</parameter></entry>
|
|
||||||
<entry>STRING</entry>
|
|
||||||
<entry>
|
|
||||||
An activation token. This can be either an X11-style startup ID (see
|
|
||||||
<ulink url="https://specifications.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">Startup notification protocol</ulink>)
|
|
||||||
or a
|
|
||||||
<ulink url="https://gitlab.freedesktop.org/wayland/wayland-protocols/-/tree/main/staging/xdg-activation">Wayland xdg-activation</ulink>
|
|
||||||
token.
|
|
||||||
</entry>
|
|
||||||
</row>
|
|
||||||
</tbody>
|
|
||||||
</tgroup>
|
|
||||||
</table>
|
|
||||||
<note>
|
|
||||||
<para>
|
|
||||||
Clients should not assume the server will generate this signal. Some
|
|
||||||
servers may not support user interaction at all, or may not support
|
|
||||||
the concept of being able to generate an activation token for a
|
|
||||||
notification.
|
|
||||||
</para>
|
|
||||||
</note>
|
|
||||||
</sect3>
|
|
||||||
</sect2>
|
</sect2>
|
||||||
</sect1>
|
</sect1>
|
||||||
</article>
|
</article>
|
||||||
|
|
|
@ -1,138 +0,0 @@
|
||||||
<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<info>
|
|
||||||
<date>November 2005</date>
|
|
||||||
<productname>libnotify</productname>
|
|
||||||
<authorgroup>
|
|
||||||
<author>
|
|
||||||
<personname>Andre Filipe de Assuncao e Brito</personname>
|
|
||||||
<email>decko@noisemakers.org</email>
|
|
||||||
<contrib>Original author</contrib>
|
|
||||||
</author>
|
|
||||||
<author>
|
|
||||||
<personname>Paul van Tilburg</personname>
|
|
||||||
<email>paulvt@debian.org</email>
|
|
||||||
<contrib>Original author</contrib>
|
|
||||||
</author>
|
|
||||||
<author>
|
|
||||||
<personname>Riccardo Setti</personname>
|
|
||||||
<email>giskard@debian.org</email>
|
|
||||||
<contrib>Original author</contrib>
|
|
||||||
</author>
|
|
||||||
</authorgroup>
|
|
||||||
</info>
|
|
||||||
<refmeta>
|
|
||||||
<refentrytitle>notify-send</refentrytitle>
|
|
||||||
<manvolnum>1</manvolnum>
|
|
||||||
<refmiscinfo class="manual">User Commands</refmiscinfo>
|
|
||||||
</refmeta>
|
|
||||||
<refnamediv>
|
|
||||||
<refname>notify-send</refname>
|
|
||||||
<refpurpose>a program to send desktop notifications</refpurpose>
|
|
||||||
</refnamediv>
|
|
||||||
<refsynopsisdiv>
|
|
||||||
<cmdsynopsis>
|
|
||||||
<command>notify-send</command>
|
|
||||||
<arg choice="opt">
|
|
||||||
<replaceable>OPTIONS</replaceable>
|
|
||||||
</arg>
|
|
||||||
<arg choice="req">
|
|
||||||
<replaceable>summary</replaceable>
|
|
||||||
</arg>
|
|
||||||
<arg choice="opt">
|
|
||||||
<replaceable>body</replaceable>
|
|
||||||
</arg>
|
|
||||||
</cmdsynopsis>
|
|
||||||
</refsynopsisdiv>
|
|
||||||
<refsection>
|
|
||||||
<info><title>Description</title></info>
|
|
||||||
|
|
||||||
<para>With <command>notify-send</command> you can send desktop notifications to the user via a notification daemon from the command line. These notifications can be used to inform the user about an event or display some form of information without getting in the user’s way.</para>
|
|
||||||
</refsection>
|
|
||||||
<refsection>
|
|
||||||
<info><title>Options</title></info>
|
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term><option>-?</option>, <option>--help</option></term>
|
|
||||||
<listitem>
|
|
||||||
<para>Show help and exit.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term><option>-a</option>, <option>--app-name</option>=<replaceable>APP_NAME</replaceable></term>
|
|
||||||
<listitem>
|
|
||||||
<para>Specifies the app name for the notification.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term><option>-A</option>, <option>--action</option>=[<replaceable>NAME</replaceable>=]<replaceable>Text...</replaceable></term>
|
|
||||||
<listitem>
|
|
||||||
<para>Specifies the actions to display to the user. Implies <option>--wait</option> to wait for user input. May be set multiple times. The <replaceable>NAME</replaceable> of the action is output to <literal>stdout</literal>. If <replaceable>NAME</replaceable> is not specified, the numerical index of the option is used (starting with <literal>1</literal>).</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term><option>-u</option>, <option>--urgency</option>=<replaceable>LEVEL</replaceable></term>
|
|
||||||
<listitem>
|
|
||||||
<para>Specifies the urgency level (<literal>low</literal>, <literal>normal</literal>, <literal>critical</literal>).</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term><option>-t</option>, <option>--expire-time</option>=<replaceable>TIME</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>The duration, in milliseconds, for the notification to appear on screen.</para>
|
|
||||||
<para>Not all implementations use this parameter. GNOME Shell and Notify OSD always ignore it, while Plasma ignores it for notifications with the critical urgency level.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term><option>-i</option>, <option>--icon</option>=<replaceable>ICON</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>Specifies an icon filename or stock icon to display.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term><option>-c</option>, <option>--category</option>=<replaceable>TYPE</replaceable>[,<replaceable>TYPE</replaceable>…]
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>Specifies the notification category.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term><option>-h</option>, <option>--hint</option>=<replaceable>TYPE</replaceable>:<replaceable>NAME</replaceable>:<replaceable>VALUE</replaceable> </term>
|
|
||||||
<listitem>
|
|
||||||
<para>Specifies basic extra data to pass. Valid types are <literal>BOOLEAN</literal>, <literal>INT</literal>, <literal>DOUBLE</literal>, <literal>STRING</literal>, <literal>BYTE</literal> and <literal>VARIANT</literal>.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term><option>-p</option>, <option>--print-id</option></term>
|
|
||||||
<listitem>
|
|
||||||
<para>Print the notification ID.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term><option>-r</option>, <option>--replace-id</option>=<replaceable>REPLACE_ID</replaceable></term>
|
|
||||||
<listitem>
|
|
||||||
<para>The ID of the notification to replace.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term><option>-w</option>, <option>--wait</option></term>
|
|
||||||
<listitem>
|
|
||||||
<para>Wait for the notification to be closed before exiting. If the <option>expire-time</option> is set, it will be used as the maximum waiting time.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term><option>-e</option>, <option>--transient</option></term>
|
|
||||||
<listitem>
|
|
||||||
<para>Show a transient notification. Transient notifications by-pass the server's persistence capability, if any. And so it won't be preserved until the user acknowledges it.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
|
||||||
</refsection>
|
|
||||||
<refsection>
|
|
||||||
<info><title>See also</title></info>
|
|
||||||
|
|
||||||
<para>The Desktop Notification Spec on <link xlink:href="https://specifications.freedesktop.org/notification-spec/">https://specifications.freedesktop.org/notification-spec/</link>.</para>
|
|
||||||
</refsection>
|
|
||||||
</refentry>
|
|
|
@ -0,0 +1,83 @@
|
||||||
|
## Process this file with automake to produce Makefile.in
|
||||||
|
|
||||||
|
# We require automake 1.6 at least.
|
||||||
|
AUTOMAKE_OPTIONS = 1.6
|
||||||
|
|
||||||
|
# This is a blank Makefile.am for using gtk-doc.
|
||||||
|
# Copy this to your project's API docs directory and modify the variables to
|
||||||
|
# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples
|
||||||
|
# of using the various options.
|
||||||
|
|
||||||
|
# The name of the module, e.g. 'glib'.
|
||||||
|
DOC_MODULE=libnotify
|
||||||
|
|
||||||
|
# The top-level SGML file. You can change this if you want to.
|
||||||
|
DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
|
||||||
|
|
||||||
|
# The directory containing the source code. Relative to $(srcdir).
|
||||||
|
# gtk-doc will search all .c & .h files beneath here for inline comments
|
||||||
|
# documenting the functions and macros.
|
||||||
|
# e.g. DOC_SOURCE_DIR=../../../gtk
|
||||||
|
DOC_SOURCE_DIR=../../libnotify
|
||||||
|
|
||||||
|
# Extra options to pass to gtkdoc-scangobj. Not normally needed.
|
||||||
|
SCANGOBJ_OPTIONS=
|
||||||
|
|
||||||
|
# Extra options to supply to gtkdoc-scan.
|
||||||
|
# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
|
||||||
|
SCAN_OPTIONS=--deprecated-guards="LIBNOTIFY_DISABLE_DEPRECATED"
|
||||||
|
|
||||||
|
# Extra options to supply to gtkdoc-mkdb.
|
||||||
|
# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml
|
||||||
|
MKDB_OPTIONS=--sgml-mode --output-format=xml
|
||||||
|
|
||||||
|
# Extra options to supply to gtkdoc-mktmpl
|
||||||
|
# e.g. MKTMPL_OPTIONS=--only-section-tmpl
|
||||||
|
MKTMPL_OPTIONS=
|
||||||
|
|
||||||
|
# Extra options to supply to gtkdoc-fixref. Not normally needed.
|
||||||
|
# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
|
||||||
|
FIXXREF_OPTIONS=
|
||||||
|
|
||||||
|
# Used for dependencies. The docs will be rebuilt if any of these change.
|
||||||
|
# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
|
||||||
|
# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
|
||||||
|
HFILE_GLOB=$(top_srcdir)/libnotify/*.h
|
||||||
|
CFILE_GLOB=$(top_srcdir)/libnotify/*.c
|
||||||
|
|
||||||
|
# Header files to ignore when scanning.
|
||||||
|
# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h
|
||||||
|
IGNORE_HFILES= \
|
||||||
|
notify-enum-types.h \
|
||||||
|
notify-marshal.h \
|
||||||
|
internal.h
|
||||||
|
|
||||||
|
# Images to copy into HTML directory.
|
||||||
|
# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
|
||||||
|
HTML_IMAGES=
|
||||||
|
|
||||||
|
# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
|
||||||
|
# e.g. content_files=running.sgml building.sgml changes-2.0.sgml
|
||||||
|
content_files=
|
||||||
|
|
||||||
|
# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded
|
||||||
|
# These files must be listed here *and* in content_files
|
||||||
|
# e.g. expand_content_files=running.sgml
|
||||||
|
expand_content_files=
|
||||||
|
|
||||||
|
# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
|
||||||
|
# Only needed if you are using gtkdoc-scangobj to dynamically query widget
|
||||||
|
# signals and properties.
|
||||||
|
# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
|
||||||
|
# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
|
||||||
|
INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(PACKAGE_CFLAGS)
|
||||||
|
GTKDOC_LIBS=$(PACKAGE_LIBS) $(top_builddir)/libnotify/libnotify.la
|
||||||
|
|
||||||
|
# This includes the standard gtk-doc make rules, copied by gtkdocize.
|
||||||
|
include $(top_srcdir)/gtk-doc.make
|
||||||
|
|
||||||
|
# Other files to distribute
|
||||||
|
# e.g. EXTRA_DIST += version.xml.in
|
||||||
|
EXTRA_DIST +=
|
||||||
|
|
||||||
|
-include $(top_srcdir)/git.mk
|
|
@ -4,7 +4,6 @@ NOTIFY_EXPIRES_DEFAULT
|
||||||
NOTIFY_EXPIRES_NEVER
|
NOTIFY_EXPIRES_NEVER
|
||||||
<TITLE>NotifyNotification</TITLE>
|
<TITLE>NotifyNotification</TITLE>
|
||||||
NotifyNotification
|
NotifyNotification
|
||||||
NotifyClosedReason
|
|
||||||
NotifyUrgency
|
NotifyUrgency
|
||||||
NotifyActionCallback
|
NotifyActionCallback
|
||||||
NOTIFY_ACTION_CALLBACK
|
NOTIFY_ACTION_CALLBACK
|
||||||
|
@ -28,7 +27,6 @@ notify_notification_clear_hints
|
||||||
notify_notification_add_action
|
notify_notification_add_action
|
||||||
notify_notification_clear_actions
|
notify_notification_clear_actions
|
||||||
notify_notification_close
|
notify_notification_close
|
||||||
notify_notification_get_activation_token
|
|
||||||
notify_notification_get_closed_reason
|
notify_notification_get_closed_reason
|
||||||
<SUBSECTION Standard>
|
<SUBSECTION Standard>
|
||||||
NotifyNotificationPrivate
|
NotifyNotificationPrivate
|
||||||
|
|
|
@ -0,0 +1,184 @@
|
||||||
|
# git.mk
|
||||||
|
#
|
||||||
|
# Copyright 2009, Red Hat, Inc.
|
||||||
|
# Written by Behdad Esfahbod
|
||||||
|
#
|
||||||
|
# Copying and distribution of this file, with or without modification,
|
||||||
|
# are permitted in any medium without royalty provided the copyright
|
||||||
|
# notice and this notice are preserved.
|
||||||
|
#
|
||||||
|
# The canonical source for this file is pango/git.mk, or whereever the
|
||||||
|
# header of pango/git.mk suggests in the future.
|
||||||
|
#
|
||||||
|
# To use in your project, import this file in your git repo's toplevel,
|
||||||
|
# then do "make -f git.mk". This modifies all Makefile.am files in
|
||||||
|
# your project to include git.mk.
|
||||||
|
#
|
||||||
|
# This enables automatic .gitignore generation. If you need to ignore
|
||||||
|
# more files, add them to the GITIGNOREFILES variable in your Makefile.am.
|
||||||
|
# But think twice before doing that. If a file has to be in .gitignore,
|
||||||
|
# chances are very high that it's a generated file and should be in one
|
||||||
|
# of MOSTLYCLEANFILES, CLEANFILES, DISTCLEANFILES, or MAINTAINERCLEANFILES.
|
||||||
|
#
|
||||||
|
# The only case that you need to manually add a file to GITIGNOREFILES is
|
||||||
|
# when remove files in one of mostlyclean-local, clean-local, distclean-local,
|
||||||
|
# or maintainer-clean-local.
|
||||||
|
#
|
||||||
|
# Note that for files like editor backup, etc, there are better places to
|
||||||
|
# ignore them. See "man gitignore".
|
||||||
|
#
|
||||||
|
# If "make maintainer-clean" removes the files but they are not recognized
|
||||||
|
# by this script (that is, if "git status" shows untracked files still), send
|
||||||
|
# me the output of "git status" as well as your Makefile.am and Makefile for
|
||||||
|
# the directories involved.
|
||||||
|
#
|
||||||
|
# For a list of toplevel files that should be in MAINTAINERCLEANFILES, see
|
||||||
|
# pango/Makefile.am.
|
||||||
|
#
|
||||||
|
# Don't EXTRA_DIST this file. It is supposed to only live in git clones,
|
||||||
|
# not tarballs. It serves no useful purpose in tarballs and clutters the
|
||||||
|
# build dir.
|
||||||
|
#
|
||||||
|
# This file knows how to handle autoconf, automake, libtool, gtk-doc,
|
||||||
|
# gnome-doc-utils, intltool.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# KNOWN ISSUES:
|
||||||
|
#
|
||||||
|
# - Recursive configure doesn't work as $(top_srcdir)/git.mk inside the
|
||||||
|
# submodule doesn't find us. If you have configure.{in,ac} files in
|
||||||
|
# subdirs, add a proxy git.mk file in those dirs that simply does:
|
||||||
|
# "include $(top_srcdir)/../git.mk". Add more ..'s to your taste.
|
||||||
|
# And add those files to git. See vte/gnome-pty-helper/git.mk for
|
||||||
|
# example.
|
||||||
|
#
|
||||||
|
|
||||||
|
git-all: git-mk-install
|
||||||
|
|
||||||
|
git-mk-install:
|
||||||
|
@echo Installing git makefile
|
||||||
|
@any_failed=; find $(top_srcdir) -name Makefile.am | while read x; do \
|
||||||
|
if grep 'include .*/git.mk' $$x >/dev/null; then \
|
||||||
|
echo $$x already includes git.mk; \
|
||||||
|
else \
|
||||||
|
failed=; \
|
||||||
|
echo "Updating $$x"; \
|
||||||
|
{ cat $$x; \
|
||||||
|
echo ''; \
|
||||||
|
echo '-include $$(top_srcdir)/git.mk'; \
|
||||||
|
} > $$x.tmp || failed=1; \
|
||||||
|
if test x$$failed = x; then \
|
||||||
|
mv $$x.tmp $$x || failed=1; \
|
||||||
|
fi; \
|
||||||
|
if test x$$failed = x; then : else \
|
||||||
|
echo Failed updating $$x; >&2 \
|
||||||
|
any_failed=1; \
|
||||||
|
fi; \
|
||||||
|
fi; done; test -z "$$any_failed"
|
||||||
|
|
||||||
|
.PHONY: git-all git-mk-install
|
||||||
|
|
||||||
|
|
||||||
|
### .gitignore generation
|
||||||
|
|
||||||
|
$(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
|
||||||
|
$(AM_V_GEN) \
|
||||||
|
{ \
|
||||||
|
if test "x$(DOC_MODULE)" = x -o "x$(DOC_MAIN_SGML_FILE)" = x; then :; else \
|
||||||
|
for x in \
|
||||||
|
$(DOC_MODULE)-decl-list.txt \
|
||||||
|
$(DOC_MODULE)-decl.txt \
|
||||||
|
tmpl/$(DOC_MODULE)-unused.sgml \
|
||||||
|
"tmpl/*.bak" \
|
||||||
|
xml html \
|
||||||
|
; do echo /$$x; done; \
|
||||||
|
fi; \
|
||||||
|
if test "x$(DOC_MODULE)" = x -o "x$(DOC_LINGUAS)" = x; then :; else \
|
||||||
|
for x in \
|
||||||
|
$(_DOC_C_DOCS) \
|
||||||
|
$(_DOC_LC_DOCS) \
|
||||||
|
$(_DOC_OMF_ALL) \
|
||||||
|
$(_DOC_DSK_ALL) \
|
||||||
|
$(_DOC_HTML_ALL) \
|
||||||
|
$(_DOC_POFILES) \
|
||||||
|
"*/.xml2po.mo" \
|
||||||
|
"*/*.omf.out" \
|
||||||
|
; do echo /$$x; done; \
|
||||||
|
fi; \
|
||||||
|
if test -f $(srcdir)/po/Makefile.in.in; then \
|
||||||
|
for x in \
|
||||||
|
po/Makefile.in.in \
|
||||||
|
po/Makefile.in \
|
||||||
|
po/Makefile \
|
||||||
|
po/POTFILES \
|
||||||
|
po/stamp-it \
|
||||||
|
po/.intltool-merge-cache \
|
||||||
|
"po/*.gmo" \
|
||||||
|
"po/*.mo" \
|
||||||
|
po/$(GETTEXT_PACKAGE).pot \
|
||||||
|
intltool-extract.in \
|
||||||
|
intltool-merge.in \
|
||||||
|
intltool-update.in \
|
||||||
|
; do echo /$$x; done; \
|
||||||
|
fi; \
|
||||||
|
if test -f $(srcdir)/configure; then \
|
||||||
|
for x in \
|
||||||
|
autom4te.cache \
|
||||||
|
configure \
|
||||||
|
config.h \
|
||||||
|
stamp-h1 \
|
||||||
|
libtool \
|
||||||
|
config.lt \
|
||||||
|
; do echo /$$x; done; \
|
||||||
|
fi; \
|
||||||
|
for x in \
|
||||||
|
.gitignore \
|
||||||
|
$(GITIGNOREFILES) \
|
||||||
|
$(CLEANFILES) \
|
||||||
|
$(PROGRAMS) \
|
||||||
|
$(check_PROGRAMS) \
|
||||||
|
$(EXTRA_PROGRAMS) \
|
||||||
|
$(LTLIBRARIES) \
|
||||||
|
so_locations \
|
||||||
|
.libs _libs \
|
||||||
|
$(MOSTLYCLEANFILES) \
|
||||||
|
"*.$(OBJEXT)" \
|
||||||
|
"*.lo" \
|
||||||
|
$(DISTCLEANFILES) \
|
||||||
|
$(am__CONFIG_DISTCLEAN_FILES) \
|
||||||
|
$(CONFIG_CLEAN_FILES) \
|
||||||
|
TAGS ID GTAGS GRTAGS GSYMS GPATH tags \
|
||||||
|
"*.tab.c" \
|
||||||
|
$(MAINTAINERCLEANFILES) \
|
||||||
|
$(BUILT_SOURCES) \
|
||||||
|
$(DEPDIR) \
|
||||||
|
Makefile \
|
||||||
|
Makefile.in \
|
||||||
|
"*.orig" \
|
||||||
|
"*.rej" \
|
||||||
|
"*.bak" \
|
||||||
|
"*~" \
|
||||||
|
".*.sw[nop]" \
|
||||||
|
; do echo /$$x; done; \
|
||||||
|
} | \
|
||||||
|
sed "s@^/`echo "$(srcdir)" | sed 's/\(.\)/[\1]/g'`/@/@" | \
|
||||||
|
sed 's@/[.]/@/@g' | \
|
||||||
|
LC_ALL=C sort | uniq > $@.tmp && \
|
||||||
|
mv $@.tmp $@;
|
||||||
|
|
||||||
|
all: $(srcdir)/.gitignore gitignore-recurse-maybe
|
||||||
|
gitignore-recurse-maybe:
|
||||||
|
@if test "x$(SUBDIRS)" = "x$(DIST_SUBDIRS)"; then :; else \
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) gitignore-recurse; \
|
||||||
|
fi;
|
||||||
|
gitignore-recurse:
|
||||||
|
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||||
|
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) .gitignore gitignore-recurse || echo "Skipping $$subdir"); \
|
||||||
|
done
|
||||||
|
gitignore: $(srcdir)/.gitignore gitignore-recurse
|
||||||
|
|
||||||
|
maintainer-clean: gitignore-clean
|
||||||
|
gitignore-clean:
|
||||||
|
-rm -f $(srcdir)/.gitignore
|
||||||
|
|
||||||
|
.PHONY: gitignore-clean gitignore gitignore-recurse gitignore-recurse-maybe
|
|
@ -8,21 +8,18 @@
|
||||||
<category rdf:resource="http://api.gnome.org/doap-extensions#core" />
|
<category rdf:resource="http://api.gnome.org/doap-extensions#core" />
|
||||||
<programming-language>C</programming-language>
|
<programming-language>C</programming-language>
|
||||||
<shortdesc xml:lang="en">libnotify is a library for sending desktop notifications</shortdesc>
|
<shortdesc xml:lang="en">libnotify is a library for sending desktop notifications</shortdesc>
|
||||||
<description>Library to send desktop notifications that follows the FDO
|
|
||||||
specifications:
|
|
||||||
https://gitlab.freedesktop.org/xdg/xdg-specs/-/blob/master/notification/notification-spec.xml</description>
|
|
||||||
<maintainer>
|
<maintainer>
|
||||||
<foaf:Person>
|
<foaf:Person>
|
||||||
<foaf:name>Marco Trevisan</foaf:name>
|
<foaf:name>Christian Hammond</foaf:name>
|
||||||
<foaf:mbox rdf:resource="mailto:mail@3v1n0.net" />
|
<foaf:mbox rdf:resource="mailto:chipx86@chipx86.com" />
|
||||||
<gnome:userid>marcotrevi</gnome:userid>
|
<gnome:userid>chammond</gnome:userid>
|
||||||
</foaf:Person>
|
</foaf:Person>
|
||||||
</maintainer>
|
</maintainer>
|
||||||
<maintainer>
|
<maintainer>
|
||||||
<foaf:Person>
|
<foaf:Person>
|
||||||
<foaf:name>Logan Rathbone</foaf:name>
|
<foaf:name>William Jon McCann</foaf:name>
|
||||||
<foaf:mbox rdf:resource="mailto:poprocks@gmail.com" />
|
<foaf:mbox rdf:resource="mailto:william.jon.mccann@gmail.com" />
|
||||||
<gnome:userid>larathbone</gnome:userid>
|
<gnome:userid>mccann</gnome:userid>
|
||||||
</foaf:Person>
|
</foaf:Person>
|
||||||
</maintainer>
|
</maintainer>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
prefix=@prefix@
|
||||||
|
exec_prefix=@exec_prefix@
|
||||||
|
libdir=@libdir@
|
||||||
|
includedir=@includedir@
|
||||||
|
|
||||||
|
Name: libnotify
|
||||||
|
Description: Notifications Library
|
||||||
|
Version: @VERSION@
|
||||||
|
Requires: @pkg_modules@
|
||||||
|
Libs: -L${libdir} -lnotify
|
||||||
|
Cflags: -I${includedir}
|
||||||
|
|
|
@ -0,0 +1,126 @@
|
||||||
|
notifyincdir = $(includedir)/libnotify
|
||||||
|
|
||||||
|
MARSHAL_PREFIX = notify_marshal
|
||||||
|
MARSHAL_FILE = notify-marshal
|
||||||
|
ENUM_FILE = notify-enum-types
|
||||||
|
|
||||||
|
AM_CPPFLAGS = \
|
||||||
|
-I. \
|
||||||
|
-I.. \
|
||||||
|
-I$(top_srcdir) \
|
||||||
|
-I$(top_builddir) \
|
||||||
|
-DG_LOG_DOMAIN=\"libnotify\" \
|
||||||
|
$(PACKAGE_CFLAGS)
|
||||||
|
|
||||||
|
lib_LTLIBRARIES = libnotify.la
|
||||||
|
|
||||||
|
notify_headers = \
|
||||||
|
notify.h \
|
||||||
|
notification.h
|
||||||
|
|
||||||
|
notifyinc_HEADERS = \
|
||||||
|
$(notify_headers) \
|
||||||
|
notify-features.h \
|
||||||
|
$(ENUM_FILE).h
|
||||||
|
|
||||||
|
noinst_HEADERS = \
|
||||||
|
notify-marshal.h \
|
||||||
|
internal.h
|
||||||
|
|
||||||
|
BUILT_SOURCES = \
|
||||||
|
$(ENUM_FILE).h \
|
||||||
|
$(ENUM_FILE).c \
|
||||||
|
notify-marshal.c \
|
||||||
|
notify-marshal.h
|
||||||
|
|
||||||
|
libnotify_la_SOURCES = \
|
||||||
|
notify.c \
|
||||||
|
notification.c \
|
||||||
|
notify-enum-types.c \
|
||||||
|
notify-marshal.c
|
||||||
|
|
||||||
|
libnotify_la_LIBADD = \
|
||||||
|
$(PACKAGE_LIBS)
|
||||||
|
|
||||||
|
libnotify_la_LDFLAGS = \
|
||||||
|
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
|
||||||
|
-export-symbols-regex "^notify_.*"
|
||||||
|
|
||||||
|
notify-marshal.h: notify-marshal.list
|
||||||
|
$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=$(MARSHAL_PREFIX) $(srcdir)/notify-marshal.list \
|
||||||
|
--header > $@.tmp && mv $@.tmp $@
|
||||||
|
|
||||||
|
notify-marshal.c: notify-marshal.list
|
||||||
|
$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=$(MARSHAL_PREFIX) $(srcdir)/notify-marshal.list \
|
||||||
|
--header --body > $@.tmp && mv $@.tmp $@
|
||||||
|
|
||||||
|
$(ENUM_FILE).h: s-enum-types-h
|
||||||
|
@true
|
||||||
|
s-enum-types-h: $(notify_headers) Makefile
|
||||||
|
$(AM_V_GEN) ( cd $(srcdir) && glib-mkenums \
|
||||||
|
--fhead "#ifndef _NOTIFY_ENUM_TYPES_H_\n#define _NOTIFY_ENUM_TYPES_H_\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
|
||||||
|
--fprod "/* enumerations from \"@filename@\" */\n" \
|
||||||
|
--vhead "GType @enum_name@_get_type(void);\n#define NOTIFY_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
|
||||||
|
--ftail "G_END_DECLS\n\n#endif /* _NOTIFY_ENUM_TYPES_H_ */" \
|
||||||
|
$(notify_headers) ) > tmp-$(ENUM_FILE).h \
|
||||||
|
&& (cmp -s tmp-$(ENUM_FILE).h $(ENUM_FILE).h || cp tmp-$(ENUM_FILE).h $(ENUM_FILE).h ) \
|
||||||
|
&& rm -f tmp-$(ENUM_FILE).h \
|
||||||
|
&& echo timestamp > $(@F)
|
||||||
|
|
||||||
|
$(ENUM_FILE).c: s-enum-types-c
|
||||||
|
@true
|
||||||
|
s-enum-types-c: $(notify_headers) Makefile
|
||||||
|
$(AM_V_GEN) ( cd $(srcdir) && glib-mkenums \
|
||||||
|
--fhead "#include <libnotify/notify.h>" \
|
||||||
|
--fprod "\n/* enumerations from \"@filename@\" */" \
|
||||||
|
--vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \
|
||||||
|
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
|
||||||
|
--vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \
|
||||||
|
$(notify_headers) ) > tmp-$(ENUM_FILE).c \
|
||||||
|
&& (cmp -s tmp-$(ENUM_FILE).c $(ENUM_FILE).c || cp tmp-$(ENUM_FILE).c $(ENUM_FILE).c ) \
|
||||||
|
&& rm -f tmp-$(ENUM_FILE).c \
|
||||||
|
&& echo timestamp > $(@F)
|
||||||
|
|
||||||
|
|
||||||
|
if HAVE_INTROSPECTION
|
||||||
|
|
||||||
|
-include $(INTROSPECTION_MAKEFILE)
|
||||||
|
INTROSPECTION_GIRS = Notify-0.7.gir
|
||||||
|
INTROSPECTION_SCANNER_ARGS = --add-include-path=$(top_srcdir) --add-include-path=$(top_builddir) --warn-all -I$(top_srcdir) -I$(top_builddir)
|
||||||
|
INTROSPECTION_COMPILER_ARGS = --includedir=$(top_srcdir)
|
||||||
|
|
||||||
|
Notify-0.7.gir: libnotify.la
|
||||||
|
Notify_0_7_gir_INCLUDES = GLib-2.0 GdkPixbuf-2.0
|
||||||
|
Notify_0_7_gir_LIBS = libnotify.la
|
||||||
|
Notify_0_7_gir_FILES = $(notifyinc_HEADERS) $(libnotify_la_SOURCES)
|
||||||
|
Notify_0_7_gir_PACKAGES = glib-2.0 gobject-2.0 gdk-pixbuf-2.0
|
||||||
|
Notify_0_7_gir_EXPORT_PACKAGES = libnotify
|
||||||
|
Notify_0_7_gir_SCANNERFLAGS = --c-include "libnotify/notify.h"
|
||||||
|
|
||||||
|
girdir = $(datadir)/gir-1.0
|
||||||
|
dist_gir_DATA = $(INTROSPECTION_GIRS)
|
||||||
|
|
||||||
|
typelibdir = $(libdir)/girepository-1.0
|
||||||
|
typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
EXTRA_DIST = \
|
||||||
|
notify-marshal.list \
|
||||||
|
$(ENUM_FILE).h
|
||||||
|
|
||||||
|
CLEANFILES = \
|
||||||
|
notify-marshal.c \
|
||||||
|
notify-marshal.h \
|
||||||
|
$(ENUM_FILE).c \
|
||||||
|
$(ENUM_FILE).h \
|
||||||
|
s-enum-types-c \
|
||||||
|
s-enum-types-h
|
||||||
|
|
||||||
|
if HAVE_INTROSPECTION
|
||||||
|
CLEANFILES += \
|
||||||
|
$(dist_gir_DATA) \
|
||||||
|
$(typelib_DATA)
|
||||||
|
endif
|
||||||
|
|
||||||
|
-include $(top_srcdir)/git.mk
|
|
@ -26,10 +26,6 @@
|
||||||
#define NOTIFY_DBUS_CORE_INTERFACE "org.freedesktop.Notifications"
|
#define NOTIFY_DBUS_CORE_INTERFACE "org.freedesktop.Notifications"
|
||||||
#define NOTIFY_DBUS_CORE_OBJECT "/org/freedesktop/Notifications"
|
#define NOTIFY_DBUS_CORE_OBJECT "/org/freedesktop/Notifications"
|
||||||
|
|
||||||
#define NOTIFY_PORTAL_DBUS_NAME "org.freedesktop.portal.Desktop"
|
|
||||||
#define NOTIFY_PORTAL_DBUS_CORE_INTERFACE "org.freedesktop.portal.Notification"
|
|
||||||
#define NOTIFY_PORTAL_DBUS_CORE_OBJECT "/org/freedesktop/portal/desktop"
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
GDBusProxy * _notify_get_proxy (GError **error);
|
GDBusProxy * _notify_get_proxy (GError **error);
|
||||||
|
@ -40,14 +36,6 @@ gint _notify_notification_get_timeout (const NotifyNotific
|
||||||
gboolean _notify_notification_has_nondefault_actions (const NotifyNotification *n);
|
gboolean _notify_notification_has_nondefault_actions (const NotifyNotification *n);
|
||||||
gboolean _notify_check_spec_version (int major, int minor);
|
gboolean _notify_check_spec_version (int major, int minor);
|
||||||
|
|
||||||
const char * _notify_get_snap_name (void);
|
|
||||||
const char * _notify_get_snap_path (void);
|
|
||||||
const char * _notify_get_snap_app (void);
|
|
||||||
|
|
||||||
const char * _notify_get_flatpak_app (void);
|
|
||||||
|
|
||||||
gboolean _notify_uses_portal_notifications (void);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* _LIBNOTIFY_INTERNAL_H_ */
|
#endif /* _LIBNOTIFY_INTERNAL_H_ */
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
libnotify_includesubdir = meson.project_name()
|
libnotify_includedir = join_paths(includedir, meson.project_name())
|
||||||
libnotify_includedir = join_paths(includedir, libnotify_includesubdir)
|
|
||||||
|
|
||||||
headers = [
|
headers = [
|
||||||
'notify.h',
|
'notify.h',
|
||||||
|
@ -37,9 +36,9 @@ libnotify_cflags = [
|
||||||
]
|
]
|
||||||
|
|
||||||
mapfile = meson.project_name() + '.map'
|
mapfile = meson.project_name() + '.map'
|
||||||
libnotify_ldflags = cc.get_supported_link_arguments([
|
libnotify_ldflags = [
|
||||||
'-Wl,--version-script,'+join_paths(meson.current_source_dir(), mapfile),
|
'-Wl,--version-script,'+join_paths(meson.current_source_dir(), mapfile),
|
||||||
])
|
]
|
||||||
|
|
||||||
notify_dep = declare_dependency(
|
notify_dep = declare_dependency(
|
||||||
include_directories: default_includes,
|
include_directories: default_includes,
|
||||||
|
@ -69,9 +68,8 @@ pkgconfig.generate(libnotify_lib,
|
||||||
)
|
)
|
||||||
|
|
||||||
introspection = get_option('introspection')
|
introspection = get_option('introspection')
|
||||||
g_ir_scanner = find_program('g-ir-scanner', required: introspection.enabled())
|
if not introspection.disabled()
|
||||||
|
find_program('g-ir-scanner', required: introspection.enabled())
|
||||||
if g_ir_scanner.found() and not introspection.disabled()
|
|
||||||
gnome.generate_gir(libnotify_lib,
|
gnome.generate_gir(libnotify_lib,
|
||||||
sources: headers + sources + enum_types,
|
sources: headers + sources + enum_types,
|
||||||
namespace: 'Notify',
|
namespace: 'Notify',
|
||||||
|
@ -83,4 +81,4 @@ if g_ir_scanner.found() and not introspection.disabled()
|
||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
install_headers(headers, subdir: libnotify_includesubdir)
|
install_headers(headers, subdir: libnotify_includedir)
|
||||||
|
|
|
@ -53,7 +53,6 @@
|
||||||
static void notify_notification_class_init (NotifyNotificationClass *klass);
|
static void notify_notification_class_init (NotifyNotificationClass *klass);
|
||||||
static void notify_notification_init (NotifyNotification *sp);
|
static void notify_notification_init (NotifyNotification *sp);
|
||||||
static void notify_notification_finalize (GObject *object);
|
static void notify_notification_finalize (GObject *object);
|
||||||
static void notify_notification_dispose (GObject *object);
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -69,11 +68,9 @@ struct _NotifyNotificationPrivate
|
||||||
char *app_name;
|
char *app_name;
|
||||||
char *summary;
|
char *summary;
|
||||||
char *body;
|
char *body;
|
||||||
char *activation_token;
|
|
||||||
|
|
||||||
/* NULL to use icon data. Anything else to have server lookup icon */
|
/* NULL to use icon data. Anything else to have server lookup icon */
|
||||||
char *icon_name;
|
char *icon_name;
|
||||||
GdkPixbuf *icon_pixbuf;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* -1 = use server default
|
* -1 = use server default
|
||||||
|
@ -81,14 +78,12 @@ struct _NotifyNotificationPrivate
|
||||||
* > 0 = Number of milliseconds before we timeout
|
* > 0 = Number of milliseconds before we timeout
|
||||||
*/
|
*/
|
||||||
gint timeout;
|
gint timeout;
|
||||||
guint portal_timeout_id;
|
|
||||||
|
|
||||||
GSList *actions;
|
GSList *actions;
|
||||||
GHashTable *action_map;
|
GHashTable *action_map;
|
||||||
GHashTable *hints;
|
GHashTable *hints;
|
||||||
|
|
||||||
gboolean has_nondefault_actions;
|
gboolean has_nondefault_actions;
|
||||||
gboolean activating;
|
|
||||||
gboolean updates_pending;
|
gboolean updates_pending;
|
||||||
|
|
||||||
gulong proxy_signal_handler;
|
gulong proxy_signal_handler;
|
||||||
|
@ -153,7 +148,6 @@ notify_notification_class_init (NotifyNotificationClass *klass)
|
||||||
object_class->constructor = notify_notification_constructor;
|
object_class->constructor = notify_notification_constructor;
|
||||||
object_class->get_property = notify_notification_get_property;
|
object_class->get_property = notify_notification_get_property;
|
||||||
object_class->set_property = notify_notification_set_property;
|
object_class->set_property = notify_notification_set_property;
|
||||||
object_class->dispose = notify_notification_dispose;
|
|
||||||
object_class->finalize = notify_notification_finalize;
|
object_class->finalize = notify_notification_finalize;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -238,9 +232,9 @@ notify_notification_class_init (NotifyNotificationClass *klass)
|
||||||
g_param_spec_int ("closed-reason",
|
g_param_spec_int ("closed-reason",
|
||||||
"Closed Reason",
|
"Closed Reason",
|
||||||
"The reason code for why the notification was closed",
|
"The reason code for why the notification was closed",
|
||||||
NOTIFY_CLOSED_REASON_UNSET,
|
-1,
|
||||||
G_MAXINT32,
|
G_MAXINT32,
|
||||||
NOTIFY_CLOSED_REASON_UNSET,
|
-1,
|
||||||
G_PARAM_READABLE
|
G_PARAM_READABLE
|
||||||
| G_PARAM_STATIC_NAME
|
| G_PARAM_STATIC_NAME
|
||||||
| G_PARAM_STATIC_NICK
|
| G_PARAM_STATIC_NICK
|
||||||
|
@ -361,7 +355,7 @@ notify_notification_init (NotifyNotification *obj)
|
||||||
{
|
{
|
||||||
obj->priv = g_new0 (NotifyNotificationPrivate, 1);
|
obj->priv = g_new0 (NotifyNotificationPrivate, 1);
|
||||||
obj->priv->timeout = NOTIFY_EXPIRES_DEFAULT;
|
obj->priv->timeout = NOTIFY_EXPIRES_DEFAULT;
|
||||||
obj->priv->closed_reason = NOTIFY_CLOSED_REASON_UNSET;
|
obj->priv->closed_reason = -1;
|
||||||
obj->priv->hints = g_hash_table_new_full (g_str_hash,
|
obj->priv->hints = g_hash_table_new_full (g_str_hash,
|
||||||
g_str_equal,
|
g_str_equal,
|
||||||
g_free,
|
g_free,
|
||||||
|
@ -373,22 +367,6 @@ notify_notification_init (NotifyNotification *obj)
|
||||||
(GDestroyNotify) destroy_pair);
|
(GDestroyNotify) destroy_pair);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
notify_notification_dispose (GObject *object)
|
|
||||||
{
|
|
||||||
NotifyNotification *obj = NOTIFY_NOTIFICATION (object);
|
|
||||||
NotifyNotificationPrivate *priv = obj->priv;
|
|
||||||
|
|
||||||
if (priv->portal_timeout_id) {
|
|
||||||
g_source_remove (priv->portal_timeout_id);
|
|
||||||
priv->portal_timeout_id = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_clear_object (&priv->icon_pixbuf);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (parent_class)->dispose (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
notify_notification_finalize (GObject *object)
|
notify_notification_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
|
@ -402,7 +380,6 @@ notify_notification_finalize (GObject *object)
|
||||||
g_free (priv->summary);
|
g_free (priv->summary);
|
||||||
g_free (priv->body);
|
g_free (priv->body);
|
||||||
g_free (priv->icon_name);
|
g_free (priv->icon_name);
|
||||||
g_free (priv->activation_token);
|
|
||||||
|
|
||||||
if (priv->actions != NULL) {
|
if (priv->actions != NULL) {
|
||||||
g_slist_foreach (priv->actions, (GFunc) g_free, NULL);
|
g_slist_foreach (priv->actions, (GFunc) g_free, NULL);
|
||||||
|
@ -425,18 +402,6 @@ notify_notification_finalize (GObject *object)
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
|
||||||
maybe_warn_portal_unsupported_feature (const char *feature_name)
|
|
||||||
{
|
|
||||||
if (!_notify_uses_portal_notifications ()) {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_message ("%s is not available when using Portal Notifications",
|
|
||||||
feature_name);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* notify_notification_new:
|
* notify_notification_new:
|
||||||
* @summary: The required summary text.
|
* @summary: The required summary text.
|
||||||
|
@ -460,95 +425,6 @@ notify_notification_new (const char *summary,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gchar *
|
|
||||||
try_prepend_path (const char *base_path,
|
|
||||||
const char *path)
|
|
||||||
{
|
|
||||||
gchar *path_filename;
|
|
||||||
gchar *path_ret;
|
|
||||||
gboolean was_uri;
|
|
||||||
|
|
||||||
if (!path || *path == '\0')
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
was_uri = TRUE;
|
|
||||||
path_ret = NULL;
|
|
||||||
path_filename = g_filename_from_uri (base_path, NULL, NULL);
|
|
||||||
|
|
||||||
if (path_filename == NULL) {
|
|
||||||
was_uri = FALSE;
|
|
||||||
|
|
||||||
if (base_path && base_path[0] == G_DIR_SEPARATOR) {
|
|
||||||
path_filename = g_strdup (base_path);
|
|
||||||
} else {
|
|
||||||
path_filename = realpath (base_path, NULL);
|
|
||||||
|
|
||||||
if (path_filename == NULL) {
|
|
||||||
/* File path is not existing, but let's check
|
|
||||||
* if it's under the base path before giving up
|
|
||||||
*/
|
|
||||||
path_filename = g_strdup (base_path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (g_str_has_prefix (path_filename, path)) {
|
|
||||||
path_ret = g_strdup (path_filename);
|
|
||||||
} else {
|
|
||||||
g_debug ("Trying to look at file '%s' in the '%s' prefix.",
|
|
||||||
base_path,
|
|
||||||
path);
|
|
||||||
path_ret = g_build_filename (path, path_filename, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!g_file_test (path_ret, G_FILE_TEST_EXISTS)) {
|
|
||||||
g_debug ("Nothing found at %s", path_ret);
|
|
||||||
g_free (path_ret);
|
|
||||||
path_ret = NULL;
|
|
||||||
} else if (was_uri) {
|
|
||||||
gchar *uri = g_filename_to_uri (path_ret, NULL, NULL);
|
|
||||||
|
|
||||||
if (uri != NULL) {
|
|
||||||
g_free (path_ret);
|
|
||||||
path_ret = uri;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
g_free (path_filename);
|
|
||||||
|
|
||||||
return path_ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gchar *
|
|
||||||
try_prepend_snap_desktop (NotifyNotification *notification,
|
|
||||||
const gchar *desktop)
|
|
||||||
{
|
|
||||||
gchar *ret = NULL;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* if it's an absolute path, try prepending $SNAP, otherwise try
|
|
||||||
* ${SNAP_NAME}_; snap .desktop files are in the format
|
|
||||||
* ${SNAP_NAME}_desktop_file_name
|
|
||||||
*/
|
|
||||||
ret = try_prepend_path (desktop, _notify_get_snap_path ());
|
|
||||||
|
|
||||||
if (ret == NULL && _notify_get_snap_name () != NULL &&
|
|
||||||
strchr (desktop, G_DIR_SEPARATOR) == NULL) {
|
|
||||||
ret = g_strdup_printf ("%s_%s", _notify_get_snap_name (), desktop);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gchar *
|
|
||||||
try_prepend_snap (NotifyNotification *notification,
|
|
||||||
const gchar *value)
|
|
||||||
{
|
|
||||||
/* hardcoded paths to icons might be relocated under $SNAP */
|
|
||||||
return try_prepend_path (value, _notify_get_snap_path ());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
notify_notification_update_internal (NotifyNotification *notification,
|
notify_notification_update_internal (NotifyNotification *notification,
|
||||||
const char *app_name,
|
const char *app_name,
|
||||||
|
@ -576,18 +452,9 @@ notify_notification_update_internal (NotifyNotification *notification,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notification->priv->icon_name != icon) {
|
if (notification->priv->icon_name != icon) {
|
||||||
gchar *snapped_icon;
|
|
||||||
g_free (notification->priv->icon_name);
|
g_free (notification->priv->icon_name);
|
||||||
notification->priv->icon_name = (icon != NULL
|
notification->priv->icon_name = (icon != NULL
|
||||||
&& *icon != '\0' ? g_strdup (icon) : NULL);
|
&& *icon != '\0' ? g_strdup (icon) : NULL);
|
||||||
snapped_icon = try_prepend_snap_desktop (notification,
|
|
||||||
notification->priv->icon_name);
|
|
||||||
if (snapped_icon != NULL) {
|
|
||||||
g_debug ("Icon updated in snap environment: '%s' -> '%s'\n",
|
|
||||||
notification->priv->icon_name, snapped_icon);
|
|
||||||
g_free (notification->priv->icon_name);
|
|
||||||
notification->priv->icon_name = snapped_icon;
|
|
||||||
}
|
|
||||||
g_object_notify (G_OBJECT (notification), "icon-name");
|
g_object_notify (G_OBJECT (notification), "icon-name");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -624,80 +491,6 @@ notify_notification_update (NotifyNotification *notification,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
|
||||||
get_portal_notification_id (NotifyNotification *notification)
|
|
||||||
{
|
|
||||||
char *app_id;
|
|
||||||
char *notification_id;
|
|
||||||
|
|
||||||
g_assert (_notify_uses_portal_notifications ());
|
|
||||||
|
|
||||||
if (_notify_get_snap_name ()) {
|
|
||||||
app_id = g_strdup_printf ("snap.%s_%s",
|
|
||||||
_notify_get_snap_name (),
|
|
||||||
_notify_get_snap_app ());
|
|
||||||
} else {
|
|
||||||
app_id = g_strdup_printf ("flatpak.%s",
|
|
||||||
_notify_get_flatpak_app ());
|
|
||||||
}
|
|
||||||
|
|
||||||
notification_id = g_strdup_printf ("libnotify-%s-%s-%u",
|
|
||||||
app_id,
|
|
||||||
notify_get_app_name (),
|
|
||||||
notification->priv->id);
|
|
||||||
|
|
||||||
g_free (app_id);
|
|
||||||
|
|
||||||
return notification_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
activate_action (NotifyNotification *notification,
|
|
||||||
const gchar *action)
|
|
||||||
{
|
|
||||||
CallbackPair *pair;
|
|
||||||
|
|
||||||
pair = g_hash_table_lookup (notification->priv->action_map, action);
|
|
||||||
|
|
||||||
if (!pair) {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Some clients have assumed it is safe to unref the
|
|
||||||
* Notification at the end of their NotifyActionCallback
|
|
||||||
* so we add a temporary ref until we're done with it.
|
|
||||||
*/
|
|
||||||
g_object_ref (notification);
|
|
||||||
|
|
||||||
notification->priv->activating = TRUE;
|
|
||||||
pair->cb (notification, (char *) action, pair->user_data);
|
|
||||||
notification->priv->activating = FALSE;
|
|
||||||
g_free (notification->priv->activation_token);
|
|
||||||
notification->priv->activation_token = NULL;
|
|
||||||
|
|
||||||
g_object_unref (notification);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
close_notification (NotifyNotification *notification,
|
|
||||||
NotifyClosedReason reason)
|
|
||||||
{
|
|
||||||
if (notification->priv->closed_reason != NOTIFY_CLOSED_REASON_UNSET ||
|
|
||||||
reason == NOTIFY_CLOSED_REASON_UNSET) {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_object_ref (G_OBJECT (notification));
|
|
||||||
notification->priv->closed_reason = reason;
|
|
||||||
g_signal_emit (notification, signals[SIGNAL_CLOSED], 0);
|
|
||||||
notification->priv->id = 0;
|
|
||||||
g_object_unref (G_OBJECT (notification));
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
proxy_g_signal_cb (GDBusProxy *proxy,
|
proxy_g_signal_cb (GDBusProxy *proxy,
|
||||||
const char *sender_name,
|
const char *sender_name,
|
||||||
|
@ -705,12 +498,8 @@ proxy_g_signal_cb (GDBusProxy *proxy,
|
||||||
GVariant *parameters,
|
GVariant *parameters,
|
||||||
NotifyNotification *notification)
|
NotifyNotification *notification)
|
||||||
{
|
{
|
||||||
const char *interface;
|
|
||||||
|
|
||||||
g_return_if_fail (NOTIFY_IS_NOTIFICATION (notification));
|
g_return_if_fail (NOTIFY_IS_NOTIFICATION (notification));
|
||||||
|
|
||||||
interface = g_dbus_proxy_get_interface_name (proxy);
|
|
||||||
|
|
||||||
if (g_strcmp0 (signal_name, "NotificationClosed") == 0 &&
|
if (g_strcmp0 (signal_name, "NotificationClosed") == 0 &&
|
||||||
g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(uu)"))) {
|
g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(uu)"))) {
|
||||||
guint32 id, reason;
|
guint32 id, reason;
|
||||||
|
@ -719,332 +508,33 @@ proxy_g_signal_cb (GDBusProxy *proxy,
|
||||||
if (id != notification->priv->id)
|
if (id != notification->priv->id)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
close_notification (notification, reason);
|
g_object_ref (G_OBJECT (notification));
|
||||||
|
notification->priv->closed_reason = reason;
|
||||||
|
g_signal_emit (notification, signals[SIGNAL_CLOSED], 0);
|
||||||
|
notification->priv->id = 0;
|
||||||
|
g_object_unref (G_OBJECT (notification));
|
||||||
} else if (g_strcmp0 (signal_name, "ActionInvoked") == 0 &&
|
} else if (g_strcmp0 (signal_name, "ActionInvoked") == 0 &&
|
||||||
g_str_equal (interface, NOTIFY_DBUS_CORE_INTERFACE) &&
|
|
||||||
g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(us)"))) {
|
g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(us)"))) {
|
||||||
guint32 id;
|
guint32 id;
|
||||||
const char *action;
|
const char *action;
|
||||||
|
CallbackPair *pair;
|
||||||
|
|
||||||
g_variant_get (parameters, "(u&s)", &id, &action);
|
g_variant_get (parameters, "(u&s)", &id, &action);
|
||||||
|
|
||||||
if (id != notification->priv->id)
|
if (id != notification->priv->id)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!activate_action (notification, action) &&
|
pair = (CallbackPair *) g_hash_table_lookup (notification->priv->action_map,
|
||||||
g_ascii_strcasecmp (action, "default")) {
|
action);
|
||||||
g_warning ("Received unknown action %s", action);
|
|
||||||
}
|
|
||||||
} else if (g_strcmp0 (signal_name, "ActivationToken") == 0 &&
|
|
||||||
g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(us)"))) {
|
|
||||||
guint32 id;
|
|
||||||
const char *activation_token;
|
|
||||||
|
|
||||||
g_variant_get (parameters, "(u&s)", &id, &activation_token);
|
if (pair == NULL) {
|
||||||
|
if (g_ascii_strcasecmp (action, "default")) {
|
||||||
if (id != notification->priv->id)
|
g_warning ("Received unknown action %s", action);
|
||||||
return;
|
|
||||||
|
|
||||||
g_free (notification->priv->activation_token);
|
|
||||||
notification->priv->activation_token = g_strdup (activation_token);
|
|
||||||
} else if (g_str_equal (signal_name, "ActionInvoked") &&
|
|
||||||
g_str_equal (interface, NOTIFY_PORTAL_DBUS_CORE_INTERFACE) &&
|
|
||||||
g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(ssav)"))) {
|
|
||||||
char *notification_id;
|
|
||||||
const char *id;
|
|
||||||
const char *action;
|
|
||||||
GVariant *parameter;
|
|
||||||
|
|
||||||
g_variant_get (parameters, "(&s&s@av)", &id, &action, ¶meter);
|
|
||||||
g_variant_unref (parameter);
|
|
||||||
|
|
||||||
notification_id = get_portal_notification_id (notification);
|
|
||||||
|
|
||||||
if (!g_str_equal (notification_id, id)) {
|
|
||||||
g_free (notification_id);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!activate_action (notification, action) &&
|
|
||||||
g_str_equal (action, "default-action") &&
|
|
||||||
!_notify_get_snap_app ()) {
|
|
||||||
g_warning ("Received unknown action %s", action);
|
|
||||||
}
|
|
||||||
|
|
||||||
close_notification (notification, NOTIFY_CLOSED_REASON_DISMISSED);
|
|
||||||
|
|
||||||
g_free (notification_id);
|
|
||||||
} else {
|
|
||||||
g_debug ("Unhandled signal '%s.%s'", interface, signal_name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
remove_portal_notification (GDBusProxy *proxy,
|
|
||||||
NotifyNotification *notification,
|
|
||||||
NotifyClosedReason reason,
|
|
||||||
GError **error)
|
|
||||||
{
|
|
||||||
GVariant *ret;
|
|
||||||
gchar *notification_id;
|
|
||||||
|
|
||||||
if (notification->priv->portal_timeout_id) {
|
|
||||||
g_source_remove (notification->priv->portal_timeout_id);
|
|
||||||
notification->priv->portal_timeout_id = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
notification_id = get_portal_notification_id (notification);
|
|
||||||
|
|
||||||
ret = g_dbus_proxy_call_sync (proxy,
|
|
||||||
"RemoveNotification",
|
|
||||||
g_variant_new ("(s)", notification_id),
|
|
||||||
G_DBUS_CALL_FLAGS_NONE,
|
|
||||||
-1,
|
|
||||||
NULL,
|
|
||||||
error);
|
|
||||||
|
|
||||||
g_free (notification_id);
|
|
||||||
|
|
||||||
if (!ret) {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
close_notification (notification, reason);
|
|
||||||
|
|
||||||
g_variant_unref (ret);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
on_portal_timeout (gpointer data)
|
|
||||||
{
|
|
||||||
NotifyNotification *notification = data;
|
|
||||||
GDBusProxy *proxy;
|
|
||||||
|
|
||||||
notification->priv->portal_timeout_id = 0;
|
|
||||||
|
|
||||||
proxy = _notify_get_proxy (NULL);
|
|
||||||
if (proxy == NULL) {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
remove_portal_notification (proxy, notification,
|
|
||||||
NOTIFY_CLOSED_REASON_EXPIRED, NULL);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GIcon *
|
|
||||||
get_notification_gicon (NotifyNotification *notification,
|
|
||||||
GError **error)
|
|
||||||
{
|
|
||||||
NotifyNotificationPrivate *priv = notification->priv;
|
|
||||||
GFileInputStream *input;
|
|
||||||
GFile *file = NULL;
|
|
||||||
GIcon *gicon = NULL;
|
|
||||||
|
|
||||||
if (priv->icon_pixbuf) {
|
|
||||||
return G_ICON (g_object_ref (priv->icon_pixbuf));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!priv->icon_name) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strstr (priv->icon_name, "://")) {
|
|
||||||
file = g_file_new_for_uri (priv->icon_name);
|
|
||||||
} else if (g_file_test (priv->icon_name, G_FILE_TEST_EXISTS)) {
|
|
||||||
file = g_file_new_for_path (priv->icon_name);
|
|
||||||
} else {
|
|
||||||
gicon = g_themed_icon_new (priv->icon_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!file) {
|
|
||||||
return gicon;
|
|
||||||
}
|
|
||||||
|
|
||||||
input = g_file_read (file, NULL, error);
|
|
||||||
|
|
||||||
if (input) {
|
|
||||||
GByteArray *bytes_array = g_byte_array_new ();
|
|
||||||
guint8 buf[1024];
|
|
||||||
|
|
||||||
while (TRUE) {
|
|
||||||
gssize read;
|
|
||||||
|
|
||||||
read = g_input_stream_read (G_INPUT_STREAM (input),
|
|
||||||
buf,
|
|
||||||
G_N_ELEMENTS (buf),
|
|
||||||
NULL, NULL);
|
|
||||||
|
|
||||||
if (read > 0) {
|
|
||||||
g_byte_array_append (bytes_array, buf, read);
|
|
||||||
} else {
|
|
||||||
if (read < 0) {
|
|
||||||
g_byte_array_unref (bytes_array);
|
|
||||||
bytes_array = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
pair->cb (notification, (char *) action, pair->user_data);
|
||||||
if (bytes_array && bytes_array->len) {
|
|
||||||
GBytes *bytes;
|
|
||||||
|
|
||||||
bytes = g_byte_array_free_to_bytes (bytes_array);
|
|
||||||
bytes_array = NULL;
|
|
||||||
|
|
||||||
gicon = g_bytes_icon_new (bytes);
|
|
||||||
} else if (bytes_array) {
|
|
||||||
g_byte_array_unref (bytes_array);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_clear_object (&input);
|
|
||||||
g_clear_object (&file);
|
|
||||||
|
|
||||||
return gicon;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
add_portal_notification (GDBusProxy *proxy,
|
|
||||||
NotifyNotification *notification,
|
|
||||||
GError **error)
|
|
||||||
{
|
|
||||||
GIcon *icon;
|
|
||||||
GVariant *urgency;
|
|
||||||
GVariant *ret;
|
|
||||||
GVariantBuilder builder;
|
|
||||||
NotifyNotificationPrivate *priv = notification->priv;
|
|
||||||
GError *local_error = NULL;
|
|
||||||
static guint32 portal_notification_count = 0;
|
|
||||||
char *notification_id;
|
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT);
|
|
||||||
|
|
||||||
g_variant_builder_add (&builder, "{sv}", "title",
|
|
||||||
g_variant_new_string (priv->summary ? priv->summary : ""));
|
|
||||||
g_variant_builder_add (&builder, "{sv}", "body",
|
|
||||||
g_variant_new_string (priv->body ? priv->body : ""));
|
|
||||||
|
|
||||||
if (g_hash_table_lookup (priv->action_map, "default")) {
|
|
||||||
g_variant_builder_add (&builder, "{sv}", "default-action",
|
|
||||||
g_variant_new_string ("default"));
|
|
||||||
} else if (g_hash_table_lookup (priv->action_map, "DEFAULT")) {
|
|
||||||
g_variant_builder_add (&builder, "{sv}", "default-action",
|
|
||||||
g_variant_new_string ("DEFAULT"));
|
|
||||||
} else if (_notify_get_snap_app ()) {
|
|
||||||
/* In the snap case we may need to ensure that a default-action
|
|
||||||
* is set to ensure that we will use the FDO notification daemon
|
|
||||||
* and won't fallback to GTK one, as app-id won't match.
|
|
||||||
* See: https://github.com/flatpak/xdg-desktop-portal/issues/769
|
|
||||||
*/
|
|
||||||
g_variant_builder_add (&builder, "{sv}", "default-action",
|
|
||||||
g_variant_new_string ("snap-fake-default-action"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (priv->has_nondefault_actions) {
|
|
||||||
GVariantBuilder buttons;
|
|
||||||
GSList *l;
|
|
||||||
|
|
||||||
g_variant_builder_init (&buttons, G_VARIANT_TYPE ("aa{sv}"));
|
|
||||||
|
|
||||||
for (l = priv->actions; l && l->next; l = l->next->next) {
|
|
||||||
GVariantBuilder button;
|
|
||||||
const char *action;
|
|
||||||
const char *label;
|
|
||||||
|
|
||||||
g_variant_builder_init (&button, G_VARIANT_TYPE_VARDICT);
|
|
||||||
|
|
||||||
action = l->data;
|
|
||||||
label = l->next->data;
|
|
||||||
|
|
||||||
g_variant_builder_add (&button, "{sv}", "action",
|
|
||||||
g_variant_new_string (action));
|
|
||||||
g_variant_builder_add (&button, "{sv}", "label",
|
|
||||||
g_variant_new_string (label));
|
|
||||||
|
|
||||||
g_variant_builder_add (&buttons, "@a{sv}",
|
|
||||||
g_variant_builder_end (&button));
|
|
||||||
}
|
|
||||||
|
|
||||||
g_variant_builder_add (&builder, "{sv}", "buttons",
|
|
||||||
g_variant_builder_end (&buttons));
|
|
||||||
}
|
|
||||||
|
|
||||||
urgency = g_hash_table_lookup (notification->priv->hints, "urgency");
|
|
||||||
if (urgency) {
|
|
||||||
switch (g_variant_get_byte (urgency)) {
|
|
||||||
case NOTIFY_URGENCY_LOW:
|
|
||||||
g_variant_builder_add (&builder, "{sv}", "priority",
|
|
||||||
g_variant_new_string ("low"));
|
|
||||||
break;
|
|
||||||
case NOTIFY_URGENCY_NORMAL:
|
|
||||||
g_variant_builder_add (&builder, "{sv}", "priority",
|
|
||||||
g_variant_new_string ("normal"));
|
|
||||||
break;
|
|
||||||
case NOTIFY_URGENCY_CRITICAL:
|
|
||||||
g_variant_builder_add (&builder, "{sv}", "priority",
|
|
||||||
g_variant_new_string ("urgent"));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
g_warn_if_reached ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
icon = get_notification_gicon (notification, &local_error);
|
|
||||||
if (icon) {
|
|
||||||
GVariant *serialized_icon = g_icon_serialize (icon);
|
|
||||||
|
|
||||||
g_variant_builder_add (&builder, "{sv}", "icon",
|
|
||||||
serialized_icon);
|
|
||||||
g_variant_unref (serialized_icon);
|
|
||||||
g_clear_object (&icon);
|
|
||||||
} else if (local_error) {
|
|
||||||
g_propagate_error (error, local_error);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!priv->id) {
|
|
||||||
priv->id = ++portal_notification_count;
|
|
||||||
} else if (priv->closed_reason == NOTIFY_CLOSED_REASON_UNSET) {
|
|
||||||
remove_portal_notification (proxy, notification,
|
|
||||||
NOTIFY_CLOSED_REASON_UNSET, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
notification_id = get_portal_notification_id (notification);
|
|
||||||
|
|
||||||
ret = g_dbus_proxy_call_sync (proxy,
|
|
||||||
"AddNotification",
|
|
||||||
g_variant_new ("(s@a{sv})",
|
|
||||||
notification_id,
|
|
||||||
g_variant_builder_end (&builder)),
|
|
||||||
G_DBUS_CALL_FLAGS_NONE,
|
|
||||||
-1,
|
|
||||||
NULL,
|
|
||||||
error);
|
|
||||||
|
|
||||||
if (priv->portal_timeout_id) {
|
|
||||||
g_source_remove (priv->portal_timeout_id);
|
|
||||||
priv->portal_timeout_id = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_free (notification_id);
|
|
||||||
|
|
||||||
if (!ret) {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (priv->timeout > 0) {
|
|
||||||
priv->portal_timeout_id = g_timeout_add (priv->timeout,
|
|
||||||
on_portal_timeout,
|
|
||||||
notification);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_variant_unref (ret);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1068,7 +558,6 @@ notify_notification_show (NotifyNotification *notification,
|
||||||
GHashTableIter iter;
|
GHashTableIter iter;
|
||||||
gpointer key, data;
|
gpointer key, data;
|
||||||
GVariant *result;
|
GVariant *result;
|
||||||
GApplication *application = NULL;
|
|
||||||
|
|
||||||
g_return_val_if_fail (notification != NULL, FALSE);
|
g_return_val_if_fail (notification != NULL, FALSE);
|
||||||
g_return_val_if_fail (NOTIFY_IS_NOTIFICATION (notification), FALSE);
|
g_return_val_if_fail (NOTIFY_IS_NOTIFICATION (notification), FALSE);
|
||||||
|
@ -1092,10 +581,6 @@ notify_notification_show (NotifyNotification *notification,
|
||||||
notification);
|
notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_notify_uses_portal_notifications ()) {
|
|
||||||
return add_portal_notification (proxy, notification, error);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_variant_builder_init (&actions_builder, G_VARIANT_TYPE ("as"));
|
g_variant_builder_init (&actions_builder, G_VARIANT_TYPE ("as"));
|
||||||
for (l = priv->actions; l != NULL; l = l->next) {
|
for (l = priv->actions; l != NULL; l = l->next) {
|
||||||
g_variant_builder_add (&actions_builder, "s", l->data);
|
g_variant_builder_add (&actions_builder, "s", l->data);
|
||||||
|
@ -1107,41 +592,6 @@ notify_notification_show (NotifyNotification *notification,
|
||||||
g_variant_builder_add (&hints_builder, "{sv}", key, data);
|
g_variant_builder_add (&hints_builder, "{sv}", key, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_hash_table_lookup (priv->hints, "sender-pid") == NULL) {
|
|
||||||
g_variant_builder_add (&hints_builder, "{sv}", "sender-pid",
|
|
||||||
g_variant_new_int64 (getpid ()));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_notify_get_snap_app () &&
|
|
||||||
g_hash_table_lookup (priv->hints, "desktop-entry") == NULL) {
|
|
||||||
gchar *snap_desktop;
|
|
||||||
|
|
||||||
snap_desktop = g_strdup_printf ("%s_%s",
|
|
||||||
_notify_get_snap_name (),
|
|
||||||
_notify_get_snap_app ());
|
|
||||||
|
|
||||||
g_debug ("Using desktop entry: %s", snap_desktop);
|
|
||||||
g_variant_builder_add (&hints_builder, "{sv}",
|
|
||||||
"desktop-entry",
|
|
||||||
g_variant_new_take_string (snap_desktop));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!_notify_get_snap_app ()) {
|
|
||||||
application = g_application_get_default ();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (application != NULL) {
|
|
||||||
GVariant *desktop_entry = g_hash_table_lookup (priv->hints, "desktop-entry");
|
|
||||||
|
|
||||||
if (desktop_entry == NULL) {
|
|
||||||
const char *application_id = g_application_get_application_id (application);
|
|
||||||
|
|
||||||
g_debug ("Using desktop entry: %s", application_id);
|
|
||||||
g_variant_builder_add (&hints_builder, "{sv}", "desktop-entry",
|
|
||||||
g_variant_new_string (application_id));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* TODO: make this nonblocking */
|
/* TODO: make this nonblocking */
|
||||||
result = g_dbus_proxy_call_sync (proxy,
|
result = g_dbus_proxy_call_sync (proxy,
|
||||||
"Notify",
|
"Notify",
|
||||||
|
@ -1219,10 +669,6 @@ notify_notification_set_category (NotifyNotification *notification,
|
||||||
g_return_if_fail (notification != NULL);
|
g_return_if_fail (notification != NULL);
|
||||||
g_return_if_fail (NOTIFY_IS_NOTIFICATION (notification));
|
g_return_if_fail (NOTIFY_IS_NOTIFICATION (notification));
|
||||||
|
|
||||||
if (maybe_warn_portal_unsupported_feature ("Category")) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (category != NULL && category[0] != '\0') {
|
if (category != NULL && category[0] != '\0') {
|
||||||
notify_notification_set_hint_string (notification,
|
notify_notification_set_hint_string (notification,
|
||||||
"category",
|
"category",
|
||||||
|
@ -1300,18 +746,11 @@ notify_notification_set_image_from_pixbuf (NotifyNotification *notification,
|
||||||
hint_name = "icon_data";
|
hint_name = "icon_data";
|
||||||
}
|
}
|
||||||
|
|
||||||
g_clear_object (¬ification->priv->icon_pixbuf);
|
|
||||||
|
|
||||||
if (pixbuf == NULL) {
|
if (pixbuf == NULL) {
|
||||||
notify_notification_set_hint (notification, hint_name, NULL);
|
notify_notification_set_hint (notification, hint_name, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_notify_uses_portal_notifications ()) {
|
|
||||||
notification->priv->icon_pixbuf = g_object_ref (pixbuf);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_object_get (pixbuf,
|
g_object_get (pixbuf,
|
||||||
"width", &width,
|
"width", &width,
|
||||||
"height", &height,
|
"height", &height,
|
||||||
|
@ -1340,52 +779,6 @@ notify_notification_set_image_from_pixbuf (NotifyNotification *notification,
|
||||||
notify_notification_set_hint (notification, hint_name, value);
|
notify_notification_set_hint (notification, hint_name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef gchar * (*StringParserFunc) (NotifyNotification *, const gchar *);
|
|
||||||
|
|
||||||
static GVariant *
|
|
||||||
get_parsed_variant (NotifyNotification *notification,
|
|
||||||
const char *key,
|
|
||||||
GVariant *variant,
|
|
||||||
StringParserFunc str_parser)
|
|
||||||
{
|
|
||||||
const char *str = g_variant_get_string (variant, NULL);
|
|
||||||
gchar *parsed = str_parser (notification, str);
|
|
||||||
|
|
||||||
if (parsed != NULL && g_strcmp0 (str, parsed) != 0) {
|
|
||||||
g_debug ("Hint %s updated in snap environment: '%s' -> '%s'\n",
|
|
||||||
key, str, parsed);
|
|
||||||
g_variant_unref (variant);
|
|
||||||
variant = g_variant_new_take_string (parsed);
|
|
||||||
}
|
|
||||||
|
|
||||||
return variant;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GVariant *
|
|
||||||
maybe_parse_snap_hint_value (NotifyNotification *notification,
|
|
||||||
const gchar *key,
|
|
||||||
GVariant *value)
|
|
||||||
{
|
|
||||||
StringParserFunc parse_func = NULL;
|
|
||||||
|
|
||||||
if (!_notify_get_snap_path ())
|
|
||||||
return value;
|
|
||||||
|
|
||||||
if (g_strcmp0 (key, "desktop-entry") == 0) {
|
|
||||||
parse_func = try_prepend_snap_desktop;
|
|
||||||
} else if (g_strcmp0 (key, "image-path") == 0 ||
|
|
||||||
g_strcmp0 (key, "image_path") == 0 ||
|
|
||||||
g_strcmp0 (key, "sound-file") == 0) {
|
|
||||||
parse_func = try_prepend_snap;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parse_func == NULL) {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
return get_parsed_variant (notification, key, value, parse_func);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* notify_notification_set_hint:
|
* notify_notification_set_hint:
|
||||||
* @notification: a #NotifyNotification
|
* @notification: a #NotifyNotification
|
||||||
|
@ -1408,7 +801,6 @@ notify_notification_set_hint (NotifyNotification *notification,
|
||||||
g_return_if_fail (key != NULL && *key != '\0');
|
g_return_if_fail (key != NULL && *key != '\0');
|
||||||
|
|
||||||
if (value != NULL) {
|
if (value != NULL) {
|
||||||
value = maybe_parse_snap_hint_value (notification, key, value);
|
|
||||||
g_hash_table_insert (notification->priv->hints,
|
g_hash_table_insert (notification->priv->hints,
|
||||||
g_strdup (key),
|
g_strdup (key),
|
||||||
g_variant_ref_sink (value));
|
g_variant_ref_sink (value));
|
||||||
|
@ -1435,10 +827,6 @@ notify_notification_set_app_name (NotifyNotification *notification,
|
||||||
{
|
{
|
||||||
g_return_if_fail (NOTIFY_IS_NOTIFICATION (notification));
|
g_return_if_fail (NOTIFY_IS_NOTIFICATION (notification));
|
||||||
|
|
||||||
if (maybe_warn_portal_unsupported_feature ("App Name")) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_free (notification->priv->app_name);
|
g_free (notification->priv->app_name);
|
||||||
notification->priv->app_name = g_strdup (app_name);
|
notification->priv->app_name = g_strdup (app_name);
|
||||||
|
|
||||||
|
@ -1544,11 +932,7 @@ notify_notification_set_hint_byte_array (NotifyNotification *notification,
|
||||||
|
|
||||||
g_return_if_fail (value != NULL || len == 0);
|
g_return_if_fail (value != NULL || len == 0);
|
||||||
|
|
||||||
#ifdef GLIB_VERSION_2_68
|
|
||||||
value_dup = g_memdup2 (value, len);
|
|
||||||
#else
|
|
||||||
value_dup = g_memdup (value, len);
|
value_dup = g_memdup (value, len);
|
||||||
#endif
|
|
||||||
notify_notification_set_hint (notification, key,
|
notify_notification_set_hint (notification, key,
|
||||||
g_variant_new_from_data (G_VARIANT_TYPE ("ay"),
|
g_variant_new_from_data (G_VARIANT_TYPE ("ay"),
|
||||||
value_dup,
|
value_dup,
|
||||||
|
@ -1677,28 +1061,6 @@ notify_notification_add_action (NotifyNotification *notification,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* notify_notification_get_activation_token:
|
|
||||||
* @notification: The notification.
|
|
||||||
*
|
|
||||||
* If an an action is currently being activated, return the activation token.
|
|
||||||
* This function is intended to be used in a #NotifyActionCallback to get
|
|
||||||
* the activation token for the activated action, if the notification daemon
|
|
||||||
* supports it.
|
|
||||||
*
|
|
||||||
* Return value: (transfer none): The current activation token, or %NULL if none
|
|
||||||
*
|
|
||||||
* Since: 0.7.10
|
|
||||||
*/
|
|
||||||
const char *
|
|
||||||
notify_notification_get_activation_token (NotifyNotification *notification)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (NOTIFY_IS_NOTIFICATION (notification), NULL);
|
|
||||||
g_return_val_if_fail (notification->priv->activating, NULL);
|
|
||||||
|
|
||||||
return notification->priv->activation_token;
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
_notify_notification_has_nondefault_actions (const NotifyNotification *n)
|
_notify_notification_has_nondefault_actions (const NotifyNotification *n)
|
||||||
{
|
{
|
||||||
|
@ -1735,12 +1097,6 @@ notify_notification_close (NotifyNotification *notification,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_notify_uses_portal_notifications ()) {
|
|
||||||
return remove_portal_notification (proxy, notification,
|
|
||||||
NOTIFY_CLOSED_REASON_API_REQUEST,
|
|
||||||
error);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* FIXME: make this nonblocking! */
|
/* FIXME: make this nonblocking! */
|
||||||
result = g_dbus_proxy_call_sync (proxy,
|
result = g_dbus_proxy_call_sync (proxy,
|
||||||
"CloseNotification",
|
"CloseNotification",
|
||||||
|
@ -1765,17 +1121,13 @@ notify_notification_close (NotifyNotification *notification,
|
||||||
* Returns the closed reason code for the notification. This is valid only
|
* Returns the closed reason code for the notification. This is valid only
|
||||||
* after the "closed" signal is emitted.
|
* after the "closed" signal is emitted.
|
||||||
*
|
*
|
||||||
* Since version 0.8.0 the returned value is of type #NotifyClosedReason.
|
* Returns: The closed reason code.
|
||||||
*
|
|
||||||
* Returns: An integer representing the closed reason code
|
|
||||||
* (Since 0.8.0 it's also a #NotifyClosedReason).
|
|
||||||
*/
|
*/
|
||||||
gint
|
gint
|
||||||
notify_notification_get_closed_reason (const NotifyNotification *notification)
|
notify_notification_get_closed_reason (const NotifyNotification *notification)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (notification != NULL, NOTIFY_CLOSED_REASON_UNSET);
|
g_return_val_if_fail (notification != NULL, -1);
|
||||||
g_return_val_if_fail (NOTIFY_IS_NOTIFICATION (notification),
|
g_return_val_if_fail (NOTIFY_IS_NOTIFICATION (notification), -1);
|
||||||
NOTIFY_CLOSED_REASON_UNSET);
|
|
||||||
|
|
||||||
return notification->priv->closed_reason;
|
return notification->priv->closed_reason;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,11 +55,6 @@ typedef struct _NotifyNotification NotifyNotification;
|
||||||
typedef struct _NotifyNotificationClass NotifyNotificationClass;
|
typedef struct _NotifyNotificationClass NotifyNotificationClass;
|
||||||
typedef struct _NotifyNotificationPrivate NotifyNotificationPrivate;
|
typedef struct _NotifyNotificationPrivate NotifyNotificationPrivate;
|
||||||
|
|
||||||
/**
|
|
||||||
* NotifyNotification:
|
|
||||||
*
|
|
||||||
* A passive pop-up notification.
|
|
||||||
*/
|
|
||||||
struct _NotifyNotification
|
struct _NotifyNotification
|
||||||
{
|
{
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
|
@ -93,34 +88,11 @@ typedef enum
|
||||||
|
|
||||||
} NotifyUrgency;
|
} NotifyUrgency;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NotifyClosedReason:
|
|
||||||
* @NOTIFY_CLOSED_REASON_UNSET: Notification not closed.
|
|
||||||
* @NOTIFY_CLOSED_REASON_EXPIRED: Timeout has expired.
|
|
||||||
* @NOTIFY_CLOSED_REASON_DISMISSED: It has been dismissed by the user.
|
|
||||||
* @NOTIFY_CLOSED_REASON_API_REQUEST: It has been closed by a call to
|
|
||||||
* notify_notification_close().
|
|
||||||
* @NOTIFY_CLOSED_REASON_UNDEFIEND: Closed by undefined/reserved reasons.
|
|
||||||
*
|
|
||||||
* The reason for which the notification has been closed.
|
|
||||||
*
|
|
||||||
* Since: 0.8.0
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
NOTIFY_CLOSED_REASON_UNSET = -1,
|
|
||||||
NOTIFY_CLOSED_REASON_EXPIRED = 1,
|
|
||||||
NOTIFY_CLOSED_REASON_DISMISSED = 2,
|
|
||||||
NOTIFY_CLOSED_REASON_API_REQUEST = 3,
|
|
||||||
NOTIFY_CLOSED_REASON_UNDEFIEND = 4,
|
|
||||||
} NotifyClosedReason;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NotifyActionCallback:
|
* NotifyActionCallback:
|
||||||
* @notification: a #NotifyActionCallback notification
|
* @notification:
|
||||||
* @action: (transfer none): The activated action name
|
* @action:
|
||||||
* @user_data: (nullable) (transfer none): User provided data
|
* @user_data:
|
||||||
*
|
*
|
||||||
* An action callback function.
|
* An action callback function.
|
||||||
*/
|
*/
|
||||||
|
@ -208,8 +180,6 @@ void notify_notification_add_action (NotifyNotificatio
|
||||||
gpointer user_data,
|
gpointer user_data,
|
||||||
GFreeFunc free_func);
|
GFreeFunc free_func);
|
||||||
|
|
||||||
const char *notify_notification_get_activation_token (NotifyNotification *notification);
|
|
||||||
|
|
||||||
void notify_notification_clear_actions (NotifyNotification *notification);
|
void notify_notification_clear_actions (NotifyNotification *notification);
|
||||||
gboolean notify_notification_close (NotifyNotification *notification,
|
gboolean notify_notification_close (NotifyNotification *notification,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
|
@ -43,14 +43,10 @@
|
||||||
|
|
||||||
static gboolean _initted = FALSE;
|
static gboolean _initted = FALSE;
|
||||||
static char *_app_name = NULL;
|
static char *_app_name = NULL;
|
||||||
static char *_snap_name = NULL;
|
|
||||||
static char *_snap_app = NULL;
|
|
||||||
static char *_flatpak_app = NULL;
|
|
||||||
static GDBusProxy *_proxy = NULL;
|
static GDBusProxy *_proxy = NULL;
|
||||||
static GList *_active_notifications = NULL;
|
static GList *_active_notifications = NULL;
|
||||||
static int _spec_version_major = 0;
|
static int _spec_version_major = 0;
|
||||||
static int _spec_version_minor = 0;
|
static int _spec_version_minor = 0;
|
||||||
static int _portal_version = 0;
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
_notify_check_spec_version (int major,
|
_notify_check_spec_version (int major,
|
||||||
|
@ -78,26 +74,6 @@ _notify_get_server_info (char **ret_name,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_notify_uses_portal_notifications ()) {
|
|
||||||
if (ret_name) {
|
|
||||||
*ret_name = g_strdup ("Portal Notification");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ret_vendor) {
|
|
||||||
*ret_vendor = g_strdup ("Freedesktop");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ret_version) {
|
|
||||||
*ret_version = g_strdup_printf ("%u", _portal_version);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ret_spec_version) {
|
|
||||||
*ret_spec_version = g_strdup ("1.2");
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
result = g_dbus_proxy_call_sync (proxy,
|
result = g_dbus_proxy_call_sync (proxy,
|
||||||
"GetServerInformation",
|
"GetServerInformation",
|
||||||
g_variant_new ("()"),
|
g_variant_new ("()"),
|
||||||
|
@ -143,18 +119,6 @@ _notify_update_spec_version (GError **error)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
|
||||||
set_app_name (const char *app_name)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (app_name != NULL, FALSE);
|
|
||||||
g_return_val_if_fail (*app_name != '\0', FALSE);
|
|
||||||
|
|
||||||
g_free (_app_name);
|
|
||||||
_app_name = g_strdup (app_name);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* notify_set_app_name:
|
* notify_set_app_name:
|
||||||
|
@ -166,267 +130,38 @@ set_app_name (const char *app_name)
|
||||||
void
|
void
|
||||||
notify_set_app_name (const char *app_name)
|
notify_set_app_name (const char *app_name)
|
||||||
{
|
{
|
||||||
set_app_name (app_name);
|
g_free (_app_name);
|
||||||
|
_app_name = g_strdup (app_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* notify_init:
|
* notify_init:
|
||||||
* @app_name: (nullable): The name of the application initializing libnotify.
|
* @app_name: The name of the application initializing libnotify.
|
||||||
*
|
*
|
||||||
* Initialized libnotify. This must be called before any other functions.
|
* Initialized libnotify. This must be called before any other functions.
|
||||||
*
|
*
|
||||||
* Starting from 0.8, if the provided @app_name is %NULL, libnotify will
|
|
||||||
* try to figure it out from the running application.
|
|
||||||
* Before it was not allowed, and was causing libnotify not to be initialized.
|
|
||||||
*
|
|
||||||
* Returns: %TRUE if successful, or %FALSE on error.
|
* Returns: %TRUE if successful, or %FALSE on error.
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
notify_init (const char *app_name)
|
notify_init (const char *app_name)
|
||||||
{
|
{
|
||||||
|
g_return_val_if_fail (app_name != NULL, FALSE);
|
||||||
|
g_return_val_if_fail (*app_name != '\0', FALSE);
|
||||||
|
|
||||||
if (_initted)
|
if (_initted)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if (app_name == NULL) {
|
notify_set_app_name (app_name);
|
||||||
GApplication *application;
|
|
||||||
|
|
||||||
app_name = _notify_get_snap_app ();
|
#if !GLIB_CHECK_VERSION (2, 36, 0)
|
||||||
if (app_name == NULL) {
|
g_type_init ();
|
||||||
app_name = _notify_get_flatpak_app ();
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
if (app_name == NULL &&
|
|
||||||
(application = g_application_get_default ())) {
|
|
||||||
app_name = g_application_get_application_id (application);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!set_app_name (app_name)) {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
_initted = TRUE;
|
_initted = TRUE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
_initialize_snap_names (void)
|
|
||||||
{
|
|
||||||
gchar *cgroup_contents = NULL;
|
|
||||||
gchar *found_snap_name = NULL;
|
|
||||||
gchar **lines;
|
|
||||||
gint i;
|
|
||||||
|
|
||||||
if (!g_file_get_contents ("/proc/self/cgroup", &cgroup_contents,
|
|
||||||
NULL, NULL)) {
|
|
||||||
g_free (cgroup_contents);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
lines = g_strsplit (cgroup_contents, "\n", -1);
|
|
||||||
g_free (cgroup_contents);
|
|
||||||
|
|
||||||
for (i = 0; lines[i]; ++i) {
|
|
||||||
gchar **parts = g_strsplit (lines[i], ":", 3);
|
|
||||||
gchar *basename;
|
|
||||||
gchar **ns;
|
|
||||||
guint ns_length;
|
|
||||||
|
|
||||||
if (g_strv_length (parts) != 3) {
|
|
||||||
g_strfreev (parts);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
basename = g_path_get_basename (parts[2]);
|
|
||||||
g_strfreev (parts);
|
|
||||||
|
|
||||||
if (!basename) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
ns = g_strsplit (basename, ".", -1);
|
|
||||||
ns_length = g_strv_length (ns);
|
|
||||||
g_free (basename);
|
|
||||||
|
|
||||||
if (ns_length < 2 || !g_str_equal (ns[0], "snap")) {
|
|
||||||
g_strfreev (ns);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_snap_name == NULL) {
|
|
||||||
g_free (found_snap_name);
|
|
||||||
found_snap_name = g_strdup (ns[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ns_length < 3) {
|
|
||||||
g_strfreev (ns);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_snap_name == NULL) {
|
|
||||||
_snap_name = found_snap_name;
|
|
||||||
found_snap_name = NULL;
|
|
||||||
g_debug ("SNAP name: %s", _snap_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (g_str_equal (ns[1], _snap_name)) {
|
|
||||||
_snap_app = g_strdup (ns[2]);
|
|
||||||
g_strfreev (ns);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_strfreev (ns);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_snap_name == NULL && found_snap_name != NULL) {
|
|
||||||
_snap_name = found_snap_name;
|
|
||||||
found_snap_name = NULL;
|
|
||||||
g_debug ("SNAP name: %s", _snap_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_snap_app == NULL) {
|
|
||||||
_snap_app = g_strdup (_snap_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_debug ("SNAP app: %s", _snap_app);
|
|
||||||
|
|
||||||
g_strfreev (lines);
|
|
||||||
g_free (found_snap_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *
|
|
||||||
_notify_get_snap_path (void)
|
|
||||||
{
|
|
||||||
static const char *snap_path = NULL;
|
|
||||||
static gsize snap_path_set = FALSE;
|
|
||||||
|
|
||||||
if (g_once_init_enter (&snap_path_set)) {
|
|
||||||
snap_path = g_getenv ("SNAP");
|
|
||||||
|
|
||||||
if (!snap_path || *snap_path == '\0' ||
|
|
||||||
!strchr (snap_path, G_DIR_SEPARATOR)) {
|
|
||||||
snap_path = NULL;
|
|
||||||
} else {
|
|
||||||
g_debug ("SNAP path: %s", snap_path);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_once_init_leave (&snap_path_set, TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
return snap_path;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *
|
|
||||||
_notify_get_snap_name (void)
|
|
||||||
{
|
|
||||||
static gsize snap_name_set = FALSE;
|
|
||||||
|
|
||||||
if (g_once_init_enter (&snap_name_set)) {
|
|
||||||
if (!_snap_name) {
|
|
||||||
const char *snap_name_env = g_getenv ("SNAP_NAME");
|
|
||||||
|
|
||||||
if (!snap_name_env || *snap_name_env == '\0')
|
|
||||||
snap_name_env = NULL;
|
|
||||||
|
|
||||||
_snap_name = g_strdup (snap_name_env);
|
|
||||||
g_debug ("SNAP name: %s", _snap_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_once_init_leave (&snap_name_set, TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
return _snap_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *
|
|
||||||
_notify_get_snap_app (void)
|
|
||||||
{
|
|
||||||
static gsize snap_app_set = FALSE;
|
|
||||||
|
|
||||||
if (g_once_init_enter (&snap_app_set)) {
|
|
||||||
_initialize_snap_names ();
|
|
||||||
g_once_init_leave (&snap_app_set, TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
return _snap_app;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *
|
|
||||||
_notify_get_flatpak_app (void)
|
|
||||||
{
|
|
||||||
static gsize flatpak_app_set = FALSE;
|
|
||||||
|
|
||||||
if (g_once_init_enter (&flatpak_app_set)) {
|
|
||||||
GKeyFile *info = g_key_file_new ();
|
|
||||||
|
|
||||||
if (g_key_file_load_from_file (info, "/.flatpak-info",
|
|
||||||
G_KEY_FILE_NONE, NULL)) {
|
|
||||||
const char *group = "Application";
|
|
||||||
|
|
||||||
if (g_key_file_has_group (info, "Runtime")) {
|
|
||||||
group = "Runtime";
|
|
||||||
}
|
|
||||||
|
|
||||||
_flatpak_app = g_key_file_get_string (info, group,
|
|
||||||
"name", NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_key_file_free (info);
|
|
||||||
g_once_init_leave (&flatpak_app_set, TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
return _flatpak_app;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
_notify_is_running_under_flatpak (void)
|
|
||||||
{
|
|
||||||
return !!_notify_get_flatpak_app ();
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
_notify_is_running_under_snap (void)
|
|
||||||
{
|
|
||||||
return !!_notify_get_snap_app ();
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
_notify_is_running_in_sandbox (void)
|
|
||||||
{
|
|
||||||
static gsize use_portal = 0;
|
|
||||||
enum {
|
|
||||||
IGNORE_PORTAL = 1,
|
|
||||||
TRY_USE_PORTAL = 2,
|
|
||||||
FORCE_PORTAL = 3
|
|
||||||
};
|
|
||||||
|
|
||||||
if (g_once_init_enter (&use_portal)) {
|
|
||||||
if (G_UNLIKELY (g_getenv ("NOTIFY_IGNORE_PORTAL"))) {
|
|
||||||
g_once_init_leave (&use_portal, IGNORE_PORTAL);
|
|
||||||
} else if (G_UNLIKELY (g_getenv ("NOTIFY_FORCE_PORTAL"))) {
|
|
||||||
g_once_init_leave (&use_portal, FORCE_PORTAL);
|
|
||||||
} else {
|
|
||||||
g_once_init_leave (&use_portal, TRY_USE_PORTAL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (use_portal == IGNORE_PORTAL) {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return use_portal == FORCE_PORTAL ||
|
|
||||||
_notify_is_running_under_flatpak () ||
|
|
||||||
_notify_is_running_under_snap ();
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean
|
|
||||||
_notify_uses_portal_notifications (void)
|
|
||||||
{
|
|
||||||
return _portal_version != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* notify_get_app_name:
|
* notify_get_app_name:
|
||||||
*
|
*
|
||||||
|
@ -476,15 +211,6 @@ notify_uninit (void)
|
||||||
_proxy = NULL;
|
_proxy = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free (_snap_name);
|
|
||||||
_snap_name = NULL;
|
|
||||||
|
|
||||||
g_free (_snap_app);
|
|
||||||
_snap_app = NULL;
|
|
||||||
|
|
||||||
g_free (_flatpak_app);
|
|
||||||
_flatpak_app = NULL;
|
|
||||||
|
|
||||||
_initted = FALSE;
|
_initted = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -501,46 +227,6 @@ notify_is_initted (void)
|
||||||
return _initted;
|
return _initted;
|
||||||
}
|
}
|
||||||
|
|
||||||
GDBusProxy *
|
|
||||||
_get_portal_proxy (GError **error)
|
|
||||||
{
|
|
||||||
GError *local_error = NULL;
|
|
||||||
GDBusProxy *proxy;
|
|
||||||
GVariant *res;
|
|
||||||
|
|
||||||
proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
|
|
||||||
G_DBUS_PROXY_FLAGS_NONE,
|
|
||||||
NULL,
|
|
||||||
NOTIFY_PORTAL_DBUS_NAME,
|
|
||||||
NOTIFY_PORTAL_DBUS_CORE_OBJECT,
|
|
||||||
NOTIFY_PORTAL_DBUS_CORE_INTERFACE,
|
|
||||||
NULL,
|
|
||||||
&local_error);
|
|
||||||
|
|
||||||
if (proxy == NULL) {
|
|
||||||
g_debug ("Failed to get portal proxy: %s", local_error->message);
|
|
||||||
g_clear_error (&local_error);
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
res = g_dbus_proxy_get_cached_property (proxy, "version");
|
|
||||||
if (!res) {
|
|
||||||
g_object_unref (proxy);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
_portal_version = g_variant_get_uint32 (res);
|
|
||||||
g_assert (_portal_version > 0);
|
|
||||||
|
|
||||||
g_warning ("Running in confined mode, using Portal notifications. "
|
|
||||||
"Some features and hints won't be supported");
|
|
||||||
|
|
||||||
g_variant_unref (res);
|
|
||||||
|
|
||||||
return proxy;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* _notify_get_proxy:
|
* _notify_get_proxy:
|
||||||
* @error: (allow-none): a location to store a #GError, or %NULL
|
* @error: (allow-none): a location to store a #GError, or %NULL
|
||||||
|
@ -556,14 +242,6 @@ _notify_get_proxy (GError **error)
|
||||||
if (_proxy != NULL)
|
if (_proxy != NULL)
|
||||||
return _proxy;
|
return _proxy;
|
||||||
|
|
||||||
if (_notify_is_running_in_sandbox ()) {
|
|
||||||
_proxy = _get_portal_proxy (error);
|
|
||||||
|
|
||||||
if (_proxy != NULL) {
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
|
_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
|
||||||
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
|
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -572,8 +250,6 @@ _notify_get_proxy (GError **error)
|
||||||
NOTIFY_DBUS_CORE_INTERFACE,
|
NOTIFY_DBUS_CORE_INTERFACE,
|
||||||
NULL,
|
NULL,
|
||||||
error);
|
error);
|
||||||
|
|
||||||
out:
|
|
||||||
if (_proxy == NULL) {
|
if (_proxy == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -611,15 +287,6 @@ notify_get_server_caps (void)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_notify_uses_portal_notifications ()) {
|
|
||||||
list = g_list_prepend (list, g_strdup ("actions"));
|
|
||||||
list = g_list_prepend (list, g_strdup ("body"));
|
|
||||||
list = g_list_prepend (list, g_strdup ("body-images"));
|
|
||||||
list = g_list_prepend (list, g_strdup ("icon-static"));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
result = g_dbus_proxy_call_sync (proxy,
|
result = g_dbus_proxy_call_sync (proxy,
|
||||||
"GetCapabilities",
|
"GetCapabilities",
|
||||||
g_variant_new ("()"),
|
g_variant_new ("()"),
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<node name="/org/freedesktop/Notification">
|
||||||
|
|
||||||
|
<interface name="org.freedesktop.NotificationListener">
|
||||||
|
|
||||||
|
</interface>
|
||||||
|
</node>
|
33
meson.build
33
meson.build
|
@ -1,13 +1,11 @@
|
||||||
project('libnotify',
|
project('libnotify',
|
||||||
'c',
|
'c',
|
||||||
version: '0.8.1',
|
version: '0.7.7',
|
||||||
meson_version: '>= 0.47.0')
|
meson_version: '>= 0.47.0')
|
||||||
|
|
||||||
gnome = import('gnome')
|
gnome = import('gnome')
|
||||||
pkgconfig = import('pkgconfig')
|
pkgconfig = import('pkgconfig')
|
||||||
|
|
||||||
cc = meson.get_compiler('c')
|
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# libtool versioning
|
# libtool versioning
|
||||||
################################################################
|
################################################################
|
||||||
|
@ -22,11 +20,8 @@ LT_CURRENT=4
|
||||||
LT_REVISION=0
|
LT_REVISION=0
|
||||||
LT_AGE=0
|
LT_AGE=0
|
||||||
|
|
||||||
API_VERSION = 7
|
|
||||||
|
|
||||||
VERSION_ARRAY = meson.project_version().split('.')
|
VERSION_ARRAY = meson.project_version().split('.')
|
||||||
# Minor version is hardcoded until we have a real API break
|
MODULE_VERSION = '@0@.@1@'.format(VERSION_ARRAY[0], VERSION_ARRAY[1])
|
||||||
MODULE_VERSION = '@0@.@1@'.format(VERSION_ARRAY[0], API_VERSION)
|
|
||||||
LIBNAME = meson.project_name().split('lib')[1]
|
LIBNAME = meson.project_name().split('lib')[1]
|
||||||
|
|
||||||
default_includes = include_directories('.')
|
default_includes = include_directories('.')
|
||||||
|
@ -34,12 +29,11 @@ default_includes = include_directories('.')
|
||||||
prefix = get_option('prefix')
|
prefix = get_option('prefix')
|
||||||
includedir = join_paths(prefix, get_option('includedir'))
|
includedir = join_paths(prefix, get_option('includedir'))
|
||||||
docdir = join_paths(prefix, get_option('datadir'), 'doc', meson.project_name())
|
docdir = join_paths(prefix, get_option('datadir'), 'doc', meson.project_name())
|
||||||
man1dir = join_paths(prefix, get_option('mandir'), 'man1')
|
|
||||||
|
|
||||||
libnotify_deps = []
|
libnotify_deps = []
|
||||||
extra_deps = []
|
extra_deps = []
|
||||||
|
|
||||||
glib_req_version = '>= 2.38.0'
|
glib_req_version = '>= 2.26.0'
|
||||||
|
|
||||||
gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0')
|
gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0')
|
||||||
glib_dep = dependency('glib-2.0', version: glib_req_version)
|
glib_dep = dependency('glib-2.0', version: glib_req_version)
|
||||||
|
@ -55,27 +49,6 @@ configure_file(input: 'config.h.meson',
|
||||||
output : 'config.h',
|
output : 'config.h',
|
||||||
configuration : conf)
|
configuration : conf)
|
||||||
|
|
||||||
if get_option('man')
|
|
||||||
xsltproc = find_program('xsltproc', required: true)
|
|
||||||
stylesheet = 'http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl'
|
|
||||||
xsltproc_command = [
|
|
||||||
xsltproc,
|
|
||||||
'--nonet',
|
|
||||||
'--stringparam', 'man.output.quietly', '1',
|
|
||||||
'--stringparam', 'funcsynopsis.style', 'ansi',
|
|
||||||
'--stringparam', 'man.th.extra1.suppress', '1',
|
|
||||||
'-o', '@OUTPUT@',
|
|
||||||
stylesheet,
|
|
||||||
'@INPUT@',
|
|
||||||
]
|
|
||||||
|
|
||||||
testrun = run_command(xsltproc, '--nonet', stylesheet, check: false)
|
|
||||||
|
|
||||||
if testrun.returncode() != 0
|
|
||||||
error('DocBook stylesheet for generating man pages not found, you need to install docbook-xsl-ns or similar package.')
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
subdir('libnotify')
|
subdir('libnotify')
|
||||||
subdir('tools')
|
subdir('tools')
|
||||||
subdir('docs')
|
subdir('docs')
|
||||||
|
|
|
@ -6,10 +6,6 @@ option('introspection',
|
||||||
type: 'feature',
|
type: 'feature',
|
||||||
value: 'enabled',
|
value: 'enabled',
|
||||||
description: 'Enable GObject introspection')
|
description: 'Enable GObject introspection')
|
||||||
option('man',
|
|
||||||
type: 'boolean',
|
|
||||||
value: true,
|
|
||||||
description: 'Enable generating the manual page (depends on xsltproc)')
|
|
||||||
option('gtk_doc',
|
option('gtk_doc',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
value: true,
|
value: true,
|
||||||
|
|
|
@ -0,0 +1,93 @@
|
||||||
|
INCLUDES = \
|
||||||
|
-I$(top_srcdir) \
|
||||||
|
$(TESTS_CFLAGS)
|
||||||
|
|
||||||
|
noinst_PROGRAMS = \
|
||||||
|
test-replace \
|
||||||
|
test-replace-widget \
|
||||||
|
test-server-info \
|
||||||
|
test-default-action \
|
||||||
|
test-multi-actions \
|
||||||
|
test-action-icons \
|
||||||
|
test-image \
|
||||||
|
test-basic \
|
||||||
|
test-error \
|
||||||
|
test-markup \
|
||||||
|
test-persistence \
|
||||||
|
test-removal \
|
||||||
|
test-resident \
|
||||||
|
test-rtl \
|
||||||
|
test-size-changes \
|
||||||
|
test-transient \
|
||||||
|
test-urgency \
|
||||||
|
test-xy \
|
||||||
|
test-xy-actions \
|
||||||
|
test-xy-stress
|
||||||
|
|
||||||
|
common_ldflags = \
|
||||||
|
$(top_builddir)/libnotify/libnotify.la \
|
||||||
|
$(TESTS_LIBS)
|
||||||
|
|
||||||
|
test_replace_SOURCES = test-replace.c
|
||||||
|
test_replace_LDADD = $(common_ldflags)
|
||||||
|
|
||||||
|
test_replace_widget_SOURCES = test-replace-widget.c
|
||||||
|
test_replace_widget_LDADD = $(common_ldflags)
|
||||||
|
|
||||||
|
test_server_info_SOURCES = test-server-info.c
|
||||||
|
test_server_info_LDADD = $(common_ldflags)
|
||||||
|
|
||||||
|
test_size_changes_SOURCES = test-size-changes.c
|
||||||
|
test_size_changes_LDADD = $(common_ldflags)
|
||||||
|
|
||||||
|
test_default_action_SOURCES = test-default-action.c
|
||||||
|
test_default_action_LDADD = $(common_ldflags)
|
||||||
|
|
||||||
|
test_multi_actions_SOURCES = test-multi-actions.c
|
||||||
|
test_multi_actions_LDADD = $(common_ldflags)
|
||||||
|
|
||||||
|
test_action_icons_SOURCES = test-action-icons.c
|
||||||
|
test_action_icons_LDADD = $(common_ldflags)
|
||||||
|
|
||||||
|
test_image_SOURCES = test-image.c
|
||||||
|
test_image_LDADD = $(common_ldflags)
|
||||||
|
|
||||||
|
test_basic_SOURCES = test-basic.c
|
||||||
|
test_basic_LDADD = $(common_ldflags)
|
||||||
|
|
||||||
|
test_error_SOURCES = test-error.c
|
||||||
|
test_error_LDADD = $(common_ldflags)
|
||||||
|
|
||||||
|
test_markup_SOURCES = test-markup.c
|
||||||
|
test_markup_LDADD = $(common_ldflags)
|
||||||
|
|
||||||
|
test_urgency_SOURCES = test-urgency.c
|
||||||
|
test_urgency_LDADD = $(common_ldflags)
|
||||||
|
|
||||||
|
test_xy_SOURCES = test-xy.c
|
||||||
|
test_xy_LDADD = $(common_ldflags)
|
||||||
|
|
||||||
|
test_xy_actions_SOURCES = test-xy-actions.c
|
||||||
|
test_xy_actions_LDADD = $(common_ldflags)
|
||||||
|
|
||||||
|
test_xy_stress_SOURCES = test-xy-stress.c
|
||||||
|
test_xy_stress_LDADD = $(common_ldflags)
|
||||||
|
|
||||||
|
test_rtl_SOURCES = test-rtl.c
|
||||||
|
test_rtl_LDADD = $(common_ldflags)
|
||||||
|
|
||||||
|
test_persistence_SOURCES = test-persistence.c
|
||||||
|
test_persistence_LDADD = $(common_ldflags)
|
||||||
|
|
||||||
|
test_removal_SOURCES = test-removal.c
|
||||||
|
test_removal_LDADD = $(common_ldflags)
|
||||||
|
|
||||||
|
test_resident_SOURCES = test-resident.c
|
||||||
|
test_resident_LDADD = $(common_ldflags)
|
||||||
|
|
||||||
|
test_transient_SOURCES = test-transient.c
|
||||||
|
test_transient_LDADD = $(common_ldflags)
|
||||||
|
|
||||||
|
EXTRA_DIST = applet-critical.png test-gir.py
|
||||||
|
|
||||||
|
-include $(top_srcdir)/git.mk
|
|
@ -29,6 +29,10 @@ main ()
|
||||||
{
|
{
|
||||||
NotifyNotification *n;
|
NotifyNotification *n;
|
||||||
|
|
||||||
|
#if !GLIB_CHECK_VERSION (2, 36, 0)
|
||||||
|
g_type_init ();
|
||||||
|
#endif
|
||||||
|
|
||||||
notify_init ("Error Handling");
|
notify_init ("Error Handling");
|
||||||
|
|
||||||
n = notify_notification_new ("Summary", "Content", NULL);
|
n = notify_notification_new ("Summary", "Content", NULL);
|
||||||
|
|
|
@ -28,6 +28,10 @@ main ()
|
||||||
GError *error;
|
GError *error;
|
||||||
error = NULL;
|
error = NULL;
|
||||||
|
|
||||||
|
#if !GLIB_CHECK_VERSION (2, 36, 0)
|
||||||
|
g_type_init ();
|
||||||
|
#endif
|
||||||
|
|
||||||
notify_init ("Replace Test");
|
notify_init ("Replace Test");
|
||||||
|
|
||||||
n = notify_notification_new ("Summary",
|
n = notify_notification_new ("Summary",
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
bin_PROGRAMS = notify-send
|
||||||
|
|
||||||
|
common_ldflags = \
|
||||||
|
$(top_builddir)/libnotify/libnotify.la \
|
||||||
|
$(PACKAGE_LIBS)
|
||||||
|
|
||||||
|
notify_send_SOURCES = notify-send.c
|
||||||
|
notify_send_LDADD = $(common_ldflags)
|
||||||
|
|
||||||
|
INCLUDES = $(PACKAGE_CFLAGS) \
|
||||||
|
-I$(top_srcdir)
|
||||||
|
|
||||||
|
-include $(top_srcdir)/git.mk
|
|
@ -26,14 +26,12 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <glib-unix.h>
|
|
||||||
#include <glib/gprintf.h>
|
#include <glib/gprintf.h>
|
||||||
|
|
||||||
#define N_(x) (x)
|
#define N_(x) (x)
|
||||||
#define GETTEXT_PACKAGE NULL
|
#define GETTEXT_PACKAGE NULL
|
||||||
|
|
||||||
static NotifyUrgency urgency = NOTIFY_URGENCY_NORMAL;
|
static NotifyUrgency urgency = NOTIFY_URGENCY_NORMAL;
|
||||||
static GMainLoop *loop = NULL;
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
g_option_arg_urgency_cb (const char *option_name,
|
g_option_arg_urgency_cb (const char *option_name,
|
||||||
|
@ -101,26 +99,6 @@ notify_notification_set_hint_variant (NotifyNotification *notification,
|
||||||
key,
|
key,
|
||||||
(guchar) h_byte);
|
(guchar) h_byte);
|
||||||
}
|
}
|
||||||
} else if (g_ascii_strcasecmp (type, "boolean") == 0) {
|
|
||||||
gboolean h_boolean = FALSE;
|
|
||||||
|
|
||||||
if (g_ascii_strcasecmp (value, "true") == 0) {
|
|
||||||
h_boolean = TRUE;
|
|
||||||
} else if (g_ascii_isdigit (*value)) {
|
|
||||||
h_boolean = !!g_ascii_strtoull (value, NULL, 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
notify_notification_set_hint (notification, key,
|
|
||||||
g_variant_new_boolean (h_boolean));
|
|
||||||
} else if (g_ascii_strcasecmp (type, "variant") == 0) {
|
|
||||||
GVariant *variant = g_variant_parse (NULL, value, NULL, NULL, NULL);
|
|
||||||
|
|
||||||
if (variant != NULL) {
|
|
||||||
notify_notification_set_hint (notification, key, variant);
|
|
||||||
} else {
|
|
||||||
conv_error = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
*error = g_error_new (G_OPTION_ERROR,
|
*error = g_error_new (G_OPTION_ERROR,
|
||||||
G_OPTION_ERROR_BAD_VALUE,
|
G_OPTION_ERROR_BAD_VALUE,
|
||||||
|
@ -142,70 +120,6 @@ notify_notification_set_hint_variant (NotifyNotification *notification,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
handle_closed (NotifyNotification *notify,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
g_main_loop_quit (loop);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
on_sigint (gpointer data)
|
|
||||||
{
|
|
||||||
NotifyNotification *notification = data;
|
|
||||||
|
|
||||||
g_printerr ("Wait cancelled, closing notification\n");
|
|
||||||
|
|
||||||
notify_notification_close (notification, NULL);
|
|
||||||
g_main_loop_quit (loop);
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
handle_action (NotifyNotification *notify,
|
|
||||||
char *action,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
const char *action_name = user_data;
|
|
||||||
const char *activation_token;
|
|
||||||
|
|
||||||
activation_token = notify_notification_get_activation_token (notify);
|
|
||||||
|
|
||||||
g_printf ("%s\n", action_name);
|
|
||||||
|
|
||||||
if (activation_token) {
|
|
||||||
g_debug ("Activation Token: %s", activation_token);
|
|
||||||
}
|
|
||||||
|
|
||||||
notify_notification_close (notify, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
on_wait_timeout (gpointer data)
|
|
||||||
{
|
|
||||||
fprintf (stderr, "Wait timeout expired\n");
|
|
||||||
g_main_loop_quit (loop);
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
server_has_capability (const gchar *capability)
|
|
||||||
{
|
|
||||||
GList *server_caps = notify_get_server_caps ();
|
|
||||||
gboolean supported;
|
|
||||||
|
|
||||||
supported = !!g_list_find_custom (server_caps,
|
|
||||||
capability,
|
|
||||||
(GCompareFunc) g_ascii_strcasecmp);
|
|
||||||
|
|
||||||
g_list_foreach (server_caps, (GFunc) g_free, NULL);
|
|
||||||
g_list_free (server_caps);
|
|
||||||
|
|
||||||
return supported;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
@ -214,19 +128,11 @@ main (int argc, char *argv[])
|
||||||
static const char *type = NULL;
|
static const char *type = NULL;
|
||||||
static char *app_name = NULL;
|
static char *app_name = NULL;
|
||||||
static char *icon_str = NULL;
|
static char *icon_str = NULL;
|
||||||
|
static char *icons = NULL;
|
||||||
static char **n_text = NULL;
|
static char **n_text = NULL;
|
||||||
static char **hints = NULL;
|
static char **hints = NULL;
|
||||||
static char **actions = NULL;
|
|
||||||
static char *server_name = NULL;
|
|
||||||
static char *server_vendor = NULL;
|
|
||||||
static char *server_version = NULL;
|
|
||||||
static char *server_spec_version = NULL;
|
|
||||||
static gboolean print_id = FALSE;
|
|
||||||
static gint notification_id = 0;
|
|
||||||
static gboolean do_version = FALSE;
|
static gboolean do_version = FALSE;
|
||||||
static gboolean hint_error = FALSE, show_error = FALSE;
|
static gboolean hint_error = FALSE;
|
||||||
static gboolean transient = FALSE;
|
|
||||||
static gboolean wait = FALSE;
|
|
||||||
static glong expire_timeout = NOTIFY_EXPIRES_DEFAULT;
|
static glong expire_timeout = NOTIFY_EXPIRES_DEFAULT;
|
||||||
GOptionContext *opt_ctx;
|
GOptionContext *opt_ctx;
|
||||||
NotifyNotification *notify;
|
NotifyNotification *notify;
|
||||||
|
@ -244,32 +150,16 @@ main (int argc, char *argv[])
|
||||||
"notification."), N_("TIME")},
|
"notification."), N_("TIME")},
|
||||||
{"app-name", 'a', 0, G_OPTION_ARG_STRING, &app_name,
|
{"app-name", 'a', 0, G_OPTION_ARG_STRING, &app_name,
|
||||||
N_("Specifies the app name for the icon"), N_("APP_NAME")},
|
N_("Specifies the app name for the icon"), N_("APP_NAME")},
|
||||||
{"icon", 'i', 0, G_OPTION_ARG_FILENAME, &icon_str,
|
{"icon", 'i', 0, G_OPTION_ARG_FILENAME, &icons,
|
||||||
N_("Specifies an icon filename or stock icon to display."),
|
N_("Specifies an icon filename or stock icon to display."),
|
||||||
N_("ICON")},
|
N_("ICON[,ICON...]")},
|
||||||
{"category", 'c', 0, G_OPTION_ARG_FILENAME, &type,
|
{"category", 'c', 0, G_OPTION_ARG_FILENAME, &type,
|
||||||
N_("Specifies the notification category."),
|
N_("Specifies the notification category."),
|
||||||
N_("TYPE[,TYPE...]")},
|
N_("TYPE[,TYPE...]")},
|
||||||
{"transient", 'e', 0, G_OPTION_ARG_NONE, &transient,
|
|
||||||
N_("Create a transient notification"),
|
|
||||||
NULL},
|
|
||||||
{"hint", 'h', 0, G_OPTION_ARG_FILENAME_ARRAY, &hints,
|
{"hint", 'h', 0, G_OPTION_ARG_FILENAME_ARRAY, &hints,
|
||||||
N_
|
N_
|
||||||
("Specifies basic extra data to pass. Valid types are boolean, int, double, string, byte and variant."),
|
("Specifies basic extra data to pass. Valid types are int, double, string and byte."),
|
||||||
N_("TYPE:NAME:VALUE")},
|
N_("TYPE:NAME:VALUE")},
|
||||||
{"print-id", 'p', 0, G_OPTION_ARG_NONE, &print_id,
|
|
||||||
N_ ("Print the notification ID."), NULL},
|
|
||||||
{"replace-id", 'r', 0, G_OPTION_ARG_INT, ¬ification_id,
|
|
||||||
N_ ("The ID of the notification to replace."), N_("REPLACE_ID")},
|
|
||||||
{"wait", 'w', 0, G_OPTION_ARG_NONE, &wait,
|
|
||||||
N_("Wait for the notification to be closed before exiting."),
|
|
||||||
NULL},
|
|
||||||
{"action", 'A', 0, G_OPTION_ARG_FILENAME_ARRAY, &actions,
|
|
||||||
N_
|
|
||||||
("Specifies the actions to display to the user. Implies --wait to wait for user input."
|
|
||||||
" May be set multiple times. The name of the action is output to stdout. If NAME is "
|
|
||||||
"not specified, the numerical index of the option is used (starting with 0)."),
|
|
||||||
N_("[NAME=]Text...")},
|
|
||||||
{"version", 'v', 0, G_OPTION_ARG_NONE, &do_version,
|
{"version", 'v', 0, G_OPTION_ARG_NONE, &do_version,
|
||||||
N_("Version of the package."),
|
N_("Version of the package."),
|
||||||
NULL},
|
NULL},
|
||||||
|
@ -283,6 +173,10 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
setlocale (LC_ALL, "");
|
setlocale (LC_ALL, "");
|
||||||
|
|
||||||
|
#if !GLIB_CHECK_VERSION (2, 36, 0)
|
||||||
|
g_type_init ();
|
||||||
|
#endif
|
||||||
|
|
||||||
g_set_prgname (argv[0]);
|
g_set_prgname (argv[0]);
|
||||||
g_log_set_always_fatal (G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
|
g_log_set_always_fatal (G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
|
||||||
|
|
||||||
|
@ -321,44 +215,27 @@ main (int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (icons != NULL) {
|
||||||
|
char *c;
|
||||||
|
|
||||||
|
/* XXX */
|
||||||
|
if ((c = strchr (icons, ',')) != NULL)
|
||||||
|
*c = '\0';
|
||||||
|
|
||||||
|
icon_str = icons;
|
||||||
|
}
|
||||||
|
|
||||||
if (!notify_init ("notify-send"))
|
if (!notify_init ("notify-send"))
|
||||||
exit (1);
|
exit (1);
|
||||||
|
|
||||||
notify_get_server_info (&server_name,
|
notify = notify_notification_new (summary,
|
||||||
&server_vendor,
|
body,
|
||||||
&server_version,
|
icon_str);
|
||||||
&server_spec_version);
|
|
||||||
|
|
||||||
g_debug ("Using sever %s %s, v%s - Supporting Notification Spec %s",
|
|
||||||
server_name, server_vendor, server_version, server_spec_version);
|
|
||||||
g_free (server_name);
|
|
||||||
g_free (server_vendor);
|
|
||||||
g_free (server_version);
|
|
||||||
g_free (server_spec_version);
|
|
||||||
|
|
||||||
notify = g_object_new (NOTIFY_TYPE_NOTIFICATION,
|
|
||||||
"summary", summary,
|
|
||||||
"body", body,
|
|
||||||
"icon-name", icon_str,
|
|
||||||
"id", notification_id,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
notify_notification_set_category (notify, type);
|
notify_notification_set_category (notify, type);
|
||||||
notify_notification_set_urgency (notify, urgency);
|
notify_notification_set_urgency (notify, urgency);
|
||||||
notify_notification_set_timeout (notify, expire_timeout);
|
notify_notification_set_timeout (notify, expire_timeout);
|
||||||
notify_notification_set_app_name (notify, app_name);
|
notify_notification_set_app_name (notify, app_name);
|
||||||
|
|
||||||
if (transient) {
|
|
||||||
notify_notification_set_hint (notify, "transient",
|
|
||||||
g_variant_new_boolean (TRUE));
|
|
||||||
|
|
||||||
if (!server_has_capability ("persistence")) {
|
|
||||||
g_debug ("Persistence is not supported by the "
|
|
||||||
"notifications server. "
|
|
||||||
"All notifications are transient.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
g_free (body);
|
g_free (body);
|
||||||
|
|
||||||
/* Set hints */
|
/* Set hints */
|
||||||
|
@ -369,7 +246,7 @@ main (int argc, char *argv[])
|
||||||
char **tokens = NULL;
|
char **tokens = NULL;
|
||||||
|
|
||||||
while ((hint = hints[i++])) {
|
while ((hint = hints[i++])) {
|
||||||
tokens = g_strsplit (hint, ":", 3);
|
tokens = g_strsplit (hint, ":", -1);
|
||||||
l = g_strv_length (tokens);
|
l = g_strv_length (tokens);
|
||||||
|
|
||||||
if (l != 3) {
|
if (l != 3) {
|
||||||
|
@ -386,7 +263,7 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
if (!retval) {
|
if (!retval) {
|
||||||
fprintf (stderr, "%s\n", error->message);
|
fprintf (stderr, "%s\n", error->message);
|
||||||
g_clear_error (&error);
|
g_error_free (error);
|
||||||
hint_error = TRUE;
|
hint_error = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,90 +274,12 @@ main (int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (actions != NULL) {
|
if (!hint_error)
|
||||||
gint i = 0;
|
notify_notification_show (notify, NULL);
|
||||||
char *action = NULL;
|
|
||||||
gchar **spl = NULL;
|
|
||||||
gboolean have_actions;
|
|
||||||
|
|
||||||
have_actions = server_has_capability ("actions");
|
|
||||||
if (!have_actions) {
|
|
||||||
g_printerr (N_("Actions are not supported by this "
|
|
||||||
"notifications server. "
|
|
||||||
"Displaying non-interactively.\n"));
|
|
||||||
show_error = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (have_actions && (action = actions[i++])) {
|
|
||||||
gchar *name;
|
|
||||||
const gchar *label;
|
|
||||||
|
|
||||||
spl = g_strsplit (action, "=", 2);
|
|
||||||
|
|
||||||
if (g_strv_length (spl) == 1) {
|
|
||||||
name = g_strdup_printf ("%d", i - 1);
|
|
||||||
label = g_strstrip (spl[0]);
|
|
||||||
} else {
|
|
||||||
name = g_strdup (g_strstrip (spl[0]));
|
|
||||||
label = g_strstrip (spl[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (*label != '\0' && *name != '\0') {
|
|
||||||
notify_notification_add_action (notify,
|
|
||||||
name,
|
|
||||||
label,
|
|
||||||
handle_action,
|
|
||||||
name,
|
|
||||||
g_free);
|
|
||||||
wait = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_strfreev (spl);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_strfreev (actions);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wait) {
|
|
||||||
g_signal_connect (G_OBJECT (notify),
|
|
||||||
"closed",
|
|
||||||
G_CALLBACK (handle_closed),
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
if (expire_timeout > 0) {
|
|
||||||
g_timeout_add (expire_timeout, on_wait_timeout, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!hint_error) {
|
|
||||||
retval = notify_notification_show (notify, &error);
|
|
||||||
|
|
||||||
if (!retval) {
|
|
||||||
fprintf (stderr, "%s\n", error->message);
|
|
||||||
g_clear_error (&error);
|
|
||||||
show_error = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (print_id) {
|
|
||||||
g_object_get (notify, "id", ¬ification_id, NULL);
|
|
||||||
g_printf ("%d\n", notification_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wait) {
|
|
||||||
g_unix_signal_add (SIGINT, on_sigint, notify);
|
|
||||||
loop = g_main_loop_new (NULL, FALSE);
|
|
||||||
g_main_loop_run (loop);
|
|
||||||
g_main_loop_unref (loop);
|
|
||||||
loop = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_object_unref (G_OBJECT (notify));
|
g_object_unref (G_OBJECT (notify));
|
||||||
|
|
||||||
notify_uninit ();
|
notify_uninit ();
|
||||||
|
|
||||||
if (hint_error || show_error)
|
exit (hint_error);
|
||||||
exit (1);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue