summaryrefslogtreecommitdiffstats
path: root/lib/widget/rect.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:22:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:22:03 +0000
commitffccd5b2b05243e7976db80f90f453dccfae9886 (patch)
tree39a43152d27f7390d8f7a6fb276fa6887f87c6e8 /lib/widget/rect.h
parentInitial commit. (diff)
downloadmc-0acba638a84ac029b0ce3ee33c0f8b7d9f3fa027.tar.xz
mc-0acba638a84ac029b0ce3ee33c0f8b7d9f3fa027.zip
Adding upstream version 3:4.8.30.upstream/3%4.8.30
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/widget/rect.h')
-rw-r--r--lib/widget/rect.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/widget/rect.h b/lib/widget/rect.h
new file mode 100644
index 0000000..ca85968
--- /dev/null
+++ b/lib/widget/rect.h
@@ -0,0 +1,45 @@
+
+/** \file rect.h
+ * \brief Header: rectangular class
+ */
+
+#ifndef MC__WIDGET_RECT_H
+#define MC__WIDGET_RECT_H
+
+/*** typedefs (not structures) and defined constants *********************************************/
+
+#define RECT(x) ((WRect *)(x))
+#define CONST_RECT(x) ((const WRect *)(x))
+
+/*** enums ***************************************************************************************/
+
+/*** structures declarations (and typedefs of structures) ****************************************/
+
+struct WRect;
+typedef struct WRect WRect;
+
+struct WRect
+{
+ int y;
+ int x;
+ int lines;
+ int cols;
+};
+
+/*** global variables defined in .c file *********************************************************/
+
+/*** declarations of public functions ************************************************************/
+
+WRect *rect_new (int y, int x, int lines, int cols);
+void rect_init (WRect * r, int y, int x, int lines, int cols);
+void rect_move (WRect * r, int dy, int dx);
+void rect_resize (WRect * r, int dl, int dc);
+void rect_grow (WRect * r, int dl, int dc);
+void rect_intersect (WRect * r, const WRect * r1);
+void rect_union (WRect * r, const WRect * r1);
+gboolean rects_are_overlapped (const WRect * r1, const WRect * r2);
+gboolean rects_are_equal (const WRect * r1, const WRect * r2);
+
+/*** inline functions ****************************************************************************/
+
+#endif /* MC__WIDGET_RECT_H */