ilmErrorTypes ilm_SetKeyboardMultiFocus(t_ilm_surface *pSurfaceIds, t_ilm_int number);
/**
+ * \brief Get the indentifiers of all the surfaces that have keyboard focus
+ *
+ * \ingroup ilmControl
+ * \param[out] pSurfaceIds Pointer to the list of surface IDs
+ * \param[in] size The total available number of elements in pSurfaceIds
+ * \param[out] pCount Pointer to the number of surface IDs that were returned
+ * \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_GetKeyboardMultiFocusSurfaceIds(t_ilm_surface *pSurfaceIds, t_ilm_int size, t_ilm_int *pCount);
+/**
* \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_GetKeyboardMultiFocusSurfaceIds(t_ilm_surface *pSurfaceIds, t_ilm_int size,
+ t_ilm_int *pCount)
+{
+ struct ilm_control_context *ctx = sync_and_acquire_instance();
+ struct surface_context *ctx_surf;
+
+ *pCount = 0;
+ wl_list_for_each(ctx_surf, &ctx->wl.list_surface, link) {
+ if (ctx_surf->prop.hasKeyboardFocus) {
+ if (*pCount >= size) {
+ fprintf(stderr, "not enough space to store surface IDs\n");
+ break;
+ }
+ pSurfaceIds[*pCount] = ctx_surf->id_surface;
+ (*pCount)++;
+ }
+ }
+
+ release_instance();
+
+ return ILM_SUCCESS;
+}
+
+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)
void getKeyboardFocus()
{
- t_ilm_surface surfaceId;
+ t_ilm_surface surfaceIds[1024];
+ t_ilm_int surfaceCount;
- ilmErrorTypes callResult = ilm_GetKeyboardFocusSurfaceId(&surfaceId);
+ ilmErrorTypes callResult;
+
+ callResult = ilm_GetKeyboardMultiFocusSurfaceIds((t_ilm_surface*)surfaceIds,
+ 1024, &surfaceCount);
if (ILM_SUCCESS == callResult)
{
- cout << "keyboardFocusSurfaceId == " << surfaceId << endl;
+ cout << "keyboardFocusSurfaceId == ";
+ for (int i = 0; i < surfaceCount; i++)
+ {
+ cout << surfaceIds[i];
+ if (i + 1 < surfaceCount)
+ cout << ",";
+ }
+ cout << endl;
}
else
{