xosd3xosd
X on-screen display library
Usage
#include <xosd.h>
xosd* xosd_init(char * font, char * colour, int timeout,
xosd_pos pos, int offset);
int xosd_uninit (xosd* osd);
int xosd_display (xosd* osd, int line,
xosd_command command, ...);
int xosd_hide (xosd* osd);
int xosd_show (xosd* osd);
int xosd_set_pos (xosd* osd, xosd_pos pos);
int xosd_set_offset (xosd* osd, int offset);
int xosd_set_shadow_offset (xosd* osd, int shadow_offset);
int xosd_set_timeout (xosd* osd, int timeout);
int xosd_set_font (xosd* osd, char* font);
int xosd_set_colour (xosd* osd, char* colour);
int xosd_get_colour (xosd* osd,
int* red, int* green, int* blue);
Arguments
- font
-
String with a font name (in XLFD format)
- colour
-
A color name string (in a format which
XParseColor(3x) recognises)
- timeout
-
Time the text will be on screen before it gets removed.
- pos
-
One of
XOSD_toporXOSD_bottom(for the top or the bottom of the screen)
- offset
-
Offset from the top or bottom of the screen.
- shadow_offset
-
Offset of black shadow from main text.
- osd
-
The on-screen display object to act on.
- command
-
One of
XOSD_percentage,XOSD_slider,XOSD_stringorXOSD_printfappropriate number of bars, XOSD_slider is similar, except it only displays a line at the exact percentage required, rather than a full bar up to that point, XOSD_string takes a single char *, and XOSD_printf takes a print style string, and its arguments.
Overview
xosd is a library for displaying an on-screen display (like the one on many TVs) on your X display.
The latest version can be found on http://www.ignavus.net/software.html
It is distributed under the GNU General Public License.
Examples
#include <xosd.h>
int main (int argc, char *argv[])
{
xosd *osd;
osd = xosd_init ("fixed", "LawnGreen", 3, XOSD_top, 0, 1);
xosd_display (osd, 0, XOSD_string, "Example XOSD output");
sleep (5);
xosd_uninit (osd);
return EXIT_SUCCESS;
}