Sysinfo Gadget: Unify define macro checking.
This commit is contained in:
parent
d7538011ec
commit
139045c120
|
@ -605,7 +605,7 @@ sysinfo_batman_remove(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNU
|
|||
E_FREE_FUNC(inst->cfg->batman.configure, evas_object_del);
|
||||
EINA_LIST_FREE(inst->cfg->batman.handlers, handler)
|
||||
ecore_event_handler_del(handler);
|
||||
#ifdef HAVE_EEZE
|
||||
#if defined(HAVE_EEZE)
|
||||
_batman_udev_stop(inst);
|
||||
#elif defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
(void) inst;
|
||||
|
@ -731,7 +731,7 @@ _conf_item_get(int *id)
|
|||
ci->batman.time_left = -2;
|
||||
ci->batman.have_battery = -2;
|
||||
ci->batman.have_power = -2;
|
||||
#if defined HAVE_EEZE || defined __OpenBSD__ || defined __NetBSD__
|
||||
#if defined(HAVE_EEZE) || defined(__OpenBSD__) || defined(__NetBSD__)
|
||||
ci->batman.fuzzy = 0;
|
||||
#endif
|
||||
ci->batman.desktop_notifications = 0;
|
||||
|
|
|
@ -27,12 +27,12 @@ struct _Battery
|
|||
{
|
||||
Instance *inst;
|
||||
const char *udi;
|
||||
#if defined HAVE_EEZE || defined __OpenBSD__ || defined __DragonFly__ || defined __FreeBSD__ || defined __NetBSD__
|
||||
#if defined(HAVE_EEZE) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
Ecore_Poller *poll;
|
||||
#endif
|
||||
Eina_Bool present:1;
|
||||
Eina_Bool charging:1;
|
||||
#if defined HAVE_EEZE || defined __OpenBSD__ || defined __DragonFly__ || defined __FreeBSD__ || defined __NetBSD__
|
||||
#if defined(HAVE_EEZE) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
double last_update;
|
||||
double percent;
|
||||
double current_charge;
|
||||
|
@ -98,12 +98,12 @@ EINTERN void _batman_device_update(Instance *inst);
|
|||
EINTERN int _batman_fallback_start(Instance *inst);
|
||||
EINTERN void _batman_fallback_stop(void);
|
||||
/* end batman_fallback.c */
|
||||
#ifdef HAVE_EEZE
|
||||
#if defined(HAVE_EEZE)
|
||||
/* in batman_udev.c */
|
||||
EINTERN int _batman_udev_start(Instance *inst);
|
||||
EINTERN void _batman_udev_stop(Instance *inst);
|
||||
/* end batman_udev.c */
|
||||
#elif !defined __OpenBSD__ && !defined __DragonFly__ && !defined __FreeBSD__ && !defined __NetBSD__
|
||||
#elif !defined(__OpenBSD__) && !defined(__DragonFly__) && !defined(__FreeBSD__) && !defined(__NetBSD__)
|
||||
/* in batman_upower.c */
|
||||
EINTERN int _batman_upower_start(Instance *inst);
|
||||
EINTERNvoid _batman_upower_stop(void);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "batman.h"
|
||||
|
||||
#ifdef HAVE_CFBASE_H
|
||||
#if defined(HAVE_CFBASE_H)
|
||||
# include <CFBase.h>
|
||||
# include <CFNumber.h>
|
||||
# include <CFArray.h>
|
||||
|
|
|
@ -88,7 +88,7 @@ _cpuclock_set_thread_done(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
|
|||
void
|
||||
_cpuclock_set_governor(const char *governor)
|
||||
{
|
||||
#if defined __FreeBSD__ || defined __OpenBSD__
|
||||
#if defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||
return;
|
||||
#endif
|
||||
char buf[4096], exe[4096];
|
||||
|
@ -132,7 +132,7 @@ _cpuclock_set_frequency(int frequency)
|
|||
void
|
||||
_cpuclock_set_pstate(int min, int max, int turbo)
|
||||
{
|
||||
#if defined __FreeBSD__ || defined __OpenBSD__
|
||||
#if defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||
return;
|
||||
#endif
|
||||
char buf[4096], exe[4096];
|
||||
|
@ -852,7 +852,7 @@ _cpuclock_cb_frequency_check_notify(void *data,
|
|||
|
||||
if ((inst->cfg->cpuclock.status) && (status) &&
|
||||
(
|
||||
#ifdef __OpenBSD__
|
||||
#if defined(__OpenBSD__)
|
||||
(status->cur_percent != inst->cfg->cpuclock.status->cur_percent ) ||
|
||||
#endif
|
||||
(status->cur_frequency != inst->cfg->cpuclock.status->cur_frequency ) ||
|
||||
|
|
|
@ -26,7 +26,7 @@ EINTERN void _cpuclock_config_updated(Instance *inst);
|
|||
EINTERN void _cpuclock_set_governor(const char *governor);
|
||||
EINTERN void _cpuclock_set_frequency(int frequency);
|
||||
EINTERN void _cpuclock_set_pstate(int min, int max, int turbo);
|
||||
#if defined __OpenBSD__ || defined __FreeBSD__
|
||||
#if defined(__OpenBSD__) || defined(__FreeBSD__)
|
||||
EINTERN int _cpuclock_sysctl_frequency(int new_perf);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -567,7 +567,7 @@ cpuclock_configure(Instance *inst)
|
|||
elm_radio_state_value_set(o, i);
|
||||
E_ALIGN(o, 0.0, 0.0);
|
||||
E_WEIGHT(o, EVAS_HINT_EXPAND, 0);
|
||||
#ifdef __OpenBSD__
|
||||
#if defined(__OpenBSD__)
|
||||
snprintf(buf, sizeof(buf), "%i %%", frequency);
|
||||
#else
|
||||
if (frequency < 1000000)
|
||||
|
@ -581,7 +581,7 @@ cpuclock_configure(Instance *inst)
|
|||
evas_object_smart_callback_add(o, "changed", _frequency_changed, cc);
|
||||
evas_object_show(o);
|
||||
|
||||
#ifdef __OpenBSD__
|
||||
#if defined(__OpenBSD__)
|
||||
if (inst->cfg->cpuclock.status->cur_percent == frequency)
|
||||
value = i;
|
||||
#else
|
||||
|
|
|
@ -462,10 +462,10 @@ sysinfo_memusage_remove(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_U
|
|||
}
|
||||
EINA_LIST_FREE(inst->cfg->memusage.handlers, handler)
|
||||
ecore_event_handler_del(handler);
|
||||
inst->cfg->thermal.done = EINA_TRUE;
|
||||
inst->cfg->memusage.done = EINA_TRUE;
|
||||
if (inst->cfg->esm == E_SYSINFO_MODULE_SYSINFO)
|
||||
{
|
||||
if (inst->cfg->memusage.done && inst->cfg->cpumonitor.done &&
|
||||
if (inst->cfg->thermal.done && inst->cfg->cpumonitor.done &&
|
||||
inst->cfg->netstatus.done && inst->cfg->cpuclock.done && inst->cfg->batman.done)
|
||||
{
|
||||
sysinfo_config->items = eina_list_remove(sysinfo_config->items, inst->cfg);
|
||||
|
|
|
@ -28,7 +28,7 @@ sysinfo_init(void)
|
|||
E_CONFIG_VAL(D, T, batman.suspend_below, INT);
|
||||
E_CONFIG_VAL(D, T, batman.suspend_method, INT);
|
||||
E_CONFIG_VAL(D, T, batman.force_mode, INT);
|
||||
#if defined HAVE_EEZE || defined __OpenBSD__ || defined __NetBSD__
|
||||
#if defined(HAVE_EEZE) || defined(__OpenBSD__) || defined(__NetBSD__)
|
||||
E_CONFIG_VAL(D, T, batman.fuzzy, INT);
|
||||
#endif
|
||||
E_CONFIG_VAL(D, T, batman.desktop_notifications, INT);
|
||||
|
@ -82,7 +82,7 @@ sysinfo_init(void)
|
|||
ci->batman.time_left = -2;
|
||||
ci->batman.have_battery = -2;
|
||||
ci->batman.have_power = -2;
|
||||
#if defined HAVE_EEZE || defined __OpenBSD__ || defined __NetBSD__
|
||||
#if defined(HAVE_EEZ)E || defined(__OpenBSD__) || defined(__NetBSD__)
|
||||
ci->batman.fuzzy = 0;
|
||||
#endif
|
||||
ci->batman.desktop_notifications = 0;
|
||||
|
|
|
@ -101,7 +101,7 @@ _conf_item_get(int *id)
|
|||
ci->batman.time_left = -2;
|
||||
ci->batman.have_battery = -2;
|
||||
ci->batman.have_power = -2;
|
||||
#if defined HAVE_EEZE || defined __OpenBSD__ || defined __NetBSD__
|
||||
#if defined(HAVE_EEZE) || defined(__OpenBSD__) || defined(__NetBSD__)
|
||||
ci->batman.fuzzy = 0;
|
||||
#endif
|
||||
ci->batman.desktop_notifications = 0;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define SYSINFO_H
|
||||
|
||||
#include "e.h"
|
||||
#ifdef HAVE_EEZE
|
||||
#if defined(HAVE_EEZE)
|
||||
# include <Eeze.h>
|
||||
#else
|
||||
# include <Eldbus.h>
|
||||
|
@ -39,7 +39,7 @@ enum _Netstatus_Unit
|
|||
typedef enum _Sensor_Type
|
||||
{
|
||||
SENSOR_TYPE_NONE,
|
||||
#if defined __FreeBSD__ || defined __OpenBSD__ || defined __DragonFly__
|
||||
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
|
||||
SENSOR_TYPE_FREEBSD,
|
||||
SENSOR_TYPE_OPENBSD,
|
||||
#else
|
||||
|
@ -77,7 +77,7 @@ struct _Tempthread
|
|||
const char *sensor_path;
|
||||
void *extn;
|
||||
E_Powersave_Sleeper *sleeper;
|
||||
#ifdef HAVE_EEZE
|
||||
#if defined(HAVE_EEZE)
|
||||
Eina_List *tempdevs;
|
||||
#endif
|
||||
Eina_Bool initted : 1;
|
||||
|
@ -88,7 +88,7 @@ struct _Cpu_Status
|
|||
Eina_List *frequencies;
|
||||
Eina_List *governors;
|
||||
int cur_frequency;
|
||||
#ifdef __OpenBSD__
|
||||
#if defined(__OpenBSD__)
|
||||
int cur_percent;
|
||||
#endif
|
||||
int cur_min_frequency;
|
||||
|
@ -146,11 +146,11 @@ struct _Config_Item
|
|||
int desktop_notifications;
|
||||
Eina_List *handlers;
|
||||
Eina_Bool done;
|
||||
#ifdef HAVE_EEZE
|
||||
#if defined(HAVE_EEZE)
|
||||
Eeze_Udev_Watch *acwatch;
|
||||
Eeze_Udev_Watch *batwatch;
|
||||
#endif
|
||||
#if defined HAVE_EEZE || defined __OpenBSD__ || defined __NetBSD__
|
||||
#if defined(HAVE_EEZE) || defined(__OpenBSD__) || defined(__NetBSD__)
|
||||
Eina_Bool fuzzy;
|
||||
int fuzzcount;
|
||||
#endif
|
||||
|
@ -167,7 +167,7 @@ struct _Config_Item
|
|||
int temp;
|
||||
const char *sensor_name;
|
||||
Unit units;
|
||||
#ifdef HAVE_EEZE
|
||||
#if defined(HAVE_EEZE)
|
||||
Ecore_Poller *poller;
|
||||
Tempthread *tth;
|
||||
#endif
|
||||
|
|
|
@ -13,11 +13,11 @@ struct _Thermal_Config
|
|||
};
|
||||
|
||||
|
||||
#ifdef HAVE_EEZE
|
||||
#if defined(HAVE_EEZE)
|
||||
EINTERN int thermal_udev_get(Tempthread *tth);
|
||||
#endif
|
||||
|
||||
#if defined __OpenBSD__ || defined __DragonFly__ || defined __FreeBSD__
|
||||
#if defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD__)
|
||||
EINTERN int thermal_sysctl_get(Tempthread *tth);
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue