summaryrefslogtreecommitdiff
path: root/gui/aoi.h
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-17 20:54:25 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-17 20:54:25 -0300
commit5014b5de97b9c3fa1600fd8c4d3460520c4ba081 (patch)
treecafd98b7d86d6619c6b9cf13bf42945fca391f57 /gui/aoi.h
parent34ea81f8d4018fc3ecf91663d741ae5afcbc26d7 (diff)
downloadeeshow-5014b5de97b9c3fa1600fd8c4d3460520c4ba081.tar.gz
eeshow-5014b5de97b9c3fa1600fd8c4d3460520c4ba081.tar.bz2
eeshow-5014b5de97b9c3fa1600fd8c4d3460520c4ba081.zip
eeshow/: move gui* into subdirectory gui/
Diffstat (limited to 'gui/aoi.h')
-rw-r--r--gui/aoi.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/gui/aoi.h b/gui/aoi.h
new file mode 100644
index 0000000..b804b1b
--- /dev/null
+++ b/gui/aoi.h
@@ -0,0 +1,43 @@
+/*
+ * gui/aoi.h - GUI: areas of interest
+ *
+ * Written 2016 by Werner Almesberger
+ * Copyright 2016 by Werner Almesberger
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef GUI_AOI_H
+#define GUI_AOI_H
+
+#include <stdbool.h>
+
+
+struct aoi {
+ int x, y, w, h; /* activation box, eeschema coordinates */
+ /* points to hovered aoi, or NULL */
+
+ bool (*hover)(void *user, bool on);
+ void (*click)(void *user);
+ void (*drag)(void *user, int dx, int dy);
+ void *user;
+
+ struct aoi *next;
+};
+
+
+struct aoi *aoi_add(struct aoi **aois, const struct aoi *cfg);
+void aoi_update(struct aoi *aoi, const struct aoi *cfg);
+bool aoi_hover(const struct aoi *aois, int x, int y);
+
+bool aoi_move(const struct aoi *aois, int x, int y);
+bool aoi_down(const struct aoi *aois, int x, int y);
+bool aoi_up(const struct aoi *aois, int x, int y);
+
+void aoi_remove(struct aoi **aois, const struct aoi *aoi);
+void aoi_dehover(void);
+
+#endif /* !GUI_AOI_H */