From 250f5532942e3510c8b7ac55d4b12534d70c8ddb Mon Sep 17 00:00:00 2001 From: gizmo98 Date: Sun, 18 Sep 2016 18:45:05 +0200 Subject: [PATCH 1/5] =?UTF-8?q?Revert=20"Linux=20joystick:=20Look=20at=20e?= =?UTF-8?q?ntire=20axis=20namespace=20for=20controls=20(t=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …hanks, "spaz16"!)." This reverts commit 4cb7923. see RetroPie/RetroPie-Setup#1297 --- src/joystick/linux/SDL_sysjoystick.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/joystick/linux/SDL_sysjoystick.c b/src/joystick/linux/SDL_sysjoystick.c index 8c73859ea..44e541357 100644 --- a/src/joystick/linux/SDL_sysjoystick.c +++ b/src/joystick/linux/SDL_sysjoystick.c @@ -492,7 +492,7 @@ ConfigJoystick(SDL_Joystick * joystick, int fd) ++joystick->nbuttons; } } - for (i = 0; i < ABS_MAX; ++i) { + for (i = 0; i < ABS_MISC; ++i) { /* Skip hats */ if (i == ABS_HAT0X) { i = ABS_HAT3Y; @@ -753,6 +753,10 @@ HandleInputEvents(SDL_Joystick * joystick) } break; case EV_ABS: + if (code >= ABS_MISC) { + break; + } + switch (code) { case ABS_HAT0X: case ABS_HAT0Y: From d3a51e210c13dc1a55a4fa53dcfc8c3849f13e69 Mon Sep 17 00:00:00 2001 From: gizmo98 Date: Sun, 18 Sep 2016 19:07:03 +0200 Subject: [PATCH 2/5] Modify debian controls for retropie modul --- debian/control | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/debian/control b/debian/control index e61995df4..1ceb936bd 100644 --- a/debian/control +++ b/debian/control @@ -30,7 +30,7 @@ Build-Depends: debhelper (>= 9), libxxf86vm-dev Homepage: http://www.libsdl.org/ -Package: libsdl2 +Package: libsdl2-2.0-0 Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} @@ -38,8 +38,8 @@ Depends: ${misc:Depends}, ${shlibs:Depends}, libudev0 [linux-any], libdbus-1-3 [linux-any] -Conflicts: libsdl-1.3-0 -Replaces: libsdl-1.3-0 +Conflicts: libsdl-1.3-0, libsdl2 +Replaces: libsdl-1.3-0, libsdl2 Description: Simple DirectMedia Layer SDL is a library that allows programs portable low level access to a video framebuffer, audio output, mouse, and keyboard. @@ -51,7 +51,7 @@ Section: libdevel Architecture: any Multi-Arch: same Depends: ${misc:Depends}, - libsdl2 (= ${binary:Version}), + libsdl2-2.0-0 (= ${binary:Version}), libc6-dev, libgl1-mesa-dev Conflicts: libsdl-1.3-dev @@ -68,7 +68,7 @@ Section: debug Architecture: any Multi-Arch: same Depends: ${misc:Depends}, - libsdl2 (= ${binary:Version}), + libsdl2-2.0-0 (= ${binary:Version}), Description: Simple DirectMedia Layer debug files SDL is a library that allows programs portable low level access to a video framebuffer, audio output, mouse, and keyboard. From 1e197bd1773043a571ed46645b83d73341595c46 Mon Sep 17 00:00:00 2001 From: gizmo98 Date: Sun, 18 Sep 2016 19:45:07 +0200 Subject: [PATCH 3/5] Rename libsdl2.install --- debian/{libsdl2.install => libsdl2-2.0-0.install} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename debian/{libsdl2.install => libsdl2-2.0-0.install} (100%) diff --git a/debian/libsdl2.install b/debian/libsdl2-2.0-0.install similarity index 100% rename from debian/libsdl2.install rename to debian/libsdl2-2.0-0.install From 6d9f3cb0da4e6a1b5b82e4f1006e6ce6891eabf4 Mon Sep 17 00:00:00 2001 From: gizmo98 Date: Mon, 19 Sep 2016 18:52:23 +0200 Subject: [PATCH 4/5] Add ubuntu xenial debian files --- debian/changelog | 206 ++- debian/control | 153 +- debian/copyright | 223 +-- debian/docs | 2 +- debian/gbp.conf | 7 + debian/libsdl2-2.0-0-udeb.install | 1 + debian/libsdl2-dev.install | 4 +- debian/libsdl2-doc.doc-base | 14 + debian/libsdl2-doc.examples | 1 + debian/libsdl2-doc.install | 1 + .../patches/SDL2_dont_propagate_lpthread.diff | 43 + debian/patches/mir_new_abi_api.diff | 1226 +++++++++++++++++ debian/patches/series | 2 + debian/rules | 94 +- debian/sdl2-config.1 | 64 +- debian/source/format | 2 +- debian/upstream/signing-key.asc | 60 + debian/watch | 3 +- 18 files changed, 1889 insertions(+), 217 deletions(-) create mode 100644 debian/gbp.conf create mode 100644 debian/libsdl2-2.0-0-udeb.install create mode 100644 debian/libsdl2-doc.doc-base create mode 100644 debian/libsdl2-doc.examples create mode 100644 debian/libsdl2-doc.install create mode 100644 debian/patches/SDL2_dont_propagate_lpthread.diff create mode 100644 debian/patches/mir_new_abi_api.diff create mode 100644 debian/patches/series create mode 100644 debian/upstream/signing-key.asc diff --git a/debian/changelog b/debian/changelog index 6a88d2473..b5a5a36d3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,40 +1,206 @@ -libsdl2 (2.0.4) UNRELEASED; urgency=low +libsdl2 (2.0.4+dfsg1-2ubuntu2) xenial; urgency=medium - * Updated SDL to version 2.0.4 + * Rebuild against libsndio6.1. - -- Sam Lantinga Thu, 07 Jan 2016 11:02:39 -0800 + -- Gianfranco Costamagna Thu, 10 Mar 2016 22:59:45 +0100 -libsdl2 (2.0.3) UNRELEASED; urgency=low +libsdl2 (2.0.4+dfsg1-2ubuntu1) xenial; urgency=medium - * Updated SDL to version 2.0.3 + * debian/patches/mir_new_abi_api.diff: New Mir ABI/API update + to work with MIR 0.14 and greater (lp: #1513241) + * Add libmirclient-dev as build-dependency. - -- Sam Lantinga Sun, 9 Mar 2014 10:35:54 -0800 + -- Brandon Schaefer Wed, 20 Jan 2016 12:03:45 -0600 -libsdl2 (2.0.2) UNRELEASED; urgency=low +libsdl2 (2.0.4+dfsg1-2) unstable; urgency=low - * Updated SDL to version 2.0.2 + * Upload to unstable - -- Sam Lantinga Sun, 9 Feb 2014 2:55:59 -0800 + -- Gianfranco Costamagna Mon, 18 Jan 2016 16:36:59 +0100 -libsdl2 (2.0.1) UNRELEASED; urgency=low +libsdl2 (2.0.4+dfsg1-1) experimental; urgency=medium - * Updated SDL to version 2.0.1 + * Team upload. + * run wrap-and-sort -sa. + * Fix copyright lintian warning. + * Update copyright to new release. + * New upstream release (Closes: #788688, #798265, #788540) + - Drop patches use-default-screen and + fix_joystick_misc_axes.diff, applied upstream. + * Add Files-Excluded keyword to copyright file, allowing to + import a new release with uscan command. (Closes: #804662) + * Create new -doc package, and move examples into it (Closes: #739430). - -- Sam Lantinga Wed, 23 Oct 2013 16:31:38 -0800 + -- Gianfranco Costamagna Sun, 03 Jan 2016 12:12:54 +0100 -libsdl2 (2.0.0) UNRELEASED; urgency=low +libsdl2 (2.0.2+dfsg1-8) unstable; urgency=medium - * SDL is now a native debian package. - * Removed udeb package - * Disabled DirectFB support by default, to avoid runtime dependencies + * Change to improve build reproducibility: tar file permission modes. + Thanks Reiner Herrmann. (Closes: #803578) + * Build with sndio support (Closes: #799707) + * Update d/copyright to adapt to minor changes in code and files moved + around, and quell lintian (spelling-error-in-copyright, + wildcard-matches-nothing-in-dep5-copyright and + unused-file-paragraph-in-dep5-copyright) - -- Sam Lantinga Fri, 15 Feb 2013 08:55:04 -0800 + -- Manuel A. Fernandez Montecelo Sun, 01 Nov 2015 00:55:03 +0000 -libsdl2 (2.0.0~20130127-1) UNRELEASED; urgency=low +libsdl2 (2.0.2+dfsg1-7) unstable; urgency=medium - * New upstream snapshot. + * Bump Policy Standards-Version to 3.9.6 (no changes needed) + * Remove Barry deFreese from uploaders + * Change for reproducible builds: use "--owner=0 --group=0" when + creating the "examples" tar file (Closes: #777186). Thanks Chris Lamb + and rest of the Reproducible Builds team for the analysis and patch + suggested. - -- Sam Hocevar Wed, 30 Jan 2013 23:01:12 +0100 + -- Manuel A. Fernandez Montecelo Mon, 27 Apr 2015 22:53:31 +0100 + +libsdl2 (2.0.2+dfsg1-6) unstable; urgency=medium + + * rules: disable activec for ppc64el build (Closes: #770670) + + -- Dominique Dumont Thu, 27 Nov 2014 18:52:50 +0100 + +libsdl2 (2.0.2+dfsg1-5) unstable; urgency=medium + + * patch to use default screen from DISPLAY (Closes: #754401) + * fix short name of BSD-3-clause + + -- Dominique Dumont Sat, 18 Oct 2014 19:01:30 +0200 + +libsdl2 (2.0.2+dfsg1-4) unstable; urgency=medium + + [ Hector Oron ] + * d/control: remove libts-dev build depends. (Closes: #751766) + + [ Felix Geyer ] + * Move upstream GPG key as an ascii-armored keyring to debian/upstream/. + + -- Felix Geyer Mon, 16 Jun 2014 21:02:07 +0200 + +libsdl2 (2.0.2+dfsg1-3) unstable; urgency=medium + + * Actually change Build-Depends libegl1-mesa-dev to be conditionally + [!hurd-any]. It was applied to libgl1-mesa-dev by mistake in -2. + + -- Manuel A. Fernandez Montecelo Wed, 19 Mar 2014 20:22:29 +0000 + +libsdl2 (2.0.2+dfsg1-2) unstable; urgency=medium + + * Conditional dependencies libegl1-mesa-dev [!hurd-any], + libgles2-mesa-dev [!hurd-any] and libwayland-dev [linux-any], they do + not seem to support these kernels at the moment + + -- Manuel A. Fernandez Montecelo Tue, 18 Mar 2014 20:17:10 +0000 + +libsdl2 (2.0.2+dfsg1-1) unstable; urgency=low + + * New upstream release + - Remove patch applied upstream: fix_ftbfs_kfreebsd.diff + - Add support for Wayland, including build-depends for libegl1-mesa-dev, + libxkbcommon-dev and libwayland-dev. Thanks Franz Schrober for the + request and the help to enable it. (Closes: #714482) + - Add support for OpenGLES, including build-depends for libgles2-mesa-dev + + -- Manuel A. Fernandez Montecelo Sat, 15 Mar 2014 00:22:48 +0000 + +libsdl2 (2.0.1+dfsg1-3) unstable; urgency=medium + + * Use "dh_autoreconf" to support new architectures + + -- Manuel A. Fernandez Montecelo Sun, 09 Mar 2014 01:58:11 +0000 + +libsdl2 (2.0.1+dfsg1-2) unstable; urgency=medium + + * Fix FTBFS on kFreeBSD. + - Add fix_ftbfs_kfreebsd.diff to extend a __FreeBSD__ check to + __FreeBSD_kernel__. + + -- Felix Geyer Sun, 05 Jan 2014 13:42:59 +0100 + +libsdl2 (2.0.1+dfsg1-1) unstable; urgency=medium + + * New upstream release (Closes: #728974) + - Remove patch applied upstream: + bug-723797-false_positives_in_mouse_wheel_code.patch + * Bump Standards-Version to 3.9.5, no changes needed. + + [ Felix Geyer ] + * Import upstream gpg key for uscan to verify the orig tarball. + + -- Manuel A. Fernandez Montecelo Sat, 28 Dec 2013 12:31:19 +0000 + +libsdl2 (2.0.0+dfsg1-3) unstable; urgency=low + + * Build-Depends on pkg-config + * Apply patch accepted upstream to work around a false-positive in the + X11 mouse wheel code (Closes: #723797). Thanks Darren Salt for the + report and the fix. + * Review and removal of old patches not applied in SDL2, virtually of + them applied upstream, or rejected as invalid for good reason, or + don't apply any more (code/functionality removed upstream). I + forwarded and documented the remaining patches. + - 001_autogen_autotools_fix.diff + - 020_libcaca_new_api.diff + - 030_pulseaudio_enable.diff + - 040_propagate_pic_to_nasm.diff + - 050_altivec_detection.diff + - 060_disable_ipod.diff + - 205_lock_keys.diff + - 205_x11_keysym_fix.diff + - 206_gcc4_compilation_fix.diff + - 209_alsa_priority.diff + - 214_missing_mmx_blit.diff + - 215_kfreebsd_gnu.diff + - 216_page_size.diff + - 217_x11_keytounicode.diff + - 218_double_free.diff + - 218_joystick_memmove.diff + - 219_pulseaudio_crackles.diff + - 220_std_cld.diff + - 221_check_SDL_NOKBD_environment_variable.diff + - 222_joystick_crash.diff + - 310_fixmouseclicks + - 310_segfault_noGLX.diff + - 320_activate_xrandr_on_default.diff + - 320_disappearingcursor.diff + + -- Manuel A. Fernandez Montecelo Sun, 20 Oct 2013 00:58:48 +0100 + +libsdl2 (2.0.0+dfsg1-2) unstable; urgency=low + + * Remove external_header_paths.diff, it's not needed anymore and pulls + harmful flags into the pkg-config file. Thanks to Thibaut Girka for + the report and analysis. (Closes: #720650) + + -- Felix Geyer Fri, 30 Aug 2013 20:20:47 +0200 + +libsdl2 (2.0.0+dfsg1-1) unstable; urgency=low + + * New upstream release + * Filter upstream tarball from binaries and unneeded cruft + - Remove from debian/copyright files that are now filtered out when creating + the orig.tar + * Add build-dependency on libdbus-1-dev, to use D-Bus + * Switch to @debian.org address + * Bring the man page of sdl-config up to date + + -- Manuel A. Fernandez Montecelo Mon, 12 Aug 2013 20:45:31 +0100 + +libsdl2 (2.0.0~rc1-1) unstable; urgency=low + + * New upstream release candidate. + * Filter debian/* when importing new upstream releases. + * Bump SHLIBVER to 2.0.0~rc1. + * Update debian/docs. + * Bump Standards-Version to 3.9.4, no changes needed. + * Disable directfb backend for now as it's broken and upstream + disables it by default. + - Drop the udeb package. + * Drop some unused dependencies and confflags. + + -- Felix Geyer Sun, 02 Jun 2013 18:31:42 +0200 libsdl2 (2.0.0~20130103-1) unstable; urgency=low diff --git a/debian/control b/debian/control index 1ceb936bd..1ab35ee02 100644 --- a/debian/control +++ b/debian/control @@ -2,73 +2,128 @@ Source: libsdl2 Priority: optional Section: libs Maintainer: Debian SDL packages maintainers -Uploaders: Barry deFreese , - Sam Hocevar , - Manuel A. Fernandez Montecelo , - Felix Geyer , - Sam Lantinga -Standards-Version: 3.9.3 -Build-Depends: debhelper (>= 9), - dh-autoreconf, - dpkg-dev (>= 1.16.1~), - libasound2-dev [linux-any], - libgl1-mesa-dev, - libpulse-dev, - libudev-dev [linux-any], - libdbus-1-dev [linux-any], - libibus-1.0-dev[linux-any], - libusb2-dev [kfreebsd-any], - libusbhid-dev [kfreebsd-any], - libx11-dev, - libxcursor-dev, - libxext-dev, - libxi-dev, - libxinerama-dev, - libxrandr-dev, - libxss-dev, - libxt-dev, - libxxf86vm-dev +Uploaders: + Sam Hocevar , + Manuel A. Fernandez Montecelo , + Felix Geyer +Standards-Version: 3.9.6 +Build-Depends: + debhelper (>= 9), + dh-autoreconf, + libasound2-dev [linux-any], + libdbus-1-dev, + libegl1-mesa-dev [!hurd-any], + libgl1-mesa-dev, + libgles2-mesa-dev [!hurd-any], + libglu1-mesa-dev, + libmirclient-dev, + libpulse-dev, + libsndio-dev, + libudev-dev [linux-any], + libusb2-dev [kfreebsd-any], + libusbhid-dev [kfreebsd-any], + libwayland-dev [linux-any], + libx11-dev, + libxcursor-dev, + libxext-dev, + libxi-dev, + libxinerama-dev, + libxkbcommon-dev, + libxrandr-dev, + libxss-dev, + libxt-dev, + libxv-dev, + libxxf86vm-dev, + pkg-config +Build-Depends-Indep: + doxygen +Vcs-Git: git://anonscm.debian.org/pkg-sdl/packages/libsdl2.git +Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-sdl/packages/libsdl2.git Homepage: http://www.libsdl.org/ Package: libsdl2-2.0-0 Architecture: any +Pre-Depends: + ${misc:Pre-Depends} +Depends: + ${misc:Depends}, + ${shlibs:Depends} Multi-Arch: same -Pre-Depends: ${misc:Pre-Depends} -Depends: ${misc:Depends}, - ${shlibs:Depends}, - libudev0 [linux-any], - libdbus-1-3 [linux-any] -Conflicts: libsdl-1.3-0, libsdl2 -Replaces: libsdl-1.3-0, libsdl2 +Conflicts: + libsdl-1.3-0 +Replaces: + libsdl-1.3-0 Description: Simple DirectMedia Layer - SDL is a library that allows programs portable low level access to - a video framebuffer, audio output, mouse, and keyboard. + SDL is a library that allows programs portable low level access to a video + framebuffer, audio output, mouse, and keyboard. . - This package contains the shared library, compiled with X11 graphics drivers and OSS, ALSA and PulseAudio sound drivers. + This version of SDL is compiled with X11 and Wayland graphics drivers and OSS, + ALSA, NAS, sndio and PulseAudio sound drivers. Package: libsdl2-dev -Section: libdevel Architecture: any -Multi-Arch: same -Depends: ${misc:Depends}, - libsdl2-2.0-0 (= ${binary:Version}), - libc6-dev, - libgl1-mesa-dev -Conflicts: libsdl-1.3-dev -Replaces: libsdl-1.3-dev +Section: libdevel +Depends: + libasound2-dev [linux-any], + libdbus-1-dev, + libegl1-mesa-dev [!hurd-any], + libgl1-mesa-dev, + libgles2-mesa-dev [!hurd-any], + libglu1-mesa-dev, + libmirclient-dev, + libpulse-dev, + libsdl2-2.0-0 (= ${binary:Version}), + libsndio-dev, + libudev-dev [linux-any], + libusb2-dev [kfreebsd-any], + libusbhid-dev [kfreebsd-any], + libwayland-dev [linux-any], + libx11-dev, + libxcursor-dev, + libxext-dev, + libxi-dev, + libxinerama-dev, + libxkbcommon-dev, + libxrandr-dev, + libxss-dev, + libxt-dev, + libxv-dev, + libxxf86vm-dev, + ${misc:Depends} +Conflicts: + libsdl-1.3-dev +Replaces: + libsdl-1.3-dev Description: Simple DirectMedia Layer development files SDL is a library that allows programs portable low level access to a video framebuffer, audio output, mouse, and keyboard. . - This package contains files needed if you wish to use the SDL library in your own programs. + This package contains the files needed to compile and link programs which + use SDL. + +Package: libsdl2-doc +Section: doc +Architecture: all +Depends: + ${misc:Depends} +Breaks: + libsdl2-dev (<< 2.0.4+dfsg-1) +Replaces: + libsdl2-dev (<< 2.0.4+dfsg-1) +Description: Reference manual for libsdl2 + SDL is a library that allows programs portable low level access to a video + framebuffer, audio output, mouse, and keyboard. + . + This package contains the reference manual and examples. Package: libsdl2-dbg -Priority: extra -Section: debug Architecture: any Multi-Arch: same -Depends: ${misc:Depends}, - libsdl2-2.0-0 (= ${binary:Version}), +Priority: extra +Section: debug +Depends: + libsdl2-2.0-0 (= ${binary:Version}), + ${misc:Depends} Description: Simple DirectMedia Layer debug files SDL is a library that allows programs portable low level access to a video framebuffer, audio output, mouse, and keyboard. diff --git a/debian/copyright b/debian/copyright index 99c3d4496..849ade5df 100644 --- a/debian/copyright +++ b/debian/copyright @@ -2,20 +2,42 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: SDL Upstream-Contact: Sam Lantinga Source: http://www.libsdl.org/ +Files-Excluded: Android.mk + android-project + debian + VisualC + VisualC-WinRT + Xcode + Xcode-iOS Files: * Copyright: 1997-2016 Sam Lantinga License: zlib/libpng +Files: include/SDL_opengl_glext.h + include/SDL_opengles2_khrplatform.h +Copyright: 2008-2014 The Khronos Group Inc. +License: Expat-like + +Files: include/SDL_opengles2_gl2.h + include/SDL_opengles2_gl2ext.h + include/SDL_opengles2_gl2platform.h +Copyright: 1997-2016 Sam Lantinga +License: SGI-Free-Software-License-B + Files: src/libm/* Copyright: 1993 by Sun Microsystems, Inc. All rights reserved. License: SunPro Files: src/main/windows/SDL_windows_main.c -Copyright: 2016 Sam Lantinga +Copyright: 1998 Sam Lantinga License: PublicDomain_Sam_Lantinga Comment: SDL_main.c, placed in the public domain by Sam Lantinga 4/13/98 +Files: src/main/winrt/SDL_winrt_main_NonXAML.cpp +Copyright: 2014 David Ludwig +License: PublicDomain_David_Ludwig + Files: src/render/mmx.h Copyright: 1997-99 by H. Dietz and R. Fisher License: zlib/libpng @@ -31,61 +53,58 @@ Copyright: 1995 Erik Corry 1995 Brown University License: BrownUn_UnCalifornia_ErikCorry -Files: src/test/SDL_test_md5.c -Copyright: 1997-2016 Sam Lantinga - 1990 RSA Data Security, Inc. +Files: src/stdlib/SDL_qsort.c +Copyright: 1998 Gareth McCaughan +License: Gareth_McCaughan + +Files: src/test/SDL_test_md5.c include/SDL_test_md5.h +Copyright: 1997-2012 Sam Lantinga + 1990-1991 RSA Data Security, Inc. License: zlib/libpng and RSA_Data_Security -Files: src/thread/windows/win_ce_semaphore.c -Copyright: 1998, Johnson M. Hart (with corrections 2001 by Rainer Loritz) -License: Johnson_M._Hart +Files: src/video/haiku/SDL_bkeyboard.cc + src/video/haiku/SDL_bkeyboard.h +Copyright: 1997-2012 Sam Lantinga +License: LGPL-2.1+ Files: src/video/x11/imKStoUCS.c src/video/x11/imKStoUCS.h Copyright: 1994-2003 The XFree86 Project, Inc. License: MIT/X11 +Files: test/testautomation_rwops.c + include/SDL_test_fuzzer.h + include/SDL_test_harness.h +Copyright: 2011 Markus Kauppila +License: zlib/libpng + +Files: test/testautomation_* +Copyright: Edgar Simo "bobbens" +License: PublicDomain_Edgar_Simo + Files: test/testhaptic.c -Copyright: 1997-2016 Sam Lantinga +Copyright: 1997-2011 Sam Lantinga 2008 Edgar Simo Serra -License: BSD_3_clause +License: BSD-3-clause Files: test/testrumble.c -Copyright: 1997-2016 Sam Lantinga +Copyright: 1997-2011 Sam Lantinga 2011 Edgar Simo Serra -License: BSD_3_clause +License: BSD-3-clause + +Files: test/nacl/* +Copyright: 2013 The Chromium Authors +License: BSD-3-clause-chromium Files: test/shapes/* Copyright: none License: zlib/libpng Comment: No specific information about the images -Files: Xcode/TemplatesForXcode*/*/main.c -Copyright: none -License: zlib/libpng -Comment: SDL files, no copyright or license notice - -Files: Xcode/TemplatesForXcode*/*/atlantis/* -Copyright: 1993, 1994, Silicon Graphics, Inc. -License: SGI_atlantis - -Files: Xcode/TemplatesForXcode*/*/atlantis/atlantis.c -Copyright: 1994 Mark J. Kilgard - 1993, 1994, Silicon Graphics, Inc. -License: SGI_atlantis -Comment: See license for full copyright notice, this one is the same except for - the additional copyright holder - -Files: Xcode/SDLTest/sdlcommon_prefix.h -Copyright: 2003 Darrell Walisser -License: zlib/libpng -Comment: - Created by Darrell Walisser on Wed Aug 06 2003. - Copyright (c) 2003 __MyCompanyName__. All rights reserved. - Files: debian/* -Copyright: 2011-2012, Manuel A. Fernandez Montecelo - 2011-2012, Felix Geyer +Copyright: 2015, Gianfranco Costamagna + 2011-2013, Manuel A. Fernandez Montecelo + 2011-2013, Felix Geyer 2011, Roman Vasiyarov 2010, Jon Dowland 2009, Barry deFreese @@ -96,6 +115,54 @@ Copyright: 2011-2012, Manuel A. Fernandez Montecelo 2001, Branden Robinson License: LGPL-2.1+ +License: SGI-Free-Software-License-B + SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + . + 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 including the dates of first publication and + either this permission notice or a reference to + http://oss.sgi.com/projects/FreeB/ + 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 + SILICON GRAPHICS, INC. 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. + . + Except as contained in this notice, the name of Silicon Graphics, Inc. + shall not be used in advertising or otherwise to promote the sale, use or + other dealings in this Software without prior written authorization from + Silicon Graphics, Inc. + +License: Expat-like + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and/or associated documentation files (the + "Materials"), to deal in the Materials without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Materials, and to + permit persons to whom the Materials are 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 Materials. + . + THE MATERIALS ARE 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 + MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. License: zlib/libpng This software is provided 'as-is', without any express or implied @@ -120,7 +187,7 @@ License: LGPL-2.1+ the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. . - On Debian systems, the complete text of version 2.1 of the GNU Lesser + On Debian systems, the complete text of version 2.1 of the GNU Lesser General Public License can be found in '/usr/share/common-licenses/LGPL-2.1'. License: MIT/X11 @@ -146,7 +213,36 @@ License: MIT/X11 ings in this Software without prior written authorization from the XFree86 Project. -License: BSD_3_clause +License: BSD-3-clause-chromium + Copyright (c) 2011 Google Inc. All rights reserved. + . + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + . + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License: BSD-3-clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright @@ -169,7 +265,7 @@ License: BSD_3_clause (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Comment: - Copyright (C) 1997-2016 Sam Lantinga + Copyright (C) 1997-2011 Sam Lantinga . This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -266,10 +362,12 @@ License: BrownUn_UnCalifornia_ErikCorry * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ -License: Johnson_M._Hart - Permission is granted for any and all use providing that this - copyright is properly acknowledged. - There are no assurances of suitability for any use whatsoever. +License: Gareth_McCaughan + You may use it in anything you like; you may make money + out of it; you may distribute it in object form or as + part of an executable without including source code; + you don't have to credit me. (But it would be nice if + you did.) License: SunPro Developed at SunPro, a Sun Microsystems, Inc. business. @@ -280,6 +378,9 @@ License: SunPro License: PublicDomain_Sam_Lantinga Placed in the public domain by Sam Lantinga 4/13/98 +License: PublicDomain_David_Ludwig + placed in the public domain by David Ludwig 3/13/14 + License: PublicDomain_Edgar_Simo Written by Edgar Simo "bobbens" . @@ -313,39 +414,3 @@ License: RSA_Data_Security ** These notices must be retained in any copies of any part of this ** ** documentation and/or software. ** *********************************************************************** - -License: SGI_atlantis - (c) Copyright 1993, 1994, Silicon Graphics, Inc. - ALL RIGHTS RESERVED - Permission to use, copy, modify, and distribute this software for - any purpose and without fee is hereby granted, provided that the above - copyright notice appear in all copies and that both the copyright notice - and this permission notice appear in supporting documentation, and that - the name of Silicon Graphics, Inc. not be used in advertising - or publicity pertaining to distribution of the software without specific, - written prior permission. - . - THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - . - US Government Users Restricted Rights - Use, duplication, or disclosure by the Government is subject to - restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - (c)(1)(ii) of the Rights in Technical Data and Computer Software - clause at DFARS 252.227-7013 and/or in similar or successor - clauses in the FAR or the DOD or NASA FAR Supplement. - Unpublished-- rights reserved under the copyright laws of the - United States. Contractor/manufacturer is Silicon Graphics, - Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - . - OpenGL(TM) is a trademark of Silicon Graphics, Inc. diff --git a/debian/docs b/debian/docs index 2e2e9c4ee..229d128e4 100644 --- a/debian/docs +++ b/debian/docs @@ -1,4 +1,4 @@ BUGS.txt CREDITS.txt -README.txt README-SDL.txt +README.txt diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 000000000..d719155a6 --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,7 @@ +[DEFAULT] +pristine-tar = True +sign-tags = True + +[import-orig] +filter = [ 'Android.mk', 'android-project', 'debian', 'VisualC', 'VisualC-WinRT', 'Xcode', 'Xcode-iOS' ] +filter-pristine-tar = True diff --git a/debian/libsdl2-2.0-0-udeb.install b/debian/libsdl2-2.0-0-udeb.install new file mode 100644 index 000000000..e4193c74c --- /dev/null +++ b/debian/libsdl2-2.0-0-udeb.install @@ -0,0 +1 @@ +usr/lib/*/libSDL2-2.0.so.0* diff --git a/debian/libsdl2-dev.install b/debian/libsdl2-dev.install index af2c5b19d..d7d0549c9 100644 --- a/debian/libsdl2-dev.install +++ b/debian/libsdl2-dev.install @@ -1,9 +1,9 @@ usr/bin/sdl2-config usr/include/SDL2 +usr/lib/*/cmake/SDL2/sdl2-config.cmake usr/lib/*/libSDL2*.so usr/lib/*/libSDL2.a -usr/lib/*/libSDL2main.a usr/lib/*/libSDL2_test.a +usr/lib/*/libSDL2main.a usr/lib/*/pkgconfig/sdl2.pc -usr/lib/*/cmake/SDL2/sdl2-config.cmake usr/share/aclocal/sdl2.m4 diff --git a/debian/libsdl2-doc.doc-base b/debian/libsdl2-doc.doc-base new file mode 100644 index 000000000..f9782aa72 --- /dev/null +++ b/debian/libsdl2-doc.doc-base @@ -0,0 +1,14 @@ +Document: libsdl2 +Title: LibSDL2 Manual +Author: Sam Lantinga +Abstract: + SDL is a library that allows programs portable low level access to a video + framebuffer, audio output, mouse, and keyboard. + . + This version of SDL is compiled with X11 and Wayland graphics drivers and OSS, + ALSA, NAS, sndio and PulseAudio sound drivers. +Section: Programming/C++ + +Format: HTML +Index: /usr/share/doc/libsdl2-doc/html/index.html +Files: /usr/share/doc/libsdl2-doc/html/* diff --git a/debian/libsdl2-doc.examples b/debian/libsdl2-doc.examples new file mode 100644 index 000000000..c7566aaed --- /dev/null +++ b/debian/libsdl2-doc.examples @@ -0,0 +1 @@ +debian/examples.tar.gz diff --git a/debian/libsdl2-doc.install b/debian/libsdl2-doc.install new file mode 100644 index 000000000..119cc3d95 --- /dev/null +++ b/debian/libsdl2-doc.install @@ -0,0 +1 @@ +output/html usr/share/doc/libsdl2-doc/ diff --git a/debian/patches/SDL2_dont_propagate_lpthread.diff b/debian/patches/SDL2_dont_propagate_lpthread.diff new file mode 100644 index 000000000..459cd990e --- /dev/null +++ b/debian/patches/SDL2_dont_propagate_lpthread.diff @@ -0,0 +1,43 @@ +Description: Do not propagate -lpthread to sdl-config --libs (adapted for SDL2) + Introduced in 1.2.11-1 (Thu, 20 Jul 2006 14:17:18 +0200). + . + Upstream will not apply it at the moment: + Sam Lantinga 2012-01-22 10:54:21 PST + . + At some point it was required that multi-threaded programs using pthreads on + Linux link directly to the pthread library. I don't remember all the details, + but it had something to do with initializing C runtime variables correctly. + . + I'm sure it's not an issue anymore, but I'd rather not apply this patch in 1.2. + I'll go ahead and make this change in 1.3 though. +Author: Sam Hocevar +Last-Update: 2013-10-19 +Bug-Debian: http://bugs.debian.org/375822 +Forwarded: http://bugzilla.libsdl.org/show_bug.cgi?id=1392 + +--- + sdl2-config.in | 2 +- + sdl2.pc.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/sdl2.pc.in ++++ b/sdl2.pc.in +@@ -10,6 +10,6 @@ + Version: @SDL_VERSION@ + Requires: + Conflicts: +-Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@ ++Libs: -L${libdir} @SDL_RLD_FLAGS@ -lSDL2 + Libs.private: @SDL_STATIC_LIBS@ + Cflags: -I${includedir}/SDL2 @SDL_CFLAGS@ +--- a/sdl2-config.in ++++ b/sdl2-config.in +@@ -45,7 +45,7 @@ + echo -I@includedir@/SDL2 @SDL_CFLAGS@ + ;; + @ENABLE_SHARED_TRUE@ --libs) +-@ENABLE_SHARED_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@ ++@ENABLE_SHARED_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ -lSDL2 + @ENABLE_SHARED_TRUE@ ;; + @ENABLE_STATIC_TRUE@@ENABLE_SHARED_TRUE@ --static-libs) + @ENABLE_STATIC_TRUE@@ENABLE_SHARED_FALSE@ --libs|--static-libs) diff --git a/debian/patches/mir_new_abi_api.diff b/debian/patches/mir_new_abi_api.diff new file mode 100644 index 000000000..0af13f1ef --- /dev/null +++ b/debian/patches/mir_new_abi_api.diff @@ -0,0 +1,1226 @@ +--- a/configure.in ++++ b/configure.in +@@ -1260,12 +1260,12 @@ + MIR_LIBS=`$PKG_CONFIG --libs mirclient egl xkbcommon` + save_CFLAGS="$CFLAGS" + CFLAGS="$save_CFLAGS $MIR_CFLAGS" +- +- dnl This will disable Mir on Ubuntu < 14.04 ++ ++ dnl This will disable Mir on Ubuntu < 15.04 (Mir should be 0.14 at this point) + AC_TRY_COMPILE([ + #include + ],[ +- MirMotionToolType tool = mir_motion_tool_type_mouse; ++ MirPointerButton button = mir_pointer_button_primary; + ],[ + video_mir=yes + ]) +--- a/src/video/mir/SDL_mirdyn.c ++++ b/src/video/mir/SDL_mirdyn.c +@@ -84,9 +84,11 @@ + /* Define all the function pointers and wrappers... */ + #define SDL_MIR_MODULE(modname) int SDL_MIR_HAVE_##modname = 0; + #define SDL_MIR_SYM(rc,fn,params) SDL_DYNMIRFN_##fn MIR_##fn = NULL; ++#define SDL_MIR_SYM_CONST(type,name) SDL_DYMMIRCONST_##name MIR_##name = NULL; + #include "SDL_mirsym.h" + #undef SDL_MIR_MODULE + #undef SDL_MIR_SYM ++#undef SDL_MIR_SYM_CONST + + static int mir_load_refcount = 0; + +@@ -103,9 +105,11 @@ + /* set all the function pointers to NULL. */ + #define SDL_MIR_MODULE(modname) SDL_MIR_HAVE_##modname = 0; + #define SDL_MIR_SYM(rc,fn,params) MIR_##fn = NULL; ++#define SDL_MIR_SYM_CONST(type,name) MIR_##name = NULL; + #include "SDL_mirsym.h" + #undef SDL_MIR_MODULE + #undef SDL_MIR_SYM ++#undef SDL_MIR_SYM_CONST + + + #ifdef SDL_VIDEO_DRIVER_MIR_DYNAMIC +@@ -139,15 +143,19 @@ + + #define SDL_MIR_MODULE(modname) SDL_MIR_HAVE_##modname = 1; /* default yes */ + #define SDL_MIR_SYM(rc,fn,params) ++#define SDL_MIR_SYM_CONST(type,name) + #include "SDL_mirsym.h" + #undef SDL_MIR_MODULE + #undef SDL_MIR_SYM ++#undef SDL_MIR_SYM_CONST + + #define SDL_MIR_MODULE(modname) thismod = &SDL_MIR_HAVE_##modname; + #define SDL_MIR_SYM(rc,fn,params) MIR_##fn = (SDL_DYNMIRFN_##fn) MIR_GetSym(#fn,thismod); ++#define SDL_MIR_SYM_CONST(type,name) MIR_##name = *(SDL_DYMMIRCONST_##name*) MIR_GetSym(#name,thismod); + #include "SDL_mirsym.h" + #undef SDL_MIR_MODULE + #undef SDL_MIR_SYM ++#undef SDL_MIR_SYM_CONST + + if ((SDL_MIR_HAVE_MIR_CLIENT) && (SDL_MIR_HAVE_XKBCOMMON)) { + /* all required symbols loaded. */ +@@ -162,9 +170,11 @@ + + #define SDL_MIR_MODULE(modname) SDL_MIR_HAVE_##modname = 1; /* default yes */ + #define SDL_MIR_SYM(rc,fn,params) MIR_##fn = fn; ++#define SDL_MIR_SYM_CONST(type,name) MIR_##name = name; + #include "SDL_mirsym.h" + #undef SDL_MIR_MODULE + #undef SDL_MIR_SYM ++#undef SDL_MIR_SYM_CONST + + #endif + } +--- a/src/video/mir/SDL_mirdyn.h ++++ b/src/video/mir/SDL_mirdyn.h +@@ -40,9 +40,13 @@ + #define SDL_MIR_SYM(rc,fn,params) \ + typedef rc (*SDL_DYNMIRFN_##fn) params; \ + extern SDL_DYNMIRFN_##fn MIR_##fn; ++#define SDL_MIR_SYM_CONST(type, name) \ ++ typedef type SDL_DYMMIRCONST_##name; \ ++ extern SDL_DYMMIRCONST_##name MIR_##name; + #include "SDL_mirsym.h" + #undef SDL_MIR_MODULE + #undef SDL_MIR_SYM ++#undef SDL_MIR_SYM_CONST + + #ifdef __cplusplus + } +--- a/src/video/mir/SDL_mirevents.c ++++ b/src/video/mir/SDL_mirevents.c +@@ -58,7 +58,7 @@ + { + SDL_Window* keyboard_window = SDL_GetKeyboardFocus(); + +- if (keyboard_window != sdl_window) ++ if (sdl_window && keyboard_window != sdl_window) + SDL_SetKeyboardFocus(sdl_window); + } + +@@ -68,51 +68,68 @@ + a single key press produces a character. + */ + static void +-HandleKeyEvent(MirKeyEvent const ev, SDL_Window* window) ++HandleKeyEvent(MirKeyboardEvent const* key_event, SDL_Window* window) + { +- uint32_t scancode = SDL_SCANCODE_UNKNOWN; +- Uint8 key_state = ev.action == mir_key_action_up ? SDL_RELEASED : SDL_PRESSED; ++ xkb_keysym_t key_code; ++ Uint8 key_state; ++ int event_scancode; ++ uint32_t sdl_scancode = SDL_SCANCODE_UNKNOWN; ++ ++ MirKeyboardAction action = MIR_mir_keyboard_event_action(key_event); ++ ++ key_state = SDL_PRESSED; ++ key_code = MIR_mir_keyboard_event_key_code(key_event); ++ event_scancode = MIR_mir_keyboard_event_scan_code(key_event); ++ ++ if (action == mir_keyboard_action_up) ++ key_state = SDL_RELEASED; + + CheckKeyboardFocus(window); + +- if (ev.scan_code < SDL_arraysize(xfree86_scancode_table2)) +- scancode = xfree86_scancode_table2[ev.scan_code]; ++ if (event_scancode < SDL_arraysize(xfree86_scancode_table2)) ++ sdl_scancode = xfree86_scancode_table2[event_scancode]; + +- if (scancode != SDL_SCANCODE_UNKNOWN) +- SDL_SendKeyboardKey(key_state, scancode); ++ if (sdl_scancode != SDL_SCANCODE_UNKNOWN) ++ SDL_SendKeyboardKey(key_state, sdl_scancode); + + if (key_state == SDL_PRESSED) +- HandleKeyText(ev.key_code); ++ HandleKeyText(key_code); + } + + static void +-HandleMouseButton(SDL_Window* sdl_window, Uint8 state, MirMotionButton button_state) ++HandleMouseButton(SDL_Window* sdl_window, Uint8 state, MirPointerEvent const* pointer) + { +- static uint32_t last_sdl_button; +- uint32_t sdl_button; ++ uint32_t sdl_button = SDL_BUTTON_LEFT; ++ MirPointerButton button_state = mir_pointer_button_primary; ++ ++ static uint32_t old_button_states = 0; ++ uint32_t new_button_states = MIR_mir_pointer_event_buttons(pointer); ++ ++ // XOR on our old button states vs our new states to get the newley pressed/released button ++ button_state = new_button_states ^ old_button_states; + + switch (button_state) { +- case mir_motion_button_primary: ++ case mir_pointer_button_primary: + sdl_button = SDL_BUTTON_LEFT; + break; +- case mir_motion_button_secondary: ++ case mir_pointer_button_secondary: + sdl_button = SDL_BUTTON_RIGHT; + break; +- case mir_motion_button_tertiary: ++ case mir_pointer_button_tertiary: + sdl_button = SDL_BUTTON_MIDDLE; + break; +- case mir_motion_button_forward: ++ case mir_pointer_button_forward: + sdl_button = SDL_BUTTON_X1; + break; +- case mir_motion_button_back: ++ case mir_pointer_button_back: + sdl_button = SDL_BUTTON_X2; + break; + default: +- sdl_button = last_sdl_button; + break; + } + +- last_sdl_button = sdl_button; ++ old_button_states = new_button_states; ++ + SDL_SendMouseButton(sdl_window, 0, state, sdl_button); + } + +@@ -148,104 +165,127 @@ + } + + static void +-HandleTouchEvent(MirMotionEvent const motion, int cord_index, SDL_Window* sdl_window) ++HandleTouchEvent(MirTouchEvent const* touch, int device_id, SDL_Window* sdl_window) + { +- int device_id = motion.device_id; +- int id = motion.pointer_coordinates[cord_index].id; ++ int i, point_count; ++ point_count = MIR_mir_touch_event_point_count(touch); + +- int width = sdl_window->w; +- int height = sdl_window->h; +- float x = motion.pointer_coordinates[cord_index].x; +- float y = motion.pointer_coordinates[cord_index].y; +- +- float n_x = x / width; +- float n_y = y / height; +- float pressure = motion.pointer_coordinates[cord_index].pressure; +- +- AddTouchDevice(motion.device_id); +- +- switch (motion.action) { +- case mir_motion_action_down: +- case mir_motion_action_pointer_down: +- HandleTouchPress(device_id, id, SDL_TRUE, n_x, n_y, pressure); +- break; +- case mir_motion_action_up: +- case mir_motion_action_pointer_up: +- HandleTouchPress(device_id, id, SDL_FALSE, n_x, n_y, pressure); +- break; +- case mir_motion_action_hover_move: +- case mir_motion_action_move: +- HandleTouchMotion(device_id, id, n_x, n_y, pressure); +- break; +- default: +- break; ++ AddTouchDevice(device_id); ++ ++ for (i = 0; i < point_count; i++) { ++ int id = MIR_mir_touch_event_id(touch, i); ++ ++ int width = sdl_window->w; ++ int height = sdl_window->h; ++ ++ float x = MIR_mir_touch_event_axis_value(touch, i, mir_touch_axis_x); ++ float y = MIR_mir_touch_event_axis_value(touch, i, mir_touch_axis_y); ++ ++ float n_x = x / width; ++ float n_y = y / height; ++ ++ float pressure = MIR_mir_touch_event_axis_value(touch, i, mir_touch_axis_pressure); ++ ++ switch (MIR_mir_touch_event_action(touch, i)) { ++ case mir_touch_action_up: ++ HandleTouchPress(device_id, id, SDL_FALSE, n_x, n_y, pressure); ++ break; ++ case mir_touch_action_down: ++ HandleTouchPress(device_id, id, SDL_TRUE, n_x, n_y, pressure); ++ break; ++ case mir_touch_action_change: ++ HandleTouchMotion(device_id, id, n_x, n_y, pressure); ++ break; ++ } + } + } + + static void +-HandleMouseEvent(MirMotionEvent const motion, int cord_index, SDL_Window* sdl_window) ++HandleMouseEvent(MirPointerEvent const* pointer, SDL_Window* sdl_window) + { + SDL_SetMouseFocus(sdl_window); + +- switch (motion.action) { +- case mir_motion_action_down: +- case mir_motion_action_pointer_down: +- HandleMouseButton(sdl_window, SDL_PRESSED, motion.button_state); +- break; +- case mir_motion_action_up: +- case mir_motion_action_pointer_up: +- HandleMouseButton(sdl_window, SDL_RELEASED, motion.button_state); +- break; +- case mir_motion_action_hover_move: +- case mir_motion_action_move: +- HandleMouseMotion(sdl_window, +- motion.pointer_coordinates[cord_index].x, +- motion.pointer_coordinates[cord_index].y); ++ switch (MIR_mir_pointer_event_action(pointer)) { ++ case mir_pointer_action_button_down: ++ HandleMouseButton(sdl_window, SDL_PRESSED, pointer); ++ break; ++ case mir_pointer_action_button_up: ++ HandleMouseButton(sdl_window, SDL_RELEASED, pointer); ++ break; ++ case mir_pointer_action_motion: { ++ int x, y; ++ int hscroll, vscroll; ++ SDL_Mouse* mouse = SDL_GetMouse(); ++ x = MIR_mir_pointer_event_axis_value(pointer, mir_pointer_axis_x); ++ y = MIR_mir_pointer_event_axis_value(pointer, mir_pointer_axis_y); ++ hscroll = MIR_mir_pointer_event_axis_value(pointer, mir_pointer_axis_hscroll); ++ vscroll = MIR_mir_pointer_event_axis_value(pointer, mir_pointer_axis_vscroll); ++ ++ if (mouse && (mouse->x != x || mouse->y != y)) ++ HandleMouseMotion(sdl_window, x, y); ++ if (vscroll != 0 || hscroll != 0) ++ HandleMouseScroll(sdl_window, hscroll, vscroll); ++ } + break; +- case mir_motion_action_outside: ++ case mir_pointer_action_leave: + SDL_SetMouseFocus(NULL); + break; +- case mir_motion_action_scroll: +- HandleMouseScroll(sdl_window, +- motion.pointer_coordinates[cord_index].hscroll, +- motion.pointer_coordinates[cord_index].vscroll); +- break; +- case mir_motion_action_cancel: +- case mir_motion_action_hover_enter: +- case mir_motion_action_hover_exit: +- break; ++ case mir_pointer_action_enter: + default: + break; + } + } + + static void +-HandleMotionEvent(MirMotionEvent const motion, SDL_Window* sdl_window) ++MIR_HandleInput(MirInputEvent const* input_event, SDL_Window* window) + { +- int cord_index; +- for (cord_index = 0; cord_index < motion.pointer_count; cord_index++) { +- if (motion.pointer_coordinates[cord_index].tool_type == mir_motion_tool_type_finger) { +- HandleTouchEvent(motion, cord_index, sdl_window); +- } +- else { +- HandleMouseEvent(motion, cord_index, sdl_window); +- } ++ switch (MIR_mir_input_event_get_type(input_event)) { ++ case (mir_input_event_type_key): ++ HandleKeyEvent(MIR_mir_input_event_get_keyboard_event(input_event), window); ++ break; ++ case (mir_input_event_type_pointer): ++ HandleMouseEvent(MIR_mir_input_event_get_pointer_event(input_event), window); ++ break; ++ case (mir_input_event_type_touch): ++ HandleTouchEvent(MIR_mir_input_event_get_touch_event(input_event), ++ MIR_mir_input_event_get_device_id(input_event), ++ window); ++ break; ++ default: ++ break; + } + } + ++static void ++MIR_HandleResize(MirResizeEvent const* resize_event, SDL_Window* window) ++{ ++ int new_w = MIR_mir_resize_event_get_width (resize_event); ++ int new_h = MIR_mir_resize_event_get_height(resize_event); ++ ++ int old_w = window->w; ++ int old_h = window->h; ++ ++ if (new_w != old_w || new_h != old_h) ++ SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, new_w, new_h); ++} ++ + void +-MIR_HandleInput(MirSurface* surface, MirEvent const* ev, void* context) ++MIR_HandleEvent(MirSurface* surface, MirEvent const* ev, void* context) + { +- SDL_Window* window = (SDL_Window*)context; +- switch (ev->type) { +- case (mir_event_type_key): +- HandleKeyEvent(ev->key, window); +- break; +- case (mir_event_type_motion): +- HandleMotionEvent(ev->motion, window); +- break; +- default: +- break; ++ MirEventType event_type = MIR_mir_event_get_type(ev); ++ SDL_Window* window = (SDL_Window*)context; ++ ++ if (window) { ++ switch (event_type) { ++ case (mir_event_type_input): ++ MIR_HandleInput(MIR_mir_event_get_input_event(ev), window); ++ break; ++ case (mir_event_type_resize): ++ MIR_HandleResize(MIR_mir_event_get_resize_event(ev), window); ++ break; ++ default: ++ break; ++ } + } + } + +--- a/src/video/mir/SDL_mirevents.h ++++ b/src/video/mir/SDL_mirevents.h +@@ -29,7 +29,7 @@ + #include + + extern void +-MIR_HandleInput(MirSurface* surface, MirEvent const* ev, void* context); ++MIR_HandleEvent(MirSurface* surface, MirEvent const* ev, void* context); + + #endif /* _SDL_mirevents_h */ + +--- a/src/video/mir/SDL_mirframebuffer.c ++++ b/src/video/mir/SDL_mirframebuffer.c +@@ -39,7 +39,11 @@ + SDL_PIXELFORMAT_BGR888, /* mir_pixel_format_xbgr_8888 */ + SDL_PIXELFORMAT_ARGB8888, /* mir_pixel_format_argb_8888 */ + SDL_PIXELFORMAT_RGB888, /* mir_pixel_format_xrgb_8888 */ +- SDL_PIXELFORMAT_BGR24 /* mir_pixel_format_bgr_888 */ ++ SDL_PIXELFORMAT_BGR24, /* mir_pixel_format_bgr_888 */ ++ SDL_PIXELFORMAT_RGB24, /* mir_pixel_format_rgb_888 */ ++ SDL_PIXELFORMAT_RGB565, /* mir_pixel_format_rgb_565 */ ++ SDL_PIXELFORMAT_RGBA5551, /* mir_pixel_format_rgba_5551 */ ++ SDL_PIXELFORMAT_RGBA4444 /* mir_pixel_format_rgba_4444 */ + }; + + Uint32 +@@ -53,19 +57,13 @@ + void** pixels, int* pitch) + { + MIR_Data* mir_data = _this->driverdata; +- MIR_Window* mir_window; +- MirSurfaceParameters surfaceparm; + + mir_data->software = SDL_TRUE; + + if (MIR_CreateWindow(_this, window) < 0) + return SDL_SetError("Failed to created a mir window."); + +- mir_window = window->driverdata; +- +- MIR_mir_surface_get_parameters(mir_window->surface, &surfaceparm); +- +- *format = MIR_GetSDLPixelFormat(surfaceparm.pixel_format); ++ *format = MIR_GetSDLPixelFormat(mir_data->pixel_format); + if (*format == SDL_PIXELFORMAT_UNKNOWN) + return SDL_SetError("Unknown pixel format"); + +@@ -75,12 +73,6 @@ + if (*pixels == NULL) + return SDL_OutOfMemory(); + +- mir_window->surface = MIR_mir_connection_create_surface_sync(mir_data->connection, &surfaceparm); +- if (!MIR_mir_surface_is_valid(mir_window->surface)) { +- const char* error = MIR_mir_surface_get_error_message(mir_window->surface); +- return SDL_SetError("Failed to created a mir surface: %s", error); +- } +- + return 0; + } + +@@ -91,12 +83,14 @@ + MIR_Window* mir_window = window->driverdata; + + MirGraphicsRegion region; ++ MirBufferStream* bs; + int i, j, x, y, w, h, start; + int bytes_per_pixel, bytes_per_row, s_stride, d_stride; + char* s_dest; + char* pixels; + +- MIR_mir_surface_get_graphics_region(mir_window->surface, ®ion); ++ bs = MIR_mir_surface_get_buffer_stream(mir_window->surface); ++ MIR_mir_buffer_stream_get_graphics_region(bs, ®ion); + + s_dest = region.vaddr; + pixels = (char*)window->surface->pixels; +@@ -144,7 +138,7 @@ + } + } + +- MIR_mir_surface_swap_buffers_sync(mir_window->surface); ++ MIR_mir_buffer_stream_swap_buffers_sync(bs); + + return 0; + } +--- a/src/video/mir/SDL_mirmouse.c ++++ b/src/video/mir/SDL_mirmouse.c +@@ -27,13 +27,22 @@ + + #if SDL_VIDEO_DRIVER_MIR + +-#include "SDL_mirmouse.h" +- + #include "../../events/SDL_mouse_c.h" ++#include "../SDL_sysvideo.h" + #include "SDL_assert.h" + + #include "SDL_mirdyn.h" + ++#include "SDL_mirvideo.h" ++#include "SDL_mirmouse.h" ++#include "SDL_mirwindow.h" ++ ++typedef struct ++{ ++ MirCursorConfiguration* conf; ++ MirBufferStream* stream; ++} MIR_Cursor; ++ + static SDL_Cursor* + MIR_CreateDefaultCursor() + { +@@ -41,6 +50,16 @@ + + cursor = SDL_calloc(1, sizeof(SDL_Cursor)); + if (cursor) { ++ ++ MIR_Cursor* mir_cursor = SDL_calloc(1, sizeof(MIR_Cursor)); ++ if (mir_cursor) { ++ mir_cursor->conf = NULL; ++ mir_cursor->stream = NULL; ++ cursor->driverdata = mir_cursor; ++ } ++ else { ++ SDL_OutOfMemory(); ++ } + } + else { + SDL_OutOfMemory(); +@@ -49,58 +68,160 @@ + return cursor; + } + ++static void ++CopySurfacePixelsToMirStream(SDL_Surface* surface, MirBufferStream* stream) ++{ ++ char* dest, *pixels; ++ int i, s_w, s_h, r_stride, p_stride, bytes_per_pixel, bytes_per_row; ++ ++ MirGraphicsRegion region; ++ MIR_mir_buffer_stream_get_graphics_region(stream, ®ion); ++ ++ s_w = surface->w; ++ s_h = surface->h; ++ ++ bytes_per_pixel = surface->format->BytesPerPixel; ++ bytes_per_row = bytes_per_pixel * s_w; ++ ++ dest = region.vaddr; ++ pixels = (char*)surface->pixels; ++ ++ r_stride = region.stride; ++ p_stride = surface->pitch; ++ ++ for (i = 0; i < s_h; i++) ++ { ++ memcpy(dest, pixels, bytes_per_row); ++ dest += r_stride; ++ pixels += p_stride; ++ } ++} ++ + static SDL_Cursor* +-MIR_CreateCursor(SDL_Surface* sruface, int hot_x, int hot_y) ++MIR_CreateCursor(SDL_Surface* surface, int hot_x, int hot_y) + { +- return MIR_CreateDefaultCursor(); ++ MirCursorConfiguration* conf; ++ MirBufferStream* stream; ++ ++ int s_w = surface->w; ++ int s_h = surface->h; ++ ++ MIR_Data* mir_data = (MIR_Data*)SDL_GetVideoDevice()->driverdata; ++ SDL_Cursor* cursor = MIR_CreateDefaultCursor(); ++ MIR_Cursor* mir_cursor = (MIR_Cursor*)cursor->driverdata; ++ ++ stream = MIR_mir_connection_create_buffer_stream_sync(mir_data->connection, ++ s_w, s_h, mir_data->pixel_format, ++ mir_buffer_usage_software); ++ ++ conf = MIR_mir_cursor_configuration_from_buffer_stream(stream, hot_x, hot_y); ++ ++ CopySurfacePixelsToMirStream(surface, stream); ++ MIR_mir_buffer_stream_swap_buffers_sync(stream); ++ ++ mir_cursor->conf = conf; ++ mir_cursor->stream = stream; ++ ++ return cursor; + } + + static SDL_Cursor* + MIR_CreateSystemCursor(SDL_SystemCursor id) + { ++ char const* cursor_name = NULL; ++ MirCursorConfiguration* conf; ++ SDL_Cursor* cursor = MIR_CreateDefaultCursor(); ++ + switch(id) { + case SDL_SYSTEM_CURSOR_ARROW: ++ cursor_name = MIR_mir_arrow_cursor_name; + break; + case SDL_SYSTEM_CURSOR_IBEAM: ++ cursor_name = MIR_mir_caret_cursor_name; + break; + case SDL_SYSTEM_CURSOR_WAIT: ++ cursor_name = MIR_mir_busy_cursor_name; + break; + case SDL_SYSTEM_CURSOR_CROSSHAIR: ++ /* Unsupported */ ++ cursor_name = MIR_mir_arrow_cursor_name; + break; + case SDL_SYSTEM_CURSOR_WAITARROW: ++ cursor_name = MIR_mir_busy_cursor_name; + break; + case SDL_SYSTEM_CURSOR_SIZENWSE: ++ cursor_name = MIR_mir_omnidirectional_resize_cursor_name; + break; + case SDL_SYSTEM_CURSOR_SIZENESW: ++ cursor_name = MIR_mir_omnidirectional_resize_cursor_name; + break; + case SDL_SYSTEM_CURSOR_SIZEWE: ++ cursor_name = MIR_mir_horizontal_resize_cursor_name; + break; + case SDL_SYSTEM_CURSOR_SIZENS: ++ cursor_name = MIR_mir_vertical_resize_cursor_name; + break; + case SDL_SYSTEM_CURSOR_SIZEALL: ++ cursor_name = MIR_mir_omnidirectional_resize_cursor_name; + break; + case SDL_SYSTEM_CURSOR_NO: ++ /* Unsupported */ ++ cursor_name = MIR_mir_closed_hand_cursor_name; + break; + case SDL_SYSTEM_CURSOR_HAND: ++ cursor_name = MIR_mir_open_hand_cursor_name; + break; + default: + SDL_assert(0); + return NULL; + } + +- return MIR_CreateDefaultCursor(); ++ conf = MIR_mir_cursor_configuration_from_name(cursor_name); ++ ++ cursor->driverdata = conf; ++ ++ return cursor; + } + + static void + MIR_FreeCursor(SDL_Cursor* cursor) + { +- if (cursor) +- SDL_free(cursor); ++ if (cursor) { ++ ++ if (cursor->driverdata) { ++ MIR_Cursor* mir_cursor = (MIR_Cursor*)cursor->driverdata; ++ ++ if (mir_cursor->conf) ++ MIR_mir_cursor_configuration_destroy(mir_cursor->conf); ++ if (mir_cursor->stream) ++ MIR_mir_buffer_stream_release_sync(mir_cursor->stream); ++ ++ SDL_free(mir_cursor); ++ } ++ ++ SDL_free(cursor); ++ } + } + + static int + MIR_ShowCursor(SDL_Cursor* cursor) + { ++ MIR_Data* mir_data = (MIR_Data*)SDL_GetVideoDevice()->driverdata; ++ MIR_Window* mir_window = mir_data->current_window; ++ ++ if (cursor && cursor->driverdata) { ++ if (mir_window && MIR_mir_surface_is_valid(mir_window->surface)) { ++ MIR_Cursor* mir_cursor = (MIR_Cursor*)cursor->driverdata; ++ ++ if (mir_cursor->conf) { ++ MIR_mir_wait_for(MIR_mir_surface_configure_cursor(mir_window->surface, mir_cursor->conf)); ++ } ++ } ++ } ++ else if(mir_window && MIR_mir_surface_is_valid(mir_window->surface)) { ++ MIR_mir_wait_for(MIR_mir_surface_configure_cursor(mir_window->surface, NULL)); ++ } ++ + return 0; + } + +--- a/src/video/mir/SDL_mirsym.h ++++ b/src/video/mir/SDL_mirsym.h +@@ -23,23 +23,74 @@ + + SDL_MIR_MODULE(MIR_CLIENT) + SDL_MIR_SYM(MirDisplayConfiguration*,mir_connection_create_display_config,(MirConnection *connection)) +-SDL_MIR_SYM(MirSurface *,mir_connection_create_surface_sync,(MirConnection *connection, MirSurfaceParameters const *params)) ++SDL_MIR_SYM(MirSurface *,mir_surface_create_sync,(MirSurfaceSpec* spec)) ++SDL_MIR_SYM(MirEGLNativeWindowType,mir_buffer_stream_get_egl_native_window,(MirBufferStream *surface)) ++SDL_MIR_SYM(void,mir_buffer_stream_get_graphics_region,(MirBufferStream *stream, MirGraphicsRegion *graphics_region)) ++SDL_MIR_SYM(void,mir_buffer_stream_swap_buffers_sync,(MirBufferStream *stream)) ++SDL_MIR_SYM(void,mir_surface_set_event_handler,(MirSurface *surface, mir_surface_event_callback callback, void* context)) ++SDL_MIR_SYM(MirSurfaceSpec*,mir_connection_create_spec_for_normal_surface,(MirConnection *connection, int width, int height, MirPixelFormat format)) ++SDL_MIR_SYM(MirSurfaceSpec*,mir_connection_create_spec_for_changes,(MirConnection *connection)) ++SDL_MIR_SYM(void,mir_surface_spec_set_buffer_usage,(MirSurfaceSpec *spec, MirBufferUsage usage)) ++SDL_MIR_SYM(void,mir_surface_spec_set_name,(MirSurfaceSpec *spec, char const *name)) ++SDL_MIR_SYM(void,mir_surface_spec_release,(MirSurfaceSpec *spec)) ++SDL_MIR_SYM(void,mir_surface_spec_set_width,(MirSurfaceSpec *spec, unsigned width)) ++SDL_MIR_SYM(void,mir_surface_spec_set_height,(MirSurfaceSpec *spec, unsigned height)) ++SDL_MIR_SYM(void,mir_surface_spec_set_min_width,(MirSurfaceSpec *spec, unsigned min_width)) ++SDL_MIR_SYM(void,mir_surface_spec_set_min_height,(MirSurfaceSpec *spec, unsigned min_height)) ++SDL_MIR_SYM(void,mir_surface_spec_set_max_width,(MirSurfaceSpec *spec, unsigned max_width)) ++SDL_MIR_SYM(void,mir_surface_spec_set_max_height,(MirSurfaceSpec *spec, unsigned max_height)) ++SDL_MIR_SYM(void,mir_surface_spec_set_type,(MirSurfaceSpec *spec, MirSurfaceType type)) ++SDL_MIR_SYM(void,mir_surface_spec_set_state,(MirSurfaceSpec *spec, MirSurfaceState state)) ++SDL_MIR_SYM(void,mir_surface_apply_spec,(MirSurface *surface, MirSurfaceSpec *spec)) ++SDL_MIR_SYM(void,mir_surface_get_parameters,(MirSurface *surface, MirSurfaceParameters *params)) ++SDL_MIR_SYM(MirBufferStream*,mir_surface_get_buffer_stream,(MirSurface *surface)) ++SDL_MIR_SYM(MirCursorConfiguration*,mir_cursor_configuration_from_buffer_stream,(MirBufferStream* stream, int hot_x, int hot_y)) ++SDL_MIR_SYM(MirBufferStream*,mir_connection_create_buffer_stream_sync,(MirConnection *connection, int w, int h, MirPixelFormat format, MirBufferUsage usage)) ++SDL_MIR_SYM(MirKeyboardAction,mir_keyboard_event_action,(MirKeyboardEvent const *event)) ++SDL_MIR_SYM(xkb_keysym_t,mir_keyboard_event_key_code,(MirKeyboardEvent const *event)) ++SDL_MIR_SYM(int,mir_keyboard_event_scan_code,(MirKeyboardEvent const *event)) ++SDL_MIR_SYM(bool,mir_pointer_event_button_state,(MirPointerEvent const *event, MirPointerButton button)) ++SDL_MIR_SYM(MirPointerButtons,mir_pointer_event_buttons,(MirPointerEvent const *event)) ++SDL_MIR_SYM(MirInputDeviceId,mir_input_event_get_device_id,(MirInputEvent const* ev)) ++SDL_MIR_SYM(MirTouchId,mir_touch_event_id,(MirTouchEvent const *event, size_t touch_index)) ++SDL_MIR_SYM(float,mir_touch_event_axis_value,(MirTouchEvent const *event, size_t touch_index, MirTouchAxis axis)) ++SDL_MIR_SYM(MirTouchAction,mir_touch_event_action,(MirTouchEvent const *event, size_t touch_index)) ++SDL_MIR_SYM(MirPointerAction,mir_pointer_event_action,(MirPointerEvent const *event)) ++SDL_MIR_SYM(float,mir_pointer_event_axis_value,(MirPointerEvent const *event, MirPointerAxis)) ++SDL_MIR_SYM(MirEventType,mir_event_get_type,(MirEvent const *event)) ++SDL_MIR_SYM(MirInputEventType,mir_input_event_get_type,(MirInputEvent const *event)) ++SDL_MIR_SYM(MirInputEvent const*,mir_event_get_input_event,(MirEvent const *event)) ++SDL_MIR_SYM(MirResizeEvent const*,mir_event_get_resize_event,(MirEvent const *event)) ++SDL_MIR_SYM(MirKeyboardEvent const*,mir_input_event_get_keyboard_event,(MirInputEvent const *event)) ++SDL_MIR_SYM(MirPointerEvent const*,mir_input_event_get_pointer_event,(MirInputEvent const *event)) ++SDL_MIR_SYM(MirTouchEvent const*,mir_input_event_get_touch_event,(MirInputEvent const *event)) ++SDL_MIR_SYM(unsigned int,mir_touch_event_point_count,(MirTouchEvent const *event)) + SDL_MIR_SYM(void,mir_connection_get_available_surface_formats,(MirConnection* connection, MirPixelFormat* formats, unsigned const int format_size, unsigned int *num_valid_formats)) + SDL_MIR_SYM(MirEGLNativeDisplayType,mir_connection_get_egl_native_display,(MirConnection *connection)) +-SDL_MIR_SYM(MirBool,mir_connection_is_valid,(MirConnection *connection)) ++SDL_MIR_SYM(bool,mir_connection_is_valid,(MirConnection *connection)) + SDL_MIR_SYM(void,mir_connection_release,(MirConnection *connection)) ++SDL_MIR_SYM(MirPixelFormat,mir_connection_get_egl_pixel_format,(MirConnection* connection, void* egldisplay, void* eglconfig)) + SDL_MIR_SYM(MirConnection *,mir_connect_sync,(char const *server, char const *app_name)) + SDL_MIR_SYM(void,mir_display_config_destroy,(MirDisplayConfiguration* display_configuration)) +-SDL_MIR_SYM(MirEGLNativeWindowType,mir_surface_get_egl_native_window,(MirSurface *surface)) + SDL_MIR_SYM(char const *,mir_surface_get_error_message,(MirSurface *surface)) +-SDL_MIR_SYM(void,mir_surface_get_graphics_region,(MirSurface *surface, MirGraphicsRegion *graphics_region)) +-SDL_MIR_SYM(void,mir_surface_get_parameters,(MirSurface *surface, MirSurfaceParameters *parameters)) +-SDL_MIR_SYM(MirBool,mir_surface_is_valid,(MirSurface *surface)) ++SDL_MIR_SYM(bool,mir_surface_is_valid,(MirSurface *surface)) + SDL_MIR_SYM(void,mir_surface_release_sync,(MirSurface *surface)) +-SDL_MIR_SYM(void,mir_surface_set_event_handler,(MirSurface *surface, MirEventDelegate const *event_handler)) +-SDL_MIR_SYM(MirWaitHandle*,mir_surface_set_type,(MirSurface *surface, MirSurfaceType type)) +-SDL_MIR_SYM(MirWaitHandle*,mir_surface_set_state,(MirSurface *surface, MirSurfaceState state)) +-SDL_MIR_SYM(void,mir_surface_swap_buffers_sync,(MirSurface *surface)) ++SDL_MIR_SYM(void,mir_buffer_stream_release_sync,(MirBufferStream *stream)) ++SDL_MIR_SYM(MirCursorConfiguration*,mir_cursor_configuration_from_name,(char const* cursor_name)) ++SDL_MIR_SYM(MirWaitHandle*,mir_surface_configure_cursor,(MirSurface* surface, MirCursorConfiguration const* conf)) ++SDL_MIR_SYM(void,mir_cursor_configuration_destroy,(MirCursorConfiguration* conf)) ++SDL_MIR_SYM(void,mir_wait_for,(MirWaitHandle* handle)) ++SDL_MIR_SYM(int,mir_resize_event_get_width,(MirResizeEvent const* resize_event)) ++SDL_MIR_SYM(int,mir_resize_event_get_height,(MirResizeEvent const* resize_event)) ++ ++SDL_MIR_SYM_CONST(char const*,mir_omnidirectional_resize_cursor_name) ++SDL_MIR_SYM_CONST(char const*,mir_busy_cursor_name) ++SDL_MIR_SYM_CONST(char const*,mir_arrow_cursor_name) ++SDL_MIR_SYM_CONST(char const*,mir_caret_cursor_name) ++SDL_MIR_SYM_CONST(char const*,mir_vertical_resize_cursor_name) ++SDL_MIR_SYM_CONST(char const*,mir_horizontal_resize_cursor_name) ++SDL_MIR_SYM_CONST(char const*,mir_open_hand_cursor_name) ++SDL_MIR_SYM_CONST(char const*,mir_closed_hand_cursor_name) + + SDL_MIR_MODULE(XKBCOMMON) + SDL_MIR_SYM(int,xkb_keysym_to_utf8,(xkb_keysym_t keysym, char *buffer, size_t size)) +--- a/src/video/mir/SDL_mirvideo.c ++++ b/src/video/mir/SDL_mirvideo.c +@@ -27,13 +27,13 @@ + + #if SDL_VIDEO_DRIVER_MIR + ++#include "SDL_mirwindow.h" + #include "SDL_video.h" + + #include "SDL_mirframebuffer.h" + #include "SDL_mirmouse.h" + #include "SDL_miropengl.h" + #include "SDL_mirvideo.h" +-#include "SDL_mirwindow.h" + + #include "SDL_mirdyn.h" + +@@ -146,29 +146,29 @@ + device->GL_GetProcAddress = MIR_GL_GetProcAddress; + + /* mirwindow */ +- device->CreateWindow = MIR_CreateWindow; +- device->DestroyWindow = MIR_DestroyWindow; +- device->GetWindowWMInfo = MIR_GetWindowWMInfo; +- device->SetWindowFullscreen = MIR_SetWindowFullscreen; +- device->MaximizeWindow = MIR_MaximizeWindow; +- device->MinimizeWindow = MIR_MinimizeWindow; +- device->RestoreWindow = MIR_RestoreWindow; ++ device->CreateWindow = MIR_CreateWindow; ++ device->DestroyWindow = MIR_DestroyWindow; ++ device->GetWindowWMInfo = MIR_GetWindowWMInfo; ++ device->SetWindowFullscreen = MIR_SetWindowFullscreen; ++ device->MaximizeWindow = MIR_MaximizeWindow; ++ device->MinimizeWindow = MIR_MinimizeWindow; ++ device->RestoreWindow = MIR_RestoreWindow; ++ device->ShowWindow = MIR_RestoreWindow; ++ device->HideWindow = MIR_HideWindow; ++ device->SetWindowSize = MIR_SetWindowSize; ++ device->SetWindowMinimumSize = MIR_SetWindowMinimumSize; ++ device->SetWindowMaximumSize = MIR_SetWindowMaximumSize; ++ device->SetWindowTitle = MIR_SetWindowTitle; + + device->CreateWindowFrom = NULL; +- device->SetWindowTitle = NULL; + device->SetWindowIcon = NULL; +- device->SetWindowPosition = NULL; +- device->SetWindowSize = NULL; +- device->SetWindowMinimumSize = NULL; +- device->SetWindowMaximumSize = NULL; +- device->ShowWindow = NULL; +- device->HideWindow = NULL; + device->RaiseWindow = NULL; + device->SetWindowBordered = NULL; + device->SetWindowGammaRamp = NULL; + device->GetWindowGammaRamp = NULL; + device->SetWindowGrab = NULL; + device->OnWindowEnter = NULL; ++ device->SetWindowPosition = NULL; + + /* mirframebuffer */ + device->CreateWindowFramebuffer = MIR_CreateWindowFramebuffer; +@@ -272,8 +272,10 @@ + { + MIR_Data* mir_data = _this->driverdata; + +- mir_data->connection = MIR_mir_connect_sync(NULL, __PRETTY_FUNCTION__); +- mir_data->software = SDL_FALSE; ++ mir_data->connection = MIR_mir_connect_sync(NULL, __PRETTY_FUNCTION__); ++ mir_data->current_window = NULL; ++ mir_data->software = SDL_FALSE; ++ mir_data->pixel_format = mir_pixel_format_invalid; + + if (!MIR_mir_connection_is_valid(mir_data->connection)) + return SDL_SetError("Failed to connect to the Mir Server"); +--- a/src/video/mir/SDL_mirvideo.h ++++ b/src/video/mir/SDL_mirvideo.h +@@ -29,11 +29,14 @@ + #include + #include + ++typedef struct MIR_Window MIR_Window; ++ + typedef struct + { + MirConnection* connection; +- SDL_bool software; +- ++ MIR_Window* current_window; ++ SDL_bool software; ++ MirPixelFormat pixel_format; + } MIR_Data; + + #endif /* _SDL_mirvideo_h_ */ +--- a/src/video/mir/SDL_mirwindow.c ++++ b/src/video/mir/SDL_mirwindow.c +@@ -46,52 +46,15 @@ + return 0; + } + +-MirPixelFormat +-FindValidPixelFormat(MIR_Data* mir_data) +-{ +- unsigned int pf_size = 32; +- unsigned int valid_formats; +- unsigned int f; +- +- MirPixelFormat formats[pf_size]; +- MIR_mir_connection_get_available_surface_formats(mir_data->connection, formats, +- pf_size, &valid_formats); +- +- for (f = 0; f < valid_formats; f++) { +- MirPixelFormat cur_pf = formats[f]; +- +- if (cur_pf == mir_pixel_format_abgr_8888 || +- cur_pf == mir_pixel_format_xbgr_8888 || +- cur_pf == mir_pixel_format_argb_8888 || +- cur_pf == mir_pixel_format_xrgb_8888) { +- +- return cur_pf; +- } +- } +- +- return mir_pixel_format_invalid; +-} +- + int + MIR_CreateWindow(_THIS, SDL_Window* window) + { + MIR_Window* mir_window; + MIR_Data* mir_data; ++ MirPixelFormat pixel_format; ++ MirBufferUsage buffer_usage; + +- MirSurfaceParameters surfaceparm = +- { +- .name = "MirSurface", +- .width = window->w, +- .height = window->h, +- .pixel_format = mir_pixel_format_invalid, +- .buffer_usage = mir_buffer_usage_hardware, +- .output_id = mir_display_output_id_invalid +- }; +- +- MirEventDelegate delegate = { +- MIR_HandleInput, +- window +- }; ++ MirSurfaceSpec* spec; + + mir_window = SDL_calloc(1, sizeof(MIR_Window)); + if (!mir_window) +@@ -100,9 +63,6 @@ + mir_data = _this->driverdata; + window->driverdata = mir_window; + +- if (mir_data->software) +- surfaceparm.buffer_usage = mir_buffer_usage_software; +- + if (window->x == SDL_WINDOWPOS_UNDEFINED) + window->x = 0; + +@@ -112,12 +72,32 @@ + mir_window->mir_data = mir_data; + mir_window->sdl_window = window; + +- surfaceparm.pixel_format = FindValidPixelFormat(mir_data); +- if (surfaceparm.pixel_format == mir_pixel_format_invalid) { ++ pixel_format = MIR_mir_connection_get_egl_pixel_format(mir_data->connection, ++ _this->egl_data->egl_display, ++ _this->egl_data->egl_config); ++ ++ mir_data->pixel_format = pixel_format; ++ if (pixel_format == mir_pixel_format_invalid) { + return SDL_SetError("Failed to find a valid pixel format."); + } + +- mir_window->surface = MIR_mir_connection_create_surface_sync(mir_data->connection, &surfaceparm); ++ buffer_usage = mir_buffer_usage_hardware; ++ if (mir_data->software) ++ buffer_usage = mir_buffer_usage_software; ++ ++ spec = MIR_mir_connection_create_spec_for_normal_surface(mir_data->connection, ++ window->w, ++ window->h, ++ pixel_format); ++ ++ MIR_mir_surface_spec_set_buffer_usage(spec, buffer_usage); ++ MIR_mir_surface_spec_set_name(spec, "Mir surface"); ++ ++ mir_window->surface = MIR_mir_surface_create_sync(spec); ++ MIR_mir_surface_set_event_handler(mir_window->surface, MIR_HandleEvent, window); ++ ++ MIR_mir_surface_spec_release(spec); ++ + if (!MIR_mir_surface_is_valid(mir_window->surface)) { + const char* error = MIR_mir_surface_get_error_message(mir_window->surface); + return SDL_SetError("Failed to created a mir surface: %s", error); +@@ -125,7 +105,8 @@ + + if (window->flags & SDL_WINDOW_OPENGL) { + EGLNativeWindowType egl_native_window = +- (EGLNativeWindowType)MIR_mir_surface_get_egl_native_window(mir_window->surface); ++ (EGLNativeWindowType)MIR_mir_buffer_stream_get_egl_native_window( ++ MIR_mir_surface_get_buffer_stream(mir_window->surface)); + + mir_window->egl_surface = SDL_EGL_CreateSurface(_this, egl_native_window); + +@@ -138,7 +119,7 @@ + mir_window->egl_surface = EGL_NO_SURFACE; + } + +- MIR_mir_surface_set_event_handler(mir_window->surface, &delegate); ++ mir_data->current_window = mir_window; + + return 0; + } +@@ -146,13 +127,15 @@ + void + MIR_DestroyWindow(_THIS, SDL_Window* window) + { +- MIR_Data* mir_data = _this->driverdata; ++ MIR_Data* mir_data = _this->driverdata; + MIR_Window* mir_window = window->driverdata; + + if (mir_data) { + SDL_EGL_DestroySurface(_this, mir_window->egl_surface); + MIR_mir_surface_release_sync(mir_window->surface); + ++ mir_data->current_window = NULL; ++ + SDL_free(mir_window); + } + window->driverdata = NULL; +@@ -180,49 +163,166 @@ + SDL_VideoDisplay* display, + SDL_bool fullscreen) + { ++ MIR_Data* mir_data = _this->driverdata; + MIR_Window* mir_window = window->driverdata; ++ MirSurfaceSpec* spec; ++ MirSurfaceState state; + + if (IsSurfaceValid(mir_window) < 0) + return; + + if (fullscreen) { +- MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_fullscreen); ++ state = mir_surface_state_fullscreen; + } else { +- MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_restored); ++ state = mir_surface_state_restored; + } ++ ++ spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection); ++ MIR_mir_surface_spec_set_state(spec, state); ++ ++ MIR_mir_surface_apply_spec(mir_window->surface, spec); ++ MIR_mir_surface_spec_release(spec); + } + + void + MIR_MaximizeWindow(_THIS, SDL_Window* window) + { ++ MIR_Data* mir_data = _this->driverdata; + MIR_Window* mir_window = window->driverdata; ++ MirSurfaceSpec* spec; + + if (IsSurfaceValid(mir_window) < 0) + return; + +- MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_maximized); ++ spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection); ++ MIR_mir_surface_spec_set_state(spec, mir_surface_state_maximized); ++ ++ MIR_mir_surface_apply_spec(mir_window->surface, spec); ++ MIR_mir_surface_spec_release(spec); + } + + void + MIR_MinimizeWindow(_THIS, SDL_Window* window) + { ++ MIR_Data* mir_data = _this->driverdata; + MIR_Window* mir_window = window->driverdata; ++ MirSurfaceSpec* spec; + + if (IsSurfaceValid(mir_window) < 0) + return; + +- MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_minimized); ++ spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection); ++ MIR_mir_surface_spec_set_state(spec, mir_surface_state_minimized); ++ ++ MIR_mir_surface_apply_spec(mir_window->surface, spec); ++ MIR_mir_surface_spec_release(spec); + } + + void + MIR_RestoreWindow(_THIS, SDL_Window * window) + { ++ MIR_Data* mir_data = _this->driverdata; ++ MIR_Window* mir_window = window->driverdata; ++ MirSurfaceSpec* spec; ++ ++ if (IsSurfaceValid(mir_window) < 0) ++ return; ++ ++ spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection); ++ MIR_mir_surface_spec_set_state(spec, mir_surface_state_restored); ++ ++ MIR_mir_surface_apply_spec(mir_window->surface, spec); ++ MIR_mir_surface_spec_release(spec); ++} ++ ++void ++MIR_HideWindow(_THIS, SDL_Window* window) ++{ ++ MIR_Data* mir_data = _this->driverdata; ++ MIR_Window* mir_window = window->driverdata; ++ MirSurfaceSpec* spec; ++ ++ if (IsSurfaceValid(mir_window) < 0) ++ return; ++ ++ spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection); ++ MIR_mir_surface_spec_set_state(spec, mir_surface_state_hidden); ++ ++ MIR_mir_surface_apply_spec(mir_window->surface, spec); ++ MIR_mir_surface_spec_release(spec); ++} ++ ++void ++MIR_SetWindowSize(_THIS, SDL_Window* window) ++{ ++ MIR_Data* mir_data = _this->driverdata; ++ MIR_Window* mir_window = window->driverdata; ++ MirSurfaceSpec* spec; ++ ++ if (IsSurfaceValid(mir_window) < 0) ++ return; ++ ++ /* You cannot set the x/y of a mir window! So only update w/h */ ++ spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection); ++ MIR_mir_surface_spec_set_width (spec, window->w); ++ MIR_mir_surface_spec_set_height(spec, window->h); ++ ++ MIR_mir_surface_apply_spec(mir_window->surface, spec); ++ MIR_mir_surface_spec_release(spec); ++} ++ ++void ++MIR_SetWindowMinimumSize(_THIS, SDL_Window* window) ++{ ++ MIR_Data* mir_data = _this->driverdata; ++ MIR_Window* mir_window = window->driverdata; ++ MirSurfaceSpec* spec; ++ ++ if (IsSurfaceValid(mir_window) < 0) ++ return; ++ ++ spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection); ++ MIR_mir_surface_spec_set_min_width (spec, window->min_w); ++ MIR_mir_surface_spec_set_min_height(spec, window->min_h); ++ ++ MIR_mir_surface_apply_spec(mir_window->surface, spec); ++ MIR_mir_surface_spec_release(spec); ++} ++ ++void ++MIR_SetWindowMaximumSize(_THIS, SDL_Window* window) ++{ ++ MIR_Data* mir_data = _this->driverdata; ++ MIR_Window* mir_window = window->driverdata; ++ MirSurfaceSpec* spec; ++ ++ if (IsSurfaceValid(mir_window) < 0) ++ return; ++ ++ spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection); ++ MIR_mir_surface_spec_set_max_width (spec, window->max_w); ++ MIR_mir_surface_spec_set_max_height(spec, window->max_h); ++ ++ MIR_mir_surface_apply_spec(mir_window->surface, spec); ++ MIR_mir_surface_spec_release(spec); ++} ++ ++void ++MIR_SetWindowTitle(_THIS, SDL_Window* window) ++{ ++ MIR_Data* mir_data = _this->driverdata; + MIR_Window* mir_window = window->driverdata; ++ char const* title = window->title ? window->title : ""; ++ MirSurfaceSpec* spec; + + if (IsSurfaceValid(mir_window) < 0) + return; + +- MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_restored); ++ spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection); ++ MIR_mir_surface_spec_set_name(spec, title); ++ ++ MIR_mir_surface_apply_spec(mir_window->surface, spec); ++ MIR_mir_surface_spec_release(spec); + } + + #endif /* SDL_VIDEO_DRIVER_MIR */ +--- a/src/video/mir/SDL_mirwindow.h ++++ b/src/video/mir/SDL_mirwindow.h +@@ -31,13 +31,13 @@ + + #include "SDL_mirvideo.h" + +-typedef struct { ++struct MIR_Window { + SDL_Window* sdl_window; +- MIR_Data* mir_data; ++ MIR_Data* mir_data; + + MirSurface* surface; +- EGLSurface egl_surface; +-} MIR_Window; ++ EGLSurface egl_surface; ++}; + + + extern int +@@ -60,10 +60,25 @@ + extern void + MIR_RestoreWindow(_THIS, SDL_Window* window); + ++extern void ++MIR_HideWindow(_THIS, SDL_Window* window); ++ + extern SDL_bool + MIR_GetWindowWMInfo(_THIS, SDL_Window* window, SDL_SysWMinfo* info); + +-#endif /* _SDL_mirwindow_h */ ++extern void ++MIR_SetWindowSize(_THIS, SDL_Window* window); ++ ++extern void ++MIR_SetWindowMinimumSize(_THIS, SDL_Window* window); ++ ++extern void ++MIR_SetWindowMaximumSize(_THIS, SDL_Window* window); ++ ++extern void ++MIR_SetWindowTitle(_THIS, SDL_Window* window); ++ ++#endif /* _SDL_mirwindow */ + + /* vi: set ts=4 sw=4 expandtab: */ + diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 000000000..8ac487ec9 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,2 @@ +SDL2_dont_propagate_lpthread.diff +mir_new_abi_api.diff diff --git a/debian/rules b/debian/rules index 4bde8f325..3d155d087 100755 --- a/debian/rules +++ b/debian/rules @@ -1,41 +1,95 @@ #!/usr/bin/make -f +SHLIBVER = 2.0.4 + DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) -confflags = --disable-rpath --disable-video-directfb \ +confflags = --disable-rpath --enable-sdl-dlopen --disable-loadso \ --disable-nas --disable-esd --disable-arts \ --disable-alsa-shared --disable-pulseaudio-shared \ - --disable-x11-shared + --disable-x11-shared --disable-video-directfb \ + --enable-video-opengles \ + --enable-video-wayland --disable-wayland-shared + +ifeq ($(DEB_HOST_ARCH_CPU),powerpc) + confflags += --disable-altivec +endif + +ifeq ($(DEB_HOST_ARCH_CPU),ppc64el) + confflags += --disable-altivec +endif + +# disable Wayland on non-Linux, they do not support other kernels at the moment +ifeq (hurd,$(findstring hurd,$(DEB_HOST_ARCH_CPU))) + confflags += --disable-video-wayland +endif +ifeq (kfreefsd,$(findstring kfreebsd,$(DEB_HOST_ARCH_CPU))) + confflags += --disable-video-wayland +endif + +# disable OpenGLES on Hurd, it does not support it at the moment +ifeq (hurd,$(findstring hurd,$(DEB_HOST_ARCH_CPU))) + confflags += --disable--video-opengles +endif + %: - dh $@ --parallel + dh $@ --with autoreconf --parallel + +override_dh_autoreconf: + # aclocal needs to include in specific order, and/or it seems that + # doesn't try to find .m4 files in /usr/share/aclocal at all. Updates + # to both .m4 files and ltmain.sh (aclocal and libtoolize) are necessary + # to support new architectures aarch64 (arm64) and powerpc64le, and this + # seems the more straight way to achieve it. + # + # An alternative would be to just build-depend on libesd0-dev, + # libasound2-dev and libltdl-dev to provide the files "esd.m4 alsa.m4 + # ltdl.m4" in /usr/share/aclocal, and not use the local "acinclude" dir + # at all, but this pull even more dependencies, and unneeded ones. + # + # Another equivalent alternative, but more verbose: + # + # ACLOCAL="cat acinclude/esd.m4 acinclude/alsa.m4 acinclude/ltdl.m4 \ + # /usr/share/aclocal/libtool.m4 \ + # /usr/share/aclocal/ltoptions.m4 \ + # /usr/share/aclocal/ltversion.m4 \ + # /usr/share/aclocal/ltsugar.m4 >> aclocal.m4; aclocal" + # LIBTOOLIZE="libtoolize -f -i" dh_autoreconf --as-needed + # autoreconf -- -I acinclude -f -i + AUTOHEADER=true ACLOCAL="aclocal --force --install -I /usr/share/aclocal/ -I acinclude" LIBTOOLIZE="libtoolize -fi" dh_autoreconf --as-needed + # To verify that it worked, grep should find these strings: + # + #rgrep -i aarch64 . + #rgrep -r powerpc64le . override_dh_auto_configure: - dh_auto_configure -Bbuilddir/all -- $(confflags) + dh_auto_configure -- $(confflags) -override_dh_auto_build: - dh_auto_build -Bbuilddir/all - tar czf debian/examples.tar.gz test +override_dh_auto_build-indep: + tar czf debian/examples.tar.gz test --owner=0 --group=0 --mode=go=rX,u+rw,a-s + doxygen docs/doxyfile + # useless files + find output -name "*.md5" -delete + find output -type d -empty -delete -override_dh_auto_install: - dh_auto_install -Bbuilddir/all - -override_dh_auto_clean: - dh_auto_clean -Bbuilddir/all +override_dh_auto_clean-indep: + dh_auto_clean rm -f debian/examples.tar.gz + rm -rf output override_dh_install: - dh_install --remaining-packages --fail-missing -XlibSDL2.la - -override_dh_installexamples: - dh_installexamples -plibsdl2-dev debian/examples.tar.gz - dh_installexamples --remaining-packages + dh_install --fail-missing -XlibSDL2.la override_dh_link: - # to address lintian warning - # W: libsdl2-2.0-0: dev-pkg-without-shlib-symlink usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.0.0 usr/lib/x86_64-linux-gnu/libSDL2-2.0.so - dh_link -plibsdl2-dev usr/lib/$(DEB_HOST_MULTIARCH)/libSDL2-2.0.so.0.0.0 usr/lib/$(DEB_HOST_MULTIARCH)/libSDL2-2.0.so + # to address lintian warning + # W: libsdl2-2.0-0: dev-pkg-without-shlib-symlink usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.0.0 usr/lib/x86_64-linux-gnu/libSDL2-2.0.so + dh_link -plibsdl2-dev usr/lib/$(DEB_HOST_MULTIARCH)/libSDL2-2.0.so.0.4.0 usr/lib/$(DEB_HOST_MULTIARCH)/libSDL2-2.0.so + dh_link --remaining-packages override_dh_strip: dh_strip --dbg-package=libsdl2-dbg + +override_dh_makeshlibs: + dh_makeshlibs -V"libsdl2-2.0-0 (>= $(SHLIBVER))" diff --git a/debian/sdl2-config.1 b/debian/sdl2-config.1 index c4f4106fa..262e06783 100644 --- a/debian/sdl2-config.1 +++ b/debian/sdl2-config.1 @@ -1,13 +1,9 @@ -.TH sdl2-config 1 "2012-02-20" "SDL 2.0" +.TH sdl2-config 1 "2013-07-27" "SDL 2.0" .SH NAME sdl2-config \- script to get information about the installed version of SDL .SH SYNOPSIS .B sdl2-config -[ --prefix= -.IR DIR ] -[ --exec-prefix= -.IR DIR ] -[ --version ] [ --libs | --library-libs | --plugin-libs ] [ --cflags ] +[--prefix=[\fIDIR\fR]] [--exec-prefix=[\fIDIR\fR]] [--version] [--cflags] [--libs] [--static-libs] .SH DESCRIPTION .B sdl2-config is a tool that is used to configure and determine the compiler and linker @@ -20,13 +16,14 @@ included with SDL. Print the compiler flags that are necessary to compile a program or library that uses SDL. .TP -.BI --exec-prefix= DIR -If specified, use -.I DIR -instead of the installation exec prefix that SDL was build with when -computing the output for the --cflags, --libs, --library-libs, and ---plugin-libs options. This option must be specified before any of the ---cflags, --libs, --library-libs, and --plugin-libs options. +.BI --exec-prefix\fR[=\fIDIR\fR] +If \fIDIR\fR is not specified, print the exec prefix of the current SDL +installation. +.IP +If \fIDIR\fR is specified, use it instead of the installation exec prefix that +SDL was built with when computing the output for the --cflags, --libs and +--static-libs options. This option must be specified before any of the options +--cflags, --libs and --static-libs. .TP .B --libs Print the linker flags that are necessary to link a program that uses SDL. @@ -34,27 +31,14 @@ Print the linker flags that are necessary to link a program that uses SDL. .B --static-libs Print the linker flags that are necessary to statically link a program that uses SDL. .TP -.B --library-libs -Print the linker flags that are necessary to link a library that uses SDL. -(This excludes any static objects required for linking, since these must be -linked only by executable programs.) -.TP -.B --plugin-libs -Print the linker flags that are necessary to link an SDL-using object that -is to be accessed via -.IR dlopen (3). -This may include static objects with PIC symbol information. This option -should -.B not -be used for ordinary shared libraries or standalone applications. -.TP -.BI --prefix= DIR -If specified, use PREFIX instead of the installation prefix that SDL was -built with when computing the output for the --cflags, --libs, ---library-libs, and --plugin-libs options. This option is also used for -the exec prefix if --exec-prefix was not specified. This option must be -specified before any of the --cflags, --libs, --library-libs, and ---plugin-libs options. +.BI --prefix\fR[=\fIDIR\fR] +If \fIDIR\fR is not specified, print the prefix of the current SDL installation. +.IP +If \fIDIR\fR is specified, use it instead of the installation prefix that SDL +was built with when computing the output for the --cflags, --libs and +--static-libs options. This option is also used for the exec prefix if +--exec-prefix was not specified. This option must be specified before any of +the options --cflags, --libs and --static-libs. .TP .B --version Prints the currently installed version of SDL on standard output. @@ -69,18 +53,10 @@ gcc -o my_app $(sdl2-config --libs) main.o util.o is how you might use .B sdl2-config to link compiled objects into an executable program. -.TP -gcc -o libSDL_nifty-2.0.so.0.0.1 $(sdl --library-libs) read.o write.o munge.o -is how you might use -.B sdl2-config -to link compiled objects into a shared library. -.TP -gcc -o libnifty_xmms.so $(sdl --plugin-libs) stream.o blit.o deinterlace.o -is how you might use -.B sdl2-config -to link compiled objects into a plugin for use by another program. .SH AUTHOR The Simple DirectMedia Layer (SDL) library was written by Sam Lantinga. .PP This manual page was written by Branden Robinson, originally for Progeny Linux Systems, Inc., and the Debian Project. +.br +Updated in 2013 by Manuel A. Fernandez Montecelo . diff --git a/debian/source/format b/debian/source/format index 89ae9db8f..163aaf8d8 100644 --- a/debian/source/format +++ b/debian/source/format @@ -1 +1 @@ -3.0 (native) +3.0 (quilt) diff --git a/debian/upstream/signing-key.asc b/debian/upstream/signing-key.asc new file mode 100644 index 000000000..bc6177224 --- /dev/null +++ b/debian/upstream/signing-key.asc @@ -0,0 +1,60 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1 + +mQGiBDpWOb0RBADQwd3d9mzt6KzqlsgXf9mikBuMbpKzYs1SBKYpdzUs9sRY0CnH +vCQTrL5sI57yKLnqEl6SbIiE75ZwrSWwvUDFFTh35Jew5nPZwv64en2kw2y4qrnJ +kBZCHDSU4KgfUZtoJ25Tmeru5MLNbXxCOoMszO5L5OchwMrGMtmFLRA/bwCgy5Th +d1/vJo+bej9tbgv++SJ05o0D/3MPK7EBoxWkQ0I+ScqOsvSMRQXWc/hXy4lyIp8e +xJByBApkv0LiiT3KlPpq/K2gTlDlCZ/JTt6Rv8Ug0g47R3a0aoz9kfc15UjHdiap +UOfF9MWmmbw59Lyx6+y2e0/C5xWzNOR1G4G5y4RZL/GXrp67xz/0fEhI85R+eASq +AEfSBAC5ZxwnBwyl+h+PXeJYKrPQjSUlgtSAkKp7PNBywwlue1LcSb7j4cc+cmgH +QMVuM883LPE59btNzFTAZjlzzIMiaXf5h9EkDARTGQ1wFiO3V5vIbVLh4kAoNfpT +egy7bYn3UrlbKg3V2DbCdEXm1zQufZzK7T0yenA5Ps8xXX7mNrQhU2FtIExhbnRp +bmdhIDxzbG91a2VuQGxpYnNkbC5vcmc+iFcEExECABcFAjpWOb0FCwcKAwQDFQMC +AxYCAQIXgAAKCRAwpZN3p3Y75t9RAJ48WI+nOPes0WK7t381Ij4JfSYxWQCgjpMa +Dg3/ah23HZhYtTKtHUzD9ziIRgQQEQIABgUCOoivfAAKCRAAUOX6oWT9DUfdAJ98 +VF1sQJzLBlnEaxwShI7kiJhu0gCgi6RmNv7uvdWcFrx44bIQW6PmeSWIRgQQEQIA +BgUCOqpvNwAKCRBFGL4/Itst46hqAJ9bnBc6ITeOHrHMpe3GqQ82phQvIQCeL+rF +bvxq0Zkymxzvpo6f0PQRXoOIRgQQEQIABgUCOsmb0QAKCRDsNH1Owq8moK5WAJwL +Rg3R4hST2QNQo55DeSSrVdOGkgCfXb2L6H/9lHv6fuEiHS0QI7ZntuiIRgQQEQIA +BgUCOy1cOAAKCRCWH0qNRXUpuvz8AKDN6Fq5lxOKpKvHvW47D2JbElIgnQCgjLKm +AsI+jIl61AkGx4QUx2W2jz2IRgQQEQIABgUCPuDQVQAKCRCHKI2OXqAN77RsAKDD +R0ZHqyC5F+q0kwAko/Sah6UQ5ACg23xKp8AQn5okh+JdV1bTg+fiMk6IRgQQEQIA +BgUCSD7jIQAKCRCEaROH9mEvTubsAJ9xaD1kfgRr9V1mm8rKfcV/C5czOACgjs/s +xHvBK0pZhYeMOzCTC8f98VSIRgQSEQIABgUCQYTQkwAKCRBZmXci2GQ9aTkYAJwK +djDIIkXr0324uhSwMl167EaYQgCfTSn6/HDaS7c7G5I+iLrd6K3EKsuIVwQTEQIA +FwUCOlY5vQULBwoDBAMVAwIDFgIBAheAAAoJEDClk3endjvm31EAnj+2HLP9MN0j +cKu4rCzMXZG4dlh4AJwNLRbvQk14n6OED1rmPbbQrd3ds4kBHAQQAQIABgUCUSlA +SwAKCRC8igP+iWp3vvORB/40VfgODA2qXRFJ9ws4i5QBcF84lPnecxWP89tOd2SG +VrT4Ttq3fukRr02bnfooC8pEsd/q9Dpl0x5RR1LXL0IQI7RBB63DmrIwUkWRit2J ++yAjN+8ajujv/Yja3GCVOz+gCOFrlBRgudrevS7L/2pkVrG706GHTvDF3mflrnP4 +JOmGLQmQi2iS5lmvfrt735+2WhWgLLyvjLwQ/FmYMPeIBwxt1f7/QQpVFGBR+Xi1 +RTQ9AYxPYA3dkZNAQJaeMoQOxGHZg4T6ORx9YdQD0kJWVQNxDvJ868co3BxX7e64 +EZrV0wqUy9ZeioxvESV/BS8i+HJ0AOmTqCIKsmHqZ3BgiQEcBBMBAgAGBQJA4Dg8 +AAoJEAuerLG7Symnm/YH/28kPjtCBCOdH/+K7eDE3LGRczXfG1y858cUUyXuofQo +42O2u/RUHd6305ZtAKTBDwL8Iz6srLokhbeBvc6QalbrfOZ51W7K2s9lUf4D3N7r +sAdNH7hH+S4jRTrjpobLepA/8CtNH/6gaX2Xx65lIiUpe/jVys91w4vKGnbBwegD +UZ4BeoA2cGpDih5GT8gnNGIN9fv1ku2IW/v4/7j/TXu1ZzklsTeYNzMp01cXqpFc +ObOhcpEVfwfwdNgF2HyoK/beuTILaN369L3QTR+2DXz2I10fAYUi4FmaC+tnuTcQ +UR1nVZupKK+DW3COb9J8CT7hGyYyab1SpPtHpmooLYOJAhwEEAECAAYFAklzvZAA +CgkQ9XofcAgkdty08Q/+MXVyhq/vrOt5u54JInoDIajHNE9h3cWvWV43emx364J0 +cN46glkhCRjVgUsFEk3kHGQgc+Qmix0vGn1aEgqso6yL9OVNUX+8z6WoOFuyQslI +VDA5XPTkAZ3iVemZqvTw1LlquR+/XbRER2Qtg4tPI5kBPMPUl5hb4bKiHPnUFb6j +tLvP3yDa2Uab9eEwXZkCKg4jjKiayk1RqcHQ2h9jL9BymyxY5S4OpbO/8Hw9OOgp +Pm7+cqbshqO7s9cjQ6FK4oPKS6qY8MDVog1fJbePB5aQtC9szWIXTZIn/7CTYinY +S7o7J53ZdUw4aeNdzI+p7NiJ75RXDQ++UpiPEG5SPP5eBFTxMzqGG0/ePlXUgihP +nFvqdVAxFphm67FWzVIpKWKn1io6A1fc7ozKUMuOmbO7DwnyLmYyme33Zw2WUrr4 +lKJomp7cmz+r3byrFAinPY7erhuuHWKIHdibdTjGNUZG5Rp9r3Y2Fjdxw+StJdE9 +q2T2esWXIWoc9vOdJvjmM0b8C3Yx3f6T46pnXbusM9p4xlSQ0KkVYZdk3CR0MFvr +YLYzxCAp/6M95UKvFCPhgWUuKyLQWfxVtIfVmbImGT4+1rJaJ7VcaD2gYDqD4PSo +LaZWm1Z9YJlC2GMMLbi53pU+ur+oSWjm/gT1QmplQENbF4UXcb2/CnN3IeuHK+K5 +AQ0EOlY5wxAEAPvjB0B5RNAj8hBF/Lq78w5rJ1/f5RqWXmdfxApuEE/9OEFXUSUX +ms9f/IWvySdyf48Pk4t2h8b8i7F0f3R+tcCp6m0Pt1BSNHYumfmtonTy5FHqpwBV +lEi7I0s5mD3kxO+k8PQbATHH5smFnoz2UTc+MzQjUdtTzXUkUgqvf9zTAAMGA/9Y +/h6rhi3YYXeI6SmbXqcmzsQKzaWVhLew67szejnYsKIJ1ja4MefYlthCXgmIBriN +ftxIGtBI0Pcmzwpn0eknRNK6NgpmESbGKCWh59JeiAK5hdBPe47LSFVct5zSO9vQ +hRDyLzhzPPtB3XeoKTUkLWxBSLbeZVwcHPIK/wLal4hGBBgRAgAGBQI6VjnDAAoJ +EDClk3endjvmxmUAn3Ne6Z3UULpie8RJP15RBt6K2MWFAJ9hK/Ls/FeBJ9d50qxm +YdZ2RrTXNg== +=59LX +-----END PGP PUBLIC KEY BLOCK----- diff --git a/debian/watch b/debian/watch index 07dc20117..c59af9d72 100644 --- a/debian/watch +++ b/debian/watch @@ -1,2 +1,3 @@ version=3 -http://www.libsdl.org/release/SDL-([\d.]+)\.tar\.gz +opts=dversionmangle=s/.dfsg\d+$//,pgpsigurlmangle=s/$/.sig/ \ + http://www.libsdl.org/release/SDL2-([\d.]+)\.tar\.(?:gz|bz2|xz|lzma) From e5adef7c295157740ad98b286f8ef7be6ea04818 Mon Sep 17 00:00:00 2001 From: gizmo98 Date: Mon, 19 Sep 2016 19:05:56 +0200 Subject: [PATCH 5/5] Remove patches --- .../patches/SDL2_dont_propagate_lpthread.diff | 43 - debian/patches/mir_new_abi_api.diff | 1226 ----------------- debian/patches/series | 2 - 3 files changed, 1271 deletions(-) delete mode 100644 debian/patches/SDL2_dont_propagate_lpthread.diff delete mode 100644 debian/patches/mir_new_abi_api.diff delete mode 100644 debian/patches/series diff --git a/debian/patches/SDL2_dont_propagate_lpthread.diff b/debian/patches/SDL2_dont_propagate_lpthread.diff deleted file mode 100644 index 459cd990e..000000000 --- a/debian/patches/SDL2_dont_propagate_lpthread.diff +++ /dev/null @@ -1,43 +0,0 @@ -Description: Do not propagate -lpthread to sdl-config --libs (adapted for SDL2) - Introduced in 1.2.11-1 (Thu, 20 Jul 2006 14:17:18 +0200). - . - Upstream will not apply it at the moment: - Sam Lantinga 2012-01-22 10:54:21 PST - . - At some point it was required that multi-threaded programs using pthreads on - Linux link directly to the pthread library. I don't remember all the details, - but it had something to do with initializing C runtime variables correctly. - . - I'm sure it's not an issue anymore, but I'd rather not apply this patch in 1.2. - I'll go ahead and make this change in 1.3 though. -Author: Sam Hocevar -Last-Update: 2013-10-19 -Bug-Debian: http://bugs.debian.org/375822 -Forwarded: http://bugzilla.libsdl.org/show_bug.cgi?id=1392 - ---- - sdl2-config.in | 2 +- - sdl2.pc.in | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - ---- a/sdl2.pc.in -+++ b/sdl2.pc.in -@@ -10,6 +10,6 @@ - Version: @SDL_VERSION@ - Requires: - Conflicts: --Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@ -+Libs: -L${libdir} @SDL_RLD_FLAGS@ -lSDL2 - Libs.private: @SDL_STATIC_LIBS@ - Cflags: -I${includedir}/SDL2 @SDL_CFLAGS@ ---- a/sdl2-config.in -+++ b/sdl2-config.in -@@ -45,7 +45,7 @@ - echo -I@includedir@/SDL2 @SDL_CFLAGS@ - ;; - @ENABLE_SHARED_TRUE@ --libs) --@ENABLE_SHARED_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@ -+@ENABLE_SHARED_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ -lSDL2 - @ENABLE_SHARED_TRUE@ ;; - @ENABLE_STATIC_TRUE@@ENABLE_SHARED_TRUE@ --static-libs) - @ENABLE_STATIC_TRUE@@ENABLE_SHARED_FALSE@ --libs|--static-libs) diff --git a/debian/patches/mir_new_abi_api.diff b/debian/patches/mir_new_abi_api.diff deleted file mode 100644 index 0af13f1ef..000000000 --- a/debian/patches/mir_new_abi_api.diff +++ /dev/null @@ -1,1226 +0,0 @@ ---- a/configure.in -+++ b/configure.in -@@ -1260,12 +1260,12 @@ - MIR_LIBS=`$PKG_CONFIG --libs mirclient egl xkbcommon` - save_CFLAGS="$CFLAGS" - CFLAGS="$save_CFLAGS $MIR_CFLAGS" -- -- dnl This will disable Mir on Ubuntu < 14.04 -+ -+ dnl This will disable Mir on Ubuntu < 15.04 (Mir should be 0.14 at this point) - AC_TRY_COMPILE([ - #include - ],[ -- MirMotionToolType tool = mir_motion_tool_type_mouse; -+ MirPointerButton button = mir_pointer_button_primary; - ],[ - video_mir=yes - ]) ---- a/src/video/mir/SDL_mirdyn.c -+++ b/src/video/mir/SDL_mirdyn.c -@@ -84,9 +84,11 @@ - /* Define all the function pointers and wrappers... */ - #define SDL_MIR_MODULE(modname) int SDL_MIR_HAVE_##modname = 0; - #define SDL_MIR_SYM(rc,fn,params) SDL_DYNMIRFN_##fn MIR_##fn = NULL; -+#define SDL_MIR_SYM_CONST(type,name) SDL_DYMMIRCONST_##name MIR_##name = NULL; - #include "SDL_mirsym.h" - #undef SDL_MIR_MODULE - #undef SDL_MIR_SYM -+#undef SDL_MIR_SYM_CONST - - static int mir_load_refcount = 0; - -@@ -103,9 +105,11 @@ - /* set all the function pointers to NULL. */ - #define SDL_MIR_MODULE(modname) SDL_MIR_HAVE_##modname = 0; - #define SDL_MIR_SYM(rc,fn,params) MIR_##fn = NULL; -+#define SDL_MIR_SYM_CONST(type,name) MIR_##name = NULL; - #include "SDL_mirsym.h" - #undef SDL_MIR_MODULE - #undef SDL_MIR_SYM -+#undef SDL_MIR_SYM_CONST - - - #ifdef SDL_VIDEO_DRIVER_MIR_DYNAMIC -@@ -139,15 +143,19 @@ - - #define SDL_MIR_MODULE(modname) SDL_MIR_HAVE_##modname = 1; /* default yes */ - #define SDL_MIR_SYM(rc,fn,params) -+#define SDL_MIR_SYM_CONST(type,name) - #include "SDL_mirsym.h" - #undef SDL_MIR_MODULE - #undef SDL_MIR_SYM -+#undef SDL_MIR_SYM_CONST - - #define SDL_MIR_MODULE(modname) thismod = &SDL_MIR_HAVE_##modname; - #define SDL_MIR_SYM(rc,fn,params) MIR_##fn = (SDL_DYNMIRFN_##fn) MIR_GetSym(#fn,thismod); -+#define SDL_MIR_SYM_CONST(type,name) MIR_##name = *(SDL_DYMMIRCONST_##name*) MIR_GetSym(#name,thismod); - #include "SDL_mirsym.h" - #undef SDL_MIR_MODULE - #undef SDL_MIR_SYM -+#undef SDL_MIR_SYM_CONST - - if ((SDL_MIR_HAVE_MIR_CLIENT) && (SDL_MIR_HAVE_XKBCOMMON)) { - /* all required symbols loaded. */ -@@ -162,9 +170,11 @@ - - #define SDL_MIR_MODULE(modname) SDL_MIR_HAVE_##modname = 1; /* default yes */ - #define SDL_MIR_SYM(rc,fn,params) MIR_##fn = fn; -+#define SDL_MIR_SYM_CONST(type,name) MIR_##name = name; - #include "SDL_mirsym.h" - #undef SDL_MIR_MODULE - #undef SDL_MIR_SYM -+#undef SDL_MIR_SYM_CONST - - #endif - } ---- a/src/video/mir/SDL_mirdyn.h -+++ b/src/video/mir/SDL_mirdyn.h -@@ -40,9 +40,13 @@ - #define SDL_MIR_SYM(rc,fn,params) \ - typedef rc (*SDL_DYNMIRFN_##fn) params; \ - extern SDL_DYNMIRFN_##fn MIR_##fn; -+#define SDL_MIR_SYM_CONST(type, name) \ -+ typedef type SDL_DYMMIRCONST_##name; \ -+ extern SDL_DYMMIRCONST_##name MIR_##name; - #include "SDL_mirsym.h" - #undef SDL_MIR_MODULE - #undef SDL_MIR_SYM -+#undef SDL_MIR_SYM_CONST - - #ifdef __cplusplus - } ---- a/src/video/mir/SDL_mirevents.c -+++ b/src/video/mir/SDL_mirevents.c -@@ -58,7 +58,7 @@ - { - SDL_Window* keyboard_window = SDL_GetKeyboardFocus(); - -- if (keyboard_window != sdl_window) -+ if (sdl_window && keyboard_window != sdl_window) - SDL_SetKeyboardFocus(sdl_window); - } - -@@ -68,51 +68,68 @@ - a single key press produces a character. - */ - static void --HandleKeyEvent(MirKeyEvent const ev, SDL_Window* window) -+HandleKeyEvent(MirKeyboardEvent const* key_event, SDL_Window* window) - { -- uint32_t scancode = SDL_SCANCODE_UNKNOWN; -- Uint8 key_state = ev.action == mir_key_action_up ? SDL_RELEASED : SDL_PRESSED; -+ xkb_keysym_t key_code; -+ Uint8 key_state; -+ int event_scancode; -+ uint32_t sdl_scancode = SDL_SCANCODE_UNKNOWN; -+ -+ MirKeyboardAction action = MIR_mir_keyboard_event_action(key_event); -+ -+ key_state = SDL_PRESSED; -+ key_code = MIR_mir_keyboard_event_key_code(key_event); -+ event_scancode = MIR_mir_keyboard_event_scan_code(key_event); -+ -+ if (action == mir_keyboard_action_up) -+ key_state = SDL_RELEASED; - - CheckKeyboardFocus(window); - -- if (ev.scan_code < SDL_arraysize(xfree86_scancode_table2)) -- scancode = xfree86_scancode_table2[ev.scan_code]; -+ if (event_scancode < SDL_arraysize(xfree86_scancode_table2)) -+ sdl_scancode = xfree86_scancode_table2[event_scancode]; - -- if (scancode != SDL_SCANCODE_UNKNOWN) -- SDL_SendKeyboardKey(key_state, scancode); -+ if (sdl_scancode != SDL_SCANCODE_UNKNOWN) -+ SDL_SendKeyboardKey(key_state, sdl_scancode); - - if (key_state == SDL_PRESSED) -- HandleKeyText(ev.key_code); -+ HandleKeyText(key_code); - } - - static void --HandleMouseButton(SDL_Window* sdl_window, Uint8 state, MirMotionButton button_state) -+HandleMouseButton(SDL_Window* sdl_window, Uint8 state, MirPointerEvent const* pointer) - { -- static uint32_t last_sdl_button; -- uint32_t sdl_button; -+ uint32_t sdl_button = SDL_BUTTON_LEFT; -+ MirPointerButton button_state = mir_pointer_button_primary; -+ -+ static uint32_t old_button_states = 0; -+ uint32_t new_button_states = MIR_mir_pointer_event_buttons(pointer); -+ -+ // XOR on our old button states vs our new states to get the newley pressed/released button -+ button_state = new_button_states ^ old_button_states; - - switch (button_state) { -- case mir_motion_button_primary: -+ case mir_pointer_button_primary: - sdl_button = SDL_BUTTON_LEFT; - break; -- case mir_motion_button_secondary: -+ case mir_pointer_button_secondary: - sdl_button = SDL_BUTTON_RIGHT; - break; -- case mir_motion_button_tertiary: -+ case mir_pointer_button_tertiary: - sdl_button = SDL_BUTTON_MIDDLE; - break; -- case mir_motion_button_forward: -+ case mir_pointer_button_forward: - sdl_button = SDL_BUTTON_X1; - break; -- case mir_motion_button_back: -+ case mir_pointer_button_back: - sdl_button = SDL_BUTTON_X2; - break; - default: -- sdl_button = last_sdl_button; - break; - } - -- last_sdl_button = sdl_button; -+ old_button_states = new_button_states; -+ - SDL_SendMouseButton(sdl_window, 0, state, sdl_button); - } - -@@ -148,104 +165,127 @@ - } - - static void --HandleTouchEvent(MirMotionEvent const motion, int cord_index, SDL_Window* sdl_window) -+HandleTouchEvent(MirTouchEvent const* touch, int device_id, SDL_Window* sdl_window) - { -- int device_id = motion.device_id; -- int id = motion.pointer_coordinates[cord_index].id; -+ int i, point_count; -+ point_count = MIR_mir_touch_event_point_count(touch); - -- int width = sdl_window->w; -- int height = sdl_window->h; -- float x = motion.pointer_coordinates[cord_index].x; -- float y = motion.pointer_coordinates[cord_index].y; -- -- float n_x = x / width; -- float n_y = y / height; -- float pressure = motion.pointer_coordinates[cord_index].pressure; -- -- AddTouchDevice(motion.device_id); -- -- switch (motion.action) { -- case mir_motion_action_down: -- case mir_motion_action_pointer_down: -- HandleTouchPress(device_id, id, SDL_TRUE, n_x, n_y, pressure); -- break; -- case mir_motion_action_up: -- case mir_motion_action_pointer_up: -- HandleTouchPress(device_id, id, SDL_FALSE, n_x, n_y, pressure); -- break; -- case mir_motion_action_hover_move: -- case mir_motion_action_move: -- HandleTouchMotion(device_id, id, n_x, n_y, pressure); -- break; -- default: -- break; -+ AddTouchDevice(device_id); -+ -+ for (i = 0; i < point_count; i++) { -+ int id = MIR_mir_touch_event_id(touch, i); -+ -+ int width = sdl_window->w; -+ int height = sdl_window->h; -+ -+ float x = MIR_mir_touch_event_axis_value(touch, i, mir_touch_axis_x); -+ float y = MIR_mir_touch_event_axis_value(touch, i, mir_touch_axis_y); -+ -+ float n_x = x / width; -+ float n_y = y / height; -+ -+ float pressure = MIR_mir_touch_event_axis_value(touch, i, mir_touch_axis_pressure); -+ -+ switch (MIR_mir_touch_event_action(touch, i)) { -+ case mir_touch_action_up: -+ HandleTouchPress(device_id, id, SDL_FALSE, n_x, n_y, pressure); -+ break; -+ case mir_touch_action_down: -+ HandleTouchPress(device_id, id, SDL_TRUE, n_x, n_y, pressure); -+ break; -+ case mir_touch_action_change: -+ HandleTouchMotion(device_id, id, n_x, n_y, pressure); -+ break; -+ } - } - } - - static void --HandleMouseEvent(MirMotionEvent const motion, int cord_index, SDL_Window* sdl_window) -+HandleMouseEvent(MirPointerEvent const* pointer, SDL_Window* sdl_window) - { - SDL_SetMouseFocus(sdl_window); - -- switch (motion.action) { -- case mir_motion_action_down: -- case mir_motion_action_pointer_down: -- HandleMouseButton(sdl_window, SDL_PRESSED, motion.button_state); -- break; -- case mir_motion_action_up: -- case mir_motion_action_pointer_up: -- HandleMouseButton(sdl_window, SDL_RELEASED, motion.button_state); -- break; -- case mir_motion_action_hover_move: -- case mir_motion_action_move: -- HandleMouseMotion(sdl_window, -- motion.pointer_coordinates[cord_index].x, -- motion.pointer_coordinates[cord_index].y); -+ switch (MIR_mir_pointer_event_action(pointer)) { -+ case mir_pointer_action_button_down: -+ HandleMouseButton(sdl_window, SDL_PRESSED, pointer); -+ break; -+ case mir_pointer_action_button_up: -+ HandleMouseButton(sdl_window, SDL_RELEASED, pointer); -+ break; -+ case mir_pointer_action_motion: { -+ int x, y; -+ int hscroll, vscroll; -+ SDL_Mouse* mouse = SDL_GetMouse(); -+ x = MIR_mir_pointer_event_axis_value(pointer, mir_pointer_axis_x); -+ y = MIR_mir_pointer_event_axis_value(pointer, mir_pointer_axis_y); -+ hscroll = MIR_mir_pointer_event_axis_value(pointer, mir_pointer_axis_hscroll); -+ vscroll = MIR_mir_pointer_event_axis_value(pointer, mir_pointer_axis_vscroll); -+ -+ if (mouse && (mouse->x != x || mouse->y != y)) -+ HandleMouseMotion(sdl_window, x, y); -+ if (vscroll != 0 || hscroll != 0) -+ HandleMouseScroll(sdl_window, hscroll, vscroll); -+ } - break; -- case mir_motion_action_outside: -+ case mir_pointer_action_leave: - SDL_SetMouseFocus(NULL); - break; -- case mir_motion_action_scroll: -- HandleMouseScroll(sdl_window, -- motion.pointer_coordinates[cord_index].hscroll, -- motion.pointer_coordinates[cord_index].vscroll); -- break; -- case mir_motion_action_cancel: -- case mir_motion_action_hover_enter: -- case mir_motion_action_hover_exit: -- break; -+ case mir_pointer_action_enter: - default: - break; - } - } - - static void --HandleMotionEvent(MirMotionEvent const motion, SDL_Window* sdl_window) -+MIR_HandleInput(MirInputEvent const* input_event, SDL_Window* window) - { -- int cord_index; -- for (cord_index = 0; cord_index < motion.pointer_count; cord_index++) { -- if (motion.pointer_coordinates[cord_index].tool_type == mir_motion_tool_type_finger) { -- HandleTouchEvent(motion, cord_index, sdl_window); -- } -- else { -- HandleMouseEvent(motion, cord_index, sdl_window); -- } -+ switch (MIR_mir_input_event_get_type(input_event)) { -+ case (mir_input_event_type_key): -+ HandleKeyEvent(MIR_mir_input_event_get_keyboard_event(input_event), window); -+ break; -+ case (mir_input_event_type_pointer): -+ HandleMouseEvent(MIR_mir_input_event_get_pointer_event(input_event), window); -+ break; -+ case (mir_input_event_type_touch): -+ HandleTouchEvent(MIR_mir_input_event_get_touch_event(input_event), -+ MIR_mir_input_event_get_device_id(input_event), -+ window); -+ break; -+ default: -+ break; - } - } - -+static void -+MIR_HandleResize(MirResizeEvent const* resize_event, SDL_Window* window) -+{ -+ int new_w = MIR_mir_resize_event_get_width (resize_event); -+ int new_h = MIR_mir_resize_event_get_height(resize_event); -+ -+ int old_w = window->w; -+ int old_h = window->h; -+ -+ if (new_w != old_w || new_h != old_h) -+ SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, new_w, new_h); -+} -+ - void --MIR_HandleInput(MirSurface* surface, MirEvent const* ev, void* context) -+MIR_HandleEvent(MirSurface* surface, MirEvent const* ev, void* context) - { -- SDL_Window* window = (SDL_Window*)context; -- switch (ev->type) { -- case (mir_event_type_key): -- HandleKeyEvent(ev->key, window); -- break; -- case (mir_event_type_motion): -- HandleMotionEvent(ev->motion, window); -- break; -- default: -- break; -+ MirEventType event_type = MIR_mir_event_get_type(ev); -+ SDL_Window* window = (SDL_Window*)context; -+ -+ if (window) { -+ switch (event_type) { -+ case (mir_event_type_input): -+ MIR_HandleInput(MIR_mir_event_get_input_event(ev), window); -+ break; -+ case (mir_event_type_resize): -+ MIR_HandleResize(MIR_mir_event_get_resize_event(ev), window); -+ break; -+ default: -+ break; -+ } - } - } - ---- a/src/video/mir/SDL_mirevents.h -+++ b/src/video/mir/SDL_mirevents.h -@@ -29,7 +29,7 @@ - #include - - extern void --MIR_HandleInput(MirSurface* surface, MirEvent const* ev, void* context); -+MIR_HandleEvent(MirSurface* surface, MirEvent const* ev, void* context); - - #endif /* _SDL_mirevents_h */ - ---- a/src/video/mir/SDL_mirframebuffer.c -+++ b/src/video/mir/SDL_mirframebuffer.c -@@ -39,7 +39,11 @@ - SDL_PIXELFORMAT_BGR888, /* mir_pixel_format_xbgr_8888 */ - SDL_PIXELFORMAT_ARGB8888, /* mir_pixel_format_argb_8888 */ - SDL_PIXELFORMAT_RGB888, /* mir_pixel_format_xrgb_8888 */ -- SDL_PIXELFORMAT_BGR24 /* mir_pixel_format_bgr_888 */ -+ SDL_PIXELFORMAT_BGR24, /* mir_pixel_format_bgr_888 */ -+ SDL_PIXELFORMAT_RGB24, /* mir_pixel_format_rgb_888 */ -+ SDL_PIXELFORMAT_RGB565, /* mir_pixel_format_rgb_565 */ -+ SDL_PIXELFORMAT_RGBA5551, /* mir_pixel_format_rgba_5551 */ -+ SDL_PIXELFORMAT_RGBA4444 /* mir_pixel_format_rgba_4444 */ - }; - - Uint32 -@@ -53,19 +57,13 @@ - void** pixels, int* pitch) - { - MIR_Data* mir_data = _this->driverdata; -- MIR_Window* mir_window; -- MirSurfaceParameters surfaceparm; - - mir_data->software = SDL_TRUE; - - if (MIR_CreateWindow(_this, window) < 0) - return SDL_SetError("Failed to created a mir window."); - -- mir_window = window->driverdata; -- -- MIR_mir_surface_get_parameters(mir_window->surface, &surfaceparm); -- -- *format = MIR_GetSDLPixelFormat(surfaceparm.pixel_format); -+ *format = MIR_GetSDLPixelFormat(mir_data->pixel_format); - if (*format == SDL_PIXELFORMAT_UNKNOWN) - return SDL_SetError("Unknown pixel format"); - -@@ -75,12 +73,6 @@ - if (*pixels == NULL) - return SDL_OutOfMemory(); - -- mir_window->surface = MIR_mir_connection_create_surface_sync(mir_data->connection, &surfaceparm); -- if (!MIR_mir_surface_is_valid(mir_window->surface)) { -- const char* error = MIR_mir_surface_get_error_message(mir_window->surface); -- return SDL_SetError("Failed to created a mir surface: %s", error); -- } -- - return 0; - } - -@@ -91,12 +83,14 @@ - MIR_Window* mir_window = window->driverdata; - - MirGraphicsRegion region; -+ MirBufferStream* bs; - int i, j, x, y, w, h, start; - int bytes_per_pixel, bytes_per_row, s_stride, d_stride; - char* s_dest; - char* pixels; - -- MIR_mir_surface_get_graphics_region(mir_window->surface, ®ion); -+ bs = MIR_mir_surface_get_buffer_stream(mir_window->surface); -+ MIR_mir_buffer_stream_get_graphics_region(bs, ®ion); - - s_dest = region.vaddr; - pixels = (char*)window->surface->pixels; -@@ -144,7 +138,7 @@ - } - } - -- MIR_mir_surface_swap_buffers_sync(mir_window->surface); -+ MIR_mir_buffer_stream_swap_buffers_sync(bs); - - return 0; - } ---- a/src/video/mir/SDL_mirmouse.c -+++ b/src/video/mir/SDL_mirmouse.c -@@ -27,13 +27,22 @@ - - #if SDL_VIDEO_DRIVER_MIR - --#include "SDL_mirmouse.h" -- - #include "../../events/SDL_mouse_c.h" -+#include "../SDL_sysvideo.h" - #include "SDL_assert.h" - - #include "SDL_mirdyn.h" - -+#include "SDL_mirvideo.h" -+#include "SDL_mirmouse.h" -+#include "SDL_mirwindow.h" -+ -+typedef struct -+{ -+ MirCursorConfiguration* conf; -+ MirBufferStream* stream; -+} MIR_Cursor; -+ - static SDL_Cursor* - MIR_CreateDefaultCursor() - { -@@ -41,6 +50,16 @@ - - cursor = SDL_calloc(1, sizeof(SDL_Cursor)); - if (cursor) { -+ -+ MIR_Cursor* mir_cursor = SDL_calloc(1, sizeof(MIR_Cursor)); -+ if (mir_cursor) { -+ mir_cursor->conf = NULL; -+ mir_cursor->stream = NULL; -+ cursor->driverdata = mir_cursor; -+ } -+ else { -+ SDL_OutOfMemory(); -+ } - } - else { - SDL_OutOfMemory(); -@@ -49,58 +68,160 @@ - return cursor; - } - -+static void -+CopySurfacePixelsToMirStream(SDL_Surface* surface, MirBufferStream* stream) -+{ -+ char* dest, *pixels; -+ int i, s_w, s_h, r_stride, p_stride, bytes_per_pixel, bytes_per_row; -+ -+ MirGraphicsRegion region; -+ MIR_mir_buffer_stream_get_graphics_region(stream, ®ion); -+ -+ s_w = surface->w; -+ s_h = surface->h; -+ -+ bytes_per_pixel = surface->format->BytesPerPixel; -+ bytes_per_row = bytes_per_pixel * s_w; -+ -+ dest = region.vaddr; -+ pixels = (char*)surface->pixels; -+ -+ r_stride = region.stride; -+ p_stride = surface->pitch; -+ -+ for (i = 0; i < s_h; i++) -+ { -+ memcpy(dest, pixels, bytes_per_row); -+ dest += r_stride; -+ pixels += p_stride; -+ } -+} -+ - static SDL_Cursor* --MIR_CreateCursor(SDL_Surface* sruface, int hot_x, int hot_y) -+MIR_CreateCursor(SDL_Surface* surface, int hot_x, int hot_y) - { -- return MIR_CreateDefaultCursor(); -+ MirCursorConfiguration* conf; -+ MirBufferStream* stream; -+ -+ int s_w = surface->w; -+ int s_h = surface->h; -+ -+ MIR_Data* mir_data = (MIR_Data*)SDL_GetVideoDevice()->driverdata; -+ SDL_Cursor* cursor = MIR_CreateDefaultCursor(); -+ MIR_Cursor* mir_cursor = (MIR_Cursor*)cursor->driverdata; -+ -+ stream = MIR_mir_connection_create_buffer_stream_sync(mir_data->connection, -+ s_w, s_h, mir_data->pixel_format, -+ mir_buffer_usage_software); -+ -+ conf = MIR_mir_cursor_configuration_from_buffer_stream(stream, hot_x, hot_y); -+ -+ CopySurfacePixelsToMirStream(surface, stream); -+ MIR_mir_buffer_stream_swap_buffers_sync(stream); -+ -+ mir_cursor->conf = conf; -+ mir_cursor->stream = stream; -+ -+ return cursor; - } - - static SDL_Cursor* - MIR_CreateSystemCursor(SDL_SystemCursor id) - { -+ char const* cursor_name = NULL; -+ MirCursorConfiguration* conf; -+ SDL_Cursor* cursor = MIR_CreateDefaultCursor(); -+ - switch(id) { - case SDL_SYSTEM_CURSOR_ARROW: -+ cursor_name = MIR_mir_arrow_cursor_name; - break; - case SDL_SYSTEM_CURSOR_IBEAM: -+ cursor_name = MIR_mir_caret_cursor_name; - break; - case SDL_SYSTEM_CURSOR_WAIT: -+ cursor_name = MIR_mir_busy_cursor_name; - break; - case SDL_SYSTEM_CURSOR_CROSSHAIR: -+ /* Unsupported */ -+ cursor_name = MIR_mir_arrow_cursor_name; - break; - case SDL_SYSTEM_CURSOR_WAITARROW: -+ cursor_name = MIR_mir_busy_cursor_name; - break; - case SDL_SYSTEM_CURSOR_SIZENWSE: -+ cursor_name = MIR_mir_omnidirectional_resize_cursor_name; - break; - case SDL_SYSTEM_CURSOR_SIZENESW: -+ cursor_name = MIR_mir_omnidirectional_resize_cursor_name; - break; - case SDL_SYSTEM_CURSOR_SIZEWE: -+ cursor_name = MIR_mir_horizontal_resize_cursor_name; - break; - case SDL_SYSTEM_CURSOR_SIZENS: -+ cursor_name = MIR_mir_vertical_resize_cursor_name; - break; - case SDL_SYSTEM_CURSOR_SIZEALL: -+ cursor_name = MIR_mir_omnidirectional_resize_cursor_name; - break; - case SDL_SYSTEM_CURSOR_NO: -+ /* Unsupported */ -+ cursor_name = MIR_mir_closed_hand_cursor_name; - break; - case SDL_SYSTEM_CURSOR_HAND: -+ cursor_name = MIR_mir_open_hand_cursor_name; - break; - default: - SDL_assert(0); - return NULL; - } - -- return MIR_CreateDefaultCursor(); -+ conf = MIR_mir_cursor_configuration_from_name(cursor_name); -+ -+ cursor->driverdata = conf; -+ -+ return cursor; - } - - static void - MIR_FreeCursor(SDL_Cursor* cursor) - { -- if (cursor) -- SDL_free(cursor); -+ if (cursor) { -+ -+ if (cursor->driverdata) { -+ MIR_Cursor* mir_cursor = (MIR_Cursor*)cursor->driverdata; -+ -+ if (mir_cursor->conf) -+ MIR_mir_cursor_configuration_destroy(mir_cursor->conf); -+ if (mir_cursor->stream) -+ MIR_mir_buffer_stream_release_sync(mir_cursor->stream); -+ -+ SDL_free(mir_cursor); -+ } -+ -+ SDL_free(cursor); -+ } - } - - static int - MIR_ShowCursor(SDL_Cursor* cursor) - { -+ MIR_Data* mir_data = (MIR_Data*)SDL_GetVideoDevice()->driverdata; -+ MIR_Window* mir_window = mir_data->current_window; -+ -+ if (cursor && cursor->driverdata) { -+ if (mir_window && MIR_mir_surface_is_valid(mir_window->surface)) { -+ MIR_Cursor* mir_cursor = (MIR_Cursor*)cursor->driverdata; -+ -+ if (mir_cursor->conf) { -+ MIR_mir_wait_for(MIR_mir_surface_configure_cursor(mir_window->surface, mir_cursor->conf)); -+ } -+ } -+ } -+ else if(mir_window && MIR_mir_surface_is_valid(mir_window->surface)) { -+ MIR_mir_wait_for(MIR_mir_surface_configure_cursor(mir_window->surface, NULL)); -+ } -+ - return 0; - } - ---- a/src/video/mir/SDL_mirsym.h -+++ b/src/video/mir/SDL_mirsym.h -@@ -23,23 +23,74 @@ - - SDL_MIR_MODULE(MIR_CLIENT) - SDL_MIR_SYM(MirDisplayConfiguration*,mir_connection_create_display_config,(MirConnection *connection)) --SDL_MIR_SYM(MirSurface *,mir_connection_create_surface_sync,(MirConnection *connection, MirSurfaceParameters const *params)) -+SDL_MIR_SYM(MirSurface *,mir_surface_create_sync,(MirSurfaceSpec* spec)) -+SDL_MIR_SYM(MirEGLNativeWindowType,mir_buffer_stream_get_egl_native_window,(MirBufferStream *surface)) -+SDL_MIR_SYM(void,mir_buffer_stream_get_graphics_region,(MirBufferStream *stream, MirGraphicsRegion *graphics_region)) -+SDL_MIR_SYM(void,mir_buffer_stream_swap_buffers_sync,(MirBufferStream *stream)) -+SDL_MIR_SYM(void,mir_surface_set_event_handler,(MirSurface *surface, mir_surface_event_callback callback, void* context)) -+SDL_MIR_SYM(MirSurfaceSpec*,mir_connection_create_spec_for_normal_surface,(MirConnection *connection, int width, int height, MirPixelFormat format)) -+SDL_MIR_SYM(MirSurfaceSpec*,mir_connection_create_spec_for_changes,(MirConnection *connection)) -+SDL_MIR_SYM(void,mir_surface_spec_set_buffer_usage,(MirSurfaceSpec *spec, MirBufferUsage usage)) -+SDL_MIR_SYM(void,mir_surface_spec_set_name,(MirSurfaceSpec *spec, char const *name)) -+SDL_MIR_SYM(void,mir_surface_spec_release,(MirSurfaceSpec *spec)) -+SDL_MIR_SYM(void,mir_surface_spec_set_width,(MirSurfaceSpec *spec, unsigned width)) -+SDL_MIR_SYM(void,mir_surface_spec_set_height,(MirSurfaceSpec *spec, unsigned height)) -+SDL_MIR_SYM(void,mir_surface_spec_set_min_width,(MirSurfaceSpec *spec, unsigned min_width)) -+SDL_MIR_SYM(void,mir_surface_spec_set_min_height,(MirSurfaceSpec *spec, unsigned min_height)) -+SDL_MIR_SYM(void,mir_surface_spec_set_max_width,(MirSurfaceSpec *spec, unsigned max_width)) -+SDL_MIR_SYM(void,mir_surface_spec_set_max_height,(MirSurfaceSpec *spec, unsigned max_height)) -+SDL_MIR_SYM(void,mir_surface_spec_set_type,(MirSurfaceSpec *spec, MirSurfaceType type)) -+SDL_MIR_SYM(void,mir_surface_spec_set_state,(MirSurfaceSpec *spec, MirSurfaceState state)) -+SDL_MIR_SYM(void,mir_surface_apply_spec,(MirSurface *surface, MirSurfaceSpec *spec)) -+SDL_MIR_SYM(void,mir_surface_get_parameters,(MirSurface *surface, MirSurfaceParameters *params)) -+SDL_MIR_SYM(MirBufferStream*,mir_surface_get_buffer_stream,(MirSurface *surface)) -+SDL_MIR_SYM(MirCursorConfiguration*,mir_cursor_configuration_from_buffer_stream,(MirBufferStream* stream, int hot_x, int hot_y)) -+SDL_MIR_SYM(MirBufferStream*,mir_connection_create_buffer_stream_sync,(MirConnection *connection, int w, int h, MirPixelFormat format, MirBufferUsage usage)) -+SDL_MIR_SYM(MirKeyboardAction,mir_keyboard_event_action,(MirKeyboardEvent const *event)) -+SDL_MIR_SYM(xkb_keysym_t,mir_keyboard_event_key_code,(MirKeyboardEvent const *event)) -+SDL_MIR_SYM(int,mir_keyboard_event_scan_code,(MirKeyboardEvent const *event)) -+SDL_MIR_SYM(bool,mir_pointer_event_button_state,(MirPointerEvent const *event, MirPointerButton button)) -+SDL_MIR_SYM(MirPointerButtons,mir_pointer_event_buttons,(MirPointerEvent const *event)) -+SDL_MIR_SYM(MirInputDeviceId,mir_input_event_get_device_id,(MirInputEvent const* ev)) -+SDL_MIR_SYM(MirTouchId,mir_touch_event_id,(MirTouchEvent const *event, size_t touch_index)) -+SDL_MIR_SYM(float,mir_touch_event_axis_value,(MirTouchEvent const *event, size_t touch_index, MirTouchAxis axis)) -+SDL_MIR_SYM(MirTouchAction,mir_touch_event_action,(MirTouchEvent const *event, size_t touch_index)) -+SDL_MIR_SYM(MirPointerAction,mir_pointer_event_action,(MirPointerEvent const *event)) -+SDL_MIR_SYM(float,mir_pointer_event_axis_value,(MirPointerEvent const *event, MirPointerAxis)) -+SDL_MIR_SYM(MirEventType,mir_event_get_type,(MirEvent const *event)) -+SDL_MIR_SYM(MirInputEventType,mir_input_event_get_type,(MirInputEvent const *event)) -+SDL_MIR_SYM(MirInputEvent const*,mir_event_get_input_event,(MirEvent const *event)) -+SDL_MIR_SYM(MirResizeEvent const*,mir_event_get_resize_event,(MirEvent const *event)) -+SDL_MIR_SYM(MirKeyboardEvent const*,mir_input_event_get_keyboard_event,(MirInputEvent const *event)) -+SDL_MIR_SYM(MirPointerEvent const*,mir_input_event_get_pointer_event,(MirInputEvent const *event)) -+SDL_MIR_SYM(MirTouchEvent const*,mir_input_event_get_touch_event,(MirInputEvent const *event)) -+SDL_MIR_SYM(unsigned int,mir_touch_event_point_count,(MirTouchEvent const *event)) - SDL_MIR_SYM(void,mir_connection_get_available_surface_formats,(MirConnection* connection, MirPixelFormat* formats, unsigned const int format_size, unsigned int *num_valid_formats)) - SDL_MIR_SYM(MirEGLNativeDisplayType,mir_connection_get_egl_native_display,(MirConnection *connection)) --SDL_MIR_SYM(MirBool,mir_connection_is_valid,(MirConnection *connection)) -+SDL_MIR_SYM(bool,mir_connection_is_valid,(MirConnection *connection)) - SDL_MIR_SYM(void,mir_connection_release,(MirConnection *connection)) -+SDL_MIR_SYM(MirPixelFormat,mir_connection_get_egl_pixel_format,(MirConnection* connection, void* egldisplay, void* eglconfig)) - SDL_MIR_SYM(MirConnection *,mir_connect_sync,(char const *server, char const *app_name)) - SDL_MIR_SYM(void,mir_display_config_destroy,(MirDisplayConfiguration* display_configuration)) --SDL_MIR_SYM(MirEGLNativeWindowType,mir_surface_get_egl_native_window,(MirSurface *surface)) - SDL_MIR_SYM(char const *,mir_surface_get_error_message,(MirSurface *surface)) --SDL_MIR_SYM(void,mir_surface_get_graphics_region,(MirSurface *surface, MirGraphicsRegion *graphics_region)) --SDL_MIR_SYM(void,mir_surface_get_parameters,(MirSurface *surface, MirSurfaceParameters *parameters)) --SDL_MIR_SYM(MirBool,mir_surface_is_valid,(MirSurface *surface)) -+SDL_MIR_SYM(bool,mir_surface_is_valid,(MirSurface *surface)) - SDL_MIR_SYM(void,mir_surface_release_sync,(MirSurface *surface)) --SDL_MIR_SYM(void,mir_surface_set_event_handler,(MirSurface *surface, MirEventDelegate const *event_handler)) --SDL_MIR_SYM(MirWaitHandle*,mir_surface_set_type,(MirSurface *surface, MirSurfaceType type)) --SDL_MIR_SYM(MirWaitHandle*,mir_surface_set_state,(MirSurface *surface, MirSurfaceState state)) --SDL_MIR_SYM(void,mir_surface_swap_buffers_sync,(MirSurface *surface)) -+SDL_MIR_SYM(void,mir_buffer_stream_release_sync,(MirBufferStream *stream)) -+SDL_MIR_SYM(MirCursorConfiguration*,mir_cursor_configuration_from_name,(char const* cursor_name)) -+SDL_MIR_SYM(MirWaitHandle*,mir_surface_configure_cursor,(MirSurface* surface, MirCursorConfiguration const* conf)) -+SDL_MIR_SYM(void,mir_cursor_configuration_destroy,(MirCursorConfiguration* conf)) -+SDL_MIR_SYM(void,mir_wait_for,(MirWaitHandle* handle)) -+SDL_MIR_SYM(int,mir_resize_event_get_width,(MirResizeEvent const* resize_event)) -+SDL_MIR_SYM(int,mir_resize_event_get_height,(MirResizeEvent const* resize_event)) -+ -+SDL_MIR_SYM_CONST(char const*,mir_omnidirectional_resize_cursor_name) -+SDL_MIR_SYM_CONST(char const*,mir_busy_cursor_name) -+SDL_MIR_SYM_CONST(char const*,mir_arrow_cursor_name) -+SDL_MIR_SYM_CONST(char const*,mir_caret_cursor_name) -+SDL_MIR_SYM_CONST(char const*,mir_vertical_resize_cursor_name) -+SDL_MIR_SYM_CONST(char const*,mir_horizontal_resize_cursor_name) -+SDL_MIR_SYM_CONST(char const*,mir_open_hand_cursor_name) -+SDL_MIR_SYM_CONST(char const*,mir_closed_hand_cursor_name) - - SDL_MIR_MODULE(XKBCOMMON) - SDL_MIR_SYM(int,xkb_keysym_to_utf8,(xkb_keysym_t keysym, char *buffer, size_t size)) ---- a/src/video/mir/SDL_mirvideo.c -+++ b/src/video/mir/SDL_mirvideo.c -@@ -27,13 +27,13 @@ - - #if SDL_VIDEO_DRIVER_MIR - -+#include "SDL_mirwindow.h" - #include "SDL_video.h" - - #include "SDL_mirframebuffer.h" - #include "SDL_mirmouse.h" - #include "SDL_miropengl.h" - #include "SDL_mirvideo.h" --#include "SDL_mirwindow.h" - - #include "SDL_mirdyn.h" - -@@ -146,29 +146,29 @@ - device->GL_GetProcAddress = MIR_GL_GetProcAddress; - - /* mirwindow */ -- device->CreateWindow = MIR_CreateWindow; -- device->DestroyWindow = MIR_DestroyWindow; -- device->GetWindowWMInfo = MIR_GetWindowWMInfo; -- device->SetWindowFullscreen = MIR_SetWindowFullscreen; -- device->MaximizeWindow = MIR_MaximizeWindow; -- device->MinimizeWindow = MIR_MinimizeWindow; -- device->RestoreWindow = MIR_RestoreWindow; -+ device->CreateWindow = MIR_CreateWindow; -+ device->DestroyWindow = MIR_DestroyWindow; -+ device->GetWindowWMInfo = MIR_GetWindowWMInfo; -+ device->SetWindowFullscreen = MIR_SetWindowFullscreen; -+ device->MaximizeWindow = MIR_MaximizeWindow; -+ device->MinimizeWindow = MIR_MinimizeWindow; -+ device->RestoreWindow = MIR_RestoreWindow; -+ device->ShowWindow = MIR_RestoreWindow; -+ device->HideWindow = MIR_HideWindow; -+ device->SetWindowSize = MIR_SetWindowSize; -+ device->SetWindowMinimumSize = MIR_SetWindowMinimumSize; -+ device->SetWindowMaximumSize = MIR_SetWindowMaximumSize; -+ device->SetWindowTitle = MIR_SetWindowTitle; - - device->CreateWindowFrom = NULL; -- device->SetWindowTitle = NULL; - device->SetWindowIcon = NULL; -- device->SetWindowPosition = NULL; -- device->SetWindowSize = NULL; -- device->SetWindowMinimumSize = NULL; -- device->SetWindowMaximumSize = NULL; -- device->ShowWindow = NULL; -- device->HideWindow = NULL; - device->RaiseWindow = NULL; - device->SetWindowBordered = NULL; - device->SetWindowGammaRamp = NULL; - device->GetWindowGammaRamp = NULL; - device->SetWindowGrab = NULL; - device->OnWindowEnter = NULL; -+ device->SetWindowPosition = NULL; - - /* mirframebuffer */ - device->CreateWindowFramebuffer = MIR_CreateWindowFramebuffer; -@@ -272,8 +272,10 @@ - { - MIR_Data* mir_data = _this->driverdata; - -- mir_data->connection = MIR_mir_connect_sync(NULL, __PRETTY_FUNCTION__); -- mir_data->software = SDL_FALSE; -+ mir_data->connection = MIR_mir_connect_sync(NULL, __PRETTY_FUNCTION__); -+ mir_data->current_window = NULL; -+ mir_data->software = SDL_FALSE; -+ mir_data->pixel_format = mir_pixel_format_invalid; - - if (!MIR_mir_connection_is_valid(mir_data->connection)) - return SDL_SetError("Failed to connect to the Mir Server"); ---- a/src/video/mir/SDL_mirvideo.h -+++ b/src/video/mir/SDL_mirvideo.h -@@ -29,11 +29,14 @@ - #include - #include - -+typedef struct MIR_Window MIR_Window; -+ - typedef struct - { - MirConnection* connection; -- SDL_bool software; -- -+ MIR_Window* current_window; -+ SDL_bool software; -+ MirPixelFormat pixel_format; - } MIR_Data; - - #endif /* _SDL_mirvideo_h_ */ ---- a/src/video/mir/SDL_mirwindow.c -+++ b/src/video/mir/SDL_mirwindow.c -@@ -46,52 +46,15 @@ - return 0; - } - --MirPixelFormat --FindValidPixelFormat(MIR_Data* mir_data) --{ -- unsigned int pf_size = 32; -- unsigned int valid_formats; -- unsigned int f; -- -- MirPixelFormat formats[pf_size]; -- MIR_mir_connection_get_available_surface_formats(mir_data->connection, formats, -- pf_size, &valid_formats); -- -- for (f = 0; f < valid_formats; f++) { -- MirPixelFormat cur_pf = formats[f]; -- -- if (cur_pf == mir_pixel_format_abgr_8888 || -- cur_pf == mir_pixel_format_xbgr_8888 || -- cur_pf == mir_pixel_format_argb_8888 || -- cur_pf == mir_pixel_format_xrgb_8888) { -- -- return cur_pf; -- } -- } -- -- return mir_pixel_format_invalid; --} -- - int - MIR_CreateWindow(_THIS, SDL_Window* window) - { - MIR_Window* mir_window; - MIR_Data* mir_data; -+ MirPixelFormat pixel_format; -+ MirBufferUsage buffer_usage; - -- MirSurfaceParameters surfaceparm = -- { -- .name = "MirSurface", -- .width = window->w, -- .height = window->h, -- .pixel_format = mir_pixel_format_invalid, -- .buffer_usage = mir_buffer_usage_hardware, -- .output_id = mir_display_output_id_invalid -- }; -- -- MirEventDelegate delegate = { -- MIR_HandleInput, -- window -- }; -+ MirSurfaceSpec* spec; - - mir_window = SDL_calloc(1, sizeof(MIR_Window)); - if (!mir_window) -@@ -100,9 +63,6 @@ - mir_data = _this->driverdata; - window->driverdata = mir_window; - -- if (mir_data->software) -- surfaceparm.buffer_usage = mir_buffer_usage_software; -- - if (window->x == SDL_WINDOWPOS_UNDEFINED) - window->x = 0; - -@@ -112,12 +72,32 @@ - mir_window->mir_data = mir_data; - mir_window->sdl_window = window; - -- surfaceparm.pixel_format = FindValidPixelFormat(mir_data); -- if (surfaceparm.pixel_format == mir_pixel_format_invalid) { -+ pixel_format = MIR_mir_connection_get_egl_pixel_format(mir_data->connection, -+ _this->egl_data->egl_display, -+ _this->egl_data->egl_config); -+ -+ mir_data->pixel_format = pixel_format; -+ if (pixel_format == mir_pixel_format_invalid) { - return SDL_SetError("Failed to find a valid pixel format."); - } - -- mir_window->surface = MIR_mir_connection_create_surface_sync(mir_data->connection, &surfaceparm); -+ buffer_usage = mir_buffer_usage_hardware; -+ if (mir_data->software) -+ buffer_usage = mir_buffer_usage_software; -+ -+ spec = MIR_mir_connection_create_spec_for_normal_surface(mir_data->connection, -+ window->w, -+ window->h, -+ pixel_format); -+ -+ MIR_mir_surface_spec_set_buffer_usage(spec, buffer_usage); -+ MIR_mir_surface_spec_set_name(spec, "Mir surface"); -+ -+ mir_window->surface = MIR_mir_surface_create_sync(spec); -+ MIR_mir_surface_set_event_handler(mir_window->surface, MIR_HandleEvent, window); -+ -+ MIR_mir_surface_spec_release(spec); -+ - if (!MIR_mir_surface_is_valid(mir_window->surface)) { - const char* error = MIR_mir_surface_get_error_message(mir_window->surface); - return SDL_SetError("Failed to created a mir surface: %s", error); -@@ -125,7 +105,8 @@ - - if (window->flags & SDL_WINDOW_OPENGL) { - EGLNativeWindowType egl_native_window = -- (EGLNativeWindowType)MIR_mir_surface_get_egl_native_window(mir_window->surface); -+ (EGLNativeWindowType)MIR_mir_buffer_stream_get_egl_native_window( -+ MIR_mir_surface_get_buffer_stream(mir_window->surface)); - - mir_window->egl_surface = SDL_EGL_CreateSurface(_this, egl_native_window); - -@@ -138,7 +119,7 @@ - mir_window->egl_surface = EGL_NO_SURFACE; - } - -- MIR_mir_surface_set_event_handler(mir_window->surface, &delegate); -+ mir_data->current_window = mir_window; - - return 0; - } -@@ -146,13 +127,15 @@ - void - MIR_DestroyWindow(_THIS, SDL_Window* window) - { -- MIR_Data* mir_data = _this->driverdata; -+ MIR_Data* mir_data = _this->driverdata; - MIR_Window* mir_window = window->driverdata; - - if (mir_data) { - SDL_EGL_DestroySurface(_this, mir_window->egl_surface); - MIR_mir_surface_release_sync(mir_window->surface); - -+ mir_data->current_window = NULL; -+ - SDL_free(mir_window); - } - window->driverdata = NULL; -@@ -180,49 +163,166 @@ - SDL_VideoDisplay* display, - SDL_bool fullscreen) - { -+ MIR_Data* mir_data = _this->driverdata; - MIR_Window* mir_window = window->driverdata; -+ MirSurfaceSpec* spec; -+ MirSurfaceState state; - - if (IsSurfaceValid(mir_window) < 0) - return; - - if (fullscreen) { -- MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_fullscreen); -+ state = mir_surface_state_fullscreen; - } else { -- MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_restored); -+ state = mir_surface_state_restored; - } -+ -+ spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection); -+ MIR_mir_surface_spec_set_state(spec, state); -+ -+ MIR_mir_surface_apply_spec(mir_window->surface, spec); -+ MIR_mir_surface_spec_release(spec); - } - - void - MIR_MaximizeWindow(_THIS, SDL_Window* window) - { -+ MIR_Data* mir_data = _this->driverdata; - MIR_Window* mir_window = window->driverdata; -+ MirSurfaceSpec* spec; - - if (IsSurfaceValid(mir_window) < 0) - return; - -- MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_maximized); -+ spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection); -+ MIR_mir_surface_spec_set_state(spec, mir_surface_state_maximized); -+ -+ MIR_mir_surface_apply_spec(mir_window->surface, spec); -+ MIR_mir_surface_spec_release(spec); - } - - void - MIR_MinimizeWindow(_THIS, SDL_Window* window) - { -+ MIR_Data* mir_data = _this->driverdata; - MIR_Window* mir_window = window->driverdata; -+ MirSurfaceSpec* spec; - - if (IsSurfaceValid(mir_window) < 0) - return; - -- MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_minimized); -+ spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection); -+ MIR_mir_surface_spec_set_state(spec, mir_surface_state_minimized); -+ -+ MIR_mir_surface_apply_spec(mir_window->surface, spec); -+ MIR_mir_surface_spec_release(spec); - } - - void - MIR_RestoreWindow(_THIS, SDL_Window * window) - { -+ MIR_Data* mir_data = _this->driverdata; -+ MIR_Window* mir_window = window->driverdata; -+ MirSurfaceSpec* spec; -+ -+ if (IsSurfaceValid(mir_window) < 0) -+ return; -+ -+ spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection); -+ MIR_mir_surface_spec_set_state(spec, mir_surface_state_restored); -+ -+ MIR_mir_surface_apply_spec(mir_window->surface, spec); -+ MIR_mir_surface_spec_release(spec); -+} -+ -+void -+MIR_HideWindow(_THIS, SDL_Window* window) -+{ -+ MIR_Data* mir_data = _this->driverdata; -+ MIR_Window* mir_window = window->driverdata; -+ MirSurfaceSpec* spec; -+ -+ if (IsSurfaceValid(mir_window) < 0) -+ return; -+ -+ spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection); -+ MIR_mir_surface_spec_set_state(spec, mir_surface_state_hidden); -+ -+ MIR_mir_surface_apply_spec(mir_window->surface, spec); -+ MIR_mir_surface_spec_release(spec); -+} -+ -+void -+MIR_SetWindowSize(_THIS, SDL_Window* window) -+{ -+ MIR_Data* mir_data = _this->driverdata; -+ MIR_Window* mir_window = window->driverdata; -+ MirSurfaceSpec* spec; -+ -+ if (IsSurfaceValid(mir_window) < 0) -+ return; -+ -+ /* You cannot set the x/y of a mir window! So only update w/h */ -+ spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection); -+ MIR_mir_surface_spec_set_width (spec, window->w); -+ MIR_mir_surface_spec_set_height(spec, window->h); -+ -+ MIR_mir_surface_apply_spec(mir_window->surface, spec); -+ MIR_mir_surface_spec_release(spec); -+} -+ -+void -+MIR_SetWindowMinimumSize(_THIS, SDL_Window* window) -+{ -+ MIR_Data* mir_data = _this->driverdata; -+ MIR_Window* mir_window = window->driverdata; -+ MirSurfaceSpec* spec; -+ -+ if (IsSurfaceValid(mir_window) < 0) -+ return; -+ -+ spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection); -+ MIR_mir_surface_spec_set_min_width (spec, window->min_w); -+ MIR_mir_surface_spec_set_min_height(spec, window->min_h); -+ -+ MIR_mir_surface_apply_spec(mir_window->surface, spec); -+ MIR_mir_surface_spec_release(spec); -+} -+ -+void -+MIR_SetWindowMaximumSize(_THIS, SDL_Window* window) -+{ -+ MIR_Data* mir_data = _this->driverdata; -+ MIR_Window* mir_window = window->driverdata; -+ MirSurfaceSpec* spec; -+ -+ if (IsSurfaceValid(mir_window) < 0) -+ return; -+ -+ spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection); -+ MIR_mir_surface_spec_set_max_width (spec, window->max_w); -+ MIR_mir_surface_spec_set_max_height(spec, window->max_h); -+ -+ MIR_mir_surface_apply_spec(mir_window->surface, spec); -+ MIR_mir_surface_spec_release(spec); -+} -+ -+void -+MIR_SetWindowTitle(_THIS, SDL_Window* window) -+{ -+ MIR_Data* mir_data = _this->driverdata; - MIR_Window* mir_window = window->driverdata; -+ char const* title = window->title ? window->title : ""; -+ MirSurfaceSpec* spec; - - if (IsSurfaceValid(mir_window) < 0) - return; - -- MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_restored); -+ spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection); -+ MIR_mir_surface_spec_set_name(spec, title); -+ -+ MIR_mir_surface_apply_spec(mir_window->surface, spec); -+ MIR_mir_surface_spec_release(spec); - } - - #endif /* SDL_VIDEO_DRIVER_MIR */ ---- a/src/video/mir/SDL_mirwindow.h -+++ b/src/video/mir/SDL_mirwindow.h -@@ -31,13 +31,13 @@ - - #include "SDL_mirvideo.h" - --typedef struct { -+struct MIR_Window { - SDL_Window* sdl_window; -- MIR_Data* mir_data; -+ MIR_Data* mir_data; - - MirSurface* surface; -- EGLSurface egl_surface; --} MIR_Window; -+ EGLSurface egl_surface; -+}; - - - extern int -@@ -60,10 +60,25 @@ - extern void - MIR_RestoreWindow(_THIS, SDL_Window* window); - -+extern void -+MIR_HideWindow(_THIS, SDL_Window* window); -+ - extern SDL_bool - MIR_GetWindowWMInfo(_THIS, SDL_Window* window, SDL_SysWMinfo* info); - --#endif /* _SDL_mirwindow_h */ -+extern void -+MIR_SetWindowSize(_THIS, SDL_Window* window); -+ -+extern void -+MIR_SetWindowMinimumSize(_THIS, SDL_Window* window); -+ -+extern void -+MIR_SetWindowMaximumSize(_THIS, SDL_Window* window); -+ -+extern void -+MIR_SetWindowTitle(_THIS, SDL_Window* window); -+ -+#endif /* _SDL_mirwindow */ - - /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/debian/patches/series b/debian/patches/series deleted file mode 100644 index 8ac487ec9..000000000 --- a/debian/patches/series +++ /dev/null @@ -1,2 +0,0 @@ -SDL2_dont_propagate_lpthread.diff -mir_new_abi_api.diff