Jump to content

Libraries

From KolibriOS wiki
Library Description Forum topic
Box lib The box_lib.obj library provides various user-interface controls that can be used when developing applications. http://board.kolibrios.org/viewtopic.php?f=24&t=1220
OpenDialog Provides a file and directory selection dialog similar to the Microsoft Windows Common Dialog controls and their counterparts on Linux.
libio Provides facilities for basic file I/O operations, including opening, closing, reading, modifying and truncating files, as well as getting and setting the current file position. It also provides functions for enumerating files in a directory whose names match a specified mask.

In general, this library should be used by programs that need low-level file operations.

libini Provides facilities for working with INI files — text files containing sets of keys and values that can also be edited manually with an external text editor.

In general, this library should be used by programs that need to save and load their settings in a platform-independent format.

http://board.kolibrios.org/viewtopic.php?f=24&t=1114
libimg Provides facilities for working with image files and containers. The library is extensible and can transparently decode images in various formats by identifying them through file signatures and other heuristics.

In general, this library should be used by programs that need to display images in their user interface, such as icons on buttons.

http://board.kolibrios.org/viewtopic.php?f=24&t=1728
libgfx Provides facilities for drawing graphical primitives such as points, lines, outlined and filled rectangles, circles, and more. It uses a canvas abstraction to support buffered rendering.

In general, this library should be used by programs that need to draw graphics on the screen.

buf2d A library for working with 2D images. It can create image buffers in memory and display them on the screen when required. Images can be composited on top of one another, including images with transparency. The library also provides functions for drawing lines, Bézier curves, rectangles and circles, as well as functions for rendering voxel graphics. http://board.kolibrios.org/viewtopic.php?f=24&t=1319
xml Library for parsing XML. http://board.kolibrios.org/viewtopic.php?f=24&t=1701
exif Library for reading EXIF metadata from images. http://board.kolibrios.org/viewtopic.php?f=24&t=2757
libcrash Provides cryptographic hash functions and related functionality. http://board.kolibrios.org/viewtopic.php?f=24&t=2189
console Provides functions for working with the console. http://board.kolibrios.org/viewtopic.php?f=24&t=930
network Provides network-related functions.

Library testing

The source tree contains a .test directory with various library tests. The tests are designed to be independent of one another and should generate, or contain pre-generated, test data that produces identical results regardless of the order in which the tests are executed.

The KIV application was originally based on one of these tests (002). It uses the libio and libimg libraries to demonstrate their capabilities in a small graphical application that can display an image whose path is passed as a command-line argument.

Coding style

All public functions are placed in <library name>.asm, while auxiliary public definitions are placed in <library name>.inc.

All other library-specific functions and definitions — private or auxiliary — are separated into <library name>_p.asm and <library name>_p.inc. Additional files with descriptive names may also be present to provide extra functionality.

Functions declared in public files use the following naming convention: <function namespace>.<function name>

Functions declared in private files use: <library name>._.<function name>

This convention helps keep library code separated when libraries are linked statically.

Functions use a specific format for descriptive comments, allowing documentation to be generated automatically in the future.

See also