rough working DuWM

This commit is contained in:
EverythingWindows 2022-11-21 13:56:13 +07:00
parent c5b2c3e370
commit a043f16287
9 changed files with 82 additions and 14 deletions

View file

@ -16,6 +16,7 @@ Module TerminalAPI
If Strings.IsFree = True Then If Strings.IsFree = True Then
Strings.ComputerInfo(0) = "shiftos" Strings.ComputerInfo(0) = "shiftos"
Strings.ComputerInfo(1) = "user" Strings.ComputerInfo(1) = "user"
Strings.ComputerInfo(7) = 1
Terminal_CheckFeature() Terminal_CheckFeature()
Terminal_PrintPrompt() Terminal_PrintPrompt()
Terminal_AssignPrompt() Terminal_AssignPrompt()
@ -276,15 +277,15 @@ Module TerminalAPI
Undeveloped() Undeveloped()
Case "shutdown", "shut down" Case "shutdown", "shut down"
TerminateShiftOS() TerminateShiftOS()
Case "startx" Case "startg"
Undeveloped() Undeveloped()
StartX() StartG()
Case "shiftertest" Case "shiftertest"
DuWM_SecondWindowSet(Shifter) DuWM_SecondWindowSet(Shifter)
Console.Close() Console.Close()
DuWM_FirstWindowSet(Console) DuWM_FirstWindowSet(Console)
Case "stopx" Case "stopg"
StopX() StopG()
Undeveloped() Undeveloped()
Case "textpad" Case "textpad"
If Strings.AvailableFeature(17) = "1" Then If Strings.AvailableFeature(17) = "1" Then

View file

@ -1,7 +1,7 @@
Module Terminate Module Terminate
Public Sub TerminateShiftOS() Public Sub TerminateShiftOS()
NewLine("Stopping the Window Manager...") NewLine("Stopping the Window Manager...")
StopX() StopG()
Console_Full() Console_Full()
If Strings.OnceInfo(6) = "story" Then If Strings.OnceInfo(6) = "story" Then
NewLine("Saving game...") NewLine("Saving game...")

View file

@ -42,8 +42,7 @@ Partial Class 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.FromArgb(CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(0, Byte), Integer))
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.Controls.Add(Me.Button1)
Me.ForeColor = System.Drawing.Color.White Me.ForeColor = System.Drawing.Color.White

View file

@ -12,6 +12,5 @@
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'DuWM_FirstWindowSet(Console) 'DuWM_FirstWindowSet(Console)
DuWM_SingleWindowSet(Console)
End Sub End Sub
End Class End Class

View file

@ -1,19 +1,29 @@
Module DesktopManager Module DesktopManager
Public Sub StartX() Public Sub StartG()
Desktop.Show() Desktop.Show()
Desktop.FormBorderStyle = FormBorderStyle.None Desktop.FormBorderStyle = FormBorderStyle.None
Desktop.WindowState = FormWindowState.Maximized Desktop.WindowState = FormWindowState.Maximized
Desktop.TopMost = False Desktop.TopMost = False
IsConsoleParent = False IsConsoleParent = False
OnlyOne = True
Console.Close() Console.Close()
WindowManagerChoose()
Cursor.Show() Cursor.Show()
End Sub End Sub
Public Sub StopX() Public Sub StopG()
Desktop.Close() DuWM_CurrentProcess = 0
Strings.ProcessID(0) = 0
Strings.ProcessID(1) = 0
Cursor.Hide() Cursor.Hide()
Console_Full()
IsConsoleParent = True IsConsoleParent = True
Console.Show()
Desktop.Close()
End Sub
Public Sub WindowManagerChoose()
Select Case Strings.ComputerInfo(7)
Case 1
DuWM_Initiate()
End Select
End Sub End Sub
End Module End Module

View file

@ -2,6 +2,14 @@
Public OnlyOne As Boolean Public OnlyOne As Boolean
Public FirstWindow As Form Public FirstWindow As Form
Public SecondWindow As Form Public SecondWindow As Form
Public DuWM_CurrentProcess As Integer = 0
Public Sub DuWM_Initiate()
Strings.ProcessID(0) = 0
Strings.ProcessID(1) = 0
'DuWM_SingleWindowSet(Console)
DuWM_NewProcess(Console)
End Sub
Public Sub DuWM_FirstWindowSet(WindowName As Form) Public Sub DuWM_FirstWindowSet(WindowName As Form)
WindowName.Show() WindowName.Show()
@ -27,6 +35,38 @@
WindowName.Width = Desktop.Width - 20 WindowName.Width = Desktop.Width - 20
WindowName.Location = New Point(10, 10) WindowName.Location = New Point(10, 10)
FirstWindow = WindowName FirstWindow = WindowName
Strings.ProcessID(0) = 1
End Sub
Public Sub DuWM_NewProcess(ProcessName As Form)
Dim NewWindow As New DuWM_WindowContainer
DuWM_CurrentProcess = DuWM_CurrentProcess + 1
NewWindow.ChildForm = ProcessName
NewWindow.ChildForm.TopLevel = False
NewWindow.ChildForm.FormBorderStyle = FormBorderStyle.None
NewWindow.ChildForm.WindowState = FormWindowState.Normal
NewWindow.ChildForm.Visible = False
NewWindow.DuWM_ContainerPanel.Controls.Add(NewWindow.ChildForm)
Select Case NewWindow.ChildForm.Visible
Case False
NewWindow.ChildForm.Visible = True
Case Else
NewWindow.ChildForm.Visible = False
End Select
If ProcessName Is Console Then
Strings.ProcessID(0) = 1
NewWindow.DuWM_PID = 0
Else
Strings.ProcessID(1) = 1
NewWindow.DuWM_PID = 1
End If
NewWindow.Show()
Select Case DuWM_CurrentProcess
Case 1
NewWindow.Height = Desktop.Height - 20
NewWindow.Width = Desktop.Width - 20
NewWindow.Location = New Point(10, 10)
End Select
End Sub End Sub
'Public Sub DuWM_GenerateWindowSet(WindowName As Form, PID As Integer) 'Public Sub DuWM_GenerateWindowSet(WindowName As Form, PID As Integer)

