Skip to content
Browse files

Added jAppleMenuBar kiosk mode support (OS X only)

  • Loading branch information...
1 parent da25412 commit 4d83abc152560d9afbfd7de6a2339b4089ddeec3 @mickm mickm committed Feb 1, 2011
View
BIN lib/libjAppleMenuBar.jnilib
Binary file not shown.
View
26 src/fullscreen/SoftFullScreen.java
@@ -65,6 +65,9 @@
// the first time wait until the frame is displayed
boolean fsIsInitialized;
+
+ // are we in kiosk mode? (OS X only)
+ boolean kioskMode;
// Daddy...
PApplet dad;
@@ -78,17 +81,30 @@
public SoftFullScreen( PApplet dad ){
this( dad, 0 );
}
+
+ /**
+ * Creates a new softfullscreen object on a specific screen
+ * (numbering starts at 0)
+ *
+ * @param dad The parent sketch (usually "this")
+ * @param screenNr The screen number.
+ */
+ public SoftFullScreen( PApplet dad, int screenNr ){
+ this( dad, screenNr, false );
+ }
/**
* Creates a new softfullscreen object on a specific screen
- * (numbering starts at 0)
+ * (numbering starts at 0) optionally in kiosk mode.
*
* @param dad The parent sketch (usually "this")
* @param screenNr The screen number.
+ * @param kioskMode Enable/disable kiosk mode (OS X only)
*/
- public SoftFullScreen( PApplet dad, int screenNr ){
+ public SoftFullScreen( PApplet dad, int screenNr, boolean kioskMode ){
super( dad );
this.dad = dad;
+ this.kioskMode = kioskMode;
GraphicsDevice[] devices = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
if( screenNr >= devices.length ){
@@ -102,7 +118,7 @@ public SoftFullScreen( PApplet dad, int screenNr ){
WindowListener listener = new WindowAdapter(){
public void windowDeiconified( WindowEvent w ){
if( isFullScreen() && PApplet.platform == PConstants.MACOSX ){
- new JAppleMenuBar().setVisible( false );
+ new JAppleMenuBar().setVisible( false, SoftFullScreen.this.kioskMode );
}
}
@@ -156,7 +172,7 @@ public void restore(){
fsFrame.setState( Frame.NORMAL );
if( PApplet.platform == PConstants.MACOSX ){
- new JAppleMenuBar().setVisible( false );
+ new JAppleMenuBar().setVisible( false, kioskMode );
}
}
else{
@@ -201,7 +217,7 @@ else if( fullScreen ){
fsFrame.add( dad );
if( PApplet.platform == PConstants.MACOSX ){
- new JAppleMenuBar().setVisible( false );
+ new JAppleMenuBar().setVisible( false, kioskMode );
}
fsFrame.setVisible( true );
View
8 src/japplemenubar/JAppleMenuBar.java
@@ -33,5 +33,11 @@
System.loadLibrary( "jAppleMenuBar" );
}
- public native void setVisible( boolean visibility );
+ public native void setVisible( boolean visibility, boolean kioskMode );
+
+ public void setVisible( boolean visibility )
+ {
+ // Keep original API in-tact. Default kiosk-mode to off.
+ setVisible( visibility, false );
+ }
}

0 comments on commit 4d83abc

Please sign in to comment.
Something went wrong with that request. Please try again.