forked from iterate-ch/rococoa
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from umjammer/0.8.12
0.8.12
- Loading branch information
Showing
27 changed files
with
989 additions
and
27 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
34 changes: 34 additions & 0 deletions
34
rococoa-contrib/src/main/java/org/rococoa/cocoa/gamecontroller/GCAcceleration.java
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,34 @@ | ||
/* | ||
* Copyright (c) 2024 by Naohide Sano, All rights reserved. | ||
* | ||
* Programmed by Naohide Sano | ||
*/ | ||
|
||
package org.rococoa.cocoa.gamecontroller; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import com.sun.jna.Structure; | ||
|
||
|
||
/** | ||
* A three-dimensional acceleration vector. | ||
* | ||
* @author <a href="mailto:[email protected]">Naohide Sano</a> (nsano) | ||
* @version 0.00 2024-03-28 nsano initial version <br> | ||
*/ | ||
public class GCAcceleration extends Structure { | ||
|
||
/** The acceleration measurement along the x-axis, in multiples of earth’s gravity. */ | ||
public double x; | ||
/** The acceleration measurement along the y-axis, in multiples of earth’s gravity. */ | ||
public double y; | ||
/** The acceleration measurement along the z-axis, in multiples of earth’s gravity. */ | ||
public double z; | ||
|
||
@Override | ||
protected List<String> getFieldOrder() { | ||
return Arrays.asList("x", "y", "z"); | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
rococoa-contrib/src/main/java/org/rococoa/cocoa/gamecontroller/GCColor.java
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,47 @@ | ||
/* | ||
* Copyright (c) 2024 by Naohide Sano, All rights reserved. | ||
* | ||
* Programmed by Naohide Sano | ||
*/ | ||
|
||
package org.rococoa.cocoa.gamecontroller; | ||
|
||
import java.util.logging.Logger; | ||
|
||
import org.rococoa.ObjCClass; | ||
import org.rococoa.Rococoa; | ||
import org.rococoa.cocoa.foundation.NSObject; | ||
|
||
|
||
/** | ||
* The colored light on a device. | ||
* | ||
* @author <a href="mailto:[email protected]">Naohide Sano</a> (nsano) | ||
* @version 0.00 2024-03-27 nsano initial version <br> | ||
*/ | ||
public abstract class GCColor extends NSObject { | ||
|
||
static { | ||
GameControllerLibrary.library.toString(); | ||
} | ||
|
||
private static final Logger logger = Logger.getLogger(GCColor.class.getName()); | ||
|
||
public static final _Class CLASS = Rococoa.createClass("GCDeviceLight", _Class.class); | ||
|
||
public interface _Class extends ObjCClass { | ||
GCColor alloc(); | ||
} | ||
|
||
/** Creates a color with the specified red, green, and blue values. */ | ||
public abstract GCColor initWithRed_green_blue(float red, float green, float blue); | ||
|
||
/** The normalized value of the red component ranging from 0 to 1. */ | ||
public abstract float red(); | ||
|
||
/** The normalized value of the green component ranging from 0 to 1. */ | ||
public abstract float green(); | ||
|
||
/** The normalized value of the blue component ranging from 0 to 1. */ | ||
public abstract float blue(); | ||
} |
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
57 changes: 57 additions & 0 deletions
57
rococoa-contrib/src/main/java/org/rococoa/cocoa/gamecontroller/GCControllerAxisInput.java
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,57 @@ | ||
/* | ||
* Copyright (c) 2024 by Naohide Sano, All rights reserved. | ||
* | ||
* Programmed by Naohide Sano | ||
*/ | ||
|
||
package org.rococoa.cocoa.gamecontroller; | ||
|
||
import java.util.logging.Logger; | ||
|
||
import org.rococoa.ID; | ||
import org.rococoa.ObjCBlock; | ||
import org.rococoa.ObjCBlocks.BlockLiteral; | ||
import org.rococoa.ObjCClass; | ||
import org.rococoa.Rococoa; | ||
|
||
|
||
/** | ||
* GCControllerAxisInput. | ||
* | ||
* @author <a href="mailto:[email protected]">Naohide Sano</a> (nsano) | ||
* @version 0.00 2024-03-27 nsano initial version <br> | ||
*/ | ||
public abstract class GCControllerAxisInput extends GCControllerElement { | ||
|
||
static { | ||
GameControllerLibrary.library.toString(); | ||
} | ||
|
||
private static final Logger logger = Logger.getLogger(GCControllerAxisInput.class.getName()); | ||
|
||
public static final _Class CLASS = Rococoa.createClass("GCControllerAxisInput", _Class.class); | ||
|
||
public interface _Class extends ObjCClass { | ||
GCControllerAxisInput alloc(); | ||
} | ||
|
||
public abstract GCControllerAxisInput init(); | ||
|
||
// Accessing the input values | ||
|
||
/** The current value of the axis. */ | ||
public abstract float value(); | ||
|
||
/** Sets the normalized value of the axis. */ | ||
public abstract void setValue(float value); | ||
|
||
// Getting change information | ||
|
||
/** The block that the element calls when the user changes the axis value. */ | ||
public abstract BlockLiteral /* GCControllerAxisValueChangedHandler */ valueChangedHandler(); | ||
public abstract void setValueChangedHandler(BlockLiteral /* GCControllerAxisValueChangedHandler */ handler); | ||
/** The signature for the block that executes when the user changes the axis value. */ | ||
public interface GCControllerAxisValueChangedHandler extends ObjCBlock { | ||
void callback(BlockLiteral literal, ID /* GCControllerAxisInput */ axis, float value); | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
rococoa-contrib/src/main/java/org/rococoa/cocoa/gamecontroller/GCControllerButtonInput.java
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,64 @@ | ||
/* | ||
* Copyright (c) 2024 by Naohide Sano, All rights reserved. | ||
* | ||
* Programmed by Naohide Sano | ||
*/ | ||
|
||
package org.rococoa.cocoa.gamecontroller; | ||
|
||
import java.util.logging.Logger; | ||
|
||
import org.rococoa.ID; | ||
import org.rococoa.ObjCBlock; | ||
import org.rococoa.ObjCBlocks.BlockLiteral; | ||
import org.rococoa.ObjCClass; | ||
import org.rococoa.Rococoa; | ||
|
||
|
||
/** | ||
* GCControllerButtonInput. | ||
* | ||
* @author <a href="mailto:[email protected]">Naohide Sano</a> (nsano) | ||
* @version 0.00 2024-03-27 nsano initial version <br> | ||
*/ | ||
public abstract class GCControllerButtonInput extends GCControllerElement { | ||
|
||
static { | ||
GameControllerLibrary.library.toString(); | ||
} | ||
|
||
private static final Logger logger = Logger.getLogger(GCControllerButtonInput.class.getName()); | ||
|
||
public static final _Class CLASS = Rococoa.createClass("GCControllerButtonInput", _Class.class); | ||
|
||
public interface _Class extends ObjCClass { | ||
GCControllerButtonInput alloc(); | ||
} | ||
|
||
public abstract GCControllerButtonInput init(); | ||
|
||
/** A Boolean value that indicates whether the user is touching the button. */ | ||
public abstract boolean touched(); | ||
/** A Boolean value that indicates whether the user is pressing the button. */ | ||
public abstract boolean pressed(); | ||
/** The level of pressure the user is applying to the button. */ | ||
public abstract float value(); | ||
|
||
/** The block that the element calls when the user touches the button. */ | ||
public abstract BlockLiteral /* GCControllerButtonTouchedChangedHandler */ touchedChangedHandler(); | ||
public abstract void setTouchedChangedHandler(BlockLiteral /* GCControllerButtonTouchedChangedHandler */ handler); | ||
/** The signature for the block that executes when the user touches the button if the controller supports that feature. */ | ||
public interface GCControllerButtonTouchedChangedHandler extends ObjCBlock { | ||
void callbak(BlockLiteral literal, ID /* GCControllerButtonInput */ button, float value, boolean pressed, boolean touched); | ||
} | ||
/** The block that the element calls when the user presses or releases the button. */ | ||
public abstract BlockLiteral /* GCControllerButtonValueChangedHandler */ pressedChangedHandler(); | ||
public abstract void setPressedChangedHandler(BlockLiteral /* GCControllerButtonValueChangedHandler */ handler); | ||
/** The block that the element calls when the user changes the level of pressure on the button. */ | ||
public abstract BlockLiteral /* GCControllerButtonValueChangedHandler */ valueChangedHandler(); | ||
public abstract void setValueChangedHandler(BlockLiteral /* GCControllerButtonValueChangedHandler */ handler); | ||
/** The signature for the block that executes when a button’s state changes. */ | ||
public interface GCControllerButtonValueChangedHandler extends ObjCBlock { | ||
void callbak(BlockLiteral literal, ID /* GCControllerButtonInput */ button, float value, boolean pressed); | ||
} | ||
} |
Oops, something went wrong.