debian/0000755000000000000000000000000012141430601007156 5ustar debian/compat0000644000000000000000000000000212141430233010355 0ustar 9 debian/gir1.2-keybinder-0.0.install0000644000000000000000000000005712141430233014020 0ustar usr/lib/girepository-1.0/Keybinder-0.0.typelib debian/patches/0000755000000000000000000000000012141430233010606 5ustar debian/patches/python-multiarch-header-path.patch0000644000000000000000000000126512141430233017322 0ustar Description: Define python multiarch header include paths Use python-config to get the multiarch header include paths Author: Micah Gersten --- keybinder-0.3.0.orig/m4/python.m4 +++ keybinder-0.3.0/m4/python.m4 @@ -45,7 +45,7 @@ AC_MSG_CHECKING(for headers required to dnl deduce PYTHON_INCLUDES py_prefix=`$PYTHON -c "import sys; print sys.prefix"` py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` -PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" +PYTHON_INCLUDES=`$PYTHON-config --includes` if test "$py_prefix" != "$py_exec_prefix"; then PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" fi debian/patches/series0000644000000000000000000000005512141430233012023 0ustar Xkb.patch python-multiarch-header-path.patch debian/patches/Xkb.patch0000644000000000000000000001147212141430233012360 0ustar Description: Fix crash with Xkb extension Author: Roland Stigge Index: keybinder/libkeybinder/bind.c =================================================================== --- keybinder.orig/libkeybinder/bind.c 2012-08-24 12:59:26.000000000 +0200 +++ keybinder/libkeybinder/bind.c 2012-08-24 13:18:15.587581790 +0200 @@ -72,6 +72,8 @@ static GSList *bindings = NULL; static guint32 last_event_time = 0; static gboolean processing_event = FALSE; +static gboolean detected_xkb_extension = FALSE; +static gboolean use_xkb_extension = FALSE; /* Return the modifier mask that needs to be pressed to produce key in the * given group (keyboard layout) and level ("shift level"). @@ -193,13 +195,15 @@ GdkKeymap *map; GdkKeymapKey *keys; gint n_keys; - GdkModifierType add_modifiers; - XkbDescPtr xmap; + GdkModifierType add_modifiers = 0; + XkbDescPtr xmap = NULL; gboolean success = FALSE; - xmap = XkbGetMap(GDK_WINDOW_XDISPLAY(rootwin), - XkbAllClientInfoMask, - XkbUseCoreKbd); + if (use_xkb_extension) { + xmap = XkbGetMap(GDK_WINDOW_XDISPLAY(rootwin), + XkbAllClientInfoMask, + XkbUseCoreKbd); + } map = gdk_keymap_get_default(); gdk_keymap_get_entries_for_keyval(map, keyval, &keys, &n_keys); @@ -216,16 +220,24 @@ continue; } - add_modifiers = FinallyGetModifiersForKeycode(xmap, + + TRACE (g_print("grab/ungrab keycode: %d, lev: %d, grp: %d, ", + keys[k].keycode, keys[k].level, keys[k].group)); + if (use_xkb_extension) { + add_modifiers = FinallyGetModifiersForKeycode(xmap, keys[k].keycode, keys[k].group, keys[k].level); + } else if (keys[k].level > 0) { + /* skip shifted/modified keys in non-xkb mode + * this might mean the key can't be bound at all + */ + continue; + } if (add_modifiers == MODIFIERS_ERROR) { continue; } - TRACE (g_print("grab/ungrab keycode: %d, lev: %d, grp: %d, ", - keys[k].keycode, keys[k].level, keys[k].group)); TRACE (g_print("modifiers: 0x%x (consumed: 0x%x)\n", add_modifiers | modifiers, add_modifiers)); if (grab_ungrab_with_ignorable_modifiers(rootwin, @@ -243,7 +255,9 @@ } g_free(keys); - XkbFreeClientMap(xmap, 0, TRUE); + if (xmap) { + XkbFreeClientMap(xmap, 0, TRUE); + } return success; } @@ -360,7 +374,8 @@ xevent->xkey.keycode, xevent->xkey.state)); - gdk_keymap_translate_keyboard_state( + if (use_xkb_extension) { + gdk_keymap_translate_keyboard_state( keymap, xevent->xkey.keycode, modifiers, @@ -369,6 +384,10 @@ */ WE_ONLY_USE_ONE_GROUP, &keyval, NULL, NULL, &consumed); + } else { + consumed = 0; + keyval = XLookupKeysym(&xevent->xkey, 0); + } /* Map non-virtual to virtual modifiers */ modifiers &= ~consumed; @@ -447,6 +466,26 @@ { GdkKeymap *keymap = gdk_keymap_get_default (); GdkWindow *rootwin = gdk_get_default_root_window (); + Display *disp; + int xkb_opcode; + int xkb_event_base; + int xkb_error_base; + int majver = XkbMajorVersion; + int minver = XkbMinorVersion; + + if (!(disp = XOpenDisplay(NULL))) { + g_warning("keybinder_init: Unable to open display"); + return; + } + + detected_xkb_extension = XkbQueryExtension(disp, + &xkb_opcode, + &xkb_event_base, + &xkb_error_base, + &majver, &minver); + + use_xkb_extension = detected_xkb_extension; + TRACE(g_print("XKB: %d, version: %d, %d\n", use_xkb_extension, majver, minver)); gdk_window_add_filter (rootwin, filter_func, NULL); @@ -465,6 +504,20 @@ } /** + * keybinder_set_use_cooked_accelerators: (skip) + * @keystring: an accelerator description (gtk_accelerator_parse() format) + * @handler: callback function + * @user_data: data to pass to @handler + * + * Set cooked accelerators. + */ +void +keybinder_set_use_cooked_accelerators (gboolean use_cooked) +{ + use_xkb_extension = use_cooked && detected_xkb_extension; +} + +/** * keybinder_bind: (skip) * @keystring: an accelerator description (gtk_accelerator_parse() format) * @handler: callback function Index: keybinder/libkeybinder/keybinder.h =================================================================== --- keybinder.orig/libkeybinder/keybinder.h 2012-08-24 12:59:26.000000000 +0200 +++ keybinder/libkeybinder/keybinder.h 2012-08-24 13:15:35.143576876 +0200 @@ -32,6 +32,8 @@ void keybinder_init (void); +void keybinder_set_use_cooked_accelerators (gboolean use_cooked); + gboolean keybinder_bind (const char *keystring, KeybinderHandler handler, void *user_data); debian/rules0000755000000000000000000000151012141430233010234 0ustar #!/usr/bin/make -f PYTHONS := $(shell pyversions -vr debian/control) %: dh $@ --with python2,autoreconf,gir clean: rm -fr build keybinder/*.pyc dh $@ --with python2,autoreconf override_dh_auto_configure: for pyvers in ${PYTHONS}; do \ mkdir -p build/py$$pyvers; cp -Rl `ls . | grep -v build | grep -v debian` build/py$$pyvers;\ (cd build/py$$pyvers; CC="cc -Wl,--as-needed" ./configure --prefix=/usr --enable-gtk-doc PYTHON=python$$pyvers); \ done override_dh_auto_build: for pyvers in ${PYTHONS}; do \ (cd build/py$$pyvers/; $(MAKE) PYTHON=python$$pyvers); \ done override_dh_auto_install: for pyvers in ${PYTHONS}; do \ (cd build/py$$pyvers/; $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp); \ done find $(CURDIR)/debian/tmp -name "*.la" -delete override_dh_makeshlibs: dh_makeshlibs -V 'libkeybinder0 (>= 0.3.0)' debian/docs0000644000000000000000000000001712141430233010030 0ustar AUTHORS README debian/python-keybinder.install0000644000000000000000000000002012141430233014032 0ustar usr/lib/python* debian/libkeybinder-dev.install0000644000000000000000000000014712141430233013770 0ustar usr/include usr/lib/libkeybinder.so usr/lib/pkgconfig/keybinder.pc usr/share/gir-1.0/Keybinder-0.0.gir debian/control0000644000000000000000000001042212141430233010561 0ustar Source: keybinder Section: libs Priority: optional Maintainer: Luca Falavigna Build-Depends: debhelper (>= 9), python-all-dev (>= 2.6.6-3~), pkg-config (>= 0.9.0), libgtk2.0-dev (>= 2.20), python-gtk2-dev (>= 2.12), gobject-introspection (>= 0.6.7), libgirepository1.0-dev (>= 0.6.7), gtk-doc-tools (>= 1.14), dh-autoreconf Standards-Version: 3.9.4 X-Python-Version: >= 2.5 Homepage: http://kaizer.se/wiki/keybinder/ Vcs-Git: git://anonscm.debian.org/collab-maint/keybinder.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/keybinder.git;a=summary Package: libkeybinder0 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: registers global key bindings for applications keybinder is a library for registering global keyboard shortcuts to be used by GTK-based applications under the X Window System. . When a combination of key is pressed, keybinder notifies it to the registering application, which can execute one or more operations based on the event previously registered. . Originally written as part of the Tomboy project, keybinder has been distributed as stand-alone library let other applications to use key binding. Package: gir1.2-keybinder-0.0 Section: introspection Architecture: any Depends: ${gir:Depends}, ${shlibs:Depends}, ${misc:Depends} Description: registers global key bindings for applications - introspection data keybinder is a library for registering global keyboard shortcuts to be used by GTK-based applications under the X Window System. . When a combination of key is pressed, keybinder notifies it to the registering application, which can execute one or more operations based on the event previously registered. . Originally written as part of the Tomboy project, keybinder has been distributed as stand-alone library let other applications to use key binding. . This package contains introspection data. Package: libkeybinder-dev Section: libdevel Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libkeybinder0 (= ${binary:Version}), gir1.2-keybinder-0.0 (= ${binary:Version}), libgtk2.0-dev Description: registers global key bindings for applications - development headers keybinder is a library for registering global keyboard shortcuts to be used by GTK-based applications under the X Window System. . When a combination of key is pressed, keybinder notifies it to the registering application, which can execute one or more operations based on the event previously registered. . Originally written as part of the Tomboy project, keybinder has been distributed as stand-alone library let other applications to use key binding. . This package contains libkeybinder development headers. Package: python-keybinder Section: python Architecture: any Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, python-gtk2 Provides: ${python:Provides} Description: registers global key bindings for applications - Python bindings keybinder is a library for registering global keyboard shortcuts to be used by GTK-based applications under the X Window System. . When a combination of key is pressed, keybinder notifies it to the registering application, which can execute one or more operations based on the event previously registered. . Originally written as part of the Tomboy project, keybinder has been distributed as stand-alone library let other applications to use key binding. . This package contains Python bindings. Package: keybinder-doc Section: doc Architecture: all Depends: ${misc:Depends} Description: registers global key bindings for applications - documentation keybinder is a library for registering global keyboard shortcuts to be used by GTK-based applications under the X Window System. . When a combination of key is pressed, keybinder notifies it to the registering application, which can execute one or more operations based on the event previously registered. . Originally written as part of the Tomboy project, keybinder has been distributed as stand-alone library let other applications to use key binding. . This package contains documentation and API reference. debian/libkeybinder0.symbols.amd640000644000000000000000000000043412141430233014227 0ustar libkeybinder.so.0 libkeybinder0 #MINVER# keybinder_bind@Base 0.2.1 keybinder_bind_full@Base 0.3.0 keybinder_get_current_event_time@Base 0.2.1 keybinder_init@Base 0.2.1 keybinder_set_use_cooked_accelerators@Base 0.2.2 keybinder_unbind@Base 0.2.1 keybinder_unbind_all@Base 0.3.0 debian/changelog0000644000000000000000000001072312141430233011034 0ustar keybinder (0.3.0-2) unstable; urgency=low * Upload to unstable. * debian/patches/python-multiarch-header-path.patch: - Define python multiarch header include paths (Closes: #697825). * debian/control: - Add libgtk2.0-dev to libkeybinder-dev Depends field, thanks to Alessandro Ghedini for the bug report (Closes: #687457). - Bump Standards-Version to 3.9.4. - Move VCS repository under collab-maint. -- Luca Falavigna Sun, 05 May 2013 12:12:17 +0200 keybinder (0.3.0-1) experimental; urgency=low * New upstream release. * Add introspection support. * debian/patches/ACLOCAL_AMFLAGS.patch: - Removed, applied upstream. * debian/patches/Xkb.patch: - Refresh for new upstream release. * debian/control: - Build-depend on gtk-doc-tools (>= 1.14). - Provide keybinder-doc documentation package. * debian/libkeybinder0.symbols.amd64: - Refresh to pick new symbols. * debian/rules: - Allow to build source twice in a row. - Build with --enable-gtk-doc option. - Bump dh_makeshlibs version to >= 0.3.0 for the new symbols. -- Luca Falavigna Fri, 24 Aug 2012 15:43:15 +0200 keybinder (0.2.2-4) unstable; urgency=low * debian/patches/Xkb.patch: - Fix crash with Xkb extension (Closes: #593371). * debian/compat: - Bump compatibility level to 9. * debian/control: - Bump Standards-Version to 3.9.3. * debian/copyright: - Format now points to copyright-format site. * debian/libkeybinder0.symbols.amd64: - Refresh to pick new symbols. * debian/rules: - Bump dh_makeshlibs version to >= 0.2.2 for the new symbols. -- Luca Falavigna Sun, 27 May 2012 02:27:18 +0200 keybinder (0.2.2-3) unstable; urgency=low * Switch to dh_python2. * Use autoreconf sequencer. * debian/patches/ACLOCAL_AMFLAGS.patch: - Define ACLOCAL_AMFLAGS, set to -I m4. * debian/control: - Bump Standards-Version to 3.9.2, no changes required. * debian/copyright: - Update copyright information. * debian/rules: - Do not install .la files. -- Luca Falavigna Thu, 21 Apr 2011 23:56:20 +0200 keybinder (0.2.2-2) unstable; urgency=low * debian/control: - Adjust Homepage field to new URL. - Bump Standards.Version to 3.9.0, no changes required. * debian/libkeybinder-dev.install: - Install keybinder.pc file (Closes: #585077). -- Luca Falavigna Sat, 17 Jul 2010 14:39:57 +0200 keybinder (0.2.2-1) unstable; urgency=low * New upstream release. * debian/control: - Fix Vcs fields to point to new repository. * debian/rules: - Compile with --as-needed flag enabled. -- Luca Falavigna Thu, 03 Jun 2010 21:50:23 +0200 keybinder (0.2.1-1) unstable; urgency=low * New upstream release. * Package is no longer maintainer under DPMT. * New binary packages: - libkeybinder0, shared library - libkeybinder-dev, development headers * Update copyright information -- Luca Falavigna Sun, 02 May 2010 12:49:36 +0200 keybinder (0.1.1-1) unstable; urgency=low * New upstream release. - Fix incorrect Super modifier binding (Closes: #578651). -- Luca Falavigna Wed, 21 Apr 2010 20:53:19 +0200 keybinder (0.1.0-1) unstable; urgency=low * New upstream release. * Switch to format 3.0 (quilt). * debian/control: - Build-depend on libgtk2.0-dev (>= 2.20). * debian/copyright: - Refresh copyright information. -- Luca Falavigna Sun, 11 Apr 2010 14:05:36 +0200 keybinder (0.0.4-2) unstable; urgency=low * debian/control: - Add autoconf, automake and libtool to Build-Depends. - Add autoconf2.13 and automake1.4 to Build-Conflicts. - Bump Standards-Version to 3.8.4, no changes required. * debian/rules: - Run "autoreconf -fi -I m4" for every Python build instance to get proper libtool fixes (Closes: #558567). -- Luca Falavigna Thu, 11 Feb 2010 22:15:50 +0100 keybinder (0.0.4-1) unstable; urgency=low * New upstream release. * Remove gnome-doc-utils and python-gnomeapplet from Build-Depends. * Update my e-mail address. * Bump Standards-Version to 3.8.3, no changes required. -- Luca Falavigna Fri, 27 Nov 2009 10:48:11 +0100 keybinder (0.0.3-1) unstable; urgency=low * Initial release (Closes: #535619). -- Luca Falavigna Wed, 08 Jul 2009 11:55:13 +0200 debian/install0000644000000000000000000000003212141430233010543 0ustar usr/lib/libkeybinder.so.* debian/copyright0000644000000000000000000000520512141430233011114 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: keybinder Upstream-Contact: Ulrik Sverdrup Source: http://kaizer.se/publicfiles/keybinder/ Files: * Copyright: 2007-2010, Ulrik Sverdrup License: GPL-2+ Files: examples/* Copyright: 2010 Ulrik Sverdrup License: public-domain Files: libkeybinder/* Copyright: 2008 Alex Graveley 2010 Ulrik Sverdrup License: MIT Files: lua-keybinder/* Copyright: 2010 Ulrik Sverdrup License: MIT Files: debian/* Copyright: 2009-2011, Luca Falavigna License: GPL-2+ License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This program 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 General Public License for more details. . You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . On Debian GNU/Linux systems, the complete text of the GNU General Public License version 2 can be found in /usr/share/common-licenses/GPL-2 License: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. License: public-domain This work is placed in the public domain. debian/keybinder-doc.install0000644000000000000000000000004112141430233013261 0ustar usr/share/gtk-doc/html/keybinder debian/source/0000755000000000000000000000000012141430233010457 5ustar debian/source/format0000644000000000000000000000001412141430233011665 0ustar 3.0 (quilt) debian/watch0000644000000000000000000000011612141430233010206 0ustar version=3 http://kaizer.se/publicfiles/keybinder/keybinder-([0-9.]+)\.tar\.gz