From: Ji-hoon Lee Date: Thu, 27 Nov 2014 08:06:27 +0000 (+0900) Subject: Upload initial version X-Git-Tag: submit/tizen/20150611.051311~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F54%2F40854%2F1;p=platform%2Fcore%2Fuifw%2Flibscl-common.git Upload initial version Change-Id: I72e31c43a625ce6a1c96e3b93528c08b23168090 --- diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..2e8a0de --- /dev/null +++ b/AUTHORS @@ -0,0 +1,2 @@ +Developer: + Ji-hoon Lee diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..39740e7 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,53 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(libscl-common CXX) + +SET(SRCS + src/sclcommon.cpp +) + +SET(PACKAGE ${PROJECT_NAME}) +SET(PKGNAME ${PACKAGE}) +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) +SET(LIBDIR "${PREFIX}/lib") + +IF("${CMAKE_BUILD_TYPE}" STREQUAL "") + SET(CMAKE_BUILD_TYPE "Release") +ENDIF() +MESSAGE(STATUS "Build type: ${CMAKE_BUILD_TYPE}") + +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src + ${CMAKE_SOURCE_DIR}/src/include + ) + +INCLUDE(FindPkgConfig) +pkg_check_modules(pkgs REQUIRED + elementary + ) + +FOREACH(flag ${pkgs_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall") +SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") +SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -g") + +ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"") +ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"") +ADD_DEFINITIONS("-DLOG_TAG=\"LIBSCL_COMMON\"") +ADD_DEFINITIONS("-D__EFL__") + +ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS}) + +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS}) + +set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR}) + +INSTALL(FILES "${CMAKE_SOURCE_DIR}/src/sclcommon.h" DESTINATION include/libscl-common) +INSTALL(FILES "${CMAKE_SOURCE_DIR}/src/scltypes.h" DESTINATION include/libscl-common) +INSTALL(FILES "${CMAKE_SOURCE_DIR}/src/sclcast.h" DESTINATION include/libscl-common) +INSTALL(FILES "${CMAKE_SOURCE_DIR}/src/sclcast-efl.h" DESTINATION include/libscl-common) + +CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY) +INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig) diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..f17fd14 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,4 @@ +2014-10-29 11:15 Ji-hoon Lee + + Initial version. + diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..fa3678d --- /dev/null +++ b/NOTICE @@ -0,0 +1,3 @@ +Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. +Except as noted, this software is licensed under Apache License, Version 2. +Please, see the LICENSE file for Apache License terms and conditions. diff --git a/README b/README new file mode 100644 index 0000000..06439e3 --- /dev/null +++ b/README @@ -0,0 +1,5 @@ +libscl-common +============== + +This is a library that helps developing S/W Keyboards. + diff --git a/libscl-common.pc.in b/libscl-common.pc.in new file mode 100644 index 0000000..944564b --- /dev/null +++ b/libscl-common.pc.in @@ -0,0 +1,13 @@ +# Package Information for pkg-config + +prefix=/usr +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: libscl-common +Description: SCL Common - A library for developing software keyboards +Version: 1.0 +Libs: -L${libdir} -lscl-common +Cflags: -I${includedir}/libscl-common + diff --git a/packaging/libscl-common.changes b/packaging/libscl-common.changes new file mode 100644 index 0000000..e69de29 diff --git a/packaging/libscl-common.manifest b/packaging/libscl-common.manifest new file mode 100644 index 0000000..017d22d --- /dev/null +++ b/packaging/libscl-common.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/libscl-common.spec b/packaging/libscl-common.spec new file mode 100644 index 0000000..f2a8493 --- /dev/null +++ b/packaging/libscl-common.spec @@ -0,0 +1,56 @@ +%define _optdir /opt +%define _appdir %{_optdir}/apps + +Name: libscl-common +Summary: A library for developing software keyboards +Version: 0.0.1 +Release: 1 +Group: System Environment/Libraries +License: Apache License, Version 2.0 +Source0: libscl-common-%{version}.tar.gz +BuildRequires: gettext-tools +BuildRequires: cmake +BuildRequires: pkgconfig(elementary) + + +%description +A library that helps developing S/W Keyboard + +%package devel +Summary: SCL-Common header file +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel +A devel pacakge of libscl-common library that helps developing S/W Keyboard + +%prep +%setup -q + + +%build +cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} +make %{?jobs:-j%jobs} + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}/usr/share/license +cp LICENSE %{buildroot}/usr/share/license/%{name} + +%make_install + + + +%post + +%postun + +%files +%defattr(-,root,root,-) +%{_libdir}/libscl-common.so +/usr/share/license/%{name} + +%files devel +%defattr(-,root,root,-) +%{_includedir}/* +%{_libdir}/pkgconfig/libscl-common.pc diff --git a/src/sclcast-efl.h b/src/sclcast-efl.h new file mode 100644 index 0000000..7b06714 --- /dev/null +++ b/src/sclcast-efl.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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 __SCL_CAST_EFL_H__ +#define __SCL_CAST_EFL_H__ + +#include "scltypes.h" + +#include + +namespace scl +{ + + inline Evas_Object* NATIVE_WINDOW_CAST(sclwindow window) { + return static_cast(window); + } + inline sclwindow SCL_WINDOW_CAST(Evas_Object *window) { + return static_cast(window); + } + +} + +#endif //__SCL_CAST_EFL_H__ diff --git a/src/sclcast.h b/src/sclcast.h new file mode 100644 index 0000000..85045ef --- /dev/null +++ b/src/sclcast.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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 __SCL_CAST_H__ +#define __SCL_CAST_H__ + +#include "sclcast-efl.h" + +#endif //__SCL_CAST_H__ diff --git a/src/sclcommon.cpp b/src/sclcommon.cpp new file mode 100644 index 0000000..9d85e11 --- /dev/null +++ b/src/sclcommon.cpp @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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 "sclcommon.h" + +using namespace scl; + diff --git a/src/sclcommon.h b/src/sclcommon.h new file mode 100644 index 0000000..14e60fc --- /dev/null +++ b/src/sclcommon.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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 __SCL_COMMON_H__ +#define __SCL_COMMON_H__ + +#include "scltypes.h" +#include "sclcast.h" + +//SCL_BEGIN_DECLS + +namespace scl +{ + + +} + +//SCL_END_DECLS + +#endif //__SCL_COMMON_H__ diff --git a/src/scltypes.h b/src/scltypes.h new file mode 100644 index 0000000..f56f178 --- /dev/null +++ b/src/scltypes.h @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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 __SCL_TYPES_H__ +#define __SCL_TYPES_H__ + +namespace scl +{ + +#define SCL_BEGIN_DECLS extern "C" { +#define SCL_END_DECLS } + +#ifndef FALSE +#define FALSE (0) +#endif + +#ifndef TRUE +#define TRUE (!FALSE) +#endif + +#ifndef NOT_USED +#define NOT_USED -1 +#endif + +#ifndef USED +#define USED 1 +#endif + +typedef signed char scl8; +typedef signed short scl16; +typedef signed int scl32; + +typedef unsigned char sclu8; +typedef unsigned short sclu16; +typedef unsigned int sclu32; + +typedef char sclchar; +typedef short sclshort; +typedef long scllong; +typedef int sclint; +typedef char sclboolean; + +typedef unsigned char sclbyte; +typedef unsigned char scluchar; +typedef unsigned short sclushort; +typedef unsigned long sclulong; +typedef unsigned int scluint; + +typedef float sclfloat; +typedef double scldouble; + +/* sclwindow should be a struct - containing a flag whether it is a virtual window or not*/ +#define SCLWINDOW_INVALID 0 +#define SCLWINDOW_VIRTUAL_DIM -1 +#define SCLWINDOW_VIRTUAL_MAGNIFIER -2 + +typedef enum { + SCL_EVENT_PASS_ON, /* This event needs further handling of default SCL event handler */ + SCL_EVENT_DONE, /* We're done with this event, do not call any other default SCL event handlers */ +} SCLEventReturnType; +/* +typedef struct _SclWindow { + operator =(void *ptr) {is = false} + sclboolean isVirtual; + void* ptr; +} SclWindow;*/ + +typedef void* sclwindow; +typedef void* sclimage; +typedef void* sclfont; +typedef void* scldrawctx; +typedef sclint scltouchdevice; +#define SCLTOUCHDEVICE_INVALID -1 + +typedef struct { + sclint x, y; +} SclPoint; + +typedef struct { + sclint width, height; +} SclSize; + +typedef struct { + sclint left, top, right, bottom; +} SclRect; + +typedef struct { + sclint x, y, width, height; +} SclRectangle; + +typedef struct { + sclbyte r, g, b, a; +} SclColor; + +#define SCL_MAKEWORD(low, high) ((sclu16)(((sclu8)(low)) | ((sclu16)((sclu8)(high))) << 8)) +#define SCL_MAKELONG(low, high) ((sclu32)(((sclu16)(low)) | ((sclu32)((sclu16)(high))) << 16)) +#define SCL_LOWORD(i32) ((sclu16)((i32) & 0xFFFF)) +#define SCL_HIWORD(i32) ((sclu16)(((sclu32)(i32) >> 16) & 0xFFFF)) +#define SCL_LOBYTE(i16) ((sclu8)((i16) & 0xFF)) +#define SCL_HIBYTE(i16) ((sclu8)(((sclu16)(i16) >> 8) & 0xFF)) + +/* Checks if the given character is in between '!'(0x21) and '~'(0x7e) range */ +#define SCL_ISCHAR(ch) ((ch) >= '!' && (ch) <= '~') + +} + +#endif //__SCL_TYPES_H__