Gdk

Name

Gdk -- Gdk addons

Synopsis


GdkGC*      new_gdk_GC_with_color           (guint8 red,
                                             guint8 green,
                                             guint8 blue);
void        resize_gdk_pixmap               (GdkPixmap **pixmap,
                                             gint new_width,
                                             gint new_height,
                                             GdkGC *fill);
void        enlarge_gdk_pixmap              (GdkPixmap **pixmap,
                                             gint new_width,
                                             gint new_height,
                                             GdkGC *fill);
void        draw_gdk_text_centered          (GdkDrawable *drawable,
                                             GdkFont *font,
                                             GdkGC *gc,
                                             gint x,
                                             gint y,
                                             gint width,
                                             gint height,
                                             const gchar *text,
                                             gint text_length);
void        fill_gdk_window                 (GdkPixmap *pixmap,
                                             GdkGC *fill);

Description

This is the functionality which I wanted from GDK but wasn't there.

Details

new_gdk_GC_with_color ()

GdkGC*      new_gdk_GC_with_color           (guint8 red,
                                             guint8 green,
                                             guint8 blue);

Creates a new GdkGC (Graphic Context) with the foreground color set to the color descrived by red, green and blue components.

red : red component of the color.
green : green component of the color.
blue : blue component of the color.
Returns : the new Graphic Context.


resize_gdk_pixmap ()

void        resize_gdk_pixmap               (GdkPixmap **pixmap,
                                             gint new_width,
                                             gint new_height,
                                             GdkGC *fill);

Will resize *pixmap and, if enlarging, will fill the extra area with the foreground color of fill.

If the size realy changes, it will copy the old pixmap to a new one, destroing it and setting *pixmap to the new pixmap.

pixmap : pixmap to resize.
new_width : the new width of the pixmap.
new_height : the new height of the pixmap.
fill : a GdkGC with the foreground color set.


enlarge_gdk_pixmap ()

void        enlarge_gdk_pixmap              (GdkPixmap **pixmap,
                                             gint new_width,
                                             gint new_height,
                                             GdkGC *fill);

Same as resize_gdk_pixmap but will only do the resizing if the requested size is bigger then the current size.

This is usefull for eficiency. See src/MEM/drawings/virtual.c:draw_page_tables for an example.

pixmap : pixmap to resize.
new_width : the new width of the pixmap.
new_height : the new height of the pixmap.
fill : a GdkGC with the foreground color set.


draw_gdk_text_centered ()

void        draw_gdk_text_centered          (GdkDrawable *drawable,
                                             GdkFont *font,
                                             GdkGC *gc,
                                             gint x,
                                             gint y,
                                             gint width,
                                             gint height,
                                             const gchar *text,
                                             gint text_length);

Draw text of length text_length centered in the area defined by x, y, width and height of drawable using font font and the foreground color of gc.

drawable : a GdkDrawable.
font : any font.
gc : a GdkGC with the foreground color set.
x : x coordinate of the area.
y : y coordinate of the area.
width : width of the area.
height :height of the area.
text : text to draw.
text_length : length of text.


fill_gdk_window ()

void        fill_gdk_window                 (GdkPixmap *pixmap,
                                             GdkGC *fill);

Paint all the surface of pixmap with the foreground color of fill.

pixmap : pixmap to fill.
fill : a GdkGC with foreground color set.