Mercurial > MadButterfly
diff include/mb_shapes.h @ 280:c8b6ca46950b mbtext
Add merged result
author | wycc |
---|---|
date | Sat, 31 Jan 2009 12:29:50 +0800 |
parents | a90fd749af82 b42ee279669e |
children | 137a73822d48 |
line wrap: on
line diff
--- a/include/mb_shapes.h Sat Jan 31 11:51:19 2009 +0800 +++ b/include/mb_shapes.h Sat Jan 31 12:29:50 2009 +0800 @@ -10,6 +10,7 @@ #include <cairo.h> #include "mb_types.h" #include "mb_redraw_man.h" +#include "mb_img_ldr.h" #include <pango/pangocairo.h> /*! \page define_shape How to Define Shapes @@ -24,12 +25,22 @@ * - assigned to \ref shape_t::free. * - *_transform() * - *_draw() + * - *_draw() is responsive to define shape. How the shape is filled + * or stroked is defined by paint. * - first member variable of a shape type must be a shape_t. * * Must modify * - event.c::draw_shape_path() * - redraw_man.c::clean_shape() * - redraw_man.c::draw_shape() + * + * \section shape_transform Shape Transform + * + * All shape types must have a shape transform function. It is invoked by + * redraw_man.c::clean_shape(). It's task is to update \ref geo_t of the + * shape object. In most situtation, it call geo_from_positions() to + * update geo_t. + * */ /*! \defgroup shapes Shapes @@ -154,6 +165,19 @@ extern void sh_rect_set(shape_t *shape, co_aix x, co_aix y, co_aix w, co_aix h, co_aix rx, co_aix ry); /* @} */ + +/*! \defgroup shape_image Shape of Image + * @{ + */ +extern shape_t *rdman_shape_image_new(redraw_man_t *rdman, + mb_img_data_t *img_data, + co_aix x, co_aix y, + co_aix w, co_aix h); +extern void sh_image_transform(shape_t *shape); +extern void sh_image_draw(shape_t *shape, cairo_t *cr); +extern void sh_image_set_geometry(shape_t *shape, co_aix x, co_aix y, + co_aix w, co_aix h); +/* @} */ /* @} */ #endif /* __SHAPES_H_ */