diff include/mb_shapes.h @ 257:50d253d0fcba

Simple image loader and image shape. - img_ldr.c is a simple image loader that rooted on a directory specified when a loader instance been created. - sh_image_t is corresponding shape of image tag in SVG. - This changeset is still buggy. It need more testing. - svg2code.py is not ready for image tag.
author Thinker K.F. Li <thinker@branda.to>
date Thu, 15 Jan 2009 16:46:47 +0800
parents bcad1ccdf45c
children 29acbd8a0dd0
line wrap: on
line diff
--- a/include/mb_shapes.h	Thu Jan 15 02:15:35 2009 +0800
+++ b/include/mb_shapes.h	Thu Jan 15 16:46:47 2009 +0800
@@ -10,6 +10,7 @@
 #include <cairo.h>
 #include "mb_types.h"
 #include "mb_redraw_man.h"
+#include "mb_img_ldr.h"
 
 /*! \page define_shape How to Define Shapes
  *
@@ -29,6 +30,14 @@
  * - 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
@@ -68,6 +77,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(shape_t *shape, co_aix x, co_aix y,
+			 co_aix w, co_aix h);
+/* @} */
 /* @} */
 
 #endif /* __SHAPES_H_ */