Skip to content

Commit

Permalink
Core stuff?
Browse files Browse the repository at this point in the history
  • Loading branch information
miniksa committed Feb 15, 2022
1 parent 48e37a5 commit 9ab0c75
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/cascadia/TerminalControl/ControlCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
auto pfnTerminalTaskbarProgressChanged = std::bind(&ControlCore::_terminalTaskbarProgressChanged, this);
_terminal->TaskbarProgressChangedCallback(pfnTerminalTaskbarProgressChanged);

auto pfnShowWindowChanged = [&](bool foo){ foo;};
auto pfnShowWindowChanged = std::bind(&ControlCore::_terminalShowWindowChanged, this, std::placeholders::_1);
_terminal->SetShowWindowCallback(pfnShowWindowChanged);

// MSFT 33353327: Initialize the renderer in the ctor instead of Initialize().
Expand Down Expand Up @@ -1262,6 +1262,12 @@ namespace winrt::Microsoft::Terminal::Control::implementation
_TaskbarProgressChangedHandlers(*this, nullptr);
}

void ControlCore::_terminalShowWindowChanged(bool showOrHide)
{
auto showWindow = winrt::make_self<implementation::ShowWindowArgs>(showOrHide);
_ShowWindowChangedHandlers(*this, *showWindow);
}

bool ControlCore::HasSelection() const
{
return _terminal->IsSelectionActive();
Expand Down
2 changes: 2 additions & 0 deletions src/cascadia/TerminalControl/ControlCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
TYPED_EVENT(TransparencyChanged, IInspectable, Control::TransparencyChangedEventArgs);
TYPED_EVENT(ReceivedOutput, IInspectable, IInspectable);
TYPED_EVENT(FoundMatch, IInspectable, Control::FoundResultsArgs);
TYPED_EVENT(ShowWindowChanged, IInspectable, Control::ShowWindowArgs);
// clang-format on

private:
Expand Down Expand Up @@ -261,6 +262,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
const int bufferSize);
void _terminalCursorPositionChanged();
void _terminalTaskbarProgressChanged();
void _terminalShowWindowChanged(bool showOrHide);
#pragma endregion

#pragma region RendererCallbacks
Expand Down
1 change: 1 addition & 0 deletions src/cascadia/TerminalControl/ControlCore.idl
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ namespace Microsoft.Terminal.Control
event Windows.Foundation.TypedEventHandler<Object, TransparencyChangedEventArgs> TransparencyChanged;
event Windows.Foundation.TypedEventHandler<Object, Object> ReceivedOutput;
event Windows.Foundation.TypedEventHandler<Object, FoundResultsArgs> FoundMatch;
event Windows.Foundation.TypedEventHandler<Object, ShowWindowArgs> ShowWindowChanged;

};
}
12 changes: 12 additions & 0 deletions src/cascadia/TerminalControl/EventArgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,16 @@ namespace winrt::Microsoft::Terminal::Control::implementation

WINRT_PROPERTY(bool, FoundMatch);
};

struct ShowWindowArgs : public ShowWindowArgsT<ShowWindowArgs>
{
public:
ShowWindowArgs(const bool showOrHide) :
_ShowOrHide(showOrHide)
{

}

WINRT_PROPERTY(bool, ShowOrHide);
}
}
5 changes: 5 additions & 0 deletions src/cascadia/TerminalControl/EventArgs.idl
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,9 @@ namespace Microsoft.Terminal.Control
{
Boolean FoundMatch { get; };
}

runtime class ShowWindowArgs
{
Boolean ShowOrHide { get; };
}
}

1 comment on commit 9ab0c75

@github-actions

This comment was marked as outdated.

Please sign in to comment.