forked from enlightenment/enlightenment
make bulb gadget change glow/brightness based on actual backlight
brightness. SVN revision: 60306
This commit is contained in:
parent
27ed7c4764
commit
004bdade85
|
@ -11886,18 +11886,55 @@ collections {
|
|||
/*** MOD: BACKLIGHT ***/
|
||||
group { name: "e/modules/backlight/main";
|
||||
images {
|
||||
image: "bulb.png" COMP;
|
||||
image: "bulb-0.png" COMP;
|
||||
image: "bulb-1.png" COMP;
|
||||
image: "bulb-2.png" COMP;
|
||||
}
|
||||
min: 16 16;
|
||||
max: 128 128;
|
||||
script {
|
||||
public message(Msg_Type:type, id, ...) {
|
||||
if ((type == MSG_FLOAT) && (id == 0)) {
|
||||
new Float:val;
|
||||
val = getfarg(2);
|
||||
set_tween_state(PART:"glow", val, "default", 0.0, "full", 0.0);
|
||||
set_tween_state(PART:"glow2", val, "default", 0.0, "full", 0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
part {
|
||||
name: "glow";
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "base";
|
||||
rel2.to: "base";
|
||||
image.normal: "bulb-1.png";
|
||||
color: 255 255 255 0;
|
||||
}
|
||||
description { state: "full" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
}
|
||||
part {
|
||||
name: "base";
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
description { state: "default" 0.0;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: BOTH;
|
||||
image.normal: "bulb.png";
|
||||
image.normal: "bulb-0.png";
|
||||
}
|
||||
}
|
||||
part {
|
||||
name: "glow2";
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "base";
|
||||
rel2.to: "base";
|
||||
image.normal: "bulb-2.png";
|
||||
color: 255 255 255 0;
|
||||
}
|
||||
description { state: "full" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -454,4 +454,6 @@ flip_pmt.png \
|
|||
flip_shad.png \
|
||||
flip_t.png \
|
||||
flip_colon.png \
|
||||
bulb.png
|
||||
bulb-0.png \
|
||||
bulb-1.png \
|
||||
bulb-2.png
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 648 B |
Binary file not shown.
Before Width: | Height: | Size: 3.2 KiB |
|
@ -2986,7 +2986,7 @@ _e_border_shape_input_rectangle_set(E_Border* bd)
|
|||
{
|
||||
if (bd->visible) // not shaped input
|
||||
{
|
||||
if (!bd->comp_hidden)
|
||||
if (!((bd->comp_hidden) || (bd->tmp_input_hidden > 0)))
|
||||
ecore_x_composite_window_events_enable(bd->win);
|
||||
else
|
||||
ecore_x_composite_window_events_disable(bd->win);
|
||||
|
@ -3132,7 +3132,7 @@ _e_border_show(E_Border *bd)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!bd->comp_hidden)
|
||||
if (!((bd->comp_hidden) || (bd->tmp_input_hidden > 0)))
|
||||
{
|
||||
_e_border_shape_input_rectangle_set(bd);
|
||||
// not anymore
|
||||
|
@ -8914,7 +8914,49 @@ e_border_comp_hidden_set(E_Border *bd,
|
|||
|
||||
bd->comp_hidden = hidden;
|
||||
|
||||
if (bd->comp_hidden)
|
||||
if ((bd->comp_hidden) || (bd->tmp_input_hidden > 0))
|
||||
{
|
||||
ecore_x_composite_window_events_disable(bd->win);
|
||||
ecore_x_window_ignore_set(bd->win, EINA_TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
_e_border_shape_input_rectangle_set(bd);
|
||||
ecore_x_window_ignore_set(bd->win, EINA_FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_border_tmp_input_hidden_push(E_Border *bd)
|
||||
{
|
||||
E_OBJECT_CHECK(bd);
|
||||
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
|
||||
|
||||
bd->tmp_input_hidden++;
|
||||
if (bd->tmp_input_hidden != 1) return;
|
||||
|
||||
if ((bd->comp_hidden) || (bd->tmp_input_hidden > 0))
|
||||
{
|
||||
ecore_x_composite_window_events_disable(bd->win);
|
||||
ecore_x_window_ignore_set(bd->win, EINA_TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
_e_border_shape_input_rectangle_set(bd);
|
||||
ecore_x_window_ignore_set(bd->win, EINA_FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_border_tmp_input_hidden_pop(E_Border *bd)
|
||||
{
|
||||
E_OBJECT_CHECK(bd);
|
||||
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
|
||||
|
||||
bd->tmp_input_hidden--;
|
||||
if (bd->tmp_input_hidden != 0) return;
|
||||
|
||||
if ((bd->comp_hidden) || (bd->tmp_input_hidden > 0))
|
||||
{
|
||||
ecore_x_composite_window_events_disable(bd->win);
|
||||
ecore_x_window_ignore_set(bd->win, EINA_TRUE);
|
||||
|
|
|
@ -566,9 +566,12 @@ struct _E_Border
|
|||
unsigned char post_move : 1;
|
||||
unsigned char post_resize : 1;
|
||||
unsigned char post_show : 1;
|
||||
|
||||
Ecore_Idle_Enterer *post_job;
|
||||
|
||||
Eina_Bool argb;
|
||||
|
||||
int tmp_input_hidden;
|
||||
};
|
||||
|
||||
struct _E_Border_Pending_Move_Resize
|
||||
|
@ -709,6 +712,8 @@ EAPI E_Border *e_border_under_pointer_get(E_Desk *desk, E_Border *exclude);
|
|||
EAPI int e_border_pointer_warp_to_center(E_Border *bd);
|
||||
|
||||
EAPI void e_border_comp_hidden_set(E_Border *bd, Eina_Bool hidden);
|
||||
EAPI void e_border_tmp_input_hidden_push(E_Border *bd);
|
||||
EAPI void e_border_tmp_input_hidden_pop(E_Border *bd);
|
||||
|
||||
extern EAPI int E_EVENT_BORDER_RESIZE;
|
||||
extern EAPI int E_EVENT_BORDER_MOVE;
|
||||
|
|
|
@ -597,6 +597,7 @@ _e_desk_show_begin(E_Desk *desk, int mode, int dx, int dy)
|
|||
}
|
||||
else if ((bd->desk == desk) && (!bd->sticky))
|
||||
{
|
||||
e_border_tmp_input_hidden_push(bd);
|
||||
bd->fx.start.t = t;
|
||||
if (mode == 1)
|
||||
{
|
||||
|
@ -670,11 +671,19 @@ _e_desk_show_end(E_Desk *desk)
|
|||
if (!bd->visible)
|
||||
e_border_show(bd);
|
||||
}
|
||||
e_border_tmp_input_hidden_pop(bd);
|
||||
}
|
||||
}
|
||||
|
||||
if (e_config->focus_last_focused_per_desktop)
|
||||
e_desk_last_focused_focus(desk);
|
||||
if ((e_config->focus_policy == E_FOCUS_MOUSE) ||
|
||||
(e_config->focus_policy == E_FOCUS_SLOPPY))
|
||||
{
|
||||
if (e_config->focus_last_focused_per_desktop)
|
||||
{
|
||||
if (!e_border_under_pointer_get(desk, NULL))
|
||||
e_desk_last_focused_focus(desk);
|
||||
}
|
||||
}
|
||||
|
||||
e_container_border_list_free(bl);
|
||||
ecore_x_window_shadow_tree_flush();
|
||||
|
|
|
@ -41,6 +41,18 @@ static E_Action *act = NULL;
|
|||
|
||||
static void _backlight_popup_free(Instance *inst);
|
||||
|
||||
static void
|
||||
_backlight_gadget_update(Instance *inst)
|
||||
{
|
||||
Edje_Message_Float msg;
|
||||
|
||||
msg.val = inst->val;
|
||||
if (msg.val < 0.0) msg.val = 0.0;
|
||||
else if (msg.val > 1.0) msg.val = 1.0;
|
||||
printf("%3.3f\n", msg.val);
|
||||
edje_object_message_send(inst->o_backlight, EDJE_MESSAGE_FLOAT, 0, &msg);
|
||||
}
|
||||
|
||||
static void
|
||||
_backlight_input_win_del(Instance *inst)
|
||||
{
|
||||
|
@ -91,6 +103,7 @@ _backlight_input_win_key_down_cb(void *data, int type __UNUSED__, void *event)
|
|||
inst->val = v;
|
||||
e_backlight_mode_set(inst->gcc->gadcon->zone, E_BACKLIGHT_MODE_NORMAL);
|
||||
e_backlight_level_set(inst->gcc->gadcon->zone, v, 0.0);
|
||||
_backlight_gadget_update(inst);
|
||||
}
|
||||
else if ((!strcmp(keysym, "Down")) ||
|
||||
(!strcmp(keysym, "Right")) ||
|
||||
|
@ -107,6 +120,7 @@ _backlight_input_win_key_down_cb(void *data, int type __UNUSED__, void *event)
|
|||
inst->val = v;
|
||||
e_backlight_mode_set(inst->gcc->gadcon->zone, E_BACKLIGHT_MODE_NORMAL);
|
||||
e_backlight_level_set(inst->gcc->gadcon->zone, v, 0.0);
|
||||
_backlight_gadget_update(inst);
|
||||
}
|
||||
else if ((!strcmp(keysym, "0")) ||
|
||||
(!strcmp(keysym, "1")) ||
|
||||
|
@ -124,6 +138,7 @@ _backlight_input_win_key_down_cb(void *data, int type __UNUSED__, void *event)
|
|||
inst->val = v;
|
||||
e_backlight_mode_set(inst->gcc->gadcon->zone, E_BACKLIGHT_MODE_NORMAL);
|
||||
e_backlight_level_set(inst->gcc->gadcon->zone, v, 0.0);
|
||||
_backlight_gadget_update(inst);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -149,7 +164,7 @@ _backlight_input_win_key_down_cb(void *data, int type __UNUSED__, void *event)
|
|||
mod |= E_BINDING_MODIFIER_WIN;
|
||||
|
||||
if (bind->key && (!strcmp(bind->key, ev->keyname)) &&
|
||||
((bind->modifiers == mod) || (bind->any_mod)))
|
||||
((bind->modifiers == (int)mod) || (bind->any_mod)))
|
||||
{
|
||||
_backlight_popup_free(inst);
|
||||
break;
|
||||
|
@ -199,9 +214,9 @@ static void
|
|||
_slider_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
Instance *inst = data;
|
||||
printf("ch cb %3.3f\n", inst->val);
|
||||
e_backlight_mode_set(inst->gcc->gadcon->zone, E_BACKLIGHT_MODE_NORMAL);
|
||||
e_backlight_level_set(inst->gcc->gadcon->zone, inst->val, 0.0);
|
||||
_backlight_gadget_update(inst);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -215,6 +230,7 @@ _backlight_popup_new(Instance *inst)
|
|||
e_backlight_update();
|
||||
e_backlight_mode_set(inst->gcc->gadcon->zone, E_BACKLIGHT_MODE_NORMAL);
|
||||
inst->val = e_backlight_level_get(inst->gcc->gadcon->zone);
|
||||
_backlight_gadget_update(inst);
|
||||
|
||||
inst->popup = e_gadcon_popup_new(inst->gcc);
|
||||
evas = inst->popup->win->evas;
|
||||
|
|
Loading…
Reference in New Issue