Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace some of our macros to reduce confusion, increase success #9376

Merged
merged 6 commits into from
Mar 4, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cascadia/Remoting/FindTargetWindowArgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
{
struct FindTargetWindowArgs : public FindTargetWindowArgsT<FindTargetWindowArgs>
{
GETSET_PROPERTY(winrt::Microsoft::Terminal::Remoting::CommandlineArgs, Args, nullptr);
GETSET_PROPERTY(int, ResultTargetWindow, -1);
WINRT_PROPERTY(winrt::Microsoft::Terminal::Remoting::CommandlineArgs, Args, nullptr);
WINRT_PROPERTY(int, ResultTargetWindow, -1);

public:
FindTargetWindowArgs(winrt::Microsoft::Terminal::Remoting::CommandlineArgs args) :
Expand Down
4 changes: 2 additions & 2 deletions src/cascadia/Remoting/ProposeCommandlineResult.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
struct ProposeCommandlineResult : public ProposeCommandlineResultT<ProposeCommandlineResult>
{
public:
GETSET_PROPERTY(Windows::Foundation::IReference<uint64_t>, Id);
GETSET_PROPERTY(bool, ShouldCreateWindow, true);
WINRT_PROPERTY(Windows::Foundation::IReference<uint64_t>, Id);
WINRT_PROPERTY(bool, ShouldCreateWindow, true);

public:
ProposeCommandlineResult(bool shouldCreateWindow) :
Expand Down
8 changes: 4 additions & 4 deletions src/cascadia/Remoting/WindowActivatedArgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
};
struct WindowActivatedArgs : public WindowActivatedArgsT<WindowActivatedArgs>
{
GETSET_PROPERTY(uint64_t, PeasantID, 0);
GETSET_PROPERTY(winrt::guid, DesktopID, {});
GETSET_PROPERTY(winrt::Windows::Foundation::DateTime, ActivatedTime, {});
GETSET_PROPERTY(uint64_t, Hwnd, 0);
WINRT_PROPERTY(uint64_t, PeasantID, 0);
WINRT_PROPERTY(winrt::guid, DesktopID, {});
WINRT_PROPERTY(winrt::Windows::Foundation::DateTime, ActivatedTime, {});
WINRT_PROPERTY(uint64_t, Hwnd, 0);

public:
WindowActivatedArgs(uint64_t peasantID,
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/ShellExtension/PlaceholderType.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace winrt::Microsoft::Terminal::ShellExtension::implementation
struct PlaceholderType : PlaceholderTypeT<PlaceholderType>
{
PlaceholderType() = default;
GETSET_PROPERTY(int32_t, Placeholder, 42);
WINRT_PROPERTY(int32_t, Placeholder, 42);
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/ActionPaletteItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace winrt::TerminalApp::implementation
ActionPaletteItem() = default;
ActionPaletteItem(Microsoft::Terminal::Settings::Model::Command const& command);

GETSET_PROPERTY(Microsoft::Terminal::Settings::Model::Command, Command, nullptr);
WINRT_PROPERTY(Microsoft::Terminal::Settings::Model::Command, Command, nullptr);

private:
Windows::UI::Xaml::Data::INotifyPropertyChanged::PropertyChanged_revoker _commandChangedRevoker;
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/CommandLinePaletteItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace winrt::TerminalApp::implementation
CommandLinePaletteItem() = default;
CommandLinePaletteItem(winrt::hstring const& commandLine);

GETSET_PROPERTY(winrt::hstring, CommandLine);
WINRT_PROPERTY(winrt::hstring, CommandLine);
};
}

Expand Down
12 changes: 6 additions & 6 deletions src/cascadia/TerminalApp/CommandPalette.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ namespace winrt::TerminalApp::implementation
void EnableTabSearchMode();

WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, NoMatchesText, _PropertyChangedHandlers);
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, SearchBoxPlaceholderText, _PropertyChangedHandlers);
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, PrefixCharacter, _PropertyChangedHandlers);
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, ControlName, _PropertyChangedHandlers);
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, ParentCommandName, _PropertyChangedHandlers);
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, ParsedCommandLineText, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, NoMatchesText, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, SearchBoxPlaceholderText, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, PrefixCharacter, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, ControlName, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, ParentCommandName, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, ParsedCommandLineText, _PropertyChangedHandlers);

TYPED_EVENT(SwitchToTabRequested, winrt::TerminalApp::CommandPalette, winrt::TerminalApp::TabBase);
TYPED_EVENT(CommandLineExecutionRequested, winrt::TerminalApp::CommandPalette, winrt::hstring);
Expand Down
8 changes: 4 additions & 4 deletions src/cascadia/TerminalApp/FilteredCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ namespace winrt::TerminalApp::implementation
static int Compare(winrt::TerminalApp::FilteredCommand const& first, winrt::TerminalApp::FilteredCommand const& second);

WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
OBSERVABLE_GETSET_PROPERTY(winrt::TerminalApp::PaletteItem, Item, _PropertyChangedHandlers, nullptr);
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, Filter, _PropertyChangedHandlers);
OBSERVABLE_GETSET_PROPERTY(winrt::TerminalApp::HighlightedText, HighlightedName, _PropertyChangedHandlers);
OBSERVABLE_GETSET_PROPERTY(int, Weight, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::TerminalApp::PaletteItem, Item, _PropertyChangedHandlers, nullptr);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, Filter, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::TerminalApp::HighlightedText, HighlightedName, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(int, Weight, _PropertyChangedHandlers);

