2005-02-13 03:37:13 -08:00
|
|
|
/*
|
|
|
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
|
|
|
*/
|
2004-11-24 19:37:45 -08:00
|
|
|
#include "e.h"
|
|
|
|
#include "e_mod_main.h"
|
|
|
|
|
|
|
|
/* TODO List:
|
2005-05-13 14:09:41 -07:00
|
|
|
*
|
2005-05-14 07:06:09 -07:00
|
|
|
* * Listen to change of main e_app!
|
|
|
|
*
|
|
|
|
* * Create separate config for each bar
|
2005-02-13 03:37:13 -08:00
|
|
|
* * Fix menu
|
|
|
|
*
|
2004-11-24 19:37:45 -08:00
|
|
|
* * icon labels & label tooltips supported for the name of the app
|
|
|
|
* * use part list to know how many icons & where to put in the overlay of an icon
|
|
|
|
* * description bubbles/tooltips for icons
|
|
|
|
* * support dynamic iconsize change on the fly
|
|
|
|
* * app subdirs - need to somehow handle these...
|
|
|
|
* * use overlay object and repeat events for doing auto hide/show
|
|
|
|
* * emit signals on hide/show due to autohide/show
|
|
|
|
* * virtualise autoshow/hide to later allow for key bindings, mouse events elsewhere, ipc and other singals to show/hide
|
2005-02-13 03:37:13 -08:00
|
|
|
*
|
2004-11-24 19:37:45 -08:00
|
|
|
*/
|
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
static int bar_count;
|
2005-02-13 03:37:13 -08:00
|
|
|
static E_Config_DD *conf_edd;
|
2005-05-14 07:06:09 -07:00
|
|
|
static E_Config_DD *conf_bar_edd;
|
|
|
|
|
|
|
|
static int drag, drag_start;
|
|
|
|
static int drag_x, drag_y;
|
2005-05-01 12:29:17 -07:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
/* const strings */
|
2005-05-14 07:06:09 -07:00
|
|
|
static const char *_ibar_main_orientation[] =
|
2005-02-13 03:37:13 -08:00
|
|
|
{"left", "right", "top", "bottom"};
|
2004-11-24 19:37:45 -08:00
|
|
|
|
|
|
|
/* module private routines */
|
2005-05-14 07:06:09 -07:00
|
|
|
static IBar *_ibar_new();
|
|
|
|
static void _ibar_free(IBar *ib);
|
|
|
|
static void _ibar_app_change(void *data, E_App *a, E_App_Change ch);
|
|
|
|
static void _ibar_config_menu_new(IBar *ib);
|
|
|
|
|
|
|
|
static IBar_Bar *_ibar_bar_new(IBar *ib, E_Container *con);
|
|
|
|
static void _ibar_bar_free(IBar_Bar *ibb);
|
|
|
|
static void _ibar_bar_menu_new(IBar_Bar *ibb);
|
|
|
|
static void _ibar_bar_enable(IBar_Bar *ibb);
|
|
|
|
static void _ibar_bar_disable(IBar_Bar *ibb);
|
|
|
|
static void _ibar_bar_frame_resize(IBar_Bar *ibb);
|
|
|
|
static void _ibar_bar_edge_change(IBar_Bar *ibb, int edge);
|
|
|
|
static void _ibar_bar_update_policy(IBar_Bar *ibb);
|
|
|
|
static void _ibar_bar_motion_handle(IBar_Bar *ibb, Evas_Coord mx, Evas_Coord my);
|
|
|
|
static void _ibar_bar_timer_handle(IBar_Bar *ibb);
|
|
|
|
static void _ibar_bar_follower_reset(IBar_Bar *ibb);
|
|
|
|
|
|
|
|
static IBar_Icon *_ibar_icon_new(IBar_Bar *ibb, E_App *a);
|
|
|
|
static void _ibar_icon_free(IBar_Icon *ic);
|
|
|
|
static IBar_Icon *_ibar_icon_find(IBar_Bar *ibb, E_App *a);
|
2005-06-10 09:01:00 -07:00
|
|
|
static IBar_Icon *_ibar_icon_pos_find(IBar_Bar *ibb, int x, int y);
|
2005-05-14 07:06:09 -07:00
|
|
|
static void _ibar_icon_reorder_after(IBar_Icon *ic, IBar_Icon *after);
|
|
|
|
|
|
|
|
static void _ibar_bar_cb_gmc_change(void *data, E_Gadman_Client *gmc, E_Gadman_Change change);
|
|
|
|
static void _ibar_bar_cb_intercept_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y);
|
|
|
|
static void _ibar_bar_cb_intercept_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h);
|
|
|
|
static void _ibar_bar_cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static void _ibar_bar_cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static void _ibar_bar_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static void _ibar_bar_cb_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static void _ibar_bar_cb_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static int _ibar_bar_cb_timer(void *data);
|
|
|
|
static int _ibar_bar_cb_animator(void *data);
|
|
|
|
|
|
|
|
static void _ibar_bar_cb_enter(void *data, const char *type, void *event);
|
|
|
|
static void _ibar_bar_cb_move(void *data, const char *type, void *event);
|
|
|
|
static void _ibar_bar_cb_leave(void *data, const char *type, void *event);
|
2005-07-26 04:03:36 -07:00
|
|
|
|
2005-10-05 10:56:35 -07:00
|
|
|
static void _ibar_bar_cb_drop(void *data, const char *type, void *event);
|
2005-05-14 07:06:09 -07:00
|
|
|
static void _ibar_bar_cb_finished(E_Drag *drag, int dropped);
|
|
|
|
|
|
|
|
static void _ibar_icon_cb_intercept_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y);
|
|
|
|
static void _ibar_icon_cb_intercept_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h);
|
|
|
|
static void _ibar_icon_cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static void _ibar_icon_cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static void _ibar_icon_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static void _ibar_icon_cb_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static void _ibar_icon_cb_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
|
|
|
|
static void _ibar_bar_cb_width_auto(void *data, E_Menu *m, E_Menu_Item *mi);
|
2005-06-17 17:10:31 -07:00
|
|
|
static void _ibar_bar_cb_follower(void *data, E_Menu *m, E_Menu_Item *mi);
|
2005-05-14 07:06:09 -07:00
|
|
|
#if 0
|
|
|
|
static void _ibar_icon_reorder_before(IBar_Icon *ic, IBar_Icon *before);
|
|
|
|
#endif
|
|
|
|
static void _ibar_bar_iconsize_change(IBar_Bar *ibb);
|
|
|
|
static void _ibar_bar_cb_iconsize_microscopic(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
|
|
static void _ibar_bar_cb_iconsize_tiny(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
|
|
static void _ibar_bar_cb_iconsize_very_small(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
|
|
static void _ibar_bar_cb_iconsize_small(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
|
|
static void _ibar_bar_cb_iconsize_medium(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
|
|
static void _ibar_bar_cb_iconsize_large(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
|
|
static void _ibar_bar_cb_iconsize_very_large(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
|
|
static void _ibar_bar_cb_iconsize_extremely_large(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
|
|
static void _ibar_bar_cb_iconsize_huge(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
|
|
static void _ibar_bar_cb_iconsize_enormous(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
|
|
static void _ibar_bar_cb_iconsize_gigantic(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
|
|
|
|
|
|
static void _ibar_bar_cb_menu_enabled(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
|
|
static void _ibar_bar_cb_menu_edit(void *data, E_Menu *m, E_Menu_Item *mi);
|
2004-11-24 19:37:45 -08:00
|
|
|
|
2005-06-11 04:19:10 -07:00
|
|
|
static void _ibar_drag_cb_intercept_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y);
|
|
|
|
static void _ibar_drag_cb_intercept_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h);
|
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
/* public module routines. all modules must have these */
|
2005-09-24 06:42:05 -07:00
|
|
|
E_Module_Api e_modapi =
|
2005-09-23 10:13:47 -07:00
|
|
|
{
|
|
|
|
E_MODULE_API_VERSION,
|
|
|
|
"IBar"
|
|
|
|
};
|
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
void *
|
2005-04-11 20:34:31 -07:00
|
|
|
e_modapi_init(E_Module *m)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar *ib;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
/* actually init ibar */
|
|
|
|
ib = _ibar_new();
|
2005-02-13 03:37:13 -08:00
|
|
|
m->config_menu = ib->config_menu;
|
2004-11-24 19:37:45 -08:00
|
|
|
return ib;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 20:34:31 -07:00
|
|
|
e_modapi_shutdown(E_Module *m)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar *ib;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
|
|
|
if (m->config_menu)
|
|
|
|
m->config_menu = NULL;
|
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
ib = m->data;
|
|
|
|
if (ib)
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_free(ib);
|
2004-11-24 19:37:45 -08:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 20:34:31 -07:00
|
|
|
e_modapi_save(E_Module *m)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar *ib;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2004-12-05 00:36:54 -08:00
|
|
|
ib = m->data;
|
2005-05-14 07:06:09 -07:00
|
|
|
e_config_domain_save("module.ibar", conf_edd, ib->conf);
|
2004-11-24 19:37:45 -08:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 20:34:31 -07:00
|
|
|
e_modapi_info(E_Module *m)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
char buf[4096];
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
snprintf(buf, sizeof(buf), "%s/module_icon.png", e_module_dir_get(m));
|
|
|
|
m->icon_file = strdup(buf);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 20:34:31 -07:00
|
|
|
e_modapi_about(E_Module *m)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-09-22 11:17:18 -07:00
|
|
|
e_module_dialog_show(_("Enlightenment IBar Module"),
|
|
|
|
_("This is the IBar Application Launcher bar module for Enlightenment.<br>"
|
|
|
|
"It is a first example module and is being used to flesh out several<br>"
|
|
|
|
"interfaces in Enlightenment 0.17.0. It is under heavy development,<br>"
|
|
|
|
"so expect it to <hilight>break often</hilight> and change as it improves."));
|
2005-09-20 23:57:36 -07:00
|
|
|
return 1;
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* module private routines */
|
2005-05-14 07:06:09 -07:00
|
|
|
static IBar *
|
|
|
|
_ibar_new()
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar *ib;
|
|
|
|
char buf[4096];
|
2005-02-16 03:43:58 -08:00
|
|
|
Evas_List *managers, *l, *l2, *cl;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
bar_count = 0;
|
|
|
|
ib = E_NEW(IBar, 1);
|
2004-11-24 19:37:45 -08:00
|
|
|
if (!ib) return NULL;
|
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
conf_bar_edd = E_CONFIG_DD_NEW("IBar_Config_Bar", Config_Bar);
|
2005-02-16 03:43:58 -08:00
|
|
|
#undef T
|
|
|
|
#undef D
|
2005-05-14 07:06:09 -07:00
|
|
|
#define T Config_Bar
|
|
|
|
#define D conf_bar_edd
|
2005-04-01 08:12:31 -08:00
|
|
|
E_CONFIG_VAL(D, T, enabled, UCHAR);
|
2005-02-16 03:43:58 -08:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
conf_edd = E_CONFIG_DD_NEW("IBar_Config", Config);
|
2004-12-05 00:36:54 -08:00
|
|
|
#undef T
|
|
|
|
#undef D
|
|
|
|
#define T Config
|
2005-02-13 03:37:13 -08:00
|
|
|
#define D conf_edd
|
2005-05-14 07:06:09 -07:00
|
|
|
E_CONFIG_VAL(D, T, appdir, STR);
|
2005-06-17 17:10:31 -07:00
|
|
|
E_CONFIG_VAL(D, T, follower, INT);
|
2004-12-05 00:36:54 -08:00
|
|
|
E_CONFIG_VAL(D, T, follow_speed, DOUBLE);
|
|
|
|
E_CONFIG_VAL(D, T, autoscroll_speed, DOUBLE);
|
|
|
|
E_CONFIG_VAL(D, T, iconsize, INT);
|
2005-02-13 03:37:13 -08:00
|
|
|
E_CONFIG_VAL(D, T, width, INT);
|
2005-05-14 07:06:09 -07:00
|
|
|
E_CONFIG_LIST(D, T, bars, conf_bar_edd);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
ib->conf = e_config_domain_load("module.ibar", conf_edd);
|
2004-12-05 00:36:54 -08:00
|
|
|
if (!ib->conf)
|
|
|
|
{
|
|
|
|
ib->conf = E_NEW(Config, 1);
|
2005-05-14 07:06:09 -07:00
|
|
|
ib->conf->appdir = strdup("bar");
|
2005-06-17 17:10:31 -07:00
|
|
|
ib->conf->follower = 1;
|
2004-12-05 00:36:54 -08:00
|
|
|
ib->conf->follow_speed = 0.9;
|
|
|
|
ib->conf->autoscroll_speed = 0.95;
|
2005-03-19 04:49:46 -08:00
|
|
|
ib->conf->iconsize = 24;
|
2005-05-14 07:06:09 -07:00
|
|
|
ib->conf->width = IBAR_WIDTH_AUTO;
|
2004-12-05 00:36:54 -08:00
|
|
|
}
|
|
|
|
E_CONFIG_LIMIT(ib->conf->follow_speed, 0.01, 1.0);
|
|
|
|
E_CONFIG_LIMIT(ib->conf->autoscroll_speed, 0.01, 1.0);
|
|
|
|
E_CONFIG_LIMIT(ib->conf->iconsize, 2, 400);
|
2005-02-16 03:43:58 -08:00
|
|
|
E_CONFIG_LIMIT(ib->conf->width, -2, -1);
|
2005-03-19 04:49:46 -08:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_config_menu_new(ib);
|
|
|
|
|
|
|
|
if (ib->conf->appdir[0] != '/')
|
|
|
|
{
|
|
|
|
char *homedir;
|
|
|
|
|
|
|
|
homedir = e_user_homedir_get();
|
|
|
|
if (homedir)
|
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "%s/.e/e/applications/%s", homedir, ib->conf->appdir);
|
|
|
|
free(homedir);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
strcpy(buf, ib->conf->appdir);
|
|
|
|
|
|
|
|
ib->apps = e_app_new(buf, 0);
|
|
|
|
if (ib->apps) e_app_subdir_scan(ib->apps, 0);
|
|
|
|
e_app_change_callback_add(_ibar_app_change, ib);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
managers = e_manager_list();
|
2005-05-14 07:06:09 -07:00
|
|
|
cl = ib->conf->bars;
|
2004-11-24 19:37:45 -08:00
|
|
|
for (l = managers; l; l = l->next)
|
|
|
|
{
|
|
|
|
E_Manager *man;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
man = l->data;
|
|
|
|
for (l2 = man->containers; l2; l2 = l2->next)
|
|
|
|
{
|
|
|
|
E_Container *con;
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-16 03:43:58 -08:00
|
|
|
/* Config */
|
2004-11-24 19:37:45 -08:00
|
|
|
con = l2->data;
|
2005-05-14 07:06:09 -07:00
|
|
|
ibb = _ibar_bar_new(ib, con);
|
2005-02-16 03:43:58 -08:00
|
|
|
if (ibb)
|
|
|
|
{
|
|
|
|
E_Menu_Item *mi;
|
|
|
|
|
|
|
|
if (!cl)
|
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
ibb->conf = E_NEW(Config_Bar, 1);
|
2005-02-16 03:43:58 -08:00
|
|
|
ibb->conf->enabled = 1;
|
2005-05-14 07:06:09 -07:00
|
|
|
ib->conf->bars = evas_list_append(ib->conf->bars, ibb->conf);
|
2005-02-16 03:43:58 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ibb->conf = cl->data;
|
|
|
|
cl = cl->next;
|
|
|
|
}
|
|
|
|
/* Menu */
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_menu_new(ibb);
|
2005-02-16 03:43:58 -08:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
/* Add main menu to bar menu */
|
2005-02-16 03:43:58 -08:00
|
|
|
mi = e_menu_item_new(ibb->menu);
|
2005-05-23 15:52:34 -07:00
|
|
|
e_menu_item_label_set(mi, _("Options"));
|
2005-03-21 14:42:47 -08:00
|
|
|
e_menu_item_submenu_set(mi, ib->config_menu_options);
|
|
|
|
|
|
|
|
mi = e_menu_item_new(ibb->menu);
|
2005-05-23 15:52:34 -07:00
|
|
|
e_menu_item_label_set(mi, _("Size"));
|
2005-03-21 14:42:47 -08:00
|
|
|
e_menu_item_submenu_set(mi, ib->config_menu_size);
|
2005-02-16 03:43:58 -08:00
|
|
|
|
|
|
|
mi = e_menu_item_new(ib->config_menu);
|
|
|
|
e_menu_item_label_set(mi, con->name);
|
|
|
|
e_menu_item_submenu_set(mi, ibb->menu);
|
|
|
|
|
|
|
|
/* Setup */
|
|
|
|
if (!ibb->conf->enabled)
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_disable(ibb);
|
2005-02-16 03:43:58 -08:00
|
|
|
|
|
|
|
}
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return ib;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_free(IBar *ib)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-02-13 03:37:13 -08:00
|
|
|
E_CONFIG_DD_FREE(conf_edd);
|
2005-05-14 07:06:09 -07:00
|
|
|
E_CONFIG_DD_FREE(conf_bar_edd);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
while (ib->bars)
|
|
|
|
_ibar_bar_free(ib->bars->data);
|
|
|
|
if (ib->apps)
|
|
|
|
e_object_unref(E_OBJECT(ib->apps));
|
2005-02-16 03:43:58 -08:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
E_FREE(ib->conf->appdir);
|
|
|
|
e_app_change_callback_del(_ibar_app_change, ib);
|
2005-03-21 14:42:47 -08:00
|
|
|
e_object_del(E_OBJECT(ib->config_menu_options));
|
|
|
|
e_object_del(E_OBJECT(ib->config_menu_size));
|
2005-02-16 03:43:58 -08:00
|
|
|
e_object_del(E_OBJECT(ib->config_menu));
|
2005-05-14 07:06:09 -07:00
|
|
|
evas_list_free(ib->conf->bars);
|
2005-02-16 03:43:58 -08:00
|
|
|
free(ib->conf);
|
2004-11-24 19:37:45 -08:00
|
|
|
free(ib);
|
|
|
|
}
|
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
static void
|
|
|
|
_ibar_app_change(void *data, E_App *a, E_App_Change ch)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar *ib;
|
|
|
|
Evas_List *l, *ll;
|
|
|
|
|
|
|
|
ib = data;
|
|
|
|
for (l = ib->bars; l; l = l->next)
|
|
|
|
{
|
|
|
|
IBar_Bar *ibb;
|
|
|
|
|
|
|
|
ibb = l->data;
|
|
|
|
switch (ch)
|
|
|
|
{
|
|
|
|
case E_APP_ADD:
|
|
|
|
if (e_app_is_parent(ib->apps, a))
|
|
|
|
{
|
|
|
|
IBar_Icon *ic;
|
|
|
|
|
2005-09-28 05:48:38 -07:00
|
|
|
if (e_app_valid_exe_get(a) || (!a->exe))
|
2005-05-14 07:06:09 -07:00
|
|
|
{
|
2005-09-27 20:44:31 -07:00
|
|
|
ic = _ibar_icon_new(ibb, a);
|
|
|
|
if (ic)
|
2005-05-14 07:06:09 -07:00
|
|
|
{
|
2005-09-27 20:44:31 -07:00
|
|
|
for (ll = ib->apps->subapps; ll; ll = ll->next)
|
|
|
|
{
|
|
|
|
E_App *a2;
|
|
|
|
|
|
|
|
a2 = ll->data;
|
|
|
|
ic = _ibar_icon_find(ibb, a2);
|
|
|
|
if (ic) _ibar_icon_reorder_after(ic, NULL);
|
|
|
|
}
|
|
|
|
_ibar_bar_frame_resize(ibb);
|
2005-05-14 07:06:09 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case E_APP_DEL:
|
|
|
|
if (e_app_is_parent(ib->apps, a))
|
|
|
|
{
|
|
|
|
IBar_Icon *ic;
|
|
|
|
|
|
|
|
ic = _ibar_icon_find(ibb, a);
|
|
|
|
if (ic) _ibar_icon_free(ic);
|
|
|
|
_ibar_bar_frame_resize(ibb);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case E_APP_CHANGE:
|
|
|
|
if (e_app_is_parent(ib->apps, a))
|
|
|
|
{
|
|
|
|
IBar_Icon *ic;
|
|
|
|
|
|
|
|
ic = _ibar_icon_find(ibb, a);
|
|
|
|
if (ic) _ibar_icon_free(ic);
|
|
|
|
evas_image_cache_flush(ibb->evas);
|
|
|
|
evas_image_cache_reload(ibb->evas);
|
|
|
|
ic = _ibar_icon_new(ibb, a);
|
|
|
|
if (ic)
|
|
|
|
{
|
|
|
|
for (ll = ib->apps->subapps; ll; ll = ll->next)
|
|
|
|
{
|
|
|
|
E_App *a2;
|
|
|
|
|
|
|
|
a2 = ll->data;
|
|
|
|
ic = _ibar_icon_find(ibb, a2);
|
|
|
|
if (ic) _ibar_icon_reorder_after(ic, NULL);
|
|
|
|
}
|
|
|
|
_ibar_bar_frame_resize(ibb);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case E_APP_ORDER:
|
|
|
|
if (a == ib->apps)
|
|
|
|
{
|
|
|
|
for (ll = ib->apps->subapps; ll; ll = ll->next)
|
|
|
|
{
|
|
|
|
IBar_Icon *ic;
|
|
|
|
E_App *a2;
|
|
|
|
|
|
|
|
a2 = ll->data;
|
|
|
|
ic = _ibar_icon_find(ibb, a2);
|
|
|
|
if (ic) _ibar_icon_reorder_after(ic, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case E_APP_EXEC:
|
2005-09-13 23:39:59 -07:00
|
|
|
if (e_app_is_parent(ib->apps, a))
|
|
|
|
{
|
|
|
|
IBar_Icon *ic;
|
|
|
|
|
|
|
|
ic = _ibar_icon_find(ibb, a);
|
|
|
|
if (ic)
|
|
|
|
{
|
|
|
|
if (a->startup_notify)
|
|
|
|
{
|
|
|
|
edje_object_signal_emit(ic->icon_object, "start", "");
|
|
|
|
for (ll = ic->extra_icons; ll; ll = ll->next) edje_object_signal_emit(ll->data, "start", "");
|
|
|
|
edje_object_signal_emit(ic->bg_object, "start", "");
|
|
|
|
edje_object_signal_emit(ic->overlay_object, "start", "");
|
2005-10-08 12:38:13 -07:00
|
|
|
if (ic->ibb->overlay_object)
|
|
|
|
edje_object_signal_emit(ic->ibb->overlay_object, "start", "");
|
2005-09-13 23:39:59 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
edje_object_signal_emit(ic->icon_object, "exec", "");
|
|
|
|
for (ll = ic->extra_icons; ll; ll = ll->next) edje_object_signal_emit(ll->data, "exec", "");
|
|
|
|
edje_object_signal_emit(ic->bg_object, "exec", "");
|
|
|
|
edje_object_signal_emit(ic->overlay_object, "exec", "");
|
2005-10-08 12:38:13 -07:00
|
|
|
if (ic->ibb->overlay_object)
|
|
|
|
edje_object_signal_emit(ic->ibb->overlay_object, "exec", "");
|
2005-09-13 23:39:59 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2005-05-14 07:06:09 -07:00
|
|
|
break;
|
|
|
|
case E_APP_READY:
|
2005-09-13 23:39:59 -07:00
|
|
|
case E_APP_READY_EXPIRE:
|
2005-05-14 07:06:09 -07:00
|
|
|
case E_APP_EXIT:
|
2005-09-13 23:39:59 -07:00
|
|
|
if (e_app_is_parent(ib->apps, a))
|
|
|
|
{
|
|
|
|
if (a->startup_notify)
|
|
|
|
{
|
|
|
|
IBar_Icon *ic;
|
|
|
|
|
|
|
|
ic = _ibar_icon_find(ibb, a);
|
|
|
|
if (ic)
|
|
|
|
{
|
|
|
|
edje_object_signal_emit(ic->icon_object, "stop", "");
|
|
|
|
for (ll = ic->extra_icons; ll; ll = ll->next) edje_object_signal_emit(ll->data, "stop", "");
|
|
|
|
edje_object_signal_emit(ic->bg_object, "stop", "");
|
|
|
|
edje_object_signal_emit(ic->overlay_object, "stop", "");
|
2005-10-08 12:38:13 -07:00
|
|
|
if (ic->ibb->overlay_object)
|
|
|
|
edje_object_signal_emit(ic->ibb->overlay_object, "stop", "");
|
2005-09-13 23:39:59 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2005-05-14 07:06:09 -07:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static IBar_Bar *
|
|
|
|
_ibar_bar_new(IBar *ib, E_Container *con)
|
|
|
|
{
|
|
|
|
IBar_Bar *ibb;
|
|
|
|
Evas_List *l;
|
2005-02-13 03:37:13 -08:00
|
|
|
Evas_Object *o;
|
2005-02-16 03:43:58 -08:00
|
|
|
E_Gadman_Policy policy;
|
2005-05-03 06:44:43 -07:00
|
|
|
Evas_Coord x, y, w, h;
|
2005-10-05 10:56:35 -07:00
|
|
|
const char *drop[] = { "enlightenment/eapp", "enlightenment/border", "text/uri-list" };
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
ibb = E_NEW(IBar_Bar, 1);
|
2005-02-13 03:37:13 -08:00
|
|
|
if (!ibb) return NULL;
|
2005-05-14 07:06:09 -07:00
|
|
|
ibb->ibar = ib;
|
|
|
|
ib->bars = evas_list_append(ib->bars, ibb);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
|
|
|
ibb->con = con;
|
|
|
|
e_object_ref(E_OBJECT(con));
|
|
|
|
ibb->evas = con->bg_evas;
|
|
|
|
|
2005-02-16 03:43:58 -08:00
|
|
|
ibb->x = ibb->y = ibb->w = ibb->h = -1;
|
|
|
|
|
2005-02-13 03:37:13 -08:00
|
|
|
evas_event_freeze(ibb->evas);
|
|
|
|
o = edje_object_add(ibb->evas);
|
2005-05-14 07:06:09 -07:00
|
|
|
ibb->bar_object = o;
|
|
|
|
e_theme_edje_object_set(o, "base/theme/modules/ibar",
|
|
|
|
"modules/ibar/main");
|
2005-02-13 03:37:13 -08:00
|
|
|
evas_object_show(o);
|
|
|
|
|
2005-06-17 17:10:31 -07:00
|
|
|
if (ibb->ibar->conf->follower)
|
|
|
|
{
|
|
|
|
o = edje_object_add(ibb->evas);
|
|
|
|
ibb->overlay_object = o;
|
2005-10-26 19:44:36 -07:00
|
|
|
evas_object_layer_set(o, 2);
|
2005-06-17 17:10:31 -07:00
|
|
|
e_theme_edje_object_set(o, "base/theme/modules/ibar",
|
|
|
|
"modules/ibar/follower");
|
|
|
|
evas_object_show(o);
|
|
|
|
}
|
2005-02-13 03:37:13 -08:00
|
|
|
|
|
|
|
o = evas_object_rectangle_add(ibb->evas);
|
|
|
|
ibb->event_object = o;
|
2005-10-26 19:44:36 -07:00
|
|
|
evas_object_layer_set(o, 3);
|
2005-02-13 03:37:13 -08:00
|
|
|
evas_object_repeat_events_set(o, 1);
|
|
|
|
evas_object_color_set(o, 0, 0, 0, 0);
|
2005-05-14 07:06:09 -07:00
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, _ibar_bar_cb_mouse_in, ibb);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT, _ibar_bar_cb_mouse_out, ibb);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _ibar_bar_cb_mouse_down, ibb);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _ibar_bar_cb_mouse_up, ibb);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_MOVE, _ibar_bar_cb_mouse_move, ibb);
|
2005-02-13 03:37:13 -08:00
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = e_box_add(ibb->evas);
|
2005-05-14 07:06:09 -07:00
|
|
|
ibb->box_object = o;
|
|
|
|
evas_object_intercept_move_callback_add(o, _ibar_bar_cb_intercept_move, ibb);
|
|
|
|
evas_object_intercept_resize_callback_add(o, _ibar_bar_cb_intercept_resize, ibb);
|
2005-02-13 03:37:13 -08:00
|
|
|
e_box_freeze(o);
|
2005-05-14 07:06:09 -07:00
|
|
|
edje_object_part_swallow(ibb->bar_object, "items", o);
|
2005-02-13 03:37:13 -08:00
|
|
|
evas_object_show(o);
|
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
if (ibb->ibar->apps)
|
2005-01-01 18:39:44 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
for (l = ibb->ibar->apps->subapps; l; l = l->next)
|
|
|
|
{
|
|
|
|
E_App *a;
|
|
|
|
IBar_Icon *ic;
|
2005-05-13 14:19:04 -07:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
a = l->data;
|
2005-09-28 05:48:38 -07:00
|
|
|
if (e_app_valid_exe_get(a) || (!a->exe))
|
2005-09-27 20:44:31 -07:00
|
|
|
{
|
|
|
|
ic = _ibar_icon_new(ibb, a);
|
|
|
|
}
|
2005-05-14 07:06:09 -07:00
|
|
|
}
|
2005-01-01 18:39:44 -08:00
|
|
|
}
|
2005-02-13 03:37:13 -08:00
|
|
|
ibb->align_req = 0.5;
|
|
|
|
ibb->align = 0.5;
|
2005-05-14 07:06:09 -07:00
|
|
|
e_box_align_set(ibb->box_object, 0.5, 0.5);
|
|
|
|
|
|
|
|
e_box_thaw(ibb->box_object);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
evas_object_resize(ibb->bar_object, 1000, 1000);
|
|
|
|
edje_object_calc_force(ibb->bar_object);
|
|
|
|
edje_object_part_geometry_get(ibb->bar_object, "items", &x, &y, &w, &h);
|
2005-06-08 06:08:44 -07:00
|
|
|
ibb->bar_inset.l = x;
|
|
|
|
ibb->bar_inset.r = 1000 - (x + w);
|
|
|
|
ibb->bar_inset.t = y;
|
|
|
|
ibb->bar_inset.b = 1000 - (y + h);
|
|
|
|
|
|
|
|
o = edje_object_add(ibb->evas);
|
|
|
|
e_theme_edje_object_set(o, "base/theme/modules/ibar",
|
|
|
|
"modules/ibar/icon");
|
|
|
|
evas_object_resize(o, 100, 100);
|
|
|
|
edje_object_calc_force(o);
|
|
|
|
edje_object_part_geometry_get(o, "item", &x, &y, &w, &h);
|
|
|
|
ibb->icon_inset.l = x;
|
|
|
|
ibb->icon_inset.r = 100 - (x + w);
|
|
|
|
ibb->icon_inset.t = y;
|
|
|
|
ibb->icon_inset.b = 100 - (y + h);
|
|
|
|
evas_object_del(o);
|
2005-05-03 06:44:43 -07:00
|
|
|
|
2005-10-05 10:56:35 -07:00
|
|
|
ibb->drop_handler = e_drop_handler_add(ibb,
|
|
|
|
_ibar_bar_cb_enter, _ibar_bar_cb_move,
|
|
|
|
_ibar_bar_cb_leave, _ibar_bar_cb_drop,
|
|
|
|
drop, 3,
|
|
|
|
ibb->x + ibb->bar_inset.l, ibb->y + ibb->bar_inset.t,
|
|
|
|
ibb->w - (ibb->bar_inset.l + ibb->bar_inset.r),
|
|
|
|
ibb->h - (ibb->bar_inset.t + ibb->bar_inset.b));
|
2005-05-01 12:29:17 -07:00
|
|
|
|
2005-02-13 03:37:13 -08:00
|
|
|
ibb->gmc = e_gadman_client_new(ibb->con->gadman);
|
2005-05-14 07:06:09 -07:00
|
|
|
e_gadman_client_domain_set(ibb->gmc, "module.ibar", bar_count++);
|
2005-02-16 03:43:58 -08:00
|
|
|
policy = E_GADMAN_POLICY_EDGES | E_GADMAN_POLICY_HMOVE | E_GADMAN_POLICY_VMOVE;
|
2005-05-14 07:06:09 -07:00
|
|
|
if (ibb->ibar->conf->width == IBAR_WIDTH_FIXED)
|
2005-02-16 03:43:58 -08:00
|
|
|
policy |= E_GADMAN_POLICY_HSIZE;
|
|
|
|
e_gadman_client_policy_set(ibb->gmc, policy);
|
2005-02-13 03:37:13 -08:00
|
|
|
e_gadman_client_min_size_set(ibb->gmc, 8, 8);
|
2005-03-19 04:49:46 -08:00
|
|
|
e_gadman_client_max_size_set(ibb->gmc, 3200, 3200);
|
2005-02-16 03:43:58 -08:00
|
|
|
e_gadman_client_auto_size_set(ibb->gmc, -1, -1);
|
2005-02-13 03:37:13 -08:00
|
|
|
e_gadman_client_align_set(ibb->gmc, 0.5, 1.0);
|
2005-06-20 01:41:01 -07:00
|
|
|
e_gadman_client_resize(ibb->gmc, 400, 40);
|
2005-05-14 07:06:09 -07:00
|
|
|
e_gadman_client_change_func_set(ibb->gmc, _ibar_bar_cb_gmc_change, ibb);
|
2005-03-21 00:18:17 -08:00
|
|
|
e_gadman_client_edge_set(ibb->gmc, E_GADMAN_EDGE_BOTTOM);
|
2005-02-13 03:37:13 -08:00
|
|
|
e_gadman_client_load(ibb->gmc);
|
|
|
|
|
|
|
|
evas_event_thaw(ibb->evas);
|
|
|
|
|
2005-02-21 08:12:32 -08:00
|
|
|
/* We need to resize, if the width is auto and the number
|
|
|
|
* of apps has changed since last startup */
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_frame_resize(ibb);
|
2005-02-21 08:12:32 -08:00
|
|
|
|
2005-02-13 03:37:13 -08:00
|
|
|
/*
|
2005-05-14 07:06:09 -07:00
|
|
|
edje_object_signal_emit(ibb->bar_object, "passive", "");
|
2005-02-13 03:37:13 -08:00
|
|
|
edje_object_signal_emit(ibb->overlay_object, "passive", "");
|
|
|
|
*/
|
|
|
|
|
|
|
|
return ibb;
|
2005-01-01 18:39:44 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_free(IBar_Bar *ibb)
|
2005-01-01 18:39:44 -08:00
|
|
|
{
|
2005-02-13 03:37:13 -08:00
|
|
|
e_object_unref(E_OBJECT(ibb->con));
|
2005-05-14 07:06:09 -07:00
|
|
|
|
2005-02-16 03:43:58 -08:00
|
|
|
e_object_del(E_OBJECT(ibb->menu));
|
|
|
|
|
2005-02-13 03:37:13 -08:00
|
|
|
while (ibb->icons)
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_icon_free(ibb->icons->data);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-10-05 10:56:35 -07:00
|
|
|
e_drop_handler_del(ibb->drop_handler);
|
2005-06-10 14:26:50 -07:00
|
|
|
|
2005-02-13 03:37:13 -08:00
|
|
|
if (ibb->timer) ecore_timer_del(ibb->timer);
|
|
|
|
if (ibb->animator) ecore_animator_del(ibb->animator);
|
2005-05-14 07:06:09 -07:00
|
|
|
evas_object_del(ibb->bar_object);
|
2005-06-17 17:10:31 -07:00
|
|
|
if (ibb->overlay_object) evas_object_del(ibb->overlay_object);
|
2005-05-14 07:06:09 -07:00
|
|
|
evas_object_del(ibb->box_object);
|
2005-02-13 03:37:13 -08:00
|
|
|
evas_object_del(ibb->event_object);
|
2005-06-11 04:19:10 -07:00
|
|
|
if (ibb->drag_object) evas_object_del(ibb->drag_object);
|
|
|
|
ibb->drag_object = NULL;
|
|
|
|
if (ibb->drag_object_overlay) evas_object_del(ibb->drag_object_overlay);
|
|
|
|
ibb->drag_object_overlay = NULL;
|
|
|
|
|
2005-02-13 03:37:13 -08:00
|
|
|
e_gadman_client_save(ibb->gmc);
|
|
|
|
e_object_del(E_OBJECT(ibb->gmc));
|
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
ibb->ibar->bars = evas_list_remove(ibb->ibar->bars, ibb);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-02-16 03:43:58 -08:00
|
|
|
free(ibb->conf);
|
2005-02-13 03:37:13 -08:00
|
|
|
free(ibb);
|
2005-05-14 07:06:09 -07:00
|
|
|
bar_count--;
|
2005-01-01 18:39:44 -08:00
|
|
|
}
|
|
|
|
|
2005-02-16 03:43:58 -08:00
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_menu_new(IBar_Bar *ibb)
|
2005-02-16 03:43:58 -08:00
|
|
|
{
|
|
|
|
E_Menu *mn;
|
|
|
|
E_Menu_Item *mi;
|
|
|
|
|
|
|
|
mn = e_menu_new();
|
|
|
|
ibb->menu = mn;
|
|
|
|
|
|
|
|
/* Enabled */
|
2005-04-05 07:47:49 -07:00
|
|
|
/*
|
2005-02-16 03:43:58 -08:00
|
|
|
mi = e_menu_item_new(mn);
|
|
|
|
e_menu_item_label_set(mi, "Enabled");
|
|
|
|
e_menu_item_check_set(mi, 1);
|
|
|
|
if (ibb->conf->enabled) e_menu_item_toggle_set(mi, 1);
|
2005-05-14 07:06:09 -07:00
|
|
|
e_menu_item_callback_set(mi, _ibar_bar_cb_menu_enabled, ibb);
|
2005-04-05 07:47:49 -07:00
|
|
|
*/
|
|
|
|
|
2005-02-16 03:43:58 -08:00
|
|
|
/* Edit */
|
|
|
|
mi = e_menu_item_new(mn);
|
2005-04-25 02:12:38 -07:00
|
|
|
e_menu_item_label_set(mi, _("Edit Mode"));
|
2005-05-14 07:06:09 -07:00
|
|
|
e_menu_item_callback_set(mi, _ibar_bar_cb_menu_edit, ibb);
|
2005-02-16 03:43:58 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_enable(IBar_Bar *ibb)
|
2005-02-16 03:43:58 -08:00
|
|
|
{
|
|
|
|
ibb->conf->enabled = 1;
|
2005-05-14 07:06:09 -07:00
|
|
|
evas_object_show(ibb->bar_object);
|
2005-06-17 17:10:31 -07:00
|
|
|
if (ibb->overlay_object) evas_object_show(ibb->overlay_object);
|
2005-05-14 07:06:09 -07:00
|
|
|
evas_object_show(ibb->box_object);
|
2005-02-16 03:43:58 -08:00
|
|
|
evas_object_show(ibb->event_object);
|
|
|
|
e_config_save_queue();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_disable(IBar_Bar *ibb)
|
2005-02-16 03:43:58 -08:00
|
|
|
{
|
|
|
|
ibb->conf->enabled = 0;
|
2005-05-14 07:06:09 -07:00
|
|
|
evas_object_hide(ibb->bar_object);
|
2005-06-17 17:10:31 -07:00
|
|
|
if (ibb->overlay_object) evas_object_hide(ibb->overlay_object);
|
2005-05-14 07:06:09 -07:00
|
|
|
evas_object_hide(ibb->box_object);
|
2005-02-16 03:43:58 -08:00
|
|
|
evas_object_hide(ibb->event_object);
|
|
|
|
e_config_save_queue();
|
|
|
|
}
|
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
static IBar_Icon *
|
|
|
|
_ibar_icon_new(IBar_Bar *ibb, E_App *a)
|
2005-01-01 18:39:44 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Icon *ic;
|
2005-10-08 12:27:31 -07:00
|
|
|
// char *str;
|
2005-02-13 03:37:13 -08:00
|
|
|
Evas_Object *o;
|
2005-06-08 06:08:44 -07:00
|
|
|
Evas_Coord w, h;
|
2005-05-13 14:19:04 -07:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
ic = E_NEW(IBar_Icon, 1);
|
2005-02-13 03:37:13 -08:00
|
|
|
if (!ic) return NULL;
|
|
|
|
ic->ibb = ibb;
|
2005-05-14 07:06:09 -07:00
|
|
|
ic->app = a;
|
|
|
|
e_object_ref(E_OBJECT(a));
|
2005-02-13 03:37:13 -08:00
|
|
|
ibb->icons = evas_list_append(ibb->icons, ic);
|
|
|
|
|
|
|
|
o = evas_object_rectangle_add(ibb->evas);
|
|
|
|
ic->event_object = o;
|
|
|
|
evas_object_layer_set(o, 1);
|
2005-05-14 07:06:09 -07:00
|
|
|
evas_object_clip_set(o, evas_object_clip_get(ibb->box_object));
|
2005-02-13 03:37:13 -08:00
|
|
|
evas_object_color_set(o, 0, 0, 0, 0);
|
|
|
|
evas_object_repeat_events_set(o, 1);
|
2005-05-14 07:06:09 -07:00
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, _ibar_icon_cb_mouse_in, ic);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT, _ibar_icon_cb_mouse_out, ic);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _ibar_icon_cb_mouse_down, ic);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _ibar_icon_cb_mouse_up, ic);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_MOVE, _ibar_icon_cb_mouse_move, ic);
|
2005-02-13 03:37:13 -08:00
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = edje_object_add(ibb->evas);
|
|
|
|
ic->bg_object = o;
|
2005-05-14 07:06:09 -07:00
|
|
|
evas_object_intercept_move_callback_add(o, _ibar_icon_cb_intercept_move, ic);
|
|
|
|
evas_object_intercept_resize_callback_add(o, _ibar_icon_cb_intercept_resize, ic);
|
|
|
|
e_theme_edje_object_set(o, "base/theme/modules/ibar",
|
|
|
|
"modules/ibar/icon");
|
2005-02-13 03:37:13 -08:00
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = edje_object_add(ibb->evas);
|
|
|
|
ic->icon_object = o;
|
2005-06-08 06:08:44 -07:00
|
|
|
evas_object_resize(o, ibb->ibar->conf->iconsize, ibb->ibar->conf->iconsize);
|
2005-05-14 07:06:09 -07:00
|
|
|
edje_object_file_set(o, ic->app->path, "icon");
|
2005-02-13 03:37:13 -08:00
|
|
|
edje_object_part_swallow(ic->bg_object, "item", o);
|
|
|
|
evas_object_pass_events_set(o, 1);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = edje_object_add(ibb->evas);
|
|
|
|
ic->overlay_object = o;
|
2005-05-14 07:06:09 -07:00
|
|
|
evas_object_intercept_move_callback_add(o, _ibar_icon_cb_intercept_move, ic);
|
|
|
|
evas_object_intercept_resize_callback_add(o, _ibar_icon_cb_intercept_resize, ic);
|
|
|
|
e_theme_edje_object_set(o, "base/theme/modules/ibar",
|
|
|
|
"modules/ibar/icon_overlay");
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = edje_object_add(ibb->evas);
|
|
|
|
ic->extra_icons = evas_list_append(ic->extra_icons, o);
|
|
|
|
edje_object_file_set(o, ic->app->path, "icon");
|
|
|
|
edje_object_part_swallow(ic->overlay_object, "item", o);
|
|
|
|
evas_object_pass_events_set(o, 1);
|
2005-02-13 03:37:13 -08:00
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
evas_object_raise(ic->event_object);
|
|
|
|
|
2005-06-08 06:08:44 -07:00
|
|
|
w = ibb->ibar->conf->iconsize + ibb->icon_inset.l + ibb->icon_inset.r;
|
|
|
|
h = ibb->ibar->conf->iconsize + ibb->icon_inset.t + ibb->icon_inset.b;
|
2005-05-14 07:06:09 -07:00
|
|
|
e_box_pack_end(ibb->box_object, ic->bg_object);
|
2005-02-13 03:37:13 -08:00
|
|
|
e_box_pack_options_set(ic->bg_object,
|
|
|
|
1, 1, /* fill */
|
|
|
|
0, 0, /* expand */
|
|
|
|
0.5, 0.5, /* align */
|
2005-06-08 06:08:44 -07:00
|
|
|
w, h, /* min */
|
|
|
|
w, h /* max */
|
2005-02-13 03:37:13 -08:00
|
|
|
);
|
|
|
|
|
2005-10-08 12:27:31 -07:00
|
|
|
/*
|
2005-02-13 03:37:13 -08:00
|
|
|
str = (char *)edje_object_data_get(ic->icon_object, "raise_on_hilight");
|
|
|
|
if (str)
|
2005-01-01 18:39:44 -08:00
|
|
|
{
|
2005-02-13 03:37:13 -08:00
|
|
|
if (atoi(str) == 1) ic->raise_on_hilight = 1;
|
2005-01-01 18:39:44 -08:00
|
|
|
}
|
2005-10-08 12:27:31 -07:00
|
|
|
*/
|
2005-02-13 03:37:13 -08:00
|
|
|
edje_object_signal_emit(ic->bg_object, "passive", "");
|
|
|
|
edje_object_signal_emit(ic->overlay_object, "passive", "");
|
|
|
|
return ic;
|
2005-01-01 18:39:44 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_icon_free(IBar_Icon *ic)
|
2005-01-01 18:39:44 -08:00
|
|
|
{
|
2005-02-13 03:37:13 -08:00
|
|
|
ic->ibb->icons = evas_list_remove(ic->ibb->icons, ic);
|
|
|
|
if (ic->bg_object) evas_object_del(ic->bg_object);
|
|
|
|
if (ic->overlay_object) evas_object_del(ic->overlay_object);
|
|
|
|
if (ic->icon_object) evas_object_del(ic->icon_object);
|
|
|
|
if (ic->event_object) evas_object_del(ic->event_object);
|
2005-05-14 07:06:09 -07:00
|
|
|
while (ic->extra_icons)
|
|
|
|
{
|
|
|
|
Evas_Object *o;
|
|
|
|
|
|
|
|
o = ic->extra_icons->data;
|
|
|
|
ic->extra_icons = evas_list_remove_list(ic->extra_icons, ic->extra_icons);
|
|
|
|
evas_object_del(o);
|
|
|
|
}
|
|
|
|
e_object_unref(E_OBJECT(ic->app));
|
2005-02-13 03:37:13 -08:00
|
|
|
free(ic);
|
2005-01-01 18:39:44 -08:00
|
|
|
}
|
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
static IBar_Icon *
|
|
|
|
_ibar_icon_find(IBar_Bar *ibb, E_App *a)
|
2005-01-01 18:39:44 -08:00
|
|
|
{
|
|
|
|
Evas_List *l;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
|
|
|
for (l = ibb->icons; l; l = l->next)
|
2005-01-01 18:39:44 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Icon *ic;
|
2005-01-01 18:39:44 -08:00
|
|
|
|
2005-02-13 03:37:13 -08:00
|
|
|
ic = l->data;
|
2005-09-26 03:03:49 -07:00
|
|
|
if (e_app_equals(ic->app, a))
|
2005-09-26 02:13:44 -07:00
|
|
|
return ic;
|
2005-01-01 18:39:44 -08:00
|
|
|
}
|
2005-02-13 03:37:13 -08:00
|
|
|
return NULL;
|
2005-01-01 18:39:44 -08:00
|
|
|
}
|
|
|
|
|
2005-06-10 09:01:00 -07:00
|
|
|
static IBar_Icon *
|
|
|
|
_ibar_icon_pos_find(IBar_Bar *ibb, int x, int y)
|
|
|
|
{
|
|
|
|
IBar_Icon *ic;
|
|
|
|
double pos, iw;
|
|
|
|
int w, h;
|
|
|
|
|
|
|
|
x = x - (ibb->x + ibb->bar_inset.l);
|
|
|
|
y = y - (ibb->y + ibb->bar_inset.t);
|
|
|
|
w = ibb->w - (ibb->bar_inset.l + ibb->bar_inset.r);
|
|
|
|
h = ibb->h - (ibb->bar_inset.t + ibb->bar_inset.b);
|
|
|
|
|
|
|
|
if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_BOTTOM) ||
|
|
|
|
(e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_TOP))
|
|
|
|
{
|
|
|
|
iw = w / (double) e_box_pack_count_get(ibb->box_object);
|
|
|
|
pos = x / iw;
|
|
|
|
}
|
|
|
|
else if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_LEFT) ||
|
|
|
|
(e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_RIGHT))
|
|
|
|
{
|
|
|
|
iw = h / (double) e_box_pack_count_get(ibb->box_object);
|
|
|
|
pos = y / iw;
|
|
|
|
}
|
|
|
|
|
|
|
|
ic = evas_list_nth(ibb->icons, pos);
|
|
|
|
return ic;
|
|
|
|
}
|
|
|
|
|
2005-02-13 03:37:13 -08:00
|
|
|
void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_config_menu_new(IBar *ib)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
E_Menu *mn;
|
|
|
|
E_Menu_Item *mi;
|
|
|
|
|
|
|
|
mn = e_menu_new();
|
2005-03-21 14:42:47 -08:00
|
|
|
ib->config_menu = mn;
|
|
|
|
|
|
|
|
mn = e_menu_new();
|
|
|
|
ib->config_menu_options = mn;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
mi = e_menu_item_new(mn);
|
2005-04-11 14:50:36 -07:00
|
|
|
e_menu_item_label_set(mi, _("Auto fit icons"));
|
2005-02-16 03:43:58 -08:00
|
|
|
e_menu_item_check_set(mi, 1);
|
2005-05-14 07:06:09 -07:00
|
|
|
if (ib->conf->width == IBAR_WIDTH_AUTO) e_menu_item_toggle_set(mi, 1);
|
|
|
|
e_menu_item_callback_set(mi, _ibar_bar_cb_width_auto, ib);
|
2004-11-24 19:37:45 -08:00
|
|
|
|
2005-06-17 17:10:31 -07:00
|
|
|
mi = e_menu_item_new(mn);
|
|
|
|
e_menu_item_label_set(mi, _("Follower"));
|
|
|
|
e_menu_item_check_set(mi, 1);
|
|
|
|
if (ib->conf->follower) e_menu_item_toggle_set(mi, 1);
|
|
|
|
e_menu_item_callback_set(mi, _ibar_bar_cb_follower, ib);
|
|
|
|
|
2005-03-21 14:42:47 -08:00
|
|
|
mn = e_menu_new();
|
|
|
|
ib->config_menu_size = mn;
|
2004-11-24 19:37:45 -08:00
|
|
|
|
2005-01-01 18:39:44 -08:00
|
|
|
mi = e_menu_item_new(mn);
|
2005-04-11 14:50:36 -07:00
|
|
|
e_menu_item_label_set(mi, _("Microscopic"));
|
2005-01-01 18:39:44 -08:00
|
|
|
e_menu_item_radio_set(mi, 1);
|
|
|
|
e_menu_item_radio_group_set(mi, 2);
|
|
|
|
if (ib->conf->iconsize == 8) e_menu_item_toggle_set(mi, 1);
|
2005-05-14 07:06:09 -07:00
|
|
|
e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_microscopic, ib);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-01-01 18:39:44 -08:00
|
|
|
mi = e_menu_item_new(mn);
|
2005-04-11 14:50:36 -07:00
|
|
|
e_menu_item_label_set(mi, _("Tiny"));
|
2005-01-01 18:39:44 -08:00
|
|
|
e_menu_item_radio_set(mi, 1);
|
|
|
|
e_menu_item_radio_group_set(mi, 2);
|
|
|
|
if (ib->conf->iconsize == 12) e_menu_item_toggle_set(mi, 1);
|
2005-05-14 07:06:09 -07:00
|
|
|
e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_tiny, ib);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-01-01 18:39:44 -08:00
|
|
|
mi = e_menu_item_new(mn);
|
2005-04-11 14:50:36 -07:00
|
|
|
e_menu_item_label_set(mi, _("Very Small"));
|
2005-01-01 18:39:44 -08:00
|
|
|
e_menu_item_radio_set(mi, 1);
|
|
|
|
e_menu_item_radio_group_set(mi, 2);
|
|
|
|
if (ib->conf->iconsize == 16) e_menu_item_toggle_set(mi, 1);
|
2005-05-14 07:06:09 -07:00
|
|
|
e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_very_small, ib);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-01-01 18:39:44 -08:00
|
|
|
mi = e_menu_item_new(mn);
|
2005-04-11 14:50:36 -07:00
|
|
|
e_menu_item_label_set(mi, _("Small"));
|
2005-01-01 18:39:44 -08:00
|
|
|
e_menu_item_radio_set(mi, 1);
|
|
|
|
e_menu_item_radio_group_set(mi, 2);
|
|
|
|
if (ib->conf->iconsize == 24) e_menu_item_toggle_set(mi, 1);
|
2005-05-14 07:06:09 -07:00
|
|
|
e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_small, ib);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-01-01 18:39:44 -08:00
|
|
|
mi = e_menu_item_new(mn);
|
2005-04-11 14:50:36 -07:00
|
|
|
e_menu_item_label_set(mi, _("Medium"));
|
2005-01-01 18:39:44 -08:00
|
|
|
e_menu_item_radio_set(mi, 1);
|
|
|
|
e_menu_item_radio_group_set(mi, 2);
|
|
|
|
if (ib->conf->iconsize == 32) e_menu_item_toggle_set(mi, 1);
|
2005-05-14 07:06:09 -07:00
|
|
|
e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_medium, ib);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-01-01 18:39:44 -08:00
|
|
|
mi = e_menu_item_new(mn);
|
2005-04-11 14:50:36 -07:00
|
|
|
e_menu_item_label_set(mi, _("Large"));
|
2005-01-01 18:39:44 -08:00
|
|
|
e_menu_item_radio_set(mi, 1);
|
|
|
|
e_menu_item_radio_group_set(mi, 2);
|
|
|
|
if (ib->conf->iconsize == 40) e_menu_item_toggle_set(mi, 1);
|
2005-05-14 07:06:09 -07:00
|
|
|
e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_large, ib);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-01-01 18:39:44 -08:00
|
|
|
mi = e_menu_item_new(mn);
|
2005-04-11 14:50:36 -07:00
|
|
|
e_menu_item_label_set(mi, _("Very Large"));
|
2005-01-01 18:39:44 -08:00
|
|
|
e_menu_item_radio_set(mi, 1);
|
|
|
|
e_menu_item_radio_group_set(mi, 2);
|
|
|
|
if (ib->conf->iconsize == 48) e_menu_item_toggle_set(mi, 1);
|
2005-05-14 07:06:09 -07:00
|
|
|
e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_very_large, ib);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-01-01 18:39:44 -08:00
|
|
|
mi = e_menu_item_new(mn);
|
2005-04-17 18:55:32 -07:00
|
|
|
e_menu_item_label_set(mi, _("Extremely Large"));
|
2005-01-01 18:39:44 -08:00
|
|
|
e_menu_item_radio_set(mi, 1);
|
|
|
|
e_menu_item_radio_group_set(mi, 2);
|
|
|
|
if (ib->conf->iconsize == 56) e_menu_item_toggle_set(mi, 1);
|
2005-05-14 07:06:09 -07:00
|
|
|
e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_extremely_large, ib);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-01-01 18:39:44 -08:00
|
|
|
mi = e_menu_item_new(mn);
|
2005-04-11 14:50:36 -07:00
|
|
|
e_menu_item_label_set(mi, _("Huge"));
|
2005-01-01 18:39:44 -08:00
|
|
|
e_menu_item_radio_set(mi, 1);
|
|
|
|
e_menu_item_radio_group_set(mi, 2);
|
|
|
|
if (ib->conf->iconsize == 64) e_menu_item_toggle_set(mi, 1);
|
2005-05-14 07:06:09 -07:00
|
|
|
e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_huge, ib);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-01-01 18:39:44 -08:00
|
|
|
mi = e_menu_item_new(mn);
|
2005-04-11 14:50:36 -07:00
|
|
|
e_menu_item_label_set(mi, _("Enormous"));
|
2005-01-01 18:39:44 -08:00
|
|
|
e_menu_item_radio_set(mi, 1);
|
|
|
|
e_menu_item_radio_group_set(mi, 2);
|
|
|
|
if (ib->conf->iconsize == 96) e_menu_item_toggle_set(mi, 1);
|
2005-05-14 07:06:09 -07:00
|
|
|
e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_enormous, ib);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-01-01 18:39:44 -08:00
|
|
|
mi = e_menu_item_new(mn);
|
2005-04-11 14:50:36 -07:00
|
|
|
e_menu_item_label_set(mi, _("Gigantic"));
|
2005-01-01 18:39:44 -08:00
|
|
|
e_menu_item_radio_set(mi, 1);
|
|
|
|
e_menu_item_radio_group_set(mi, 2);
|
|
|
|
if (ib->conf->iconsize == 128) e_menu_item_toggle_set(mi, 1);
|
2005-05-14 07:06:09 -07:00
|
|
|
e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_gigantic, ib);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-03-21 14:42:47 -08:00
|
|
|
/* Submenus */
|
|
|
|
mi = e_menu_item_new(ib->config_menu);
|
2005-04-11 14:50:36 -07:00
|
|
|
e_menu_item_label_set(mi, _("Options"));
|
2005-03-21 14:42:47 -08:00
|
|
|
e_menu_item_submenu_set(mi, ib->config_menu_options);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-03-21 14:42:47 -08:00
|
|
|
mi = e_menu_item_new(ib->config_menu);
|
2005-04-11 14:50:36 -07:00
|
|
|
e_menu_item_label_set(mi, _("Size"));
|
2005-03-21 14:42:47 -08:00
|
|
|
e_menu_item_submenu_set(mi, ib->config_menu_size);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
#if 0
|
|
|
|
static void
|
|
|
|
_ibar_icon_reorder_before(IBar_Icon *ic, IBar_Icon *before)
|
|
|
|
{
|
|
|
|
Evas_Coord bw, bh;
|
|
|
|
|
|
|
|
e_box_freeze(ic->ibb->box_object);
|
|
|
|
e_box_unpack(ic->bg_object);
|
|
|
|
ic->ibb->icons = evas_list_remove(ic->ibb->icons, ic);
|
|
|
|
if (before)
|
|
|
|
{
|
|
|
|
ic->ibb->icons = evas_list_prepend_relative(ic->ibb->icons, ic, before);
|
|
|
|
e_box_pack_before(ic->ibb->box_object, ic->bg_object, before->bg_object);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ic->ibb->icons = evas_list_prepend(ic->ibb->icons, ic);
|
|
|
|
e_box_pack_start(ic->ibb->box_object, ic->bg_object);
|
|
|
|
}
|
|
|
|
edje_object_size_min_calc(ic->bg_object, &bw, &bh);
|
|
|
|
e_box_pack_options_set(ic->bg_object,
|
|
|
|
1, 1, /* fill */
|
|
|
|
0, 0, /* expand */
|
|
|
|
0.5, 0.5, /* align */
|
|
|
|
bw, bh, /* min */
|
|
|
|
bw, bh /* max */
|
|
|
|
);
|
|
|
|
e_box_thaw(ic->ibb->box_object);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ibar_icon_reorder_after(IBar_Icon *ic, IBar_Icon *after)
|
|
|
|
{
|
2005-06-08 06:08:44 -07:00
|
|
|
Evas_Coord w, h;
|
2005-05-14 07:06:09 -07:00
|
|
|
|
|
|
|
e_box_freeze(ic->ibb->box_object);
|
|
|
|
e_box_unpack(ic->bg_object);
|
|
|
|
ic->ibb->icons = evas_list_remove(ic->ibb->icons, ic);
|
|
|
|
if (after)
|
|
|
|
{
|
|
|
|
ic->ibb->icons = evas_list_append_relative(ic->ibb->icons, ic, after);
|
|
|
|
e_box_pack_after(ic->ibb->box_object, ic->bg_object, after->bg_object);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ic->ibb->icons = evas_list_append(ic->ibb->icons, ic);
|
|
|
|
e_box_pack_end(ic->ibb->box_object, ic->bg_object);
|
|
|
|
}
|
2005-06-08 06:08:44 -07:00
|
|
|
w = ic->ibb->ibar->conf->iconsize + ic->ibb->icon_inset.l + ic->ibb->icon_inset.r;
|
|
|
|
h = ic->ibb->ibar->conf->iconsize + ic->ibb->icon_inset.t + ic->ibb->icon_inset.b;
|
2005-05-14 07:06:09 -07:00
|
|
|
e_box_pack_options_set(ic->bg_object,
|
|
|
|
1, 1, /* fill */
|
|
|
|
0, 0, /* expand */
|
|
|
|
0.5, 0.5, /* align */
|
2005-06-08 06:08:44 -07:00
|
|
|
w, h, /* min */
|
|
|
|
w, h /* max */
|
2005-05-14 07:06:09 -07:00
|
|
|
);
|
|
|
|
e_box_thaw(ic->ibb->box_object);
|
|
|
|
}
|
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_frame_resize(IBar_Bar *ibb)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-03-12 01:44:16 -08:00
|
|
|
Evas_Coord w, h, bw, bh;
|
2005-02-16 03:43:58 -08:00
|
|
|
/* Not finished loading config yet! */
|
2005-08-24 15:08:33 -07:00
|
|
|
if ((ibb->x == -1) || (ibb->y == -1) ||
|
|
|
|
(ibb->w == -1) || (ibb->h == -1))
|
2005-02-16 03:43:58 -08:00
|
|
|
return;
|
2004-11-24 19:37:45 -08:00
|
|
|
|
|
|
|
evas_event_freeze(ibb->evas);
|
2005-05-14 07:06:09 -07:00
|
|
|
e_box_freeze(ibb->box_object);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
e_box_min_size_get(ibb->box_object, &w, &h);
|
|
|
|
edje_extern_object_min_size_set(ibb->box_object, w, h);
|
|
|
|
edje_object_part_swallow(ibb->bar_object, "items", ibb->box_object);
|
|
|
|
edje_object_size_min_calc(ibb->bar_object, &bw, &bh);
|
|
|
|
edje_extern_object_min_size_set(ibb->box_object, 0, 0);
|
|
|
|
edje_object_part_swallow(ibb->bar_object, "items", ibb->box_object);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
e_box_thaw(ibb->box_object);
|
2005-05-03 06:44:43 -07:00
|
|
|
evas_event_thaw(ibb->evas);
|
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
if (ibb->ibar->conf->width == IBAR_WIDTH_AUTO)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-03-12 01:44:16 -08:00
|
|
|
e_gadman_client_resize(ibb->gmc, bw, bh);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-10-08 12:38:13 -07:00
|
|
|
if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_LEFT) ||
|
|
|
|
(e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_RIGHT))
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
/* h is the width of the bar */
|
2005-03-12 01:44:16 -08:00
|
|
|
e_gadman_client_resize(ibb->gmc, bw, ibb->h);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
2005-10-08 12:38:13 -07:00
|
|
|
else if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_TOP) ||
|
|
|
|
(e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_BOTTOM))
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
/* w is the width of the bar */
|
2005-03-12 01:44:16 -08:00
|
|
|
e_gadman_client_resize(ibb->gmc, ibb->w, bh);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-02-16 03:43:58 -08:00
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_edge_change(IBar_Bar *ibb, int edge)
|
2005-02-16 03:43:58 -08:00
|
|
|
{
|
|
|
|
Evas_List *l;
|
2005-06-08 06:08:44 -07:00
|
|
|
Evas_Coord w, h, tmp;
|
2005-02-16 03:43:58 -08:00
|
|
|
Evas_Object *o;
|
|
|
|
E_Gadman_Policy policy;
|
|
|
|
int changed;
|
|
|
|
|
|
|
|
evas_event_freeze(ibb->evas);
|
2005-05-14 07:06:09 -07:00
|
|
|
o = ibb->bar_object;
|
|
|
|
edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[edge]);
|
2005-02-16 03:43:58 -08:00
|
|
|
edje_object_message_signal_process(o);
|
|
|
|
|
2005-06-17 17:10:31 -07:00
|
|
|
if (ibb->overlay_object)
|
|
|
|
{
|
|
|
|
o = ibb->overlay_object;
|
|
|
|
edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[edge]);
|
|
|
|
edje_object_message_signal_process(o);
|
|
|
|
}
|
2005-02-16 03:43:58 -08:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
e_box_freeze(ibb->box_object);
|
2005-02-16 03:43:58 -08:00
|
|
|
|
|
|
|
for (l = ibb->icons; l; l = l->next)
|
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Icon *ic;
|
2005-02-16 03:43:58 -08:00
|
|
|
|
|
|
|
ic = l->data;
|
|
|
|
o = ic->bg_object;
|
2005-05-14 07:06:09 -07:00
|
|
|
edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[edge]);
|
2005-02-16 03:43:58 -08:00
|
|
|
edje_object_message_signal_process(o);
|
|
|
|
|
|
|
|
o = ic->overlay_object;
|
2005-05-14 07:06:09 -07:00
|
|
|
edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[edge]);
|
2005-02-16 03:43:58 -08:00
|
|
|
edje_object_message_signal_process(o);
|
|
|
|
|
2005-06-08 06:08:44 -07:00
|
|
|
w = ibb->ibar->conf->iconsize + ibb->icon_inset.l + ibb->icon_inset.r;
|
|
|
|
h = ibb->ibar->conf->iconsize + ibb->icon_inset.t + ibb->icon_inset.b;
|
2005-02-16 03:43:58 -08:00
|
|
|
e_box_pack_options_set(ic->bg_object,
|
|
|
|
1, 1, /* fill */
|
|
|
|
0, 0, /* expand */
|
|
|
|
0.5, 0.5, /* align */
|
2005-06-08 06:08:44 -07:00
|
|
|
w, h, /* min */
|
|
|
|
w, h /* max */
|
2005-02-16 03:43:58 -08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
ibb->align_req = 0.5;
|
|
|
|
ibb->align = 0.5;
|
2005-05-14 07:06:09 -07:00
|
|
|
e_box_align_set(ibb->box_object, 0.5, 0.5);
|
2005-02-16 03:43:58 -08:00
|
|
|
|
|
|
|
policy = E_GADMAN_POLICY_EDGES | E_GADMAN_POLICY_HMOVE | E_GADMAN_POLICY_VMOVE;
|
|
|
|
if ((edge == E_GADMAN_EDGE_BOTTOM) ||
|
|
|
|
(edge == E_GADMAN_EDGE_TOP))
|
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
changed = (e_box_orientation_get(ibb->box_object) != 1);
|
2005-02-16 03:43:58 -08:00
|
|
|
if (changed)
|
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
e_box_orientation_set(ibb->box_object, 1);
|
|
|
|
if (ibb->ibar->conf->width == IBAR_WIDTH_FIXED)
|
2005-02-16 03:43:58 -08:00
|
|
|
policy |= E_GADMAN_POLICY_HSIZE;
|
|
|
|
e_gadman_client_policy_set(ibb->gmc, policy);
|
|
|
|
tmp = ibb->w;
|
|
|
|
ibb->w = ibb->h;
|
|
|
|
ibb->h = tmp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ((edge == E_GADMAN_EDGE_LEFT) ||
|
|
|
|
(edge == E_GADMAN_EDGE_RIGHT))
|
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
changed = (e_box_orientation_get(ibb->box_object) != 0);
|
2005-02-16 03:43:58 -08:00
|
|
|
if (changed)
|
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
e_box_orientation_set(ibb->box_object, 0);
|
|
|
|
if (ibb->ibar->conf->width == IBAR_WIDTH_FIXED)
|
2005-02-16 03:43:58 -08:00
|
|
|
policy |= E_GADMAN_POLICY_VSIZE;
|
|
|
|
e_gadman_client_policy_set(ibb->gmc, policy);
|
|
|
|
tmp = ibb->w;
|
|
|
|
ibb->w = ibb->h;
|
|
|
|
ibb->h = tmp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
e_box_thaw(ibb->box_object);
|
2005-02-16 03:43:58 -08:00
|
|
|
evas_event_thaw(ibb->evas);
|
2005-02-24 02:23:30 -08:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_frame_resize(ibb);
|
2005-02-16 03:43:58 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_update_policy(IBar_Bar *ibb)
|
2005-02-16 03:43:58 -08:00
|
|
|
{
|
|
|
|
E_Gadman_Policy policy;
|
|
|
|
|
|
|
|
policy = E_GADMAN_POLICY_EDGES | E_GADMAN_POLICY_HMOVE | E_GADMAN_POLICY_VMOVE;
|
|
|
|
if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_BOTTOM) ||
|
|
|
|
(e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_TOP))
|
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
if (ibb->ibar->conf->width == IBAR_WIDTH_FIXED)
|
2005-02-16 03:43:58 -08:00
|
|
|
policy |= E_GADMAN_POLICY_HSIZE;
|
|
|
|
e_gadman_client_policy_set(ibb->gmc, policy);
|
|
|
|
}
|
|
|
|
else if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_LEFT) ||
|
|
|
|
(e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_RIGHT))
|
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
if (ibb->ibar->conf->width == IBAR_WIDTH_FIXED)
|
2005-02-16 03:43:58 -08:00
|
|
|
policy |= E_GADMAN_POLICY_VSIZE;
|
|
|
|
e_gadman_client_policy_set(ibb->gmc, policy);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_motion_handle(IBar_Bar *ibb, Evas_Coord mx, Evas_Coord my)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
Evas_Coord x, y, w, h;
|
|
|
|
double relx, rely;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
evas_object_geometry_get(ibb->box_object, &x, &y, &w, &h);
|
2004-11-24 19:37:45 -08:00
|
|
|
if (w > 0) relx = (double)(mx - x) / (double)w;
|
|
|
|
else relx = 0.0;
|
|
|
|
if (h > 0) rely = (double)(my - y) / (double)h;
|
|
|
|
else rely = 0.0;
|
2005-02-13 03:37:13 -08:00
|
|
|
if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_BOTTOM) ||
|
|
|
|
(e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_TOP))
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
ibb->align_req = 1.0 - relx;
|
|
|
|
ibb->follow_req = relx;
|
|
|
|
}
|
2005-02-13 03:37:13 -08:00
|
|
|
else if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_LEFT) ||
|
|
|
|
(e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_RIGHT))
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
ibb->align_req = 1.0 - rely;
|
|
|
|
ibb->follow_req = rely;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_timer_handle(IBar_Bar *ibb)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
if (!ibb->timer)
|
2005-05-14 07:06:09 -07:00
|
|
|
ibb->timer = ecore_timer_add(0.01, _ibar_bar_cb_timer, ibb);
|
2004-11-24 19:37:45 -08:00
|
|
|
if (!ibb->animator)
|
2005-05-14 07:06:09 -07:00
|
|
|
ibb->animator = ecore_animator_add(_ibar_bar_cb_animator, ibb);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_follower_reset(IBar_Bar *ibb)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
Evas_Coord ww, hh, bx, by, bw, bh, d1, d2, mw, mh;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-06-17 17:10:31 -07:00
|
|
|
if (!ibb->overlay_object) return;
|
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
evas_output_viewport_get(ibb->evas, NULL, NULL, &ww, &hh);
|
2005-05-14 07:06:09 -07:00
|
|
|
evas_object_geometry_get(ibb->box_object, &bx, &by, &bw, &bh);
|
2004-11-24 19:37:45 -08:00
|
|
|
edje_object_size_min_get(ibb->overlay_object, &mw, &mh);
|
2005-02-13 03:37:13 -08:00
|
|
|
if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_BOTTOM) ||
|
|
|
|
(e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_TOP))
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
d1 = bx;
|
|
|
|
d2 = ww - (bx + bw);
|
|
|
|
if (bw > 0)
|
|
|
|
{
|
|
|
|
if (d1 < d2)
|
|
|
|
ibb->follow_req = -((double)(d1 + (mw * 4)) / (double)bw);
|
|
|
|
else
|
|
|
|
ibb->follow_req = 1.0 + ((double)(d2 + (mw * 4)) / (double)bw);
|
|
|
|
}
|
|
|
|
}
|
2005-02-13 03:37:13 -08:00
|
|
|
else if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_LEFT) ||
|
|
|
|
(e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_RIGHT))
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
d1 = by;
|
|
|
|
d2 = hh - (by + bh);
|
|
|
|
if (bh > 0)
|
|
|
|
{
|
|
|
|
if (d1 < d2)
|
|
|
|
ibb->follow_req = -((double)(d1 + (mh * 4)) / (double)bh);
|
|
|
|
else
|
|
|
|
ibb->follow_req = 1.0 + ((double)(d2 + (mh * 4)) / (double)bh);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_icon_cb_intercept_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Icon *ic;
|
2004-11-24 19:37:45 -08:00
|
|
|
|
|
|
|
ic = data;
|
|
|
|
evas_object_move(o, x, y);
|
|
|
|
evas_object_move(ic->event_object, x, y);
|
|
|
|
evas_object_move(ic->overlay_object, x, y);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_icon_cb_intercept_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Icon *ic;
|
2004-11-24 19:37:45 -08:00
|
|
|
|
|
|
|
ic = data;
|
|
|
|
evas_object_resize(o, w, h);
|
|
|
|
evas_object_resize(ic->event_object, w, h);
|
|
|
|
evas_object_resize(ic->overlay_object, w, h);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_intercept_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2004-11-24 19:37:45 -08:00
|
|
|
|
|
|
|
ibb = data;
|
|
|
|
evas_object_move(o, x, y);
|
|
|
|
evas_object_move(ibb->event_object, x, y);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_intercept_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2004-11-24 19:37:45 -08:00
|
|
|
|
|
|
|
ibb = data;
|
2005-01-07 05:04:47 -08:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
evas_object_resize(o, w, h);
|
|
|
|
evas_object_resize(ibb->event_object, w, h);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_icon_cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Mouse_In *ev;
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Icon *ic;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
ev = event_info;
|
|
|
|
ic = data;
|
|
|
|
evas_event_freeze(ic->ibb->evas);
|
|
|
|
evas_object_raise(ic->event_object);
|
|
|
|
if (ic->raise_on_hilight)
|
|
|
|
evas_object_stack_below(ic->bg_object, ic->event_object);
|
|
|
|
evas_object_stack_below(ic->overlay_object, ic->event_object);
|
|
|
|
evas_event_thaw(ic->ibb->evas);
|
|
|
|
edje_object_signal_emit(ic->bg_object, "active", "");
|
|
|
|
edje_object_signal_emit(ic->overlay_object, "active", "");
|
2005-10-08 12:38:13 -07:00
|
|
|
if (ic->ibb->overlay_object)
|
|
|
|
edje_object_signal_emit(ic->ibb->overlay_object, "active", "");
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_icon_cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Out *ev;
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Icon *ic;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
ev = event_info;
|
|
|
|
ic = data;
|
|
|
|
edje_object_signal_emit(ic->bg_object, "passive", "");
|
|
|
|
edje_object_signal_emit(ic->overlay_object, "passive", "");
|
2005-10-08 12:38:13 -07:00
|
|
|
if (ic->ibb->overlay_object)
|
|
|
|
edje_object_signal_emit(ic->ibb->overlay_object, "passive", "");
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_icon_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Down *ev;
|
|
|
|
IBar_Icon *ic;
|
|
|
|
|
|
|
|
ev = event_info;
|
|
|
|
ic = data;
|
|
|
|
if (ev->button == 1)
|
|
|
|
{
|
|
|
|
drag_x = ev->output.x;
|
|
|
|
drag_y = ev->output.y;
|
|
|
|
drag_start = 1;
|
|
|
|
drag = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ibar_icon_cb_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Up *ev;
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Icon *ic;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
ev = event_info;
|
|
|
|
ic = data;
|
|
|
|
if (ev->button == 1)
|
2005-05-14 07:06:09 -07:00
|
|
|
{
|
2005-09-13 23:43:54 -07:00
|
|
|
if (!drag) e_zone_app_exec(ic->ibb->gmc->zone, ic->app);
|
2005-05-14 07:06:09 -07:00
|
|
|
drag = 0;
|
|
|
|
drag_start = 0;
|
|
|
|
}
|
2005-05-01 12:29:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_icon_cb_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Move *ev;
|
|
|
|
IBar_Icon *ic;
|
|
|
|
|
|
|
|
ev = event_info;
|
|
|
|
ic = data;
|
|
|
|
|
|
|
|
if (drag_start)
|
|
|
|
{
|
2005-05-20 19:49:47 -07:00
|
|
|
int dx, dy;
|
2005-05-14 07:06:09 -07:00
|
|
|
|
2005-05-20 19:49:47 -07:00
|
|
|
dx = ev->cur.output.x - drag_x;
|
|
|
|
dy = ev->cur.output.y - drag_y;
|
|
|
|
if (((dx * dx) + (dy * dy)) >
|
|
|
|
(e_config->drag_resist * e_config->drag_resist))
|
2005-05-14 07:06:09 -07:00
|
|
|
{
|
|
|
|
E_Drag *d;
|
|
|
|
Evas_Object *o;
|
2005-05-14 22:20:18 -07:00
|
|
|
Evas_Coord x, y, w, h;
|
2005-10-07 11:36:54 -07:00
|
|
|
const char *drag_types[] = { "enlightenment/eapp" };
|
2005-05-14 07:06:09 -07:00
|
|
|
|
|
|
|
drag = 1;
|
|
|
|
drag_start = 0;
|
|
|
|
|
2005-05-14 22:20:18 -07:00
|
|
|
evas_object_geometry_get(ic->icon_object,
|
|
|
|
&x, &y, &w, &h);
|
2005-10-07 11:36:54 -07:00
|
|
|
d = e_drag_new(ic->ibb->con, x, y, drag_types, 1,
|
|
|
|
ic->app, -1, _ibar_bar_cb_finished);
|
2005-05-14 07:06:09 -07:00
|
|
|
o = edje_object_add(e_drag_evas_get(d));
|
|
|
|
edje_object_file_set(o, ic->app->path, "icon");
|
|
|
|
e_drag_object_set(d, o);
|
|
|
|
|
2005-05-14 22:20:18 -07:00
|
|
|
e_drag_resize(d, w, h);
|
|
|
|
e_drag_start(d, drag_x, drag_y);
|
2005-07-25 02:55:47 -07:00
|
|
|
evas_event_feed_mouse_up(ic->ibb->evas, 1, EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
2005-05-14 07:06:09 -07:00
|
|
|
e_app_remove(ic->app);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ibar_bar_cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Mouse_In *ev;
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
ev = event_info;
|
|
|
|
ibb = data;
|
2005-06-17 17:10:31 -07:00
|
|
|
if (ibb->overlay_object)
|
|
|
|
edje_object_signal_emit(ibb->overlay_object, "active", "");
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_motion_handle(ibb, ev->canvas.x, ev->canvas.y);
|
|
|
|
_ibar_bar_timer_handle(ibb);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Out *ev;
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
ev = event_info;
|
|
|
|
ibb = data;
|
2005-06-17 17:10:31 -07:00
|
|
|
if (ibb->overlay_object)
|
|
|
|
edje_object_signal_emit(ibb->overlay_object, "passive", "");
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_follower_reset(ibb);
|
|
|
|
_ibar_bar_timer_handle(ibb);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Down *ev;
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
ev = event_info;
|
|
|
|
ibb = data;
|
|
|
|
if (ev->button == 3)
|
|
|
|
{
|
2005-02-16 03:43:58 -08:00
|
|
|
e_menu_activate_mouse(ibb->menu, e_zone_current_get(ibb->con),
|
2004-11-24 19:37:45 -08:00
|
|
|
ev->output.x, ev->output.y, 1, 1,
|
2005-07-25 02:55:47 -07:00
|
|
|
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
|
2005-05-13 07:14:04 -07:00
|
|
|
e_util_container_fake_mouse_up_later(ibb->con, 3);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Up *ev;
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
|
|
|
ev = event_info;
|
|
|
|
ibb = data;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Move *ev;
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
|
|
|
ev = event_info;
|
|
|
|
ibb = data;
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_motion_handle(ibb, ev->cur.canvas.x, ev->cur.canvas.y);
|
|
|
|
_ibar_bar_timer_handle(ibb);
|
2005-02-13 03:37:13 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_timer(void *data)
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-13 03:37:13 -08:00
|
|
|
double dif, dif2;
|
|
|
|
double v;
|
|
|
|
|
|
|
|
ibb = data;
|
2005-05-14 07:06:09 -07:00
|
|
|
v = ibb->ibar->conf->autoscroll_speed;
|
2005-02-13 03:37:13 -08:00
|
|
|
ibb->align = (ibb->align_req * (1.0 - v)) + (ibb->align * v);
|
2005-05-14 07:06:09 -07:00
|
|
|
v = ibb->ibar->conf->follow_speed;
|
2005-02-13 03:37:13 -08:00
|
|
|
ibb->follow = (ibb->follow_req * (1.0 - v)) + (ibb->follow * v);
|
|
|
|
|
|
|
|
dif = ibb->align - ibb->align_req;
|
|
|
|
if (dif < 0) dif = -dif;
|
|
|
|
if (dif < 0.001) ibb->align = ibb->align_req;
|
|
|
|
|
|
|
|
dif2 = ibb->follow - ibb->follow_req;
|
|
|
|
if (dif2 < 0) dif2 = -dif2;
|
|
|
|
if (dif2 < 0.001) ibb->follow = ibb->follow_req;
|
|
|
|
|
|
|
|
if ((dif < 0.001) && (dif2 < 0.001))
|
|
|
|
{
|
|
|
|
ibb->timer = NULL;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_animator(void *data)
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-13 03:37:13 -08:00
|
|
|
Evas_Coord x, y, w, h, mw, mh;
|
|
|
|
|
|
|
|
ibb = data;
|
2005-10-08 12:27:31 -07:00
|
|
|
|
2005-02-13 03:37:13 -08:00
|
|
|
if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_BOTTOM) ||
|
|
|
|
(e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_TOP))
|
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
e_box_align_set(ibb->box_object, ibb->align, 0.5);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-10-08 12:38:13 -07:00
|
|
|
if (ibb->overlay_object)
|
|
|
|
{
|
|
|
|
evas_object_geometry_get(ibb->box_object, &x, &y, &w, &h);
|
|
|
|
edje_object_size_min_get(ibb->overlay_object, &mw, &mh);
|
|
|
|
evas_object_resize(ibb->overlay_object, mw, h);
|
|
|
|
evas_object_move(ibb->overlay_object, x + (w * ibb->follow) - (mw / 2), y);
|
|
|
|
}
|
2005-02-13 03:37:13 -08:00
|
|
|
}
|
|
|
|
else if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_LEFT) ||
|
|
|
|
(e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_RIGHT))
|
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
e_box_align_set(ibb->box_object, 0.5, ibb->align);
|
2005-02-13 03:37:13 -08:00
|
|
|
|
2005-10-08 12:38:13 -07:00
|
|
|
if (ibb->overlay_object)
|
|
|
|
{
|
|
|
|
evas_object_geometry_get(ibb->box_object, &x, &y, &w, &h);
|
|
|
|
edje_object_size_min_get(ibb->overlay_object, &mw, &mh);
|
|
|
|
evas_object_resize(ibb->overlay_object, w, mh);
|
|
|
|
evas_object_move(ibb->overlay_object, x, y + (h * ibb->follow) - (mh / 2));
|
|
|
|
}
|
2005-02-13 03:37:13 -08:00
|
|
|
}
|
|
|
|
if (ibb->timer) return 1;
|
|
|
|
ibb->animator = NULL;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
static void
|
|
|
|
_ibar_bar_cb_enter(void *data, const char *type, void *event)
|
2005-05-01 12:29:17 -07:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
E_Event_Dnd_Enter *ev;
|
2005-06-11 04:19:10 -07:00
|
|
|
Evas_Object *o, *o2;
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-06-08 06:08:44 -07:00
|
|
|
IBar_Icon *ic;
|
2005-06-10 09:01:00 -07:00
|
|
|
int w, h;
|
2005-05-03 10:27:42 -07:00
|
|
|
|
|
|
|
ev = event;
|
|
|
|
ibb = data;
|
|
|
|
|
2005-06-11 04:19:10 -07:00
|
|
|
o = edje_object_add(ibb->evas);
|
2005-05-14 07:06:09 -07:00
|
|
|
ibb->drag_object = o;
|
2005-06-11 04:19:10 -07:00
|
|
|
o2 = edje_object_add(ibb->evas);
|
|
|
|
ibb->drag_object_overlay = o2;
|
|
|
|
evas_object_intercept_move_callback_add(o, _ibar_drag_cb_intercept_move, o2);
|
|
|
|
evas_object_intercept_resize_callback_add(o, _ibar_drag_cb_intercept_resize, o2);
|
|
|
|
e_theme_edje_object_set(o, "base/theme/modules/ibar",
|
|
|
|
"modules/ibar/drop");
|
|
|
|
e_theme_edje_object_set(o2, "base/theme/modules/ibar",
|
|
|
|
"modules/ibar/drop_overlay");
|
|
|
|
edje_object_signal_emit(o, "set_orientation",
|
|
|
|
_ibar_main_orientation[e_gadman_client_edge_get(ibb->gmc)]);
|
|
|
|
edje_object_signal_emit(o2, "set_orientation",
|
|
|
|
_ibar_main_orientation[e_gadman_client_edge_get(ibb->gmc)]);
|
2005-06-08 06:08:44 -07:00
|
|
|
evas_object_resize(o, ibb->ibar->conf->iconsize, ibb->ibar->conf->iconsize);
|
|
|
|
|
2005-06-10 09:01:00 -07:00
|
|
|
ic = _ibar_icon_pos_find(ibb, ev->x, ev->y);
|
2005-06-08 06:08:44 -07:00
|
|
|
|
|
|
|
e_box_freeze(ibb->box_object);
|
|
|
|
evas_object_show(ibb->drag_object);
|
2005-06-11 04:19:10 -07:00
|
|
|
evas_object_show(ibb->drag_object_overlay);
|
2005-06-08 06:08:44 -07:00
|
|
|
if (ic)
|
|
|
|
{
|
|
|
|
/* Add new eapp before this icon */
|
|
|
|
e_box_pack_before(ibb->box_object, ibb->drag_object, ic->bg_object);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Add at the end */
|
|
|
|
e_box_pack_end(ibb->box_object, ibb->drag_object);
|
|
|
|
}
|
|
|
|
w = ibb->ibar->conf->iconsize + ibb->icon_inset.l + ibb->icon_inset.r;
|
|
|
|
h = ibb->ibar->conf->iconsize + ibb->icon_inset.t + ibb->icon_inset.b;
|
|
|
|
e_box_pack_options_set(ibb->drag_object,
|
|
|
|
1, 1, /* fill */
|
|
|
|
0, 0, /* expand */
|
|
|
|
0.5, 0.5, /* align */
|
|
|
|
w, h, /* min */
|
|
|
|
w, h /* max */
|
|
|
|
);
|
|
|
|
e_box_thaw(ibb->box_object);
|
|
|
|
|
|
|
|
_ibar_bar_frame_resize(ibb);
|
2005-05-14 07:06:09 -07:00
|
|
|
}
|
2005-05-03 10:27:42 -07:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
static void
|
|
|
|
_ibar_bar_cb_move(void *data, const char *type, void *event)
|
|
|
|
{
|
|
|
|
E_Event_Dnd_Move *ev;
|
|
|
|
IBar_Bar *ibb;
|
|
|
|
IBar_Icon *ic;
|
2005-06-10 09:01:00 -07:00
|
|
|
int w, h;
|
2005-05-14 07:06:09 -07:00
|
|
|
|
|
|
|
ev = event;
|
|
|
|
ibb = data;
|
|
|
|
|
2005-06-10 09:01:00 -07:00
|
|
|
ic = _ibar_icon_pos_find(ibb, ev->x, ev->y);
|
2005-05-14 07:06:09 -07:00
|
|
|
|
|
|
|
e_box_freeze(ibb->box_object);
|
|
|
|
evas_object_show(ibb->drag_object);
|
|
|
|
e_box_unpack(ibb->drag_object);
|
|
|
|
if (ic)
|
|
|
|
{
|
|
|
|
/* Add new eapp before this icon */
|
|
|
|
e_box_pack_before(ibb->box_object, ibb->drag_object, ic->bg_object);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Add at the end */
|
|
|
|
e_box_pack_end(ibb->box_object, ibb->drag_object);
|
|
|
|
}
|
2005-06-08 06:08:44 -07:00
|
|
|
w = ibb->ibar->conf->iconsize + ibb->icon_inset.l + ibb->icon_inset.r;
|
|
|
|
h = ibb->ibar->conf->iconsize + ibb->icon_inset.t + ibb->icon_inset.b;
|
2005-05-14 07:06:09 -07:00
|
|
|
e_box_pack_options_set(ibb->drag_object,
|
|
|
|
1, 1, /* fill */
|
|
|
|
0, 0, /* expand */
|
|
|
|
0.5, 0.5, /* align */
|
2005-06-08 06:08:44 -07:00
|
|
|
w, h, /* min */
|
|
|
|
w, h /* max */
|
2005-05-14 07:06:09 -07:00
|
|
|
);
|
|
|
|
e_box_thaw(ibb->box_object);
|
|
|
|
|
|
|
|
_ibar_bar_frame_resize(ibb);
|
2005-05-03 10:27:42 -07:00
|
|
|
}
|
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
static void
|
|
|
|
_ibar_bar_cb_leave(void *data, const char *type, void *event)
|
2005-05-03 10:27:42 -07:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
E_Event_Dnd_Leave *ev;
|
|
|
|
IBar_Bar *ibb;
|
2005-05-01 13:29:32 -07:00
|
|
|
|
|
|
|
ev = event;
|
|
|
|
ibb = data;
|
2005-05-03 11:46:04 -07:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
e_box_freeze(ibb->box_object);
|
|
|
|
e_box_unpack(ibb->drag_object);
|
|
|
|
evas_object_del(ibb->drag_object);
|
2005-06-11 04:19:10 -07:00
|
|
|
ibb->drag_object = NULL;
|
|
|
|
evas_object_del(ibb->drag_object_overlay);
|
|
|
|
ibb->drag_object_overlay = NULL;
|
2005-05-14 07:06:09 -07:00
|
|
|
e_box_thaw(ibb->box_object);
|
2005-05-03 06:44:43 -07:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_frame_resize(ibb);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-10-05 10:56:35 -07:00
|
|
|
_ibar_bar_cb_drop(void *data, const char *type, void *event)
|
2005-05-14 07:06:09 -07:00
|
|
|
{
|
|
|
|
E_Event_Dnd_Drop *ev;
|
2005-10-05 10:56:35 -07:00
|
|
|
E_App *app = NULL;
|
|
|
|
Evas_List *l = NULL;
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
|
|
|
IBar_Icon *ic;
|
|
|
|
|
|
|
|
ev = event;
|
|
|
|
ibb = data;
|
2005-10-05 10:56:35 -07:00
|
|
|
if (!strcmp(type, "enlightenment/eapp"))
|
2005-07-26 04:03:36 -07:00
|
|
|
{
|
2005-10-05 10:56:35 -07:00
|
|
|
app = ev->data;
|
2005-07-26 04:03:36 -07:00
|
|
|
}
|
2005-10-05 10:56:35 -07:00
|
|
|
else if (!strcmp(type, "enlightenment/border"))
|
2005-07-26 04:03:36 -07:00
|
|
|
{
|
2005-10-05 10:56:35 -07:00
|
|
|
E_Border *bd;
|
2005-07-26 04:03:36 -07:00
|
|
|
|
2005-10-05 10:56:35 -07:00
|
|
|
bd = ev->data;
|
|
|
|
app = bd->app;
|
2005-07-26 04:03:36 -07:00
|
|
|
|
2005-10-05 10:56:35 -07:00
|
|
|
if (!app)
|
|
|
|
{
|
|
|
|
app = e_app_window_name_class_title_role_find(bd->client.icccm.name,
|
|
|
|
bd->client.icccm.class,
|
|
|
|
e_border_name_get(bd),
|
|
|
|
bd->client.icccm.window_role);
|
|
|
|
}
|
|
|
|
if (!app)
|
|
|
|
{
|
|
|
|
app = e_app_launch_id_pid_find(bd->client.netwm.startup_id,
|
|
|
|
bd->client.netwm.pid);
|
|
|
|
}
|
|
|
|
if (!app)
|
|
|
|
{
|
|
|
|
E_Dialog *dia;
|
|
|
|
|
2005-10-12 19:43:16 -07:00
|
|
|
e_box_freeze(ibb->box_object);
|
|
|
|
e_box_unpack(ibb->drag_object);
|
|
|
|
evas_object_del(ibb->drag_object);
|
|
|
|
ibb->drag_object = NULL;
|
|
|
|
evas_object_del(ibb->drag_object_overlay);
|
|
|
|
ibb->drag_object_overlay = NULL;
|
|
|
|
e_box_thaw(ibb->box_object);
|
|
|
|
_ibar_bar_frame_resize(ibb);
|
|
|
|
|
2005-10-05 10:56:35 -07:00
|
|
|
dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
|
|
|
|
e_dialog_title_set(dia, _("Cannot add icon"));
|
|
|
|
e_dialog_text_set(dia,
|
|
|
|
_("You tried to drop an icon of an application that<br>"
|
|
|
|
"does not have a matching application file.<br>"
|
|
|
|
"<br>"
|
|
|
|
"The icon cannot be added to IBar."
|
|
|
|
));
|
|
|
|
e_dialog_button_add(dia, _("OK"), NULL, NULL, NULL);
|
|
|
|
e_dialog_button_focus_num(dia, 1);
|
|
|
|
e_win_centered_set(dia->win, 1);
|
|
|
|
e_dialog_show(dia);
|
|
|
|
return;
|
|
|
|
}
|
2005-05-14 07:06:09 -07:00
|
|
|
}
|
2005-10-05 10:56:35 -07:00
|
|
|
else if (!strcmp(type, "text/uri-list"))
|
2005-05-14 07:06:09 -07:00
|
|
|
{
|
2005-10-05 10:56:35 -07:00
|
|
|
l = ev->data;
|
2005-05-14 07:06:09 -07:00
|
|
|
}
|
2005-06-10 14:26:50 -07:00
|
|
|
|
|
|
|
/* add dropped element */
|
|
|
|
ic = _ibar_icon_pos_find(ibb, ev->x, ev->y);
|
|
|
|
|
|
|
|
/* remove drag marker */
|
|
|
|
e_box_freeze(ibb->box_object);
|
|
|
|
e_box_unpack(ibb->drag_object);
|
|
|
|
evas_object_del(ibb->drag_object);
|
2005-06-11 04:19:10 -07:00
|
|
|
ibb->drag_object = NULL;
|
|
|
|
evas_object_del(ibb->drag_object_overlay);
|
|
|
|
ibb->drag_object_overlay = NULL;
|
2005-06-10 14:26:50 -07:00
|
|
|
e_box_thaw(ibb->box_object);
|
|
|
|
|
|
|
|
_ibar_bar_frame_resize(ibb);
|
|
|
|
|
|
|
|
if (ic)
|
|
|
|
{
|
|
|
|
/* Add new eapp before this icon */
|
2005-10-05 10:56:35 -07:00
|
|
|
if (app)
|
|
|
|
e_app_prepend_relative(app, ic->app);
|
|
|
|
else if (l)
|
|
|
|
e_app_files_prepend_relative(l, ic->app);
|
2005-06-10 14:26:50 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Add at the end */
|
2005-10-05 10:56:35 -07:00
|
|
|
if (app)
|
|
|
|
e_app_append(app, ibb->ibar->apps);
|
|
|
|
else if (l)
|
|
|
|
e_app_files_append(l, ibb->ibar->apps);
|
2005-06-10 14:26:50 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
static void
|
|
|
|
_ibar_bar_cb_finished(E_Drag *drag, int dropped)
|
|
|
|
{
|
|
|
|
/* Unref the object so it will be deleted. */
|
|
|
|
if (!dropped)
|
|
|
|
e_object_unref(E_OBJECT(drag->data));
|
2005-05-04 04:04:08 -07:00
|
|
|
}
|
|
|
|
|
2005-02-13 03:37:13 -08:00
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_gmc_change(void *data, E_Gadman_Client *gmc, E_Gadman_Change change)
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
|
|
|
ibb = data;
|
2005-02-16 03:43:58 -08:00
|
|
|
switch (change)
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
2005-02-16 03:43:58 -08:00
|
|
|
case E_GADMAN_CHANGE_MOVE_RESIZE:
|
|
|
|
e_gadman_client_geometry_get(ibb->gmc, &ibb->x, &ibb->y, &ibb->w, &ibb->h);
|
2005-02-17 09:45:20 -08:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
edje_extern_object_min_size_set(ibb->box_object, 0, 0);
|
|
|
|
edje_object_part_swallow(ibb->bar_object, "items", ibb->box_object);
|
2005-02-17 09:45:20 -08:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
evas_object_move(ibb->bar_object, ibb->x, ibb->y);
|
2005-06-17 17:10:31 -07:00
|
|
|
if (ibb->overlay_object)
|
|
|
|
evas_object_move(ibb->overlay_object, ibb->x, ibb->y);
|
2005-05-14 07:06:09 -07:00
|
|
|
evas_object_resize(ibb->bar_object, ibb->w, ibb->h);
|
2005-06-17 17:10:31 -07:00
|
|
|
if (ibb->overlay_object)
|
|
|
|
evas_object_resize(ibb->overlay_object, ibb->w, ibb->h);
|
2005-02-17 09:45:20 -08:00
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_follower_reset(ibb);
|
|
|
|
_ibar_bar_timer_handle(ibb);
|
2005-05-01 13:00:55 -07:00
|
|
|
|
2005-10-05 10:56:35 -07:00
|
|
|
e_drop_handler_geometry_set(ibb->drop_handler,
|
2005-06-08 06:08:44 -07:00
|
|
|
ibb->x + ibb->bar_inset.l, ibb->y + ibb->bar_inset.t,
|
|
|
|
ibb->w - (ibb->bar_inset.l + ibb->bar_inset.r),
|
|
|
|
ibb->h - (ibb->bar_inset.t + ibb->bar_inset.b));
|
2005-02-16 03:43:58 -08:00
|
|
|
break;
|
|
|
|
case E_GADMAN_CHANGE_EDGE:
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_edge_change(ibb, e_gadman_client_edge_get(ibb->gmc));
|
2005-02-16 03:43:58 -08:00
|
|
|
break;
|
|
|
|
case E_GADMAN_CHANGE_RAISE:
|
|
|
|
case E_GADMAN_CHANGE_ZONE:
|
2005-05-14 07:06:09 -07:00
|
|
|
/* FIXME
|
|
|
|
* Must we do something here?
|
|
|
|
*/
|
2005-02-16 03:43:58 -08:00
|
|
|
break;
|
2005-02-13 03:37:13 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_width_auto(void *data, E_Menu *m, E_Menu_Item *mi)
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar *ib;
|
|
|
|
IBar_Bar *ibb;
|
2005-02-16 03:43:58 -08:00
|
|
|
unsigned char enabled;
|
|
|
|
Evas_List *l;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
|
|
|
ib = data;
|
2005-02-16 03:43:58 -08:00
|
|
|
enabled = e_menu_item_toggle_get(mi);
|
2005-05-14 07:06:09 -07:00
|
|
|
if ((enabled) && (ib->conf->width == IBAR_WIDTH_FIXED))
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
ib->conf->width = IBAR_WIDTH_AUTO;
|
|
|
|
for (l = ib->bars; l; l = l->next)
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
|
|
|
ibb = l->data;
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_update_policy(ibb);
|
|
|
|
_ibar_bar_frame_resize(ibb);
|
2005-02-13 03:37:13 -08:00
|
|
|
}
|
|
|
|
}
|
2005-05-14 07:06:09 -07:00
|
|
|
else if (!(enabled) && (ib->conf->width == IBAR_WIDTH_AUTO))
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
ib->conf->width = IBAR_WIDTH_FIXED;
|
|
|
|
for (l = ib->bars; l; l = l->next)
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
|
|
|
ibb = l->data;
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_update_policy(ibb);
|
|
|
|
_ibar_bar_frame_resize(ibb);
|
2005-02-13 03:37:13 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
e_config_save_queue();
|
|
|
|
}
|
|
|
|
|
2005-06-17 17:10:31 -07:00
|
|
|
static void
|
|
|
|
_ibar_bar_cb_follower(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
|
|
{
|
|
|
|
IBar *ib;
|
|
|
|
IBar_Bar *ibb;
|
|
|
|
unsigned char enabled;
|
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
ib = data;
|
|
|
|
enabled = e_menu_item_toggle_get(mi);
|
|
|
|
if ((enabled) && (!ib->conf->follower))
|
|
|
|
{
|
|
|
|
ib->conf->follower = 1;
|
|
|
|
for (l = ib->bars; l; l = l->next)
|
|
|
|
{
|
|
|
|
Evas_Object *o;
|
|
|
|
|
|
|
|
ibb = l->data;
|
|
|
|
if (ibb->overlay_object) continue;
|
|
|
|
o = edje_object_add(ibb->evas);
|
|
|
|
ibb->overlay_object = o;
|
2005-10-26 19:44:36 -07:00
|
|
|
evas_object_layer_set(o, 2);
|
2005-06-17 17:10:31 -07:00
|
|
|
e_theme_edje_object_set(o, "base/theme/modules/ibar",
|
|
|
|
"modules/ibar/follower");
|
|
|
|
evas_object_show(o);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!(enabled) && (ib->conf->follower))
|
|
|
|
{
|
|
|
|
ib->conf->follower = 0;
|
|
|
|
for (l = ib->bars; l; l = l->next)
|
|
|
|
{
|
|
|
|
ibb = l->data;
|
|
|
|
if (!ibb->overlay_object) continue;
|
|
|
|
evas_object_del(ibb->overlay_object);
|
|
|
|
ibb->overlay_object = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
e_config_save_queue();
|
|
|
|
}
|
|
|
|
|
2005-02-17 09:45:20 -08:00
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_iconsize_change(IBar_Bar *ibb)
|
2005-02-17 09:45:20 -08:00
|
|
|
{
|
|
|
|
Evas_List *l;
|
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
e_box_freeze(ibb->box_object);
|
2005-02-17 09:45:20 -08:00
|
|
|
for (l = ibb->icons; l; l = l->next)
|
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Icon *ic;
|
2005-02-17 09:45:20 -08:00
|
|
|
Evas_Object *o;
|
2005-06-08 06:08:44 -07:00
|
|
|
Evas_Coord w, h;
|
2005-02-17 09:45:20 -08:00
|
|
|
|
|
|
|
ic = l->data;
|
|
|
|
o = ic->icon_object;
|
|
|
|
|
2005-05-14 07:06:09 -07:00
|
|
|
evas_object_resize(o, ibb->ibar->conf->iconsize, ibb->ibar->conf->iconsize);
|
2005-02-17 09:45:20 -08:00
|
|
|
edje_object_part_swallow(ic->bg_object, "item", o);
|
|
|
|
|
2005-06-08 06:08:44 -07:00
|
|
|
w = ibb->ibar->conf->iconsize + ibb->icon_inset.l + ibb->icon_inset.r;
|
|
|
|
h = ibb->ibar->conf->iconsize + ibb->icon_inset.t + ibb->icon_inset.b;
|
2005-02-17 09:45:20 -08:00
|
|
|
e_box_pack_options_set(ic->bg_object,
|
|
|
|
1, 1, /* fill */
|
|
|
|
0, 0, /* expand */
|
|
|
|
0.5, 0.5, /* align */
|
2005-06-08 06:08:44 -07:00
|
|
|
w, h, /* min */
|
|
|
|
w, h /* max */
|
2005-02-17 09:45:20 -08:00
|
|
|
);
|
|
|
|
}
|
2005-05-14 07:06:09 -07:00
|
|
|
e_box_thaw(ibb->box_object);
|
|
|
|
_ibar_bar_frame_resize(ibb);
|
2005-02-17 09:45:20 -08:00
|
|
|
}
|
|
|
|
|
2005-02-13 03:37:13 -08:00
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_iconsize_microscopic(void *data, E_Menu *m, E_Menu_Item *mi)
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar *ib;
|
2005-02-13 03:37:13 -08:00
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
ib = data;
|
|
|
|
ib->conf->iconsize = 8;
|
2005-05-14 07:06:09 -07:00
|
|
|
for (l = ib->bars; l; l = l->next)
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
|
|
|
ibb = l->data;
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_iconsize_change(ibb);
|
2005-02-13 03:37:13 -08:00
|
|
|
}
|
|
|
|
e_config_save_queue();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_iconsize_tiny(void *data, E_Menu *m, E_Menu_Item *mi)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar *ib;
|
2005-02-13 03:37:13 -08:00
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
ib = data;
|
|
|
|
ib->conf->iconsize = 12;
|
2005-05-14 07:06:09 -07:00
|
|
|
for (l = ib->bars; l; l = l->next)
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
|
|
|
ibb = l->data;
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_iconsize_change(ibb);
|
2005-02-13 03:37:13 -08:00
|
|
|
}
|
|
|
|
e_config_save_queue();
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_iconsize_very_small(void *data, E_Menu *m, E_Menu_Item *mi)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar *ib;
|
2005-02-13 03:37:13 -08:00
|
|
|
Evas_List *l;
|
2004-11-24 19:37:45 -08:00
|
|
|
|
2005-02-13 03:37:13 -08:00
|
|
|
ib = data;
|
|
|
|
ib->conf->iconsize = 16;
|
2005-05-14 07:06:09 -07:00
|
|
|
for (l = ib->bars; l; l = l->next)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
|
|
|
ibb = l->data;
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_iconsize_change(ibb);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
2005-02-13 03:37:13 -08:00
|
|
|
e_config_save_queue();
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
2005-02-13 03:37:13 -08:00
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_iconsize_small(void *data, E_Menu *m, E_Menu_Item *mi)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar *ib;
|
2005-02-13 03:37:13 -08:00
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
ib = data;
|
|
|
|
ib->conf->iconsize = 24;
|
2005-05-14 07:06:09 -07:00
|
|
|
for (l = ib->bars; l; l = l->next)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
|
|
|
ibb = l->data;
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_iconsize_change(ibb);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
2005-02-13 03:37:13 -08:00
|
|
|
e_config_save_queue();
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_iconsize_medium(void *data, E_Menu *m, E_Menu_Item *mi)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar *ib;
|
2005-02-13 03:37:13 -08:00
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
ib = data;
|
|
|
|
ib->conf->iconsize = 32;
|
2005-05-14 07:06:09 -07:00
|
|
|
for (l = ib->bars; l; l = l->next)
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
|
|
|
ibb = l->data;
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_iconsize_change(ibb);
|
2005-02-13 03:37:13 -08:00
|
|
|
}
|
|
|
|
e_config_save_queue();
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_iconsize_large(void *data, E_Menu *m, E_Menu_Item *mi)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar *ib;
|
2005-02-13 03:37:13 -08:00
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
ib = data;
|
|
|
|
ib->conf->iconsize = 40;
|
2005-05-14 07:06:09 -07:00
|
|
|
for (l = ib->bars; l; l = l->next)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
|
|
|
ibb = l->data;
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_iconsize_change(ibb);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
2005-02-13 03:37:13 -08:00
|
|
|
e_config_save_queue();
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_iconsize_very_large(void *data, E_Menu *m, E_Menu_Item *mi)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar *ib;
|
2005-02-13 03:37:13 -08:00
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
ib = data;
|
|
|
|
ib->conf->iconsize = 48;
|
2005-05-14 07:06:09 -07:00
|
|
|
for (l = ib->bars; l; l = l->next)
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
|
|
|
ibb = l->data;
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_iconsize_change(ibb);
|
2005-02-13 03:37:13 -08:00
|
|
|
}
|
|
|
|
e_config_save_queue();
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_iconsize_extremely_large(void *data, E_Menu *m, E_Menu_Item *mi)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar *ib;
|
2005-02-13 03:37:13 -08:00
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
ib = data;
|
|
|
|
ib->conf->iconsize = 56;
|
2005-05-14 07:06:09 -07:00
|
|
|
for (l = ib->bars; l; l = l->next)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
|
|
|
ibb = l->data;
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_iconsize_change(ibb);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
2005-02-13 03:37:13 -08:00
|
|
|
e_config_save_queue();
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_iconsize_huge(void *data, E_Menu *m, E_Menu_Item *mi)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar *ib;
|
2005-02-13 03:37:13 -08:00
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
ib = data;
|
|
|
|
ib->conf->iconsize = 64;
|
2005-05-14 07:06:09 -07:00
|
|
|
for (l = ib->bars; l; l = l->next)
|
2005-02-13 03:37:13 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
|
|
|
ibb = l->data;
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_iconsize_change(ibb);
|
2005-02-13 03:37:13 -08:00
|
|
|
}
|
|
|
|
e_config_save_queue();
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_iconsize_enormous(void *data, E_Menu *m, E_Menu_Item *mi)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar *ib;
|
2005-02-13 03:37:13 -08:00
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
ib = data;
|
|
|
|
ib->conf->iconsize = 96;
|
2005-05-14 07:06:09 -07:00
|
|
|
for (l = ib->bars; l; l = l->next)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
|
|
|
ibb = l->data;
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_iconsize_change(ibb);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
2005-02-13 03:37:13 -08:00
|
|
|
e_config_save_queue();
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_iconsize_gigantic(void *data, E_Menu *m, E_Menu_Item *mi)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar *ib;
|
2005-02-13 03:37:13 -08:00
|
|
|
Evas_List *l;
|
2004-11-24 19:37:45 -08:00
|
|
|
|
2005-02-13 03:37:13 -08:00
|
|
|
ib = data;
|
|
|
|
ib->conf->iconsize = 128;
|
2005-05-14 07:06:09 -07:00
|
|
|
for (l = ib->bars; l; l = l->next)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-13 03:37:13 -08:00
|
|
|
|
|
|
|
ibb = l->data;
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_iconsize_change(ibb);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
2005-02-13 03:37:13 -08:00
|
|
|
e_config_save_queue();
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
2004-12-25 07:33:48 -08:00
|
|
|
|
2005-02-16 03:43:58 -08:00
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_menu_enabled(void *data, E_Menu *m, E_Menu_Item *mi)
|
2005-02-16 03:43:58 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-16 03:43:58 -08:00
|
|
|
unsigned char enabled;
|
|
|
|
|
|
|
|
ibb = data;
|
|
|
|
enabled = e_menu_item_toggle_get(mi);
|
|
|
|
if ((ibb->conf->enabled) && (!enabled))
|
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_disable(ibb);
|
2005-02-16 03:43:58 -08:00
|
|
|
}
|
|
|
|
else if ((!ibb->conf->enabled) && (enabled))
|
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_enable(ibb);
|
2005-02-16 03:43:58 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-14 07:06:09 -07:00
|
|
|
_ibar_bar_cb_menu_edit(void *data, E_Menu *m, E_Menu_Item *mi)
|
2005-02-16 03:43:58 -08:00
|
|
|
{
|
2005-05-14 07:06:09 -07:00
|
|
|
IBar_Bar *ibb;
|
2005-02-16 03:43:58 -08:00
|
|
|
|
|
|
|
ibb = data;
|
|
|
|
e_gadman_mode_set(ibb->gmc->gadman, E_GADMAN_MODE_EDIT);
|
|
|
|
}
|
2005-06-11 04:19:10 -07:00
|
|
|
|
|
|
|
static void
|
|
|
|
_ibar_drag_cb_intercept_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y)
|
|
|
|
{
|
|
|
|
evas_object_move(o, x, y);
|
|
|
|
evas_object_move(data, x, y);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ibar_drag_cb_intercept_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h)
|
|
|
|
{
|
|
|
|
evas_object_resize(o, w, h);
|
|
|
|
evas_object_resize(data, w, h);
|
|
|
|
}
|
|
|
|
|