Skip to content
Snippets Groups Projects
Select Git revision
  • master
  • caml2
  • input_conditionals
  • caml
  • cache
5 results

radio.elf

Blame
  • wl_init.c 25.05 KiB
    //========================================================================
    // GLFW 3.3 Wayland - www.glfw.org
    //------------------------------------------------------------------------
    // Copyright (c) 2014 Jonas Ådahl <jadahl@gmail.com>
    //
    // This software is provided 'as-is', without any express or implied
    // warranty. In no event will the authors be held liable for any damages
    // arising from the use of this software.
    //
    // Permission is granted to anyone to use this software for any purpose,
    // including commercial applications, and to alter it and redistribute it
    // freely, subject to the following restrictions:
    //
    // 1. The origin of this software must not be misrepresented; you must not
    //    claim that you wrote the original software. If you use this software
    //    in a product, an acknowledgment in the product documentation would
    //    be appreciated but is not required.
    //
    // 2. Altered source versions must be plainly marked as such, and must not
    //    be misrepresented as being the original software.
    //
    // 3. This notice may not be removed or altered from any source
    //    distribution.
    //
    //========================================================================
    
    #include "internal.h"
    
    #include <linux/input.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <sys/mman.h>
    #include <unistd.h>
    #include <wayland-client.h>
    #include <wayland-cursor.h>
    
    
    static inline int min(int n1, int n2)
    {
        return n1 < n2 ? n1 : n2;
    }
    
    static void pointerHandleEnter(void* data,
                                   struct wl_pointer* pointer,
                                   uint32_t serial,
                                   struct wl_surface* surface,
                                   wl_fixed_t sx,
                                   wl_fixed_t sy)
    {
        _GLFWwindow* window = wl_surface_get_user_data(surface);
    
        _glfw.wl.pointerSerial = serial;
        _glfw.wl.pointerFocus = window;
    
        _glfwPlatformSetCursor(window, window->wl.currentCursor);
        _glfwInputCursorEnter(window, GLFW_TRUE);
    }
    
    static void pointerHandleLeave(void* data,
                                   struct wl_pointer* pointer,
                                   uint32_t serial,
                                   struct wl_surface* surface)
    {
        _GLFWwindow* window = _glfw.wl.pointerFocus;
    
        if (!window)
            return;
    
        _glfw.wl.pointerSerial = serial;