Basics3GHOSD LibraryBasicsCreation, rendering, destruction.Synopsis
#include <ghosd/ghosd.h>
Ghosd;
void (*GhosdRenderFunc) (Ghosd *ghosd,
cairo_t *cr,
void *user_data);
Ghosd* ghosd_new (void);
void ghosd_set_transparent (Ghosd *ghosd,
int transparent);
#define GHOSD_COORD_CENTER
void ghosd_set_position (Ghosd *ghosd,
int x,
int y,
int width,
int height);
void ghosd_set_render (Ghosd *ghosd,
GhosdRenderFunc render_func,
void *data);
void ghosd_render (Ghosd *ghosd);
void ghosd_show (Ghosd *ghosd);
DescriptionDetailsGhosdGhosdtypedef struct _Ghosd Ghosd;
An opaque Ghosd object. Think of it as the window that the content is
displayed in.
GhosdRenderFunc ()GhosdRenderFuncvoid (*GhosdRenderFunc) (Ghosd *ghosd,
cairo_t *cr,
void *user_data);
The type of callback called when Ghosd needs to render the content.
ghosd :A Ghosd object.
cr :A cairo_t to draw on.
user_data :User data that was passed to ghosd_set_render().
ghosd_new ()ghosd_newGhosd* ghosd_new (void);
Create a new Ghosd object.
Can return NULL if unable to connect to the X server.Returns : a new Ghosd object.
ghosd_set_transparent ()ghosd_set_transparentvoid ghosd_set_transparent (Ghosd *ghosd,
int transparent);
Change the "transparent" setting. Setting transparent to FALSE is
mostly useful for debugging.ghosd : a Ghosd object.
transparent : a boolean indicating the transparent setting.
GHOSD_COORD_CENTERGHOSD_COORD_CENTER#define GHOSD_COORD_CENTER MAXINT
Pass this as a coordinate to ghosd_set_position() to center along that axis.
ghosd_set_position ()ghosd_set_positionvoid ghosd_set_position (Ghosd *ghosd,
int x,
int y,
int width,
int height);
Position the initial Ghosd. Must be called before ghosd_render() and
ghosd_show(), and can only be called once.
Positive x,y are interpreted as normal coordinates.
Pass GHOSD_COORD_CENTER to center on a given dimension,
and negative coordinates right-align (like CSS right).ghosd : a Ghosd object.
x : x coordinate in screen pixels.
y : y coordinate in screen pixels.
width : width in screen pixels.
height : width in screen pixels.
ghosd_set_render ()ghosd_set_rendervoid ghosd_set_render (Ghosd *ghosd,
GhosdRenderFunc render_func,
void *data);
Register a function to draw on the Ghosd.ghosd : a Ghosd object.
render_func : a GhosdRenderFunc callback.
data : user data to pass to the callback.
ghosd_render ()ghosd_rendervoid ghosd_render (Ghosd *ghosd);
Makes the Ghosd redraw itself.ghosd : a Ghosd object.
ghosd_show ()ghosd_showvoid ghosd_show (Ghosd *ghosd);
Show the Ghosd.ghosd : a Ghosd object.