godot/thirdparty/linuxbsd_headers/X11/extensions/XInput2.h

/*
 * Copyright © 2009 Red Hat, Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 *
 */

/* Definitions used by the library and client */

#ifndef _XINPUT2_H_
#define _XINPUT2_H_

#include <X11/Xlib.h>
#include <X11/extensions/XI2.h>
#include <X11/extensions/Xge.h>
#include <X11/extensions/Xfixes.h> /* PointerBarrier */

/*******************************************************************
 *
 */
XIAddMasterInfo;

XIRemoveMasterInfo;

XIAttachSlaveInfo;

XIDetachSlaveInfo;

XIAnyHierarchyChangeInfo;

XIModifierState;

XIGroupState;

XIButtonState;

XIValuatorState;


XIEventMask;

XIAnyClassInfo;

XIButtonClassInfo;

XIKeyClassInfo;

XIValuatorClassInfo;

/* new in XI 2.1 */
XIScrollClassInfo;

XITouchClassInfo;

XIDeviceInfo;

XIGrabModifiers;

BarrierEventID;

XIBarrierReleasePointerInfo;

/**
 * Generic XI2 event. All XI2 events have the same header.
 */
XIEvent;


XIHierarchyInfo;

/*
 * Notifies the client that the device hierarchy has been changed. The client
 * is expected to re-query the server for the device hierarchy.
 */
XIHierarchyEvent;

/*
 * Notifies the client that the classes have been changed. This happens when
 * the slave device that sends through the master changes.
 */
XIDeviceChangedEvent;

XIDeviceEvent;

XIRawEvent;

XIEnterEvent;

XILeaveEvent;
XIFocusInEvent;
XIFocusOutEvent;

XIPropertyEvent;

XITouchOwnershipEvent;

XIBarrierEvent;

_XFUNCPROTOBEGIN

extern Bool     XIQueryPointer(
    Display*            display,
    int                 deviceid,
    Window              win,
    Window*             root,
    Window*             child,
    double*             root_x,
    double*             root_y,
    double*             win_x,
    double*             win_y,
    XIButtonState       *buttons,
    XIModifierState     *mods,
    XIGroupState        *group
);

extern Bool     XIWarpPointer(
    Display*            display,
    int                 deviceid,
    Window              src_win,
    Window              dst_win,
    double              src_x,
    double              src_y,
    unsigned int        src_width,
    unsigned int        src_height,
    double              dst_x,
    double              dst_y
);

extern Status   XIDefineCursor(
    Display*            display,
    int                 deviceid,
    Window              win,
    Cursor              cursor
);

extern Status   XIUndefineCursor(
    Display*            display,
    int                 deviceid,
    Window              win
);

extern Status   XIChangeHierarchy(
    Display*            display,
    XIAnyHierarchyChangeInfo*  changes,
    int                 num_changes
);

extern Status   XISetClientPointer(
    Display*            dpy,
    Window              win,
    int                 deviceid
);

extern Bool     XIGetClientPointer(
    Display*            dpy,
    Window              win,
    int*                deviceid
);

extern int      XISelectEvents(
     Display*            dpy,
     Window              win,
     XIEventMask         *masks,
     int                 num_masks
);

extern XIEventMask *XIGetSelectedEvents(
     Display*            dpy,
     Window              win,
     int                 *num_masks_return
);

extern Status XIQueryVersion(
     Display*           dpy,
     int*               major_version_inout,
     int*               minor_version_inout
);

extern XIDeviceInfo* XIQueryDevice(
     Display*           dpy,
     int                deviceid,
     int*               ndevices_return
);

extern Status XISetFocus(
     Display*           dpy,
     int                deviceid,
     Window             focus,
     Time               time
);

extern Status XIGetFocus(
     Display*           dpy,
     int                deviceid,
     Window             *focus_return);

extern Status XIGrabDevice(
     Display*           dpy,
     int                deviceid,
     Window             grab_window,
     Time               time,
     Cursor             cursor,
     int                grab_mode,
     int                paired_device_mode,
     Bool               owner_events,
     XIEventMask        *mask
);

extern Status XIUngrabDevice(
     Display*           dpy,
     int                deviceid,
     Time               time
);

