Debian Codegraph @

pt_pal_editor/src/gui.h

raw symbols SCIP
1 #pragma once
2
3 #define SCREEN_W 437
4 #define SCREEN_H 273
5
6 #define TRACKER_X 3
7 #define TRACKER_Y 15
8
9 #define COLORPICKER1_X 326
10 #define COLORPICKER1_Y 15
11
12 #define COLORPICKER2_X 326
13 #define COLORPICKER2_Y 103
14
15 #define LOADINI_X 326
16 #define LOADINI_Y 194
17
18 #define LOADPT_X 326
19 #define LOADPT_Y 208
20
21 #define SAVE_X 326
22 #define SAVE_Y 222
23
24 #include <stdint.h>
25 #include <stdbool.h>
26 #include <SDL2/SDL.h>
27
28 typedef struct keyb_t
29 {
30 bool leftShiftKeyDown, leftCtrlKeyDown, leftAltKeyDown;
31 } keyb_t;
32
33 typedef struct mouse_t
34 {
35 bool leftButtonPressed, rightButtonPressed;
36 int32_t x, y;
37 float fMouseXMul, fMouseYMul;
38 } mouse_t;
39
40 void charOut(int32_t xPos, int32_t yPos, uint32_t color, char chr);
41 void textOut(int32_t xPos, int32_t yPos, uint32_t color, const char *text);
42 void textOutShadow(int32_t xPos, int32_t yPos, uint32_t fgColor, uint32_t bgColor, const char *text);
43 void hLine(int32_t x, int32_t y, int32_t w, uint32_t color);
44 void vLine(int32_t x, int32_t y, int32_t h, uint32_t color);
45
46 void showErrorMsgBox(const char *fmt, ...); // main.c
47
48 void mouseButtonUpHandler(void);
49 void mouseButtonDownHandler(void);
50 void keyDownHandler(SDL_Keycode keyEntry);
51 void drawTracker(void);
52 void setupGUI(void);
53 void drawColorPicker2(void);
54 void drawColorPicker1(void);
55 void handleSlidersHeldDown(void);
56 void handleRainbowHeldDown(void);
57 void handleRainbowUpDownButtons(void);
58
59 // gui.c
60 extern bool topScreenShown, bottomScreenShown, analyzerShown;
61 extern uint8_t currColor, rainbowPos, colorsMax;
62 extern uint16_t *theRightColors;
63
64 // main.c
65 extern volatile bool programRunning, redrawScreen;
66 extern uint32_t *frameBuffer;
67 extern keyb_t keyb;
68 extern mouse_t mouse;