summaryrefslogtreecommitdiff
path: root/iup/src/iup_mask.h
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2009-11-04 11:56:41 -0800
committerPixel <pixel@nobis-crew.org>2009-11-04 11:59:33 -0800
commitd577d991b97ae2b5ee1af23641bcffc3f83af5b2 (patch)
tree590639d50205d1bcfaff2a7d2dc6ebf3f373c7ed /iup/src/iup_mask.h
Initial import. Contains the im, cd and iup librairies, and a "working" Makefile for them under linux.
Diffstat (limited to 'iup/src/iup_mask.h')
-rwxr-xr-xiup/src/iup_mask.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/iup/src/iup_mask.h b/iup/src/iup_mask.h
new file mode 100755
index 0000000..5e87f24
--- /dev/null
+++ b/iup/src/iup_mask.h
@@ -0,0 +1,55 @@
+/** \file
+ * \brief Mask functions
+ *
+ * See Copyright Notice in "iup.h"
+ */
+
+#ifndef __IUP_MASK_H
+#define __IUP_MASK_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** \defgroup mask Text Mask
+ * \par
+ * Used to filter text input in IupText.
+ * \par
+ * See \ref iup_mask.h
+ * \ingroup util */
+
+typedef struct _Imask Imask;
+
+/** Creates a mask given a string. \n
+ * If casei is true, will turn the mask case insensitive.
+ * \ingroup mask */
+Imask* iupMaskCreate(const char* mask_str, int casei);
+
+/** Creates an integer mask with limits.
+ * \ingroup mask */
+Imask* iupMaskCreateInt(int min, int max);
+
+/** Creates a float mask with limits.
+ * \ingroup mask */
+Imask* iupMaskCreateFloat(float min, float max);
+
+/** Destroys the mask.
+ * \ingroup mask */
+void iupMaskDestroy(Imask* mask);
+
+/** Check if the value is valid using the mask to filter it.
+ * Returns 1 if full match, -1 if partial match, and 0 otherwise.
+ * \ingroup mask */
+int iupMaskCheck(Imask* mask, const char *value);
+
+/** Returns the mask string.
+ * \ingroup mask */
+char* iupMaskGetStr(Imask* mask);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif