Skip to content
This repository has been archived by the owner on Jun 11, 2022. It is now read-only.

Commit

Permalink
Move Finger out of Touch namespace
Browse files Browse the repository at this point in the history
Change 'namespace' hack from final abstract class to interface
  • Loading branch information
Dgame committed May 31, 2015
1 parent 96c4070 commit ac846f0
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 43 deletions.
2 changes: 1 addition & 1 deletion source/Dgame/System/Battery.d
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct Battery {
* *
* Author: Randy Schuett (rswhite4@googlemail.com)k * Author: Randy Schuett (rswhite4@googlemail.com)k
*/ */
final abstract class System { interface System {
/** /**
* Returns the PowerInfo structure with the currently power informations * Returns the PowerInfo structure with the currently power informations
* *
Expand Down
3 changes: 1 addition & 2 deletions source/Dgame/System/Keyboard.d
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ public:
* *
* Author: Randy Schuett (rswhite4@googlemail.com) * Author: Randy Schuett (rswhite4@googlemail.com)
*/ */
final abstract class Keyboard { interface Keyboard {
public:
/** /**
* Returns if the given Keyboard.Code is pressed. * Returns if the given Keyboard.Code is pressed.
* *
Expand Down
50 changes: 25 additions & 25 deletions source/Dgame/System/Touch.d
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,35 +7,35 @@ import derelict.sdl2.sdl;
public: public:


/** /**
* Represent Touch-Events * The Finger structure
*
* Author: Randy Schuett (rswhite4@googlemail.com)
*/ */
final abstract class Touch { struct Finger {
/** /**
* The Finger structure * The Finger ID
*/ */
static struct Finger { long id; // TODO: change to (u)int?
/** /**
* The Finger ID * The x coordinate in range of 0 .. 1
*/ * Multiply it with the width of the Window to get the real x coordinate
long id; */
/** float x;
* The x coordinate in range of 0 .. 1 /**
* Multiply it with the width of the Window to get the real x coordinate * The y coordinate in range of 0 .. 1
*/ * Multiply it with the height of the Window to get the real y coordinate
float x; */
/** float y;
* The y coordinate in range of 0 .. 1 /**
* Multiply it with the height of the Window to get the real y coordinate * The quantity of pressure applied in range of 0 .. 1
*/ */
float y; float pressure;
/** }
* The quantity of pressure applied in range of 0 .. 1
*/
float pressure;
}


/**
* Represent Touch-Events
*
* Author: Randy Schuett (rswhite4@googlemail.com)
*/
interface Touch {
/** /**
* Returns of many Touch-Devices exist * Returns of many Touch-Devices exist
*/ */
Expand Down
2 changes: 1 addition & 1 deletion source/Dgame/docs/Battery.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ <h1>Dgame.System.Battery</h1>
</dd> </dd>
</dl> </dl>
</dd> </dd>
<dt><big><a name="System"></a>abstract class <u>System</u>; <dt><big><a name="System"></a>interface <u>System</u>;
</big></dt> </big></dt>
<dd>The <u>System</u> struct contains the Power struct, <dd>The <u>System</u> struct contains the Power struct,
which give information about your current battery which give information about your current battery
Expand Down
2 changes: 1 addition & 1 deletion source/Dgame/docs/Keyboard.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<h1>Dgame.System.Keyboard</h1> <h1>Dgame.System.Keyboard</h1>
<!-- Generated by Ddoc from ..\System\Keyboard.d --> <!-- Generated by Ddoc from ..\System\Keyboard.d -->
<br><br> <br><br>
<dl><dt><big><a name="Keyboard"></a>abstract class <u>Keyboard</u>; <dl><dt><big><a name="Keyboard"></a>interface <u>Keyboard</u>;
</big></dt> </big></dt>
<dd>Represent the <u>Keyboard</u> <dd>Represent the <u>Keyboard</u>
<br><br> <br><br>
Expand Down
26 changes: 13 additions & 13 deletions source/Dgame/docs/Touch.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,42 +5,42 @@
<h1>Dgame.System.Touch</h1> <h1>Dgame.System.Touch</h1>
<!-- Generated by Ddoc from ..\System\Touch.d --> <!-- Generated by Ddoc from ..\System\Touch.d -->
<br><br> <br><br>
<dl><dt><big><a name="Touch"></a>abstract class <u>Touch</u>; <dl><dt><big><a name="Finger"></a>struct <u>Finger</u>;
</big></dt>
<dd>Represent <u>Touch</u>-Events
<br><br>
<b>Author:</b><br>
Randy Schuett (rswhite4@googlemail.com)<br><br>

<dl><dt><big><a name="Touch.Finger"></a>struct <u>Finger</u>;
</big></dt> </big></dt>
<dd>The <u>Finger</u> structure<br><br> <dd>The <u>Finger</u> structure<br><br>


<dl><dt><big><a name="Touch.Finger.id"></a>long <u>id</u>; <dl><dt><big><a name="Finger.id"></a>long <u>id</u>;
</big></dt> </big></dt>
<dd>The Finger ID<br><br> <dd>The Finger ID<br><br>


</dd> </dd>
<dt><big><a name="Touch.Finger.x"></a>float <u>x</u>; <dt><big><a name="Finger.x"></a>float <u>x</u>;
</big></dt> </big></dt>
<dd>The <u>x</u> coordinate in range of 0 .. 1 <dd>The <u>x</u> coordinate in range of 0 .. 1
Multiply it with the width of the Window to get the real <u>x</u> coordinate<br><br> Multiply it with the width of the Window to get the real <u>x</u> coordinate<br><br>


</dd> </dd>
<dt><big><a name="Touch.Finger.y"></a>float <u>y</u>; <dt><big><a name="Finger.y"></a>float <u>y</u>;
</big></dt> </big></dt>
<dd>The <u>y</u> coordinate in range of 0 .. 1 <dd>The <u>y</u> coordinate in range of 0 .. 1
Multiply it with the height of the Window to get the real <u>y</u> coordinate<br><br> Multiply it with the height of the Window to get the real <u>y</u> coordinate<br><br>


</dd> </dd>
<dt><big><a name="Touch.Finger.pressure"></a>float <u>pressure</u>; <dt><big><a name="Finger.pressure"></a>float <u>pressure</u>;
</big></dt> </big></dt>
<dd>The quantity of <u>pressure</u> applied in range of 0 .. 1<br><br> <dd>The quantity of <u>pressure</u> applied in range of 0 .. 1<br><br>


</dd> </dd>
</dl> </dl>
</dd> </dd>
<dt><big><a name="Touch.getNumOfDevices"></a>static nothrow @nogc int <u>getNumOfDevices</u>(); <dt><big><a name="Touch"></a>interface <u>Touch</u>;
</big></dt>
<dd>Represent <u>Touch</u>-Events
<br><br>
<b>Author:</b><br>
Randy Schuett (rswhite4@googlemail.com)<br><br>

<dl><dt><big><a name="Touch.getNumOfDevices"></a>static nothrow @nogc int <u>getNumOfDevices</u>();
</big></dt> </big></dt>
<dd>Returns of many Touch-Devices exist<br><br> <dd>Returns of many Touch-Devices exist<br><br>


Expand Down

0 comments on commit ac846f0

Please sign in to comment.