extern Status XIAllowEvents(
    Display*            display,
    int                 deviceid,
    int                 event_mode,
    Time                time
);

extern Status XIAllowTouchEvents(
    Display*            display,
    int                 deviceid,
    unsigned int        touchid,
    Window              grab_window,
    int                 event_mode
);

extern int XIGrabButton(
    Display*            display,
    int                 deviceid,
    int                 button,
    Window              grab_window,
    Cursor              cursor,
    int                 grab_mode,
    int                 paired_device_mode,
    int                 owner_events,
    XIEventMask         *mask,
    int                 num_modifiers,
    XIGrabModifiers     *modifiers_inout
);

extern int XIGrabKeycode(
    Display*            display,
    int                 deviceid,
    int                 keycode,
    Window              grab_window,
    int                 grab_mode,
    int                 paired_device_mode,
    int                 owner_events,
    XIEventMask         *mask,
    int                 num_modifiers,
    XIGrabModifiers     *modifiers_inout
);

extern int XIGrabEnter(
    Display*            display,
    int                 deviceid,
    Window              grab_window,
    Cursor              cursor,
    int                 grab_mode,
    int                 paired_device_mode,
    int                 owner_events,
    XIEventMask         *mask,
    int                 num_modifiers,
    XIGrabModifiers     *modifiers_inout
);

extern int XIGrabFocusIn(
    Display*            display,
    int                 deviceid,
    Window              grab_window,
    int                 grab_mode,
    int                 paired_device_mode,
    int                 owner_events,
    XIEventMask         *mask,
    int                 num_modifiers,
    XIGrabModifiers     *modifiers_inout
);

extern int XIGrabTouchBegin(
    Display*            display,
    int                 deviceid,
    Window              grab_window,
    int                 owner_events,
    XIEventMask         *mask,
    int                 num_modifiers,
    XIGrabModifiers     *modifiers_inout
);

extern Status XIUngrabButton(
    Display*            display,
    int                 deviceid,
    int                 button,
    Window              grab_window,
    int                 num_modifiers,
    XIGrabModifiers     *modifiers
);

extern Status XIUngrabKeycode(
    Display*            display,
    int                 deviceid,
    int                 keycode,
    Window              grab_window,
    int                 num_modifiers,
    XIGrabModifiers     *modifiers
);

extern Status XIUngrabEnter(
    Display*            display,
    int                 deviceid,
    Window              grab_window,
    int                 num_modifiers,
    XIGrabModifiers     *modifiers
);

extern Status XIUngrabFocusIn(
    Display*            display,
    int                 deviceid,
    Window              grab_window,
    int                 num_modifiers,
    XIGrabModifiers     *modifiers
);

extern Status XIUngrabTouchBegin(
    Display*            display,
    int                 deviceid,
    Window              grab_window,
    int                 num_modifiers,
    XIGrabModifiers     *modifiers
);

extern Atom *XIListProperties(
    Display*            display,
    int                 deviceid,
    int                 *num_props_return
);

extern void XIChangeProperty(
    Display*            display,
    int                 deviceid,
    Atom                property,
    Atom                type,
    int                 format,
    int                 mode,
    unsigned char       *data,
    int                 num_items
);

extern void
XIDeleteProperty(
    Display*            display,
    int                 deviceid,
    Atom                property
);

extern Status
XIGetProperty(
    Display*            display,
    int                 deviceid,
    Atom                property,
    long                offset,
    long                length,
    Bool                delete_property,
    Atom                type,
    Atom                *type_return,
    int                 *format_return,
    unsigned long       *num_items_return,
    unsigned long       *bytes_after_return,
    unsigned char       **data
);

extern void
XIBarrierReleasePointers(
    Display*                    display,
    XIBarrierReleasePointerInfo *barriers,
    int                         num_barriers
);

extern void
XIBarrierReleasePointer(
    Display*                    display,
    int                         deviceid,
    PointerBarrier              barrier,
    BarrierEventID              eventid
);

extern void XIFreeDeviceInfo(XIDeviceInfo       *info);

_XFUNCPROTOEND

#endif /* XINPUT2_H */