Namespace GLA
Glassomium JS Public API 0.2
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
<static> |
GLA.CloseWindow()
Closes the current window
|
<static> |
GLA.EnterFullscreen()
Switches the current window to fullscreen mode.
|
<static> |
GLA.ExitFullscreen()
Switches the current fullscreen window back to windowed mode.
|
<static> |
GLA.ExitScreensaver(animation, time)
Exits from the current screensaver window using an animation
|
<static> |
GLA.GetZoom()
Returns the current zoom level of the window (magnification scale where 1.0 is equivalent to normal)
this is safer than quering directly the CSS of the window as it might change in future releases
|
<static> |
GLA.GoBack()
Will bring the window back one page (equivalent of the back button on your browser)
if no previous page is available, nothing happens
|
<static> |
GLA.GoForward()
Will bring the window forward one page (equivalent of the forward button on your browser)
if no next page is available, nothing happens
|
<static> |
GLA.HideKeyboard()
Hides the keyboard associated with the current window (if any)
|
<static> |
GLA.KeyboardOnKeyPressed(character)
Notifies Glassomium that a key has been pressed on a keyboard window
this method only works with keyboard windows and needs to be called whenever
a user presses a key
|
<static> |
GLA.Log(msg)
Prints to the Glassomium console a message.
|
<static> |
GLA.OpenNewWebBrowserWindow(url)
EXPERIMENTAL: Opens a new web browser window at the specified URL.
|
<static> |
GLA.OpenNewWindow(url)
Spawns a new window pointing at the specified URL
|
<static> |
GLA.SetDraggable(flag)
Sets whether the current window can be dragged around the screen
By default this property is enabled.
|
<static> |
GLA.SetMenuButtons(list)
Requests the following features to be enabled in the system menu
Note that the system menu implementar is not required to follow these constraints,
it's simply a guideline.
|
<static> |
GLA.SetPinchableOutOfFullscreen(flag)
Sets whether the current window can be pinched out of fullscreen, by touching one of the corners
of the screen during the pinch gesture.
|
<static> |
GLA.SetPinchableToFullscreen(flag)
Sets whether the current window can be pinched to fullscreen.
|
<static> |
GLA.SetScrollOnPinch(flag)
Sets whether the current window should perform a scroll movement in the vertical direction
(simulating a mouse wheel) during a pinch gesture when in fullscreen mode AND when not touching
one of the corners.
|
<static> |
GLA.SetScrollOnTouchMove(flag)
Sets whether the current window should perform a scroll whenever the user drag his/her
finger across the window.
|
<static> |
GLA.SetTransformable(flag)
Sets whether the current window can be transformed (pinch-scaled and rotated)
By default this property is enabled.
|
<static> |
GLA.SetTransparent(flag)
Sets whether the current window is transparent.
|
<static> |
GLA.SetTuioEnabled(flag)
Sets whether the current window is receiving TUIO messages in the form of touchstart,
touchmove and touchend events.
|
<static> |
GLA.SetZoom(level, time)
Set the zoom of the window to the specified value
A GLAZoomCompleted event is fired once the zoom has completed.
|
<static> |
GLA.ShowKeyboard()
Shows a keyboard (if any is available) to the user
|
<static> |
GLA.ShowScreensaver()
Forces Glassomium to display the system screensaver, regardless of
whether the user has not interacted with the system for more than screensaver.wait (as defined
in the current theme configuration)
|
<static> |
GLA.ZoomIn(time)
Performs a zoom-in (like when you press CTRL++ on your webbrowser)
A GLAZoomCompleted event is fired once the zoom has completed.
|
<static> |
GLA.ZoomOut(time)
Performs a zoom-out (like when you press CTRL+- on your webbrowser)
A GLAZoomCompleted event is fired once the zoom has completed.
|
Method Detail
<static>
GLA.CloseWindow()
Closes the current window
<static>
GLA.EnterFullscreen()
Switches the current window to fullscreen mode. If the window is already
in fullscreen mode nothing happens. Switching to fullscreen mode will modify
the dimensions of the window to match the screen of the user. Applications should
always be able to adapt to different resolutions for this reason. Applications can be notified of
this change by listening for the window resize event.
<static>
GLA.ExitFullscreen()
Switches the current fullscreen window back to windowed mode. If the window is already
in windowed mode, nothing happens. Switching to windowed mode will modify the dimensions of the window.
Applications can be notified of this change by listening for the window resize event.
<static>
GLA.ExitScreensaver(animation, time)
Exits from the current screensaver window using an animation
- Parameters:
- animation
- valid options are: "slideup", "slidedown", "slideleft", "slideright", "fadeout"
- time
- milliseconds to complete the animation
<static>
GLA.GetZoom()
Returns the current zoom level of the window (magnification scale where 1.0 is equivalent to normal)
this is safer than quering directly the CSS of the window as it might change in future releases
<static>
GLA.GoBack()
Will bring the window back one page (equivalent of the back button on your browser)
if no previous page is available, nothing happens
<static>
GLA.GoForward()
Will bring the window forward one page (equivalent of the forward button on your browser)
if no next page is available, nothing happens
<static>
GLA.HideKeyboard()
Hides the keyboard associated with the current window (if any)
<static>
GLA.KeyboardOnKeyPressed(character)
Notifies Glassomium that a key has been pressed on a keyboard window
this method only works with keyboard windows and needs to be called whenever
a user presses a key
- Parameters:
- character
- the UTF8 character that has been typed (ex. 'a', 'b', etc)
<static>
GLA.Log(msg)
Prints to the Glassomium console a message. This is useful for debugging purposes when an
application is running inside Glassomium instead of inside a browser. When running in a browser
GLA.Log will call the default console.log
- Parameters:
- msg
- a message to display
<static>
GLA.OpenNewWebBrowserWindow(url)
EXPERIMENTAL: Opens a new web browser window at the specified URL. Web browser windows
are special types of window that inject a browserbar (defined in your themes system/browserbar)
in order to allow for the user to type a new URL. This is NOT a stable feature, as certain websites
do not couple well yet with Glassomium. Some themes might not implement a browserbar, so standalone
applications should not call this API. If you are in control of your theme, then you could add it
to your launcher.
- Parameters:
- url
- a valid URL
<static>
GLA.OpenNewWindow(url)
Spawns a new window pointing at the specified URL
- Parameters:
- url
- a valid URL
<static>
GLA.SetDraggable(flag)
Sets whether the current window can be dragged around the screen
By default this property is enabled. This property should be disabled only when there's
need to avoid conflicting gestures (having TUIO messages for multi touch interaction enabled on a painting
program for example).
- Parameters:
- flag
- boolean indicating whether the window is draggable or not
<static>
GLA.SetMenuButtons(list)
Requests the following features to be enabled in the system menu
Note that the system menu implementar is not required to follow these constraints,
it's simply a guideline. If you want to have more control over the default buttons,
set window.menu.show to no in your application.cfg and make your own buttons. By default all buttons
available are enabled.
- Parameters:
- list
- of button strings that need to be enabled valid values: "close", "maximize", "restore", "zoom-in", "zoom-out"
<static>
GLA.SetPinchableOutOfFullscreen(flag)
Sets whether the current window can be pinched out of fullscreen, by touching one of the corners
of the screen during the pinch gesture. By default this property is enabled.
This property should be disabled if you have another way of exiting out of fullscreen and don't want
to use this default feature.
- Parameters:
- flag
- boolean indicating whether the window is pinchable out of fullscreen or not
<static>
GLA.SetPinchableToFullscreen(flag)
Sets whether the current window can be pinched to fullscreen. When a user scales a window
to occupy the majority of the screen, by default we switch the application to fullscreen. This
can be turned off by passing false to this function.
- Parameters:
- flag
- boolean indicating whether the window is pinchable to fullscreen or not
<static>
GLA.SetScrollOnPinch(flag)
Sets whether the current window should perform a scroll movement in the vertical direction
(simulating a mouse wheel) during a pinch gesture when in fullscreen mode AND when not touching
one of the corners. This is useful for web applications that use mouse wheel events
to zoom in and out (maps, for example).
- Parameters:
- flag
- boolean indicating whether the window should perform a scroll on pinch
<static>
GLA.SetScrollOnTouchMove(flag)
Sets whether the current window should perform a scroll whenever the user drag his/her
finger across the window. When this property is enabled, no mousemove events will be fired.
This is meant to allow for a simple way of implementing scrolling on windows. If you want finer control
over the scrolling, listen for mousemove events, do your own computations and set this property to false.
By default this property is disabled.
- Parameters:
- flag
- boolean indicating whether scroll on touch move is enabled or not
<static>
GLA.SetTransformable(flag)
Sets whether the current window can be transformed (pinch-scaled and rotated)
By default this property is enabled. This property should be disabled only when there's
need to avoid conflicting gestures (having TUIO messages for multi touch interaction enabled on a painting
program for example).
- Parameters:
- flag
- boolean indicating whether the window is transformable or not
<static>
GLA.SetTransparent(flag)
Sets whether the current window is transparent. Transparent windows will let Glassomium
display windows in the background whenever an HTML component in the page has the color set
to "transparent". When set to false any transparent element will be rendered white.
Windows should also specify their transparency setting in an application.cfg file, as to avoid
flickering (this method can be called only after successful page load) whereas a cfg file will set
the transparency before page load.
- Parameters:
- flag
- boolean indicating whether transparency is enabled or not
<static>
GLA.SetTuioEnabled(flag)
Sets whether the current window is receiving TUIO messages in the form of touchstart,
touchmove and touchend events. By default a window will NOT receive TUIO messages and
support must be explicitely enabled through this method.
- Parameters:
- flag
- boolean indicating whether tuio is enabled or not
<static>
GLA.SetZoom(level, time)
Set the zoom of the window to the specified value
A GLAZoomCompleted event is fired once the zoom has completed. Applications that have a canvas
or use javascript to position elements should catch this event and rearrange the UI.
- Parameters:
- level
- float N magnification scale where 1.0 is equivalent to normal.
- time
- number of milliseconds that the zoom animation should take. 0 equals no animation.
<static>
GLA.ShowKeyboard()
Shows a keyboard (if any is available) to the user
<static>
GLA.ShowScreensaver()
Forces Glassomium to display the system screensaver, regardless of
whether the user has not interacted with the system for more than screensaver.wait (as defined
in the current theme configuration)
<static>
GLA.ZoomIn(time)
Performs a zoom-in (like when you press CTRL++ on your webbrowser)
A GLAZoomCompleted event is fired once the zoom has completed. Applications that have a canvas
or use javascript to position elements should catch this event and rearrange the UI.
- Parameters:
- time
- number of milliseconds that the zoom animation should take. 0 equals no animation.
<static>
GLA.ZoomOut(time)
Performs a zoom-out (like when you press CTRL+- on your webbrowser)
A GLAZoomCompleted event is fired once the zoom has completed. Applications that have a canvas
or use javascript to position elements should catch this event and rearrange the UI.
- Parameters:
- time
- number of milliseconds that the zoom animation should take. 0 equals no animation.