return EINA_FALSE;
}
+
+E_API Eina_Bool
+e_client_hwc_available_properties_get(E_Client *ec, const hwc_prop **props, int *count)
+{
+ E_Hwc *hwc;
+ E_Output *output;
+ E_Zone *zone;
+ E_Hwc_Window *hwc_window;
+ E_Hwc_Window_State state;
+ const tdm_prop *tprops;
+ int i;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(count, EINA_FALSE);
+ zone = ec->zone;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(zone, EINA_FALSE);
+ output = e_output_find(zone->output_id);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
+ hwc = output->hwc;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(hwc, EINA_FALSE);
+ hwc_window = ec->hwc_window;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window, EINA_FALSE);
+
+ state = e_hwc_window_state_get(hwc_window);
+ if (state == E_HWC_WINDOW_STATE_VIDEO)
+ {
+ if (!e_hwc_windows_get_video_available_properties(hwc, &tprops, count))
+ {
+ ERR("e_hwc_windows_get_video_available_properties failed");
+ return EINA_FALSE;
+ }
+ }
+ else
+ {
+ if (!e_hwc_windows_get_available_properties(hwc, &tprops, count))
+ {
+ ERR("e_hwc_windows_get_available_properties failed");
+ return EINA_FALSE;
+ }
+ }
+
+ *props = (hwc_prop *)tprops;
+
+ if (state == E_HWC_WINDOW_STATE_VIDEO)
+ ELOGF("HWC", ">>>>>>>> Available VIDEO props : count = %d", NULL, NULL, *count);
+ else
+ ELOGF("HWC", ">>>>>>>> Available UI props : count = %d", NULL, NULL, *count);
+ for (i = 0; i < *count; i++)
+ ELOGF("HWC", " [%d] %s, %u", NULL, NULL, i, tprops[i].name, tprops[i].id);
+
+ return EINA_TRUE;
+}
+
+E_API Eina_Bool
+e_client_hwc_property_get(E_Client *ec, unsigned int id, hwc_value *value)
+{
+ E_Hwc_Window *hwc_window;
+ tdm_value tvalue;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(value, EINA_FALSE);
+ hwc_window = ec->hwc_window;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window, EINA_FALSE);
+
+ if (!e_hwc_window_get_property(hwc_window, id, &tvalue))
+ {
+ ERR("e_hwc_window_get_property failed");
+ return EINA_FALSE;
+ }
+
+ memcpy(&value->ptr, &tvalue.ptr, sizeof(tdm_value));
+
+ return EINA_TRUE;
+}
+
+const char *
+_e_client_hwc_prop_name_get_by_id(E_Client *ec, unsigned int id)
+{
+ const hwc_prop *props;
+ int i, count = 0;
+
+ if (!e_client_hwc_available_properties_get(ec, &props, &count))
+ {
+ ERR("e_client_hwc_available_properties_get failed.");
+ return EINA_FALSE;
+ }
+
+ for (i = 0; i < count; i++)
+ {
+ if (props[i].id == id)
+ return props[i].name;
+ }
+
+ ERR("No available property: id %d", id);
+
+ return NULL;
+}
+
+E_API Eina_Bool
+e_client_hwc_property_set(E_Client *ec, unsigned int id, hwc_value value)
+{
+ E_Hwc_Window *hwc_window;
+ const char *name;
+ tdm_value tvalue;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
+ hwc_window = ec->hwc_window;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window, EINA_FALSE);
+
+ name = _e_client_hwc_prop_name_get_by_id(ec, id);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(name, EINA_FALSE);
+
+ memcpy(&tvalue.ptr, &value.ptr, sizeof(hwc_value));
+
+ if (!e_hwc_window_set_property(hwc_window, id, name, tvalue, EINA_TRUE))
+ {
+ ERR("e_hwc_window_set_property failed");
+ return EINA_FALSE;
+ }
+
+ return EINA_TRUE;
+}
typedef struct _E_Hwc E_Hwc;
+#define HWC_NAME_LEN 64
+
typedef enum _E_Hwc_Mode
{
E_HWC_MODE_NONE = 0,
E_HWC_INTERCEPT_HOOK_LAST,
} E_Hwc_Intercept_Hook_Point;
+/*The hwc value type enumeration */
+typedef enum {
+ HWC_VALUE_TYPE_UNKNOWN,
+ HWC_VALUE_TYPE_PTR,
+ HWC_VALUE_TYPE_INT32,
+ HWC_VALUE_TYPE_UINT32,
+ HWC_VALUE_TYPE_INT64,
+ HWC_VALUE_TYPE_UINT64,
+} hwc_value_type;
+
+/*brief The hwc value union */
+typedef union {
+ void *ptr;
+ int32_t s32;
+ uint32_t u32;
+ int64_t s64;
+ uint64_t u64;
+} hwc_value;
+
+/* The property of the hwc client */
+typedef struct _hwc_prop {
+ unsigned int id;
+ char name[HWC_NAME_LEN];
+ hwc_value_type type;
+} hwc_prop;
+
typedef Eina_Bool (*E_Hwc_Intercept_Hook_Cb)(void *data, E_Hwc *hwc);
typedef struct _E_Hwc_Intercept_Hook E_Hwc_Intercept_Hook;
EINTERN Eina_Bool e_hwc_intercept_hook_call(E_Hwc_Intercept_Hook_Point hookpoint, E_Hwc *hwc);
-E_API E_Hwc_Intercept_Hook *e_hwc_intercept_hook_add(E_Hwc_Intercept_Hook_Point hookpoint, E_Hwc_Intercept_Hook_Cb func, const void *data);
-E_API void e_hwc_intercept_hook_del(E_Hwc_Intercept_Hook *ch);
+E_API E_Hwc_Intercept_Hook *e_hwc_intercept_hook_add(E_Hwc_Intercept_Hook_Point hookpoint, E_Hwc_Intercept_Hook_Cb func, const void *data);
+E_API void e_hwc_intercept_hook_del(E_Hwc_Intercept_Hook *ch);
+
+E_API Eina_Bool e_client_hwc_available_properties_get(E_Client *ec, const hwc_prop **props, int *count);
+E_API Eina_Bool e_client_hwc_property_get(E_Client *ec, unsigned int id, hwc_value *value);
+E_API Eina_Bool e_client_hwc_property_set(E_Client *ec, unsigned int id, hwc_value value);
#endif
#endif