mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-09-14 10:32:10 +02:00
Compare commits
22 Commits
1.24
...
extensions
Author | SHA1 | Date | |
---|---|---|---|
c2b5cf23cf
|
|||
095c23b472
|
|||
c5a42e74d9
|
|||
23ebd58da0
|
|||
9a6394d079
|
|||
88a55c8795
|
|||
d406866a02
|
|||
c2094bd2c0
|
|||
065b5a751b
|
|||
0dc454e61f
|
|||
416a43f0b1
|
|||
7a338076db
|
|||
54bf1c2012
|
|||
32681259f6
|
|||
1c1aa5ea44
|
|||
da54af221c
|
|||
6c8d518e0d
|
|||
697f4f1569
|
|||
15d4ec3228
|
|||
c303346bc3
|
|||
b9af966849
|
|||
0a7459b72e
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -12,6 +12,7 @@ bld/*
|
|||||||
# Rider
|
# Rider
|
||||||
**/.idea/dictionaries
|
**/.idea/dictionaries
|
||||||
**/.idea/misc.xml
|
**/.idea/misc.xml
|
||||||
|
**/.idea/riderMarkupCache.xml
|
||||||
|
|
||||||
# User-specific files
|
# User-specific files
|
||||||
*.suo
|
*.suo
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||||
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||||
<option name="PROJECT_KIND" value="DotNetCore" />
|
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||||
<option name="PROJECT_TFM" value="net6.0-windows7.0" />
|
<option name="PROJECT_TFM" value="net7.0-windows" />
|
||||||
<method v="2">
|
<method v="2">
|
||||||
<option name="Build" />
|
<option name="Build" />
|
||||||
</method>
|
</method>
|
||||||
|
@@ -12,6 +12,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TweetImpl.CefSharp", "windo
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TweetLib.WinForms.Legacy", "windows\TweetLib.WinForms.Legacy\TweetLib.WinForms.Legacy.csproj", "{B54E732A-4090-4DAA-9ABD-311368C17B68}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TweetLib.WinForms.Legacy", "windows\TweetLib.WinForms.Legacy\TweetLib.WinForms.Legacy.csproj", "{B54E732A-4090-4DAA-9ABD-311368C17B68}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TweetLib.Api", "lib\TweetLib.Api\TweetLib.Api.csproj", "{85596C10-F76E-4619-9CC6-6C1593880F83}"
|
||||||
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TweetLib.Communication", "lib\TweetLib.Communication\TweetLib.Communication.csproj", "{72473763-4B9D-4FB6-A923-9364B2680F06}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TweetLib.Communication", "lib\TweetLib.Communication\TweetLib.Communication.csproj", "{72473763-4B9D-4FB6-A923-9364B2680F06}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TweetLib.Core", "lib\TweetLib.Core\TweetLib.Core.csproj", "{93BA3CB4-A812-4949-B07D-8D393FB38937}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TweetLib.Core", "lib\TweetLib.Core\TweetLib.Core.csproj", "{93BA3CB4-A812-4949-B07D-8D393FB38937}"
|
||||||
@@ -54,6 +56,10 @@ Global
|
|||||||
{B54E732A-4090-4DAA-9ABD-311368C17B68}.Debug|x86.Build.0 = Debug|x86
|
{B54E732A-4090-4DAA-9ABD-311368C17B68}.Debug|x86.Build.0 = Debug|x86
|
||||||
{B54E732A-4090-4DAA-9ABD-311368C17B68}.Release|x86.ActiveCfg = Release|x86
|
{B54E732A-4090-4DAA-9ABD-311368C17B68}.Release|x86.ActiveCfg = Release|x86
|
||||||
{B54E732A-4090-4DAA-9ABD-311368C17B68}.Release|x86.Build.0 = Release|x86
|
{B54E732A-4090-4DAA-9ABD-311368C17B68}.Release|x86.Build.0 = Release|x86
|
||||||
|
{85596C10-F76E-4619-9CC6-6C1593880F83}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
|
{85596C10-F76E-4619-9CC6-6C1593880F83}.Debug|x86.Build.0 = Debug|x86
|
||||||
|
{85596C10-F76E-4619-9CC6-6C1593880F83}.Release|x86.ActiveCfg = Release|x86
|
||||||
|
{85596C10-F76E-4619-9CC6-6C1593880F83}.Release|x86.Build.0 = Release|x86
|
||||||
{72473763-4B9D-4FB6-A923-9364B2680F06}.Debug|x86.ActiveCfg = Debug|x86
|
{72473763-4B9D-4FB6-A923-9364B2680F06}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
{72473763-4B9D-4FB6-A923-9364B2680F06}.Debug|x86.Build.0 = Debug|x86
|
{72473763-4B9D-4FB6-A923-9364B2680F06}.Debug|x86.Build.0 = Debug|x86
|
||||||
{72473763-4B9D-4FB6-A923-9364B2680F06}.Release|x86.ActiveCfg = Release|x86
|
{72473763-4B9D-4FB6-A923-9364B2680F06}.Release|x86.ActiveCfg = Release|x86
|
||||||
|
@@ -6,6 +6,6 @@ using TweetDuck;
|
|||||||
|
|
||||||
namespace TweetDuck {
|
namespace TweetDuck {
|
||||||
internal static class Version {
|
internal static class Version {
|
||||||
public const string Tag = "1.24";
|
public const string Tag = "1.25.4";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BIN
bld/Redist/API-MS-Win-core-xstate-l2-1-0.dll
Normal file
BIN
bld/Redist/API-MS-Win-core-xstate-l2-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-console-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-console-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-console-l1-2-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-console-l1-2-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-datetime-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-datetime-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-debug-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-debug-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-errorhandling-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-errorhandling-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-fibers-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-fibers-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-file-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-file-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-file-l1-2-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-file-l1-2-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-file-l2-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-file-l2-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-handle-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-handle-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-heap-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-heap-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-interlocked-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-interlocked-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-libraryloader-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-libraryloader-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-localization-l1-2-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-localization-l1-2-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-memory-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-memory-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-namedpipe-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-namedpipe-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-processenvironment-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-processenvironment-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-processthreads-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-processthreads-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-processthreads-l1-1-1.dll
Normal file
BIN
bld/Redist/api-ms-win-core-processthreads-l1-1-1.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-profile-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-profile-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-rtlsupport-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-rtlsupport-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-string-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-string-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-synch-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-synch-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-synch-l1-2-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-synch-l1-2-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-sysinfo-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-sysinfo-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-timezone-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-timezone-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-core-util-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-core-util-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-crt-conio-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-crt-conio-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-crt-convert-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-crt-convert-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-crt-environment-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-crt-environment-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-crt-filesystem-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-crt-filesystem-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-crt-heap-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-crt-heap-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-crt-locale-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-crt-locale-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-crt-math-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-crt-math-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-crt-multibyte-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-crt-multibyte-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-crt-private-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-crt-private-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-crt-process-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-crt-process-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-crt-runtime-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-crt-runtime-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-crt-stdio-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-crt-stdio-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-crt-string-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-crt-string-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-crt-time-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-crt-time-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/api-ms-win-crt-utility-l1-1-0.dll
Normal file
BIN
bld/Redist/api-ms-win-crt-utility-l1-1-0.dll
Normal file
Binary file not shown.
BIN
bld/Redist/concrt140.dll
Normal file
BIN
bld/Redist/concrt140.dll
Normal file
Binary file not shown.
BIN
bld/Redist/msvcp140.dll
Normal file
BIN
bld/Redist/msvcp140.dll
Normal file
Binary file not shown.
BIN
bld/Redist/msvcp140_1.dll
Normal file
BIN
bld/Redist/msvcp140_1.dll
Normal file
Binary file not shown.
BIN
bld/Redist/msvcp140_2.dll
Normal file
BIN
bld/Redist/msvcp140_2.dll
Normal file
Binary file not shown.
BIN
bld/Redist/msvcp140_atomic_wait.dll
Normal file
BIN
bld/Redist/msvcp140_atomic_wait.dll
Normal file
Binary file not shown.
BIN
bld/Redist/msvcp140_codecvt_ids.dll
Normal file
BIN
bld/Redist/msvcp140_codecvt_ids.dll
Normal file
Binary file not shown.
BIN
bld/Redist/ucrtbase.dll
Normal file
BIN
bld/Redist/ucrtbase.dll
Normal file
Binary file not shown.
BIN
bld/Redist/vccorlib140.dll
Normal file
BIN
bld/Redist/vccorlib140.dll
Normal file
Binary file not shown.
BIN
bld/Redist/vcruntime140.dll
Normal file
BIN
bld/Redist/vcruntime140.dll
Normal file
Binary file not shown.
@@ -1,18 +1,21 @@
|
|||||||
; Script generated by the Inno Script Studio Wizard.
|
; Script generated by the Inno Script Studio Wizard.
|
||||||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
||||||
|
|
||||||
|
#define MyAppID "8C25A716-7E11-4AAD-9992-8B5D0C78AE06"
|
||||||
|
|
||||||
#define MyAppName "TweetDuck"
|
#define MyAppName "TweetDuck"
|
||||||
#define MyAppPublisher "chylex"
|
#define MyAppPublisher "chylex"
|
||||||
#define MyAppURL "https://tweetduck.chylex.com"
|
#define MyAppURL "https://tweetduck.chylex.com"
|
||||||
#define MyAppShortURL "https://td.chylex.com"
|
#define MyAppShortURL "https://td.chylex.com"
|
||||||
#define MyAppExeName "TweetDuck.exe"
|
#define MyAppExeName "TweetDuck.exe"
|
||||||
|
|
||||||
#define MyAppVersion GetFileVersion("..\windows\TweetDuck\bin\x86\Release\TweetDuck.exe")
|
#define MyAppArchitecture "x86"
|
||||||
|
#define MyAppVersion GetFileVersion("..\windows\TweetDuck\bin\" + MyAppArchitecture + "\Release\TweetDuck.exe")
|
||||||
|
|
||||||
#include ReadReg(HKLM, "Software\Mitrich Software\Inno Download Plugin", "InstallDir") + "\idp.iss"
|
#include ReadReg(HKLM, "Software\Mitrich Software\Inno Download Plugin", "InstallDir") + "\idp.iss"
|
||||||
|
|
||||||
[Setup]
|
[Setup]
|
||||||
AppId={{8C25A716-7E11-4AAD-9992-8B5D0C78AE06}
|
AppId={{{#MyAppID}}
|
||||||
AppName={#MyAppName}
|
AppName={#MyAppName}
|
||||||
AppVersion={#MyAppVersion}
|
AppVersion={#MyAppVersion}
|
||||||
AppVerName={#MyAppName} {#MyAppVersion}
|
AppVerName={#MyAppName} {#MyAppVersion}
|
||||||
@@ -43,8 +46,8 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
|
|||||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalTasks}"; Flags: unchecked
|
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalTasks}"; Flags: unchecked
|
||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
Source: "..\windows\TweetDuck\bin\x86\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "..\windows\TweetDuck\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||||
|
|
||||||
[Icons]
|
[Icons]
|
||||||
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: TDIsUninstallable
|
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: TDIsUninstallable
|
||||||
|
@@ -1,18 +1,21 @@
|
|||||||
; Script generated by the Inno Script Studio Wizard.
|
; Script generated by the Inno Script Studio Wizard.
|
||||||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
||||||
|
|
||||||
|
#define MyAppID "8C25A716-7E11-4AAD-9992-8B5D0C78AE06"
|
||||||
|
|
||||||
#define MyAppName "TweetDuck"
|
#define MyAppName "TweetDuck"
|
||||||
#define MyAppPublisher "chylex"
|
#define MyAppPublisher "chylex"
|
||||||
#define MyAppURL "https://tweetduck.chylex.com"
|
#define MyAppURL "https://tweetduck.chylex.com"
|
||||||
#define MyAppShortURL "https://td.chylex.com"
|
#define MyAppShortURL "https://td.chylex.com"
|
||||||
#define MyAppExeName "TweetDuck.exe"
|
#define MyAppExeName "TweetDuck.exe"
|
||||||
|
|
||||||
#define MyAppVersion GetFileVersion("..\windows\TweetDuck\bin\x86\Release\TweetDuck.exe")
|
#define MyAppArchitecture "x86"
|
||||||
|
#define MyAppVersion GetFileVersion("..\windows\TweetDuck\bin\" + MyAppArchitecture + "\Release\TweetDuck.exe")
|
||||||
|
|
||||||
#include ReadReg(HKLM, "Software\Mitrich Software\Inno Download Plugin", "InstallDir") + "\idp.iss"
|
#include ReadReg(HKLM, "Software\Mitrich Software\Inno Download Plugin", "InstallDir") + "\idp.iss"
|
||||||
|
|
||||||
[Setup]
|
[Setup]
|
||||||
AppId={{8C25A716-7E11-4AAD-9992-8B5D0C78AE06}
|
AppId={{{#MyAppID}}
|
||||||
AppName={#MyAppName} Portable
|
AppName={#MyAppName} Portable
|
||||||
AppVersion={#MyAppVersion}
|
AppVersion={#MyAppVersion}
|
||||||
AppVerName={#MyAppName} {#MyAppVersion}
|
AppVerName={#MyAppName} {#MyAppVersion}
|
||||||
@@ -40,8 +43,8 @@ MinVersion=0,6.1
|
|||||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
Source: "..\windows\TweetDuck\bin\x86\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "..\windows\TweetDuck\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||||
|
|
||||||
[Run]
|
[Run]
|
||||||
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall shellexec skipifsilent
|
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall shellexec skipifsilent
|
||||||
|
@@ -1,15 +1,17 @@
|
|||||||
; Script generated by the Inno Script Studio Wizard.
|
; Script generated by the Inno Script Studio Wizard.
|
||||||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
||||||
|
|
||||||
|
#define MyAppID "8C25A716-7E11-4AAD-9992-8B5D0C78AE06"
|
||||||
|
|
||||||
#define MyAppName "TweetDuck"
|
#define MyAppName "TweetDuck"
|
||||||
#define MyAppPublisher "chylex"
|
#define MyAppPublisher "chylex"
|
||||||
#define MyAppURL "https://tweetduck.chylex.com"
|
#define MyAppURL "https://tweetduck.chylex.com"
|
||||||
#define MyAppShortURL "https://td.chylex.com"
|
#define MyAppShortURL "https://td.chylex.com"
|
||||||
#define MyAppExeName "TweetDuck.exe"
|
#define MyAppExeName "TweetDuck.exe"
|
||||||
|
|
||||||
#define MyAppID "8C25A716-7E11-4AAD-9992-8B5D0C78AE06"
|
#define MyAppArchitecture "x86"
|
||||||
#define MyAppVersion GetFileVersion("..\windows\TweetDuck\bin\x86\Release\TweetDuck.exe")
|
#define MyAppVersion GetFileVersion("..\windows\TweetDuck\bin\" + MyAppArchitecture + "\Release\TweetDuck.exe")
|
||||||
#define CefVersion GetFileVersion("..\windows\TweetDuck\bin\x86\Release\libcef.dll")
|
#define CefVersion GetFileVersion("..\windows\TweetDuck\bin\" + MyAppArchitecture + "\Release\libcef.dll")
|
||||||
|
|
||||||
#include ReadReg(HKLM, "Software\Mitrich Software\Inno Download Plugin", "InstallDir") + "\idp.iss"
|
#include ReadReg(HKLM, "Software\Mitrich Software\Inno Download Plugin", "InstallDir") + "\idp.iss"
|
||||||
|
|
||||||
@@ -43,13 +45,13 @@ MinVersion=0,6.1
|
|||||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
Source: "..\windows\TweetDuck\bin\x86\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "..\windows\TweetDuck\bin\x86\Release\TweetDuck.*"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\TweetDuck.*"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "..\windows\TweetDuck\bin\x86\Release\TweetImpl.*"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\TweetImpl.*"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "..\windows\TweetDuck\bin\x86\Release\TweetLib.*"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\TweetLib.*"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "..\windows\TweetDuck\bin\x86\Release\guide\*.*"; DestDir: "{app}\guide"; Flags: ignoreversion recursesubdirs createallsubdirs
|
Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\guide\*.*"; DestDir: "{app}\guide"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||||
Source: "..\windows\TweetDuck\bin\x86\Release\resources\*.*"; DestDir: "{app}\resources"; Flags: ignoreversion recursesubdirs createallsubdirs
|
Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\resources\*.*"; DestDir: "{app}\resources"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||||
Source: "..\windows\TweetDuck\bin\x86\Release\plugins\*.*"; DestDir: "{app}\plugins"; Flags: ignoreversion recursesubdirs createallsubdirs
|
Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\plugins\*.*"; DestDir: "{app}\plugins"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||||
|
|
||||||
[Icons]
|
[Icons]
|
||||||
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: TDIsUninstallable
|
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: TDIsUninstallable
|
||||||
@@ -69,16 +71,19 @@ Type: filesandordirs; Name: "{localappdata}\{#MyAppName}\GPUCache"
|
|||||||
Type: files; Name: "{app}\CEFSHARP-LICENSE.txt"
|
Type: files; Name: "{app}\CEFSHARP-LICENSE.txt"
|
||||||
Type: files; Name: "{app}\LICENSE.txt"
|
Type: files; Name: "{app}\LICENSE.txt"
|
||||||
Type: files; Name: "{app}\README.txt"
|
Type: files; Name: "{app}\README.txt"
|
||||||
Type: files; Name: "{app}\natives_blob.bin"
|
|
||||||
Type: files; Name: "{app}\cef.pak"
|
Type: files; Name: "{app}\cef.pak"
|
||||||
Type: files; Name: "{app}\cef_100_percent.pak"
|
Type: files; Name: "{app}\cef_100_percent.pak"
|
||||||
Type: files; Name: "{app}\cef_200_percent.pak"
|
Type: files; Name: "{app}\cef_200_percent.pak"
|
||||||
Type: files; Name: "{app}\cef_extensions.pak"
|
Type: files; Name: "{app}\cef_extensions.pak"
|
||||||
Type: files; Name: "{app}\devtools_resources.pak"
|
Type: files; Name: "{app}\devtools_resources.pak"
|
||||||
|
Type: files; Name: "{app}\natives_blob.bin"
|
||||||
|
Type: files; Name: "{app}\dbgshim.dll"
|
||||||
|
Type: files; Name: "{app}\mscordaccore_x86_x86_6.*.dll"
|
||||||
Type: filesandordirs; Name: "{app}\guide"
|
Type: filesandordirs; Name: "{app}\guide"
|
||||||
Type: filesandordirs; Name: "{app}\plugins\official"
|
Type: filesandordirs; Name: "{app}\plugins\official"
|
||||||
Type: filesandordirs; Name: "{app}\resources"
|
Type: filesandordirs; Name: "{app}\resources"
|
||||||
Type: filesandordirs; Name: "{app}\scripts"
|
Type: filesandordirs; Name: "{app}\scripts"
|
||||||
|
Type: filesandordirs; Name: "{app}\swiftshader"
|
||||||
|
|
||||||
[Code]
|
[Code]
|
||||||
function TDIsUninstallable: Boolean; forward;
|
function TDIsUninstallable: Boolean; forward;
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"sdk": {
|
"sdk": {
|
||||||
"version": "6.0.0",
|
"version": "7.0.0",
|
||||||
"rollForward": "latestMinor",
|
"rollForward": "latestMinor",
|
||||||
"allowPrerelease": false
|
"allowPrerelease": false
|
||||||
}
|
}
|
||||||
|
37
lib/TweetLib.Api/Data/NamespacedResource.cs
Normal file
37
lib/TweetLib.Api/Data/NamespacedResource.cs
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
namespace TweetLib.Api.Data {
|
||||||
|
public readonly struct NamespacedResource {
|
||||||
|
public Resource Namespace { get; }
|
||||||
|
public Resource Path { get; }
|
||||||
|
|
||||||
|
public NamespacedResource(Resource ns, Resource path) {
|
||||||
|
Namespace = ns;
|
||||||
|
Path = path;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool Equals(NamespacedResource other) {
|
||||||
|
return Namespace.Equals(other.Namespace) && Path.Equals(other.Path);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Equals(object? obj) {
|
||||||
|
return obj is NamespacedResource other && Equals(other);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool operator ==(NamespacedResource left, NamespacedResource right) {
|
||||||
|
return left.Equals(right);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool operator !=(NamespacedResource left, NamespacedResource right) {
|
||||||
|
return !left.Equals(right);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetHashCode() {
|
||||||
|
unchecked {
|
||||||
|
return (Namespace.GetHashCode() * 397) ^ Path.GetHashCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string ToString() {
|
||||||
|
return $"{Namespace}:{Path}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,28 @@
|
|||||||
|
namespace TweetLib.Api.Data.Notification {
|
||||||
|
/// <summary>
|
||||||
|
/// Allows extensions to decide which screen to use for notifications.
|
||||||
|
///
|
||||||
|
/// Every registered provider becomes available in the Options dialog and has to be explicitly selected by the user. Only one provider
|
||||||
|
/// can be active at any given time.
|
||||||
|
/// </summary>
|
||||||
|
public interface IDesktopNotificationScreenProvider {
|
||||||
|
/// <summary>
|
||||||
|
/// A unique identifier of this provider. Only needs to be unique within the scope of this plugin.
|
||||||
|
/// </summary>
|
||||||
|
Resource Id { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Text displayed in the user interface.
|
||||||
|
/// </summary>
|
||||||
|
string DisplayName { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a screen that will be used to display the next desktop notification.
|
||||||
|
///
|
||||||
|
/// If the return value is <c>null</c> or a screen that is not present in <see cref="IScreenLayout.AllScreens" />, desktop
|
||||||
|
/// notifications will be temporarily paused and this method will be called again after an unspecified amount of time (but
|
||||||
|
/// not sooner than 1 second since the last call).
|
||||||
|
/// </summary>
|
||||||
|
IScreen? PickScreen(IScreenLayout layout);
|
||||||
|
}
|
||||||
|
}
|
7
lib/TweetLib.Api/Data/Notification/IScreen.cs
Normal file
7
lib/TweetLib.Api/Data/Notification/IScreen.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace TweetLib.Api.Data.Notification {
|
||||||
|
public interface IScreen {
|
||||||
|
ScreenBounds Bounds { get; }
|
||||||
|
string Name { get; }
|
||||||
|
bool IsPrimary { get; }
|
||||||
|
}
|
||||||
|
}
|
9
lib/TweetLib.Api/Data/Notification/IScreenLayout.cs
Normal file
9
lib/TweetLib.Api/Data/Notification/IScreenLayout.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace TweetLib.Api.Data.Notification {
|
||||||
|
public interface IScreenLayout {
|
||||||
|
IScreen PrimaryScreen { get; }
|
||||||
|
IScreen TweetDuckScreen { get; }
|
||||||
|
List<IScreen> AllScreens { get; }
|
||||||
|
}
|
||||||
|
}
|
18
lib/TweetLib.Api/Data/Notification/ScreenBounds.cs
Normal file
18
lib/TweetLib.Api/Data/Notification/ScreenBounds.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
namespace TweetLib.Api.Data.Notification {
|
||||||
|
public readonly struct ScreenBounds {
|
||||||
|
public int X1 { get; }
|
||||||
|
public int Y1 { get; }
|
||||||
|
public int Width { get; }
|
||||||
|
public int Height { get; }
|
||||||
|
|
||||||
|
public int X2 => X1 + Width;
|
||||||
|
public int Y2 => Y1 + Height;
|
||||||
|
|
||||||
|
public ScreenBounds(int x1, int y1, int width, int height) {
|
||||||
|
X1 = x1;
|
||||||
|
Y1 = y1;
|
||||||
|
Width = width;
|
||||||
|
Height = height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
43
lib/TweetLib.Api/Data/Resource.cs
Normal file
43
lib/TweetLib.Api/Data/Resource.cs
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
using System;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
namespace TweetLib.Api.Data {
|
||||||
|
public readonly struct Resource {
|
||||||
|
private const string ValidCharacterPattern = "^[a-z0-9_]+$";
|
||||||
|
private static readonly Regex ValidCharacterRegex = new Regex(ValidCharacterPattern, RegexOptions.Compiled);
|
||||||
|
|
||||||
|
public string Name { get; }
|
||||||
|
|
||||||
|
public Resource(string name) {
|
||||||
|
if (!ValidCharacterRegex.IsMatch(name)) {
|
||||||
|
throw new ArgumentException("Resource name must match the regex: " + ValidCharacterPattern);
|
||||||
|
}
|
||||||
|
|
||||||
|
Name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool Equals(Resource other) {
|
||||||
|
return Name == other.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Equals(object? obj) {
|
||||||
|
return obj is Resource other && Equals(other);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool operator ==(Resource left, Resource right) {
|
||||||
|
return left.Equals(right);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool operator !=(Resource left, Resource right) {
|
||||||
|
return !left.Equals(right);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetHashCode() {
|
||||||
|
return Name.GetHashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string ToString() {
|
||||||
|
return Name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
5
lib/TweetLib.Api/ITweetDuckApi.cs
Normal file
5
lib/TweetLib.Api/ITweetDuckApi.cs
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
namespace TweetLib.Api {
|
||||||
|
public interface ITweetDuckApi {
|
||||||
|
T? FindService<T>() where T : class, ITweetDuckService;
|
||||||
|
}
|
||||||
|
}
|
3
lib/TweetLib.Api/ITweetDuckService.cs
Normal file
3
lib/TweetLib.Api/ITweetDuckService.cs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
namespace TweetLib.Api {
|
||||||
|
public interface ITweetDuckService {}
|
||||||
|
}
|
7
lib/TweetLib.Api/Service/INotificationService.cs
Normal file
7
lib/TweetLib.Api/Service/INotificationService.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
using TweetLib.Api.Data.Notification;
|
||||||
|
|
||||||
|
namespace TweetLib.Api.Service {
|
||||||
|
public interface INotificationService : ITweetDuckService {
|
||||||
|
void RegisterDesktopNotificationScreenProvider(IDesktopNotificationScreenProvider provider);
|
||||||
|
}
|
||||||
|
}
|
15
lib/TweetLib.Api/TweetDuckExtension.cs
Normal file
15
lib/TweetLib.Api/TweetDuckExtension.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
using TweetLib.Api.Data;
|
||||||
|
|
||||||
|
namespace TweetLib.Api {
|
||||||
|
public abstract class TweetDuckExtension {
|
||||||
|
/// <summary>
|
||||||
|
/// Unique identifier of the extension.
|
||||||
|
/// </summary>
|
||||||
|
public abstract Resource Id { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when the extension is loaded on startup, or enabled at runtime.
|
||||||
|
/// </summary>
|
||||||
|
public abstract void Enable(ITweetDuckApi api);
|
||||||
|
}
|
||||||
|
}
|
16
lib/TweetLib.Api/TweetLib.Api.csproj
Normal file
16
lib/TweetLib.Api/TweetLib.Api.csproj
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<Configurations>Debug;Release</Configurations>
|
||||||
|
<Platforms>x86;x64</Platforms>
|
||||||
|
<LangVersion>10</LangVersion>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="..\..\Version.cs" Link="Version.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
@@ -1,10 +1,10 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<Configurations>Debug;Release</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
<Platforms>x86;x64</Platforms>
|
<Platforms>x86;x64</Platforms>
|
||||||
<LangVersion>10</LangVersion>
|
<LangVersion>11</LangVersion>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<Configurations>Debug;Release</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
<Platforms>x86;x64</Platforms>
|
<Platforms>x86;x64</Platforms>
|
||||||
<LangVersion>10</LangVersion>
|
<LangVersion>11</LangVersion>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<Platforms>x86</Platforms>
|
<Platforms>x86</Platforms>
|
||||||
<LangVersion>10</LangVersion>
|
<LangVersion>11</LangVersion>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@@ -5,6 +5,8 @@ using TweetLib.Browser.Request;
|
|||||||
using TweetLib.Core.Application;
|
using TweetLib.Core.Application;
|
||||||
using TweetLib.Core.Features;
|
using TweetLib.Core.Features;
|
||||||
using TweetLib.Core.Features.Plugins;
|
using TweetLib.Core.Features.Plugins;
|
||||||
|
using TweetLib.Core.Resources;
|
||||||
|
using TweetLib.Core.Systems.Api;
|
||||||
using TweetLib.Core.Systems.Configuration;
|
using TweetLib.Core.Systems.Configuration;
|
||||||
using TweetLib.Core.Systems.Logging;
|
using TweetLib.Core.Systems.Logging;
|
||||||
using TweetLib.Utils.Static;
|
using TweetLib.Utils.Static;
|
||||||
@@ -21,9 +23,12 @@ namespace TweetLib.Core {
|
|||||||
internal static readonly string PluginPath = Path.Combine(ProgramPath, "plugins");
|
internal static readonly string PluginPath = Path.Combine(ProgramPath, "plugins");
|
||||||
internal static readonly string GuidePath = Path.Combine(ProgramPath, "guide");
|
internal static readonly string GuidePath = Path.Combine(ProgramPath, "guide");
|
||||||
|
|
||||||
|
public static readonly string ExtensionPath = Path.Combine(ProgramPath, "extensions");
|
||||||
public static readonly string StoragePath = IsPortable ? Path.Combine(ProgramPath, "portable", "storage") : GetDataFolder();
|
public static readonly string StoragePath = IsPortable ? Path.Combine(ProgramPath, "portable", "storage") : GetDataFolder();
|
||||||
public static readonly string LogoPath = Path.Combine(ResourcesPath, "images/logo.png");
|
public static readonly string LogoPath = Path.Combine(ResourcesPath, "images/logo.png");
|
||||||
|
|
||||||
|
public static ApiImplementation Api { get; } = new ();
|
||||||
|
|
||||||
public static Logger Logger { get; } = new (Path.Combine(StoragePath, "TD_Log.txt"), Setup.IsDebugLogging);
|
public static Logger Logger { get; } = new (Path.Combine(StoragePath, "TD_Log.txt"), Setup.IsDebugLogging);
|
||||||
public static ConfigManager ConfigManager { get; } = Setup.CreateConfigManager(StoragePath);
|
public static ConfigManager ConfigManager { get; } = Setup.CreateConfigManager(StoragePath);
|
||||||
|
|
||||||
|
41
lib/TweetLib.Core/Features/Extensions/ExtensionLoader.cs
Normal file
41
lib/TweetLib.Core/Features/Extensions/ExtensionLoader.cs
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
|
using TweetLib.Api;
|
||||||
|
using TweetLib.Core.Systems.Api;
|
||||||
|
|
||||||
|
namespace TweetLib.Core.Features.Extensions {
|
||||||
|
public static class ExtensionLoader {
|
||||||
|
public static void LoadAllInFolder(string extensionFolder) {
|
||||||
|
if (!Directory.Exists(extensionFolder)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
foreach (string file in Directory.EnumerateFiles(extensionFolder, "*.dll", SearchOption.TopDirectoryOnly)) {
|
||||||
|
try {
|
||||||
|
Assembly assembly = Assembly.LoadFile(file);
|
||||||
|
foreach (Type type in assembly.GetTypes()) {
|
||||||
|
if (typeof(TweetDuckExtension).IsAssignableFrom(type) && Activator.CreateInstance(type) is TweetDuckExtension extension) {
|
||||||
|
EnableExtension(extension);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
App.ErrorHandler.HandleException("Extension Error", "Could not load extension: " + Path.GetFileNameWithoutExtension(file), true, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (DirectoryNotFoundException) {
|
||||||
|
// ignore
|
||||||
|
} catch (Exception e) {
|
||||||
|
App.ErrorHandler.HandleException("Extension Error", "Could not load extensions.", true, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void EnableExtension(TweetDuckExtension extension) {
|
||||||
|
ApiImplementation apiImplementation = App.Api;
|
||||||
|
apiImplementation.CurrentExtension = extension;
|
||||||
|
extension.Enable(apiImplementation);
|
||||||
|
apiImplementation.CurrentExtension = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
25
lib/TweetLib.Core/Systems/Api/ApiImplementation.cs
Normal file
25
lib/TweetLib.Core/Systems/Api/ApiImplementation.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using TweetLib.Api;
|
||||||
|
|
||||||
|
namespace TweetLib.Core.Systems.Api {
|
||||||
|
public class ApiImplementation : ITweetDuckApi {
|
||||||
|
public TweetDuckExtension? CurrentExtension { get; internal set; }
|
||||||
|
|
||||||
|
private readonly Dictionary<Type, ITweetDuckService> services = new Dictionary<Type, ITweetDuckService>();
|
||||||
|
|
||||||
|
internal ApiImplementation() {}
|
||||||
|
|
||||||
|
public void RegisterService<T>(T service) where T : class, ITweetDuckService {
|
||||||
|
if (!typeof(T).IsInterface) {
|
||||||
|
throw new ArgumentException("Api service implementation must be registered with its interface type.");
|
||||||
|
}
|
||||||
|
|
||||||
|
services.Add(typeof(T), service);
|
||||||
|
}
|
||||||
|
|
||||||
|
public T? FindService<T>() where T : class, ITweetDuckService {
|
||||||
|
return services.TryGetValue(typeof(T), out ITweetDuckService? service) ? service as T : null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -10,7 +10,7 @@ using TweetLib.Utils.Static;
|
|||||||
|
|
||||||
namespace TweetLib.Core.Systems.Configuration {
|
namespace TweetLib.Core.Systems.Configuration {
|
||||||
public abstract class ConfigManager {
|
public abstract class ConfigManager {
|
||||||
protected static TypeConverterRegistry ConverterRegistry { get; } = new ();
|
public static TypeConverterRegistry ConverterRegistry { get; } = new ();
|
||||||
|
|
||||||
static ConfigManager() {
|
static ConfigManager() {
|
||||||
ConverterRegistry.Register(typeof(WindowState), new BasicTypeConverter<WindowState> {
|
ConverterRegistry.Register(typeof(WindowState), new BasicTypeConverter<WindowState> {
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<Configurations>Debug;Release</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
<Platforms>x86;x64</Platforms>
|
<Platforms>x86;x64</Platforms>
|
||||||
<LangVersion>10</LangVersion>
|
<LangVersion>11</LangVersion>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\TweetLib.Api\TweetLib.Api.csproj" />
|
||||||
<ProjectReference Include="..\TweetLib.Browser\TweetLib.Browser.csproj" />
|
<ProjectReference Include="..\TweetLib.Browser\TweetLib.Browser.csproj" />
|
||||||
<ProjectReference Include="..\TweetLib.Utils\TweetLib.Utils.csproj" />
|
<ProjectReference Include="..\TweetLib.Utils\TweetLib.Utils.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<Configurations>Debug;Release</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
<Platforms>x86;x64</Platforms>
|
<Platforms>x86;x64</Platforms>
|
||||||
<LangVersion>10</LangVersion>
|
<LangVersion>11</LangVersion>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<Platforms>x86</Platforms>
|
<Platforms>x86</Platforms>
|
||||||
<RuntimeIdentifiers>win7-x86;linux-x64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win7-x86;linux-x64</RuntimeIdentifiers>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@@ -7,7 +7,7 @@ open Xunit
|
|||||||
module RegexAccount =
|
module RegexAccount =
|
||||||
|
|
||||||
module IsMatch =
|
module IsMatch =
|
||||||
let isMatch = TwitterUrls.RegexAccount.IsMatch
|
let isMatch: string -> bool = TwitterUrls.RegexAccount.IsMatch
|
||||||
|
|
||||||
[<Fact>]
|
[<Fact>]
|
||||||
let ``accepts HTTP protocol`` () =
|
let ``accepts HTTP protocol`` () =
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<Platforms>x86</Platforms>
|
<Platforms>x86</Platforms>
|
||||||
<RuntimeIdentifiers>win7-x86;linux-x64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win7-x86;linux-x64</RuntimeIdentifiers>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<Platforms>x86</Platforms>
|
<Platforms>x86</Platforms>
|
||||||
<RuntimeIdentifiers>win7-x86;linux-x64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win7-x86;linux-x64</RuntimeIdentifiers>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<Configurations>Debug;Release</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
<Platforms>x64</Platforms>
|
<Platforms>x64</Platforms>
|
||||||
<LangVersion>10</LangVersion>
|
<LangVersion>11</LangVersion>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
|
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<Configurations>Debug;Release</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
<Platforms>x64</Platforms>
|
<Platforms>x64</Platforms>
|
||||||
<LangVersion>10</LangVersion>
|
<LangVersion>11</LangVersion>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"sdk": {
|
"sdk": {
|
||||||
"version": "6.0.0",
|
"version": "7.0.0",
|
||||||
"rollForward": "latestMinor",
|
"rollForward": "latestMinor",
|
||||||
"allowPrerelease": false
|
"allowPrerelease": false
|
||||||
}
|
}
|
||||||
|
@@ -67,6 +67,7 @@ import setup_tweet_context_menu from "./tweetdeck/setup_tweet_context_menu.js";
|
|||||||
import setup_tweetduck_account_bamboozle from "./tweetdeck/setup_tweetduck_account_bamboozle.js";
|
import setup_tweetduck_account_bamboozle from "./tweetdeck/setup_tweetduck_account_bamboozle.js";
|
||||||
import setup_video_player from "./tweetdeck/setup_video_player.js";
|
import setup_video_player from "./tweetdeck/setup_video_player.js";
|
||||||
import skip_pre_login_page from "./tweetdeck/skip_pre_login_page.js";
|
import skip_pre_login_page from "./tweetdeck/skip_pre_login_page.js";
|
||||||
|
import tweetdeck_preview_warning from "./tweetdeck/tweetdeck_preview_warning.js";
|
||||||
import update from "./update/update.js";
|
import update from "./update/update.js";
|
||||||
|
|
||||||
const globalFunctions = [
|
const globalFunctions = [
|
||||||
|
@@ -133,6 +133,14 @@ button {
|
|||||||
bottom: 192px !important;
|
bottom: 192px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************/
|
||||||
|
/* Hide Preview button */
|
||||||
|
/***********************/
|
||||||
|
|
||||||
|
.js-gryphon-beta-btn {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
/*************************************/
|
/*************************************/
|
||||||
/* Tweak collapsed left panel layout */
|
/* Tweak collapsed left panel layout */
|
||||||
/*************************************/
|
/*************************************/
|
||||||
|
7
resources/Content/tweetdeck/tweetdeck_preview_warning.js
Normal file
7
resources/Content/tweetdeck/tweetdeck_preview_warning.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import { $TD } from "../api/bridge.js";
|
||||||
|
|
||||||
|
export default function() {
|
||||||
|
if (!("TD" in window)) {
|
||||||
|
$TD.alert("warning", "Some TweetDuck features failed to load. This might happen if your Twitter account is enrolled into the TweetDeck Preview, which TweetDuck does not support. Try opting out of the TweetDeck Preview to restore TweetDuck's functionality.");
|
||||||
|
}
|
||||||
|
}
|
@@ -1,17 +1,16 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0-windows</TargetFramework>
|
<TargetFramework>net7.0-windows</TargetFramework>
|
||||||
<Configurations>Debug;Release</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
<Platforms>x86</Platforms>
|
<Platforms>x86</Platforms>
|
||||||
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
|
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
|
||||||
<LangVersion>10</LangVersion>
|
<LangVersion>11</LangVersion>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<UseWindowsForms>true</UseWindowsForms>
|
|
||||||
<RootNamespace>TweetDuck.Browser</RootNamespace>
|
<RootNamespace>TweetDuck.Browser</RootNamespace>
|
||||||
<AssemblyName>TweetDuck.Browser</AssemblyName>
|
<AssemblyName>TweetDuck.Browser</AssemblyName>
|
||||||
<ApplicationIcon>..\TweetDuck\Resources\Images\icon.ico</ApplicationIcon>
|
<ApplicationIcon>..\TweetDuck\Resources\Images\icon.ico</ApplicationIcon>
|
||||||
@@ -33,14 +32,14 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="CefSharp.WinForms.NETCore" Version="105.3.330" />
|
<PackageReference Include="CefSharp.Common.NETCore" Version="107.1.90" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="..\..\Version.cs" Link="Version.cs" />
|
<Compile Include="..\..\Version.cs" Link="Version.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="CopyResources" AfterTargets="Build">
|
<Target Name="MakeBrowserProcessLargeAddressAware" AfterTargets="Build">
|
||||||
<Exec Command="call "$(DevEnvDir)\..\..\VC\Auxiliary\Build\vcvars32.bat" & editbin /largeaddressaware /TSAWARE "$(TargetDir)TweetDuck.Browser.exe"" ContinueOnError="false" />
|
<Exec Command="call "$(DevEnvDir)\..\..\VC\Auxiliary\Build\vcvars32.bat" & editbin /largeaddressaware /TSAWARE "$(TargetDir)TweetDuck.Browser.exe"" ContinueOnError="false" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
@@ -23,7 +23,7 @@ namespace TweetDuck.Video.Controls {
|
|||||||
|
|
||||||
string? text = tooltipFunc(args);
|
string? text = tooltipFunc(args);
|
||||||
|
|
||||||
if (text == null) {
|
if (text == null || control.Parent == null) {
|
||||||
Visible = false;
|
Visible = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -28,7 +28,7 @@ namespace TweetDuck.Video.Controls {
|
|||||||
brushFore.Color = ForeColor;
|
brushFore.Color = ForeColor;
|
||||||
brushHover.Color = Color.FromArgb(128, ForeColor);
|
brushHover.Color = Color.FromArgb(128, ForeColor);
|
||||||
brushOverlap.Color = Color.FromArgb(80 + ForeColor.R * 11 / 16, 80 + ForeColor.G * 11 / 16, 80 + ForeColor.B * 11 / 16);
|
brushOverlap.Color = Color.FromArgb(80 + ForeColor.R * 11 / 16, 80 + ForeColor.G * 11 / 16, 80 + ForeColor.B * 11 / 16);
|
||||||
brushBack.Color = Parent.BackColor;
|
brushBack.Color = Parent?.BackColor ?? Color.Black;
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle rect = new Rectangle(0, 0, Width, Height);
|
Rectangle rect = new Rectangle(0, 0, Width, Height);
|
||||||
|
@@ -237,7 +237,7 @@ namespace TweetDuck.Video {
|
|||||||
int maxWidth = Math.Min(DpiScaled(media.imageSourceWidth), ownerWidth * 3 / 4);
|
int maxWidth = Math.Min(DpiScaled(media.imageSourceWidth), ownerWidth * 3 / 4);
|
||||||
int maxHeight = Math.Min(DpiScaled(media.imageSourceHeight), ownerHeight * 3 / 4);
|
int maxHeight = Math.Min(DpiScaled(media.imageSourceHeight), ownerHeight * 3 / 4);
|
||||||
|
|
||||||
bool isCursorInside = ClientRectangle.Contains(PointToClient(Cursor.Position));
|
bool isCursorInside = ClientRectangle.Contains(PointToClient(Cursor.Position)) && Handle == NativeMethods.GetFormHandleAt(Cursor.Position);
|
||||||
|
|
||||||
Size newSize = new Size(Math.Max(minWidth + 2, maxWidth), Math.Max(minHeight + 2, maxHeight));
|
Size newSize = new Size(Math.Max(minWidth + 2, maxWidth), Math.Max(minHeight + 2, maxHeight));
|
||||||
Point newLocation = new Point(ownerLeft + (ownerWidth - newSize.Width) / 2, ownerTop + (ownerHeight - newSize.Height + SystemInformation.CaptionHeight) / 2);
|
Point newLocation = new Point(ownerLeft + (ownerWidth - newSize.Width) / 2, ownerTop + (ownerHeight - newSize.Height + SystemInformation.CaptionHeight) / 2);
|
||||||
|
@@ -1,11 +1,13 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using System.Drawing;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace TweetDuck.Video {
|
namespace TweetDuck.Video {
|
||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
static class NativeMethods {
|
static class NativeMethods {
|
||||||
|
private const int GA_ROOT = 2;
|
||||||
private const int GWL_HWNDPARENT = -8;
|
private const int GWL_HWNDPARENT = -8;
|
||||||
|
|
||||||
[DllImport("user32.dll")]
|
[DllImport("user32.dll")]
|
||||||
@@ -25,6 +27,12 @@ namespace TweetDuck.Video {
|
|||||||
[DllImport("user32.dll")]
|
[DllImport("user32.dll")]
|
||||||
public static extern IntPtr GetForegroundWindow();
|
public static extern IntPtr GetForegroundWindow();
|
||||||
|
|
||||||
|
[DllImport("user32.dll")]
|
||||||
|
private static extern IntPtr WindowFromPoint(Point point);
|
||||||
|
|
||||||
|
[DllImport("user32.dll")]
|
||||||
|
private static extern IntPtr GetAncestor(IntPtr hwnd, int flags);
|
||||||
|
|
||||||
[DllImport("user32.dll")]
|
[DllImport("user32.dll")]
|
||||||
public static extern bool SetProcessDPIAware();
|
public static extern bool SetProcessDPIAware();
|
||||||
|
|
||||||
@@ -49,5 +57,10 @@ namespace TweetDuck.Video {
|
|||||||
* ...so technically, this is following the documentation to the word.
|
* ...so technically, this is following the documentation to the word.
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IntPtr GetFormHandleAt(Point point) {
|
||||||
|
IntPtr window = WindowFromPoint(point);
|
||||||
|
return window == IntPtr.Zero ? IntPtr.Zero : GetAncestor(window, GA_ROOT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0-windows</TargetFramework>
|
<TargetFramework>net7.0-windows</TargetFramework>
|
||||||
<Configurations>Debug;Release</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
<Platforms>x86</Platforms>
|
<Platforms>x86</Platforms>
|
||||||
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
|
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
|
||||||
<LangVersion>10</LangVersion>
|
<LangVersion>11</LangVersion>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
21
windows/TweetDuck/Application/ApiServices.cs
Normal file
21
windows/TweetDuck/Application/ApiServices.cs
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
using System;
|
||||||
|
using TweetDuck.Application.Service;
|
||||||
|
using TweetLib.Api;
|
||||||
|
using TweetLib.Api.Data;
|
||||||
|
using TweetLib.Api.Service;
|
||||||
|
using TweetLib.Core;
|
||||||
|
|
||||||
|
namespace TweetDuck.Application {
|
||||||
|
static class ApiServices {
|
||||||
|
public static NotificationService Notifications { get; } = new NotificationService();
|
||||||
|
|
||||||
|
public static void Register() {
|
||||||
|
App.Api.RegisterService<INotificationService>(Notifications);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static NamespacedResource Namespace(Resource path) {
|
||||||
|
TweetDuckExtension currentExtension = App.Api.CurrentExtension ?? throw new InvalidOperationException("Cannot use API services outside of designated method calls.");
|
||||||
|
return new NamespacedResource(currentExtension.Id, path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
33
windows/TweetDuck/Application/Service/NotificationService.cs
Normal file
33
windows/TweetDuck/Application/Service/NotificationService.cs
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using TweetLib.Api.Data;
|
||||||
|
using TweetLib.Api.Data.Notification;
|
||||||
|
using TweetLib.Api.Service;
|
||||||
|
|
||||||
|
namespace TweetDuck.Application.Service {
|
||||||
|
sealed class NotificationService : INotificationService {
|
||||||
|
private readonly List<NamespacedProvider> desktopNotificationScreenProviders = new ();
|
||||||
|
|
||||||
|
public void RegisterDesktopNotificationScreenProvider(IDesktopNotificationScreenProvider provider) {
|
||||||
|
desktopNotificationScreenProviders.Add(new NamespacedProvider(ApiServices.Namespace(provider.Id), provider));
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<NamespacedProvider> GetDesktopNotificationScreenProviders() {
|
||||||
|
return desktopNotificationScreenProviders;
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed class NamespacedProvider : IDesktopNotificationScreenProvider {
|
||||||
|
public NamespacedResource NamespacedId { get; }
|
||||||
|
|
||||||
|
private readonly IDesktopNotificationScreenProvider provider;
|
||||||
|
|
||||||
|
public NamespacedProvider(NamespacedResource id, IDesktopNotificationScreenProvider provider) {
|
||||||
|
this.NamespacedId = id;
|
||||||
|
this.provider = provider;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Resource Id => provider.Id;
|
||||||
|
public string DisplayName => provider.DisplayName;
|
||||||
|
public IScreen? PickScreen(IScreenLayout layout) => provider.PickScreen(layout);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -22,15 +22,7 @@ namespace TweetDuck.Browser.Notification {
|
|||||||
|
|
||||||
protected virtual Point PrimaryLocation {
|
protected virtual Point PrimaryLocation {
|
||||||
get {
|
get {
|
||||||
Screen screen;
|
Screen screen = Config.NotificationDisplay.PickScreen(owner);
|
||||||
|
|
||||||
if (Config.NotificationDisplay > 0 && Config.NotificationDisplay <= Screen.AllScreens.Length) {
|
|
||||||
screen = Screen.AllScreens[Config.NotificationDisplay - 1];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
screen = Screen.FromControl(owner);
|
|
||||||
}
|
|
||||||
|
|
||||||
int edgeDist = Config.NotificationEdgeDistance;
|
int edgeDist = Config.NotificationEdgeDistance;
|
||||||
|
|
||||||
switch (Config.NotificationPosition) {
|
switch (Config.NotificationPosition) {
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using TweetDuck.Controls;
|
||||||
using TweetDuck.Management;
|
using TweetDuck.Management;
|
||||||
using TweetDuck.Utils;
|
using TweetDuck.Utils;
|
||||||
using TweetLib.Browser.Interfaces;
|
using TweetLib.Browser.Interfaces;
|
||||||
@@ -53,12 +54,12 @@ namespace TweetDuck.Browser.Notification {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WindowsSessionManager_LockStateChanged(object? sender, EventArgs e) {
|
private void WindowsSessionManager_LockStateChanged(object? sender, bool isLocked) {
|
||||||
if (WindowsSessionManager.IsLocked) {
|
if (isLocked) {
|
||||||
PauseNotification(NotificationPauseReason.WindowsSessionLocked);
|
this.InvokeAsyncSafe(() => PauseNotification(NotificationPauseReason.WindowsSessionLocked));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ResumeNotification(NotificationPauseReason.WindowsSessionLocked);
|
this.InvokeAsyncSafe(() => ResumeNotification(NotificationPauseReason.WindowsSessionLocked));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user