summaryrefslogtreecommitdiff
path: root/EyesP.h
diff options
context:
space:
mode:
authorSerge Bazanski <q3k@q3k.org>2023-05-28 14:21:56 +0200
committerSerge Bazanski <q3k@q3k.org>2023-05-28 14:28:58 +0200
commit6f6c975d2cdc1f615f83576c9d1f828e1cdabda3 (patch)
treefa3f59c025ea60b640416b9432a3d10f81048235 /EyesP.h
parentf30ef4e0f3e464f6304bdc85d28ebec0c2ba5e4f (diff)
Implement multi-ocular support, add biblical example
This removes the assumption that an xeyes instance displays just a pair of eyes, and instead allows future developers to implement different kinds of ocular layouts. Currently, the ocular layout system only allows for specifying offsets, but a future change might also make different parts of the eye geometry configurable: size of different elements, padding, etc. Signed-off-by: Serge Bazanski <q3k@q3k.org>
Diffstat (limited to 'EyesP.h')
-rw-r--r--EyesP.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/EyesP.h b/EyesP.h
index ecd565b..fa7e940 100644
--- a/EyesP.h
+++ b/EyesP.h
@@ -18,6 +18,23 @@
#define SEG_BUFF_SIZE 128
+typedef struct {
+ // X offset
+ double x;
+ // Y offset
+ double y;
+} EyeLayout;
+
+typedef struct {
+ EyeLayout *eyes;
+ int count;
+
+ double w_min_x;
+ double w_max_x;
+ double w_min_y;
+double w_max_y;
+} EyeConfiguration;
+
/* New fields for the eyes widget instance record */
typedef struct {
Pixel pixel[PART_SHAPE];
@@ -28,7 +45,9 @@ typedef struct {
Boolean shape_window; /* use SetWindowShapeMask */
int update; /* current timeout index */
TPoint mouse; /* old mouse position */
- TPoint pupil[2]; /* pupil position */
+ Boolean biblically_accurate;
+ EyeConfiguration *configuration;
+ TPoint *pupils;
Transform t;
Transform maskt;
XtIntervalId interval_id;