summaryrefslogtreecommitdiff
path: root/iup/src/iup_draw.h
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2010-06-15 00:59:57 -0700
committerPixel <pixel@nobis-crew.org>2010-06-15 00:59:57 -0700
commiteed0eb6a476d54ce19aeff137984aa981d9e3976 (patch)
tree807891636efd2f87dcbd261e971216269973ae07 /iup/src/iup_draw.h
parentccc8261e4d48de89da4ddfe7b55e378ae0cd6f47 (diff)
Upgrading to iup 3.1
Diffstat (limited to 'iup/src/iup_draw.h')
-rw-r--r--iup/src/iup_draw.h98
1 files changed, 98 insertions, 0 deletions
diff --git a/iup/src/iup_draw.h b/iup/src/iup_draw.h
new file mode 100644
index 0000000..b4d08e3
--- /dev/null
+++ b/iup/src/iup_draw.h
@@ -0,0 +1,98 @@
+/** \file
+ * \brief Simple Draw API.
+ *
+ * See Copyright Notice in "iup.h"
+ */
+
+#ifndef __IUP_DRAW_H
+#define __IUP_DRAW_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/** \defgroup draw Simple Draw API
+ * \par
+ * See \ref iup_draw.h
+ * \ingroup util */
+
+
+
+struct _IdrawCanvas;
+typedef struct _IdrawCanvas IdrawCanvas;
+
+
+/** Creates a draw canvas based on an IupCanvas.
+ * This will create an image for offscreen drawing.
+ * \ingroup draw */
+IdrawCanvas* iupDrawCreateCanvas(Ihandle* ih);
+
+/** Destroys the IdrawCanvas.
+ * \ingroup draw */
+void iupDrawKillCanvas(IdrawCanvas* dc);
+
+/** Draws the ofscreen image on the screen.
+ * \ingroup draw */
+void iupDrawFlush(IdrawCanvas* dc);
+
+/** Rebuild the offscreen image if the canvas size has changed.
+ * Automatically done in iupDrawCreateCanvas.
+ * \ingroup draw */
+void iupDrawUpdateSize(IdrawCanvas* dc);
+
+/** Returns the canvas size available for drawing.
+ * \ingroup draw */
+void iupDrawGetSize(IdrawCanvas* dc, int *w, int *h);
+
+/** Draws the parent background.
+ * \ingroup draw */
+void iupDrawParentBackground(IdrawCanvas* dc);
+
+/** Draws a line.
+ * \ingroup draw */
+void iupDrawLine(IdrawCanvas* dc, int x1, int y1, int x2, int y2, unsigned char r, unsigned char g, unsigned char b);
+
+/** Draws a filled/hollow rectangle.
+ * \ingroup draw */
+void iupDrawRectangle(IdrawCanvas* dc, int x1, int y1, int x2, int y2, unsigned char r, unsigned char g, unsigned char b, int filled);
+
+/** Draws a filled/hollow arc.
+ * \ingroup draw */
+void iupDrawArc(IdrawCanvas* dc, int x1, int y1, int x2, int y2, double a1, double a2, unsigned char r, unsigned char g, unsigned char b, int filled);
+
+/** Draws a filled/hollow polygon.
+ * points are arranged xyxyxy...
+ * \ingroup draw */
+void iupDrawPolygon(IdrawCanvas* dc, int* points, int count, unsigned char r, unsigned char g, unsigned char b, int filled);
+
+/** Draws a text.
+ * x,y is at left,top corner of the text.
+ * \ingroup draw */
+void iupDrawText(IdrawCanvas* dc, const char* text, int len, int x, int y, unsigned char r, unsigned char g, unsigned char b);
+
+/** Draws an image.
+ * x,y is at left,top corner of the image.
+ * \ingroup draw */
+void iupDrawImage(IdrawCanvas* dc, const char* name, int make_inactive, int x, int y);
+
+/** Sets a rectangle clipping area.
+ * \ingroup draw */
+void iupDrawSetClipRect(IdrawCanvas* dc, int x1, int y1, int x2, int y2);
+
+/** Removes clipping.
+ * \ingroup draw */
+void iupDrawResetClip(IdrawCanvas* dc);
+
+/*
+TO DO:
+- check position and size of primitives
+*/
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+