Showing preview only (7,774K chars total). Download the full file or copy to clipboard to get everything.
Repository: FireCubeStudios/Clippy
Branch: master
Commit: 5734b6ee2e89
Files: 79
Total size: 7.4 MB
Directory structure:
gitextract_9yfi5vry/
├── .gitattributes
├── .gitignore
├── Clippy/
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── Clippy.csproj
│ ├── Controls/
│ │ ├── APIBox.xaml
│ │ ├── APIBox.xaml.cs
│ │ ├── MessageTriangle.xaml
│ │ ├── MessageTriangle.xaml.cs
│ │ ├── Messages/
│ │ │ ├── ClippyMessage.xaml
│ │ │ ├── ClippyMessage.xaml.cs
│ │ │ ├── SystemMessage.xaml
│ │ │ ├── SystemMessage.xaml.cs
│ │ │ ├── UserMessage.xaml
│ │ │ └── UserMessage.xaml.cs
│ │ ├── ShineUITextblock.xaml
│ │ └── ShineUITextblock.xaml.cs
│ ├── Helpers/
│ │ ├── ClippyInputHelper.cs
│ │ ├── ClippyKeyboardListener.cs
│ │ ├── KeyboardHelper.cs
│ │ └── MessageSelector.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── NativeMethods.txt
│ ├── Package.appxmanifest
│ ├── Properties/
│ │ └── launchSettings.json
│ ├── Services/
│ │ ├── KeyService.cs
│ │ └── SettingsService.cs
│ ├── SettingsWindow.xaml
│ ├── SettingsWindow.xaml.cs
│ ├── Windows/
│ │ ├── MicaWindow.cs
│ │ ├── TransparentBackdrop.cs
│ │ └── WindowsSystemDispatcherQueueHelper.cs
│ └── app.manifest
├── Clippy.Core/
│ ├── Classes/
│ │ └── Message.cs
│ ├── Clippy.Core.csproj
│ ├── Constants.cs
│ ├── Enums/
│ │ └── Role.cs
│ ├── Factories/
│ │ └── MessageFactory.cs
│ ├── Interfaces/
│ │ └── IMessage.cs
│ ├── Runtime/
│ │ └── IsExternalInit.cs
│ ├── Services/
│ │ ├── IChatService.cs
│ │ ├── IKeyService.cs
│ │ └── ISettingsService.cs
│ └── ViewModels/
│ ├── ClippyViewModel.cs
│ └── Messages/
│ ├── ClippyMessageViewModel.Streaming.cs
│ ├── ClippyMessageViewModel.cs
│ ├── MessageViewModel.cs
│ ├── SystemMessageViewModel.cs
│ └── UserMessageViewModel.cs
├── Clippy.sln
├── CubeKit.UI/
│ ├── Controls/
│ │ ├── Settings/
│ │ │ ├── Converters.cs
│ │ │ ├── SettingsBlockControl.xaml
│ │ │ ├── SettingsBlockControl.xaml.cs
│ │ │ ├── SettingsDisplayControl.xaml
│ │ │ └── SettingsDisplayControl.xaml.cs
│ │ └── Toolkit/
│ │ ├── DesignTimeHelpers.cs
│ │ ├── DropShadowPanel.Properties.cs
│ │ ├── DropShadowPanel.xaml
│ │ ├── DropShadowPanel.xaml.cs
│ │ └── IAlphaMaskProvider.cs
│ ├── Converters/
│ │ └── BooleanToVisibilityConverter.cs
│ ├── CubeKit.UI.csproj
│ ├── Helpers/
│ │ └── NativeHelper.cs
│ ├── Icons/
│ │ ├── FluentIconElement.cs
│ │ ├── FluentIconSource.cs
│ │ ├── FluentSymbol.cs
│ │ ├── FluentSymbolIcon.Icons.cs
│ │ └── FluentSymbolIcon.cs
│ ├── Materials/
│ │ ├── Bloom.html
│ │ ├── BloomView.xaml
│ │ └── BloomView.xaml.cs
│ ├── Styles/
│ │ ├── CubeThemeDictionary.xaml
│ │ ├── CubeUI.xaml
│ │ ├── GlowGradientUI.xaml
│ │ └── WindowChrome.xaml
│ └── Themes/
│ └── Generic.xaml
├── LICENSE.txt
└── README.md
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
================================================
FILE: .gitignore
================================================
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Oo]ut/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
/Clippy.Core/Services/ChatService.cs
/Clippy/Tray
================================================
FILE: Clippy/App.xaml
================================================
<Application
x:Class="Clippy.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Clippy"
xmlns:ToolkitControls="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:icons="using:CubeKit.UI.Icons">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<ResourceDictionary Source="ms-appx:///CubeKit.UI/Styles/GlowGradientUI.xaml" />
<!-- <ResourceDictionary Source="ms-appx:///CubeKit.UI/Styles/WindowChrome.xaml" />-->
</ResourceDictionary.MergedDictionaries>
<Style x:Key="GlowNumberBox" TargetType="NumberBox">
<Setter Property="IsTabStop" Value="False" />
<Setter Property="SelectionHighlightColor" Value="{ThemeResource TextControlSelectionHighlightColor}" />
<Setter Property="SelectionFlyout" Value="{StaticResource TextControlCommandBarSelectionFlyout}" />
<Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
<Setter Property="BorderBrush" Value="{ThemeResource TextControlBorderBrush}" />
<Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}" />
<Setter Property="Padding" Value="{ThemeResource TextControlThemePadding}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="NumberBox">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Target="HeaderContentPresenter.Foreground" Value="{ThemeResource TextControlHeaderForegroundDisabled}"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="SpinButtonStates">
<VisualState x:Name="SpinButtonsCollapsed" />
<VisualState x:Name="SpinButtonsVisible">
<VisualState.Setters>
<Setter Target="DownSpinButton.Visibility" Value="Visible" />
<Setter Target="UpSpinButton.Visibility" Value="Visible" />
<Setter Target="InputBox.CornerRadius" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CornerRadius, Converter={StaticResource LeftCornerRadiusFilterConverter}}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="SpinButtonsPopup">
<VisualState.Setters>
<Setter Target="InputBox.Style" Value="{ThemeResource GlowTextBox}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="UpSpinButtonEnabledStates">
<VisualState x:Name="UpSpinButtonEnabled" />
<VisualState x:Name="UpSpinButtonDisabled">
<VisualState.Setters>
<Setter Target="UpSpinButton.IsEnabled" Value="False" />
<Setter Target="PopupUpSpinButton.IsEnabled" Value="False" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="DownSpinButtonEnabledStates">
<VisualState x:Name="DownSpinButtonEnabled" />
<VisualState x:Name="DownSpinButtonDisabled">
<VisualState.Setters>
<Setter Target="DownSpinButton.IsEnabled" Value="False" />
<Setter Target="PopupDownSpinButton.IsEnabled" Value="False" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<StaticResource x:Key="RepeatButtonBorderBrushPointerOver" ResourceKey="TextControlBorderBrush"/>
<StaticResource x:Key="RepeatButtonBorderBrushPressed" ResourceKey="TextControlBorderBrush"/>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<StaticResource x:Key="RepeatButtonBorderBrushPointerOver" ResourceKey="TextControlBorderBrush"/>
<StaticResource x:Key="RepeatButtonBorderBrushPressed" ResourceKey="TextControlBorderBrush"/>
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<StaticResource x:Key="RepeatButtonBorderBrushPointerOver" ResourceKey="SystemControlHighlightBaseMediumLowBrush" />
<StaticResource x:Key="RepeatButtonBorderBrushPressed" ResourceKey="SystemControlHighlightTransparentBrush" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ContentPresenter x:Name="HeaderContentPresenter"
Grid.ColumnSpan="3"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
FontWeight="Normal"
Foreground="{ThemeResource TextControlHeaderForeground}"
Margin="{ThemeResource TextBoxTopHeaderMargin}"
FontSize="{TemplateBinding FontSize}"
FontFamily="{TemplateBinding FontFamily}"
TextWrapping="Wrap"
VerticalAlignment="Top"
Visibility="Collapsed"
x:DeferLoadStrategy="Lazy" />
<TextBox x:Name="InputBox"
Grid.Row="1" Width="108"
Style="{ThemeResource GlowTextBox}"
InputScope="{TemplateBinding InputScope}"
PlaceholderText="{TemplateBinding PlaceholderText}"
PreventKeyboardDisplayOnProgrammaticFocus="{TemplateBinding PreventKeyboardDisplayOnProgrammaticFocus}"
CornerRadius="4" />
<Popup x:Name="UpDownPopup"
Grid.Row="1" Visibility="Collapsed"
Grid.Column="1"
VerticalOffset="{ThemeResource NumberBoxPopupVerticalOffset}"
HorizontalOffset="{ThemeResource NumberBoxPopupHorizonalOffset}"
ShouldConstrainToRootBounds="False"
HorizontalAlignment="Left">
<Grid x:Name="PopupContentRoot"
Background="{ThemeResource NumberBoxPopupBackground}"
BorderBrush="{ThemeResource NumberBoxPopupBorderBrush}"
BorderThickness="{ThemeResource NumberBoxPopupBorderThickness}"
CornerRadius="{ThemeResource OverlayCornerRadius}">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<RepeatButton x:Name="PopupUpSpinButton"
Style="{StaticResource NumberBoxPopupSpinButtonStyle}"
Content=""/>
<RepeatButton x:Name="PopupDownSpinButton"
Style="{StaticResource NumberBoxPopupSpinButtonStyle}"
Grid.Row="1"
Content=""/>
</Grid>
</Popup>
<RepeatButton x:Name="UpSpinButton"
Grid.Row="1"
Grid.Column="1"
Visibility="Collapsed" CornerRadius="4" Height="24"
Style="{ThemeResource UpToolbarRepeatButton}"/>
<RepeatButton x:Name="DownSpinButton"
Grid.Row="1"
Grid.Column="2"
Visibility="Collapsed" CornerRadius="4" Height="24"
Style="{ThemeResource DownToolbarRepeatButton}"/>
<ContentPresenter x:Name="DescriptionPresenter"
Grid.Row="2"
Grid.ColumnSpan="3"
Content="{TemplateBinding Description}"
Foreground="{ThemeResource SystemControlDescriptionTextForegroundBrush}"
AutomationProperties.AccessibilityView="Raw"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Name="NumberBoxSpinButtonStyle" TargetType="RepeatButton" BasedOn="{StaticResource DefaultRepeatButtonStyle}">
<Style.Setters>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="MinWidth" Value="34"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="Background" Value="{ThemeResource TextControlBackground}"/>
<Setter Property="BorderBrush" Value="{ThemeResource TextControlBorderBrush}"/>
<Setter Property="BorderThickness" Value="{ThemeResource NumberBoxSpinButtonBorderThickness}"/>
<Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}"/>
</Style.Setters>
</Style>
<Style x:Name="NumberBoxPopupSpinButtonStyle" TargetType="RepeatButton">
<Style.Setters>
<Setter Property="AutomationProperties.AccessibilityView" Value="Raw"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="Width" Value="40"/>
<Setter Property="Background" Value="{ThemeResource NumberBoxPopupSpinButtonBackground}"/>
<Setter Property="BorderThickness" Value="{ThemeResource NumberBoxPopupSpinButtonBorderThickness}"/>
<Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}"/>
</Style.Setters>
</Style>
<Style x:Key="ToolbarRepeatButton" TargetType="RepeatButton">
<Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="Foreground" Value="{ThemeResource ToggleButtonForeground}" />
<Setter Property="BorderBrush" Value="{ThemeResource ToggleButtonBorderBrush}" />
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="CornerRadius" Value="4"/>
<Setter Property="Padding" Value="{StaticResource ButtonPadding}" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
<Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" />
<Setter Property="FocusVisualMargin" Value="-3" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RepeatButton">
<Grid x:Name="RootGrid" Background="{TemplateBinding Background}" CornerRadius="{TemplateBinding CornerRadius}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" >
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Width" EnableDependentAnimation="True" Duration="0:0:0.12" To="0"/>
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Target="RootGrid.Background" Value="{ThemeResource ToggleButtonBackgroundPointerOver}" />
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource RepeatButtonForegroundPointerOver}" />
</VisualState.Setters>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Width" EnableDependentAnimation="True" Duration="0:0:0.12" To="12"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<VisualState.Setters>
<Setter Target="RootGrid.Background" Value="{ThemeResource ToggleButtonBackgroundPressed}" />
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource RepeatButtonForegroundPressed}" />
</VisualState.Setters>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Width" RepeatBehavior="Forever" EnableDependentAnimation="True" Duration="0:0:0.12" From="0" To="12"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Target="RootGrid.Background" Value="{ThemeResource RepeatButtonRevealBackgroundDisabled}" />
<Setter Target="ContentPresenter.BorderBrush" Value="{ThemeResource RepeatButtonRevealBorderBrushDisabled}" />
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource RepeatButtonForegroundDisabled}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentPresenter x:Name="ContentPresenter" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" Content="{TemplateBinding Content}" ContentTransitions="{TemplateBinding ContentTransitions}" ContentTemplate="{TemplateBinding ContentTemplate}" Padding="{TemplateBinding Padding}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" AutomationProperties.AccessibilityView="Raw" />
<ToolkitControls:DropShadowPanel CornerRadius="2" Margin="2,0,2,2" x:Name="Glow" Color="{ThemeResource SystemAccentColorLight2}" ShadowOpacity="0.93" Grid.Row="0" VerticalAlignment="Bottom"
HorizontalAlignment="Center">
<Grid x:Name="Pipe"
Height="2" Width="0.1" CornerRadius="2"
VerticalAlignment="Bottom"
HorizontalAlignment="Center">
<Grid.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
<GradientStop Color="{ThemeResource SystemAccentColorLight3}" Offset="0.0" />
<GradientStop Color="{ThemeResource SystemAccentColorLight2}" Offset="0.5" />
<GradientStop Color="{ThemeResource SystemAccentColorLight3}" Offset="1.0" />
</LinearGradientBrush>
</Grid.Background>
</Grid>
</ToolkitControls:DropShadowPanel>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="RefreshButton" TargetType="Button">
<Setter Property="Foreground" Value="{ThemeResource SplitButtonForeground}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="{ThemeResource SplitButtonBorderThemeThickness}" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
<Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" />
<Setter Property="FocusVisualMargin" Value="-3" />
<Setter Property="CornerRadius" Value="4"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid x:Name="RootGrid" Background="{TemplateBinding Background}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Width" EnableDependentAnimation="True" Duration="0:0:0.12" To="0">
</DoubleAnimation>
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBackgroundPointerOver}" />
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Width" EnableDependentAnimation="True" Duration="0:0:0.12" To="12">
</DoubleAnimation>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBackgroundPressed}" />
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Width" EnableDependentAnimation="True" Duration="0:0:0.12" To="0">
</DoubleAnimation>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SplitButtonForegroundDisabled}"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentPresenter x:Name="ContentPresenter"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}"
ContentTransitions="{TemplateBinding ContentTransitions}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Padding="{TemplateBinding Padding}"
CornerRadius="4"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
AutomationProperties.AccessibilityView="Raw"/>
<icons:FluentSymbolIcon Symbol="ArrowClockwise20" RenderTransformOrigin="0.5,0.5" Foreground="{ThemeResource SystemAccentColorLight2}">
<icons:FluentSymbolIcon.RenderTransform>
<RotateTransform x:Name="Refresh" Angle="0"/>
</icons:FluentSymbolIcon.RenderTransform>
</icons:FluentSymbolIcon>
<ToolkitControls:DropShadowPanel CornerRadius="2" Margin="2,0,2,2" x:Name="Glow" Color="{ThemeResource SystemAccentColorLight2}" ShadowOpacity="0.93" Grid.Row="0" VerticalAlignment="Bottom"
HorizontalAlignment="Center">
<Grid x:Name="Pipe"
Height="2" Width="0.1" CornerRadius="2"
VerticalAlignment="Bottom"
HorizontalAlignment="Center">
<Grid.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
<GradientStop Color="{ThemeResource SystemAccentColorLight3}" Offset="0.0" />
<GradientStop Color="{ThemeResource SystemAccentColorLight2}" Offset="0.5" />
<GradientStop Color="{ThemeResource SystemAccentColorLight3}" Offset="1.0" />
</LinearGradientBrush>
</Grid.Background>
</Grid>
</ToolkitControls:DropShadowPanel>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ClippyToggleButton" TargetType="ToggleButton">
<Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="Foreground" Value="{ThemeResource ToggleButtonForeground}" />
<Setter Property="BorderBrush" Value="{ThemeResource ToggleButtonBorderBrush}" />
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="CornerRadius" Value="4"/>
<Setter Property="Padding" Value="{StaticResource ButtonPadding}" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
<Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" />
<Setter Property="FocusVisualMargin" Value="-3" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Grid x:Name="RootGrid" Background="Transparent" CornerRadius="4">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<Storyboard>
<PointerUpThemeAnimation Storyboard.TargetName="ContentPresenter" />
<DoubleAnimation Storyboard.TargetName="ScaleA" Storyboard.TargetProperty="ScaleX" EnableDependentAnimation="True" Duration="0:0:0.12" To="0.9"/>
<DoubleAnimation Storyboard.TargetName="ScaleA" Storyboard.TargetProperty="ScaleY" EnableDependentAnimation="True" Duration="0:0:0.12" To="0.9"/>
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Width" EnableDependentAnimation="True" Duration="0:0:0.12" To="0"/>
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Height" EnableDependentAnimation="True" Duration="0:0:0.12" To="0"/>
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOver">
<Storyboard>
<PointerUpThemeAnimation Storyboard.TargetName="ContentPresenter" />
<DoubleAnimation Storyboard.TargetName="ScaleA" Storyboard.TargetProperty="ScaleX" EnableDependentAnimation="True" Duration="0:0:0.12" To="1"/>
<DoubleAnimation Storyboard.TargetName="ScaleA" Storyboard.TargetProperty="ScaleY" EnableDependentAnimation="True" Duration="0:0:0.12" To="1"/>
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Width" EnableDependentAnimation="True" Duration="0:0:0.12" To="7"/>
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Height" EnableDependentAnimation="True" Duration="0:0:0.12" To="7"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="ScaleA" Storyboard.TargetProperty="ScaleX" EnableDependentAnimation="True" Duration="0:0:0.12" To="0.85"/>
<DoubleAnimation Storyboard.TargetName="ScaleA" Storyboard.TargetProperty="ScaleY" EnableDependentAnimation="True" Duration="0:0:0.12" To="0.85"/>
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Width" EnableDependentAnimation="True" Duration="0:0:0.12" To="4"/>
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Height" EnableDependentAnimation="True" Duration="0:0:0.12" To="4"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBackgroundDisabled}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonForegroundDisabled}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBorderBrushDisabled}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Checked">
<Storyboard>
<PointerUpThemeAnimation Storyboard.TargetName="ContentPresenter" />
<DoubleAnimation Storyboard.TargetName="ScaleA" Storyboard.TargetProperty="ScaleX" EnableDependentAnimation="True" Duration="0:0:0.12" To="0.9"/>
<DoubleAnimation Storyboard.TargetName="ScaleA" Storyboard.TargetProperty="ScaleY" EnableDependentAnimation="True" Duration="0:0:0.12" To="0.9"/>
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Width" EnableDependentAnimation="True" Duration="0:0:0.12" To="7"/>
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Height" EnableDependentAnimation="True" Duration="0:0:0.12" To="7"/>
</Storyboard>
</VisualState>
<VisualState x:Name="CheckedPointerOver">
<Storyboard>
<PointerUpThemeAnimation Storyboard.TargetName="ContentPresenter" />
<DoubleAnimation Storyboard.TargetName="ScaleA" Storyboard.TargetProperty="ScaleX" EnableDependentAnimation="True" Duration="0:0:0.12" To="1"/>
<DoubleAnimation Storyboard.TargetName="ScaleA" Storyboard.TargetProperty="ScaleY" EnableDependentAnimation="True" Duration="0:0:0.12" To="1"/>
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Width" EnableDependentAnimation="True" Duration="0:0:0.12" To="10"/>
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Height" EnableDependentAnimation="True" Duration="0:0:0.12" To="10"/>
</Storyboard>
</VisualState>
<VisualState x:Name="CheckedPressed">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="ScaleA" Storyboard.TargetProperty="ScaleX" EnableDependentAnimation="True" Duration="0:0:0.12" To="0.85"/>
<DoubleAnimation Storyboard.TargetName="ScaleA" Storyboard.TargetProperty="ScaleY" EnableDependentAnimation="True" Duration="0:0:0.12" To="0.85"/>
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Width" EnableDependentAnimation="True" Duration="0:0:0.12" To="4"/>
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Height" EnableDependentAnimation="True" Duration="0:0:0.12" To="4"/>
</Storyboard>
</VisualState>
<VisualState x:Name="CheckedDisabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBackgroundCheckedDisabled}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonForegroundCheckedDisabled}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBorderBrushCheckedDisabled}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Indeterminate">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBackgroundIndeterminate}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonForegroundIndeterminate}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBorderBrushIndeterminate}" />
</ObjectAnimationUsingKeyFrames>
<PointerUpThemeAnimation Storyboard.TargetName="ContentPresenter" />
</Storyboard>
</VisualState>
<VisualState x:Name="IndeterminatePointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBackgroundIndeterminatePointerOver}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBorderBrushIndeterminatePointerOver}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonForegroundIndeterminatePointerOver}" />
</ObjectAnimationUsingKeyFrames>
<PointerUpThemeAnimation Storyboard.TargetName="ContentPresenter" />
</Storyboard>
</VisualState>
<VisualState x:Name="IndeterminatePressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBackgroundIndeterminatePressed}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBorderBrushIndeterminatePressed}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonForegroundIndeterminatePressed}" />
</ObjectAnimationUsingKeyFrames>
<PointerDownThemeAnimation Storyboard.TargetName="ContentPresenter" />
</Storyboard>
</VisualState>
<VisualState x:Name="IndeterminateDisabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBackgroundIndeterminateDisabled}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonForegroundIndeterminateDisabled}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBorderBrushIndeterminateDisabled}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentPresenter x:Name="ContentPresenter"
Background="{TemplateBinding Background}"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}"
CornerRadius="{TemplateBinding CornerRadius}"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Margin="0, 0, 0, 2" RenderTransformOrigin="0.5, 0.5"
AutomationProperties.AccessibilityView="Raw">
<ContentPresenter.RenderTransform>
<ScaleTransform x:Name="ScaleA"/>
</ContentPresenter.RenderTransform>
</ContentPresenter>
<ToolkitControls:DropShadowPanel CornerRadius="2" Margin="6" x:Name="Glow" Color="{ThemeResource SystemAccentColorLight2}" ShadowOpacity="0.93" VerticalAlignment="Bottom"
HorizontalAlignment="Right">
<Grid x:Name="Pipe"
Height="2" Width="2" CornerRadius="50"
VerticalAlignment="Bottom"
HorizontalAlignment="Center">
<Grid.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
<GradientStop Color="{ThemeResource SystemAccentColorLight3}" Offset="0.0" />
<GradientStop Color="{ThemeResource SystemAccentColorLight2}" Offset="0.5" />
<GradientStop Color="{ThemeResource SystemAccentColorLight3}" Offset="1.0" />
</LinearGradientBrush>
</Grid.Background>
</Grid>
</ToolkitControls:DropShadowPanel>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="PinToggleButton" TargetType="ToggleButton">
<Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="Foreground" Value="{ThemeResource ToggleButtonForeground}" />
<Setter Property="BorderBrush" Value="{ThemeResource ToggleButtonBorderBrush}" />
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="CornerRadius" Value="4"/>
<Setter Property="Padding" Value="{StaticResource ButtonPadding}" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
<Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" />
<Setter Property="FocusVisualMargin" Value="-3" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Grid x:Name="RootGrid" Background="Transparent" CornerRadius="4">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Target="Pin.Symbol" Value="Pin20"/>
</VisualState.Setters>
<Storyboard>
<PointerUpThemeAnimation Storyboard.TargetName="ContentPresenter" />
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Width" EnableDependentAnimation="True" Duration="0:0:0.12" To="0">
</DoubleAnimation>
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Target="Pin.Symbol" Value="Pin20"/>
</VisualState.Setters>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBackgroundPointerOver}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBorderBrushPointerOver}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonForegroundPointerOver}" />
</ObjectAnimationUsingKeyFrames>
<PointerUpThemeAnimation Storyboard.TargetName="ContentPresenter" />
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Width" EnableDependentAnimation="True" Duration="0:0:0.12" To="12">
</DoubleAnimation>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<VisualState.Setters>
<Setter Target="Pin.Symbol" Value="Pin20"/>
</VisualState.Setters>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBackgroundPressed}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBorderBrushPressed}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonForegroundPressed}" />
</ObjectAnimationUsingKeyFrames>
<PointerDownThemeAnimation Storyboard.TargetName="ContentPresenter" />
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Width" EnableDependentAnimation="True" Duration="0:0:0.12" To="8">
</DoubleAnimation>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBackgroundDisabled}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonForegroundDisabled}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBorderBrushDisabled}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Checked">
<VisualState.Setters>
<Setter Target="Pin.Symbol" Value="Pin20Filled"/>
</VisualState.Setters>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonForegroundChecked}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBorderBrushChecked}" />
</ObjectAnimationUsingKeyFrames>
<PointerUpThemeAnimation Storyboard.TargetName="ContentPresenter" />
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Width" EnableDependentAnimation="True" Duration="0:0:0.12" To="28">
</DoubleAnimation>
</Storyboard>
</VisualState>
<VisualState x:Name="CheckedPointerOver">
<VisualState.Setters>
<Setter Target="Pin.Symbol" Value="Pin20Filled"/>
</VisualState.Setters>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBackgroundPointerOver}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBorderBrushCheckedPointerOver}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonForegroundCheckedPointerOver}" />
</ObjectAnimationUsingKeyFrames>
<PointerUpThemeAnimation Storyboard.TargetName="ContentPresenter" />
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Width" EnableDependentAnimation="True" Duration="0:0:0.12" To="32">
</DoubleAnimation>
</Storyboard>
</VisualState>
<VisualState x:Name="CheckedPressed">
<VisualState.Setters>
<Setter Target="Pin.Symbol" Value="Pin20Filled"/>
</VisualState.Setters>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBackgroundPressed}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonForegroundCheckedPressed}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBorderBrushCheckedPressed}" />
</ObjectAnimationUsingKeyFrames>
<PointerDownThemeAnimation Storyboard.TargetName="ContentPresenter" />
<DoubleAnimation Storyboard.TargetName="Pipe" Storyboard.TargetProperty="Width" EnableDependentAnimation="True" Duration="0:0:0.12" To="24">
</DoubleAnimation>
</Storyboard>
</VisualState>
<VisualState x:Name="CheckedDisabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBackgroundCheckedDisabled}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonForegroundCheckedDisabled}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBorderBrushCheckedDisabled}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Indeterminate">
<VisualState.Setters>
<Setter Target="Pin.Symbol" Value="Pin20"/>
</VisualState.Setters>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBackgroundIndeterminate}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonForegroundIndeterminate}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBorderBrushIndeterminate}" />
</ObjectAnimationUsingKeyFrames>
<PointerUpThemeAnimation Storyboard.TargetName="ContentPresenter" />
</Storyboard>
</VisualState>
<VisualState x:Name="IndeterminatePointerOver">
<VisualState.Setters>
<Setter Target="Pin.Symbol" Value="Pin20"/>
</VisualState.Setters>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBackgroundIndeterminatePointerOver}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBorderBrushIndeterminatePointerOver}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonForegroundIndeterminatePointerOver}" />
</ObjectAnimationUsingKeyFrames>
<PointerUpThemeAnimation Storyboard.TargetName="ContentPresenter" />
</Storyboard>
</VisualState>
<VisualState x:Name="IndeterminatePressed">
<VisualState.Setters>
<Setter Target="Pin.Symbol" Value="Pin20"/>
</VisualState.Setters>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBackgroundIndeterminatePressed}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBorderBrushIndeterminatePressed}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonForegroundIndeterminatePressed}" />
</ObjectAnimationUsingKeyFrames>
<PointerDownThemeAnimation Storyboard.TargetName="ContentPresenter" />
</Storyboard>
</VisualState>
<VisualState x:Name="IndeterminateDisabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBackgroundIndeterminateDisabled}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonForegroundIndeterminateDisabled}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleButtonBorderBrushIndeterminateDisabled}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentPresenter x:Name="ContentPresenter"
Background="{TemplateBinding Background}"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}"
CornerRadius="{TemplateBinding CornerRadius}"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Margin="0, 0, 0, 2"
AutomationProperties.AccessibilityView="Raw">
</ContentPresenter>
<icons:FluentSymbolIcon x:Name="Pin" Symbol="Pin20" Margin="0, 0, 0, 2" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{ThemeResource SystemAccentColorLight2}"/>
<ToolkitControls:DropShadowPanel CornerRadius="2" Margin="2,0,2,2" x:Name="Glow" Color="{ThemeResource SystemAccentColorLight2}" ShadowOpacity="0.93" Grid.Row="0" VerticalAlignment="Bottom"
HorizontalAlignment="Center">
<Grid x:Name="Pipe"
Height="2" Width="0.1" CornerRadius="2"
VerticalAlignment="Bottom"
HorizontalAlignment="Center">
<Grid.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
<GradientStop Color="{ThemeResource SystemAccentColorLight3}" Offset="0.0" />
<GradientStop Color="{ThemeResource SystemAccentColorLight2}" Offset="0.5" />
<GradientStop Color="{ThemeResource SystemAccentColorLight3}" Offset="1.0" />
</LinearGradientBrush>
</Grid.Background>
</Grid>
</ToolkitControls:DropShadowPanel>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>
================================================
FILE: Clippy/App.xaml.cs
================================================
using Microsoft.Extensions.DependencyInjection;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using Microsoft.UI.Xaml.Shapes;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Clippy.Core.ViewModels;
using Clippy.Core.Services;
using Clippy.Services;
using System.Threading.Tasks;
using System.Runtime.ExceptionServices;
using WinUIEx;
using Clippy.Tray;
using System.Threading;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace Clippy
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
public partial class App : Application
{
private const string MutexID = "Clippy2025Mutex";
private static Mutex? SingleInstanceMutex;
/// <summary>
/// Gets the current <see cref="App"/> instance in use
/// </summary>
public new static App Current => (App)Application.Current;
/// <summary>
/// Gets the <see cref="IServiceProvider"/> instance to resolve application services.
/// </summary>
public IServiceProvider Services { get; }
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
Services = ConfigureServices();
this.InitializeComponent();
UnhandledException += OnUnhandledException;
TaskScheduler.UnobservedTaskException += OnUnobservedException;
AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException;
CheckSingleInstance();
}
private void CheckSingleInstance()
{
bool isNewInstance;
SingleInstanceMutex = new Mutex(true, MutexID, out isNewInstance);
if (!isNewInstance)
System.Environment.Exit(0);
}
private static IServiceProvider ConfigureServices()
{
var services = new ServiceCollection();
services.AddSingleton<IChatService, ChatService>();
services.AddSingleton<IKeyService, KeyService>();
services.AddSingleton<ISettingsService, SettingsService>();
services.AddSingleton<ClippyViewModel>();
return services.BuildServiceProvider();
}
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="args">Details about the launch request and process.</param>
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
{
if (AppInstance.GetActivatedEventArgs().Kind != ActivationKind.StartupTask)
{
ShowClippy();
}
TrayWindow = new TrayFlyoutWindow();
}
public void ShowClippy()
{
if (m_window is null)
m_window = new MainWindow();
m_window.Activate();
m_window.Show();
}
public void OpenSettings()
{
if (s_window is null)
s_window = new SettingsWindow();
s_window.Activate();
s_window.Closed += (sender, e) => { s_window = null; };
}
private MainWindow m_window;
private Window s_window;
private TrayFlyoutWindow TrayWindow;
private static void OnUnobservedException(object? sender, UnobservedTaskExceptionEventArgs e) => e.SetObserved();
private static void OnUnhandledException(object? sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e) => e.Handled = true;
private void CurrentDomain_FirstChanceException(object? sender, FirstChanceExceptionEventArgs e)
{
}
}
}
================================================
FILE: Clippy/Clippy.csproj
================================================
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net9.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion>10.0.18362.0</SupportedOSPlatformVersion>
<RootNamespace>Clippy</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;arm64</Platforms>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
<PackageCertificateThumbprint>3E4148A36277D5E342AEAE4759BDF4C13A5E8EBA</PackageCertificateThumbprint>
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
<AppxPackageDir>D:\Repos\Clippy\Clippy\AppPackagesSideloading\</AppxPackageDir>
<AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppxBundle>Always</AppxBundle>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
<GenerateTemporaryStoreCertificate>True</GenerateTemporaryStoreCertificate>
<AppxBundlePlatforms>x86|x64|arm64</AppxBundlePlatforms>
</PropertyGroup>
<ItemGroup>
<Compile Remove="AppPackagesSideloading\**" />
<EmbeddedResource Remove="AppPackagesSideloading\**" />
<None Remove="AppPackagesSideloading\**" />
<Page Remove="AppPackagesSideloading\**" />
</ItemGroup>
<ItemGroup>
<Content Remove="Assets\Clippy\Clippy.png" />
</ItemGroup>
<ItemGroup>
<None Remove="Controls\APIBox.xaml" />
<None Remove="Controls\ClippyMessage.xaml" />
<None Remove="Controls\Messages\SystemMessage.xaml" />
<None Remove="Controls\MessageTriangle.xaml" />
<None Remove="Controls\ShineUITextblock.xaml" />
<None Remove="Controls\UserMessage.xaml" />
<None Remove="NativeMethods.txt" />
<None Remove="SettingsWindow.xaml" />
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="NativeMethods.txt" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\SplashScreen.scale-200.png" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
<Content Include="Assets\Square150x150Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Labs.WinUI.Shimmer" Version="0.1.250811-build.2202" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="CommunityToolkit.WinUI.UI.Behaviors" Version="7.1.2" />
<PackageReference Include="CommunityToolkit.WinUI.UI.Controls.Markdown" Version="7.1.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.8" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.183">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.2.0" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.4948" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.250602001" />
<PackageReference Include="TerraFX.Interop.Windows" Version="10.0.26100.2" />
<PackageReference Include="WindowsInput" Version="6.4.1" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
<!-- Defining the "Msix" ProjectCapability here allows the Single-project MSIX Packaging
Tools extension to be activated for this project even if the Windows App SDK Nuget
package has not yet been restored -->
<ItemGroup Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnablePreviewMsixTooling)'=='true'">
<ProjectCapability Include="Msix" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Clippy.Core\Clippy.Core.csproj" />
<ProjectReference Include="..\CubeKit.UI\CubeKit.UI.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="Assets\Clippy\Clippy.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<Page Update="Controls\Messages\SystemMessage.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Update="Controls\APIBox.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Update="Controls\ShineUITextblock.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Update="SettingsWindow.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Update="Controls\MessageTriangle.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Update="Controls\UserMessage.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Update="Controls\ClippyMessage.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Folder Include="Assets\OOBE\" />
<Folder Include="Tray\" />
</ItemGroup>
<ItemGroup>
<PRIResource Remove="AppPackagesSideloading\**" />
</ItemGroup>
<ItemGroup>
<Content Update="Assets\Clippy\Clippy.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>
================================================
FILE: Clippy/Controls/APIBox.xaml
================================================
<UserControl
x:Class="Clippy.Controls.APIBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Clippy.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Icons="using:CubeKit.UI.Icons"
xmlns:toolkit="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:ani="using:CommunityToolkit.WinUI.UI.Animations"
xmlns:interactions="using:Microsoft.Xaml.Interactions.Core"
xmlns:behaviors="using:CommunityToolkit.WinUI.UI.Behaviors"
mc:Ignorable="d">
<UserControl.Resources>
<LinearGradientBrush x:Name="AccentLinearGradientBrush" x:Key="AccentLinearGradientBrush" StartPoint="0,0" EndPoint="1,0">
<GradientStop Color="{ThemeResource SystemAccentColorLight1}" Offset="0.0" />
<GradientStop Color="{ThemeResource SystemAccentColorLight2}" Offset="0.5" />
<GradientStop Color="{ThemeResource SystemAccentColorLight3}" Offset="1.0" />
</LinearGradientBrush>
<LinearGradientBrush x:Name="RedLinearGradientBrush" StartPoint="0,0" EndPoint="1,0">
<GradientStop Color="DarkRed" Offset="0.0" />
<GradientStop Color="Red" Offset="0.5" />
<GradientStop Color="#e96e60" Offset="1.0" />
</LinearGradientBrush>
<LinearGradientBrush x:Name="GreenLinearGradientBrush" StartPoint="0,0" EndPoint="1,0">
<GradientStop Color="DarkGreen" Offset="0.0" />
<GradientStop Color="Green" Offset="0.5" />
<GradientStop Color="LightGreen" Offset="1.0" />
</LinearGradientBrush>
<Style x:Key="KeyGlowPasswordBoxStyle" TargetType="PasswordBox">
<Setter Property="Foreground" Value="{ThemeResource AccentLinearGradientBrush}" />
<Setter Property="Background" Value="{ThemeResource SortHvidBrush}" />
<Setter Property="BorderBrush" Value="{ThemeResource TextControlBorderBrush}" />
<Setter Property="BorderBrush" Value="{ThemeResource TextControlBorderBrush}" />
<Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}" />
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto" />
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
<Setter Property="Padding" Value="{ThemeResource TextControlThemePadding}" />
<Setter Property="ContextFlyout" Value="{StaticResource TextControlCommandBarContextFlyout}" />
<Setter Property="SelectionFlyout" Value="{StaticResource TextControlCommandBarSelectionFlyout}" />
<Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="PasswordBox">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlHeaderForegroundDisabled}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackgroundDisabled}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrushDisabled}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForegroundDisabled}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderThickness">
<DiscreteObjectKeyFrame KeyTime="0" Value="0" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlPlaceholderForegroundDisabled}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Target="Shadow.ShadowOpacity" Value="0"/>
</VisualState.Setters>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderThickness">
<DiscreteObjectKeyFrame KeyTime="0" Value="0" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForeground}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrushPointerOver}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderThickness">
<DiscreteObjectKeyFrame KeyTime="0" Value="0" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SortHvidBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlPlaceholderForegroundPointerOver}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForegroundPointerOver}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Focused">
<VisualState.Setters>
<Setter Target="Shadow.ShadowOpacity" Value="0.43"/>
</VisualState.Setters>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="BottomBar" Duration="0:0:0.15" Storyboard.TargetProperty="ScaleX" EnableDependentAnimation="True" To="1"/>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlPlaceholderForegroundFocused}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderThickness">
<DiscreteObjectKeyFrame KeyTime="0" Value="0" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SortHvidBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrushFocused}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForegroundFocused}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<VisualState.Setters>
<Setter Target="Shadow.ShadowOpacity" Value="0.43"/>
</VisualState.Setters>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderThickness">
<DiscreteObjectKeyFrame KeyTime="0" Value="0" />
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation Storyboard.TargetName="BottomBar" Duration="0:0:5" Storyboard.TargetProperty="ScaleX" EnableDependentAnimation="True" To="1"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="ButtonStates">
<VisualState x:Name="ButtonVisible">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RevealButton" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="ButtonCollapsed" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ContentPresenter x:Name="HeaderContentPresenter"
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="2"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
FontWeight="Normal"
Foreground="{ThemeResource TextControlHeaderForeground}"
Margin="{ThemeResource PasswordBoxTopHeaderMargin}"
TextWrapping="Wrap"
VerticalAlignment="Top"
Visibility="Collapsed"
x:DeferLoadStrategy="Lazy" />
<Border x:Name="BorderElement"
Grid.Row="1"
Grid.Column="0"
Grid.RowSpan="1"
Grid.ColumnSpan="2"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
MinWidth="{ThemeResource TextControlThemeMinWidth}"
MinHeight="{ThemeResource TextControlThemeMinHeight}"/>
<toolkit:DropShadowPanel x:Name="Shadow" BlurRadius="16.0" ShadowOpacity="0.43" IsMasked="True" Grid.Row="1"
OffsetX="0.0" OffsetY="0.0" VerticalAlignment="Bottom" Color="{ThemeResource SystemAccentColorLight2}">
<Grid VerticalAlignment="Bottom" Margin="0, 0, 0, 0" Width="{TemplateBinding Width}"
Height="2" CornerRadius="0, 0, 4, 4" Background="{TemplateBinding Foreground}">
<Grid.RenderTransform>
<ScaleTransform x:Name="BottomBar" ScaleX="0"/>
</Grid.RenderTransform>
</Grid>
</toolkit:DropShadowPanel>
<ScrollViewer x:Name="ContentElement"
Grid.Row="1"
Grid.Column="0"
HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
Margin="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"
IsTabStop="False"
ZoomMode="Disabled"
AutomationProperties.AccessibilityView="Raw" />
<TextBlock x:Name="PlaceholderTextContentPresenter"
Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="2"
Foreground="{ThemeResource TextControlPlaceholderForeground}"
Margin="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"
Text="{TemplateBinding PlaceholderText}"
IsHitTestVisible="False" />
<ToggleButton x:Name="RevealButton"
Grid.Row="1"
Grid.Column="0"
Canvas.ZIndex="3"
HorizontalAlignment="Right"
Style="{StaticResource ToolbarToggleButton}"
CornerRadius="{TemplateBinding CornerRadius}"
Padding="{ThemeResource HelperButtonThemePadding}"
Visibility="Collapsed"
FontSize="{TemplateBinding FontSize}"
VerticalAlignment="Top"
Width="30" Height="28">
<Icons:FluentSymbolIcon Symbol="EyeShow16" Margin="0, 0, 2, 0"/>
</ToggleButton>
<ContentPresenter x:Name="DescriptionPresenter"
Grid.Row="2"
Grid.Column="0"
Grid.ColumnSpan="2"
Content="{TemplateBinding Description}"
Foreground="{ThemeResource SystemControlDescriptionTextForegroundBrush}"
AutomationProperties.AccessibilityView="Raw"
x:Load="False"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<StackPanel Orientation="Horizontal" Spacing="12">
<toolkit:DropShadowPanel ShadowOpacity="0.4" OffsetX="4" CornerRadius="8" Margin="0, 12, 0, 16" OffsetY="4">
<PasswordBox x:Name="KeyBox" Width="340" PasswordRevealMode="{x:Bind PrivacyToPassword(PasswordVisbility.IsChecked), Mode=OneWay}" PlaceholderText="Enter your OpenAI Api key here..." KeyDown="ApiBox_KeyDown" Style="{ThemeResource KeyGlowPasswordBoxStyle}">
<ani:Explicit.Animations>
<ani:AnimationSet x:Name="PasswordLoadAnimation" IsSequential="True">
<ani:OffsetAnimation From="0" To="8,0,0" Duration="0:0:0.0625"/>
<ani:OffsetAnimation From="8,0,0" To="-8,0,0" Duration="0:0:0.125"/>
<ani:OffsetAnimation From="-8,0,0" To="6,0,0" Duration="0:0:0.109375"/>
<ani:OffsetAnimation From="6,0,0" To="-6,0,0" Duration="0:0:0.09375"/>
<ani:OffsetAnimation From="-6,0,0" To="2,0,0" Duration="0:0:0.0625"/>
<ani:OffsetAnimation From="-2,0,0" To="0,0,0" Duration="0:0:0.015625"/>
</ani:AnimationSet>
</ani:Explicit.Animations>
</PasswordBox>
</toolkit:DropShadowPanel>
<ToggleButton x:Name="PasswordVisbility" Style="{ThemeResource ToolbarToggleButton}" IsChecked="False" Height="32">
<Icons:FluentSymbolIcon Symbol="{x:Bind PrivacyToIcon(PasswordVisbility.IsChecked), Mode=OneWay}" Foreground="{ThemeResource HvidSortBrush}"/>
</ToggleButton>
<Button Click="Submit_Click" Style="{ThemeResource ToolbarButton}" Height="32">
<Icons:FluentSymbolIcon Symbol="Save20"/>
</Button>
</StackPanel>
</UserControl>
================================================
FILE: Clippy/Controls/APIBox.xaml.cs
================================================
using Clippy.Core.Services;
using Clippy.Services;
using CubeKit.UI.Icons;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.System;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace Clippy.Controls
{
public sealed partial class APIBox : UserControl
{
private KeyService Keys = (KeyService)App.Current.Services.GetService<IKeyService>();
public APIBox()
{
this.InitializeComponent();
KeyBox.Password = Keys.GetKey();
}
private void AddApi()
{
if (string.IsNullOrEmpty(KeyBox.Password))
{
Reject();
return;
}
try
{
/* OpenAIService AI = new OpenAIService(new OpenAiOptions()
{
ApiKey = KeyBox.Password
});*/
Keys.SetKey(KeyBox.Password);
}
catch
{
Reject();
}
}
private FluentSymbol PrivacyToIcon(bool? boolean) => (boolean ?? false) ? FluentSymbol.EyeShow20 : FluentSymbol.EyeHide20;
private PasswordRevealMode PrivacyToPassword(bool? boolean) => (boolean ?? false) ? PasswordRevealMode.Visible : PasswordRevealMode.Hidden;
private void ApiBox_KeyDown(object sender, KeyRoutedEventArgs e)
{
if (e.Key == VirtualKey.Enter)
AddApi();
}
private void Submit_Click(object sender, RoutedEventArgs e) => AddApi();
private void Accept() => KeyBox.Foreground = GreenLinearGradientBrush;
private void Reject()
{
KeyBox.Foreground = RedLinearGradientBrush;
KeyBox.Focus(FocusState.Programmatic);
PasswordLoadAnimation.Start();
}
}
}
================================================
FILE: Clippy/Controls/MessageTriangle.xaml
================================================
<UserControl
x:Class="Clippy.Controls.MessageTriangle"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Clippy.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ToolkitControls="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<ToolkitControls:DropShadowPanel BlurRadius="16.0" ShadowOpacity="0.33" IsMasked="True" CornerRadius="8"
OffsetX="0.0" OffsetY="0.5" VerticalAlignment="Bottom" Color="Black">
<Grid>
<Path Fill="{ThemeResource MicaBrush}">
<Path.Data>
<PathGeometry>
<PathFigure StartPoint="0,0">
<LineSegment Point="10,10" />
<LineSegment Point="20,0" />
</PathFigure>
</PathGeometry>
</Path.Data>
</Path>
<Path Canvas.ZIndex="3">
<Path.Data>
<PathGeometry>
<PathFigure StartPoint="0,0">
<LineSegment Point="10,10" />
<LineSegment Point="20,0" />
</PathFigure>
</PathGeometry>
</Path.Data>
</Path>
</Grid>
</ToolkitControls:DropShadowPanel>
</UserControl>
================================================
FILE: Clippy/Controls/MessageTriangle.xaml.cs
================================================
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace Clippy.Controls
{
public sealed partial class MessageTriangle : UserControl
{
public MessageTriangle()
{
this.InitializeComponent();
}
}
}
================================================
FILE: Clippy/Controls/Messages/ClippyMessage.xaml
================================================
<UserControl
x:Class="Clippy.Controls.Messages.ClippyMessage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Clippy.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:icons="using:CubeKit.UI.Icons"
xmlns:ToolkitControls="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<Grid>
<StackPanel>
<ToolkitControls:DropShadowPanel BlurRadius="16.0" ShadowOpacity="0.43" IsMasked="True" CornerRadius="8"
OffsetX="0.0" OffsetY="0.0" VerticalAlignment="Bottom" Color="Black">
<Grid BorderBrush="{ThemeResource MicaBorderBrush}" BorderThickness="0, 1, 0, 0" Background="{ThemeResource MicaBrush}" CornerRadius="8">
<StackPanel Spacing="4" Padding="12">
<local:ShineUITextblock Text="{x:Bind ViewModel.StreamingText, Mode=OneWay}" Visibility="{x:Bind BoolToVis(ViewModel.IsStreaming), Mode=OneWay}"/>
<local:ShineUITextblock Text="{x:Bind ViewModel.MessageText, Mode=OneWay}" Visibility="{x:Bind InvertBoolToVis(ViewModel.IsStreaming), Mode=OneWay}"/>
<StackPanel x:Name="Send" Orientation="Horizontal" Spacing="4" x:Load="{x:Bind IsSendEnabled, Mode=OneWay}">
<ToolkitControls:DropShadowPanel ShadowOpacity="0.4" Color="Black" OffsetX="4" CornerRadius="8" Margin="0, 12, 0, 0" OffsetY="4">
<TextBox x:Name="SendBox" KeyDown="SendBox_KeyDown" Style="{ThemeResource GlowTextBox}" PlaceholderText="Ask me anything" Width="240" AcceptsReturn="True" TextWrapping="Wrap" MaxLength="1000"/>
</ToolkitControls:DropShadowPanel>
<Button Click="Send_Click" VerticalAlignment="Bottom" Style="{ThemeResource ToolbarButton}">
<icons:FluentSymbolIcon Symbol="Send20"/>
</Button>
</StackPanel>
</StackPanel>
</Grid>
</ToolkitControls:DropShadowPanel>
<local:MessageTriangle HorizontalAlignment="Left" Margin="236, -1, 0, 0" Canvas.ZIndex="2"/>
</StackPanel>
</Grid>
</UserControl>
================================================
FILE: Clippy/Controls/Messages/ClippyMessage.xaml.cs
================================================
using Clippy.Core.Services;
using Clippy.Core.ViewModels.Messages;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.WinUI.UI.Controls;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.System;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace Clippy.Controls.Messages
{
public sealed partial class ClippyMessage : UserControl
{
public ClippyMessageViewModel ViewModel
{
get => (ClippyMessageViewModel)GetValue(ViewModelProperty);
set
{
if (value is not null)
value.UIThread = action => DispatcherQueue.TryEnqueue(() => action());
SetValue(ViewModelProperty, value);
}
}
public static readonly DependencyProperty ViewModelProperty =
DependencyProperty.Register(
nameof(ViewModel),
typeof(ClippyMessageViewModel),
typeof(ClippyMessage),
new PropertyMetadata(null));
public bool IsSendEnabled
{
get => (bool)GetValue(IsSendEnabledProperty);
set => SetValue(IsSendEnabledProperty, value);
}
public static readonly DependencyProperty IsSendEnabledProperty =
DependencyProperty.Register("IsSendEnabled", typeof(bool), typeof(UserMessage), null);
public ClippyMessage()
{
this.InitializeComponent();
}
private void Send_Click(object sender, RoutedEventArgs e)
{
//if (SendBox.Text is not null && !String.IsNullOrEmpty(Message))
// Chat.SendAsync(new Clippy.Core.Classes.UserMessage(SendBox.Text));
}
private void SendBox_KeyDown(object sender, KeyRoutedEventArgs e)
{
// if (e.Key == VirtualKey.Enter && SendBox.Text is not null && !String.IsNullOrEmpty(Message))
// Chat.SendAsync(new Clippy.Core.Classes.UserMessage(SendBox.Text));
}
// Bool to Visibility
public Visibility BoolToVis(bool b) => b ? Visibility.Visible : Visibility.Collapsed;
// Bool to inverted visibility
public Visibility InvertBoolToVis(bool b) => b ? Visibility.Collapsed : Visibility.Visible;
}
}
================================================
FILE: Clippy/Controls/Messages/SystemMessage.xaml
================================================
<?xml version="1.0" encoding="utf-8"?>
<UserControl
x:Class="Clippy.Controls.Messages.SystemMessage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Clippy.Controls.Messages"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid>
</Grid>
</UserControl>
================================================
FILE: Clippy/Controls/Messages/SystemMessage.xaml.cs
================================================
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace Clippy.Controls.Messages
{
public sealed partial class SystemMessage : UserControl
{
public SystemMessage()
{
this.InitializeComponent();
}
}
}
================================================
FILE: Clippy/Controls/Messages/UserMessage.xaml
================================================
<UserControl
x:Class="Clippy.Controls.Messages.UserMessage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Clippy.Controls"
xmlns:ToolkitControls="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:icons="using:CubeKit.UI.Icons"
mc:Ignorable="d">
<Grid>
<StackPanel>
<ToolkitControls:DropShadowPanel BlurRadius="16.0" ShadowOpacity="0.43" IsMasked="True" CornerRadius="8"
OffsetX="0.0" OffsetY="0.0" VerticalAlignment="Bottom" Color="Black" HorizontalAlignment="Stretch">
<Grid BorderBrush="{ThemeResource MicaBorderBrush}" BorderThickness="0, 1, 0, 0" HorizontalAlignment="Stretch" Background="{ThemeResource MicaBrush}" CornerRadius="8">
<Grid Background="{ThemeResource MicaBlurBrush}" Padding="12">
<TextBlock Text="{x:Bind ViewModel.MessageText, Mode=OneWay}" Width="290" IsTextSelectionEnabled="True" TextWrapping="WrapWholeWords" HorizontalAlignment="Left" VerticalAlignment="Center"/>
</Grid>
</Grid>
</ToolkitControls:DropShadowPanel>
<local:MessageTriangle HorizontalAlignment="Left" Margin="24, -1, 0, 0"/>
</StackPanel>
</Grid>
</UserControl>
================================================
FILE: Clippy/Controls/Messages/UserMessage.xaml.cs
================================================
using Clippy.Core.ViewModels.Messages;
using CommunityToolkit.Mvvm.ComponentModel;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace Clippy.Controls.Messages
{
public sealed partial class UserMessage : UserControl
{
public UserMessageViewModel ViewModel
{
get => (UserMessageViewModel)GetValue(ViewModelProperty);
set => SetValue(ViewModelProperty, value);
}
public static readonly DependencyProperty ViewModelProperty =
DependencyProperty.Register(
nameof(ViewModel),
typeof(UserMessageViewModel),
typeof(UserMessage),
new PropertyMetadata(null));
public UserMessage()
{
this.InitializeComponent();
}
}
}
================================================
FILE: Clippy/Controls/ShineUITextblock.xaml
================================================
<UserControl
x:Class="Clippy.Controls.ShineUITextblock"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Clippy.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ToolkitControls="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:labs="using:CommunityToolkit.Labs.WinUI"
mc:Ignorable="d">
<Grid>
<ToolkitControls:MarkdownTextBlock x:Name="MarkdownBlock" LinkClicked="MarkdownTextBlock_LinkClicked" Text="{x:Bind Text, Mode=OneWay}" Background="Transparent" Width="290" IsTextSelectionEnabled="True" TextWrapping="WrapWholeWords"/>
<StackPanel x:Name="Shimmer" Spacing="10" Margin="0, 6, 4, 6">
<labs:Shimmer Width="284" Height="10"/>
<labs:Shimmer Width="284" Height="10"/>
<labs:Shimmer Width="244" Height="10" HorizontalAlignment="Left"/>
</StackPanel>
</Grid>
</UserControl>
================================================
FILE: Clippy/Controls/ShineUITextblock.xaml.cs
================================================
using CommunityToolkit.WinUI.UI.Controls;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.System;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace Clippy.Controls
{
public sealed partial class ShineUITextblock : UserControl
{
public string Text
{
get => (string)GetValue(TextProperty);
set
{
SetValue(TextProperty, value);
if(value.Length == 0)
{
MarkdownBlock.Visibility = Visibility.Collapsed;
Shimmer.Visibility = Visibility.Visible;
}
else
{
MarkdownBlock.Visibility = Visibility.Visible;
Shimmer.Visibility = Visibility.Collapsed;
}
}
}
public static readonly DependencyProperty TextProperty =
DependencyProperty.Register("Text", typeof(string), typeof(ShineUITextblock), null);
public ShineUITextblock()
{
this.InitializeComponent();
}
private async void MarkdownTextBlock_LinkClicked(object sender, LinkClickedEventArgs e) => await Launcher.LaunchUriAsync(new Uri(e.Link));
}
}
================================================
FILE: Clippy/Helpers/ClippyInputHelper.cs
================================================
using CubeKit.UI.Helpers;
using Microsoft.UI.Xaml.Input;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection.Metadata;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Core;
using WinUIEx;
using static CubeKit.UI.Helpers.NativeHelper;
using static WindowsInput.Native.SystemMetrics;
namespace Clippy.Helpers
{
public class ClippyInputHelper
{
public static async void PointerPress(IntPtr WindowToIgnore)
{
return;
await Task.Run(async () =>
{
// NativeHelper.GetCursorPos(out Point point);
// Perform hit testing to determine the target
// IntPtr hWnd = await GetWindowHandleAtPoint(point, WindowToIgnore);
// Forward the pointer event to the target window
// NativeHelper.SendMessage(hWnd, NativeHelper.WM_LBUTTONDOWN, (IntPtr)point.X, (IntPtr)point.Y);
// NativeHelper.SendMessage(hWnd, NativeHelper.WM_LBUTTONUP, (IntPtr)point.X, (IntPtr)point.Y);
});
}
public static async void PointerHover(IntPtr WindowToIgnore)
{
return;
await Task.Run(async () =>
{
NativeHelper.GetCursorPos(out Point point);
// Perform hit testing to determine the target
IntPtr hWnd = await GetWindowHandleAtPoint(point, WindowToIgnore);
// Forward the pointer event to the target window
NativeHelper.SendMessage(hWnd, NativeHelper.WM_MOUSEMOVE, (IntPtr)point.X, (IntPtr)point.Y);
});
}
public static async Task<IntPtr> GetWindowHandleAtPoint(Point point, IntPtr WindowToIgnore)
{
IntPtr hWnd = WindowFromPoint(point);
await Task.Run(() =>
{
while (hWnd != IntPtr.Zero && hWnd != WindowToIgnore)
{
RECT rect;
GetWindowRect(hWnd, out rect);
if (rect.Left <= point.X && rect.Top <= point.Y && rect.Right >= point.X && rect.Bottom >= point.Y)
{
// Check if there is a child window at the point
IntPtr childHwnd = ChildWindowFromPointEx(hWnd, point, GW_CHILD);
if (childHwnd != IntPtr.Zero)
hWnd = childHwnd;
else
break;
}
else
{
hWnd = GetWindow(hWnd, GW_HWNDNEXT);
}
}
});
return hWnd;
}
}
}
================================================
FILE: Clippy/Helpers/ClippyKeyboardListener.cs
================================================
using Clippy.Core.Services;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WinUIEx;
namespace Clippy.Helpers
{
public class ClippyKeyboardListener
{
private static WindowEx Clippy;
private static bool IsWin = false;
private static bool IsC = false;
private const uint VK_WINDOWS = 0x5B;
private const uint VK_C = 0x43;
private static KeyboardHelper KeyboardHook;
private static ISettingsService Settings = App.Current.Services.GetService<ISettingsService>();
public static void Setup(WindowEx clippy)
{
Clippy = clippy;
KeyboardHook = new KeyboardHelper();
KeyboardHook.KeyboardPressed += OnKeyPressed;
}
private static void OnKeyPressed(object sender, KeyboardHelperEventArgs e)
{
if (!Settings.KeyboardEnabled)
return;
if (e.KeyboardState == KeyboardHelper.KeyboardState.KeyDown)
{
if (e.KeyboardData.VirtualCode == VK_WINDOWS)
IsWin = true;
if (e.KeyboardData.VirtualCode == VK_C)
IsC = true;
if (IsWin && IsC)
{
Clippy.Show();
Clippy.SetForegroundWindow();
Clippy.BringToFront();
}
}
else if (e.KeyboardState == KeyboardHelper.KeyboardState.KeyUp)
{
if (e.KeyboardData.VirtualCode == VK_WINDOWS)
IsWin = false;
if (e.KeyboardData.VirtualCode == VK_C)
IsC = false;
}
}
}
}
================================================
FILE: Clippy/Helpers/KeyboardHelper.cs
================================================
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace Clippy.Helpers
{
public class KeyboardHelper : IDisposable
{
public event EventHandler<KeyboardHelperEventArgs> KeyboardPressed;
public KeyboardHelper()
{
_windowsHookHandle = IntPtr.Zero;
_user32LibraryHandle = IntPtr.Zero;
_hookProc = LowLevelKeyboardProc; // we must keep alive _hookProc, because GC is not aware about SetWindowsHookEx behaviour.
_user32LibraryHandle = LoadLibrary("User32");
if (_user32LibraryHandle == IntPtr.Zero)
{
int errorCode = Marshal.GetLastWin32Error();
throw new Win32Exception(errorCode, $"Failed to load library 'User32.dll'. Error {errorCode}: {new Win32Exception(Marshal.GetLastWin32Error()).Message}.");
}
_windowsHookHandle = SetWindowsHookEx(WH_KEYBOARD_LL, _hookProc, _user32LibraryHandle, 0);
if (_windowsHookHandle == IntPtr.Zero)
{
int errorCode = Marshal.GetLastWin32Error();
throw new Win32Exception(errorCode, $"Failed to adjust keyboard hooks for '{Process.GetCurrentProcess().ProcessName}'. Error {errorCode}: {new Win32Exception(Marshal.GetLastWin32Error()).Message}.");
}
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
// because we can unhook only in the same thread, not in garbage collector thread
if (_windowsHookHandle != IntPtr.Zero)
{
if (!UnhookWindowsHookEx(_windowsHookHandle))
{
int errorCode = Marshal.GetLastWin32Error();
throw new Win32Exception(errorCode, $"Failed to remove keyboard hooks for '{Process.GetCurrentProcess().ProcessName}'. Error {errorCode}: {new Win32Exception(Marshal.GetLastWin32Error()).Message}.");
}
_windowsHookHandle = IntPtr.Zero;
// ReSharper disable once DelegateSubtraction
_hookProc -= LowLevelKeyboardProc;
}
}
if (_user32LibraryHandle != IntPtr.Zero)
{
if (!FreeLibrary(_user32LibraryHandle)) // reduces reference to library by 1.
{
int errorCode = Marshal.GetLastWin32Error();
throw new Win32Exception(errorCode, $"Failed to unload library 'User32.dll'. Error {errorCode}: {new Win32Exception(Marshal.GetLastWin32Error()).Message}.");
}
_user32LibraryHandle = IntPtr.Zero;
}
}
~KeyboardHelper()
{
Dispose(false);
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
private IntPtr _windowsHookHandle;
private IntPtr _user32LibraryHandle;
private HookProc _hookProc;
delegate IntPtr HookProc(int nCode, IntPtr wParam, IntPtr lParam);
[DllImport("kernel32.dll")]
private static extern IntPtr LoadLibrary(string lpFileName);
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
private static extern bool FreeLibrary(IntPtr hModule);
/// <summary>
/// The SetWindowsHookEx function installs an application-defined hook procedure into a hook chain.
/// You would install a hook procedure to monitor the system for certain types of events. These events are
/// associated either with a specific thread or with all threads in the same desktop as the calling thread.
/// </summary>
/// <param name="idHook">hook type</param>
/// <param name="lpfn">hook procedure</param>
/// <param name="hMod">handle to application instance</param>
/// <param name="dwThreadId">thread identifier</param>
/// <returns>If the function succeeds, the return value is the handle to the hook procedure.</returns>
[DllImport("USER32", SetLastError = true)]
static extern IntPtr SetWindowsHookEx(int idHook, HookProc lpfn, IntPtr hMod, int dwThreadId);
/// <summary>
/// The UnhookWindowsHookEx function removes a hook procedure installed in a hook chain by the SetWindowsHookEx function.
/// </summary>
/// <param name="hhk">handle to hook procedure</param>
/// <returns>If the function succeeds, the return value is true.</returns>
[DllImport("USER32", SetLastError = true)]
public static extern bool UnhookWindowsHookEx(IntPtr hHook);
/// <summary>
/// The CallNextHookEx function passes the hook information to the next hook procedure in the current hook chain.
/// A hook procedure can call this function either before or after processing the hook information.
/// </summary>
/// <param name="hHook">handle to current hook</param>
/// <param name="code">hook code passed to hook procedure</param>
/// <param name="wParam">value passed to hook procedure</param>
/// <param name="lParam">value passed to hook procedure</param>
/// <returns>If the function succeeds, the return value is true.</returns>
[DllImport("USER32", SetLastError = true)]
static extern IntPtr CallNextHookEx(IntPtr hHook, int code, IntPtr wParam, IntPtr lParam);
[StructLayout(LayoutKind.Sequential)]
public struct LowLevelKeyboardInputEvent
{
/// <summary>
/// A virtual-key code. The code must be a value in the range 1 to 254.
/// </summary>
public int VirtualCode;
/// <summary>
/// A hardware scan code for the key.
/// </summary>
public int HardwareScanCode;
/// <summary>
/// The extended-key flag, event-injected Flags, context code, and transition-state flag. This member is specified as follows. An application can use the following values to test the keystroke Flags. Testing LLKHF_INJECTED (bit 4) will tell you whether the event was injected. If it was, then testing LLKHF_LOWER_IL_INJECTED (bit 1) will tell you whether or not the event was injected from a process running at lower integrity level.
/// </summary>
public int Flags;
/// <summary>
/// The time stamp stamp for this message, equivalent to what GetMessageTime would return for this message.
/// </summary>
public int TimeStamp;
/// <summary>
/// Additional information associated with the message.
/// </summary>
public IntPtr AdditionalInformation;
}
public const int WH_KEYBOARD_LL = 13;
//const int HC_ACTION = 0;
public enum KeyboardState
{
KeyDown = 0x0100,
KeyUp = 0x0101,
SysKeyDown = 0x0104,
SysKeyUp = 0x0105
}
public const int VkSnapshot = 0x5b;
//const int VkLwin = 0x5b;
//const int VkRwin = 0x5c;
//const int VkTab = 0x09;
//const int VkEscape = 0x18;
//const int VkControl = 0x11;
const int KfAltdown = 0x2000;
public const int LlkhfAltdown = (KfAltdown >> 8);
public IntPtr LowLevelKeyboardProc(int nCode, IntPtr wParam, IntPtr lParam)
{
bool fEatKeyStroke = false;
var wparamTyped = wParam.ToInt32();
if (Enum.IsDefined(typeof(KeyboardState), wparamTyped))
{
object o = Marshal.PtrToStructure(lParam, typeof(LowLevelKeyboardInputEvent));
LowLevelKeyboardInputEvent p = (LowLevelKeyboardInputEvent)o;
var eventArguments = new KeyboardHelperEventArgs(p, (KeyboardState)wparamTyped);
EventHandler<KeyboardHelperEventArgs> handler = KeyboardPressed;
handler?.Invoke(this, eventArguments);
fEatKeyStroke = eventArguments.Handled;
}
return fEatKeyStroke ? (IntPtr)1 : CallNextHookEx(IntPtr.Zero, nCode, wParam, lParam);
}
}
public class KeyboardHelperEventArgs : HandledEventArgs
{
public KeyboardHelper.KeyboardState KeyboardState { get; private set; }
public KeyboardHelper.LowLevelKeyboardInputEvent KeyboardData { get; private set; }
public KeyboardHelperEventArgs(
KeyboardHelper.LowLevelKeyboardInputEvent keyboardData,
KeyboardHelper.KeyboardState keyboardState)
{
KeyboardData = keyboardData;
KeyboardState = keyboardState;
}
}
}
================================================
FILE: Clippy/Helpers/MessageSelector.cs
================================================
using Clippy.Core.Classes;
using Clippy.Core.ViewModels.Messages;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Clippy.Helpers
{
public partial class MessageSelector : DataTemplateSelector
{
public DataTemplate ClippyMessageTemplate { get; set; }
public DataTemplate UserMessageTemplate { get; set; }
public DataTemplate SystemMessageTemplate { get; set; }
protected override DataTemplate SelectTemplateCore(object item)
{
return item switch
{
ClippyMessageViewModel => ClippyMessageTemplate,
UserMessageViewModel => UserMessageTemplate,
SystemMessageViewModel => SystemMessageTemplate,
_ => base.SelectTemplateCore(item)
};
}
}
}
================================================
FILE: Clippy/MainWindow.xaml
================================================
<winuiex:WindowEx
xmlns:winuiex="using:WinUIEx"
x:Class="Clippy.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Clippy"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
IsResizable="False"
IsShownInSwitchers="False"
IsMinimizable="False"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="using:Clippy.Controls"
xmlns:icons="using:CubeKit.UI.Icons"
xmlns:classes="using:Clippy.Core.Classes"
xmlns:helpers="using:Clippy.Helpers"
xmlns:vmm="using:Clippy.Core.ViewModels.Messages"
xmlns:messages="using:Clippy.Controls.Messages"
xmlns:ToolkitControls="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<Grid x:Name="Background" BorderBrush="{ThemeResource MicaBorderBrush}" BorderThickness="0" PointerMoved="Background_PointerMoved" PointerPressed="Background_PointerPressed">
<Grid.Resources>
<DataTemplate x:Key="ClippyMessageTemplate" x:DataType="vmm:ClippyMessageViewModel">
<messages:ClippyMessage ViewModel="{x:Bind }" Margin="0, 8, 0, 8"/>
</DataTemplate>
<DataTemplate x:Key="UserMessageTemplate" x:DataType="vmm:UserMessageViewModel">
<messages:UserMessage ViewModel="{x:Bind }" Margin="0, 8, 0, 8"/>
</DataTemplate>
<DataTemplate x:Key="SystemMessageTemplate">
<messages:SystemMessage/>
</DataTemplate>
<helpers:MessageSelector x:Key="MessageTemplateSelector"
ClippyMessageTemplate="{StaticResource ClippyMessageTemplate}"
UserMessageTemplate="{StaticResource UserMessageTemplate}"
SystemMessageTemplate="{StaticResource SystemMessageTemplate}" />
</Grid.Resources>
<Grid Canvas.ZIndex="0" Background="{ThemeResource LayerFillColorDefaultBrush}" Visibility="{x:Bind BtoV(Settings.TranslucentBackground), Mode=OneWay}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
<Grid x:Name="Content" Canvas.ZIndex="1" Padding="12, 8, 12, 8">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="100" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<ListView Grid.Row="0" Visibility="{x:Bind BtoV(Clippy.IsClippyEnabled), Mode=OneWay}" ItemTemplateSelector="{StaticResource MessageTemplateSelector}" SelectionMode="None" ItemsSource="{x:Bind Clippy.MessagesVM, Mode=OneWay}">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsStackPanel ItemsUpdatingScrollMode="KeepLastItemInView" VerticalAlignment="Bottom"/>
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Margin" Value="0,8,0,8" />
</Style>
</ListView.ItemContainerStyle>
<ListView.ItemContainerTransitions>
<TransitionCollection>
<EntranceThemeTransition IsStaggeringEnabled="True" />
<AddDeleteThemeTransition />
<ContentThemeTransition />
</TransitionCollection>
</ListView.ItemContainerTransitions>
</ListView>
<Grid Grid.Row="1" Margin="0, -16, 0, 0">
<ToggleButton IsChecked="{x:Bind Clippy.IsClippyEnabled, Mode=TwoWay}" Style="{ThemeResource ClippyToggleButton}" Padding="0" HorizontalAlignment="Right" Checked="Clippy_Checked" Unchecked="Clippy_Unchecked">
<ToggleButton.ContextFlyout>
<MenuFlyout x:Name="Flyout" Placement="Bottom" ShouldConstrainToRootBounds="False">
<MenuFlyout.SystemBackdrop>
<MicaBackdrop/>
</MenuFlyout.SystemBackdrop>
<MenuFlyout.MenuFlyoutPresenterStyle>
<Style TargetType="MenuFlyoutPresenter">
<Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="0, -8, 0, 0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="CornerRadius" Value="8" />
<Setter Property="MaxWidth" Value="10000" />
<Setter Property="MaxHeight" Value="10000" />
<Setter Property="IsDefaultShadowEnabled" Value="True"/>
</Style>
</MenuFlyout.MenuFlyoutPresenterStyle>
<ToggleMenuFlyoutItem Text="Pin to top" IsChecked="{x:Bind Clippy.IsPinned, Mode=TwoWay}">
<MenuFlyoutItem.Icon>
<icons:FluentIconElement Symbol="Pin20"/>
</MenuFlyoutItem.Icon>
</ToggleMenuFlyoutItem>
<MenuFlyoutItem Text="Hide" Click="Hide_Click">
<MenuFlyoutItem.Icon>
<icons:FluentIconElement Symbol="EyeHide20"/>
</MenuFlyoutItem.Icon>
</MenuFlyoutItem>
<MenuFlyoutItem Text="Settings" Click="Settings_Click">
<MenuFlyoutItem.Icon>
<icons:FluentIconElement Symbol="Settings20"/>
</MenuFlyoutItem.Icon>
</MenuFlyoutItem>
<MenuFlyoutSeparator/>
<MenuFlyoutItem Text="Exit" Click="Exit_Click">
<MenuFlyoutItem.Icon>
<icons:FluentIconElement Symbol="Dismiss20"/>
</MenuFlyoutItem.Icon>
</MenuFlyoutItem>
</MenuFlyout>
</ToggleButton.ContextFlyout>
<Image Source="ms-appx:///Assets/Clippy/Clippy.png" Height="100" Width="100"/>
</ToggleButton>
</Grid>
<Grid Grid.Row="2" Visibility="{x:Bind BtoV(Clippy.IsClippyEnabled), Mode=OneWay}" VerticalAlignment="Bottom" HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="36" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<ToolkitControls:DropShadowPanel BlurRadius="16.0" ShadowOpacity="0.43" IsMasked="True" CornerRadius="8" OffsetX="0.0" OffsetY="0.0" Color="Black">
<Grid ColumnSpacing="4" BorderBrush="{ThemeResource MicaBorderBrush}" Padding="8" BorderThickness="1" Background="{ThemeResource MicaBrush}" CornerRadius="8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<ToolkitControls:DropShadowPanel Grid.Column="0" ShadowOpacity="0.4" Color="Black" OffsetX="4" CornerRadius="8" OffsetY="4">
<TextBox Text="{x:Bind Clippy.CurrentText, Mode=TwoWay}" PreviewKeyDown="TextBox_PreviewKeyDown" KeyUp="TextBox_KeyUp" Style="{ThemeResource GlowTextBox}" PlaceholderText="Ask me anything.." Width="278" MaxHeight="300" VerticalAlignment="Bottom" AcceptsReturn="True" TextWrapping="Wrap" MaxLength="1000"/>
</ToolkitControls:DropShadowPanel>
<Button Grid.Column="1" Command="{x:Bind Clippy.SendPromptCommand, Mode=OneWay}" Visibility="{x:Bind InvertBoolToVis(Clippy.SendPromptCommand.IsRunning), Mode=OneWay}" VerticalAlignment="Bottom" Style="{ThemeResource ToolbarButton}">
<Button.KeyboardAccelerators>
<KeyboardAccelerator Modifiers="None" Key="Enter" />
</Button.KeyboardAccelerators>
<icons:FluentSymbolIcon Symbol="Send20"/>
</Button>
<Button Grid.Column="1" Command="{x:Bind Clippy.SendPromptCancelCommand, Mode=OneWay}" Visibility="{x:Bind BoolToVis(Clippy.SendPromptCommand.IsRunning), Mode=OneWay}" VerticalAlignment="Bottom" Style="{ThemeResource ToolbarButton}">
<Button.KeyboardAccelerators>
<KeyboardAccelerator Modifiers="None" Key="Enter" />
</Button.KeyboardAccelerators>
<icons:FluentSymbolIcon Symbol="Stop20Filled" />
</Button>
</Grid>
</ToolkitControls:DropShadowPanel>
</Grid>
<StackPanel Grid.Row="1" Visibility="{x:Bind BtoV(Clippy.IsClippyEnabled), Mode=OneWay}" Orientation="Horizontal" Spacing="4" HorizontalAlignment="Left" VerticalAlignment="Bottom">
<Button Click="Settings_Click" Foreground="{ThemeResource SystemAccentColorLight2}" Style="{ThemeResource SettingsToolbarButton}"/>
<AppBarSeparator/>
<Button Click="Hide_Click" Style="{ThemeResource ToolbarButton}" Padding="0" Foreground="{ThemeResource SystemAccentColorLight2}" Height="32" Width="40">
<icons:FluentSymbolIcon Symbol="EyeHide20" />
</Button>
<ToggleButton IsChecked="{x:Bind Clippy.IsPinned, Mode=TwoWay}" Style="{ThemeResource PinToggleButton}" Height="32" Width="40"/>
<Button Command="{x:Bind Clippy.RefreshChatCommand}" Style="{ThemeResource RefreshButton}" Height="32" Width="40"/>
</StackPanel>
</Grid>
</Grid>
</Grid>
</winuiex:WindowEx>
================================================
FILE: Clippy/MainWindow.xaml.cs
================================================
using CubeKit.UI.Helpers;
using Microsoft.UI.Windowing;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using WinUIEx;
using Windows.Win32;
using WinRT.Interop;
using Clippy.Windows;
using WinUIEx.Messaging;
using Windows.Win32.UI.WindowsAndMessaging;
using Microsoft.UI;
using Clippy.Core.ViewModels;
using Microsoft.Extensions.DependencyInjection;
using Clippy.Services;
using Clippy.Helpers;
using Clippy.Core.Services;
using Windows.UI.Input.Preview.Injection;
using Windows.UI.Input;
using Windows.Devices.Input;
using Windows.System;
using Windows.UI.Core;
using System.Diagnostics.Eventing.Reader;
using TerraFX.Interop.Windows;
using static TerraFX.Interop.Windows.WS;
using static TerraFX.Interop.Windows.Windows;
using static TerraFX.Interop.Windows.GWL;
using static TerraFX.Interop.Windows.SWP;
using static TerraFX.Interop.Windows.SW;
using System.Reflection.Metadata;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace Clippy
{
/// <summary>
/// An empty window that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainWindow : WindowEx
{
private SettingsService Settings = (SettingsService)App.Current.Services.GetService<ISettingsService>();
private ClippyViewModel Clippy = App.Current.Services.GetService<ClippyViewModel>();
WindowMessageMonitor m;
public MainWindow()
{
this.InitializeComponent();
m = new(this);
unsafe
{
var hwnd = (HWND)this.GetWindowHandle();
int lExStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
SetWindowLong(hwnd, GWL_EXSTYLE, lExStyle | WS_EX_LAYERED);
}
m.WindowMessageReceived += WindowMessageReceived;
SystemBackdrop = new TransparentBackdrop();
Content.Background = new SolidColorBrush(Colors.Red);
Content.Background = new SolidColorBrush(Colors.Transparent);
ClippyKeyboardListener.Setup(this);
Collapse();
this.BringToFront();
if (Clippy.IsPinned) Pin();
else Unpin();
Clippy.PropertyChanged += (object sender, System.ComponentModel.PropertyChangedEventArgs e) =>
{
if(e.PropertyName == "IsPinned")
{
if (Clippy.IsPinned) Pin();
else Unpin();
}
};
}
private unsafe void Pin()
{
var presenter = this.AppWindow.Presenter as OverlappedPresenter;
var hwnd = (HWND)this.GetWindowHandle();
if (presenter is not null) presenter.IsAlwaysOnTop = true;
// Add the extended window styles for always on top
int lExStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
SetWindowLong(hwnd, GWL_EXSTYLE, lExStyle | WS_EX_TOPMOST);
// Move window to top
SetWindowPos(hwnd, HWND.HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
}
private unsafe void Unpin()
{
var presenter = this.AppWindow.Presenter as OverlappedPresenter;
var hwnd = (HWND)this.GetWindowHandle();
if (presenter is not null) presenter.IsAlwaysOnTop = false;
// Add the extended window styles for always on top
int lExStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
SetWindowLong(hwnd, GWL_EXSTYLE, lExStyle & ~WS_EX_TOPMOST);
this.BringToFront();
}
private void WindowMessageReceived(object? sender, WindowMessageEventArgs e)
{
if (e.Message.MessageId == PInvoke.WM_ERASEBKGND)
{
e.Handled = true;
e.Result = 1;
}
}
private double GetScale()
{
var progmanWindow = NativeHelper.FindWindow("Shell_TrayWnd", null);
var monitor = NativeHelper.MonitorFromWindow(progmanWindow, NativeHelper.MONITOR_DEFAULTTOPRIMARY);
NativeHelper.DeviceScaleFactor scale;
NativeHelper.GetScaleFactorForMonitor(monitor, out scale);
if (scale == NativeHelper.DeviceScaleFactor.DEVICE_SCALE_FACTOR_INVALID)
scale = NativeHelper.DeviceScaleFactor.SCALE_100_PERCENT;
return Convert.ToDouble(scale) / 100;
}
private void Settings_Click(object sender, RoutedEventArgs e)
{
App.Current.OpenSettings();
}
private Visibility BtoV(bool b) => b ? Visibility.Visible : Visibility.Collapsed;
private void Clippy_Checked(object sender, RoutedEventArgs e) => Expand();
private void Clippy_Unchecked(object sender, RoutedEventArgs e) => Collapse();
private void Collapse()
{
this.Height = 150;
this.Width = 150;
double Scale = GetScale();
double DisplayHeight = (DisplayArea.Primary.OuterBounds.Height) - 100;
double DisplayWidth = (DisplayArea.Primary.OuterBounds.Width) - 200;
double W = this.Width * Scale;
double H = this.Height * Scale;
this.MoveAndResize(DisplayWidth - W, DisplayHeight - H, this.Width, this.Height);
}
private void Expand()
{
this.Height = 1000;
this.Width = 380;
double Scale = GetScale();
double DisplayHeight = (DisplayArea.Primary.OuterBounds.Height) - 100;
double DisplayWidth = (DisplayArea.Primary.OuterBounds.Width) - 200;
double W = this.Width * Scale;
double H = this.Height * Scale;
this.MoveAndResize(DisplayWidth - W, DisplayHeight - H, this.Width, this.Height);
Content.MaxHeight = this.Height;
}
// Bool to Visibility
public Visibility BoolToVis(bool b) => b ? Visibility.Visible : Visibility.Collapsed;
// Bool to inverted visibility
public Visibility InvertBoolToVis(bool b) => b ? Visibility.Collapsed : Visibility.Visible;
private void Background_PointerPressed(object sender, PointerRoutedEventArgs e) => ClippyInputHelper.PointerPress(this.GetWindowHandle());
private void Background_PointerMoved(object sender, PointerRoutedEventArgs e) => ClippyInputHelper.PointerHover(this.GetWindowHandle());
private void TextBox_PreviewKeyDown(object sender, KeyRoutedEventArgs e)
{
// NOTE - AcceptsReturn is set to true in XAML.
/*if (e.Key == VirtualKey.Enter)
{
// If SHIFT is pressed, this next IF is skipped over, so the default behavior of "AcceptsReturn" is used.
var keyState = CoreWindow.GetForCurrentThread().GetKeyState(VirtualKey.Shift);
if ((keyState & CoreVirtualKeyStates.Down) != CoreVirtualKeyStates.Down)
e.Handled = true; // Mark the event as handled
} */
}
private void TextBox_KeyUp(object sender, KeyRoutedEventArgs e)
{
/*if (e.Key == VirtualKey.Enter)
{
// If SHIFT is pressed, this next IF is skipped over, so the default behavior of "AcceptsReturn" is used.
var keyState = CoreWindow.GetForCurrentThread().GetKeyState(VirtualKey.Shift);
if ((keyState & CoreVirtualKeyStates.Down) != CoreVirtualKeyStates.Down)
{
// Force update x:Bind text
Clippy.CurrentText = (sender as TextBox).Text;
if (Clippy.SendPromptCommand.CanExecute(this))
Clippy.SendPromptCommand.Execute(this);
}
} */
}
private void Exit_Click(object sender, RoutedEventArgs e) => Application.Current.Exit();
private void Hide_Click(object sender, RoutedEventArgs e)
{
this.Hide();
}
}
}
================================================
FILE: Clippy/NativeMethods.txt
================================================
WINDOW_EX_STYLE
GetWindowLong
WM_ERASEBKGND
SetWindowLong
================================================
FILE: Clippy/Package.appxmanifest
================================================
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"
IgnorableNamespaces="uap rescap mp">
<Identity
Name="2505FireCubeStudios.Clippy11"
Publisher="CN=3C7C8FC9-7104-4B33-8730-EE1E929D5D3B"
Version="1.1.10.0" />
<Properties>
<DisplayName>Paperclip by FireCube</DisplayName>
<PublisherDisplayName>FireCubeStudios</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate"/>
</Resources>
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
<Extensions>
<uap5:Extension Category="windows.startupTask">
<uap5:StartupTask
TaskId="ClippyStartupTaskId"
DisplayName="Clippy"
Enabled="true"/>
</uap5:Extension>
</Extensions>
<uap:VisualElements
DisplayName="Paperclip by FireCube"
Description="Clippy"
BackgroundColor="transparent"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square71x71Logo="Assets\SmallTile.png" Square310x310Logo="Assets\LargeTile.png"/>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<rescap:Capability Name="runFullTrust" />
</Capabilities>
<mp:PhoneIdentity PhoneProductId="6ade929b-55cf-457a-93a9-88db7ef72596" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
</Package>
================================================
FILE: Clippy/Properties/launchSettings.json
================================================
{
"profiles": {
"Clippy (Package)": {
"commandName": "MsixPackage",
"nativeDebugging": true
},
"Clippy (Unpackaged)": {
"commandName": "Project",
"nativeDebugging": true
}
}
}
================================================
FILE: Clippy/Services/KeyService.cs
================================================
using Clippy.Core.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using Windows.Security.Credentials;
namespace Clippy.Services
{
public class KeyService : IKeyService
{
private const string Name = "Key";
private const string Resource = "R";
private PasswordVault Vault = new PasswordVault();
public string GetKey()
{
try
{
return Vault.Retrieve(Resource, Name).Password;
}
catch
{
return "";
}
}
public void SetKey(string key) => Vault.Add(new PasswordCredential(Resource, Name, key));
}
}
================================================
FILE: Clippy/Services/SettingsService.cs
================================================
using Clippy.Core.Services;
using Clippy.Helpers;
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Storage;
namespace Clippy.Services
{
public class SettingsService : ObservableObject, ISettingsService
{
private static ApplicationDataContainer Settings = ApplicationData.Current.LocalSettings;
private bool autoPin = (bool)(Settings.Values["AutoPin"] ?? true);
public bool AutoPin
{
get => autoPin;
set
{
Settings.Values["AutoPin"] = value;
SetProperty(ref autoPin, value);
}
}
private bool trayClippy = (bool)(Settings.Values["TrayClippy"] ?? true);
public bool TrayClippy
{
get => trayClippy;
set
{
Settings.Values["TrayClippy"] = value;
SetProperty(ref trayClippy, value);
//if (value)
// ClippyTrayListener.Recreate();
// else
// ClippyTrayListener.Remove();
}
}
private bool translucentBackground = (bool)(Settings.Values["TranslucentBackground"] ?? true);
public bool TranslucentBackground
{
get => translucentBackground;
set
{
Settings.Values["TranslucentBackground"] = value;
SetProperty(ref translucentBackground, value);
}
}
private int tokens = (int)(Settings.Values["Tokens"] ?? 100);
public int Tokens
{
get => tokens;
set
{
if (value > 50 && value < 2000)
{
Settings.Values["Tokens"] = value;
SetProperty(ref tokens, value);
}
else
SetProperty(ref tokens, 100);
}
}
private bool keyboardEnabled = (bool)(Settings.Values["KeyboardEnabled"] ?? true);
public bool KeyboardEnabled
{
get => keyboardEnabled;
set
{
Settings.Values["KeyboardEnabled"] = value;
SetProperty(ref keyboardEnabled, value);
}
}
}
}
================================================
FILE: Clippy/SettingsWindow.xaml
================================================
<winuiex:WindowEx
xmlns:winuiex="using:WinUIEx"
x:Class="Clippy.SettingsWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Clippy"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:icons="using:CubeKit.UI.Icons"
xmlns:settings="using:CubeKit.UI.Controls.Settings"
xmlns:controls="using:Clippy.Controls"
MinWidth="1090"
mc:Ignorable="d"
Title="Clippy Settings">
<winuiex:WindowEx.SystemBackdrop>
<MicaBackdrop/>
</winuiex:WindowEx.SystemBackdrop>
<Grid>
<Border x:Name="AppTitleBar"
IsHitTestVisible="True"
VerticalAlignment="Top"
Height="40"
Canvas.ZIndex="1"
Margin="12,0,0,0">
<Grid>
<StackPanel Orientation="Horizontal">
<Image x:Name="AppFontIcon"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Source="Assets/Square44x44Logo.scale-100.png"
Width="24"
Height="24"/>
<TextBlock x:Name="AppTitle"
Text="Clippy by FireCube"
VerticalAlignment="Center"
Margin="8, 0, 0, 0"
Style="{StaticResource CaptionTextBlockStyle}" />
<TextBlock
Text=" - Settings"
VerticalAlignment="Center"
Margin="2, 0, 0, 0"
Style="{StaticResource CaptionTextBlockStyle}"
Opacity="0.7"/>
</StackPanel>
</Grid>
</Border>
<ScrollViewer x:Name="SettingsPanel" Margin="0, 48, 0, 0">
<Grid>
<StackPanel x:Name="SettingsGrid" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="100, 50, 300, 100">
<StackPanel Margin="4, 4, 4, 24" Spacing="8" Orientation="Horizontal">
<TextBlock FontSize="24" FontWeight="SemiBold">Clippy by FireCube</TextBlock>
<TextBlock FontSize="20" Opacity="0.7" FontWeight="SemiBold" VerticalAlignment="Bottom"> - 1.0</TextBlock>
</StackPanel>
<!-- <TextBlock FontSize="14" FontWeight="SemiBold" Margin="4, 4, 4, 2">API Key</TextBlock>
<settings:SettingsBlockControl Title="OpenAI Api" Margin="2" Description="OpenAI API key for Clippy">
<settings:SettingsBlockControl.Icon>
<icons:FluentIconElement VerticalAlignment="Center" Symbol="Key24" Foreground="LightCoral"/>
</settings:SettingsBlockControl.Icon>
<settings:SettingsBlockControl.ExpandableContent>
<Grid Padding="24, 0, 24, 0">
<controls:APIBox/>
</Grid>
</settings:SettingsBlockControl.ExpandableContent>
</settings:SettingsBlockControl>-->
<TextBlock FontSize="14" FontWeight="SemiBold" Margin="4, 28, 4, 2">Clippy Options</TextBlock>
<!-- <settings:SettingsBlockControl Title="Maximum tokens" Margin="2" Description="Maximum amount of tokens to use for Clippy input + output per prompt. (1 token = 2-3 words)">
<settings:SettingsBlockControl.Icon>
<icons:FluentIconElement VerticalAlignment="Center" Symbol="TextWordCount24"/>
</settings:SettingsBlockControl.Icon>
<NumberBox Style="{ThemeResource GlowNumberBox}" AcceptsExpression="False" Value="{x:Bind Settings.Tokens, Mode=TwoWay}" PlaceholderText="100" Maximum="2000" Minimum="50" Width="200" Margin="0, 0, 90, 0" SmallChange="10" LargeChange="100" SpinButtonPlacementMode="Inline"/>
</settings:SettingsBlockControl>-->
<settings:SettingsBlockControl x:Name="Keyboard" Title="Keyboard" Margin="2" Description="Note: Support for other shortcuts is not yet supported">
<settings:SettingsBlockControl.Icon>
<icons:FluentIconElement VerticalAlignment="Center" Symbol="Keyboard24"/>
</settings:SettingsBlockControl.Icon>
<ToggleSwitch IsOn="{x:Bind Settings.KeyboardEnabled, Mode=TwoWay}" Style="{ThemeResource GlowSwitch}" OnContent="Win + Shift + C" HorizontalAlignment="Right" OffContent="Off"/>
</settings:SettingsBlockControl>
<TextBlock FontSize="14" FontWeight="SemiBold" Margin="4, 28, 4, 2">Personalisation Options</TextBlock>
<settings:SettingsBlockControl Title="Autopin Clippy" Margin="2" Description="Always pin Clippy to the top of the screen on startup">
<settings:SettingsBlockControl.Icon>
<icons:FluentIconElement VerticalAlignment="Center" Symbol="Pin24"/>
</settings:SettingsBlockControl.Icon>
<ToggleSwitch IsOn="{x:Bind Settings.AutoPin, Mode=TwoWay}" Style="{ThemeResource GlowSwitch}" OnContent="On" HorizontalAlignment="Right" OffContent="Off"/>
</settings:SettingsBlockControl>
<settings:SettingsBlockControl Title="Translucent background" Margin="2" Description="Toggle a translucent or transparent window background.">
<settings:SettingsBlockControl.Icon>
<icons:FluentIconElement VerticalAlignment="Center" Symbol="ColorBackground24"/>
</settings:SettingsBlockControl.Icon>
<ToggleSwitch IsOn="{x:Bind Settings.TranslucentBackground, Mode=TwoWay}" Style="{ThemeResource GlowSwitch}" OffContent="Transparent" HorizontalAlignment="Right" OnContent="Translucent"/>
</settings:SettingsBlockControl>
<settings:SettingsBlockControl Title="Run on startup" Margin="2" Description="Launch Clippy when Windows starts up (recommended)">
<settings:SettingsBlockControl.Icon>
<icons:FluentIconElement VerticalAlignment="Center" Symbol="ClockAlarm24"/>
</settings:SettingsBlockControl.Icon>
<ToggleSwitch x:Name="StartupToggle" Toggled="StartupToggle_Toggled" Style="{ThemeResource GlowSwitch}" OnContent="On" HorizontalAlignment="Right" OffContent="Off"/>
</settings:SettingsBlockControl>
<TextBlock x:Name="StartupErrorText" Text="" Visibility="Collapsed" TextWrapping="WrapWholeWords" Foreground="{ThemeResource RedLinearGradientBrush}"/>
<settings:SettingsBlockControl Title="Show Clippy in Tray" Margin="2" Description="Summon Clippy from the System Tray area">
<settings:SettingsBlockControl.Icon>
<icons:FluentIconElement VerticalAlignment="Center" Symbol="Apps24"/>
</settings:SettingsBlockControl.Icon>
<ToggleSwitch IsOn="{x:Bind Settings.TrayClippy, Mode=TwoWay}" IsEnabled="False" Style="{ThemeResource GlowSwitch}" OnContent="On" HorizontalAlignment="Right" OffContent="Off"/>
</settings:SettingsBlockControl>
<TextBlock FontSize="14" FontWeight="SemiBold" Margin="4, 28, 4, 2">Information</TextBlock>
<settings:SettingsBlockControl Title="Rate the app!" Margin="2" Description="Help support us by rating the app!">
<settings:SettingsBlockControl.Icon>
<icons:FluentIconElement VerticalAlignment="Center" Symbol="Star24"/>
</settings:SettingsBlockControl.Icon>
<Button Click="Star_Click" Margin="4,12,4,8" Width="150" Style="{ThemeResource ToolbarButton}" BorderThickness="1" BorderBrush="{ThemeResource MicaBorderBrush}">Rate</Button>
</settings:SettingsBlockControl>
<settings:SettingsBlockControl Title="Contact the developer, See new features, Get app support" Margin="2" Description="Join the Windows Apps Hub">
<settings:SettingsBlockControl.Icon>
<icons:FluentIconElement VerticalAlignment="Center" Symbol="people24"/>
</settings:SettingsBlockControl.Icon>
<Button Click="Hub_Click" Margin="4,12,4,8" Width="150" Style="{ThemeResource ToolbarButton}" BorderThickness="1" BorderBrush="{ThemeResource MicaBorderBrush}">Open</Button>
</settings:SettingsBlockControl>
<settings:SettingsBlockControl Title="Submit bugs, Track updates, View code" Margin="2" Description="Visit the GitHub repository">
<settings:SettingsBlockControl.Icon>
<icons:FluentIconElement VerticalAlignment="Center" Symbol="Bug24"/>
</settings:SettingsBlockControl.Icon>
<Button Click="GitHub_Click" Margin="4,12,4,8" Width="150" Style="{ThemeResource ToolbarButton}" BorderThickness="1" BorderBrush="{ThemeResource MicaBorderBrush}">Open</Button>
</settings:SettingsBlockControl>
</StackPanel>
<StackPanel Margin="80, 100, 12, 40" Width="200" x:Name="AboutPanel" HorizontalAlignment="Right" VerticalAlignment="Top">
<TextBlock FontSize="14" FontWeight="SemiBold" Margin="4, 4, 4, 8">About this app</TextBlock>
<StackPanel Margin="4, 0, 4, 0" Orientation="Horizontal">
<TextBlock FontSize="14" Margin="0, 4, 4, 0">Clippy by FireCube</TextBlock>
<TextBlock Opacity="0.7" FontSize="14" Margin="2, 4, 4, 0"> - Preview 4</TextBlock>
</StackPanel>
<TextBlock FontSize="14" Margin="4, 0, 4, 0" TextWrapping="WrapWholeWords">Developed by FireCubeStudios</TextBlock>
<HyperlinkButton Margin="4" NavigateUri="https://discord.gg/3WYcKat">Join Clippy Discord</HyperlinkButton>
<HyperlinkButton Margin="4" NavigateUri="https://github.com/FireCubeStudios/Clippy">Star the GitHub repository</HyperlinkButton>
<HyperlinkButton Margin="4" NavigateUri="ms-windows-store://review/?ProductId=9NWK37S35V5T">Rate the app</HyperlinkButton>
<MenuFlyoutSeparator Margin="0, 0, 24, 0"/>
<HyperlinkButton Margin="4" NavigateUri="https://twitter.com/FireCubeStudios">Follow me on Twitter</HyperlinkButton>
<HyperlinkButton Margin="4" NavigateUri="https://bsky.app/profile/firecube.bsky.social">Follow me on Bluesky</HyperlinkButton>
<Button Click="Exit_Click" Margin="4,12,4,8" Width="150" Style="{ThemeResource ToolbarButton}" BorderThickness="1" BorderBrush="{ThemeResource MicaBorderBrush}">Exit</Button>
</StackPanel>
</Grid>
</ScrollViewer>
</Grid>
</winuiex:WindowEx>
================================================
FILE: Clippy/SettingsWindow.xaml.cs
================================================
using Clippy.Core.Services;
using Clippy.Services;
using Clippy.Windows;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.UI.Composition.SystemBackdrops;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using System;
using System.Collections.Generic;
using System.Diagnostics.Tracing;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel.Core;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.System;
using WinUIEx;
using WinRT;
using Windows.ApplicationModel;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace Clippy
{
/// <summary>
/// An empty window that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class SettingsWindow : WindowEx
{
private SettingsService Settings = (SettingsService)App.Current.Services.GetService<ISettingsService>();
public SettingsWindow()
{
this.InitializeComponent();
this.ExtendsContentIntoTitleBar = true;
SetTitleBar(AppTitleBar);
SetupStartup();
}
private async void SetupStartup()
{
var startup = await StartupTask.GetAsync("ClippyStartupTaskId");
UpdateToggleState(startup.State);
}
private async void Star_Click(object sender, RoutedEventArgs e) => await Launcher.LaunchUriAsync(new Uri("ms-windows-store://review/?ProductId=9NWK37S35V5T"));
private async void Hub_Click(object sender, RoutedEventArgs e) => await Launcher.LaunchUriAsync(new Uri("https://discord.gg/3WYcKat"));
private async void GitHub_Click(object sender, RoutedEventArgs e) => await Launcher.LaunchUriAsync(new Uri("https://github.com/FireCubeStudios/Clippy"));
private void Exit_Click(object sender, RoutedEventArgs e) => Application.Current.Exit();
private void UpdateToggleState(StartupTaskState state)
{
StartupToggle.IsEnabled = true;
StartupErrorText.Visibility = Visibility.Collapsed;
switch (state)
{
case StartupTaskState.Enabled:
StartupToggle.IsOn = true;
break;
case StartupTaskState.Disabled:
break;
case StartupTaskState.DisabledByUser:
StartupToggle.IsOn = false;
StartupErrorText.Visibility = Visibility.Visible;
StartupErrorText.Text = "Unable to change state of startup task via the application - enable via Startup page in Windows Settings";
break;
default:
StartupToggle.IsEnabled = false;
break;
}
}
private async void StartupToggle_Toggled(object sender, RoutedEventArgs e)
{
bool enable = StartupToggle.IsOn;
var startup = await StartupTask.GetAsync("ClippyStartupTaskId");
StartupErrorText.Visibility = Visibility.Collapsed;
switch (startup.State)
{
case StartupTaskState.Enabled when !enable:
startup.Disable();
break;
case StartupTaskState.Disabled when enable:
var updatedState = await startup.RequestEnableAsync();
UpdateToggleState(updatedState);
break;
case StartupTaskState.DisabledByUser when enable:
StartupToggle.IsOn = false;
StartupErrorText.Visibility = Visibility.Visible;
StartupErrorText.Text = "Unable to change state of startup task via the application - enable via Startup page in Windows Settings";
break;
default:
break;
}
}
}
}
================================================
FILE: Clippy/Windows/MicaWindow.cs
================================================
using Microsoft.UI.Composition.SystemBackdrops;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using WinRT;
using WinUIEx;
namespace Clippy.Windows
{
public class MicaWindow
{
MicaController? m_micaController;
SystemBackdropConfiguration? m_configurationSource;
public bool TrySetMicaBackdrop(WindowEx W)
{
try
{
if (MicaController.IsSupported())
{
WindowsSystemDispatcherQueueHelper.EnsureWindowsSystemDispatcherQueueController();
// Hooking up the policy object
m_configurationSource = new SystemBackdropConfiguration();
// Initial configuration state.
m_configurationSource.IsInputActive = true;
m_micaController = new MicaController();
// Enable the system backdrop.
// Note: Be sure to have "using WinRT;" to support the Window.As<...>() call.
m_micaController.AddSystemBackdropTarget(W.As<Microsoft.UI.Composition.ICompositionSupportsSystemBackdrop>());
m_micaController.SetSystemBackdropConfiguration(m_configurationSource);
return true; // succeeded
}
return false; // Mica is not supported on this system
}
catch
{
return false;
}
}
}
}
================================================
FILE: Clippy/Windows/TransparentBackdrop.cs
================================================
using System;
using Microsoft.UI.Xaml.Media;
using Compositor = Windows.UI.Composition.Compositor;
using Windows.UI.Composition;
using ICompositionSupportsSystemBackdrop = Microsoft.UI.Composition.ICompositionSupportsSystemBackdrop;
using Windows.UI;
namespace Clippy.Windows
{
internal class TransparentBackdrop : SystemBackdrop
{
static readonly Lazy<Compositor> _Compositor = new(() =>
{
WindowsSystemDispatcherQueueHelper.EnsureWindowsSystemDispatcherQueueController();
return new();
});
static Compositor Compositor => _Compositor.Value;
protected override void OnTargetConnected(ICompositionSupportsSystemBackdrop connectedTarget, Microsoft.UI.Xaml.XamlRoot xamlRoot)
{
connectedTarget.SystemBackdrop = Compositor.CreateColorBrush(
Color.FromArgb(0, 255, 255, 255)
);
}
protected override void OnTargetDisconnected(ICompositionSupportsSystemBackdrop disconnectedTarget)
{
disconnectedTarget.SystemBackdrop = null;
}
}
}
================================================
FILE: Clippy/Windows/WindowsSystemDispatcherQueueHelper.cs
================================================
using System.Runtime.InteropServices;
using Windows.System;
namespace Clippy.Windows
{
public static class WindowsSystemDispatcherQueueHelper
{
[StructLayout(LayoutKind.Sequential)]
struct DispatcherQueueOptions
{
internal int dwSize;
internal int threadType;
internal int apartmentType;
}
[DllImport("CoreMessaging.dll")]
private static extern int CreateDispatcherQueueController([In] DispatcherQueueOptions options, [In, Out, MarshalAs(UnmanagedType.IUnknown)] ref object? dispatcherQueueController);
static object? m_dispatcherQueueController = null;
public static void EnsureWindowsSystemDispatcherQueueController()
{
if (DispatcherQueue.GetForCurrentThread() != null)
// one already exists, so we'll just use it.
return;
if (m_dispatcherQueueController == null)
{
DispatcherQueueOptions options;
options.dwSize = Marshal.SizeOf(typeof(DispatcherQueueOptions));
options.threadType = 2; // DQTYPE_THREAD_CURRENT
options.apartmentType = 2; // DQTAT_COM_STA
_ = CreateDispatcherQueueController(options, ref m_dispatcherQueueController);
}
}
}
}
================================================
FILE: Clippy/app.manifest
================================================
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="Clippy.app"/>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<!-- The combination of below two tags have the following effect:
1) Per-Monitor for >= Windows 10 Anniversary Update
2) System < Windows 10 Anniversary Update
-->
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
</windowsSettings>
</application>
</assembly>
================================================
FILE: Clippy.Core/Classes/Message.cs
================================================
using Clippy.Core.Enums;
using Clippy.Core.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
namespace Clippy.Core.Classes
{
public record Message(Role Role, string MessageText, DateTime MessageDate) : IMessage
{
public Message(Role Role, string MessageText) : this(Role, MessageText, DateTime.Now) { }
}
}
================================================
FILE: Clippy.Core/Clippy.Core.csproj
================================================
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>11.0</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="System.Text.Json" Version="9.0.8" />
</ItemGroup>
</Project>
================================================
FILE: Clippy.Core/Constants.cs
================================================
using System;
using System.Collections.Generic;
using System.Text;
namespace Clippy.Core
{
public class Constants
{
public const string FIRST_CLIPPY_MESSAGE = "Hi! I'm Clippy, your Windows assistant. Would you like to get some assistance?";
public const string DEFAULT_SYSTEM_PROMPT = "You are in an app that revives Microsoft Clippy in Windows. Speak in a Clippy style";// and try to stay as concise/short as possible and not output long messages.";
}
}
================================================
FILE: Clippy.Core/Enums/Role.cs
================================================
using System;
using System.Collections.Generic;
using System.Text;
namespace Clippy.Core.Enums
{
public enum Role
{
User = 0,
Assistant = 1,
System = 2,
}
}
================================================
FILE: Clippy.Core/Factories/MessageFactory.cs
================================================
using Clippy.Core.Interfaces;
using Clippy.Core.ViewModels.Messages;
using Clippy.Core.ViewModels;
using System;
using System.Collections.Generic;
using System.Text;
namespace Clippy.Core.Factories
{
public class MessageFactory
{
public static MessageViewModel GetMessageViewModel(IMessage message)
{
switch (message.Role)
{
case Enums.Role.User:
return new UserMessageViewModel(message);
case Enums.Role.Assistant:
return new ClippyMessageViewModel(message);
default:
return new SystemMessageViewModel(message);
}
}
}
}
================================================
FILE: Clippy.Core/Interfaces/IMessage.cs
================================================
using Clippy.Core.Enums;
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
namespace Clippy.Core.Interfaces
{
public interface IMessage
{
public Role Role { get; init; }
public DateTime MessageDate { get; init; }
public string MessageText { get; init; }
}
}
================================================
FILE: Clippy.Core/Runtime/IsExternalInit.cs
================================================
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
namespace System.Runtime.CompilerServices
{
/// <summary>
/// Reserved to be used by the compiler for tracking metadata.
/// This class should not be used by developers in source code.
/// This dummy class is required to compile records when targeting .NET Standard 2.1
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static class IsExternalInit
{
}
}
================================================
FILE: Clippy.Core/Services/IChatService.cs
================================================
using Clippy.Core.Classes;
using Clippy.Core.Interfaces;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Clippy.Core.Services
{
public interface IChatService
{
Task<string> SendChatAsync(IEnumerable<IMessage> Messages);
IAsyncEnumerable<string> StreamChatAsync(IEnumerable<IMessage> Messages, CancellationToken cancellationToken = default);
}
}
================================================
FILE: Clippy.Core/Services/IKeyService.cs
================================================
using System;
using System.Collections.Generic;
using System.Text;
namespace Clippy.Core.Services
{
public interface IKeyService
{
public string GetKey();
public void SetKey(string key);
}
}
================================================
FILE: Clippy.Core/Services/ISettingsService.cs
================================================
using System;
using System.Collections.Generic;
using System.Text;
namespace Clippy.Core.Services
{
public interface ISettingsService
{
public bool AutoPin { get; set; }
public bool TrayClippy { get; set; }
public bool TranslucentBackground { get; set; }
public bool KeyboardEnabled { get; set; }
public int Tokens { get; set; }
}
}
================================================
FILE: Clippy.Core/ViewModels/ClippyViewModel.cs
================================================
using Clippy.Core.Classes;
using Clippy.Core.Services;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using Clippy.Core.Interfaces;
using Clippy.Core.Enums;
using Clippy.Core.ViewModels.Messages;
using System.Collections.ObjectModel;
using Clippy.Core.Factories;
using System.Linq.Expressions;
using System.Diagnostics;
namespace Clippy.Core.ViewModels
{
public partial class ClippyViewModel : ObservableObject
{
public ObservableCollection<MessageViewModel> MessagesVM = new();
public ObservableCollection<IMessage> Messages = new();
[ObservableProperty]
private bool isClippyEnabled = true;
[ObservableProperty]
private bool isPinned = true;
[ObservableProperty]
private string currentText = "";
[ObservableProperty]
private DateTime updatedAt = DateTime.Now;
public IChatService ChatService;
public ISettingsService SettingsService;
public ClippyViewModel(IChatService chatService, ISettingsService settingsService)
{
ChatService = chatService;
SettingsService = settingsService;
isPinned = SettingsService.AutoPin;
SetupChat();
}
private void SetupChat()
{
AddMessage(new Message(Role.System, Constants.DEFAULT_SYSTEM_PROMPT));
AddMessage(new Message(Role.Assistant, Constants.FIRST_CLIPPY_MESSAGE));
}
private MessageViewModel AddMessage(IMessage message)
{
var ViewModel = MessageFactory.GetMessageViewModel(message);
MessagesVM.Add(ViewModel);
Messages.Add(message);
return ViewModel;
}
[RelayCommand(IncludeCancelCommand = true)]
public async Task SendPrompt(CancellationToken cancellationToken)
{
try
{
if (!String.IsNullOrEmpty(CurrentText))
{
AddMessage(new Message(Role.User, CurrentText)); // update UI here
CurrentText = "";
await Task.Delay(300);
var messageVM = AddMessage(new Message(Role.Assistant, "")) as ClippyMessageViewModel;
UpdatedAt = DateTime.Now;
messageVM?.StartStreamText(cancellationToken);
try
{
await foreach (var chunk in ChatService.StreamChatAsync(Messages, cancellationToken))
messageVM?.AddStreamText(chunk);
}
catch (TaskCanceledException)
{
return; // Task cancelled so it is ok
}
catch (Exception e)
{
messageVM?.Exception(e);
}
messageVM?.EndStreamText();
}
}
catch (Exception e)
{
Debug.WriteLine(e.Message);
}
}
[RelayCommand]
private void RefreshChat()
{
MessagesVM.Clear();
Messages.Clear();
SetupChat();
}
}
}
================================================
FILE: Clippy.Core/ViewModels/Messages/ClippyMessageViewModel.Streaming.cs
================================================
using System;
using System.C
gitextract_9yfi5vry/ ├── .gitattributes ├── .gitignore ├── Clippy/ │ ├── App.xaml │ ├── App.xaml.cs │ ├── Clippy.csproj │ ├── Controls/ │ │ ├── APIBox.xaml │ │ ├── APIBox.xaml.cs │ │ ├── MessageTriangle.xaml │ │ ├── MessageTriangle.xaml.cs │ │ ├── Messages/ │ │ │ ├── ClippyMessage.xaml │ │ │ ├── ClippyMessage.xaml.cs │ │ │ ├── SystemMessage.xaml │ │ │ ├── SystemMessage.xaml.cs │ │ │ ├── UserMessage.xaml │ │ │ └── UserMessage.xaml.cs │ │ ├── ShineUITextblock.xaml │ │ └── ShineUITextblock.xaml.cs │ ├── Helpers/ │ │ ├── ClippyInputHelper.cs │ │ ├── ClippyKeyboardListener.cs │ │ ├── KeyboardHelper.cs │ │ └── MessageSelector.cs │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── NativeMethods.txt │ ├── Package.appxmanifest │ ├── Properties/ │ │ └── launchSettings.json │ ├── Services/ │ │ ├── KeyService.cs │ │ └── SettingsService.cs │ ├── SettingsWindow.xaml │ ├── SettingsWindow.xaml.cs │ ├── Windows/ │ │ ├── MicaWindow.cs │ │ ├── TransparentBackdrop.cs │ │ └── WindowsSystemDispatcherQueueHelper.cs │ └── app.manifest ├── Clippy.Core/ │ ├── Classes/ │ │ └── Message.cs │ ├── Clippy.Core.csproj │ ├── Constants.cs │ ├── Enums/ │ │ └── Role.cs │ ├── Factories/ │ │ └── MessageFactory.cs │ ├── Interfaces/ │ │ └── IMessage.cs │ ├── Runtime/ │ │ └── IsExternalInit.cs │ ├── Services/ │ │ ├── IChatService.cs │ │ ├── IKeyService.cs │ │ └── ISettingsService.cs │ └── ViewModels/ │ ├── ClippyViewModel.cs │ └── Messages/ │ ├── ClippyMessageViewModel.Streaming.cs │ ├── ClippyMessageViewModel.cs │ ├── MessageViewModel.cs │ ├── SystemMessageViewModel.cs │ └── UserMessageViewModel.cs ├── Clippy.sln ├── CubeKit.UI/ │ ├── Controls/ │ │ ├── Settings/ │ │ │ ├── Converters.cs │ │ │ ├── SettingsBlockControl.xaml │ │ │ ├── SettingsBlockControl.xaml.cs │ │ │ ├── SettingsDisplayControl.xaml │ │ │ └── SettingsDisplayControl.xaml.cs │ │ └── Toolkit/ │ │ ├── DesignTimeHelpers.cs │ │ ├── DropShadowPanel.Properties.cs │ │ ├── DropShadowPanel.xaml │ │ ├── DropShadowPanel.xaml.cs │ │ └── IAlphaMaskProvider.cs │ ├── Converters/ │ │ └── BooleanToVisibilityConverter.cs │ ├── CubeKit.UI.csproj │ ├── Helpers/ │ │ └── NativeHelper.cs │ ├── Icons/ │ │ ├── FluentIconElement.cs │ │ ├── FluentIconSource.cs │ │ ├── FluentSymbol.cs │ │ ├── FluentSymbolIcon.Icons.cs │ │ └── FluentSymbolIcon.cs │ ├── Materials/ │ │ ├── Bloom.html │ │ ├── BloomView.xaml │ │ └── BloomView.xaml.cs │ ├── Styles/ │ │ ├── CubeThemeDictionary.xaml │ │ ├── CubeUI.xaml │ │ ├── GlowGradientUI.xaml │ │ └── WindowChrome.xaml │ └── Themes/ │ └── Generic.xaml ├── LICENSE.txt └── README.md
SYMBOL INDEX (226 symbols across 48 files)
FILE: Clippy.Core/Classes/Message.cs
type Message (line 9) | public record Message(Role Role, string MessageText, DateTime MessageDat...
FILE: Clippy.Core/Constants.cs
class Constants (line 7) | public class Constants
FILE: Clippy.Core/Enums/Role.cs
type Role (line 7) | public enum Role
FILE: Clippy.Core/Factories/MessageFactory.cs
class MessageFactory (line 10) | public class MessageFactory
method GetMessageViewModel (line 12) | public static MessageViewModel GetMessageViewModel(IMessage message)
FILE: Clippy.Core/Interfaces/IMessage.cs
type IMessage (line 9) | public interface IMessage
FILE: Clippy.Core/Runtime/IsExternalInit.cs
class IsExternalInit (line 13) | [EditorBrowsable(EditorBrowsableState.Never)]
FILE: Clippy.Core/Services/IChatService.cs
type IChatService (line 12) | public interface IChatService
method SendChatAsync (line 14) | Task<string> SendChatAsync(IEnumerable<IMessage> Messages);
method StreamChatAsync (line 15) | IAsyncEnumerable<string> StreamChatAsync(IEnumerable<IMessage> Message...
FILE: Clippy.Core/Services/IKeyService.cs
type IKeyService (line 7) | public interface IKeyService
method GetKey (line 9) | public string GetKey();
method SetKey (line 10) | public void SetKey(string key);
FILE: Clippy.Core/Services/ISettingsService.cs
type ISettingsService (line 7) | public interface ISettingsService
FILE: Clippy.Core/ViewModels/ClippyViewModel.cs
class ClippyViewModel (line 21) | public partial class ClippyViewModel : ObservableObject
method ClippyViewModel (line 42) | public ClippyViewModel(IChatService chatService, ISettingsService sett...
method SetupChat (line 50) | private void SetupChat()
method AddMessage (line 56) | private MessageViewModel AddMessage(IMessage message)
method SendPrompt (line 64) | [RelayCommand(IncludeCancelCommand = true)]
method RefreshChat (line 102) | [RelayCommand]
FILE: Clippy.Core/ViewModels/Messages/ClippyMessageViewModel.Streaming.cs
class ClippyMessageViewModel (line 10) | public partial class ClippyMessageViewModel
method StartStreamText (line 24) | public void StartStreamText(CancellationToken cancellationToken, int b...
method AddStreamText (line 55) | public void AddStreamText(string text)
method EndStreamText (line 64) | public void EndStreamText()
FILE: Clippy.Core/ViewModels/Messages/ClippyMessageViewModel.cs
class ClippyMessageViewModel (line 10) | public partial class ClippyMessageViewModel : MessageViewModel
method ClippyMessageViewModel (line 16) | public ClippyMessageViewModel(IMessage message) : base(message)
method Exception (line 20) | public void Exception(Exception exception)
FILE: Clippy.Core/ViewModels/Messages/MessageViewModel.cs
class MessageViewModel (line 10) | public abstract partial class MessageViewModel : ObservableObject
method MessageViewModel (line 16) | public MessageViewModel(IMessage message)
FILE: Clippy.Core/ViewModels/Messages/SystemMessageViewModel.cs
class SystemMessageViewModel (line 8) | public class SystemMessageViewModel : MessageViewModel
method SystemMessageViewModel (line 10) | public SystemMessageViewModel(IMessage message) : base(message)
FILE: Clippy.Core/ViewModels/Messages/UserMessageViewModel.cs
class UserMessageViewModel (line 8) | public class UserMessageViewModel : MessageViewModel
method UserMessageViewModel (line 10) | public UserMessageViewModel(IMessage message) : base(message)
FILE: Clippy/App.xaml.cs
class App (line 36) | public partial class App : Application
method App (line 55) | public App()
method CheckSingleInstance (line 66) | private void CheckSingleInstance()
method ConfigureServices (line 74) | private static IServiceProvider ConfigureServices()
method OnLaunched (line 91) | protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEv...
method ShowClippy (line 101) | public void ShowClippy()
method OpenSettings (line 109) | public void OpenSettings()
method OnUnobservedException (line 123) | private static void OnUnobservedException(object? sender, UnobservedTa...
method OnUnhandledException (line 125) | private static void OnUnhandledException(object? sender, Microsoft.UI....
method CurrentDomain_FirstChanceException (line 127) | private void CurrentDomain_FirstChanceException(object? sender, FirstC...
FILE: Clippy/Controls/APIBox.xaml.cs
class APIBox (line 26) | public sealed partial class APIBox : UserControl
method APIBox (line 30) | public APIBox()
method AddApi (line 36) | private void AddApi()
method PrivacyToIcon (line 57) | private FluentSymbol PrivacyToIcon(bool? boolean) => (boolean ?? false...
method PrivacyToPassword (line 59) | private PasswordRevealMode PrivacyToPassword(bool? boolean) => (boolea...
method ApiBox_KeyDown (line 61) | private void ApiBox_KeyDown(object sender, KeyRoutedEventArgs e)
method Submit_Click (line 67) | private void Submit_Click(object sender, RoutedEventArgs e) => AddApi();
method Accept (line 69) | private void Accept() => KeyBox.Foreground = GreenLinearGradientBrush;
method Reject (line 71) | private void Reject()
FILE: Clippy/Controls/MessageTriangle.xaml.cs
class MessageTriangle (line 21) | public sealed partial class MessageTriangle : UserControl
method MessageTriangle (line 23) | public MessageTriangle()
FILE: Clippy/Controls/Messages/ClippyMessage.xaml.cs
class ClippyMessage (line 27) | public sealed partial class ClippyMessage : UserControl
method ClippyMessage (line 56) | public ClippyMessage()
method Send_Click (line 61) | private void Send_Click(object sender, RoutedEventArgs e)
method SendBox_KeyDown (line 67) | private void SendBox_KeyDown(object sender, KeyRoutedEventArgs e)
method BoolToVis (line 74) | public Visibility BoolToVis(bool b) => b ? Visibility.Visible : Visibi...
method InvertBoolToVis (line 77) | public Visibility InvertBoolToVis(bool b) => b ? Visibility.Collapsed ...
FILE: Clippy/Controls/Messages/SystemMessage.xaml.cs
class SystemMessage (line 21) | public sealed partial class SystemMessage : UserControl
method SystemMessage (line 23) | public SystemMessage()
FILE: Clippy/Controls/Messages/UserMessage.xaml.cs
class UserMessage (line 23) | public sealed partial class UserMessage : UserControl
method UserMessage (line 38) | public UserMessage()
FILE: Clippy/Controls/ShineUITextblock.xaml.cs
class ShineUITextblock (line 23) | public sealed partial class ShineUITextblock : UserControl
method ShineUITextblock (line 47) | public ShineUITextblock()
method MarkdownTextBlock_LinkClicked (line 52) | private async void MarkdownTextBlock_LinkClicked(object sender, LinkCl...
FILE: Clippy/Helpers/ClippyInputHelper.cs
class ClippyInputHelper (line 18) | public class ClippyInputHelper
method PointerPress (line 20) | public static async void PointerPress(IntPtr WindowToIgnore)
method PointerHover (line 36) | public static async void PointerHover(IntPtr WindowToIgnore)
method GetWindowHandleAtPoint (line 52) | public static async Task<IntPtr> GetWindowHandleAtPoint(Point point, I...
FILE: Clippy/Helpers/ClippyKeyboardListener.cs
class ClippyKeyboardListener (line 12) | public class ClippyKeyboardListener
method Setup (line 27) | public static void Setup(WindowEx clippy)
method OnKeyPressed (line 34) | private static void OnKeyPressed(object sender, KeyboardHelperEventArg...
FILE: Clippy/Helpers/KeyboardHelper.cs
class KeyboardHelper (line 11) | public class KeyboardHelper : IDisposable
method KeyboardHelper (line 15) | public KeyboardHelper()
method Dispose (line 38) | protected virtual void Dispose(bool disposing)
method Dispose (line 73) | public void Dispose()
method LoadLibrary (line 85) | [DllImport("kernel32.dll")]
method FreeLibrary (line 88) | [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
method SetWindowsHookEx (line 101) | [DllImport("USER32", SetLastError = true)]
method UnhookWindowsHookEx (line 109) | [DllImport("USER32", SetLastError = true)]
method CallNextHookEx (line 121) | [DllImport("USER32", SetLastError = true)]
type LowLevelKeyboardInputEvent (line 124) | [StructLayout(LayoutKind.Sequential)]
type KeyboardState (line 156) | public enum KeyboardState
method LowLevelKeyboardProc (line 173) | public IntPtr LowLevelKeyboardProc(int nCode, IntPtr wParam, IntPtr lP...
class KeyboardHelperEventArgs (line 194) | public class KeyboardHelperEventArgs : HandledEventArgs
method KeyboardHelperEventArgs (line 199) | public KeyboardHelperEventArgs(
FILE: Clippy/Helpers/MessageSelector.cs
class MessageSelector (line 13) | public partial class MessageSelector : DataTemplateSelector
method SelectTemplateCore (line 19) | protected override DataTemplate SelectTemplateCore(object item)
FILE: Clippy/MainWindow.xaml.cs
class MainWindow (line 50) | public sealed partial class MainWindow : WindowEx
method MainWindow (line 56) | public MainWindow()
method Pin (line 90) | private unsafe void Pin()
method Unpin (line 104) | private unsafe void Unpin()
method WindowMessageReceived (line 117) | private void WindowMessageReceived(object? sender, WindowMessageEventA...
method GetScale (line 126) | private double GetScale()
method Settings_Click (line 140) | private void Settings_Click(object sender, RoutedEventArgs e)
method BtoV (line 145) | private Visibility BtoV(bool b) => b ? Visibility.Visible : Visibility...
method Clippy_Checked (line 147) | private void Clippy_Checked(object sender, RoutedEventArgs e) => Expan...
method Clippy_Unchecked (line 149) | private void Clippy_Unchecked(object sender, RoutedEventArgs e) => Col...
method Collapse (line 151) | private void Collapse()
method Expand (line 164) | private void Expand()
method BoolToVis (line 180) | public Visibility BoolToVis(bool b) => b ? Visibility.Visible : Visibi...
method InvertBoolToVis (line 183) | public Visibility InvertBoolToVis(bool b) => b ? Visibility.Collapsed ...
method Background_PointerPressed (line 185) | private void Background_PointerPressed(object sender, PointerRoutedEve...
method Background_PointerMoved (line 187) | private void Background_PointerMoved(object sender, PointerRoutedEvent...
method TextBox_PreviewKeyDown (line 189) | private void TextBox_PreviewKeyDown(object sender, KeyRoutedEventArgs e)
method TextBox_KeyUp (line 201) | private void TextBox_KeyUp(object sender, KeyRoutedEventArgs e)
method Exit_Click (line 218) | private void Exit_Click(object sender, RoutedEventArgs e) => Applicati...
method Hide_Click (line 220) | private void Hide_Click(object sender, RoutedEventArgs e)
FILE: Clippy/Services/KeyService.cs
class KeyService (line 12) | public class KeyService : IKeyService
method GetKey (line 18) | public string GetKey()
method SetKey (line 30) | public void SetKey(string key) => Vault.Add(new PasswordCredential(Res...
FILE: Clippy/Services/SettingsService.cs
class SettingsService (line 13) | public class SettingsService : ObservableObject, ISettingsService
FILE: Clippy/SettingsWindow.xaml.cs
class SettingsWindow (line 35) | public sealed partial class SettingsWindow : WindowEx
method SettingsWindow (line 39) | public SettingsWindow()
method SetupStartup (line 47) | private async void SetupStartup()
method Star_Click (line 52) | private async void Star_Click(object sender, RoutedEventArgs e) => awa...
method Hub_Click (line 54) | private async void Hub_Click(object sender, RoutedEventArgs e) => awai...
method GitHub_Click (line 56) | private async void GitHub_Click(object sender, RoutedEventArgs e) => a...
method Exit_Click (line 58) | private void Exit_Click(object sender, RoutedEventArgs e) => Applicati...
method UpdateToggleState (line 60) | private void UpdateToggleState(StartupTaskState state)
method StartupToggle_Toggled (line 82) | private async void StartupToggle_Toggled(object sender, RoutedEventArg...
FILE: Clippy/Windows/MicaWindow.cs
class MicaWindow (line 13) | public class MicaWindow
method TrySetMicaBackdrop (line 17) | public bool TrySetMicaBackdrop(WindowEx W)
FILE: Clippy/Windows/TransparentBackdrop.cs
class TransparentBackdrop (line 10) | internal class TransparentBackdrop : SystemBackdrop
method OnTargetConnected (line 18) | protected override void OnTargetConnected(ICompositionSupportsSystemBa...
method OnTargetDisconnected (line 24) | protected override void OnTargetDisconnected(ICompositionSupportsSyste...
FILE: Clippy/Windows/WindowsSystemDispatcherQueueHelper.cs
class WindowsSystemDispatcherQueueHelper (line 6) | public static class WindowsSystemDispatcherQueueHelper
type DispatcherQueueOptions (line 8) | [StructLayout(LayoutKind.Sequential)]
method CreateDispatcherQueueController (line 16) | [DllImport("CoreMessaging.dll")]
method EnsureWindowsSystemDispatcherQueueController (line 20) | public static void EnsureWindowsSystemDispatcherQueueController()
FILE: CubeKit.UI/Controls/Settings/Converters.cs
class ValueConverter (line 14) | public abstract class ValueConverter<TSource, TTarget>
method Convert (line 22) | public TTarget? Convert(TSource? value)
method ConvertBack (line 32) | public TSource? ConvertBack(TTarget? value)
method Convert (line 45) | public object? Convert(object? value, Type? targetType, object? parame...
method ConvertBack (line 59) | public object? ConvertBack(object? value, Type? targetType, object? pa...
method Convert (line 72) | protected virtual TTarget? Convert(TSource? value, object? parameter, ...
method ConvertBack (line 84) | protected virtual TSource? ConvertBack(TTarget? value, object? paramet...
class ToObjectConverter (line 93) | public abstract class ToObjectConverter<T>
method Convert (line 103) | protected override object? Convert(T? value, object? parameter, string...
method ConvertBack (line 115) | protected override T? ConvertBack(object? value, object? parameter, st...
class InverseBooleanConverter (line 124) | public class InverseBooleanConverter
method Convert (line 134) | protected override bool Convert(bool value, object? parameter, string?...
method ConvertBack (line 146) | protected override bool ConvertBack(bool value, object? parameter, str...
class NullToTrueConverter (line 152) | public class NullToTrueConverter
method Convert (line 168) | protected override bool Convert(object? value, object? parameter, stri...
method ConvertBack (line 180) | protected override object? ConvertBack(bool value, object? parameter, ...
class StringNullOrWhiteSpaceToTrueConverter (line 186) | public class StringNullOrWhiteSpaceToTrueConverter
method Convert (line 202) | protected override bool Convert(string? value, object? parameter, stri...
method ConvertBack (line 214) | protected override string ConvertBack(bool value, object? parameter, s...
FILE: CubeKit.UI/Controls/Settings/SettingsBlockControl.xaml.cs
class SettingsBlockControl (line 22) | [ContentProperty(Name = nameof(SettingsActionableElement))]
method SettingsBlockControl (line 110) | public SettingsBlockControl()
method ActionableButton_Click (line 115) | private void ActionableButton_Click(object sender, RoutedEventArgs e)
method Expander_Expanding (line 120) | private void Expander_Expanding(Microsoft.UI.Xaml.Controls.Expander se...
method Expander_Collapsed (line 125) | private void Expander_Collapsed(Microsoft.UI.Xaml.Controls.Expander se...
FILE: CubeKit.UI/Controls/Settings/SettingsDisplayControl.xaml.cs
class SettingsDisplayControl (line 22) | [ContentProperty(Name = nameof(SettingsActionableElement))]
method SettingsDisplayControl (line 79) | public SettingsDisplayControl()
method MainPanel_SizeChanged (line 85) | private void MainPanel_SizeChanged(object sender, SizeChangedEventArgs e)
FILE: CubeKit.UI/Controls/Toolkit/DesignTimeHelpers.cs
class DesignTimeHelpers (line 5) | public static class DesignTimeHelpers
method InitializeDesignerMode (line 27) | private static bool InitializeDesignerMode()
method InitializeDesignMode2 (line 48) | private static bool InitializeDesignMode2()
FILE: CubeKit.UI/Controls/Toolkit/DropShadowPanel.Properties.cs
class DropShadowPanel (line 17) | public partial class DropShadowPanel
method OnBlurRadiusChanged (line 194) | private static void OnBlurRadiusChanged(DependencyObject d, Dependency...
method OnColorChanged (line 202) | private static void OnColorChanged(DependencyObject d, DependencyPrope...
method OnOffsetXChanged (line 210) | private static void OnOffsetXChanged(DependencyObject d, DependencyPro...
method OnOffsetYChanged (line 218) | private static void OnOffsetYChanged(DependencyObject d, DependencyPro...
method OnOffsetZChanged (line 226) | private static void OnOffsetZChanged(DependencyObject d, DependencyPro...
method OnShadowOpacityChanged (line 234) | private static void OnShadowOpacityChanged(DependencyObject d, Depende...
method OnIsMaskedChanged (line 242) | private static void OnIsMaskedChanged(DependencyObject d, DependencyPr...
FILE: CubeKit.UI/Controls/Toolkit/DropShadowPanel.xaml.cs
class DropShadowPanel (line 30) | [TemplatePart(Name = PartShadow, Type = typeof(Border))]
method DropShadowPanel (line 42) | public DropShadowPanel()
method OnApplyTemplate (line 60) | protected override void OnApplyTemplate()
method OnContentChanged (line 80) | protected override void OnContentChanged(object oldContent, object new...
method OnSizeChanged (line 103) | private void OnSizeChanged(object sender, SizeChangedEventArgs e)
method ConfigureShadowVisualForCastingElement (line 111) | private void ConfigureShadowVisualForCastingElement()
method OnBlurRadiusChanged (line 121) | private void OnBlurRadiusChanged(double newValue)
method OnColorChanged (line 129) | private void OnColorChanged(Color newValue)
method OnOffsetXChanged (line 137) | private void OnOffsetXChanged(double newValue)
method OnOffsetYChanged (line 145) | private void OnOffsetYChanged(double newValue)
method OnOffsetZChanged (line 153) | private void OnOffsetZChanged(double newValue)
method OnShadowOpacityChanged (line 161) | private void OnShadowOpacityChanged(double newValue)
method UpdateShadowMask (line 169) | private void UpdateShadowMask()
method CustomMaskedElement_Loaded (line 214) | private void CustomMaskedElement_Loaded(object sender, RoutedEventArgs e)
method UpdateShadowOffset (line 224) | private void UpdateShadowOffset(float x, float y, float z)
method UpdateShadowSize (line 232) | private void UpdateShadowSize()
FILE: CubeKit.UI/Controls/Toolkit/IAlphaMaskProvider.cs
type IAlphaMaskProvider (line 8) | public interface IAlphaMaskProvider
method GetAlphaMask (line 19) | CompositionBrush GetAlphaMask();
FILE: CubeKit.UI/Converters/BooleanToVisibilityConverter.cs
class BooleanToVisibilityConverter (line 11) | public class BooleanToVisibilityConverter : IValueConverter
method Convert (line 13) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 15) | public object ConvertBack(object value, Type targetType, object parame...
FILE: CubeKit.UI/Helpers/NativeHelper.cs
class NativeHelper (line 10) | public static class NativeHelper
method FindWindow (line 22) | [DllImport("user32.dll", SetLastError = true)]
method MonitorFromWindow (line 25) | [DllImport("user32.dll")]
method GetScaleFactorForMonitor (line 28) | [DllImport("shcore.dll")]
method WindowFromPoint (line 31) | [DllImport("user32.dll")]
method GetWindowRect (line 34) | [DllImport("user32.dll")]
method ChildWindowFromPointEx (line 37) | [DllImport("user32.dll")]
method SendMessage (line 40) | [DllImport("user32.dll")]
method GetCursorPos (line 43) | [DllImport("user32.dll")]
method GetWindow (line 47) | [DllImport("user32.dll")]
type Point (line 50) | [StructLayout(LayoutKind.Sequential)]
type RECT (line 57) | public struct RECT
type DeviceScaleFactor (line 65) | public enum DeviceScaleFactor
FILE: CubeKit.UI/Icons/FluentIconElement.cs
class FluentIconElement (line 11) | public sealed class FluentIconElement : PathIcon
method FluentIconElement (line 16) | public FluentIconElement() { }
method FluentIconElement (line 22) | public FluentIconElement(FluentSymbol symbol)
method FluentIconElement (line 30) | public FluentIconElement(FluentIconSource source)
method OnSymbolChanged (line 52) | private static void OnSymbolChanged(DependencyObject d, DependencyProp...
FILE: CubeKit.UI/Icons/FluentIconSource.cs
class FluentIconSource (line 9) | public class FluentIconSource : PathIconSource
method FluentIconSource (line 14) | public FluentIconSource() { }
method FluentIconSource (line 19) | public FluentIconSource(FluentSymbol symbol)
method OnSymbolChanged (line 41) | private static void OnSymbolChanged(DependencyObject d, DependencyProp...
FILE: CubeKit.UI/Icons/FluentSymbol.cs
type FluentSymbol (line 12) | public enum FluentSymbol
FILE: CubeKit.UI/Icons/FluentSymbolIcon.Icons.cs
class FluentSymbolIcon (line 6) | public partial class FluentSymbolIcon
FILE: CubeKit.UI/Icons/FluentSymbolIcon.cs
class FluentSymbolIcon (line 9) | public partial class FluentSymbolIcon : Control
method FluentSymbolIcon (line 13) | public FluentSymbolIcon()
method FluentSymbolIcon (line 21) | public FluentSymbolIcon(FluentSymbol symbol)
method OnApplyTemplate (line 44) | protected override void OnApplyTemplate()
method OnSymbolChanged (line 57) | private static void OnSymbolChanged(DependencyObject d, DependencyProp...
method GetPathIcon (line 69) | public static PathIcon GetPathIcon(FluentSymbol symbol)
method GetPathData (line 82) | public static Geometry GetPathData(int symbol)
method GetPathData (line 90) | public static Geometry GetPathData(FluentSymbol symbol)
FILE: CubeKit.UI/Materials/BloomView.xaml.cs
class BloomView (line 21) | public sealed partial class BloomView : UserControl
method BloomView (line 23) | public BloomView()
method Bloom_SizeChanged (line 30) | private void Bloom_SizeChanged(object sender, SizeChangedEventArgs e)
Condensed preview — 79 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (7,815K chars).
[
{
"path": ".gitattributes",
"chars": 2518,
"preview": "###############################################################################\n# Set default behavior to automatically "
},
{
"path": ".gitignore",
"chars": 6273,
"preview": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n##\n## G"
},
{
"path": "Clippy/App.xaml",
"chars": 71908,
"preview": "<Application\n x:Class=\"Clippy.App\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xmlns:x"
},
{
"path": "Clippy/App.xaml.cs",
"chars": 4256,
"preview": "using Microsoft.Extensions.DependencyInjection;\nusing Microsoft.UI.Xaml;\nusing Microsoft.UI.Xaml.Controls;\nusing Micros"
},
{
"path": "Clippy/Clippy.csproj",
"chars": 5742,
"preview": "<Project Sdk=\"Microsoft.NET.Sdk\">\n <PropertyGroup>\n <OutputType>WinExe</OutputType>\n <TargetFramework>net9.0-win"
},
{
"path": "Clippy/Controls/APIBox.xaml",
"chars": 21583,
"preview": "<UserControl\n x:Class=\"Clippy.Controls.APIBox\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\""
},
{
"path": "Clippy/Controls/APIBox.xaml.cs",
"chars": 2352,
"preview": "using Clippy.Core.Services;\nusing Clippy.Services;\nusing CubeKit.UI.Icons;\nusing Microsoft.Extensions.DependencyInjecti"
},
{
"path": "Clippy/Controls/MessageTriangle.xaml",
"chars": 1550,
"preview": "<UserControl\n x:Class=\"Clippy.Controls.MessageTriangle\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/pres"
},
{
"path": "Clippy/Controls/MessageTriangle.xaml.cs",
"chars": 772,
"preview": "using Microsoft.UI.Xaml;\nusing Microsoft.UI.Xaml.Controls;\nusing Microsoft.UI.Xaml.Controls.Primitives;\nusing Microsoft"
},
{
"path": "Clippy/Controls/Messages/ClippyMessage.xaml",
"chars": 2419,
"preview": "<UserControl\n x:Class=\"Clippy.Controls.Messages.ClippyMessage\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xa"
},
{
"path": "Clippy/Controls/Messages/ClippyMessage.xaml.cs",
"chars": 2545,
"preview": "using Clippy.Core.Services;\nusing Clippy.Core.ViewModels.Messages;\nusing CommunityToolkit.Mvvm.ComponentModel;\nusing Co"
},
{
"path": "Clippy/Controls/Messages/SystemMessage.xaml",
"chars": 485,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<UserControl\n x:Class=\"Clippy.Controls.Messages.SystemMessage\"\n xmlns=\"http"
},
{
"path": "Clippy/Controls/Messages/SystemMessage.xaml.cs",
"chars": 740,
"preview": "using Microsoft.UI.Xaml;\nusing Microsoft.UI.Xaml.Controls;\nusing Microsoft.UI.Xaml.Controls.Primitives;\nusing Microsoft."
},
{
"path": "Clippy/Controls/Messages/UserMessage.xaml",
"chars": 1493,
"preview": "<UserControl\n x:Class=\"Clippy.Controls.Messages.UserMessage\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml"
},
{
"path": "Clippy/Controls/Messages/UserMessage.xaml.cs",
"chars": 1218,
"preview": "using Clippy.Core.ViewModels.Messages;\nusing CommunityToolkit.Mvvm.ComponentModel;\nusing Microsoft.UI.Xaml;\nusing Micro"
},
{
"path": "Clippy/Controls/ShineUITextblock.xaml",
"chars": 1072,
"preview": "<UserControl\n x:Class=\"Clippy.Controls.ShineUITextblock\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/pre"
},
{
"path": "Clippy/Controls/ShineUITextblock.xaml.cs",
"chars": 1737,
"preview": "using CommunityToolkit.WinUI.UI.Controls;\nusing Microsoft.UI.Xaml;\nusing Microsoft.UI.Xaml.Controls;\nusing Microsoft.UI"
},
{
"path": "Clippy/Helpers/ClippyInputHelper.cs",
"chars": 2851,
"preview": "using CubeKit.UI.Helpers;\nusing Microsoft.UI.Xaml.Input;\nusing System;\nusing System.Collections.Generic;\nusing System.C"
},
{
"path": "Clippy/Helpers/ClippyKeyboardListener.cs",
"chars": 1812,
"preview": "using Clippy.Core.Services;\nusing Microsoft.Extensions.DependencyInjection;\nusing System;\nusing System.Collections.Gene"
},
{
"path": "Clippy/Helpers/KeyboardHelper.cs",
"chars": 8933,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Lin"
},
{
"path": "Clippy/Helpers/MessageSelector.cs",
"chars": 816,
"preview": "using Clippy.Core.Classes;\nusing Clippy.Core.ViewModels.Messages;\nusing Microsoft.UI.Xaml;\nusing Microsoft.UI.Xaml.Cont"
},
{
"path": "Clippy/MainWindow.xaml",
"chars": 10537,
"preview": "<winuiex:WindowEx\n xmlns:winuiex=\"using:WinUIEx\"\n x:Class=\"Clippy.MainWindow\"\n xmlns=\"http://schemas.microsoft"
},
{
"path": "Clippy/MainWindow.xaml.cs",
"chars": 7907,
"preview": "using CubeKit.UI.Helpers;\nusing Microsoft.UI.Windowing;\nusing Microsoft.UI.Xaml;\nusing Microsoft.UI.Xaml.Controls;\nusin"
},
{
"path": "Clippy/NativeMethods.txt",
"chars": 58,
"preview": "WINDOW_EX_STYLE\nGetWindowLong\nWM_ERASEBKGND\nSetWindowLong"
},
{
"path": "Clippy/Package.appxmanifest",
"chars": 2253,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Package\n xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows"
},
{
"path": "Clippy/Properties/launchSettings.json",
"chars": 219,
"preview": "{\n \"profiles\": {\n \"Clippy (Package)\": {\n \"commandName\": \"MsixPackage\",\n \"nativeDebugging\": true\n },\n "
},
{
"path": "Clippy/Services/KeyService.cs",
"chars": 768,
"preview": "using Clippy.Core.Services;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing"
},
{
"path": "Clippy/Services/SettingsService.cs",
"chars": 2390,
"preview": "using Clippy.Core.Services;\nusing Clippy.Helpers;\nusing CommunityToolkit.Mvvm.ComponentModel;\nusing System;\nusing Syste"
},
{
"path": "Clippy/SettingsWindow.xaml",
"chars": 11426,
"preview": "<winuiex:WindowEx \n xmlns:winuiex=\"using:WinUIEx\" \n x:Class=\"Clippy.SettingsWindow\"\n xmlns=\"http://schemas.mic"
},
{
"path": "Clippy/SettingsWindow.xaml.cs",
"chars": 3620,
"preview": "using Clippy.Core.Services;\nusing Clippy.Services;\nusing Clippy.Windows;\nusing Microsoft.Extensions.DependencyInjection"
},
{
"path": "Clippy/Windows/MicaWindow.cs",
"chars": 1570,
"preview": "using Microsoft.UI.Composition.SystemBackdrops;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusin"
},
{
"path": "Clippy/Windows/TransparentBackdrop.cs",
"chars": 1097,
"preview": "using System;\nusing Microsoft.UI.Xaml.Media;\nusing Compositor = Windows.UI.Composition.Compositor;\nusing Windows.UI.Com"
},
{
"path": "Clippy/Windows/WindowsSystemDispatcherQueueHelper.cs",
"chars": 1343,
"preview": "using System.Runtime.InteropServices;\nusing Windows.System;\n\nnamespace Clippy.Windows\n{\n public static class Windows"
},
{
"path": "Clippy/app.manifest",
"chars": 720,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n <asse"
},
{
"path": "Clippy.Core/Classes/Message.cs",
"chars": 343,
"preview": "using Clippy.Core.Enums;\nusing Clippy.Core.Interfaces;\nusing System;\nusing System.Collections.Generic;\nusing System.Tex"
},
{
"path": "Clippy.Core/Clippy.Core.csproj",
"chars": 377,
"preview": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n <PropertyGroup>\n <TargetFramework>netstandard2.1</TargetFramework>\n <Nullable"
},
{
"path": "Clippy.Core/Constants.cs",
"chars": 464,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Clippy.Core\n{\n\tpublic class Constants\n\t{\n"
},
{
"path": "Clippy.Core/Enums/Role.cs",
"chars": 168,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Clippy.Core.Enums\n{\n\tpublic enum Role\n\t{\n"
},
{
"path": "Clippy.Core/Factories/MessageFactory.cs",
"chars": 568,
"preview": "using Clippy.Core.Interfaces;\nusing Clippy.Core.ViewModels.Messages;\nusing Clippy.Core.ViewModels;\nusing System;\nusing "
},
{
"path": "Clippy.Core/Interfaces/IMessage.cs",
"chars": 305,
"preview": "using Clippy.Core.Enums;\nusing System;\nusing System.Collections.Generic;\nusing System.Data;\nusing System.Text;\n\nnamespa"
},
{
"path": "Clippy.Core/Runtime/IsExternalInit.cs",
"chars": 479,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Text;\n\nnamespace System.Runti"
},
{
"path": "Clippy.Core/Services/IChatService.cs",
"chars": 475,
"preview": "using Clippy.Core.Classes;\nusing Clippy.Core.Interfaces;\nusing System;\nusing System.Collections.Generic;\nusing System.C"
},
{
"path": "Clippy.Core/Services/IKeyService.cs",
"chars": 221,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Clippy.Core.Services\n{\n public interfa"
},
{
"path": "Clippy.Core/Services/ISettingsService.cs",
"chars": 387,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Clippy.Core.Services\n{\n public interfa"
},
{
"path": "Clippy.Core/ViewModels/ClippyViewModel.cs",
"chars": 2765,
"preview": "using Clippy.Core.Classes;\nusing Clippy.Core.Services;\nusing CommunityToolkit.Mvvm.ComponentModel;\nusing CommunityToolk"
},
{
"path": "Clippy.Core/ViewModels/Messages/ClippyMessageViewModel.Streaming.cs",
"chars": 1796,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Threading"
},
{
"path": "Clippy.Core/ViewModels/Messages/ClippyMessageViewModel.cs",
"chars": 576,
"preview": "using Clippy.Core.Interfaces;\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Threading"
},
{
"path": "Clippy.Core/ViewModels/Messages/MessageViewModel.cs",
"chars": 496,
"preview": "using CommunityToolkit.Mvvm.ComponentModel;\nusing Clippy.Core.Interfaces;\nusing System;\nusing System.Collections.Generi"
},
{
"path": "Clippy.Core/ViewModels/Messages/SystemMessageViewModel.cs",
"chars": 281,
"preview": "using Clippy.Core.Interfaces;\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Clippy.Core"
},
{
"path": "Clippy.Core/ViewModels/Messages/UserMessageViewModel.cs",
"chars": 277,
"preview": "using Clippy.Core.Interfaces;\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Clippy.Core"
},
{
"path": "Clippy.sln",
"chars": 5604,
"preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 17\nVisualStudioVersion = 17.2.3261"
},
{
"path": "CubeKit.UI/Controls/Settings/Converters.cs",
"chars": 7762,
"preview": "using System;\nusing Microsoft.UI.Xaml;\nusing Microsoft.UI.Xaml.Data;\n\n#nullable enable\n\nnamespace CubeKit.UI.Controls.S"
},
{
"path": "CubeKit.UI/Controls/Settings/SettingsBlockControl.xaml",
"chars": 6075,
"preview": "<UserControl\n x:Class=\"CubeKit.UI.Controls.Settings.SettingsBlockControl\"\n xmlns=\"http://schemas.microsoft.com/wi"
},
{
"path": "CubeKit.UI/Controls/Settings/SettingsBlockControl.xaml.cs",
"chars": 4262,
"preview": "using Microsoft.UI.Xaml;\nusing Microsoft.UI.Xaml.Controls;\nusing Microsoft.UI.Xaml.Controls.Primitives;\nusing Microsoft"
},
{
"path": "CubeKit.UI/Controls/Settings/SettingsDisplayControl.xaml",
"chars": 4783,
"preview": "<UserControl\n x:Class=\"CubeKit.UI.Controls.Settings.SettingsDisplayControl\"\n xmlns=\"http://schemas.microsoft.com/"
},
{
"path": "CubeKit.UI/Controls/Settings/SettingsDisplayControl.xaml.cs",
"chars": 3260,
"preview": "using Microsoft.UI.Xaml;\nusing Microsoft.UI.Xaml.Controls;\nusing Microsoft.UI.Xaml.Controls.Primitives;\nusing Microsoft"
},
{
"path": "CubeKit.UI/Controls/Toolkit/DesignTimeHelpers.cs",
"chars": 2670,
"preview": "using System;\n\nnamespace CubeKit.UI.Controls.Toolkit\n{\n public static class DesignTimeHelpers\n {\n private "
},
{
"path": "CubeKit.UI/Controls/Toolkit/DropShadowPanel.Properties.cs",
"chars": 8453,
"preview": "using Microsoft.UI;\nusing Microsoft.UI.Composition;\nusing Microsoft.UI.Xaml;\nusing System;\nusing System.Collections.Gen"
},
{
"path": "CubeKit.UI/Controls/Toolkit/DropShadowPanel.xaml",
"chars": 1754,
"preview": "<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xmlns:x=\"http"
},
{
"path": "CubeKit.UI/Controls/Toolkit/DropShadowPanel.xaml.cs",
"chars": 6894,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Numerics;\nusing System"
},
{
"path": "CubeKit.UI/Controls/Toolkit/IAlphaMaskProvider.cs",
"chars": 735,
"preview": "using Microsoft.UI.Composition;\n\nnamespace CubeKit.UI.Controls.Toolkit\n{\n /// <summary>\n /// Any user control can"
},
{
"path": "CubeKit.UI/Converters/BooleanToVisibilityConverter.cs",
"chars": 586,
"preview": "using Microsoft.UI.Xaml;\nusing Microsoft.UI.Xaml.Data;\nusing System;\nusing System.Collections.Generic;\nusing System.Lin"
},
{
"path": "CubeKit.UI/CubeKit.UI.csproj",
"chars": 2869,
"preview": "<Project Sdk=\"Microsoft.NET.Sdk\">\n <PropertyGroup>\n <TargetFramework>net9.0-windows10.0.22621.0</TargetFramework>\n "
},
{
"path": "CubeKit.UI/Helpers/NativeHelper.cs",
"chars": 2735,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.T"
},
{
"path": "CubeKit.UI/Icons/FluentIconElement.cs",
"chars": 2130,
"preview": "using Microsoft.UI.Xaml;\nusing Microsoft.UI.Xaml.Controls;\n\n// The Templated Control item template is documented at htt"
},
{
"path": "CubeKit.UI/Icons/FluentIconSource.cs",
"chars": 1744,
"preview": "using Microsoft.UI.Xaml;\nusing Microsoft.UI.Xaml.Controls;\n\nnamespace CubeKit.UI.Icons\n{\n /// <summary>\n /// Repr"
},
{
"path": "CubeKit.UI/Icons/FluentSymbol.cs",
"chars": 163661,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nna"
},
{
"path": "CubeKit.UI/Icons/FluentSymbolIcon.Icons.cs",
"chars": 6943202,
"preview": "using System.Collections.Generic;\n\nnamespace CubeKit.UI.Icons\n{\n\n public partial class FluentSymbolIcon\n {\n "
},
{
"path": "CubeKit.UI/Icons/FluentSymbolIcon.cs",
"chars": 3746,
"preview": "using Microsoft.UI.Xaml;\nusing Microsoft.UI.Xaml.Controls;\nusing Microsoft.UI.Xaml.Media;\n\n// The Templated Control ite"
},
{
"path": "CubeKit.UI/Materials/Bloom.html",
"chars": 111365,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\">\n <title></title>\n <script>\nvar uniqueId = 0;function gen"
},
{
"path": "CubeKit.UI/Materials/BloomView.xaml",
"chars": 721,
"preview": "<UserControl\n x:Class=\"CubeKit.UI.Materials.BloomView\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/prese"
},
{
"path": "CubeKit.UI/Materials/BloomView.xaml.cs",
"chars": 1058,
"preview": "using Microsoft.UI.Xaml;\nusing Microsoft.UI.Xaml.Controls;\nusing Microsoft.UI.Xaml.Controls.Primitives;\nusing Microsoft"
},
{
"path": "CubeKit.UI/Styles/CubeThemeDictionary.xaml",
"chars": 7216,
"preview": "<ResourceDictionary\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xmlns:x=\"http://schemas.m"
},
{
"path": "CubeKit.UI/Styles/CubeUI.xaml",
"chars": 6799,
"preview": "<ResourceDictionary\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xmlns:x=\"http://schemas.m"
},
{
"path": "CubeKit.UI/Styles/GlowGradientUI.xaml",
"chars": 225533,
"preview": "<ResourceDictionary\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xmlns:x=\"http://schemas.m"
},
{
"path": "CubeKit.UI/Styles/WindowChrome.xaml",
"chars": 30864,
"preview": "<ResourceDictionary\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xmlns:x=\"http://schemas.mi"
},
{
"path": "CubeKit.UI/Themes/Generic.xaml",
"chars": 1276,
"preview": "<ResourceDictionary\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xmlns:x=\"http://schemas.mi"
},
{
"path": "LICENSE.txt",
"chars": 1069,
"preview": "MIT License\n\nCopyright (c) [year] [fullname]\n\nPermission is hereby granted, free of charge, to any person obtaining a co"
},
{
"path": "README.md",
"chars": 2457,
"preview": "<div align=\"center\">\n<img src=\"https://store-images.s-microsoft.com/image/apps.44246.14443762301762232.2ced24ff-d71a-4ad"
}
]
About this extraction
This page contains the full source code of the FireCubeStudios/Clippy GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 79 files (7.4 MB), approximately 1.9M tokens, and a symbol index with 226 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.