forked from enlightenment/enlightenment
formatting
lot of mixed spaces/tabs here made the code unreadable
This commit is contained in:
parent
f5e19a7721
commit
b5e75eb264
|
@ -25,7 +25,8 @@ _backlight_gadget_update(Instance *inst)
|
||||||
else
|
else
|
||||||
msg.val = inst->val;
|
msg.val = inst->val;
|
||||||
if (msg.val < 0.0) msg.val = 0.0;
|
if (msg.val < 0.0) msg.val = 0.0;
|
||||||
else if (msg.val > 1.0) msg.val = 1.0;
|
else if (msg.val > 1.0)
|
||||||
|
msg.val = 1.0;
|
||||||
edje_object_message_send(elm_layout_edje_get(inst->o_backlight), EDJE_MESSAGE_FLOAT, 0, &msg);
|
edje_object_message_send(elm_layout_edje_get(inst->o_backlight), EDJE_MESSAGE_FLOAT, 0, &msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -312,3 +313,4 @@ backlight_shutdown(void)
|
||||||
}
|
}
|
||||||
E_FREE_LIST(handlers, ecore_event_handler_del);
|
E_FREE_LIST(handlers, ecore_event_handler_del);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,8 @@ struct _Context
|
||||||
E_Menu *menu;
|
E_Menu *menu;
|
||||||
unsigned int notification_id;
|
unsigned int notification_id;
|
||||||
|
|
||||||
struct {
|
struct
|
||||||
|
{
|
||||||
E_Action *incr;
|
E_Action *incr;
|
||||||
E_Action *decr;
|
E_Action *decr;
|
||||||
E_Action *mute;
|
E_Action *mute;
|
||||||
|
@ -399,7 +400,7 @@ _check_changed_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||||
emix_config_save_state_get();
|
emix_config_save_state_get();
|
||||||
if (emix_config_save_get()) e_config_save_queue();
|
if (emix_config_save_get()) e_config_save_queue();
|
||||||
/*
|
/*
|
||||||
*TODO: is it really necessary ? or it will be update
|
* TODO: is it really necessary ? or it will be update
|
||||||
* with the sink changed hanlder
|
* with the sink changed hanlder
|
||||||
*/
|
*/
|
||||||
_mixer_gadget_update();
|
_mixer_gadget_update();
|
||||||
|
@ -897,6 +898,7 @@ _sink_input_event(int type, Emix_Sink_Input *input)
|
||||||
pid = _get_ppid(pid);
|
pid = _get_ppid(pid);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EMIX_SINK_INPUT_REMOVED_EVENT:
|
case EMIX_SINK_INPUT_REMOVED_EVENT:
|
||||||
EINA_LIST_FOREACH(_client_sinks, l, sink)
|
EINA_LIST_FOREACH(_client_sinks, l, sink)
|
||||||
{
|
{
|
||||||
|
@ -908,6 +910,7 @@ _sink_input_event(int type, Emix_Sink_Input *input)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EMIX_SINK_INPUT_CHANGED_EVENT:
|
case EMIX_SINK_INPUT_CHANGED_EVENT:
|
||||||
EINA_LIST_FOREACH(_client_sinks, l, sink)
|
EINA_LIST_FOREACH(_client_sinks, l, sink)
|
||||||
{
|
{
|
||||||
|
@ -930,12 +933,15 @@ _events_cb(void *data EINA_UNUSED, enum Emix_Event type, void *event_info)
|
||||||
case EMIX_SINK_REMOVED_EVENT:
|
case EMIX_SINK_REMOVED_EVENT:
|
||||||
_sink_event(type, event_info);
|
_sink_event(type, event_info);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EMIX_DISCONNECTED_EVENT:
|
case EMIX_DISCONNECTED_EVENT:
|
||||||
_disconnected();
|
_disconnected();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EMIX_READY_EVENT:
|
case EMIX_READY_EVENT:
|
||||||
_ready();
|
_ready();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EMIX_SINK_INPUT_ADDED_EVENT:
|
case EMIX_SINK_INPUT_ADDED_EVENT:
|
||||||
case EMIX_SINK_INPUT_REMOVED_EVENT:
|
case EMIX_SINK_INPUT_REMOVED_EVENT:
|
||||||
case EMIX_SINK_INPUT_CHANGED_EVENT:
|
case EMIX_SINK_INPUT_CHANGED_EVENT:
|
||||||
|
@ -1083,7 +1089,6 @@ _bd_hook_sink_volume_drag_stop(void *data, Evas_Object *obj, void *event_info EI
|
||||||
elm_check_state_set(check, mute);
|
elm_check_state_set(check, mute);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_bd_hook_sink_mute_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
_bd_hook_sink_mute_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||||
{
|
{
|
||||||
|
|
|
@ -141,6 +141,7 @@ _config_update_btn(Evas_Object *button, const int mouse_button)
|
||||||
case 0:
|
case 0:
|
||||||
snprintf(lbl, sizeof(lbl), _("Click to set"));
|
snprintf(lbl, sizeof(lbl), _("Click to set"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
if (e_config->mouse_hand == E_MOUSE_HAND_RIGHT)
|
if (e_config->mouse_hand == E_MOUSE_HAND_RIGHT)
|
||||||
{
|
{
|
||||||
|
@ -158,10 +159,12 @@ _config_update_btn(Evas_Object *button, const int mouse_button)
|
||||||
icon = "preferences-desktop-mouse-extra";
|
icon = "preferences-desktop-mouse-extra";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
snprintf(lbl, sizeof(lbl), _("Middle button"));
|
snprintf(lbl, sizeof(lbl), _("Middle button"));
|
||||||
icon = "preferences-desktop-mouse-middle";
|
icon = "preferences-desktop-mouse-middle";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
if (e_config->mouse_hand == E_MOUSE_HAND_RIGHT)
|
if (e_config->mouse_hand == E_MOUSE_HAND_RIGHT)
|
||||||
{
|
{
|
||||||
|
@ -179,6 +182,7 @@ _config_update_btn(Evas_Object *button, const int mouse_button)
|
||||||
icon = "preferences-desktop-mouse-extra";
|
icon = "preferences-desktop-mouse-extra";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
snprintf(lbl, sizeof(lbl), _("Button %i"), mouse_button);
|
snprintf(lbl, sizeof(lbl), _("Button %i"), mouse_button);
|
||||||
icon = "preferences-desktop-mouse-extra";
|
icon = "preferences-desktop-mouse-extra";
|
||||||
|
|
|
@ -105,3 +105,4 @@ e_modapi_gadget_save(E_Module *m EINA_UNUSED)
|
||||||
e_config_domain_save("module.pager", conf_edd, pager_config);
|
e_config_domain_save("module.pager", conf_edd, pager_config);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -178,9 +178,11 @@ _pager_location_get(Instance *inst)
|
||||||
case E_GADGET_SITE_ORIENT_HORIZONTAL:
|
case E_GADGET_SITE_ORIENT_HORIZONTAL:
|
||||||
s = "top";
|
s = "top";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case E_GADGET_SITE_ORIENT_VERTICAL:
|
case E_GADGET_SITE_ORIENT_VERTICAL:
|
||||||
s = "left";
|
s = "left";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case E_GADGET_SITE_ORIENT_NONE:
|
case E_GADGET_SITE_ORIENT_NONE:
|
||||||
s = "left";
|
s = "left";
|
||||||
break;
|
break;
|
||||||
|
@ -193,9 +195,11 @@ _pager_location_get(Instance *inst)
|
||||||
case E_GADGET_SITE_ORIENT_HORIZONTAL:
|
case E_GADGET_SITE_ORIENT_HORIZONTAL:
|
||||||
s = "bottom";
|
s = "bottom";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case E_GADGET_SITE_ORIENT_VERTICAL:
|
case E_GADGET_SITE_ORIENT_VERTICAL:
|
||||||
s = "left";
|
s = "left";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case E_GADGET_SITE_ORIENT_NONE:
|
case E_GADGET_SITE_ORIENT_NONE:
|
||||||
s = "left";
|
s = "left";
|
||||||
break;
|
break;
|
||||||
|
@ -213,9 +217,11 @@ _pager_location_get(Instance *inst)
|
||||||
case E_GADGET_SITE_ORIENT_HORIZONTAL:
|
case E_GADGET_SITE_ORIENT_HORIZONTAL:
|
||||||
s = "top";
|
s = "top";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case E_GADGET_SITE_ORIENT_VERTICAL:
|
case E_GADGET_SITE_ORIENT_VERTICAL:
|
||||||
s = "right";
|
s = "right";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case E_GADGET_SITE_ORIENT_NONE:
|
case E_GADGET_SITE_ORIENT_NONE:
|
||||||
s = "right";
|
s = "right";
|
||||||
break;
|
break;
|
||||||
|
@ -228,9 +234,11 @@ _pager_location_get(Instance *inst)
|
||||||
case E_GADGET_SITE_ORIENT_HORIZONTAL:
|
case E_GADGET_SITE_ORIENT_HORIZONTAL:
|
||||||
s = "bottom";
|
s = "bottom";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case E_GADGET_SITE_ORIENT_VERTICAL:
|
case E_GADGET_SITE_ORIENT_VERTICAL:
|
||||||
s = "right";
|
s = "right";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case E_GADGET_SITE_ORIENT_NONE:
|
case E_GADGET_SITE_ORIENT_NONE:
|
||||||
s = "right";
|
s = "right";
|
||||||
break;
|
break;
|
||||||
|
@ -250,9 +258,11 @@ _pager_location_get(Instance *inst)
|
||||||
case E_GADGET_SITE_ORIENT_HORIZONTAL:
|
case E_GADGET_SITE_ORIENT_HORIZONTAL:
|
||||||
s = "bottom";
|
s = "bottom";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case E_GADGET_SITE_ORIENT_VERTICAL:
|
case E_GADGET_SITE_ORIENT_VERTICAL:
|
||||||
s = "left";
|
s = "left";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
s = "bottom";
|
s = "bottom";
|
||||||
break;
|
break;
|
||||||
|
@ -316,7 +326,6 @@ _pager_gadget_anchor_change_cb(void *data, Evas_Object *obj, void *event_info EI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_pager_gadget_created_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
_pager_gadget_created_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||||
{
|
{
|
||||||
|
@ -361,13 +370,14 @@ _pager_orient(Instance *inst, E_Gadget_Site_Orient orient)
|
||||||
{
|
{
|
||||||
switch (orient)
|
switch (orient)
|
||||||
{
|
{
|
||||||
|
|
||||||
case E_GADGET_SITE_ORIENT_HORIZONTAL:
|
case E_GADGET_SITE_ORIENT_HORIZONTAL:
|
||||||
inst->pager->invert = EINA_FALSE;
|
inst->pager->invert = EINA_FALSE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case E_GADGET_SITE_ORIENT_VERTICAL:
|
case E_GADGET_SITE_ORIENT_VERTICAL:
|
||||||
inst->pager->invert = EINA_TRUE;
|
inst->pager->invert = EINA_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
inst->pager->invert = EINA_FALSE;
|
inst->pager->invert = EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -445,12 +455,15 @@ _pager_new(Evas *evas, Eina_Bool popup)
|
||||||
case E_POWERSAVE_MODE_HIGH:
|
case E_POWERSAVE_MODE_HIGH:
|
||||||
p->plain = EINA_TRUE;
|
p->plain = EINA_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case E_POWERSAVE_MODE_EXTREME:
|
case E_POWERSAVE_MODE_EXTREME:
|
||||||
p->plain = EINA_TRUE;
|
p->plain = EINA_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case E_POWERSAVE_MODE_FREEZE:
|
case E_POWERSAVE_MODE_FREEZE:
|
||||||
p->plain = EINA_TRUE;
|
p->plain = EINA_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
p->plain = EINA_FALSE;
|
p->plain = EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -488,13 +501,14 @@ _pager_fill(Pager *p)
|
||||||
orient = e_gadget_site_orient_get(e_gadget_site_get(p->inst->o_pager));
|
orient = e_gadget_site_orient_get(e_gadget_site_get(p->inst->o_pager));
|
||||||
switch (orient)
|
switch (orient)
|
||||||
{
|
{
|
||||||
|
|
||||||
case E_GADGET_SITE_ORIENT_HORIZONTAL:
|
case E_GADGET_SITE_ORIENT_HORIZONTAL:
|
||||||
p->invert = EINA_FALSE;
|
p->invert = EINA_FALSE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case E_GADGET_SITE_ORIENT_VERTICAL:
|
case E_GADGET_SITE_ORIENT_VERTICAL:
|
||||||
p->invert = EINA_TRUE;
|
p->invert = EINA_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
p->invert = EINA_FALSE;
|
p->invert = EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1066,7 +1080,7 @@ _button_cb_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNU
|
||||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
|
||||||
if (_pager_check_modifiers(ev->modifiers)) return;
|
if (_pager_check_modifiers(ev->modifiers)) return;
|
||||||
if (ev->button != 3) return;
|
if (ev->button != 3) return;
|
||||||
if(!pager_config) return;
|
if (!pager_config) return;
|
||||||
if (cfg_dialog) return;
|
if (cfg_dialog) return;
|
||||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||||
e_gadget_configure(inst->o_pager);
|
e_gadget_configure(inst->o_pager);
|
||||||
|
@ -1090,12 +1104,15 @@ _pager_cb_config_gadget_updated(Eina_Bool style_changed)
|
||||||
case E_POWERSAVE_MODE_HIGH:
|
case E_POWERSAVE_MODE_HIGH:
|
||||||
p->plain = EINA_TRUE;
|
p->plain = EINA_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case E_POWERSAVE_MODE_EXTREME:
|
case E_POWERSAVE_MODE_EXTREME:
|
||||||
p->plain = EINA_TRUE;
|
p->plain = EINA_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case E_POWERSAVE_MODE_FREEZE:
|
case E_POWERSAVE_MODE_FREEZE:
|
||||||
p->plain = EINA_TRUE;
|
p->plain = EINA_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
p->plain = EINA_FALSE;
|
p->plain = EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1382,8 +1399,8 @@ _pager_window_desk_change(Pager *pager, E_Client *ec)
|
||||||
/* and this pager zone is for this client */
|
/* and this pager zone is for this client */
|
||||||
/* see if the window is in this pager at all */
|
/* see if the window is in this pager at all */
|
||||||
pw = _pager_window_find(pager, ec);
|
pw = _pager_window_find(pager, ec);
|
||||||
if (pw)
|
if (pw) /* is it sticky */
|
||||||
{ /* is it sticky */
|
{
|
||||||
if (ec->sticky)
|
if (ec->sticky)
|
||||||
{
|
{
|
||||||
/* if its sticky and in this pager - its already everywhere, so abort
|
/* if its sticky and in this pager - its already everywhere, so abort
|
||||||
|
@ -1734,7 +1751,6 @@ _pager_cb_event_client_property(void *data EINA_UNUSED, int type EINA_UNUSED, vo
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_pager_cb_event_zone_desk_count_set(void *data EINA_UNUSED, int type EINA_UNUSED, E_Event_Zone_Desk_Count_Set *ev)
|
_pager_cb_event_zone_desk_count_set(void *data EINA_UNUSED, int type EINA_UNUSED, E_Event_Zone_Desk_Count_Set *ev)
|
||||||
{
|
{
|
||||||
|
@ -2129,7 +2145,6 @@ _pager_window_cb_drag_finished(E_Drag *drag, int dropped)
|
||||||
else y = 0;
|
else y = 0;
|
||||||
evas_object_move(pw->client->frame, x, y);
|
evas_object_move(pw->client->frame, x, y);
|
||||||
|
|
||||||
|
|
||||||
if (!(pw->client->lock_user_stacking))
|
if (!(pw->client->lock_user_stacking))
|
||||||
evas_object_raise(pw->client->frame);
|
evas_object_raise(pw->client->frame);
|
||||||
evas_object_focus_set(pw->client->frame, 1);
|
evas_object_focus_set(pw->client->frame, 1);
|
||||||
|
|
|
@ -357,7 +357,7 @@ _screensaver_on(void *data)
|
||||||
#if defined(HAVE_EEZE)
|
#if defined(HAVE_EEZE)
|
||||||
Instance *inst = data;
|
Instance *inst = data;
|
||||||
#else
|
#else
|
||||||
(void) data;
|
(void)data;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_EEZE)
|
#if defined(HAVE_EEZE)
|
||||||
|
@ -417,7 +417,8 @@ _batman_config_updated(Instance *inst)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _warning_popup_dismissed(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
static void
|
||||||
|
_warning_popup_dismissed(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Instance *inst = data;
|
Instance *inst = data;
|
||||||
|
|
||||||
|
@ -425,7 +426,6 @@ static void _warning_popup_dismissed(void *data, Evas_Object *obj EINA_UNUSED, v
|
||||||
E_FREE_FUNC(inst->warning, evas_object_del);
|
E_FREE_FUNC(inst->warning, evas_object_del);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_batman_cb_warning_popup_timeout(void *data)
|
_batman_cb_warning_popup_timeout(void *data)
|
||||||
{
|
{
|
||||||
|
@ -613,13 +613,13 @@ sysinfo_batman_remove(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNU
|
||||||
#if defined(HAVE_EEZE)
|
#if defined(HAVE_EEZE)
|
||||||
_batman_udev_stop(inst);
|
_batman_udev_stop(inst);
|
||||||
#elif defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__)
|
#elif defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__)
|
||||||
(void) inst;
|
(void)inst;
|
||||||
_batman_sysctl_stop();
|
_batman_sysctl_stop();
|
||||||
#elif defined(upower)
|
#elif defined(upower)
|
||||||
(void) inst;
|
(void)inst;
|
||||||
_batman_upower_stop();
|
_batman_upower_stop();
|
||||||
#else
|
#else
|
||||||
(void) inst;
|
(void)inst;
|
||||||
_batman_fallback_stop();
|
_batman_fallback_stop();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -707,7 +707,7 @@ _conf_item_get(int *id)
|
||||||
ci = E_NEW(Config_Item, 1);
|
ci = E_NEW(Config_Item, 1);
|
||||||
|
|
||||||
if (*id != -1)
|
if (*id != -1)
|
||||||
ci->id = eina_list_count(sysinfo_config->items)+1;
|
ci->id = eina_list_count(sysinfo_config->items) + 1;
|
||||||
else
|
else
|
||||||
ci->id = -1;
|
ci->id = -1;
|
||||||
|
|
||||||
|
@ -755,3 +755,4 @@ batman_create(Evas_Object *parent, int *id, E_Gadget_Site_Orient orient EINA_UNU
|
||||||
|
|
||||||
return inst->o_main;
|
return inst->o_main;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -140,12 +140,15 @@ _suspend_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||||
case 0:
|
case 0:
|
||||||
inst->cfg->batman.suspend_method = SUSPEND;
|
inst->cfg->batman.suspend_method = SUSPEND;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
inst->cfg->batman.suspend_method = HIBERNATE;
|
inst->cfg->batman.suspend_method = HIBERNATE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
inst->cfg->batman.suspend_method = SHUTDOWN;
|
inst->cfg->batman.suspend_method = SHUTDOWN;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
inst->cfg->batman.suspend_method = SUSPEND;
|
inst->cfg->batman.suspend_method = SUSPEND;
|
||||||
}
|
}
|
||||||
|
@ -166,18 +169,23 @@ _poll_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||||
case 0:
|
case 0:
|
||||||
inst->cfg->batman.poll_interval = 4;
|
inst->cfg->batman.poll_interval = 4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
inst->cfg->batman.poll_interval = 8;
|
inst->cfg->batman.poll_interval = 8;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
inst->cfg->batman.poll_interval = 32;
|
inst->cfg->batman.poll_interval = 32;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
inst->cfg->batman.poll_interval = 64;
|
inst->cfg->batman.poll_interval = 64;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
inst->cfg->batman.poll_interval = 256;
|
inst->cfg->batman.poll_interval = 256;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
inst->cfg->batman.poll_interval = 32;
|
inst->cfg->batman.poll_interval = 32;
|
||||||
}
|
}
|
||||||
|
@ -367,23 +375,28 @@ batman_configure(Instance *inst)
|
||||||
evas_object_smart_callback_add(o, "changed", _poll_changed, bc);
|
evas_object_smart_callback_add(o, "changed", _poll_changed, bc);
|
||||||
evas_object_show(o);
|
evas_object_show(o);
|
||||||
|
|
||||||
switch(inst->cfg->batman.poll_interval)
|
switch (inst->cfg->batman.poll_interval)
|
||||||
{
|
{
|
||||||
case 4:
|
case 4:
|
||||||
elm_radio_value_set(group, 0);
|
elm_radio_value_set(group, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
elm_radio_value_set(group, 1);
|
elm_radio_value_set(group, 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 32:
|
case 32:
|
||||||
elm_radio_value_set(group, 2);
|
elm_radio_value_set(group, 2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 64:
|
case 64:
|
||||||
elm_radio_value_set(group, 3);
|
elm_radio_value_set(group, 3);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 256:
|
case 256:
|
||||||
elm_radio_value_set(group, 4);
|
elm_radio_value_set(group, 4);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
elm_radio_value_set(group, 2);
|
elm_radio_value_set(group, 2);
|
||||||
}
|
}
|
||||||
|
@ -534,17 +547,20 @@ batman_configure(Instance *inst)
|
||||||
evas_object_smart_callback_add(o, "changed", _suspend_changed, bc);
|
evas_object_smart_callback_add(o, "changed", _suspend_changed, bc);
|
||||||
evas_object_show(o);
|
evas_object_show(o);
|
||||||
|
|
||||||
switch(inst->cfg->batman.suspend_method)
|
switch (inst->cfg->batman.suspend_method)
|
||||||
{
|
{
|
||||||
case SUSPEND:
|
case SUSPEND:
|
||||||
elm_radio_value_set(groupy, 0);
|
elm_radio_value_set(groupy, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HIBERNATE:
|
case HIBERNATE:
|
||||||
elm_radio_value_set(groupy, 1);
|
elm_radio_value_set(groupy, 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SHUTDOWN:
|
case SHUTDOWN:
|
||||||
elm_radio_value_set(groupy, 2);
|
elm_radio_value_set(groupy, 2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
elm_radio_value_set(groupy, 0);
|
elm_radio_value_set(groupy, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -727,7 +727,6 @@ linux_acpi_cb_acpid_add(void *data EINA_UNUSED,
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
linux_acpi_cb_acpid_del(void *data EINA_UNUSED,
|
linux_acpi_cb_acpid_del(void *data EINA_UNUSED,
|
||||||
int type EINA_UNUSED,
|
int type EINA_UNUSED,
|
||||||
|
|
|
@ -98,7 +98,7 @@ _batman_sysctl_start(Instance *inst)
|
||||||
sysctlnametomib("hw.acpi.battery.time", bat->mib_time, &len);
|
sysctlnametomib("hw.acpi.battery.time", bat->mib_time, &len);
|
||||||
|
|
||||||
bat->mib_units = malloc(sizeof(int) * 4);
|
bat->mib_units = malloc(sizeof(int) * 4);
|
||||||
if(!bat->mib_units) return 0;
|
if (!bat->mib_units) return 0;
|
||||||
sysctlnametomib("hw.acpi.battery.units", bat->mib_units, &len);
|
sysctlnametomib("hw.acpi.battery.units", bat->mib_units, &len);
|
||||||
|
|
||||||
bat->last_update = ecore_time_get();
|
bat->last_update = ecore_time_get();
|
||||||
|
@ -175,6 +175,7 @@ _batman_sysctl_battery_update_poll(void *data)
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -324,7 +325,6 @@ _batman_sysctl_battery_update(Instance *inst)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
EINA_LIST_FOREACH(batman_device_ac_adapters, l, ac)
|
EINA_LIST_FOREACH(batman_device_ac_adapters, l, ac)
|
||||||
{
|
{
|
||||||
#if defined(__OpenBSD__) || defined(__NetBSD__)
|
#if defined(__OpenBSD__) || defined(__NetBSD__)
|
||||||
|
@ -350,5 +350,3 @@ _batman_sysctl_battery_update(Instance *inst)
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,7 @@ _bat_get_all_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending E
|
||||||
else if (!strcmp(key, "TimeToEmpty"))
|
else if (!strcmp(key, "TimeToEmpty"))
|
||||||
{
|
{
|
||||||
eldbus_message_iter_arguments_get(variant, "x", &val.i64);
|
eldbus_message_iter_arguments_get(variant, "x", &val.i64);
|
||||||
bat->time_left = (int) val.i64;
|
bat->time_left = (int)val.i64;
|
||||||
if (bat->time_left > 0)
|
if (bat->time_left > 0)
|
||||||
bat->charging = EINA_FALSE;
|
bat->charging = EINA_FALSE;
|
||||||
else
|
else
|
||||||
|
@ -150,27 +150,27 @@ _bat_get_all_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending E
|
||||||
else if (!strcmp(key, "Percentage"))
|
else if (!strcmp(key, "Percentage"))
|
||||||
{
|
{
|
||||||
eldbus_message_iter_arguments_get(variant, "d", &val.d);
|
eldbus_message_iter_arguments_get(variant, "d", &val.d);
|
||||||
bat->percent = (int) val.d;
|
bat->percent = (int)val.d;
|
||||||
}
|
}
|
||||||
else if (!strcmp(key, "Energy"))
|
else if (!strcmp(key, "Energy"))
|
||||||
{
|
{
|
||||||
eldbus_message_iter_arguments_get(variant, "d", &val.d);
|
eldbus_message_iter_arguments_get(variant, "d", &val.d);
|
||||||
bat->current_charge = (int) val.d;
|
bat->current_charge = (int)val.d;
|
||||||
}
|
}
|
||||||
else if (!strcmp(key, "EnergyFullDesign"))
|
else if (!strcmp(key, "EnergyFullDesign"))
|
||||||
{
|
{
|
||||||
eldbus_message_iter_arguments_get(variant, "d", &val.d);
|
eldbus_message_iter_arguments_get(variant, "d", &val.d);
|
||||||
bat->design_charge = (int) val.d;
|
bat->design_charge = (int)val.d;
|
||||||
}
|
}
|
||||||
else if (!strcmp(key, "EnergyFull"))
|
else if (!strcmp(key, "EnergyFull"))
|
||||||
{
|
{
|
||||||
eldbus_message_iter_arguments_get(variant, "d", &val.d);
|
eldbus_message_iter_arguments_get(variant, "d", &val.d);
|
||||||
bat->last_full_charge = (int) val.d;
|
bat->last_full_charge = (int)val.d;
|
||||||
}
|
}
|
||||||
else if (!strcmp(key, "TimeToFull"))
|
else if (!strcmp(key, "TimeToFull"))
|
||||||
{
|
{
|
||||||
eldbus_message_iter_arguments_get(variant, "x", &val.i64);
|
eldbus_message_iter_arguments_get(variant, "x", &val.i64);
|
||||||
bat->time_full = (int) val.i64;
|
bat->time_full = (int)val.i64;
|
||||||
}
|
}
|
||||||
else if (!strcmp(key, "Technology"))
|
else if (!strcmp(key, "Technology"))
|
||||||
{
|
{
|
||||||
|
@ -395,3 +395,4 @@ _batman_upower_stop(void)
|
||||||
E_FREE_FUNC(obj, eldbus_object_unref);
|
E_FREE_FUNC(obj, eldbus_object_unref);
|
||||||
E_FREE_FUNC(conn, eldbus_connection_unref);
|
E_FREE_FUNC(conn, eldbus_connection_unref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,7 @@ _cpuclock_set_thread_done(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -230,6 +231,7 @@ _cpuclock_event_cb_powersave(void *data, int type, void *event)
|
||||||
eina_stringshare_del(inst->cfg->cpuclock.status->orig_governor);
|
eina_stringshare_del(inst->cfg->cpuclock.status->orig_governor);
|
||||||
inst->cfg->cpuclock.status->orig_governor = NULL;
|
inst->cfg->cpuclock.status->orig_governor = NULL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case E_POWERSAVE_MODE_MEDIUM:
|
case E_POWERSAVE_MODE_MEDIUM:
|
||||||
case E_POWERSAVE_MODE_HIGH:
|
case E_POWERSAVE_MODE_HIGH:
|
||||||
if ((inst->cfg->cpuclock.powersave_governor) || (has_conservative))
|
if ((inst->cfg->cpuclock.powersave_governor) || (has_conservative))
|
||||||
|
@ -827,7 +829,7 @@ static void
|
||||||
_cpuclock_cb_frequency_check_main(void *data, Ecore_Thread *th)
|
_cpuclock_cb_frequency_check_main(void *data, Ecore_Thread *th)
|
||||||
{
|
{
|
||||||
Thread_Config *thc = data;
|
Thread_Config *thc = data;
|
||||||
for (;;)
|
for (;; )
|
||||||
{
|
{
|
||||||
Cpu_Status *status;
|
Cpu_Status *status;
|
||||||
|
|
||||||
|
@ -860,9 +862,9 @@ _cpuclock_cb_frequency_check_notify(void *data,
|
||||||
if ((thc->inst->cfg->cpuclock.status) && (status) &&
|
if ((thc->inst->cfg->cpuclock.status) && (status) &&
|
||||||
(
|
(
|
||||||
#if defined(__OpenBSD__)
|
#if defined(__OpenBSD__)
|
||||||
(status->cur_percent != thc->inst->cfg->cpuclock.status->cur_percent ) ||
|
(status->cur_percent != thc->inst->cfg->cpuclock.status->cur_percent) ||
|
||||||
#endif
|
#endif
|
||||||
(status->cur_frequency != thc->inst->cfg->cpuclock.status->cur_frequency ) ||
|
(status->cur_frequency != thc->inst->cfg->cpuclock.status->cur_frequency) ||
|
||||||
(status->cur_min_frequency != thc->inst->cfg->cpuclock.status->cur_min_frequency) ||
|
(status->cur_min_frequency != thc->inst->cfg->cpuclock.status->cur_min_frequency) ||
|
||||||
(status->cur_max_frequency != thc->inst->cfg->cpuclock.status->cur_max_frequency) ||
|
(status->cur_max_frequency != thc->inst->cfg->cpuclock.status->cur_max_frequency) ||
|
||||||
(status->can_set_frequency != thc->inst->cfg->cpuclock.status->can_set_frequency)))
|
(status->can_set_frequency != thc->inst->cfg->cpuclock.status->can_set_frequency)))
|
||||||
|
@ -1002,7 +1004,6 @@ sysinfo_cpuclock_remove(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_U
|
||||||
if (inst->cfg->cpuclock.governor)
|
if (inst->cfg->cpuclock.governor)
|
||||||
eina_stringshare_del(inst->cfg->cpuclock.governor);
|
eina_stringshare_del(inst->cfg->cpuclock.governor);
|
||||||
E_FREE_FUNC(inst->cfg->cpuclock.status, _cpuclock_status_free);
|
E_FREE_FUNC(inst->cfg->cpuclock.status, _cpuclock_status_free);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1125,7 +1126,7 @@ _conf_item_get(int *id)
|
||||||
ci = E_NEW(Config_Item, 1);
|
ci = E_NEW(Config_Item, 1);
|
||||||
|
|
||||||
if (*id != -1)
|
if (*id != -1)
|
||||||
ci->id = eina_list_count(sysinfo_config->items)+1;
|
ci->id = eina_list_count(sysinfo_config->items) + 1;
|
||||||
else
|
else
|
||||||
ci->id = -1;
|
ci->id = -1;
|
||||||
|
|
||||||
|
@ -1166,3 +1167,4 @@ cpuclock_create(Evas_Object *parent, int *id, E_Gadget_Site_Orient orient EINA_U
|
||||||
|
|
||||||
return inst->o_main;
|
return inst->o_main;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -191,18 +191,23 @@ _poll_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||||
case 0:
|
case 0:
|
||||||
inst->cfg->cpuclock.poll_interval = 4;
|
inst->cfg->cpuclock.poll_interval = 4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
inst->cfg->cpuclock.poll_interval = 8;
|
inst->cfg->cpuclock.poll_interval = 8;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
inst->cfg->cpuclock.poll_interval = 32;
|
inst->cfg->cpuclock.poll_interval = 32;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
inst->cfg->cpuclock.poll_interval = 64;
|
inst->cfg->cpuclock.poll_interval = 64;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
inst->cfg->cpuclock.poll_interval = 256;
|
inst->cfg->cpuclock.poll_interval = 256;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
inst->cfg->cpuclock.poll_interval = 32;
|
inst->cfg->cpuclock.poll_interval = 32;
|
||||||
}
|
}
|
||||||
|
@ -348,23 +353,28 @@ cpuclock_configure(Instance *inst)
|
||||||
evas_object_smart_callback_add(o, "changed", _poll_changed, cc);
|
evas_object_smart_callback_add(o, "changed", _poll_changed, cc);
|
||||||
evas_object_show(o);
|
evas_object_show(o);
|
||||||
|
|
||||||
switch(inst->cfg->cpuclock.poll_interval)
|
switch (inst->cfg->cpuclock.poll_interval)
|
||||||
{
|
{
|
||||||
case 4:
|
case 4:
|
||||||
elm_radio_value_set(group, 0);
|
elm_radio_value_set(group, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
elm_radio_value_set(group, 1);
|
elm_radio_value_set(group, 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 32:
|
case 32:
|
||||||
elm_radio_value_set(group, 2);
|
elm_radio_value_set(group, 2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 64:
|
case 64:
|
||||||
elm_radio_value_set(group, 3);
|
elm_radio_value_set(group, 3);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 256:
|
case 256:
|
||||||
elm_radio_value_set(group, 4);
|
elm_radio_value_set(group, 4);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
elm_radio_value_set(group, 2);
|
elm_radio_value_set(group, 2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
# include <sys/sysctl.h>
|
# include <sys/sysctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(__OpenBSD__)
|
#if defined(__OpenBSD__)
|
||||||
int
|
int
|
||||||
_cpuclock_sysctl_frequency(int new_perf)
|
_cpuclock_sysctl_frequency(int new_perf)
|
||||||
|
@ -22,6 +21,7 @@ _cpuclock_sysctl_frequency(int new_perf)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(__FreeBSD__) || defined(__DragonFly__)
|
#elif defined(__FreeBSD__) || defined(__DragonFly__)
|
||||||
int
|
int
|
||||||
_cpuclock_sysctl_frequency(int new_perf)
|
_cpuclock_sysctl_frequency(int new_perf)
|
||||||
|
@ -31,4 +31,5 @@ _cpuclock_sysctl_frequency(int new_perf)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -147,3 +147,4 @@ sys_cpu_pstate(int min, int max, int turbo)
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,7 @@ static void
|
||||||
_cpumonitor_cb_usage_check_main(void *data, Ecore_Thread *th)
|
_cpumonitor_cb_usage_check_main(void *data, Ecore_Thread *th)
|
||||||
{
|
{
|
||||||
Thread_Config *thc = data;
|
Thread_Config *thc = data;
|
||||||
for (;;)
|
for (;; )
|
||||||
{
|
{
|
||||||
if (ecore_thread_check(th)) break;
|
if (ecore_thread_check(th)) break;
|
||||||
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
|
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
|
||||||
|
@ -474,7 +474,7 @@ _conf_item_get(int *id)
|
||||||
ci = E_NEW(Config_Item, 1);
|
ci = E_NEW(Config_Item, 1);
|
||||||
|
|
||||||
if (*id != -1)
|
if (*id != -1)
|
||||||
ci->id = eina_list_count(sysinfo_config->items)+1;
|
ci->id = eina_list_count(sysinfo_config->items) + 1;
|
||||||
else
|
else
|
||||||
ci->id = -1;
|
ci->id = -1;
|
||||||
|
|
||||||
|
|
|
@ -15,23 +15,28 @@ _config_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||||
Instance *inst = data;
|
Instance *inst = data;
|
||||||
int value = elm_radio_value_get(obj);
|
int value = elm_radio_value_get(obj);
|
||||||
|
|
||||||
switch(value)
|
switch (value)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
inst->cfg->cpumonitor.poll_interval = 4;
|
inst->cfg->cpumonitor.poll_interval = 4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
inst->cfg->cpumonitor.poll_interval = 8;
|
inst->cfg->cpumonitor.poll_interval = 8;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
inst->cfg->cpumonitor.poll_interval = 32;
|
inst->cfg->cpumonitor.poll_interval = 32;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
inst->cfg->cpumonitor.poll_interval = 64;
|
inst->cfg->cpumonitor.poll_interval = 64;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
inst->cfg->cpumonitor.poll_interval = 256;
|
inst->cfg->cpumonitor.poll_interval = 256;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
inst->cfg->cpumonitor.poll_interval = 32;
|
inst->cfg->cpumonitor.poll_interval = 32;
|
||||||
}
|
}
|
||||||
|
@ -126,23 +131,28 @@ cpumonitor_configure(Instance *inst)
|
||||||
evas_object_smart_callback_add(o, "changed", _config_changed, inst);
|
evas_object_smart_callback_add(o, "changed", _config_changed, inst);
|
||||||
evas_object_show(o);
|
evas_object_show(o);
|
||||||
|
|
||||||
switch(inst->cfg->cpumonitor.poll_interval)
|
switch (inst->cfg->cpumonitor.poll_interval)
|
||||||
{
|
{
|
||||||
case 4:
|
case 4:
|
||||||
elm_radio_value_set(group, 0);
|
elm_radio_value_set(group, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
elm_radio_value_set(group, 1);
|
elm_radio_value_set(group, 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 32:
|
case 32:
|
||||||
elm_radio_value_set(group, 2);
|
elm_radio_value_set(group, 2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 64:
|
case 64:
|
||||||
elm_radio_value_set(group, 3);
|
elm_radio_value_set(group, 3);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 256:
|
case 256:
|
||||||
elm_radio_value_set(group, 4);
|
elm_radio_value_set(group, 4);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
elm_radio_value_set(group, 2);
|
elm_radio_value_set(group, 2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ _cpumonitor_proc_getcores(void)
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
fclose (f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
return cores;
|
return cores;
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ _cpumonitor_proc_getusage(unsigned long *prev_total,
|
||||||
char *line, *tok;
|
char *line, *tok;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
line = strchr(buf, ' ')+1;
|
line = strchr(buf, ' ') + 1;
|
||||||
tok = strtok(line, " ");
|
tok = strtok(line, " ");
|
||||||
while (tok)
|
while (tok)
|
||||||
{
|
{
|
||||||
|
@ -66,7 +66,8 @@ _cpumonitor_proc_getusage(unsigned long *prev_total,
|
||||||
if (total_change != 0)
|
if (total_change != 0)
|
||||||
percent = 100 * (1 - ((float)idle_change / (float)total_change));
|
percent = 100 * (1 - ((float)idle_change / (float)total_change));
|
||||||
if (percent > 100) percent = 100;
|
if (percent > 100) percent = 100;
|
||||||
else if (percent < 0) percent = 0;
|
else if (percent < 0)
|
||||||
|
percent = 0;
|
||||||
*prev_total = total;
|
*prev_total = total;
|
||||||
*prev_idle = idle;
|
*prev_idle = idle;
|
||||||
*prev_percent = percent;
|
*prev_percent = percent;
|
||||||
|
@ -98,7 +99,8 @@ _cpumonitor_proc_getusage(unsigned long *prev_total,
|
||||||
if (total_change != 0)
|
if (total_change != 0)
|
||||||
percent = 100 * (1 - ((float)idle_change / (float)total_change));
|
percent = 100 * (1 - ((float)idle_change / (float)total_change));
|
||||||
if (percent > 100) percent = 100;
|
if (percent > 100) percent = 100;
|
||||||
else if (percent < 0) percent = 0;
|
else if (percent < 0)
|
||||||
|
percent = 0;
|
||||||
core->percent = percent;
|
core->percent = percent;
|
||||||
core->total = total;
|
core->total = total;
|
||||||
core->idle = idle;
|
core->idle = idle;
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
# define CPU_STATES 6
|
# define CPU_STATES 6
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
_cpumonitor_sysctl_getcores(void)
|
_cpumonitor_sysctl_getcores(void)
|
||||||
{
|
{
|
||||||
int cores = 0;
|
int cores = 0;
|
||||||
|
@ -25,7 +25,6 @@ _cpumonitor_sysctl_getcores(void)
|
||||||
return cores;
|
return cores;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_cpumonitor_sysctl_getusage(unsigned long *prev_total, unsigned long *prev_idle, int *prev_percent, Eina_List *cores)
|
_cpumonitor_sysctl_getusage(unsigned long *prev_total, unsigned long *prev_idle, int *prev_percent, Eina_List *cores)
|
||||||
{
|
{
|
||||||
|
@ -70,13 +69,13 @@ _cpumonitor_sysctl_getusage(unsigned long *prev_total, unsigned long *prev_idle,
|
||||||
core->total = total;
|
core->total = total;
|
||||||
core->idle = cpu[4];
|
core->idle = cpu[4];
|
||||||
|
|
||||||
percent_all += (int) percent;
|
percent_all += (int)percent;
|
||||||
total_all += total;
|
total_all += total;
|
||||||
idle_all += core->idle;
|
idle_all += core->idle;
|
||||||
}
|
}
|
||||||
*prev_total = total_all / ncpu;
|
*prev_total = total_all / ncpu;
|
||||||
*prev_idle = idle_all / ncpu;
|
*prev_idle = idle_all / ncpu;
|
||||||
*prev_percent = (int) (percent_all / ncpu);
|
*prev_percent = (int)(percent_all / ncpu);
|
||||||
#elif defined(__OpenBSD__)
|
#elif defined(__OpenBSD__)
|
||||||
int ncpu = _cpumonitor_sysctl_getcores();
|
int ncpu = _cpumonitor_sysctl_getcores();
|
||||||
if (!ncpu) return;
|
if (!ncpu) return;
|
||||||
|
@ -109,7 +108,7 @@ _cpumonitor_sysctl_getusage(unsigned long *prev_total, unsigned long *prev_idle,
|
||||||
|
|
||||||
*prev_total = total;
|
*prev_total = total;
|
||||||
*prev_idle = idle; // cpu_times[3];
|
*prev_idle = idle; // cpu_times[3];
|
||||||
*prev_percent = (int) percent;
|
*prev_percent = (int)percent;
|
||||||
}
|
}
|
||||||
else if (ncpu > 1)
|
else if (ncpu > 1)
|
||||||
{
|
{
|
||||||
|
@ -140,7 +139,7 @@ _cpumonitor_sysctl_getusage(unsigned long *prev_total, unsigned long *prev_idle,
|
||||||
|
|
||||||
core->percent = percent;
|
core->percent = percent;
|
||||||
|
|
||||||
percent_all += (int) percent;
|
percent_all += (int)percent;
|
||||||
total_all += total;
|
total_all += total;
|
||||||
idle_all += core->idle;
|
idle_all += core->idle;
|
||||||
}
|
}
|
||||||
|
|
|
@ -275,7 +275,7 @@ static void
|
||||||
_memusage_cb_usage_check_main(void *data, Ecore_Thread *th)
|
_memusage_cb_usage_check_main(void *data, Ecore_Thread *th)
|
||||||
{
|
{
|
||||||
Thread_Config *thc = data;
|
Thread_Config *thc = data;
|
||||||
for (;;)
|
for (;; )
|
||||||
{
|
{
|
||||||
if (ecore_thread_check(th)) break;
|
if (ecore_thread_check(th)) break;
|
||||||
#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
|
#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
|
||||||
|
@ -395,7 +395,6 @@ _memusage_removed_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_data)
|
||||||
|
|
||||||
if (inst->o_main != event_data) return;
|
if (inst->o_main != event_data) return;
|
||||||
|
|
||||||
|
|
||||||
if (inst->cfg->memusage.popup)
|
if (inst->cfg->memusage.popup)
|
||||||
E_FREE_FUNC(inst->cfg->memusage.popup, evas_object_del);
|
E_FREE_FUNC(inst->cfg->memusage.popup, evas_object_del);
|
||||||
if (inst->cfg->memusage.configure)
|
if (inst->cfg->memusage.configure)
|
||||||
|
@ -502,7 +501,6 @@ sysinfo_memusage_create(Evas_Object *parent, Instance *inst)
|
||||||
_memusage_resize_cb, inst);
|
_memusage_resize_cb, inst);
|
||||||
evas_object_show(inst->cfg->memusage.o_gadget);
|
evas_object_show(inst->cfg->memusage.o_gadget);
|
||||||
|
|
||||||
|
|
||||||
E_LIST_HANDLER_APPEND(inst->cfg->memusage.handlers, E_EVENT_SCREENSAVER_ON, _screensaver_on, inst);
|
E_LIST_HANDLER_APPEND(inst->cfg->memusage.handlers, E_EVENT_SCREENSAVER_ON, _screensaver_on, inst);
|
||||||
E_LIST_HANDLER_APPEND(inst->cfg->memusage.handlers, E_EVENT_SCREENSAVER_OFF, _screensaver_off, inst);
|
E_LIST_HANDLER_APPEND(inst->cfg->memusage.handlers, E_EVENT_SCREENSAVER_OFF, _screensaver_off, inst);
|
||||||
|
|
||||||
|
@ -526,7 +524,7 @@ _conf_item_get(int *id)
|
||||||
ci = E_NEW(Config_Item, 1);
|
ci = E_NEW(Config_Item, 1);
|
||||||
|
|
||||||
if (*id != -1)
|
if (*id != -1)
|
||||||
ci->id = eina_list_count(sysinfo_config->items)+1;
|
ci->id = eina_list_count(sysinfo_config->items) + 1;
|
||||||
else
|
else
|
||||||
ci->id = -1;
|
ci->id = -1;
|
||||||
|
|
||||||
|
|
|
@ -15,23 +15,28 @@ _config_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||||
Instance *inst = data;
|
Instance *inst = data;
|
||||||
int value = elm_radio_value_get(obj);
|
int value = elm_radio_value_get(obj);
|
||||||
|
|
||||||
switch(value)
|
switch (value)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
inst->cfg->memusage.poll_interval = 4;
|
inst->cfg->memusage.poll_interval = 4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
inst->cfg->memusage.poll_interval = 8;
|
inst->cfg->memusage.poll_interval = 8;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
inst->cfg->memusage.poll_interval = 32;
|
inst->cfg->memusage.poll_interval = 32;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
inst->cfg->memusage.poll_interval = 64;
|
inst->cfg->memusage.poll_interval = 64;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
inst->cfg->memusage.poll_interval = 256;
|
inst->cfg->memusage.poll_interval = 256;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
inst->cfg->memusage.poll_interval = 32;
|
inst->cfg->memusage.poll_interval = 32;
|
||||||
}
|
}
|
||||||
|
@ -126,23 +131,28 @@ memusage_configure(Instance *inst)
|
||||||
evas_object_smart_callback_add(o, "changed", _config_changed, inst);
|
evas_object_smart_callback_add(o, "changed", _config_changed, inst);
|
||||||
evas_object_show(o);
|
evas_object_show(o);
|
||||||
|
|
||||||
switch(inst->cfg->memusage.poll_interval)
|
switch (inst->cfg->memusage.poll_interval)
|
||||||
{
|
{
|
||||||
case 4:
|
case 4:
|
||||||
elm_radio_value_set(group, 0);
|
elm_radio_value_set(group, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
elm_radio_value_set(group, 1);
|
elm_radio_value_set(group, 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 32:
|
case 32:
|
||||||
elm_radio_value_set(group, 2);
|
elm_radio_value_set(group, 2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 64:
|
case 64:
|
||||||
elm_radio_value_set(group, 3);
|
elm_radio_value_set(group, 3);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 256:
|
case 256:
|
||||||
elm_radio_value_set(group, 4);
|
elm_radio_value_set(group, 4);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
elm_radio_value_set(group, 2);
|
elm_radio_value_set(group, 2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
#include "memusage.h"
|
#include "memusage.h"
|
||||||
|
|
||||||
|
unsigned long
|
||||||
unsigned long _line_parse(const char *line)
|
_line_parse(const char *line)
|
||||||
{
|
{
|
||||||
char *p, *tok;
|
char *p, *tok;
|
||||||
|
|
||||||
p = strchr(line, ':') + 1;
|
p = strchr(line, ':') + 1;
|
||||||
while(isspace(*p)) p++;
|
while (isspace(*p))
|
||||||
|
p++;
|
||||||
tok = strtok(p, " ");
|
tok = strtok(p, " ");
|
||||||
return atol(tok);
|
return atol(tok);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _memusage_proc_getusage(unsigned long *mem_total,
|
void
|
||||||
|
_memusage_proc_getusage(unsigned long *mem_total,
|
||||||
unsigned long *mem_used,
|
unsigned long *mem_used,
|
||||||
unsigned long *mem_cached,
|
unsigned long *mem_cached,
|
||||||
unsigned long *mem_buffers,
|
unsigned long *mem_buffers,
|
||||||
|
@ -39,7 +41,7 @@ void _memusage_proc_getusage(unsigned long *mem_total,
|
||||||
f = fopen("/proc/meminfo", "r");
|
f = fopen("/proc/meminfo", "r");
|
||||||
if (!f) return;
|
if (!f) return;
|
||||||
|
|
||||||
while(fgets(line, sizeof(line), f) != NULL)
|
while (fgets(line, sizeof(line), f) != NULL)
|
||||||
{
|
{
|
||||||
if (!strncmp("MemTotal:", line, 9))
|
if (!strncmp("MemTotal:", line, 9))
|
||||||
{
|
{
|
||||||
|
@ -93,3 +95,4 @@ void _memusage_proc_getusage(unsigned long *mem_total,
|
||||||
*swp_total = tmp_swp_total;
|
*swp_total = tmp_swp_total;
|
||||||
*swp_used = tmp_swp_total - tmp_swp_free;
|
*swp_used = tmp_swp_total - tmp_swp_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,14 +26,17 @@ _sysctlfromname(const char *name, void *mib, int depth, size_t *len)
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void _memsize_bytes_to_kb(unsigned long *bytes)
|
void
|
||||||
|
_memsize_bytes_to_kb(unsigned long *bytes)
|
||||||
{
|
{
|
||||||
*bytes = (unsigned int) *bytes >> 10;
|
*bytes = (unsigned int)*bytes >> 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _memusage_sysctl_getusage(unsigned long *mem_total,
|
void
|
||||||
|
_memusage_sysctl_getusage(unsigned long *mem_total,
|
||||||
unsigned long *mem_used,
|
unsigned long *mem_used,
|
||||||
unsigned long *mem_cached,
|
unsigned long *mem_cached,
|
||||||
unsigned long *mem_buffers,
|
unsigned long *mem_buffers,
|
||||||
|
@ -136,7 +139,7 @@ void _memusage_sysctl_getusage(unsigned long *mem_total,
|
||||||
rnswap = swapctl(SWAP_STATS, swdev, nswap);
|
rnswap = swapctl(SWAP_STATS, swdev, nswap);
|
||||||
if (rnswap == -1) goto swap_out;
|
if (rnswap == -1) goto swap_out;
|
||||||
|
|
||||||
for (i = 0; i < nswap; i++)// nswap; i++)
|
for (i = 0; i < nswap; i++) // nswap; i++)
|
||||||
{
|
{
|
||||||
if (swdev[i].se_flags & SWF_ENABLE)
|
if (swdev[i].se_flags & SWF_ENABLE)
|
||||||
{
|
{
|
||||||
|
@ -162,3 +165,4 @@ swap_out:
|
||||||
_memsize_bytes_to_kb(mem_shared);
|
_memsize_bytes_to_kb(mem_shared);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ static void
|
||||||
_netstatus_cb_usage_check_main(void *data, Ecore_Thread *th)
|
_netstatus_cb_usage_check_main(void *data, Ecore_Thread *th)
|
||||||
{
|
{
|
||||||
Thread_Config *thc = data;
|
Thread_Config *thc = data;
|
||||||
for (;;)
|
for (;; )
|
||||||
{
|
{
|
||||||
char rin[4096], rout[4096];
|
char rin[4096], rout[4096];
|
||||||
|
|
||||||
|
@ -406,7 +406,7 @@ _conf_item_get(int *id)
|
||||||
ci = E_NEW(Config_Item, 1);
|
ci = E_NEW(Config_Item, 1);
|
||||||
|
|
||||||
if (*id != -1)
|
if (*id != -1)
|
||||||
ci->id = eina_list_count(sysinfo_config->items)+1;
|
ci->id = eina_list_count(sysinfo_config->items) + 1;
|
||||||
else
|
else
|
||||||
ci->id = -1;
|
ci->id = -1;
|
||||||
|
|
||||||
|
|
|
@ -18,23 +18,28 @@ _poll_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||||
Instance *inst = nc->inst;
|
Instance *inst = nc->inst;
|
||||||
int value = elm_radio_value_get(obj);
|
int value = elm_radio_value_get(obj);
|
||||||
|
|
||||||
switch(value)
|
switch (value)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
inst->cfg->netstatus.poll_interval = 4;
|
inst->cfg->netstatus.poll_interval = 4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
inst->cfg->netstatus.poll_interval = 8;
|
inst->cfg->netstatus.poll_interval = 8;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
inst->cfg->netstatus.poll_interval = 32;
|
inst->cfg->netstatus.poll_interval = 32;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
inst->cfg->netstatus.poll_interval = 64;
|
inst->cfg->netstatus.poll_interval = 64;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
inst->cfg->netstatus.poll_interval = 256;
|
inst->cfg->netstatus.poll_interval = 256;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
inst->cfg->netstatus.poll_interval = 32;
|
inst->cfg->netstatus.poll_interval = 32;
|
||||||
}
|
}
|
||||||
|
@ -244,23 +249,28 @@ netstatus_configure(Instance *inst)
|
||||||
evas_object_smart_callback_add(o, "changed", _poll_changed, nc);
|
evas_object_smart_callback_add(o, "changed", _poll_changed, nc);
|
||||||
evas_object_show(o);
|
evas_object_show(o);
|
||||||
|
|
||||||
switch(inst->cfg->netstatus.poll_interval)
|
switch (inst->cfg->netstatus.poll_interval)
|
||||||
{
|
{
|
||||||
case 4:
|
case 4:
|
||||||
elm_radio_value_set(group, 0);
|
elm_radio_value_set(group, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
elm_radio_value_set(group, 1);
|
elm_radio_value_set(group, 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 32:
|
case 32:
|
||||||
elm_radio_value_set(group, 2);
|
elm_radio_value_set(group, 2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 64:
|
case 64:
|
||||||
elm_radio_value_set(group, 3);
|
elm_radio_value_set(group, 3);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 256:
|
case 256:
|
||||||
elm_radio_value_set(group, 4);
|
elm_radio_value_set(group, 4);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
elm_radio_value_set(group, 2);
|
elm_radio_value_set(group, 2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,9 @@ _netstatus_proc_getrstatus(Eina_Bool automax,
|
||||||
f = fopen("/proc/net/dev", "r");
|
f = fopen("/proc/net/dev", "r");
|
||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
while(fgets(buf, sizeof(buf), f) != NULL)
|
while (fgets(buf, sizeof(buf), f) != NULL)
|
||||||
{
|
{
|
||||||
if (sscanf (buf, "%s %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu "
|
if (sscanf(buf, "%s %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu "
|
||||||
"%lu %lu %lu %lu\n", dummys, &in, &dummy, &dummy,
|
"%lu %lu %lu %lu\n", dummys, &in, &dummy, &dummy,
|
||||||
&dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy,
|
&dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy,
|
||||||
&dummy, &dummy, &dummy, &dummy, &dummy, &dummy) < 17)
|
&dummy, &dummy, &dummy, &dummy, &dummy, &dummy) < 17)
|
||||||
|
@ -42,7 +42,8 @@ _netstatus_proc_getrstatus(Eina_Bool automax,
|
||||||
if (*prev_inmax > 0)
|
if (*prev_inmax > 0)
|
||||||
percent = 100 * ((float)*prev_incurrent / (float)*prev_inmax);
|
percent = 100 * ((float)*prev_incurrent / (float)*prev_inmax);
|
||||||
if (percent > 100) percent = 100;
|
if (percent > 100) percent = 100;
|
||||||
else if (percent < 0) percent = 0;
|
else if (percent < 0)
|
||||||
|
percent = 0;
|
||||||
*prev_inpercent = percent;
|
*prev_inpercent = percent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,9 +64,9 @@ _netstatus_proc_gettstatus(Eina_Bool automax,
|
||||||
f = fopen("/proc/net/dev", "r");
|
f = fopen("/proc/net/dev", "r");
|
||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
while(fgets(buf, sizeof(buf), f) != NULL)
|
while (fgets(buf, sizeof(buf), f) != NULL)
|
||||||
{
|
{
|
||||||
if (sscanf (buf, "%s %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu "
|
if (sscanf(buf, "%s %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu "
|
||||||
"%lu %lu %lu %lu\n", dummys, &dummy, &dummy, &dummy,
|
"%lu %lu %lu %lu\n", dummys, &dummy, &dummy, &dummy,
|
||||||
&dummy, &dummy, &dummy, &dummy, &dummy, &out, &dummy,
|
&dummy, &dummy, &dummy, &dummy, &dummy, &out, &dummy,
|
||||||
&dummy, &dummy, &dummy, &dummy, &dummy, &dummy) < 17)
|
&dummy, &dummy, &dummy, &dummy, &dummy, &dummy) < 17)
|
||||||
|
@ -89,7 +90,8 @@ _netstatus_proc_gettstatus(Eina_Bool automax,
|
||||||
if (*prev_outcurrent > 0)
|
if (*prev_outcurrent > 0)
|
||||||
percent = 100 * ((float)*prev_outcurrent / (float)*prev_outmax);
|
percent = 100 * ((float)*prev_outcurrent / (float)*prev_outmax);
|
||||||
if (percent > 100) percent = 100;
|
if (percent > 100) percent = 100;
|
||||||
else if (percent < 0) percent = 0;
|
else if (percent < 0)
|
||||||
|
percent = 0;
|
||||||
*prev_outpercent = percent;
|
*prev_outpercent = percent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,11 +83,11 @@ _openbsd_generic_network_status(unsigned long int *in, unsigned long int *out)
|
||||||
struct if_data if_data;
|
struct if_data if_data;
|
||||||
|
|
||||||
ifreq.ifr_data = (void *)&if_data;
|
ifreq.ifr_data = (void *)&if_data;
|
||||||
strncpy(ifreq.ifr_name, ifa->ifa_name, IFNAMSIZ-1);
|
strncpy(ifreq.ifr_name, ifa->ifa_name, IFNAMSIZ - 1);
|
||||||
if (ioctl(sock, SIOCGIFDATA, &ifreq) < 0)
|
if (ioctl(sock, SIOCGIFDATA, &ifreq) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
struct if_data * const ifi = &if_data;
|
struct if_data *const ifi = &if_data;
|
||||||
if (ifi->ifi_type == IFT_ETHER || ifi->ifi_type == IFT_IEEE80211)
|
if (ifi->ifi_type == IFT_ETHER || ifi->ifi_type == IFT_IEEE80211)
|
||||||
{
|
{
|
||||||
if (ifi->ifi_ibytes)
|
if (ifi->ifi_ibytes)
|
||||||
|
@ -103,6 +103,7 @@ _openbsd_generic_network_status(unsigned long int *in, unsigned long int *out)
|
||||||
}
|
}
|
||||||
close(sock);
|
close(sock);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -137,7 +138,8 @@ _netstatus_sysctl_getrstatus(Eina_Bool automax,
|
||||||
if (*prev_inmax > 0)
|
if (*prev_inmax > 0)
|
||||||
percent = 100 * ((float)*prev_incurrent / (float)*prev_inmax);
|
percent = 100 * ((float)*prev_incurrent / (float)*prev_inmax);
|
||||||
if (percent > 100) percent = 100;
|
if (percent > 100) percent = 100;
|
||||||
else if (percent < 0) percent = 0;
|
else if (percent < 0)
|
||||||
|
percent = 0;
|
||||||
*prev_inpercent = percent;
|
*prev_inpercent = percent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -174,7 +176,8 @@ _netstatus_sysctl_gettstatus(Eina_Bool automax,
|
||||||
if (*prev_outcurrent > 0)
|
if (*prev_outcurrent > 0)
|
||||||
percent = 100 * ((float)*prev_outcurrent / (float)*prev_outmax);
|
percent = 100 * ((float)*prev_outcurrent / (float)*prev_outmax);
|
||||||
if (percent > 100) percent = 100;
|
if (percent > 100) percent = 100;
|
||||||
else if (percent < 0) percent = 0;
|
else if (percent < 0)
|
||||||
|
percent = 0;
|
||||||
*prev_outpercent = percent;
|
*prev_outpercent = percent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ _conf_item_get(int *id)
|
||||||
ci = E_NEW(Config_Item, 1);
|
ci = E_NEW(Config_Item, 1);
|
||||||
|
|
||||||
if (*id != -1)
|
if (*id != -1)
|
||||||
ci->id = eina_list_count(sysinfo_config->items)+1;
|
ci->id = eina_list_count(sysinfo_config->items) + 1;
|
||||||
else
|
else
|
||||||
ci->id = -1;
|
ci->id = -1;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,8 @@ _thermal_thread_free(Tempthread *tth)
|
||||||
eina_stringshare_del(tth->sensor_name);
|
eina_stringshare_del(tth->sensor_name);
|
||||||
eina_stringshare_del(tth->sensor_path);
|
eina_stringshare_del(tth->sensor_path);
|
||||||
#if defined(HAVE_EEZE)
|
#if defined(HAVE_EEZE)
|
||||||
EINA_LIST_FREE(tth->tempdevs, s) eina_stringshare_del(s);
|
EINA_LIST_FREE(tth->tempdevs, s)
|
||||||
|
eina_stringshare_del(s);
|
||||||
#endif
|
#endif
|
||||||
e_powersave_sleeper_free(tth->sleeper);
|
e_powersave_sleeper_free(tth->sleeper);
|
||||||
E_FREE(tth->extn);
|
E_FREE(tth->extn);
|
||||||
|
@ -24,7 +25,8 @@ _thermal_face_level_set(Instance *inst, double level)
|
||||||
Edje_Message_Float msg;
|
Edje_Message_Float msg;
|
||||||
|
|
||||||
if (level < 0.0) level = 0.0;
|
if (level < 0.0) level = 0.0;
|
||||||
else if (level > 1.0) level = 1.0;
|
else if (level > 1.0)
|
||||||
|
level = 1.0;
|
||||||
msg.val = level;
|
msg.val = level;
|
||||||
edje_object_message_send(elm_layout_edje_get(inst->cfg->thermal.o_gadget), EDJE_MESSAGE_FLOAT, 1, &msg);
|
edje_object_message_send(elm_layout_edje_get(inst->cfg->thermal.o_gadget), EDJE_MESSAGE_FLOAT, 1, &msg);
|
||||||
}
|
}
|
||||||
|
@ -32,7 +34,6 @@ _thermal_face_level_set(Instance *inst, double level)
|
||||||
static void
|
static void
|
||||||
_thermal_apply(Instance *inst, int temp)
|
_thermal_apply(Instance *inst, int temp)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (inst->cfg->thermal.temp == temp) return;
|
if (inst->cfg->thermal.temp == temp) return;
|
||||||
inst->cfg->thermal.temp = temp;
|
inst->cfg->thermal.temp = temp;
|
||||||
if (temp != -999)
|
if (temp != -999)
|
||||||
|
@ -82,6 +83,7 @@ _thermal_udev_poll(void *data)
|
||||||
_thermal_apply(tth->inst, temp);
|
_thermal_apply(tth->inst, temp);
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
|
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
|
||||||
|
@ -91,7 +93,7 @@ _thermal_check_sysctl(void *data, Ecore_Thread *th)
|
||||||
Tempthread *tth = data;
|
Tempthread *tth = data;
|
||||||
int ptemp = -500, temp;
|
int ptemp = -500, temp;
|
||||||
|
|
||||||
for (;;)
|
for (;; )
|
||||||
{
|
{
|
||||||
if (ecore_thread_check(th)) break;
|
if (ecore_thread_check(th)) break;
|
||||||
temp = thermal_sysctl_get(tth);
|
temp = thermal_sysctl_get(tth);
|
||||||
|
@ -101,6 +103,7 @@ _thermal_check_sysctl(void *data, Ecore_Thread *th)
|
||||||
if (ecore_thread_check(th)) break;
|
if (ecore_thread_check(th)) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(HAVE_EEZE) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__)
|
#if !defined(HAVE_EEZE) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__)
|
||||||
|
@ -109,7 +112,7 @@ _thermal_check_fallback(void *data, Ecore_Thread *th)
|
||||||
{
|
{
|
||||||
Tempthread *tth = data;
|
Tempthread *tth = data;
|
||||||
int ptemp = -500, temp;
|
int ptemp = -500, temp;
|
||||||
for (;;)
|
for (;; )
|
||||||
{
|
{
|
||||||
if (ecore_thread_check(th)) break;
|
if (ecore_thread_check(th)) break;
|
||||||
temp = thermal_fallback_get(tth);
|
temp = thermal_fallback_get(tth);
|
||||||
|
@ -119,6 +122,7 @@ _thermal_check_fallback(void *data, Ecore_Thread *th)
|
||||||
if (ecore_thread_check(th)) break;
|
if (ecore_thread_check(th)) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(HAVE_EEZE)
|
#if !defined(HAVE_EEZE)
|
||||||
|
@ -136,8 +140,8 @@ _thermal_check_done(void *data, Ecore_Thread *th EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Tempthread *tth = data;
|
Tempthread *tth = data;
|
||||||
_thermal_thread_free(tth);
|
_thermal_thread_free(tth);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static Evas_Object *
|
static Evas_Object *
|
||||||
|
@ -230,6 +234,7 @@ _thermal_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UN
|
||||||
e_gadget_configure(inst->o_main);
|
e_gadget_configure(inst->o_main);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_screensaver_on(void *data)
|
_screensaver_on(void *data)
|
||||||
{
|
{
|
||||||
|
@ -253,7 +258,6 @@ _screensaver_off(void *data)
|
||||||
return ECORE_CALLBACK_RENEW;
|
return ECORE_CALLBACK_RENEW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_thermal_config_updated(Instance *inst)
|
_thermal_config_updated(Instance *inst)
|
||||||
{
|
{
|
||||||
|
@ -451,7 +455,7 @@ _conf_item_get(int *id)
|
||||||
ci = E_NEW(Config_Item, 1);
|
ci = E_NEW(Config_Item, 1);
|
||||||
|
|
||||||
if (*id != -1)
|
if (*id != -1)
|
||||||
ci->id = eina_list_count(sysinfo_config->items)+1;
|
ci->id = eina_list_count(sysinfo_config->items) + 1;
|
||||||
else
|
else
|
||||||
ci->id = -1;
|
ci->id = -1;
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,6 @@ _update_low_temperature(void *data, Evas_Object *obj EINA_UNUSED, void *event_in
|
||||||
inst->cfg->thermal.low = value;
|
inst->cfg->thermal.low = value;
|
||||||
e_config_save_queue();
|
e_config_save_queue();
|
||||||
_thermal_config_updated(inst);
|
_thermal_config_updated(inst);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -51,9 +50,11 @@ _units_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||||
case 0:
|
case 0:
|
||||||
inst->cfg->thermal.units = CELSIUS;
|
inst->cfg->thermal.units = CELSIUS;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
inst->cfg->thermal.units = FAHRENHEIT;
|
inst->cfg->thermal.units = FAHRENHEIT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
inst->cfg->thermal.units = CELSIUS;
|
inst->cfg->thermal.units = CELSIUS;
|
||||||
}
|
}
|
||||||
|
@ -103,18 +104,23 @@ _poll_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||||
case 0:
|
case 0:
|
||||||
inst->cfg->thermal.poll_interval = 4;
|
inst->cfg->thermal.poll_interval = 4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
inst->cfg->thermal.poll_interval = 8;
|
inst->cfg->thermal.poll_interval = 8;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
inst->cfg->thermal.poll_interval = 32;
|
inst->cfg->thermal.poll_interval = 32;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
inst->cfg->thermal.poll_interval = 64;
|
inst->cfg->thermal.poll_interval = 64;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
inst->cfg->thermal.poll_interval = 256;
|
inst->cfg->thermal.poll_interval = 256;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
inst->cfg->thermal.poll_interval = 32;
|
inst->cfg->thermal.poll_interval = 32;
|
||||||
}
|
}
|
||||||
|
@ -182,14 +188,16 @@ thermal_configure(Instance *inst)
|
||||||
evas_object_smart_callback_add(o, "changed", _units_changed, tc);
|
evas_object_smart_callback_add(o, "changed", _units_changed, tc);
|
||||||
evas_object_show(o);
|
evas_object_show(o);
|
||||||
|
|
||||||
switch(inst->cfg->thermal.units)
|
switch (inst->cfg->thermal.units)
|
||||||
{
|
{
|
||||||
case CELSIUS:
|
case CELSIUS:
|
||||||
elm_radio_value_set(groupu, 0);
|
elm_radio_value_set(groupu, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FAHRENHEIT:
|
case FAHRENHEIT:
|
||||||
elm_radio_value_set(groupu, 1);
|
elm_radio_value_set(groupu, 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
elm_radio_value_set(groupu, 0);
|
elm_radio_value_set(groupu, 0);
|
||||||
}
|
}
|
||||||
|
@ -258,23 +266,28 @@ thermal_configure(Instance *inst)
|
||||||
evas_object_smart_callback_add(o, "changed", _poll_changed, tc);
|
evas_object_smart_callback_add(o, "changed", _poll_changed, tc);
|
||||||
evas_object_show(o);
|
evas_object_show(o);
|
||||||
|
|
||||||
switch(inst->cfg->thermal.poll_interval)
|
switch (inst->cfg->thermal.poll_interval)
|
||||||
{
|
{
|
||||||
case 4:
|
case 4:
|
||||||
elm_radio_value_set(group, 0);
|
elm_radio_value_set(group, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
elm_radio_value_set(group, 1);
|
elm_radio_value_set(group, 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 32:
|
case 32:
|
||||||
elm_radio_value_set(group, 2);
|
elm_radio_value_set(group, 2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 64:
|
case 64:
|
||||||
elm_radio_value_set(group, 3);
|
elm_radio_value_set(group, 3);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 256:
|
case 256:
|
||||||
elm_radio_value_set(group, 4);
|
elm_radio_value_set(group, 4);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
elm_radio_value_set(group, 2);
|
elm_radio_value_set(group, 2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,6 +193,7 @@ init(Tempthread *tth)
|
||||||
{
|
{
|
||||||
case SENSOR_TYPE_NONE:
|
case SENSOR_TYPE_NONE:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SENSOR_TYPE_OMNIBOOK:
|
case SENSOR_TYPE_OMNIBOOK:
|
||||||
tth->sensor_path = eina_stringshare_add("/proc/omnibook/temperature");
|
tth->sensor_path = eina_stringshare_add("/proc/omnibook/temperature");
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -26,13 +26,13 @@ typedef struct
|
||||||
|
|
||||||
#if defined(__FreeBSD__) || defined(__DragonFly__)
|
#if defined(__FreeBSD__) || defined(__DragonFly__)
|
||||||
static const char *sources[] =
|
static const char *sources[] =
|
||||||
{
|
{
|
||||||
"hw.acpi.thermal.tz0.temperature",
|
"hw.acpi.thermal.tz0.temperature",
|
||||||
"dev.cpu.0.temperature",
|
"dev.cpu.0.temperature",
|
||||||
"dev.aibs.0.temp.0",
|
"dev.aibs.0.temp.0",
|
||||||
"dev.lm75.0.temperature",
|
"dev.lm75.0.temperature",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__OpenBSD__)
|
#if defined(__OpenBSD__)
|
||||||
|
@ -187,7 +187,7 @@ check(Tempthread *tth)
|
||||||
goto error;
|
goto error;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (ret) return temp;
|
if (ret) return temp;
|
||||||
|
|
||||||
return -999;
|
return -999;
|
||||||
error:
|
error:
|
||||||
|
@ -208,4 +208,5 @@ thermal_sysctl_get(Tempthread *tth)
|
||||||
temp = check(tth);
|
temp = check(tth);
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -48,3 +48,4 @@ thermal_udev_get(Tempthread *tth)
|
||||||
}
|
}
|
||||||
return -999;
|
return -999;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,3 +26,4 @@ e_modapi_gadget_save(E_Module *m EINA_UNUSED)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue