From f266335f021f0fa16a2e71bec21cb6018859c397 Mon Sep 17 00:00:00 2001 From: Ramakrishnan Muthukrishnan Date: Sun, 12 Nov 2023 22:45:43 +0530 Subject: [PATCH] screen.h: work in progress to define colours and coordinates --- screen.h | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ vfo.c | 2 +- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 screen.h diff --git a/screen.h b/screen.h new file mode 100644 index 0000000..addd841 --- /dev/null +++ b/screen.h @@ -0,0 +1,62 @@ +#ifndef _SCREEN_H +#define _SCREEN_H + +#define MENU_HEIGHT (50) +#define MENU_WIDTH (50) +// so menu height x 2 == meter height (but we still have 20 pixels +// empty. +#define METER_HEIGHT (100) // edit default = 60 +#define METER_WIDTH (240) +#define PANADAPTER_HEIGHT (105) +#define ZOOMPAN_HEIGHT (50) +#define SLIDERS_HEIGHT (100) +#define TOOLBAR_HEIGHT (30) +#define WATERFALL_HEIGHT (105) + +// define a type and coordinates for various widgets on the screen. +#define VFO_HEIGHT (100) +#define VFO_WIDTH (display_width - METER_WIDTH - MENU_WIDTH) + +#define BLACK_R (0.0) +#define BLACK_G (0.0) +#define BLACK_B (0.0) + +#define RED_R (1.0) +#define RED_G (0.0) +#define RED_B (0.0) + +#define YELLOW_R (1.0) +#define YELLOW_G (1.0) +#define YELLOW_B (0.0) + +#define CYAN_R (0.0) +#define CYAN_G (1.0) +#define CYAN_B (1.0) + +#define WHITE_R (1.0) +#define WHITE_G (1.0) +#define WHITE_B (1.0) + +#define GREEN_R (0.0) +#define GREEN_G (1.0) +#define GREEN_B (0.0) + +#define DARK_GREEN_R (0.0) +#define DARK_GREEN_G (0.65) +#define DARK_GREEN_B (0.0) + + +// font/typeface sizes + +#define MODE_RENDER_FONT_SIZE (30) +#define VFO_A_RENDER_FONT_SIZE (70) + +// coordinates + +#define MODE_X 70 +#define MODE_Y 80 + +#define VFO_A_X 285 +#define VFO_A_Y 95 + +#endif // _SCREEN_H diff --git a/vfo.c b/vfo.c index b70f707..7a64dcd 100644 --- a/vfo.c +++ b/vfo.c @@ -1013,7 +1013,7 @@ void vfo_update(void) { cairo_t *cr; cr = cairo_create(vfo_surface); - cairo_set_source_rgb(cr, 0.0, 0.0, 0.0); + cairo_set_source_rgb(cr, BLACK_R, BLACK_G, BLACK_B); cairo_paint(cr); cairo_select_font_face(cr, "Cantarell", CAIRO_FONT_SLANT_NORMAL, -- 2.45.2