-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Dan Printzell <[email protected]>
- Loading branch information
Showing
14 changed files
with
2,783 additions
and
2,556 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,47 @@ | ||
module dwin.backend.workspace; | ||
|
||
import dwin.backend.container; | ||
import dwin.backend.layout; | ||
import dwin.layout.floatinglayout; | ||
|
||
class Workspace { | ||
public: | ||
this(string name) { | ||
this.name = name; | ||
onTopContainers = new FloatingLayout(); | ||
onTop = new FloatingLayout(); | ||
root = new FloatingLayout(); | ||
} | ||
|
||
void Add(Container container) { | ||
if (rootContainer) | ||
rootContainer.Add(container); | ||
else | ||
rootContainer = container; | ||
root.Add(container); | ||
} | ||
|
||
void Remove(Container container) { | ||
assert(rootContainer); | ||
|
||
if (rootContainer == container) | ||
rootContainer = null; | ||
else | ||
rootContainer.Remove(container); | ||
root.Remove(container); | ||
} | ||
|
||
void AddOnTop(Container container) { | ||
onTopContainers.Add(container); | ||
onTop.Add(container); | ||
} | ||
|
||
void RemoveOnTop(Container container) { | ||
onTopContainers.Remove(container); | ||
onTop.Remove(container); | ||
} | ||
|
||
@property ref string Name() { | ||
return name; | ||
} | ||
|
||
@property Container RootContainer() { | ||
return rootContainer; | ||
@property Layout Root() { | ||
return root; | ||
} | ||
|
||
@property FloatingLayout OnTopContainers() { | ||
return onTopContainers; | ||
@property FloatingLayout OnTop() { | ||
return onTop; | ||
} | ||
|
||
protected: | ||
string name; | ||
Container rootContainer; | ||
FloatingLayout onTopContainers; | ||
Layout root; | ||
FloatingLayout onTop; | ||
} |
Oops, something went wrong.