Skip to content

Commit

Permalink
wrap global states as session
Browse files Browse the repository at this point in the history
  • Loading branch information
kmaehashi committed Jun 14, 2020
1 parent 02230af commit 1f1935d
Show file tree
Hide file tree
Showing 9 changed files with 772 additions and 610 deletions.
3 changes: 3 additions & 0 deletions DesktopApp/XojoInstruments.xojo_project
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ Class=XIArray;../XojoInstruments/XojoInstruments/Framework/XIArray.xojo_code;&h0
Class=XIIterator;../XojoInstruments/XojoInstruments/Framework/XIIterator.xojo_code;&h000000004AFAE7FF;&h0000000025A657FF;false
Class=SnapshotDelta;../XojoInstruments/XojoInstruments/SnapshotDelta.xojo_code;&h000000007FC35FFF;&h000000005D00D7FF;false
Class=XINamedTemporaryFile;../XojoInstruments/XojoInstruments/Framework/XINamedTemporaryFile.xojo_code;&h00000000793B87FF;&h0000000025A657FF;false
Class=InstrumentsLocalSession;../XojoInstruments/XojoInstruments/InstrumentsLocalSession.xojo_code;&h000000006382E7FF;&h000000005D00D7FF;false
Class=InstrumentsSession;../XojoInstruments/XojoInstruments/InstrumentsSession.xojo_code;&h000000004917A7FF;&h000000005D00D7FF;false
Class=XIDate;../XojoInstruments/XojoInstruments/Framework/XIDate.xojo_code;&h000000004A93E7FF;&h0000000025A657FF;false
MajorVersion=#XojoInstruments.MajorVersion
MinorVersion=#XojoInstruments.MinorVersion
SubVersion=#XojoInstruments.BugVersion
Expand Down
21 changes: 17 additions & 4 deletions XojoInstruments/XojoInstruments.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,37 @@
Protected Module XojoInstruments
#tag Method, Flags = &h1
Protected Sub Start()
StartGUI()
End Sub
#tag EndMethod

#tag Method, Flags = &h1
Protected Sub StartGUI()
#if TargetDesktop
Static desktopGUI As XojoInstrumentsDesktopGUI

If desktopGUI = Nil Then
// Take a snapshot to register Introspection-related things to system object list.
Dim snap As New Snapshot(True)
#Pragma Unused snap
If mLocalSession = Nil Then
mLocalSession = New InstrumentsLocalSession()
End If

// Create a window.
desktopGUI = New XojoInstrumentsDesktopGUI()
desktopGUI = New XojoInstrumentsDesktopGUI(mLocalSession)
End If

desktopGUI.Show()
#else
// Local mode is only supported for Desktop apps.
Raise New PlatformNotSupportedException()
#endif
End Sub
#tag EndMethod


#tag Property, Flags = &h21
Private mLocalSession As InstrumentsLocalSession
#tag EndProperty

#tag ComputedProperty, Flags = &h1
#tag Getter
Get
Expand Down
6 changes: 6 additions & 0 deletions XojoInstruments/XojoInstruments/Framework/XIDate.xojo_code
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#tag Class
Protected Class XIDate
Inherits Date
Implements XojoInstruments.Framework.XIObject
End Class
#tag EndClass
Loading

0 comments on commit 1f1935d

Please # to comment.