summaryrefslogtreecommitdiff
path: root/iup/srccontrols/matrix/iupmat_scroll.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/srccontrols/matrix/iupmat_scroll.h
Initial import. Contains the im, cd and iup librairies, and a "working" Makefile for them under linux.
Diffstat (limited to 'iup/srccontrols/matrix/iupmat_scroll.h')
-rwxr-xr-xiup/srccontrols/matrix/iupmat_scroll.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/iup/srccontrols/matrix/iupmat_scroll.h b/iup/srccontrols/matrix/iupmat_scroll.h
new file mode 100755
index 0000000..582442b
--- /dev/null
+++ b/iup/srccontrols/matrix/iupmat_scroll.h
@@ -0,0 +1,69 @@
+/** \file
+ * \brief iupmatrix control
+ * scrolling.
+ *
+ * See Copyright Notice in "iup.h"
+ */
+
+#ifndef __IUPMAT_SCROLL_H
+#define __IUPMAT_SCROLL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int iupMatrixScroll_CB(Ihandle* ih, int action, float x, float y);
+
+void iupMatrixScrollToVisible(Ihandle* ih, int lin, int col);
+
+typedef void (*iupMatrixScrollMoveF)(Ihandle* ih, int mode, float pos, int m);
+void iupMatrixScrollMoveCursor(iupMatrixScrollMoveF func, Ihandle* ih, int mode, float pos, int m);
+
+/* Used only by the macros bellow */
+void iupMatrixScrollHome (Ihandle* ih, int, float, int);
+void iupMatrixScrollEnd (Ihandle* ih, int, float, int);
+void iupMatrixScrollLeftUp (Ihandle* ih, int, float, int);
+void iupMatrixScrollRightDown (Ihandle* ih, int, float, int);
+void iupMatrixScrollPgLeftUp (Ihandle* ih, int, float, int);
+void iupMatrixScrollPgRightDown(Ihandle* ih, int, float, int);
+void iupMatrixScrollPos (Ihandle* ih, int, float, int);
+void iupMatrixScrollCr (Ihandle* ih, int, float, int);
+
+/* Mode used to "walk" inside the matrix.
+ It shows if the movement request was from the scrollbar or from a key.
+ Possible values for the "mode" parameter of the iupMatrixScrollMoveCursor function.
+ */
+#define IMAT_SCROLLBAR 0
+#define IMAT_SCROLLKEY 1
+
+/* Macros to help during the call of iupMatrixScrollMoveCursor function */
+
+/* used in the keyboard processing module */
+#define iupMatrixScrollKeyHome(ih) iupMatrixScrollMoveCursor(iupMatrixScrollHome , ih, IMAT_SCROLLKEY, 0, 0)
+#define iupMatrixScrollKeyEnd(ih) iupMatrixScrollMoveCursor(iupMatrixScrollEnd , ih, IMAT_SCROLLKEY, 0, 0)
+#define iupMatrixScrollKeyPgUp(ih) iupMatrixScrollMoveCursor(iupMatrixScrollPgLeftUp , ih, IMAT_SCROLLKEY, 0, IMAT_PROCESS_LIN)
+#define iupMatrixScrollKeyPgDown(ih) iupMatrixScrollMoveCursor(iupMatrixScrollPgRightDown, ih, IMAT_SCROLLKEY, 0, IMAT_PROCESS_LIN)
+#define iupMatrixScrollKeyDown(ih) iupMatrixScrollMoveCursor(iupMatrixScrollRightDown , ih, IMAT_SCROLLKEY, 0, IMAT_PROCESS_LIN)
+#define iupMatrixScrollKeyRight(ih) iupMatrixScrollMoveCursor(iupMatrixScrollRightDown , ih, IMAT_SCROLLKEY, 0, IMAT_PROCESS_COL)
+#define iupMatrixScrollKeyUp(ih) iupMatrixScrollMoveCursor(iupMatrixScrollLeftUp , ih, IMAT_SCROLLKEY, 0, IMAT_PROCESS_LIN)
+#define iupMatrixScrollKeyLeft(ih) iupMatrixScrollMoveCursor(iupMatrixScrollLeftUp , ih, IMAT_SCROLLKEY, 0, IMAT_PROCESS_COL)
+#define iupMatrixScrollKeyCr(ih) iupMatrixScrollMoveCursor(iupMatrixScrollCr , ih, IMAT_SCROLLKEY, 0, 0)
+
+/* Used by the scrollbar callback only */
+#define iupMatrixScrollUp(ih) iupMatrixScrollMoveCursor(iupMatrixScrollLeftUp , ih, IMAT_SCROLLBAR, 0, IMAT_PROCESS_LIN)
+#define iupMatrixScrollLeft(ih) iupMatrixScrollMoveCursor(iupMatrixScrollLeftUp , ih, IMAT_SCROLLBAR, 0, IMAT_PROCESS_COL)
+#define iupMatrixScrollDown(ih) iupMatrixScrollMoveCursor(iupMatrixScrollRightDown , ih, IMAT_SCROLLBAR, 0, IMAT_PROCESS_LIN)
+#define iupMatrixScrollRight(ih) iupMatrixScrollMoveCursor(iupMatrixScrollRightDown , ih, IMAT_SCROLLBAR, 0, IMAT_PROCESS_COL)
+#define iupMatrixScrollPgUp(ih) iupMatrixScrollMoveCursor(iupMatrixScrollPgLeftUp , ih, IMAT_SCROLLBAR, 0, IMAT_PROCESS_LIN)
+#define iupMatrixScrollPgLeft(ih) iupMatrixScrollMoveCursor(iupMatrixScrollPgLeftUp , ih, IMAT_SCROLLBAR, 0, IMAT_PROCESS_COL)
+#define iupMatrixScrollPgDown(ih) iupMatrixScrollMoveCursor(iupMatrixScrollPgRightDown, ih, IMAT_SCROLLBAR, 0, IMAT_PROCESS_LIN)
+#define iupMatrixScrollPgRight(ih) iupMatrixScrollMoveCursor(iupMatrixScrollPgRightDown, ih, IMAT_SCROLLBAR, 0, IMAT_PROCESS_COL)
+#define iupMatrixScrollPosVer(ih, y) iupMatrixScrollMoveCursor(iupMatrixScrollPos , ih, IMAT_SCROLLBAR, y, IMAT_PROCESS_LIN)
+#define iupMatrixScrollPosHor(ih, x) iupMatrixScrollMoveCursor(iupMatrixScrollPos , ih, IMAT_SCROLLBAR, x, IMAT_PROCESS_COL)
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif