Skip to content

Commit

Permalink
2022.5.18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SLT-World committed May 18, 2022
1 parent 959424a commit af20bd5
Show file tree
Hide file tree
Showing 50 changed files with 6,084 additions and 1,916 deletions.
50 changes: 8 additions & 42 deletions SLBr/SLBr.sln
Original file line number Diff line number Diff line change
@@ -1,59 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30907.101
# Visual Studio Version 17
VisualStudioVersion = 17.1.32407.343
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{497AA70B-948C-485D-9BDC-D4079761233F}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLBr", "SLBr\SLBr.csproj", "{7816736D-3C43-4D68-9A4D-9F0825372E97}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLBr Lite", "SLBr Lite\SLBr Lite.csproj", "{AB6A58F6-E85D-48A5-AB26-863F68BCF732}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLBr", "SLBr\SLBr.csproj", "{FF1DA947-F704-4897-B47F-0F380F969997}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Debug|x64.ActiveCfg = Debug|x64
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Debug|x64.Build.0 = Debug|x64
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Debug|x86.ActiveCfg = Debug|Win32
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Debug|x86.Build.0 = Debug|Win32
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Release|Any CPU.Build.0 = Release|Any CPU
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Release|x64.ActiveCfg = Release|x64
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Release|x64.Build.0 = Release|x64
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Release|x86.ActiveCfg = Release|Win32
{7816736D-3C43-4D68-9A4D-9F0825372E97}.Release|x86.Build.0 = Release|Win32
{AB6A58F6-E85D-48A5-AB26-863F68BCF732}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AB6A58F6-E85D-48A5-AB26-863F68BCF732}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB6A58F6-E85D-48A5-AB26-863F68BCF732}.Debug|x64.ActiveCfg = Debug|Any CPU
{AB6A58F6-E85D-48A5-AB26-863F68BCF732}.Debug|x64.Build.0 = Debug|Any CPU
{AB6A58F6-E85D-48A5-AB26-863F68BCF732}.Debug|x86.ActiveCfg = Debug|Any CPU
{AB6A58F6-E85D-48A5-AB26-863F68BCF732}.Debug|x86.Build.0 = Debug|Any CPU
{AB6A58F6-E85D-48A5-AB26-863F68BCF732}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB6A58F6-E85D-48A5-AB26-863F68BCF732}.Release|Any CPU.Build.0 = Release|Any CPU
{AB6A58F6-E85D-48A5-AB26-863F68BCF732}.Release|x64.ActiveCfg = Release|Any CPU
{AB6A58F6-E85D-48A5-AB26-863F68BCF732}.Release|x64.Build.0 = Release|Any CPU
{AB6A58F6-E85D-48A5-AB26-863F68BCF732}.Release|x86.ActiveCfg = Release|Any CPU
{AB6A58F6-E85D-48A5-AB26-863F68BCF732}.Release|x86.Build.0 = Release|Any CPU
{FF1DA947-F704-4897-B47F-0F380F969997}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FF1DA947-F704-4897-B47F-0F380F969997}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FF1DA947-F704-4897-B47F-0F380F969997}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FF1DA947-F704-4897-B47F-0F380F969997}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{7816736D-3C43-4D68-9A4D-9F0825372E97} = {497AA70B-948C-485D-9BDC-D4079761233F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7AEF2092-FFC4-4819-97A3-CC8862806680}
SolutionGuid = {1E5502FE-17AC-47F8-B630-E10EC469B60F}
EndGlobalSection
EndGlobal
68 changes: 48 additions & 20 deletions SLBr/SLBr/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
// Copyright © 2022 SLT World. All rights reserved.
// Use of this source code is governed by a GNU license that can be found in the LICENSE file.
using CefSharp.BrowserSubprocess;
using CefSharp.Wpf;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
Expand All @@ -27,9 +30,38 @@ public partial class App : Application

//private static Mutex SingleInstanceMutex;

static Mutex mutex = new Mutex(true, "{SLBrSLTBrowser-SLT-WORLD-BROWSER-SLBr}");
[STAThread]
private void Application_Startup(object sender, StartupEventArgs e)
{
Process _Process = Process.GetCurrentProcess();
var args = Environment.GetCommandLineArgs();
if (args.Length > 0 && args[0].StartsWith("--type=", StringComparison.Ordinal))
{
SelfHost.Main(args);
return;
}
if (mutex.WaitOne(TimeSpan.Zero, true))
mutex.ReleaseMutex();
else
{
MessageBox.Show("An instance SLBr is already running...");
Utils.PostMessage(
(IntPtr)Utils.HWND_BROADCAST,
Utils.WM_SHOWPAGE,
IntPtr.Zero,
IntPtr.Zero);
Current.Shutdown();
}
/*bool IsNewInstance = false;
SingleInstanceMutex = new Mutex(true, "SLBrSLTBrowser", out IsNewInstance);
if (!IsNewInstance)
{
MessageBox.Show("Already an instance is running...");
Current.Shutdown();
}*/


/*Process _Process = Process.GetCurrentProcess();
List<Process> Processes = Process.GetProcesses().Where(p =>
p.ProcessName == _Process.ProcessName && !_Process.HasExited).ToList();
Expand All @@ -40,57 +72,60 @@ private void Application_Startup(object sender, StartupEventArgs e)
//ShowWindow(Processes[0].MainWindowHandle, SW_MAXIMIZE);
MessageBox.Show("There " + (count > 2 ? "are" : "is") + $" already {count - 1} instance" + (count > 2 ? "s" : "") + " of SLBr running... Relaunch the application if you think something is wrong.");//BUG, Relaunching in SLBr shows this message
Current.Shutdown();
}
}*/


/*if (e.Args.Count() > 0)
{
MessageBox.Show("You have the latest version.");
Shutdown();
}*/

string ExecutablePath = Process.GetCurrentProcess().MainModule.FileName;
//string IconPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Resources/SLBr.ico");
JumpTask OpenTask = new JumpTask
{
Title = "Open",
Arguments = "",
//Description = "Open SLBr",
CustomCategory = "Actions",
ApplicationPath = Assembly.GetExecutingAssembly().Location,
IconResourcePath = Assembly.GetExecutingAssembly().Location
ApplicationPath = ExecutablePath,
IconResourcePath = ExecutablePath
};
JumpTask PrivateOpenTask = new JumpTask
{
Title = "Open in private mode",
Arguments = "Private",
//Description = "No browsing history will be saved, in memory cache will be used (Incognito)",
CustomCategory = "Actions",
ApplicationPath = Assembly.GetExecutingAssembly().Location,
IconResourcePath = Assembly.GetExecutingAssembly().Location
ApplicationPath = ExecutablePath,
IconResourcePath = ExecutablePath
};
JumpTask DeveloperOpenTask = new JumpTask
{
Title = "Open in developer mode",
Arguments = "Developer",
//Description = "Access to developer features of SLBr and bypass the i5 processor check",
CustomCategory = "Actions",
ApplicationPath = Assembly.GetExecutingAssembly().Location,
IconResourcePath = Assembly.GetExecutingAssembly().Location
ApplicationPath = ExecutablePath,
IconResourcePath = ExecutablePath
};
JumpTask ChromiumOpenTask = new JumpTask
{
Title = "Open in chromium mode",
Arguments = "Chromium",
//Description = "Access to developer features of SLBr and bypass the i5 processor check",
CustomCategory = "Actions",
ApplicationPath = Assembly.GetExecutingAssembly().Location,
IconResourcePath = Assembly.GetExecutingAssembly().Location
ApplicationPath = ExecutablePath,
IconResourcePath = ExecutablePath
};
JumpTask IEOpenTask = new JumpTask
{
Title = "Open in Internet Explorer mode",
Arguments = "IE",
//Description = "Access to developer features of SLBr and bypass the i5 processor check",
CustomCategory = "Actions",
ApplicationPath = Assembly.GetExecutingAssembly().Location,
IconResourcePath = Assembly.GetExecutingAssembly().Location
ApplicationPath = ExecutablePath,
IconResourcePath = ExecutablePath
};

JumpList jumpList = new JumpList();
Expand All @@ -103,13 +138,6 @@ private void Application_Startup(object sender, StartupEventArgs e)
jumpList.ShowRecentCategory = false;

JumpList.SetJumpList(Current, jumpList);
/*bool IsNewInstance = false;
SingleInstanceMutex = new Mutex(true, "SLBrSLTBrowser", out IsNewInstance);
if (!IsNewInstance)
{
MessageBox.Show("Already an instance is running...");
Current.Shutdown();
}*/
}
}
}
10 changes: 10 additions & 0 deletions SLBr/SLBr/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Windows;

[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
37 changes: 37 additions & 0 deletions SLBr/SLBr/ChromiumWebBrowser.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using CefSharp;
using CefSharp.Wpf;

namespace SLBr
{
/* class ChromiumWebBrowser : CefSharp.Wpf.ChromiumWebBrowser
{
public ChromiumWebBrowser() : base()
{
}
public ChromiumWebBrowser(string path) : base(path)
{
}
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("user32.dll", SetLastError = true)]
static extern bool PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);*/

/*protected override void WndProc(ref Message m)
{
const int WM_PARENTNOTIFY = 0x0210;
const int WM_NCLBUTTONDOWN = 0x00A1;
//Console.WriteLine(m.Msg);
if (m.Msg == WM_PARENTNOTIFY)
{
PostMessage(Parent.Handle, WM_NCLBUTTONDOWN, IntPtr.Zero, IntPtr.Zero);
}
base.WndProc(ref m);
}*/
//}
}
14 changes: 12 additions & 2 deletions SLBr/SLBr/Favourite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,18 @@ public string Arguments
RaisePropertyChanged("Arguments");
}
}
public string Address
{
get { return DUrl; }
set
{
DUrl = value;
RaisePropertyChanged("Url");
}
}

public string DName { get; set; }
public string DArguments { get; set; }
private string DName { get; set; }
private string DArguments { get; set; }
private string DUrl { get; set; }
}
}
Loading

0 comments on commit af20bd5

Please sign in to comment.