Dual Window Manager development

This commit is contained in:
EverythingWindows 2022-11-21 10:43:53 +07:00
parent 3f4edf1b79
commit c5b2c3e370
13 changed files with 141 additions and 27 deletions

View file

@ -4,8 +4,11 @@ Module TerminalAPI
Public command As String Public command As String
Public AdvancedCommand As Boolean Public AdvancedCommand As Boolean
Public RawCommand As String Public RawCommand As String
Public IsConsoleParent As Boolean = True
Public Sub InitializeTerminal() Public Sub InitializeTerminal()
If IsConsoleParent = True Then
Cursor.Hide()
Strings.OnceInfo(1) = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\ShiftFS" Strings.OnceInfo(1) = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\ShiftFS"
Strings.OnceInfo(4) = "!" Strings.OnceInfo(4) = "!"
Strings.OnceInfo(7) = Console.Width Strings.OnceInfo(7) = Console.Width
@ -35,6 +38,13 @@ Module TerminalAPI
End If End If
End If End If
End If End If
Else
Cursor.Show()
Console_Windowed()
Console.TopMost = True
Terminal_PrintPrompt()
Terminal_AssignPrompt()
End If
Console.CurrentDirectory = Strings.OnceInfo(1) Console.CurrentDirectory = Strings.OnceInfo(1)
Console.Pseudodir = Console.CurrentDirectory.Replace(Strings.OnceInfo(1), "!\") Console.Pseudodir = Console.CurrentDirectory.Replace(Strings.OnceInfo(1), "!\")
Console.CurrentInterpreter = "terminal" Console.CurrentInterpreter = "terminal"
@ -179,6 +189,10 @@ Module TerminalAPI
AdvancedCommand = False AdvancedCommand = False
NormalCommand() NormalCommand()
End If End If
Case "close"
If IsConsoleParent = False Then
Console.Close()
End If
Case "codepoint" Case "codepoint"
Codepoint() Codepoint()
AdvancedCommand = False AdvancedCommand = False
@ -265,10 +279,10 @@ Module TerminalAPI
Case "startx" Case "startx"
Undeveloped() Undeveloped()
StartX() StartX()
Console_Windowed()
DuWM_FirstWindowSet(Console)
Case "shiftertest" Case "shiftertest"
DuWM_SecondWindowSet(Shifter) DuWM_SecondWindowSet(Shifter)
Console.Close()
DuWM_FirstWindowSet(Console)
Case "stopx" Case "stopx"
StopX() StopX()
Undeveloped() Undeveloped()

View file

@ -1,13 +1,13 @@
Public Class Strings Public Class Strings
Public Shared OSInfo() As String Public Shared OSInfo() As String
Public Shared ComputerInfo(6) As String Public Shared ComputerInfo(7) As String
Public Shared IsFree As Boolean Public Shared IsFree As Boolean
Public Shared OnceInfo(8) As String Public Shared OnceInfo(8) As String
Public Shared AvailableFeature(35) As String Public Shared AvailableFeature(35) As String
Public Shared CLIInterpreter As String Public Shared CLIInterpreter As String
Public Shared SaveFile As String Public Shared SaveFile As String
Public Shared Achievement As String Public Shared Achievement As String
Public Shared ProcessID(2) As String Public Shared ProcessID(1) As String
'STRING CATEGORIZATION WRITING RULES! 'STRING CATEGORIZATION WRITING RULES!
'THIS IS IN ORDER TO REMAIN COMPATIBLE WITH OLDER VERSIONS! 'THIS IS IN ORDER TO REMAIN COMPATIBLE WITH OLDER VERSIONS!
@ -47,6 +47,7 @@
'4 = Installed Packages (0.2.3) (default : 0 for New Game) '4 = Installed Packages (0.2.3) (default : 0 for New Game)
'5 = Color for Terminal (0.2.4) (default : 0F) '5 = Color for Terminal (0.2.4) (default : 0F)
'6 = Color for Infobar (0.2.4) (default : F0) '6 = Color for Infobar (0.2.4) (default : F0)
'7 = Window Manager (0.2.7) (default : 0)
' '
'AvailableFeature (Default is defined on the Story Mode, Free Mode automatically assigns every available feature to 1, Unavailable in the Shiftorium assigned as 2, Upgraded assigned as 3) Strings: 'AvailableFeature (Default is defined on the Story Mode, Free Mode automatically assigns every available feature to 1, Unavailable in the Shiftorium assigned as 2, Upgraded assigned as 3) Strings:
'0 = MAN command [Manual on each command] (0.2) (default : 0) '0 = MAN command [Manual on each command] (0.2) (default : 0)

View file

@ -11,5 +11,6 @@
NewLine("Shutting down...") NewLine("Shutting down...")
ShiftOSMenu.Show() ShiftOSMenu.Show()
Console.Close() Console.Close()
Shifter.Close()
End Sub End Sub
End Module End Module

View file

@ -29,6 +29,7 @@ Partial Class Console
Me.InfoBarTimer = New System.Windows.Forms.Timer(Me.components) Me.InfoBarTimer = New System.Windows.Forms.Timer(Me.components)
Me.ToolBar = New System.Windows.Forms.TextBox() Me.ToolBar = New System.Windows.Forms.TextBox()
Me.ShortcutHandler = New System.ComponentModel.BackgroundWorker() Me.ShortcutHandler = New System.ComponentModel.BackgroundWorker()
Me.DuWMHandle = New System.Windows.Forms.Timer(Me.components)
Me.SuspendLayout() Me.SuspendLayout()
' '
'TextBox1 'TextBox1
@ -80,6 +81,9 @@ Partial Class Console
Me.ToolBar.TabIndex = 1 Me.ToolBar.TabIndex = 1
Me.ToolBar.Visible = False Me.ToolBar.Visible = False
' '
'DuWMHandle
'
'
'Console 'Console
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@ -104,4 +108,5 @@ Partial Class Console
Friend WithEvents InfoBarTimer As Timer Friend WithEvents InfoBarTimer As Timer
Friend WithEvents ToolBar As TextBox Friend WithEvents ToolBar As TextBox
Public WithEvents ShortcutHandler As System.ComponentModel.BackgroundWorker Public WithEvents ShortcutHandler As System.ComponentModel.BackgroundWorker
Friend WithEvents DuWMHandle As Timer
End Class End Class

View file

@ -126,4 +126,7 @@
<metadata name="ShortcutHandler.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="ShortcutHandler.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>274, 17</value> <value>274, 17</value>
</metadata> </metadata>
<metadata name="DuWMHandle.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>415, 17</value>
</metadata>
</root> </root>

View file

@ -24,7 +24,6 @@ Public Class Console
.WorkerSupportsCancellation = True .WorkerSupportsCancellation = True
End With End With
Console_Full() Console_Full()
Cursor.Hide()
InitializeTerminal() InitializeTerminal()
End Sub End Sub
@ -237,4 +236,8 @@ Public Class Console
Private Sub TextBox1_Click(sender As Object, e As MouseEventArgs) Handles TextBox1.MouseDoubleClick, TextBox1.Click Private Sub TextBox1_Click(sender As Object, e As MouseEventArgs) Handles TextBox1.MouseDoubleClick, TextBox1.Click
End Sub End Sub
Private Sub DuWMHandle_Tick(sender As Object, e As EventArgs) Handles DuWMHandle.Tick
End Sub
End Class End Class

View file

@ -23,33 +23,61 @@ Partial Class Shifter
<System.Diagnostics.DebuggerStepThrough()> <System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent() Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label() Me.Label1 = New System.Windows.Forms.Label()
Me.Button1 = New System.Windows.Forms.Button()
Me.Label2 = New System.Windows.Forms.Label()
Me.SuspendLayout() Me.SuspendLayout()
' '
'Label1 'Label1
' '
Me.Label1.AutoSize = True Me.Label1.AutoSize = True
Me.Label1.Font = New System.Drawing.Font("Segoe UI", 24.0!, System.Drawing.FontStyle.Bold)
Me.Label1.Location = New System.Drawing.Point(12, 9) Me.Label1.Location = New System.Drawing.Point(12, 9)
Me.Label1.Name = "Label1" Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(40, 13) Me.Label1.Size = New System.Drawing.Size(131, 45)
Me.Label1.TabIndex = 0 Me.Label1.TabIndex = 0
Me.Label1.Text = "Shifter!" Me.Label1.Text = "Shifter!"
' '
'Button1
'
Me.Button1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button1.Location = New System.Drawing.Point(713, 415)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(75, 23)
Me.Button1.TabIndex = 1
Me.Button1.Text = "Close"
Me.Button1.UseVisualStyleBackColor = True
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(17, 64)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(69, 13)
Me.Label2.TabIndex = 2
Me.Label2.Text = "no desktop :("
'
'Shifter 'Shifter
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.Color.White Me.BackColor = System.Drawing.Color.White
Me.ClientSize = New System.Drawing.Size(800, 450) Me.ClientSize = New System.Drawing.Size(800, 450)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.Label1)
Me.ForeColor = System.Drawing.Color.Black Me.ForeColor = System.Drawing.Color.Black
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.Name = "Shifter" Me.Name = "Shifter"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Shifter" Me.Text = "Shifter"
Me.TopMost = True
Me.ResumeLayout(False) Me.ResumeLayout(False)
Me.PerformLayout() Me.PerformLayout()
End Sub End Sub
Friend WithEvents Label1 As Label Friend WithEvents Label1 As Label
Friend WithEvents Button1 As Button
Friend WithEvents Label2 As Label
End Class End Class

