///lv_obj.h typedefstruct _lv_obj_t { struct _lv_obj_t* parent;/**< Pointer to the parent object*/ lv_ll_t child_ll; /**< Linked list to store the children objects*/ lv_area_t coords; /**< Coordinates of the object (x1, y1, x2, y2)*/ lv_event_cb_t event_cb; /**< Event callback function */ lv_signal_cb_t signal_cb; /**< Object type specific signal function*/ lv_design_cb_t design_cb; /**< Object type specific design function*/ void* ext_attr; /**< Object type specific extended data*/ lv_style_list_t style_list; #if LV_USE_EXT_CLICK_AREA == LV_EXT_CLICK_AREA_TINY uint8_t ext_click_pad_hor; /**< Extra click padding in horizontal direction */ uint8_t ext_click_pad_ver; /**< Extra click padding in vertical direction */ #elif LV_USE_EXT_CLICK_AREA == LV_EXT_CLICK_AREA_FULL lv_area_t ext_click_pad; /**< Extra click padding area. */ #endif lv_coord_t ext_draw_pad; /**< EXTend the size in every direction for drawing. */ /*Attributes and states*/ uint8_t click : 1; /**< 1: Can be pressed by an input device*/ uint8_t drag : 1; /**< 1: Enable the dragging*/ uint8_t drag_throw : 1; /**< 1: Enable throwing with drag*/ uint8_t drag_parent : 1; /**< 1: Parent will be dragged instead*/ uint8_t hidden : 1; /**< 1: Object is hidden*/ uint8_t top : 1; /**< 1: If the object or its children is clicked it goes to the foreground*/ uint8_t parent_event : 1; /**< 1: Send the object's events to the parent too. */ uint8_t adv_hittest : 1; /**< 1: Use advanced hit-testing (slower) */ uint8_t gesture_parent : 1; /**< 1: Parent will be gesture instead*/ uint8_t focus_parent : 1; /**< 1: Parent will be focused instead*/ lv_drag_dir_t drag_dir : 3; /**< Which directions the object can be dragged in */ lv_bidi_dir_t base_dir : 2; /**< Base direction of texts related to this object */ #if LV_USE_GROUP != 0 void* group_p; #endif uint8_t protect; /**< Automatically happening actions can be prevented. 'OR'ed values from `lv_protect_t`*/ lv_state_t state; #if LV_USE_ID lv_id_t id; /**< Unique object ID in screen*/ #endif #if LV_USE_OBJ_REALIGN lv_realign_t realign; /**< Information about the last call to ::lv_obj_align. */ #endif #if LV_USE_USER_DATA lv_obj_user_data_t user_data; /**< Custom user data for object. */ #endif } lv_obj_t;
/** * Set relative the position of an object (relative to the parent) * @param obj pointer to an object * @param x new distance from the left side of the parent * @param y new distance from the top of the parent */ voidlv_obj_set_pos(lv_obj_t* obj, lv_coord_t x, lv_coord_t y); /** * Set the x coordinate of a object * @param obj pointer to an object * @param x new distance from the left side from the parent */ voidlv_obj_set_x(lv_obj_t* obj, lv_coord_t x); /** * Set the y coordinate of a object * @param obj pointer to an object * @param y new distance from the top of the parent */ voidlv_obj_set_y(lv_obj_t* obj, lv_coord_t y);