|
luna-sysmgr-common
|
#include <HostBase.h>
Signals | |
| void | signalBluetoothKeyboardActive (bool active) |
Public Member Functions | |
| virtual | ~HostBase () |
| virtual void | init (int w, int h)=0 |
| virtual void | show () |
| const HostInfo & | getInfo () const |
| virtual void | run () |
| virtual void | quit () |
| virtual const char * | hardwareName () const =0 |
| virtual unsigned short | translateKeyWithMeta (unsigned short key, bool withShift, bool withAlt) |
| void | lockPainting () |
| void | unlockPainting () |
| virtual void | setMetaModifier (bool metaKeyDown) |
| virtual bool | metaModifier () |
| virtual int | getNumberOfSwitches () const |
| void | turboModeSubscription (bool add) |
| virtual void | setCentralWidget (QWidget *view) |
| virtual void | flip () |
| virtual bool | hasAltKey (Qt::KeyboardModifiers modifiers) |
| virtual QImage | takeScreenShot () const |
| virtual QImage | takeAppDirectRenderingScreenShot () const |
| virtual void | setAppDirectRenderingLayerEnabled (bool enable) |
| void | setOrientation (OrientationEvent::Orientation o) |
| QPoint | map (const QPoint &pt) |
| virtual void | setRenderingLayerEnabled (bool enable) |
| virtual InputControl * | getInputControlALS () |
| virtual InputControl * | getInputControlBluetoothInputDetect () |
| virtual InputControl * | getInputControlProximity () |
| virtual InputControl * | getInputControlTouchpanel () |
| virtual InputControl * | getInputControlKeys () |
| virtual LedControl * | getLedControlKeypadAndDisplay () |
| virtual void | OrientationSensorOn (bool enable) |
| virtual OrientationEvent * | postProcessDeviceOrientation (OrientationEvent *currOrientation) |
| virtual bool | homeButtonWakesUpScreen () |
| virtual void | setBluetoothKeyboardActive (bool active) |
| virtual bool | bluetoothKeyboardActive () const |
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 () |
Static Public Member Functions | |
| static HostBase * | instance () |
| static bool | hostIsQemu () |
Protected Member Functions | |
| HostBase () | |
| virtual void | handleEvent (sptr< Event >) |
| virtual void | turboMode (bool enable) |
Protected Attributes | |
| HostInfo | m_info |
| Mutex | m_paintMutex |
| bool | m_metaKeyDown |
| OrientationEvent::Orientation | m_orientation |
| QTransform | m_trans |
| int | m_numBuffers |
| unsigned | m_turboModeSubscriptions |
Protected Attributes inherited from TaskBase | |
| GMainContext * | m_mainCtxt |
| GMainLoop * | m_mainLoop |
| Mutex | m_mutex |
| Mutex | m_eventsMutex |
| std::list< sptr< Event > > | m_eventsList |
| AsyncCaller< TaskBase > * | m_asyncCaller |
| SingletonTimer * | m_masterTimer |
Base functionality for interfacing with the hardware of all devices which LunaSysMgr can run on
Provides information and capabilities such as:
|
virtual |
Clean up device-specific resources
Closes down any hardware initialized when this host was constructed. Designed to be overridden by each Host class for each type of device so that all hardware of specific devices is correctly shut down.
Just runs HostBase::quit() unless overridden by a derived class.
|
protected |
|
inlinevirtual |
|
inlinevirtual |
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 in HostArm.
|
inline |
Gets a structure of information about the current host device
The HostInfo structure mostly contains information about the display device. This allows retrieval of that from a central point.
|
inlinevirtual |
Gets an InputControl pointer for the ambient light sensor
Allows the ambient light sensor to be turned on/off.
Reimplemented in HostArm.
|
inlinevirtual |
Gets an InputControl pointer for Bluetooth input detection
Allows the Bluetooth input detection to be turned on/off.
Reimplemented in HostArm.
|
inlinevirtual |
Gets an InputControl pointer for the keyboard
Allows the keyboard to be turned on/off.
Reimplemented in HostArm.
|
inlinevirtual |
Gets an InputControl pointer for the face proximity sensor
Allows the face proximity sensor to be turned on/off.
Reimplemented in HostArm.
|
inlinevirtual |
Gets an InputControl pointer for the touch panel
Allows the touch panel to be turned on/off.
Reimplemented in HostArm.
|
inlinevirtual |
Gets an LedControl pointer for the keyboard backlight
Allows the keyboard backlight to be turned on/off.
Reimplemented in HostArm.
|
inlinevirtual |
Gets the number of hardware switches the current host device has
As an example, the Palm Pre has 3 switches:
Reimplemented in HostArm, HostArmQemu, HostArmBroadway, HostArmTopaz, HostArmOpal, and HostArmWindsorNot.
|
pure virtual |
Return the specific name (including model revision) of the current host device
As an example, for a generic ARM device for which more information is not available, it returns "ARM Device". For a Palm Pixie device, it might return something like "Pixie DVT1".
Implemented in HostArm, HostArmQemu, HostArmBroadway, HostArmMantaray, HostArmTopaz, HostArmOpal, HostArmWindsorNot, HostArmUnknown, and HostQtDesktop.
|
virtual |
Maps Qt's version of the state of the modifier keys to whether or not the Alt (dot) key is pressed
On HostQtDesktop, both the Ctrl and Alt keys are mapped to the LunaSysMgr version of the Alt (dot) key.
| modifiers | Keybaord modifiers, as reported by Qt |
Reimplemented in HostQtDesktop.
|
inlinevirtual |
Presumably whether the Home button wakes up the screen
This is seldom used and largely undocumented. Description is more or less a guess.
Reimplemented in HostArmTopaz, HostArmOpal, and HostArmWindsorNot.
|
static |
Gets whether or not the current host is running under a Qemu virtual machine
|
pure 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. |
Implemented in HostArm, and HostQtDesktop.
|
static |
Gets a pointer to an instance of the current device-specific Host class
Since each host device will have different capabilities, this method allows you to retrieve the correct host information for the current device.
|
inline |
Locks the display's back buffer to draw to
If the display is currently being used by another thread, this method waits until the other method is done and exclusive access is granted before returning.
|
inline |
Map a screen touch sensor point to a point on the display screen taking into account device orientation
| pt | Touchscreen point coordinates. |
|
inlinevirtual |
Gets whether or not the meta key is currently pressed
|
inlinevirtual |
Function enables/disables the orientation sensor
| enable | true to enable the orientation sensor, false to disable it. |
Reimplemented in HostArm.
|
inlinevirtual |
Function processes the Orientation of the device and returns the correct screen(display) orientation.
| currOrientation | - Current device orientation |
Reimplemented in HostArmTopaz.
|
virtual |
Terminates this task
At this point, it doesn't appear this is used by any deriving classes. Ideally this would do cleanup from TaskBase::run().
Implements TaskBase.
|
virtual |
Runs this task
The bulk of derived classes' funcionality should reside within this method. This method should not return until the task is complete. For example, WebAppManager runs a QCoreApplication within this method, and when it terminates, this function returns.
Implements TaskBase.
|
inlinevirtual |
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 in HostArm.
|
inlinevirtual |
|
inlinevirtual |
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 in HostArm, HostArmQemu, and HostQtDesktop.
|
inlinevirtual |
Sets whether or not the meta key is currently pressed
| metaKeyDown | true if the meta key is currently pressed, otherwise false. |
| void HostBase::setOrientation | ( | OrientationEvent::Orientation | o | ) |
Sets the device's current orientation
Changes the display's transformation matrix so on-screen items display with the correct orientation.
| o | One of OrientationEvent::Orientation_Up, OrientationEvent::Orientation_Down, OrientationEvent::Orientation_Right, OrientationEvent::Orientation_Left indicating which edge of the screen is vertically "up". |
|
inlinevirtual |
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 in HostArm.
|
inlinevirtual |
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 in HostArm, and HostQtDesktop.
|
signal |
Unknown at this time
Do not currently know how this works or where it is defined.
| active | Unknown. |
|
inlinevirtual |
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 in HostArm.
|
inlinevirtual |
Takes a screenshot
Currently only implemented on ARM devices.
Reimplemented in HostArm.
|
virtual |
Translate a hardware keycode to a system keycode depending on modifier keys
Takes a hardware keycode and which modifiers are currently pressed and returns a system modifier. For example, if the key is the key code for "a" and shift is down, it translates it to the key code for "A".
| key | Input hardware key code. |
| withShift | Whether Shift is currently pressed. |
| withAlt | Whether Alt (dot key) is currently pressed. |
Reimplemented in HostQtDesktop.
|
inlineprotectedvirtual |
Enables/disables turbo mode
Changes CPU frequency scaling. When turbo mode is enabled, the CPU is set to run at full speed. When disabled, it turns the speed down to save on power usage.
| enable | true to enable turbo mode, false to disable it |
Reimplemented in HostArmTopaz, and HostArmOpal.
| void HostBase::turboModeSubscription | ( | bool | add | ) |
Enables/disables subscribing to turbo mode
Counts the number of times callers turn on turbo mode and turns it on as long as anyone needs it.
| add | true to ask that turbo mode be turned on, false to tell HostBase that it's no longer needed. |
|
inline |
Unlocks the display's back buffer so other threads can draw to it
|
protected |
Host device info generated in HostBase::init() and cached here so it can be retrieved quickly
|
protected |
Whether or not the Meta key is currently pressed
|
protected |
Presumably the number of back buffers
Currently appears to be unused.
Confirm documentation of this member variable.
Remove this if possible.
|
protected |
Current orientation of device
|
protected |
Mutex that allows locking of the back buffer while a function paints to it
|
protected |
Current transformation matrix used to rotate the display to match the current device orientation (so the screen image always faces "up")
|
protected |
Number of running pieces of code which currently need turbo mode enabled