summaryrefslogtreecommitdiff
path: root/navit/graphics.c
diff options
context:
space:
mode:
Diffstat (limited to 'navit/graphics.c')
-rw-r--r--navit/graphics.c61
1 files changed, 40 insertions, 21 deletions
diff --git a/navit/graphics.c b/navit/graphics.c
index 64611acdc..44993b3e3 100644
--- a/navit/graphics.c
+++ b/navit/graphics.c
@@ -58,6 +58,15 @@
//# Comment:
//# Authors: Martin Schaller (04/2008)
//##############################################################################################################
+/**
+ * @brief graphics object
+ * A graphics object serves as the target for drawing operations.
+ * It encapsulates various settings, and a drawing target, such as an image buffer or a window.
+ * Currently, in Navit, there is always one main graphics object, which is used to draw the
+ * map, and optionally additional graphics objects for overlays.
+ * @see graphics_overlay_new()
+ * @see struct graphics_gc
+ */
struct graphics
{
struct graphics* parent;
@@ -272,19 +281,31 @@ int graphics_get_attr(struct graphics *this_, enum attr_type type, struct attr *
}
/**
- * FIXME
- * @param <>
- * @returns <>
+ * @brief Create a new graphics overlay.
+ * An overlay is a graphics object that is independent of the main graphics object. When
+ * drawing everything to a window, the overlay will be shown on top of the main graphics
+ * object. Navit uses overlays for OSD elements and for the vehicle on the map.
+ * This allows updating OSD elements and the vehicle without redrawing the map.
+ *
+ * @param parent parent graphics context (should be the main graphics context as returned by
+ * graphics_new)
+ * @param p drawing position for the overlay
+ * @param w width of overlay
+ * @param h height of overlay
+ * @param wraparound use wraparound (0/1). If set, position, width and height "wrap around":
+ * negative position coordinates wrap around the window, negative width/height specify
+ * difference to window width/height.
+ * @returns new overlay
* @author Martin Schaller (04/2008)
*/
-struct graphics * graphics_overlay_new(struct graphics *parent, struct point *p, int w, int h, int alpha, int wraparound)
+struct graphics * graphics_overlay_new(struct graphics *parent, struct point *p, int w, int h, int wraparound)
{
struct graphics *this_;
struct point_rect pr;
if (!parent->meth.overlay_new)
return NULL;
this_=g_new0(struct graphics, 1);
- this_->priv=parent->meth.overlay_new(parent->priv, &this_->meth, p, w, h, alpha, wraparound);
+ this_->priv=parent->meth.overlay_new(parent->priv, &this_->meth, p, w, h, wraparound);
this_->image_cache_hash = parent->image_cache_hash;
this_->parent = parent;
pr.lu.x=0;
@@ -301,23 +322,22 @@ struct graphics * graphics_overlay_new(struct graphics *parent, struct point *p,
}
/**
- * @brief Alters the size, position, alpha and wraparound for an overlay
+ * @brief Alters the size, position and wraparound for an overlay
*
* @param this_ The overlay's graphics struct
* @param p The new position of the overlay
* @param w The new width of the overlay
* @param h The new height of the overlay
- * @param alpha The new alpha of the overlay
* @param wraparound The new wraparound of the overlay
*/
void
-graphics_overlay_resize(struct graphics *this_, struct point *p, int w, int h, int alpha, int wraparound)
+graphics_overlay_resize(struct graphics *this_, struct point *p, int w, int h, int wraparound)
{
if (! this_->meth.overlay_resize) {
return;
}
- this_->meth.overlay_resize(this_->priv, p, w, h, alpha, wraparound);
+ this_->meth.overlay_resize(this_->priv, p, w, h, wraparound);
}
static void
@@ -467,9 +487,9 @@ void graphics_font_destroy_all(struct graphics *gra)
}
/**
- * FIXME
- * @param <>
- * @returns <>
+ * Create a new graphics context.
+ * @param gra associated graphics object for the new context
+ * @returns new graphics context
* @author Martin Schaller (04/2008)
*/
struct graphics_gc * graphics_gc_new(struct graphics *gra)
@@ -483,9 +503,8 @@ struct graphics_gc * graphics_gc_new(struct graphics *gra)
}
/**
- * FIXME
- * @param <>
- * @returns <>
+ * Destroy a graphics context, freeing associated resources.
+ * @param gc context to destroy
* @author Martin Schaller (04/2008)
*/
void graphics_gc_destroy(struct graphics_gc *gc)
@@ -530,9 +549,9 @@ graphics_convert_color(struct graphics *gra, struct color *in, struct color *out
}
/**
- * FIXME
- * @param <>
- * @returns <>
+ * Set foreground color.
+ * @param gc graphics context to set color for
+ * @param c color to set
* @author Martin Schaller (04/2008)
*/
void graphics_gc_set_foreground(struct graphics_gc *gc, struct color *c)
@@ -849,9 +868,9 @@ void graphics_image_free(struct graphics *gra, struct graphics_image *img)
}
/**
- * FIXME
- * @param <>
- * @returns <>
+ * Report the beginning or the end of a set of drawing operations.
+ * @param this_ graphics object that is being drawn to
+ * @param mode specify beginning or end of drawing
* @author Martin Schaller (04/2008)
*/
void graphics_draw_mode(struct graphics *this_, enum draw_mode_num mode)