<commit_before>/*
 *   2003 <NAME> <<EMAIL>>
 *     patch to make the horizontal-wheel-replacement-buttons work.
 *
 *   2002 <NAME> <<EMAIL>>
 *     patches for fast scrolling, palm detection, edge motion,
 *     horizontal scrolling
 *
 *   2002 <NAME> <<EMAIL>>
 *     for newer Firmware (5.8) protocol changes for 3rd to 6th button
 *
 *	 Copyright (C) 2001 <NAME> <<EMAIL>>
 *     start merging tpconfig and gpm code to a xfree-input modul
 *     adding some changes and extensions (ex. 3rd and 4th button)
 *
 *   Copyright (c) 1999 <NAME> <<EMAIL>> for the
 *     absolut to relative translation code (from the gpm-source)
 *     and some other ideas
 *
 *   This program is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU General Public License
 *   as published by the Free Software Foundation; either version 2
 *   of the License, or (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *
 * Trademarks are the property of their respective owners.
 *
 */


/*****************************************************************************
 *	Standard Headers
 ****************************************************************************/

#include <misc.h>
#include <xf86.h>
#define NEED_XF86_TYPES
#include <xf86_ansic.h>
#include <xf86_OSproc.h>
#include <xf86Xinput.h>
#include <xisb.h>
#include <exevents.h>			/* Needed for InitValuator/Proximity stuff	*/
#include "mipointer.h"
#ifdef XFREE_4_0_3
#include <xf86Optrec.h>  		/* needed for Options */
#endif


/*****************************************************************************
 *	Local Headers
 ****************************************************************************/
#define SYNAPTICS_PRIVATE
#include "synaptics.h"
#include "ps2comm.h"

/*****************************************************************************
 *	Variables without includable headers
 ****************************************************************************/

/*****************************************************************************
 *	Local Variables and Types
 ****************************************************************************/

typedef enum {
	BOTTOM_EDGE = 1,
	TOP_EDGE = 2,
	LEFT_EDGE = 4,
	RIGHT_EDGE = 8,
	LEFT_BOTTOM_EDGE = BOTTOM_EDGE | LEFT_EDGE,
	RIGHT_BOTTOM_EDGE = BOTTOM_EDGE | RIGHT_EDGE,
	RIGHT_TOP_EDGE = TOP_EDGE | RIGHT_EDGE,
	LEFT_TOP_EDGE = TOP_EDGE | LEFT_EDGE
} edge_type;

#define MAX(a, b) (((a)>(b))?(a):(b))
#define MIN(a, b) (((a)<(b))?(a):(b))
#define TIME_DIFF(a, b) ((long)((a)-(b)))
#define SYSCALL(call) while(((call) == -1) && (errno == EINTR))

/* for auto-dev: */
#define INP_DEV_N "N: Name=\"Synaptics Synaptics TouchPad\""
#define INP_DEV_H "H: Handlers="
#define DEV_INPUT_EVENT "/dev/input/"
#define PROC_BUS_INPUT_DEV "/proc/bus/input/devices"

#define VERSION "0.11.3p8"

/*****************************************************************************
 * Forward declaration
 ****************************************************************************/
static InputInfoPtr
SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags);


InputDriverRec SYNAPTICS = {
  1,
  "synaptics",
  NULL,
  SynapticsPreInit,
  /*SynapticsUnInit*/ NULL,
  NULL,
  0
};

#ifdef XFree86LOADER

static XF86ModuleVersionInfo VersionRec =
{
	"synaptics",
	MODULEVENDORSTRING,<commit_msg>Changed version to 0.11.3p9.<commit_after>/*
 *   2003 <NAME> <<EMAIL>>
 *     patch to make the horizontal-wheel-replacement-buttons work.
 *
 *   2002 <NAME> <<EMAIL>>
 *     patches for fast scrolling, palm detection, edge motion,
 *     horizontal scrolling
 *
 *   2002 <NAME> <<EMAIL>>
 *     for newer Firmware (5.8) protocol changes for 3rd to 6th button
 *
 *	 Copyright (C) 2001 <NAME> <<EMAIL>>
 *     start merging tpconfig and gpm code to a xfree-input modul
 *     adding some changes and extensions (ex. 3rd and 4th button)
 *
 *   Copyright (c) 1999 <NAME> <<EMAIL>> for the
 *     absolut to relative translation code (from the gpm-source)
 *     and some other ideas
 *
 *   This program is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU General Public License
 *   as published by the Free Software Foundation; either version 2
 *   of the License, or (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *
 * Trademarks are the property of their respective owners.
 *
 */


/*****************************************************************************
 *	Standard Headers
 ****************************************************************************/

#include <misc.h>
#include <xf86.h>
#define NEED_XF86_TYPES
#include <xf86_ansic.h>
#include <xf86_OSproc.h>
#include <xf86Xinput.h>
#include <xisb.h>
#include <exevents.h>			/* Needed for InitValuator/Proximity stuff	*/
#include "mipointer.h"
#ifdef XFREE_4_0_3
#include <xf86Optrec.h>  		/* needed for Options */
#endif


/*****************************************************************************
 *	Local Headers
 ****************************************************************************/
#define SYNAPTICS_PRIVATE
#include "synaptics.h"
#include "ps2comm.h"

/*****************************************************************************
 *	Variables without includable headers
 ****************************************************************************/

/*****************************************************************************
 *	Local Variables and Types
 ****************************************************************************/

typedef enum {
	BOTTOM_EDGE = 1,
	TOP_EDGE = 2,
	LEFT_EDGE = 4,
	RIGHT_EDGE = 8,
	LEFT_BOTTOM_EDGE = BOTTOM_EDGE | LEFT_EDGE,
	RIGHT_BOTTOM_EDGE = BOTTOM_EDGE | RIGHT_EDGE,
	RIGHT_TOP_EDGE = TOP_EDGE | RIGHT_EDGE,
	LEFT_TOP_EDGE = TOP_EDGE | LEFT_EDGE
} edge_type;

#define MAX(a, b) (((a)>(b))?(a):(b))
#define MIN(a, b) (((a)<(b))?(a):(b))
#define TIME_DIFF(a, b) ((long)((a)-(b)))
#define SYSCALL(call) while(((call) == -1) && (errno == EINTR))

/* for auto-dev: */
#define INP_DEV_N "N: Name=\"Synaptics Synaptics TouchPad\""
#define INP_DEV_H "H: Handlers="
#define DEV_INPUT_EVENT "/dev/input/"
#define PROC_BUS_INPUT_DEV "/proc/bus/input/devices"

#define VERSION "0.11.3p9"

/*****************************************************************************
 * Forward declaration
 ****************************************************************************/
static InputInfoPtr
SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags);


InputDriverRec SYNAPTICS = {
  1,
  "synaptics",
  NULL,
  SynapticsPreInit,
  /*SynapticsUnInit*/ NULL,
  NULL,
  0
};

#ifdef XFree86LOADER

static XF86ModuleVersionInfo VersionRec =
{
	"synaptics",
	MODULEVENDORSTRING,
{'fraction_non_alphanumeric': 0.2941643509329099, 'fraction_numerical': 0.01839354241100966, 'mean_word_length': 4.955870764381403, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3040068', 'n_tokens_mistral': 2376, 'n_tokens_neox': 2171, 'n_words': 676}