use
super::*;
#[repr(C)]
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct __BindgenBitfieldUnit<Storage, Align>
where
Storage: AsRef<[u8]> + AsMut<[u8]>,
{
storage: Storage,
align: [Align; 0],
}
impl<Storage, Align> __BindgenBitfieldUnit<Storage, Align>
where
Storage: AsRef<[u8]> + AsMut<[u8]>,
{
#[inline]
pub fn new(storage: Storage) -> Self {
Self { storage, align: [] }
}
#[inline]
pub fn get_bit(&self, index: usize) -> bool {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = self.storage.as_ref()[byte_index];
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
index % 8
};
let mask = 1 << bit_index;
byte & mask == mask
}
#[inline]
pub fn set_bit(&mut self, index: usize, val: bool) {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = &mut self.storage.as_mut()[byte_index];
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
index % 8
};
let mask = 1 << bit_index;
if val {
*byte |= mask;
} else {
*byte &= !mask;
}
}
#[inline]
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
let mut val = 0;
for i in 0..(bit_width as usize) {
if self.get_bit(i + bit_offset) {
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
val |= 1 << index;
}
}
val
}
#[inline]
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
for i in 0..(bit_width as usize) {
let mask = 1 << i;
let val_bit_is_set = val & mask == mask;
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
self.set_bit(index + bit_offset, val_bit_is_set);
}
}
}
pub const LV_LABEL_DEF_SCROLL_SPEED: u32 = 25;
pub const LV_LABEL_WAIT_CHAR_COUNT: u32 = 3;
pub const LV_LABEL_TEXT_SEL: u32 = 0;
pub const LV_LABEL_LONG_TXT_HINT: u32 = 0;
pub const LV_LABEL_DOT_NUM: u32 = 3;
pub const LV_LABEL_POS_LAST: u32 = 65535;
pub const LV_LABEL_TEXT_SEL_OFF: u32 = 65535;
pub type lv_coord_t = i16;
pub type lv_obj_user_data_t = *mut ::cty::c_void;
pub type lv_res_t = u8;
#[doc = " Represents a point on the screen."]
#[repr(C)]
#[derive(Default, Copy, Clone)]
pub struct lv_point_t {
pub x: lv_coord_t,
pub y: lv_coord_t,
}
#[doc = " Represents an area of the screen."]
#[repr(C)]
#[derive(Default, Copy, Clone)]
pub struct lv_area_t {
pub x1: lv_coord_t,
pub y1: lv_coord_t,
pub x2: lv_coord_t,
pub y2: lv_coord_t,
}
pub type lv_align_t = u8;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_style_list_t {
pub style_list: *mut *mut lv_style_t,
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u8>,
pub __bindgen_padding_0: u32,
}
impl Default for lv_style_list_t {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl lv_style_list_t {
#[inline]
pub fn style_cnt(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 6u8) as u32) }
}
#[inline]
pub fn set_style_cnt(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(0usize, 6u8, val as u64)
}
}
#[inline]
pub fn has_local(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) }
}
#[inline]
pub fn set_has_local(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(6usize, 1u8, val as u64)
}
}
#[inline]
pub fn has_trans(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) }
}
#[inline]
pub fn set_has_trans(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(7usize, 1u8, val as u64)
}
}
#[inline]
pub fn skip_trans(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u32) }
}
#[inline]
pub fn set_skip_trans(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(8usize, 1u8, val as u64)
}
}
#[inline]
pub fn ignore_trans(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u32) }
}
#[inline]
pub fn set_ignore_trans(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(9usize, 1u8, val as u64)
}
}
#[inline]
pub fn valid_cache(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u32) }
}
#[inline]
pub fn set_valid_cache(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(10usize, 1u8, val as u64)
}
}
#[inline]
pub fn ignore_cache(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u32) }
}
#[inline]
pub fn set_ignore_cache(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(11usize, 1u8, val as u64)
}
}
#[inline]
pub fn radius_zero(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u32) }
}
#[inline]
pub fn set_radius_zero(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(12usize, 1u8, val as u64)
}
}
#[inline]
pub fn opa_scale_cover(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u32) }
}
#[inline]
pub fn set_opa_scale_cover(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(13usize, 1u8, val as u64)
}
}
#[inline]
pub fn clip_corner_off(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u32) }
}
#[inline]
pub fn set_clip_corner_off(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(14usize, 1u8, val as u64)
}
}
#[inline]
pub fn transform_all_zero(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u32) }
}
#[inline]
pub fn set_transform_all_zero(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(15usize, 1u8, val as u64)
}
}
#[inline]
pub fn pad_all_zero(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(16usize, 1u8) as u32) }
}
#[inline]
pub fn set_pad_all_zero(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(16usize, 1u8, val as u64)
}
}
#[inline]
pub fn blend_mode_all_normal(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(17usize, 1u8) as u32) }
}
#[inline]
pub fn set_blend_mode_all_normal(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(17usize, 1u8, val as u64)
}
}
#[inline]
pub fn bg_opa_transp(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(18usize, 1u8) as u32) }
}
#[inline]
pub fn set_bg_opa_transp(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(18usize, 1u8, val as u64)
}
}
#[inline]
pub fn bg_opa_cover(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(19usize, 1u8) as u32) }
}
#[inline]
pub fn set_bg_opa_cover(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(19usize, 1u8, val as u64)
}
}
#[inline]
pub fn bg_grad_dir_none(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(20usize, 1u8) as u32) }
}
#[inline]
pub fn set_bg_grad_dir_none(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(20usize, 1u8, val as u64)
}
}
#[inline]
pub fn border_width_zero(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(21usize, 1u8) as u32) }
}
#[inline]
pub fn set_border_width_zero(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(21usize, 1u8, val as u64)
}
}
#[inline]
pub fn border_side_full(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(22usize, 1u8) as u32) }
}
#[inline]
pub fn set_border_side_full(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(22usize, 1u8, val as u64)
}
}
#[inline]
pub fn border_post_off(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(23usize, 1u8) as u32) }
}
#[inline]
pub fn set_border_post_off(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(23usize, 1u8, val as u64)
}
}
#[inline]
pub fn outline_width_zero(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(24usize, 1u8) as u32) }
}
#[inline]
pub fn set_outline_width_zero(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(24usize, 1u8, val as u64)
}
}
#[inline]
pub fn pattern_img_null(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(25usize, 1u8) as u32) }
}
#[inline]
pub fn set_pattern_img_null(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(25usize, 1u8, val as u64)
}
}
#[inline]
pub fn shadow_width_zero(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(26usize, 1u8) as u32) }
}
#[inline]
pub fn set_shadow_width_zero(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(26usize, 1u8, val as u64)
}
}
#[inline]
pub fn value_txt_str(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(27usize, 1u8) as u32) }
}
#[inline]
pub fn set_value_txt_str(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(27usize, 1u8, val as u64)
}
}
#[inline]
pub fn img_recolor_opa_transp(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(28usize, 1u8) as u32) }
}
#[inline]
pub fn set_img_recolor_opa_transp(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(28usize, 1u8, val as u64)
}
}
#[inline]
pub fn text_space_zero(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(29usize, 1u8) as u32) }
}
#[inline]
pub fn set_text_space_zero(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(29usize, 1u8, val as u64)
}
}
#[inline]
pub fn text_decor_none(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(30usize, 1u8) as u32) }
}
#[inline]
pub fn set_text_decor_none(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(30usize, 1u8, val as u64)
}
}
#[inline]
pub fn text_font_normal(&self) -> u32 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u32) }
}
#[inline]
pub fn set_text_font_normal(&mut self, val: u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(31usize, 1u8, val as u64)
}
}
#[inline]
pub fn new_bitfield_1(
style_cnt: u32,
has_local: u32,
has_trans: u32,
skip_trans: u32,
ignore_trans: u32,
valid_cache: u32,
ignore_cache: u32,
radius_zero: u32,
opa_scale_cover: u32,
clip_corner_off: u32,
transform_all_zero: u32,
pad_all_zero: u32,
blend_mode_all_normal: u32,
bg_opa_transp: u32,
bg_opa_cover: u32,
bg_grad_dir_none: u32,
border_width_zero: u32,
border_side_full: u32,
border_post_off: u32,
outline_width_zero: u32,
pattern_img_null: u32,
shadow_width_zero: u32,
value_txt_str: u32,
img_recolor_opa_transp: u32,
text_space_zero: u32,
text_decor_none: u32,
text_font_normal: u32,
) -> __BindgenBitfieldUnit<[u8; 4usize], u8> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u8> =
Default::default();
__bindgen_bitfield_unit.set(0usize, 6u8, {
let style_cnt: u32 = unsafe { ::core::mem::transmute(style_cnt) };
style_cnt as u64
});
__bindgen_bitfield_unit.set(6usize, 1u8, {
let has_local: u32 = unsafe { ::core::mem::transmute(has_local) };
has_local as u64
});
__bindgen_bitfield_unit.set(7usize, 1u8, {
let has_trans: u32 = unsafe { ::core::mem::transmute(has_trans) };
has_trans as u64
});
__bindgen_bitfield_unit.set(8usize, 1u8, {
let skip_trans: u32 = unsafe { ::core::mem::transmute(skip_trans) };
skip_trans as u64
});
__bindgen_bitfield_unit.set(9usize, 1u8, {
let ignore_trans: u32 = unsafe { ::core::mem::transmute(ignore_trans) };
ignore_trans as u64
});
__bindgen_bitfield_unit.set(10usize, 1u8, {
let valid_cache: u32 = unsafe { ::core::mem::transmute(valid_cache) };
valid_cache as u64
});
__bindgen_bitfield_unit.set(11usize, 1u8, {
let ignore_cache: u32 = unsafe { ::core::mem::transmute(ignore_cache) };
ignore_cache as u64
});
__bindgen_bitfield_unit.set(12usize, 1u8, {
let radius_zero: u32 = unsafe { ::core::mem::transmute(radius_zero) };
radius_zero as u64
});
__bindgen_bitfield_unit.set(13usize, 1u8, {
let opa_scale_cover: u32 = unsafe { ::core::mem::transmute(opa_scale_cover) };
opa_scale_cover as u64
});
__bindgen_bitfield_unit.set(14usize, 1u8, {
let clip_corner_off: u32 = unsafe { ::core::mem::transmute(clip_corner_off) };
clip_corner_off as u64
});
__bindgen_bitfield_unit.set(15usize, 1u8, {
let transform_all_zero: u32 = unsafe { ::core::mem::transmute(transform_all_zero) };
transform_all_zero as u64
});
__bindgen_bitfield_unit.set(16usize, 1u8, {
let pad_all_zero: u32 = unsafe { ::core::mem::transmute(pad_all_zero) };
pad_all_zero as u64
});
__bindgen_bitfield_unit.set(17usize, 1u8, {
let blend_mode_all_normal: u32 =
unsafe { ::core::mem::transmute(blend_mode_all_normal) };
blend_mode_all_normal as u64
});
__bindgen_bitfield_unit.set(18usize, 1u8, {
let bg_opa_transp: u32 = unsafe { ::core::mem::transmute(bg_opa_transp) };
bg_opa_transp as u64
});
__bindgen_bitfield_unit.set(19usize, 1u8, {
let bg_opa_cover: u32 = unsafe { ::core::mem::transmute(bg_opa_cover) };
bg_opa_cover as u64
});
__bindgen_bitfield_unit.set(20usize, 1u8, {
let bg_grad_dir_none: u32 = unsafe { ::core::mem::transmute(bg_grad_dir_none) };
bg_grad_dir_none as u64
});
__bindgen_bitfield_unit.set(21usize, 1u8, {
let border_width_zero: u32 = unsafe { ::core::mem::transmute(border_width_zero) };
border_width_zero as u64
});
__bindgen_bitfield_unit.set(22usize, 1u8, {
let border_side_full: u32 = unsafe { ::core::mem::transmute(border_side_full) };
border_side_full as u64
});
__bindgen_bitfield_unit.set(23usize, 1u8, {
let border_post_off: u32 = unsafe { ::core::mem::transmute(border_post_off) };
border_post_off as u64
});
__bindgen_bitfield_unit.set(24usize, 1u8, {
let outline_width_zero: u32 = unsafe { ::core::mem::transmute(outline_width_zero) };
outline_width_zero as u64
});
__bindgen_bitfield_unit.set(25usize, 1u8, {
let pattern_img_null: u32 = unsafe { ::core::mem::transmute(pattern_img_null) };
pattern_img_null as u64
});
__bindgen_bitfield_unit.set(26usize, 1u8, {
let shadow_width_zero: u32 = unsafe { ::core::mem::transmute(shadow_width_zero) };
shadow_width_zero as u64
});
__bindgen_bitfield_unit.set(27usize, 1u8, {
let value_txt_str: u32 = unsafe { ::core::mem::transmute(value_txt_str) };
value_txt_str as u64
});
__bindgen_bitfield_unit.set(28usize, 1u8, {
let img_recolor_opa_transp: u32 =
unsafe { ::core::mem::transmute(img_recolor_opa_transp) };
img_recolor_opa_transp as u64
});
__bindgen_bitfield_unit.set(29usize, 1u8, {
let text_space_zero: u32 = unsafe { ::core::mem::transmute(text_space_zero) };
text_space_zero as u64
});
__bindgen_bitfield_unit.set(30usize, 1u8, {
let text_decor_none: u32 = unsafe { ::core::mem::transmute(text_decor_none) };
text_decor_none as u64
});
__bindgen_bitfield_unit.set(31usize, 1u8, {
let text_font_normal: u32 = unsafe { ::core::mem::transmute(text_font_normal) };
text_font_normal as u64
});
__bindgen_bitfield_unit
}
}
#[doc = " Dummy type to make handling easier"]
pub type lv_ll_node_t = u8;
#[doc = " Description of a linked list"]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_ll_t {
pub n_size: u32,
pub head: *mut lv_ll_node_t,
pub tail: *mut lv_ll_node_t,
}
impl Default for lv_ll_t {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
pub type lv_drag_dir_t = u8;
pub type lv_bidi_dir_t = u8;
pub type lv_design_mode_t = u8;
pub type lv_design_res_t = u8;
#[doc = " The design callback is used to draw the object on the screen."]
#[doc = " It accepts the object, a mask area, and the mode in which to draw the object."]
pub type lv_design_cb_t = ::core::option::Option<
unsafe extern "C" fn(
obj: *mut _lv_obj_t,
clip_area: *const lv_area_t,
mode: lv_design_mode_t,
) -> lv_design_res_t,
>;
pub type lv_event_t = u8;
#[doc = " @brief Event callback."]
#[doc = " Events are used to notify the user of some action being taken on the object."]
#[doc = " For details, see ::lv_event_t."]
pub type lv_event_cb_t =
::core::option::Option<unsafe extern "C" fn(obj: *mut _lv_obj_t, event: lv_event_t)>;
pub type lv_signal_t = u8;
pub type lv_signal_cb_t = ::core::option::Option<
unsafe extern "C" fn(
obj: *mut _lv_obj_t,
sign: lv_signal_t,
param: *mut ::cty::c_void,
) -> lv_res_t,
>;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_realign_t {
pub base: *const _lv_obj_t,
pub xofs: lv_coord_t,
pub yofs: lv_coord_t,
pub align: lv_align_t,
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
pub __bindgen_padding_0: u16,
}
impl Default for lv_realign_t {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl lv_realign_t {
#[inline]
pub fn auto_realign(&self) -> u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
}
#[inline]
pub fn set_auto_realign(&mut self, val: u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
self._bitfield_1.set(0usize, 1u8, val as u64)
}
}
#[inline]
pub fn mid_align(&self) -> u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
}
#[inline]
pub fn set_mid_align(&mut self, val: u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
self._bitfield_1.set(1usize, 1u8, val as u64)
}
}
#[inline]
pub fn new_bitfield_1(
auto_realign: u8,
mid_align: u8,
) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> =
Default::default();
__bindgen_bitfield_unit.set(0usize, 1u8, {
let auto_realign: u8 = unsafe { ::core::mem::transmute(auto_realign) };
auto_realign as u64
});
__bindgen_bitfield_unit.set(1usize, 1u8, {
let mid_align: u8 = unsafe { ::core::mem::transmute(mid_align) };
mid_align as u64
});
__bindgen_bitfield_unit
}
}
pub type lv_state_t = u8;
pub type lv_obj_t = _lv_obj_t;
#[doc = "< Expand the object size to the text size"]
pub const LV_LABEL_LONG_EXPAND: lv_label_long_mode_t = 0;
#[doc = "< Keep the object width, break the too long lines and expand the object"]
#[doc = "height"]
pub const LV_LABEL_LONG_BREAK: lv_label_long_mode_t = 1;
#[doc = "< Keep the size and write dots at the end if the text is too long"]
pub const LV_LABEL_LONG_DOT: lv_label_long_mode_t = 2;
#[doc = "< Keep the size and roll the text back and forth"]
pub const LV_LABEL_LONG_SROLL: lv_label_long_mode_t = 3;
#[doc = "< Keep the size and roll the text circularly"]
pub const LV_LABEL_LONG_SROLL_CIRC: lv_label_long_mode_t = 4;
#[doc = "< Keep the size and crop the text out of it"]
pub const LV_LABEL_LONG_CROP: lv_label_long_mode_t = 5;
#[doc = " Long mode behaviors. Used in 'lv_label_ext_t'"]
pub type _bindgen_ty_32 = u32;
pub type lv_label_long_mode_t = u8;
#[doc = "< Align text to left"]
pub const LV_LABEL_ALIGN_LEFT: lv_label_align_t = 0;
#[doc = "< Align text to center"]
pub const LV_LABEL_ALIGN_CENTER: lv_label_align_t = 1;
#[doc = "< Align text to right"]
pub const LV_LABEL_ALIGN_RIGHT: lv_label_align_t = 2;
#[doc = "< Use LEFT or RIGHT depending on the direction of the text (LTR/RTL)"]
pub const LV_LABEL_ALIGN_AUTO: lv_label_align_t = 3;
#[doc = " Label align policy"]
pub type _bindgen_ty_33 = u32;
pub type lv_label_align_t = u8;
#[doc = " Data of label"]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lv_label_ext_t {
pub text: *mut ::cty::c_char,
pub dot: lv_label_ext_t__bindgen_ty_1,
pub dot_end: u32,
pub anim_speed: u16,
pub offset: lv_point_t,
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize], u8>,
pub __bindgen_padding_0: u32,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union lv_label_ext_t__bindgen_ty_1 {
pub tmp_ptr: *mut ::cty::c_char,
pub tmp: [::cty::c_char; 4usize],
_bindgen_union_align: u64,
}
impl Default for lv_label_ext_t__bindgen_ty_1 {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl Default for lv_label_ext_t {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl lv_label_ext_t {
#[inline]
pub fn long_mode(&self) -> lv_label_long_mode_t {
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u8) }
}
#[inline]
pub fn set_long_mode(&mut self, val: lv_label_long_mode_t) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
self._bitfield_1.set(0usize, 3u8, val as u64)
}
}
#[inline]
pub fn static_txt(&self) -> u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
}
#[inline]
pub fn set_static_txt(&mut self, val: u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
self._bitfield_1.set(3usize, 1u8, val as u64)
}
}
#[inline]
pub fn align(&self) -> u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 2u8) as u8) }
}
#[inline]
pub fn set_align(&mut self, val: u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
self._bitfield_1.set(4usize, 2u8, val as u64)
}
}
#[inline]
pub fn recolor(&self) -> u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u8) }
}
#[inline]
pub fn set_recolor(&mut self, val: u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
self._bitfield_1.set(6usize, 1u8, val as u64)
}
}
#[inline]
pub fn expand(&self) -> u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u8) }
}
#[inline]
pub fn set_expand(&mut self, val: u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
self._bitfield_1.set(7usize, 1u8, val as u64)
}
}
#[inline]
pub fn dot_tmp_alloc(&self) -> u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
}
#[inline]
pub fn set_dot_tmp_alloc(&mut self, val: u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
self._bitfield_1.set(8usize, 1u8, val as u64)
}
}
#[inline]
pub fn new_bitfield_1(
long_mode: lv_label_long_mode_t,
static_txt: u8,
align: u8,
recolor: u8,
expand: u8,
dot_tmp_alloc: u8,
) -> __BindgenBitfieldUnit<[u8; 2usize], u8> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize], u8> =
Default::default();
__bindgen_bitfield_unit.set(0usize, 3u8, {
let long_mode: u8 = unsafe { ::core::mem::transmute(long_mode) };
long_mode as u64
});
__bindgen_bitfield_unit.set(3usize, 1u8, {
let static_txt: u8 = unsafe { ::core::mem::transmute(static_txt) };
static_txt as u64
});
__bindgen_bitfield_unit.set(4usize, 2u8, {
let align: u8 = unsafe { ::core::mem::transmute(align) };
align as u64
});
__bindgen_bitfield_unit.set(6usize, 1u8, {
let recolor: u8 = unsafe { ::core::mem::transmute(recolor) };
recolor as u64
});
__bindgen_bitfield_unit.set(7usize, 1u8, {
let expand: u8 = unsafe { ::core::mem::transmute(expand) };
expand as u64
});
__bindgen_bitfield_unit.set(8usize, 1u8, {
let dot_tmp_alloc: u8 = unsafe { ::core::mem::transmute(dot_tmp_alloc) };
dot_tmp_alloc as u64
});
__bindgen_bitfield_unit
}
}
pub const LV_LABEL_PART_MAIN: lv_label_part_t = 0;
#[doc = " Label styles"]
pub type _bindgen_ty_34 = u32;
pub type lv_label_part_t = u8;
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Create a label objects"]
#[doc = " - __`par`__: pointer to an object, it will be the parent of the new label"]
#[doc = " - __`copy`__: pointer to a button object, if not NULL then the new object will be copied from it"]
#[doc = " Return: pointer to the created button"]
pub fn lv_label_create(par: *mut lv_obj_t, copy: *const lv_obj_t) -> *mut lv_obj_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Set a new text for a label. Memory will be allocated to store the text by the label."]
#[doc = " - __`label`__: pointer to a label object"]
#[doc = " - __`text`__: '\\0' terminated character string. NULL to refresh with the current text."]
pub fn lv_label_set_text(label: *mut lv_obj_t, text: *const ::cty::c_char);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Set a new formatted text for a label. Memory will be allocated to store the text by the label."]
#[doc = " - __`label`__: pointer to a label object"]
#[doc = " - __`fmt`__: `printf`-like format"]
pub fn lv_label_set_text_fmt(label: *mut lv_obj_t, fmt: *const ::cty::c_char, ...);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Set a static text. It will not be saved by the label so the 'text' variable"]
#[doc = " has to be 'alive' while the label exist."]
#[doc = " - __`label`__: pointer to a label object"]
#[doc = " - __`text`__: pointer to a text. NULL to refresh with the current text."]
pub fn lv_label_set_text_static(label: *mut lv_obj_t, text: *const ::cty::c_char);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Set the behavior of the label with longer text then the object size"]
#[doc = " - __`label`__: pointer to a label object"]
#[doc = " - __`long_mode`__: the new mode from 'lv_label_long_mode' enum."]
#[doc = " In LV_LONG_BREAK/LONG/ROLL the size of the label should be set AFTER this"]
#[doc = " function"]
pub fn lv_label_set_long_mode(label: *mut lv_obj_t, long_mode: lv_label_long_mode_t);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Set the align of the label (left or center)"]
#[doc = " - __`label`__: pointer to a label object"]
#[doc = " - __`align`__: 'LV_LABEL_ALIGN_LEFT' or 'LV_LABEL_ALIGN_LEFT'"]
pub fn lv_label_set_align(label: *mut lv_obj_t, align: lv_label_align_t);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Enable the recoloring by in-line commands"]
#[doc = " - __`label`__: pointer to a label object"]
#[doc = " - __`en`__: true: enable recoloring, false: disable"]
pub fn lv_label_set_recolor(label: *mut lv_obj_t, en: bool);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Set the label's animation speed in LV_LABEL_LONG_SROLL/SCROLL_CIRC modes"]
#[doc = " - __`label`__: pointer to a label object"]
#[doc = " - __`anim_speed`__: speed of animation in px/sec unit"]
pub fn lv_label_set_anim_speed(label: *mut lv_obj_t, anim_speed: u16);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " @brief Set the selection start index."]
#[doc = " - __`label`__: pointer to a label object."]
#[doc = " - __`index`__: index to set. `LV_LABEL_TXT_SEL_OFF` to select nothing."]
pub fn lv_label_set_text_sel_start(label: *mut lv_obj_t, index: u32);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " @brief Set the selection end index."]
#[doc = " - __`label`__: pointer to a label object."]
#[doc = " - __`index`__: index to set. `LV_LABEL_TXT_SEL_OFF` to select nothing."]
pub fn lv_label_set_text_sel_end(label: *mut lv_obj_t, index: u32);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get the text of a label"]
#[doc = " - __`label`__: pointer to a label object"]
#[doc = " Return: the text of the label"]
pub fn lv_label_get_text(label: *const lv_obj_t) -> *mut ::cty::c_char;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get the long mode of a label"]
#[doc = " - __`label`__: pointer to a label object"]
#[doc = " Return: the long mode"]
pub fn lv_label_get_long_mode(label: *const lv_obj_t) -> lv_label_long_mode_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get the align attribute"]
#[doc = " - __`label`__: pointer to a label object"]
#[doc = " Return: LV_LABEL_ALIGN_LEFT or LV_LABEL_ALIGN_CENTER"]
pub fn lv_label_get_align(label: *const lv_obj_t) -> lv_label_align_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get the recoloring attribute"]
#[doc = " - __`label`__: pointer to a label object"]
#[doc = " Return: true: recoloring is enabled, false: disable"]
pub fn lv_label_get_recolor(label: *const lv_obj_t) -> bool;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get the label's animation speed in LV_LABEL_LONG_ROLL and SCROLL modes"]
#[doc = " - __`label`__: pointer to a label object"]
#[doc = " Return: speed of animation in px/sec unit"]
pub fn lv_label_get_anim_speed(label: *const lv_obj_t) -> u16;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get the relative x and y coordinates of a letter"]
#[doc = " - __`label`__: pointer to a label object"]
#[doc = " - __`index`__: index of the letter [0 ... text length]. Expressed in character index, not byte"]
#[doc = " index (different in UTF-8)"]
#[doc = " - __`pos`__: store the result here (E.g. index = 0 gives 0;0 coordinates)"]
pub fn lv_label_get_letter_pos(label: *const lv_obj_t, index: u32, pos: *mut lv_point_t);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Get the index of letter on a relative point of a label"]
#[doc = " - __`label`__: pointer to label object"]
#[doc = " - __`pos`__: pointer to point with coordinates on a the label"]
#[doc = " Return: the index of the letter on the 'pos_p' point (E.g. on 0;0 is the 0. letter)"]
#[doc = " Expressed in character index and not byte index (different in UTF-8)"]
pub fn lv_label_get_letter_on(label: *const lv_obj_t, pos: *mut lv_point_t) -> u32;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Check if a character is drawn under a point."]
#[doc = " - __`label`__: Label object"]
#[doc = " - __`pos`__: Point to check for character under"]
#[doc = " Return: whether a character is drawn under the point"]
pub fn lv_label_is_char_under_pos(label: *const lv_obj_t, pos: *mut lv_point_t) -> bool;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " @brief Get the selection start index."]
#[doc = " - __`label`__: pointer to a label object."]
#[doc = " Return: selection start index. `LV_LABEL_TXT_SEL_OFF` if nothing is selected."]
pub fn lv_label_get_text_sel_start(label: *const lv_obj_t) -> u32;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " @brief Get the selection end index."]
#[doc = " - __`label`__: pointer to a label object."]
#[doc = " Return: selection end index. `LV_LABEL_TXT_SEL_OFF` if nothing is selected."]
pub fn lv_label_get_text_sel_end(label: *const lv_obj_t) -> u32;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
pub fn lv_label_get_style(label: *mut lv_obj_t, type_: u8) -> *mut lv_style_list_t;
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Insert a text to the label. The label text can not be static."]
#[doc = " - __`label`__: pointer to a label object"]
#[doc = " - __`pos`__: character index to insert. Expressed in character index and not byte index (Different"]
#[doc = " in UTF-8) 0: before first char. LV_LABEL_POS_LAST: after last char."]
#[doc = " - __`txt`__: pointer to the text to insert"]
pub fn lv_label_ins_text(label: *mut lv_obj_t, pos: u32, txt: *const ::cty::c_char);
}
#[lvgl_macros::safe_wrap(attr)] extern "C" {
#[doc = " Delete characters from a label. The label text can not be static."]
#[doc = " - __`label`__: pointer to a label object"]
#[doc = " - __`pos`__: character index to insert. Expressed in character index and not byte index (Different"]
#[doc = " in UTF-8) 0: before first char."]
#[doc = " - __`cnt`__: number of characters to cut"]
pub fn lv_label_cut_text(label: *mut lv_obj_t, pos: u32, cnt: u32);
}