xref: /openbsd-src/gnu/llvm/clang/tools/clang-format-vs/ClangFormat/ClangFormat.vsct (revision e5dd70708596ae51455a0ffa086a00c5b29f8583)
1*e5dd7070Spatrick<?xml version="1.0" encoding="utf-8"?>
2*e5dd7070Spatrick<CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema">
3*e5dd7070Spatrick
4*e5dd7070Spatrick  <!--  This is the file that defines the actual layout and type of the commands.
5*e5dd7070Spatrick        It is divided in different sections (e.g. command definition, command
6*e5dd7070Spatrick        placement, ...), with each defining a specific set of properties.
7*e5dd7070Spatrick        See the comment before each section for more details about how to
8*e5dd7070Spatrick        use it. -->
9*e5dd7070Spatrick
10*e5dd7070Spatrick  <!--  The VSCT compiler (the tool that translates this file into the binary
11*e5dd7070Spatrick        format that VisualStudio will consume) has the ability to run a preprocessor
12*e5dd7070Spatrick        on the vsct file; this preprocessor is (usually) the C++ preprocessor, so
13*e5dd7070Spatrick        it is possible to define includes and macros with the same syntax used
14*e5dd7070Spatrick        in C++ files. Using this ability of the compiler here, we include some files
15*e5dd7070Spatrick        defining some of the constants that we will use inside the file. -->
16*e5dd7070Spatrick
17*e5dd7070Spatrick  <!--This is the file that defines the IDs for all the commands exposed by VisualStudio. -->
18*e5dd7070Spatrick  <Extern href="stdidcmd.h"/>
19*e5dd7070Spatrick
20*e5dd7070Spatrick  <!--This header contains the command ids for the menus provided by the shell. -->
21*e5dd7070Spatrick  <Extern href="vsshlids.h"/>
22*e5dd7070Spatrick
23*e5dd7070Spatrick
24*e5dd7070Spatrick
25*e5dd7070Spatrick
26*e5dd7070Spatrick  <!--The Commands section is where we the commands, menus and menu groups are defined.
27*e5dd7070Spatrick      This section uses a Guid to identify the package that provides the command defined inside it. -->
28*e5dd7070Spatrick  <Commands package="guidClangFormatPkg">
29*e5dd7070Spatrick    <!-- Inside this section we have different sub-sections: one for the menus, another
30*e5dd7070Spatrick    for the menu groups, one for the buttons (the actual commands), one for the combos
31*e5dd7070Spatrick    and the last one for the bitmaps used. Each element is identified by a command id that
32*e5dd7070Spatrick    is a unique pair of guid and numeric identifier; the guid part of the identifier is usually
33*e5dd7070Spatrick    called "command set" and is used to group different command inside a logically related
34*e5dd7070Spatrick    group; your package should define its own command set in order to avoid collisions
35*e5dd7070Spatrick    with command ids defined by other packages. -->
36*e5dd7070Spatrick
37*e5dd7070Spatrick
38*e5dd7070Spatrick    <!-- In this section you can define new menu groups. A menu group is a container for
39*e5dd7070Spatrick         other menus or buttons (commands); from a visual point of view you can see the
40*e5dd7070Spatrick         group as the part of a menu contained between two lines. The parent of a group
41*e5dd7070Spatrick         must be a menu. -->
42*e5dd7070Spatrick    <Groups>
43*e5dd7070Spatrick
44*e5dd7070Spatrick      <Group guid="guidClangFormatCmdSet" id="MyMenuGroup" priority="0x0600">
45*e5dd7070Spatrick        <Parent guid="guidSHLMainMenu" id="IDM_VS_MENU_TOOLS"/>
46*e5dd7070Spatrick      </Group>
47*e5dd7070Spatrick
48*e5dd7070Spatrick
49*e5dd7070Spatrick
50*e5dd7070Spatrick    </Groups>
51*e5dd7070Spatrick
52*e5dd7070Spatrick    <!--Buttons section. -->
53*e5dd7070Spatrick    <!--This section defines the elements the user can interact with, like a menu command or a button
54*e5dd7070Spatrick        or combo box in a toolbar. -->
55*e5dd7070Spatrick    <Buttons>
56*e5dd7070Spatrick      <!--To define a menu group you have to specify its ID, the parent menu and its display priority.
57*e5dd7070Spatrick          The command is visible and enabled by default. If you need to change the visibility, status, etc, you can use
58*e5dd7070Spatrick          the CommandFlag node.
59*e5dd7070Spatrick          You can add more than one CommandFlag node e.g.:
60*e5dd7070Spatrick              <CommandFlag>DefaultInvisible</CommandFlag>
61*e5dd7070Spatrick              <CommandFlag>DynamicVisibility</CommandFlag>
62*e5dd7070Spatrick          If you do not want an image next to your command, remove the Icon node /> -->
63*e5dd7070Spatrick
64*e5dd7070Spatrick      <Button guid="guidClangFormatCmdSet" id="cmdidClangFormatSelection" priority="0x0100" type="Button">
65*e5dd7070Spatrick        <Parent guid="guidClangFormatCmdSet" id="MyMenuGroup" />
66*e5dd7070Spatrick        <Icon guid="guidImages" id="bmpPic1" />
67*e5dd7070Spatrick        <Strings>
68*e5dd7070Spatrick          <ButtonText>Clang Format Selection</ButtonText>
69*e5dd7070Spatrick        </Strings>
70*e5dd7070Spatrick      </Button>
71*e5dd7070Spatrick
72*e5dd7070Spatrick      <Button guid="guidClangFormatCmdSet" id="cmdidClangFormatDocument" priority="0x0101" type="Button">
73*e5dd7070Spatrick        <Parent guid="guidClangFormatCmdSet" id="MyMenuGroup" />
74*e5dd7070Spatrick        <Icon guid="guidImages" id="bmpPic2" />
75*e5dd7070Spatrick        <Strings>
76*e5dd7070Spatrick          <ButtonText>Clang Format Document</ButtonText>
77*e5dd7070Spatrick        </Strings>
78*e5dd7070Spatrick      </Button>
79*e5dd7070Spatrick
80*e5dd7070Spatrick    </Buttons>
81*e5dd7070Spatrick
82*e5dd7070Spatrick    <!--The bitmaps section is used to define the bitmaps that are used for the commands.-->
83*e5dd7070Spatrick    <Bitmaps>
84*e5dd7070Spatrick      <!--  The bitmap id is defined in a way that is a little bit different from the others:
85*e5dd7070Spatrick            the declaration starts with a guid for the bitmap strip, then there is the resource id of the
86*e5dd7070Spatrick            bitmap strip containing the bitmaps and then there are the numeric ids of the elements used
87*e5dd7070Spatrick            inside a button definition. An important aspect of this declaration is that the element id
88*e5dd7070Spatrick            must be the actual index (1-based) of the bitmap inside the bitmap strip. -->
89*e5dd7070Spatrick      <Bitmap guid="guidImages" href="Resources\Images_32bit.bmp" usedList="bmpPic1, bmpPic2, bmpPicSearch, bmpPicX, bmpPicArrows"/>
90*e5dd7070Spatrick
91*e5dd7070Spatrick    </Bitmaps>
92*e5dd7070Spatrick
93*e5dd7070Spatrick  </Commands>
94*e5dd7070Spatrick
95*e5dd7070Spatrick
96*e5dd7070Spatrick  <KeyBindings>
97*e5dd7070Spatrick    <KeyBinding guid="guidClangFormatCmdSet" id="cmdidClangFormatSelection" editor="guidTextEditor" key1="R" mod1="Control" key2="F" mod2="Control"/>
98*e5dd7070Spatrick    <KeyBinding guid="guidClangFormatCmdSet" id="cmdidClangFormatDocument" editor="guidTextEditor" key1="R" mod1="Control" key2="D" mod2="Control"/>
99*e5dd7070Spatrick  </KeyBindings>
100*e5dd7070Spatrick
101*e5dd7070Spatrick
102*e5dd7070Spatrick
103*e5dd7070Spatrick  <Symbols>
104*e5dd7070Spatrick    <!-- This is the package guid. -->
105*e5dd7070Spatrick    <GuidSymbol name="guidClangFormatPkg" value="{c5286038-25d3-4f65-83a8-51fa2df4a146}" />
106*e5dd7070Spatrick
107*e5dd7070Spatrick    <!-- This is the guid used to group the menu commands together -->
108*e5dd7070Spatrick    <GuidSymbol name="guidClangFormatCmdSet" value="{e39cbab1-0f96-4022-a2bc-da5a9db7eb78}">
109*e5dd7070Spatrick
110*e5dd7070Spatrick      <IDSymbol name="MyMenuGroup" value="0x1020" />
111*e5dd7070Spatrick      <IDSymbol name="cmdidClangFormatSelection" value="0x0100" />
112*e5dd7070Spatrick      <IDSymbol name="cmdidClangFormatDocument" value="0x0101" />
113*e5dd7070Spatrick    </GuidSymbol>
114*e5dd7070Spatrick
115*e5dd7070Spatrick    <GuidSymbol name="guidTextEditor" value="{8B382828-6202-11d1-8870-0000F87579D2}" />
116*e5dd7070Spatrick
117*e5dd7070Spatrick
118*e5dd7070Spatrick    <GuidSymbol name="guidImages" value="{6d53937b-9ae1-42e1-8849-d876dcdbad7b}" >
119*e5dd7070Spatrick      <IDSymbol name="bmpPic1" value="1" />
120*e5dd7070Spatrick      <IDSymbol name="bmpPic2" value="2" />
121*e5dd7070Spatrick      <IDSymbol name="bmpPicSearch" value="3" />
122*e5dd7070Spatrick      <IDSymbol name="bmpPicX" value="4" />
123*e5dd7070Spatrick      <IDSymbol name="bmpPicArrows" value="5" />
124*e5dd7070Spatrick    </GuidSymbol>
125*e5dd7070Spatrick  </Symbols>
126*e5dd7070Spatrick
127*e5dd7070Spatrick</CommandTable>
128