]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
screen.h: work in progress to define colours and coordinates
authorRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Sun, 12 Nov 2023 17:15:43 +0000 (22:45 +0530)
committerRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Sun, 12 Nov 2023 17:15:43 +0000 (22:45 +0530)
screen.h [new file with mode: 0644]
vfo.c

diff --git a/screen.h b/screen.h
new file mode 100644 (file)
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 b70f707c19a386e97acbc31068413aac0a3e42ee..7a64dcdfe4d62b754d9ce0668e1337e14707d2de 100644 (file)
--- 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,