summaryrefslogtreecommitdiff
path: root/Source/DirectFB/inputdrivers/ps2mouse
diff options
context:
space:
mode:
Diffstat (limited to 'Source/DirectFB/inputdrivers/ps2mouse')
-rwxr-xr-xSource/DirectFB/inputdrivers/ps2mouse/Makefile.am31
-rwxr-xr-xSource/DirectFB/inputdrivers/ps2mouse/Makefile.in594
-rwxr-xr-xSource/DirectFB/inputdrivers/ps2mouse/ps2mouse.c576
3 files changed, 1201 insertions, 0 deletions
diff --git a/Source/DirectFB/inputdrivers/ps2mouse/Makefile.am b/Source/DirectFB/inputdrivers/ps2mouse/Makefile.am
new file mode 100755
index 0000000..30915f8
--- /dev/null
+++ b/Source/DirectFB/inputdrivers/ps2mouse/Makefile.am
@@ -0,0 +1,31 @@
+## Makefile.am for DirectFB/inputdrivers/ps2mouse
+
+INCLUDES = \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/lib \
+ -I$(top_builddir)/lib \
+ -I$(top_srcdir)/src
+
+ps2mouse_LTLIBRARIES = libdirectfb_ps2mouse.la
+
+if BUILD_STATIC
+ps2mouse_DATA = $(ps2mouse_LTLIBRARIES:.la=.o)
+endif
+
+ps2mousedir = $(MODULEDIR)/inputdrivers
+
+libdirectfb_ps2mouse_la_SOURCES = \
+ ps2mouse.c
+
+libdirectfb_ps2mouse_la_LDFLAGS = \
+ -module \
+ -avoid-version \
+ $(DFB_LDFLAGS)
+
+libdirectfb_ps2mouse_la_LIBADD = \
+ $(top_builddir)/lib/direct/libdirect.la \
+ $(top_builddir)/src/libdirectfb.la
+
+
+include $(top_srcdir)/rules/libobject.make
+
diff --git a/Source/DirectFB/inputdrivers/ps2mouse/Makefile.in b/Source/DirectFB/inputdrivers/ps2mouse/Makefile.in
new file mode 100755
index 0000000..8ee00f3
--- /dev/null
+++ b/Source/DirectFB/inputdrivers/ps2mouse/Makefile.in
@@ -0,0 +1,594 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(top_srcdir)/rules/libobject.make
+subdir = inputdrivers/ps2mouse
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(ps2mousedir)" \
+ "$(DESTDIR)$(ps2mousedir)"
+ps2mouseLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(ps2mouse_LTLIBRARIES)
+libdirectfb_ps2mouse_la_DEPENDENCIES = \
+ $(top_builddir)/lib/direct/libdirect.la \
+ $(top_builddir)/src/libdirectfb.la
+am_libdirectfb_ps2mouse_la_OBJECTS = ps2mouse.lo
+libdirectfb_ps2mouse_la_OBJECTS = \
+ $(am_libdirectfb_ps2mouse_la_OBJECTS)
+libdirectfb_ps2mouse_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(libdirectfb_ps2mouse_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(libdirectfb_ps2mouse_la_SOURCES)
+DIST_SOURCES = $(libdirectfb_ps2mouse_la_SOURCES)
+ps2mouseDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(ps2mouse_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+ASFLAGS = @ASFLAGS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATADIR = @DATADIR@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@
+DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@
+DFB_LDFLAGS = @DFB_LDFLAGS@
+DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@
+DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@
+DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@
+DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@
+DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@
+DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@
+DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@
+DIRECTFB_VERSION = @DIRECTFB_VERSION@
+DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@
+DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@
+DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@
+DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@
+DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@
+DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@
+DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@
+DSYMUTIL = @DSYMUTIL@
+DYNLIB = @DYNLIB@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
+FREETYPE_LIBS = @FREETYPE_LIBS@
+FREETYPE_PROVIDER = @FREETYPE_PROVIDER@
+FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@
+FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@
+FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@
+GIF_PROVIDER = @GIF_PROVIDER@
+GREP = @GREP@
+HAVE_LINUX = @HAVE_LINUX@
+INCLUDEDIR = @INCLUDEDIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@
+JPEG_PROVIDER = @JPEG_PROVIDER@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBJPEG = @LIBJPEG@
+LIBOBJS = @LIBOBJS@
+LIBPNG = @LIBPNG@
+LIBPNG_CONFIG = @LIBPNG_CONFIG@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_BINARY = @LT_BINARY@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MAN2HTML = @MAN2HTML@
+MKDIR_P = @MKDIR_P@
+MODULEDIR = @MODULEDIR@
+MODULEDIRNAME = @MODULEDIRNAME@
+NMEDIT = @NMEDIT@
+OBJEXT = @OBJEXT@
+OSX_LIBS = @OSX_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PKG_CONFIG = @PKG_CONFIG@
+PNG_PROVIDER = @PNG_PROVIDER@
+RANLIB = @RANLIB@
+RUNTIME_SYSROOT = @RUNTIME_SYSROOT@
+SDL_CFLAGS = @SDL_CFLAGS@
+SDL_LIBS = @SDL_LIBS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOPATH = @SOPATH@
+STRIP = @STRIP@
+SYSCONFDIR = @SYSCONFDIR@
+SYSFS_LIBS = @SYSFS_LIBS@
+THREADFLAGS = @THREADFLAGS@
+THREADLIB = @THREADLIB@
+TSLIB_CFLAGS = @TSLIB_CFLAGS@
+TSLIB_LIBS = @TSLIB_LIBS@
+VERSION = @VERSION@
+VNC_CFLAGS = @VNC_CFLAGS@
+VNC_CONFIG = @VNC_CONFIG@
+VNC_LIBS = @VNC_LIBS@
+X11_CFLAGS = @X11_CFLAGS@
+X11_LIBS = @X11_LIBS@
+ZLIB_LIBS = @ZLIB_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/lib \
+ -I$(top_builddir)/lib \
+ -I$(top_srcdir)/src
+
+ps2mouse_LTLIBRARIES = libdirectfb_ps2mouse.la
+@BUILD_STATIC_TRUE@ps2mouse_DATA = $(ps2mouse_LTLIBRARIES:.la=.o)
+ps2mousedir = $(MODULEDIR)/inputdrivers
+libdirectfb_ps2mouse_la_SOURCES = \
+ ps2mouse.c
+
+libdirectfb_ps2mouse_la_LDFLAGS = \
+ -module \
+ -avoid-version \
+ $(DFB_LDFLAGS)
+
+libdirectfb_ps2mouse_la_LIBADD = \
+ $(top_builddir)/lib/direct/libdirect.la \
+ $(top_builddir)/src/libdirectfb.la
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu inputdrivers/ps2mouse/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu inputdrivers/ps2mouse/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ps2mouseLTLIBRARIES: $(ps2mouse_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(ps2mousedir)" || $(MKDIR_P) "$(DESTDIR)$(ps2mousedir)"
+ @list='$(ps2mouse_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(ps2mouseLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(ps2mousedir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(ps2mouseLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(ps2mousedir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-ps2mouseLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(ps2mouse_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(ps2mousedir)/$$p'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(ps2mousedir)/$$p"; \
+ done
+
+clean-ps2mouseLTLIBRARIES:
+ -test -z "$(ps2mouse_LTLIBRARIES)" || rm -f $(ps2mouse_LTLIBRARIES)
+ @list='$(ps2mouse_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libdirectfb_ps2mouse.la: $(libdirectfb_ps2mouse_la_OBJECTS) $(libdirectfb_ps2mouse_la_DEPENDENCIES)
+ $(libdirectfb_ps2mouse_la_LINK) -rpath $(ps2mousedir) $(libdirectfb_ps2mouse_la_OBJECTS) $(libdirectfb_ps2mouse_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ps2mouse.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-ps2mouseDATA: $(ps2mouse_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(ps2mousedir)" || $(MKDIR_P) "$(DESTDIR)$(ps2mousedir)"
+ @list='$(ps2mouse_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(ps2mouseDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(ps2mousedir)/$$f'"; \
+ $(ps2mouseDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(ps2mousedir)/$$f"; \
+ done
+
+uninstall-ps2mouseDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(ps2mouse_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(ps2mousedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(ps2mousedir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(ps2mousedir)" "$(DESTDIR)$(ps2mousedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ps2mouseLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-ps2mouseDATA install-ps2mouseLTLIBRARIES
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-ps2mouseDATA uninstall-ps2mouseLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-ps2mouseLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-ps2mouseDATA install-ps2mouseLTLIBRARIES install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-ps2mouseDATA \
+ uninstall-ps2mouseLTLIBRARIES
+
+%.o: .libs/%.a %.la
+ rm -f $<.tmp/*.o
+ if test -d $<.tmp; then rmdir $<.tmp; fi
+ mkdir $<.tmp
+ (cd $<.tmp && $(AR) x ../../$<)
+ $(LD) -o $@ -r $<.tmp/*.o
+ rm -f $<.tmp/*.o && rmdir $<.tmp
+
+.PHONY: $(LTLIBRARIES:%.la=.libs/%.a)
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Source/DirectFB/inputdrivers/ps2mouse/ps2mouse.c b/Source/DirectFB/inputdrivers/ps2mouse/ps2mouse.c
new file mode 100755
index 0000000..5b0fe2d
--- /dev/null
+++ b/Source/DirectFB/inputdrivers/ps2mouse/ps2mouse.c
@@ -0,0 +1,576 @@
+/*
+ (c) Copyright 2001-2009 The world wide DirectFB Open Source Community (directfb.org)
+ (c) Copyright 2000-2004 Convergence (integrated media) GmbH
+
+ All rights reserved.
+
+ Written by Denis Oliver Kropp <dok@directfb.org>,
+ Andreas Hundt <andi@fischlustig.de>,
+ Sven Neumann <neo@directfb.org>,
+ Ville Syrjälä <syrjala@sci.fi> and
+ Claudio Ciccani <klan@users.sf.net>.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include <config.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include <fcntl.h>
+
+#include <termios.h>
+
+#include <sys/utsname.h>
+
+#include <directfb.h>
+
+#include <core/coredefs.h>
+#include <core/coretypes.h>
+
+#include <core/input.h>
+#include <core/system.h>
+
+#include <misc/conf.h>
+
+#include <direct/debug.h>
+#include <direct/mem.h>
+#include <direct/messages.h>
+#include <direct/thread.h>
+#include <direct/util.h>
+
+#include <core/input_driver.h>
+
+
+DFB_INPUT_DRIVER( ps2mouse )
+
+
+/* Stolen from the linux kernel (pc_keyb.h) */
+#define PS2_SET_RES 0xE8 /* Set resolution */
+#define PS2_SET_SCALE11 0xE6 /* Set 1:1 scaling */
+#define PS2_SET_SCALE21 0xE7 /* Set 2:1 scaling */
+#define PS2_GET_SCALE 0xE9 /* Get scaling factor */
+#define PS2_SET_STREAM 0xEA /* Set stream mode */
+#define PS2_SET_SAMPLE 0xF3 /* Set sample rate */
+#define PS2_ENABLE_DEV 0xF4 /* Enable aux device */
+#define PS2_DISABLE_DEV 0xF5 /* Disable aux device */
+#define PS2_RESET 0xFF /* Reset aux device */
+#define PS2_ACK 0xFA /* Command byte ACK */
+
+/*** mouse commands ***/
+
+#define PS2_SEND_ID 0xF2
+#define PS2_ID_ERROR -1
+#define PS2_ID_PS2 0
+#define PS2_ID_IMPS2 3
+
+static int ndev;
+static const char *devlist[8];
+
+typedef struct {
+ int fd;
+ CoreInputDevice *device;
+ DirectThread *thread;
+
+ int mouseId;
+ int packetLength;
+
+ int dx;
+ int dy;
+} PS2MouseData;
+
+
+static void
+flush_xy( PS2MouseData *data )
+{
+ DFBInputEvent evt;
+
+ if (data->dx) {
+ evt.type = DIET_AXISMOTION;
+ evt.flags = DIEF_AXISREL;
+ evt.axis = DIAI_X;
+ evt.axisrel = data->dx;
+
+ /* Signal immediately following event. */
+ if (data->dy)
+ evt.flags |= DIEF_FOLLOW;
+
+ dfb_input_dispatch( data->device, &evt );
+
+ data->dx = 0;
+ }
+
+ if (data->dy) {
+ evt.type = DIET_AXISMOTION;
+ evt.flags = DIEF_AXISREL;
+ evt.axis = DIAI_Y;
+ evt.axisrel = data->dy;
+
+ dfb_input_dispatch( data->device, &evt );
+
+ data->dy = 0;
+ }
+}
+
+static void*
+ps2mouseEventThread( DirectThread *thread, void *driver_data )
+{
+ PS2MouseData *data = (PS2MouseData*) driver_data;
+
+ unsigned char packet[4];
+ unsigned char pos = 0;
+ unsigned char last_buttons = 0;
+
+ int readlen;
+ unsigned char buf[256];
+
+
+ while ( (readlen = read(data->fd, buf, 256)) > 0 ) {
+ int i;
+
+ direct_thread_testcancel( thread );
+
+ for ( i = 0; i < readlen; i++ ) {
+
+ if ( pos == 0 && (buf[i] & 0xc0) ) {
+ continue;
+ }
+ packet[pos++] = buf[i];
+ if ( pos == data->packetLength ) {
+ int dx, dy, dz;
+ int buttons;
+
+ pos = 0;
+
+ if ( !(packet[0] & 0x08) ) {
+ /* We've lost sync! */
+ i--; /* does this make sense? oh well,
+ it will resync eventually (will it ?)*/
+ continue;
+ }
+
+ buttons = packet[0] & 0x07;
+ dx = (packet[0] & 0x10) ? packet[1]-256 : packet[1];
+ dy = (packet[0] & 0x20) ? -(packet[2]-256) : -packet[2];
+ if (data->mouseId == PS2_ID_IMPS2) {
+ /* Just strip off the extra buttons if present
+ and sign extend the 4 bit value */
+ dz = (s8)((packet[3] & 0x80) ?
+ packet[3] | 0xf0 : packet[3] & 0x0F);
+ if (dz) {
+ DFBInputEvent evt;
+
+ evt.type = DIET_AXISMOTION;
+ evt.flags = DIEF_AXISREL;
+ evt.axis = DIAI_Z;
+ evt.axisrel = dz;
+
+ flush_xy( data );
+
+ dfb_input_dispatch( data->device, &evt );
+ }
+ }
+ else {
+ dz = 0;
+ }
+
+ data->dx += dx;
+ data->dy += dy;
+
+ if ( !dfb_config->mouse_motion_compression )
+ flush_xy( data );
+
+ if ( last_buttons != buttons ) {
+ DFBInputEvent evt;
+ unsigned char changed_buttons;
+
+ changed_buttons = last_buttons ^ buttons;
+
+ /* make sure the compressed motion event is dispatched
+ before any button change */
+ flush_xy( data );
+
+ if ( changed_buttons & 0x01 ) {
+ evt.type = (buttons & 0x01) ?
+ DIET_BUTTONPRESS : DIET_BUTTONRELEASE;
+ evt.flags = DIEF_NONE;
+ evt.button = DIBI_LEFT;
+ dfb_input_dispatch( data->device, &evt );
+ }
+ if ( changed_buttons & 0x02 ) {
+ evt.type = (buttons & 0x02) ?
+ DIET_BUTTONPRESS : DIET_BUTTONRELEASE;
+ evt.flags = DIEF_NONE;
+ evt.button = DIBI_RIGHT;
+ dfb_input_dispatch( data->device, &evt );
+ }
+ if ( changed_buttons & 0x04 ) {
+ evt.type = (buttons & 0x04) ?
+ DIET_BUTTONPRESS : DIET_BUTTONRELEASE;
+ evt.flags = DIEF_NONE;
+ evt.button = DIBI_MIDDLE;
+ dfb_input_dispatch( data->device, &evt );
+ }
+
+ last_buttons = buttons;
+ }
+ }
+ }
+ /* make sure the compressed motion event is dispatched,
+ necessary if the last packet was a motion event */
+ flush_xy( data );
+ }
+
+ if ( readlen <= 0 && errno != EINTR )
+ D_PERROR ("psmouse thread died\n");
+
+ return NULL;
+}
+
+
+static int
+ps2WriteChar( int fd, unsigned char c, bool verbose )
+{
+ struct timeval tv;
+ fd_set fds;
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 200000; /* timeout 200 ms */
+
+ FD_ZERO( &fds );
+ FD_SET( fd, &fds );
+
+ write( fd, &c, 1 );
+
+ if ( select(fd+1, &fds, NULL, NULL, &tv) == 0 ) {
+ if ( verbose )
+ D_ERROR( "DirectFB/PS2Mouse: timeout waiting for ack!!\n" );
+ return -1;
+ }
+
+ read( fd, &c, 1 );
+
+ if ( c != PS2_ACK )
+ return -2;
+
+ return 0;
+}
+
+
+static int
+ps2GetId( int fd, bool verbose )
+{
+ unsigned char c;
+
+ if ( ps2WriteChar(fd, PS2_SEND_ID, verbose) < 0 )
+ return PS2_ID_ERROR;
+
+ read( fd, &c, 1 );
+
+ return( c );
+}
+
+
+static int
+ps2Write( int fd, const unsigned char *data, size_t len, bool verbose)
+{
+ size_t i;
+ int error = 0;
+
+ for ( i = 0; i < len; i++ ) {
+ if ( ps2WriteChar(fd, data[i], verbose) < 0 ) {
+ if ( verbose )
+ D_ERROR( "DirectFB/PS2Mouse: error @byte %zu\n", i );
+ error++;
+ }
+ }
+
+ if ( error && verbose )
+ D_ERROR( "DirectFB/PS2Mouse: missed %i ack's!\n", error);
+
+ return( error );
+}
+
+
+static int
+init_ps2( int fd, bool verbose )
+{
+ static const unsigned char basic_init[] =
+ { PS2_ENABLE_DEV, PS2_SET_SAMPLE, 100 };
+ static const unsigned char imps2_init[] =
+ { PS2_SET_SAMPLE, 200, PS2_SET_SAMPLE, 100, PS2_SET_SAMPLE, 80 };
+ static const unsigned char ps2_init[] =
+ { PS2_SET_SCALE11, PS2_ENABLE_DEV, PS2_SET_SAMPLE, 100, PS2_SET_RES, 3 };
+ int mouseId;
+
+ struct timeval tv;
+ fd_set fds;
+ int count = 100;
+
+ /* read all data from the file descriptor before initializing the mouse */
+ while (true) {
+ unsigned char buf[64];
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 50000; /* timeout 1/50 sec */
+
+ FD_ZERO( &fds );
+ FD_SET( fd, &fds );
+
+ if (select( fd+1, &fds, NULL, NULL, &tv ))
+ read( fd, buf, sizeof(buf) );
+ else
+ break;
+
+ if (! --count) {
+ D_ERROR( "DirectFB/PS2Mouse: "
+ "PS/2 mouse keeps sending data, "
+ "initialization failed\n" );
+ return -1;
+ }
+ }
+
+ ps2Write( fd, basic_init, sizeof (basic_init), verbose );
+ /* Do a basic init in case the mouse is confused */
+ if (ps2Write( fd, basic_init, sizeof (basic_init), verbose ) != 0) {
+ if (verbose)
+ D_ERROR( "DirectFB/PS2Mouse: PS/2 mouse failed init\n" );
+ return -1;
+ }
+
+ ps2Write( fd, ps2_init, sizeof (ps2_init), verbose );
+
+ if (ps2Write(fd, imps2_init, sizeof (imps2_init), verbose) != 0) {
+ if (verbose)
+ D_ERROR ("DirectFB/PS2Mouse: mouse failed IMPS/2 init\n");
+ return -2;
+ }
+
+ if ((mouseId = ps2GetId( fd, verbose )) < 0)
+ return mouseId;
+
+ if ( mouseId != PS2_ID_IMPS2 ) /* unknown id, assume PS/2 */
+ mouseId = PS2_ID_PS2;
+
+ return mouseId;
+}
+
+/**************************************************************************************************/
+
+static void
+check_devices( const char *devnames[], int num )
+{
+ int i, fd;
+
+ for (i=0; i<num; i++) {
+ if ((fd = open( devnames[i], O_RDWR | O_SYNC )) < 0)
+ continue;
+
+ if (init_ps2( fd, false ) < 0) {
+ close( fd );
+ continue;
+ }
+
+ devlist[ndev++] = devnames[i];
+
+ close( fd );
+
+ break;
+ }
+}
+
+#define CHECK_DEVICES(n) check_devices( n, D_ARRAY_SIZE(n) )
+
+/**************************************************************************************************/
+
+static const char *dev_psaux[2] = { "/dev/psaux", "/dev/misc/psaux" };
+static const char *dev_input[1] = { "/dev/input/mice" };
+
+/**************************************************************************************************/
+
+static int
+driver_get_available( void )
+{
+ struct utsname uts;
+ bool check_psaux = true;
+ bool check_input = true;
+
+ if (dfb_system_type() != CORE_FBDEV)
+ return 0;
+
+ if (dfb_config->mouse_protocol &&
+ (strcasecmp( dfb_config->mouse_protocol, "PS/2") == 0 ||
+ strcasecmp( dfb_config->mouse_protocol, "IMPS/2") == 0))
+ {
+ int fd = open( dfb_config->mouse_source, O_RDONLY | O_NONBLOCK );
+
+ if (fd < 0) {
+ D_PERROR( "DirectFB/PS2Mouse: opening %s failed!\n",
+ dfb_config->mouse_source );
+ return 0;
+ }
+
+ devlist[0] = dfb_config->mouse_source;
+ close( fd );
+ return 1;
+ }
+
+ if (uname( &uts ) < 0)
+ D_PERROR( "DirectFB/PS2Mouse: uname() failed!\n" );
+ else if (!strncmp( uts.release, "2.6.", 4 ) || !strncmp( uts.release, "2.5.", 4 ))
+ check_psaux = false;
+
+ if (check_psaux)
+ CHECK_DEVICES( dev_psaux );
+
+ if (check_input)
+ CHECK_DEVICES( dev_input );
+
+ return ndev;
+}
+
+static void
+driver_get_info( InputDriverInfo *info )
+{
+ /* fill driver info structure */
+ snprintf( info->name,
+ DFB_INPUT_DRIVER_INFO_NAME_LENGTH, "PS/2 Mouse Driver" );
+
+ snprintf( info->vendor,
+ DFB_INPUT_DRIVER_INFO_VENDOR_LENGTH, "directfb.org" );
+
+ info->version.major = 1;
+ info->version.minor = 0;
+}
+
+static DFBResult
+driver_open_device( CoreInputDevice *device,
+ unsigned int number,
+ InputDeviceInfo *info,
+ void **driver_data )
+{
+ int fd;
+ int mouseId = -1;
+ int flags;
+ PS2MouseData *data;
+
+ /* open device */
+
+ flags = (dfb_config->mouse_gpm_source)
+ ? (O_RDONLY | O_NONBLOCK)
+ : (O_RDWR | O_SYNC | O_EXCL);
+
+ fd = open( devlist[number], flags );
+ if (fd < 0) {
+ D_PERROR( "DirectFB/PS2Mouse: failed opening `%s' !\n",
+ devlist[number] );
+ close( fd );
+ return DFB_INIT;
+ }
+
+ fcntl( fd, F_SETFL, fcntl ( fd, F_GETFL ) & ~O_NONBLOCK );
+
+ if (!dfb_config->mouse_gpm_source) {
+ mouseId = init_ps2( fd, true );
+
+ if (mouseId < 0) {
+ D_PERROR( "DirectFB/PS2Mouse: could not initialize mouse on `%s'!\n",
+ devlist[number] );
+ close( fd );
+ return DFB_INIT;
+ }
+ }
+
+ if (dfb_config->mouse_protocol) {
+ if (strcasecmp( dfb_config->mouse_protocol, "IMPS/2" ) == 0) {
+ mouseId = PS2_ID_IMPS2;
+ }
+ else if (strcasecmp( dfb_config->mouse_protocol, "PS/2" ) == 0) {
+ mouseId = PS2_ID_PS2;
+ }
+ else {
+ D_ERROR( "DirectFB/PS2Mouse: unsupported protocol `%s' !\n",
+ dfb_config->mouse_protocol );
+ close( fd );
+ return DFB_INIT;
+ }
+ }
+
+ /* fill device info structure */
+ snprintf( info->desc.name, DFB_INPUT_DEVICE_DESC_NAME_LENGTH,
+ (mouseId == PS2_ID_IMPS2) ? "IMPS/2 Mouse" : "PS/2 Mouse" );
+
+ snprintf( info->desc.vendor,
+ DFB_INPUT_DEVICE_DESC_VENDOR_LENGTH, "Unknown" );
+
+ info->prefered_id = DIDID_MOUSE;
+ info->desc.type = DIDTF_MOUSE;
+ info->desc.caps = DICAPS_AXES | DICAPS_BUTTONS;
+ info->desc.max_axis = (mouseId == PS2_ID_IMPS2) ? DIAI_Z : DIAI_Y;
+ info->desc.max_button = DIBI_MIDDLE; /* TODO: probe!? */
+
+ /* allocate and fill private data */
+ data = D_CALLOC( 1, sizeof(PS2MouseData) );
+ if (!data) {
+ close( fd );
+ return D_OOM();
+ }
+
+ data->fd = fd;
+ data->device = device;
+ data->mouseId = mouseId;
+ data->packetLength = (mouseId == PS2_ID_IMPS2) ? 4 : 3;
+
+ /* start input thread */
+ data->thread = direct_thread_create( DTT_INPUT, ps2mouseEventThread, data, "PS/2 Input" );
+
+ /* set private data pointer */
+ *driver_data = data;
+
+ return DFB_OK;
+}
+
+/*
+ * Fetch one entry from the device's keymap if supported.
+ */
+static DFBResult
+driver_get_keymap_entry( CoreInputDevice *device,
+ void *driver_data,
+ DFBInputDeviceKeymapEntry *entry )
+{
+ return DFB_UNSUPPORTED;
+}
+
+static void
+driver_close_device( void *driver_data )
+{
+ PS2MouseData *data = (PS2MouseData*) driver_data;
+
+ /* stop input thread */
+ direct_thread_cancel( data->thread );
+ direct_thread_join( data->thread );
+ direct_thread_destroy( data->thread );
+
+ /* close device */
+ close( data->fd );
+
+ /* free private data */
+ D_FREE( data );
+}