diff options
author | Michael Catanzaro <mcatanzaro@gnome.org> | 2019-08-05 21:33:31 -0500 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@gnome.org> | 2019-08-05 21:33:52 -0500 |
commit | d893a7b753b0f5151831e5af0536e9af6ffee65d (patch) | |
tree | 029d56a815ad1c1341bb2129e1b76d07846b2535 | |
parent | e585119934c7afbcce5aaabab097305ce1f59576 (diff) | |
download | cheese-d893a7b753b0f5151831e5af0536e9af6ffee65d.tar.gz |
I hate libcanberra!
It's the only library where the pkg-config name doesn't match the vapi,
and meson does NOT like this.
This commit allows us to build without requiring and linking to
libcanberra-gtk (the GTK 2 version).
The proper solution is to stop using libcanberra and use gsound instead.
-rw-r--r-- | meson.build | 4 | ||||
-rw-r--r-- | src/meson.build | 3 | ||||
-rw-r--r-- | src/vapi/libcanberra-gtk3.vapi | 38 |
3 files changed, 42 insertions, 3 deletions
diff --git a/meson.build b/meson.build index 104beadd..de8a755c 100644 --- a/meson.build +++ b/meson.build @@ -111,8 +111,8 @@ gstreamer_pbutils_dep = dependency('gstreamer-pbutils-1.0') gstreamer_plugins_bad_dep = dependency('gstreamer-plugins-bad-1.0', version: '>= 1.4') gtk_dep = dependency('gtk+-3.0', version: '>= 3.13.4') libcanberra_dep = dependency('libcanberra') -libcanberra_gtk_dep = dependency('libcanberra-gtk') -libcanberra_gtk3_dep = dependency('libcanberra-gtk3', version: '>= 0.26') +libcanberra_gtk_lib = meson.get_compiler('c').find_library('libcanberra-gtk3') +libcanberra_gtk3_dep = declare_dependency(dependencies: [libcanberra_gtk_lib]) m_dep = cc.find_library('m') diff --git a/src/meson.build b/src/meson.build index b1800127..74f62b16 100644 --- a/src/meson.build +++ b/src/meson.build @@ -8,6 +8,7 @@ sources = files( 'thumbview/cheese-thumbnail.c', 'thumbview/cheese-thumb-view.c', 'thumbview/eog-thumb-nav.c', + 'vapi/libcanberra-gtk3.vapi' ) deps = [ @@ -17,7 +18,7 @@ deps = [ gnome_desktop_dep, eogthumbnav_dep, libcanberra_dep, - libcanberra_gtk_dep, + libcanberra_gtk3_dep, libcheese_gtk_dep, posix_dep, ] diff --git a/src/vapi/libcanberra-gtk3.vapi b/src/vapi/libcanberra-gtk3.vapi new file mode 100644 index 00000000..94add4ea --- /dev/null +++ b/src/vapi/libcanberra-gtk3.vapi @@ -0,0 +1,38 @@ +/*** + This file is part of libcanberra. + + Copyright 2009 Lennart Poettering + + libcanberra is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 2.1 of the + License, or (at your option) any later version. + + libcanberra is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with libcanberra. If not, see + <http://www.gnu.org/licenses/>. +***/ + +using Canberra; +using Gdk; +using Gtk; + +[CCode (cprefix = "CA_GTK_", lower_case_cprefix = "ca_gtk_", cheader_filename = "canberra-gtk.h")] +namespace CanberraGtk { + + public unowned Context? context_get(); + public unowned Context? context_get_for_screen(Gdk.Screen? screen); + + public int proplist_set_for_widget(Proplist p, Gtk.Widget w); + public int play_for_widget(Gtk.Widget w, uint32 id, ...); + public int proplist_set_for_event(Proplist p, Gdk.Event e); + public int play_for_event(Gdk.Event e, uint32 id, ...); + + public void widget_disable_sounds(Gtk.Widget w, bool enable = false); +} + |