--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., 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.
+ *
+ */
+
+// CLASS HEADER
+#include "bidirectional-support-impl.h"
+
+// INTERNAL INCLUDES
+#include <singleton-service-impl.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace TextAbstraction
+{
+
+BidirectionalSupport::BidirectionalSupport()
+: mPlugin( NULL )
+{
+
+}
+
+BidirectionalSupport::~BidirectionalSupport()
+{
+
+}
+
+Dali::TextAbstraction::BidirectionalSupport BidirectionalSupport::Get()
+{
+ Dali::TextAbstraction::BidirectionalSupport bidirectionalSupportHandle;
+
+ Dali::SingletonService service( SingletonService::Get() );
+ if ( service )
+ {
+ // Check whether the singleton is already created
+ Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::TextAbstraction::BidirectionalSupport ) );
+ if(handle)
+ {
+ // If so, downcast the handle
+ BidirectionalSupport* impl = dynamic_cast< Dali::Internal::TextAbstraction::BidirectionalSupport* >( handle.GetObjectPtr() );
+ bidirectionalSupportHandle = Dali::TextAbstraction::BidirectionalSupport( impl );
+ }
+ else // create and register the object
+ {
+ bidirectionalSupportHandle = Dali::TextAbstraction::BidirectionalSupport( new BidirectionalSupport);
+ service.Register( typeid( bidirectionalSupportHandle ), bidirectionalSupportHandle );
+ }
+ }
+
+ return bidirectionalSupportHandle;
+}
+
+Dali::TextAbstraction::BidiInfoIndex BidirectionalSupport::CreateInfo( const Dali::TextAbstraction::Character* const paragraph,
+ Dali::TextAbstraction::Length numberOfCharacters )
+{
+ return 0u;
+}
+
+void BidirectionalSupport::DestroyInfo( Dali::TextAbstraction::BidiInfoIndex bidiInfoIndex )
+{
+}
+
+void BidirectionalSupport::Reorder( Dali::TextAbstraction::BidiInfoIndex bidiInfoIndex,
+ Dali::TextAbstraction::CharacterIndex firstCharacterIndex,
+ Dali::TextAbstraction::Length numberOfCharacters,
+ Dali::TextAbstraction::CharacterIndex* visualToLogicalMap )
+{
+}
+
+} // namespace TextAbstraction
+
+} // namespace Internal
+
+} // namespace Dali
--- /dev/null
+#ifndef __DALI_INTERNAL_TEXT_ABSTRACTION_BIDIRECTIONAL_SUPPORT_IMPL_H__
+#define __DALI_INTERNAL_TEXT_ABSTRACTION_BIDIRECTIONAL_SUPPORT_IMPL_H__
+
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., 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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/base-object.h>
+
+// INTERNAL INCLUDES
+#include <dali/public-api/text-abstraction/bidirectional-support.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace TextAbstraction
+{
+
+/**
+ * Implementation of the BidirectionalSupport
+ */
+
+class BidirectionalSupport : public Dali::BaseObject
+{
+public:
+
+ /**
+ * Constructor
+ */
+ BidirectionalSupport();
+
+ /**
+ * Destructor
+ */
+ ~BidirectionalSupport();
+
+ /**
+ * @copydoc Dali::BidirectionalSupport::Get()
+ */
+ static Dali::TextAbstraction::BidirectionalSupport Get();
+
+ /**
+ * @copydoc Dali::BidirectionalSupport::CreateInfo()
+ */
+ Dali::TextAbstraction::BidiInfoIndex CreateInfo( const Dali::TextAbstraction::Character* const paragraph,
+ Dali::TextAbstraction::Length numberOfCharacters );
+
+ /**
+ * @copydoc Dali::BidirectionalSupport::DestroyInfo()
+ */
+ void DestroyInfo( Dali::TextAbstraction::BidiInfoIndex bidiInfoIndex );
+
+ /**
+ * @copydoc Dali::BidirectionalSupport::Reorder()
+ */
+ void Reorder( Dali::TextAbstraction::BidiInfoIndex bidiInfoIndex,
+ Dali::TextAbstraction::CharacterIndex firstCharacterIndex,
+ Dali::TextAbstraction::Length numberOfCharacters,
+ Dali::TextAbstraction::CharacterIndex* visualToLogicalMap );
+
+private:
+
+ // Undefined copy constructor.
+ BidirectionalSupport( const BidirectionalSupport& );
+
+ // Undefined assignment constructor.
+ BidirectionalSupport& operator=( BidirectionalSupport& );
+
+ void* mPlugin; ///< TODO replace this with bidirectional support plugin
+
+}; // class BidirectionalSupport
+
+
+} // namespace TextAbstraction
+
+} // namespace Internal
+
+inline static Internal::TextAbstraction::BidirectionalSupport& GetImplementation(Dali::TextAbstraction::BidirectionalSupport& bidirectionalSupport)
+{
+ DALI_ASSERT_ALWAYS( bidirectionalSupport && "bidirectional support handle is empty" );
+ BaseObject& handle = bidirectionalSupport.GetBaseObject();
+ return static_cast<Internal::TextAbstraction::BidirectionalSupport&>(handle);
+}
+
+inline static const Internal::TextAbstraction::BidirectionalSupport& GetImplementation(const Dali::TextAbstraction::BidirectionalSupport& bidirectionalSupport)
+{
+ DALI_ASSERT_ALWAYS( bidirectionalSupport && "bidirectional support handle is empty" );
+ const BaseObject& handle = bidirectionalSupport.GetBaseObject();
+ return static_cast<const Internal::TextAbstraction::BidirectionalSupport&>(handle);
+}
+
+} // namespace Dali
+
+#endif // __DALI_INTERNAL_TEXT_ABSTRACTION_BIDIRECTIONAL_SUPPORT_IMPL_H__
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., 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.
- *
- */
-
-// CLASS HEADER
-#include "reordering-impl.h"
-
-// INTERNAL INCLUDES
-#include <singleton-service-impl.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace TextAbstraction
-{
-
-
-Reordering::Reordering()
-:mPlugin(NULL)
-{
-
-}
-
-Reordering::~Reordering()
-{
-
-}
-
-Dali::TextAbstraction::Reordering Reordering::Get()
-{
- Dali::TextAbstraction::Reordering reorderingHandle;
-
- Dali::SingletonService service( SingletonService::Get() );
- if ( service )
- {
- // Check whether the singleton is already created
- Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::TextAbstraction::Reordering ) );
- if(handle)
- {
- // If so, downcast the handle
- Reordering* impl = dynamic_cast< Dali::Internal::TextAbstraction::Reordering* >( handle.GetObjectPtr() );
- reorderingHandle = Dali::TextAbstraction::Reordering( impl );
- }
- else // create and register the object
- {
- reorderingHandle = Dali::TextAbstraction::Reordering( new Reordering);
- service.Register( typeid( reorderingHandle ), reorderingHandle );
- }
- }
-
- return reorderingHandle;
-}
-
-} // namespace Reordering
-} // namespace Internal
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_INTERNAL_TEXT_ABSTRACTION_REORDERING_IMPL_H__
-#define __DALI_INTERNAL_TEXT_ABSTRACTION_REORDERING_IMPL_H__
-
-/*
- * Copyright (c) 2015 Samsung Electronics Co., 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.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/object/base-object.h>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/text-abstraction/reordering.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace TextAbstraction
-{
-
-/**
- * Implementation of the Reordering
- */
-
-class Reordering : public Dali::BaseObject
-{
-public:
-
- /**
- * Constructor
- */
- Reordering();
-
- /**
- * Destructor
- */
- ~Reordering();
-
- /**
- * @copydoc Dali::Reordering::Get()
- */
- static Dali::TextAbstraction::Reordering Get();
-
-private:
-
- // Undefined copy constructor.
- Reordering( const Reordering& );
-
- // Undefined assignment constructor.
- Reordering& operator=( Reordering& );
-
- void* mPlugin; ///< TODO replace this with reordering plugin
-
-}; // class Reordering
-
-
-} // namespace TextAbstraction
-
-} // namespace Internal
-
-inline static Internal::TextAbstraction::Reordering& GetImplementation(Dali::TextAbstraction::Reordering& reordering)
-{
- DALI_ASSERT_ALWAYS( reordering && "reordering handle is empty" );
- BaseObject& handle = reordering.GetBaseObject();
- return static_cast<Internal::TextAbstraction::Reordering&>(handle);
-}
-
-inline static const Internal::TextAbstraction::Reordering& GetImplementation(const Dali::TextAbstraction::Reordering& reordering)
-{
- DALI_ASSERT_ALWAYS( reordering && "reordering handle is empty" );
- const BaseObject& handle = reordering.GetBaseObject();
- return static_cast<const Internal::TextAbstraction::Reordering&>(handle);
-}
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_TEXT_ABSTRACTION_REORDERING_IMPL_H__
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., 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.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/public-api/text-abstraction/bidirectional-support.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/text-abstraction/bidirectional-support-impl.h>
+
+namespace Dali
+{
+
+namespace TextAbstraction
+{
+
+BidirectionalSupport::BidirectionalSupport()
+{
+}
+
+BidirectionalSupport::~BidirectionalSupport()
+{
+}
+
+BidirectionalSupport::BidirectionalSupport( Dali::Internal::TextAbstraction::BidirectionalSupport* implementation )
+: BaseHandle( implementation )
+{
+}
+
+BidirectionalSupport BidirectionalSupport::Get()
+{
+ return Dali::Internal::TextAbstraction::BidirectionalSupport::Get();
+}
+
+BidiInfoIndex BidirectionalSupport::CreateInfo( const Character* const paragraph,
+ Length numberOfCharacters )
+{
+ return GetImplementation( *this ).CreateInfo( paragraph,
+ numberOfCharacters );
+}
+
+void BidirectionalSupport::DestroyInfo( BidiInfoIndex bidiInfoIndex )
+{
+ GetImplementation( *this ).DestroyInfo( bidiInfoIndex );
+}
+
+void BidirectionalSupport::Reorder( BidiInfoIndex bidiInfoIndex,
+ CharacterIndex firstCharacterIndex,
+ Length numberOfCharacters,
+ CharacterIndex* visualToLogicalMap )
+{
+ GetImplementation( *this ).Reorder( bidiInfoIndex,
+ firstCharacterIndex,
+ numberOfCharacters,
+ visualToLogicalMap );
+}
+
+} // namespace TextAbstraction
+
+} // namespace Dali
--- /dev/null
+#ifndef __DALI_PLATFORM_TEXT_ABSTRACTION_BIDIRECTIONAL_SUPPORT_H__
+#define __DALI_PLATFORM_TEXT_ABSTRACTION_BIDIRECTIONAL_SUPPORT_H__
+
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., 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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/text-abstraction/text-abstraction.h>
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/base-handle.h>
+
+namespace Dali
+{
+
+namespace Internal DALI_INTERNAL
+{
+
+namespace TextAbstraction
+{
+class BidirectionalSupport;
+} // TextAbstraction
+} // Internal
+
+namespace TextAbstraction
+{
+
+
+/**
+ * BidirectionalSupport API
+ *
+ */
+class DALI_IMPORT_API BidirectionalSupport : public BaseHandle
+{
+
+public:
+
+ /**
+ * @brief Create an uninitialized TextAbstraction handle.
+ *
+ */
+ BidirectionalSupport();
+
+ /**
+ * @brief Destructor
+ *
+ * This is non-virtual since derived Handle types must not contain data or virtual methods.
+ */
+ ~BidirectionalSupport();
+
+ /**
+ * @brief This constructor is used by BidirectionalSupport::Get().
+ *
+ * @param[in] implementation a pointer to the internal bidirectional support object.
+ */
+ explicit DALI_INTERNAL BidirectionalSupport( Dali::Internal::TextAbstraction::BidirectionalSupport* implementation );
+
+ /**
+ * @brief Retrieve a handle to the BidirectionalSupport instance.
+ *
+ * @return A handle to the BidirectionalSupport
+ */
+ static BidirectionalSupport Get();
+
+ /**
+ * @brief Creates bidirectional data for the whole paragraph.
+ *
+ * @param[in] paragraph Pointer to the first character of the paragraph coded in UTF32.
+ * @param[in] numberOfCharacters The number of characters of the paragraph.
+ *
+ * @return An index of an object inside a table storing the bidirectional data.
+ */
+ BidiInfoIndex CreateInfo( const Character* const paragraph,
+ Length numberOfCharacters );
+
+ /**
+ * @brief Destroys the bidirectional data.
+ *
+ * @param[in] bidiInfoIndex The index to the of the object inside the table storing the bidirectional data for the current paragraph.
+ */
+ void DestroyInfo( BidiInfoIndex bidiInfoIndex );
+
+ /**
+ * @brief Reorders a line of a paragraph.
+ *
+ * @pre visualToLogicalMap must have enough space allocated for @p numberOfCharacters.
+ *
+ * @param[in] bidiInfoIndex The index to the of the object inside the table storing the bidirectional data for the current paragraph.
+ * @param[in] firstCharacterIndex The first character of the line within the whole paragraph.
+ * @param[in] numberOfCharacters The number of characters of the line.
+ * @param[out] visualToLogicalMap The visual to logical conversion map.
+ */
+ void Reorder( BidiInfoIndex bidiInfoIndex,
+ CharacterIndex firstCharacterIndex,
+ Length numberOfCharacters,
+ CharacterIndex* visualToLogicalMap );
+};
+
+} // namespace TextAbstraction
+
+} // namespace Dali
+
+#endif // __DALI_PLATFORM_TEXT_ABSTRACTION_BIDIRECTIONAL_SUPPORT_H__
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., 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.
- *
- */
-
-// CLASS HEADER
-#include <dali/public-api/text-abstraction/reordering.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/text-abstraction/reordering-impl.h>
-
-namespace Dali
-{
-
-namespace TextAbstraction
-{
-
-Reordering::Reordering()
-{
-}
-Reordering::~Reordering()
-{
-}
-Reordering::Reordering(Dali::Internal::TextAbstraction::Reordering *impl)
- : BaseHandle(impl)
-{
-}
-
-Reordering Reordering::Get()
-{
- return Dali::Internal::TextAbstraction::Reordering::Get();
-}
-
-
-
-} // namespace TextAbstraction
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_PLATFORM_TEXT_ABSTRACTION_REORDERING_H__
-#define __DALI_PLATFORM_TEXT_ABSTRACTION_REORDERING_H__
-
-/*
- * Copyright (c) 2015 Samsung Electronics Co., 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 <dali/public-api/object/base-handle.h>
-
-namespace Dali
-{
-
-namespace Internal DALI_INTERNAL
-{
-
-namespace TextAbstraction
-{
-class Reordering;
-} // TextAbstraction
-} // Internal
-
-namespace TextAbstraction
-{
-
-
-/**
- * Reordering API
- *
- */
-class DALI_IMPORT_API Reordering : public BaseHandle
-{
-
-public:
-
- /**
- * @brief Create an uninitialized TextAbstraction handle.
- *
- */
- Reordering();
-
- /**
- * @brief Destructor
- *
- * This is non-virtual since derived Handle types must not contain data or virtual methods.
- */
- ~Reordering();
-
- /**
- * @brief This constructor is used by Reordering::Get().
- *
- * @param[in] reordering a pointer to the internal reordering object.
- */
- explicit DALI_INTERNAL Reordering( Dali::Internal::TextAbstraction::Reordering* reordering);
-
- /**
- * @brief Retrieve a handle to the Reordering instance.
- *
- * @return A handle to the Reordering
- */
- static Reordering Get();
-
-
-};
-
-} // namespace TextAbstraction
-
-} // namespace Dali
-
-#endif // __DALI_PLATFORM_TEXT_ABSTRACTION_REORDERING_H__
// EXTERNAL INCLUDES
#include <stdint.h>
-#include <string>
namespace Dali
{
typedef uint32_t FaceIndex; ///< Used with fonts which allow several font faces
typedef uint32_t GlyphIndex; ///< Uniquely identifies a glyph within a particular font
typedef uint32_t Character; ///< A UTF-32 representation of a character
+typedef uint32_t CharacterIndex; ///< An index into an array of characters
+typedef uint32_t Length; ///< The length of an array
+typedef uint32_t BidiInfoIndex; ///< Index to the bidirectional info for a paragraph.
} // namespace TextAbstraction
#include <dali/public-api/text-abstraction/text-abstraction-definitions.h>
#include <dali/public-api/text-abstraction/font-client.h>
#include <dali/public-api/text-abstraction/glyph-info.h>
-#include <dali/public-api/text-abstraction/reordering.h>
+#include <dali/public-api/text-abstraction/bidirectional-support.h>
#include <dali/public-api/text-abstraction/segmentation.h>
#include <dali/public-api/text-abstraction/shaping.h>
text_abstraction_src_files = \
$(text_src_dir)/dali/public-api/text-abstraction/font-client.cpp \
$(text_src_dir)/dali/public-api/text-abstraction/font-list.cpp \
- $(text_src_dir)/dali/public-api/text-abstraction/reordering.cpp \
+ $(text_src_dir)/dali/public-api/text-abstraction/bidirectional-support.cpp \
$(text_src_dir)/dali/public-api/text-abstraction/segmentation.cpp \
$(text_src_dir)/dali/public-api/text-abstraction/shaping.cpp \
$(text_src_dir)/dali/internal/text-abstraction/font-client-impl.cpp \
- $(text_src_dir)/dali/internal/text-abstraction/reordering-impl.cpp \
+ $(text_src_dir)/dali/internal/text-abstraction/bidirectional-support-impl.cpp \
$(text_src_dir)/dali/internal/text-abstraction/segmentation-impl.cpp \
$(text_src_dir)/dali/internal/text-abstraction/shaping-impl.cpp
$(text_src_dir)/dali/public-api/text-abstraction/font-client.h \
$(text_src_dir)/dali/public-api/text-abstraction/font-list.h \
$(text_src_dir)/dali/public-api/text-abstraction/glyph-info.h \
- $(text_src_dir)/dali/public-api/text-abstraction/reordering.h \
+ $(text_src_dir)/dali/public-api/text-abstraction/bidirectional-support.h \
$(text_src_dir)/dali/public-api/text-abstraction/segmentation.h \
$(text_src_dir)/dali/public-api/text-abstraction/shaping.h \
$(text_src_dir)/dali/public-api/text-abstraction/text-abstraction.h \