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