From f4e63994080d661563065d4d705fae9f96f3b810 Mon Sep 17 00:00:00 2001 From: gambas Date: Thu, 28 Feb 2019 19:42:36 +0100 Subject: [PATCH] Add a new void component 'gb.input'. --- Makefile.am | 1 + TEMPLATE/conf/gb.input.conf | 79 ++++++++++++++++++++++++++++++++ TEMPLATE/template/make-component | 2 +- configure.ac | 1 + gb.input/AUTHORS | 0 gb.input/COPYING | 1 + gb.input/ChangeLog | 0 gb.input/INSTALL | 1 + gb.input/Makefile.am | 3 ++ gb.input/NEWS | 0 gb.input/README | 0 gb.input/acinclude.m4 | 1 + gb.input/component.am | 1 + gb.input/configure.ac | 14 ++++++ gb.input/gambas.h | 1 + gb.input/gb_common.h | 1 + gb.input/m4 | 1 + gb.input/reconf | 1 + gb.input/src/Makefile.am | 7 +++ gb.input/src/evdev.c | 28 +++++++++++ gb.input/src/evdev.h | 35 ++++++++++++++ gb.input/src/gb.input.component | 3 ++ gb.input/src/main.c | 28 +++++++++++ gb.input/src/main.h | 35 ++++++++++++++ 24 files changed, 243 insertions(+), 1 deletion(-) create mode 100644 TEMPLATE/conf/gb.input.conf create mode 100644 gb.input/AUTHORS create mode 120000 gb.input/COPYING create mode 100644 gb.input/ChangeLog create mode 120000 gb.input/INSTALL create mode 100644 gb.input/Makefile.am create mode 100644 gb.input/NEWS create mode 100644 gb.input/README create mode 120000 gb.input/acinclude.m4 create mode 120000 gb.input/component.am create mode 100644 gb.input/configure.ac create mode 120000 gb.input/gambas.h create mode 120000 gb.input/gb_common.h create mode 120000 gb.input/m4 create mode 120000 gb.input/reconf create mode 100644 gb.input/src/Makefile.am create mode 100644 gb.input/src/evdev.c create mode 100644 gb.input/src/evdev.h create mode 100644 gb.input/src/gb.input.component create mode 100644 gb.input/src/main.c create mode 100644 gb.input/src/main.h diff --git a/Makefile.am b/Makefile.am index 62ab6c6b7..814af3a0c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -37,6 +37,7 @@ SUBDIRS = \ @httpd_dir@ \ @openssl_dir@ \ @openal_dir@ \ + @input_dir@ \ comp \ app \ . diff --git a/TEMPLATE/conf/gb.input.conf b/TEMPLATE/conf/gb.input.conf new file mode 100644 index 000000000..59f0c9f46 --- /dev/null +++ b/TEMPLATE/conf/gb.input.conf @@ -0,0 +1,79 @@ +/* Copyrights */ +#define __COPYRIGHT (c) +#define __AUTHOR Joe Smith +#define __EMAIL + +/* Name of the component */ +#define __COMPONENT gb.input + +/* Name of the component with points replaced by dashes */ +#define __COMPONENT_DASH gb-input + +/* Name of the component with points replaced by underscore */ +#define __COMPONENT_UNDERSCORE gb_input + +/* Short name of the component */ +#define __NAME input + +/* Short name of the component in uppercase */ +#define __UNAME INPUT + +/* Description of the component */ +#define __DESCRIPTION Input device management + +/* If the component detection uses pkg-config */ +#define __USE_PKGCONFIG 1 + +#if __USE_PKGCONFIG + + /* Name of the package for pkg-config */ + #define __PKGCONFIG_NAME libevdev + + /* Minimum version needed */ + //#define __PKGCONFIG_VERSION 1.2.8 + +#else /* __USE_PKGCONFIG */ + + /* If your component uses C */ + #define __USE_C 1 + + /* If your component uses C++ */ + #define __USE_CPLUSPLUS 0 + + /* If your component uses multi-threading */ + #define __USE_THREAD 0 + + /* If your component uses X-Window */ + #define __USE_XWINDOW 0 + + /* Includes to search for */ + #define __SEARCH_INCLUDE + + /* Includes directories search path */ + #define __SEARCH_INCLUDE_PATH + + /* Includes sub-directories search */ + #define __SEARCH_INCLUDE_DIR + + /* Libraries to search for */ + #define __SEARCH_LIBRARY + + /* Libraries directories search path */ + #define __SEARCH_LIBRARY_PATH + + /* Libraries sub-directories search path */ + #define __SEARCH_LIBRARY_DIR + + /* Libraries to link with */ + #define __LIBRARY + + /* Includes to link with */ + #define __INCLUDE + +#endif /* __USE_PKGCONFIG */ + +/* Source file list */ +#define __SOURCES main.c main.h evdev.c evdev.h + +/* Main C/C++ source basename in uppercase */ +#define __MAIN_UNAME MAIN diff --git a/TEMPLATE/template/make-component b/TEMPLATE/template/make-component index 447880a0c..ddce91cd9 100755 --- a/TEMPLATE/template/make-component +++ b/TEMPLATE/template/make-component @@ -1,3 +1,3 @@ $#$!/bin/sh cd src -mv gb.xxx.component __COMPONENT.component +mv .component __COMPONENT.component diff --git a/configure.ac b/configure.ac index fb751f023..57edd0042 100644 --- a/configure.ac +++ b/configure.ac @@ -49,6 +49,7 @@ GB_CONFIG_SUBDIRS(media, gb.media) GB_CONFIG_SUBDIRS(httpd, gb.httpd) GB_CONFIG_SUBDIRS(openssl, gb.openssl) GB_CONFIG_SUBDIRS(openal, gb.openal) +GB_CONFIG_SUBDIRS(input, gb.input) AC_CONFIG_SUBDIRS(comp) AC_CONFIG_SUBDIRS(app) diff --git a/gb.input/AUTHORS b/gb.input/AUTHORS new file mode 100644 index 000000000..e69de29bb diff --git a/gb.input/COPYING b/gb.input/COPYING new file mode 120000 index 000000000..012065c85 --- /dev/null +++ b/gb.input/COPYING @@ -0,0 +1 @@ +../COPYING \ No newline at end of file diff --git a/gb.input/ChangeLog b/gb.input/ChangeLog new file mode 100644 index 000000000..e69de29bb diff --git a/gb.input/INSTALL b/gb.input/INSTALL new file mode 120000 index 000000000..99d491b4f --- /dev/null +++ b/gb.input/INSTALL @@ -0,0 +1 @@ +../INSTALL \ No newline at end of file diff --git a/gb.input/Makefile.am b/gb.input/Makefile.am new file mode 100644 index 000000000..fc70ee1c2 --- /dev/null +++ b/gb.input/Makefile.am @@ -0,0 +1,3 @@ +ACLOCAL_AMFLAGS = -I m4 --install +SUBDIRS = @INPUT_DIR@ +EXTRA_DIST = reconf gambas.h gb*.h diff --git a/gb.input/NEWS b/gb.input/NEWS new file mode 100644 index 000000000..e69de29bb diff --git a/gb.input/README b/gb.input/README new file mode 100644 index 000000000..e69de29bb diff --git a/gb.input/acinclude.m4 b/gb.input/acinclude.m4 new file mode 120000 index 000000000..d84c32a31 --- /dev/null +++ b/gb.input/acinclude.m4 @@ -0,0 +1 @@ +../acinclude.m4 \ No newline at end of file diff --git a/gb.input/component.am b/gb.input/component.am new file mode 120000 index 000000000..2f0eee34f --- /dev/null +++ b/gb.input/component.am @@ -0,0 +1 @@ +../component.am \ No newline at end of file diff --git a/gb.input/configure.ac b/gb.input/configure.ac new file mode 100644 index 000000000..1fd44e6ff --- /dev/null +++ b/gb.input/configure.ac @@ -0,0 +1,14 @@ +dnl ---- configure.ac for gb.input +m4_include([../version.m4]) +AC_INIT(gambas3-gb-input, GB_VERSION, GB_MAIL, [], GB_URL) +AC_CONFIG_MACRO_DIR([m4]) +GB_INIT(gb.input) +AC_PROG_LIBTOOL +GB_COMPONENT_PKG_CONFIG( + input, + INPUT, + gb.input, + [src], + libevdev) +AC_OUTPUT( Makefile src/Makefile ) +GB_PRINT_MESSAGES diff --git a/gb.input/gambas.h b/gb.input/gambas.h new file mode 120000 index 000000000..03677ecd0 --- /dev/null +++ b/gb.input/gambas.h @@ -0,0 +1 @@ +../main/share/gambas.h \ No newline at end of file diff --git a/gb.input/gb_common.h b/gb.input/gb_common.h new file mode 120000 index 000000000..707d79da6 --- /dev/null +++ b/gb.input/gb_common.h @@ -0,0 +1 @@ +../main/share/gb_common.h \ No newline at end of file diff --git a/gb.input/m4 b/gb.input/m4 new file mode 120000 index 000000000..7d49a2a4b --- /dev/null +++ b/gb.input/m4 @@ -0,0 +1 @@ +../m4 \ No newline at end of file diff --git a/gb.input/reconf b/gb.input/reconf new file mode 120000 index 000000000..48a376da6 --- /dev/null +++ b/gb.input/reconf @@ -0,0 +1 @@ +../reconf \ No newline at end of file diff --git a/gb.input/src/Makefile.am b/gb.input/src/Makefile.am new file mode 100644 index 000000000..337292894 --- /dev/null +++ b/gb.input/src/Makefile.am @@ -0,0 +1,7 @@ +COMPONENT = gb.input +include $(top_srcdir)/component.am +gblib_LTLIBRARIES = gb.input.la +gb_input_la_LIBADD = @INPUT_LIB@ +gb_input_la_LDFLAGS = -module @LD_FLAGS@ @INPUT_LDFLAGS@ +gb_input_la_CPPFLAGS = @INPUT_INC@ +gb_input_la_SOURCES = main.c main.h evdev.c evdev.h diff --git a/gb.input/src/evdev.c b/gb.input/src/evdev.c new file mode 100644 index 000000000..2513055b3 --- /dev/null +++ b/gb.input/src/evdev.c @@ -0,0 +1,28 @@ +/*************************************************************************** + + evdev.c + + gb.input component + + (c) Joe Smith + + 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 1, 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., 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + +***************************************************************************/ + +#define __EVDEV_C + +#include "evdev.h" diff --git a/gb.input/src/evdev.h b/gb.input/src/evdev.h new file mode 100644 index 000000000..dc81917de --- /dev/null +++ b/gb.input/src/evdev.h @@ -0,0 +1,35 @@ +/*************************************************************************** + + evdev.h + + gb.input component + + (c) Joe Smith + + 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 1, 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., 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + +***************************************************************************/ + +#ifndef __EVDEV_H +#define __EVDEV_H + +#include "gambas.h" + +#ifndef __MAIN_C +extern GB_INTERFACE GB; +#endif + +#endif /* __EVDEV_H */ diff --git a/gb.input/src/gb.input.component b/gb.input/src/gb.input.component new file mode 100644 index 000000000..10e636c3f --- /dev/null +++ b/gb.input/src/gb.input.component @@ -0,0 +1,3 @@ +[Component] +Author= +Alpha=1 diff --git a/gb.input/src/main.c b/gb.input/src/main.c new file mode 100644 index 000000000..5fe3a643b --- /dev/null +++ b/gb.input/src/main.c @@ -0,0 +1,28 @@ +/*************************************************************************** + + main.c + + gb.input component + + (c) Joe Smith + + 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 1, 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., 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + +***************************************************************************/ + +#define __MAIN_C + +#include "main.h" diff --git a/gb.input/src/main.h b/gb.input/src/main.h new file mode 100644 index 000000000..8c33d3f3d --- /dev/null +++ b/gb.input/src/main.h @@ -0,0 +1,35 @@ +/*************************************************************************** + + main.h + + gb.input component + + (c) Joe Smith + + 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 1, 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., 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + +***************************************************************************/ + +#ifndef __MAIN_H +#define __MAIN_H + +#include "gambas.h" + +#ifndef __MAIN_C +extern GB_INTERFACE GB; +#endif + +#endif /* __MAIN_H */