From c729b553ff48debeb2cf6f0e3ab9cea51db026b6 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Thu, 31 Oct 2024 20:04:23 +0100 Subject: [PATCH] add --scale option --- src/x49gpng/options.c | 8 +++++++- src/x49gpng/options.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/x49gpng/options.c b/src/x49gpng/options.c index 68e2198..ce2d0fa 100644 --- a/src/x49gpng/options.c +++ b/src/x49gpng/options.c @@ -28,6 +28,7 @@ void config_init( char* progname, int argc, char* argv[] ) opt.firmware = NULL; opt.model = MODEL_50G; opt.name = NULL; + opt.scale = 1.0; #if defined( __linux__ ) opt.font = "urw gothic l"; @@ -52,6 +53,7 @@ void config_init( char* progname, int argc, char* argv[] ) {"49gp", no_argument, NULL, 496}, {"49gp-newrpl", no_argument, NULL, 497}, {"name", required_argument, NULL, 'n'}, + {"scale", required_argument, NULL, 's'}, {"font", required_argument, NULL, 't'}, @@ -74,7 +76,8 @@ void config_init( char* progname, int argc, char* argv[] ) " --49gp show HP 49g+ faceplate\n" " --49gp-newrpl show HP 49g+ faceplate with newRPL labels\n" " -n --name[=] set alternate UI name\n" - " -t --font[=] set alternate UI font\n" + " -t --font[=] set alternate UI font\n" + " -s --scale[=] scale GUI by X.x\n" " -D --enable-debug[=] enable the debugger interface\n" " (default port: %u)\n" " -d --debug use along -D to also start the debugger immediately\n" @@ -126,6 +129,9 @@ void config_init( char* progname, int argc, char* argv[] ) case 'n': opt.name = strdup( optarg ); break; + case 's': + opt.scale = atof( optarg ); + break; case 't': opt.font = strdup( optarg ); break; diff --git a/src/x49gpng/options.h b/src/x49gpng/options.h index 7d5b193..2737cfd 100644 --- a/src/x49gpng/options.h +++ b/src/x49gpng/options.h @@ -26,6 +26,7 @@ struct options { char* name; char* font; + double scale; }; extern struct options opt;