View file

@ -10,4 +10,8 @@
Close() Close()
End If End If
End Sub End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Close()
End Sub
End Class End Class

View file

@ -22,14 +22,30 @@ Partial Class Desktop
'Do not modify it using the code editor. 'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _ <System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent() Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.Button1 = New System.Windows.Forms.Button()
Me.DuWM = New System.Windows.Forms.Timer(Me.components)
Me.SuspendLayout() Me.SuspendLayout()
' '
'Button1
'
Me.Button1.BackColor = System.Drawing.Color.Black
Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button1.Location = New System.Drawing.Point(12, 12)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(75, 23)
Me.Button1.TabIndex = 0
Me.Button1.Text = "term"
Me.Button1.UseVisualStyleBackColor = False
'
'Desktop 'Desktop
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.Color.Red Me.BackColor = System.Drawing.Color.Red
Me.BackgroundImage = Global.ShiftOS_TheRevival.My.Resources.Resources.MenuBanner1
Me.ClientSize = New System.Drawing.Size(800, 450) Me.ClientSize = New System.Drawing.Size(800, 450)
Me.Controls.Add(Me.Button1)
Me.ForeColor = System.Drawing.Color.White Me.ForeColor = System.Drawing.Color.White
Me.Name = "Desktop" Me.Name = "Desktop"
Me.ShowIcon = False Me.ShowIcon = False
@ -40,4 +56,7 @@ Partial Class Desktop
Me.ResumeLayout(False) Me.ResumeLayout(False)
End Sub End Sub
Friend WithEvents Button1 As Button
Friend WithEvents DuWM As Timer
End Class End Class

