|
luna-sysmgr-common
|
#include <HostArm.h>
Public Member Functions | |
| HostArm () | |
| virtual | ~HostArm () |
| virtual void | init (int w, int h) |
| virtual void | show () |
| virtual int | getNumberOfSwitches () const |
| int | readHidEvents (int fd, struct input_event *eventBuf, int bufSize) |
| virtual const char * | hardwareName () const |
| virtual InputControl * | getInputControlALS () |
| virtual InputControl * | getInputControlBluetoothInputDetect () |
| virtual InputControl * | getInputControlProximity () |
| virtual InputControl * | getInputControlTouchpanel () |
| virtual InputControl * | getInputControlKeys () |
| virtual LedControl * | getLedControlKeypadAndDisplay () |
| virtual void | OrientationSensorOn (bool enable) |
| virtual void | setBluetoothKeyboardActive (bool active) |
| virtual bool | bluetoothKeyboardActive () const |
Public Member Functions inherited from HostBase | |
| virtual | ~HostBase () |
| const HostInfo & | getInfo () const |
| virtual void | run () |
| virtual void | quit () |
| virtual unsigned short | translateKeyWithMeta (unsigned short key, bool withShift, bool withAlt) |
| void | lockPainting () |
| void | unlockPainting () |
| virtual void | setMetaModifier (bool metaKeyDown) |
| virtual bool | metaModifier () |
| void | turboModeSubscription (bool add) |
| virtual bool | hasAltKey (Qt::KeyboardModifiers modifiers) |
| void | setOrientation (OrientationEvent::Orientation o) |
| QPoint | map (const QPoint &pt) |
| virtual OrientationEvent * | postProcessDeviceOrientation (OrientationEvent *currOrientation) |
| virtual bool | homeButtonWakesUpScreen () |
Public Member Functions inherited from TaskBase | |
| TaskBase () | |
| virtual | ~TaskBase () |
| void | postEvent (sptr< Event > event, bool highPriority=false) |
| GMainLoop * | mainLoop () const |
| SingletonTimer * | masterTimer () const |
Public Member Functions inherited from RefCounted | |
| RefCounted () | |
| virtual | ~RefCounted () |
| void | ref () |
| void | deref () |
Protected Slots | |
| void | readALSData () |
| void | readProxData () |
Protected Member Functions | |
| virtual void | wakeUpLcd () |
| virtual int | screenX (int rawX, Event::Type type) |
| virtual int | screenY (int rawY, Event::Type type) |
| virtual void | setCentralWidget (QWidget *view) |
| void | setupInput (void) |
| void | shutdownInput (void) |
| void | startService (void) |
| void | stopService (void) |
| void | disableScreenBlanking () |
| virtual void | flip () |
| virtual QImage | takeScreenShot () const |
| virtual QImage | takeAppDirectRenderingScreenShot () const |
| virtual void | setAppDirectRenderingLayerEnabled (bool enable) |
| virtual void | setRenderingLayerEnabled (bool enable) |
| virtual void | NYXDataAvailable (NYXConnectorBase::Sensor aSensorType) |
Protected Member Functions inherited from HostBase | |
| HostBase () | |
| virtual void | handleEvent (sptr< Event >) |
| virtual void | turboMode (bool enable) |
Static Protected Member Functions | |
| static bool | getMsgValueInt (LSMessage *msg, int &value) |
Additional Inherited Members | |
Signals inherited from HostBase | |
| void | signalBluetoothKeyboardActive (bool active) |
Static Public Member Functions inherited from HostBase | |
| static HostBase * | instance () |
| static bool | hostIsQemu () |
Base class for all ARM-based host device classes to derive from
| HostArm::HostArm | ( | ) |
Constructs an ARM-based host device
Initializes common ARM hardware.
|
virtual |
Shuts down ARM-specific hardware
|
virtual |
|
protected |
Disable screen blanking and puts the screen into graphics mode
Enabled screen blanking to restore the screen from sleep, then immediately disables it.
After that, it puts the screen into grahics mode to get it ready to draw to (and hide the text terminal cursor).
When deciphering the implementation of this, see the manpage for console_ioctl, specifically TIOCLINUX subcodes 0 and 10.
|
protectedvirtual |
Flips the back buffer to the display
Displays to the screen what is currently contained in the back buffer. Since there is a back buffer, drawing can be completed on the back buffer at the program's leisure before displaying it in one swift move with a flip.
Reimplemented from HostBase.
|
virtual |
Gets an InputControl pointer for the ambient light sensor
Allows the ambient light sensor to be turned on/off.
Reimplemented from HostBase.
|
virtual |
Gets an InputControl pointer for Bluetooth input detection
Allows the Bluetooth input detection to be turned on/off.
Reimplemented from HostBase.
|
virtual |
Gets an InputControl pointer for the keyboard
Allows the keyboard to be turned on/off.
Reimplemented from HostBase.
|
virtual |
Gets an InputControl pointer for the face proximity sensor
Allows the face proximity sensor to be turned on/off.
Reimplemented from HostBase.
|
virtual |
Gets an InputControl pointer for the touch panel
Allows the touch panel to be turned on/off.
Reimplemented from HostBase.
|
virtual |
Gets an LedControl pointer for the keyboard backlight
Allows the keyboard backlight to be turned on/off.
Reimplemented from HostBase.
|
staticprotected |
Given a return value from an IPC call with a "value" element, returns the integer value of it
When an IPC call passes back a JSON structure in a format such as:
{ value : "127" }
It returns the integer value of the "value" element.
| msg | Return value message to parse from IPC call. |
| value | Where to store the integer version of the value. |
|
virtual |
Gets the number of hardware switches the current host device has
As an example, the Palm Pre has 3 switches:
Reimplemented from HostBase.
Reimplemented in HostArmQemu, HostArmBroadway, HostArmTopaz, HostArmOpal, and HostArmWindsorNot.
|
virtual |
Implements HostBase.
Reimplemented in HostArmQemu, HostArmBroadway, HostArmMantaray, HostArmTopaz, HostArmOpal, HostArmWindsorNot, and HostArmUnknown.
|
virtual |
Initialize device-specific hardware
Initializes hardware, fetches display info, and generally prepares the host device for LunaSysMgr to run on it.
Must be overridden for each type of device Host class needed.
| w | Hint as to what the screen width probably is. Ignored by most devices since they can query the screen for its capabilities. |
| h | Hint as to what the screen height probably is. Ignored by most devices since they can query the screen for its capabilities. |
Implements HostBase.
|
protectedvirtual |
Function gets called whenever there is some data available from NYX.
| [in] | - | aSensorType - Sensor which has got some data to report |
Implements NYXConnectorObserver.
|
virtual |
Function enables/disables the orientation sensor
| enable | true to enable the orientation sensor, false to disable it. |
Reimplemented from HostBase.
|
protectedslot |
Read the value of the ambient light sensor
Reads the value of the ambient light sensor and posts an AlsEvent event to the active window's event queue with the value IF it is able to successfully retrieve the value.
| int HostArm::readHidEvents | ( | int | fd, |
| struct input_event * | eventBuf, | ||
| int | bufSize | ||
| ) |
Reads input_event structures from a file descriptor and returns the number read
Mainly just a utility method for use within this class. Very purpose- specific.
| fd | File descriptor to read from. |
| eventBuf | Buffer to read input_events into. |
| bufSize | Amount of allocated memory (in bytes) that eventBuf points to. |
|
protectedslot |
Read the value of the face proximity sensor
Reads the value of the face proximity sensor and posts an ProximityEvent event to the active window's event queue with the value IF it is able to successfully retrieve the value.
|
inlineprotectedvirtual |
Remap a raw X value from the touchscreen to a pixel value
| rawX | Raw X value from the touchscreen. |
| type | Type of event which gave us this coordinate value. |
|
inlineprotectedvirtual |
Remap a raw Y value from the touchscreen to a pixel value
| rawY | Raw Y value from the touchscreen. |
| type | Type of event which gave us this coordinate value. |
|
protectedvirtual |
Unknown purpose at this time
This is used in very few other places, so I don't know exactly what it's used for. On ARM devices, executes an FBIO command that I cannot currently find documentation for. Seems to have something to do with blanking.
| enable | Unknown. |
Reimplemented from HostBase.
|
virtual |
|
protectedvirtual |
Sets the Qt widget that the display should reside in
Mostly unused except under the QtDesktop and Qemu hosts, where it is used to attach a keyboard remapping filter.
Called by WindowServer::WindowServer().
| view | Qt widget to display within. |
Reimplemented from HostBase.
Reimplemented in HostArmQemu.
|
protectedvirtual |
Unknown purpose at this time
Almost the same as HostBase::setAppDirectRenderingLayerEnabled, but on a different fb device. Has something to do with blanking, but still don't really understand what this is used for.
| enable | Unknown. |
Reimplemented from HostBase.
|
protected |
Starts talking to this device's sensors
Calls both HostArm::getInputControlALS() and HostArm::getInputControlProximity() to connect to HAL for the sensors. After each, it also subscribes to notifiers for them so when either of them changes value an event is posted to our event queue.
|
virtual |
Grab access to the hardware (including the display and input devices) for use by LunaSysMgr
Run this when you're ready to start using the host to display things. It grabs exclusive access to the screen and input devices (on most devices) so it can actually start displaying graphics on the screen.
Must be overridden per-device since it's fairly device-specific what needs to be enabled to be able to run LunaSysMgr.
Reimplemented from HostBase.
|
protected |
Disconnects from Nyx for each of the sensors
Sensors which are disconnected from include:
And closes down the Nyx notifiers for:
|
protected |
Attaches the main GLib event loop for this host to the IPC system
|
protected |
Disconnects the main GLib event loop for this host from the IPC system
|
protectedvirtual |
Takes a screenshot, including anything rendered directly to the display by an app
Currently only implemented on ARM devices, and on them is the same as a regular screenshot.
Reimplemented from HostBase.
|
protectedvirtual |
Takes a screenshot
Currently only implemented on ARM devices.
Reimplemented from HostBase.
|
protectedvirtual |
Turns the LCD on
Not much more to say about this one. The function of it is pretty straightforward.
|
protected |
Whether or not a Bluetooth keyboard is active
|
protected |
Memory-mapped pointer to /dev/fb0
Write pixel data to this to display it.
|
protected |
File descriptor for the first framebuffer device (/dev/fb0, the LCD)
Initialized by HostArm::init().
|
protected |
Number of buffers successfully memory mapped for /dev/fb0
Looks like this is where you can tell how many back buffers have been enabled for the device (in addition to the main buffer). This should be the total number of buffers for the device, including back buffers.
|
protected |
Memory-mapped pointer to /dev/fb1
Write pixel data to this to display it to /dev/fb1.
|
protected |
File descriptor for the secondary framebuffer device (/dev/fb1, for direct rendering)
Initialized by HostArm::init().
|
protected |
Number of buffers successfully memory mapped for /dev/fb1
Looks like this is where you can tell how many back buffers have been enabled for the device (in addition to the main buffer). This should be the total number of buffers for the device, including back buffers.
|
protected |
Nyx input control for the ambient light sensor
Initialized in HostArm::getInputControlALS().
|
protected |
Nyx input control for the whether or not a Bluetooth input device is connected
Initialized in HostArm::getInputControlBluetoothInputDetect().
|
protected |
Nyx input control for the keyboard
Initialized in HostArm::getInputControlKeys().
|
protected |
Nyx input control for the face proximity sensor
Initialized in HostArm::getInputControlProximity().
|
protected |
Nyx input control for the touch panel
Initialized in HostArm::getInputControlTouchpanel().
|
protected |
|
protected |
Watches for changes in the ambient light sensor value and posts events to the event queue when they occur
Initialized by HostArm::setupInput().
|
protected |
Watches for changes in the face proximity sensor value and posts events to the event queue when they occur
Initialized by HostArm::setupInput().
|
protected |
Nyx sensor connector for the orientation sensor
Initialized, enabled, and disabled by HostArm::OrientationSensorOn().
|
protected |
IPC system connection
Appears to be initialized by HostArm::startService().