2019-09-24 21:00:58 +02:00
|
|
|
/**
|
|
|
|
* @file lv_bifi.h
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LV_BIDI_H
|
|
|
|
#define LV_BIDI_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*********************
|
|
|
|
* INCLUDES
|
|
|
|
*********************/
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
/*********************
|
|
|
|
* DEFINES
|
|
|
|
*********************/
|
|
|
|
|
|
|
|
/**********************
|
|
|
|
* TYPEDEFS
|
|
|
|
**********************/
|
2019-10-08 16:26:55 +02:00
|
|
|
enum
|
2019-09-24 21:00:58 +02:00
|
|
|
{
|
2019-10-08 16:26:55 +02:00
|
|
|
/*The first 4 values are stored in `lv_obj_t` on 2 bits*/
|
|
|
|
LV_BIDI_DIR_LTR = 0x00,
|
|
|
|
LV_BIDI_DIR_RTL = 0x01,
|
|
|
|
LV_BIDI_DIR_AUTO = 0x02,
|
|
|
|
LV_BIDI_DIR_INHERIT = 0x03,
|
|
|
|
|
|
|
|
LV_BIDI_DIR_NEUTRAL = 0x20,
|
|
|
|
LV_BIDI_DIR_WEAK = 0x21,
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef uint8_t lv_bidi_dir_t;
|
2019-09-24 21:00:58 +02:00
|
|
|
|
|
|
|
/**********************
|
|
|
|
* GLOBAL PROTOTYPES
|
|
|
|
**********************/
|
2019-10-08 16:26:55 +02:00
|
|
|
#if LV_USE_BIDI
|
2019-09-24 21:00:58 +02:00
|
|
|
|
2019-10-08 16:26:55 +02:00
|
|
|
void lv_bidi_process(const char * str_in, char * str_out, lv_bidi_dir_t base_dir);
|
|
|
|
lv_bidi_dir_t lv_bidi_detect_base_dir(const char * txt);
|
2019-09-24 21:00:58 +02:00
|
|
|
lv_bidi_dir_t lv_bidi_get_letter_dir(uint32_t letter);
|
|
|
|
bool lv_bidi_letter_is_weak(uint32_t letter);
|
|
|
|
bool lv_bidi_letter_is_rtl(uint32_t letter);
|
|
|
|
bool lv_bidi_letter_is_neutral(uint32_t letter);
|
|
|
|
|
|
|
|
/**********************
|
|
|
|
* MACROS
|
|
|
|
**********************/
|
|
|
|
|
2019-10-08 16:26:55 +02:00
|
|
|
#endif /*LV_USE_BIDI*/
|
|
|
|
|
2019-09-24 21:00:58 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern "C" */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /*LV_BIDI_H*/
|