2026 Renovation (#3)
Rebuilt using raylib immediate mode gui. Simple window mode with text input and progress graph, and overlay mode. Reviewed-on: #3 Co-authored-by: talksik <[email protected]>
This commit was merged in pull request #3.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
#ifndef COMMON_H
|
||||
#define COMMON_H
|
||||
|
||||
typedef unsigned int U32;
|
||||
|
||||
struct date {
|
||||
U32 day;
|
||||
U32 month;
|
||||
U32 year;
|
||||
};
|
||||
|
||||
struct date to_date(char *);
|
||||
char *to_string(struct date);
|
||||
|
||||
#endif
|
||||
+6464
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
||||
#include <sqlite3.h>
|
||||
#include "common.h"
|
||||
|
||||
/* persist on disk with compact representation
|
||||
date representation -> value
|
||||
*/
|
||||
void store_result(U32 val, struct date d);
|
||||
void retrieve_result(U32 val, struct date d);
|
||||
void retrieve_results_before(int *vals, struct date before);
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#ifndef WINDOWSTATE_H
|
||||
#define WINDOWSTATE_H
|
||||
|
||||
#include "common.h"
|
||||
#include <stddef.h>
|
||||
#include <time.h>
|
||||
|
||||
enum mode_t {
|
||||
WINDOW = 0,
|
||||
OVERLAY
|
||||
};
|
||||
typedef enum mode_t Mode;
|
||||
|
||||
void init_window_state();
|
||||
void cleanup_window_state();
|
||||
|
||||
void set_intention(char *intention);
|
||||
char *get_intention();
|
||||
size_t get_intention_size();
|
||||
|
||||
Mode get_mode();
|
||||
void set_mode(Mode mode);
|
||||
|
||||
// returns 1 for win, 0 for loss
|
||||
U32 get_result(struct tm *time);
|
||||
void set_result(struct tm *time, U32 result);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user