chromium/third_party/dawn/third_party/glfw/src/input.c

//========================================================================
// GLFW 3.5 - www.glfw.org
//------------------------------------------------------------------------
// Copyright (c) 2002-2006 Marcus Geelnard
// Copyright (c) 2006-2019 Camilla Löwy <[email protected]>
//
// 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 "mappings.h"

#include <assert.h>
#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>

// Internal key state used for sticky keys
#define _GLFW_STICK

// Internal constants for gamepad mapping source types
#define _GLFW_JOYSTICK_AXIS
#define _GLFW_JOYSTICK_BUTTON
#define _GLFW_JOYSTICK_HATBIT

#define GLFW_MOD_MASK

// Initializes the platform joystick API if it has not been already
//
static GLFWbool initJoysticks(void)
{}

// Finds a mapping based on joystick GUID
//
static _GLFWmapping* findMapping(const char* guid)
{}

// Checks whether a gamepad mapping element is present in the hardware
//
static GLFWbool isValidElementForJoystick(const _GLFWmapelement* e,
                                          const _GLFWjoystick* js)
{}

// Finds a mapping based on joystick GUID and verifies element indices
//
static _GLFWmapping* findValidMapping(const _GLFWjoystick* js)
{}

// Parses an SDL_GameControllerDB line and adds it to the mapping list
//
static GLFWbool parseMapping(_GLFWmapping* mapping, const char* string)
{}


//////////////////////////////////////////////////////////////////////////
//////                         GLFW event API                       //////
//////////////////////////////////////////////////////////////////////////

// Notifies shared code of a physical key event
//
void _glfwInputKey(_GLFWwindow* window, int key, int scancode, int action, int mods)
{}

// Notifies shared code of a Unicode codepoint input event
// The 'plain' parameter determines whether to emit a regular character event
//
void _glfwInputChar(_GLFWwindow* window, uint32_t codepoint, int mods, GLFWbool plain)
{}

// Notifies shared code of a scroll event
//
void _glfwInputScroll(_GLFWwindow* window, double xoffset, double yoffset)
{}

// Notifies shared code of a mouse button click event
//
void _glfwInputMouseClick(_GLFWwindow* window, int button, int action, int mods)
{}

// Notifies shared code of a cursor motion event
// The position is specified in content area relative screen coordinates
//
void _glfwInputCursorPos(_GLFWwindow* window, double xpos, double ypos)
{}

// Notifies shared code of a cursor enter/leave event
//
void _glfwInputCursorEnter(_GLFWwindow* window, GLFWbool entered)
{}

// Notifies shared code of files or directories dropped on a window
//
void _glfwInputDrop(_GLFWwindow* window, int count, const char** paths)
{}

// Notifies shared code of a joystick connection or disconnection
//
void _glfwInputJoystick(_GLFWjoystick* js, int event)
{}

// Notifies shared code of the new value of a joystick axis
//
void _glfwInputJoystickAxis(_GLFWjoystick* js, int axis, float value)
{}

// Notifies shared code of the new value of a joystick button
//
void _glfwInputJoystickButton(_GLFWjoystick* js, int button, char value)
{}

// Notifies shared code of the new value of a joystick hat
//
void _glfwInputJoystickHat(_GLFWjoystick* js, int hat, char value)
{}


//////////////////////////////////////////////////////////////////////////
//////                       GLFW internal API                      //////
//////////////////////////////////////////////////////////////////////////

// Adds the built-in set of gamepad mappings
//
void _glfwInitGamepadMappings(void)
{}

// Returns an available joystick object with arrays and name allocated
//
_GLFWjoystick* _glfwAllocJoystick(const char* name,
                                  const char* guid,
                                  int axisCount,
                                  int buttonCount,
                                  int hatCount)
{}

// Frees arrays and name and flags the joystick object as unused
//
void _glfwFreeJoystick(_GLFWjoystick* js)
{}

// Center the cursor in the content area of the specified window
//
void _glfwCenterCursorInContentArea(_GLFWwindow* window)
{}


//////////////////////////////////////////////////////////////////////////
//////                        GLFW public API                       //////
//////////////////////////////////////////////////////////////////////////

GLFWAPI int glfwGetInputMode(GLFWwindow* handle, int mode)
{}

GLFWAPI void glfwSetInputMode(GLFWwindow* handle, int mode, int value)
{}

GLFWAPI int glfwRawMouseMotionSupported(void)
{}

GLFWAPI const char* glfwGetKeyName(int key, int scancode)
{}

GLFWAPI int glfwGetKeyScancode(int key)
{}

GLFWAPI int glfwGetKey(GLFWwindow* handle, int key)
{}

GLFWAPI int glfwGetMouseButton(GLFWwindow* handle, int button)
{}

GLFWAPI void glfwGetCursorPos(GLFWwindow* handle, double* xpos, double* ypos)
{}

GLFWAPI void glfwSetCursorPos(GLFWwindow* handle, double xpos, double ypos)
{}

GLFWAPI GLFWcursor* glfwCreateCursor(const GLFWimage* image, int xhot, int yhot)
{}

GLFWAPI GLFWcursor* glfwCreateStandardCursor(int shape)
{}

GLFWAPI void glfwDestroyCursor(GLFWcursor* handle)
{}

GLFWAPI void glfwSetCursor(GLFWwindow* windowHandle, GLFWcursor* cursorHandle)
{}

GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* handle, GLFWkeyfun cbfun)
{}

GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* handle, GLFWcharfun cbfun)
{}

GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* handle, GLFWcharmodsfun cbfun)
{}

GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* handle,
                                                      GLFWmousebuttonfun cbfun)
{}

GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* handle,
                                                  GLFWcursorposfun cbfun)
{}

GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* handle,
                                                      GLFWcursorenterfun cbfun)
{}

GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* handle,
                                            GLFWscrollfun cbfun)
{}

GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* handle, GLFWdropfun cbfun)
{}

GLFWAPI int glfwJoystickPresent(int jid)
{}

GLFWAPI const float* glfwGetJoystickAxes(int jid, int* count)
{}

GLFWAPI const unsigned char* glfwGetJoystickButtons(int jid, int* count)
{}

GLFWAPI const unsigned char* glfwGetJoystickHats(int jid, int* count)
{}

GLFWAPI const char* glfwGetJoystickName(int jid)
{}

GLFWAPI const char* glfwGetJoystickGUID(int jid)
{}

GLFWAPI void glfwSetJoystickUserPointer(int jid, void* pointer)
{}

GLFWAPI void* glfwGetJoystickUserPointer(int jid)
{}

GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun cbfun)
{}

GLFWAPI int glfwUpdateGamepadMappings(const char* string)
{}

GLFWAPI int glfwJoystickIsGamepad(int jid)
{}

GLFWAPI const char* glfwGetGamepadName(int jid)
{}

GLFWAPI int glfwGetGamepadState(int jid, GLFWgamepadstate* state)
{}

GLFWAPI void glfwSetClipboardString(GLFWwindow* handle, const char* string)
{}

GLFWAPI const char* glfwGetClipboardString(GLFWwindow* handle)
{}

GLFWAPI double glfwGetTime(void)
{}

GLFWAPI void glfwSetTime(double time)
{}

GLFWAPI uint64_t glfwGetTimerValue(void)
{}

GLFWAPI uint64_t glfwGetTimerFrequency(void)
{}