not-quite-finish-but-functional DuWM

This commit is contained in:
EverythingWindows 2022-11-22 05:42:55 +07:00
parent a043f16287
commit 804f2b7f7e
14 changed files with 134 additions and 20 deletions

View file

@ -4,10 +4,11 @@ Module TerminalAPI
Public command As String
Public AdvancedCommand As Boolean
Public RawCommand As String
Public IsConsoleParent As Boolean = True
Public IsConsoleParent As Boolean
Public Sub InitializeTerminal()
If IsConsoleParent = True Then
Console.TopMost = False
Cursor.Hide()
Strings.OnceInfo(1) = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\ShiftFS"
Strings.OnceInfo(4) = "!"
@ -279,13 +280,18 @@ Module TerminalAPI
TerminateShiftOS()
Case "startg"
Undeveloped()
StartG()
If IsStartG = False Then
StartG()
End If
Case "shiftertest"
DuWM_SecondWindowSet(Shifter)
Console.Close()
DuWM_FirstWindowSet(Console)
'DuWM_SecondWindowSet(Shifter)
'Console.Close()
'DuWM_FirstWindowSet(Console)
DuWM_NewProcess(Shifter)
Case "stopg"
StopG()
If IsStartG = True Then
StopG()
End If
Undeveloped()
Case "textpad"
If Strings.AvailableFeature(17) = "1" Then

View file

@ -1,7 +1,9 @@
Module Terminate
Public Sub TerminateShiftOS()
NewLine("Stopping the Window Manager...")
StopG()
If IsStartG = True Then
NewLine("Stopping the Window Manager...")
StopG()
End If
Console_Full()
If Strings.OnceInfo(6) = "story" Then
NewLine("Saving game...")
@ -10,7 +12,8 @@
Cursor.Show()
NewLine("Shutting down...")
ShiftOSMenu.Show()
Console.Close()
Shifter.Close()
If IsStartG = False Then
Console.Close()
End If
End Sub
End Module

View file

@ -56,6 +56,7 @@ Module SaveLoadSystem
End Sub
Public Sub FreeRoamMode()
IsConsoleParent = True
'Sets all features to as bought
Strings.ComputerInfo(0) = "shiftos"
Strings.ComputerInfo(1) = "user"

View file

@ -23,7 +23,9 @@ Public Class Console
With ShortcutHandler
.WorkerSupportsCancellation = True
End With
'MsgBox("Full!")
Console_Full()
'MsgBox("Initialize!")
InitializeTerminal()
End Sub

View file

@ -37,6 +37,7 @@ Partial Class Desktop
Me.Button1.TabIndex = 0
Me.Button1.Text = "term"
Me.Button1.UseVisualStyleBackColor = False
Me.Button1.Visible = False
'
'Desktop
'

View file

@ -1,23 +1,47 @@
Module DesktopManager
Imports System.Threading
Module DesktopManager
Public IsStartG As Boolean
Public Sub StartG()
IsStartG = True
Desktop.Show()
Desktop.FormBorderStyle = FormBorderStyle.None
Desktop.WindowState = FormWindowState.Maximized
Desktop.TopMost = False
IsConsoleParent = False
Console.Close()
Console.Dispose()
WindowManagerChoose()
Cursor.Show()
End Sub
Public Sub StopG()
DuWM_CurrentProcess = 0
Strings.ProcessID(0) = 0
Strings.ProcessID(1) = 0
Cursor.Hide()
IsStartG = False
'MsgBox("IsConsoleParent should be true!")
IsConsoleParent = True
''MsgBox("PID 0 0")
'Strings.ProcessID(0) = 0
''MsgBox("PID 1 0")
'Strings.ProcessID(1) = 0
TerminateWindowApps()
'MsgBox("Hide!")
Cursor.Hide()
MsgBox("this is not a bug, this is a feature") 'Use this messagebox to hold Console to stay open, because removing this line closes Console all together for some reason
Console.Show()
Desktop.Close()
'MsgBox("ADIOS!")
Desktop.Hide()
End Sub
Public Sub TerminateWindowApps()
Dim MaxPID As Integer = 0
Do
If MaxPID = 2 Then
Exit Do
Else
Strings.ProcessID(MaxPID) = 0
MaxPID = MaxPID + 1
End If
Loop
End Sub
Public Sub WindowManagerChoose()

View file

@ -0,0 +1,30 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class ThisIsNotABugThisIsAFeature
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
components = New System.ComponentModel.Container
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(800, 450)
Me.Text = "ThisIsNotABugThisIsAFeature"
End Sub
End Class

