|
wlmaker
|
#include "box.h"#include <stdint.h>#include <string.h>#include "libbase/libbase.h"#include "container.h"#include "rectangle.h"
Functions | |
| static void | _wlmtk_box_element_layout (wlmtk_element_t *element_ptr) |
| static bs_dllist_node_t * | create_margin (wlmtk_box_t *box_ptr) |
| static void | _wlmtk_box_margin_set_color (bs_dllist_node_t *dlnode_ptr, void *ud_ptr) |
| bool | wlmtk_box_init (wlmtk_box_t *box_ptr, wlmtk_box_orientation_t orientation, const struct wlmtk_margin_style *style_ptr) |
| void | wlmtk_box_fini (wlmtk_box_t *box_ptr) |
| void | wlmtk_box_add_element_front (wlmtk_box_t *box_ptr, wlmtk_element_t *element_ptr) |
| void | wlmtk_box_add_element_back (wlmtk_box_t *box_ptr, wlmtk_element_t *element_ptr) |
| void | wlmtk_box_remove_element (wlmtk_box_t *box_ptr, wlmtk_element_t *element_ptr) |
| wlmtk_element_t * | wlmtk_box_element (wlmtk_box_t *box_ptr) |
| void | wlmtk_box_set_style (wlmtk_box_t *box_ptr, const struct wlmtk_margin_style *style_ptr) |
| static void | test_init_fini (bs_test_t *test_ptr) |
| static void | test_layout_horizontal (bs_test_t *test_ptr) |
| static void | test_layout_vertical (bs_test_t *test_ptr) |
Variables | |
| static const wlmtk_element_vmt_t | box_element_vmt |
| static const bs_test_case_t | _wlmtk_box_test_cases [] |
| const bs_test_set_t | wlmtk_box_test_set |
| static const struct wlmtk_margin_style | test_style |
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
static |
Lays out the elements of the box.
Steps through all visible elements, and sets their position to be left-to-right. Also updates and repositions all margin elements.
| element_ptr |
|
static |
Sets the color in each margin rectangle.
|
static |
Creates a new margin element, and returns the dlnode.
|
static |
Exercises setup and teardown.
|
static |
Tests layouting horizontally
|
static |
Tests layouting vertically
| void wlmtk_box_add_element_back | ( | wlmtk_box_t * | box_ptr, |
| wlmtk_element_t * | element_ptr | ||
| ) |
Adds element_ptr to the back of the box.
| box_ptr | |
| element_ptr |
| void wlmtk_box_add_element_front | ( | wlmtk_box_t * | box_ptr, |
| wlmtk_element_t * | element_ptr | ||
| ) |
Adds element_ptr to the front of the box.
| box_ptr | |
| element_ptr |
| wlmtk_element_t * wlmtk_box_element | ( | wlmtk_box_t * | box_ptr | ) |
box_ptr. | void wlmtk_box_fini | ( | wlmtk_box_t * | box_ptr | ) |
Un-initializes the box.
| box_ptr |
| bool wlmtk_box_init | ( | wlmtk_box_t * | box_ptr, |
| wlmtk_box_orientation_t | orientation, | ||
| const struct wlmtk_margin_style * | style_ptr | ||
| ) |
Initializes the box with the provided virtual method table.
| box_ptr | |
| orientation | |
| style_ptr |
| void wlmtk_box_remove_element | ( | wlmtk_box_t * | box_ptr, |
| wlmtk_element_t * | element_ptr | ||
| ) |
Removes element_ptr from the box.
Requires that element_ptr is an element of the box.
| box_ptr | |
| element_ptr |
| void wlmtk_box_set_style | ( | wlmtk_box_t * | box_ptr, |
| const struct wlmtk_margin_style * | style_ptr | ||
| ) |
Updates the box style and updates the layout of the contained elements.
|
static |
Test cases
|
static |
Virtual method table: wlmtk_element_t at wlmtk_box_t level.
|
static |
Style used for tests.
| const bs_test_set_t wlmtk_box_test_set |
Unit tests.