-
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.
Resize and Move works, but is ALOT slower than a16f222.
Signed-off-by: Dan Printzell <[email protected]>
- Loading branch information
Showing
17 changed files
with
727 additions
and
410 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
module dwin.backend.mouse; | ||
|
||
import dwin.backend.mousestyle; | ||
|
||
enum MouseStyles { | ||
Normal, | ||
Resizing, | ||
Moving | ||
} | ||
|
||
abstract class Mouse { | ||
public: | ||
abstract void Update(); | ||
abstract void Move(short x, short y); | ||
|
||
/// This will _NOT_ update the real position of the mouse | ||
void Set(short x, short y) { | ||
this.x = x; | ||
this.y = y; | ||
} | ||
|
||
@property short X(short x) { | ||
this.x = x; | ||
Move(x, y); | ||
return this.x; | ||
} | ||
|
||
@property short X() { | ||
return this.x; | ||
} | ||
|
||
@property short Y(short y) { | ||
this.y = y; | ||
Move(x, y); | ||
return this.y; | ||
} | ||
|
||
@property short Y() { | ||
return this.y; | ||
} | ||
|
||
@property bool[5] Buttons() { | ||
return buttons; | ||
} | ||
|
||
@property void Style(MouseStyles style) { | ||
styles[style].Apply(); | ||
} | ||
|
||
override string toString() { | ||
import std.format : format; | ||
|
||
return format("Mouse[X: %s, Y: %s, Buttons: '%(%s, %)']", x, y, buttons); | ||
} | ||
|
||
protected: | ||
short x; | ||
short y; | ||
bool[5] buttons; | ||
|
||
MouseStyle[MouseStyles.max + 1] styles; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module dwin.backend.mousestyle; | ||
|
||
abstract class MouseStyle { | ||
abstract void Apply(); | ||
} |
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
Oops, something went wrong.