diff options
| author | @syxhe <https://t.me/syxhe> | 2024-07-27 00:59:30 -0500 |
|---|---|---|
| committer | @syxhe <https://t.me/syxhe> | 2024-07-27 00:59:30 -0500 |
| commit | 1d46925315b40b1bdbc44d1714c366589d153948 (patch) | |
| tree | be0650f60db73e0467c7be018cb1c2452c7e758d /src/screen.h | |
| parent | fc247603ecf22eb10192a0fcde9c140e3b35872c (diff) | |
Lord forgive me for this terrible code
Diffstat (limited to 'src/screen.h')
| -rw-r--r-- | src/screen.h | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/src/screen.h b/src/screen.h index 5d0837e..9419d5c 100644 --- a/src/screen.h +++ b/src/screen.h | |||
| @@ -53,7 +53,31 @@ enum customcolor_pairs { | |||
| 53 | }; | 53 | }; |
| 54 | 54 | ||
| 55 | struct funcholder { | 55 | struct funcholder { |
| 56 | int (*callback)(void); | 56 | int (*callback)(void*); |
| 57 | enum type { | ||
| 58 | FH_UNSPEC, | ||
| 59 | |||
| 60 | FH_SPIN, | ||
| 61 | FH_BUY, | ||
| 62 | FH_QUIT, | ||
| 63 | |||
| 64 | FH_TOOBIG | ||
| 65 | } type; | ||
| 66 | |||
| 67 | union param { | ||
| 68 | struct spinp { | ||
| 69 | WINDOW *bannerwin; | ||
| 70 | int phrasenum; | ||
| 71 | } spinp; | ||
| 72 | |||
| 73 | struct buyp { | ||
| 74 | |||
| 75 | } buyp; | ||
| 76 | |||
| 77 | struct quitp { | ||
| 78 | |||
| 79 | } quitp; | ||
| 80 | } params; | ||
| 57 | 81 | ||
| 58 | }; | 82 | }; |
| 59 | 83 | ||
| @@ -63,9 +87,8 @@ static float normalize(float value, float oldmin, float oldmax, float newmin, fl | |||
| 63 | // Initialize a new curses color using standard rgb values (0-255) instead of curses' 0-1000 range | 87 | // Initialize a new curses color using standard rgb values (0-255) instead of curses' 0-1000 range |
| 64 | static int init_rgb_color(int colornum, int red, int green, int blue); | 88 | static int init_rgb_color(int colornum, int red, int green, int blue); |
| 65 | 89 | ||
| 66 | int spin(void); | 90 | int spin(void *spinp); |
| 67 | int buy(void); | 91 | int buy(void *buyp); |
| 68 | int quit(void); | 92 | int quit(void *quitp); |
| 69 | #define USERFUNCS (int (* [])(void)){spin, buy, quit} | ||
| 70 | 93 | ||
| 71 | #endif \ No newline at end of file | 94 | #endif \ No newline at end of file |
