diff options
author | Emre Ucan <eucan@de.adit-jv.com> | 2015-04-07 13:11:34 +0200 |
---|---|---|
committer | Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp> | 2015-05-13 16:06:26 +0900 |
commit | 15fa542970930402ed7f2e85f4ee432dbe18a096 (patch) | |
tree | c66b1be3c727e2634e2b204f2bd92829c0540a8c /ivi-input-api | |
parent | 71623c96b7b10778f2021152fab4ba73a3a17044 (diff) | |
download | wayland-ivi-extension-15fa542970930402ed7f2e85f4ee432dbe18a096.tar.gz |
ilmInput: create new directory, a header file and a source file for new input handling
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Diffstat (limited to 'ivi-input-api')
-rw-r--r-- | ivi-input-api/ilmInput/CMakeLists.txt | 90 | ||||
-rw-r--r-- | ivi-input-api/ilmInput/include/ilm_input.h | 124 | ||||
-rw-r--r-- | ivi-input-api/ilmInput/src/ilm_input.c | 76 |
3 files changed, 290 insertions, 0 deletions
diff --git a/ivi-input-api/ilmInput/CMakeLists.txt b/ivi-input-api/ilmInput/CMakeLists.txt new file mode 100644 index 0000000..0d9e753 --- /dev/null +++ b/ivi-input-api/ilmInput/CMakeLists.txt @@ -0,0 +1,90 @@ +############################################################################ +# +# Copyright 2010-2014 BMW Car IT GmbH +# Copyright (C) 2013 DENSO CORPORATION +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +############################################################################ + +cmake_minimum_required (VERSION 2.6) + +project(ilmInput) + +find_package(Threads) +find_package(PkgConfig REQUIRED) +pkg_check_modules(WAYLAND_CLIENT wayland-client REQUIRED) + +GET_TARGET_PROPERTY(ILM_CONTROL_INCLUDE_DIRS ilmControl INCLUDE_DIRECTORIES) + +include_directories( + include + ${ILM_CONTROL_INCLUDE_DIRS} + ${WAYLAND_CLIENT_INCLUDE_DIR} +) + +link_directories( + ${WAYLAND_CLIENT_LIBRARY_DIRS} +) + +add_library(${PROJECT_NAME} SHARED + src/ilm_input.c +) + +add_dependencies(${PROJECT_NAME} + ilmControl + ${WAYLAND_CLIENT_LIBRARIES} +) + +set(LIBS + ${LIBS} + ilmControl + ivi-extension-protocol + rt + dl + ${CMAKE_THREAD_LIBS_INIT} + ${WAYLAND_CLIENT_LIBRARIES} +) + +target_link_libraries(${PROJECT_NAME} ${LIBS}) + +install ( + TARGETS ${PROJECT_NAME} + LIBRARY DESTINATION lib +) + +install ( + FILES ${CMAKE_SOURCE_DIR}/ivi-input-api/ilmInput/include/ilm_input.h + DESTINATION include/ilm +) + +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${ILM_API_VERSION} SOVERSION ${ILM_API_VERSION}) + + +#============================================================================================= +# generate documentation for ilmInput API +#============================================================================================= + +add_custom_target(ilm-input-doc + COMMAND cat ${CMAKE_SOURCE_DIR}/doc/Doxyfile.template + | sed 's/___DOC_NAME___/ilmInput API/' + | sed 's/___DOC_VERSION___/${ILM_API_VERSION}/' + | sed 's!___INPUT_FILE___!${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmCommon/include/ilm_common.h ${CMAKE_CURRENT_SOURCE_DIR}/include/ilm_input.h!' + | sed 's/___OUTPUT_DIR___/ilm-input-doc/' + | doxygen - + COMMAND make --silent -C ilm-input-doc/latex + COMMAND cp ilm-input-doc/latex/refman.pdf + ${CMAKE_BINARY_DIR}/ilm-input-api-${ILM_API_VERSION}.pdf + COMMENT "Generating ilm-input-api-${ILM_API_VERSION}.pdf" +) diff --git a/ivi-input-api/ilmInput/include/ilm_input.h b/ivi-input-api/ilmInput/include/ilm_input.h new file mode 100644 index 0000000..7c0008e --- /dev/null +++ b/ivi-input-api/ilmInput/include/ilm_input.h @@ -0,0 +1,124 @@ +/*************************************************************************** +* +* Copyright 2015, Codethink Ltd. +* +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +****************************************************************************/ +#ifndef _ILM_INPUT_H_ +#define _ILM_INPUT_H_ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "ilm_common.h" + +/** + * \brief Set the surface's accepted seats to the list specified + * \ingroup ilmControl + * \param[in] surfaceID The surface whose list of accepted seats is to be + * changed + * \param[in] num_seats The number of seats stored in seats + * \param[in] seats A pointer to an array of strings listing each seat + * to accept by its seat name + * \return ILM_SUCCESS if the method call was successful + * \return ILM_FAILED if the client cannot call the method on the surface + */ +ilmErrorTypes +ilm_setInputAcceptanceOn(t_ilm_surface surfaceID, t_ilm_uint num_seats, + t_ilm_string *seats); + +/** + * \brief Get the surface's list of accepted seats + * \ingroup ilmControl + * \param[in] surfaceID The surface that the list of seats comes from + * \param[out] num_seats The number of seats returned + * \param[out] seats A pointer to the memory where an array of seats is + * stored. It is the caller's responsibility to free + * this memory after use. + * \return ILM_SUCCESS if the method call was successful + * \return ILM_FAILED if the client cannot call the method on the surface + */ +ilmErrorTypes +ilm_getInputAcceptanceOn(t_ilm_surface surfaceID, t_ilm_uint *num_seats, + t_ilm_string **seats); + +/** + * \brief Get the list of seats that support the device types specified in + * bitmask + * \ingroup ilmControl + * \param[in] bitmask The bitmask that indicates what type of devices + * are requested (e.g. ILM_INPUT_DEVICE_POINTER) + * \param[out] num_seats The number of seats returned + * \param[out] seats A pointer to the memory where an array of seats is + * stored. It is the caller's responsibility to free + * this memory after use. + * \return ILM_SUCCESS if the method call was successful + * \return ILM_FAILED if the method call was unsuccessful + */ +ilmErrorTypes +ilm_getInputDevices(ilmInputDevice bitmask, t_ilm_uint *num_seats, + t_ilm_string **seats); +/** + * \brief Get the device capabilities of a seat + * \ingroup ilmControl + * \param[in] seat_name The name of the seat + * \param[out] bitmask A pointer to the bitmask that should be set + * \return ILM_SUCCESS if the method call was successful + * \return ILM_FAILED if the method call was unsuccessful + */ +ilmErrorTypes +ilm_getInputDeviceCapabilities(t_ilm_string seat_name, ilmInputDevice* bitmask); + +/** + * \brief Set whether the specified surfaces have input focus set for the + * given device types + * \ingroup ilmControl + * \param[in] surfaceIDs An array of surface IDs whose input focus may be + * changed + * \param[in] num_surfaces The number of surfaces in surfaceIDs + * \param[in] bitmask A bitmask of the types of device for which focus + * will be set + * \param[in] is_set ILM_TRUE if focus is to be set, ILM_FALSE if focus + * is to be unset + * \return ILM_SUCCESS if the method call was successful + * \return ILM_FAILED if the method call was unsuccessful + */ +ilmErrorTypes +ilm_setInputFocus(t_ilm_surface *surfaceIDs, t_ilm_uint num_surfaces, + ilmInputDevice bitmask, t_ilm_bool is_set); + +/** + * \brief Get all surface IDs and their corresponding focus bitmasks + * \ingroup ilmControl + * \param[out] surfaceIDs A pointer to the memory where an array of surface + * IDs will be created. The caller is responsible for + * freeing this memory after use. + * \param[out] bitmasks A pointer to the memory where an array of bitmasks + * will be created. The caller is responsible for + * freeing this memory after use. + * \param[out] num_ids The number of surface IDs that were returned + * \return ILM_SUCCESS if the method call was successful + * \return ILM_FAILED if the method call was unsuccessful + */ +ilmErrorTypes +ilm_getInputFocus(t_ilm_surface **surfaceIDs, ilmInputDevice** bitmasks, + t_ilm_uint *num_ids); + +#ifdef __cplusplus +} /**/ +#endif /* __cplusplus */ + +#endif /* _ILM_INPUT_H_ */ diff --git a/ivi-input-api/ilmInput/src/ilm_input.c b/ivi-input-api/ilmInput/src/ilm_input.c new file mode 100644 index 0000000..19ee6fa --- /dev/null +++ b/ivi-input-api/ilmInput/src/ilm_input.c @@ -0,0 +1,76 @@ +/************************************************************************** + * + * Copyright 2015 Codethink Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ****************************************************************************/ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "ivi-input-client-protocol.h" +#include "ilm_input.h" +#include "ilm_control_platform.h" + + +/* GCC visibility */ +#if defined(__GNUC__) && __GNUC__ >= 4 +#define ILM_EXPORT __attribute__ ((visibility("default"))) +#else +#define ILM_EXPORT +#endif + +extern struct ilm_control_context ilm_context; + +ILM_EXPORT ilmErrorTypes +ilm_setInputAcceptanceOn(t_ilm_surface surfaceID, t_ilm_uint num_seats, + t_ilm_string *seats) +{ + return ILM_FAILED; +} + +ILM_EXPORT ilmErrorTypes +ilm_getInputAcceptanceOn(t_ilm_surface surfaceID, t_ilm_uint *num_seats, + t_ilm_string **seats) +{ + return ILM_FAILED; +} + +ILM_EXPORT ilmErrorTypes +ilm_getInputDevices(ilmInputDevice bitmask, t_ilm_uint *num_seats, + t_ilm_string **seats) +{ + return ILM_FAILED; +} + +ILM_EXPORT ilmErrorTypes +ilm_getInputDeviceCapabilities(t_ilm_string seat_name, ilmInputDevice *bitmask) +{ + return ILM_FAILED; +} + +ILM_EXPORT ilmErrorTypes +ilm_setInputFocus(t_ilm_surface *surfaceIDs, t_ilm_uint num_surfaces, + ilmInputDevice bitmask, t_ilm_bool is_set) +{ + return ILM_FAILED; +} + +ILM_EXPORT ilmErrorTypes +ilm_getInputFocus(t_ilm_surface **surfaceIDs, ilmInputDevice **bitmasks, + t_ilm_uint *num_ids) +{ + return ILM_FAILED; +} |