Add typedef enum

Specify no parameters on some functions
This commit is contained in:
rafspiny 2024-01-21 19:40:25 +01:00 committed by Carsten Haitzler
parent 16bf105f34
commit 74cd743aa0
2 changed files with 9 additions and 9 deletions

View File

@ -12,7 +12,7 @@ static DbusAccelerometer* accelerometer_dbus;
static int static int
_convertible_rotation_get(const enum screen_rotation orientation) _convertible_rotation_get(const screen_rotation orientation)
{ {
switch (orientation) switch (orientation)
{ {
@ -118,7 +118,7 @@ _fetch_X_device_input_number(void)
* @param rotation The expected rotation * @param rotation The expected rotation
*/ */
static void 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); DBG("Working on screen %s", randr_id);
E_Randr2_Screen *rotatable_screen = e_randr2_screen_id_find(randr_id); E_Randr2_Screen *rotatable_screen = e_randr2_screen_id_find(randr_id);
@ -402,10 +402,10 @@ sensor_proxy_shutdown(void)
* @param variant * @param variant
* @return Enum specifying the orientation. UNDEFINED by default * @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) _access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant)
{ {
enum screen_rotation rotation = UNDEFINED; screen_rotation rotation = UNDEFINED;
char *type = NULL; char *type = NULL;
if (!eldbus_message_arguments_get(msg, "v", variant)) 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; const char *errname, *errmsg;
enum screen_rotation orientation; screen_rotation orientation;
Eldbus_Message_Iter *variant = NULL; Eldbus_Message_Iter *variant = NULL;
if (eldbus_message_error_get(msg, &errname, &errmsg)) if (eldbus_message_error_get(msg, &errname, &errmsg))

View File

@ -10,14 +10,14 @@
#define EFL_DBUS_ACC_IFACE "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 enum {UNDEFINED, NORMAL, RIGHT_UP, FLIPPED, LEFT_UP} screen_rotation;
typedef struct _DbusAccelerometer DbusAccelerometer; typedef struct _DbusAccelerometer DbusAccelerometer;
struct _DbusAccelerometer struct _DbusAccelerometer
{ {
Eina_Bool has_accelerometer; Eina_Bool has_accelerometer;
enum screen_rotation orientation; screen_rotation orientation;
Eldbus_Proxy *sensor_proxy, *sensor_proxy_properties; Eldbus_Proxy *sensor_proxy, *sensor_proxy_properties;
Eldbus_Pending *pending_has_orientation, *pending_orientation, *pending_acc_claim, *pending_acc_crelease; Eldbus_Pending *pending_has_orientation, *pending_orientation, *pending_acc_claim, *pending_acc_crelease;
Eldbus_Signal_Handler *dbus_property_changed_sh; Eldbus_Signal_Handler *dbus_property_changed_sh;
@ -26,10 +26,10 @@ struct _DbusAccelerometer
/** /**
* Fetch the DBUS interfaces and fill the DbusAccelerometer struct * 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 void
on_has_accelerometer(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED); on_has_accelerometer(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED);