From 7f33315dcd22e61aee2a6939cde27dcd08af92fb Mon Sep 17 00:00:00 2001 From: rafspiny Date: Mon, 24 Jul 2023 22:48:01 +0200 Subject: [PATCH 01/35] First attempt at integrating convertible module --- meson_options.txt | 4 + .../convertible/accelerometer-orientation.h | 16 + src/modules/convertible/convertible-icon.edj | Bin 0 -> 10041 bytes src/modules/convertible/convertible_logging.h | 22 + src/modules/convertible/dbus_acceleration.c | 438 ++++++++++++++++++ src/modules/convertible/dbus_acceleration.h | 104 +++++ .../convertible/e-gadget-convertible.c | 61 +++ .../convertible/e-gadget-convertible.h | 22 + .../convertible/e-module-convertible.edj | Bin 0 -> 15752 bytes src/modules/convertible/e_mod_config.c | 160 +++++++ src/modules/convertible/e_mod_config.h | 44 ++ src/modules/convertible/e_mod_main.c | 378 +++++++++++++++ src/modules/convertible/e_mod_main.h | 25 + src/modules/convertible/input_rotation.h | 20 + src/modules/convertible/meson.build | 23 + src/modules/convertible/module.desktop | 8 + src/modules/meson.build | 3 +- 17 files changed, 1327 insertions(+), 1 deletion(-) create mode 100755 src/modules/convertible/accelerometer-orientation.h create mode 100755 src/modules/convertible/convertible-icon.edj create mode 100755 src/modules/convertible/convertible_logging.h create mode 100644 src/modules/convertible/dbus_acceleration.c create mode 100644 src/modules/convertible/dbus_acceleration.h create mode 100644 src/modules/convertible/e-gadget-convertible.c create mode 100644 src/modules/convertible/e-gadget-convertible.h create mode 100755 src/modules/convertible/e-module-convertible.edj create mode 100644 src/modules/convertible/e_mod_config.c create mode 100644 src/modules/convertible/e_mod_config.h create mode 100644 src/modules/convertible/e_mod_main.c create mode 100644 src/modules/convertible/e_mod_main.h create mode 100755 src/modules/convertible/input_rotation.h create mode 100644 src/modules/convertible/meson.build create mode 100644 src/modules/convertible/module.desktop diff --git a/meson_options.txt b/meson_options.txt index ce0f88d69..3f751cbfb 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -132,6 +132,10 @@ option('connman', type: 'boolean', value: true, description: 'enable connman module: (default=true)') +option('convertible', + type: 'boolean', + value: true, + description: 'enable convertible module: (default=true)') option('cpufreq', type: 'boolean', value: true, diff --git a/src/modules/convertible/accelerometer-orientation.h b/src/modules/convertible/accelerometer-orientation.h new file mode 100755 index 000000000..f1f92d08e --- /dev/null +++ b/src/modules/convertible/accelerometer-orientation.h @@ -0,0 +1,16 @@ +// +// Created by raffaele on 01/05/19. +// + +#ifndef E_GADGET_CONVERTIBLE_IIO_SENSOR_ACCELEROMETER_H +#define E_GADGET_CONVERTIBLE_IIO_SENSOR_ACCELEROMETER_H + +// Those costants are the possible states for the orientation of the acceleromenter. + +#define ACCELEROMETER_ORIENTATION_UNDEFINED "undefined" +#define ACCELEROMETER_ORIENTATION_NORMAL "normal" +#define ACCELEROMETER_ORIENTATION_LEFT "left-up" +#define ACCELEROMETER_ORIENTATION_RIGHT "right-up" +#define ACCELEROMETER_ORIENTATION_BOTTOM "bottom-up" + +#endif //E_GADGET_CONVERTIBLE_IIO_SENSOR_ACCELEROMETER_H diff --git a/src/modules/convertible/convertible-icon.edj b/src/modules/convertible/convertible-icon.edj new file mode 100755 index 0000000000000000000000000000000000000000..eb0b05378dbfd18d6e920122122ec3b17e0705d7 GIT binary patch literal 10041 zcmZ{o30zJ2`^S$-3T;T67Q_(dwkb7uM z5F#W)F&ay@$<|^SV;C)xk|qDo_uPAOZu9${*X!H!eBb9e-{tu}&-1-FKeG&=D9RYE zf})&uQdGwbUF&uX%mNKhUl05-)3t8rA+6Ey^c_o49fniX7ljnntsKA{Z30EPCP4l} zQAVxcPoQ_v@qW>;y+Kh{TJRdM9y(4vrKs*usZO8t5A>B_oglk%m>XC(FtT2XaEM!A zHjrI7c5}dbgPC*KafniL8@qPruUJSk+qYFiYGam*I2t~tmO^Ijt3oc_JFNH>^??$A~C>?wZFlz9s|2t zFuQhk*uQljFmp6^zu$t9xwy3i`DX10)}7elA-??uY%(O*2M54r62|c}^2J)vj^WI$ zNj+d<4HD-=%?DFMa{bom z%<&W02{7(>rC=ps+`5qub{(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v zM&n`0dn5_>D{n@|oF8jv{BXk3@V~d27M<#uXSp~`WodrS#P(rKMe6b6O)lj(RX&u;Uz7KYxI>(qsOc3Ue#y+96hA@phxwAx|DCS52Uys`?N86ccanf z5_v!0qPSypsPnV_H7nPgje2HrGNiS4^QDxAMPK(@b4k>Y`e8zA-_TO;hOENg3th4% z{m>d*7gzd+cgVr)f%is)A9-CCQnYh@^TG!ABVO0+LrU$hyjd6ViE3DtyhgqcB^6>E9Pm1HR z20samds+H+=a_4yNAj}Ea<_Vy1Z*l6?1-(1w?B|tFe&eF*_N&OLCH;xb+NH?7Oz+? zGxi?Q<-GdBiw<|Y6RA~<-}1oEccWJI(WheFyUNbnyOy3jD#|SE z`c?VHf?m_BD)UP3EWLj_^ZxBskLUMj?o%65v1a5Sd<|t}m2TDPG2hcv;Bnq6HOF`H z?0CCBJhKuyz7h0$lW6@a`Zr0Q@Vi8_?6rBO;o4ql3tuM0eCQbSVca`ck&qw2yVq}$ z@0Rr!_Puk{?%8wm!_dd}!dr`@R$fgVuq9(vSyeKm?jNB`o=z)IdRf{jxgo=J+jY73d7JN222VelQTtnssh?F`-w+|Q3r z{b*`pHE2k`vx{df=#=-Nqj2`@RkNJ?%P5ouiSNJFJd!zG`^x+em8$DmXnfKyj=f{~Pdk5Z=rh4Dqe^gsv_GnZ>w#7T+ zQ$f54k^7Agbo$wV*E8K(9ZG9sjfbVIJpFv`^aXX*(^{{Wxt)EtW5bT>@+*>p345Dt zkY&WFIVdjFR^)resf7)SM@&86T( +#include "convertible_logging.h" +#include "accelerometer-orientation.h" +#include "dbus_acceleration.h" +#include "e_mod_main.h" +#include "input_rotation.h" + +DbusAccelerometer* accelerometer_dbus; + +DbusAccelerometer* sensor_proxy_init() { + // Initialise DBUS component + if (accelerometer_dbus != NULL) + { + INF("We already have a struct filled"); + return accelerometer_dbus; + } + accelerometer_dbus = calloc(1, sizeof(DbusAccelerometer)); + + // The next line is probably redundant + accelerometer_dbus->orientation = undefined; + + DBG("Before eldbus initialization"); + int initialization = eldbus_init(); + if (initialization == EXIT_FAILURE) + { + ERR("Unable to initialise ELDBUS"); + } + + INF("Getting dbus interfaces"); + accelerometer_dbus->sensor_proxy = get_dbus_interface(EFL_DBUS_ACC_IFACE); + accelerometer_dbus->sensor_proxy_properties = get_dbus_interface(ELDBUS_FDO_INTERFACE_PROPERTIES); + if (accelerometer_dbus->sensor_proxy == NULL) + { + ERR("Unable to get the proxy for interface %s", EFL_DBUS_ACC_IFACE); + return accelerometer_dbus; + } + + accelerometer_dbus->pending_has_orientation = eldbus_proxy_property_get(accelerometer_dbus->sensor_proxy, + "HasAccelerometer", on_has_accelerometer, + accelerometer_dbus); + if (!accelerometer_dbus->pending_has_orientation) + { + ERR("Error: could not get property HasAccelerometer"); + } + + // Claim the accelerometer_dbus + accelerometer_dbus->pending_acc_claim = eldbus_proxy_call(accelerometer_dbus->sensor_proxy, "ClaimAccelerometer", + on_accelerometer_claimed, accelerometer_dbus, -1, ""); + + if (!accelerometer_dbus->pending_acc_claim) + { + ERR("Error: could not call ClaimAccelerometer"); + } + + return accelerometer_dbus; +} + +void sensor_proxy_shutdown() +{ + INF("Removing signal handler dbus_property_changed_sh"); + eldbus_signal_handler_del(accelerometer_dbus->dbus_property_changed_sh); + + // TODO Should to this and wait for the release before continuing + INF("Freeing convertible resources"); + accelerometer_dbus->pending_acc_crelease = eldbus_proxy_call(accelerometer_dbus->sensor_proxy, "ReleaseAccelerometer", on_accelerometer_released, accelerometer_dbus, -1, ""); + if (accelerometer_dbus) + { + e_object_del(E_OBJECT(accelerometer_dbus)); + free(accelerometer_dbus); + accelerometer_dbus = NULL; + } + + DBG("Shutting down ELDBUS"); + eldbus_shutdown(); +} + +int _convertible_rotation_get(const enum screen_rotation orientation); + +int _is_device_a_touch_pointer(int dev_counter, int num_properties, char **iterator); + +Eldbus_Proxy *get_dbus_interface(const char *IFACE) +{ + DBG("Working on interface: %s", IFACE); + Eldbus_Connection *conn; + Eldbus_Object *obj; + Eldbus_Proxy *sensor_proxy; + + conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM); + if (!conn) + { + ERR("Error: could not get system bus"); + return NULL; + } + obj = eldbus_object_get(conn, EFL_DBUS_ACC_BUS, EFL_DBUS_ACC_PATH); + if (!obj) + { + ERR("Error: could not get object"); + return NULL; + } + sensor_proxy = eldbus_proxy_get(obj, IFACE); + if (!sensor_proxy) + { + ERR("Error: could not get proxy for interface %s", IFACE); + return NULL; + } + + return sensor_proxy; +} + +enum screen_rotation access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, Eina_Bool* result) +{ + const char *type = NULL; + *result = EINA_TRUE; + + if (!eldbus_message_arguments_get(msg, "v", variant)) + { + WARN("Error getting arguments."); + *result = EINA_FALSE; + } + type = eldbus_message_iter_signature_get((*variant)); + if (type == NULL) + { + WARN("Unable to get the type."); + *result = EINA_FALSE; + return undefined; + } + + type = eldbus_message_iter_signature_get((*variant)); + if (type[1]) + { + WARN("It is a complex type, not handle yet."); + *result = EINA_FALSE; + } + if (type[0] != 's') + { + WARN("Expected type is string(s)."); + *result = EINA_FALSE; + } + const char **string_property_value = calloc(PATH_MAX, sizeof(char)); + if (!eldbus_message_iter_arguments_get((*variant), "s", string_property_value)) + { + WARN("error in eldbus_message_iter_arguments_get()"); + *result = EINA_FALSE; + } + + enum screen_rotation rotation = undefined; + if (strcmp(ACCELEROMETER_ORIENTATION_RIGHT, *string_property_value) == 0) + rotation = right_up; + if (strcmp(ACCELEROMETER_ORIENTATION_LEFT, *string_property_value) == 0) + rotation = left_up; + if (strcmp(ACCELEROMETER_ORIENTATION_BOTTOM, *string_property_value) == 0) + rotation = flipped; + if (strcmp(ACCELEROMETER_ORIENTATION_NORMAL, *string_property_value) == 0) + rotation = normal; + + free((void *) type); + free(string_property_value); + return rotation; +} + +Eina_Bool +access_bool_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, Eina_Bool *boolean_property_value) +{ + const char *type; + Eina_Bool res = EINA_TRUE; + + if (!eldbus_message_arguments_get(msg, "v", variant)) + { + WARN("Error getting arguments."); + res = EINA_FALSE; + } + type = eldbus_message_iter_signature_get((*variant)); + if (type == NULL) + { + WARN("Unable to get the type."); + res = EINA_FALSE; + return res; + } + + if (type[1]) + { + WARN("It is a complex type, not handle yet."); + res = EINA_FALSE; + } + if (type[0] != 'b') + { + WARN("Expected type is int."); + res = EINA_FALSE; + } + if (!eldbus_message_iter_arguments_get((*variant), "b", boolean_property_value)) + { + WARN("error in eldbus_message_iter_arguments_get()"); + res = EINA_FALSE; + } + free((void *) type); + return res; +} + +void +on_has_accelerometer(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) +{ + const char *errname, *errmsg; + Eina_Bool has_accelerometer = EINA_FALSE; + Eldbus_Message_Iter *variant = NULL; + + if (eldbus_message_error_get(msg, &errname, &errmsg)) + { + ERR("Error: %s %s", errname, errmsg); + } + + access_bool_property(msg, &variant, &has_accelerometer); + DbusAccelerometer *accelerometer = (DbusAccelerometer *) data; + accelerometer->has_accelerometer = has_accelerometer; + DBG("Has Accelerometer: %d", accelerometer->has_accelerometer); +} + +void +on_accelerometer_orientation(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) +{ + INF("New orientation received"); + Instance *inst = (Instance *) data; + + if (inst->locked_position == EINA_TRUE) + { + WARN("Locked position. Ignoring rotation"); + return; + } + + + const char *errname, *errmsg; + enum screen_rotation orientation; + Eldbus_Message_Iter *variant = NULL; + Eina_Bool* result = calloc(1, sizeof(Eina_Bool)); + + if (eldbus_message_error_get(msg, &errname, &errmsg)) + { + ERR("Error: %s %s", errname, errmsg); + return; + } + + orientation = access_string_property(msg, &variant, result); + if (*result == EINA_FALSE) + { + INF("Failed to retrieve the orientation from dbus message"); + free(result); + return; + } + free(result); + + inst->accelerometer->orientation = orientation; + DBG("Current Orientation: %d", inst->accelerometer->orientation); + + if (inst->randr2_ids == NULL) + ERR("Screen not set."); + else + { + Eina_List *l; + const char *randr_id = NULL; + EINA_LIST_FOREACH(inst->randr2_ids, l, randr_id) + { + _fetch_and_rotate_screen(randr_id, orientation); + } + free((void *)randr_id); + } +} + +int _convertible_rotation_get(const enum screen_rotation orientation) +{ + switch (orientation) + { + case normal: return 0; + case left_up: return 90; + case flipped: return 180; + case right_up: return 270; + + default: return 0; + } +} + +const float * _get_matrix_rotation_transformation(int rotation) +{ + const float *transformation; + switch (rotation) { + case 90: + transformation = MATRIX_ROTATION_90; + break; + case 180: + transformation = MATRIX_ROTATION_180; + break; + case 270: + transformation = MATRIX_ROTATION_270; + break; + default: + transformation = MATRIX_ROTATION_IDENTITY; + } + return transformation; +} + +int _fetch_X_device_input_number() +{ + // I should get the touchscreen associated with the screen probably by looking at the classes of the input devices + // I need to submit my patch to add getters for other XIDeviceInfo fields, like raster mentioned in his commit. + const char *dev_name = NULL; + char **property_name = NULL; + int dev_num = ecore_x_input_device_num_get(); + int dev_number = -1; + + for (int dev_counter=0; dev_counterrotation) + { + WARN("Screen %s is already rotated to %d degrees", randr_id, rotation); + } else + { + screen_randr_cfg->rotation = rotation; + e_randr2_config_apply(); + DBG("Screen %s rotated to %d", randr_id, rotation); + + int x_dev_num = _fetch_X_device_input_number(); + if (x_dev_num == -1) + { + ERR("Unable to find a pointer device with coordinate transformation capabilities"); + return; + } + DBG("Rotating input number %d", x_dev_num); + + int num_ret, unit_size_ret; + Ecore_X_Atom format_ret; + char *result = NULL; + TransformationMatrix *matrix = calloc(1, sizeof(TransformationMatrix)); + result = ecore_x_input_device_property_get(x_dev_num, CTM_name, &num_ret, &format_ret, &unit_size_ret); + if (result != NULL) + { + + DBG("Device with coordinates transformation matrix"); + // format_ret of 116 -> ECORE_X_ATOM_FLOAT + // num_ret of 9 -> 9 (float) to read + // unit_size_ret of 32 -> each float is 32 bits + memcpy(matrix->values, result, sizeof(matrix->values)); + const float * rotation_matrix_2d = _get_matrix_rotation_transformation(rotation); + memcpy(matrix->values, rotation_matrix_2d, 6 * sizeof(*rotation_matrix_2d)); + ecore_x_input_device_property_set(x_dev_num, CTM_name, matrix->values, num_ret, format_ret, unit_size_ret); + + DBG("Input device %d rotated to %d", x_dev_num, rotation); + } else { + ERR("Unable to fetch coordinates transformation matrix for device %d", x_dev_num); + } + free(matrix); + } +} + +void +on_accelerometer_claimed(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) +{ + const char *errname, *errmsg; + + INF("Going to claim the accelerometer_dbus"); + if (eldbus_message_error_get(msg, &errname, &errmsg)) + { + ERR("Error: %s %s", errname, errmsg); + return; + } + INF("Accelerometer claimed"); +} + +void +on_accelerometer_released(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) +{ + const char *errname, *errmsg; + + INF("Going to release the accelerometer_dbus"); + if (eldbus_message_error_get(msg, &errname, &errmsg)) + { + ERR("Error: %s %s", errname, errmsg); + return; + } + INF("Accelerometer released"); +} diff --git a/src/modules/convertible/dbus_acceleration.h b/src/modules/convertible/dbus_acceleration.h new file mode 100644 index 000000000..b194ff08d --- /dev/null +++ b/src/modules/convertible/dbus_acceleration.h @@ -0,0 +1,104 @@ +#include +#include +#include + +#ifndef EFL_DBUS_ACCELERATION +#define EFL_DBUS_ACCELERATION + +#define EFL_DBUS_ACC_BUS "net.hadess.SensorProxy" +#define EFL_DBUS_ACC_PATH "/net/hadess/SensorProxy" +#define EFL_DBUS_ACC_IFACE "net.hadess.SensorProxy" + +// This enum represents the 4 states of screen rotation plus undefined +enum screen_rotation {undefined, normal, right_up, flipped, left_up}; + +typedef struct _DbusAccelerometer DbusAccelerometer; + +struct _DbusAccelerometer +{ + Eina_Bool has_accelerometer; + enum screen_rotation orientation; + Eldbus_Proxy *sensor_proxy, *sensor_proxy_properties; + Eldbus_Pending *pending_has_orientation, *pending_orientation, *pending_acc_claim, *pending_acc_crelease; + Eldbus_Signal_Handler *dbus_property_changed_sh; +}; + +/** + * Fetch the DBUS interfaces and fill the DbusAccelerometer struct + * */ +DbusAccelerometer* sensor_proxy_init(); + + +void sensor_proxy_shutdown(); + +/** + * Helper to get the interface + * */ +Eldbus_Proxy *get_dbus_interface(const char *IFACE); + +/** + * Helper function to extract ta string property from the message + * @param msg The message coming from the get property invocation + * @param variant + * @param result 1 if result is ok, 0 if it failed + * @return Enum specifying the orientation + */ +enum screen_rotation +access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, Eina_Bool* result); + +/** + * Helper function to extract ta boolean property from the message + * @param msg The message coming from the get property invocation + * @param variant + * @param boolean_property_value The boolean property pointer where the value should be stored, if read + * @return + */ +Eina_Bool +access_bool_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, Eina_Bool *boolean_property_value); + +/** + * Callback definition to handle the request of the hasAccelerometer property of DBUS interface net.hadess.SensorProxy + * @param data DbusAccelerometer + * @param msg The message + * @param pending + */ +void +on_has_accelerometer(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED); + +/** + * Callback definition to handle the request of the accelerometer property of DBUS interface net.hadess.SensorProxy + * @param data DbusAccelerometer + * @param msg The message + * @param pending + */ +void +on_accelerometer_orientation(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED); + +/** + * Callback definition to handle the execution of the ClaimAccelerometer() method of DBUS + * interface net.hadess.SensorProxy + * @param data not used + * @param msg The message + * @param pending + */ +void +on_accelerometer_claimed(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED); + +/** + * Callback definition to handle the execution of the ReleaseAccelerometer() method of DBUS + * interface net.hadess.SensorProxy + * @param data not used + * @param msg The message + * @param pending + */ +void +on_accelerometer_released(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED); + + +/** + * Fetch a screen from its ID and rotate it according to the rotation parameter + * @param randr_id The randr2 id + * @param rotation The expected rotation + */ +void _fetch_and_rotate_screen(const char* randr_id, enum screen_rotation orientation); +#endif diff --git a/src/modules/convertible/e-gadget-convertible.c b/src/modules/convertible/e-gadget-convertible.c new file mode 100644 index 000000000..8030bc4ca --- /dev/null +++ b/src/modules/convertible/e-gadget-convertible.c @@ -0,0 +1,61 @@ +// +// Created by raffaele on 04/05/19. +// +#include "convertible_logging.h" +#include "e-gadget-convertible.h" +#include "e_mod_main.h" + +/* LIST OF INSTANCES */ +static Eina_List *instances = NULL; + +void _update_instances(const Instance *current_instance) +{ + Eina_List *l; + Instance *instance = NULL; + EINA_LIST_FOREACH(instances, l, instance) + { + if (current_instance != instance) + { + instance->locked_position = current_instance->locked_position; + if (instance->locked_position == EINA_TRUE) + edje_object_signal_emit(instance->o_button, "lock,rotation,icon", "convertible/tablet"); + else + edje_object_signal_emit(instance->o_button, "unlock,rotation,icon", "convertible/tablet"); + } + } +} + +void _rotation_signal_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const char *sig EINA_UNUSED, + const char *src EINA_UNUSED) +{ + DBG("Rotation: Signal %s received from %s", sig, src); + Instance *inst = data; + if (eina_str_has_prefix(sig, "unlock")) + inst->locked_position = EINA_FALSE; + if (eina_str_has_prefix(sig, "lock")) + inst->locked_position = EINA_TRUE; + _update_instances(inst); +} + +void _keyboard_signal_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const char *sig EINA_UNUSED, + const char *src EINA_UNUSED) +{ + DBG("Keyboard: Signal %s received from %s", sig, src); +} + + +/** + * Callback for gadget creation + * */ +static void +_gadget_created(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) +{ + DBG("Inside gadget created"); + // do_orient(inst, e_gadget_site_orient_get(obj), e_gadget_site_anchor_get(obj)); + evas_object_smart_callback_del_full(obj, "gadget_created", _gadget_created, NULL); +} + + +void update_instances(Eina_List *new_instances) { + instances = new_instances; +} diff --git a/src/modules/convertible/e-gadget-convertible.h b/src/modules/convertible/e-gadget-convertible.h new file mode 100644 index 000000000..e353ccf2f --- /dev/null +++ b/src/modules/convertible/e-gadget-convertible.h @@ -0,0 +1,22 @@ +// +// Created by raffaele on 04/05/19. +// +#include +#include +#include "e_mod_main.h" + +#ifndef E_GADGET_CONVERTIBLE_E_GADGET_CONVERTIBLE_H +#define E_GADGET_CONVERTIBLE_E_GADGET_CONVERTIBLE_H + +/* gadcon callback for actions */ +void +_rotation_signal_cb(void *data EINA_UNUSED, Evas_Object *obj, const char *sig EINA_UNUSED, const char *src EINA_UNUSED); + +void +_keyboard_signal_cb(void *data EINA_UNUSED, Evas_Object *obj, const char *sig EINA_UNUSED, const char *src EINA_UNUSED); + +void update_instances(Eina_List *instances); +/* end gadcon callback for actions */ + + +#endif //E_GADGET_CONVERTIBLE_E_GADGET_CONVERTIBLE_H diff --git a/src/modules/convertible/e-module-convertible.edj b/src/modules/convertible/e-module-convertible.edj new file mode 100755 index 0000000000000000000000000000000000000000..d3e4d40338e96af6b4f7dc4198998a174b23f57e GIT binary patch literal 15752 zcma)=2|U!>|NlRwR3a*sRAeWaY>76cMX4+atEiIS!+rFo?@3(#5v{<5Y z3#F(m(Je)iNEH9q`OJK#5BGi_|KI1~%=?_@=dADZe!tK8(0Q*uhN7s>6xGg#q6Q(` zVVx{#Wunjx2@hu@*m7CY$_J2h8!hCyvZPhc;xR1#mBn8ouPRG@At+7qLs2##C`!qe zqIyXwsxM(`NE0b)*g(t+V|APgt_P+f55z1m zcSt2tCJ*wJU|x_tWrSvCV0^HSNKD(4VDnMbV6mfMaVU3UwXFhM21e$=w0#J+mDFRg znP5pM6CE)1R)8Htu`{bbA=p_kq6enl8?aj__F~oh0+s`Y{ZrH%1y+C}d)yOXC172U znEtTVz7;64>nVYu&sOysz<+C)!1keD&D!1Pg6W-%i$(>Cl9 z7zd24Q}m@h6s#+&?E)~THtaK)8yM!U7*_-an`yP@)nJ}&81$^|O&Ah+RFJS|+P;vQ z1dugDNWnr0W9i^euq9yZeS=MEuLNV;K^oX@Ft!f%g6#(*<1u4A13O6=YYbhmOKlj@ zOA28~3|Vi?#pUB6AbN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 index 000000000..6f529cd49 --- /dev/null +++ b/src/modules/convertible/e_mod_config.c @@ -0,0 +1,160 @@ +// +// Created by raffaele on 01/08/19. +// +#include "convertible_logging.h" +#include "e.h" +#include "e_mod_config.h" + +static Convertible_Config *_config = NULL; +E_Config_DD *edd = NULL; +EINTERN Convertible_Config *convertible_config; + +/** + * Create the config structure + * */ +static void +_econvertible_config_dd_new(void) +{ +// c_zone = E_CONFIG_DD_NEW("Econvertible_Zone_Config", Convertible_Zone_Config); +// E_CONFIG_VAL(c_zone, Convertible_Zone_Config, name, STR); +// E_CONFIG_VAL(c_zone, Convertible_Zone_Config, follow_rotation, INT); + + // TODO Not sure what his line does. Apparently, it is needed to specify the type of the configuration data structure + edd = E_CONFIG_DD_NEW("Convertible_Config", Convertible_Config); + + E_CONFIG_VAL(edd, Convertible_Config, disable_keyboard_on_rotation, INT); +// E_CONFIG_LIST(edd, Convertible_Config, rotatable_screen_configuration, c_zone); +} + +/** + * Update the *_config data structure based on the settings coming from the dialog panel + * @param config The config coming from the Dialog Panel (E_Config_Dialog_data) + */ +static void +_config_set(Convertible_Config *config) +{ + DBG("config_set disable_keyboard_on_rotation %d", config->disable_keyboard_on_rotation); + _config->disable_keyboard_on_rotation = config->disable_keyboard_on_rotation; + e_config_domain_save("module.convertible", edd, config); +} + +/** + * Initialise the configuration object + * + * @param cfg + * @return + */ +static void* +_create_data(E_Config_Dialog *cfg EINA_UNUSED) +{ + E_Config_Dialog_Data *dialog_data; + + dialog_data = E_NEW(E_Config_Dialog_Data, 1); + dialog_data->config = malloc(sizeof(Convertible_Config)); + dialog_data->config->disable_keyboard_on_rotation = _config->disable_keyboard_on_rotation; +// dialog_data->config->rotatable_screen_configuration = _config->rotatable_screen_configuration; + + DBG("disable_keyboard_on_rotation %d", dialog_data->config->disable_keyboard_on_rotation); + return dialog_data; +} + +/** + * Release memory for the data structure holding the configuration + * + * @param c + * @param dialog_data + */ +static void +_free_data(E_Config_Dialog *c EINA_UNUSED, E_Config_Dialog_Data *dialog_data) +{ + free(dialog_data->config); + free(dialog_data); +} + +/** + * This function should store the modified settings into the data structure referred by the pointer _config + * @param cfd + * @param cfdata + * @return + */ +static int +_basic_apply_data(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata) +{ + DBG("_basic_apply_data"); + _config_set(cfdata->config); + return 1; +} + +/** + * Create the panel by adding all the items like labels, checkbox and lists + * + * @param cfd + * @param evas + * @param cfdata + * @return + */ +static Evas_Object * +_basic_create_widgets(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, + E_Config_Dialog_Data *cfdata) +{ + Evas_Object *o, *evas_option_input_disable; //, *evas_label_section_screens; // *list_item_screen, +// Evas_Object *screen_list = NULL; + + o = e_widget_list_add(evas, 0, 0); + + evas_option_input_disable = e_widget_check_add(evas, "Disable input when rotated", &(cfdata->config->disable_keyboard_on_rotation)); + e_widget_list_object_append(o, evas_option_input_disable, 0, 0, 0); + + DBG("After basic_create_widget"); + return o; + } + +/** + * This function initialise the config dialog for the module + * @param comp + * @param p + * @return + */ +E_Config_Dialog* +e_int_config_convertible_module(Evas_Object *comp, const char *p EINA_UNUSED) +{ + E_Config_Dialog *cfd; + E_Config_Dialog_View *v; + + if (e_config_dialog_find("E", "windows/convertible")) + return NULL; + + v = E_NEW(E_Config_Dialog_View, 1); + v->create_cfdata = _create_data; + v->free_cfdata = _free_data; + v->basic.apply_cfdata = _basic_apply_data; + v->basic.create_widgets = _basic_create_widgets; + + cfd = e_config_dialog_new(comp, + "Convertible Configuration", + "E", "windows/convertible", + NULL, + 0, v, NULL); + return cfd; +} + +void +econvertible_config_init() +{ + _econvertible_config_dd_new(); + _config = e_config_domain_load("module.econvertible", edd); + if (!_config) + { + _config = E_NEW(Convertible_Config, 1); + _config->disable_keyboard_on_rotation = 1; +// _config->rotatable_screen_configuration = NULL; + } + + DBG("Config loaded"); +} + +void econvertible_config_shutdown() +{ + E_CONFIG_DD_FREE(edd); + E_FREE(convertible_config); +} \ No newline at end of file diff --git a/src/modules/convertible/e_mod_config.h b/src/modules/convertible/e_mod_config.h new file mode 100644 index 000000000..3226aea3f --- /dev/null +++ b/src/modules/convertible/e_mod_config.h @@ -0,0 +1,44 @@ +// +// Created by raffaele on 01/08/19. +// +#include +#include "e_mod_main.h" + +#ifndef E_GADGET_CONVERTIBLE_E_MOD_CONFIG_H +#define E_GADGET_CONVERTIBLE_E_MOD_CONFIG_H + +// Definition for a zone configuration +typedef struct _Convertible_Zone_Config Convertible_Zone_Config; + +struct _Convertible_Zone_Config +{ + char *name; + int follow_rotation; +}; + +// Definition of the data structure to hold the gadget configuration +typedef struct _Convertible_Config Convertible_Config; + +struct _Convertible_Config +{ + int disable_keyboard_on_rotation; +// Eina_List *rotatable_screen_configuration; +}; + +// As far as I understand, this structure should hold data useful for the configuration and a pointer to +// another structure holding the configuration options +struct _E_Config_Dialog_Data +{ + Convertible_Config *config; + Evas_Object *zones; + Evas_Object *inputs; +}; + +E_Config_Dialog* e_int_config_convertible_module(Evas_Object *comp, const char *p); +void econvertible_config_init(); +void econvertible_config_shutdown(); +//E_Config_Dialog* econvertible_config_init(Evas_Object *comp, const char*p); +void _menu_new(Instance *inst, Evas_Event_Mouse_Down *ev); +void _mouse_down_cb(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event); + +#endif //E_GADGET_CONVERTIBLE_E_MOD_CONFIG_H diff --git a/src/modules/convertible/e_mod_main.c b/src/modules/convertible/e_mod_main.c new file mode 100644 index 000000000..1d080e8d0 --- /dev/null +++ b/src/modules/convertible/e_mod_main.c @@ -0,0 +1,378 @@ +// +// Created by raffaele on 04/05/19. +// +#include +#include +#include +#include "convertible_logging.h" +#include "accelerometer-orientation.h" +#include "e-gadget-convertible.h" +#include "e_mod_main.h" +#include "dbus_acceleration.h" +#include "e_mod_config.h" + + +// The main module reference +E_Module *convertible_module; +Instance *inst; + +// Configuration +extern Convertible_Config *convertible_config; +extern E_Config_DD *edd; + +// Logger +int _convertible_log_dom; + +/* module setup */ +E_API E_Module_Api e_modapi = + { + E_MODULE_API_VERSION, + "convertible" + }; + + +/* LIST OF INSTANCES */ +static Eina_List *instances = NULL; + + +/* gadcon requirements */ +static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style); +static void _gc_shutdown(E_Gadcon_Client *gcc); +static void _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient); +static const char *_gc_label(const E_Gadcon_Client_Class *client_class); +static Evas_Object *_gc_icon(const E_Gadcon_Client_Class *client_class, Evas *evas); +static const char *_gc_id_new(const E_Gadcon_Client_Class *client_class); +/* and actually define the gadcon class that this module provides (just 1) */ +static const E_Gadcon_Client_Class _gadcon_class = +{ + GADCON_CLIENT_CLASS_VERSION, + "convertible", + { + _gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL, + e_gadcon_site_is_not_toolbar + }, + E_GADCON_CLIENT_STYLE_PLAIN +}; + + +static E_Gadcon_Client * +_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style) +{ + Evas_Object *evas_object; + E_Gadcon_Client *gcc; + Instance *instance; + + evas_object = edje_object_add(gc->evas); + e_theme_edje_object_set(evas_object, "base/theme/modules/convertible", + "e/modules/convertible/main"); + + instance = E_NEW(Instance, 1); + instance->accelerometer = inst->accelerometer; + instance->disabled_keyboard = inst->disabled_keyboard; + instance->locked_position = inst->locked_position; + instance->randr2_ids = inst->randr2_ids; + instance->o_button = evas_object; + + instances = eina_list_append(instances, instance); + update_instances(instances); + + gcc = e_gadcon_client_new(gc, name, id, style, evas_object); + gcc->data = instance; + + evas_object_size_hint_aspect_set(evas_object, EVAS_ASPECT_CONTROL_BOTH, 1, 1); + // evas_object_smart_callback_add(parent, "gadget_site_anchor", _anchor_change, inst); + + // Adding callback for EDJE object + INF("Adding callback for creation and other events from EDJE"); + edje_object_signal_callback_add(evas_object, "lock,rotation", "tablet", _rotation_signal_cb, instance); + edje_object_signal_callback_add(evas_object, "unlock,rotation", "tablet", _rotation_signal_cb, instance); + edje_object_signal_callback_add(evas_object, "enable,keyboard", "keyboard", _keyboard_signal_cb, instance); + edje_object_signal_callback_add(evas_object, "disable,keyboard", "keyboard", _keyboard_signal_cb, instance); + + inst->o_button = evas_object; + + return gcc; +} + +static void +_gc_shutdown(E_Gadcon_Client *gcc) +{ + DBG("CONVERTIBLE gadcon shutdown"); + Instance *instance; + + if (!(instance = gcc->data)) return; + instances = eina_list_remove(instances, instance); + instance->accelerometer = NULL; + + // Remove callbacks + DBG("Removing EDJE callbacks"); + edje_object_signal_callback_del(instance->o_button, "lock,rotation", "tablet", _rotation_signal_cb); + edje_object_signal_callback_del(instance->o_button, "unlock,rotation", "tablet", _rotation_signal_cb); + edje_object_signal_callback_del(instance->o_button, "enable,keyboard", "keyboard", _keyboard_signal_cb); + edje_object_signal_callback_del(instance->o_button, "disable,keyboard", "keyboard", _keyboard_signal_cb); + + evas_object_del(instance->o_button); + + E_FREE(instance); +} + +static void +_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient) +{ + Instance *inst; + Evas_Coord mw, mh; + char buf[4096]; + const char *s = "float"; + + inst = gcc->data; + switch (orient) + { + case E_GADCON_ORIENT_FLOAT: + s = "float"; + break; + + case E_GADCON_ORIENT_HORIZ: + s = "horizontal"; + break; + + case E_GADCON_ORIENT_VERT: + s = "vertical"; + break; + + case E_GADCON_ORIENT_LEFT: + s = "left"; + break; + + case E_GADCON_ORIENT_RIGHT: + s = "right"; + break; + + case E_GADCON_ORIENT_TOP: + s = "top"; + break; + + case E_GADCON_ORIENT_BOTTOM: + s = "bottom"; + break; + + case E_GADCON_ORIENT_CORNER_TL: + s = "top_left"; + break; + + case E_GADCON_ORIENT_CORNER_TR: + s = "top_right"; + break; + + case E_GADCON_ORIENT_CORNER_BL: + s = "bottom_left"; + break; + + case E_GADCON_ORIENT_CORNER_BR: + s = "bottom_right"; + break; + + case E_GADCON_ORIENT_CORNER_LT: + s = "left_top"; + break; + + case E_GADCON_ORIENT_CORNER_RT: + s = "right_top"; + break; + + case E_GADCON_ORIENT_CORNER_LB: + s = "left_bottom"; + break; + + case E_GADCON_ORIENT_CORNER_RB: + s = "right_bottom"; + break; + + default: + break; + } + snprintf(buf, sizeof(buf), "e,state,orientation,%s", s); + edje_object_signal_emit(inst->o_button, buf, "e"); + edje_object_message_signal_process(inst->o_button); + + mw = 0, mh = 0; + edje_object_size_min_get(inst->o_button, &mw, &mh); + if ((mw < 1) || (mh < 1)) + edje_object_size_min_calc(inst->o_button, &mw, &mh); + if (mw < 4) mw = 4; + if (mh < 4) mh = 4; + e_gadcon_client_aspect_set(gcc, mw, mh); + e_gadcon_client_min_size_set(gcc, mw, mh); +} + +static const char * +_gc_label(const E_Gadcon_Client_Class *client_class EINA_UNUSED) +{ + return "Convertible"; +} + +static Evas_Object * +_gc_icon(const E_Gadcon_Client_Class *client_class EINA_UNUSED, Evas *evas) +{ + Evas_Object *o; + char buf[PATH_MAX]; + + o = edje_object_add(evas); + snprintf(buf, sizeof(buf), "%s/e-module-convertible.edj", convertible_module->dir); + edje_object_file_set(o, buf, "main"); + return o; +} + +static const char * +_gc_id_new(const E_Gadcon_Client_Class *client_class EINA_UNUSED) +{ + static char buf[4096]; + + snprintf(buf, sizeof(buf), "%s.%d", client_class->name, + eina_list_count(instances) + 1); + return buf; +} + + +/** + * Prepare to fetch the new value for the DBUS property that has changed + * */ +static void +_cb_properties_changed(void *data, const Eldbus_Message *msg) +{ + Instance *inst = (Instance *) data; + Eldbus_Message_Iter *array, *invalidate; + char *iface; + + if (!eldbus_message_arguments_get(msg, "sa{sv}as", &iface, &array, &invalidate)) + ERR("Error getting data from properties changed signal."); + // Given that the property changed, let's get the new value + Eldbus_Pending *pending_operation = eldbus_proxy_property_get(inst->accelerometer->sensor_proxy, + "AccelerometerOrientation", + on_accelerometer_orientation, inst); + if (!pending_operation) + ERR("Error: could not get property AccelerometerOrientation"); +} + +E_API void * +e_modapi_init(E_Module *m) +{ + // Initialise the logger + _convertible_log_dom = eina_log_domain_register("convertible", EINA_COLOR_LIGHTBLUE); + + convertible_module = m; + char theme_overlay_path[PATH_MAX]; + snprintf(theme_overlay_path, sizeof(theme_overlay_path), "%s/e-module-convertible.edj", convertible_module->dir); + elm_theme_extension_add(NULL, theme_overlay_path); + + econvertible_config_init(NULL); + + // Config DBus + DbusAccelerometer *accelerometer = sensor_proxy_init(); + inst = E_NEW(Instance, 1); + inst->accelerometer = accelerometer; + inst->locked_position = EINA_FALSE; + inst->disabled_keyboard = EINA_FALSE; + + // Making sure we rotate the screen to the current orientation coming from the sensor + inst->accelerometer->pending_orientation = eldbus_proxy_property_get(inst->accelerometer->sensor_proxy, + "AccelerometerOrientation", + on_accelerometer_orientation, inst); + if (!inst->accelerometer->pending_orientation) + { + ERR("Error: could not get property AccelerometerOrientation"); + } + + // Set the callback for property changed event + accelerometer->dbus_property_changed_sh = eldbus_proxy_signal_handler_add(accelerometer->sensor_proxy_properties, + "PropertiesChanged", + _cb_properties_changed, inst); + if (!accelerometer->dbus_property_changed_sh) + ERR("Error: could not add the signal handler for PropertiesChanged"); + + // Screen related part + E_Zone *zone = NULL; + + // Initialise screen part + DBG("Looking for the main screen"); + Eina_List *l; + inst->randr2_ids = NULL; + EINA_LIST_FOREACH(e_comp->zones, l, zone) + { + // Get the screen for the zone + E_Randr2_Screen *screen = e_randr2_screen_id_find(zone->randr2_id); + DBG("name randr2 id %s", zone->randr2_id); + DBG("rot_90 %i", screen->info.can_rot_90); + // Arbitrarily chosen a condition to check that rotation is enabled + if (screen->info.can_rot_90 == EINA_TRUE) + { + int max_screen_length = 300; + char *randr2_id = malloc(sizeof(char) * max_screen_length); + int copied_chars = eina_strlcpy(randr2_id, zone->randr2_id, max_screen_length); + if (copied_chars > max_screen_length) + ERR("Screen name %s has been truncated. Cannot handle screens.", randr2_id); + if (copied_chars < 0) + ERR("Can't copy the screen name"); + + inst->randr2_ids = eina_list_append(inst->randr2_ids, randr2_id); + if (eina_error_get()) + ERR("Memory is low. List allocation failed."); + } + } + + if (inst->randr2_ids == NULL) + ERR("Unable to find rotatable screens"); + + DBG("%d screen(s) has been found", eina_list_count(inst->randr2_ids)); + + e_gadcon_provider_register(&_gadcon_class); + + INF("Creating menu entries for settings"); + e_configure_registry_category_add("extensions", 90, "Extensions", NULL, + "preferences-extensions"); + e_configure_registry_item_add("extensions/convertible", 30, "convertible", NULL, + "preferences-desktop-convertible", e_int_config_convertible_module); + + instances = eina_list_append(instances, inst); + + return m; +} + +E_API int +e_modapi_shutdown(E_Module *m EINA_UNUSED) +{ + INF("Freeing configuration"); + econvertible_config_shutdown(); + + e_configure_registry_item_del("extensions/convertible"); + + // Shutdown Dbus + sensor_proxy_shutdown(); + + // Remove screen info + char *element; + EINA_LIST_FREE(inst->randr2_ids, element) + free(element); + + free(inst); + + INF("Shutting down the module"); + convertible_module = NULL; + e_gadcon_provider_unregister(&_gadcon_class); + + // Removing logger + DBG("Removing the logger"); + eina_log_domain_unregister(_convertible_log_dom); + _convertible_log_dom = -1; + + return 1; +} + +E_API int +e_modapi_save(E_Module *m EINA_UNUSED) +{ + if (convertible_config) + { + e_config_domain_save("module.convertible", edd, convertible_config); + } + return 1; +} diff --git a/src/modules/convertible/e_mod_main.h b/src/modules/convertible/e_mod_main.h new file mode 100644 index 000000000..f1a8e1e6d --- /dev/null +++ b/src/modules/convertible/e_mod_main.h @@ -0,0 +1,25 @@ +// +// Created by raffaele on 04/05/19. +// +#include +#include "dbus_acceleration.h" + + +#ifndef E_GADGET_CONVERTIBLE_CONVERTIBLE_H +#define E_GADGET_CONVERTIBLE_CONVERTIBLE_H + +typedef struct _Instance Instance; + +struct _Instance +{ + Evas_Object *o_button; + DbusAccelerometer *accelerometer; + // I hate to put DBUS related stuff in this struct. Unfortunately, I did not (quickly) find a better way of + // handling signals across multiple instances sharing one DbusAccelerometer struct. + Eina_List *randr2_ids; + + Eina_Bool locked_position; + Eina_Bool disabled_keyboard; +}; + +#endif //E_GADGET_CONVERTIBLE_CONVERTIBLE_H diff --git a/src/modules/convertible/input_rotation.h b/src/modules/convertible/input_rotation.h new file mode 100755 index 000000000..90a1d3cf6 --- /dev/null +++ b/src/modules/convertible/input_rotation.h @@ -0,0 +1,20 @@ +// +// Created by raffaele on 18/12/19. +// + +#ifndef E_GADGET_CONVERTIBLE_INPUT_ROTATION_H +#define E_GADGET_CONVERTIBLE_INPUT_ROTATION_H + +typedef struct _TransformationMatrix { + float values[9]; +} TransformationMatrix; + + +static const float MATRIX_ROTATION_IDENTITY[6] = {1, 0, 0, 0, 1, 0 }; +static const float MATRIX_ROTATION_270[6] = {0, 1, 0, -1, 0, 1 }; +static const float MATRIX_ROTATION_180[6] = {-1, 0, 1, 0, -1, 1 }; +static const float MATRIX_ROTATION_90[6] = {0, -1, 1, 1, 0, 0 }; + +// "Coordinate Transformation Matrix" +static const char *CTM_name = "Coordinate Transformation Matrix"; +#endif //E_GADGET_CONVERTIBLE_INPUT_ROTATION_H diff --git a/src/modules/convertible/meson.build b/src/modules/convertible/meson.build new file mode 100644 index 000000000..5960ef2c3 --- /dev/null +++ b/src/modules/convertible/meson.build @@ -0,0 +1,23 @@ +src = files( + 'e_mod_main.c', + 'dbus_acceleration.h', + 'dbus_acceleration.c', + 'e-gadget-convertible.h', + 'e-gadget-convertible.c', + 'accelerometer-orientation.h', + 'convertible_logging.h', + 'e_mod_main.h', + 'e_mod_config.h', + 'e_mod_config.c' +) + +#shared_module('module', build_files, +# include_directories: inc, + # name_prefix : '', + # dependencies : [ dep_e, deps ], + # install_dir : join_paths([dir_gadgets, module_arch]), + # install : true, + # link_args : '-Wl,--unresolved-symbols=ignore-all' + # ) + + diff --git a/src/modules/convertible/module.desktop b/src/modules/convertible/module.desktop new file mode 100644 index 000000000..3f3992b15 --- /dev/null +++ b/src/modules/convertible/module.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Link +Name=E-convertible +GenericName=E-convertible +Comment=Helps to manage screen rotation based on accelerometer +Comment[it]=Aiuta a gestire la rotazione dello schermo basandosi sui dati dell'accelerometro +Icon=convertible-icon +X-Enlightenment-ModuleType=system diff --git a/src/modules/meson.build b/src/modules/meson.build index 52e543dab..82bd4c8c3 100644 --- a/src/modules/meson.build +++ b/src/modules/meson.build @@ -5,7 +5,7 @@ module_includes2 = [ '../..' , '../bin' , '../bin/efx' ] module_deps = [ deps_e, dep_dl ] mods = [ -# standard run of the mill modules with cion and desktop +# standard run of the mill modules with icon and desktop 'ibar', 'pager', 'temperature', @@ -29,6 +29,7 @@ mods = [ 'conf_performance', 'conf_paths', 'conf_interaction', + 'convertible', 'gadman', 'geolocation', 'connman', -- 2.25.1 From 1edbc5cca4bd8e1815db17d1639e7ea1152ddbe9 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Mon, 31 Jul 2023 10:25:17 +0200 Subject: [PATCH 02/35] Fix icon --- src/modules/convertible/convertible-icon.edj | Bin 10041 -> 0 bytes .../convertible/e-module-convertible.edj | Bin 15752 -> 10041 bytes src/modules/convertible/meson.build | 11 ----------- src/modules/convertible/module.desktop | 2 +- 4 files changed, 1 insertion(+), 12 deletions(-) delete mode 100755 src/modules/convertible/convertible-icon.edj diff --git a/src/modules/convertible/convertible-icon.edj b/src/modules/convertible/convertible-icon.edj deleted file mode 100755 index eb0b05378dbfd18d6e920122122ec3b17e0705d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10041 zcmZ{o30zJ2`^S$-3T;T67Q_(dwkb7uM z5F#W)F&ay@$<|^SV;C)xk|qDo_uPAOZu9${*X!H!eBb9e-{tu}&-1-FKeG&=D9RYE zf})&uQdGwbUF&uX%mNKhUl05-)3t8rA+6Ey^c_o49fniX7ljnntsKA{Z30EPCP4l} zQAVxcPoQ_v@qW>;y+Kh{TJRdM9y(4vrKs*usZO8t5A>B_oglk%m>XC(FtT2XaEM!A zHjrI7c5}dbgPC*KafniL8@qPruUJSk+qYFiYGam*I2t~tmO^Ijt3oc_JFNH>^??$A~C>?wZFlz9s|2t zFuQhk*uQ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iS=c@oM)X z=bfedzWFTA&I*;E7$bF2M1SaKoBC|B1g;=(B%)9Qecy>m`p zin7*CQ2#QZaih=u0?pc?m0fOKF6bF^qPXYS5O<9k4;KF6aLMGup8KPm`~JN^Ju$iS zZH-F1yWvV+*VI-Gi2b(4H~C%K`jJ1^o|-((DcZ&R?w}{8^Ns{-MyxtSrV8*F{$Qchb7yaq5Z{TB>okK>Ip5^W9(xjPx zX-HyxH}yuN>%w+5zKuRlM7LBHHfoplOB8iaacR(bb8h3Jp9#F@O&h)`{~Rm2`y^wX z)seG*Iaes{I`M6pnrB7N+v$(pA6Nv1O{zYadvjNFY24H`+ftII$DR7-Q_<2?I((kv z?6Y@fJ#H`C3O}pk2L2kC{5@(df}R%n2R+Qp%W|SA13BJv#7Z(nrCzpJr!58{8kZxD|1hCbi@be-~Y^UVls5dCL7e-leY({y!$0 BWa9t; diff --git a/src/modules/convertible/meson.build b/src/modules/convertible/meson.build index 5960ef2c3..7ecf1e98c 100644 --- a/src/modules/convertible/meson.build +++ b/src/modules/convertible/meson.build @@ -10,14 +10,3 @@ src = files( 'e_mod_config.h', 'e_mod_config.c' ) - -#shared_module('module', build_files, -# include_directories: inc, - # name_prefix : '', - # dependencies : [ dep_e, deps ], - # install_dir : join_paths([dir_gadgets, module_arch]), - # install : true, - # link_args : '-Wl,--unresolved-symbols=ignore-all' - # ) - - diff --git a/src/modules/convertible/module.desktop b/src/modules/convertible/module.desktop index 3f3992b15..a86d3199a 100644 --- a/src/modules/convertible/module.desktop +++ b/src/modules/convertible/module.desktop @@ -4,5 +4,5 @@ Name=E-convertible GenericName=E-convertible Comment=Helps to manage screen rotation based on accelerometer Comment[it]=Aiuta a gestire la rotazione dello schermo basandosi sui dati dell'accelerometro -Icon=convertible-icon +Icon=e-module-convertible X-Enlightenment-ModuleType=system -- 2.25.1 From ff71a650c289133039805fb43cda3efb0c3d3ad8 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Wed, 2 Aug 2023 21:43:51 +0200 Subject: [PATCH 03/35] Address linting comments. --- src/modules/convertible/dbus_acceleration.c | 35 +++++++++++++------ src/modules/convertible/dbus_acceleration.h | 9 +++-- .../convertible/e-gadget-convertible.c | 12 ++++--- .../convertible/e-gadget-convertible.h | 3 +- src/modules/convertible/e_mod_config.c | 4 +-- src/modules/convertible/e_mod_config.h | 15 +++++--- 6 files changed, 52 insertions(+), 26 deletions(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index 6111c69ed..d7041951e 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -10,7 +10,9 @@ DbusAccelerometer* accelerometer_dbus; -DbusAccelerometer* sensor_proxy_init() { +DbusAccelerometer* +sensor_proxy_init() +{ // Initialise DBUS component if (accelerometer_dbus != NULL) { @@ -58,7 +60,8 @@ DbusAccelerometer* sensor_proxy_init() { return accelerometer_dbus; } -void sensor_proxy_shutdown() +void +sensor_proxy_shutdown(void) { INF("Removing signal handler dbus_property_changed_sh"); eldbus_signal_handler_del(accelerometer_dbus->dbus_property_changed_sh); @@ -77,11 +80,14 @@ void sensor_proxy_shutdown() eldbus_shutdown(); } -int _convertible_rotation_get(const enum screen_rotation orientation); +int +_convertible_rotation_get(const enum screen_rotation orientation); -int _is_device_a_touch_pointer(int dev_counter, int num_properties, char **iterator); +int +_is_device_a_touch_pointer(int dev_counter, int num_properties, char **iterator); -Eldbus_Proxy *get_dbus_interface(const char *IFACE) +Eldbus_Proxy * +get_dbus_interface(const char *IFACE) { DBG("Working on interface: %s", IFACE); Eldbus_Connection *conn; @@ -110,7 +116,8 @@ Eldbus_Proxy *get_dbus_interface(const char *IFACE) return sensor_proxy; } -enum screen_rotation access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, Eina_Bool* result) +enum screen_rotation +access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, Eina_Bool* result) { const char *type = NULL; *result = EINA_TRUE; @@ -267,7 +274,8 @@ on_accelerometer_orientation(void *data, const Eldbus_Message *msg, Eldbus_Pendi } } -int _convertible_rotation_get(const enum screen_rotation orientation) +int +_convertible_rotation_get(const enum screen_rotation orientation) { switch (orientation) { @@ -280,7 +288,8 @@ int _convertible_rotation_get(const enum screen_rotation orientation) } } -const float * _get_matrix_rotation_transformation(int rotation) +const float * +_get_matrix_rotation_transformation(int rotation) { const float *transformation; switch (rotation) { @@ -299,7 +308,8 @@ const float * _get_matrix_rotation_transformation(int rotation) return transformation; } -int _fetch_X_device_input_number() +int +_fetch_X_device_input_number(void) { // I should get the touchscreen associated with the screen probably by looking at the classes of the input devices // I need to submit my patch to add getters for other XIDeviceInfo fields, like raster mentioned in his commit. @@ -335,7 +345,8 @@ int _fetch_X_device_input_number() return dev_number; } -int _is_device_a_touch_pointer(int dev_counter, int num_properties, char **iterator) +int +_is_device_a_touch_pointer(int dev_counter, int num_properties, char **iterator) { // Looking for a device with either a libinput property for calibration or the old evdev Axlis labels property. int is_correct_device = EINA_FALSE; @@ -360,7 +371,9 @@ int _is_device_a_touch_pointer(int dev_counter, int num_properties, char **itera return is_correct_device; } -void _fetch_and_rotate_screen(const char* randr_id, enum screen_rotation orientation) { +void +_fetch_and_rotate_screen(const char* randr_id, enum screen_rotation orientation) +{ DBG("Working on screen %s", randr_id); E_Randr2_Screen *rotatable_screen = e_randr2_screen_id_find(randr_id); E_Config_Randr2_Screen *screen_randr_cfg = e_randr2_config_screen_find(rotatable_screen, e_randr2_cfg); diff --git a/src/modules/convertible/dbus_acceleration.h b/src/modules/convertible/dbus_acceleration.h index b194ff08d..0276f5e4b 100644 --- a/src/modules/convertible/dbus_acceleration.h +++ b/src/modules/convertible/dbus_acceleration.h @@ -29,12 +29,14 @@ struct _DbusAccelerometer DbusAccelerometer* sensor_proxy_init(); -void sensor_proxy_shutdown(); +void +sensor_proxy_shutdown(void); /** * Helper to get the interface * */ -Eldbus_Proxy *get_dbus_interface(const char *IFACE); +Eldbus_Proxy * +get_dbus_interface(const char *IFACE); /** * Helper function to extract ta string property from the message @@ -100,5 +102,6 @@ on_accelerometer_released(void *data EINA_UNUSED, const Eldbus_Message *msg, Eld * @param randr_id The randr2 id * @param rotation The expected rotation */ -void _fetch_and_rotate_screen(const char* randr_id, enum screen_rotation orientation); +void +_fetch_and_rotate_screen(const char* randr_id, enum screen_rotation orientation); #endif diff --git a/src/modules/convertible/e-gadget-convertible.c b/src/modules/convertible/e-gadget-convertible.c index 8030bc4ca..c2dcd03a4 100644 --- a/src/modules/convertible/e-gadget-convertible.c +++ b/src/modules/convertible/e-gadget-convertible.c @@ -8,7 +8,8 @@ /* LIST OF INSTANCES */ static Eina_List *instances = NULL; -void _update_instances(const Instance *current_instance) +void +_update_instances(const Instance *current_instance) { Eina_List *l; Instance *instance = NULL; @@ -25,7 +26,8 @@ void _update_instances(const Instance *current_instance) } } -void _rotation_signal_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const char *sig EINA_UNUSED, +void +_rotation_signal_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const char *sig EINA_UNUSED, const char *src EINA_UNUSED) { DBG("Rotation: Signal %s received from %s", sig, src); @@ -37,7 +39,8 @@ void _rotation_signal_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, c _update_instances(inst); } -void _keyboard_signal_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const char *sig EINA_UNUSED, +void +_keyboard_signal_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const char *sig EINA_UNUSED, const char *src EINA_UNUSED) { DBG("Keyboard: Signal %s received from %s", sig, src); @@ -56,6 +59,7 @@ _gadget_created(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_ } -void update_instances(Eina_List *new_instances) { +void +update_instances(Eina_List *new_instances) { instances = new_instances; } diff --git a/src/modules/convertible/e-gadget-convertible.h b/src/modules/convertible/e-gadget-convertible.h index e353ccf2f..02f911d7e 100644 --- a/src/modules/convertible/e-gadget-convertible.h +++ b/src/modules/convertible/e-gadget-convertible.h @@ -15,7 +15,8 @@ _rotation_signal_cb(void *data EINA_UNUSED, Evas_Object *obj, const char *sig EI void _keyboard_signal_cb(void *data EINA_UNUSED, Evas_Object *obj, const char *sig EINA_UNUSED, const char *src EINA_UNUSED); -void update_instances(Eina_List *instances); +void +update_instances(Eina_List *instances); /* end gadcon callback for actions */ diff --git a/src/modules/convertible/e_mod_config.c b/src/modules/convertible/e_mod_config.c index 6f529cd49..b93cc9fba 100644 --- a/src/modules/convertible/e_mod_config.c +++ b/src/modules/convertible/e_mod_config.c @@ -139,7 +139,7 @@ e_int_config_convertible_module(Evas_Object *comp, const char *p EINA_UNUSED) } void -econvertible_config_init() +econvertible_config_init(void) { _econvertible_config_dd_new(); _config = e_config_domain_load("module.econvertible", edd); @@ -153,7 +153,7 @@ econvertible_config_init() DBG("Config loaded"); } -void econvertible_config_shutdown() +void econvertible_config_shutdown(void) { E_CONFIG_DD_FREE(edd); E_FREE(convertible_config); diff --git a/src/modules/convertible/e_mod_config.h b/src/modules/convertible/e_mod_config.h index 3226aea3f..7e65bc7ac 100644 --- a/src/modules/convertible/e_mod_config.h +++ b/src/modules/convertible/e_mod_config.h @@ -34,11 +34,16 @@ struct _E_Config_Dialog_Data Evas_Object *inputs; }; -E_Config_Dialog* e_int_config_convertible_module(Evas_Object *comp, const char *p); -void econvertible_config_init(); -void econvertible_config_shutdown(); +E_Config_Dialog* +e_int_config_convertible_module(Evas_Object *comp, const char *p); +void +econvertible_config_init(void); +void +econvertible_config_shutdown(void); //E_Config_Dialog* econvertible_config_init(Evas_Object *comp, const char*p); -void _menu_new(Instance *inst, Evas_Event_Mouse_Down *ev); -void _mouse_down_cb(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event); +void +_menu_new(Instance *inst, Evas_Event_Mouse_Down *ev); +void +_mouse_down_cb(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event); #endif //E_GADGET_CONVERTIBLE_E_MOD_CONFIG_H -- 2.25.1 From 608e2fcebfe8df0085d77a483d8b3402ef64ccb1 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Wed, 2 Aug 2023 21:53:59 +0200 Subject: [PATCH 04/35] Address calloc failure --- src/modules/convertible/dbus_acceleration.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index d7041951e..9d98ff1ce 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -20,6 +20,7 @@ sensor_proxy_init() return accelerometer_dbus; } accelerometer_dbus = calloc(1, sizeof(DbusAccelerometer)); + EINA_SAFETY_ON_NULL_RETURN_VAL(accelerometer_dbus, NULL); // The next line is probably redundant accelerometer_dbus->orientation = undefined; @@ -147,6 +148,7 @@ access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, *result = EINA_FALSE; } const char **string_property_value = calloc(PATH_MAX, sizeof(char)); + EINA_SAFETY_ON_NULL_RETURN_VAL(string_property_value, EINA_FALSE); if (!eldbus_message_iter_arguments_get((*variant), "s", string_property_value)) { WARN("error in eldbus_message_iter_arguments_get()"); @@ -241,6 +243,7 @@ on_accelerometer_orientation(void *data, const Eldbus_Message *msg, Eldbus_Pendi enum screen_rotation orientation; Eldbus_Message_Iter *variant = NULL; Eina_Bool* result = calloc(1, sizeof(Eina_Bool)); + EINA_SAFETY_ON_NULL_RETURN_VAL(result, NULL); if (eldbus_message_error_get(msg, &errname, &errmsg)) { @@ -401,6 +404,7 @@ _fetch_and_rotate_screen(const char* randr_id, enum screen_rotation orientation) Ecore_X_Atom format_ret; char *result = NULL; TransformationMatrix *matrix = calloc(1, sizeof(TransformationMatrix)); + EINA_SAFETY_ON_NULL_RETURN_VAL(matrix, NULL); result = ecore_x_input_device_property_get(x_dev_num, CTM_name, &num_ret, &format_ret, &unit_size_ret); if (result != NULL) { -- 2.25.1 From 3c3a1ac60387a33e34ca41766d5cf89008e53841 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Wed, 2 Aug 2023 21:56:51 +0200 Subject: [PATCH 05/35] Removed dbus initialization --- src/modules/convertible/dbus_acceleration.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index 9d98ff1ce..badee37a3 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -24,14 +24,7 @@ sensor_proxy_init() // The next line is probably redundant accelerometer_dbus->orientation = undefined; - - DBG("Before eldbus initialization"); - int initialization = eldbus_init(); - if (initialization == EXIT_FAILURE) - { - ERR("Unable to initialise ELDBUS"); - } - + INF("Getting dbus interfaces"); accelerometer_dbus->sensor_proxy = get_dbus_interface(EFL_DBUS_ACC_IFACE); accelerometer_dbus->sensor_proxy_properties = get_dbus_interface(ELDBUS_FDO_INTERFACE_PROPERTIES); -- 2.25.1 From d2ccd898f9e854da671401b08264dd266027d9d0 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Wed, 2 Aug 2023 22:23:31 +0200 Subject: [PATCH 06/35] Use strdup --- src/modules/convertible/e_mod_main.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/modules/convertible/e_mod_main.c b/src/modules/convertible/e_mod_main.c index 1d080e8d0..306655a91 100644 --- a/src/modules/convertible/e_mod_main.c +++ b/src/modules/convertible/e_mod_main.c @@ -305,12 +305,8 @@ e_modapi_init(E_Module *m) // Arbitrarily chosen a condition to check that rotation is enabled if (screen->info.can_rot_90 == EINA_TRUE) { - int max_screen_length = 300; - char *randr2_id = malloc(sizeof(char) * max_screen_length); - int copied_chars = eina_strlcpy(randr2_id, zone->randr2_id, max_screen_length); - if (copied_chars > max_screen_length) - ERR("Screen name %s has been truncated. Cannot handle screens.", randr2_id); - if (copied_chars < 0) + char *randr2_id = strdup(zone->randr2_id); + if (randr2_id == NULL) ERR("Can't copy the screen name"); inst->randr2_ids = eina_list_append(inst->randr2_ids, randr2_id); -- 2.25.1 From 479b83eb81ea0debce917149197989d88613f822 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Thu, 3 Aug 2023 11:57:26 +0200 Subject: [PATCH 07/35] Other minor changes --- src/modules/convertible/dbus_acceleration.c | 15 +++++++-------- src/modules/convertible/e_mod_main.c | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index badee37a3..c15ba3933 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -14,7 +14,7 @@ DbusAccelerometer* sensor_proxy_init() { // Initialise DBUS component - if (accelerometer_dbus != NULL) + if (accelerometer_dbus) { INF("We already have a struct filled"); return accelerometer_dbus; @@ -24,7 +24,7 @@ sensor_proxy_init() // The next line is probably redundant accelerometer_dbus->orientation = undefined; - + INF("Getting dbus interfaces"); accelerometer_dbus->sensor_proxy = get_dbus_interface(EFL_DBUS_ACC_IFACE); accelerometer_dbus->sensor_proxy_properties = get_dbus_interface(ELDBUS_FDO_INTERFACE_PROPERTIES); @@ -348,15 +348,14 @@ _is_device_a_touch_pointer(int dev_counter, int num_properties, char **iterator) int is_correct_device = EINA_FALSE; for (int i=0; idir); elm_theme_extension_add(NULL, theme_overlay_path); - econvertible_config_init(NULL); + econvertible_config_init(); // Config DBus DbusAccelerometer *accelerometer = sensor_proxy_init(); @@ -290,7 +290,7 @@ e_modapi_init(E_Module *m) ERR("Error: could not add the signal handler for PropertiesChanged"); // Screen related part - E_Zone *zone = NULL; + E_Zone *zone; // Initialise screen part DBG("Looking for the main screen"); -- 2.25.1 From 4ea8172e51254178ad9a3e039782f525b232b9e4 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Thu, 3 Aug 2023 12:11:54 +0200 Subject: [PATCH 08/35] Correctly defien function with no params --- src/modules/convertible/dbus_acceleration.c | 2 +- src/modules/convertible/dbus_acceleration.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index c15ba3933..20c2f0c40 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -11,7 +11,7 @@ DbusAccelerometer* accelerometer_dbus; DbusAccelerometer* -sensor_proxy_init() +sensor_proxy_init(void) { // Initialise DBUS component if (accelerometer_dbus) diff --git a/src/modules/convertible/dbus_acceleration.h b/src/modules/convertible/dbus_acceleration.h index 0276f5e4b..cd473449f 100644 --- a/src/modules/convertible/dbus_acceleration.h +++ b/src/modules/convertible/dbus_acceleration.h @@ -26,7 +26,7 @@ struct _DbusAccelerometer /** * Fetch the DBUS interfaces and fill the DbusAccelerometer struct * */ -DbusAccelerometer* sensor_proxy_init(); +DbusAccelerometer* sensor_proxy_init(void); void -- 2.25.1 From 43b233348a7918778e597a7aca8c556ac0fe497f Mon Sep 17 00:00:00 2001 From: rafspiny Date: Thu, 3 Aug 2023 12:22:23 +0200 Subject: [PATCH 09/35] Other minor changes --- src/modules/convertible/dbus_acceleration.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index 20c2f0c40..b2ea5a333 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -113,7 +113,7 @@ get_dbus_interface(const char *IFACE) enum screen_rotation access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, Eina_Bool* result) { - const char *type = NULL; + char *type = NULL; *result = EINA_TRUE; if (!eldbus_message_arguments_get(msg, "v", variant)) @@ -158,7 +158,7 @@ access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, if (strcmp(ACCELEROMETER_ORIENTATION_NORMAL, *string_property_value) == 0) rotation = normal; - free((void *) type); + free(type); free(string_property_value); return rotation; } @@ -166,7 +166,7 @@ access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, Eina_Bool access_bool_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, Eina_Bool *boolean_property_value) { - const char *type; + char *type; Eina_Bool res = EINA_TRUE; if (!eldbus_message_arguments_get(msg, "v", variant)) @@ -197,7 +197,7 @@ access_bool_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, E WARN("error in eldbus_message_iter_arguments_get()"); res = EINA_FALSE; } - free((void *) type); + free(type); return res; } @@ -214,7 +214,7 @@ on_has_accelerometer(void *data, const Eldbus_Message *msg, Eldbus_Pending *pend } access_bool_property(msg, &variant, &has_accelerometer); - DbusAccelerometer *accelerometer = (DbusAccelerometer *) data; + DbusAccelerometer *accelerometer = data; accelerometer->has_accelerometer = has_accelerometer; DBG("Has Accelerometer: %d", accelerometer->has_accelerometer); } @@ -266,7 +266,7 @@ on_accelerometer_orientation(void *data, const Eldbus_Message *msg, Eldbus_Pendi { _fetch_and_rotate_screen(randr_id, orientation); } - free((void *)randr_id); + free(randr_id); } } @@ -309,8 +309,8 @@ _fetch_X_device_input_number(void) { // I should get the touchscreen associated with the screen probably by looking at the classes of the input devices // I need to submit my patch to add getters for other XIDeviceInfo fields, like raster mentioned in his commit. - const char *dev_name = NULL; - char **property_name = NULL; + const char *dev_name; + char **property_name; int dev_num = ecore_x_input_device_num_get(); int dev_number = -1; -- 2.25.1 From a139e88811bceb16d45b08be5cf357947d8af5f1 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Thu, 3 Aug 2023 12:27:04 +0200 Subject: [PATCH 10/35] Enum with all caps values. --- src/modules/convertible/accelerometer-orientation.h | 2 +- src/modules/convertible/dbus_acceleration.c | 12 ++++++------ src/modules/convertible/dbus_acceleration.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/modules/convertible/accelerometer-orientation.h b/src/modules/convertible/accelerometer-orientation.h index f1f92d08e..d2bc856c1 100755 --- a/src/modules/convertible/accelerometer-orientation.h +++ b/src/modules/convertible/accelerometer-orientation.h @@ -5,7 +5,7 @@ #ifndef E_GADGET_CONVERTIBLE_IIO_SENSOR_ACCELEROMETER_H #define E_GADGET_CONVERTIBLE_IIO_SENSOR_ACCELEROMETER_H -// Those costants are the possible states for the orientation of the acceleromenter. +// Those costants are the possible states for the orientation of the accelerometer. #define ACCELEROMETER_ORIENTATION_UNDEFINED "undefined" #define ACCELEROMETER_ORIENTATION_NORMAL "normal" diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index b2ea5a333..e2be711a8 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -126,7 +126,7 @@ access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, { WARN("Unable to get the type."); *result = EINA_FALSE; - return undefined; + return UNDEFINED; } type = eldbus_message_iter_signature_get((*variant)); @@ -148,15 +148,15 @@ access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, *result = EINA_FALSE; } - enum screen_rotation rotation = undefined; + enum screen_rotation rotation = UNDEFINED; if (strcmp(ACCELEROMETER_ORIENTATION_RIGHT, *string_property_value) == 0) - rotation = right_up; + rotation = RIGHT_UP; if (strcmp(ACCELEROMETER_ORIENTATION_LEFT, *string_property_value) == 0) - rotation = left_up; + rotation = LEFT_UP; if (strcmp(ACCELEROMETER_ORIENTATION_BOTTOM, *string_property_value) == 0) - rotation = flipped; + rotation = FLIPPED; if (strcmp(ACCELEROMETER_ORIENTATION_NORMAL, *string_property_value) == 0) - rotation = normal; + rotation = NORMAL; free(type); free(string_property_value); diff --git a/src/modules/convertible/dbus_acceleration.h b/src/modules/convertible/dbus_acceleration.h index cd473449f..614bdc7d3 100644 --- a/src/modules/convertible/dbus_acceleration.h +++ b/src/modules/convertible/dbus_acceleration.h @@ -10,7 +10,7 @@ #define EFL_DBUS_ACC_IFACE "net.hadess.SensorProxy" // This enum represents the 4 states of screen rotation plus undefined -enum screen_rotation {undefined, normal, right_up, flipped, left_up}; +enum screen_rotation {UNDEFINED, NORMAL, RIGHT_UP, FLIPPED, LEFT_UP}; typedef struct _DbusAccelerometer DbusAccelerometer; -- 2.25.1 From fc30c75946b5b15226e394b8c40eb702ff56fd59 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Thu, 3 Aug 2023 12:29:00 +0200 Subject: [PATCH 11/35] More readable strcmp in ifs --- src/modules/convertible/dbus_acceleration.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index e2be711a8..660f886d1 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -149,13 +149,13 @@ access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, } enum screen_rotation rotation = UNDEFINED; - if (strcmp(ACCELEROMETER_ORIENTATION_RIGHT, *string_property_value) == 0) + if (!strcmp(ACCELEROMETER_ORIENTATION_RIGHT, *string_property_value)) rotation = RIGHT_UP; - if (strcmp(ACCELEROMETER_ORIENTATION_LEFT, *string_property_value) == 0) + if (!strcmp(ACCELEROMETER_ORIENTATION_LEFT, *string_property_value)) rotation = LEFT_UP; - if (strcmp(ACCELEROMETER_ORIENTATION_BOTTOM, *string_property_value) == 0) + if (!strcmp(ACCELEROMETER_ORIENTATION_BOTTOM, *string_property_value)) rotation = FLIPPED; - if (strcmp(ACCELEROMETER_ORIENTATION_NORMAL, *string_property_value) == 0) + if (!strcmp(ACCELEROMETER_ORIENTATION_NORMAL, *string_property_value)) rotation = NORMAL; free(type); @@ -329,7 +329,7 @@ _fetch_X_device_input_number(void) iterator = property_name; for (int i=0; i Date: Thu, 3 Aug 2023 12:31:01 +0200 Subject: [PATCH 12/35] Syntax sugar in for loops --- src/modules/convertible/dbus_acceleration.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index 660f886d1..0ffbc0441 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -314,7 +314,7 @@ _fetch_X_device_input_number(void) int dev_num = ecore_x_input_device_num_get(); int dev_number = -1; - for (int dev_counter=0; dev_counter Date: Thu, 3 Aug 2023 17:44:23 +0200 Subject: [PATCH 13/35] Functions renaming --- src/modules/convertible/dbus_acceleration.c | 42 ++++++++++++--------- src/modules/convertible/dbus_acceleration.h | 29 -------------- 2 files changed, 25 insertions(+), 46 deletions(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index 0ffbc0441..23318d324 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -110,45 +110,45 @@ get_dbus_interface(const char *IFACE) return sensor_proxy; } +/** + * Helper function to extract ta string property from the message + * @param msg The message coming from the get property invocation + * @param variant + * @return Enum specifying the orientation. UNDEFINED by default + */ enum screen_rotation -access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, Eina_Bool* result) +_access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant) { + enum screen_rotation rotation = UNDEFINED; char *type = NULL; - *result = EINA_TRUE; if (!eldbus_message_arguments_get(msg, "v", variant)) { WARN("Error getting arguments."); - *result = EINA_FALSE; } type = eldbus_message_iter_signature_get((*variant)); if (type == NULL) { WARN("Unable to get the type."); - *result = EINA_FALSE; - return UNDEFINED; + return rotation; } type = eldbus_message_iter_signature_get((*variant)); if (type[1]) { WARN("It is a complex type, not handle yet."); - *result = EINA_FALSE; } if (type[0] != 's') { WARN("Expected type is string(s)."); - *result = EINA_FALSE; } const char **string_property_value = calloc(PATH_MAX, sizeof(char)); EINA_SAFETY_ON_NULL_RETURN_VAL(string_property_value, EINA_FALSE); if (!eldbus_message_iter_arguments_get((*variant), "s", string_property_value)) { WARN("error in eldbus_message_iter_arguments_get()"); - *result = EINA_FALSE; } - enum screen_rotation rotation = UNDEFINED; if (!strcmp(ACCELEROMETER_ORIENTATION_RIGHT, *string_property_value)) rotation = RIGHT_UP; if (!strcmp(ACCELEROMETER_ORIENTATION_LEFT, *string_property_value)) @@ -163,8 +163,15 @@ access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, return rotation; } +/** + * Helper function to extract ta boolean property from the message + * @param msg The message coming from the get property invocation + * @param variant + * @param boolean_property_value The boolean property pointer where the value should be stored, if read + * @return + */ Eina_Bool -access_bool_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, Eina_Bool *boolean_property_value) +_access_bool_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, Eina_Bool *boolean_property_value) { char *type; Eina_Bool res = EINA_TRUE; @@ -213,7 +220,7 @@ on_has_accelerometer(void *data, const Eldbus_Message *msg, Eldbus_Pending *pend ERR("Error: %s %s", errname, errmsg); } - access_bool_property(msg, &variant, &has_accelerometer); + _access_bool_property(msg, &variant, &has_accelerometer); DbusAccelerometer *accelerometer = data; accelerometer->has_accelerometer = has_accelerometer; DBG("Has Accelerometer: %d", accelerometer->has_accelerometer); @@ -235,8 +242,6 @@ on_accelerometer_orientation(void *data, const Eldbus_Message *msg, Eldbus_Pendi const char *errname, *errmsg; enum screen_rotation orientation; Eldbus_Message_Iter *variant = NULL; - Eina_Bool* result = calloc(1, sizeof(Eina_Bool)); - EINA_SAFETY_ON_NULL_RETURN_VAL(result, NULL); if (eldbus_message_error_get(msg, &errname, &errmsg)) { @@ -244,14 +249,12 @@ on_accelerometer_orientation(void *data, const Eldbus_Message *msg, Eldbus_Pendi return; } - orientation = access_string_property(msg, &variant, result); - if (*result == EINA_FALSE) + orientation = _access_string_property(msg, &variant); + if (*orientation == UNDEFINED) { INF("Failed to retrieve the orientation from dbus message"); - free(result); return; } - free(result); inst->accelerometer->orientation = orientation; DBG("Current Orientation: %d", inst->accelerometer->orientation); @@ -366,6 +369,11 @@ _is_device_a_touch_pointer(int dev_counter, int num_properties, char **iterator) return is_correct_device; } +/** + * Fetch a screen from its ID and rotate it according to the rotation parameter + * @param randr_id The randr2 id + * @param rotation The expected rotation + */ void _fetch_and_rotate_screen(const char* randr_id, enum screen_rotation orientation) { diff --git a/src/modules/convertible/dbus_acceleration.h b/src/modules/convertible/dbus_acceleration.h index 614bdc7d3..62c1d72b8 100644 --- a/src/modules/convertible/dbus_acceleration.h +++ b/src/modules/convertible/dbus_acceleration.h @@ -38,26 +38,6 @@ sensor_proxy_shutdown(void); Eldbus_Proxy * get_dbus_interface(const char *IFACE); -/** - * Helper function to extract ta string property from the message - * @param msg The message coming from the get property invocation - * @param variant - * @param result 1 if result is ok, 0 if it failed - * @return Enum specifying the orientation - */ -enum screen_rotation -access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, Eina_Bool* result); - -/** - * Helper function to extract ta boolean property from the message - * @param msg The message coming from the get property invocation - * @param variant - * @param boolean_property_value The boolean property pointer where the value should be stored, if read - * @return - */ -Eina_Bool -access_bool_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, Eina_Bool *boolean_property_value); - /** * Callback definition to handle the request of the hasAccelerometer property of DBUS interface net.hadess.SensorProxy * @param data DbusAccelerometer @@ -95,13 +75,4 @@ on_accelerometer_claimed(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldb */ void on_accelerometer_released(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED); - - -/** - * Fetch a screen from its ID and rotate it according to the rotation parameter - * @param randr_id The randr2 id - * @param rotation The expected rotation - */ -void -_fetch_and_rotate_screen(const char* randr_id, enum screen_rotation orientation); #endif -- 2.25.1 From fbfd52f679af59f7e4a403fddff5dfae0ee9c064 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Thu, 3 Aug 2023 17:59:43 +0200 Subject: [PATCH 14/35] Forgot to update reference to renamed enum values --- src/modules/convertible/dbus_acceleration.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index 23318d324..62232aa62 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -264,12 +264,11 @@ on_accelerometer_orientation(void *data, const Eldbus_Message *msg, Eldbus_Pendi else { Eina_List *l; - const char *randr_id = NULL; + char *randr_id = NULL; EINA_LIST_FOREACH(inst->randr2_ids, l, randr_id) { _fetch_and_rotate_screen(randr_id, orientation); } - free(randr_id); } } @@ -278,10 +277,10 @@ _convertible_rotation_get(const enum screen_rotation orientation) { switch (orientation) { - case normal: return 0; - case left_up: return 90; - case flipped: return 180; - case right_up: return 270; + case NORMAL: return 0; + case LEFT_UP: return 90; + case FLIPPED: return 180; + case RIGHT_UP: return 270; default: return 0; } -- 2.25.1 From 5b042e08e23880e75c4f1257193c60caa67a0364 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Thu, 3 Aug 2023 21:56:29 +0200 Subject: [PATCH 15/35] Forgot to update reference to renamed enum values --- src/modules/convertible/dbus_acceleration.c | 2 +- src/modules/convertible/dbus_acceleration.h | 2 +- src/modules/convertible/e-gadget-convertible.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index 62232aa62..98d671a62 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -23,7 +23,7 @@ sensor_proxy_init(void) EINA_SAFETY_ON_NULL_RETURN_VAL(accelerometer_dbus, NULL); // The next line is probably redundant - accelerometer_dbus->orientation = undefined; + accelerometer_dbus->orientation = UNDEFINED; INF("Getting dbus interfaces"); accelerometer_dbus->sensor_proxy = get_dbus_interface(EFL_DBUS_ACC_IFACE); diff --git a/src/modules/convertible/dbus_acceleration.h b/src/modules/convertible/dbus_acceleration.h index 62c1d72b8..db2fe5a18 100644 --- a/src/modules/convertible/dbus_acceleration.h +++ b/src/modules/convertible/dbus_acceleration.h @@ -9,7 +9,7 @@ #define EFL_DBUS_ACC_PATH "/net/hadess/SensorProxy" #define EFL_DBUS_ACC_IFACE "net.hadess.SensorProxy" -// This enum represents the 4 states of screen rotation plus undefined +// This enum represents the 4 states of screen rotation plus UNDEFINED enum screen_rotation {UNDEFINED, NORMAL, RIGHT_UP, FLIPPED, LEFT_UP}; typedef struct _DbusAccelerometer DbusAccelerometer; diff --git a/src/modules/convertible/e-gadget-convertible.c b/src/modules/convertible/e-gadget-convertible.c index c2dcd03a4..03e5f4572 100644 --- a/src/modules/convertible/e-gadget-convertible.c +++ b/src/modules/convertible/e-gadget-convertible.c @@ -8,7 +8,7 @@ /* LIST OF INSTANCES */ static Eina_List *instances = NULL; -void +static void _update_instances(const Instance *current_instance) { Eina_List *l; -- 2.25.1 From d60a6fd16b2fc0bab442e30bd30672175d6454c9 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Thu, 3 Aug 2023 22:11:06 +0200 Subject: [PATCH 16/35] Forgot to update reference to renamed enum values --- src/modules/convertible/dbus_acceleration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index 98d671a62..3325d50af 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -250,7 +250,7 @@ on_accelerometer_orientation(void *data, const Eldbus_Message *msg, Eldbus_Pendi } orientation = _access_string_property(msg, &variant); - if (*orientation == UNDEFINED) + if (orientation == UNDEFINED) { INF("Failed to retrieve the orientation from dbus message"); return; -- 2.25.1 From 5e7fa42b8c418d6c46b9518e9444ab1d31d7e7e2 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Thu, 10 Aug 2023 11:37:27 +0200 Subject: [PATCH 17/35] Make some functions static --- src/modules/convertible/dbus_acceleration.c | 34 +++++++++++++++++--- src/modules/convertible/dbus_acceleration.h | 35 --------------------- src/modules/convertible/e_mod_config.h | 5 --- 3 files changed, 29 insertions(+), 45 deletions(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index 3325d50af..2a33c25c1 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -8,7 +8,7 @@ #include "e_mod_main.h" #include "input_rotation.h" -DbusAccelerometer* accelerometer_dbus; +static DbusAccelerometer* accelerometer_dbus; DbusAccelerometer* sensor_proxy_init(void) @@ -80,7 +80,10 @@ _convertible_rotation_get(const enum screen_rotation orientation); int _is_device_a_touch_pointer(int dev_counter, int num_properties, char **iterator); -Eldbus_Proxy * +/** + * Helper to get the interface + * */ +statis Eldbus_Proxy * get_dbus_interface(const char *IFACE) { DBG("Working on interface: %s", IFACE); @@ -208,7 +211,13 @@ _access_bool_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, return res; } -void +/** + * Callback definition to handle the request of the hasAccelerometer property of DBUS interface net.hadess.SensorProxy + * @param data DbusAccelerometer + * @param msg The message + * @param pending + */ +static void on_has_accelerometer(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) { const char *errname, *errmsg; @@ -425,7 +434,14 @@ _fetch_and_rotate_screen(const char* randr_id, enum screen_rotation orientation) } } -void +/** + * Callback definition to handle the execution of the ClaimAccelerometer() method of DBUS + * interface net.hadess.SensorProxy + * @param data not used + * @param msg The message + * @param pending + */ + static void on_accelerometer_claimed(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) { const char *errname, *errmsg; @@ -439,7 +455,15 @@ on_accelerometer_claimed(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldb INF("Accelerometer claimed"); } -void + +/** + * Callback definition to handle the execution of the ReleaseAccelerometer() method of DBUS + * interface net.hadess.SensorProxy + * @param data not used + * @param msg The message + * @param pending + */ +static void on_accelerometer_released(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) { const char *errname, *errmsg; diff --git a/src/modules/convertible/dbus_acceleration.h b/src/modules/convertible/dbus_acceleration.h index db2fe5a18..2724c1914 100644 --- a/src/modules/convertible/dbus_acceleration.h +++ b/src/modules/convertible/dbus_acceleration.h @@ -32,21 +32,6 @@ DbusAccelerometer* sensor_proxy_init(void); void sensor_proxy_shutdown(void); -/** - * Helper to get the interface - * */ -Eldbus_Proxy * -get_dbus_interface(const char *IFACE); - -/** - * Callback definition to handle the request of the hasAccelerometer property of DBUS interface net.hadess.SensorProxy - * @param data DbusAccelerometer - * @param msg The message - * @param pending - */ -void -on_has_accelerometer(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED); - /** * Callback definition to handle the request of the accelerometer property of DBUS interface net.hadess.SensorProxy * @param data DbusAccelerometer @@ -55,24 +40,4 @@ on_has_accelerometer(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_P */ void on_accelerometer_orientation(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED); - -/** - * Callback definition to handle the execution of the ClaimAccelerometer() method of DBUS - * interface net.hadess.SensorProxy - * @param data not used - * @param msg The message - * @param pending - */ -void -on_accelerometer_claimed(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED); - -/** - * Callback definition to handle the execution of the ReleaseAccelerometer() method of DBUS - * interface net.hadess.SensorProxy - * @param data not used - * @param msg The message - * @param pending - */ -void -on_accelerometer_released(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED); #endif diff --git a/src/modules/convertible/e_mod_config.h b/src/modules/convertible/e_mod_config.h index 7e65bc7ac..ebd8d937a 100644 --- a/src/modules/convertible/e_mod_config.h +++ b/src/modules/convertible/e_mod_config.h @@ -40,10 +40,5 @@ void econvertible_config_init(void); void econvertible_config_shutdown(void); -//E_Config_Dialog* econvertible_config_init(Evas_Object *comp, const char*p); -void -_menu_new(Instance *inst, Evas_Event_Mouse_Down *ev); -void -_mouse_down_cb(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event); #endif //E_GADGET_CONVERTIBLE_E_MOD_CONFIG_H -- 2.25.1 From ffd51d8fca3d7cd0c61f10d9b942d286d5bd5fb1 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Thu, 10 Aug 2023 12:45:35 +0200 Subject: [PATCH 18/35] WIP --- src/modules/convertible/dbus_acceleration.c | 50 +++++++++++---------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index 2a33c25c1..4fd0a2c27 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -10,6 +10,32 @@ static DbusAccelerometer* accelerometer_dbus; + +/** + * Callback definition to handle the request of the hasAccelerometer property of DBUS interface net.hadess.SensorProxy + * @param data DbusAccelerometer + * @param msg The message + * @param pending + */ +static void +on_has_accelerometer(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) +{ + const char *errname, *errmsg; + Eina_Bool has_accelerometer = EINA_FALSE; + Eldbus_Message_Iter *variant = NULL; + + if (eldbus_message_error_get(msg, &errname, &errmsg)) + { + ERR("Error: %s %s", errname, errmsg); + } + + _access_bool_property(msg, &variant, &has_accelerometer); + DbusAccelerometer *accelerometer = data; + accelerometer->has_accelerometer = has_accelerometer; + DBG("Has Accelerometer: %d", accelerometer->has_accelerometer); +} + + DbusAccelerometer* sensor_proxy_init(void) { @@ -211,30 +237,6 @@ _access_bool_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, return res; } -/** - * Callback definition to handle the request of the hasAccelerometer property of DBUS interface net.hadess.SensorProxy - * @param data DbusAccelerometer - * @param msg The message - * @param pending - */ -static void -on_has_accelerometer(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) -{ - const char *errname, *errmsg; - Eina_Bool has_accelerometer = EINA_FALSE; - Eldbus_Message_Iter *variant = NULL; - - if (eldbus_message_error_get(msg, &errname, &errmsg)) - { - ERR("Error: %s %s", errname, errmsg); - } - - _access_bool_property(msg, &variant, &has_accelerometer); - DbusAccelerometer *accelerometer = data; - accelerometer->has_accelerometer = has_accelerometer; - DBG("Has Accelerometer: %d", accelerometer->has_accelerometer); -} - void on_accelerometer_orientation(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) { -- 2.25.1 From b12978c7c96aff8ca531cd66ea7c9d63d3e3597f Mon Sep 17 00:00:00 2001 From: rafspiny Date: Sat, 19 Aug 2023 19:38:10 +0200 Subject: [PATCH 19/35] Prefix local static functions with underscore. --- src/modules/convertible/dbus_acceleration.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index 4fd0a2c27..3a75a742e 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -18,7 +18,7 @@ static DbusAccelerometer* accelerometer_dbus; * @param pending */ static void -on_has_accelerometer(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) +_on_has_accelerometer(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) { const char *errname, *errmsg; Eina_Bool has_accelerometer = EINA_FALSE; @@ -61,7 +61,7 @@ sensor_proxy_init(void) } accelerometer_dbus->pending_has_orientation = eldbus_proxy_property_get(accelerometer_dbus->sensor_proxy, - "HasAccelerometer", on_has_accelerometer, + "HasAccelerometer", _on_has_accelerometer, accelerometer_dbus); if (!accelerometer_dbus->pending_has_orientation) { @@ -70,7 +70,7 @@ sensor_proxy_init(void) // Claim the accelerometer_dbus accelerometer_dbus->pending_acc_claim = eldbus_proxy_call(accelerometer_dbus->sensor_proxy, "ClaimAccelerometer", - on_accelerometer_claimed, accelerometer_dbus, -1, ""); + _on_accelerometer_claimed, accelerometer_dbus, -1, ""); if (!accelerometer_dbus->pending_acc_claim) { @@ -444,7 +444,7 @@ _fetch_and_rotate_screen(const char* randr_id, enum screen_rotation orientation) * @param pending */ static void -on_accelerometer_claimed(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) +_on_accelerometer_claimed(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) { const char *errname, *errmsg; -- 2.25.1 From 1f36cc158bf30383dc1ca56df65c074b8dcb24ee Mon Sep 17 00:00:00 2001 From: rafspiny Date: Sat, 19 Aug 2023 19:46:50 +0200 Subject: [PATCH 20/35] Prefix local static functions with underscore. --- src/modules/convertible/dbus_acceleration.c | 88 ++++++++++----------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index 3a75a742e..9db1de15a 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -11,6 +11,49 @@ static DbusAccelerometer* accelerometer_dbus; +/** + * Callback definition to handle the execution of the ReleaseAccelerometer() method of DBUS + * interface net.hadess.SensorProxy + * @param data not used + * @param msg The message + * @param pending + */ +static void +_on_accelerometer_released(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) +{ + const char *errname, *errmsg; + + INF("Going to release the accelerometer_dbus"); + if (eldbus_message_error_get(msg, &errname, &errmsg)) + { + ERR("Error: %s %s", errname, errmsg); + return; + } + INF("Accelerometer released"); +} + + +/** + * Callback definition to handle the execution of the ClaimAccelerometer() method of DBUS + * interface net.hadess.SensorProxy + * @param data not used + * @param msg The message + * @param pending + */ +static void +_on_accelerometer_claimed(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) +{ + const char *errname, *errmsg; + + INF("Going to claim the accelerometer_dbus"); + if (eldbus_message_error_get(msg, &errname, &errmsg)) + { + ERR("Error: %s %s", errname, errmsg); + return; + } + INF("Accelerometer claimed"); +} + /** * Callback definition to handle the request of the hasAccelerometer property of DBUS interface net.hadess.SensorProxy * @param data DbusAccelerometer @@ -88,7 +131,7 @@ sensor_proxy_shutdown(void) // TODO Should to this and wait for the release before continuing INF("Freeing convertible resources"); - accelerometer_dbus->pending_acc_crelease = eldbus_proxy_call(accelerometer_dbus->sensor_proxy, "ReleaseAccelerometer", on_accelerometer_released, accelerometer_dbus, -1, ""); + accelerometer_dbus->pending_acc_crelease = eldbus_proxy_call(accelerometer_dbus->sensor_proxy, "ReleaseAccelerometer", _on_accelerometer_released, accelerometer_dbus, -1, ""); if (accelerometer_dbus) { e_object_del(E_OBJECT(accelerometer_dbus)); @@ -435,46 +478,3 @@ _fetch_and_rotate_screen(const char* randr_id, enum screen_rotation orientation) free(matrix); } } - -/** - * Callback definition to handle the execution of the ClaimAccelerometer() method of DBUS - * interface net.hadess.SensorProxy - * @param data not used - * @param msg The message - * @param pending - */ - static void -_on_accelerometer_claimed(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) -{ - const char *errname, *errmsg; - - INF("Going to claim the accelerometer_dbus"); - if (eldbus_message_error_get(msg, &errname, &errmsg)) - { - ERR("Error: %s %s", errname, errmsg); - return; - } - INF("Accelerometer claimed"); -} - - -/** - * Callback definition to handle the execution of the ReleaseAccelerometer() method of DBUS - * interface net.hadess.SensorProxy - * @param data not used - * @param msg The message - * @param pending - */ -static void -on_accelerometer_released(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) -{ - const char *errname, *errmsg; - - INF("Going to release the accelerometer_dbus"); - if (eldbus_message_error_get(msg, &errname, &errmsg)) - { - ERR("Error: %s %s", errname, errmsg); - return; - } - INF("Accelerometer released"); -} -- 2.25.1 From 6939a34c1d8cbc362531b73b72b85957b192ded0 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Sat, 19 Aug 2023 19:53:58 +0200 Subject: [PATCH 21/35] Prefix local functions static. --- src/modules/convertible/dbus_acceleration.c | 92 ++++++++++----------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index 9db1de15a..e5fc6f602 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -11,6 +11,51 @@ static DbusAccelerometer* accelerometer_dbus; +/** + * Helper function to extract ta boolean property from the message + * @param msg The message coming from the get property invocation + * @param variant + * @param boolean_property_value The boolean property pointer where the value should be stored, if read + * @return + */ +static Eina_Bool +_access_bool_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, Eina_Bool *boolean_property_value) +{ + char *type; + Eina_Bool res = EINA_TRUE; + + if (!eldbus_message_arguments_get(msg, "v", variant)) + { + WARN("Error getting arguments."); + res = EINA_FALSE; + } + type = eldbus_message_iter_signature_get((*variant)); + if (type == NULL) + { + WARN("Unable to get the type."); + res = EINA_FALSE; + return res; + } + + if (type[1]) + { + WARN("It is a complex type, not handle yet."); + res = EINA_FALSE; + } + if (type[0] != 'b') + { + WARN("Expected type is int."); + res = EINA_FALSE; + } + if (!eldbus_message_iter_arguments_get((*variant), "b", boolean_property_value)) + { + WARN("error in eldbus_message_iter_arguments_get()"); + res = EINA_FALSE; + } + free(type); + return res; +} + /** * Callback definition to handle the execution of the ReleaseAccelerometer() method of DBUS * interface net.hadess.SensorProxy @@ -152,7 +197,7 @@ _is_device_a_touch_pointer(int dev_counter, int num_properties, char **iterator) /** * Helper to get the interface * */ -statis Eldbus_Proxy * +static Eldbus_Proxy * get_dbus_interface(const char *IFACE) { DBG("Working on interface: %s", IFACE); @@ -235,51 +280,6 @@ _access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant return rotation; } -/** - * Helper function to extract ta boolean property from the message - * @param msg The message coming from the get property invocation - * @param variant - * @param boolean_property_value The boolean property pointer where the value should be stored, if read - * @return - */ -Eina_Bool -_access_bool_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, Eina_Bool *boolean_property_value) -{ - char *type; - Eina_Bool res = EINA_TRUE; - - if (!eldbus_message_arguments_get(msg, "v", variant)) - { - WARN("Error getting arguments."); - res = EINA_FALSE; - } - type = eldbus_message_iter_signature_get((*variant)); - if (type == NULL) - { - WARN("Unable to get the type."); - res = EINA_FALSE; - return res; - } - - if (type[1]) - { - WARN("It is a complex type, not handle yet."); - res = EINA_FALSE; - } - if (type[0] != 'b') - { - WARN("Expected type is int."); - res = EINA_FALSE; - } - if (!eldbus_message_iter_arguments_get((*variant), "b", boolean_property_value)) - { - WARN("error in eldbus_message_iter_arguments_get()"); - res = EINA_FALSE; - } - free(type); - return res; -} - void on_accelerometer_orientation(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) { -- 2.25.1 From 5992d94c85f8e07869487c4671395168b6526870 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Sat, 19 Aug 2023 20:10:26 +0200 Subject: [PATCH 22/35] Silly me. Order! --- src/modules/convertible/dbus_acceleration.c | 66 ++++++++++----------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index e5fc6f602..4d41d0d04 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -11,6 +11,39 @@ static DbusAccelerometer* accelerometer_dbus; +/** + * Helper to get the interface + * */ +static Eldbus_Proxy * +get_dbus_interface(const char *IFACE) +{ + DBG("Working on interface: %s", IFACE); + Eldbus_Connection *conn; + Eldbus_Object *obj; + Eldbus_Proxy *sensor_proxy; + + conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM); + if (!conn) + { + ERR("Error: could not get system bus"); + return NULL; + } + obj = eldbus_object_get(conn, EFL_DBUS_ACC_BUS, EFL_DBUS_ACC_PATH); + if (!obj) + { + ERR("Error: could not get object"); + return NULL; + } + sensor_proxy = eldbus_proxy_get(obj, IFACE); + if (!sensor_proxy) + { + ERR("Error: could not get proxy for interface %s", IFACE); + return NULL; + } + + return sensor_proxy; +} + /** * Helper function to extract ta boolean property from the message * @param msg The message coming from the get property invocation @@ -194,39 +227,6 @@ _convertible_rotation_get(const enum screen_rotation orientation); int _is_device_a_touch_pointer(int dev_counter, int num_properties, char **iterator); -/** - * Helper to get the interface - * */ -static Eldbus_Proxy * -get_dbus_interface(const char *IFACE) -{ - DBG("Working on interface: %s", IFACE); - Eldbus_Connection *conn; - Eldbus_Object *obj; - Eldbus_Proxy *sensor_proxy; - - conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM); - if (!conn) - { - ERR("Error: could not get system bus"); - return NULL; - } - obj = eldbus_object_get(conn, EFL_DBUS_ACC_BUS, EFL_DBUS_ACC_PATH); - if (!obj) - { - ERR("Error: could not get object"); - return NULL; - } - sensor_proxy = eldbus_proxy_get(obj, IFACE); - if (!sensor_proxy) - { - ERR("Error: could not get proxy for interface %s", IFACE); - return NULL; - } - - return sensor_proxy; -} - /** * Helper function to extract ta string property from the message * @param msg The message coming from the get property invocation -- 2.25.1 From 8c184e7ef0bdcebe4b775577d590a3837b0c1248 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Sat, 19 Aug 2023 20:28:51 +0200 Subject: [PATCH 23/35] Address shadowing warnings --- src/modules/convertible/dbus_acceleration.c | 313 +++++++++--------- .../convertible/e-gadget-convertible.c | 13 - src/modules/convertible/e_mod_main.c | 17 +- 3 files changed, 166 insertions(+), 177 deletions(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index 4d41d0d04..2be8ea95f 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -11,6 +11,164 @@ static DbusAccelerometer* accelerometer_dbus; +static int +_convertible_rotation_get(const enum screen_rotation orientation) +{ + switch (orientation) + { + case NORMAL: return 0; + case LEFT_UP: return 90; + case FLIPPED: return 180; + case RIGHT_UP: return 270; + + default: return 0; + } +} + +static const float * +_get_matrix_rotation_transformation(int rotation) +{ + const float *transformation; + switch (rotation) { + case 90: + transformation = MATRIX_ROTATION_90; + break; + case 180: + transformation = MATRIX_ROTATION_180; + break; + case 270: + transformation = MATRIX_ROTATION_270; + break; + default: + transformation = MATRIX_ROTATION_IDENTITY; + } + return transformation; +} + + +static int +_is_device_a_touch_pointer(int dev_counter, int num_properties, char **iterator) +{ + // Looking for a device with either a libinput property for calibration or the old evdev Axlis labels property. + int is_correct_device = EINA_FALSE; + for (int i = 0; i < num_properties; i++) + { + if (strstr(*iterator, "libinput Calibration Matrix")) + is_correct_device = EINA_TRUE; + if (strstr(*iterator, "Axis Labels")) + { + int num_ret, unit_size_ret; + Ecore_X_Atom format_ret; + char *result = ecore_x_input_device_property_get(dev_counter, *iterator, &num_ret, &format_ret, &unit_size_ret); + if (result) { + // TODO Shall check for the value "Abs MT Position" + } + DBG("Looks like I found a device with calibration capabilities"); + is_correct_device = EINA_TRUE; + } + iterator++; + } + return is_correct_device; +} + + +static int +_fetch_X_device_input_number(void) +{ + // I should get the touchscreen associated with the screen probably by looking at the classes of the input devices + // I need to submit my patch to add getters for other XIDeviceInfo fields, like raster mentioned in his commit. + const char *dev_name; + char **property_name; + int dev_num = ecore_x_input_device_num_get(); + int dev_number = -1; + + for (int dev_counter = 0; dev_counter < dev_num; dev_counter++) + { + dev_name = ecore_x_input_device_name_get(dev_counter); + // Less horrible hack that relies on the presence of a property containing the work Calibration + DBG("Found device with name %s", dev_name); + int num_properties; + property_name = ecore_x_input_device_properties_list(dev_counter, &num_properties); + DBG("Found %d properties", num_properties); + char **iterator = property_name; + int is_correct_device = _is_device_a_touch_pointer(dev_counter, num_properties, iterator); + if (is_correct_device == EINA_FALSE) + continue; + iterator = property_name; + for (int i = 0; i < num_properties; i++) + { + if (!strcmp(*iterator, CTM_name)) + { + dev_number = dev_counter; + DBG("Setting device: %d", dev_number); + } + iterator++; + } + } + + return dev_number; +} + + +/** + * Fetch a screen from its ID and rotate it according to the rotation parameter + * @param randr_id The randr2 id + * @param rotation The expected rotation + */ +static void +_fetch_and_rotate_screen(const char* randr_id, enum screen_rotation orientation) +{ + DBG("Working on screen %s", randr_id); + E_Randr2_Screen *rotatable_screen = e_randr2_screen_id_find(randr_id); + E_Config_Randr2_Screen *screen_randr_cfg = e_randr2_config_screen_find(rotatable_screen, e_randr2_cfg); + int rotation = _convertible_rotation_get(orientation); + DBG("Screen %s is going to be rotated to %d", randr_id, rotation); + + if (rotation == screen_randr_cfg->rotation) + { + WARN("Screen %s is already rotated to %d degrees", randr_id, rotation); + } else { + screen_randr_cfg->rotation = rotation; + e_randr2_config_apply(); + DBG("Screen %s rotated to %d", randr_id, rotation); + + int x_dev_num = _fetch_X_device_input_number(); + if (x_dev_num == -1) { + ERR("Unable to find a pointer device with coordinate transformation capabilities"); + return; + } + DBG("Rotating input number %d", x_dev_num); + + int num_ret, unit_size_ret; + Ecore_X_Atom format_ret; + char *result = NULL; + TransformationMatrix *matrix = calloc(1, sizeof(TransformationMatrix)); + if (matrix == NULL) + { + ERR("Unable to allocate memory for the transformation matrix"); + return; + } + + result = ecore_x_input_device_property_get(x_dev_num, CTM_name, &num_ret, &format_ret, &unit_size_ret); + if (result) + { + DBG("Device with coordinates transformation matrix"); + // format_ret of 116 -> ECORE_X_ATOM_FLOAT + // num_ret of 9 -> 9 (float) to read + // unit_size_ret of 32 -> each float is 32 bits + memcpy(matrix->values, result, sizeof(matrix->values)); + const float * rotation_matrix_2d = _get_matrix_rotation_transformation(rotation); + memcpy(matrix->values, rotation_matrix_2d, 6 * sizeof(*rotation_matrix_2d)); + ecore_x_input_device_property_set(x_dev_num, CTM_name, matrix->values, num_ret, format_ret, unit_size_ret); + + DBG("Input device %d rotated to %d", x_dev_num, rotation); + } else { + ERR("Unable to fetch coordinates transformation matrix for device %d", x_dev_num); + } + free(matrix); + } +} + /** * Helper to get the interface * */ @@ -224,9 +382,6 @@ sensor_proxy_shutdown(void) int _convertible_rotation_get(const enum screen_rotation orientation); -int -_is_device_a_touch_pointer(int dev_counter, int num_properties, char **iterator); - /** * Helper function to extract ta string property from the message * @param msg The message coming from the get property invocation @@ -326,155 +481,3 @@ on_accelerometer_orientation(void *data, const Eldbus_Message *msg, Eldbus_Pendi } } -int -_convertible_rotation_get(const enum screen_rotation orientation) -{ - switch (orientation) - { - case NORMAL: return 0; - case LEFT_UP: return 90; - case FLIPPED: return 180; - case RIGHT_UP: return 270; - - default: return 0; - } -} - -const float * -_get_matrix_rotation_transformation(int rotation) -{ - const float *transformation; - switch (rotation) { - case 90: - transformation = MATRIX_ROTATION_90; - break; - case 180: - transformation = MATRIX_ROTATION_180; - break; - case 270: - transformation = MATRIX_ROTATION_270; - break; - default: - transformation = MATRIX_ROTATION_IDENTITY; - } - return transformation; -} - -int -_fetch_X_device_input_number(void) -{ - // I should get the touchscreen associated with the screen probably by looking at the classes of the input devices - // I need to submit my patch to add getters for other XIDeviceInfo fields, like raster mentioned in his commit. - const char *dev_name; - char **property_name; - int dev_num = ecore_x_input_device_num_get(); - int dev_number = -1; - - for (int dev_counter = 0; dev_counter < dev_num; dev_counter++) - { - dev_name = ecore_x_input_device_name_get(dev_counter); - // Less horrible hack that relies on the presence of a property containing the work Calibration - DBG("Found device with name %s", dev_name); - int num_properties; - property_name = ecore_x_input_device_properties_list(dev_counter, &num_properties); - DBG("Found %d properties", num_properties); - char **iterator = property_name; - int is_correct_device = _is_device_a_touch_pointer(dev_counter, num_properties, iterator); - if (is_correct_device == EINA_FALSE) - continue; - iterator = property_name; - for (int i = 0; i < num_properties; i++) - { - if (!strcmp(*iterator, CTM_name)) - { - dev_number = dev_counter; - DBG("Setting device: %d", dev_number); - } - iterator++; - } - } - - return dev_number; -} - -int -_is_device_a_touch_pointer(int dev_counter, int num_properties, char **iterator) -{ - // Looking for a device with either a libinput property for calibration or the old evdev Axlis labels property. - int is_correct_device = EINA_FALSE; - for (int i = 0; i < num_properties; i++) - { - if (strstr(*iterator, "libinput Calibration Matrix")) - is_correct_device = EINA_TRUE; - if (strstr(*iterator, "Axis Labels")) - { - int num_ret, unit_size_ret; - Ecore_X_Atom format_ret; - char *result = ecore_x_input_device_property_get(dev_counter, *iterator, &num_ret, &format_ret, &unit_size_ret); - if (result) { - // TODO Shall check for the value "Abs MT Position" - } - DBG("Looks like I found a device with calibration capabilities"); - is_correct_device = EINA_TRUE; - } - iterator++; - } - return is_correct_device; -} - -/** - * Fetch a screen from its ID and rotate it according to the rotation parameter - * @param randr_id The randr2 id - * @param rotation The expected rotation - */ -void -_fetch_and_rotate_screen(const char* randr_id, enum screen_rotation orientation) -{ - DBG("Working on screen %s", randr_id); - E_Randr2_Screen *rotatable_screen = e_randr2_screen_id_find(randr_id); - E_Config_Randr2_Screen *screen_randr_cfg = e_randr2_config_screen_find(rotatable_screen, e_randr2_cfg); - int rotation = _convertible_rotation_get(orientation); - DBG("Screen %s is going to be rotated to %d", randr_id, rotation); - - if (rotation == screen_randr_cfg->rotation) - { - WARN("Screen %s is already rotated to %d degrees", randr_id, rotation); - } else - { - screen_randr_cfg->rotation = rotation; - e_randr2_config_apply(); - DBG("Screen %s rotated to %d", randr_id, rotation); - - int x_dev_num = _fetch_X_device_input_number(); - if (x_dev_num == -1) - { - ERR("Unable to find a pointer device with coordinate transformation capabilities"); - return; - } - DBG("Rotating input number %d", x_dev_num); - - int num_ret, unit_size_ret; - Ecore_X_Atom format_ret; - char *result = NULL; - TransformationMatrix *matrix = calloc(1, sizeof(TransformationMatrix)); - EINA_SAFETY_ON_NULL_RETURN_VAL(matrix, NULL); - result = ecore_x_input_device_property_get(x_dev_num, CTM_name, &num_ret, &format_ret, &unit_size_ret); - if (result) - { - - DBG("Device with coordinates transformation matrix"); - // format_ret of 116 -> ECORE_X_ATOM_FLOAT - // num_ret of 9 -> 9 (float) to read - // unit_size_ret of 32 -> each float is 32 bits - memcpy(matrix->values, result, sizeof(matrix->values)); - const float * rotation_matrix_2d = _get_matrix_rotation_transformation(rotation); - memcpy(matrix->values, rotation_matrix_2d, 6 * sizeof(*rotation_matrix_2d)); - ecore_x_input_device_property_set(x_dev_num, CTM_name, matrix->values, num_ret, format_ret, unit_size_ret); - - DBG("Input device %d rotated to %d", x_dev_num, rotation); - } else { - ERR("Unable to fetch coordinates transformation matrix for device %d", x_dev_num); - } - free(matrix); - } -} diff --git a/src/modules/convertible/e-gadget-convertible.c b/src/modules/convertible/e-gadget-convertible.c index 03e5f4572..051809d19 100644 --- a/src/modules/convertible/e-gadget-convertible.c +++ b/src/modules/convertible/e-gadget-convertible.c @@ -46,19 +46,6 @@ _keyboard_signal_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const DBG("Keyboard: Signal %s received from %s", sig, src); } - -/** - * Callback for gadget creation - * */ -static void -_gadget_created(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) -{ - DBG("Inside gadget created"); - // do_orient(inst, e_gadget_site_orient_get(obj), e_gadget_site_anchor_get(obj)); - evas_object_smart_callback_del_full(obj, "gadget_created", _gadget_created, NULL); -} - - void update_instances(Eina_List *new_instances) { instances = new_instances; diff --git a/src/modules/convertible/e_mod_main.c b/src/modules/convertible/e_mod_main.c index 892a7b3eb..5e69941e4 100644 --- a/src/modules/convertible/e_mod_main.c +++ b/src/modules/convertible/e_mod_main.c @@ -119,12 +119,11 @@ _gc_shutdown(E_Gadcon_Client *gcc) static void _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient) { - Instance *inst; Evas_Coord mw, mh; char buf[4096]; const char *s = "float"; - inst = gcc->data; + Instance *instance = gcc->data; switch (orient) { case E_GADCON_ORIENT_FLOAT: @@ -191,13 +190,13 @@ _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient) break; } snprintf(buf, sizeof(buf), "e,state,orientation,%s", s); - edje_object_signal_emit(inst->o_button, buf, "e"); - edje_object_message_signal_process(inst->o_button); + edje_object_signal_emit(instance->o_button, buf, "e"); + edje_object_message_signal_process(instance->o_button); mw = 0, mh = 0; - edje_object_size_min_get(inst->o_button, &mw, &mh); + edje_object_size_min_get(instance->o_button, &mw, &mh); if ((mw < 1) || (mh < 1)) - edje_object_size_min_calc(inst->o_button, &mw, &mh); + edje_object_size_min_calc(instance->o_button, &mw, &mh); if (mw < 4) mw = 4; if (mh < 4) mh = 4; e_gadcon_client_aspect_set(gcc, mw, mh); @@ -239,16 +238,16 @@ _gc_id_new(const E_Gadcon_Client_Class *client_class EINA_UNUSED) static void _cb_properties_changed(void *data, const Eldbus_Message *msg) { - Instance *inst = (Instance *) data; + Instance *instance = (Instance *) data; Eldbus_Message_Iter *array, *invalidate; char *iface; if (!eldbus_message_arguments_get(msg, "sa{sv}as", &iface, &array, &invalidate)) ERR("Error getting data from properties changed signal."); // Given that the property changed, let's get the new value - Eldbus_Pending *pending_operation = eldbus_proxy_property_get(inst->accelerometer->sensor_proxy, + Eldbus_Pending *pending_operation = eldbus_proxy_property_get(instance->accelerometer->sensor_proxy, "AccelerometerOrientation", - on_accelerometer_orientation, inst); + on_accelerometer_orientation, instance); if (!pending_operation) ERR("Error: could not get property AccelerometerOrientation"); } -- 2.25.1 From 801e552985fea04fec39bb1cfbe5a79d07975189 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Tue, 22 Aug 2023 22:02:26 +0200 Subject: [PATCH 24/35] Add border to icon Add filling to icon --- .../convertible/e-module-convertible.edj | Bin 10041 -> 11127 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/modules/convertible/e-module-convertible.edj b/src/modules/convertible/e-module-convertible.edj index eb0b05378dbfd18d6e920122122ec3b17e0705d7..0fb2f9b06de2657d72b88c445b08c66d82089cfb 100755 GIT binary patch literal 11127 zcmZ{o2|Seh_s5@7X%X3ll$7=n?Szn|ET!9?=8l=c)G*V`Skt0KQFO~~FQvUG+C*6* zB^6q3aiwTQi7bh<{6F7W^l*Rw=k@x|Ip6nlp6_zL=bY!ks8Y?IqNwg@|4@`+Dn<1w zmNj)PFjX{Mrhnl_Mb^{@Ly~*AOpj7jmq`@WHJzf=Cj#_EbEc?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AMPK(@b4k>Y`e8zA-_TO;hOENg3th4% z{m>d*7gzd+cgVr)f%is)A9-CCQnYh@^TG!ABVO0+LrU$hyjd6ViE3DtyhgqcB^6>E9Pm1HR z20samds+H+=a_4yNAj}Ea<_Vy1Z*l6?1-(1w?B|tFe&eF*_N&OLCH;xb+NH?7Oz+? zGxi?Q<-GdBiw<|Y6RA~<-}1oEccWJI(WheFyUNbnyOy3jD#|SE z`c?VHf?m_BD)UP3EWLj_^ZxBskLUMj?o%65v1a5Sd<|t}m2TDPG2hcv;Bnq6HOF`H z?0CCBJhKuyz7h0$lW6@a`Zr0Q@Vi8_?6rBO;o4ql3tuM0eCQbSVca`ck&qw2yVq}$ z@0Rr!_Puk{?%8wm!_dd}!dr`@R$fgVuq9(vSyeKm?jNB`o=z)IdRf{jxgo=J+jY73d7JN222VelQTtnssh?F`-w+|Q3r z{b*`pHE2k`vx{df=#=-Nqj2`@RkNJ?%P5ouiSNJFJd!zG`^x+em8$DmXnfKyj=f{~Pdk5Z=rh4Dqe^gsv_GnZ>w#7T+ zQ$f54k^7Agbo$wV*E8K(9ZG9sjfbVIJpFv`^aXX*(^{{Wxt)EtW5bT>@+*>p345Dt zkY&WFIVdjFR^)resf7)SM@&86T( Date: Thu, 24 Aug 2023 08:24:11 +0200 Subject: [PATCH 25/35] Move icon for convertible configuration to screen section --- src/modules/convertible/e_mod_main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/modules/convertible/e_mod_main.c b/src/modules/convertible/e_mod_main.c index 5e69941e4..62df5f20e 100644 --- a/src/modules/convertible/e_mod_main.c +++ b/src/modules/convertible/e_mod_main.c @@ -322,10 +322,12 @@ e_modapi_init(E_Module *m) e_gadcon_provider_register(&_gadcon_class); INF("Creating menu entries for settings"); - e_configure_registry_category_add("extensions", 90, "Extensions", NULL, - "preferences-extensions"); - e_configure_registry_item_add("extensions/convertible", 30, "convertible", NULL, - "preferences-desktop-convertible", e_int_config_convertible_module); + /* create Screen configuration category + * + * NB: If the category already exists, this function just returns */ + e_configure_registry_category_add("screen", 30, _("Screen"), NULL, "preferences-desktop-display"); + e_configure_registry_item_add("screen/convertible", 30, "convertible", NULL, + "object-rotate-right", e_int_config_convertible_module); instances = eina_list_append(instances, inst); -- 2.25.1 From e7fb1684ce780aa9a0900f40417c9da3ed8a0d24 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Thu, 24 Aug 2023 21:42:51 +0200 Subject: [PATCH 26/35] Allegedly using the icon from edj --- src/modules/convertible/e_mod_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/convertible/e_mod_main.c b/src/modules/convertible/e_mod_main.c index 62df5f20e..ee87184b4 100644 --- a/src/modules/convertible/e_mod_main.c +++ b/src/modules/convertible/e_mod_main.c @@ -326,8 +326,8 @@ e_modapi_init(E_Module *m) * * NB: If the category already exists, this function just returns */ e_configure_registry_category_add("screen", 30, _("Screen"), NULL, "preferences-desktop-display"); - e_configure_registry_item_add("screen/convertible", 30, "convertible", NULL, - "object-rotate-right", e_int_config_convertible_module); + e_configure_registry_item_add("screen/convertible", 30, "convertible", theme_overlay_path, + "main", e_int_config_convertible_module); instances = eina_list_append(instances, inst); -- 2.25.1 From bb379144924ae04aca59c10039a1e7a4d3c01c77 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Fri, 25 Aug 2023 19:43:37 +0200 Subject: [PATCH 27/35] Fix icon --- src/modules/convertible/e_mod_config.c | 16 ++++++++-------- src/modules/convertible/e_mod_config.h | 12 +----------- src/modules/convertible/e_mod_main.c | 26 +++++++++++++++++++------- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/src/modules/convertible/e_mod_config.c b/src/modules/convertible/e_mod_config.c index b93cc9fba..d0ae47d59 100644 --- a/src/modules/convertible/e_mod_config.c +++ b/src/modules/convertible/e_mod_config.c @@ -6,8 +6,8 @@ #include "e_mod_config.h" static Convertible_Config *_config = NULL; -E_Config_DD *edd = NULL; -EINTERN Convertible_Config *convertible_config; +E_Config_DD *config_edd = NULL; +extern Convertible_Config *convertible_config; /** * Create the config structure @@ -20,10 +20,10 @@ _econvertible_config_dd_new(void) // E_CONFIG_VAL(c_zone, Convertible_Zone_Config, follow_rotation, INT); // TODO Not sure what his line does. Apparently, it is needed to specify the type of the configuration data structure - edd = E_CONFIG_DD_NEW("Convertible_Config", Convertible_Config); + config_edd = E_CONFIG_DD_NEW("Convertible_Config", Convertible_Config); - E_CONFIG_VAL(edd, Convertible_Config, disable_keyboard_on_rotation, INT); -// E_CONFIG_LIST(edd, Convertible_Config, rotatable_screen_configuration, c_zone); + E_CONFIG_VAL(config_edd, Convertible_Config, disable_keyboard_on_rotation, INT); +// E_CONFIG_LIST(config_edd, Convertible_Config, rotatable_screen_configuration, c_zone); } /** @@ -35,7 +35,7 @@ _config_set(Convertible_Config *config) { DBG("config_set disable_keyboard_on_rotation %d", config->disable_keyboard_on_rotation); _config->disable_keyboard_on_rotation = config->disable_keyboard_on_rotation; - e_config_domain_save("module.convertible", edd, config); + e_config_domain_save("module.convertible", config_edd, config); } /** @@ -142,7 +142,7 @@ void econvertible_config_init(void) { _econvertible_config_dd_new(); - _config = e_config_domain_load("module.econvertible", edd); + _config = e_config_domain_load("module.econvertible", config_edd); if (!_config) { _config = E_NEW(Convertible_Config, 1); @@ -155,6 +155,6 @@ econvertible_config_init(void) void econvertible_config_shutdown(void) { - E_CONFIG_DD_FREE(edd); + E_CONFIG_DD_FREE(config_edd); E_FREE(convertible_config); } \ No newline at end of file diff --git a/src/modules/convertible/e_mod_config.h b/src/modules/convertible/e_mod_config.h index ebd8d937a..0af443795 100644 --- a/src/modules/convertible/e_mod_config.h +++ b/src/modules/convertible/e_mod_config.h @@ -7,22 +7,12 @@ #ifndef E_GADGET_CONVERTIBLE_E_MOD_CONFIG_H #define E_GADGET_CONVERTIBLE_E_MOD_CONFIG_H -// Definition for a zone configuration -typedef struct _Convertible_Zone_Config Convertible_Zone_Config; - -struct _Convertible_Zone_Config -{ - char *name; - int follow_rotation; -}; - // Definition of the data structure to hold the gadget configuration typedef struct _Convertible_Config Convertible_Config; - struct _Convertible_Config { + E_Module *module; int disable_keyboard_on_rotation; -// Eina_List *rotatable_screen_configuration; }; // As far as I understand, this structure should hold data useful for the configuration and a pointer to diff --git a/src/modules/convertible/e_mod_main.c b/src/modules/convertible/e_mod_main.c index ee87184b4..d8126c7f5 100644 --- a/src/modules/convertible/e_mod_main.c +++ b/src/modules/convertible/e_mod_main.c @@ -17,8 +17,9 @@ E_Module *convertible_module; Instance *inst; // Configuration -extern Convertible_Config *convertible_config; -extern E_Config_DD *edd; +extern Convertible_Config *convertible_config = NULL; +static E_Config_DD *conf_edd = NULL; +Convertible_Config *conf = NULL; // Logger int _convertible_log_dom; @@ -34,6 +35,9 @@ E_API E_Module_Api e_modapi = /* LIST OF INSTANCES */ static Eina_List *instances = NULL; +/* Other functions for configuration */ +static void _conf_new(void); +static void _conf_free(void); /* gadcon requirements */ static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style); @@ -217,7 +221,7 @@ _gc_icon(const E_Gadcon_Client_Class *client_class EINA_UNUSED, Evas *evas) o = edje_object_add(evas); snprintf(buf, sizeof(buf), "%s/e-module-convertible.edj", convertible_module->dir); - edje_object_file_set(o, buf, "main"); + edje_object_file_set(o, buf, "icon"); return o; } @@ -257,8 +261,8 @@ e_modapi_init(E_Module *m) { // Initialise the logger _convertible_log_dom = eina_log_domain_register("convertible", EINA_COLOR_LIGHTBLUE); - convertible_module = m; + char theme_overlay_path[PATH_MAX]; snprintf(theme_overlay_path, sizeof(theme_overlay_path), "%s/e-module-convertible.edj", convertible_module->dir); elm_theme_extension_add(NULL, theme_overlay_path); @@ -326,8 +330,8 @@ e_modapi_init(E_Module *m) * * NB: If the category already exists, this function just returns */ e_configure_registry_category_add("screen", 30, _("Screen"), NULL, "preferences-desktop-display"); - e_configure_registry_item_add("screen/convertible", 30, "convertible", theme_overlay_path, - "main", e_int_config_convertible_module); + e_configure_registry_item_add("screen/convertible", 30, "convertible", NULL, + theme_overlay_path, e_int_config_convertible_module); instances = eina_list_append(instances, inst); @@ -369,7 +373,15 @@ e_modapi_save(E_Module *m EINA_UNUSED) { if (convertible_config) { - e_config_domain_save("module.convertible", edd, convertible_config); + e_config_domain_save("module.convertible", conf_edd, convertible_config); } return 1; } + +static void +_conf_new(void) +{ + conf = E_NEW(Convertible_Config, 1); + conf->disable_keyboard_on_rotation = 1; + e_config_save_queue(); +} -- 2.25.1 From dcf621326b80280e7994bdafc157322f071b944e Mon Sep 17 00:00:00 2001 From: rafspiny Date: Sun, 31 Dec 2023 14:03:56 +0100 Subject: [PATCH 28/35] Rebase --- src/modules/convertible/dbus_acceleration.c | 64 +++++++++++-------- src/modules/convertible/dbus_acceleration.h | 6 +- .../convertible/e-gadget-convertible.c | 2 +- src/modules/convertible/e_mod_main.c | 53 ++++++--------- 4 files changed, 63 insertions(+), 62 deletions(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index 2be8ea95f..1483d984d 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -65,6 +65,7 @@ _is_device_a_touch_pointer(int dev_counter, int num_properties, char **iterator) } DBG("Looks like I found a device with calibration capabilities"); is_correct_device = EINA_TRUE; + free(result); } iterator++; } @@ -101,6 +102,7 @@ _fetch_X_device_input_number(void) { dev_number = dev_counter; DBG("Setting device: %d", dev_number); + break; } iterator++; } @@ -120,7 +122,18 @@ _fetch_and_rotate_screen(const char* randr_id, enum screen_rotation orientation) { DBG("Working on screen %s", randr_id); E_Randr2_Screen *rotatable_screen = e_randr2_screen_id_find(randr_id); + if (rotatable_screen == NULL) + { + DBG("Failed to load screen for id %s", randr_id); + return; + } + E_Config_Randr2_Screen *screen_randr_cfg = e_randr2_config_screen_find(rotatable_screen, e_randr2_cfg); + if (screen_randr_cfg == NULL) + { + DBG("Failed to load screen configuration for id %s", randr_id); + return; + } int rotation = _convertible_rotation_get(orientation); DBG("Screen %s is going to be rotated to %d", randr_id, rotation); @@ -165,6 +178,7 @@ _fetch_and_rotate_screen(const char* randr_id, enum screen_rotation orientation) } else { ERR("Unable to fetch coordinates transformation matrix for device %d", x_dev_num); } + free(result); free(matrix); } } @@ -173,7 +187,7 @@ _fetch_and_rotate_screen(const char* randr_id, enum screen_rotation orientation) * Helper to get the interface * */ static Eldbus_Proxy * -get_dbus_interface(const char *IFACE) +_get_dbus_interface(const char *IFACE) { DBG("Working on interface: %s", IFACE); Eldbus_Connection *conn; @@ -228,16 +242,19 @@ _access_bool_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, return res; } + if (type[0] != 'b') + { + WARN("Expected type is int."); + res = EINA_FALSE; + free(type); + return res; + } if (type[1]) { WARN("It is a complex type, not handle yet."); res = EINA_FALSE; } - if (type[0] != 'b') - { - WARN("Expected type is int."); - res = EINA_FALSE; - } + if (!eldbus_message_iter_arguments_get((*variant), "b", boolean_property_value)) { WARN("error in eldbus_message_iter_arguments_get()"); @@ -379,16 +396,13 @@ sensor_proxy_shutdown(void) eldbus_shutdown(); } -int -_convertible_rotation_get(const enum screen_rotation orientation); - /** * Helper function to extract ta string property from the message * @param msg The message coming from the get property invocation * @param variant * @return Enum specifying the orientation. UNDEFINED by default */ -enum screen_rotation +static enum screen_rotation _access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant) { enum screen_rotation rotation = UNDEFINED; @@ -404,34 +418,33 @@ _access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant WARN("Unable to get the type."); return rotation; } - - type = eldbus_message_iter_signature_get((*variant)); + if (type[0] != 's') + { + WARN("Expected type is string(s)."); + free(type); + return rotation; + } if (type[1]) { WARN("It is a complex type, not handle yet."); } - if (type[0] != 's') - { - WARN("Expected type is string(s)."); - } - const char **string_property_value = calloc(PATH_MAX, sizeof(char)); - EINA_SAFETY_ON_NULL_RETURN_VAL(string_property_value, EINA_FALSE); - if (!eldbus_message_iter_arguments_get((*variant), "s", string_property_value)) + + const char *string_property_value; + if (!eldbus_message_iter_arguments_get(variant, "s", &string_property_value)) { WARN("error in eldbus_message_iter_arguments_get()"); } - if (!strcmp(ACCELEROMETER_ORIENTATION_RIGHT, *string_property_value)) + if (strcmp(ACCELEROMETER_ORIENTATION_RIGHT, string_property_value) == 0) rotation = RIGHT_UP; - if (!strcmp(ACCELEROMETER_ORIENTATION_LEFT, *string_property_value)) + if (strcmp(ACCELEROMETER_ORIENTATION_LEFT, string_property_value) == 0) rotation = LEFT_UP; - if (!strcmp(ACCELEROMETER_ORIENTATION_BOTTOM, *string_property_value)) + if (strcmp(ACCELEROMETER_ORIENTATION_BOTTOM, string_property_value) == 0) rotation = FLIPPED; - if (!strcmp(ACCELEROMETER_ORIENTATION_NORMAL, *string_property_value)) + if (strcmp(ACCELEROMETER_ORIENTATION_NORMAL, string_property_value) == 0) rotation = NORMAL; free(type); - free(string_property_value); return rotation; } @@ -439,7 +452,7 @@ void on_accelerometer_orientation(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) { INF("New orientation received"); - Instance *inst = (Instance *) data; + Instance *inst = data; if (inst->locked_position == EINA_TRUE) { @@ -447,7 +460,6 @@ on_accelerometer_orientation(void *data, const Eldbus_Message *msg, Eldbus_Pendi return; } - const char *errname, *errmsg; enum screen_rotation orientation; Eldbus_Message_Iter *variant = NULL; diff --git a/src/modules/convertible/dbus_acceleration.h b/src/modules/convertible/dbus_acceleration.h index 2724c1914..c2f864702 100644 --- a/src/modules/convertible/dbus_acceleration.h +++ b/src/modules/convertible/dbus_acceleration.h @@ -26,11 +26,13 @@ struct _DbusAccelerometer /** * Fetch the DBUS interfaces and fill the DbusAccelerometer struct * */ -DbusAccelerometer* sensor_proxy_init(void); +DbusAccelerometer* sensor_proxy_init(); +void sensor_proxy_shutdown(); + void -sensor_proxy_shutdown(void); +on_has_accelerometer(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED); /** * Callback definition to handle the request of the accelerometer property of DBUS interface net.hadess.SensorProxy diff --git a/src/modules/convertible/e-gadget-convertible.c b/src/modules/convertible/e-gadget-convertible.c index 051809d19..a00edefef 100644 --- a/src/modules/convertible/e-gadget-convertible.c +++ b/src/modules/convertible/e-gadget-convertible.c @@ -12,7 +12,7 @@ static void _update_instances(const Instance *current_instance) { Eina_List *l; - Instance *instance = NULL; + Instance *instance; EINA_LIST_FOREACH(instances, l, instance) { if (current_instance != instance) diff --git a/src/modules/convertible/e_mod_main.c b/src/modules/convertible/e_mod_main.c index d8126c7f5..c1d13abac 100644 --- a/src/modules/convertible/e_mod_main.c +++ b/src/modules/convertible/e_mod_main.c @@ -17,9 +17,8 @@ E_Module *convertible_module; Instance *inst; // Configuration -extern Convertible_Config *convertible_config = NULL; -static E_Config_DD *conf_edd = NULL; -Convertible_Config *conf = NULL; +extern Convertible_Config *convertible_config; +extern E_Config_DD *edd; // Logger int _convertible_log_dom; @@ -35,9 +34,6 @@ E_API E_Module_Api e_modapi = /* LIST OF INSTANCES */ static Eina_List *instances = NULL; -/* Other functions for configuration */ -static void _conf_new(void); -static void _conf_free(void); /* gadcon requirements */ static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style); @@ -124,10 +120,10 @@ static void _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient) { Evas_Coord mw, mh; - char buf[4096]; + char buf[PATH_MAX]; const char *s = "float"; - Instance *instance = gcc->data; + Instance *current_instance = gcc->data; switch (orient) { case E_GADCON_ORIENT_FLOAT: @@ -194,13 +190,13 @@ _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient) break; } snprintf(buf, sizeof(buf), "e,state,orientation,%s", s); - edje_object_signal_emit(instance->o_button, buf, "e"); - edje_object_message_signal_process(instance->o_button); + edje_object_signal_emit(current_instance->o_button, buf, "e"); + edje_object_message_signal_process(current_instance->o_button); mw = 0, mh = 0; - edje_object_size_min_get(instance->o_button, &mw, &mh); + edje_object_size_min_get(current_instance->o_button, &mw, &mh); if ((mw < 1) || (mh < 1)) - edje_object_size_min_calc(instance->o_button, &mw, &mh); + edje_object_size_min_calc(current_instance->o_button, &mw, &mh); if (mw < 4) mw = 4; if (mh < 4) mh = 4; e_gadcon_client_aspect_set(gcc, mw, mh); @@ -228,7 +224,7 @@ _gc_icon(const E_Gadcon_Client_Class *client_class EINA_UNUSED, Evas *evas) static const char * _gc_id_new(const E_Gadcon_Client_Class *client_class EINA_UNUSED) { - static char buf[4096]; + static char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "%s.%d", client_class->name, eina_list_count(instances) + 1); @@ -242,16 +238,16 @@ _gc_id_new(const E_Gadcon_Client_Class *client_class EINA_UNUSED) static void _cb_properties_changed(void *data, const Eldbus_Message *msg) { - Instance *instance = (Instance *) data; + Instance *current_instance = data; Eldbus_Message_Iter *array, *invalidate; char *iface; if (!eldbus_message_arguments_get(msg, "sa{sv}as", &iface, &array, &invalidate)) ERR("Error getting data from properties changed signal."); // Given that the property changed, let's get the new value - Eldbus_Pending *pending_operation = eldbus_proxy_property_get(instance->accelerometer->sensor_proxy, + Eldbus_Pending *pending_operation = eldbus_proxy_property_get(current_instance->accelerometer->sensor_proxy, "AccelerometerOrientation", - on_accelerometer_orientation, instance); + on_accelerometer_orientation, current_instance); if (!pending_operation) ERR("Error: could not get property AccelerometerOrientation"); } @@ -305,14 +301,15 @@ e_modapi_init(E_Module *m) E_Randr2_Screen *screen = e_randr2_screen_id_find(zone->randr2_id); DBG("name randr2 id %s", zone->randr2_id); DBG("rot_90 %i", screen->info.can_rot_90); + // Arbitrarily chosen a condition to check that rotation is enabled if (screen->info.can_rot_90 == EINA_TRUE) { char *randr2_id = strdup(zone->randr2_id); if (randr2_id == NULL) ERR("Can't copy the screen name"); - - inst->randr2_ids = eina_list_append(inst->randr2_ids, randr2_id); + else + inst->randr2_ids = eina_list_append(inst->randr2_ids, randr2_id); if (eina_error_get()) ERR("Memory is low. List allocation failed."); } @@ -326,12 +323,10 @@ e_modapi_init(E_Module *m) e_gadcon_provider_register(&_gadcon_class); INF("Creating menu entries for settings"); - /* create Screen configuration category - * - * NB: If the category already exists, this function just returns */ - e_configure_registry_category_add("screen", 30, _("Screen"), NULL, "preferences-desktop-display"); - e_configure_registry_item_add("screen/convertible", 30, "convertible", NULL, - theme_overlay_path, e_int_config_convertible_module); + e_configure_registry_category_add("extensions", 90, "Extensions", NULL, + "preferences-extensions"); + e_configure_registry_item_add("extensions/convertible", 30, "convertible", NULL, + "preferences-desktop-convertible", e_int_config_convertible_module); instances = eina_list_append(instances, inst); @@ -373,15 +368,7 @@ e_modapi_save(E_Module *m EINA_UNUSED) { if (convertible_config) { - e_config_domain_save("module.convertible", conf_edd, convertible_config); + e_config_domain_save("module.convertible", edd, convertible_config); } return 1; } - -static void -_conf_new(void) -{ - conf = E_NEW(Convertible_Config, 1); - conf->disable_keyboard_on_rotation = 1; - e_config_save_queue(); -} -- 2.25.1 From 16bf105f3408ea6d48c90f338e6a4e50eb6181f3 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Sun, 31 Dec 2023 15:01:18 +0100 Subject: [PATCH 29/35] Fix icon and translate strign --- src/modules/convertible/dbus_acceleration.c | 6 +++--- src/modules/convertible/e_mod_config.c | 2 +- src/modules/convertible/e_mod_main.c | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index 1483d984d..9ab21b771 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -348,8 +348,8 @@ sensor_proxy_init(void) accelerometer_dbus->orientation = UNDEFINED; INF("Getting dbus interfaces"); - accelerometer_dbus->sensor_proxy = get_dbus_interface(EFL_DBUS_ACC_IFACE); - accelerometer_dbus->sensor_proxy_properties = get_dbus_interface(ELDBUS_FDO_INTERFACE_PROPERTIES); + accelerometer_dbus->sensor_proxy = _get_dbus_interface(EFL_DBUS_ACC_IFACE); + accelerometer_dbus->sensor_proxy_properties = _get_dbus_interface(ELDBUS_FDO_INTERFACE_PROPERTIES); if (accelerometer_dbus->sensor_proxy == NULL) { ERR("Unable to get the proxy for interface %s", EFL_DBUS_ACC_IFACE); @@ -430,7 +430,7 @@ _access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant } const char *string_property_value; - if (!eldbus_message_iter_arguments_get(variant, "s", &string_property_value)) + if (!eldbus_message_iter_arguments_get(*variant, "s", &string_property_value)) { WARN("error in eldbus_message_iter_arguments_get()"); } diff --git a/src/modules/convertible/e_mod_config.c b/src/modules/convertible/e_mod_config.c index d0ae47d59..8b18a2122 100644 --- a/src/modules/convertible/e_mod_config.c +++ b/src/modules/convertible/e_mod_config.c @@ -7,7 +7,7 @@ static Convertible_Config *_config = NULL; E_Config_DD *config_edd = NULL; -extern Convertible_Config *convertible_config; +EINTERN Convertible_Config *convertible_config; /** * Create the config structure diff --git a/src/modules/convertible/e_mod_main.c b/src/modules/convertible/e_mod_main.c index c1d13abac..8b4a30d08 100644 --- a/src/modules/convertible/e_mod_main.c +++ b/src/modules/convertible/e_mod_main.c @@ -18,7 +18,7 @@ Instance *inst; // Configuration extern Convertible_Config *convertible_config; -extern E_Config_DD *edd; +static E_Config_DD *config_edd; // Logger int _convertible_log_dom; @@ -323,10 +323,10 @@ e_modapi_init(E_Module *m) e_gadcon_provider_register(&_gadcon_class); INF("Creating menu entries for settings"); - e_configure_registry_category_add("extensions", 90, "Extensions", NULL, + e_configure_registry_category_add("extensions", 90, _("Extensions"), NULL, "preferences-extensions"); - e_configure_registry_item_add("extensions/convertible", 30, "convertible", NULL, - "preferences-desktop-convertible", e_int_config_convertible_module); + e_configure_registry_item_add("extensions/convertible", 30, _("Convertible"), NULL, + "preferences-desktop-edge-bindings", e_int_config_convertible_module); instances = eina_list_append(instances, inst); @@ -368,7 +368,7 @@ e_modapi_save(E_Module *m EINA_UNUSED) { if (convertible_config) { - e_config_domain_save("module.convertible", edd, convertible_config); + e_config_domain_save("module.convertible", config_edd, convertible_config); } return 1; } -- 2.25.1 From 74cd743aa09378fd553c4dd0b891be63adcbe02f Mon Sep 17 00:00:00 2001 From: rafspiny Date: Sun, 21 Jan 2024 19:40:25 +0100 Subject: [PATCH 30/35] Add typedef enum Specify no parameters on some functions --- src/modules/convertible/dbus_acceleration.c | 10 +++++----- src/modules/convertible/dbus_acceleration.h | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index 9ab21b771..d665b7421 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -12,7 +12,7 @@ static DbusAccelerometer* accelerometer_dbus; static int -_convertible_rotation_get(const enum screen_rotation orientation) +_convertible_rotation_get(const screen_rotation orientation) { switch (orientation) { @@ -118,7 +118,7 @@ _fetch_X_device_input_number(void) * @param rotation The expected rotation */ static void -_fetch_and_rotate_screen(const char* randr_id, enum screen_rotation orientation) +_fetch_and_rotate_screen(const char* randr_id, screen_rotation orientation) { DBG("Working on screen %s", randr_id); E_Randr2_Screen *rotatable_screen = e_randr2_screen_id_find(randr_id); @@ -402,10 +402,10 @@ sensor_proxy_shutdown(void) * @param variant * @return Enum specifying the orientation. UNDEFINED by default */ -static enum screen_rotation +static screen_rotation _access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant) { - enum screen_rotation rotation = UNDEFINED; + screen_rotation rotation = UNDEFINED; char *type = NULL; if (!eldbus_message_arguments_get(msg, "v", variant)) @@ -461,7 +461,7 @@ on_accelerometer_orientation(void *data, const Eldbus_Message *msg, Eldbus_Pendi } const char *errname, *errmsg; - enum screen_rotation orientation; + screen_rotation orientation; Eldbus_Message_Iter *variant = NULL; if (eldbus_message_error_get(msg, &errname, &errmsg)) diff --git a/src/modules/convertible/dbus_acceleration.h b/src/modules/convertible/dbus_acceleration.h index c2f864702..fcd4d2f81 100644 --- a/src/modules/convertible/dbus_acceleration.h +++ b/src/modules/convertible/dbus_acceleration.h @@ -10,14 +10,14 @@ #define EFL_DBUS_ACC_IFACE "net.hadess.SensorProxy" // This enum represents the 4 states of screen rotation plus UNDEFINED -enum screen_rotation {UNDEFINED, NORMAL, RIGHT_UP, FLIPPED, LEFT_UP}; +typedef enum {UNDEFINED, NORMAL, RIGHT_UP, FLIPPED, LEFT_UP} screen_rotation; typedef struct _DbusAccelerometer DbusAccelerometer; struct _DbusAccelerometer { Eina_Bool has_accelerometer; - enum screen_rotation orientation; + screen_rotation orientation; Eldbus_Proxy *sensor_proxy, *sensor_proxy_properties; Eldbus_Pending *pending_has_orientation, *pending_orientation, *pending_acc_claim, *pending_acc_crelease; Eldbus_Signal_Handler *dbus_property_changed_sh; @@ -26,10 +26,10 @@ struct _DbusAccelerometer /** * Fetch the DBUS interfaces and fill the DbusAccelerometer struct * */ -DbusAccelerometer* sensor_proxy_init(); +DbusAccelerometer* sensor_proxy_init(void); -void sensor_proxy_shutdown(); +void sensor_proxy_shutdown(void); void on_has_accelerometer(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED); -- 2.25.1 From bd1ebaebada8bd550ec6466aead2de1617384244 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Mon, 22 Jan 2024 09:32:12 +0100 Subject: [PATCH 31/35] Add e prefix to signales --- src/modules/convertible/e_mod_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/convertible/e_mod_main.c b/src/modules/convertible/e_mod_main.c index 8b4a30d08..9660c057e 100644 --- a/src/modules/convertible/e_mod_main.c +++ b/src/modules/convertible/e_mod_main.c @@ -84,10 +84,10 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style) // Adding callback for EDJE object INF("Adding callback for creation and other events from EDJE"); - edje_object_signal_callback_add(evas_object, "lock,rotation", "tablet", _rotation_signal_cb, instance); - edje_object_signal_callback_add(evas_object, "unlock,rotation", "tablet", _rotation_signal_cb, instance); - edje_object_signal_callback_add(evas_object, "enable,keyboard", "keyboard", _keyboard_signal_cb, instance); - edje_object_signal_callback_add(evas_object, "disable,keyboard", "keyboard", _keyboard_signal_cb, instance); + edje_object_signal_callback_add(evas_object, "e,lock,rotation", "tablet", _rotation_signal_cb, instance); + edje_object_signal_callback_add(evas_object, "e,unlock,rotation", "tablet", _rotation_signal_cb, instance); + edje_object_signal_callback_add(evas_object, "e,enable,keyboard", "keyboard", _keyboard_signal_cb, instance); + edje_object_signal_callback_add(evas_object, "e,disable,keyboard", "keyboard", _keyboard_signal_cb, instance); inst->o_button = evas_object; -- 2.25.1 From f34460bf9679c6f5121c15962a0f3cc7e1000386 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Tue, 23 Jan 2024 22:11:24 +0100 Subject: [PATCH 32/35] Introduce version for config --- src/modules/convertible/e_mod_config.c | 35 ++++++++++++++++++-------- src/modules/convertible/e_mod_config.h | 7 ++++++ 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/src/modules/convertible/e_mod_config.c b/src/modules/convertible/e_mod_config.c index 8b18a2122..4e3b868ef 100644 --- a/src/modules/convertible/e_mod_config.c +++ b/src/modules/convertible/e_mod_config.c @@ -5,7 +5,7 @@ #include "e.h" #include "e_mod_config.h" -static Convertible_Config *_config = NULL; +static Convertible_Config *conv_config = NULL; E_Config_DD *config_edd = NULL; EINTERN Convertible_Config *convertible_config; @@ -22,19 +22,20 @@ _econvertible_config_dd_new(void) // TODO Not sure what his line does. Apparently, it is needed to specify the type of the configuration data structure config_edd = E_CONFIG_DD_NEW("Convertible_Config", Convertible_Config); + E_CONFIG_VAL(config_edd, Convertible_Config, version, INT); E_CONFIG_VAL(config_edd, Convertible_Config, disable_keyboard_on_rotation, INT); // E_CONFIG_LIST(config_edd, Convertible_Config, rotatable_screen_configuration, c_zone); } /** - * Update the *_config data structure based on the settings coming from the dialog panel + * Update the *conv_config data structure based on the settings coming from the dialog panel * @param config The config coming from the Dialog Panel (E_Config_Dialog_data) */ static void _config_set(Convertible_Config *config) { DBG("config_set disable_keyboard_on_rotation %d", config->disable_keyboard_on_rotation); - _config->disable_keyboard_on_rotation = config->disable_keyboard_on_rotation; + conv_config->disable_keyboard_on_rotation = config->disable_keyboard_on_rotation; e_config_domain_save("module.convertible", config_edd, config); } @@ -51,8 +52,8 @@ _create_data(E_Config_Dialog *cfg EINA_UNUSED) dialog_data = E_NEW(E_Config_Dialog_Data, 1); dialog_data->config = malloc(sizeof(Convertible_Config)); - dialog_data->config->disable_keyboard_on_rotation = _config->disable_keyboard_on_rotation; -// dialog_data->config->rotatable_screen_configuration = _config->rotatable_screen_configuration; + dialog_data->config->disable_keyboard_on_rotation = conv_config->disable_keyboard_on_rotation; +// dialog_data->config->rotatable_screen_configuration = conv_config->rotatable_screen_configuration; DBG("disable_keyboard_on_rotation %d", dialog_data->config->disable_keyboard_on_rotation); return dialog_data; @@ -72,7 +73,7 @@ _free_data(E_Config_Dialog *c EINA_UNUSED, E_Config_Dialog_Data *dialog_data) } /** - * This function should store the modified settings into the data structure referred by the pointer _config + * This function should store the modified settings into the data structure referred by the pointer conv_config * @param cfd * @param cfdata * @return @@ -142,14 +143,26 @@ void econvertible_config_init(void) { _econvertible_config_dd_new(); - _config = e_config_domain_load("module.econvertible", config_edd); - if (!_config) + conv_config = e_config_domain_load("module.econvertible", config_edd); + + // Check version + if (conv_config && !e_util_module_config_check(_("Convertible Module"), + conv_config->version, + MOD_CONFIG_FILE_VERSION)) { - _config = E_NEW(Convertible_Config, 1); - _config->disable_keyboard_on_rotation = 1; -// _config->rotatable_screen_configuration = NULL; + free(conv_config); + return; } + + if (!conv_config) + { + conv_config = E_NEW(Convertible_Config, 1); + conv_config->disable_keyboard_on_rotation = 1; +// conv_config->rotatable_screen_configuration = NULL; + } + + conv_config->version = MOD_CONFIG_FILE_VERSION; DBG("Config loaded"); } diff --git a/src/modules/convertible/e_mod_config.h b/src/modules/convertible/e_mod_config.h index 0af443795..2e0b98ea9 100644 --- a/src/modules/convertible/e_mod_config.h +++ b/src/modules/convertible/e_mod_config.h @@ -7,10 +7,17 @@ #ifndef E_GADGET_CONVERTIBLE_E_MOD_CONFIG_H #define E_GADGET_CONVERTIBLE_E_MOD_CONFIG_H +/* Increment for Major Changes */ +#define MOD_CONFIG_FILE_EPOCH 1 +/* Increment for Minor Changes (ie: user doesn't need a new config) */ +#define MOD_CONFIG_FILE_GENERATION 0 +#define MOD_CONFIG_FILE_VERSION ((MOD_CONFIG_FILE_EPOCH * 1000000) + MOD_CONFIG_FILE_GENERATION) + // Definition of the data structure to hold the gadget configuration typedef struct _Convertible_Config Convertible_Config; struct _Convertible_Config { + int version; E_Module *module; int disable_keyboard_on_rotation; }; -- 2.25.1 From 5efba6f8a32ef290edcbc88f3f0fa4a8564c0518 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Tue, 23 Jan 2024 22:21:21 +0100 Subject: [PATCH 33/35] Remove unused code --- src/modules/convertible/e-gadget-convertible.c | 8 -------- src/modules/convertible/e-gadget-convertible.h | 5 +++-- src/modules/convertible/e_mod_config.h | 1 - src/modules/convertible/e_mod_main.c | 1 - 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/modules/convertible/e-gadget-convertible.c b/src/modules/convertible/e-gadget-convertible.c index a00edefef..3dc83f028 100644 --- a/src/modules/convertible/e-gadget-convertible.c +++ b/src/modules/convertible/e-gadget-convertible.c @@ -5,9 +5,6 @@ #include "e-gadget-convertible.h" #include "e_mod_main.h" -/* LIST OF INSTANCES */ -static Eina_List *instances = NULL; - static void _update_instances(const Instance *current_instance) { @@ -45,8 +42,3 @@ _keyboard_signal_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const { DBG("Keyboard: Signal %s received from %s", sig, src); } - -void -update_instances(Eina_List *new_instances) { - instances = new_instances; -} diff --git a/src/modules/convertible/e-gadget-convertible.h b/src/modules/convertible/e-gadget-convertible.h index 02f911d7e..ba0976f9c 100644 --- a/src/modules/convertible/e-gadget-convertible.h +++ b/src/modules/convertible/e-gadget-convertible.h @@ -8,6 +8,9 @@ #ifndef E_GADGET_CONVERTIBLE_E_GADGET_CONVERTIBLE_H #define E_GADGET_CONVERTIBLE_E_GADGET_CONVERTIBLE_H +/* LIST OF INSTANCES */ +Eina_List *instances = NULL; + /* gadcon callback for actions */ void _rotation_signal_cb(void *data EINA_UNUSED, Evas_Object *obj, const char *sig EINA_UNUSED, const char *src EINA_UNUSED); @@ -15,8 +18,6 @@ _rotation_signal_cb(void *data EINA_UNUSED, Evas_Object *obj, const char *sig EI void _keyboard_signal_cb(void *data EINA_UNUSED, Evas_Object *obj, const char *sig EINA_UNUSED, const char *src EINA_UNUSED); -void -update_instances(Eina_List *instances); /* end gadcon callback for actions */ diff --git a/src/modules/convertible/e_mod_config.h b/src/modules/convertible/e_mod_config.h index 2e0b98ea9..9f424ab19 100644 --- a/src/modules/convertible/e_mod_config.h +++ b/src/modules/convertible/e_mod_config.h @@ -18,7 +18,6 @@ typedef struct _Convertible_Config Convertible_Config; struct _Convertible_Config { int version; - E_Module *module; int disable_keyboard_on_rotation; }; diff --git a/src/modules/convertible/e_mod_main.c b/src/modules/convertible/e_mod_main.c index 9660c057e..03a3c1920 100644 --- a/src/modules/convertible/e_mod_main.c +++ b/src/modules/convertible/e_mod_main.c @@ -74,7 +74,6 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style) instance->o_button = evas_object; instances = eina_list_append(instances, instance); - update_instances(instances); gcc = e_gadcon_client_new(gc, name, id, style, evas_object); gcc->data = instance; -- 2.25.1 From 318de512f21eaeee1e3a514f5dfe06a8d0277a37 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Sat, 3 Feb 2024 16:37:56 +0100 Subject: [PATCH 34/35] Make instances extern WIP --- src/modules/convertible/e-gadget-convertible.c | 1 + src/modules/convertible/e-gadget-convertible.h | 2 +- src/modules/convertible/e_mod_main.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/convertible/e-gadget-convertible.c b/src/modules/convertible/e-gadget-convertible.c index 3dc83f028..83ae074e7 100644 --- a/src/modules/convertible/e-gadget-convertible.c +++ b/src/modules/convertible/e-gadget-convertible.c @@ -5,6 +5,7 @@ #include "e-gadget-convertible.h" #include "e_mod_main.h" + static void _update_instances(const Instance *current_instance) { diff --git a/src/modules/convertible/e-gadget-convertible.h b/src/modules/convertible/e-gadget-convertible.h index ba0976f9c..fe006a3f2 100644 --- a/src/modules/convertible/e-gadget-convertible.h +++ b/src/modules/convertible/e-gadget-convertible.h @@ -9,7 +9,7 @@ #define E_GADGET_CONVERTIBLE_E_GADGET_CONVERTIBLE_H /* LIST OF INSTANCES */ -Eina_List *instances = NULL; +extern Eina_List *instances; /* gadcon callback for actions */ void diff --git a/src/modules/convertible/e_mod_main.c b/src/modules/convertible/e_mod_main.c index 03a3c1920..d4a347d89 100644 --- a/src/modules/convertible/e_mod_main.c +++ b/src/modules/convertible/e_mod_main.c @@ -32,7 +32,7 @@ E_API E_Module_Api e_modapi = /* LIST OF INSTANCES */ -static Eina_List *instances = NULL; +Eina_List *instances = NULL; /* gadcon requirements */ -- 2.25.1 From 3def50bd6a2e172ec18ad0569ad812d8e948ebc8 Mon Sep 17 00:00:00 2001 From: rafspiny Date: Sun, 4 Feb 2024 13:02:05 +0100 Subject: [PATCH 35/35] Use proper icon Add icon to edj file Correct icon Enable sync for edje keyboard lock/unlock Fix keyboard signals in icon Using the correct part from the edje --- .../convertible/e-gadget-convertible.c | 23 +++++++++++++----- .../convertible/e-module-convertible.edj | Bin 11127 -> 15359 bytes src/modules/convertible/e_mod_main.c | 4 +-- 3 files changed, 19 insertions(+), 8 deletions(-) mode change 100755 => 100644 src/modules/convertible/e-module-convertible.edj diff --git a/src/modules/convertible/e-gadget-convertible.c b/src/modules/convertible/e-gadget-convertible.c index 83ae074e7..14ba9db80 100644 --- a/src/modules/convertible/e-gadget-convertible.c +++ b/src/modules/convertible/e-gadget-convertible.c @@ -17,9 +17,15 @@ _update_instances(const Instance *current_instance) { instance->locked_position = current_instance->locked_position; if (instance->locked_position == EINA_TRUE) - edje_object_signal_emit(instance->o_button, "lock,rotation,icon", "convertible/tablet"); + edje_object_signal_emit(instance->o_button, "e,lock,rotation,icon", "convertible/tablet"); else - edje_object_signal_emit(instance->o_button, "unlock,rotation,icon", "convertible/tablet"); + edje_object_signal_emit(instance->o_button, "e,unlock,rotation,icon", "convertible/tablet"); + + instance->disabled_keyboard = current_instance->disabled_keyboard; + if (instance->disabled_keyboard == EINA_TRUE) + edje_object_signal_emit(instance->o_button, "e,disable,keyboard,icon", "convertible/input"); + else + edje_object_signal_emit(instance->o_button, "e,enable,keyboard,icon", "convertible/input"); } } } @@ -28,11 +34,10 @@ void _rotation_signal_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const char *sig EINA_UNUSED, const char *src EINA_UNUSED) { - DBG("Rotation: Signal %s received from %s", sig, src); Instance *inst = data; - if (eina_str_has_prefix(sig, "unlock")) + if (eina_str_has_prefix(sig, "e,unlock")) inst->locked_position = EINA_FALSE; - if (eina_str_has_prefix(sig, "lock")) + if (eina_str_has_prefix(sig, "e,lock")) inst->locked_position = EINA_TRUE; _update_instances(inst); } @@ -41,5 +46,11 @@ void _keyboard_signal_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const char *sig EINA_UNUSED, const char *src EINA_UNUSED) { - DBG("Keyboard: Signal %s received from %s", sig, src); + Instance *inst = data; + if (eina_str_has_prefix(sig, "e,enable,keyboard")) + inst->disabled_keyboard = EINA_FALSE; + if (eina_str_has_prefix(sig, "e,disable,keyboard")) + inst->disabled_keyboard = EINA_TRUE; + _update_instances(inst); + } diff --git a/src/modules/convertible/e-module-convertible.edj b/src/modules/convertible/e-module-convertible.edj old mode 100755 new mode 100644 index 0fb2f9b06de2657d72b88c445b08c66d82089cfb..74f653d318d6d199be033d75d959b0fe15df92b0 GIT binary patch literal 15359 zcma)>2|QH&_xNv5C1o#EWZzPZH7dzgA#0^*o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l9>Kf}+{{WL3_O>p1I^6Sy;feCLW9tQBb8i-B4zHN~%c*;rQ*XV71jD&ED?`^*Pty9VR$W$f z;{N^V*V7Xv+`*o$!N&co7CA1+yJXp{D|uk#WgGoYspR9vf7%>!w?yukbLn``yyS&> zyncsnUJTl0^L^g<`EK*rMGt>2j$x-wD d6`vwXeeYD8(QBLaoqO*6;`Cd3=Lab3{2xoTSH}PV diff --git a/src/modules/convertible/e_mod_main.c b/src/modules/convertible/e_mod_main.c index d4a347d89..cedcf400d 100644 --- a/src/modules/convertible/e_mod_main.c +++ b/src/modules/convertible/e_mod_main.c @@ -85,8 +85,8 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style) INF("Adding callback for creation and other events from EDJE"); edje_object_signal_callback_add(evas_object, "e,lock,rotation", "tablet", _rotation_signal_cb, instance); edje_object_signal_callback_add(evas_object, "e,unlock,rotation", "tablet", _rotation_signal_cb, instance); - edje_object_signal_callback_add(evas_object, "e,enable,keyboard", "keyboard", _keyboard_signal_cb, instance); - edje_object_signal_callback_add(evas_object, "e,disable,keyboard", "keyboard", _keyboard_signal_cb, instance); + edje_object_signal_callback_add(evas_object, "e,enable,keyboard", "input", _keyboard_signal_cb, instance); + edje_object_signal_callback_add(evas_object, "e,disable,keyboard", "input", _keyboard_signal_cb, instance); inst->o_button = evas_object; -- 2.25.1