View file

@ -25,10 +25,12 @@ Partial Class DuWM_WindowContainer
Me.components = New System.ComponentModel.Container() Me.components = New System.ComponentModel.Container()
Me.DuWM_ContainerPanel = New System.Windows.Forms.Panel() Me.DuWM_ContainerPanel = New System.Windows.Forms.Panel()
Me.DuWM_WMCheck = New System.Windows.Forms.Timer(Me.components) Me.DuWM_WMCheck = New System.Windows.Forms.Timer(Me.components)
Me.DuWM_ChildSize = New System.Windows.Forms.Timer(Me.components)
Me.SuspendLayout() Me.SuspendLayout()
' '
'DuWM_ContainerPanel 'DuWM_ContainerPanel
' '
Me.DuWM_ContainerPanel.BackColor = System.Drawing.Color.Transparent
Me.DuWM_ContainerPanel.Dock = System.Windows.Forms.DockStyle.Fill Me.DuWM_ContainerPanel.Dock = System.Windows.Forms.DockStyle.Fill
Me.DuWM_ContainerPanel.Location = New System.Drawing.Point(0, 0) Me.DuWM_ContainerPanel.Location = New System.Drawing.Point(0, 0)
Me.DuWM_ContainerPanel.Name = "DuWM_ContainerPanel" Me.DuWM_ContainerPanel.Name = "DuWM_ContainerPanel"
@ -38,6 +40,9 @@ Partial Class DuWM_WindowContainer
'DuWM_WMCheck 'DuWM_WMCheck
' '
' '
'DuWM_ChildSize
'
'
'DuWM_WindowContainer 'DuWM_WindowContainer
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@ -46,6 +51,7 @@ Partial Class DuWM_WindowContainer
Me.ClientSize = New System.Drawing.Size(800, 450) Me.ClientSize = New System.Drawing.Size(800, 450)
Me.Controls.Add(Me.DuWM_ContainerPanel) Me.Controls.Add(Me.DuWM_ContainerPanel)
Me.ForeColor = System.Drawing.Color.Black Me.ForeColor = System.Drawing.Color.Black
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.Name = "DuWM_WindowContainer" Me.Name = "DuWM_WindowContainer"
Me.Text = "DuWM_WindowContainer" Me.Text = "DuWM_WindowContainer"
Me.ResumeLayout(False) Me.ResumeLayout(False)
@ -54,4 +60,5 @@ Partial Class DuWM_WindowContainer
Friend WithEvents DuWM_ContainerPanel As Panel Friend WithEvents DuWM_ContainerPanel As Panel
Friend WithEvents DuWM_WMCheck As Timer Friend WithEvents DuWM_WMCheck As Timer
Friend WithEvents DuWM_ChildSize As Timer
End Class End Class

View file

@ -120,4 +120,7 @@
<metadata name="DuWM_WMCheck.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="DuWM_WMCheck.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<metadata name="DuWM_ChildSize.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>168, 17</value>
</metadata>
</root> </root>

View file

@ -3,12 +3,21 @@
Public DuWM_PID As Integer Public DuWM_PID As Integer
Private Sub DuWM_WindowContainer_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub DuWM_WindowContainer_Load(sender As Object, e As EventArgs) Handles MyBase.Load
DuWM_WMCheck.Start()
DuWM_ChildSize.Start()
End Sub End Sub
Private Sub DuWM_WMCheck_Tick(sender As Object, e As EventArgs) Handles DuWM_WMCheck.Tick Private Sub DuWM_WMCheck_Tick(sender As Object, e As EventArgs) Handles DuWM_WMCheck.Tick
If ChildForm.Visible = False Then
Strings.ProcessID(DuWM_PID) = 0
Close()
End If
If Strings.ProcessID(DuWM_PID) = 0 Then If Strings.ProcessID(DuWM_PID) = 0 Then
Close() Close()
End If End If
End Sub End Sub
Private Sub ChildSize_Tick(sender As Object, e As EventArgs) Handles DuWM_ChildSize.Tick
ChildForm.Size = DuWM_ContainerPanel.Size
End Sub
End Class End Class