View file

@ -0,0 +1,3 @@
Public Class ThisIsNotABugThisIsAFeature
End Class

View file

@ -17,7 +17,8 @@ Public Class ShiftOSMenu
Private Sub btn_Exit_Click(sender As Object, e As EventArgs) Handles btn_Exit.Click
Select Case btn_Exit.Text
Case "Exit"
Close()
'Close()
Application.Exit()
End Select
End Sub

View file

@ -3,6 +3,7 @@
Public FirstWindow As Form
Public SecondWindow As Form
Public DuWM_CurrentProcess As Integer = 0
Public DuWM_ChangeLayout As Boolean
Public Sub DuWM_Initiate()
Strings.ProcessID(0) = 0
@ -66,7 +67,12 @@
NewWindow.Height = Desktop.Height - 20
NewWindow.Width = Desktop.Width - 20
NewWindow.Location = New Point(10, 10)
Case 2
NewWindow.Height = Desktop.Height - 20
NewWindow.Width = (Desktop.Width / 2) - 20
NewWindow.Location = New Point((Desktop.Width / 2) + 10, 10)
End Select
DuWM_ChangeLayout = True
End Sub
'Public Sub DuWM_GenerateWindowSet(WindowName As Form, PID As Integer)

View file

@ -26,6 +26,7 @@ Partial Class DuWM_WindowContainer
Me.DuWM_ContainerPanel = New System.Windows.Forms.Panel()
Me.DuWM_WMCheck = New System.Windows.Forms.Timer(Me.components)
Me.DuWM_ChildSize = New System.Windows.Forms.Timer(Me.components)
Me.DuWM_LayoutCheck = New System.Windows.Forms.Timer(Me.components)
Me.SuspendLayout()
'
'DuWM_ContainerPanel
@ -43,6 +44,9 @@ Partial Class DuWM_WindowContainer
'DuWM_ChildSize
'
'
'DuWM_LayoutCheck
'
'
'DuWM_WindowContainer
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@ -61,4 +65,5 @@ Partial Class DuWM_WindowContainer
Friend WithEvents DuWM_ContainerPanel As Panel
Friend WithEvents DuWM_WMCheck As Timer
Friend WithEvents DuWM_ChildSize As Timer
Friend WithEvents DuWM_LayoutCheck As Timer
End Class

View file

@ -123,4 +123,7 @@
<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>
<metadata name="DuWM_LayoutCheck.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>312, 17</value>
</metadata>
</root>

View file

@ -1,18 +1,22 @@
Public Class DuWM_WindowContainer
Public ChildForm As Form
Public ChildForm As New Form
Public DuWM_PID As Integer
Private Sub DuWM_WindowContainer_Load(sender As Object, e As EventArgs) Handles MyBase.Load
DuWM_WMCheck.Start()
DuWM_ChildSize.Start()
DuWM_LayoutCheck.Start()
End Sub
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
'MsgBox(Convert.ToString(ChildForm))
DuWM_CurrentProcess = DuWM_CurrentProcess - 1
DuWM_ChangeLayout = True
DuWM_WMCheck.Stop()
Close()
End If
End Sub
@ -20,4 +24,23 @@
Private Sub ChildSize_Tick(sender As Object, e As EventArgs) Handles DuWM_ChildSize.Tick
ChildForm.Size = DuWM_ContainerPanel.Size
End Sub
Private Sub DuWM_LayoutCheck_Tick(sender As Object, e As EventArgs) Handles DuWM_LayoutCheck.Tick
If DuWM_ChangeLayout = True Then
Select Case DuWM_CurrentProcess
Case 1
Height = Desktop.Height - 20
Width = Desktop.Width - 20
Location = New Point(10, 10)
Case 2
Select Case DuWM_PID
Case 0
Height = Desktop.Height - 20
Width = (Desktop.Width / 2) - 20
Location = New Point(10, 10)
End Select
End Select
DuWM_ChangeLayout = False
End If
End Sub
End Class

View file

@ -130,6 +130,12 @@
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForms\DesktopEnvironment\master\DesktopManager.vb" />
<Compile Include="MainForms\DesktopEnvironment\master\ThisIsNotABugThisIsAFeature.Designer.vb">
<DependentUpon>ThisIsNotABugThisIsAFeature.vb</DependentUpon>
</Compile>
<Compile Include="MainForms\DesktopEnvironment\master\ThisIsNotABugThisIsAFeature.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForms\Epilepsy.Designer.vb">
<DependentUpon>Epilepsy.vb</DependentUpon>
</Compile>