core: layout 模块添加 wm_layout_registry_move 函数
This commit is contained in:
@@ -52,6 +52,21 @@ void wm_layout_registry_cleanup(wm_layout_registry_t *registry) {
|
||||
registry->slot_capacity = 0;
|
||||
}
|
||||
|
||||
bool wm_layout_registry_move(wm_layout_registry_t *src,
|
||||
wm_layout_registry_t *dest) {
|
||||
if (!src || !dest) return false;
|
||||
|
||||
dest->slots = src->slots;
|
||||
dest->slot_count = src->slot_count;
|
||||
dest->slot_capacity = src->slot_capacity;
|
||||
|
||||
src->slots = nullptr;
|
||||
src->slot_count = 0;
|
||||
src->slot_capacity = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t wm_layout_registry_count(const wm_layout_registry_t *registry) {
|
||||
return registry->slot_count;
|
||||
}
|
||||
|
||||
@@ -99,6 +99,8 @@ void wm_layout_result_push(wm_layout_result_t *result, wm_layout_item_t item);
|
||||
*/
|
||||
void wm_layout_registry_init(wm_layout_registry_t *registry);
|
||||
void wm_layout_registry_cleanup(wm_layout_registry_t *registry);
|
||||
bool wm_layout_registry_move(wm_layout_registry_t *src,
|
||||
wm_layout_registry_t *dest);
|
||||
size_t wm_layout_registry_count(const wm_layout_registry_t *registry);
|
||||
const wm_layout_slot_t *wm_layout_registry_at(
|
||||
const wm_layout_registry_t *registry, size_t index);
|
||||
|
||||
Reference in New Issue
Block a user