Repository: newlooper/VirtualSpace
Branch: main
Commit: 237d97eee27b
Files: 313
Total size: 2.4 MB
Directory structure:
gitextract_c1e7rff4/
├── .gitignore
├── Bridge/
│ ├── Agent.cs
│ ├── Behavior.cs
│ ├── Bridge.csproj
│ ├── COPYING
│ ├── Channels.cs
│ ├── Interfaces/
│ │ ├── IAppController.cs
│ │ └── IDesktop.cs
│ ├── Resources/
│ │ ├── Images/
│ │ │ ├── Images.Designer.cs
│ │ │ └── Images.resx
│ │ └── Langs/
│ │ ├── WinFormStrings.Designer.cs
│ │ ├── WinFormStrings.resx
│ │ ├── WinFormStrings.zh-Hans.Designer.cs
│ │ └── WinFormStrings.zh-Hans.resx
│ ├── VirtualDesktopNotification.cs
│ └── Window.cs
├── COPYING
├── Configuration/
│ ├── COPYING
│ ├── ConfigTemplate.cs
│ ├── Configuration.csproj
│ ├── Const.cs
│ ├── Converter/
│ │ └── EntityConverter.cs
│ ├── DataAnnotations/
│ │ └── PropertyProtectorAttribute.cs
│ ├── Entity/
│ │ ├── Cluster.cs
│ │ ├── Colour.cs
│ │ ├── KeyBinding.cs
│ │ ├── LogConfig.cs
│ │ ├── Margin.cs
│ │ ├── Mouse.cs
│ │ ├── Navigation.cs
│ │ └── UserInterface.cs
│ ├── Events/
│ │ ├── Entity/
│ │ │ ├── ExpressionTemplate.cs
│ │ │ └── RuleTemplate.cs
│ │ └── Expression/
│ │ ├── Conditions.cs
│ │ └── Conditions.test.cs
│ ├── FodyWeavers.xml
│ ├── Manager.cs
│ ├── Profile.cs
│ └── Profiles/
│ └── Default.cs
├── Helpers/
│ ├── COPYING
│ ├── DwmApi.cs
│ ├── GlobalHotKey.cs
│ ├── Helpers.csproj
│ ├── Images.cs
│ ├── Kernel32.cs
│ ├── LowLevelHooks.cs
│ ├── StringHelper.cs
│ ├── SysInfo.cs
│ ├── TaskSchedulerHelper.cs
│ ├── User32.cs
│ ├── UserMessage.cs
│ ├── VisualEffects.cs
│ ├── Win32.cs
│ ├── WinForms.cs
│ ├── WinMsg.cs
│ └── WinRegistry.cs
├── Ipc/
│ ├── Commons/
│ │ ├── Config.cs
│ │ ├── HostInfo.cs
│ │ ├── Ipc.csproj
│ │ ├── PipeMessage.cs
│ │ └── PipeMessageType.cs
│ ├── IpcClient/
│ │ ├── IpcClient.csproj
│ │ └── IpcPipeClient.cs
│ └── IpcServer/
│ ├── IpcPipeServer.cs
│ └── IpcServer.csproj
├── LinqExpressionBuilder/
│ ├── COPYING
│ ├── Keywords.cs
│ ├── LinqExpressionBuilder.cs
│ └── LinqExpressionBuilder.csproj
├── Logger/
│ ├── COPYING
│ ├── LogMessage.cs
│ ├── Logger.cs
│ ├── Logger.csproj
│ └── Manager.cs
├── Plugin/
│ ├── Commons/
│ │ ├── Plugin.csproj
│ │ ├── PluginInfo.cs
│ │ ├── PluginManager.cs
│ │ └── WinApi.cs
│ └── PluginHost/
│ ├── PluginConst.cs
│ ├── PluginHost.cs
│ └── PluginHost.csproj
├── Plugins.sln/
│ ├── .gitignore
│ ├── COPYING
│ ├── Cube3D/
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── AssemblyInfo.cs
│ │ ├── AutoVersion.tt
│ │ ├── COPYING
│ │ ├── Config/
│ │ │ ├── Const.cs
│ │ │ ├── Settings.cs
│ │ │ └── SettingsManager.cs
│ │ ├── Cube3D.csproj
│ │ ├── D3DImages/
│ │ │ └── D3DImages.cs
│ │ ├── Effects/
│ │ │ ├── Cube.cs
│ │ │ ├── Effect.cs
│ │ │ ├── Fade.cs
│ │ │ ├── Flip.cs
│ │ │ ├── InsideCube.cs
│ │ │ ├── Reveal.cs
│ │ │ └── Slide.cs
│ │ ├── FrameToD3DImage.cs
│ │ ├── Helpers/
│ │ │ ├── User32.cs
│ │ │ ├── Win32.cs
│ │ │ ├── WinMsg.cs
│ │ │ └── WpfConverters.cs
│ │ ├── MainWindow.2D.cs
│ │ ├── MainWindow.3D.cs
│ │ ├── MainWindow.animation.cs
│ │ ├── MainWindow.frame.cs
│ │ ├── MainWindow.hotkeys.cs
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ ├── SettingsWindow.xaml
│ │ ├── SettingsWindow.xaml.cs
│ │ ├── app.manifest
│ │ ├── plugin.json
│ │ └── settings.json
│ ├── Plugins.sln
│ ├── ScreenCapture/
│ │ ├── COPYING
│ │ ├── CaptureHelper.cs
│ │ ├── D3D9ShareCapture.cs
│ │ ├── Direct3D11Helper.cs
│ │ ├── FrameProcessor.cs
│ │ ├── MonitorEnumerationHelper.cs
│ │ ├── ScreenCapture.csproj
│ │ └── WindowEnumerationHelper.cs
│ └── Updater/
│ ├── AutoVersion.tt
│ ├── COPYING
│ ├── Config/
│ │ └── Const.cs
│ ├── HttpClientProgress.cs
│ ├── MainForm.Designer.cs
│ ├── MainForm.cs
│ ├── MainForm.resx
│ ├── Program.cs
│ ├── Resources/
│ │ └── Langs/
│ │ ├── WinFormStrings.resx
│ │ └── WinFormStrings.zh-Hans.resx
│ ├── Updater.csproj
│ └── plugin.json
├── Readme.md
├── Resources/
│ ├── COPYING
│ ├── Images.Designer.cs
│ ├── Images.resx
│ └── Resources.csproj
├── UiAutomation/
│ ├── COPYING
│ ├── UIA.cs
│ └── UiAutomation.csproj
├── VirtualDesktop/
│ ├── VirtualDesktop10/
│ │ ├── COM.cs
│ │ ├── VirtualDesktop.cs
│ │ ├── VirtualDesktop10.csproj
│ │ └── VirtualDesktopManager.cs
│ ├── VirtualDesktop11/
│ │ ├── COM.cs
│ │ ├── VirtualDesktop.cs
│ │ ├── VirtualDesktop11.csproj
│ │ └── VirtualDesktopManager.cs
│ ├── VirtualDesktop11_21H2/
│ │ ├── COM.cs
│ │ ├── VirtualDesktop.cs
│ │ ├── VirtualDesktop11_21H2.csproj
│ │ └── VirtualDesktopManager.cs
│ ├── VirtualDesktop11_23H2/
│ │ ├── COM.cs
│ │ ├── VirtualDesktop.cs
│ │ ├── VirtualDesktop11_23H2.csproj
│ │ └── VirtualDesktopManager.cs
│ ├── VirtualDesktop11_23H2_3085/
│ │ ├── COM.cs
│ │ ├── VirtualDesktop.cs
│ │ ├── VirtualDesktop11_23H2_3085.csproj
│ │ └── VirtualDesktopManager.cs
│ └── VirtualDesktop11_24H2/
│ ├── COM.cs
│ ├── VirtualDesktop.cs
│ ├── VirtualDesktop11_24H2.csproj
│ └── VirtualDesktopManager.cs
├── VirtualDesktopWrapper/
│ ├── DesktopManagerWrapper.cs
│ ├── DesktopManagerWrapper.events.cs
│ ├── DesktopManagerWrapper.wallpaper.cs
│ ├── DesktopWrapper.cs
│ ├── VirtualDesktopWrapper.csproj
│ └── Wrapper11.cs
├── VirtualSpace/
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── AssemblyInfo.cs
│ ├── AutoVersion.tt
│ ├── COPYING
│ ├── Factory/
│ │ └── AppControllerFactory.cs
│ ├── MainWindow.filter.cs
│ ├── MainWindow.hotkeys.cs
│ ├── MainWindow.layout.cs
│ ├── MainWindow.main.cs
│ ├── MainWindow.message.cs
│ ├── MainWindow.style.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── Program.cs
│ ├── Tools/
│ │ ├── SystemTool.cs
│ │ ├── TrayIcon.cs
│ │ └── WindowTool.cs
│ ├── VirtualDesktop/
│ │ ├── Daemon.cs
│ │ ├── DragWindow.Designer.cs
│ │ ├── DragWindow.cs
│ │ ├── DragWindow.resx
│ │ ├── Filters.cs
│ │ ├── Manager.arrangement.cs
│ │ ├── Manager.cs
│ │ ├── Manager.events.cs
│ │ ├── Manager.layout.cs
│ │ ├── Menus.cs
│ │ ├── Navigation.cs
│ │ ├── VirtualDesktopWindow.Designer.cs
│ │ ├── VirtualDesktopWindow.Mouse.cs
│ │ ├── VirtualDesktopWindow.Thumbs.cs
│ │ ├── VirtualDesktopWindow.cs
│ │ ├── VirtualDesktopWindow.resx
│ │ └── VisibleWindow.cs
│ ├── VirtualSpace.csproj
│ ├── WindowFilter.xaml
│ ├── WindowFilter.xaml.cs
│ └── app.manifest
├── VirtualSpace.sln
├── WPF/
│ └── ControlPanel/
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── AssemblyInfo.cs
│ ├── COPYING
│ ├── ControlPanel.csproj
│ ├── ControlPanel.xaml
│ ├── Converters/
│ │ ├── CheckBoxConverter.cs
│ │ ├── CheckBoxStateByIndexConverter.cs
│ │ ├── DrawerStateMutexConverter.cs
│ │ ├── LocConverter.cs
│ │ ├── MouseActionConverter.cs
│ │ ├── RuleFieldConverter.cs
│ │ ├── RuleFieldFromControlNameConverter.cs
│ │ ├── RuleFormDefaultValueConverter.cs
│ │ ├── RuleHeaderByStateConverter.cs
│ │ ├── ThemeConverter.cs
│ │ ├── UIButtonStyleByVdAConverter.cs
│ │ └── WidthHeightConverter.cs
│ ├── ExportResourceDictionary.cs
│ ├── ExportResourceDictionary.xaml
│ ├── Factories/
│ │ ├── NavBarItem.cs
│ │ └── PageFactory.cs
│ ├── FodyWeavers.xml
│ ├── MainWindow.logs.cs
│ ├── MainWindow.theme.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── Pages/
│ │ ├── Control.keyboard.cs
│ │ ├── Control.mouse.cs
│ │ ├── Control.tree.cs
│ │ ├── Control.xaml
│ │ ├── Control.xaml.cs
│ │ ├── Dialogs/
│ │ │ ├── ProfileNameDialog.xaml
│ │ │ ├── ProfileNameDialog.xaml.cs
│ │ │ ├── YesNoWithNote.xaml
│ │ │ └── YesNoWithNote.xaml.cs
│ │ ├── General.xaml
│ │ ├── General.xaml.cs
│ │ ├── Help.xaml
│ │ ├── Help.xaml.cs
│ │ ├── Logs.xaml
│ │ ├── Logs.xaml.cs
│ │ ├── Menus/
│ │ │ ├── Commons/
│ │ │ │ ├── MenuContainer.xaml
│ │ │ │ └── MenuContainer.xaml.cs
│ │ │ ├── LogsMenu.xaml
│ │ │ └── LogsMenu.xaml.cs
│ │ ├── Plugins.xaml
│ │ ├── Plugins.xaml.cs
│ │ ├── Rules.ue.cs
│ │ ├── Rules.xaml
│ │ ├── Rules.xaml.cs
│ │ ├── Settings.xaml
│ │ ├── Settings.xaml.cs
│ │ ├── UI.xaml
│ │ ├── UI.xaml.cs
│ │ └── UserControls/
│ │ ├── RuleForm.xaml
│ │ └── RuleForm.xaml.cs
│ ├── Resources/
│ │ ├── Definitions/
│ │ │ ├── KeyboardTree.json
│ │ │ └── MouseTree.json
│ │ ├── Langs.Designer.cs
│ │ ├── Langs.resx
│ │ └── Langs.zh-Hans.resx
│ ├── RuleEditorWindow.xaml
│ ├── RuleEditorWindow.xaml.cs
│ ├── Validation/
│ │ ├── Helper.cs
│ │ ├── NotEmptyValidationRule.cs
│ │ └── NumberRangeValidationRule.cs
│ └── ViewModels/
│ ├── ControlViewModel.cs
│ ├── FullObservableCollection.cs
│ ├── GeneralViewModel.cs
│ ├── LogsViewModel.cs
│ ├── MenuContainerViewModel.cs
│ ├── PluginsViewModel.cs
│ ├── RulesViewModel.cs
│ ├── SettingsViewModel.cs
│ ├── UIViewModel.cs
│ └── ViewModelBase.cs
└── WinForms/
└── AppController/
├── AppController.Designer.cs
├── AppController.DesktopArrangement.cs
├── AppController.cluster.cs
├── AppController.cs
├── AppController.csproj
├── AppController.keyboard.cs
├── AppController.lang.cs
├── AppController.logs.cs
├── AppController.mouse.cs
├── AppController.nav.cs
├── AppController.plugins.cs
├── AppController.profile.cs
├── AppController.resx
├── AppController.rules.cs
├── AppController.ui.cs
├── AppController.zh-Hans.resx
├── RuleForm.Designer.cs
├── RuleForm.cs
├── RuleForm.resx
└── RuleForm.zh-Hans.resx
================================================
FILE CONTENTS
================================================
================================================
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/
[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
*.tlog
*.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
# Nuget personal access tokens and Credentials
# nuget.config
# 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
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
.idea/
*.sln.iml
AutoVersion.cs
================================================
FILE: Bridge/Agent.cs
================================================
/* Copyright (C) 2021 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
using System.Collections.Generic;
using System.Reflection;
using System.Resources;
namespace VirtualSpace
{
public static class Agent
{
public static readonly Dictionary ValidLangs = new()
{
{"en", "English"},
{"zh-Hans", "中文(简体)"}
};
public static ResourceManager Langs = new(
Assembly.GetExecutingAssembly().GetName().Name + ".Resources.Langs.WinFormStrings",
typeof( Agent ).Assembly );
public static ResourceManager Images = new(
Assembly.GetExecutingAssembly().GetName().Name + ".Resources.Images.Images",
typeof( Agent ).Assembly );
}
}
================================================
FILE: Bridge/Behavior.cs
================================================
/* Copyright (C) 2021 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
using System;
namespace VirtualSpace.Config.Events.Entity
{
public class Behavior
{
public IntPtr Handle;
public string RuleName;
public string WindowTitle;
public int MoveToDesktop { get; set; } = -1;
public bool FollowWindow { get; set; } = true;
public bool PinWindow { get; set; }
public bool PinApp { get; set; }
public int MoveToScreen { get; set; } = -1;
public bool HideFromView { get; set; }
public Behavior Clone()
{
return new Behavior
{
Handle = Handle,
RuleName = RuleName,
WindowTitle = WindowTitle,
MoveToDesktop = MoveToDesktop,
FollowWindow = FollowWindow,
PinWindow = PinWindow,
PinApp = PinApp,
MoveToScreen = MoveToScreen,
HideFromView = HideFromView
};
}
}
}
================================================
FILE: Bridge/Bridge.csproj
================================================
net6.0-windowsenable9WinFormStrings.resxTrueTrueWinFormStrings.zh-Hans.resxTrueTrueTrueTrueImages.resxWinFormStrings.Designer.csResXFileCodeGeneratorWinFormStrings.zh-Hans.Designer.csResXFileCodeGeneratorResXFileCodeGeneratorImages.Designer.cs
================================================
FILE: Bridge/COPYING
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
================================================
FILE: Bridge/Channels.cs
================================================
/* Copyright (C) 2021 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
using System.Threading.Channels;
using VirtualSpace.Config.Events.Entity;
namespace VirtualSpace.Commons
{
public static class Channels
{
public static readonly Channel ActionChannel = Channel.CreateUnbounded();
public static readonly Channel VisibleWindowsChannel = Channel.CreateUnbounded();
public static readonly Channel VirtualDesktopNotifications = Channel.CreateUnbounded();
}
}
================================================
FILE: Bridge/Interfaces/IAppController.cs
================================================
// Copyright (C) 2022 Dylan Cheng (https://github.com/newlooper)
//
// This file is part of VirtualSpace.
//
// VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
//
// VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
using System;
namespace VirtualSpace
{
public interface IAppController
{
public void BringToTop();
public void SetMainWindowHandle( IntPtr handle );
public void Quit();
public void RenderDesktopArrangementButtons( string selectedDa );
public void CreateRuleFromWindowHandle( IntPtr handle );
}
}
================================================
FILE: Bridge/Interfaces/IDesktop.cs
================================================
// Copyright (C) 2023 Dylan Cheng (https://github.com/newlooper)
//
// This file is part of VirtualSpace.
//
// VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
//
// VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
namespace VirtualSpace
{
public interface IDesktop
{
public void MakeVisible();
}
}
================================================
FILE: Bridge/Resources/Images/Images.Designer.cs
================================================
//------------------------------------------------------------------------------
//
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
//
//------------------------------------------------------------------------------
namespace Bridge.Resources.Images {
using System;
///
/// 一个强类型的资源类,用于查找本地化的字符串等。
///
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Images {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Images() {
}
///
/// 返回此类使用的缓存的 ResourceManager 实例。
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Bridge.Resources.Images.Images", typeof(Images).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
///
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] AboutLogo_2 {
get {
object obj = ResourceManager.GetObject("AboutLogo_2", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Big0Black {
get {
object obj = ResourceManager.GetObject("Big0Black", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Big0White {
get {
object obj = ResourceManager.GetObject("Big0White", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Big1Black {
get {
object obj = ResourceManager.GetObject("Big1Black", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Big1White {
get {
object obj = ResourceManager.GetObject("Big1White", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Big2Black {
get {
object obj = ResourceManager.GetObject("Big2Black", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Big2White {
get {
object obj = ResourceManager.GetObject("Big2White", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Big3Black {
get {
object obj = ResourceManager.GetObject("Big3Black", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Big3White {
get {
object obj = ResourceManager.GetObject("Big3White", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Big4Black {
get {
object obj = ResourceManager.GetObject("Big4Black", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Big4White {
get {
object obj = ResourceManager.GetObject("Big4White", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Big5Black {
get {
object obj = ResourceManager.GetObject("Big5Black", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Big5White {
get {
object obj = ResourceManager.GetObject("Big5White", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Big6Black {
get {
object obj = ResourceManager.GetObject("Big6Black", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Big6White {
get {
object obj = ResourceManager.GetObject("Big6White", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Big7Black {
get {
object obj = ResourceManager.GetObject("Big7Black", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Big7White {
get {
object obj = ResourceManager.GetObject("Big7White", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Big8Black {
get {
object obj = ResourceManager.GetObject("Big8Black", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Big8White {
get {
object obj = ResourceManager.GetObject("Big8White", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Big9Black {
get {
object obj = ResourceManager.GetObject("Big9Black", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Big9White {
get {
object obj = ResourceManager.GetObject("Big9White", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Small0Black {
get {
object obj = ResourceManager.GetObject("Small0Black", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Small0White {
get {
object obj = ResourceManager.GetObject("Small0White", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Small1Black {
get {
object obj = ResourceManager.GetObject("Small1Black", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Small1White {
get {
object obj = ResourceManager.GetObject("Small1White", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Small2Black {
get {
object obj = ResourceManager.GetObject("Small2Black", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Small2White {
get {
object obj = ResourceManager.GetObject("Small2White", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Small3Black {
get {
object obj = ResourceManager.GetObject("Small3Black", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Small3White {
get {
object obj = ResourceManager.GetObject("Small3White", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Small4Black {
get {
object obj = ResourceManager.GetObject("Small4Black", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Small4White {
get {
object obj = ResourceManager.GetObject("Small4White", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Small5Black {
get {
object obj = ResourceManager.GetObject("Small5Black", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Small5White {
get {
object obj = ResourceManager.GetObject("Small5White", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Small6Black {
get {
object obj = ResourceManager.GetObject("Small6Black", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Small6White {
get {
object obj = ResourceManager.GetObject("Small6White", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Small7Black {
get {
object obj = ResourceManager.GetObject("Small7Black", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Small7White {
get {
object obj = ResourceManager.GetObject("Small7White", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Small8Black {
get {
object obj = ResourceManager.GetObject("Small8Black", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Small8White {
get {
object obj = ResourceManager.GetObject("Small8White", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Small9Black {
get {
object obj = ResourceManager.GetObject("Small9Black", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] Small9White {
get {
object obj = ResourceManager.GetObject("Small9White", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] TrayIcon {
get {
object obj = ResourceManager.GetObject("TrayIcon", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] TrayIconBack_Black {
get {
object obj = ResourceManager.GetObject("TrayIconBack_Black", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] TrayIconBack_Default {
get {
object obj = ResourceManager.GetObject("TrayIconBack_Default", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] TrayIconBack_White {
get {
object obj = ResourceManager.GetObject("TrayIconBack_White", resourceCulture);
return ((byte[])(obj));
}
}
}
}
================================================
FILE: Bridge/Resources/Images/Images.resx
================================================
text/microsoft-resx2.0System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\aboutlogo_2.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\big0black.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\big0white.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\big1black.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\big1white.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\big2black.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\big2white.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\big3black.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\big3white.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\big4black.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\big4white.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\big5black.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\big5white.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\big6black.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\big6white.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\big7black.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\big7white.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\big8black.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\big8white.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\big9black.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\big9white.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\small0black.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\small0white.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\small1black.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\small1white.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\small2black.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\small2white.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\small3black.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\small3white.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\small4black.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\small4white.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\small5black.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\small5white.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\small6black.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\small6white.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\small7black.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\small7white.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\small8black.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\small8white.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\small9black.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\small9white.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\trayicon.ico;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\trayiconback_black.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\trayiconback_default.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..\trayiconback_white.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
================================================
FILE: Bridge/Resources/Langs/WinFormStrings.Designer.cs
================================================
//------------------------------------------------------------------------------
//
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
//
//------------------------------------------------------------------------------
namespace Bridge.Resources.Langs {
using System;
///
/// 一个强类型的资源类,用于查找本地化的字符串等。
///
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class WinFormStrings {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal WinFormStrings() {
}
///
/// 返回此类使用的缓存的 ResourceManager 实例。
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Bridge.Resources.Langs.WinFormStrings", typeof(WinFormStrings).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
///
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
///
/// 查找类似 Current Desktop: 的本地化字符串。
///
internal static string Cluster_Notification_SVD_Current {
get {
return ResourceManager.GetString("Cluster.Notification.SVD.Current", resourceCulture);
}
}
///
/// 查找类似 Last Desktop: 的本地化字符串。
///
internal static string Cluster_Notification_SVD_Last {
get {
return ResourceManager.GetString("Cluster.Notification.SVD.Last", resourceCulture);
}
}
///
/// 查找类似 Window 【{0}】 match rule 【{1}】, but error occur when moving.
///possible reason:
///- window invalid.
///- target desktop not exists.
///- target desktop invalid. 的本地化字符串。
///
internal static string Error_MoveWindowToDesktop {
get {
return ResourceManager.GetString("Error.MoveWindowToDesktop", resourceCulture);
}
}
///
/// 查找类似 Error! 的本地化字符串。
///
internal static string Error_Title {
get {
return ResourceManager.GetString("Error.Title", resourceCulture);
}
}
///
/// 查找类似 Cannot access task with your current permissions level.
///You need to run this application 'as administrator' even if you are using an administrator account. 的本地化字符串。
///
internal static string General_RunOnStartup_Error_Permission {
get {
return ResourceManager.GetString("General.RunOnStartup.Error.Permission", resourceCulture);
}
}
///
/// 查找类似 Down 的本地化字符串。
///
internal static string hk_node_nav_down {
get {
return ResourceManager.GetString("hk_node_nav_down", resourceCulture);
}
}
///
/// 查找类似 Left 的本地化字符串。
///
internal static string hk_node_nav_left {
get {
return ResourceManager.GetString("hk_node_nav_left", resourceCulture);
}
}
///
/// 查找类似 Right 的本地化字符串。
///
internal static string hk_node_nav_right {
get {
return ResourceManager.GetString("hk_node_nav_right", resourceCulture);
}
}
///
/// 查找类似 Up 的本地化字符串。
///
internal static string hk_node_nav_up {
get {
return ResourceManager.GetString("hk_node_nav_up", resourceCulture);
}
}
///
/// 查找类似 Open AppController 的本地化字符串。
///
internal static string hk_node_open_app_controller {
get {
return ResourceManager.GetString("hk_node_open_app_controller", resourceCulture);
}
}
///
/// 查找类似 Rise MainView 的本地化字符串。
///
internal static string hk_node_rise_mainview {
get {
return ResourceManager.GetString("hk_node_rise_mainview", resourceCulture);
}
}
///
/// 查找类似 Rise MainView For Active App 的本地化字符串。
///
internal static string hk_node_rise_mainview_for_active_app {
get {
return ResourceManager.GetString("hk_node_rise_mainview_for_active_app", resourceCulture);
}
}
///
/// 查找类似 Rise MainView For Active App In Current Desktop 的本地化字符串。
///
internal static string hk_node_rise_mainview_for_active_app_in_current_vd {
get {
return ResourceManager.GetString("hk_node_rise_mainview_for_active_app_in_current_vd", resourceCulture);
}
}
///
/// 查找类似 Rise MainView For Current Desktop 的本地化字符串。
///
internal static string hk_node_rise_mainview_for_current_vd {
get {
return ResourceManager.GetString("hk_node_rise_mainview_for_current_vd", resourceCulture);
}
}
///
/// 查找类似 Toggle Window Filter 的本地化字符串。
///
internal static string hk_node_toggle_window_filter {
get {
return ResourceManager.GetString("hk_node_toggle_window_filter", resourceCulture);
}
}
///
/// 查找类似 Desktop 的本地化字符串。
///
internal static string K_D {
get {
return ResourceManager.GetString("K_D", resourceCulture);
}
}
///
/// 查找类似 Navigation 的本地化字符串。
///
internal static string K_D_N {
get {
return ResourceManager.GetString("K_D_N", resourceCulture);
}
}
///
/// 查找类似 Switch 的本地化字符串。
///
internal static string K_D_S {
get {
return ResourceManager.GetString("K_D_S", resourceCulture);
}
}
///
/// 查找类似 General 的本地化字符串。
///
internal static string K_G {
get {
return ResourceManager.GetString("K_G", resourceCulture);
}
}
///
/// 查找类似 Window 的本地化字符串。
///
internal static string K_W {
get {
return ResourceManager.GetString("K_W", resourceCulture);
}
}
///
/// 查找类似 Move 的本地化字符串。
///
internal static string K_W_M {
get {
return ResourceManager.GetString("K_W_M", resourceCulture);
}
}
///
/// 查找类似 Move and Follow 的本地化字符串。
///
internal static string K_W_MF {
get {
return ResourceManager.GetString("K_W_MF", resourceCulture);
}
}
///
/// 查找类似 Hotkey Cleared. 的本地化字符串。
///
internal static string KB_Hotkey_Cleared {
get {
return ResourceManager.GetString("KB.Hotkey.Cleared", resourceCulture);
}
}
///
/// 查找类似 Must choose a none-modifier Key. 的本地化字符串。
///
internal static string KB_Hotkey_KeyCheck {
get {
return ResourceManager.GetString("KB.Hotkey.KeyCheck", resourceCulture);
}
}
///
/// 查找类似 At least one modifier Key. 的本地化字符串。
///
internal static string KB_Hotkey_MKeyCheck {
get {
return ResourceManager.GetString("KB.Hotkey.MKeyCheck", resourceCulture);
}
}
///
/// 查找类似 Move To Desktop 的本地化字符串。
///
internal static string KB_Hotkey_MW {
get {
return ResourceManager.GetString("KB.Hotkey.MW", resourceCulture);
}
}
///
/// 查找类似 Move and Follow To Desktop 的本地化字符串。
///
internal static string KB_Hotkey_MWF {
get {
return ResourceManager.GetString("KB.Hotkey.MWF", resourceCulture);
}
}
///
/// 查找类似 Register new Hotkey Failed. 的本地化字符串。
///
internal static string KB_Hotkey_Reg_Fail {
get {
return ResourceManager.GetString("KB.Hotkey.Reg.Fail", resourceCulture);
}
}
///
/// 查找类似 Register new Hotkey Success. 的本地化字符串。
///
internal static string KB_Hotkey_Reg_Success {
get {
return ResourceManager.GetString("KB.Hotkey.Reg.Success", resourceCulture);
}
}
///
/// 查找类似 Settings Saved. 的本地化字符串。
///
internal static string KB_Hotkey_SettingsSaved {
get {
return ResourceManager.GetString("KB.Hotkey.SettingsSaved", resourceCulture);
}
}
///
/// 查找类似 Switch To Desktop 的本地化字符串。
///
internal static string KB_Hotkey_SVD {
get {
return ResourceManager.GetString("KB.Hotkey.SVD", resourceCulture);
}
}
///
/// 查找类似 Switch Back To Last Desktop 的本地化字符串。
///
internal static string KB_Hotkey_SVD_BACK_LAST {
get {
return ResourceManager.GetString("KB.Hotkey.SVD_BACK_LAST", resourceCulture);
}
}
///
/// 查找类似 Left 的本地化字符串。
///
internal static string Keys_Left {
get {
return ResourceManager.GetString("Keys.Left", resourceCulture);
}
}
///
/// 查找类似 Middle 的本地化字符串。
///
internal static string Keys_Middle {
get {
return ResourceManager.GetString("Keys.Middle", resourceCulture);
}
}
///
/// 查找类似 Right 的本地化字符串。
///
internal static string Keys_Right {
get {
return ResourceManager.GetString("Keys.Right", resourceCulture);
}
}
///
/// 查找类似 Show ContextMenu 的本地化字符串。
///
internal static string M_ContextMenu {
get {
return ResourceManager.GetString("M.ContextMenu", resourceCulture);
}
}
///
/// 查找类似 Desktop 的本地化字符串。
///
internal static string M_D {
get {
return ResourceManager.GetString("M.D", resourceCulture);
}
}
///
/// 查找类似 Show Only Selected Desktop in View 的本地化字符串。
///
internal static string M_D_DesktopShowForSelectedDesktop {
get {
return ResourceManager.GetString("M.D.DesktopShowForSelectedDesktop", resourceCulture);
}
}
///
/// 查找类似 Switch Desktop and Close View 的本地化字符串。
///
internal static string M_D_DesktopVisibleAndCloseView {
get {
return ResourceManager.GetString("M.D.DesktopVisibleAndCloseView", resourceCulture);
}
}
///
/// 查找类似 Switch Desktop Only 的本地化字符串。
///
internal static string M_D_DesktopVisibleOnly {
get {
return ResourceManager.GetString("M.D.DesktopVisibleOnly", resourceCulture);
}
}
///
/// 查找类似 MainView 的本地化字符串。
///
internal static string M_ROOT {
get {
return ResourceManager.GetString("M.ROOT", resourceCulture);
}
}
///
/// 查找类似 Window 的本地化字符串。
///
internal static string M_W {
get {
return ResourceManager.GetString("M.W", resourceCulture);
}
}
///
/// 查找类似 Active Window, Switch Desktop and Close View 的本地化字符串。
///
internal static string M_W_WindowActiveDesktopVisibleAndCloseView {
get {
return ResourceManager.GetString("M.W.WindowActiveDesktopVisibleAndCloseView", resourceCulture);
}
}
///
/// 查找类似 Active Window, Switch Desktop Only 的本地化字符串。
///
internal static string M_W_WindowActiveDesktopVisibleOnly {
get {
return ResourceManager.GetString("M.W.WindowActiveDesktopVisibleOnly", resourceCulture);
}
}
///
/// 查找类似 Close Window 的本地化字符串。
///
internal static string M_W_WindowClose {
get {
return ResourceManager.GetString("M.W.WindowClose", resourceCulture);
}
}
///
/// 查找类似 Hide From View 的本地化字符串。
///
internal static string M_W_WindowHideFromView {
get {
return ResourceManager.GetString("M.W.WindowHideFromView", resourceCulture);
}
}
///
/// 查找类似 Show Windows Only From Selected App in Selected Desktop 的本地化字符串。
///
internal static string M_W_WindowShowForSelectedProcessInSelectedDesktop {
get {
return ResourceManager.GetString("M.W.WindowShowForSelectedProcessInSelectedDesktop", resourceCulture);
}
}
///
/// 查找类似 Show Windows Only From Selected App 的本地化字符串。
///
internal static string M_W_WindowShowForSelectedProcessOnly {
get {
return ResourceManager.GetString("M.W.WindowShowForSelectedProcessOnly", resourceCulture);
}
}
///
/// 查找类似 Show Context Menu 的本地化字符串。
///
internal static string Mouse_Action_ContextMenu {
get {
return ResourceManager.GetString("Mouse.Action.ContextMenu", resourceCulture);
}
}
///
/// 查找类似 Show Only Selected Desktop in MainView 的本地化字符串。
///
internal static string Mouse_Action_DesktopShowForSelectedDesktop {
get {
return ResourceManager.GetString("Mouse.Action.DesktopShowForSelectedDesktop", resourceCulture);
}
}
///
/// 查找类似 Switch Desktop And Close View 的本地化字符串。
///
internal static string Mouse_Action_DesktopVisibleAndCloseView {
get {
return ResourceManager.GetString("Mouse.Action.DesktopVisibleAndCloseView", resourceCulture);
}
}
///
/// 查找类似 Switch Desktop Only 的本地化字符串。
///
internal static string Mouse_Action_DesktopVisibleOnly {
get {
return ResourceManager.GetString("Mouse.Action.DesktopVisibleOnly", resourceCulture);
}
}
///
/// 查找类似 Do Nothing 的本地化字符串。
///
internal static string Mouse_Action_DoNothing {
get {
return ResourceManager.GetString("Mouse.Action.DoNothing", resourceCulture);
}
}
///
/// 查找类似 Active Window, Switch Virtual Desktop And Close View 的本地化字符串。
///
internal static string Mouse_Action_WindowActiveDesktopVisibleAndCloseView {
get {
return ResourceManager.GetString("Mouse.Action.WindowActiveDesktopVisibleAndCloseView", resourceCulture);
}
}
///
/// 查找类似 Active Window, Switch Virtual Desktop Only 的本地化字符串。
///
internal static string Mouse_Action_WindowActiveDesktopVisibleOnly {
get {
return ResourceManager.GetString("Mouse.Action.WindowActiveDesktopVisibleOnly", resourceCulture);
}
}
///
/// 查找类似 Close Window 的本地化字符串。
///
internal static string Mouse_Action_WindowClose {
get {
return ResourceManager.GetString("Mouse.Action.WindowClose", resourceCulture);
}
}
///
/// 查找类似 Show Windows Only From Selected App in Selected Desktop 的本地化字符串。
///
internal static string Mouse_Action_WindowShowForSelectedProcessInSelectedDesktop {
get {
return ResourceManager.GetString("Mouse.Action.WindowShowForSelectedProcessInSelectedDesktop", resourceCulture);
}
}
///
/// 查找类似 Show Windows Only From Selected App 的本地化字符串。
///
internal static string Mouse_Action_WindowShowForSelectedProcessOnly {
get {
return ResourceManager.GetString("Mouse.Action.WindowShowForSelectedProcessOnly", resourceCulture);
}
}
///
/// 查找类似 MouseAction Exists, try another combine or Mousebutton 的本地化字符串。
///
internal static string Mouse_Tips_Exists {
get {
return ResourceManager.GetString("Mouse.Tips.Exists", resourceCulture);
}
}
///
/// 查找类似 Confirm 的本地化字符串。
///
internal static string MsgBox_Caption_Confirm {
get {
return ResourceManager.GetString("MsgBox.Caption.Confirm", resourceCulture);
}
}
///
/// 查找类似 Warning 的本地化字符串。
///
internal static string MsgBox_Caption_Warning {
get {
return ResourceManager.GetString("MsgBox.Caption.Warning", resourceCulture);
}
}
///
/// 查找类似 Next row 的本地化字符串。
///
internal static string Nav_CircleHType_NextRow {
get {
return ResourceManager.GetString("Nav.CircleHType.NextRow", resourceCulture);
}
}
///
/// 查找类似 Same row 的本地化字符串。
///
internal static string Nav_CircleHType_SameRow {
get {
return ResourceManager.GetString("Nav.CircleHType.SameRow", resourceCulture);
}
}
///
/// 查找类似 Are you sure to delete this profile?
///All files related with this profile will be deleted too. 的本地化字符串。
///
internal static string Profile_Confirm_Delete {
get {
return ResourceManager.GetString("Profile.Confirm.Delete", resourceCulture);
}
}
///
/// 查找类似 Invalid profile name, or profile name already exists. 的本地化字符串。
///
internal static string Profile_Warning_InvalidProfileName {
get {
return ResourceManager.GetString("Profile.Warning.InvalidProfileName", resourceCulture);
}
}
///
/// 查找类似 Can not rename or delete the last profile.
///Duplicate one and edit it. 的本地化字符串。
///
internal static string Profile_Warning_LastProfileProtect {
get {
return ResourceManager.GetString("Profile.Warning.LastProfileProtect", resourceCulture);
}
}
///
/// 查找类似 At least one common rule is required. 的本地化字符串。
///
internal static string Rule_AtLeastOne {
get {
return ResourceManager.GetString("Rule.AtLeastOne", resourceCulture);
}
}
///
/// 查找类似 Invalid Regex. 的本地化字符串。
///
internal static string Rule_InvalidRegex {
get {
return ResourceManager.GetString("Rule.InvalidRegex", resourceCulture);
}
}
///
/// 查找类似 is required. 的本地化字符串。
///
internal static string Rule_NameRequired {
get {
return ResourceManager.GetString("Rule.NameRequired", resourceCulture);
}
}
///
/// 查找类似 New Rule 的本地化字符串。
///
internal static string Rule_New {
get {
return ResourceManager.GetString("Rule.New", resourceCulture);
}
}
///
/// 查找类似 is 的本地化字符串。
///
internal static string Rule_Op_Eq {
get {
return ResourceManager.GetString("Rule.Op.Eq", resourceCulture);
}
}
///
/// 查找类似 ends with 的本地化字符串。
///
internal static string Rule_Op_Esw {
get {
return ResourceManager.GetString("Rule.Op.Esw", resourceCulture);
}
}
///
/// 查找类似 regex 的本地化字符串。
///
internal static string Rule_Op_Regex {
get {
return ResourceManager.GetString("Rule.Op.Regex", resourceCulture);
}
}
///
/// 查找类似 contains 的本地化字符串。
///
internal static string Rule_Op_Sc {
get {
return ResourceManager.GetString("Rule.Op.Sc", resourceCulture);
}
}
///
/// 查找类似 starts with 的本地化字符串。
///
internal static string Rule_Op_Ssw {
get {
return ResourceManager.GetString("Rule.Op.Ssw", resourceCulture);
}
}
///
/// 查找类似 Quit 的本地化字符串。
///
internal static string Tray_Menu_Quit {
get {
return ResourceManager.GetString("Tray.Menu.Quit", resourceCulture);
}
}
///
/// 查找类似 Settings 的本地化字符串。
///
internal static string Tray_Menu_Settings {
get {
return ResourceManager.GetString("Tray.Menu.Settings", resourceCulture);
}
}
///
/// 查找类似 Mouse Button Required 的本地化字符串。
///
internal static string Validation_Mouse_Button_Required {
get {
return ResourceManager.GetString("Validation.Mouse.Button.Required", resourceCulture);
}
}
///
/// 查找类似 Create Virtual Desktop 的本地化字符串。
///
internal static string VDW_CTM_Desktop_Create {
get {
return ResourceManager.GetString("VDW.CTM.Desktop.Create", resourceCulture);
}
}
///
/// 查找类似 Remove Virtual Desktop 的本地化字符串。
///
internal static string VDW_CTM_Desktop_Remove {
get {
return ResourceManager.GetString("VDW.CTM.Desktop.Remove", resourceCulture);
}
}
///
/// 查找类似 Unhide Window 的本地化字符串。
///
internal static string VDW_CTM_Desktop_UnHideWindow {
get {
return ResourceManager.GetString("VDW.CTM.Desktop.UnHideWindow", resourceCulture);
}
}
///
/// 查找类似 Close 的本地化字符串。
///
internal static string VDW_CTM_Window_Close {
get {
return ResourceManager.GetString("VDW.CTM.Window.Close", resourceCulture);
}
}
///
/// 查找类似 Hide from view 的本地化字符串。
///
internal static string VDW_CTM_Window_HideFromView {
get {
return ResourceManager.GetString("VDW.CTM.Window.HideFromView", resourceCulture);
}
}
///
/// 查找类似 Create Rule from this Window... 的本地化字符串。
///
internal static string VDW_CTM_Window_NewRule {
get {
return ResourceManager.GetString("VDW.CTM.Window.NewRule", resourceCulture);
}
}
///
/// 查找类似 Show windows from this app on all desktops 的本地化字符串。
///
internal static string VDW_CTM_Window_PinApp {
get {
return ResourceManager.GetString("VDW.CTM.Window.PinApp", resourceCulture);
}
}
///
/// 查找类似 Show this window on all desktops 的本地化字符串。
///
internal static string VDW_CTM_Window_PinWin {
get {
return ResourceManager.GetString("VDW.CTM.Window.PinWin", resourceCulture);
}
}
///
/// 查找类似 Screen 的本地化字符串。
///
internal static string VDW_CTM_Window_Screen {
get {
return ResourceManager.GetString("VDW.CTM.Window.Screen", resourceCulture);
}
}
///
/// 查找类似 Unsupported Windows Version.
///Application Will Quit.
///
///Support List
///====================================
///Windows 10 Redstone5(17763)
///Windows 10 19H1(18362)
///Windows 10 19H2(18363)
///Windows 10 20H1(19041)
///Windows 10 20H2(19042)
///Windows 10 21H1(19043)
///Windows 10 21H2(19044)
///Windows 10 22H2(19045)
///Windows 11 21H2(22000)
///Windows 11 22H2(22621)
///Windows 11 23H2(22631)
///==================================== 的本地化字符串。
///
internal static string VersionCheckFail {
get {
return ResourceManager.GetString("VersionCheckFail", resourceCulture);
}
}
}
}
================================================
FILE: Bridge/Resources/Langs/WinFormStrings.resx
================================================
text/microsoft-resx2.0System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089Create Virtual DesktopRemove Virtual DesktopCloseShow windows from this app on all desktopsShow this window on all desktopsUnsupported Windows Version.
Application Will Quit.
Support List
====================================
Windows 10 Redstone5(17763)
Windows 10 19H1(18362)
Windows 10 19H2(18363)
Windows 10 20H1(19041)
Windows 10 20H2(19042)
Windows 10 21H1(19043)
Windows 10 21H2(19044)
Windows 10 22H2(19045)
Windows 11 21H2(22000)
Windows 11 22H2(22621)
Windows 11 23H2(22631)
====================================is required.isstarts withends withcontainsregexAt least one common rule is required.Invalid Regex.Create Rule from this Window...New RuleWindow 【{0}】 match rule 【{1}】, but error occur when moving.
possible reason:
- window invalid.
- target desktop not exists.
- target desktop invalid.Error!Hide from viewUnhide WindowScreenNext rowSame rowHotkey Cleared.Register new Hotkey Success.Register new Hotkey Failed.Settings Saved.Must choose a none-modifier Key.Do NothingSwitch Desktop And Close ViewSwitch Desktop OnlyShow Context MenuActive Window, Switch Virtual Desktop And Close ViewActive Window, Switch Virtual Desktop OnlyClose WindowCurrent Desktop: Last Desktop: Cannot access task with your current permissions level.
You need to run this application 'as administrator' even if you are using an administrator account.Show Windows Only From Selected AppSwitch To Desktop Move To Desktop Move and Follow To Desktop Show Windows Only From Selected App in Selected DesktopLeftMiddleRightShow Only Selected Desktop in MainViewSwitch Back To Last DesktopAre you sure to delete this profile?
All files related with this profile will be deleted too.Can not rename or delete the last profile.
Duplicate one and edit it.Invalid profile name, or profile name already exists.WarningConfirmSettingsQuitGeneralRise MainViewOpen AppControllerRise MainView For Active AppRise MainView For Current DesktopRise MainView For Active App In Current DesktopDesktopSwitchNavigationWindowMoveMove and FollowRightUpDownLeftAt least one modifier Key.DesktopWindowMainViewSwitch Desktop and Close ViewSwitch Desktop OnlyShow ContextMenuShow Only Selected Desktop in ViewActive Window, Switch Desktop and Close ViewActive Window, Switch Desktop OnlyHide From ViewClose WindowShow Windows Only From Selected AppShow Windows Only From Selected App in Selected DesktopMouse Button RequiredMouseAction Exists, try another combine or MousebuttonToggle Window Filter
================================================
FILE: Bridge/Resources/Langs/WinFormStrings.zh-Hans.Designer.cs
================================================
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
//------------------------------------------------------------------------------
namespace VirtualSpace.Resources.Langs {
using System;
///
/// A strongly-typed resource class, for looking up localized strings, etc.
///
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class WinFormStrings_zh_Hans {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal WinFormStrings_zh_Hans() {
}
///
/// Returns the cached ResourceManager instance used by this class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Bridge.Resources.Langs.WinFormStrings.zh-Hans", typeof(WinFormStrings_zh_Hans).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
///
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
///
/// Looks up a localized string similar to 当前桌面:.
///
internal static string Cluster_Notification_SVD_Current {
get {
return ResourceManager.GetString("Cluster.Notification.SVD.Current", resourceCulture);
}
}
///
/// Looks up a localized string similar to 上一个桌面:.
///
internal static string Cluster_Notification_SVD_Last {
get {
return ResourceManager.GetString("Cluster.Notification.SVD.Last", resourceCulture);
}
}
///
/// Looks up a localized string similar to 窗口 【{0}】 匹配规则 【{1}】,但移动时发生错误。
///可能的原因:
///- 窗口无效。
///- 目标桌面不存在。
///- 目标桌面无效。.
///
internal static string Error_MoveWindowToDesktop {
get {
return ResourceManager.GetString("Error.MoveWindowToDesktop", resourceCulture);
}
}
///
/// Looks up a localized string similar to 错误!.
///
internal static string Error_Title {
get {
return ResourceManager.GetString("Error.Title", resourceCulture);
}
}
///
/// Looks up a localized string similar to 当前权限级别无法访问计划任务,
///请确保当前账户是此计算机的管理员并且“以管理员身份运行”运行此程序。.
///
internal static string General_RunOnStartup_Error_Permission {
get {
return ResourceManager.GetString("General.RunOnStartup.Error.Permission", resourceCulture);
}
}
///
/// Looks up a localized string similar to 桌面.
///
internal static string K_D {
get {
return ResourceManager.GetString("K.D", resourceCulture);
}
}
///
/// Looks up a localized string similar to 导航.
///
internal static string K_D_N {
get {
return ResourceManager.GetString("K.D.N", resourceCulture);
}
}
///
/// Looks up a localized string similar to 向左.
///
internal static string K_D_N_D {
get {
return ResourceManager.GetString("K.D.N.D", resourceCulture);
}
}
///
/// Looks up a localized string similar to 向右.
///
internal static string K_D_N_L {
get {
return ResourceManager.GetString("K.D.N.L", resourceCulture);
}
}
///
/// Looks up a localized string similar to 向上.
///
internal static string K_D_N_R {
get {
return ResourceManager.GetString("K.D.N.R", resourceCulture);
}
}
///
/// Looks up a localized string similar to 向下.
///
internal static string K_D_N_U {
get {
return ResourceManager.GetString("K.D.N.U", resourceCulture);
}
}
///
/// Looks up a localized string similar to 切换桌面.
///
internal static string K_D_S {
get {
return ResourceManager.GetString("K.D.S", resourceCulture);
}
}
///
/// Looks up a localized string similar to 通用.
///
internal static string K_G {
get {
return ResourceManager.GetString("K.G", resourceCulture);
}
}
///
/// Looks up a localized string similar to 打开程序控制.
///
internal static string K_G_oac {
get {
return ResourceManager.GetString("K.G.oac", resourceCulture);
}
}
///
/// Looks up a localized string similar to 唤起主视图.
///
internal static string K_G_rmv {
get {
return ResourceManager.GetString("K.G.rmv", resourceCulture);
}
}
///
/// Looks up a localized string similar to 为当前活动程序唤起主视图.
///
internal static string K_G_rmvfaa {
get {
return ResourceManager.GetString("K.G.rmvfaa", resourceCulture);
}
}
///
/// Looks up a localized string similar to 为当前桌面中的活动程序唤起主视图.
///
internal static string K_G_rmvfaaicvd {
get {
return ResourceManager.GetString("K.G.rmvfaaicvd", resourceCulture);
}
}
///
/// Looks up a localized string similar to 为当前桌面唤起主视图.
///
internal static string K_G_rmvfcd {
get {
return ResourceManager.GetString("K.G.rmvfcd", resourceCulture);
}
}
///
/// Looks up a localized string similar to 窗口.
///
internal static string K_W {
get {
return ResourceManager.GetString("K.W", resourceCulture);
}
}
///
/// Looks up a localized string similar to 移动.
///
internal static string K_W_M {
get {
return ResourceManager.GetString("K.W.M", resourceCulture);
}
}
///
/// Looks up a localized string similar to 移动并跟随.
///
internal static string K_W_MF {
get {
return ResourceManager.GetString("K.W.MF", resourceCulture);
}
}
///
/// Looks up a localized string similar to 热键已清除。.
///
internal static string KB_Hotkey_Cleared {
get {
return ResourceManager.GetString("KB.Hotkey.Cleared", resourceCulture);
}
}
///
/// Looks up a localized string similar to 必须选择一个非修改类键。.
///
internal static string KB_Hotkey_KeyCheck {
get {
return ResourceManager.GetString("KB.Hotkey.KeyCheck", resourceCulture);
}
}
///
/// Looks up a localized string similar to 移动到桌面 .
///
internal static string KB_Hotkey_MW {
get {
return ResourceManager.GetString("KB.Hotkey.MW", resourceCulture);
}
}
///
/// Looks up a localized string similar to 移动并跟随到桌面 .
///
internal static string KB_Hotkey_MWF {
get {
return ResourceManager.GetString("KB.Hotkey.MWF", resourceCulture);
}
}
///
/// Looks up a localized string similar to 热键注册失败。.
///
internal static string KB_Hotkey_Reg_Fail {
get {
return ResourceManager.GetString("KB.Hotkey.Reg.Fail", resourceCulture);
}
}
///
/// Looks up a localized string similar to 热键注册成功。.
///
internal static string KB_Hotkey_Reg_Success {
get {
return ResourceManager.GetString("KB.Hotkey.Reg.Success", resourceCulture);
}
}
///
/// Looks up a localized string similar to 设置已保存。.
///
internal static string KB_Hotkey_SettingsSaved {
get {
return ResourceManager.GetString("KB.Hotkey.SettingsSaved", resourceCulture);
}
}
///
/// Looks up a localized string similar to 切换到桌面 .
///
internal static string KB_Hotkey_SVD {
get {
return ResourceManager.GetString("KB.Hotkey.SVD", resourceCulture);
}
}
///
/// Looks up a localized string similar to 切换回上一个桌面.
///
internal static string KB_Hotkey_SVD_BACK_LAST {
get {
return ResourceManager.GetString("KB.Hotkey.SVD_BACK_LAST", resourceCulture);
}
}
///
/// Looks up a localized string similar to 左键.
///
internal static string Keys_Left {
get {
return ResourceManager.GetString("Keys.Left", resourceCulture);
}
}
///
/// Looks up a localized string similar to 中键.
///
internal static string Keys_Middle {
get {
return ResourceManager.GetString("Keys.Middle", resourceCulture);
}
}
///
/// Looks up a localized string similar to 右键.
///
internal static string Keys_Right {
get {
return ResourceManager.GetString("Keys.Right", resourceCulture);
}
}
///
/// Looks up a localized string similar to 显示上下文菜单.
///
internal static string Mouse_Action_ContextMenu {
get {
return ResourceManager.GetString("Mouse.Action.ContextMenu", resourceCulture);
}
}
///
/// Looks up a localized string similar to 仅显示所选桌面.
///
internal static string Mouse_Action_DesktopShowForSelectedDesktop {
get {
return ResourceManager.GetString("Mouse.Action.DesktopShowForSelectedDesktop", resourceCulture);
}
}
///
/// Looks up a localized string similar to 切换虚拟桌面并关闭视图.
///
internal static string Mouse_Action_DesktopVisibleAndCloseView {
get {
return ResourceManager.GetString("Mouse.Action.DesktopVisibleAndCloseView", resourceCulture);
}
}
///
/// Looks up a localized string similar to 仅切换虚拟桌面.
///
internal static string Mouse_Action_DesktopVisibleOnly {
get {
return ResourceManager.GetString("Mouse.Action.DesktopVisibleOnly", resourceCulture);
}
}
///
/// Looks up a localized string similar to 什么都不做.
///
internal static string Mouse_Action_DoNothing {
get {
return ResourceManager.GetString("Mouse.Action.DoNothing", resourceCulture);
}
}
///
/// Looks up a localized string similar to 激活窗口,切换桌面并关闭视图.
///
internal static string Mouse_Action_WindowActiveDesktopVisibleAndCloseView {
get {
return ResourceManager.GetString("Mouse.Action.WindowActiveDesktopVisibleAndCloseView", resourceCulture);
}
}
///
/// Looks up a localized string similar to 激活窗口,切换桌面.
///
internal static string Mouse_Action_WindowActiveDesktopVisibleOnly {
get {
return ResourceManager.GetString("Mouse.Action.WindowActiveDesktopVisibleOnly", resourceCulture);
}
}
///
/// Looks up a localized string similar to 关闭窗口.
///
internal static string Mouse_Action_WindowClose {
get {
return ResourceManager.GetString("Mouse.Action.WindowClose", resourceCulture);
}
}
///
/// Looks up a localized string similar to 仅显示所选桌面中的活动程序窗口.
///
internal static string Mouse_Action_WindowShowForSelectedProcessInSelectedDesktop {
get {
return ResourceManager.GetString("Mouse.Action.WindowShowForSelectedProcessInSelectedDesktop", resourceCulture);
}
}
///
/// Looks up a localized string similar to 仅显示此程序的窗口.
///
internal static string Mouse_Action_WindowShowForSelectedProcessOnly {
get {
return ResourceManager.GetString("Mouse.Action.WindowShowForSelectedProcessOnly", resourceCulture);
}
}
///
/// Looks up a localized string similar to 确认.
///
internal static string MsgBox_Caption_Confirm {
get {
return ResourceManager.GetString("MsgBox.Caption.Confirm", resourceCulture);
}
}
///
/// Looks up a localized string similar to 警告.
///
internal static string MsgBox_Caption_Warning {
get {
return ResourceManager.GetString("MsgBox.Caption.Warning", resourceCulture);
}
}
///
/// Looks up a localized string similar to 切换到下一行.
///
internal static string Nav_CircleHType_NextRow {
get {
return ResourceManager.GetString("Nav.CircleHType.NextRow", resourceCulture);
}
}
///
/// Looks up a localized string similar to 在同一行内循环.
///
internal static string Nav_CircleHType_SameRow {
get {
return ResourceManager.GetString("Nav.CircleHType.SameRow", resourceCulture);
}
}
///
/// Looks up a localized string similar to 确定要删除这个配置文件吗?
///所有与此配置文件相关的文件都将被删除。.
///
internal static string Profile_Confirm_Delete {
get {
return ResourceManager.GetString("Profile.Confirm.Delete", resourceCulture);
}
}
///
/// Looks up a localized string similar to 配置文件名无效,或该文件已存在。.
///
internal static string Profile_Warning_InvalidProfileName {
get {
return ResourceManager.GetString("Profile.Warning.InvalidProfileName", resourceCulture);
}
}
///
/// Looks up a localized string similar to 不能重命名或删除最后一个配置文件。.
///
internal static string Profile_Warning_LastProfileProtect {
get {
return ResourceManager.GetString("Profile.Warning.LastProfileProtect", resourceCulture);
}
}
///
/// Looks up a localized string similar to 至少需要一条窗口规则。.
///
internal static string Rule_AtLeastOne {
get {
return ResourceManager.GetString("Rule.AtLeastOne", resourceCulture);
}
}
///
/// Looks up a localized string similar to 无效的正则表达式。.
///
internal static string Rule_InvalidRegex {
get {
return ResourceManager.GetString("Rule.InvalidRegex", resourceCulture);
}
}
///
/// Looks up a localized string similar to 是必须的。.
///
internal static string Rule_NameRequired {
get {
return ResourceManager.GetString("Rule.NameRequired", resourceCulture);
}
}
///
/// Looks up a localized string similar to 新规则.
///
internal static string Rule_New {
get {
return ResourceManager.GetString("Rule.New", resourceCulture);
}
}
///
/// Looks up a localized string similar to 是.
///
internal static string Rule_Op_Eq {
get {
return ResourceManager.GetString("Rule.Op.Eq", resourceCulture);
}
}
///
/// Looks up a localized string similar to 以...结尾.
///
internal static string Rule_Op_Esw {
get {
return ResourceManager.GetString("Rule.Op.Esw", resourceCulture);
}
}
///
/// Looks up a localized string similar to 正则表达式.
///
internal static string Rule_Op_Regex {
get {
return ResourceManager.GetString("Rule.Op.Regex", resourceCulture);
}
}
///
/// Looks up a localized string similar to 包含.
///
internal static string Rule_Op_Sc {
get {
return ResourceManager.GetString("Rule.Op.Sc", resourceCulture);
}
}
///
/// Looks up a localized string similar to 以...开头.
///
internal static string Rule_Op_Ssw {
get {
return ResourceManager.GetString("Rule.Op.Ssw", resourceCulture);
}
}
///
/// Looks up a localized string similar to 退出.
///
internal static string Tray_Menu_Quit {
get {
return ResourceManager.GetString("Tray.Menu.Quit", resourceCulture);
}
}
///
/// Looks up a localized string similar to 设置.
///
internal static string Tray_Menu_Settings {
get {
return ResourceManager.GetString("Tray.Menu.Settings", resourceCulture);
}
}
///
/// Looks up a localized string similar to 创建新的虚拟桌面.
///
internal static string VDW_CTM_Desktop_Create {
get {
return ResourceManager.GetString("VDW.CTM.Desktop.Create", resourceCulture);
}
}
///
/// Looks up a localized string similar to 删除虚拟桌面.
///
internal static string VDW_CTM_Desktop_Remove {
get {
return ResourceManager.GetString("VDW.CTM.Desktop.Remove", resourceCulture);
}
}
///
/// Looks up a localized string similar to 取消隐藏窗口.
///
internal static string VDW_CTM_Desktop_UnHideWindow {
get {
return ResourceManager.GetString("VDW.CTM.Desktop.UnHideWindow", resourceCulture);
}
}
///
/// Looks up a localized string similar to 关闭.
///
internal static string VDW_CTM_Window_Close {
get {
return ResourceManager.GetString("VDW.CTM.Window.Close", resourceCulture);
}
}
///
/// Looks up a localized string similar to 从视图中隐藏.
///
internal static string VDW_CTM_Window_HideFromView {
get {
return ResourceManager.GetString("VDW.CTM.Window.HideFromView", resourceCulture);
}
}
///
/// Looks up a localized string similar to 为此窗口创建规则....
///
internal static string VDW_CTM_Window_NewRule {
get {
return ResourceManager.GetString("VDW.CTM.Window.NewRule", resourceCulture);
}
}
///
/// Looks up a localized string similar to 在所有桌面上显示此应用的窗口.
///
internal static string VDW_CTM_Window_PinApp {
get {
return ResourceManager.GetString("VDW.CTM.Window.PinApp", resourceCulture);
}
}
///
/// Looks up a localized string similar to 在所有桌面上显示此窗口.
///
internal static string VDW_CTM_Window_PinWin {
get {
return ResourceManager.GetString("VDW.CTM.Window.PinWin", resourceCulture);
}
}
///
/// Looks up a localized string similar to 屏幕.
///
internal static string VDW_CTM_Window_Screen {
get {
return ResourceManager.GetString("VDW.CTM.Window.Screen", resourceCulture);
}
}
///
/// Looks up a localized string similar to 不支持的 Windows 版本
///应用程序将退出
///
///支持的列表
///====================================
///Windows 10 Redstone5(17763)
///Windows 10 19H1(18362)
///Windows 10 19H2(18363)
///Windows 10 20H1(19041)
///Windows 10 20H2(19042)
///Windows 10 21H1(19043)
///Windows 10 21H2(19044)
///Windows 10 22H2(19045)
///Windows 11 21H2(22000)
///Windows 11 22H2(22621)
///====================================.
///
internal static string VersionCheckFail {
get {
return ResourceManager.GetString("VersionCheckFail", resourceCulture);
}
}
}
}
================================================
FILE: Bridge/Resources/Langs/WinFormStrings.zh-Hans.resx
================================================
text/microsoft-resx2.0System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089创建新的虚拟桌面删除虚拟桌面关闭在所有桌面上显示此应用的窗口在所有桌面上显示此窗口不支持的 Windows 版本
应用程序将退出
支持的列表
====================================
Windows 10 Redstone5(17763)
Windows 10 19H1(18362)
Windows 10 19H2(18363)
Windows 10 20H1(19041)
Windows 10 20H2(19042)
Windows 10 21H1(19043)
Windows 10 21H2(19044)
Windows 10 22H2(19045)
Windows 11 21H2(22000)
Windows 11 22H2(22621)
Windows 11 23H2(22631)
====================================是以...开头以...结尾包含正则表达式至少需要一条窗口规则。无效的正则表达式。是必须的。为此窗口创建规则...新规则窗口 【{0}】 匹配规则 【{1}】,但移动时发生错误。
可能的原因:
- 窗口无效。
- 目标桌面不存在。
- 目标桌面无效。错误!从视图中隐藏取消隐藏窗口屏幕切换到下一行在同一行内循环热键已清除。热键注册成功。热键注册失败。设置已保存。必须选择一个非修改类键。什么都不做仅切换桌面切换桌面并关闭视图显示上下文菜单关闭窗口激活窗口,切换桌面并关闭视图激活窗口,切换桌面当前桌面:上一个桌面:当前权限级别无法访问计划任务,
请确保当前账户是此计算机的管理员并且“以管理员身份运行”运行此程序。仅显示此程序的窗口切换到桌面 移动到桌面 移动并跟随到桌面 仅显示所选桌面中的活动程序窗口左键中键右键仅显示所选桌面切换回上一个桌面不能重命名或删除最后一个配置文件。
复制一个新的配置文件后即可操作。确定要删除这个配置文件吗?
所有与此配置文件相关的文件都将被删除。配置文件名无效,或该文件已存在。确认警告设置退出通用打开程序控制唤起主视图为当前活动程序唤起主视图为当前桌面唤起主视图为当前桌面中的活动程序唤起主视图桌面导航切换桌面窗口移动移动并跟随向左向右向上向下至少需要一个修改类键。桌面窗口主视图切换桌面并关闭视图仅切换桌面仅显示所选桌面显示上下文菜单激活窗口,切换桌面并关闭视图激活窗口,切换桌面从视图中隐藏关闭窗口仅显示此程序的窗口仅显示所选桌面中的活动程序窗口必须选择鼠标键相同的鼠标动作已存在,尝试换一种组合或鼠标键开关窗口过滤器
================================================
FILE: Bridge/VirtualDesktopNotification.cs
================================================
/* Copyright (C) 2022 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
using System;
namespace VirtualSpace.Commons
{
public enum VirtualDesktopNotificationType
{
CREATED,
DELETED,
CURRENT_CHANGED
}
public class VirtualDesktopNotification
{
public VirtualDesktopNotificationType Type { get; set; }
public Guid NewId { get; set; }
public Guid OldId { get; set; }
}
}
================================================
FILE: Bridge/Window.cs
================================================
/* Copyright (C) 2021 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
using System;
namespace VirtualSpace.Config.Events.Entity
{
public class Window
{
public IntPtr Handle { get; set; }
public string Title { get; set; }
public string WndClass { get; set; }
public string? WinInScreen { get; set; }
public int VdIndex { get; set; }
public int? ProcessId { get; set; }
public string? ProcessName { get; set; }
public string? ProcessPath { get; set; }
public string? CommandLine { get; set; }
public static Window Create(
IntPtr handle,
string title,
string wndClass,
int pId )
{
return new Window
{
Handle = handle,
Title = title,
WndClass = wndClass,
ProcessId = pId
};
}
}
}
================================================
FILE: COPYING
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
================================================
FILE: Configuration/COPYING
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
================================================
FILE: Configuration/ConfigTemplate.cs
================================================
/* Copyright (C) 2021 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
using System.Collections.Generic;
using VirtualSpace.Config.DataAnnotations;
using VirtualSpace.Config.Entity;
namespace VirtualSpace.Config
{
public class ConfigTemplate
{
[PropertyProtector] public Dictionary Profiles { get; set; }
public string CurrentProfileName { get; set; }
public string Version { get; set; }
public LogConfig LogConfig { get; set; }
public Dictionary? KeyBindings { get; set; } = new()
{
{Const.Hotkey.RISE_VIEW, new KeyBinding {GhkCode = "_+Ctrl+_+Shift+Tab", MessageId = Const.Hotkey.Info[Const.Hotkey.RISE_VIEW].MessageId}},
{Const.Hotkey.RISE_VIEW_FOR_ACTIVE_APP, new KeyBinding {GhkCode = "", MessageId = Const.Hotkey.Info[Const.Hotkey.RISE_VIEW_FOR_ACTIVE_APP].MessageId}},
{Const.Hotkey.RISE_VIEW_FOR_CURRENT_VD, new KeyBinding {GhkCode = "", MessageId = Const.Hotkey.Info[Const.Hotkey.RISE_VIEW_FOR_CURRENT_VD].MessageId}},
{
Const.Hotkey.RISE_VIEW_FOR_ACTIVE_APP_IN_CURRENT_VD,
new KeyBinding {GhkCode = "", MessageId = Const.Hotkey.Info[Const.Hotkey.RISE_VIEW_FOR_ACTIVE_APP_IN_CURRENT_VD].MessageId}
},
{Const.Hotkey.SHOW_APP_CONTROLLER, new KeyBinding {GhkCode = "_+Ctrl+Alt+_+F12", MessageId = Const.Hotkey.Info[Const.Hotkey.SHOW_APP_CONTROLLER].MessageId}},
{Const.Hotkey.NAV_LEFT, new KeyBinding {GhkCode = "", MessageId = Const.Hotkey.Info[Const.Hotkey.NAV_LEFT].MessageId}},
{Const.Hotkey.NAV_RIGHT, new KeyBinding {GhkCode = "", MessageId = Const.Hotkey.Info[Const.Hotkey.NAV_RIGHT].MessageId}},
{Const.Hotkey.NAV_UP, new KeyBinding {GhkCode = "", MessageId = Const.Hotkey.Info[Const.Hotkey.NAV_UP].MessageId}},
{Const.Hotkey.NAV_DOWN, new KeyBinding {GhkCode = "", MessageId = Const.Hotkey.Info[Const.Hotkey.NAV_DOWN].MessageId}},
{Const.Hotkey.SWITCH_BACK_LAST, new KeyBinding {GhkCode = "", MessageId = Const.Hotkey.Info[Const.Hotkey.SWITCH_BACK_LAST].MessageId}}
};
public Dictionary? MouseAction { get; set; } = new();
public Dictionary MouseActions { get; set; } = new();
[PropertyProtector]
public Cluster Cluster { get; set; } = new()
{
HideMainViewIfItsShown = false,
NotificationOnVdChanged = false,
ShowVDIndexOnTrayIcon = false,
HideOnStart = false
};
public MouseAction.Action GetMouseActionById( string id )
{
if ( MouseActions.Count == 0 )
{
MouseActions = Config.MouseAction.Info;
}
return MouseActions.ContainsKey( id )
? MouseActions[id]
: Config.MouseAction.Action.DoNothing;
}
}
}
================================================
FILE: Configuration/Configuration.csproj
================================================
net6.0-windows9trueenableallruntime; build; native; contentfiles; analyzers; buildtransitivetrue
================================================
FILE: Configuration/Const.cs
================================================
/* Copyright (C) 2022 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
using System.Collections.Generic;
using System.Windows.Forms;
using VirtualSpace.Helpers;
using KeyBinding = VirtualSpace.Config.Entity.KeyBinding;
namespace VirtualSpace.Config
{
public static class Const
{
public const int WindowTitleMaxLength = 2048;
public const int WindowClassMaxLength = 512;
public const int WindowCheckTimesLimit = 10;
public const int OneSecond = 1000;
public const int OneMinute = 60 * OneSecond;
public const int WindowCloseTimeout = 60 * OneSecond;
public const int RiseViewInterval = 500;
public const int SwitchDesktopInterval = 100;
public const int FakeHideX = -10000;
public const int FakeHideY = -10000;
public const string ApplicationFrameWindow = "ApplicationFrameWindow";
public const string WindowsUiCoreWindow = "Windows.UI.Core.CoreWindow";
public const string TaskbarCreated = "TaskbarCreated";
public const string TaskbarWndClass = "Shell_TrayWnd";
public const string WindowsCRLF = "\r\n";
public const string AppName = "VirtualSpace";
public const string HideWindowSplitter = "🔙🔜";
public static class Window
{
public const string VD_FRAME_TITLE = "VirtualSpace__VirtualDesktopFrame!";
public const string VD_CONTAINER_TITLE = "VirtualSpace__VirtualDesktopWindow!";
public const string VD_DRAG_TITLE = "VirtualSpace__VirtualDesktopDragWindow!";
public const string VS_CONTROLLER_TITLE = "[Virtual Space Controller]";
public const string VS_WINDOW_FILTER_TITLE = "VirtualSpace__WindowFilter!";
public const int WINDOW_FILTER_BAR_HEIGHT = 100;
}
public static class VirtualDesktop
{
public const int NavHTypeNextRow = 0;
public const int NavHTypeSameRow = 1;
public const int VdwSizeFloor = 100;
}
public static class Settings
{
public const string RuleFileExt = ".rules";
public const string ClusterFileExt = ".cluster";
public const string ProfilesFolder = "Profiles";
public const string CacheFolder = "Cache";
public const string PluginsFolder = "Plugins";
public const string LogsFolder = "Logs";
public const string SettingsFile = "settings.json";
public const string DefaultVersion = "2.0";
public const string DefaultLogLevel = "EVENT";
}
public static class Reg
{
public const string RegKeyApp = @"Software\newlooper.com\VirtualSpace";
public const string RegKeyConfigRoot = "ConfigRoot";
}
public static class Args
{
public const string HIDE_ON_START = "--HideOnStart";
}
public static class Hotkey
{
public const string SPLITTER = "+";
public const string NONE = "_";
public const string WIN = "Win";
public const string CTRL = "Ctrl";
public const string ALT = "Alt";
public const string SHIFT = "Shift";
public const string SVD_TREE_NODE_PREFIX = "hk_node_svd_";
private const string SVD_FUNC_DESC_PREFIX = "Switch To Desktop ";
public const string MW_TREE_NODE_PREFIX = "hk_node_mw_";
private const string MW_FUNC_DESC_PREFIX = "Move To Desktop ";
public const string MWF_TREE_NODE_PREFIX = "hk_node_mwf_";
private const string MWF_FUNC_DESC_PREFIX = "Move and Follow To Desktop ";
///////////////////////////////////////////////////
// 值与控件名称一一对应,若控件名被修改,则此处也须对应改变
public const string RISE_VIEW = "hk_node_rise_mainview";
public const string RISE_VIEW_FOR_ACTIVE_APP = "hk_node_rise_mainview_for_active_app";
public const string RISE_VIEW_FOR_CURRENT_VD = "hk_node_rise_mainview_for_current_vd";
public const string RISE_VIEW_FOR_ACTIVE_APP_IN_CURRENT_VD = "hk_node_rise_mainview_for_active_app_in_current_vd";
public const string SHOW_APP_CONTROLLER = "hk_node_open_app_controller";
public const string NAV_LEFT = "hk_node_nav_left";
public const string NAV_RIGHT = "hk_node_nav_right";
public const string NAV_UP = "hk_node_nav_up";
public const string NAV_DOWN = "hk_node_nav_down";
public const string SWITCH_BACK_LAST = "hk_node_svd_back_last";
public const string TOGGLE_WINDOW_FILTER = "hk_node_toggle_window_filter";
////////////////////////////////////////////////////////////////
// 可由热键调用的程序功能表
// tuple.Item1 => friendly name
// tuple.Item2 => UserMessageId
// tuple.Item3 => alternate hotkey, 由程序保留,只能在源码中修改
public static readonly Dictionary Info = new()
{
{RISE_VIEW, ( "Rise MainView", UserMessage.RiseView, "LWin+Tab" )},
{RISE_VIEW_FOR_ACTIVE_APP, ( "Rise MainView For Active App", UserMessage.RiseViewForActiveApp, "" )},
{RISE_VIEW_FOR_CURRENT_VD, ( "Rise MainView For Current Desktop", UserMessage.RiseViewForCurrentVD, "" )},
{
RISE_VIEW_FOR_ACTIVE_APP_IN_CURRENT_VD,
( "Rise MainView For Active App In Current Virtual Desktop", UserMessage.RiseViewForActiveAppInCurrentVD, "" )
},
{SHOW_APP_CONTROLLER, ( "Open AppController", UserMessage.ShowAppController, "" )},
{NAV_LEFT, ( "Left", UserMessage.NavLeft, "LWin+Ctrl+Left" )},
{NAV_RIGHT, ( "Right", UserMessage.NavRight, "LWin+Ctrl+Right" )},
{NAV_UP, ( "Up", UserMessage.NavUp, "LWin+Ctrl+Up" )},
{NAV_DOWN, ( "Down", UserMessage.NavDown, "LWin+Ctrl+Down" )},
{SWITCH_BACK_LAST, ( "Switch Back To Last Desktop", UserMessage.SwitchBackToLastDesktop, "" )},
{TOGGLE_WINDOW_FILTER, ( "Toggle Window Filter", UserMessage.ToggleWindowFilter, "" )}
};
public static string GetFuncDesc( string key )
{
var func = "";
if ( Info.ContainsKey( key ) )
{
func = Info[key].FuncDesc;
}
else if ( key.StartsWith( SVD_TREE_NODE_PREFIX ) )
{
func = SVD_FUNC_DESC_PREFIX + key.Replace( SVD_TREE_NODE_PREFIX, "" );
}
else if ( key.StartsWith( MW_TREE_NODE_PREFIX ) )
{
func = MW_FUNC_DESC_PREFIX + key.Replace( MW_TREE_NODE_PREFIX, "" );
}
else if ( key.StartsWith( MWF_TREE_NODE_PREFIX ) )
{
func = MWF_FUNC_DESC_PREFIX + key.Replace( MWF_TREE_NODE_PREFIX, "" );
}
return func;
}
public static KeyBinding GetKeyBinding( string key )
{
var kb = new KeyBinding();
if ( Info.ContainsKey( key ) )
{
kb.MessageId = Info[key].MessageId;
}
else if ( key.StartsWith( SVD_TREE_NODE_PREFIX ) )
{
kb.MessageId = UserMessage.Meta.SVD_START + int.Parse( key.Replace( SVD_TREE_NODE_PREFIX, "" ) );
}
else if ( key.StartsWith( MW_TREE_NODE_PREFIX ) )
{
kb.MessageId = UserMessage.Meta.MW_START + int.Parse( key.Replace( MW_TREE_NODE_PREFIX, "" ) );
}
else if ( key.StartsWith( MWF_TREE_NODE_PREFIX ) )
{
kb.MessageId = UserMessage.Meta.MWF_START + int.Parse( key.Replace( MWF_TREE_NODE_PREFIX, "" ) );
}
return kb;
}
public static string GetHotkeyExtra( string key )
{
var extra = "";
if ( Info.ContainsKey( key ) )
{
extra = Info[key].AltHotKey;
}
return extra;
}
}
}
public static class MouseAction
{
public enum Action
{
DoNothing,
ContextMenu,
DesktopVisibleAndCloseView,
DesktopVisibleOnly,
WindowActiveDesktopVisibleAndCloseView,
WindowActiveDesktopVisibleOnly,
WindowClose,
WindowHideFromView,
WindowShowForSelectedProcessOnly,
WindowShowForSelectedProcessInSelectedDesktop,
DesktopShowForSelectedDesktop
}
public static string MOUSE_NODE_DESKTOP_PREFIX = "mouse_node_d_";
public static string MOUSE_NODE_WINDOW_PREFIX = "mouse_node_w_";
public const string KEY_SPLITTER = "+";
public static readonly string NoneKeyCode = ( (int)Keys.None ).ToString( "X2" );
private static readonly Dictionary MouseButtonsName;
public static readonly Dictionary KeysName;
////////////////////////////////////////////////////////////////
// 鼠标动作表,信息包含默认行为
public static readonly Dictionary Info1; // ver 1.0
////////////////////////////////////////////////////////////////
// 鼠标动作表,信息包含默认行为
public static readonly Dictionary Info; // ver 2.0
static MouseAction()
{
MouseButtonsName = new Dictionary
{
{MouseButtons.Left, "Left"},
{MouseButtons.Middle, "Middle"},
{MouseButtons.Right, "Right"}
};
KeysName = new Dictionary
{
{Keys.Control, "Ctrl"},
{Keys.Alt, "Alt"},
{Keys.Shift, "Shift"}
};
Info = new Dictionary
{
{MOUSE_NODE_DESKTOP_PREFIX + NoneKeyCode + KEY_SPLITTER + MouseButtonsName[MouseButtons.Left], Action.DesktopVisibleAndCloseView},
{MOUSE_NODE_DESKTOP_PREFIX + NoneKeyCode + KEY_SPLITTER + MouseButtonsName[MouseButtons.Middle], Action.DesktopVisibleOnly},
{MOUSE_NODE_DESKTOP_PREFIX + NoneKeyCode + KEY_SPLITTER + MouseButtonsName[MouseButtons.Right], Action.ContextMenu},
{MOUSE_NODE_WINDOW_PREFIX + NoneKeyCode + KEY_SPLITTER + MouseButtonsName[MouseButtons.Left], Action.WindowActiveDesktopVisibleAndCloseView},
{MOUSE_NODE_WINDOW_PREFIX + NoneKeyCode + KEY_SPLITTER + MouseButtonsName[MouseButtons.Middle], Action.WindowActiveDesktopVisibleOnly},
{MOUSE_NODE_WINDOW_PREFIX + NoneKeyCode + KEY_SPLITTER + MouseButtonsName[MouseButtons.Right], Action.ContextMenu},
};
Info1 = new Dictionary
{
{MOUSE_NODE_DESKTOP_PREFIX + MouseButtonsName[MouseButtons.Left], Action.DesktopVisibleAndCloseView},
{MOUSE_NODE_DESKTOP_PREFIX + MouseButtonsName[MouseButtons.Middle], Action.DesktopVisibleOnly},
{MOUSE_NODE_DESKTOP_PREFIX + MouseButtonsName[MouseButtons.Right], Action.ContextMenu},
{MOUSE_NODE_DESKTOP_PREFIX + KeysName[Keys.Control] + KEY_SPLITTER + MouseButtonsName[MouseButtons.Left], Action.DoNothing},
{MOUSE_NODE_DESKTOP_PREFIX + KeysName[Keys.Control] + KEY_SPLITTER + MouseButtonsName[MouseButtons.Middle], Action.DoNothing},
{MOUSE_NODE_DESKTOP_PREFIX + KeysName[Keys.Control] + KEY_SPLITTER + MouseButtonsName[MouseButtons.Right], Action.DoNothing},
{MOUSE_NODE_DESKTOP_PREFIX + KeysName[Keys.Alt] + KEY_SPLITTER + MouseButtonsName[MouseButtons.Left], Action.DoNothing},
{MOUSE_NODE_DESKTOP_PREFIX + KeysName[Keys.Alt] + KEY_SPLITTER + MouseButtonsName[MouseButtons.Middle], Action.DoNothing},
{MOUSE_NODE_DESKTOP_PREFIX + KeysName[Keys.Alt] + KEY_SPLITTER + MouseButtonsName[MouseButtons.Right], Action.DoNothing},
{MOUSE_NODE_DESKTOP_PREFIX + KeysName[Keys.Shift] + KEY_SPLITTER + MouseButtonsName[MouseButtons.Left], Action.DoNothing},
{MOUSE_NODE_DESKTOP_PREFIX + KeysName[Keys.Shift] + KEY_SPLITTER + MouseButtonsName[MouseButtons.Middle], Action.DoNothing},
{MOUSE_NODE_DESKTOP_PREFIX + KeysName[Keys.Shift] + KEY_SPLITTER + MouseButtonsName[MouseButtons.Right], Action.DoNothing},
{MOUSE_NODE_WINDOW_PREFIX + MouseButtonsName[MouseButtons.Left], Action.WindowActiveDesktopVisibleAndCloseView},
{MOUSE_NODE_WINDOW_PREFIX + MouseButtonsName[MouseButtons.Middle], Action.WindowActiveDesktopVisibleOnly},
{MOUSE_NODE_WINDOW_PREFIX + MouseButtonsName[MouseButtons.Right], Action.ContextMenu},
{MOUSE_NODE_WINDOW_PREFIX + KeysName[Keys.Control] + KEY_SPLITTER + MouseButtonsName[MouseButtons.Left], Action.DoNothing},
{MOUSE_NODE_WINDOW_PREFIX + KeysName[Keys.Control] + KEY_SPLITTER + MouseButtonsName[MouseButtons.Middle], Action.DoNothing},
{MOUSE_NODE_WINDOW_PREFIX + KeysName[Keys.Control] + KEY_SPLITTER + MouseButtonsName[MouseButtons.Right], Action.DoNothing},
{MOUSE_NODE_WINDOW_PREFIX + KeysName[Keys.Alt] + KEY_SPLITTER + MouseButtonsName[MouseButtons.Left], Action.DoNothing},
{MOUSE_NODE_WINDOW_PREFIX + KeysName[Keys.Alt] + KEY_SPLITTER + MouseButtonsName[MouseButtons.Middle], Action.DoNothing},
{MOUSE_NODE_WINDOW_PREFIX + KeysName[Keys.Alt] + KEY_SPLITTER + MouseButtonsName[MouseButtons.Right], Action.DoNothing},
{MOUSE_NODE_WINDOW_PREFIX + KeysName[Keys.Shift] + KEY_SPLITTER + MouseButtonsName[MouseButtons.Left], Action.DoNothing},
{MOUSE_NODE_WINDOW_PREFIX + KeysName[Keys.Shift] + KEY_SPLITTER + MouseButtonsName[MouseButtons.Middle], Action.DoNothing},
{MOUSE_NODE_WINDOW_PREFIX + KeysName[Keys.Shift] + KEY_SPLITTER + MouseButtonsName[MouseButtons.Right], Action.DoNothing}
};
}
public static string GetActionId( MouseButtons mb, Keys key, string prefix )
{
if ( User32.GetKeyState( (int)Keys.LWin ) < 0 )
{
key |= Keys.LWin;
}
var keyCode = ( (int)key ).ToString( "X2" );
var actionId = prefix + keyCode + KEY_SPLITTER + MouseButtonsName[mb];
return actionId;
}
}
}
================================================
FILE: Configuration/Converter/EntityConverter.cs
================================================
// Copyright (C) 2023 Dylan Cheng (https://github.com/newlooper)
//
// This file is part of VirtualSpace.
//
// VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
//
// VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
using System.Collections.Generic;
using System.Linq;
namespace VirtualSpace.Config.Converter
{
public static class EntityConverter
{
public static void ConvertMouseAction( Dictionary oldFormat, Dictionary newFormat )
{
var prefix = string.Empty;
var combined = string.Empty;
var modifier = string.Empty;
var mouseButton = string.Empty;
foreach ( var (maId, ma) in oldFormat )
{
if ( maId.StartsWith( MouseAction.MOUSE_NODE_DESKTOP_PREFIX ) )
{
prefix = MouseAction.MOUSE_NODE_DESKTOP_PREFIX;
combined = maId[MouseAction.MOUSE_NODE_DESKTOP_PREFIX.Length..];
}
else if ( maId.StartsWith( MouseAction.MOUSE_NODE_WINDOW_PREFIX ) )
{
prefix = MouseAction.MOUSE_NODE_WINDOW_PREFIX;
combined = maId[MouseAction.MOUSE_NODE_WINDOW_PREFIX.Length..];
}
if ( combined.Contains( MouseAction.KEY_SPLITTER ) )
{
var arrMK = combined.Split( MouseAction.KEY_SPLITTER );
var key = MouseAction.KeysName.Single( x => x.Value == arrMK[0] ).Key;
modifier = ( (int)key ).ToString( "X2" );
mouseButton = arrMK[1];
}
else
{
modifier = MouseAction.NoneKeyCode;
mouseButton = combined;
}
newFormat.Add( prefix + modifier + MouseAction.KEY_SPLITTER + mouseButton, ma );
}
}
}
}
================================================
FILE: Configuration/DataAnnotations/PropertyProtectorAttribute.cs
================================================
// Copyright (C) 2023 Dylan Cheng (https://github.com/newlooper)
//
// This file is part of VirtualSpace.
//
// VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
//
// VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
using System;
using System.Linq;
namespace VirtualSpace.Config.DataAnnotations
{
public class PropertyProtectorAttribute : Attribute
{
public object[] Values { get; private set; }
public PropertyProtectorAttribute()
{
}
public PropertyProtectorAttribute( byte defaultV, byte min )
{
Values = new object[] {defaultV, min};
}
public PropertyProtectorAttribute( int defaultV, int min, int max )
{
Values = new object[] {defaultV, min, max};
}
public PropertyProtectorAttribute( long defaultV, long min, long max )
{
Values = new object[] {defaultV, min, max};
}
}
public abstract class PropertyProtector
{
public static void Walk( object obj )
{
var props = from prop in obj.GetType().GetProperties()
let attrs = prop.GetCustomAttributes( typeof( PropertyProtectorAttribute ), false )
where attrs.Any()
select new {Obj = obj, Property = prop, Attr = (PropertyProtectorAttribute)attrs.First()};
foreach ( var pair in props )
{
if ( pair.Attr.Values is null ) // an object that have some properties which modified by [PropertyProtector( xxx )]
{
var type = pair.Property.PropertyType;
if ( type.FullName.StartsWith( "System.Collections.Generic.Dictionary" ) ) // for collection Type, only Dictionary supported for now
{
var dict = pair.Property.GetValue( pair.Obj );
var values = ( (dynamic)dict ).Values;
foreach ( var v in values )
{
Walk( v );
}
}
else
{
Walk( pair.Property.GetValue( pair.Obj ) ); // a class instance
}
}
else
{
//////////////////////////////////////////////
// if validation fail, reset to default value
// only support byte, int, long for now
switch ( pair.Attr.Values[0] )
{
case byte:
{
var current = (byte)pair.Property.GetValue( obj );
if ( current < (byte)pair.Attr.Values[1] || current > byte.MaxValue )
{
pair.Property.SetValue( obj, pair.Attr.Values[0], null );
}
break;
}
case int:
{
var current = (int)pair.Property.GetValue( obj );
if ( current < (int)pair.Attr.Values[1] || current > (int)pair.Attr.Values[2] )
{
pair.Property.SetValue( obj, pair.Attr.Values[0], null );
}
break;
}
case long:
{
var current = (long)pair.Property.GetValue( obj );
if ( current < (long)pair.Attr.Values[1] || current > (long)pair.Attr.Values[2] )
{
pair.Property.SetValue( obj, pair.Attr.Values[0], null );
}
break;
}
}
}
}
}
}
}
================================================
FILE: Configuration/Entity/Cluster.cs
================================================
/* Copyright (C) 2021 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
using VirtualSpace.Config.DataAnnotations;
namespace VirtualSpace.Config.Entity
{
public class Cluster
{
public bool HideMainViewIfItsShown { get; set; }
public bool NotificationOnVdChanged { get; set; }
public bool ShowVDIndexOnTrayIcon { get; set; }
public int StyleOfVDIndexOnTrayIcon { get; set; } = 0;
public bool HideOnStart { get; set; }
public bool ForceFocusForegroundWindow { get; set; } = true;
public bool EnableDoubleBufferedForVDW { get; set; } = true;
public bool EnableWindowFilter { get; set; } = false;
[PropertyProtector( 50L, 30L, 100L )] public long VdwWallpaperQuality { get; set; }
[PropertyProtector( 200, 100, 1000 )] public int ToggleWindowFilterDoublePressMaxInterval { get; set; }
[PropertyProtector( 1000, 100, 1000 )] public int WindowFilterKeywordScanningInterval { get; set; }
}
}
================================================
FILE: Configuration/Entity/Colour.cs
================================================
/* Copyright (C) 2021 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
using VirtualSpace.Config.DataAnnotations;
namespace VirtualSpace.Config.Entity
{
public class Colour
{
[PropertyProtector( 55, 1 )] public byte R { get; set; }
[PropertyProtector( 55, 1 )] public byte G { get; set; }
[PropertyProtector( 55, 1 )] public byte B { get; set; }
public uint GetLongOfColor()
{
return (uint)( R * 0x10000 + G * 0x100 + B );
}
}
}
================================================
FILE: Configuration/Entity/KeyBinding.cs
================================================
/* Copyright (C) 2021 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
namespace VirtualSpace.Config.Entity
{
public class KeyBinding
{
public string GhkCode { get; set; } = "";
public int MessageId { get; set; }
}
}
================================================
FILE: Configuration/Entity/LogConfig.cs
================================================
// Copyright (C) 2022 Dylan Cheng (https://github.com/newlooper)
//
// This file is part of VirtualSpace.
//
// VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
//
// VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
namespace VirtualSpace.Config.Entity
{
public class LogConfig
{
public bool ShowLogsInGui { get; set; } = false;
public string LogLevel { get; set; }
}
}
================================================
FILE: Configuration/Entity/Margin.cs
================================================
/* Copyright (C) 2021 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
using VirtualSpace.Config.DataAnnotations;
namespace VirtualSpace.Config.Entity
{
public class Margin
{
public Margin()
{
}
public Margin( int all )
{
Top = all;
Right = all;
Bottom = all;
Left = all;
}
[PropertyProtector( 10, 0, 50 )] public int Top { get; set; }
[PropertyProtector( 10, 0, 50 )] public int Right { get; set; }
[PropertyProtector( 10, 0, 50 )] public int Bottom { get; set; }
[PropertyProtector( 10, 0, 50 )] public int Left { get; set; }
}
}
================================================
FILE: Configuration/Entity/Mouse.cs
================================================
// Copyright (C) 2022 Dylan Cheng (https://github.com/newlooper)
//
// This file is part of VirtualSpace.
//
// VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
//
// VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
using VirtualSpace.Config.DataAnnotations;
namespace VirtualSpace.Config.Entity
{
public class Mouse
{
public int LeftClickOnCanvas { get; set; }
public int RightClickOnCanvas { get; set; }
public int MiddleClickOnCanvas { get; set; }
public bool UseWheelSwitchDesktopWhenOnTaskbar { get; set; }
[PropertyProtector( 10, 1, 100 )] public int DragSizeFactor { get; set; }
[PropertyProtector( 100, 100, 1000 )] public int TaskbarVisibilityThreshold { get; set; }
}
}
================================================
FILE: Configuration/Entity/Navigation.cs
================================================
// Copyright (C) 2022 Dylan Cheng (https://github.com/newlooper)
//
// This file is part of VirtualSpace.
//
// VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
//
// VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
namespace VirtualSpace.Config.Entity
{
public class Navigation
{
public bool CirculationH { get; set; }
public int CirculationHType { get; set; }
public bool CirculationV { get; set; }
}
}
================================================
FILE: Configuration/Entity/UserInterface.cs
================================================
/* Copyright (C) 2021 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
using VirtualSpace.Config.DataAnnotations;
namespace VirtualSpace.Config.Entity
{
public class UserInterface
{
[PropertyProtector] public Colour? CanvasBackColor { get; set; }
[PropertyProtector] public Colour? VDWDefaultBackColor { get; set; }
[PropertyProtector] public Colour? VDWCurrentBackColor { get; set; }
[PropertyProtector] public Colour? VDWHighlightBackColor { get; set; }
public float VDWDragTargetOpacity { get; set; }
public string Language { get; set; }
public bool ShowVdName { get; set; } = true;
public bool ShowVdIndex { get; set; } = true;
[PropertyProtector( 0, 0, 1 )] public int ShowVdIndexType { get; set; }
[PropertyProtector( 0, 0, 50 )] public int VDWPadding { get; set; }
[PropertyProtector( 5, 0, 50 )] public int VDWBorderSize { get; set; }
[PropertyProtector( 8, 8, 50 )] public int VDWMargin { get; set; }
[PropertyProtector( 1, 1 )] public byte CanvasOpacity { get; set; }
[PropertyProtector] public Margin? ThumbMargin { get; set; }
public byte ThumbDragSourceOpacity { get; set; }
[PropertyProtector( 0, 0, 7 )] public int? DesktopArrangement { get; set; }
public int Theme { get; set; }
}
}
================================================
FILE: Configuration/Events/Entity/ExpressionTemplate.cs
================================================
/* Copyright (C) 2021 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
using System;
using System.Collections.Generic;
namespace VirtualSpace.Config.Events.Entity
{
public class ExpressionTemplate
{
public Guid id { get; set; } = Guid.NewGuid();
public string? condition { get; set; }
public List? rules { get; set; }
public string? type { get; set; }
public string? field { get; set; }
public string? @operator { get; set; }
public Value? value { get; set; }
}
public class Value
{
public string? V { get; set; }
public List? L { get; set; }
}
}
================================================
FILE: Configuration/Events/Entity/RuleTemplate.cs
================================================
/* Copyright (C) 2021 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
using System;
using System.Text.Json;
using PropertyChanged;
namespace VirtualSpace.Config.Events.Entity
{
[AddINotifyPropertyChangedInterface]
public partial class RuleTemplate
{
[DoNotNotify] public Guid Id { get; set; } = Guid.NewGuid();
[DoNotNotify] public string? Name { get; set; }
[DoNotNotify] public string? Tag { get; set; }
[DoNotNotify] public int Weight { get; set; } = 50;
public bool Enabled { get; set; }
public bool ContinueAfterHit { get; set; }
[DoNotNotify] public Func? Exp;
[DoNotNotify] public JsonDocument? Expression { get; set; }
[DoNotNotify] public Behavior? Action { get; set; }
public DateTime? Created { get; set; }
public DateTime? Updated { get; set; }
}
public static class RuleFields
{
public const string Title = nameof( Title );
public const string ProcessName = nameof( ProcessName );
public const string ProcessPath = nameof( ProcessPath );
public const string CommandLine = nameof( CommandLine );
public const string WndClass = nameof( WndClass );
public const string WinInScreen = nameof( WinInScreen );
}
}
================================================
FILE: Configuration/Events/Expression/Conditions.cs
================================================
/* Copyright (C) 2021 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.Encodings.Web;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading;
using System.Threading.Channels;
using System.Threading.Tasks;
using System.Windows.Forms;
using LinqExpressionBuilder;
using VirtualSpace.AppLogs;
using VirtualSpace.Commons;
using VirtualSpace.Config.Events.Entity;
using VirtualSpace.Helpers;
using Process = System.Diagnostics.Process;
namespace VirtualSpace.Config.Events.Expression
{
public static partial class Conditions
{
private static readonly JsonParser Jp = new();
private static List _rules;
private static readonly Channel ActionProducer = Channels.ActionChannel;
private static readonly Channel VisibleWindowsConsumer = Channels.VisibleWindowsChannel;
private static readonly ConcurrentDictionary WindowCheckTimes = new();
public static readonly ConcurrentBag WndHandleIgnoreListByRule = new();
private static long _updateRuleLock;
static Conditions()
{
_rules = InitRules();
BuildRuleExp( _rules );
RuleChecker();
}
private static async void RuleChecker()
{
while ( await VisibleWindowsConsumer.Reader.WaitToReadAsync() )
{
if ( VisibleWindowsConsumer.Reader.TryRead( out var win ) )
{
CheckRulesForWindow( win );
}
}
}
private static List InitRules()
{
var path = Manager.GetRuleFilePath();
var rules = new List();
if ( !File.Exists( path ) ) return rules;
rules = ReadRuleFromFile( path );
return rules;
}
private static void BuildRuleExp( List rules )
{
foreach ( var rule in rules )
{
rule.Exp = Jp.ExpressionFromJsonDoc( rule.Expression );
}
_rules.Sort( ( x, y ) => -x.Weight.CompareTo( y.Weight ) );
}
public static List FetchRules()
{
return _rules;
}
private static async void CheckRulesForWindow( Window win )
{
if ( _rules.Count == 0 || Interlocked.Read( ref _updateRuleLock ) != 0 ) return;
var rules = new List( _rules );
WindowCheckTimes.TryAdd( win.Handle, 0 );
var isOnePeriod = WindowCheckTimes[win.Handle] % Const.WindowCheckTimesLimit == 0;
if ( isOnePeriod )
{
Logger.Debug( $"Checking rules for {win.Title}, current profile: {Manager.Configs.CurrentProfileName}" );
}
await Task.Run( () =>
{
_ = User32.GetWindowThreadProcessId( win.Handle, out var pId );
using var pInfo = Process.GetProcessById( pId );
win.ProcessName = pInfo.ProcessName;
try
{
win.ProcessPath = pInfo.MainModule?.FileName;
win.CommandLine = pInfo.GetCommandLineArgs();
}
catch ( Exception ex )
{
Logger.Warning( "Get Process Info: " + ex.Message );
}
var screen = Screen.FromHandle( win.Handle );
var screenIndex = 0;
var allScreens = Screen.AllScreens;
for ( var i = 0; i < allScreens.Length; i++ )
{
if ( screen.DeviceName == allScreens[i].DeviceName )
{
screenIndex = i;
break;
}
}
win.WinInScreen = screenIndex.ToString();
if ( !User32.IsWindow( win.Handle ) ) return;
var hasMatchedRule = false;
var l = new List();
foreach ( var r in rules )
{
if ( !r.Enabled ) continue;
l.Add( win );
var match = l.Where( r.Exp ).Any();
l.Clear();
if ( match )
{
hasMatchedRule = true;
Logger.Debug( win.Title + $" match rule [{r.Name}]" );
r.Action.Handle = win.Handle;
r.Action.RuleName = r.Name;
r.Action.WindowTitle = win.Title;
ActionProducer.Writer.TryWrite( r.Action );
////////////////////////////////////////////////////////////////
// 某个窗口可能与多条规则匹配,继续循环就表示所有相应的动作都会按顺序执行
// 最终的方案:给规则添加一个属性,用于指定是否在匹配到规则后继续检查其他规则
// 默认为 false,即匹配到规则后立即退出循环
if ( !r.ContinueAfterHit )
break;
}
}
if ( hasMatchedRule )
{
WndHandleIgnoreListByRule.Add( win.Handle );
return;
}
if ( isOnePeriod )
{
Logger.Debug( $"Window [{win.Title}] has no matched rules." );
}
if ( Manager.CurrentProfile.IgnoreWindowOnRuleCheckTimeout )
{
if ( WindowCheckTimes[win.Handle] >= Const.WindowCheckTimesLimit )
{
Logger.Debug( $"Try find rules for [{win.Title}] too many times, ignore the window." );
WndHandleIgnoreListByRule.Add( win.Handle );
}
}
WindowCheckTimes[win.Handle]++;
} ).ConfigureAwait( false );
}
private static List ReadRuleFromFile( string path )
{
using var fs = new FileStream( path, FileMode.Open, FileAccess.Read );
var buffer = new byte[fs.Length];
_ = fs.Read( buffer, 0, (int)fs.Length );
var utf8Reader = new Utf8JsonReader( buffer );
var readOptions = GetJsonDeserializerOptions();
return JsonSerializer.Deserialize>( ref utf8Reader, readOptions );
}
public static ExpressionTemplate ParseExpressionTemplate( JsonDocument doc )
{
var readOptions = GetJsonDeserializerOptions();
return JsonSerializer.Deserialize( doc, readOptions );
}
private static JsonSerializerOptions? _readOptions;
private static JsonSerializerOptions? _writeOptions;
private static JsonSerializerOptions GetJsonDeserializerOptions()
{
return _readOptions ??= new JsonSerializerOptions();
}
public static JsonSerializerOptions GetJsonSerializerOptions()
{
return _writeOptions ??= new JsonSerializerOptions
{
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
WriteIndented = true,
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping
};
}
public static async void SaveRules( List ruleList, string? path = null )
{
Interlocked.Increment( ref _updateRuleLock );
_rules = ruleList;
BuildRuleExp( _rules );
Interlocked.Decrement( ref _updateRuleLock );
path ??= Manager.GetRuleFilePath();
await File.WriteAllBytesAsync( path, JsonSerializer.SerializeToUtf8Bytes(
ruleList, GetJsonSerializerOptions() ) );
Logger.Info( $"[RULE]Rules.{Manager.Configs.CurrentProfileName} Saved." );
}
public static void SwitchRuleProfile()
{
Interlocked.Increment( ref _updateRuleLock );
_rules = InitRules();
BuildRuleExp( _rules );
Interlocked.Decrement( ref _updateRuleLock );
Logger.Info( $"[RULE]Switch Rule Profile: {Manager.Configs.CurrentProfileName}" );
}
}
}
================================================
FILE: Configuration/Events/Expression/Conditions.test.cs
================================================
/* Copyright (C) 2022 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
#if TEST_TEST_TEST
using System;
using System.Collections.Generic;
using System.Text.Json;
using LinqExpressionBuilder;
using VirtualSpace.Config.Events.Entity;
namespace VirtualSpace.Config.Events.Expression
{
public static partial class Conditions
{
private static void TestData( string path )
{
var test1 = new ExpressionTemplate
{
field = RuleFields.Title,
@operator = Keywords.EndsWith[0],
type = Keywords.String,
value = new Value {V = "Notepad3"}
};
var test2 = new ExpressionTemplate
{
condition = Keywords.Or,
rules = new List
{
new()
{
field = RuleFields.Title,
@operator = Keywords.EndsWith[0],
type = Keywords.String,
value = new Value {V = "Notepad3"}
},
new()
{
field = RuleFields.Title,
@operator = Keywords.Contains[0],
type = Keywords.String,
value = new Value {V = "炉石传说"}
}
}
};
var writeOptions = GetJsonSerializerOptions();
var tempE1 = new RuleTemplate
{
Name = "test1",
Expression = JsonDocument.Parse( JsonSerializer.Serialize( test1, writeOptions ) ),
Action = new Behavior {MoveToDesktop = 1},
Enabled = true,
Created = new DateTime( 2021, 10, 11 )
};
var tempE2 = new RuleTemplate
{
Name = "test2",
Expression = JsonDocument.Parse( JsonSerializer.Serialize( test2, writeOptions ) ),
Action = new Behavior {MoveToDesktop = 2},
Enabled = true,
Created = DateTime.Now
};
SaveRules( path, new List {tempE1, tempE2} );
}
}
}
#endif
================================================
FILE: Configuration/FodyWeavers.xml
================================================
================================================
FILE: Configuration/Manager.cs
================================================
/* Copyright (C) 2021 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text.Json;
using System.Threading.Tasks;
using System.Windows;
using Microsoft.Win32;
using VirtualSpace.AppLogs;
using VirtualSpace.Config.Converter;
using VirtualSpace.Config.DataAnnotations;
using VirtualSpace.Config.Entity;
using VirtualSpace.Config.Events.Expression;
using VirtualSpace.Config.Profiles;
using Settings = VirtualSpace.Config.Const.Settings;
namespace VirtualSpace.Config
{
public static class Manager
{
public static ConfigTemplate Configs;
public static string AppPath;
public static string AppRootFolder;
public static string ProfileFolder;
public static string CacheFolder;
public static string PluginsFolder;
public static string ConfigRootFolder;
public static string ConfigFilePath;
public static Profile CurrentProfile => Configs.Profiles[Configs.CurrentProfileName];
public static bool Init()
{
try
{
AppPath = Environment.ProcessPath!;
AppRootFolder = Directory.GetParent( AppPath )!.FullName;
ConfigRootFolder = GetConfigRoot();
ConfigFilePath = Path.Combine( ConfigRootFolder, Settings.SettingsFile );
CheckFolders();
InitConfig( ConfigFilePath );
LogManager.SetLogLevel( Configs.LogConfig.LogLevel );
}
catch ( Exception ex )
{
MessageBox.Show( "File Access Error.\n" + ex.Message, @"Error", MessageBoxButton.OK, MessageBoxImage.Error );
return false;
}
return true;
}
private static void InitConfig( string filePath )
{
if ( File.Exists( filePath ) )
{
using var fs = new FileStream( filePath, FileMode.Open, FileAccess.Read );
var buffer = new byte[fs.Length];
_ = fs.Read( buffer, 0, (int)fs.Length );
var utf8Reader = new Utf8JsonReader( buffer );
Configs = JsonSerializer.Deserialize( ref utf8Reader );
var cluster = ReadCluster();
if ( cluster is not null )
{
Configs.Cluster = cluster;
}
PropertyProtector.Walk( Configs );
if ( Configs.MouseActions.Count == 0 )
{
Logger.Info( "Missing MouseActions, Try find old version from configs." );
if ( Configs.MouseAction is null || Configs.MouseAction.Count == 0 )
{
Logger.Info( "Old version MouseActions not found, Using native default." );
Configs.MouseActions = MouseAction.Info;
}
else
{
Logger.Info( "Old version MouseActions found, try to convert to new version." );
try
{
EntityConverter.ConvertMouseAction( Configs.MouseAction, Configs.MouseActions );
}
catch
{
Logger.Info( "Convert MouseAction failed, Using native default." );
Configs.MouseActions = MouseAction.Info;
}
}
}
Logger.Info( $"Settings File Loaded, Version: {Configs.Version}, Current Profile: {Configs.CurrentProfileName}" );
}
else
{
Logger.Info( "Settings File Not Found, Create From Default Template." );
Configs = new ConfigTemplate
{
CurrentProfileName = nameof( Default ),
Version = Settings.DefaultVersion,
LogConfig = new LogConfig {LogLevel = Settings.DefaultLogLevel},
Profiles = new Dictionary
{
{nameof( Default ), new Default()}
},
MouseActions = MouseAction.Info
};
PropertyProtector.Walk( Configs );
Save( filePath, "init", "Setting File" );
SaveCluster( Configs.Cluster );
}
}
public static async void Save( string? filePath = null, object? reason = null, [CallerArgumentExpression( "reason" )] string reasonName = "" )
{
filePath ??= ConfigFilePath;
try
{
var contents = JsonSerializer.SerializeToUtf8Bytes( Configs, JsonWriteOptions );
await File.WriteAllBytesAsync( filePath, contents ).ConfigureAwait( false );
Logger.Info( $"Settings Saved [{reasonName}: {reason}]." );
if ( reasonName.Contains( ".Configs.Cluster" ) )
SaveCluster( Configs.Cluster );
}
catch ( Exception ex )
{
Logger.Error( "Failed to save Settings: " + ex.Message );
}
}
public static async void SwitchProfile( string name )
{
Configs.CurrentProfileName = name;
var cluster = ReadCluster(); // after CurrentProfileName changed
if ( cluster is not null )
{
Configs.Cluster = cluster;
}
Conditions.SwitchRuleProfile(); // after CurrentProfileName changed
try
{
var contents = JsonSerializer.SerializeToUtf8Bytes( Configs, JsonWriteOptions );
await File.WriteAllBytesAsync( ConfigFilePath, contents ).ConfigureAwait( false );
Logger.Info( $"[Profile]Switch: {name}" );
}
catch ( Exception ex )
{
Logger.Error( "Failed to save Settings: " + ex.Message );
}
ProfileChanged?.Invoke( null, null );
}
public static event EventHandler? ProfileChanged;
public static void SaveCluster( Cluster cluster )
{
SaveProfile( Path.Combine( ProfileFolder, Configs.CurrentProfileName + Settings.ClusterFileExt ), cluster );
}
private static Cluster? ReadCluster()
{
return ReadProfile( Path.Combine( ProfileFolder, Configs.CurrentProfileName + Settings.ClusterFileExt ) );
}
private static async void SaveProfile( string path, T p )
{
try
{
var content = JsonSerializer.SerializeToUtf8Bytes( p, JsonWriteOptions );
await File.WriteAllBytesAsync( path, content );
Logger.Info( $"[Profile]{typeof( T ).Name}.{Configs.CurrentProfileName} Saved." );
}
catch ( Exception ex )
{
Logger.Error( $"Failed to save profile of {typeof( T ).Name}: {ex.Message}" );
}
}
private static T? ReadProfile( string path )
{
if ( !File.Exists( path ) )
return default;
try
{
using var fs = new FileStream( path, FileMode.Open, FileAccess.Read );
var buffer = new byte[fs.Length];
_ = fs.Read( buffer, 0, (int)fs.Length );
var utf8Reader = new Utf8JsonReader( buffer );
return JsonSerializer.Deserialize( ref utf8Reader );
}
catch ( Exception ex )
{
Logger.Error( $"Failed to read profile of {typeof( T ).Name}: {ex.Message}" );
return default;
}
}
public static async void DeleteFilesOfProfile( string profileName )
{
var dir = new DirectoryInfo( ProfileFolder );
await Task.Run( () =>
{
try
{
foreach ( var file in dir.EnumerateFiles( profileName + ".*" ) ) // such violent
{
file.Delete();
}
}
catch ( Exception ex )
{
Logger.Error( $"Failed to delete related files of profile {profileName}: {ex.Message}" );
}
} );
}
public static void SetConfigRoot( string path )
{
using var vsReg = Registry.CurrentUser.CreateSubKey( Const.Reg.RegKeyApp );
vsReg.SetValue( Const.Reg.RegKeyConfigRoot, path );
ConfigRootFolder = path;
}
private static string GetConfigRoot()
{
using var vsReg = Registry.CurrentUser.CreateSubKey( Const.Reg.RegKeyApp );
var configRootReg = vsReg.GetValue( Const.Reg.RegKeyConfigRoot );
if ( configRootReg is null || !Directory.Exists( configRootReg.ToString() ) )
{
return AppRootFolder;
}
return configRootReg.ToString();
}
private static void CheckFolders()
{
ProfileFolder = Path.Combine( ConfigRootFolder, Settings.ProfilesFolder );
Directory.CreateDirectory( ProfileFolder );
CacheFolder = Path.Combine( AppRootFolder, Settings.CacheFolder );
Directory.CreateDirectory( CacheFolder );
PluginsFolder = Path.Combine( AppRootFolder, Settings.PluginsFolder );
Directory.CreateDirectory( PluginsFolder );
}
public static string GetRuleFilePath( string? profile = null )
{
CheckFolders();
return string.IsNullOrEmpty( profile )
? Path.Combine( ProfileFolder, Configs.CurrentProfileName + Settings.RuleFileExt )
: Path.Combine( ProfileFolder, profile + Settings.RuleFileExt );
}
public static string GetCachePath()
{
CheckFolders();
return CacheFolder;
}
public static string GetPluginsPath()
{
CheckFolders();
return PluginsFolder;
}
private static readonly JsonSerializerOptions JsonWriteOptions = new() {WriteIndented = true};
}
}
================================================
FILE: Configuration/Profile.cs
================================================
/* Copyright (C) 2021 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
using System;
using System.Collections.Generic;
using System.Text.Json;
using VirtualSpace.Config.DataAnnotations;
using VirtualSpace.Config.Entity;
namespace VirtualSpace.Config
{
public class Profile
{
[PropertyProtector] public UserInterface UI { get; set; }
public bool DaemonAutoStart { get; set; }
[PropertyProtector( 0, 0, 3600 )] public int DaemonAutoStartDelay { get; set; }
public List? DesktopOrder { get; set; }
[PropertyProtector] public Mouse Mouse { get; set; }
public bool IgnoreWindowOnRuleCheckTimeout { get; set; } = true;
public Navigation Navigation { get; set; } = new()
{
CirculationH = false,
CirculationV = false,
CirculationHType = 0
};
public Profile Clone()
{
var profile = JsonSerializer.Deserialize( JsonSerializer.Serialize( this ) );
return profile!;
}
}
}
================================================
FILE: Configuration/Profiles/Default.cs
================================================
/* Copyright (C) 2021 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
using System.Drawing;
using VirtualSpace.Config.Entity;
namespace VirtualSpace.Config.Profiles
{
public class Default : Profile
{
public Default()
{
UI = new UserInterface
{
CanvasOpacity = 100,
CanvasBackColor = new Colour {R = 55, G = 55, B = 55},
VDWMargin = 8,
VDWBorderSize = 1,
VDWPadding = 0,
VDWDefaultBackColor = new Colour {R = 55, G = 55, B = 55},
VDWCurrentBackColor = new Colour {R = Color.Beige.R, G = Color.Beige.G, B = Color.Beige.B},
VDWHighlightBackColor = new Colour {R = Color.Tomato.R, G = Color.Tomato.G, B = Color.Tomato.B},
VDWDragTargetOpacity = 0.8f,
ThumbMargin = new Margin {Top = 20, Left = 10},
ThumbDragSourceOpacity = 150,
Language = "en",
DesktopArrangement = 0,
ShowVdName = true,
ShowVdIndex = true,
ShowVdIndexType = 0
};
DaemonAutoStart = true;
Mouse = new Mouse
{
DragSizeFactor = 10,
LeftClickOnCanvas = 1,
RightClickOnCanvas = 0,
MiddleClickOnCanvas = 0,
UseWheelSwitchDesktopWhenOnTaskbar = false,
TaskbarVisibilityThreshold = 100
};
Navigation = new Navigation
{
CirculationH = false,
CirculationV = false,
CirculationHType = 0
};
}
}
}
================================================
FILE: Helpers/COPYING
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
================================================
FILE: Helpers/DwmApi.cs
================================================
using System;
using System.Runtime.InteropServices;
namespace VirtualSpace.Helpers
{
public static class DwmApi
{
[Flags]
public enum DwmWindowAttribute : uint
{
///
/// Determines whether non-client rendering is enabled. Use this value only with DwmGetWindowAttribute. The retrieved value is of type BOOL. TRUE if non-client
/// rendering is enabled; otherwise, FALSE.
///
DWMWA_NCRENDERING_ENABLED = 1,
///
/// The non-client rendering policy. Use this value only with DwmSetWindowAttribute, with its pvAttribute pointing to a value from the DWMNCRENDERINGPOLICY
/// enumeration.
///
DWMWA_NCRENDERING_POLICY,
///
/// Enable or forcibly disable DWM transitions. Use this value only with DwmSetWindowAttribute, with its pvAttribute pointing to a value of TRUE to disable
/// transitions or FALSE to enable transitions.
///
DWMWA_TRANSITIONS_FORCEDISABLED,
///
/// Allow content rendered in the non-client area to be visible on the frame drawn by DWM. Use this value only with DwmSetWindowAttribute, with its pvAttribute
/// pointing to a value of TRUE to allow content rendered in the non-client area to be visible on the frame; otherwise, FALSE.
///
DWMWA_ALLOW_NCPAINT,
///
/// Retrieves the bounds of the caption button area in the window-relative space. Use this value only with DwmGetWindowAttribute. The retrieved value is of
/// type RECT.
///
DWMWA_CAPTION_BUTTON_BOUNDS,
///
/// Specifies whether non-client content is right-to-left (RTL) mirrored. Use this value only with DwmSetWindowAttribute, with its pvAttribute pointing to a
/// value of TRUE if the non-client content is right-to-left (RTL) mirrored; otherwise, FALSE.
///
DWMWA_NONCLIENT_RTL_LAYOUT,
///
/// Force the window to display an iconic thumbnail or peek representation (a static bitmap), even if a live or snapshot representation of the window is
/// available. This value normally is set during a window's creation and not changed throughout the window's lifetime. Some scenarios, however, might require
/// the value to change over time. Use this value only with DwmSetWindowAttribute, with its pvAttribute pointing to a value of TRUE to require a iconic
/// thumbnail or peek representation; otherwise, FALSE.
///
DWMWA_FORCE_ICONIC_REPRESENTATION,
///
/// Sets how Flip3D treats the window. Use this value only with DwmSetWindowAttribute, with its pvAttribute pointing to a value from the DWMFLIP3DWINDOWPOLICY
/// enumeration.
///
DWMWA_FLIP3D_POLICY,
///
/// Retrieves the extended frame bounds rectangle in screen space. Use this value only with DwmGetWindowAttribute. The retrieved value is of type RECT.
///
DWMWA_EXTENDED_FRAME_BOUNDS,
///
/// The window can provide a bitmap for use by DWM as an iconic thumbnail or peek representation (a static bitmap) for the window. This value can be specified
/// with DWMWA_FORCE_ICONIC_REPRESENTATION. This value normally is set during a window's creation and not changed throughout the window's lifetime. Some
/// scenarios, however, might require the value to change over time. Use this value only with DwmSetWindowAttribute, with its pvAttribute pointing to a value
/// of TRUE to inform DWM that the window will provide an iconic thumbnail or peek representation; otherwise, FALSE.
///
DWMWA_HAS_ICONIC_BITMAP,
///
/// Do not show peek preview for the window. The peek view shows a full-sized preview of the window when the mouse hovers over the window's thumbnail in the
/// taskbar. If this attribute is set, hovering the mouse pointer over the window's thumbnail dismisses peek (in case another window in the group has a peek
/// preview showing). Use this value only with DwmSetWindowAttribute, with its pvAttribute pointing to a value of TRUE to prevent peek functionality; FALSE to
/// allow it.
///
DWMWA_DISALLOW_PEEK,
///
/// Prevents a window from fading to a glass sheet when peek is invoked. Use this value only with DwmSetWindowAttribute, with its pvAttribute pointing to a
/// value of TRUE to prevent the window from fading during another window's peek; FALSE for normal behavior.
///
DWMWA_EXCLUDED_FROM_PEEK,
///
/// Do not use.
///
DWMWA_CLOAK,
///
/// Use with DwmGetWindowAttribute.
///
DWMWA_CLOAKED,
///
/// Use with DwmSetWindowAttribute. Freeze the window's thumbnail image with its current visuals. Do no further live updates on the thumbnail image to match
/// the window's contents.
///
DWMWA_FREEZE_REPRESENTATION,
///
/// The maximum recognized DWMWA value, used for validation purposes.
///
DWMWA_LAST
}
public static readonly int DWM_TNP_VISIBLE = 0x8;
public static readonly int DWM_TNP_OPACITY = 0x4;
public static readonly int DWM_TNP_RECTDESTINATION = 0x1;
[DllImport( "dwmapi.dll" )]
public static extern int DwmRegisterThumbnail( IntPtr dest, IntPtr src, out IntPtr thumb );
[DllImport( "dwmapi.dll" )]
public static extern int DwmUnregisterThumbnail( IntPtr thumb );
[DllImport( "dwmapi.dll" )]
public static extern int DwmQueryThumbnailSourceSize( IntPtr thumb, out SIZE size );
[DllImport( "dwmapi.dll" )]
public static extern int DwmUpdateThumbnailProperties( IntPtr hThumb, ref DWM_THUMBNAIL_PROPERTIES props );
[DllImport( "dwmapi.dll" )]
public static extern int DwmGetWindowAttribute( IntPtr hWnd, uint dwAttribute, out int pvAttribute, int cbAttribute );
}
[StructLayout( LayoutKind.Sequential )]
public struct DWM_THUMBNAIL_PROPERTIES
{
public int dwFlags;
public RECT rcDestination;
public RECT rcSource;
public byte opacity;
public bool fVisible;
public bool fSourceClientAreaOnly;
}
}
================================================
FILE: Helpers/GlobalHotKey.cs
================================================
/* Copyright (C) 2021 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace VirtualSpace.Helpers
{
public static class GlobalHotKey
{
[Flags]
public enum KeyModifiers
{
None = 0,
Alt = 1,
Ctrl = 2,
Shift = 4,
WindowsKey = 8
}
private static IntPtr _handle = IntPtr.Zero;
private static readonly List Ids = new();
public static bool RegHotKey( IntPtr hWnd, int id, KeyModifiers fsModifiers, int vk )
{
_handle = hWnd;
Ids.Add( id );
return RegisterHotKey( hWnd, id, fsModifiers, vk );
}
[DllImport( "user32.dll", SetLastError = true )]
private static extern bool RegisterHotKey( IntPtr hWnd, int id, KeyModifiers fsModifiers, int vk );
[DllImport( "user32.dll", SetLastError = true )]
public static extern bool UnregisterHotKey( IntPtr hWnd, int id );
public static void UnRegAllHotKey()
{
foreach ( var id in Ids )
{
UnregisterHotKey( _handle, id );
}
}
}
}
================================================
FILE: Helpers/Helpers.csproj
================================================
net6.0-windowsenableTrue9
================================================
FILE: Helpers/Images.cs
================================================
/* Copyright (C) 2021 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using VirtualSpace.AppLogs;
namespace VirtualSpace.Helpers
{
internal static class PathInfo
{
public const string WIDTH_HEIGHT_SPLITTER = "x";
}
public static class Images
{
public static Bitmap GetScaledBitmap( int width, int height, string path, ref Wallpaper wp, string cachePath, long quality )
{
var cached = Wallpaper.CachedWallPaper( path, cachePath, width, height );
if ( cached != null ) return cached;
using ( var src = new Bitmap( path ) )
{
var dest = new Bitmap( width, height, PixelFormat.Format32bppPArgb );
using ( var gr = Graphics.FromImage( dest ) )
{
gr.DrawImage( src, new Rectangle( Point.Empty, dest.Size ) );
}
var md5Path = Wallpaper.Md5Hash( path );
var file = Path.Combine( cachePath, md5Path.Str0, md5Path.Str1, width + PathInfo.WIDTH_HEIGHT_SPLITTER + height,
md5Path.FullString + "_" + Environment.CurrentManagedThreadId );
// dest.Save( file, ImageFormat.Jpeg );
var jpgEncoder = GetEncoder( ImageFormat.Jpeg );
var encoder = System.Drawing.Imaging.Encoder.Quality;
var encoderParameters = new EncoderParameters( 1 );
var encoderParameter = new EncoderParameter( encoder, quality );
encoderParameters.Param[0] = encoderParameter;
dest.Save( file, jpgEncoder, encoderParameters );
wp.Fullpath = file;
return dest;
}
}
private static ImageCodecInfo GetEncoder( ImageFormat format )
{
var codecs = ImageCodecInfo.GetImageEncoders();
foreach ( var codec in codecs )
{
if ( codec.FormatID == format.Guid )
{
return codec;
}
}
return null;
}
public static Icon BytesToIcon( object bytes )
{
using var ms = new MemoryStream( (byte[])bytes );
return new Icon( ms );
}
public static Bitmap BytesToBitmap( object bytes )
{
using var ms = new MemoryStream( (byte[])bytes );
return new Bitmap( ms );
}
}
public class Wallpaper
{
public Bitmap? Image { get; set; }
public Color Color { get; set; }
public string? Fullpath { get; set; }
public static Bitmap? CachedWallPaper( string path, string cachePath, int width, int height )
{
var cached = CachedWallPaperInfo( path, cachePath, width, height );
return cached.Exists ? new Bitmap( cached.Path ) : null;
}
public static (bool Exists, string Path) CachedWallPaperInfo( string path, string cachePath, int width, int height )
{
var md5Path = Md5Hash( path );
var targetPath = Path.Combine( cachePath, md5Path.Str0, md5Path.Str1, width + PathInfo.WIDTH_HEIGHT_SPLITTER + height );
Directory.CreateDirectory( targetPath );
var filepath = Path.Combine( targetPath, md5Path.FullString );
return new ValueTuple( File.Exists( filepath ), filepath );
}
public static (string FullString, string Str0, string Str1) Md5Hash( string input )
{
var md5 = MD5.Create();
var inputBytes = Encoding.ASCII.GetBytes( input );
var hashBytes = md5.ComputeHash( inputBytes );
var sb = new StringBuilder();
foreach ( var b in hashBytes )
{
sb.Append( b.ToString( "x2" ) );
}
var md5Str = sb.ToString();
return new ValueTuple(
md5Str,
md5Str.Substring( 0, 1 ),
md5Str.Substring( 1, 1 )
);
}
public void Release()
{
Image?.Dispose();
Image = null;
if ( string.IsNullOrEmpty( Fullpath ) ) return;
try
{
var file = Regex.Replace( Fullpath, @"(.*?)_\d+$", "$1" );
if ( !File.Exists( file ) )
File.Move( Fullpath, file );
}
catch ( Exception ex )
{
Logger.Warning( "Delete cache file: " + ex.Message );
}
finally
{
File.Delete( Fullpath );
}
}
}
}
================================================
FILE: Helpers/Kernel32.cs
================================================
using System;
using System.Runtime.InteropServices;
namespace VirtualSpace.Helpers
{
public static class Kernel32
{
[DllImport( "kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true )]
public static extern IntPtr GetModuleHandle( string lpModuleName );
}
}
================================================
FILE: Helpers/LowLevelHooks.cs
================================================
/* Copyright (C) 2021 Dylan Cheng (https://github.com/newlooper)
This file is part of VirtualSpace.
VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
*/
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace VirtualSpace.Helpers
{
public static class LowLevelHooks
{
public static readonly IntPtr Handled = (IntPtr)1;
}
public static class LowLevelKeyboardHook
{
public const int WM_KEYDOWN = 0x0100;
public const int WM_KEYUP = 0x0101;
public const int DUMMY_KEY = 0xFF;
private const int WH_KEYBOARD_LL = 13;
private static User32.HookProc _hookProc;
public static IntPtr HookId { get; private set; } = IntPtr.Zero;
public static void SetHook( User32.HookProc proc )
{
_hookProc = proc;
HookId = User32.SetWindowsHookEx( WH_KEYBOARD_LL, _hookProc, Kernel32.GetModuleHandle( null ), 0 );
}
public static void MultipleKeyDown( List keys )
{
SendKeys( keys, 0 );
}
public static void MultipleKeyUp( List keys )
{
SendKeys( keys, KEYEVENTF.KEYUP );
}
public static void MultipleKeyPress( List keys )
{
SendKeysCombine( keys );
}
private static void SendKeys( List keys, KEYEVENTF flags )
{
var inputs = new INPUT[keys.Count];
for ( var pos = 0; pos < keys.Count; pos++ )
{
inputs[pos].Type = InputType.INPUT_KEYBOARD;
inputs[pos].Data.Keyboard = new KEYBDINPUT
{
Vk = (ushort)keys[pos],
Scan = 0,
Flags = flags,
Time = 0,
ExtraInfo = IntPtr.Zero
};
}
var result = User32.SendInput( Convert.ToUInt32( inputs.Length ), inputs, Marshal.SizeOf( typeof( INPUT ) ) );
if ( result == 0 )
throw new Exception();
}
private static void SendKeysCombine( List keys )
{
var inputs = new INPUT[keys.Count * 2];
for ( var i = 0; i < keys.Count; i++ )
{
inputs[i].Type = InputType.INPUT_KEYBOARD;
inputs[i].Data.Keyboard = new KEYBDINPUT
{
Vk = (ushort)keys[i],
Scan = 0,
Flags = 0,
Time = 0,
ExtraInfo = IntPtr.Zero
};
inputs[inputs.Length - i - 1].Type = InputType.INPUT_KEYBOARD;
inputs[inputs.Length - i - 1].Data.Keyboard = new KEYBDINPUT
{
Vk = (ushort)keys[i],
Scan = 0,
Flags = KEYEVENTF.KEYUP,
Time = 0,
ExtraInfo = IntPtr.Zero
};
}
var result = User32.SendInput( Convert.ToUInt32( inputs.Length ), inputs, Marshal.SizeOf( typeof( INPUT ) ) );
if ( result == 0 )
throw new Exception();
}
public static bool IsKeyHold( Keys key )
{
return User32.GetAsyncKeyState( (int)key ) < 0;
}
public static void UnHook()
{
User32.UnhookWindowsHookEx( HookId );
}
public struct KBDLLHOOKSTRUCT
{
public int vkCode;
private int scanCode;
public KBDLLHOOKSTRUCTFlags flags;
private int time;
private int dwExtraInfo;
}
[Flags]
public enum KBDLLHOOKSTRUCTFlags : uint
{
LLKHF_EXTENDED = 0x01,
LLKHF_INJECTED = 0x10,
LLKHF_ALTDOWN = 0x20,
LLKHF_UP = 0x80,
}
}
public static class LowLevelMouseHook
{
private const int WH_MOUSE_LL = 14;
public const int WM_MOUSEWHEEL = 0x020A;
private static User32.HookProc _hookProc;
public static IntPtr HookId { get; private set; } = IntPtr.Zero;
public static void SetHook( User32.HookProc proc )
{
_hookProc = proc;
HookId = User32.SetWindowsHookEx( WH_MOUSE_LL, _hookProc, Kernel32.GetModuleHandle( null ), 0 );
}
public static void UnHook()
{
User32.UnhookWindowsHookEx( HookId );
}
[StructLayout( LayoutKind.Sequential )]
public struct MSLLHOOKSTRUCT
{
public POINT pt;
public int mouseData; // be careful, this must be ints, not uints.
public int flags;
public int time;
public UIntPtr dwExtraInfo;
}
}
}
================================================
FILE: Helpers/StringHelper.cs
================================================
// Copyright (C) 2023 Dylan Cheng (https://github.com/newlooper)
//
// This file is part of VirtualSpace.
//
// VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
//
// VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
using System;
using System.Text.RegularExpressions;
namespace VirtualSpace.Helpers
{
public static class StringHelper
{
public static bool IsValidRegex( string pattern )
{
if ( string.IsNullOrWhiteSpace( pattern ) ) return false;
try
{
_ = Regex.Match( "", pattern );
}
catch ( ArgumentException )
{
return false;
}
return true;
}
}
}
================================================
FILE: Helpers/SysInfo.cs
================================================
// Copyright (C) 2022 Dylan Cheng (https://github.com/newlooper)
//
// This file is part of VirtualSpace.
//
// VirtualSpace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
//
// VirtualSpace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with VirtualSpace. If not, see .
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security.Principal;
using System.Windows.Forms;
using Microsoft.Win32;
using System.Management;
using System.Runtime.CompilerServices;
using System.Windows;
[assembly: InternalsVisibleTo( "ControlPanel" )]
namespace VirtualSpace.Helpers
{
public static class SysInfo
{
private const int DefaultDpi = 96;
public static (float ScaleX, float ScaleY) Dpi => GetDpi();
public static readonly bool IsWin10;
public static readonly bool IsAdministrator;
static SysInfo()
{
IsWin10 = Environment.OSVersion.Version is {Major: 10, Build: < 22000};
var windowsPrincipal = new WindowsPrincipal( WindowsIdentity.GetCurrent() );
IsAdministrator = windowsPrincipal.IsInRole( WindowsBuiltInRole.Administrator );
}
private static (float ScaleX, float ScaleY) GetDpi()
{
using var g = Graphics.FromHwnd( IntPtr.Zero );
return new ValueTuple( g.DpiX / DefaultDpi, g.DpiY / DefaultDpi );
}
public static Version OSVersion
{
get
{
var winVer = Environment.OSVersion.Version;
if ( winVer.Revision == 0 )
{
using var registryKey = Registry.LocalMachine.OpenSubKey( @"SOFTWARE\Microsoft\Windows NT\CurrentVersion" );
var ubr = registryKey?.GetValue( "UBR" );
if ( ubr != null )
{
var buildNumber = int.Parse( ubr.ToString() );
winVer = new Version( winVer.Major, winVer.Minor, winVer.Build, buildNumber );
}
}
return winVer;
}
}
public static (int W, int H) GetAspectRadioOfScreen()
{
var nGCD = GetGreatestCommonDivisor( Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height );
return new ValueTuple( Screen.PrimaryScreen.Bounds.Width / nGCD, Screen.PrimaryScreen.Bounds.Height / nGCD );
}
private static int GetGreatestCommonDivisor( int a, int b )
{
while ( true )
{
if ( b == 0 ) return a;
var a1 = a;
a = b;
b = a1 % b;
}
}
public static bool IsTaskbarVisible()
{
return Math.Abs( SystemParameters.PrimaryScreenHeight - SystemParameters.WorkArea.Height ) > 0;
}
public enum WinAppsTheme
{
LIGHT,
DARK
}
public static WinAppsTheme GetAppsTheme()
{
return WinRegistry.AppThemeIsLight() ? WinAppsTheme.LIGHT : WinAppsTheme.DARK;
}
private static RegValueMonitor _rkm = new( "HKEY_USERS",
@"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize",
"AppsUseLightTheme" );
public static List