Introduce convertible module #49

Merged
raster merged 35 commits from rafspiny/enlightenment:master into master 2024-03-12 07:20:21 -07:00
1 changed files with 44 additions and 44 deletions
Showing only changes of commit 1f36cc158b - Show all commits

View File

@ -11,6 +11,49 @@
static DbusAccelerometer* accelerometer_dbus;

shouldnt accelerometer_dbus be static?

shouldnt accelerometer_dbus be static?

Made it static.

Made it static.

functions in C that take NO arguments are (void) not (). () means "i accept any number of arguments of an undefined type". :)

also some funcs are

int func(int x)
{
}

some are

int
func(int x)
{
}

with return type on previous line - be consistent and maybe do the latter?

functions in C that take NO arguments are (void) not (). () means "i accept any number of arguments of an undefined type". :) also some funcs are int func(int x) { } some are int func(int x) { } with return type on previous line - be consistent and maybe do the latter?

Corrected the linting for function to be

int
func(int x)
{
}

Also in the headers

int
func(int x);

Do we have a linting configi file somewhere? So we can get this kind of comments automatically? Like clang

Corrected the linting for function to be ``` int func(int x) { } ``` Also in the headers ``` int func(int x); ``` Do we have a linting configi file somewhere? So we can get this kind of comments automatically? Like clang
/**
* 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
*/

if calloc fails?

if calloc fails?

I think in most case I can use EINA_SAFETY_ON_NULL_RETURN_VAL. Am I correct?

I think in most case I can use EINA_SAFETY_ON_NULL_RETURN_VAL. Am I correct?
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");

do we really need this? eldnbus should alredy be initted by e before any module loads...

do we really need this? eldnbus should alredy be initted by e before any module loads...

Removed it.

Removed it.
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");
}