1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-21 06:53:01 +08:00
lvgl/src/lv_misc/lv_bidi.h

69 lines
1.3 KiB
C
Raw Normal View History

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
*********************/
2019-10-08 16:54:28 +02:00
#ifdef LV_CONF_INCLUDE_SIMPLE
#include "lv_conf.h"
#else
#include "../../../lv_conf.h"
#endif
2019-09-24 21:00:58 +02:00
#include <stdbool.h>
#include <stdint.h>
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
enum
2019-09-24 21:00:58 +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
**********************/
#if LV_USE_BIDI
2019-09-24 21:00:58 +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
**********************/
#endif /*LV_USE_BIDI*/
2019-09-24 21:00:58 +02:00
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_BIDI_H*/