Lines Matching refs:file
44 WriteCHdrVMods(FILE *file, Display *dpy, XkbDescPtr xkb)
52 fprintf(file, "%s#define vmod_%s %d\n",
60 fprintf(file, "%s#define vmod_%sMask (1<<%d)\n",
67 fprintf(file, "\n");
72 WriteCHdrKeycodes(FILE * file, XkbDescPtr xkb)
85 fprintf(file, "/* keycodes name is \"%s\" */\n",
87 fprintf(file, "static XkbKeyNameRec keyNames[NUM_KEYS]= {\n");
92 fprintf(file, " { %6s },", buf);
94 fprintf(file, "\n");
97 fprintf(file, " { %6s }\n", buf);
100 fprintf(file, "};\n");
105 WriteTypePreserve(FILE * file,
114 fprintf(file, "static XkbModsRec preserve_%s[%d]= {\n", prefix,
118 fprintf(file, ",\n");
119 fprintf(file, " { %15s, ", XkbModMaskText(pre->mask, XkbCFile));
120 fprintf(file, "%15s, ", XkbModMaskText(pre->real_mods, XkbCFile));
121 fprintf(file, "%15s }",
124 fprintf(file, "\n};\n");
129 WriteTypeInitFunc(FILE *file, Display *dpy, XkbDescPtr xkb)
136 fprintf(file, "\n\nstatic void\n");
137 fprintf(file, "initTypeNames(DPYTYPE dpy)\n");
138 fprintf(file, "{\n");
142 fprintf(file, "#error XkbErrBadAlloc WriteTypeInitFunc\n");
146 fprintf(file, " dflt_types[%d].name= GET_ATOM(dpy,\"%s\");\n",
158 fprintf(file, " lnames_%s[%d]= ", prefix, n);
159 fprintf(file, "GET_ATOM(dpy,\"%s\");\n", tmp);
165 fprintf(file, "}\n");
170 WriteCHdrKeyTypes(FILE *file, Display *dpy, XkbDescPtr xkb)
187 fprintf(file, "/* types name is \"%s\" */\n",
200 fprintf(file, "static XkbKTMapEntryRec map_%s[%d]= {\n", prefix,
204 fprintf(file, ",\n");
205 fprintf(file, " { %d, %6d, { %15s, %15s, %15s } }",
213 fprintf(file, "\n};\n");
216 WriteTypePreserve(file, dpy, prefix, xkb, type);
219 fprintf(file, "static Atom lnames_%s[%d];\n", prefix,
222 fprintf(file, "\n");
226 fprintf(file, "static XkbKeyTypeRec dflt_types[]= {\n");
233 fprintf(file, ",\n");
234 fprintf(file, " {\n { %15s, %15s, %15s },\n",
238 fprintf(file, " %d,\n", type->num_levels);
239 fprintf(file, " %d,", type->map_count);
241 fprintf(file, " map_%s,", prefix);
243 fprintf(file, " NULL,");
245 fprintf(file, " preserve_%s,\n", prefix);
247 fprintf(file, " NULL,\n");
249 fprintf(file, " None, lnames_%s\n }", prefix);
251 fprintf(file, " None, NULL\n }");
255 fprintf(file, "\n};\n");
256 fprintf(file,
258 WriteTypeInitFunc(file, dpy, xkb);
263 WriteCHdrCompatMap(FILE *file, Display *dpy, XkbDescPtr xkb)
275 fprintf(file, "/* compat name is \"%s\" */\n",
278 fprintf(file, "static XkbSymInterpretRec dfltSI[%d]= {\n", compat->num_si);
285 fprintf(file, ",\n");
286 fprintf(file, " { %s, ", XkbKeysymText(interp->sym, XkbCFile));
287 fprintf(file, "0x%04x,\n", interp->flags);
288 fprintf(file, " %s, ", XkbSIMatchText(interp->match, XkbCFile));
289 fprintf(file, "%s,\n", XkbModMaskText(interp->mods, XkbCFile));
290 fprintf(file, " %d,\n", interp->virtual_mod);
291 fprintf(file, " %s }", XkbActionText(dpy, xkb, act, XkbCFile));
293 fprintf(file, "\n};\n");
294 fprintf(file,
296 fprintf(file, "\nstatic XkbCompatMapRec compatMap= {\n");
297 fprintf(file, " dfltSI,\n");
298 fprintf(file, " { /* group compatibility */\n ");
303 fprintf(file, "%s{ %12s, %12s, %12s }",
309 fprintf(file, "\n },\n");
310 fprintf(file, " num_dfltSI, num_dfltSI\n");
311 fprintf(file, "};\n\n");
316 WriteCHdrSymbols(FILE *file, XkbDescPtr xkb)
324 fprintf(file, "#define NUM_SYMBOLS %d\n", xkb->map->num_syms);
329 fprintf(file, "static KeySym symCache[NUM_SYMBOLS]= {\n");
332 fprintf(file, " ");
334 fprintf(file, ",\n ");
336 fprintf(file, ", ");
337 fprintf(file, "%15s", XkbKeysymText(*sym, XkbCFile));
339 fprintf(file, "\n};\n");
345 fprintf(file, "static XkbSymMapRec symMap[NUM_KEYS]= {\n");
348 fprintf(file, " ");
350 fprintf(file, ",\n ");
352 fprintf(file, ", ");
353 fprintf(file, "{ %2d, 0x%x, %3d }",
356 fprintf(file, "\n};\n");
362 WriteCHdrClientMap(FILE *file, Display *dpy, XkbDescPtr xkb)
368 if (!WriteCHdrKeyTypes(file, dpy, xkb))
370 if (!WriteCHdrSymbols(file, xkb))
372 fprintf(file, "static XkbClientMapRec clientMap= {\n");
373 fprintf(file, " NUM_TYPES, NUM_TYPES, types, \n");
374 fprintf(file, " NUM_SYMBOLS, NUM_SYMBOLS, symCache, symMap\n");
375 fprintf(file, "};\n\n");
380 WriteCHdrServerMap(FILE *file, Display *dpy, XkbDescPtr xkb)
392 fprintf(file, "#define NUM_ACTIONS %d\n", xkb->server->num_acts);
393 fprintf(file, "static XkbAnyAction actionCache[NUM_ACTIONS]= {\n");
396 fprintf(file, " ");
398 fprintf(file, ",\n ");
399 fprintf(file, "%s",
402 fprintf(file, "\n};\n");
404 fprintf(file, "static unsigned short keyActions[NUM_KEYS]= {\n");
407 fprintf(file, " ");
409 fprintf(file, ",\n ");
411 fprintf(file, ", ");
412 fprintf(file, "%2d", xkb->server->key_acts[i]);
414 fprintf(file, "\n};\n");
415 fprintf(file, "static XkbBehavior behaviors[NUM_KEYS]= {\n");
418 fprintf(file, " ");
420 fprintf(file, ",\n ");
422 fprintf(file, ", ");
424 fprintf(file, "%s",
428 fprintf(file, "{ 0, 0 }");
430 fprintf(file, "\n};\n");
431 fprintf(file, "static unsigned char explicit_parts[NUM_KEYS]= {\n");
434 fprintf(file, " ");
436 fprintf(file, ",\n ");
438 fprintf(file, ", ");
440 fprintf(file, " 0");
442 fprintf(file, "0x%02x", xkb->server->explicit[i]);
444 fprintf(file, "\n};\n");
445 fprintf(file, "static unsigned short vmodmap[NUM_KEYS]= {\n");
448 fprintf(file, " ");
450 fprintf(file, ",\n ");
452 fprintf(file, ", ");
454 fprintf(file, " 0");
456 fprintf(file, "0x%04x", xkb->server->vmodmap[i]);
458 fprintf(file, "};\n");
459 fprintf(file, "static XkbServerMapRec serverMap= {\n");
460 fprintf(file, " %d, %d, (XkbAction *)actionCache,\n",
462 fprintf(file, " behaviors, keyActions, explicit_parts,\n");
465 fprintf(file, " { ");
467 fprintf(file, ",\n ");
469 fprintf(file, ", ");
470 fprintf(file, "%3d", xkb->server->vmods[i]);
472 fprintf(file, " },\n");
473 fprintf(file, " vmodmap\n");
474 fprintf(file, "};\n\n");
479 WriteCHdrIndicators(FILE *file, Display *dpy, XkbDescPtr xkb)
486 fprintf(file, "static XkbIndicatorRec indicators= {\n");
487 fprintf(file, " 0x%lx,\n {\n",
491 fprintf(file, "%s { 0x%02x, %s, 0x%02x, %s, { %s, ",
497 fprintf(file, " %s, %s }, %s }",
504 fprintf(file, "\n }\n};\n");
506 fprintf(file, "static void\n");
507 fprintf(file, "initIndicatorNames(DPYTYPE dpy,XkbDescPtr xkb)\n");
508 fprintf(file, "{\n");
515 fprintf(file, " xkb->names->indicators[%2d]= ", i);
516 fprintf(file, "GET_ATOM(dpy,\"%s\");\n",
519 fprintf(file, "}\n");
525 WriteCHdrGeomProps(FILE *file, XkbDescPtr xkb, XkbGeometryPtr geom)
530 fprintf(file, "\nstatic XkbPropertyRec g_props[%d]= {\n",
533 fprintf(file, "%s { \"%s\", \"%s\" }",
538 fprintf(file, "\n};\n");
544 WriteCHdrGeomColors(FILE *file, XkbDescPtr xkb, XkbGeometryPtr geom)
549 fprintf(file, "\nstatic XkbColorRec g_colors[%d]= {\n",
552 fprintf(file, "%s { %3d, \"%s\" }",
556 fprintf(file, "\n};\n");
562 WriteCHdrGeomOutlines(FILE *file, int nOL, XkbOutlinePtr ol, int shapeNdx)
567 fprintf(file, "\nstatic XkbPointRec pts_sh%02do%02d[]= {\n", shapeNdx,
571 fprintf(file, " ");
573 fprintf(file, ",\n ");
575 fprintf(file, ", ");
576 fprintf(file, "{ %4d, %4d }", ol[o].points[p].x, ol[o].points[p].y);
578 fprintf(file, "\n};");
580 fprintf(file, "\n\nstatic XkbOutlineRec ol_sh%02d[]= {\n", shapeNdx);
582 fprintf(file, "%s { %d, %d, %d, pts_sh%02do%02d }",
587 fprintf(file, "\n};\n");
592 WriteCHdrGeomShapes(FILE *file, XkbDescPtr xkb, XkbGeometryPtr geom)
598 WriteCHdrGeomOutlines(file, shape->num_outlines, shape->outlines, s);
600 fprintf(file, "\n\nstatic XkbShapeRec g_shapes[%d]= {\n", geom->num_shapes);
602 fprintf(file, "%s { None, %3d, %3d, ol_sh%02d, ",
606 fprintf(file, "&ol_sh%02d[%2d], ", s,
610 fprintf(file, " NULL, ");
612 fprintf(file, "&ol_sh%02d[%2d],\n", s,
616 fprintf(file, " NULL,\n");
617 fprintf(file,
622 fprintf(file, "\n};\n");
627 WriteCHdrGeomDoodads(FILE * file,
640 fprintf(file, "static XkbDoodadRec g_doodads[%d];\n",
643 fprintf(file, "static void\n");
644 fprintf(file, "_InitGeomDoodads(DPYTYPE dpy,XkbGeometryPtr geom)\n");
645 fprintf(file, "{\n");
646 fprintf(file, "register XkbDoodadPtr doodads;\n\n");
647 fprintf(file, " doodads= geom->doodads;\n");
653 fprintf(file, "static XkbDoodadRec doodads_s%02d[%d];\n",
656 fprintf(file, "static void\n");
657 fprintf(file, "_InitS%02dDoodads(", section_num);
658 fprintf(file, " DPYTYPE dpy,\n");
659 fprintf(file, " XkbGeometryPtr geom,\n");
660 fprintf(file, " XkbSectionPtr section)\n");
661 fprintf(file, "{\n");
662 fprintf(file, "register XkbDoodadPtr doodads;\n\n");
663 fprintf(file, " doodads= section->doodads;\n");
669 fprintf(file, "\n");
670 fprintf(file, " doodads[%d].any.name= GET_ATOM(dpy,\"%s\");\n",
672 fprintf(file, " doodads[%d].any.type= %s;\n",
674 fprintf(file, " doodads[%d].any.priority= %d;\n",
676 fprintf(file, " doodads[%d].any.top= %d;\n", d, doodad->any.top);
677 fprintf(file, " doodads[%d].any.left= %d;\n", d, doodad->any.left);
678 fprintf(file, " doodads[%d].any.angle= %d;\n", d, doodad->any.angle);
682 fprintf(file, " doodads[%d].shape.color_ndx= %d;\n",
684 fprintf(file, " doodads[%d].shape.shape_ndx= %d;\n",
688 fprintf(file, " doodads[%d].text.width= %d;\n",
690 fprintf(file, " doodads[%d].text.height= %d;\n",
692 fprintf(file, " doodads[%d].text.color_ndx= %d;\n",
694 fprintf(file, " doodads[%d].text.text= \"%s\";\n",
696 fprintf(file, " doodads[%d].text.font= \"%s\";\n",
700 fprintf(file, " doodads[%d].indicator.shape_ndx= %d;\n",
702 fprintf(file, " doodads[%d].indicator.on_color_ndx= %d;\n",
704 fprintf(file, " doodads[%d].indicator.off_color_ndx= %d;\n",
708 fprintf(file, " doodads[%d].logo.color_ndx= %d;\n",
710 fprintf(file, " doodads[%d].logo.shape_ndx= %d;\n",
712 fprintf(file, " doodads[%d].logo.logo_name= \"%s\";\n",
717 fprintf(file, "}\n");
722 WriteCHdrGeomOverlays(FILE * file,
736 fprintf(file, "static XkbOverlayKeyRec olkeys_s%02dr%02d[%d]= {\n",
739 fprintf(file, "%s { {\"%s\"}, {\"%s\"} }",
744 fprintf(file, "\n};\n");
746 fprintf(file, "static XkbOverlayRowRec olrows_s%02d[%d]= {\n",
749 fprintf(file, "%s { %4d, %4d, %4d, olkeys_s%02dr%02d }",
754 fprintf(file, "\n};\n");
756 fprintf(file, "static XkbOverlayRec overlays_s%02d[%d]= {\n", section_num,
759 fprintf(file, "%s {\n", (o == 0 ? "" : ",\n"));
760 fprintf(file, " None, /* name */\n");
761 fprintf(file, " NULL, /* section_under */\n");
762 fprintf(file, " %4d, /* num_rows */\n", ol->num_rows);
763 fprintf(file, " %4d, /* sz_rows */\n", ol->num_rows);
764 fprintf(file, " olrows_s%02d,\n", section_num);
765 fprintf(file, " NULL /* bounds */\n");
766 fprintf(file, " }");
768 fprintf(file, "\n};\n");
769 fprintf(file, "static void\n");
770 fprintf(file, "_InitS%02dOverlay(", section_num);
771 fprintf(file, " DPYTYPE dpy,\n");
772 fprintf(file, " XkbGeometryPtr geom,\n");
773 fprintf(file, " XkbSectionPtr section)\n");
774 fprintf(file, "{\n");
775 fprintf(file, "XkbOverlayPtr ol;\n\n");
776 fprintf(file, " ol= section->overlays;\n");
778 fprintf(file, " ol[%2d].name= GET_ATOM(dpy,\"%s\");\n",
780 fprintf(file, " ol[%2d].section_under= section;\n", o);
782 fprintf(file, "}\n");
787 WriteCHdrGeomRows(FILE * file,
797 fprintf(file, "static XkbKeyRec keys_s%02dr%02d[]= {\n",
800 fprintf(file, "%s { { \"%s\" }, %4d, %4d, %4d }",
805 fprintf(file, "\n};\n");
807 fprintf(file, "static XkbRowRec rows_s%02d[]= {\n", section_num);
809 fprintf(file, "%s { %4d, %4d, %2d, %2d, %1d, keys_s%02dr%02d, ",
813 fprintf(file, " { %4d, %4d, %4d, %4d } }",
816 fprintf(file, "\n};\n");
821 WriteCHdrGeomSections(FILE *file, XkbDescPtr xkb, XkbGeometryPtr geom)
828 WriteCHdrGeomRows(file, xkb, section, s);
830 WriteCHdrGeomOverlays(file, xkb, section, s);
832 fprintf(file, "\nstatic XkbSectionRec g_sections[%d]= {\n",
837 fprintf(file, ",\n");
838 fprintf(file, " {\n None, /* name */\n");
839 fprintf(file, " %4d, /* priority */\n", section->priority);
840 fprintf(file, " %4d, /* top */\n", section->top);
841 fprintf(file, " %4d, /* left */\n", section->left);
842 fprintf(file, " %4d, /* width */\n", section->width);
843 fprintf(file, " %4d, /* height */\n", section->height);
844 fprintf(file, " %4d, /* angle */\n", section->angle);
845 fprintf(file, " %4d, /* num_rows */\n", section->num_rows);
846 fprintf(file, " %4d, /* num_doodads */\n", section->num_doodads);
847 fprintf(file, " %4d, /* num_overlays */\n", section->num_overlays);
848 fprintf(file, " %4d, /* sz_rows */\n", section->num_rows);
849 fprintf(file, " %4d, /* sz_doodads */\n", section->num_doodads);
850 fprintf(file, " %4d, /* sz_overlays */\n", section->num_overlays);
852 fprintf(file, " rows_s%02d,\n", s);
854 fprintf(file, " NULL, /* rows */\n");
856 fprintf(file, " doodads_s%02d,\n", s);
858 fprintf(file, " NULL, /* doodads */\n");
859 fprintf(file, " { %4d, %4d, %4d, %4d }, /* bounds */\n",
863 fprintf(file, " overlays_s%02d\n", s);
865 fprintf(file, " NULL /* overlays */\n");
866 fprintf(file, " }");
868 fprintf(file, "\n};\n");
869 fprintf(file, "\nstatic Bool\n");
870 fprintf(file, "_InitSections(DPYTYPE dpy,XkbGeometryPtr geom)\n");
871 fprintf(file, "{\nXkbSectionPtr sections;\n\n");
872 fprintf(file, " sections= geom->sections;\n");
876 fprintf(file, " _InitS%02dDoodads(dpy,geom,§ions[%d]);\n",
880 fprintf(file, " _InitS%02dOverlays(dpy,geom,§ions[%d]);\n",
884 fprintf(file, "}\n");
889 WriteCHdrGeomAliases(FILE *file, XkbDescPtr xkb, XkbGeometryPtr geom)
894 fprintf(file, "\nstatic XkbKeyAliasRec g_aliases[%d]= {\n",
897 fprintf(file, "%s { \"%s\", \"%s\" }",
902 fprintf(file, "\n};\n");
908 WriteCHdrGeometry(FILE *file, XkbDescPtr xkb)
918 WriteCHdrGeomProps(file, xkb, geom);
919 WriteCHdrGeomColors(file, xkb, geom);
920 WriteCHdrGeomShapes(file, xkb, geom);
921 WriteCHdrGeomSections(file, xkb, geom);
922 WriteCHdrGeomDoodads(file, xkb, geom, NULL, 0);
923 WriteCHdrGeomAliases(file, xkb, geom);
924 fprintf(file, "\nstatic XkbGeometryRec geom= {\n");
925 fprintf(file, " None, /* name */\n");
926 fprintf(file, " %d, %d, /* width, height */\n",
929 fprintf(file, " \"%s\",/* label font */\n",
932 fprintf(file, " NULL, /* label font */\n");
934 fprintf(file, " &g_colors[%d], /* label color */\n",
937 fprintf(file, " NULL, /* label color */\n");
939 fprintf(file, " &g_colors[%d], /* base color */\n",
942 fprintf(file, " NULL, /* base color */\n");
943 fprintf(file,
946 fprintf(file,
949 fprintf(file,
952 fprintf(file,
955 fprintf(file, " %s, %s, %s,\n",
959 fprintf(file, " %s, %s, %s\n",
963 fprintf(file, "};\n\n");
964 fprintf(file, "static Bool\n");
965 fprintf(file, "_InitHdrGeom(DPYTYPE dpy,XkbGeometryPtr geom)\n");
966 fprintf(file, "{\n");
968 fprintf(file, " geom->name= GET_ATOM(dpy,\"%s\");\n",
972 fprintf(file, " geom->shapes[%2d].name= GET_ATOM(dpy,\"%s\");\n", i,
976 fprintf(file, " _InitGeomDoodads(dpy,geom);\n");
977 fprintf(file, " _InitSections(dpy,geom);\n");
978 fprintf(file, "}\n\n");
983 WriteCHdrGeomFile(FILE *file, XkbFileInfo *result)
987 ok = WriteCHdrGeometry(file, result->xkb);
992 WriteCHdrLayout(FILE *file, XkbFileInfo *result)
998 ok = WriteCHdrVMods(file, xkb->dpy, xkb);
999 ok = WriteCHdrKeycodes(file, xkb) && ok;
1000 ok = WriteCHdrSymbols(file, xkb) && ok;
1001 ok = WriteCHdrGeometry(file, xkb) && ok;
1006 WriteCHdrSemantics(FILE *file, XkbFileInfo *result)
1012 ok = WriteCHdrVMods(file, xkb->dpy, xkb);
1013 ok = WriteCHdrKeyTypes(file, xkb->dpy, xkb) && ok;
1014 ok = WriteCHdrCompatMap(file, xkb->dpy, xkb) && ok;
1015 ok = WriteCHdrIndicators(file, xkb->dpy, xkb) && ok;
1020 WriteCHdrKeymap(FILE *file, XkbFileInfo *result)
1026 ok = WriteCHdrVMods(file, xkb->dpy, xkb);
1027 ok = ok && WriteCHdrKeycodes(file, xkb);
1028 ok = ok && WriteCHdrClientMap(file, xkb->dpy, xkb);
1029 ok = ok && WriteCHdrServerMap(file, xkb->dpy, xkb);
1030 ok = ok && WriteCHdrCompatMap(file, xkb->dpy, xkb);
1031 ok = WriteCHdrIndicators(file, xkb->dpy, xkb) && ok;
1032 ok = ok && WriteCHdrGeometry(file, xkb);
1042 Bool (*func) (FILE * /* file */,
1088 fprintf(out, "/* This file generated automatically by xkbcomp */\n");