private:
winrt::TerminalApp::HighlightedText _computeHighlightedName();
Expand Down
6 changes: 3 additions & 3 deletions src/cascadia/TerminalApp/HighlightedText.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ namespace winrt::TerminalApp::implementation
HighlightedTextSegment(winrt::hstring const& text, bool isHighlighted);

WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, TextSegment, _PropertyChangedHandlers);
OBSERVABLE_GETSET_PROPERTY(bool, IsHighlighted, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, TextSegment, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(bool, IsHighlighted, _PropertyChangedHandlers);
};

struct HighlightedText : HighlightedTextT<HighlightedText>
Expand All @@ -27,7 +27,7 @@ namespace winrt::TerminalApp::implementation
HighlightedText(Windows::Foundation::Collections::IObservableVector<winrt::TerminalApp::HighlightedTextSegment> const& segments);

WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
OBSERVABLE_GETSET_PROPERTY(Windows::Foundation::Collections::IObservableVector<winrt::TerminalApp::HighlightedTextSegment>, Segments, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(Windows::Foundation::Collections::IObservableVector<winrt::TerminalApp::HighlightedTextSegment>, Segments, _PropertyChangedHandlers);
};
}

Expand Down
6 changes: 3 additions & 3 deletions src/cascadia/TerminalApp/PaletteItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ namespace winrt::TerminalApp::implementation
public:
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);

OBSERVABLE_GETSET_PROPERTY(winrt::hstring, Name, _PropertyChangedHandlers);
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, Icon, _PropertyChangedHandlers);
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, KeyChordText, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, Name, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, Icon, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, KeyChordText, _PropertyChangedHandlers);
};
}
6 changes: 3 additions & 3 deletions src/cascadia/TerminalApp/PaletteItemTemplateSelector.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ namespace winrt::TerminalApp::implementation
Windows::UI::Xaml::DataTemplate SelectTemplateCore(winrt::Windows::Foundation::IInspectable const&, winrt::Windows::UI::Xaml::DependencyObject const&);
Windows::UI::Xaml::DataTemplate SelectTemplateCore(winrt::Windows::Foundation::IInspectable const&);

GETSET_PROPERTY(winrt::Windows::UI::Xaml::DataTemplate, TabItemTemplate);
GETSET_PROPERTY(winrt::Windows::UI::Xaml::DataTemplate, NestedItemTemplate);
GETSET_PROPERTY(winrt::Windows::UI::Xaml::DataTemplate, GeneralItemTemplate);
WINRT_PROPERTY(winrt::Windows::UI::Xaml::DataTemplate, TabItemTemplate);
WINRT_PROPERTY(winrt::Windows::UI::Xaml::DataTemplate, NestedItemTemplate);
WINRT_PROPERTY(winrt::Windows::UI::Xaml::DataTemplate, GeneralItemTemplate);
};
}

Expand Down
14 changes: 7 additions & 7 deletions src/cascadia/TerminalApp/TabBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ namespace winrt::TerminalApp::implementation
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);

// The TabViewIndex is the index this Tab object resides in TerminalPage's _tabs vector.
GETSET_PROPERTY(uint32_t, TabViewIndex, 0);
WINRT_PROPERTY(uint32_t, TabViewIndex, 0);
// The TabViewNumTabs is the number of Tab objects in TerminalPage's _tabs vector.
GETSET_PROPERTY(uint32_t, TabViewNumTabs, 0);
WINRT_PROPERTY(uint32_t, TabViewNumTabs, 0);

OBSERVABLE_GETSET_PROPERTY(winrt::hstring, Title, _PropertyChangedHandlers);
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, Icon, _PropertyChangedHandlers);
OBSERVABLE_GETSET_PROPERTY(bool, ReadOnly, _PropertyChangedHandlers, false);
GETSET_PROPERTY(winrt::Microsoft::UI::Xaml::Controls::TabViewItem, TabViewItem, nullptr);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, Title, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, Icon, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(bool, ReadOnly, _PropertyChangedHandlers, false);
WINRT_PROPERTY(winrt::Microsoft::UI::Xaml::Controls::TabViewItem, TabViewItem, nullptr);

OBSERVABLE_GETSET_PROPERTY(winrt::Windows::UI::Xaml::FrameworkElement, Content, _PropertyChangedHandlers, nullptr);
WINRT_OBSERVABLE_PROPERTY(winrt::Windows::UI::Xaml::FrameworkElement, Content, _PropertyChangedHandlers, nullptr);

protected:
winrt::Windows::UI::Xaml::FocusState _focusState{ winrt::Windows::UI::Xaml::FocusState::Unfocused };
Expand Down
6 changes: 3 additions & 3 deletions src/cascadia/TerminalApp/TabHeaderControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ namespace winrt::TerminalApp::implementation
WINRT_CALLBACK(TitleChangeRequested, TerminalApp::TitleChangeRequestedArgs);

WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, Title, _PropertyChangedHandlers);
OBSERVABLE_GETSET_PROPERTY(double, RenamerMaxWidth, _PropertyChangedHandlers);
OBSERVABLE_GETSET_PROPERTY(winrt::TerminalApp::TerminalTabStatus, TabStatus, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, Title, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(double, RenamerMaxWidth, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::TerminalApp::TerminalTabStatus, TabStatus, _PropertyChangedHandlers);

TYPED_EVENT(RenameEnded, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);

Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/TabPaletteItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace winrt::TerminalApp::implementation
return _tab.get();
}

OBSERVABLE_GETSET_PROPERTY(winrt::TerminalApp::TerminalTabStatus, TabStatus, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::TerminalApp::TerminalTabStatus, TabStatus, _PropertyChangedHandlers);

private:
winrt::weak_ref<winrt::TerminalApp::TabBase> _tab;
Expand Down
Loading