mirror of
https://github.com/jjsullivan5196/wvkbd.git
synced 2025-03-12 18:32:48 +01:00
added -R parameter to configure rounding
This commit is contained in:
parent
d423720553
commit
ba778478e6
@ -2,6 +2,7 @@
|
||||
#define config_def_h_INCLUDED
|
||||
|
||||
#define DEFAULT_FONT "Sans 14"
|
||||
#define DEFAULT_ROUNDING 5
|
||||
static const int transparency = 255;
|
||||
|
||||
struct clr_scheme schemes[] = {
|
||||
@ -13,7 +14,7 @@ struct clr_scheme schemes[] = {
|
||||
.swipe = {.bgra = {100, 255, 100, 64}},
|
||||
.text = {.color = UINT32_MAX},
|
||||
.font = DEFAULT_FONT,
|
||||
.rounding = 5,
|
||||
.rounding = DEFAULT_ROUNDING,
|
||||
},
|
||||
{
|
||||
/* colors */
|
||||
@ -23,7 +24,7 @@ struct clr_scheme schemes[] = {
|
||||
.swipe = {.bgra = {100, 255, 100, 64}},
|
||||
.text = {.color = UINT32_MAX},
|
||||
.font = DEFAULT_FONT,
|
||||
.rounding = 5,
|
||||
.rounding = DEFAULT_ROUNDING,
|
||||
}
|
||||
};
|
||||
|
||||
|
13
main.c
13
main.c
@ -76,6 +76,7 @@ static int cur_x = -1, cur_y = -1;
|
||||
static bool cur_press = false;
|
||||
static struct kbd keyboard;
|
||||
static uint32_t height, normal_height, landscape_height;
|
||||
static int rounding = DEFAULT_ROUNDING;
|
||||
static bool hidden = false;
|
||||
|
||||
/* event handler prototypes */
|
||||
@ -680,6 +681,7 @@ usage(char *argv0)
|
||||
" -O - Print intersected keys to standard output\n");
|
||||
fprintf(stderr, " -H [int] - Height in pixels\n");
|
||||
fprintf(stderr, " -L [int] - Landscape height in pixels\n");
|
||||
fprintf(stderr, " -R [int] - Rounding radius in pixels\n");
|
||||
fprintf(stderr, " --fn [font] - Set font (e.g: DejaVu Sans 20)\n");
|
||||
fprintf(stderr, " --hidden - Start hidden (send SIGUSR2 to show)\n");
|
||||
fprintf(
|
||||
@ -948,6 +950,12 @@ main(int argc, char **argv)
|
||||
exit(1);
|
||||
}
|
||||
height = landscape_height = atoi(argv[++i]);
|
||||
} else if (!strcmp(argv[i], "-R")) {
|
||||
if (i >= argc - 1) {
|
||||
usage(argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
rounding = atoi(argv[++i]);
|
||||
} else if (!strcmp(argv[i], "-D")) {
|
||||
keyboard.debug = true;
|
||||
} else if ((!strcmp(argv[i], "-fn")) || (!strcmp(argv[i], "--fn"))) {
|
||||
@ -988,6 +996,11 @@ main(int argc, char **argv)
|
||||
schemes[i].font = fc_font_pattern;
|
||||
}
|
||||
|
||||
if (rounding != DEFAULT_ROUNDING) {
|
||||
for (i = 0; i < countof(schemes); i++)
|
||||
schemes[i].rounding = rounding;
|
||||
}
|
||||
|
||||
display = wl_display_connect(NULL);
|
||||
if (display == NULL) {
|
||||
die("Failed to create display\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user