feat(property): add property name (#6329)
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
This commit is contained in:
@@ -299,6 +299,9 @@
|
|||||||
/*Use obj property set/get API*/
|
/*Use obj property set/get API*/
|
||||||
#define LV_USE_OBJ_PROPERTY 0
|
#define LV_USE_OBJ_PROPERTY 0
|
||||||
|
|
||||||
|
/*Enable property name support*/
|
||||||
|
#define LV_USE_OBJ_PROPERTY_NAME 1
|
||||||
|
|
||||||
/* VG-Lite Simulator */
|
/* VG-Lite Simulator */
|
||||||
/*Requires: LV_USE_THORVG_INTERNAL or LV_USE_THORVG_EXTERNAL */
|
/*Requires: LV_USE_THORVG_INTERNAL or LV_USE_THORVG_EXTERNAL */
|
||||||
#define LV_USE_VG_LITE_THORVG 0
|
#define LV_USE_VG_LITE_THORVG 0
|
||||||
|
|||||||
26
.github/workflows/check_properties.yml
vendored
Normal file
26
.github/workflows/check_properties.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
name: Verify the widget property name
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
verify-property-name:
|
||||||
|
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Generate property names
|
||||||
|
run: python properties.py
|
||||||
|
working-directory: scripts
|
||||||
|
- name: Check that repository is clean
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -o pipefail
|
||||||
|
if ! (git diff --exit-code --color=always | tee /tmp/lvgl_diff.patch); then
|
||||||
|
echo "Please apply the preceding diff to your code or run scripts/properties.py"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
8
Kconfig
8
Kconfig
@@ -626,6 +626,14 @@ menu "LVGL configuration"
|
|||||||
bool "Use obj property set/get API"
|
bool "Use obj property set/get API"
|
||||||
default n
|
default n
|
||||||
|
|
||||||
|
config LV_USE_OBJ_PROPERTY_NAME
|
||||||
|
bool "Use name to access property"
|
||||||
|
default n
|
||||||
|
depends on LV_USE_OBJ_PROPERTY
|
||||||
|
help
|
||||||
|
Add a name table to every widget class, so the property can be accessed by name.
|
||||||
|
Note, the const table will increase flash usage.
|
||||||
|
|
||||||
config LV_USE_VG_LITE_THORVG
|
config LV_USE_VG_LITE_THORVG
|
||||||
bool "VG-Lite Simulator"
|
bool "VG-Lite Simulator"
|
||||||
default n
|
default n
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ Usage
|
|||||||
Two APIs are provided to get/set widget properties. It can be enabled by setting
|
Two APIs are provided to get/set widget properties. It can be enabled by setting
|
||||||
:c:macro:`LV_USE_OBJ_PROPERTY` to `1` in ``lv_conf.h``.
|
:c:macro:`LV_USE_OBJ_PROPERTY` to `1` in ``lv_conf.h``.
|
||||||
|
|
||||||
|
Set :c:macro:`LV_USE_OBJ_PROPERTY_NAME` to `1` in order to use property name instead of ID.
|
||||||
|
|
||||||
.. code:: c
|
.. code:: c
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -35,6 +37,8 @@ Two APIs are provided to get/set widget properties. It can be enabled by setting
|
|||||||
lv_result_t lv_obj_set_property(lv_obj_t * obj, const lv_property_t * value);
|
lv_result_t lv_obj_set_property(lv_obj_t * obj, const lv_property_t * value);
|
||||||
lv_property_t lv_obj_get_property(lv_obj_t * obj, lv_prop_id_t id);
|
lv_property_t lv_obj_get_property(lv_obj_t * obj, lv_prop_id_t id);
|
||||||
|
|
||||||
|
lv_prop_id_t lv_obj_property_get_id(const lv_obj_class_t * clz, const char * name);
|
||||||
|
|
||||||
.. _obj_property_id:
|
.. _obj_property_id:
|
||||||
|
|
||||||
Property ID
|
Property ID
|
||||||
|
|||||||
@@ -321,6 +321,9 @@
|
|||||||
/*Use obj property set/get API*/
|
/*Use obj property set/get API*/
|
||||||
#define LV_USE_OBJ_PROPERTY 0
|
#define LV_USE_OBJ_PROPERTY 0
|
||||||
|
|
||||||
|
/*Enable property name support*/
|
||||||
|
#define LV_USE_OBJ_PROPERTY_NAME 1
|
||||||
|
|
||||||
/* VG-Lite Simulator */
|
/* VG-Lite Simulator */
|
||||||
/*Requires: LV_USE_THORVG_INTERNAL or LV_USE_THORVG_EXTERNAL */
|
/*Requires: LV_USE_THORVG_INTERNAL or LV_USE_THORVG_EXTERNAL */
|
||||||
#define LV_USE_VG_LITE_THORVG 0
|
#define LV_USE_VG_LITE_THORVG 0
|
||||||
|
|||||||
@@ -367,6 +367,9 @@
|
|||||||
/*Use obj property set/get API*/
|
/*Use obj property set/get API*/
|
||||||
#define LV_USE_OBJ_PROPERTY 0
|
#define LV_USE_OBJ_PROPERTY 0
|
||||||
|
|
||||||
|
/*Enable property name support*/
|
||||||
|
#define LV_USE_OBJ_PROPERTY_NAME 1
|
||||||
|
|
||||||
/* VG-Lite Simulator */
|
/* VG-Lite Simulator */
|
||||||
/*Requires: LV_USE_THORVG_INTERNAL or LV_USE_THORVG_EXTERNAL */
|
/*Requires: LV_USE_THORVG_INTERNAL or LV_USE_THORVG_EXTERNAL */
|
||||||
#define LV_USE_VG_LITE_THORVG 0
|
#define LV_USE_VG_LITE_THORVG 0
|
||||||
|
|||||||
217
scripts/properties.py
Executable file
217
scripts/properties.py
Executable file
@@ -0,0 +1,217 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import argparse
|
||||||
|
from collections import defaultdict
|
||||||
|
|
||||||
|
|
||||||
|
style_properties_type = {
|
||||||
|
"LV_STYLE_BG_COLOR": "LV_PROPERTY_TYPE_COLOR",
|
||||||
|
"LV_STYLE_BG_GRAD_COLOR": "LV_PROPERTY_TYPE_COLOR",
|
||||||
|
"LV_STYLE_BG_IMAGE_SRC": "LV_PROPERTY_TYPE_IMGSRC",
|
||||||
|
"LV_STYLE_BG_IMAGE_RECOLOR": "LV_PROPERTY_TYPE_COLOR",
|
||||||
|
"LV_STYLE_BORDER_COLOR": "LV_PROPERTY_TYPE_COLOR",
|
||||||
|
"LV_STYLE_OUTLINE_COLOR": "LV_PROPERTY_TYPE_COLOR",
|
||||||
|
"LV_STYLE_SHADOW_COLOR": "LV_PROPERTY_TYPE_COLOR",
|
||||||
|
"LV_STYLE_IMAGE_RECOLOR": "LV_PROPERTY_TYPE_COLOR",
|
||||||
|
"LV_STYLE_ARCH_IMAGE_SRC": "LV_PROPERTY_TYPE_IMGSRC",
|
||||||
|
"LV_STYLE_ARCH_COLOR": "LV_PROPERTY_TYPE_COLOR",
|
||||||
|
"LV_STYLE_TEXT_COLOR": "LV_PROPERTY_TYPE_COLOR",
|
||||||
|
"LV_STYLE_TEXT_FONT": "LV_PROPERTY_TYPE_FONT",
|
||||||
|
"LV_STYLE_LINE_COLOR": "LV_PROPERTY_TYPE_COLOR",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class Property:
|
||||||
|
def __init__(self, widget, name, type, index, id):
|
||||||
|
self.widget = widget
|
||||||
|
self.name = name
|
||||||
|
self.type = type
|
||||||
|
self.index = index
|
||||||
|
self.id = id
|
||||||
|
|
||||||
|
|
||||||
|
def find_headers(directory):
|
||||||
|
if os.path.isfile(directory):
|
||||||
|
yield directory
|
||||||
|
return
|
||||||
|
|
||||||
|
for root, dirs, files in os.walk(directory):
|
||||||
|
for file in files:
|
||||||
|
if file.endswith('.h'):
|
||||||
|
yield os.path.join(root, file)
|
||||||
|
|
||||||
|
|
||||||
|
def read_widget_properties(directory):
|
||||||
|
|
||||||
|
def match_properties(file_path):
|
||||||
|
pattern = r'^\s*LV_PROPERTY_ID\((\w+),\s*(\w+),\s*(\w+),\s*(\d+)\)'
|
||||||
|
with open(file_path, 'r') as file:
|
||||||
|
for line in file.readlines():
|
||||||
|
match = re.match(pattern, line)
|
||||||
|
if match:
|
||||||
|
id = f"LV_PROPERTY_{match.group(1).upper()}_{match.group(2).upper()}"
|
||||||
|
yield Property(
|
||||||
|
match.group(1).lower(),
|
||||||
|
match.group(2).lower(), match.group(3), match.group(4),
|
||||||
|
id)
|
||||||
|
|
||||||
|
def match_styles(file_path):
|
||||||
|
pattern = r'^\s+LV_STYLE_(\w+)\s*=\s*(\d+),'
|
||||||
|
with open(file_path, 'r') as file:
|
||||||
|
for line in file.readlines():
|
||||||
|
match = re.match(pattern, line)
|
||||||
|
if match:
|
||||||
|
name = match.group(1).upper()
|
||||||
|
id = f"LV_PROPERTY_STYLE_{name}"
|
||||||
|
yield Property("style",
|
||||||
|
match.group(1).lower(), "style",
|
||||||
|
match.group(2), id)
|
||||||
|
|
||||||
|
properties_by_widget = defaultdict(list)
|
||||||
|
for file_path in find_headers(directory):
|
||||||
|
for property in match_properties(file_path):
|
||||||
|
properties_by_widget[property.widget].append(property)
|
||||||
|
|
||||||
|
for property in match_styles(file_path):
|
||||||
|
properties_by_widget[property.widget].append(property)
|
||||||
|
|
||||||
|
for widget, properties in properties_by_widget.items():
|
||||||
|
# sort properties by property name
|
||||||
|
properties.sort(key=lambda x: x.name)
|
||||||
|
properties_by_widget[widget] = properties
|
||||||
|
|
||||||
|
return properties_by_widget
|
||||||
|
|
||||||
|
|
||||||
|
def write_widget_properties(output, properties_by_widget):
|
||||||
|
# Open header file for update.
|
||||||
|
with open(f'{output}/lv_obj_property_names.h', "w") as header:
|
||||||
|
header.write(f'''
|
||||||
|
/**
|
||||||
|
* @file lv_obj_property_names.h
|
||||||
|
* GENERATED FILE, DO NOT EDIT IT!
|
||||||
|
*/
|
||||||
|
#ifndef LV_OBJ_PROPERTY_NAMES_H
|
||||||
|
#define LV_OBJ_PROPERTY_NAMES_H
|
||||||
|
|
||||||
|
#include "../../misc/lv_types.h"
|
||||||
|
|
||||||
|
#if LV_USE_OBJ_PROPERTY && LV_USE_OBJ_PROPERTY_NAME
|
||||||
|
|
||||||
|
''')
|
||||||
|
|
||||||
|
for widget in sorted(properties_by_widget.keys()):
|
||||||
|
properties = properties_by_widget[widget]
|
||||||
|
file_name = f'lv_{widget}_properties.c'
|
||||||
|
output_file = f'{output}/{file_name}'
|
||||||
|
|
||||||
|
count = len(properties)
|
||||||
|
if widget == 'style':
|
||||||
|
include = "lv_style_properties.h"
|
||||||
|
guard = None
|
||||||
|
elif widget == "obj":
|
||||||
|
include = "../../core/lv_obj.h"
|
||||||
|
guard = None
|
||||||
|
else:
|
||||||
|
include = f'../{widget}/lv_{widget}.h'
|
||||||
|
guard = f"#if LV_USE_{widget.upper()}"
|
||||||
|
|
||||||
|
with open(output_file, 'w') as f:
|
||||||
|
f.write(f'''
|
||||||
|
/**
|
||||||
|
* GENERATED FILE, DO NOT EDIT IT!
|
||||||
|
* @file {file_name}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "{include}"
|
||||||
|
|
||||||
|
#if LV_USE_OBJ_PROPERTY && LV_USE_OBJ_PROPERTY_NAME
|
||||||
|
|
||||||
|
{guard if guard else ""}
|
||||||
|
/**
|
||||||
|
* {widget.capitalize() + ' widget' if widget != 'style' else 'Style'} property names, name must be in order.
|
||||||
|
* Generated code from properties.py
|
||||||
|
*/
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
const lv_property_name_t lv_{widget}_property_names[{count}] = {{
|
||||||
|
''')
|
||||||
|
|
||||||
|
for property in properties:
|
||||||
|
name = property.name
|
||||||
|
name_str = '"' + name + '",'
|
||||||
|
f.write(f" {{{name_str :25} {property.id},}},\n")
|
||||||
|
|
||||||
|
f.write('};\n')
|
||||||
|
if guard:
|
||||||
|
f.write(f"#endif /*LV_USE_{widget.upper()}*/\n\n")
|
||||||
|
f.write("/* *INDENT-ON* */\n")
|
||||||
|
f.write('#endif\n')
|
||||||
|
header.write(
|
||||||
|
f' extern const lv_property_name_t lv_{widget}_property_names[{count}];\n'
|
||||||
|
)
|
||||||
|
header.write('#endif\n')
|
||||||
|
header.write('#endif\n')
|
||||||
|
|
||||||
|
|
||||||
|
def write_style_header(output, properties_by_widget):
|
||||||
|
properties = properties_by_widget['style']
|
||||||
|
|
||||||
|
output_file = f'{output}/lv_style_properties.h'
|
||||||
|
|
||||||
|
with open(output_file, 'w') as f:
|
||||||
|
f.write(f'''
|
||||||
|
/**
|
||||||
|
* GENERATED FILE, DO NOT EDIT IT!
|
||||||
|
* @file lv_style_properties.h
|
||||||
|
*/
|
||||||
|
#ifndef LV_STYLE_PROPERTIES_H
|
||||||
|
#define LV_STYLE_PROPERTIES_H
|
||||||
|
|
||||||
|
#include "../../core/lv_obj_property.h"
|
||||||
|
#if LV_USE_OBJ_PROPERTY
|
||||||
|
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
enum {{
|
||||||
|
''')
|
||||||
|
|
||||||
|
for property in properties:
|
||||||
|
name = property.name
|
||||||
|
id_type = style_properties_type.get(f"LV_STYLE_{name.upper()}",
|
||||||
|
"LV_PROPERTY_TYPE_INT")
|
||||||
|
f.write(
|
||||||
|
f" LV_PROPERTY_ID(STYLE, {name.upper() + ',' :25} {id_type+',' :28} LV_STYLE_{name.upper()}),\n"
|
||||||
|
)
|
||||||
|
|
||||||
|
f.write('};\n\n')
|
||||||
|
f.write('#endif\n')
|
||||||
|
f.write('#endif\n')
|
||||||
|
|
||||||
|
|
||||||
|
def main(directory, output):
|
||||||
|
property = read_widget_properties(directory)
|
||||||
|
write_widget_properties(output, property)
|
||||||
|
write_style_header(output, property)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
description='Search files and filter lines.')
|
||||||
|
parser.add_argument('-d', '--directory',
|
||||||
|
help='Directory to lvgl root path')
|
||||||
|
parser.add_argument(
|
||||||
|
'-o', '--output', help='Folders to write generated properties for all widgets.')
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
# default directory is the lvgl root path of where this script sits
|
||||||
|
if args.directory is None:
|
||||||
|
args.directory = os.path.join(os.path.dirname(__file__), "../")
|
||||||
|
|
||||||
|
if args.output is None:
|
||||||
|
args.output = os.path.join(args.directory, "src/widgets/property/")
|
||||||
|
|
||||||
|
# create output directory if it doesn't exist
|
||||||
|
os.makedirs(args.output, exist_ok=True)
|
||||||
|
|
||||||
|
main(args.directory, args.output)
|
||||||
@@ -84,6 +84,12 @@ const lv_obj_class_t lv_obj_class = {
|
|||||||
.prop_index_end = LV_PROPERTY_OBJ_END,
|
.prop_index_end = LV_PROPERTY_OBJ_END,
|
||||||
.properties = properties,
|
.properties = properties,
|
||||||
.properties_count = sizeof(properties) / sizeof(properties[0]),
|
.properties_count = sizeof(properties) / sizeof(properties[0]),
|
||||||
|
|
||||||
|
#if LV_USE_OBJ_PROPERTY_NAME
|
||||||
|
.property_names = lv_obj_property_names,
|
||||||
|
.names_count = sizeof(lv_obj_property_names) / sizeof(lv_property_name_t),
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,12 @@ struct _lv_obj_class_t {
|
|||||||
uint32_t prop_index_end;
|
uint32_t prop_index_end;
|
||||||
const lv_property_ops_t * properties;
|
const lv_property_ops_t * properties;
|
||||||
uint32_t properties_count;
|
uint32_t properties_count;
|
||||||
|
|
||||||
|
#if LV_USE_OBJ_PROPERTY_NAME
|
||||||
|
/* An array of property ID and name */
|
||||||
|
const lv_property_name_t * property_names;
|
||||||
|
uint32_t names_count;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void * user_data;
|
void * user_data;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
*********************/
|
*********************/
|
||||||
#include "../core/lv_obj.h"
|
#include "../core/lv_obj.h"
|
||||||
#include "../stdlib/lv_string.h"
|
#include "../stdlib/lv_string.h"
|
||||||
|
#include "../misc/lv_utils.h"
|
||||||
#include "lv_obj_property.h"
|
#include "lv_obj_property.h"
|
||||||
|
|
||||||
#if LV_USE_OBJ_PROPERTY
|
#if LV_USE_OBJ_PROPERTY
|
||||||
@@ -21,13 +22,17 @@
|
|||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
typedef void (*lv_property_set_int_t)(lv_obj_t *, int32_t);
|
typedef void (*lv_property_set_int_t)(lv_obj_t *, int32_t);
|
||||||
typedef void (*lv_property_set_pointer_t)(lv_obj_t *, const void *);
|
typedef void (*lv_property_set_precise_t)(lv_obj_t *, lv_value_precise_t);
|
||||||
typedef void (*lv_property_set_color_t)(lv_obj_t *, lv_color_t);
|
typedef void (*lv_property_set_color_t)(lv_obj_t *, lv_color_t);
|
||||||
|
typedef void (*lv_property_set_point_t)(lv_obj_t *, lv_point_t *);
|
||||||
|
typedef void (*lv_property_set_pointer_t)(lv_obj_t *, const void *);
|
||||||
typedef lv_result_t (*lv_property_setter_t)(lv_obj_t *, lv_prop_id_t, const lv_property_t *);
|
typedef lv_result_t (*lv_property_setter_t)(lv_obj_t *, lv_prop_id_t, const lv_property_t *);
|
||||||
|
|
||||||
typedef int32_t (*lv_property_get_int_t)(const lv_obj_t *);
|
typedef int32_t (*lv_property_get_int_t)(const lv_obj_t *);
|
||||||
typedef void * (*lv_property_get_pointer_t)(const lv_obj_t *);
|
typedef lv_value_precise_t (*lv_property_get_precise_t)(const lv_obj_t *);
|
||||||
typedef lv_color_t (*lv_property_get_color_t)(const lv_obj_t *);
|
typedef lv_color_t (*lv_property_get_color_t)(const lv_obj_t *);
|
||||||
|
typedef lv_point_t (*lv_property_get_point_t)(lv_obj_t *);
|
||||||
|
typedef void * (*lv_property_get_pointer_t)(const lv_obj_t *);
|
||||||
typedef lv_result_t (*lv_property_getter_t)(const lv_obj_t *, lv_prop_id_t, lv_property_t *);
|
typedef lv_result_t (*lv_property_getter_t)(const lv_obj_t *, lv_prop_id_t, lv_property_t *);
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
@@ -35,6 +40,7 @@ typedef lv_result_t (*lv_property_getter_t)(const lv_obj_t *, lv_prop_id_t, lv_p
|
|||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
static lv_result_t obj_property(lv_obj_t * obj, lv_prop_id_t id, lv_property_t * value, bool set);
|
static lv_result_t obj_property(lv_obj_t * obj, lv_prop_id_t id, lv_property_t * value, bool set);
|
||||||
|
static int32_t property_name_compare(const void * ref, const void * element);
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC VARIABLES
|
* STATIC VARIABLES
|
||||||
@@ -52,13 +58,14 @@ lv_result_t lv_obj_set_property(lv_obj_t * obj, const lv_property_t * value)
|
|||||||
{
|
{
|
||||||
LV_ASSERT(obj && value);
|
LV_ASSERT(obj && value);
|
||||||
|
|
||||||
if(value->id == LV_PROPERTY_ID_INVALID) {
|
uint32_t index = LV_PROPERTY_ID_INDEX(value->id);
|
||||||
|
if(value->id == LV_PROPERTY_ID_INVALID || index < LV_PROPERTY_STYLE_START || index >= LV_PROPERTY_ID_BUILTIN_LAST) {
|
||||||
LV_LOG_WARN("Invalid property id set to %p", obj);
|
LV_LOG_WARN("Invalid property id set to %p", obj);
|
||||||
return LV_RESULT_INVALID;
|
return LV_RESULT_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(value->id < LV_PROPERTY_ID_START) {
|
if(index < LV_PROPERTY_ID_START) {
|
||||||
lv_obj_set_local_style_prop(obj, value->id, value->style, value->selector);
|
lv_obj_set_local_style_prop(obj, index, value->style, value->selector);
|
||||||
return LV_RESULT_OK;
|
return LV_RESULT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,15 +89,16 @@ lv_property_t lv_obj_get_property(lv_obj_t * obj, lv_prop_id_t id)
|
|||||||
lv_result_t result;
|
lv_result_t result;
|
||||||
lv_property_t value;
|
lv_property_t value;
|
||||||
|
|
||||||
if(id == LV_PROPERTY_ID_INVALID) {
|
uint32_t index = LV_PROPERTY_ID_INDEX(id);
|
||||||
|
if(id == LV_PROPERTY_ID_INVALID || index < LV_PROPERTY_STYLE_START || index >= LV_PROPERTY_ID_BUILTIN_LAST) {
|
||||||
LV_LOG_WARN("Invalid property id to get from %p", obj);
|
LV_LOG_WARN("Invalid property id to get from %p", obj);
|
||||||
value.id = LV_PROPERTY_ID_INVALID;
|
value.id = LV_PROPERTY_ID_INVALID;
|
||||||
value.num = 0;
|
value.num = 0;
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(id < LV_PROPERTY_ID_START) {
|
if(index < LV_PROPERTY_ID_START) {
|
||||||
lv_obj_get_local_style_prop(obj, id, &value.style, 0);
|
lv_obj_get_local_style_prop(obj, index, &value.style, 0);
|
||||||
value.id = id;
|
value.id = id;
|
||||||
value.selector = 0;
|
value.selector = 0;
|
||||||
return value;
|
return value;
|
||||||
@@ -120,6 +128,40 @@ lv_property_t lv_obj_get_style_property(lv_obj_t * obj, lv_prop_id_t id, uint32_
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lv_prop_id_t lv_obj_property_get_id(const lv_obj_t * obj, const char * name)
|
||||||
|
{
|
||||||
|
#if LV_USE_OBJ_PROPERTY_NAME
|
||||||
|
const lv_obj_class_t * clz;
|
||||||
|
const lv_property_name_t * names;
|
||||||
|
lv_property_name_t * found;
|
||||||
|
|
||||||
|
for(clz = obj->class_p; clz; clz = clz->base_class) {
|
||||||
|
names = clz->property_names;
|
||||||
|
if(names == NULL) {
|
||||||
|
/* try base class*/
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
found = _lv_utils_bsearch(name, names, clz->names_count, sizeof(lv_property_name_t), property_name_compare);
|
||||||
|
if(found) return found->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Check style property*/
|
||||||
|
found = _lv_utils_bsearch(name, lv_style_property_names, sizeof(lv_style_property_names) / sizeof(lv_property_name_t),
|
||||||
|
sizeof(lv_property_name_t), property_name_compare);
|
||||||
|
if(found) return found->id;
|
||||||
|
#else
|
||||||
|
LV_UNUSED(obj);
|
||||||
|
LV_UNUSED(name);
|
||||||
|
LV_UNUSED(property_name_compare);
|
||||||
|
#endif
|
||||||
|
return LV_PROPERTY_ID_INVALID;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**********************
|
||||||
|
* STATIC FUNCTIONS
|
||||||
|
**********************/
|
||||||
|
|
||||||
static lv_result_t obj_property(lv_obj_t * obj, lv_prop_id_t id, lv_property_t * value, bool set)
|
static lv_result_t obj_property(lv_obj_t * obj, lv_prop_id_t id, lv_property_t * value, bool set)
|
||||||
{
|
{
|
||||||
const lv_property_ops_t * properties;
|
const lv_property_ops_t * properties;
|
||||||
@@ -165,23 +207,41 @@ static lv_result_t obj_property(lv_obj_t * obj, lv_prop_id_t id, lv_property_t *
|
|||||||
if(!set) value->id = prop->id;
|
if(!set) value->id = prop->id;
|
||||||
|
|
||||||
switch(LV_PROPERTY_ID_TYPE(prop->id)) {
|
switch(LV_PROPERTY_ID_TYPE(prop->id)) {
|
||||||
case LV_PROPERTY_TYPE_INT:
|
case LV_PROPERTY_TYPE_INT: {
|
||||||
if(set)((lv_property_set_int_t)(prop->setter))(obj, value->num);
|
if(set)((lv_property_set_int_t)(prop->setter))(obj, value->num);
|
||||||
else value->num = ((lv_property_get_int_t)(prop->getter))(obj);
|
else value->num = ((lv_property_get_int_t)(prop->getter))(obj);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
case LV_PROPERTY_TYPE_PRECISE: {
|
||||||
|
if(set)((lv_property_set_precise_t)(prop->setter))(obj, value->precise);
|
||||||
|
else value->precise = ((lv_property_get_precise_t)(prop->getter))(obj);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LV_PROPERTY_TYPE_COLOR: {
|
||||||
|
if(set)((lv_property_set_color_t)prop->setter)(obj, value->color);
|
||||||
|
else value->color = ((lv_property_get_color_t)(prop->getter))(obj);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LV_PROPERTY_TYPE_POINT: {
|
||||||
|
lv_point_t * point = &value->point;
|
||||||
|
if(set)((lv_property_set_point_t)(prop->setter))(obj, point);
|
||||||
|
else *point = ((lv_property_get_point_t)(prop->getter))(obj);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case LV_PROPERTY_TYPE_POINTER:
|
case LV_PROPERTY_TYPE_POINTER:
|
||||||
case LV_PROPERTY_TYPE_IMGSRC:
|
case LV_PROPERTY_TYPE_IMGSRC:
|
||||||
if(set)((lv_property_set_pointer_t)(prop->setter))(obj, value->ptr);
|
case LV_PROPERTY_TYPE_TEXT:
|
||||||
else value->ptr = ((lv_property_get_pointer_t)(prop->getter))(obj);
|
case LV_PROPERTY_TYPE_OBJ:
|
||||||
break;
|
case LV_PROPERTY_TYPE_DISPLAY:
|
||||||
case LV_PROPERTY_TYPE_COLOR:
|
case LV_PROPERTY_TYPE_FONT: {
|
||||||
if(set)((lv_property_set_color_t)prop->setter)(obj, value->color);
|
if(set)((lv_property_set_pointer_t)(prop->setter))(obj, value->ptr);
|
||||||
else value->color = ((lv_property_get_color_t)(prop->getter))(obj);
|
else value->ptr = ((lv_property_get_pointer_t)(prop->getter))(obj);
|
||||||
break;
|
break;
|
||||||
default:
|
}
|
||||||
LV_LOG_WARN("Unknown property id: 0x%08x", prop->id);
|
default: {
|
||||||
return LV_RESULT_INVALID;
|
LV_LOG_WARN("Unknown property id: 0x%08x", prop->id);
|
||||||
break;
|
return LV_RESULT_INVALID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return LV_RESULT_OK;
|
return LV_RESULT_OK;
|
||||||
@@ -194,4 +254,10 @@ static lv_result_t obj_property(lv_obj_t * obj, lv_prop_id_t id, lv_property_t *
|
|||||||
return LV_RESULT_INVALID;
|
return LV_RESULT_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int32_t property_name_compare(const void * ref, const void * element)
|
||||||
|
{
|
||||||
|
const lv_property_name_t * prop = element;
|
||||||
|
return lv_strcmp(ref, prop->name);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /*LV_USE_OBJ_PROPERTY*/
|
#endif /*LV_USE_OBJ_PROPERTY*/
|
||||||
|
|||||||
@@ -27,17 +27,24 @@ extern "C" {
|
|||||||
#define LV_PROPERTY_TYPE_INT 1 /*int32_t type*/
|
#define LV_PROPERTY_TYPE_INT 1 /*int32_t type*/
|
||||||
#define LV_PROPERTY_TYPE_PRECISE 2 /*lv_value_precise_t, int32_t or float depending on LV_USE_FLOAT*/
|
#define LV_PROPERTY_TYPE_PRECISE 2 /*lv_value_precise_t, int32_t or float depending on LV_USE_FLOAT*/
|
||||||
#define LV_PROPERTY_TYPE_COLOR 3 /*ARGB8888 type*/
|
#define LV_PROPERTY_TYPE_COLOR 3 /*ARGB8888 type*/
|
||||||
#define LV_PROPERTY_TYPE_POINTER 4 /*void * pointer*/
|
#define LV_PROPERTY_TYPE_POINT 4 /*lv_point_t */
|
||||||
#define LV_PROPERTY_TYPE_IMGSRC 5 /*Special pointer for image*/
|
#define LV_PROPERTY_TYPE_POINTER 5 /*void * pointer*/
|
||||||
|
#define LV_PROPERTY_TYPE_IMGSRC 6 /*Special pointer for image*/
|
||||||
|
#define LV_PROPERTY_TYPE_TEXT 7 /*Special pointer of char* */
|
||||||
|
#define LV_PROPERTY_TYPE_OBJ 8 /*Special pointer of lv_obj_t* */
|
||||||
|
#define LV_PROPERTY_TYPE_DISPLAY 9 /*Special pointer of lv_display_t* */
|
||||||
|
#define LV_PROPERTY_TYPE_FONT 10 /*Special pointer of lv_font_t* */
|
||||||
|
|
||||||
#define LV_PROPERTY_ID(clz, name, type, index) LV_PROPERTY_## clz ##_##name = (LV_PROPERTY_## clz ##_START + (index)) | ((type) << 28)
|
#define LV_PROPERTY_TYPE_SHIFT 28
|
||||||
|
#define LV_PROPERTY_ID(clz, name, type, index) LV_PROPERTY_## clz ##_##name = (LV_PROPERTY_## clz ##_START + (index)) | ((type) << LV_PROPERTY_TYPE_SHIFT)
|
||||||
|
|
||||||
#define LV_PROPERTY_ID_TYPE(id) ((id) >> 28)
|
#define LV_PROPERTY_ID_TYPE(id) ((id) >> LV_PROPERTY_TYPE_SHIFT)
|
||||||
#define LV_PROPERTY_ID_INDEX(id) ((id) & 0xfffffff)
|
#define LV_PROPERTY_ID_INDEX(id) ((id) & 0xfffffff)
|
||||||
|
|
||||||
/*Set properties from an array of lv_property_t*/
|
/*Set properties from an array of lv_property_t*/
|
||||||
#define LV_OBJ_SET_PROPERTY_ARRAY(obj, array) lv_obj_set_properties(obj, array, sizeof(array)/sizeof(array[0]))
|
#define LV_OBJ_SET_PROPERTY_ARRAY(obj, array) lv_obj_set_properties(obj, array, sizeof(array)/sizeof(array[0]))
|
||||||
|
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* TYPEDEFS
|
* TYPEDEFS
|
||||||
**********************/
|
**********************/
|
||||||
@@ -48,9 +55,10 @@ extern "C" {
|
|||||||
enum {
|
enum {
|
||||||
LV_PROPERTY_ID_INVALID = 0,
|
LV_PROPERTY_ID_INVALID = 0,
|
||||||
|
|
||||||
/*ID 0 to 0xff are style ID, check lv_style_prop_t*/
|
/*ID 0x01 to 0xff are style ID, check lv_style_prop_t*/
|
||||||
LV_PROPERTY_ID_START = 0x100, /*ID little than 0xff is style ID*/
|
LV_PROPERTY_STYLE_START = 0x01,
|
||||||
|
|
||||||
|
LV_PROPERTY_ID_START = 0x100, /*ID little than 0xff is style ID*/
|
||||||
/*Define the property ID for every widget here. */
|
/*Define the property ID for every widget here. */
|
||||||
LV_PROPERTY_OBJ_START = 0x100, /* lv_obj.c */
|
LV_PROPERTY_OBJ_START = 0x100, /* lv_obj.c */
|
||||||
LV_PROPERTY_IMAGE_START = 0x200, /* lv_image.c */
|
LV_PROPERTY_IMAGE_START = 0x200, /* lv_image.c */
|
||||||
@@ -62,7 +70,10 @@ enum {
|
|||||||
LV_PROPERTY_ID_ANY = 0x7ffffffe,
|
LV_PROPERTY_ID_ANY = 0x7ffffffe,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef uint32_t lv_prop_id_t;
|
struct _lv_property_name_t {
|
||||||
|
const char * name;
|
||||||
|
lv_prop_id_t id;
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
lv_prop_id_t id;
|
lv_prop_id_t id;
|
||||||
@@ -71,6 +82,7 @@ typedef struct {
|
|||||||
const void * ptr; /**< Constant pointers (font, cone text, etc)*/
|
const void * ptr; /**< Constant pointers (font, cone text, etc)*/
|
||||||
lv_color_t color; /**< Colors*/
|
lv_color_t color; /**< Colors*/
|
||||||
lv_value_precise_t precise; /**< float or int for precise value*/
|
lv_value_precise_t precise; /**< float or int for precise value*/
|
||||||
|
lv_point_t point; /**< Point*/
|
||||||
struct {
|
struct {
|
||||||
/**
|
/**
|
||||||
* Note that place struct member `style` at first place is intended.
|
* Note that place struct member `style` at first place is intended.
|
||||||
@@ -101,8 +113,8 @@ typedef struct {
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
lv_prop_id_t id;
|
lv_prop_id_t id;
|
||||||
|
|
||||||
void * setter;
|
void * setter; /**< Callback used to set property. */
|
||||||
void * getter;
|
void * getter; /**< Callback used to get property. */
|
||||||
} lv_property_ops_t;
|
} lv_property_ops_t;
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
@@ -153,10 +165,21 @@ lv_property_t lv_obj_get_property(lv_obj_t * obj, lv_prop_id_t id);
|
|||||||
*/
|
*/
|
||||||
lv_property_t lv_obj_get_style_property(lv_obj_t * obj, lv_prop_id_t id, uint32_t selector);
|
lv_property_t lv_obj_get_style_property(lv_obj_t * obj, lv_prop_id_t id, uint32_t selector);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the property ID by name. Requires to enable `LV_USE_OBJ_PROPERTY_NAME`.
|
||||||
|
* @param obj pointer to an object that has specified property or base class has.
|
||||||
|
* @param name property name
|
||||||
|
* @return property ID found or `LV_PROPERTY_ID_INVALID` if not found.
|
||||||
|
*/
|
||||||
|
lv_prop_id_t lv_obj_property_get_id(const lv_obj_t * obj, const char * name);
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* MACROS
|
* MACROS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
|
#include "../widgets/property/lv_obj_property_names.h"
|
||||||
|
#include "../widgets/property/lv_style_properties.h"
|
||||||
|
|
||||||
#endif /*LV_USE_OBJ_PROPERTY*/
|
#endif /*LV_USE_OBJ_PROPERTY*/
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -1078,6 +1078,19 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*Enable property name support*/
|
||||||
|
#ifndef LV_USE_OBJ_PROPERTY_NAME
|
||||||
|
#ifdef _LV_KCONFIG_PRESENT
|
||||||
|
#ifdef CONFIG_LV_USE_OBJ_PROPERTY_NAME
|
||||||
|
#define LV_USE_OBJ_PROPERTY_NAME CONFIG_LV_USE_OBJ_PROPERTY_NAME
|
||||||
|
#else
|
||||||
|
#define LV_USE_OBJ_PROPERTY_NAME 0
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define LV_USE_OBJ_PROPERTY_NAME 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* VG-Lite Simulator */
|
/* VG-Lite Simulator */
|
||||||
/*Requires: LV_USE_THORVG_INTERNAL or LV_USE_THORVG_EXTERNAL */
|
/*Requires: LV_USE_THORVG_INTERNAL or LV_USE_THORVG_EXTERNAL */
|
||||||
#ifndef LV_USE_VG_LITE_THORVG
|
#ifndef LV_USE_VG_LITE_THORVG
|
||||||
|
|||||||
@@ -342,15 +342,12 @@ enum _lv_style_prop_t {
|
|||||||
LV_STYLE_BITMAP_MASK_SRC = 115,
|
LV_STYLE_BITMAP_MASK_SRC = 115,
|
||||||
LV_STYLE_ROTARY_SENSITIVITY = 116,
|
LV_STYLE_ROTARY_SENSITIVITY = 116,
|
||||||
|
|
||||||
#if LV_USE_FLEX
|
|
||||||
LV_STYLE_FLEX_FLOW = 125,
|
LV_STYLE_FLEX_FLOW = 125,
|
||||||
LV_STYLE_FLEX_MAIN_PLACE = 126,
|
LV_STYLE_FLEX_MAIN_PLACE = 126,
|
||||||
LV_STYLE_FLEX_CROSS_PLACE = 127,
|
LV_STYLE_FLEX_CROSS_PLACE = 127,
|
||||||
LV_STYLE_FLEX_TRACK_PLACE = 128,
|
LV_STYLE_FLEX_TRACK_PLACE = 128,
|
||||||
LV_STYLE_FLEX_GROW = 129,
|
LV_STYLE_FLEX_GROW = 129,
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LV_USE_GRID
|
|
||||||
LV_STYLE_GRID_COLUMN_ALIGN = 130,
|
LV_STYLE_GRID_COLUMN_ALIGN = 130,
|
||||||
LV_STYLE_GRID_ROW_ALIGN = 131,
|
LV_STYLE_GRID_ROW_ALIGN = 131,
|
||||||
LV_STYLE_GRID_ROW_DSC_ARRAY = 132,
|
LV_STYLE_GRID_ROW_DSC_ARRAY = 132,
|
||||||
@@ -361,7 +358,6 @@ enum _lv_style_prop_t {
|
|||||||
LV_STYLE_GRID_CELL_ROW_POS = 137,
|
LV_STYLE_GRID_CELL_ROW_POS = 137,
|
||||||
LV_STYLE_GRID_CELL_ROW_SPAN = 138,
|
LV_STYLE_GRID_CELL_ROW_SPAN = 138,
|
||||||
LV_STYLE_GRID_CELL_Y_ALIGN = 139,
|
LV_STYLE_GRID_CELL_Y_ALIGN = 139,
|
||||||
#endif
|
|
||||||
|
|
||||||
_LV_STYLE_LAST_BUILT_IN_PROP = 140,
|
_LV_STYLE_LAST_BUILT_IN_PROP = 140,
|
||||||
|
|
||||||
|
|||||||
@@ -148,6 +148,13 @@ typedef struct _lv_font_t lv_font_t;
|
|||||||
struct _lv_image_decoder_t;
|
struct _lv_image_decoder_t;
|
||||||
typedef struct _lv_image_decoder_t lv_image_decoder_t;
|
typedef struct _lv_image_decoder_t lv_image_decoder_t;
|
||||||
|
|
||||||
|
typedef uint32_t lv_prop_id_t;
|
||||||
|
|
||||||
|
#if LV_USE_OBJ_PROPERTY
|
||||||
|
struct _lv_property_name_t;
|
||||||
|
typedef struct _lv_property_name_t lv_property_name_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if LV_USE_SYSMON
|
#if LV_USE_SYSMON
|
||||||
|
|
||||||
struct _lv_sysmon_backend_data_t;
|
struct _lv_sysmon_backend_data_t;
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ static const lv_property_ops_t properties[] = {
|
|||||||
{
|
{
|
||||||
.id = LV_PROPERTY_IMAGE_PIVOT,
|
.id = LV_PROPERTY_IMAGE_PIVOT,
|
||||||
.setter = _lv_image_set_pivot,
|
.setter = _lv_image_set_pivot,
|
||||||
.getter = lv_image_get_pivot,
|
.getter = _lv_image_get_pivot,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.id = LV_PROPERTY_IMAGE_SCALE,
|
.id = LV_PROPERTY_IMAGE_SCALE,
|
||||||
@@ -107,6 +107,12 @@ const lv_obj_class_t lv_image_class = {
|
|||||||
.prop_index_end = LV_PROPERTY_IMAGE_END,
|
.prop_index_end = LV_PROPERTY_IMAGE_END,
|
||||||
.properties = properties,
|
.properties = properties,
|
||||||
.properties_count = sizeof(properties) / sizeof(properties[0]),
|
.properties_count = sizeof(properties) / sizeof(properties[0]),
|
||||||
|
|
||||||
|
#if LV_USE_OBJ_PROPERTY_NAME
|
||||||
|
.property_names = lv_image_property_names,
|
||||||
|
.names_count = sizeof(lv_image_property_names) / sizeof(lv_property_name_t),
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ enum {
|
|||||||
LV_PROPERTY_ID(IMAGE, OFFSET_X, LV_PROPERTY_TYPE_INT, 1),
|
LV_PROPERTY_ID(IMAGE, OFFSET_X, LV_PROPERTY_TYPE_INT, 1),
|
||||||
LV_PROPERTY_ID(IMAGE, OFFSET_Y, LV_PROPERTY_TYPE_INT, 2),
|
LV_PROPERTY_ID(IMAGE, OFFSET_Y, LV_PROPERTY_TYPE_INT, 2),
|
||||||
LV_PROPERTY_ID(IMAGE, ROTATION, LV_PROPERTY_TYPE_INT, 3),
|
LV_PROPERTY_ID(IMAGE, ROTATION, LV_PROPERTY_TYPE_INT, 3),
|
||||||
LV_PROPERTY_ID(IMAGE, PIVOT, LV_PROPERTY_TYPE_POINTER, 4),
|
LV_PROPERTY_ID(IMAGE, PIVOT, LV_PROPERTY_TYPE_POINT, 4),
|
||||||
LV_PROPERTY_ID(IMAGE, SCALE, LV_PROPERTY_TYPE_INT, 5),
|
LV_PROPERTY_ID(IMAGE, SCALE, LV_PROPERTY_TYPE_INT, 5),
|
||||||
LV_PROPERTY_ID(IMAGE, SCALE_X, LV_PROPERTY_TYPE_INT, 6),
|
LV_PROPERTY_ID(IMAGE, SCALE_X, LV_PROPERTY_TYPE_INT, 6),
|
||||||
LV_PROPERTY_ID(IMAGE, SCALE_Y, LV_PROPERTY_TYPE_INT, 7),
|
LV_PROPERTY_ID(IMAGE, SCALE_Y, LV_PROPERTY_TYPE_INT, 7),
|
||||||
@@ -161,7 +161,7 @@ void lv_image_set_rotation(lv_obj_t * obj, int32_t angle);
|
|||||||
void lv_image_set_pivot(lv_obj_t * obj, int32_t x, int32_t y);
|
void lv_image_set_pivot(lv_obj_t * obj, int32_t x, int32_t y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set pivot similar to get_pivot
|
* Set pivot to accept lv_point_t * directly
|
||||||
*/
|
*/
|
||||||
static inline void _lv_image_set_pivot(lv_obj_t * obj, lv_point_t * pivot)
|
static inline void _lv_image_set_pivot(lv_obj_t * obj, lv_point_t * pivot)
|
||||||
{
|
{
|
||||||
@@ -280,6 +280,16 @@ int32_t lv_image_get_rotation(lv_obj_t * obj);
|
|||||||
*/
|
*/
|
||||||
void lv_image_get_pivot(lv_obj_t * obj, lv_point_t * pivot);
|
void lv_image_get_pivot(lv_obj_t * obj, lv_point_t * pivot);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pivot to return lv_point_t directly
|
||||||
|
*/
|
||||||
|
static inline lv_point_t _lv_image_get_pivot(lv_obj_t * obj)
|
||||||
|
{
|
||||||
|
lv_point_t pivot;
|
||||||
|
lv_image_get_pivot(obj, &pivot);
|
||||||
|
return pivot;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the zoom factor of the image.
|
* Get the zoom factor of the image.
|
||||||
* @param obj pointer to an image object
|
* @param obj pointer to an image object
|
||||||
|
|||||||
33
src/widgets/property/lv_image_properties.c
Normal file
33
src/widgets/property/lv_image_properties.c
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* GENERATED FILE, DO NOT EDIT IT!
|
||||||
|
* @file lv_image_properties.c
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "../image/lv_image.h"
|
||||||
|
|
||||||
|
#if LV_USE_OBJ_PROPERTY && LV_USE_OBJ_PROPERTY_NAME
|
||||||
|
|
||||||
|
#if LV_USE_IMAGE
|
||||||
|
/**
|
||||||
|
* Image widget property names, name must be in order.
|
||||||
|
* Generated code from properties.py
|
||||||
|
*/
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
const lv_property_name_t lv_image_property_names[11] = {
|
||||||
|
{"align", LV_PROPERTY_IMAGE_ALIGN,},
|
||||||
|
{"antialias", LV_PROPERTY_IMAGE_ANTIALIAS,},
|
||||||
|
{"blend_mode", LV_PROPERTY_IMAGE_BLEND_MODE,},
|
||||||
|
{"offset_x", LV_PROPERTY_IMAGE_OFFSET_X,},
|
||||||
|
{"offset_y", LV_PROPERTY_IMAGE_OFFSET_Y,},
|
||||||
|
{"pivot", LV_PROPERTY_IMAGE_PIVOT,},
|
||||||
|
{"rotation", LV_PROPERTY_IMAGE_ROTATION,},
|
||||||
|
{"scale", LV_PROPERTY_IMAGE_SCALE,},
|
||||||
|
{"scale_x", LV_PROPERTY_IMAGE_SCALE_X,},
|
||||||
|
{"scale_y", LV_PROPERTY_IMAGE_SCALE_Y,},
|
||||||
|
{"src", LV_PROPERTY_IMAGE_SRC,},
|
||||||
|
};
|
||||||
|
#endif /*LV_USE_IMAGE*/
|
||||||
|
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
#endif
|
||||||
68
src/widgets/property/lv_obj_properties.c
Normal file
68
src/widgets/property/lv_obj_properties.c
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* GENERATED FILE, DO NOT EDIT IT!
|
||||||
|
* @file lv_obj_properties.c
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "../../core/lv_obj.h"
|
||||||
|
|
||||||
|
#if LV_USE_OBJ_PROPERTY && LV_USE_OBJ_PROPERTY_NAME
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obj widget property names, name must be in order.
|
||||||
|
* Generated code from properties.py
|
||||||
|
*/
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
const lv_property_name_t lv_obj_property_names[48] = {
|
||||||
|
{"flag_adv_hittest", LV_PROPERTY_OBJ_FLAG_ADV_HITTEST,},
|
||||||
|
{"flag_checkable", LV_PROPERTY_OBJ_FLAG_CHECKABLE,},
|
||||||
|
{"flag_click_focusable", LV_PROPERTY_OBJ_FLAG_CLICK_FOCUSABLE,},
|
||||||
|
{"flag_clickable", LV_PROPERTY_OBJ_FLAG_CLICKABLE,},
|
||||||
|
{"flag_end", LV_PROPERTY_OBJ_FLAG_END,},
|
||||||
|
{"flag_event_bubble", LV_PROPERTY_OBJ_FLAG_EVENT_BUBBLE,},
|
||||||
|
{"flag_flex_in_new_track", LV_PROPERTY_OBJ_FLAG_FLEX_IN_NEW_TRACK,},
|
||||||
|
{"flag_floating", LV_PROPERTY_OBJ_FLAG_FLOATING,},
|
||||||
|
{"flag_gesture_bubble", LV_PROPERTY_OBJ_FLAG_GESTURE_BUBBLE,},
|
||||||
|
{"flag_hidden", LV_PROPERTY_OBJ_FLAG_HIDDEN,},
|
||||||
|
{"flag_ignore_layout", LV_PROPERTY_OBJ_FLAG_IGNORE_LAYOUT,},
|
||||||
|
{"flag_layout_1", LV_PROPERTY_OBJ_FLAG_LAYOUT_1,},
|
||||||
|
{"flag_layout_2", LV_PROPERTY_OBJ_FLAG_LAYOUT_2,},
|
||||||
|
{"flag_overflow_visible", LV_PROPERTY_OBJ_FLAG_OVERFLOW_VISIBLE,},
|
||||||
|
{"flag_press_lock", LV_PROPERTY_OBJ_FLAG_PRESS_LOCK,},
|
||||||
|
{"flag_scroll_chain_hor", LV_PROPERTY_OBJ_FLAG_SCROLL_CHAIN_HOR,},
|
||||||
|
{"flag_scroll_chain_ver", LV_PROPERTY_OBJ_FLAG_SCROLL_CHAIN_VER,},
|
||||||
|
{"flag_scroll_elastic", LV_PROPERTY_OBJ_FLAG_SCROLL_ELASTIC,},
|
||||||
|
{"flag_scroll_momentum", LV_PROPERTY_OBJ_FLAG_SCROLL_MOMENTUM,},
|
||||||
|
{"flag_scroll_on_focus", LV_PROPERTY_OBJ_FLAG_SCROLL_ON_FOCUS,},
|
||||||
|
{"flag_scroll_one", LV_PROPERTY_OBJ_FLAG_SCROLL_ONE,},
|
||||||
|
{"flag_scroll_with_arrow", LV_PROPERTY_OBJ_FLAG_SCROLL_WITH_ARROW,},
|
||||||
|
{"flag_scrollable", LV_PROPERTY_OBJ_FLAG_SCROLLABLE,},
|
||||||
|
{"flag_send_draw_task_events", LV_PROPERTY_OBJ_FLAG_SEND_DRAW_TASK_EVENTS,},
|
||||||
|
{"flag_snappable", LV_PROPERTY_OBJ_FLAG_SNAPPABLE,},
|
||||||
|
{"flag_start", LV_PROPERTY_OBJ_FLAG_START,},
|
||||||
|
{"flag_user_1", LV_PROPERTY_OBJ_FLAG_USER_1,},
|
||||||
|
{"flag_user_2", LV_PROPERTY_OBJ_FLAG_USER_2,},
|
||||||
|
{"flag_user_3", LV_PROPERTY_OBJ_FLAG_USER_3,},
|
||||||
|
{"flag_user_4", LV_PROPERTY_OBJ_FLAG_USER_4,},
|
||||||
|
{"flag_widget_1", LV_PROPERTY_OBJ_FLAG_WIDGET_1,},
|
||||||
|
{"flag_widget_2", LV_PROPERTY_OBJ_FLAG_WIDGET_2,},
|
||||||
|
{"parent", LV_PROPERTY_OBJ_PARENT,},
|
||||||
|
{"state_any", LV_PROPERTY_OBJ_STATE_ANY,},
|
||||||
|
{"state_checked", LV_PROPERTY_OBJ_STATE_CHECKED,},
|
||||||
|
{"state_disabled", LV_PROPERTY_OBJ_STATE_DISABLED,},
|
||||||
|
{"state_edited", LV_PROPERTY_OBJ_STATE_EDITED,},
|
||||||
|
{"state_end", LV_PROPERTY_OBJ_STATE_END,},
|
||||||
|
{"state_focus_key", LV_PROPERTY_OBJ_STATE_FOCUS_KEY,},
|
||||||
|
{"state_focused", LV_PROPERTY_OBJ_STATE_FOCUSED,},
|
||||||
|
{"state_hovered", LV_PROPERTY_OBJ_STATE_HOVERED,},
|
||||||
|
{"state_pressed", LV_PROPERTY_OBJ_STATE_PRESSED,},
|
||||||
|
{"state_scrolled", LV_PROPERTY_OBJ_STATE_SCROLLED,},
|
||||||
|
{"state_start", LV_PROPERTY_OBJ_STATE_START,},
|
||||||
|
{"state_user_1", LV_PROPERTY_OBJ_STATE_USER_1,},
|
||||||
|
{"state_user_2", LV_PROPERTY_OBJ_STATE_USER_2,},
|
||||||
|
{"state_user_3", LV_PROPERTY_OBJ_STATE_USER_3,},
|
||||||
|
{"state_user_4", LV_PROPERTY_OBJ_STATE_USER_4,},
|
||||||
|
};
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
#endif
|
||||||
17
src/widgets/property/lv_obj_property_names.h
Normal file
17
src/widgets/property/lv_obj_property_names.h
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* @file lv_obj_property_names.h
|
||||||
|
* GENERATED FILE, DO NOT EDIT IT!
|
||||||
|
*/
|
||||||
|
#ifndef LV_OBJ_PROPERTY_NAMES_H
|
||||||
|
#define LV_OBJ_PROPERTY_NAMES_H
|
||||||
|
|
||||||
|
#include "../../misc/lv_types.h"
|
||||||
|
|
||||||
|
#if LV_USE_OBJ_PROPERTY && LV_USE_OBJ_PROPERTY_NAME
|
||||||
|
|
||||||
|
extern const lv_property_name_t lv_image_property_names[11];
|
||||||
|
extern const lv_property_name_t lv_obj_property_names[48];
|
||||||
|
extern const lv_property_name_t lv_style_property_names[111];
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
131
src/widgets/property/lv_style_properties.c
Normal file
131
src/widgets/property/lv_style_properties.c
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* GENERATED FILE, DO NOT EDIT IT!
|
||||||
|
* @file lv_style_properties.c
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "lv_style_properties.h"
|
||||||
|
|
||||||
|
#if LV_USE_OBJ_PROPERTY && LV_USE_OBJ_PROPERTY_NAME
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Style property names, name must be in order.
|
||||||
|
* Generated code from properties.py
|
||||||
|
*/
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
const lv_property_name_t lv_style_property_names[111] = {
|
||||||
|
{"align", LV_PROPERTY_STYLE_ALIGN,},
|
||||||
|
{"anim", LV_PROPERTY_STYLE_ANIM,},
|
||||||
|
{"anim_duration", LV_PROPERTY_STYLE_ANIM_DURATION,},
|
||||||
|
{"arc_color", LV_PROPERTY_STYLE_ARC_COLOR,},
|
||||||
|
{"arc_image_src", LV_PROPERTY_STYLE_ARC_IMAGE_SRC,},
|
||||||
|
{"arc_opa", LV_PROPERTY_STYLE_ARC_OPA,},
|
||||||
|
{"arc_rounded", LV_PROPERTY_STYLE_ARC_ROUNDED,},
|
||||||
|
{"arc_width", LV_PROPERTY_STYLE_ARC_WIDTH,},
|
||||||
|
{"base_dir", LV_PROPERTY_STYLE_BASE_DIR,},
|
||||||
|
{"bg_color", LV_PROPERTY_STYLE_BG_COLOR,},
|
||||||
|
{"bg_grad", LV_PROPERTY_STYLE_BG_GRAD,},
|
||||||
|
{"bg_grad_color", LV_PROPERTY_STYLE_BG_GRAD_COLOR,},
|
||||||
|
{"bg_grad_dir", LV_PROPERTY_STYLE_BG_GRAD_DIR,},
|
||||||
|
{"bg_grad_opa", LV_PROPERTY_STYLE_BG_GRAD_OPA,},
|
||||||
|
{"bg_grad_stop", LV_PROPERTY_STYLE_BG_GRAD_STOP,},
|
||||||
|
{"bg_image_opa", LV_PROPERTY_STYLE_BG_IMAGE_OPA,},
|
||||||
|
{"bg_image_recolor", LV_PROPERTY_STYLE_BG_IMAGE_RECOLOR,},
|
||||||
|
{"bg_image_recolor_opa", LV_PROPERTY_STYLE_BG_IMAGE_RECOLOR_OPA,},
|
||||||
|
{"bg_image_src", LV_PROPERTY_STYLE_BG_IMAGE_SRC,},
|
||||||
|
{"bg_image_tiled", LV_PROPERTY_STYLE_BG_IMAGE_TILED,},
|
||||||
|
{"bg_main_opa", LV_PROPERTY_STYLE_BG_MAIN_OPA,},
|
||||||
|
{"bg_main_stop", LV_PROPERTY_STYLE_BG_MAIN_STOP,},
|
||||||
|
{"bg_opa", LV_PROPERTY_STYLE_BG_OPA,},
|
||||||
|
{"bitmap_mask_src", LV_PROPERTY_STYLE_BITMAP_MASK_SRC,},
|
||||||
|
{"blend_mode", LV_PROPERTY_STYLE_BLEND_MODE,},
|
||||||
|
{"border_color", LV_PROPERTY_STYLE_BORDER_COLOR,},
|
||||||
|
{"border_opa", LV_PROPERTY_STYLE_BORDER_OPA,},
|
||||||
|
{"border_post", LV_PROPERTY_STYLE_BORDER_POST,},
|
||||||
|
{"border_side", LV_PROPERTY_STYLE_BORDER_SIDE,},
|
||||||
|
{"border_width", LV_PROPERTY_STYLE_BORDER_WIDTH,},
|
||||||
|
{"clip_corner", LV_PROPERTY_STYLE_CLIP_CORNER,},
|
||||||
|
{"color_filter_dsc", LV_PROPERTY_STYLE_COLOR_FILTER_DSC,},
|
||||||
|
{"color_filter_opa", LV_PROPERTY_STYLE_COLOR_FILTER_OPA,},
|
||||||
|
{"flex_cross_place", LV_PROPERTY_STYLE_FLEX_CROSS_PLACE,},
|
||||||
|
{"flex_flow", LV_PROPERTY_STYLE_FLEX_FLOW,},
|
||||||
|
{"flex_grow", LV_PROPERTY_STYLE_FLEX_GROW,},
|
||||||
|
{"flex_main_place", LV_PROPERTY_STYLE_FLEX_MAIN_PLACE,},
|
||||||
|
{"flex_track_place", LV_PROPERTY_STYLE_FLEX_TRACK_PLACE,},
|
||||||
|
{"grid_cell_column_pos", LV_PROPERTY_STYLE_GRID_CELL_COLUMN_POS,},
|
||||||
|
{"grid_cell_column_span", LV_PROPERTY_STYLE_GRID_CELL_COLUMN_SPAN,},
|
||||||
|
{"grid_cell_row_pos", LV_PROPERTY_STYLE_GRID_CELL_ROW_POS,},
|
||||||
|
{"grid_cell_row_span", LV_PROPERTY_STYLE_GRID_CELL_ROW_SPAN,},
|
||||||
|
{"grid_cell_x_align", LV_PROPERTY_STYLE_GRID_CELL_X_ALIGN,},
|
||||||
|
{"grid_cell_y_align", LV_PROPERTY_STYLE_GRID_CELL_Y_ALIGN,},
|
||||||
|
{"grid_column_align", LV_PROPERTY_STYLE_GRID_COLUMN_ALIGN,},
|
||||||
|
{"grid_column_dsc_array", LV_PROPERTY_STYLE_GRID_COLUMN_DSC_ARRAY,},
|
||||||
|
{"grid_row_align", LV_PROPERTY_STYLE_GRID_ROW_ALIGN,},
|
||||||
|
{"grid_row_dsc_array", LV_PROPERTY_STYLE_GRID_ROW_DSC_ARRAY,},
|
||||||
|
{"height", LV_PROPERTY_STYLE_HEIGHT,},
|
||||||
|
{"image_opa", LV_PROPERTY_STYLE_IMAGE_OPA,},
|
||||||
|
{"image_recolor", LV_PROPERTY_STYLE_IMAGE_RECOLOR,},
|
||||||
|
{"image_recolor_opa", LV_PROPERTY_STYLE_IMAGE_RECOLOR_OPA,},
|
||||||
|
{"layout", LV_PROPERTY_STYLE_LAYOUT,},
|
||||||
|
{"length", LV_PROPERTY_STYLE_LENGTH,},
|
||||||
|
{"line_color", LV_PROPERTY_STYLE_LINE_COLOR,},
|
||||||
|
{"line_dash_gap", LV_PROPERTY_STYLE_LINE_DASH_GAP,},
|
||||||
|
{"line_dash_width", LV_PROPERTY_STYLE_LINE_DASH_WIDTH,},
|
||||||
|
{"line_opa", LV_PROPERTY_STYLE_LINE_OPA,},
|
||||||
|
{"line_rounded", LV_PROPERTY_STYLE_LINE_ROUNDED,},
|
||||||
|
{"line_width", LV_PROPERTY_STYLE_LINE_WIDTH,},
|
||||||
|
{"margin_bottom", LV_PROPERTY_STYLE_MARGIN_BOTTOM,},
|
||||||
|
{"margin_left", LV_PROPERTY_STYLE_MARGIN_LEFT,},
|
||||||
|
{"margin_right", LV_PROPERTY_STYLE_MARGIN_RIGHT,},
|
||||||
|
{"margin_top", LV_PROPERTY_STYLE_MARGIN_TOP,},
|
||||||
|
{"max_height", LV_PROPERTY_STYLE_MAX_HEIGHT,},
|
||||||
|
{"max_width", LV_PROPERTY_STYLE_MAX_WIDTH,},
|
||||||
|
{"min_height", LV_PROPERTY_STYLE_MIN_HEIGHT,},
|
||||||
|
{"min_width", LV_PROPERTY_STYLE_MIN_WIDTH,},
|
||||||
|
{"opa", LV_PROPERTY_STYLE_OPA,},
|
||||||
|
{"opa_layered", LV_PROPERTY_STYLE_OPA_LAYERED,},
|
||||||
|
{"outline_color", LV_PROPERTY_STYLE_OUTLINE_COLOR,},
|
||||||
|
{"outline_opa", LV_PROPERTY_STYLE_OUTLINE_OPA,},
|
||||||
|
{"outline_pad", LV_PROPERTY_STYLE_OUTLINE_PAD,},
|
||||||
|
{"outline_width", LV_PROPERTY_STYLE_OUTLINE_WIDTH,},
|
||||||
|
{"pad_bottom", LV_PROPERTY_STYLE_PAD_BOTTOM,},
|
||||||
|
{"pad_column", LV_PROPERTY_STYLE_PAD_COLUMN,},
|
||||||
|
{"pad_left", LV_PROPERTY_STYLE_PAD_LEFT,},
|
||||||
|
{"pad_right", LV_PROPERTY_STYLE_PAD_RIGHT,},
|
||||||
|
{"pad_row", LV_PROPERTY_STYLE_PAD_ROW,},
|
||||||
|
{"pad_top", LV_PROPERTY_STYLE_PAD_TOP,},
|
||||||
|
{"prop_inv", LV_PROPERTY_STYLE_PROP_INV,},
|
||||||
|
{"radius", LV_PROPERTY_STYLE_RADIUS,},
|
||||||
|
{"rotary_sensitivity", LV_PROPERTY_STYLE_ROTARY_SENSITIVITY,},
|
||||||
|
{"shadow_color", LV_PROPERTY_STYLE_SHADOW_COLOR,},
|
||||||
|
{"shadow_offset_x", LV_PROPERTY_STYLE_SHADOW_OFFSET_X,},
|
||||||
|
{"shadow_offset_y", LV_PROPERTY_STYLE_SHADOW_OFFSET_Y,},
|
||||||
|
{"shadow_opa", LV_PROPERTY_STYLE_SHADOW_OPA,},
|
||||||
|
{"shadow_spread", LV_PROPERTY_STYLE_SHADOW_SPREAD,},
|
||||||
|
{"shadow_width", LV_PROPERTY_STYLE_SHADOW_WIDTH,},
|
||||||
|
{"text_align", LV_PROPERTY_STYLE_TEXT_ALIGN,},
|
||||||
|
{"text_color", LV_PROPERTY_STYLE_TEXT_COLOR,},
|
||||||
|
{"text_decor", LV_PROPERTY_STYLE_TEXT_DECOR,},
|
||||||
|
{"text_font", LV_PROPERTY_STYLE_TEXT_FONT,},
|
||||||
|
{"text_letter_space", LV_PROPERTY_STYLE_TEXT_LETTER_SPACE,},
|
||||||
|
{"text_line_space", LV_PROPERTY_STYLE_TEXT_LINE_SPACE,},
|
||||||
|
{"text_opa", LV_PROPERTY_STYLE_TEXT_OPA,},
|
||||||
|
{"transform_height", LV_PROPERTY_STYLE_TRANSFORM_HEIGHT,},
|
||||||
|
{"transform_pivot_x", LV_PROPERTY_STYLE_TRANSFORM_PIVOT_X,},
|
||||||
|
{"transform_pivot_y", LV_PROPERTY_STYLE_TRANSFORM_PIVOT_Y,},
|
||||||
|
{"transform_rotation", LV_PROPERTY_STYLE_TRANSFORM_ROTATION,},
|
||||||
|
{"transform_scale_x", LV_PROPERTY_STYLE_TRANSFORM_SCALE_X,},
|
||||||
|
{"transform_scale_y", LV_PROPERTY_STYLE_TRANSFORM_SCALE_Y,},
|
||||||
|
{"transform_skew_x", LV_PROPERTY_STYLE_TRANSFORM_SKEW_X,},
|
||||||
|
{"transform_skew_y", LV_PROPERTY_STYLE_TRANSFORM_SKEW_Y,},
|
||||||
|
{"transform_width", LV_PROPERTY_STYLE_TRANSFORM_WIDTH,},
|
||||||
|
{"transition", LV_PROPERTY_STYLE_TRANSITION,},
|
||||||
|
{"translate_x", LV_PROPERTY_STYLE_TRANSLATE_X,},
|
||||||
|
{"translate_y", LV_PROPERTY_STYLE_TRANSLATE_Y,},
|
||||||
|
{"width", LV_PROPERTY_STYLE_WIDTH,},
|
||||||
|
{"x", LV_PROPERTY_STYLE_X,},
|
||||||
|
{"y", LV_PROPERTY_STYLE_Y,},
|
||||||
|
};
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
#endif
|
||||||
129
src/widgets/property/lv_style_properties.h
Normal file
129
src/widgets/property/lv_style_properties.h
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* GENERATED FILE, DO NOT EDIT IT!
|
||||||
|
* @file lv_style_properties.h
|
||||||
|
*/
|
||||||
|
#ifndef LV_STYLE_PROPERTIES_H
|
||||||
|
#define LV_STYLE_PROPERTIES_H
|
||||||
|
|
||||||
|
#include "../../core/lv_obj_property.h"
|
||||||
|
#if LV_USE_OBJ_PROPERTY
|
||||||
|
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
enum {
|
||||||
|
LV_PROPERTY_ID(STYLE, ALIGN, LV_PROPERTY_TYPE_INT, LV_STYLE_ALIGN),
|
||||||
|
LV_PROPERTY_ID(STYLE, ANIM, LV_PROPERTY_TYPE_INT, LV_STYLE_ANIM),
|
||||||
|
LV_PROPERTY_ID(STYLE, ANIM_DURATION, LV_PROPERTY_TYPE_INT, LV_STYLE_ANIM_DURATION),
|
||||||
|
LV_PROPERTY_ID(STYLE, ARC_COLOR, LV_PROPERTY_TYPE_INT, LV_STYLE_ARC_COLOR),
|
||||||
|
LV_PROPERTY_ID(STYLE, ARC_IMAGE_SRC, LV_PROPERTY_TYPE_INT, LV_STYLE_ARC_IMAGE_SRC),
|
||||||
|
LV_PROPERTY_ID(STYLE, ARC_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_ARC_OPA),
|
||||||
|
LV_PROPERTY_ID(STYLE, ARC_ROUNDED, LV_PROPERTY_TYPE_INT, LV_STYLE_ARC_ROUNDED),
|
||||||
|
LV_PROPERTY_ID(STYLE, ARC_WIDTH, LV_PROPERTY_TYPE_INT, LV_STYLE_ARC_WIDTH),
|
||||||
|
LV_PROPERTY_ID(STYLE, BASE_DIR, LV_PROPERTY_TYPE_INT, LV_STYLE_BASE_DIR),
|
||||||
|
LV_PROPERTY_ID(STYLE, BG_COLOR, LV_PROPERTY_TYPE_COLOR, LV_STYLE_BG_COLOR),
|
||||||
|
LV_PROPERTY_ID(STYLE, BG_GRAD, LV_PROPERTY_TYPE_INT, LV_STYLE_BG_GRAD),
|
||||||
|
LV_PROPERTY_ID(STYLE, BG_GRAD_COLOR, LV_PROPERTY_TYPE_COLOR, LV_STYLE_BG_GRAD_COLOR),
|
||||||
|
LV_PROPERTY_ID(STYLE, BG_GRAD_DIR, LV_PROPERTY_TYPE_INT, LV_STYLE_BG_GRAD_DIR),
|
||||||
|
LV_PROPERTY_ID(STYLE, BG_GRAD_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_BG_GRAD_OPA),
|
||||||
|
LV_PROPERTY_ID(STYLE, BG_GRAD_STOP, LV_PROPERTY_TYPE_INT, LV_STYLE_BG_GRAD_STOP),
|
||||||
|
LV_PROPERTY_ID(STYLE, BG_IMAGE_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_BG_IMAGE_OPA),
|
||||||
|
LV_PROPERTY_ID(STYLE, BG_IMAGE_RECOLOR, LV_PROPERTY_TYPE_COLOR, LV_STYLE_BG_IMAGE_RECOLOR),
|
||||||
|
LV_PROPERTY_ID(STYLE, BG_IMAGE_RECOLOR_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_BG_IMAGE_RECOLOR_OPA),
|
||||||
|
LV_PROPERTY_ID(STYLE, BG_IMAGE_SRC, LV_PROPERTY_TYPE_IMGSRC, LV_STYLE_BG_IMAGE_SRC),
|
||||||
|
LV_PROPERTY_ID(STYLE, BG_IMAGE_TILED, LV_PROPERTY_TYPE_INT, LV_STYLE_BG_IMAGE_TILED),
|
||||||
|
LV_PROPERTY_ID(STYLE, BG_MAIN_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_BG_MAIN_OPA),
|
||||||
|
LV_PROPERTY_ID(STYLE, BG_MAIN_STOP, LV_PROPERTY_TYPE_INT, LV_STYLE_BG_MAIN_STOP),
|
||||||
|
LV_PROPERTY_ID(STYLE, BG_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_BG_OPA),
|
||||||
|
LV_PROPERTY_ID(STYLE, BITMAP_MASK_SRC, LV_PROPERTY_TYPE_INT, LV_STYLE_BITMAP_MASK_SRC),
|
||||||
|
LV_PROPERTY_ID(STYLE, BLEND_MODE, LV_PROPERTY_TYPE_INT, LV_STYLE_BLEND_MODE),
|
||||||
|
LV_PROPERTY_ID(STYLE, BORDER_COLOR, LV_PROPERTY_TYPE_COLOR, LV_STYLE_BORDER_COLOR),
|
||||||
|
LV_PROPERTY_ID(STYLE, BORDER_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_BORDER_OPA),
|
||||||
|
LV_PROPERTY_ID(STYLE, BORDER_POST, LV_PROPERTY_TYPE_INT, LV_STYLE_BORDER_POST),
|
||||||
|
LV_PROPERTY_ID(STYLE, BORDER_SIDE, LV_PROPERTY_TYPE_INT, LV_STYLE_BORDER_SIDE),
|
||||||
|
LV_PROPERTY_ID(STYLE, BORDER_WIDTH, LV_PROPERTY_TYPE_INT, LV_STYLE_BORDER_WIDTH),
|
||||||
|
LV_PROPERTY_ID(STYLE, CLIP_CORNER, LV_PROPERTY_TYPE_INT, LV_STYLE_CLIP_CORNER),
|
||||||
|
LV_PROPERTY_ID(STYLE, COLOR_FILTER_DSC, LV_PROPERTY_TYPE_INT, LV_STYLE_COLOR_FILTER_DSC),
|
||||||
|
LV_PROPERTY_ID(STYLE, COLOR_FILTER_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_COLOR_FILTER_OPA),
|
||||||
|
LV_PROPERTY_ID(STYLE, FLEX_CROSS_PLACE, LV_PROPERTY_TYPE_INT, LV_STYLE_FLEX_CROSS_PLACE),
|
||||||
|
LV_PROPERTY_ID(STYLE, FLEX_FLOW, LV_PROPERTY_TYPE_INT, LV_STYLE_FLEX_FLOW),
|
||||||
|
LV_PROPERTY_ID(STYLE, FLEX_GROW, LV_PROPERTY_TYPE_INT, LV_STYLE_FLEX_GROW),
|
||||||
|
LV_PROPERTY_ID(STYLE, FLEX_MAIN_PLACE, LV_PROPERTY_TYPE_INT, LV_STYLE_FLEX_MAIN_PLACE),
|
||||||
|
LV_PROPERTY_ID(STYLE, FLEX_TRACK_PLACE, LV_PROPERTY_TYPE_INT, LV_STYLE_FLEX_TRACK_PLACE),
|
||||||
|
LV_PROPERTY_ID(STYLE, GRID_CELL_COLUMN_POS, LV_PROPERTY_TYPE_INT, LV_STYLE_GRID_CELL_COLUMN_POS),
|
||||||
|
LV_PROPERTY_ID(STYLE, GRID_CELL_COLUMN_SPAN, LV_PROPERTY_TYPE_INT, LV_STYLE_GRID_CELL_COLUMN_SPAN),
|
||||||
|
LV_PROPERTY_ID(STYLE, GRID_CELL_ROW_POS, LV_PROPERTY_TYPE_INT, LV_STYLE_GRID_CELL_ROW_POS),
|
||||||
|
LV_PROPERTY_ID(STYLE, GRID_CELL_ROW_SPAN, LV_PROPERTY_TYPE_INT, LV_STYLE_GRID_CELL_ROW_SPAN),
|
||||||
|
LV_PROPERTY_ID(STYLE, GRID_CELL_X_ALIGN, LV_PROPERTY_TYPE_INT, LV_STYLE_GRID_CELL_X_ALIGN),
|
||||||
|
LV_PROPERTY_ID(STYLE, GRID_CELL_Y_ALIGN, LV_PROPERTY_TYPE_INT, LV_STYLE_GRID_CELL_Y_ALIGN),
|
||||||
|
LV_PROPERTY_ID(STYLE, GRID_COLUMN_ALIGN, LV_PROPERTY_TYPE_INT, LV_STYLE_GRID_COLUMN_ALIGN),
|
||||||
|
LV_PROPERTY_ID(STYLE, GRID_COLUMN_DSC_ARRAY, LV_PROPERTY_TYPE_INT, LV_STYLE_GRID_COLUMN_DSC_ARRAY),
|
||||||
|
LV_PROPERTY_ID(STYLE, GRID_ROW_ALIGN, LV_PROPERTY_TYPE_INT, LV_STYLE_GRID_ROW_ALIGN),
|
||||||
|
LV_PROPERTY_ID(STYLE, GRID_ROW_DSC_ARRAY, LV_PROPERTY_TYPE_INT, LV_STYLE_GRID_ROW_DSC_ARRAY),
|
||||||
|
LV_PROPERTY_ID(STYLE, HEIGHT, LV_PROPERTY_TYPE_INT, LV_STYLE_HEIGHT),
|
||||||
|
LV_PROPERTY_ID(STYLE, IMAGE_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_IMAGE_OPA),
|
||||||
|
LV_PROPERTY_ID(STYLE, IMAGE_RECOLOR, LV_PROPERTY_TYPE_COLOR, LV_STYLE_IMAGE_RECOLOR),
|
||||||
|
LV_PROPERTY_ID(STYLE, IMAGE_RECOLOR_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_IMAGE_RECOLOR_OPA),
|
||||||
|
LV_PROPERTY_ID(STYLE, LAYOUT, LV_PROPERTY_TYPE_INT, LV_STYLE_LAYOUT),
|
||||||
|
LV_PROPERTY_ID(STYLE, LENGTH, LV_PROPERTY_TYPE_INT, LV_STYLE_LENGTH),
|
||||||
|
LV_PROPERTY_ID(STYLE, LINE_COLOR, LV_PROPERTY_TYPE_COLOR, LV_STYLE_LINE_COLOR),
|
||||||
|
LV_PROPERTY_ID(STYLE, LINE_DASH_GAP, LV_PROPERTY_TYPE_INT, LV_STYLE_LINE_DASH_GAP),
|
||||||
|
LV_PROPERTY_ID(STYLE, LINE_DASH_WIDTH, LV_PROPERTY_TYPE_INT, LV_STYLE_LINE_DASH_WIDTH),
|
||||||
|
LV_PROPERTY_ID(STYLE, LINE_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_LINE_OPA),
|
||||||
|
LV_PROPERTY_ID(STYLE, LINE_ROUNDED, LV_PROPERTY_TYPE_INT, LV_STYLE_LINE_ROUNDED),
|
||||||
|
LV_PROPERTY_ID(STYLE, LINE_WIDTH, LV_PROPERTY_TYPE_INT, LV_STYLE_LINE_WIDTH),
|
||||||
|
LV_PROPERTY_ID(STYLE, MARGIN_BOTTOM, LV_PROPERTY_TYPE_INT, LV_STYLE_MARGIN_BOTTOM),
|
||||||
|
LV_PROPERTY_ID(STYLE, MARGIN_LEFT, LV_PROPERTY_TYPE_INT, LV_STYLE_MARGIN_LEFT),
|
||||||
|
LV_PROPERTY_ID(STYLE, MARGIN_RIGHT, LV_PROPERTY_TYPE_INT, LV_STYLE_MARGIN_RIGHT),
|
||||||
|
LV_PROPERTY_ID(STYLE, MARGIN_TOP, LV_PROPERTY_TYPE_INT, LV_STYLE_MARGIN_TOP),
|
||||||
|
LV_PROPERTY_ID(STYLE, MAX_HEIGHT, LV_PROPERTY_TYPE_INT, LV_STYLE_MAX_HEIGHT),
|
||||||
|
LV_PROPERTY_ID(STYLE, MAX_WIDTH, LV_PROPERTY_TYPE_INT, LV_STYLE_MAX_WIDTH),
|
||||||
|
LV_PROPERTY_ID(STYLE, MIN_HEIGHT, LV_PROPERTY_TYPE_INT, LV_STYLE_MIN_HEIGHT),
|
||||||
|
LV_PROPERTY_ID(STYLE, MIN_WIDTH, LV_PROPERTY_TYPE_INT, LV_STYLE_MIN_WIDTH),
|
||||||
|
LV_PROPERTY_ID(STYLE, OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_OPA),
|
||||||
|
LV_PROPERTY_ID(STYLE, OPA_LAYERED, LV_PROPERTY_TYPE_INT, LV_STYLE_OPA_LAYERED),
|
||||||
|
LV_PROPERTY_ID(STYLE, OUTLINE_COLOR, LV_PROPERTY_TYPE_COLOR, LV_STYLE_OUTLINE_COLOR),
|
||||||
|
LV_PROPERTY_ID(STYLE, OUTLINE_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_OUTLINE_OPA),
|
||||||
|
LV_PROPERTY_ID(STYLE, OUTLINE_PAD, LV_PROPERTY_TYPE_INT, LV_STYLE_OUTLINE_PAD),
|
||||||
|
LV_PROPERTY_ID(STYLE, OUTLINE_WIDTH, LV_PROPERTY_TYPE_INT, LV_STYLE_OUTLINE_WIDTH),
|
||||||
|
LV_PROPERTY_ID(STYLE, PAD_BOTTOM, LV_PROPERTY_TYPE_INT, LV_STYLE_PAD_BOTTOM),
|
||||||
|
LV_PROPERTY_ID(STYLE, PAD_COLUMN, LV_PROPERTY_TYPE_INT, LV_STYLE_PAD_COLUMN),
|
||||||
|
LV_PROPERTY_ID(STYLE, PAD_LEFT, LV_PROPERTY_TYPE_INT, LV_STYLE_PAD_LEFT),
|
||||||
|
LV_PROPERTY_ID(STYLE, PAD_RIGHT, LV_PROPERTY_TYPE_INT, LV_STYLE_PAD_RIGHT),
|
||||||
|
LV_PROPERTY_ID(STYLE, PAD_ROW, LV_PROPERTY_TYPE_INT, LV_STYLE_PAD_ROW),
|
||||||
|
LV_PROPERTY_ID(STYLE, PAD_TOP, LV_PROPERTY_TYPE_INT, LV_STYLE_PAD_TOP),
|
||||||
|
LV_PROPERTY_ID(STYLE, PROP_INV, LV_PROPERTY_TYPE_INT, LV_STYLE_PROP_INV),
|
||||||
|
LV_PROPERTY_ID(STYLE, RADIUS, LV_PROPERTY_TYPE_INT, LV_STYLE_RADIUS),
|
||||||
|
LV_PROPERTY_ID(STYLE, ROTARY_SENSITIVITY, LV_PROPERTY_TYPE_INT, LV_STYLE_ROTARY_SENSITIVITY),
|
||||||
|
LV_PROPERTY_ID(STYLE, SHADOW_COLOR, LV_PROPERTY_TYPE_COLOR, LV_STYLE_SHADOW_COLOR),
|
||||||
|
LV_PROPERTY_ID(STYLE, SHADOW_OFFSET_X, LV_PROPERTY_TYPE_INT, LV_STYLE_SHADOW_OFFSET_X),
|
||||||
|
LV_PROPERTY_ID(STYLE, SHADOW_OFFSET_Y, LV_PROPERTY_TYPE_INT, LV_STYLE_SHADOW_OFFSET_Y),
|
||||||
|
LV_PROPERTY_ID(STYLE, SHADOW_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_SHADOW_OPA),
|
||||||
|
LV_PROPERTY_ID(STYLE, SHADOW_SPREAD, LV_PROPERTY_TYPE_INT, LV_STYLE_SHADOW_SPREAD),
|
||||||
|
LV_PROPERTY_ID(STYLE, SHADOW_WIDTH, LV_PROPERTY_TYPE_INT, LV_STYLE_SHADOW_WIDTH),
|
||||||
|
LV_PROPERTY_ID(STYLE, TEXT_ALIGN, LV_PROPERTY_TYPE_INT, LV_STYLE_TEXT_ALIGN),
|
||||||
|
LV_PROPERTY_ID(STYLE, TEXT_COLOR, LV_PROPERTY_TYPE_COLOR, LV_STYLE_TEXT_COLOR),
|
||||||
|
LV_PROPERTY_ID(STYLE, TEXT_DECOR, LV_PROPERTY_TYPE_INT, LV_STYLE_TEXT_DECOR),
|
||||||
|
LV_PROPERTY_ID(STYLE, TEXT_FONT, LV_PROPERTY_TYPE_FONT, LV_STYLE_TEXT_FONT),
|
||||||
|
LV_PROPERTY_ID(STYLE, TEXT_LETTER_SPACE, LV_PROPERTY_TYPE_INT, LV_STYLE_TEXT_LETTER_SPACE),
|
||||||
|
LV_PROPERTY_ID(STYLE, TEXT_LINE_SPACE, LV_PROPERTY_TYPE_INT, LV_STYLE_TEXT_LINE_SPACE),
|
||||||
|
LV_PROPERTY_ID(STYLE, TEXT_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_TEXT_OPA),
|
||||||
|
LV_PROPERTY_ID(STYLE, TRANSFORM_HEIGHT, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSFORM_HEIGHT),
|
||||||
|
LV_PROPERTY_ID(STYLE, TRANSFORM_PIVOT_X, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSFORM_PIVOT_X),
|
||||||
|
LV_PROPERTY_ID(STYLE, TRANSFORM_PIVOT_Y, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSFORM_PIVOT_Y),
|
||||||
|
LV_PROPERTY_ID(STYLE, TRANSFORM_ROTATION, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSFORM_ROTATION),
|
||||||
|
LV_PROPERTY_ID(STYLE, TRANSFORM_SCALE_X, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSFORM_SCALE_X),
|
||||||
|
LV_PROPERTY_ID(STYLE, TRANSFORM_SCALE_Y, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSFORM_SCALE_Y),
|
||||||
|
LV_PROPERTY_ID(STYLE, TRANSFORM_SKEW_X, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSFORM_SKEW_X),
|
||||||
|
LV_PROPERTY_ID(STYLE, TRANSFORM_SKEW_Y, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSFORM_SKEW_Y),
|
||||||
|
LV_PROPERTY_ID(STYLE, TRANSFORM_WIDTH, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSFORM_WIDTH),
|
||||||
|
LV_PROPERTY_ID(STYLE, TRANSITION, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSITION),
|
||||||
|
LV_PROPERTY_ID(STYLE, TRANSLATE_X, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSLATE_X),
|
||||||
|
LV_PROPERTY_ID(STYLE, TRANSLATE_Y, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSLATE_Y),
|
||||||
|
LV_PROPERTY_ID(STYLE, WIDTH, LV_PROPERTY_TYPE_INT, LV_STYLE_WIDTH),
|
||||||
|
LV_PROPERTY_ID(STYLE, X, LV_PROPERTY_TYPE_INT, LV_STYLE_X),
|
||||||
|
LV_PROPERTY_ID(STYLE, Y, LV_PROPERTY_TYPE_INT, LV_STYLE_Y),
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
@@ -99,6 +99,7 @@ set(LVGL_TEST_OPTIONS_TEST_SYSHEAP
|
|||||||
set(LVGL_TEST_OPTIONS_TEST_DEFHEAP
|
set(LVGL_TEST_OPTIONS_TEST_DEFHEAP
|
||||||
-DLV_TEST_OPTION=5
|
-DLV_TEST_OPTION=5
|
||||||
-DLV_USE_OBJ_PROPERTY=1 # add obj property test and disable pedantic
|
-DLV_USE_OBJ_PROPERTY=1 # add obj property test and disable pedantic
|
||||||
|
-DLV_USE_OBJ_PROPERTY_NAME=1
|
||||||
-DLVGL_CI_USING_DEF_HEAP
|
-DLVGL_CI_USING_DEF_HEAP
|
||||||
${SANITIZE_AND_COVERAGE_OPTIONS}
|
${SANITIZE_AND_COVERAGE_OPTIONS}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -17,10 +17,12 @@ void test_image_property(void)
|
|||||||
|
|
||||||
lv_point_t point = {0xaa, 0x55};
|
lv_point_t point = {0xaa, 0x55};
|
||||||
prop.id = LV_PROPERTY_IMAGE_PIVOT;
|
prop.id = LV_PROPERTY_IMAGE_PIVOT;
|
||||||
prop.ptr = &point;
|
prop.point = point;
|
||||||
lv_obj_set_property(obj, &prop);
|
lv_obj_set_property(obj, &prop);
|
||||||
TEST_ASSERT_TRUE(LV_PROPERTY_ID_TYPE(prop.id) == LV_PROPERTY_TYPE_POINTER);
|
prop = lv_obj_get_property(obj, LV_PROPERTY_IMAGE_PIVOT);
|
||||||
TEST_ASSERT_TRUE(prop.ptr == &point);
|
TEST_ASSERT_TRUE(LV_PROPERTY_ID_TYPE(prop.id) == LV_PROPERTY_TYPE_POINT);
|
||||||
|
TEST_ASSERT_TRUE(prop.point.x == point.x);
|
||||||
|
TEST_ASSERT_TRUE(prop.point.y == point.y);
|
||||||
|
|
||||||
static const lv_prop_id_t int_ids[] = {
|
static const lv_prop_id_t int_ids[] = {
|
||||||
LV_PROPERTY_IMAGE_OFFSET_X,
|
LV_PROPERTY_IMAGE_OFFSET_X,
|
||||||
|
|||||||
@@ -232,4 +232,41 @@ void test_obj_property_state(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void test_obj_property_type_point(void)
|
||||||
|
{
|
||||||
|
#if LV_USE_OBJ_PROPERTY
|
||||||
|
lv_obj_t * obj = lv_image_create(lv_screen_active());
|
||||||
|
lv_property_t prop = { };
|
||||||
|
|
||||||
|
prop.id = LV_PROPERTY_IMAGE_PIVOT;
|
||||||
|
prop.point.x = 0x1234;
|
||||||
|
prop.point.y = 0x5678;
|
||||||
|
|
||||||
|
TEST_ASSERT_TRUE(lv_obj_set_property(obj, &prop) == LV_RESULT_OK);
|
||||||
|
lv_property_t prop_get = lv_obj_get_property(obj, LV_PROPERTY_IMAGE_PIVOT);
|
||||||
|
TEST_ASSERT_EQUAL_UINT16(0x1234, prop_get.point.x);
|
||||||
|
TEST_ASSERT_EQUAL_UINT16(0x5678, prop_get.point.y);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_obj_property_name(void)
|
||||||
|
{
|
||||||
|
#if LV_USE_OBJ_PROPERTY && LV_USE_OBJ_PROPERTY_NAME
|
||||||
|
lv_obj_t * obj = lv_obj_create(lv_screen_active());
|
||||||
|
|
||||||
|
/*Style name*/
|
||||||
|
TEST_ASSERT_EQUAL_UINT32(LV_PROPERTY_STYLE_X, lv_obj_property_get_id(obj, "x"));
|
||||||
|
TEST_ASSERT_EQUAL_UINT32(LV_PROPERTY_STYLE_BG_MAIN_STOP, lv_obj_property_get_id(obj, "bg_main_stop"));
|
||||||
|
|
||||||
|
/*Widget property*/
|
||||||
|
obj = lv_image_create(lv_screen_active());
|
||||||
|
TEST_ASSERT_EQUAL_UINT32(LV_PROPERTY_IMAGE_ANTIALIAS, lv_obj_property_get_id(obj, "antialias"));
|
||||||
|
/*Base class property*/
|
||||||
|
TEST_ASSERT_EQUAL_UINT32(LV_PROPERTY_OBJ_PARENT, lv_obj_property_get_id(obj, "parent"));
|
||||||
|
|
||||||
|
/*OBJ flags*/
|
||||||
|
TEST_ASSERT_EQUAL_UINT32(LV_PROPERTY_OBJ_FLAG_CLICKABLE, lv_obj_property_get_id(obj, "flag_clickable"));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user