LibMB
1.9
|
mbpixbuf contains simple image manipulation and composition functions for client side images. More...
Macros | |
#define | mb_drawable_pixmap(drw) (drw)->xpixmap |
Returns a drawables X pixmap. | |
Typedefs | |
typedef struct MBColor | MBColor |
Its not recommended you touch structure internals directly. | |
typedef struct MBFont | MBFont |
Its not recommended you touch structure internals directly. | |
typedef struct MBDrawable | MBDrawable |
Type for representing an mbdrawable. More... | |
typedef struct MBLayout | MBLayout |
Experimental and therefore not as yet documented. More... | |
Enumerations | |
enum | MBEncoding |
enumerated types for text encodings | |
enum | MBFontWeight |
enumerated types for font weights. | |
enum | MBFontSlant |
enumerated types for font slant styles | |
enum | MBFontRenderOpts |
Option flags for text rendering. | |
Functions | |
MBColor * | mb_col_new_from_spec (MBPixbuf *pb, char *spec) |
Constructs a new MBColor from a string specification. More... | |
Bool | mb_col_set (MBColor *col, char *spec) |
Sets an existing MBColor from a string specification. More... | |
void | mb_col_set_rgba (MBColor *col, unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha) |
Sets an existing MBColor from r,g,b,a values. More... | |
void | mb_col_get_rgba (MBColor *col, unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *alpha) |
Gets an r,g,b,a values from an existing MBColor. More... | |
void | mb_col_unref (MBColor *col) |
Unrefs ( frees ) a created MBColor object. More... | |
MBFont * | mb_font_new (Display *dpy, char *family) |
Constructs a new MBFont instance. More... | |
void | mb_font_ref (MBFont *font) |
Refs a created MBFont object. More... | |
void | mb_font_unref (MBFont *font) |
Unrefs ( frees ) a created MBColor object. More... | |
MBFont * | mb_font_new_from_string (Display *dpy, char *spec) |
Constructs a new MBFont instance. More... | |
MBFont * | mb_font_set_from_string (MBFont *font, char *spec) |
Sets the font propertys from a textual description. More... | |
void | mb_font_set_family (MBFont *font, const char *family) |
Sets the fonts family. More... | |
char * | mb_font_get_family (MBFont *font) |
Gets the fonts family. More... | |
void | mb_font_set_weight (MBFont *font, MBFontWeight weight) |
Sets the fonts weight. More... | |
MBFontWeight | mb_font_get_weight (MBFont *font) |
Gets the fonts weight. More... | |
void | mb_font_set_slant (MBFont *font, MBFontSlant slant) |
Sets the fonts slant. More... | |
void | mb_font_set_point_size (MBFont *font, int points) |
Sets the fonts size. More... | |
int | mb_font_get_point_size (MBFont *font) |
Gets the fonts point size. More... | |
int | mb_font_set_size_to_pixels (MBFont *font, int max_pixels, int *points_to_try) |
Attempts to fit the point size to a pixel size. More... | |
void | mb_font_set_color (MBFont *font, MBColor *col) |
Sets the fonts color. More... | |
MBColor * | mb_font_get_color (MBFont *font) |
Gets the fonts point size. More... | |
int | mb_font_get_height (MBFont *font) |
Gets the fonts height in pixels. More... | |
int | mb_font_get_ascent (MBFont *font) |
Gets the fonts ascent in pixels. More... | |
int | mb_font_get_descent (MBFont *font) |
Gets the fonts descent in pixels. More... | |
int | mb_font_render_simple (MBFont *font, MBDrawable *drw, int x, int y, int width, unsigned char *text, int encoding, MBFontRenderOpts opts) |
Renders a line of text onto a MBDrawable. More... | |
int | mb_font_render_simple_get_width (MBFont *font, int width, unsigned char *text, int encoding, MBFontRenderOpts opts) |
Returns the width in pixels of any text rendered with mb_font_render_simple, taking into account any clipping. More... | |
MBDrawable * | mb_drawable_new (MBPixbuf *pixbuf, int width, int height) |
Creates a new MBDrawable instance. More... | |
MBDrawable * | mb_drawable_new_from_pixmap (MBPixbuf *pixbuf, Pixmap pxm) |
Creates a new MBDrawable instance from a pre-existing pixmap. More... | |
void | mb_drawable_unref (MBDrawable *drw) |
Unrefs ( frees ) a drawable. More... | |
mbpixbuf contains simple image manipulation and composition functions for client side images.
MBDrawable |
Type for representing an mbdrawable.
This basically wraps X pixmaps and Xft Drawables
Its not recommended you touch this directly.
MBLayout |
Experimental and therefore not as yet documented.
Its not recommended you touch this directly.
void mb_col_get_rgba | ( | MBColor * | col, |
unsigned char * | red, | ||
unsigned char * | green, | ||
unsigned char * | blue, | ||
unsigned char * | alpha | ||
) |
Gets an r,g,b,a values from an existing MBColor.
col | MBColor object to query |
red | red component |
green | green component |
blue | blue component |
alpha | alpha component |
Constructs a new MBColor from a string specification.
The format of the specification can be a color name or the format '#rrggbb[aa]'
pb | MBPixbuf reference |
spec |
Bool mb_col_set | ( | MBColor * | col, |
char * | spec | ||
) |
Sets an existing MBColor from a string specification.
The format of the specification can be a color name or the format '#rrggbb[aa]'
col | MBColor object to modify |
spec | New Color specification |
void mb_col_set_rgba | ( | MBColor * | col, |
unsigned char | red, | ||
unsigned char | green, | ||
unsigned char | blue, | ||
unsigned char | alpha | ||
) |
Sets an existing MBColor from r,g,b,a values.
col | MBColor object to modify |
red | red component |
green | green component |
blue | blue component |
alpha | alpha component |
void mb_col_unref | ( | MBColor * | col | ) |
Unrefs ( frees ) a created MBColor object.
col | MBColor object to unref |
MBDrawable* mb_drawable_new | ( | MBPixbuf * | pixbuf, |
int | width, | ||
int | height | ||
) |
Creates a new MBDrawable instance.
MBDrawables are what MBfonts get rendered too.
pixbuf | A MBPixbuf Instance. |
width | Width of requested drawable. |
height | Height of requested drawable. |
MBDrawable* mb_drawable_new_from_pixmap | ( | MBPixbuf * | pixbuf, |
Pixmap | pxm | ||
) |
Creates a new MBDrawable instance from a pre-existing pixmap.
Note, if created like this you are responsable for freeing the the drawables pixmap
pixbuf | A MBPixbuf Instance. |
pxm | the pixmap to create the drawable from |
void mb_drawable_unref | ( | MBDrawable * | drw | ) |
Unrefs ( frees ) a drawable.
drw | MBDrawable to unref |
int mb_font_get_ascent | ( | MBFont * | font | ) |
Gets the fonts ascent in pixels.
font | The font to query |
Gets the fonts point size.
font | The font to query |
int mb_font_get_descent | ( | MBFont * | font | ) |
Gets the fonts descent in pixels.
font | The font to query |
char* mb_font_get_family | ( | MBFont * | font | ) |
Gets the fonts family.
font | The font to query |
int mb_font_get_height | ( | MBFont * | font | ) |
Gets the fonts height in pixels.
font | The font to query |
int mb_font_get_point_size | ( | MBFont * | font | ) |
Gets the fonts point size.
font | The font to query |
MBFontWeight mb_font_get_weight | ( | MBFont * | font | ) |
Gets the fonts weight.
font | The font to query |
MBFont* mb_font_new | ( | Display * | dpy, |
char * | family | ||
) |
Constructs a new MBFont instance.
dpy | X Display |
family | font family name or NULL |
MBFont* mb_font_new_from_string | ( | Display * | dpy, |
char * | spec | ||
) |
Constructs a new MBFont instance.
dpy | X Display |
spec | A description of the font. This will take Gtk2 style font descriptions or Xft style ones |
void mb_font_ref | ( | MBFont * | font | ) |
Refs a created MBFont object.
font | MBFont object to unref |
int mb_font_render_simple | ( | MBFont * | font, |
MBDrawable * | drw, | ||
int | x, | ||
int | y, | ||
int | width, | ||
unsigned char * | text, | ||
int | encoding, | ||
MBFontRenderOpts | opts | ||
) |
Renders a line of text onto a MBDrawable.
font | The font to render |
drw | The MBDrawable to render too |
x | The X position on MBDrawable to render too |
y | The Y position on MBDrawable to render too |
width | The maximum width in pixels to render |
text | The text to render. |
encoding | the encoding of the text to render |
opts | Or'd MBFontRenderOpts |
int mb_font_render_simple_get_width | ( | MBFont * | font, |
int | width, | ||
unsigned char * | text, | ||
int | encoding, | ||
MBFontRenderOpts | opts | ||
) |
Returns the width in pixels of any text rendered with mb_font_render_simple, taking into account any clipping.
font | The font to render |
width | The maximum width in pixels to render |
text | The text to render. |
encoding | the encoding of the text to render |
opts | Or'd MBFontRenderOpts |
Sets the fonts color.
Note you must set a fonts color for it to be rendered
font | The font to alter |
col | The requested color. |
void mb_font_set_family | ( | MBFont * | font, |
const char * | family | ||
) |
Sets the fonts family.
font | the font to alter |
family | font family name |
Sets the font propertys from a textual description.
font | the font to alter |
spec | A description of the font. This will take Gtk2 style font descriptions or Xft style ones |
void mb_font_set_point_size | ( | MBFont * | font, |
int | points | ||
) |
Sets the fonts size.
font | The font to alter |
points | requested size in points |
int mb_font_set_size_to_pixels | ( | MBFont * | font, |
int | max_pixels, | ||
int * | points_to_try | ||
) |
Attempts to fit the point size to a pixel size.
font | The font to alter |
max_pixels | Pixel size to fit to |
points_to_try | a list on point sizes to try or NULL ( to use default values ) |
void mb_font_set_slant | ( | MBFont * | font, |
MBFontSlant | slant | ||
) |
Sets the fonts slant.
font | The font to alter |
slant | The requested font slant |
void mb_font_set_weight | ( | MBFont * | font, |
MBFontWeight | weight | ||
) |
Sets the fonts weight.
font | The font to alter |
weight | The requested font weight |
void mb_font_unref | ( | MBFont * | font | ) |
Unrefs ( frees ) a created MBColor object.
font | MBFont object to unref |