*** ../../../../link/src/xc/programs/xmodmap/exec.c Sun Apr 17 20:24:20 1994 --- ./exec.c Tue Sep 06 11:53:08 1994 *************** *** 1,3 **** --- 1,16 ---- + /* + * @DEC_COPYRIGHT@ + */ + /* + * HISTORY + * $Log: exec.c,v $ + * Revision 1.1.3.2 1994/09/06 15:52:53 Cliff_Straw + * Add support to PrintModifierMapping to print modifiers as expressions + * [1994/09/06 15:51:28 Cliff_Straw] + * + * $EndLog$ + */ + #pragma ident "@(#)$RCSfile: exec.c,v $ $Revision: 1.1.3.2 $ (DEC) $Date: 1994/09/06 15:52:53 $" /* $XConsortium: exec.c,v 1.13 94/04/17 20:24:20 rws Exp $ */ /* *************** *** 215,246 **** * print the contents of the map */ ! PrintModifierMapping (map, fp) XModifierKeymap *map; FILE *fp; { int i, k = 0; ! fprintf (fp, ! "%s: up to %d keys per modifier, (keycodes in parentheses): ", ! ProgramName, map->max_keypermod); for (i = 0; i < 8; i++) { int j; ! fprintf(fp, "%-10s", modifier_table[i].name); for (j = 0; j < map->max_keypermod; j++) { if (map->modifiermap[k]) { KeySym ks = XKeycodeToKeysym(dpy, map->modifiermap[k], 0); char *nm = XKeysymToString(ks); ! fprintf (fp, "%s %s (0x%0x)", (j > 0 ? "," : ""), ! (nm ? nm : "BadKey"), map->modifiermap[k]); } k++; } ! fprintf(fp, " "); } ! fprintf (fp, " "); return; } --- 228,278 ---- * print the contents of the map */ ! PrintModifierMapping (exprs, map, fp) ! Bool exprs; XModifierKeymap *map; FILE *fp; { int i, k = 0; + Bool modifier_printed = False; ! if (!exprs) { ! fprintf (fp, ! "%s: up to %d keys per modifier, (keycodes in parentheses): ", ! ProgramName, map->max_keypermod); ! } for (i = 0; i < 8; i++) { int j; ! if (exprs) ! modifier_printed = False; ! else ! fprintf(fp, "%-10s", modifier_table[i].name); for (j = 0; j < map->max_keypermod; j++) { if (map->modifiermap[k]) { KeySym ks = XKeycodeToKeysym(dpy, map->modifiermap[k], 0); char *nm = XKeysymToString(ks); ! if (exprs) { ! if (nm) { ! if (!modifier_printed) { ! fprintf(fp, "add %-7s =", modifier_table[i].name); ! modifier_printed = True; ! } ! fprintf (fp, " %s", nm); ! } ! } ! else ! fprintf (fp, "%s %s (0x%0x)", (j > 0 ? "," : ""), ! (nm ? nm : "BadKey"), map->modifiermap[k]); } k++; } ! if (!exprs || modifier_printed) ! fprintf(fp, " "); } ! if (!exprs) ! fprintf (fp, " "); return; } *** ../../../../link/src/xc/programs/xmodmap/handle.c Sun Apr 17 20:24:21 1994 --- ./handle.c Tue Sep 06 11:53:10 1994 *************** *** 1,3 **** --- 1,16 ---- + /* + * @DEC_COPYRIGHT@ + */ + /* + * HISTORY + * $Log: handle.c,v $ + * Revision 1.1.3.2 1994/09/06 15:52:58 Cliff_Straw + * Add a boolean argument to print_modifier_map to support printing modifier map as expressions + * [1994/09/06 15:51:33 Cliff_Straw] + * + * $EndLog$ + */ + #pragma ident "@(#)$RCSfile: handle.c,v $ $Revision: 1.1.3.2 $ (DEC) $Date: 1994/09/06 15:52:58 $" /* $XConsortium: handle.c,v 1.28 94/04/17 20:24:20 converse Exp $ */ /* *************** *** 1328,1336 **** return (SetPointerMap (opp->button_codes, opp->count)); } ! void print_modifier_map () { ! PrintModifierMapping (map, stdout); return; } --- 1341,1350 ---- return (SetPointerMap (opp->button_codes, opp->count)); } ! void print_modifier_map (exprs) ! Bool exprs; { ! PrintModifierMapping (exprs, map, stdout); return; } *** ../../../../link/src/xc/programs/xmodmap/xmodmap.c Sun Apr 17 20:24:24 1994 --- ./xmodmap.c Tue Sep 06 11:53:12 1994 *************** *** 1,3 **** --- 1,16 ---- + /* + * @DEC_COPYRIGHT@ + */ + /* + * HISTORY + * $Log: xmodmap.c,v $ + * Revision 1.1.3.2 1994/09/06 15:53:03 Cliff_Straw + * Add "-pme" option to print modifier map as expressions + * [1994/09/06 15:51:14 Cliff_Straw] + * + * $EndLog$ + */ + #pragma ident "@(#)$RCSfile: xmodmap.c,v $ $Revision: 1.1.3.2 $ (DEC) $Date: 1994/09/06 15:53:03 $" /* $XConsortium: xmodmap.c,v 1.24 94/04/17 20:24:24 converse Exp $ */ /* *************** *** 59,64 **** --- 72,78 ---- " -n don't execute changes, just show like make", " -e expression execute string", " -pm print modifier map", + " -pme print modifier map as expressions", " -pk print keymap table", " -pke print keymap table as expressions", " -pp print pointer map", *************** *** 123,128 **** --- 137,143 ---- char *displayname = NULL; int status; Bool printMap = False; + Bool printMapExprs = False; Bool printKeyTable = False; Bool printKeyTableExprs = False; Bool printPointerMap = False; *************** *** 183,191 **** case 'p': /* -p... */ switch (arg[2]) { case '