ilmErrorTypes ilm_GetKeyboardFocusSurfaceId(t_ilm_surface* pSurfaceId);
/**
+ * \brief Set the keyboard focus to multiple surfaces
+ * To receive keyboard events, 2 conditions must be fulfilled:
+ * 1- The surface must accept events from keyboard. See ilm_UpdateInputEventAcceptanceOn
+ * 2- The keyboard focus must be set on that surface
+ *
+ * \ingroup ilmControl
+ * \param[in] pSurfaceIds Pointer to an array of surface IDs
+ * \param[in] number The number of surface IDs to set
+ * \return ILM_SUCCESS if the method call was successful
+ * \return ILM_FAILED if the client can not call the method on the service.
+ */
+ilmErrorTypes ilm_SetKeyboardMultiFocus(t_ilm_surface *pSurfaceIds, t_ilm_int number);
+
+/**
* \brief Set the destination area of a surface within a layer for rendering. The surface will be scaled to this rectangle for rendering.
* \ingroup ilmControl
* \param[in] surfaceId Id of surface.
}
ILM_EXPORT ilmErrorTypes
+ilm_SetKeyboardMultiFocus(t_ilm_surface *pSurfaceIds, t_ilm_int number)
+{
+ struct ilm_control_context *ctx = sync_and_acquire_instance();
+ struct surface_context *ctx_surf;
+ unsigned int i, send_elements = 0;
+ struct wl_array send_array;
+ ilmErrorTypes retval = ILM_FAILED;
+ uint32_t *data;
+
+ wl_array_init(&send_array);
+ wl_array_add(&send_array, sizeof(uint32_t) * number);
+
+ data = send_array.data;
+ for (i = 0; i < number; i++) {
+ ctx_surf = get_surface_context(&ctx->wl, (uint32_t) pSurfaceIds[i]);
+ if (ctx_surf->prop.inputDevicesAcceptance & ILM_INPUT_DEVICE_KEYBOARD) {
+ data[send_elements] = pSurfaceIds[i];
+ send_elements++;
+ }
+ }
+
+ if (send_elements > 0) {
+ ivi_controller_set_keyboard_focus(ctx->wl.controller, &send_array);
+ retval = ILM_SUCCESS;
+ }
+
+ wl_array_release(&send_array);
+ release_instance();
+ return retval;
+}
+
+ILM_EXPORT ilmErrorTypes
ilm_surfaceSetDestinationRectangle(t_ilm_surface surfaceId,
t_ilm_int x, t_ilm_int y,
t_ilm_int width, t_ilm_int height)
<arg name="error_text" type="string" allow-null="true"/>
</event>
+ <request name="set_keyboard_focus">
+ <description summary="set multiple surfaces to have keyboard focus">
+ set_keyboard_focus will take an array of surfaces, and set
+ keyboard focus to those surfaces.
+ </description>
+ <arg name="surfaces" type="array"/>
+
</interface>
</protocol>
&prop, IVI_NOTIFICATION_ALL);
}
+static void
+controller_set_keyboard_focus(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_array *surfaces)
+{
+ struct ivicontroller *ctrl = wl_resource_get_user_data(resource);
+ ivi_layout_SetKeyboardFocusOn(surfaces->data, surfaces->size);
+ send_all_keyboard_focus(ctrl->shell);
+}
+
static const struct ivi_controller_interface controller_implementation = {
controller_commit_changes,
controller_layer_create,
- controller_surface_create
+ controller_surface_create,
+ controller_set_keyboard_focus
};
static void