e_acpi: Add function to get lid status

So we can know lid status without waiting for a lid event.
devs/discomfitor/eo
Sebastian Dransfeld 9 years ago
parent 7656e10f04
commit ed520d31a1
  1. 17
      src/bin/e_acpi.c
  2. 2
      src/bin/e_acpi.h

@ -174,6 +174,23 @@ e_acpi_shutdown(void)
return 1;
}
EINTERN E_Acpi_Lid_Status
e_acpi_lid_status_get(void)
{
int i;
for (i = 0; _devices_simple[i].name; i++)
{
if (_devices_simple[i].type == E_ACPI_TYPE_LID)
{
/* TODO: Can bus be anything other than LID? */
return _e_acpi_lid_status_get(_devices_simple[i].name, "LID");
}
}
return E_ACPI_LID_UNKNOWN;
}
EAPI void
e_acpi_events_freeze(void)
{

@ -71,6 +71,8 @@ struct _E_Event_Acpi
EINTERN int e_acpi_init(void);
EINTERN int e_acpi_shutdown(void);
EINTERN E_Acpi_Lid_Status e_acpi_lid_status_get(void);
EAPI void e_acpi_events_freeze(void);
EAPI void e_acpi_events_thaw(void);

Loading…
Cancel
Save