1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
7 SDESC[standard]= Virtual (on-screen) keyboard for X
8 HOMEPAGE= http://t-sato.in.coocan.jp/xvkbd/
12 SITES[main]= http://t-sato.in.coocan.jp/xvkbd/
13 DISTFILE[1]= xvkbd-4.0.tar.gz:main
15 SPKGS[standard]= single
17 OPTIONS_AVAILABLE= none
18 OPTIONS_STANDARD= none
20 BUILD_DEPENDS= imake:single:standard
22 XORG_COMPONENTS= x11 ice sm xaw xext xmu xpm xt xtst
24 LICENSE= GPLv2+:single
25 LICENSE_TERMS= single:{{WRKDIR}}/TERMS
26 LICENSE_FILE= GPLv2+:{{WRKSRC}}/COPYING
27 LICENSE_AWK= TERMS:"^\#include"
28 LICENSE_SOURCE= TERMS:{{WRKSRC}}/xvkbd.c
31 FPC_EQUIVALENT= x11/xvkbd
35 's|/usr/include/|${LOCALBASE}/include/|' ${WRKSRC}/XVkbd-small.ad
37 -e '/define XTEST/s|^XCOMM |#|' \
38 -e 's|.(SHAREDIR)|${PREFIX}/share/xvkbd|' \
42 ${MKDIR} ${STAGEDIR}${PREFIX}/share/xvkbd
45 ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/xvkbd
46 ${INSTALL_MAN} ${WRKSRC}/xvkbd.man \
47 ${STAGEDIR}${MANPREFIX}/man/man1/xvkbd.1
50 (cd ${CONFIGURE_WRKSRC} && ${SETENV} ${MAKE_ENV} \
51 ${LOCALBASE}/bin/xmkmf -a)
53 [FILE:401:descriptions/desc.single]
54 xvkbd is a virtual (graphical) keyboard program for X Window System which
55 provides facility to enter characters onto other clients (software) by
56 clicking on a keyboard displayed on the screen. This may be used for
57 systems without a hardware keyboard such as kiosk terminals or handheld
58 devices. This program also has facility to send characters specified as
59 the command line option to another client.
63 eb54e440badc40299ba9a8f27fcea740cd3501310e8955651af7ade517a3ac82 408256 xvkbd-4.0.tar.gz
66 [FILE:491:manifests/plist.single]
97 share/man/man1/xvkbd.1.gz
98 share/xvkbd/words.english
101 [FILE:703:patches/patch-Imakefile]
102 --- Imakefile.orig 2019-08-31 07:45:09 UTC
107 XCOMM Remove the next line if you want genuine Xaw instead of Xaw3d
111 XCOMM Remove the next line if you don't want to enable XTEST support
115 XCOMM Remove the next line if you want to disable internationalization
119 SRCS = xvkbd.c findwidget.c
120 OBJS = xvkbd.o findwidget.o
121 @@ -68,7 +68,7 @@ InstallAppDefaults(XVkbd-turkishF)
122 InstallAppDefaults(XVkbd-uk)
123 InstallAppDefaults(XVkbd-strip)
125 -InstallNonExec(words.english, $(SHAREDIR)/words.english)
126 +InstallNonExec(words.english,$(SHAREDIR)/words.english)
132 [FILE:14689:patches/patch-xvkbd.c]
133 --- xvkbd.c.orig 2019-08-31 22:14:31 UTC
135 @@ -489,8 +489,8 @@ static int altgr_mask = 0;
136 static int level3_shift_mask = 0;
137 static KeySym altgr_keysym = NoSymbol;
139 -static int shift_state = 0;
140 -static int mouse_shift = 0;
141 +static unsigned int shift_state = 0;
142 +static unsigned int mouse_shift = 0;
144 static Display *target_dpy = NULL;
146 @@ -510,6 +510,8 @@ static void PopupFunctionKeyEditor(void)
147 static void DeleteWindowProc(Widget w, XEvent *event, String *pars, Cardinal *n_pars);
148 static void SaveProperty(void);
150 +static void SignalUser1(int dummy);
153 * Search for window which has specified instance name (WM_NAME)
154 * or class name (WM_CLASS).
155 @@ -518,8 +520,7 @@ static Window FindWindow(Window top, cha
158 Window *children, dummy;
159 - unsigned int nchildren;
161 + unsigned int nchildren, i;
165 @@ -843,7 +844,9 @@ static int MyErrorHandler(Display *my_dp
167 static void SendEvent(XKeyEvent *event)
170 static Boolean first = TRUE;
173 if (!appres.no_sync) {
174 XSync(event->display, FALSE);
175 @@ -1154,11 +1157,11 @@ static void SendKeyPressedEvent(KeySym k
178 if (appres.xtest && press_release == 0) {
179 - Window root, child;
180 + Window troot, child;
181 int root_x, root_y, x, y;
184 - XQueryPointer(target_dpy, event.root, &root, &child, &root_x, &root_y, &x, &y, &mask);
185 + XQueryPointer(target_dpy, event.root, &troot, &child, &root_x, &root_y, &x, &y, &mask);
187 event.type = KeyRelease;
189 @@ -1374,7 +1377,7 @@ static XtIntervalId save_private_dict_ti
191 static void SetDefaultDictionary(void)
193 - strncpy(dict_filename, appres.dict_file, sizeof(dict_filename) - 1);
194 + snprintf(dict_filename, sizeof(dict_filename), "%s", appres.dict_file);
195 XtVaSetValues(props_dict_entry, XtNstring, dict_filename, NULL);
198 @@ -1391,7 +1394,7 @@ static void ReadCompletionDictionary(voi
201 if (strcmp(cur_dict_filename, dict_filename) == 0) return;
202 - strcpy(cur_dict_filename, dict_filename);
203 + snprintf(cur_dict_filename, sizeof(cur_dict_filename), "%s", dict_filename);
207 @@ -1497,7 +1500,7 @@ static void SavePrivateDictionary(void)
209 static void AddToCompletionText(KeySym keysym)
213 struct WORDLIST *node_ptr;
216 @@ -1704,7 +1707,7 @@ static void SendString(const char *str)
218 const char *cp, *cp2;
223 Window target_root, child, junk_w;
225 @@ -1736,8 +1739,7 @@ static void SendString(const char *str)
228 if (sizeof(key) <= len) len = sizeof(key) - 1;
229 - strncpy(key, cp + 1, len);
231 + snprintf(key, sizeof(key), "%s", cp + 1);
232 KeyPressed(None, key, NULL);
235 @@ -1785,11 +1787,12 @@ static void SendString(const char *str)
236 if ('1' <= *cp && *cp <= '9') {
237 usleep((*cp - '0') * 100000);
239 - fprintf(stderr, "%s: no digit after \"\\m\"\n",
240 + fprintf(stderr, "%s: no digit after \"\\D\"\n",
244 case 'm': /* simulate click mouse button */
247 if ('1' <= *cp && *cp <= '9') {
248 if (appres.debug) fprintf(stderr, "xvkbd: XTestFakeButtonEvent(%d)\n", *cp - '0');
249 @@ -1800,10 +1803,18 @@ static void SendString(const char *str)
250 fprintf(stderr, "%s: no digit after \"\\m\"\n",
254 + fprintf(stderr, "%s: this binary is compiled without XTEST support\n",
259 case 'y': /* move mouse pointer */
260 - sscanf(cp + 1, "%d", &val);
261 + if (sscanf(cp + 1, "%d", &val) != -1) {
262 + fprintf(stderr, "%s: no number after \"\\%c\"\n",
263 + PROGRAM_NAME, *cp);
266 target_root = RootWindow(target_dpy, DefaultScreen(target_dpy));
267 XQueryPointer(target_dpy, target_root, &junk_w, &child,
268 &cur_x, &cur_y, &junk_i, &junk_i, &junk_u);
269 @@ -1931,13 +1942,13 @@ static Boolean CheckShiftState(int row,
270 static void RefreshShiftState(Boolean force)
272 static Boolean first = TRUE;
273 - static int last_shift_state = 0;
274 - static int last_mouse_shift = 0;
275 + static unsigned int last_shift_state = 0;
276 + static unsigned int last_mouse_shift = 0;
277 static int last_num_lock_state = FALSE;
278 static Display *last_target_dpy = NULL;
279 - static long last_focus = 0;
282 + static Window last_focus = 0;
283 + unsigned int cur_shift;
284 + unsigned int changed;
285 int first_row, row, col;
288 @@ -2029,7 +2040,7 @@ static void RefreshShiftState(Boolean fo
291 int root_x, root_y, x, y;
293 + unsigned int tmask;
297 @@ -2045,28 +2056,28 @@ static void RefreshShiftState(Boolean fo
298 event.same_screen = TRUE;
301 - XQueryPointer(target_dpy, event.root, &root, &child, &root_x, &root_y, &x, &y, &mask);
302 + XQueryPointer(target_dpy, event.root, &root, &child, &root_x, &root_y, &x, &y, &tmask);
304 if (strstr(appres.positive_modifiers, "shift") != NULL
305 - && (shift_state & ShiftMask) != (mask & ShiftMask)) {
306 + && (shift_state & ShiftMask) != (tmask & ShiftMask)) {
307 event.keycode = XKeysymToKeycode(target_dpy, XK_Shift_L);
308 event.type = (shift_state & ShiftMask) ? KeyPress : KeyRelease;
311 if (strstr(appres.positive_modifiers, "control") != NULL
312 - && (shift_state & ControlMask) != (mask & ControlMask)) {
313 + && (shift_state & ControlMask) != (tmask & ControlMask)) {
314 event.keycode = XKeysymToKeycode(target_dpy, XK_Control_L);
315 event.type = (shift_state & ControlMask) ? KeyPress : KeyRelease;
318 if (strstr(appres.positive_modifiers, "alt") != NULL
319 - && (shift_state & alt_mask) != (mask & alt_mask)) {
320 + && (shift_state & alt_mask) != (tmask & alt_mask)) {
321 event.keycode = XKeysymToKeycode(target_dpy, XK_Alt_L);
322 event.type = (shift_state & alt_mask) ? KeyPress : KeyRelease;
325 if (strstr(appres.positive_modifiers, "meta") != NULL
326 - && (shift_state & meta_mask) != (mask & meta_mask)) {
327 + && (shift_state & meta_mask) != (tmask & meta_mask)) {
328 event.keycode = XKeysymToKeycode(target_dpy, XK_Meta_L);
329 event.type = (shift_state & meta_mask) ? KeyPress : KeyRelease;
331 @@ -2329,6 +2340,7 @@ static void PropsItemToggled(Widget w, c
332 XtVaGetValues(XtNameToWidget(props_panel, "*integrate_completion_panel"),
333 XtNstate, &appres.integrate_completion_panel, NULL);
335 + /* These two lines generate warnings with -Wbad-function-cast. Grrr. */
336 appres.key_click_duration = (int)XawToggleGetCurrent(click_buttons);
337 appres.autoclick_delay = (int)XawToggleGetCurrent(autoclick_buttons);
339 @@ -2401,7 +2413,7 @@ static void PopupPropsPanel(void)
340 if (props_panel == None) {
341 Widget label, button;
347 props_panel = XtVaCreatePopupShell("props_panel", transientShellWidgetClass,
348 @@ -2535,7 +2547,7 @@ static void OpenRemoteDisplay(Widget w,
349 focused_subwindow = None;
350 if (target_dpy != NULL && target_dpy != dpy) XCloseDisplay(target_dpy);
352 - strncpy(name, (display_name == NULL) ? "" : display_name, sizeof(name) - 1);
353 + snprintf(name, sizeof(name), "%s", (display_name == NULL) ? "" : display_name);
354 for (cp = name; isascii(*cp) && isprint(*cp); cp++) ;
357 @@ -3062,7 +3074,7 @@ static Widget MakeKey(Widget parent, con
358 XtAddCallback(w, XtNcallback, (XtCallbackProc)KeyPressed, (XtPointer)name);
361 - strncpy(str, label, sizeof(str) - 1);
362 + snprintf(str, sizeof(str), "%s", label);
363 if (strcmp(str, "space") == 0) strcpy(str, "");
366 @@ -3133,7 +3145,7 @@ static void MakeKeypad(Widget form, Widg
367 || (strncmp(keypad_shift[row][col], "KP_", 3) == 0
368 && isdigit(keypad_shift[row][col][3])))
369 color = appres.general_background;
370 - strcpy(name, keypad[row][col]);
371 + snprintf(name, sizeof(name), "%s", keypad[row][col]);
372 if (strcmp(name, "Focus") != 0 && strcmp(name, "Num_Lock") != 0)
373 snprintf(name, sizeof(name), "pad%d,%d", row, col);
374 key = MakeKey(keypad_box, XtNewString(name),
375 @@ -3236,12 +3248,12 @@ static void MakeKeyboard(Boolean remake)
376 Widget form, key, left;
379 - Dimension wd, max_wd;
380 + Dimension dwd, max_dwd;
381 int row, col, first_row;
382 char name[50], *label;
383 Widget key_box[NUM_KEY_ROWS];
389 #include "iconify.xbm"
390 @@ -3275,7 +3287,7 @@ static void MakeKeyboard(Boolean remake)
393 for (col = 0; keys_normal[row][col] != NULL; col++) {
394 - strcpy(name, keys_normal[row][col]);
395 + snprintf(name, sizeof(name), "%s", keys_normal[row][col]);
396 if (strcmp(name, "MainMenu") == 0) {
397 Widget iconify_button = None;
399 @@ -3320,8 +3332,8 @@ static void MakeKeyboard(Boolean remake)
400 if (strcmp(name, "space") != 0) snprintf(name, sizeof(name), "%d,%d", row, col);
402 key = MakeKey(key_box[row], XtNewString(name), label, color);
403 - XtVaGetValues(key, XtNwidth, &wd, NULL);
405 + XtVaGetValues(key, XtNwidth, &dwd, NULL);
407 /* keys can be removed by setting its width to 1 */
408 XtDestroyWidget(key);
410 @@ -3357,7 +3369,7 @@ static void MakeKeyboard(Boolean remake)
413 unsigned int wd, ht, bd, dp;
414 - int max_wd, max_ht;
415 + unsigned int max_wd, max_ht;
417 XGetGeometry(dpy, XtWindow(toplevel), &root, &x1, &y1, &wd, &ht, &bd, &dp);
418 max_wd = XtScreen(toplevel)->width * appres.max_width_ratio;
419 @@ -3376,16 +3388,16 @@ static void MakeKeyboard(Boolean remake)
421 if (!appres.debug && key_box[first_row] != None) {
423 - XtVaGetValues(key_box[1], XtNwidth, &max_wd, NULL);
424 + XtVaGetValues(key_box[1], XtNwidth, &max_dwd, NULL);
428 for (row = first_row; row < NUM_KEY_ROWS && key_box[row] != None; row++) {
429 - XtVaGetValues(key_box[row], XtNwidth, &wd, NULL);
430 - if (max_wd < wd) max_wd = wd;
431 + XtVaGetValues(key_box[row], XtNwidth, &dwd, NULL);
432 + if (max_dwd < dwd) max_dwd = dwd;
435 for (row = first_row; row < NUM_KEY_ROWS && key_box[row] != None; row++) {
436 - XtVaSetValues(key_box[row], XtNwidth, max_wd, NULL);
437 + XtVaSetValues(key_box[row], XtNwidth, max_dwd, NULL);
441 @@ -3498,9 +3510,9 @@ static void ReadProperty(void)
442 && strlen(home) + strlen(appres.key_file) + 1 < sizeof(fkey_filename))
443 snprintf(fkey_filename, sizeof(fkey_filename), "%s/%s", home, appres.key_file);
445 - strncpy(fkey_filename, appres.key_file, sizeof(fkey_filename) - 1);
446 + snprintf(fkey_filename, sizeof(fkey_filename), "%s", appres.key_file);
448 - strncpy(dict_filename, appres.dict_file, sizeof(dict_filename) - 1);
449 + snprintf(dict_filename, sizeof(dict_filename), "%s", appres.dict_file);
451 fp = fopen(fkey_filename, "r");
452 if (fp == NULL) return;
453 @@ -3513,9 +3525,9 @@ static void ReadProperty(void)
454 keyboard_layout, getenv("XENVIRONMENT"));
455 if (getenv("XENVIRONMENT") == NULL) layout_selected = TRUE;
456 } else if (sscanf(&str[1], "dict_file %s", key) == 1) {
457 - strncpy(dict_filename, key, sizeof(dict_filename) - 1);
458 + snprintf(dict_filename, sizeof(dict_filename), "%s", key);
459 } else if (sscanf(&str[1], "private_dict_weight %s", key) == 1) {
460 - strncpy(private_dict_weight_value, key, sizeof(private_dict_weight_value) - 1);
461 + snprintf(private_dict_weight_value, sizeof(private_dict_weight_value), "%s", key);
462 } else if (sscanf(&str[1], "%s %d", key, &val) == 2) {
463 if (strcmp(key, "quick_modifiers") == 0)
464 appres.quick_modifiers = val;
465 @@ -3599,7 +3611,7 @@ static void FKeyMenuSelected(Widget w, c
466 else if (strncmp(key, "Shift-", strlen("Shift-")) == 0)
467 snprintf(key2, sizeof(key2), "s:%s", &key[strlen("Shift-")]);
470 + snprintf(key2, sizeof(key2), "%s", key);
472 if (strcmp(cur_fkey, key2) != 0) {
473 if (strlen(cur_fkey) != 0) {
474 @@ -3622,7 +3634,7 @@ static void FKeyMenuSelected(Widget w, c
476 if (cur_fkey_value_mode[0] == 'c') prefix = "!";
477 else if (fkey_value[0] == '!' || fkey_value[0] == '\\') prefix = "\\";
478 - sprintf(sp->value, "%s %s%s", cur_fkey, prefix, fkey_value);
479 + snprintf(sp->value, len + strlen(fkey_value) + 5, "%s %s%s", cur_fkey, prefix, fkey_value);
480 } else { /* empty string - remove the entry for the function key */
482 if (sp2 != NULL) sp2->next = sp->next;
483 @@ -3642,10 +3654,10 @@ static void FKeyMenuSelected(Widget w, c
484 FKeyValueMenuSelected(None, (value[0] == '!') ? "command" : "string");
486 if (value[0] == '!' || value[0] == '\\') value = value + 1;
487 - strncpy(fkey_value, value, sizeof(fkey_value) - 1);
488 + snprintf(fkey_value, sizeof(fkey_value), "%s", value);
489 XtVaSetValues(fkey_value_entry, XtNstring, fkey_value, NULL);
491 - strcpy(cur_fkey, key2);
492 + snprintf(cur_fkey, sizeof(cur_fkey), "%s", key2);
496 @@ -3845,8 +3857,10 @@ static void Autoclick(void)
501 XTestFakeButtonEvent(target_dpy, 1, True, CurrentTime);
502 XTestFakeButtonEvent(target_dpy, 1, False, CurrentTime);
506 static void ShowBalloon(Widget w, XEvent *event, String *pars, Cardinal *n_pars)
507 @@ -3975,7 +3989,9 @@ int main(int argc, char *argv[])
508 Boolean open_keypad_panel = FALSE;
516 argv1 = malloc(sizeof(char *) * (argc1 + 5));
517 @@ -4180,14 +4196,14 @@ char *setlocale(int category, const char
518 if (locale == NULL) {
520 } else if (category == LC_ALL) {
521 - strcpy(old_locale, cur_locale);
522 + snprintf(cur_locale, sizeof(cur_locale), "%s", s);
523 if (locale[0] == '\0') {
524 s = getenv("LC_ALL");
525 if (s == NULL) s = "C"; /* LC_ALL not defined */
529 - strncpy(cur_locale, s, sizeof(cur_locale) - 1);
530 + snprintf(cur_locale, sizeof(cur_locale), "%s", s);
536 [FILE:3567:patches/patch-xvkbd.man]
537 --- xvkbd.man.orig 2019-08-31 22:17:45 UTC
540 -.TH xvkbd 1 2019-09-01
541 +.TH XVKBD 1 2019-09-01
545 \fPxvkbd\fP - virtual keyboard for X window system
549 \fIxvkbd\fP is a virtual (graphical) keyboard program for X Window System
550 which provides a facility to enter characters onto other clients (software)
551 by clicking on a keyboard displayed on the screen.
552 @@ -39,13 +38,13 @@ or you will have serious security risk.
553 It is tested on \fIredhat Linux\fP and \fISolaris\fP,
554 and it will work also on most UNIX-like systems.
556 -This program uses \fIXaw\fP (use of \fIXaw3d\fP is recommended)
557 +This program uses \fIXaw\fP (use of \fIXaw3d\fP is recommended)
558 and no special library is required.
563 -When \fIxvkbd\fP is started, the image of a keyboard
564 +When \fIxvkbd\fP is started, the image of a keyboard
565 will be displayed on the screen.
566 Clicking any key on the \fIxvkbd\fP window will send the character
567 to the focused window
568 @@ -92,10 +91,10 @@ The direction of the pointer motion will
570 .SH " Setting Input Focus"
571 If you are using a window manager and clients
572 -where you can set input focus by clicking mouse button on the window
573 +where you can set input focus by clicking mouse button on the window
574 (and you don't have to keep pointer in the window after that),
575 you can simply set input focus in the normal way
576 -and then click keys on the \fIxvkbd\fP window
577 +and then click keys on the \fIxvkbd\fP window
578 - the character will be sent to the selected position.
580 If you are using a window manager or clients
581 @@ -151,7 +150,6 @@ which can be used to enter Latin charact
583 \fIWord Completion...\fP
584 Open the Word Completion panel.
587 \fIChange Keyboard Layout...\fP
588 Open a popup window to change the keyboard layout.
589 @@ -274,7 +272,6 @@ You may want to set \fIJump Pointer?\fP
591 \fIxvkbd\fP accept following command line options, in addition to
592 general options such as `\fB-display\fP'.
596 Display version information and exit.
597 @@ -353,7 +350,7 @@ If auto-repeat is enabled (this is the d
598 time before start auto-repeat can be set as
599 `\fBxvkbd*Repeater.initialDelay: 600\fP',
600 and period of repeat can be set as
601 -`\fBxvkbd*Repeater.minimumDelay: 100\fP'
602 +`\fBxvkbd*Repeater.minimumDelay: 100\fP'
603 (unit of there parameters are milli-seconds).
605 Resource `\fBxvkbd.autoRepeat: false\fP' has the same function.
606 @@ -453,7 +450,7 @@ Maybe this is useful when problem arises
607 Resource `\fBxvkbd.textDelay: \fP\fIvalue\fP' has the same function.
609 .BI "-window " window
612 (hexadecimal value leaded with `\fB0x\fP', or decimal value),
613 the name (instance name or class name) of the window,
614 or the title of the window to set input focus.
615 @@ -496,7 +493,7 @@ Specify the display (in the meaning of t
618 If this option is specified,
619 -\fIxvkbd\fP will attempt to use \fIkeysym\fPs such as
620 +\fIxvkbd\fP will attempt to use \fIkeysym\fPs such as
621 \fIXK_KP_1\fP instead of \fIXK_1\fP.
623 Resource `\fBxvkbd.keypadKeysym: true\fP' has the same function.
624 @@ -881,7 +878,7 @@ it is possible to edit the assigned stri
627 On \fIXFree86\fP, resolution switch with
628 -\fICtrl + Alt + Keypad-Plus\fP and \fICtrl + Alt + Keypad-Minus\fP
629 +\fICtrl + Alt + Keypad-Plus\fP and \fICtrl + Alt + Keypad-Minus\fP
631 However, \fICtrl + Alt + Backspace\fP will not be simulated.