#include <kanzi/core/legacy/debug/kzs_error.hpp>
#include <kanzi/core/legacy/kzs_types.hpp>
#include <kanzi/core/math/vector3.hpp>
Classes | |
struct | KzuVirtualItemIterator |
Iterator for KzuVirtualItemList. More... | |
Typedefs | |
typedef unsigned int(* | KzuVirtualItemCountFunction) (void *userData) |
Function that returns item count of a list box. | |
typedef kzsError(* | KzuVirtualItemSizeFunction) (unsigned int index, void *userData, kanzi::Vector3 &size) |
Function that returns size of an item in the list box. | |
typedef float(* | KzuVirtualItemWidthFunction) (const kanzi::Vector3 size) |
Function that returns a one-dimensional width of a virtual item, based on it's dimensions. | |
Enumerations | |
enum | KzuVirtualItemListDirectionPreference { KZU_VIRTUAL_ITEM_LIST_PREFER_PREVIOUS , KZU_VIRTUAL_ITEM_LIST_PREFER_NEXT } |
Preferred element when exact match cannot be found. More... | |
Functions | |
float | kzuVirtualItemIteratorGetCenter (const struct KzuVirtualItemIterator *iterator) |
Gets offset of the center of the item pointed by the iterator. | |
unsigned int | kzuVirtualItemIteratorGetIndex (const struct KzuVirtualItemIterator *iterator) |
Gets index of the item pointed by the iterator. | |
float | kzuVirtualItemIteratorGetLeftEdge (const struct KzuVirtualItemIterator *iterator) |
Gets offset of the left edge of the item pointed by the iterator. | |
unsigned int | kzuVirtualItemIteratorGetNextIndex (const struct KzuVirtualItemIterator *iterator) |
Gets index of the item after the item pointed by the iterator. | |
unsigned int | kzuVirtualItemIteratorGetPreviousIndex (const struct KzuVirtualItemIterator *iterator) |
Gets index of the item before the item pointed by the iterator. | |
float | kzuVirtualItemIteratorGetRightEdge (const struct KzuVirtualItemIterator *iterator) |
Gets offset of the right edge of the item pointed by the the iterator. | |
kzBool | kzuVirtualItemIteratorHasNext (const struct KzuVirtualItemIterator *iterator) |
Returns whether the iterator has a next item. | |
kzBool | kzuVirtualItemIteratorHasPrevious (const struct KzuVirtualItemIterator *iterator) |
Returns whether the iterator has a previous item. | |
void | kzuVirtualItemIteratorInvalidate (struct KzuVirtualItemIterator *iterator) |
Sets the iterator invalid. | |
kzBool | kzuVirtualItemIteratorIsValid (const struct KzuVirtualItemIterator *iterator) |
Returns whether the virtual item iterator is valid. | |
kzsError | kzuVirtualItemIteratorNext (struct KzuVirtualItemIterator *iterator) |
Iterates to the next item. | |
kzsError | kzuVirtualItemIteratorPrevious (struct KzuVirtualItemIterator *iterator) |
Iterates to the previous item. | |
kzsError | kzuVirtualItemIteratorUpdateWidth (struct KzuVirtualItemIterator *iterator) |
Asks the iterator to update its width. | |
kzsError | kzuVirtualItemListCreate (KzuVirtualItemWidthFunction widthFunction, KzuVirtualItemSizeFunction sizeFunction, void *sizeFunctionUserData, KzuVirtualItemCountFunction countFunction, void *countFunctionUserData, struct KzuVirtualItemList **out_itemList) |
Creates a virtual item list that uses the given list box to provide item data. | |
kzsError | kzuVirtualItemListDelete (struct KzuVirtualItemList *itemList) |
Deletes a virtual item list. | |
unsigned int | kzuVirtualItemListGetIntervalElementCount (const struct KzuVirtualItemIterator *leftIterator, const struct KzuVirtualItemIterator *rightIterator) |
Gets the number of elements that are in between the left and right iterators, including the iterators. | |
kzBool | kzuVirtualItemListIsLooping (const struct KzuVirtualItemList *itemList) |
Gets whether the virtual item list is looping. | |
void | kzuVirtualItemListSetLooping (struct KzuVirtualItemList *itemList, kzBool looping) |
Sets whether the virtual item list is looping. | |
void | kzuVirtualItemListSetSpacing (struct KzuVirtualItemList *itemList, float spacing) |
Sets spacing between items in the virtual item list. | |
typedef float(* KzuVirtualItemWidthFunction) (const kanzi::Vector3 size) |
Function that returns a one-dimensional width of a virtual item, based on it's dimensions.
As an example, if used in a horizontal layout the function should return object's width. This value is used for determining how much space an item will need in the virtual item list.
typedef kzsError(* KzuVirtualItemSizeFunction) (unsigned int index, void *userData, kanzi::Vector3 &size) |
Function that returns size of an item in the list box.
typedef unsigned int(* KzuVirtualItemCountFunction) (void *userData) |
Function that returns item count of a list box.
kzBool kzuVirtualItemIteratorIsValid | ( | const struct KzuVirtualItemIterator * | iterator | ) |
Returns whether the virtual item iterator is valid.
void kzuVirtualItemIteratorInvalidate | ( | struct KzuVirtualItemIterator * | iterator | ) |
Sets the iterator invalid.
kzsError kzuVirtualItemIteratorUpdateWidth | ( | struct KzuVirtualItemIterator * | iterator | ) |
Asks the iterator to update its width.
float kzuVirtualItemIteratorGetRightEdge | ( | const struct KzuVirtualItemIterator * | iterator | ) |
Gets offset of the right edge of the item pointed by the the iterator.
float kzuVirtualItemIteratorGetCenter | ( | const struct KzuVirtualItemIterator * | iterator | ) |
Gets offset of the center of the item pointed by the iterator.
float kzuVirtualItemIteratorGetLeftEdge | ( | const struct KzuVirtualItemIterator * | iterator | ) |
Gets offset of the left edge of the item pointed by the iterator.
unsigned int kzuVirtualItemIteratorGetIndex | ( | const struct KzuVirtualItemIterator * | iterator | ) |
Gets index of the item pointed by the iterator.
kzBool kzuVirtualItemIteratorHasNext | ( | const struct KzuVirtualItemIterator * | iterator | ) |
Returns whether the iterator has a next item.
kzBool kzuVirtualItemIteratorHasPrevious | ( | const struct KzuVirtualItemIterator * | iterator | ) |
Returns whether the iterator has a previous item.
unsigned int kzuVirtualItemIteratorGetNextIndex | ( | const struct KzuVirtualItemIterator * | iterator | ) |
Gets index of the item after the item pointed by the iterator.
unsigned int kzuVirtualItemIteratorGetPreviousIndex | ( | const struct KzuVirtualItemIterator * | iterator | ) |
Gets index of the item before the item pointed by the iterator.
kzsError kzuVirtualItemIteratorNext | ( | struct KzuVirtualItemIterator * | iterator | ) |
Iterates to the next item.
kzsError kzuVirtualItemIteratorPrevious | ( | struct KzuVirtualItemIterator * | iterator | ) |
Iterates to the previous item.
kzsError kzuVirtualItemListCreate | ( | KzuVirtualItemWidthFunction | widthFunction, |
KzuVirtualItemSizeFunction | sizeFunction, | ||
void * | sizeFunctionUserData, | ||
KzuVirtualItemCountFunction | countFunction, | ||
void * | countFunctionUserData, | ||
struct KzuVirtualItemList ** | out_itemList ) |
Creates a virtual item list that uses the given list box to provide item data.
widthFunction | Function that returns the width from an object size. |
sizeFunction | Function that returns the size of an object by index. |
sizeFunctionUserData | User data for the size function. |
countFunction | Function that returns total item count of virtual item list. |
countFunctionUserData | User data for the count function. |
out_itemList | The created virtual item list. |
kzsError kzuVirtualItemListDelete | ( | struct KzuVirtualItemList * | itemList | ) |
Deletes a virtual item list.
void kzuVirtualItemListSetLooping | ( | struct KzuVirtualItemList * | itemList, |
kzBool | looping ) |
Sets whether the virtual item list is looping.
kzBool kzuVirtualItemListIsLooping | ( | const struct KzuVirtualItemList * | itemList | ) |
Gets whether the virtual item list is looping.
void kzuVirtualItemListSetSpacing | ( | struct KzuVirtualItemList * | itemList, |
float | spacing ) |
Sets spacing between items in the virtual item list.
unsigned int kzuVirtualItemListGetIntervalElementCount | ( | const struct KzuVirtualItemIterator * | leftIterator, |
const struct KzuVirtualItemIterator * | rightIterator ) |
Gets the number of elements that are in between the left and right iterators, including the iterators.
For example:
Calling this function with invalid iterators results in undefined behavior.