View file

@ -117,4 +117,7 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="DuWM.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root> </root>

View file

@ -1,3 +1,17 @@
Public Class Desktop Public Class Desktop
Private Sub Desktop_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub Desktop_KeyPress(sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.T AndAlso Keys.Control Then
MsgBox("dangit")
DuWM_FirstWindowSet(Console)
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'DuWM_FirstWindowSet(Console)
DuWM_SingleWindowSet(Console)
End Sub
End Class End Class

View file

@ -1,9 +1,12 @@
Module DesktopManager Module DesktopManager
Public Sub StartX() Public Sub StartX()
Desktop.Show() Desktop.Show()
Desktop.TopMost = False
Desktop.FormBorderStyle = FormBorderStyle.None Desktop.FormBorderStyle = FormBorderStyle.None
Desktop.WindowState = FormWindowState.Maximized Desktop.WindowState = FormWindowState.Maximized
Desktop.TopMost = False
IsConsoleParent = False
OnlyOne = True
Console.Close()
Cursor.Show() Cursor.Show()
End Sub End Sub
@ -11,5 +14,6 @@
Desktop.Close() Desktop.Close()
Cursor.Hide() Cursor.Hide()
Console_Full() Console_Full()
IsConsoleParent = True
End Sub End Sub
End Module End Module

View file

@ -1,10 +1,15 @@
Module DuWM_Main Module DuWM_Main
Public IsDual As Boolean Public OnlyOne As Boolean
Public FirstWindow As Form
Public SecondWindow As Form
Public Sub DuWM_FirstWindowSet(WindowName As Form) Public Sub DuWM_FirstWindowSet(WindowName As Form)
WindowName.Show()
WindowName.Height = Desktop.Height - 20 WindowName.Height = Desktop.Height - 20
WindowName.Width = (Desktop.Width / 2) - 20 WindowName.Width = (Desktop.Width / 2) - 20
WindowName.Location = New Point(10, 10) WindowName.Location = New Point(10, 10)
FirstWindow = WindowName
Strings.ProcessID(0) = 1
End Sub End Sub
Public Sub DuWM_SecondWindowSet(WindowName As Form) Public Sub DuWM_SecondWindowSet(WindowName As Form)
@ -12,6 +17,16 @@
WindowName.Height = Desktop.Height - 20 WindowName.Height = Desktop.Height - 20
WindowName.Width = (Desktop.Width / 2) - 20 WindowName.Width = (Desktop.Width / 2) - 20
WindowName.Location = New Point((Desktop.Width / 2) + 10, 10) WindowName.Location = New Point((Desktop.Width / 2) + 10, 10)
SecondWindow = WindowName
Strings.ProcessID(1) = 1
End Sub
Public Sub DuWM_SingleWindowSet(WindowName As Form)
WindowName.Show()
WindowName.Height = Desktop.Height - 20
WindowName.Width = Desktop.Width - 20
WindowName.Location = New Point(10, 10)
FirstWindow = WindowName
End Sub End Sub
'Public Sub DuWM_GenerateWindowSet(WindowName As Form, PID As Integer) 'Public Sub DuWM_GenerateWindowSet(WindowName As Form, PID As Integer)