Formatting love to comp-scale.

SVN revision: 83314
This commit is contained in:
Gustavo Lima Chaves 2013-01-25 00:49:03 +00:00 committed by Tom Hacohen
parent 4823d743f0
commit 6220019b6d
3 changed files with 1658 additions and 1529 deletions

View File

@ -7,25 +7,48 @@
// while scale is active?
//
static E_Gadcon_Client *_gc_init_scale(E_Gadcon *gc, const char *name, const char *id, const char *style);
static E_Gadcon_Client *_gc_init_scale_all(E_Gadcon *gc, const char *name, const char *id, const char *style);
static E_Gadcon_Client *_gc_init_pager(E_Gadcon *gc, const char *name, const char *id, const char *style);
static const char *_gc_label_scale(const E_Gadcon_Client_Class *client_class);
static const char *_gc_label_scale_all(const E_Gadcon_Client_Class *client_class);
static const char *_gc_label_pager(const E_Gadcon_Client_Class *client_class);
static void _gc_shutdown(E_Gadcon_Client *gcc);
static void _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient);
static const char *_gc_id_new(const E_Gadcon_Client_Class *client_class);
static Evas_Object *_gc_icon(const E_Gadcon_Client_Class *client_class, Evas *evas);
static E_Gadcon_Client *_gc_init_scale(E_Gadcon *gc,
const char *name,
const char *id,
const char *style);
static E_Gadcon_Client *_gc_init_scale_all(E_Gadcon *gc,
const char *name,
const char *id,
const char *style);
static E_Gadcon_Client *_gc_init_pager(E_Gadcon *gc,
const char *name,
const char *id,
const char *style);
static const char *_gc_label_scale(const E_Gadcon_Client_Class *);
static const char *_gc_label_scale_all(const E_Gadcon_Client_Class *);
static const char *_gc_label_pager(const E_Gadcon_Client_Class *);
static void _gc_shutdown(E_Gadcon_Client *gcc);
static void _gc_orient(E_Gadcon_Client *gcc,
E_Gadcon_Orient orient);
static const char *_gc_id_new(const E_Gadcon_Client_Class *client_class);
static Evas_Object *_gc_icon(const E_Gadcon_Client_Class *client_class,
Evas *evas);
static void _scale_conf_new(void);
static void _scale_conf_free(void);
static Config_Item *_scale_conf_item_get(const char *id);
static void _scale_gc_cb_mouse_down_scale(void *data, Evas *evas, Evas_Object *obj, void *event);
static void _scale_gc_cb_mouse_down_scale_all(void *data, Evas *evas, Evas_Object *obj, void *event);
static void _scale_gc_cb_mouse_down_pager(void *data, Evas *evas, Evas_Object *obj, void *event);
static void _scale_gc_cb_menu_post(void *data, E_Menu *menu);
static void _scale_gc_cb_menu_configure(void *data, E_Menu *mn, E_Menu_Item *mi);
static void _scale_conf_new(void);
static void _scale_conf_free(void);
static Config_Item *_scale_conf_item_get(const char *id);
static void _scale_gc_cb_mouse_down_scale(void *data,
Evas *evas,
Evas_Object *obj,
void *event);
static void _scale_gc_cb_mouse_down_scale_all(void *data,
Evas *evas,
Evas_Object *obj,
void *event);
static void _scale_gc_cb_mouse_down_pager(void *data,
Evas *evas,
Evas_Object *obj,
void *event);
static void _scale_gc_cb_menu_post(void *data,
E_Menu *menu);
static void _scale_gc_cb_menu_configure(void *data,
E_Menu *mn,
E_Menu_Item *mi);
static E_Action *act = NULL;
static int _hold_count = 0;
@ -36,39 +59,54 @@ e_mod_hold_modifier_check(Ecore_Event_Key *ev)
{
if (!_hold_mod)
return EINA_TRUE;
if ((_hold_mod & ECORE_EVENT_MODIFIER_SHIFT) && (!strcmp(ev->key, "Shift_L")))
if ((_hold_mod & ECORE_EVENT_MODIFIER_SHIFT) &&
(!strcmp(ev->key, "Shift_L")))
_hold_count--;
else if ((_hold_mod & ECORE_EVENT_MODIFIER_SHIFT) && (!strcmp(ev->key, "Shift_R")))
else if ((_hold_mod & ECORE_EVENT_MODIFIER_SHIFT) &&
(!strcmp(ev->key, "Shift_R")))
_hold_count--;
else if ((_hold_mod & ECORE_EVENT_MODIFIER_CTRL) && (!strcmp(ev->key, "Control_L")))
else if ((_hold_mod & ECORE_EVENT_MODIFIER_CTRL) &&
(!strcmp(ev->key, "Control_L")))
_hold_count--;
else if ((_hold_mod & ECORE_EVENT_MODIFIER_CTRL) && (!strcmp(ev->key, "Control_R")))
else if ((_hold_mod & ECORE_EVENT_MODIFIER_CTRL) &&
(!strcmp(ev->key, "Control_R")))
_hold_count--;
else if ((_hold_mod & ECORE_EVENT_MODIFIER_ALT) && (!strcmp(ev->key, "Alt_L")))
else if ((_hold_mod & ECORE_EVENT_MODIFIER_ALT) &&
(!strcmp(ev->key, "Alt_L")))
_hold_count--;
else if ((_hold_mod & ECORE_EVENT_MODIFIER_ALT) && (!strcmp(ev->key, "Alt_R")))
else if ((_hold_mod & ECORE_EVENT_MODIFIER_ALT) &&
(!strcmp(ev->key, "Alt_R")))
_hold_count--;
else if ((_hold_mod & ECORE_EVENT_MODIFIER_ALT) && (!strcmp(ev->key, "Meta_L")))
else if ((_hold_mod & ECORE_EVENT_MODIFIER_ALT) &&
(!strcmp(ev->key, "Meta_L")))
_hold_count--;
else if ((_hold_mod & ECORE_EVENT_MODIFIER_ALT) && (!strcmp(ev->key, "Meta_R")))
else if ((_hold_mod & ECORE_EVENT_MODIFIER_ALT) &&
(!strcmp(ev->key, "Meta_R")))
_hold_count--;
else if ((_hold_mod & ECORE_EVENT_MODIFIER_ALT) && (!strcmp(ev->key, "Super_L")))
else if ((_hold_mod & ECORE_EVENT_MODIFIER_ALT) &&
(!strcmp(ev->key, "Super_L")))
_hold_count--;
else if ((_hold_mod & ECORE_EVENT_MODIFIER_ALT) && (!strcmp(ev->key, "Super_R")))
else if ((_hold_mod & ECORE_EVENT_MODIFIER_ALT) &&
(!strcmp(ev->key, "Super_R")))
_hold_count--;
else if ((_hold_mod & ECORE_EVENT_MODIFIER_WIN) && (!strcmp(ev->key, "Super_L")))
else if ((_hold_mod & ECORE_EVENT_MODIFIER_WIN) &&
(!strcmp(ev->key, "Super_L")))
_hold_count--;
else if ((_hold_mod & ECORE_EVENT_MODIFIER_WIN) && (!strcmp(ev->key, "Super_R")))
else if ((_hold_mod & ECORE_EVENT_MODIFIER_WIN) &&
(!strcmp(ev->key, "Super_R")))
_hold_count--;
else if ((_hold_mod & ECORE_EVENT_MODIFIER_WIN) && (!strcmp(ev->key, "Mode_switch")))
else if ((_hold_mod & ECORE_EVENT_MODIFIER_WIN) &&
(!strcmp(ev->key, "Mode_switch")))
_hold_count--;
else if ((_hold_mod & ECORE_EVENT_MODIFIER_WIN) && (!strcmp(ev->key, "Meta_L")))
else if ((_hold_mod & ECORE_EVENT_MODIFIER_WIN) &&
(!strcmp(ev->key, "Meta_L")))
_hold_count--;
else if ((_hold_mod & ECORE_EVENT_MODIFIER_WIN) && (!strcmp(ev->key, "Meta_R")))
else if ((_hold_mod & ECORE_EVENT_MODIFIER_WIN) &&
(!strcmp(ev->key, "Meta_R")))
_hold_count--;
if (_hold_count <= 0)
{
return EINA_FALSE;
return EINA_FALSE;
}
return EINA_TRUE;
}
@ -87,28 +125,27 @@ e_mod_border_ignore(E_Border *bd)
return EINA_TRUE;
if (bd->client.icccm.class)
{
if (!strncmp(bd->client.icccm.class, "Illume-", 7))
return EINA_TRUE;
if (!strncmp(bd->client.icccm.class, "Illume-", 7))
return EINA_TRUE;
if (!strcmp(bd->client.icccm.class, "Virtual-Keyboard"))
return EINA_TRUE;
if (!strcmp(bd->client.icccm.class, "Virtual-Keyboard"))
return EINA_TRUE;
if (!strcmp(bd->client.icccm.class, "everything-window"))
return EINA_TRUE;
if (!strcmp(bd->client.icccm.class, "everything-window"))
return EINA_TRUE;
}
if (bd->client.icccm.name)
{
/* legacy code from illume 1 */
if (((!strcmp(bd->client.icccm.name, "multitap-pad"))) &&
(bd->client.netwm.state.skip_taskbar) &&
(bd->client.netwm.state.skip_pager))
return EINA_TRUE;
/* legacy code from illume 1 */
if (((!strcmp(bd->client.icccm.name, "multitap-pad"))) &&
(bd->client.netwm.state.skip_taskbar) &&
(bd->client.netwm.state.skip_pager))
return EINA_TRUE;
}
return EINA_FALSE;
}
static void
_e_mod_action(const char *params, int modifiers, int method)
{
@ -127,25 +164,25 @@ _e_mod_action(const char *params, int modifiers, int method)
if (!strncmp(params, "go_pager", 8))
{
active = pager_run(man, params, method);
active = pager_run(man, params, method);
}
else if (!strncmp(params, "go_scale", 8))
{
active = scale_run(man, params, method);
active = scale_run(man, params, method);
}
if (active)
{
_hold_mod = modifiers &
(ECORE_EVENT_MODIFIER_SHIFT |
ECORE_EVENT_MODIFIER_CTRL |
ECORE_EVENT_MODIFIER_ALT |
ECORE_EVENT_MODIFIER_WIN);
_hold_count = 0;
if (_hold_mod & ECORE_EVENT_MODIFIER_SHIFT) _hold_count++;
if (_hold_mod & ECORE_EVENT_MODIFIER_CTRL) _hold_count++;
if (_hold_mod & ECORE_EVENT_MODIFIER_ALT) _hold_count++;
if (_hold_mod & ECORE_EVENT_MODIFIER_WIN) _hold_count++;
_hold_mod = modifiers &
(ECORE_EVENT_MODIFIER_SHIFT |
ECORE_EVENT_MODIFIER_CTRL |
ECORE_EVENT_MODIFIER_ALT |
ECORE_EVENT_MODIFIER_WIN);
_hold_count = 0;
if (_hold_mod & ECORE_EVENT_MODIFIER_SHIFT) _hold_count++;
if (_hold_mod & ECORE_EVENT_MODIFIER_CTRL) _hold_count++;
if (_hold_mod & ECORE_EVENT_MODIFIER_ALT) _hold_count++;
if (_hold_mod & ECORE_EVENT_MODIFIER_WIN) _hold_count++;
}
}
@ -164,26 +201,31 @@ _e_mod_action_cb(E_Object *obj EINA_UNUSED, const char *params)
}
static void
_e_mod_action_cb_key(E_Object *obj EINA_UNUSED, const char *params, Ecore_Event_Key *ev)
_e_mod_action_cb_key(E_Object *obj EINA_UNUSED,
const char *params,
Ecore_Event_Key *ev)
{
_e_mod_action(params, ev->modifiers, GO_KEY);
}
static void
_e_mod_action_cb_mouse(E_Object *obj EINA_UNUSED, const char *params, Ecore_Event_Mouse_Button *ev EINA_UNUSED)
_e_mod_action_cb_mouse(E_Object *obj EINA_UNUSED,
const char *params,
Ecore_Event_Mouse_Button *ev EINA_UNUSED)
{
_e_mod_action(params, 0, GO_MOUSE);
}
/* Module and Gadcon stuff */
typedef struct _Instance Instance;
struct _Instance
{
E_Gadcon_Client *gcc;
Evas_Object *o_scale;
E_Menu *menu;
Config_Item *conf_item;
E_Gadcon_Client *gcc;
Evas_Object *o_scale;
E_Menu *menu;
Config_Item *conf_item;
};
static Eina_List *instances = NULL;
@ -192,28 +234,28 @@ static E_Config_DD *conf_item_edd = NULL;
Config *scale_conf = NULL;
static const E_Gadcon_Client_Class _gc_class_scale =
{
GADCON_CLIENT_CLASS_VERSION, "scale",
{_gc_init_scale, _gc_shutdown, _gc_orient, _gc_label_scale, _gc_icon,
_gc_id_new, NULL, NULL},
E_GADCON_CLIENT_STYLE_PLAIN
};
{
GADCON_CLIENT_CLASS_VERSION, "scale",
{_gc_init_scale, _gc_shutdown, _gc_orient, _gc_label_scale, _gc_icon,
_gc_id_new, NULL, NULL},
E_GADCON_CLIENT_STYLE_PLAIN
};
static const E_Gadcon_Client_Class _gc_class_scale_all =
{
GADCON_CLIENT_CLASS_VERSION, "scale-all",
{_gc_init_scale_all, _gc_shutdown, _gc_orient, _gc_label_scale_all, _gc_icon,
_gc_id_new, NULL, NULL},
E_GADCON_CLIENT_STYLE_PLAIN
};
{
GADCON_CLIENT_CLASS_VERSION, "scale-all",
{_gc_init_scale_all, _gc_shutdown, _gc_orient, _gc_label_scale_all,
_gc_icon, _gc_id_new, NULL, NULL},
E_GADCON_CLIENT_STYLE_PLAIN
};
static const E_Gadcon_Client_Class _gc_class_pager =
{
GADCON_CLIENT_CLASS_VERSION, "scale-pager",
{_gc_init_pager, _gc_shutdown, _gc_orient, _gc_label_pager, _gc_icon,
_gc_id_new, NULL, NULL},
E_GADCON_CLIENT_STYLE_PLAIN
};
{
GADCON_CLIENT_CLASS_VERSION, "scale-pager",
{_gc_init_pager, _gc_shutdown, _gc_orient, _gc_label_pager, _gc_icon,
_gc_id_new, NULL, NULL},
E_GADCON_CLIENT_STYLE_PLAIN
};
EAPI E_Module_Api e_modapi = {E_MODULE_API_VERSION, "Scale"};
@ -230,7 +272,8 @@ e_modapi_init(E_Module *m)
e_configure_registry_category_add("appearance", 80, D_("Look"),
NULL, "preferences-look");
e_configure_registry_item_add("appearance/comp-scale", 110, D_("Composite Scale Windows"),
e_configure_registry_item_add("appearance/comp-scale", 110,
D_("Composite Scale Windows"),
NULL, buf, e_int_config_scale_module);
conf_item_edd = E_CONFIG_DD_NEW("Config_Item", Config_Item);
@ -276,10 +319,10 @@ e_modapi_init(E_Module *m)
scale_conf = e_config_domain_load("module.scale", conf_edd);
if (scale_conf)
{
if (!e_util_module_config_check(D_("Scale Windows"),
scale_conf->version,
MOD_CONFIG_FILE_VERSION))
_scale_conf_free();
if (!e_util_module_config_check(D_("Scale Windows"),
scale_conf->version,
MOD_CONFIG_FILE_VERSION))
_scale_conf_free();
}
if (!scale_conf) _scale_conf_new();
@ -297,46 +340,50 @@ e_modapi_init(E_Module *m)
act = e_action_add("scale-windows");
if (act)
{
act->func.go = _e_mod_action_cb;
act->func.go_key = _e_mod_action_cb_key;
act->func.go_mouse = _e_mod_action_cb_mouse;
act->func.go_edge = _e_mod_action_cb_edge;
act->func.go = _e_mod_action_cb;
act->func.go_key = _e_mod_action_cb_key;
act->func.go_mouse = _e_mod_action_cb_mouse;
act->func.go_edge = _e_mod_action_cb_edge;
e_action_predef_name_set(D_("Scale Windows"), D_("Scale Windows"),
"scale-windows", "go_scale", NULL, 0);
e_action_predef_name_set(D_("Scale Windows"), D_("Scale Windows (All Desktops)"),
"scale-windows", "go_scale_all", NULL, 0);
e_action_predef_name_set(D_("Scale Windows"), D_("Scale Windows (By Class)"),
"scale-windows", NULL, "go_scale_class:E", 1);
e_action_predef_name_set(D_("Scale Windows"), D_("Select Next"),
"scale-windows", "go_scale_next", NULL, 0);
e_action_predef_name_set(D_("Scale Windows"), D_("Select Previous"),
"scale-windows", "go_scale_prev", NULL, 0);
e_action_predef_name_set(D_("Scale Windows"), D_("Select Next (All)"),
"scale-windows", "go_scale_all_next", NULL, 0);
e_action_predef_name_set(D_("Scale Windows"), D_("Select Previous (All)"),
"scale-windows", "go_scale_all_prev", NULL, 0);
e_action_predef_name_set(D_("Scale Windows"), D_("Scale Windows"),
"scale-windows", "go_scale", NULL, 0);
e_action_predef_name_set(D_("Scale Windows"),
D_("Scale Windows (All Desktops)"),
"scale-windows", "go_scale_all", NULL, 0);
e_action_predef_name_set(D_("Scale Windows"),
D_("Scale Windows (By Class)"),
"scale-windows", NULL, "go_scale_class:E", 1);
e_action_predef_name_set(D_("Scale Windows"), D_("Select Next"),
"scale-windows", "go_scale_next", NULL, 0);
e_action_predef_name_set(D_("Scale Windows"), D_("Select Previous"),
"scale-windows", "go_scale_prev", NULL, 0);
e_action_predef_name_set(D_("Scale Windows"), D_("Select Next (All)"),
"scale-windows", "go_scale_all_next",
NULL, 0);
e_action_predef_name_set(D_("Scale Windows"),
D_("Select Previous (All)"),
"scale-windows", "go_scale_all_prev", NULL,
0);
e_action_predef_name_set(D_("Scale Pager"), D_("Scale Pager"),
"scale-windows", "go_pager", NULL, 0);
e_action_predef_name_set(D_("Scale Pager"), D_("Select Next"),
"scale-windows", "go_pager_next", NULL, 0);
e_action_predef_name_set(D_("Scale Pager"), D_("Select Previous"),
"scale-windows", "go_pager_prev", NULL, 0);
e_action_predef_name_set(D_("Scale Pager"), D_("Select Left"),
"scale-windows", "go_pager_left", NULL, 0);
e_action_predef_name_set(D_("Scale Pager"), D_("Select Right"),
"scale-windows", "go_pager_right", NULL, 0);
e_action_predef_name_set(D_("Scale Pager"), D_("Select Up"),
"scale-windows", "go_pager_up", NULL, 0);
e_action_predef_name_set(D_("Scale Pager"), D_("Select Down"),
"scale-windows", "go_pager_down", NULL, 0);
e_action_predef_name_set(D_("Scale Pager"), D_("Scale Pager"),
"scale-windows", "go_pager", NULL, 0);
e_action_predef_name_set(D_("Scale Pager"), D_("Select Next"),
"scale-windows", "go_pager_next", NULL, 0);
e_action_predef_name_set(D_("Scale Pager"), D_("Select Previous"),
"scale-windows", "go_pager_prev", NULL, 0);
e_action_predef_name_set(D_("Scale Pager"), D_("Select Left"),
"scale-windows", "go_pager_left", NULL, 0);
e_action_predef_name_set(D_("Scale Pager"), D_("Select Right"),
"scale-windows", "go_pager_right", NULL, 0);
e_action_predef_name_set(D_("Scale Pager"), D_("Select Up"),
"scale-windows", "go_pager_up", NULL, 0);
e_action_predef_name_set(D_("Scale Pager"), D_("Select Down"),
"scale-windows", "go_pager_down", NULL, 0);
}
return m;
}
EAPI int
e_modapi_shutdown(E_Module *m EINA_UNUSED)
{
@ -373,20 +420,22 @@ e_modapi_shutdown(E_Module *m EINA_UNUSED)
if (act)
{
e_action_predef_name_del(D_("Scale Windows"), D_("Scale Windows"));
e_action_predef_name_del(D_("Scale Windows"), D_("Scale Windows (All Desktops)"));
e_action_predef_name_del(D_("Scale Windows"), D_("Scale Windows (By Class)"));
e_action_predef_name_del(D_("Scale Windows"), D_("Select Next"));
e_action_predef_name_del(D_("Scale Windows"), D_("Select Previous"));
e_action_predef_name_del(D_("Scale Windows"), D_("Scale Windows"));
e_action_predef_name_del(D_("Scale Windows"),
D_("Scale Windows (All Desktops)"));
e_action_predef_name_del(D_("Scale Windows"),
D_("Scale Windows (By Class)"));
e_action_predef_name_del(D_("Scale Windows"), D_("Select Next"));
e_action_predef_name_del(D_("Scale Windows"), D_("Select Previous"));
e_action_predef_name_del(D_("Scale Pager"), D_("Scale Pager"));
e_action_predef_name_del(D_("Scale Pager"), D_("Select Next"));
e_action_predef_name_del(D_("Scale Pager"), D_("Select Previous"));
e_action_predef_name_del(D_("Scale Pager"), D_("Select Left"));
e_action_predef_name_del(D_("Scale Pager"), D_("Select Right"));
e_action_predef_name_del(D_("Scale Pager"), D_("Select Up"));
e_action_predef_name_del(D_("Scale Pager"), D_("Select Down"));
e_action_del("scale-windows");
e_action_predef_name_del(D_("Scale Pager"), D_("Scale Pager"));
e_action_predef_name_del(D_("Scale Pager"), D_("Select Next"));
e_action_predef_name_del(D_("Scale Pager"), D_("Select Previous"));
e_action_predef_name_del(D_("Scale Pager"), D_("Select Left"));
e_action_predef_name_del(D_("Scale Pager"), D_("Select Right"));
e_action_predef_name_del(D_("Scale Pager"), D_("Select Up"));
e_action_predef_name_del(D_("Scale Pager"), D_("Select Down"));
e_action_del("scale-windows");
}
return 1;
@ -412,14 +461,16 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
inst->gcc = e_gadcon_client_new(gc, name, id, style, inst->o_scale);
inst->gcc->data = inst;
instances = eina_list_append(instances, inst);
return inst;
}
static E_Gadcon_Client *
_gc_init_pager(E_Gadcon *gc, const char *name, const char *id, const char *style)
_gc_init_pager(E_Gadcon *gc,
const char *name,
const char *id,
const char *style)
{
Instance *inst;
@ -427,7 +478,8 @@ _gc_init_pager(E_Gadcon *gc, const char *name, const char *id, const char *style
if (!e_theme_edje_object_set(inst->o_scale, "base/theme/modules/scale",
"modules/pager/main"))
edje_object_file_set(inst->o_scale, scale_conf->theme_path, "modules/pager/main");
edje_object_file_set(inst->o_scale, scale_conf->theme_path,
"modules/pager/main");
evas_object_event_callback_add(inst->o_scale, EVAS_CALLBACK_MOUSE_DOWN,
_scale_gc_cb_mouse_down_pager, inst);
@ -436,7 +488,10 @@ _gc_init_pager(E_Gadcon *gc, const char *name, const char *id, const char *style
}
static E_Gadcon_Client *
_gc_init_scale(E_Gadcon *gc, const char *name, const char *id, const char *style)
_gc_init_scale(E_Gadcon *gc,
const char *name,
const char *id,
const char *style)
{
Instance *inst;
@ -444,7 +499,8 @@ _gc_init_scale(E_Gadcon *gc, const char *name, const char *id, const char *style
if (!e_theme_edje_object_set(inst->o_scale, "base/theme/modules/scale",
"modules/scale/main"))
edje_object_file_set(inst->o_scale, scale_conf->theme_path, "modules/scale/main");
edje_object_file_set
(inst->o_scale, scale_conf->theme_path, "modules/scale/main");
evas_object_event_callback_add(inst->o_scale, EVAS_CALLBACK_MOUSE_DOWN,
_scale_gc_cb_mouse_down_scale, inst);
@ -453,7 +509,10 @@ _gc_init_scale(E_Gadcon *gc, const char *name, const char *id, const char *style
}
static E_Gadcon_Client *
_gc_init_scale_all(E_Gadcon *gc, const char *name, const char *id, const char *style)
_gc_init_scale_all(E_Gadcon *gc,
const char *name,
const char *id,
const char *style)
{
Instance *inst;
@ -461,7 +520,8 @@ _gc_init_scale_all(E_Gadcon *gc, const char *name, const char *id, const char *s
if (!e_theme_edje_object_set(inst->o_scale, "base/theme/modules/scale",
"modules/scale/main"))
edje_object_file_set(inst->o_scale, scale_conf->theme_path, "modules/scale/main");
edje_object_file_set
(inst->o_scale, scale_conf->theme_path, "modules/scale/main");
evas_object_event_callback_add(inst->o_scale, EVAS_CALLBACK_MOUSE_DOWN,
_scale_gc_cb_mouse_down_scale_all, inst);
@ -485,8 +545,6 @@ _gc_shutdown(E_Gadcon_Client *gcc)
}
if (inst->o_scale)
{
/* evas_object_event_callback_del(inst->o_scale, EVAS_CALLBACK_MOUSE_DOWN,
* _scale_gc_cb_mouse_down); */
evas_object_del(inst->o_scale);
}
E_FREE(inst);
@ -547,28 +605,28 @@ _scale_conf_new(void)
#define IFMODCFG(v) if ((scale_conf->version & 0xffff) < v) {
#define IFMODCFGEND }
IFMODCFG(0x0001);
scale_conf->grow = 1;
scale_conf->tight = 1;
scale_conf->scale_duration = 0.4;
scale_conf->spacing = 10;
scale_conf->fade_windows = 1;
scale_conf->fade_popups = 0;
scale_conf->fade_desktop = 1;
scale_conf->desks_duration = 0.6;
scale_conf->desks_spacing = 44;
scale_conf->layout_mode = 0;
scale_conf->desks_layout_mode = 1;
scale_conf->pager_duration = 0.4;
scale_conf->pager_fade_popups = 1;
scale_conf->pager_fade_desktop = 0;
scale_conf->pager_fade_windows = 1;
_scale_conf_item_get(NULL);
IFMODCFGEND;
IFMODCFG(0x0001);
scale_conf->grow = 1;
scale_conf->tight = 1;
scale_conf->scale_duration = 0.4;
scale_conf->spacing = 10;
scale_conf->fade_windows = 1;
scale_conf->fade_popups = 0;
scale_conf->fade_desktop = 1;
scale_conf->desks_duration = 0.6;
scale_conf->desks_spacing = 44;
scale_conf->layout_mode = 0;
scale_conf->desks_layout_mode = 1;
scale_conf->pager_duration = 0.4;
scale_conf->pager_fade_popups = 1;
scale_conf->pager_fade_desktop = 0;
scale_conf->pager_fade_windows = 1;
_scale_conf_item_get(NULL);
IFMODCFGEND;
scale_conf->version = MOD_CONFIG_FILE_VERSION;
scale_conf->version = MOD_CONFIG_FILE_VERSION;
e_config_save_queue();
e_config_save_queue();
}
static void
@ -591,10 +649,11 @@ _scale_conf_free(void)
static Config_Item *
_scale_conf_item_get(const char *id)
{;
{
Config_Item *ci;
GADCON_CLIENT_CONFIG_GET(Config_Item, scale_conf->conf_items, _gc_class_scale, id);
GADCON_CLIENT_CONFIG_GET
(Config_Item, scale_conf->conf_items, _gc_class_scale, id);
ci = E_NEW(Config_Item, 1);
ci->id = eina_stringshare_add(id);
@ -610,7 +669,7 @@ _scale_gc_menu(Instance *inst, Evas_Event_Mouse_Down *ev)
E_Menu_Item *mi;
E_Zone *zone = NULL;
int x, y;
m = e_menu_new();
mi = e_menu_item_new(m);
e_menu_item_label_set(mi, D_("Settings"));
@ -621,18 +680,17 @@ _scale_gc_menu(Instance *inst, Evas_Event_Mouse_Down *ev)
inst->menu = m;
e_menu_post_deactivate_callback_set(m, _scale_gc_cb_menu_post, inst);
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &x, &y,
NULL, NULL);
NULL, NULL);
zone = e_util_zone_current_get(e_manager_current_get());
e_menu_activate_mouse(m, zone, (x + ev->output.x),
(y + ev->output.y), 1, 1,
E_MENU_POP_DIRECTION_AUTO, ev->timestamp);
evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
EVAS_BUTTON_NONE, ev->timestamp, NULL);
e_menu_activate_mouse(m, zone, (x + ev->output.x),
(y + ev->output.y), 1, 1,
E_MENU_POP_DIRECTION_AUTO, ev->timestamp);
evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
EVAS_BUTTON_NONE, ev->timestamp, NULL);
}
static void
@ -689,7 +747,6 @@ _scale_gc_cb_mouse_down_pager(void *data,
_scale_gc_menu(inst, ev);
}
static void
_scale_gc_cb_menu_post(void *data, E_Menu *menu EINA_UNUSED)
{
@ -710,4 +767,3 @@ _scale_gc_cb_menu_configure(void *data EINA_UNUSED,
if (scale_conf->cfd) return;
e_int_config_scale_module(mn->zone->container, NULL);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff