Skip to content

Commit

Permalink
good bot
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed Nov 5, 2020
1 parent fb442f1 commit 1ec8046
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .github/actions/spell-check/dictionary/apis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ IExplorer
IInheritable
IMap
IObject
IPeasant
IStorage
LCID
llabs
llu
lround
LSHIFT
MULTIPLEUSE
NCHITTEST
NCLBUTTONDBLCLK
NCRBUTTONDBLCLK
Expand All @@ -47,6 +49,7 @@ otms
OUTLINETEXTMETRICW
PAGESCROLL
RETURNCMD
REGCLS
rfind
roundf
RSHIFT
Expand Down
6 changes: 3 additions & 3 deletions src/tools/MonarchPeasantSample/AppState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ bool AppState::areWeTheKing(const bool logPIDs)
{
if (ourPID == kingPID)
{
printf(fmt::format("We're the \x1b[33mking\x1b[m - our PID is {}\n", ourPID).c_str());
printf(fmt::format("We're the\x1b[33m king\x1b[m - our PID is {}\n", ourPID).c_str());
}
else
{
Expand All @@ -63,7 +63,7 @@ void AppState::remindKingWhoTheyAre(const winrt::MonarchPeasantSample::IPeasant&
}
}

winrt::MonarchPeasantSample::Monarch AppState::instantiateAMonarch()
winrt::MonarchPeasantSample::Monarch AppState::instantiateMonarch()
{
auto monarch = create_instance<winrt::MonarchPeasantSample::Monarch>(Monarch_clsid, CLSCTX_LOCAL_SERVER);
return monarch;
Expand All @@ -85,7 +85,7 @@ MonarchPeasantSample::IPeasant AppState::_createOurPeasant()

void AppState::createMonarch()
{
monarch = AppState::instantiateAMonarch();
monarch = AppState::instantiateMonarch();
}

// return true to exit early, false if we should continue into the main loop
Expand Down
2 changes: 1 addition & 1 deletion src/tools/MonarchPeasantSample/AppState.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class AppState
bool areWeTheKing(const bool logPIDs = false);
void initializeState();

static winrt::MonarchPeasantSample::Monarch instantiateAMonarch();
static winrt::MonarchPeasantSample::Monarch instantiateMonarch();

void createMonarch();
bool processCommandline();
Expand Down
5 changes: 2 additions & 3 deletions src/tools/MonarchPeasantSample/Monarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,8 @@ namespace winrt::MonarchPeasantSample::implementation

if (args.size() >= 3)
{
// We'll need three args at least - [exename.exe, -s, id] to be able
// to have a session ID passed on the commandline.
// printf("The new process provided tribute, we'll eat it. No need to create a new window.\n");
// We'll need three args at least - [MonarchPeasantSample.exe, -s,
// id] to be able to have a session ID passed on the commandline.

if (args[1] == L"-s" || args[1] == L"--session")
{
Expand Down
2 changes: 1 addition & 1 deletion src/tools/MonarchPeasantSample/Peasant.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "Peasant.g.h"
#include "../cascadia/inc/cppwinrt_utils.h"

// 50dba6cd-1111-4b12-8363-5e06f5d0082c
// {50dba6cd-1111-4b12-8363-5e06f5d0082c}
constexpr GUID Peasant_clsid{
0x50dba6cd,
0x1111,
Expand Down
8 changes: 4 additions & 4 deletions src/tools/MonarchPeasantSample/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Monarch/Peasant Sample

This directory contains a sample monrach/peasant application. This is a type of
This directory contains a sample monarch/peasant application. This is a type of
application where a single "Monarch" can coordinate the actions of multiple
other "Peasant" processes, as described by the specs in [#7240] and [#8135].

This project is intended to be a standalone sample of how the architecture would
work, withut involving the entirety of the Windows Terminal build. Eventually,
work, without involving the entirety of the Windows Terminal build. Eventually,
this architecture will be incorporated into `wt.exe` itself, to enable scenarios
like:
* Run `wt` in the current window ([#4472])
Expand Down Expand Up @@ -42,9 +42,9 @@ this argument works. The actual `args...` params are unused.

## Project layout

The code is vaguely seperated into the following files, with the following
The code is vaguely separated into the following files, with the following
purposes. As this code isn't production-ready code, the layering isn't
particularily well organized nor enforced.
particularly well organized nor enforced.

* `Monarch.idl/.h/.cpp`: Code for the WinRT Monarch object, responsible for
coordinating the Peasants
Expand Down
6 changes: 3 additions & 3 deletions src/tools/MonarchPeasantSample/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ using namespace winrt::Windows::Foundation;
using namespace ::Microsoft::Console;

////////////////////////////////////////////////////////////////////////////////
// This seems liks a hack, but it works.
// This seems like a hack, but it works.
//
// This class factory works so that there's only ever one instance of a Monarch
// per-process. Once the first monarch is created, we'll stash it in g_weak.
// Future callers who try to instantiate a Monarch will get the one that's
// already been made.
//
// I'm sure there's a better awy to do this with WRL, but I'm not familiar
// I'm sure there's a better way to do this with WRL, but I'm not familiar
// enough with WRL to know for sure.

winrt::weak_ref<MonarchPeasantSample::implementation::Monarch> g_weak{ nullptr };
Expand Down Expand Up @@ -82,7 +82,7 @@ DWORD registerAsMonarch()
// that we exist.
void electNewMonarch(AppState& state)
{
state.monarch = AppState::instantiateAMonarch();
state.monarch = AppState::instantiateMonarch();
bool isMonarch = state.areWeTheKing(true);

printf("LONG LIVE THE %sKING\x1b[m\n", isMonarch ? "\x1b[33m" : "");
Expand Down

1 comment on commit 1ec8046

@github-actions

This comment was marked as resolved.

Please sign in to comment.