struct _E_Config_Dialog_Data
{
- const char *dir;
- int show_label, eap_label;
+ const char *dir;
+ int show_label, eap_label;
- Evas_Object *tlist;
- Evas_Object *radio_name;
- Evas_Object *radio_comment;
- Evas_Object *radio_generic;
+ Evas_Object *tlist;
+ Evas_Object *radio_name;
+ Evas_Object *radio_comment;
+ Evas_Object *radio_generic;
E_Confirm_Dialog *dialog_delete;
};
/* Protos */
-static void *_create_data(E_Config_Dialog *cfd);
-static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
+static void *_create_data(E_Config_Dialog *cfd);
+static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
-static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
-static void _cb_add(void *data, void *data2);
-static void _cb_del(void *data, void *data2);
-static void _cb_config(void *data, void *data2);
-static void _cb_entry_ok(char *text, void *data);
-static void _cb_confirm_dialog_yes(void *data);
-static void _cb_confirm_dialog_destroy(void *data);
-static void _load_tlist(E_Config_Dialog_Data *cfdata);
-static void _show_label_cb_change(void *data, Evas_Object *obj);
-
-void
+static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
+static void _cb_add(void *data, void *data2);
+static void _cb_del(void *data, void *data2);
+static void _cb_config(void *data, void *data2);
+static void _cb_entry_ok(char *text, void *data);
+static void _cb_confirm_dialog_yes(void *data);
+static void _cb_confirm_dialog_destroy(void *data);
+static void _load_tlist(E_Config_Dialog_Data *cfdata);
+static void _show_label_cb_change(void *data, Evas_Object *obj);
+
+void
_config_ibar_module(Config_Item *ci)
{
E_Config_Dialog *cfd;
v->advanced.apply_cfdata = NULL;
v->advanced.create_widgets = NULL;
- snprintf(buf, sizeof(buf), "%s/e-module-ibar.edj",
+ snprintf(buf, sizeof(buf), "%s/e-module-ibar.edj",
e_module_dir_get(ibar_config->module));
/* Create The Dialog */
cfd = e_config_dialog_new(e_container_current_get(e_manager_current_get()),
- _("IBar Settings"),
- "E", "_e_mod_ibar_config_dialog",
- buf, 0, v, ci);
+ _("IBar Settings"),
+ "E", "_e_mod_ibar_config_dialog",
+ buf, 0, v, ci);
ibar_config->config_dialog = cfd;
}
-static void
+static void
_fill_data(Config_Item *ci, E_Config_Dialog_Data *cfdata)
{
if (ci->dir)
return cfdata;
}
-static void
+static void
_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
if (cfdata->dir) eina_stringshare_del(cfdata->dir);
ob = e_widget_button_add(evas, _("Delete"), "list-remove", _cb_del, cfdata, NULL);
e_widget_table_object_append(ot, ob, 0, 1, 1, 1, 1, 1, 1, 0);
ob = e_widget_button_add(evas, _("Setup"), "configure", _cb_config, cfdata, NULL);
- e_widget_table_object_append(ot, ob, 0, 2, 1, 1, 1, 1, 1, 0);
+ e_widget_table_object_append(ot, ob, 0, 2, 1, 1, 1, 1, 1, 0);
- if (!e_configure_registry_exists("applications/ibar_applications"))
+ if (!e_configure_registry_exists("applications/ibar_applications"))
e_widget_disabled_set(ob, 1);
e_widget_frametable_object_append(of, ot, 1, 0, 1, 1, 1, 1, 1, 0);
of = e_widget_framelist_add(evas, _("Icon Labels"), 0);
ob = e_widget_check_add(evas, _("Show Icon Label"), &(cfdata->show_label));
e_widget_on_change_hook_set(ob, _show_label_cb_change, cfdata);
- e_widget_framelist_object_append(of, ob);
+ e_widget_framelist_object_append(of, ob);
rg = e_widget_radio_group_new(&(cfdata->eap_label));
return o;
}
-static int
+static int
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
Config_Item *ci;
return 1;
}
-static void
-_cb_add(void *data, void *data2 __UNUSED__)
+static void
+_cb_add(void *data, void *data2 __UNUSED__)
{
E_Config_Dialog_Data *cfdata;
cfdata = data;
e_entry_dialog_show(_("Create new IBar source"), "enlightenment",
- _("Enter a name for this new source:"), "", NULL, NULL,
- _cb_entry_ok, NULL, cfdata);
+ _("Enter a name for this new source:"), "", NULL, NULL,
+ _cb_entry_ok, NULL, cfdata);
}
-static void
-_cb_del(void *data, void *data2 __UNUSED__)
+static void
+_cb_del(void *data, void *data2 __UNUSED__)
{
char buf[4096];
E_Config_Dialog_Data *cfdata;
E_Confirm_Dialog *dialog;
- cfdata = data;
+ cfdata = data;
if (cfdata->dialog_delete) return;
snprintf(buf, sizeof(buf), _("You requested to delete \"%s\".<br><br>"
- "Are you sure you want to delete this bar source?"),
- cfdata->dir);
+ "Are you sure you want to delete this bar source?"),
+ cfdata->dir);
dialog = e_confirm_dialog_show(_("Are you sure you want to delete this bar source?"),
- "application-exit", buf, NULL, NULL,
- _cb_confirm_dialog_yes, NULL, cfdata, NULL,
+ "application-exit", buf, NULL, NULL,
+ _cb_confirm_dialog_yes, NULL, cfdata, NULL,
_cb_confirm_dialog_destroy, cfdata);
cfdata->dialog_delete = dialog;
}
-static void
-_cb_config(void *data, void *data2 __UNUSED__)
+static void
+_cb_config(void *data, void *data2 __UNUSED__)
{
char path[PATH_MAX];
E_Config_Dialog_Data *cfdata;
cfdata = data;
- e_user_dir_snprintf(path, sizeof(path), "applications/bar/%s/.order",
+ e_user_dir_snprintf(path, sizeof(path), "applications/bar/%s/.order",
cfdata->dir);
e_configure_registry_call("internal/ibar_other",
- e_container_current_get(e_manager_current_get()),
- path);
+ e_container_current_get(e_manager_current_get()),
+ path);
}
static void
-_cb_entry_ok(char *text, void *data)
+_cb_entry_ok(char *text, void *data)
{
char buf[4096];
char tmp[4096];
if (len + sizeof("/.order") >= sizeof(buf)) return;
if (!ecore_file_exists(buf))
{
- ecore_file_mkdir(buf);
- memcpy(buf + len, "/.order", sizeof("/.order"));
- f = fopen(buf, "w");
- if (f)
- {
+ ecore_file_mkdir(buf);
+ memcpy(buf + len, "/.order", sizeof("/.order"));
+ f = fopen(buf, "w");
+ if (f)
+ {
int ret = 0;
- /* Populate this .order file with some defaults */
- snprintf(tmp, sizeof(tmp), "xterm.desktop\n" "sylpheed.desktop\n"
- "firefox.desktop\n" "openoffice.desktop\n" "xchat.desktop\n"
- "gimp.desktop\n" "xmms.desktop\n");
- ret = fwrite(tmp, sizeof(char), strlen(tmp), f);
- fclose(f);
- }
+ /* Populate this .order file with some defaults */
+ snprintf(tmp, sizeof(tmp), "xterm.desktop\n" "sylpheed.desktop\n"
+ "firefox.desktop\n" "openoffice.desktop\n" "xchat.desktop\n"
+ "gimp.desktop\n" "xmms.desktop\n");
+ ret = fwrite(tmp, sizeof(char), strlen(tmp), f);
+ fclose(f);
+ }
}
_load_tlist(data);
}
static void
-_cb_confirm_dialog_yes(void *data)
+_cb_confirm_dialog_yes(void *data)
{
E_Config_Dialog_Data *cfdata;
char buf[4096];
}
static void
-_cb_confirm_dialog_destroy(void *data)
+_cb_confirm_dialog_destroy(void *data)
{
E_Config_Dialog_Data *cfdata;
cfdata->dialog_delete = NULL;
}
-static void
-_load_tlist(E_Config_Dialog_Data *cfdata)
+static void
+_load_tlist(E_Config_Dialog_Data *cfdata)
{
Eina_List *dirs;
char buf[4096], *file;
EINA_LIST_FREE(dirs, file)
{
- if (file[0] == '.') continue;
- if (eina_strlcpy(buf + len, file, sizeof(buf) - len) >= sizeof(buf) - len)
- continue;
- if (ecore_file_is_dir(buf))
- {
- e_widget_ilist_append(cfdata->tlist, NULL, file, NULL, NULL, file);
- if ((cfdata->dir) && (!strcmp(cfdata->dir, file)))
- selnum = i;
- i++;
- }
-
- free(file);
+ if (file[0] == '.') continue;
+ if (eina_strlcpy(buf + len, file, sizeof(buf) - len) >= sizeof(buf) - len)
+ continue;
+ if (ecore_file_is_dir(buf))
+ {
+ e_widget_ilist_append(cfdata->tlist, NULL, file, NULL, NULL, file);
+ if ((cfdata->dir) && (!strcmp(cfdata->dir, file)))
+ selnum = i;
+ i++;
+ }
+
+ free(file);
}
e_widget_ilist_go(cfdata->tlist);
- if (selnum >= 0) e_widget_ilist_selected_set(cfdata->tlist, selnum);
+ if (selnum >= 0) e_widget_ilist_selected_set(cfdata->tlist, selnum);
}
-static void
-_show_label_cb_change(void *data, Evas_Object *obj __UNUSED__)
+static void
+_show_label_cb_change(void *data, Evas_Object *obj __UNUSED__)
{
E_Config_Dialog_Data *cfdata;
if (!cfdata) return;
e_widget_disabled_set(cfdata->radio_name, !cfdata->show_label);
e_widget_disabled_set(cfdata->radio_comment, !cfdata->show_label);
- e_widget_disabled_set(cfdata->radio_generic, !cfdata->show_label);
+ e_widget_disabled_set(cfdata->radio_generic, !cfdata->show_label);
}
+
/* gadcon requirements */
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style);
-static void _gc_shutdown(E_Gadcon_Client *gcc);
-static void _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient);
-static const char *_gc_label(E_Gadcon_Client_Class *client_class);
-static Evas_Object *_gc_icon(E_Gadcon_Client_Class *client_class, Evas *evas);
-static const char *_gc_id_new(E_Gadcon_Client_Class *client_class);
-static void _gc_id_del(E_Gadcon_Client_Class *client_class, const char *id);
+static void _gc_shutdown(E_Gadcon_Client *gcc);
+static void _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient);
+static const char *_gc_label(E_Gadcon_Client_Class *client_class);
+static Evas_Object *_gc_icon(E_Gadcon_Client_Class *client_class, Evas *evas);
+static const char *_gc_id_new(E_Gadcon_Client_Class *client_class);
+static void _gc_id_del(E_Gadcon_Client_Class *client_class, const char *id);
/* and actually define the gadcon class that this module provides (just 1) */
static const E_Gadcon_Client_Class _gadcon_class =
{
GADCON_CLIENT_CLASS_VERSION,
- "ibar",
- {
- _gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, _gc_id_del,
- e_gadcon_site_is_not_toolbar
- },
+ "ibar",
+ {
+ _gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, _gc_id_del,
+ e_gadcon_site_is_not_toolbar
+ },
E_GADCON_CLIENT_STYLE_INSET
};
/* actual module specifics */
typedef struct _Instance Instance;
-typedef struct _IBar IBar;
+typedef struct _IBar IBar;
typedef struct _IBar_Icon IBar_Icon;
struct _Instance
{
E_Gadcon_Client *gcc;
- Evas_Object *o_ibar;
- IBar *ibar;
- E_Drop_Handler *drop_handler;
- Config_Item *ci;
- E_Gadcon_Orient orient;
+ Evas_Object *o_ibar;
+ IBar *ibar;
+ E_Drop_Handler *drop_handler;
+ Config_Item *ci;
+ E_Gadcon_Orient orient;
};
struct _IBar
{
- Instance *inst;
+ Instance *inst;
Evas_Object *o_box, *o_drop;
Evas_Object *o_drop_over, *o_empty;
- IBar_Icon *ic_drop_before;
- int drop_before;
- E_Order *apps;
- Eina_List *icons;
- Evas_Coord dnd_x, dnd_y;
+ IBar_Icon *ic_drop_before;
+ int drop_before;
+ E_Order *apps;
+ Eina_List *icons;
+ Evas_Coord dnd_x, dnd_y;
};
struct _IBar_Icon
{
- IBar *ibar;
- Evas_Object *o_holder, *o_icon;
- Evas_Object *o_holder2, *o_icon2;
+ IBar *ibar;
+ Evas_Object *o_holder, *o_icon;
+ Evas_Object *o_holder2, *o_icon2;
Efreet_Desktop *app;
- int mouse_down;
- struct
- {
- unsigned char start : 1;
- unsigned char dnd : 1;
- int x, y;
- } drag;
+ int mouse_down;
+ struct
+ {
+ unsigned char start : 1;
+ unsigned char dnd : 1;
+ int x, y;
+ } drag;
};
-static IBar *_ibar_new(Evas *evas, Instance *inst);
-static void _ibar_free(IBar *b);
-static void _ibar_cb_empty_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _ibar_empty_handle(IBar *b);
-static void _ibar_fill(IBar *b);
-static void _ibar_empty(IBar *b);
-static void _ibar_orient_set(IBar *b, int horizontal);
-static void _ibar_resize_handle(IBar *b);
-static void _ibar_instance_drop_zone_recalc(Instance *inst);
+static IBar *_ibar_new(Evas *evas, Instance *inst);
+static void _ibar_free(IBar *b);
+static void _ibar_cb_empty_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _ibar_empty_handle(IBar *b);
+static void _ibar_fill(IBar *b);
+static void _ibar_empty(IBar *b);
+static void _ibar_orient_set(IBar *b, int horizontal);
+static void _ibar_resize_handle(IBar *b);
+static void _ibar_instance_drop_zone_recalc(Instance *inst);
static Config_Item *_ibar_config_item_get(const char *id);
-static IBar_Icon *_ibar_icon_at_coord(IBar *b, Evas_Coord x, Evas_Coord y);
-static IBar_Icon *_ibar_icon_new(IBar *b, Efreet_Desktop *desktop);
-static void _ibar_icon_free(IBar_Icon *ic);
-static void _ibar_icon_fill(IBar_Icon *ic);
-static void _ibar_icon_empty(IBar_Icon *ic);
-static void _ibar_icon_signal_emit(IBar_Icon *ic, char *sig, char *src);
-static void _ibar_cb_app_change(void *data, E_Order *eo);
-static void _ibar_cb_obj_moveresize(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _ibar_cb_menu_icon_new(void *data, E_Menu *m, E_Menu_Item *mi);
-static void _ibar_cb_menu_icon_add(void *data, E_Menu *m, E_Menu_Item *mi);
-static void _ibar_cb_menu_icon_properties(void *data, E_Menu *m, E_Menu_Item *mi);
-static void _ibar_cb_menu_icon_remove(void *data, E_Menu *m, E_Menu_Item *mi);
-static void _ibar_cb_menu_configuration(void *data, E_Menu *m, E_Menu_Item *mi);
-static void _ibar_cb_menu_post(void *data, E_Menu *m);
-static void _ibar_cb_icon_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _ibar_cb_icon_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _ibar_cb_icon_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _ibar_cb_icon_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _ibar_cb_icon_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _ibar_cb_icon_move(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _ibar_cb_icon_resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void _ibar_inst_cb_enter(void *data, const char *type, void *event_info);
-static void _ibar_inst_cb_move(void *data, const char *type, void *event_info);
-static void _ibar_inst_cb_leave(void *data, const char *type, void *event_info);
-static void _ibar_inst_cb_drop(void *data, const char *type, void *event_info);
-static void _ibar_cb_drag_finished(E_Drag *data, int dropped);
-static void _ibar_drop_position_update(Instance *inst, Evas_Coord x, Evas_Coord y);
-static void _ibar_inst_cb_scroll(void *data);
-static Eina_Bool _ibar_cb_config_icons(void *data, int ev_type, void *ev);
+static IBar_Icon *_ibar_icon_at_coord(IBar *b, Evas_Coord x, Evas_Coord y);
+static IBar_Icon *_ibar_icon_new(IBar *b, Efreet_Desktop *desktop);
+static void _ibar_icon_free(IBar_Icon *ic);
+static void _ibar_icon_fill(IBar_Icon *ic);
+static void _ibar_icon_empty(IBar_Icon *ic);
+static void _ibar_icon_signal_emit(IBar_Icon *ic, char *sig, char *src);
+static void _ibar_cb_app_change(void *data, E_Order *eo);
+static void _ibar_cb_obj_moveresize(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _ibar_cb_menu_icon_new(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ibar_cb_menu_icon_add(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ibar_cb_menu_icon_properties(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ibar_cb_menu_icon_remove(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ibar_cb_menu_configuration(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ibar_cb_menu_post(void *data, E_Menu *m);
+static void _ibar_cb_icon_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _ibar_cb_icon_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _ibar_cb_icon_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _ibar_cb_icon_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _ibar_cb_icon_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _ibar_cb_icon_move(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _ibar_cb_icon_resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _ibar_inst_cb_enter(void *data, const char *type, void *event_info);
+static void _ibar_inst_cb_move(void *data, const char *type, void *event_info);
+static void _ibar_inst_cb_leave(void *data, const char *type, void *event_info);
+static void _ibar_inst_cb_drop(void *data, const char *type, void *event_info);
+static void _ibar_cb_drag_finished(E_Drag *data, int dropped);
+static void _ibar_drop_position_update(Instance *inst, Evas_Coord x, Evas_Coord y);
+static void _ibar_inst_cb_scroll(void *data);
+static Eina_Bool _ibar_cb_config_icons(void *data, int ev_type, void *ev);
static E_Config_DD *conf_edd = NULL;
static E_Config_DD *conf_item_edd = NULL;
evas_object_geometry_get(o, &x, &y, &w, &h);
inst->drop_handler =
e_drop_handler_add(E_OBJECT(inst->gcc), inst,
- _ibar_inst_cb_enter, _ibar_inst_cb_move,
- _ibar_inst_cb_leave, _ibar_inst_cb_drop,
- drop, 3, x, y, w, h);
+ _ibar_inst_cb_enter, _ibar_inst_cb_move,
+ _ibar_inst_cb_leave, _ibar_inst_cb_drop,
+ drop, 3, x, y, w, h);
evas_object_event_callback_add(o, EVAS_CALLBACK_MOVE,
- _ibar_cb_obj_moveresize, inst);
+ _ibar_cb_obj_moveresize, inst);
evas_object_event_callback_add(o, EVAS_CALLBACK_RESIZE,
- _ibar_cb_obj_moveresize, inst);
+ _ibar_cb_obj_moveresize, inst);
ibar_config->instances = eina_list_append(ibar_config->instances, inst);
return gcc;
}
case E_GADCON_ORIENT_CORNER_TR:
case E_GADCON_ORIENT_CORNER_BL:
case E_GADCON_ORIENT_CORNER_BR:
- _ibar_orient_set(inst->ibar, 1);
- e_gadcon_client_aspect_set(gcc, eina_list_count(inst->ibar->icons) * 16, 16);
- break;
+ _ibar_orient_set(inst->ibar, 1);
+ e_gadcon_client_aspect_set(gcc, eina_list_count(inst->ibar->icons) * 16, 16);
+ break;
+
case E_GADCON_ORIENT_VERT:
case E_GADCON_ORIENT_LEFT:
case E_GADCON_ORIENT_RIGHT:
case E_GADCON_ORIENT_CORNER_RT:
case E_GADCON_ORIENT_CORNER_LB:
case E_GADCON_ORIENT_CORNER_RB:
- _ibar_orient_set(inst->ibar, 0);
- e_gadcon_client_aspect_set(gcc, 16, eina_list_count(inst->ibar->icons) * 16);
- break;
+ _ibar_orient_set(inst->ibar, 0);
+ e_gadcon_client_aspect_set(gcc, 16, eina_list_count(inst->ibar->icons) * 16);
+ break;
+
default:
- break;
+ break;
}
e_gadcon_client_min_size_set(gcc, 16, 16);
}
o = edje_object_add(evas);
snprintf(buf, sizeof(buf), "%s/e-module-ibar.edj",
- e_module_dir_get(ibar_config->module));
+ e_module_dir_get(ibar_config->module));
edje_object_file_set(o, buf, "icon");
return o;
}
/* yes - don't do this. on shutdown gadgets are deleted and this means config
* for them is deleted - that means empty config is saved. keep them around
* as if u add a gadget back it can pick up its old config again
- *
+ *
Config_Item *ci;
ci = _ibar_config_item_get(id);
if (ci)
{
- if (ci->id) eina_stringshare_del(ci->id);
- ibar_config->items = eina_list_remove(ibar_config->items, ci);
+ if (ci->id) eina_stringshare_del(ci->id);
+ ibar_config->items = eina_list_remove(ibar_config->items, ci);
}
*/
}
e_box_orientation_set(b->o_box, 1);
e_box_align_set(b->o_box, 0.5, 0.5);
if (inst->ci->dir[0] != '/')
- e_user_dir_snprintf(buf, sizeof(buf), "applications/bar/%s/.order",
+ e_user_dir_snprintf(buf, sizeof(buf), "applications/bar/%s/.order",
inst->ci->dir);
else
eina_strlcpy(buf, inst->ci->dir, sizeof(buf));
b = data;
if (!ibar_config->menu)
{
- E_Menu *m;
- E_Menu_Item *mi;
- int cx, cy, cw, ch;
-
- m = e_menu_new();
- mi = e_menu_item_new(m);
- e_menu_item_label_set(mi, _("Settings"));
- e_util_menu_item_theme_icon_set(mi, "configure");
- e_menu_item_callback_set(mi, _ibar_cb_menu_configuration, b);
-
- m = e_gadcon_client_util_menu_items_append(b->inst->gcc, m, 0);
- e_menu_post_deactivate_callback_set(m, _ibar_cb_menu_post, NULL);
- ibar_config->menu = m;
-
- e_gadcon_canvas_zone_geometry_get(b->inst->gcc->gadcon,
- &cx, &cy, &cw, &ch);
- e_menu_activate_mouse(m,
- e_util_zone_current_get(e_manager_current_get()),
- cx + ev->output.x, cy + ev->output.y, 1, 1,
- E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
+ E_Menu *m;
+ E_Menu_Item *mi;
+ int cx, cy, cw, ch;
+
+ m = e_menu_new();
+ mi = e_menu_item_new(m);
+ e_menu_item_label_set(mi, _("Settings"));
+ e_util_menu_item_theme_icon_set(mi, "configure");
+ e_menu_item_callback_set(mi, _ibar_cb_menu_configuration, b);
+
+ m = e_gadcon_client_util_menu_items_append(b->inst->gcc, m, 0);
+ e_menu_post_deactivate_callback_set(m, _ibar_cb_menu_post, NULL);
+ ibar_config->menu = m;
+
+ e_gadcon_canvas_zone_geometry_get(b->inst->gcc->gadcon,
+ &cx, &cy, &cw, &ch);
+ e_menu_activate_mouse(m,
+ e_util_zone_current_get(e_manager_current_get()),
+ cx + ev->output.x, cy + ev->output.y, 1, 1,
+ E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
}
}
{
if (!b->icons)
{
- if (!b->o_empty)
- {
- Evas_Coord w, h;
+ if (!b->o_empty)
+ {
+ Evas_Coord w, h;
- b->o_empty = evas_object_rectangle_add(evas_object_evas_get(b->o_box));
- evas_object_event_callback_add(b->o_empty,
- EVAS_CALLBACK_MOUSE_DOWN,
+ b->o_empty = evas_object_rectangle_add(evas_object_evas_get(b->o_box));
+ evas_object_event_callback_add(b->o_empty,
+ EVAS_CALLBACK_MOUSE_DOWN,
_ibar_cb_empty_mouse_down, b);
- evas_object_color_set(b->o_empty, 0, 0, 0, 0);
- evas_object_show(b->o_empty);
- e_box_pack_end(b->o_box, b->o_empty);
- evas_object_geometry_get(b->o_box, NULL, NULL, &w, &h);
- if (e_box_orientation_get(b->o_box))
- w = h;
- else
- h = w;
- e_box_pack_options_set(b->o_empty,
- 1, 1, /* fill */
- 1, 1, /* expand */
- 0.5, 0.5, /* align */
- w, h, /* min */
- 9999, 9999 /* max */
- );
- }
+ evas_object_color_set(b->o_empty, 0, 0, 0, 0);
+ evas_object_show(b->o_empty);
+ e_box_pack_end(b->o_box, b->o_empty);
+ evas_object_geometry_get(b->o_box, NULL, NULL, &w, &h);
+ if (e_box_orientation_get(b->o_box))
+ w = h;
+ else
+ h = w;
+ e_box_pack_options_set(b->o_empty,
+ 1, 1, /* fill */
+ 1, 1, /* expand */
+ 0.5, 0.5, /* align */
+ w, h, /* min */
+ 9999, 9999 /* max */
+ );
+ }
}
else if (b->o_empty)
{
- evas_object_del(b->o_empty);
- b->o_empty = NULL;
+ evas_object_del(b->o_empty);
+ b->o_empty = NULL;
}
}
{
if (b->apps)
{
- Efreet_Desktop *desktop;
- const Eina_List *l;
-
- EINA_LIST_FOREACH(b->apps->desktops, l, desktop)
- {
- IBar_Icon *ic = _ibar_icon_new(b, desktop);
- b->icons = eina_list_append(b->icons, ic);
- e_box_pack_end(b->o_box, ic->o_holder);
- }
+ Efreet_Desktop *desktop;
+ const Eina_List *l;
+
+ EINA_LIST_FOREACH(b->apps->desktops, l, desktop)
+ {
+ IBar_Icon *ic = _ibar_icon_new(b, desktop);
+ b->icons = eina_list_append(b->icons, ic);
+ e_box_pack_end(b->o_box, ic->o_holder);
+ }
}
_ibar_empty_handle(b);
_ibar_resize_handle(b);
e_box_freeze(b->o_box);
EINA_LIST_FOREACH(b->icons, l, ic)
{
- e_box_pack_options_set(ic->o_holder,
- 1, 1, /* fill */
- 0, 0, /* expand */
- 0.5, 0.5, /* align */
- w, h, /* min */
- w, h /* max */
- );
+ e_box_pack_options_set(ic->o_holder,
+ 1, 1, /* fill */
+ 0, 0, /* expand */
+ 0.5, 0.5, /* align */
+ w, h, /* min */
+ w, h /* max */
+ );
}
e_box_thaw(b->o_box);
}
e_gadcon_client_viewport_geometry_get(inst->gcc, &x, &y, &w, &h);
e_drop_handler_geometry_set(inst->drop_handler, x, y, w, h);
-}
+}
static Config_Item *
_ibar_config_item_get(const char *id)
EINA_LIST_FOREACH(ibar_config->instances, l, inst)
{
- char buf[PATH_MAX];
- const Eina_List *i;
- IBar_Icon *ic;
+ char buf[PATH_MAX];
+ const Eina_List *i;
+ IBar_Icon *ic;
- if (inst->ci != ci) continue;
+ if (inst->ci != ci) continue;
- _ibar_empty(inst->ibar);
- if (inst->ibar->apps)
- e_object_del(E_OBJECT(inst->ibar->apps));
- if (inst->ci->dir[0] != '/')
- e_user_dir_snprintf(buf, sizeof(buf), "applications/bar/%s/.order",
+ _ibar_empty(inst->ibar);
+ if (inst->ibar->apps)
+ e_object_del(E_OBJECT(inst->ibar->apps));
+ if (inst->ci->dir[0] != '/')
+ e_user_dir_snprintf(buf, sizeof(buf), "applications/bar/%s/.order",
inst->ci->dir);
- else
- eina_strlcpy(buf, inst->ci->dir, sizeof(buf));
- inst->ibar->apps = e_order_new(buf);
- _ibar_fill(inst->ibar);
- _ibar_resize_handle(inst->ibar);
- _gc_orient(inst->gcc, -1);
-
- EINA_LIST_FOREACH(inst->ibar->icons, i, ic)
- {
- switch (ci->eap_label)
- {
- case 0:
- edje_object_part_text_set(ic->o_holder2, "e.text.label",
+ else
+ eina_strlcpy(buf, inst->ci->dir, sizeof(buf));
+ inst->ibar->apps = e_order_new(buf);
+ _ibar_fill(inst->ibar);
+ _ibar_resize_handle(inst->ibar);
+ _gc_orient(inst->gcc, -1);
+
+ EINA_LIST_FOREACH(inst->ibar->icons, i, ic)
+ {
+ switch (ci->eap_label)
+ {
+ case 0:
+ edje_object_part_text_set(ic->o_holder2, "e.text.label",
ic->app->name);
- break;
- case 1:
- edje_object_part_text_set(ic->o_holder2, "e.text.label",
+ break;
+
+ case 1:
+ edje_object_part_text_set(ic->o_holder2, "e.text.label",
ic->app->comment);
- break;
- case 2:
- edje_object_part_text_set(ic->o_holder2, "e.text.label",
+ break;
+
+ case 2:
+ edje_object_part_text_set(ic->o_holder2, "e.text.label",
ic->app->generic_name);
- break;
- }
- }
+ break;
+ }
+ }
}
}
Evas_Coord dx, dy, dw, dh;
evas_object_geometry_get(ic->o_holder, &dx, &dy, &dw, &dh);
- if (E_INSIDE(x, y, dx, dy, dw, dh)) return ic;
+ if (E_INSIDE(x, y, dx, dy, dw, dh)) return ic;
}
return NULL;
}
ic->app = desktop;
ic->o_holder = edje_object_add(evas_object_evas_get(b->o_box));
e_theme_edje_object_set(ic->o_holder, "base/theme/modules/ibar",
- "e/modules/ibar/icon");
- evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_IN,
- _ibar_cb_icon_mouse_in, ic);
- evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_OUT,
+ "e/modules/ibar/icon");
+ evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_IN,
+ _ibar_cb_icon_mouse_in, ic);
+ evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_OUT,
_ibar_cb_icon_mouse_out, ic);
- evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_DOWN,
+ evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_DOWN,
_ibar_cb_icon_mouse_down, ic);
- evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_UP,
+ evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_UP,
_ibar_cb_icon_mouse_up, ic);
- evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_MOVE,
+ evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOUSE_MOVE,
_ibar_cb_icon_mouse_move, ic);
- evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOVE,
+ evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_MOVE,
_ibar_cb_icon_move, ic);
- evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_RESIZE,
+ evas_object_event_callback_add(ic->o_holder, EVAS_CALLBACK_RESIZE,
_ibar_cb_icon_resize, ic);
evas_object_show(ic->o_holder);
ic->o_holder2 = edje_object_add(evas_object_evas_get(b->o_box));
e_theme_edje_object_set(ic->o_holder2, "base/theme/modules/ibar",
- "e/modules/ibar/icon_overlay");
+ "e/modules/ibar/icon_overlay");
evas_object_layer_set(ic->o_holder2, 9999);
evas_object_pass_events_set(ic->o_holder2, 1);
evas_object_show(ic->o_holder2);
{
if (ibar_config->menu)
{
- e_menu_post_deactivate_callback_set(ibar_config->menu, NULL, NULL);
- e_object_del(E_OBJECT(ibar_config->menu));
- ibar_config->menu = NULL;
+ e_menu_post_deactivate_callback_set(ibar_config->menu, NULL, NULL);
+ e_object_del(E_OBJECT(ibar_config->menu));
+ ibar_config->menu = NULL;
}
if (ic->ibar->ic_drop_before == ic)
ic->ibar->ic_drop_before = NULL;
evas_object_pass_events_set(ic->o_icon2, 1);
evas_object_show(ic->o_icon2);
- switch (ic->ibar->inst->ci->eap_label)
+ switch (ic->ibar->inst->ci->eap_label)
{
case 0: /* Eap Name */
- edje_object_part_text_set(ic->o_holder2, "e.text.label", ic->app->name);
- break;
+ edje_object_part_text_set(ic->o_holder2, "e.text.label", ic->app->name);
+ break;
+
case 1: /* Eap Comment */
- edje_object_part_text_set(ic->o_holder2, "e.text.label", ic->app->comment);
- break;
+ edje_object_part_text_set(ic->o_holder2, "e.text.label", ic->app->comment);
+ break;
+
case 2: /* Eap Generic */
- edje_object_part_text_set(ic->o_holder2, "e.text.label", ic->app->generic_name);
- break;
+ edje_object_part_text_set(ic->o_holder2, "e.text.label", ic->app->generic_name);
+ break;
}
}
_ibar_instance_drop_zone_recalc(inst);
}
-static void
-_ibar_cb_menu_icon_new(void *data __UNUSED__, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
+static void
+_ibar_cb_menu_icon_new(void *data __UNUSED__, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
{
E_Container *con;
e_configure_registry_call("applications/new_application", con, NULL);
}
-static void
-_ibar_cb_menu_icon_add(void *data __UNUSED__, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
+static void
+_ibar_cb_menu_icon_add(void *data __UNUSED__, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
{
E_Container *con;
}
/*
-static void
-_ibar_cb_menu_add(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
-{
+ static void
+ _ibar_cb_menu_add(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
+ {
IBar *b;
b = data;
e_configure_registry_call("internal/ibar_other",
- b->inst->gcc->gadcon->zone->container,
- b->apps->path);
-}
-*/
+ b->inst->gcc->gadcon->zone->container,
+ b->apps->path);
+ }
+ */
static void
_ibar_cb_menu_post(void *data __UNUSED__, E_Menu *m __UNUSED__)
ic = data;
if (ev->button == 1)
{
- ic->drag.x = ev->output.x;
- ic->drag.y = ev->output.y;
- ic->drag.start = 1;
- ic->drag.dnd = 0;
- ic->mouse_down = 1;
+ ic->drag.x = ev->output.x;
+ ic->drag.y = ev->output.y;
+ ic->drag.start = 1;
+ ic->drag.dnd = 0;
+ ic->mouse_down = 1;
}
else if ((ev->button == 3) && (!ibar_config->menu))
{
- E_Menu *m, *mo;
- E_Menu_Item *mi;
+ E_Menu *m, *mo;
+ E_Menu_Item *mi;
char buf[256];
- int cx, cy;
+ int cx, cy;
- m = e_menu_new();
+ m = e_menu_new();
- /* FIXME: other icon options go here too */
- mo = e_menu_new();
+ /* FIXME: other icon options go here too */
+ mo = e_menu_new();
- if (e_configure_registry_exists("applications/new_application"))
- {
- mi = e_menu_item_new(m);
- e_menu_item_label_set(mi, _("Create new Icon"));
- e_util_menu_item_theme_icon_set(mi, "document-new");
- e_menu_item_callback_set(mi, _ibar_cb_menu_icon_new, NULL);
+ if (e_configure_registry_exists("applications/new_application"))
+ {
+ mi = e_menu_item_new(m);
+ e_menu_item_label_set(mi, _("Create new Icon"));
+ e_util_menu_item_theme_icon_set(mi, "document-new");
+ e_menu_item_callback_set(mi, _ibar_cb_menu_icon_new, NULL);
mi = e_menu_item_new(m);
e_menu_item_separator_set(mi, 1);
- }
-
- if (e_configure_registry_exists("applications/ibar_applications"))
- {
- mi = e_menu_item_new(m);
- e_menu_item_label_set(mi, _("Contents"));
- e_util_menu_item_theme_icon_set(mi, "list-add");
- e_menu_item_callback_set(mi, _ibar_cb_menu_icon_add, NULL);
- }
-
- mi = e_menu_item_new(m);
- e_menu_item_label_set(mi, _("Settings"));
- e_util_menu_item_theme_icon_set(mi, "configure");
- e_menu_item_callback_set(mi, _ibar_cb_menu_configuration, ic->ibar);
-
- m = e_gadcon_client_util_menu_items_append(ic->ibar->inst->gcc, m, 0);
- e_menu_post_deactivate_callback_set(m, _ibar_cb_menu_post, NULL);
- ibar_config->menu = m;
-
- mi = e_menu_item_new(mo);
- e_menu_item_label_set(mi, _("Properties"));
- e_util_menu_item_theme_icon_set(mi, "configure");
- e_menu_item_callback_set(mi, _ibar_cb_menu_icon_properties, ic);
-
- mi = e_menu_item_new(mo);
- e_menu_item_label_set(mi, _("Remove"));
- e_util_menu_item_theme_icon_set(mi, "list-remove");
- e_menu_item_callback_set(mi, _ibar_cb_menu_icon_remove, ic);
+ }
+
+ if (e_configure_registry_exists("applications/ibar_applications"))
+ {
+ mi = e_menu_item_new(m);
+ e_menu_item_label_set(mi, _("Contents"));
+ e_util_menu_item_theme_icon_set(mi, "list-add");
+ e_menu_item_callback_set(mi, _ibar_cb_menu_icon_add, NULL);
+ }
+
+ mi = e_menu_item_new(m);
+ e_menu_item_label_set(mi, _("Settings"));
+ e_util_menu_item_theme_icon_set(mi, "configure");
+ e_menu_item_callback_set(mi, _ibar_cb_menu_configuration, ic->ibar);
+
+ m = e_gadcon_client_util_menu_items_append(ic->ibar->inst->gcc, m, 0);
+ e_menu_post_deactivate_callback_set(m, _ibar_cb_menu_post, NULL);
+ ibar_config->menu = m;
+
+ mi = e_menu_item_new(mo);
+ e_menu_item_label_set(mi, _("Properties"));
+ e_util_menu_item_theme_icon_set(mi, "configure");
+ e_menu_item_callback_set(mi, _ibar_cb_menu_icon_properties, ic);
+
+ mi = e_menu_item_new(mo);
+ e_menu_item_label_set(mi, _("Remove"));
+ e_util_menu_item_theme_icon_set(mi, "list-remove");
+ e_menu_item_callback_set(mi, _ibar_cb_menu_icon_remove, ic);
mi = e_menu_item_new_relative(m, NULL);
snprintf(buf, sizeof(buf), "Icon %s", ic->app->name);
e_menu_item_label_set(mi, _(buf));
- e_util_desktop_menu_item_icon_add(ic->app,
- e_util_icon_size_normalize(24 * e_scale),
+ e_util_desktop_menu_item_icon_add(ic->app,
+ e_util_icon_size_normalize(24 * e_scale),
mi);
e_menu_item_submenu_set(mi, mo);
- e_gadcon_canvas_zone_geometry_get(ic->ibar->inst->gcc->gadcon,
- &cx, &cy, NULL, NULL);
- e_menu_activate_mouse(m,
- e_util_zone_current_get(e_manager_current_get()),
- cx + ev->output.x, cy + ev->output.y, 1, 1,
- E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
+ e_gadcon_canvas_zone_geometry_get(ic->ibar->inst->gcc->gadcon,
+ &cx, &cy, NULL, NULL);
+ e_menu_activate_mouse(m,
+ e_util_zone_current_get(e_manager_current_get()),
+ cx + ev->output.x, cy + ev->output.y, 1, 1,
+ E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
}
}
ic = data;
if ((ev->button == 1) && (!ic->drag.dnd) && (ic->mouse_down == 1))
{
- if (ic->app->type == EFREET_DESKTOP_TYPE_APPLICATION)
- e_exec(ic->ibar->inst->gcc->gadcon->zone, ic->app, NULL, NULL, "ibar");
- else if (ic->app->type == EFREET_DESKTOP_TYPE_LINK)
- {
- if (!strncasecmp(ic->app->url, "file:", 5))
- {
- E_Action *act;
-
- act = e_action_find("fileman");
- if (act) act->func.go(E_OBJECT(obj), ic->app->url + 5);
- }
- }
-
- ic->drag.start = 0;
- ic->drag.dnd = 0;
- ic->mouse_down = 0;
- /* TODO: bring back "e,action,start|stop" for the startup_notify apps
- * when startup_notify is used again
- */
- _ibar_icon_signal_emit(ic, "e,action,exec", "e");
+ if (ic->app->type == EFREET_DESKTOP_TYPE_APPLICATION)
+ e_exec(ic->ibar->inst->gcc->gadcon->zone, ic->app, NULL, NULL, "ibar");
+ else if (ic->app->type == EFREET_DESKTOP_TYPE_LINK)
+ {
+ if (!strncasecmp(ic->app->url, "file:", 5))
+ {
+ E_Action *act;
+
+ act = e_action_find("fileman");
+ if (act) act->func.go(E_OBJECT(obj), ic->app->url + 5);
+ }
+ }
+
+ ic->drag.start = 0;
+ ic->drag.dnd = 0;
+ ic->mouse_down = 0;
+ /* TODO: bring back "e,action,start|stop" for the startup_notify apps
+ * when startup_notify is used again
+ */
+ _ibar_icon_signal_emit(ic, "e,action,exec", "e");
}
}
ic = data;
if (ic->drag.start)
{
- int dx, dy;
-
- dx = ev->cur.output.x - ic->drag.x;
- dy = ev->cur.output.y - ic->drag.y;
- if (((dx * dx) + (dy * dy)) >
- (e_config->drag_resist * e_config->drag_resist))
- {
- E_Drag *d;
- Evas_Object *o;
- Evas_Coord x, y, w, h;
- unsigned int size;
- const char *drag_types[] = { "enlightenment/desktop" };
- E_Gadcon_Client *gc;
-
- ic->drag.dnd = 1;
- ic->drag.start = 0;
-
- evas_object_geometry_get(ic->o_icon, &x, &y, &w, &h);
- d = e_drag_new(ic->ibar->inst->gcc->gadcon->zone->container,
- x, y, drag_types, 1,
- ic->app, -1, NULL, _ibar_cb_drag_finished);
+ int dx, dy;
+
+ dx = ev->cur.output.x - ic->drag.x;
+ dy = ev->cur.output.y - ic->drag.y;
+ if (((dx * dx) + (dy * dy)) >
+ (e_config->drag_resist * e_config->drag_resist))
+ {
+ E_Drag *d;
+ Evas_Object *o;
+ Evas_Coord x, y, w, h;
+ unsigned int size;
+ const char *drag_types[] = { "enlightenment/desktop" };
+ E_Gadcon_Client *gc;
+
+ ic->drag.dnd = 1;
+ ic->drag.start = 0;
+
+ evas_object_geometry_get(ic->o_icon, &x, &y, &w, &h);
+ d = e_drag_new(ic->ibar->inst->gcc->gadcon->zone->container,
+ x, y, drag_types, 1,
+ ic->app, -1, NULL, _ibar_cb_drag_finished);
efreet_desktop_ref(ic->app);
- size = MAX(w, h);
+ size = MAX(w, h);
o = e_util_desktop_icon_add(ic->app, size, e_drag_evas_get(d));
- e_drag_object_set(d, o);
+ e_drag_object_set(d, o);
- e_drag_resize(d, w, h);
- e_drag_start(d, ic->drag.x, ic->drag.y);
- ic->ibar->icons = eina_list_remove(ic->ibar->icons, ic);
- _ibar_resize_handle(ic->ibar);
+ e_drag_resize(d, w, h);
+ e_drag_start(d, ic->drag.x, ic->drag.y);
+ ic->ibar->icons = eina_list_remove(ic->ibar->icons, ic);
+ _ibar_resize_handle(ic->ibar);
gc = ic->ibar->inst->gcc;
- _gc_orient(gc, -1);
- e_order_remove(ic->ibar->apps, ic->app);
- _ibar_icon_free(ic);
- }
+ _gc_orient(gc, -1);
+ e_order_remove(ic->ibar->apps, ic->app);
+ _ibar_icon_free(ic);
+ }
}
}
inst->ibar->ic_drop_before = ic;
if (ic)
{
- Evas_Coord ix, iy, iw, ih;
- int before = 0;
-
- evas_object_geometry_get(ic->o_holder, &ix, &iy, &iw, &ih);
- if (e_box_orientation_get(inst->ibar->o_box))
- {
- if (x < (ix + (iw / 2))) before = 1;
- }
- else
- {
- if (y < (iy + (ih / 2))) before = 1;
- }
- if (before)
- e_box_pack_before(inst->ibar->o_box, inst->ibar->o_drop, ic->o_holder);
- else
- e_box_pack_after(inst->ibar->o_box, inst->ibar->o_drop, ic->o_holder);
- inst->ibar->drop_before = before;
+ Evas_Coord ix, iy, iw, ih;
+ int before = 0;
+
+ evas_object_geometry_get(ic->o_holder, &ix, &iy, &iw, &ih);
+ if (e_box_orientation_get(inst->ibar->o_box))
+ {
+ if (x < (ix + (iw / 2))) before = 1;
+ }
+ else
+ {
+ if (y < (iy + (ih / 2))) before = 1;
+ }
+ if (before)
+ e_box_pack_before(inst->ibar->o_box, inst->ibar->o_drop, ic->o_holder);
+ else
+ e_box_pack_after(inst->ibar->o_box, inst->ibar->o_drop, ic->o_holder);
+ inst->ibar->drop_before = before;
}
else e_box_pack_end(inst->ibar->o_box, inst->ibar->o_drop);
e_box_pack_options_set(inst->ibar->o_drop,
- 1, 1, /* fill */
- 1, 1, /* expand */
- 0.5, 0.5, /* align */
- 1, 1, /* min */
- -1, -1 /* max */
- );
+ 1, 1, /* fill */
+ 1, 1, /* expand */
+ 0.5, 0.5, /* align */
+ 1, 1, /* min */
+ -1, -1 /* max */
+ );
_ibar_resize_handle(inst->ibar);
_gc_orient(inst->gcc, -1);
}
inst->ibar->o_drop = o;
o2 = edje_object_add(evas_object_evas_get(inst->ibar->o_box));
inst->ibar->o_drop_over = o2;
- evas_object_event_callback_add(o, EVAS_CALLBACK_MOVE,
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOVE,
_ibar_cb_drop_move, inst->ibar);
- evas_object_event_callback_add(o, EVAS_CALLBACK_RESIZE,
+ evas_object_event_callback_add(o, EVAS_CALLBACK_RESIZE,
_ibar_cb_drop_resize, inst->ibar);
e_theme_edje_object_set(o, "base/theme/modules/ibar",
- "e/modules/ibar/drop");
+ "e/modules/ibar/drop");
e_theme_edje_object_set(o2, "base/theme/modules/ibar",
- "e/modules/ibar/drop_overlay");
+ "e/modules/ibar/drop_overlay");
evas_object_layer_set(o2, 19999);
evas_object_show(o);
evas_object_show(o2);
app = ev->data;
else if (!strcmp(type, "enlightenment/border"))
{
- E_Border *bd;
-
- bd = ev->data;
- app = bd->desktop;
- if (!app)
- {
- app = e_desktop_border_create(bd);
- efreet_desktop_save(app);
- e_desktop_edit(e_container_current_get(e_manager_current_get()),
+ E_Border *bd;
+
+ bd = ev->data;
+ app = bd->desktop;
+ if (!app)
+ {
+ app = e_desktop_border_create(bd);
+ efreet_desktop_save(app);
+ e_desktop_edit(e_container_current_get(e_manager_current_get()),
app);
- }
+ }
}
else if (!strcmp(type, "text/uri-list"))
fl = ev->data;
ic = inst->ibar->ic_drop_before;
if (ic)
{
- /* Add new eapp before this icon */
- if (!inst->ibar->drop_before)
- {
- const Eina_List *l;
- IBar_Icon *ic2;
-
- EINA_LIST_FOREACH(inst->ibar->icons, l, ic2)
- {
- if (ic2 == ic)
- {
- if (l->next)
- ic = l->next->data;
- else
- ic = NULL;
- break;
- }
- }
- }
- if (!ic) goto atend;
- if (app)
- e_order_prepend_relative(ic->ibar->apps, app, ic->app);
- else if (fl)
- e_order_files_prepend_relative(ic->ibar->apps, fl, ic->app);
+ /* Add new eapp before this icon */
+ if (!inst->ibar->drop_before)
+ {
+ const Eina_List *l;
+ IBar_Icon *ic2;
+
+ EINA_LIST_FOREACH(inst->ibar->icons, l, ic2)
+ {
+ if (ic2 == ic)
+ {
+ if (l->next)
+ ic = l->next->data;
+ else
+ ic = NULL;
+ break;
+ }
+ }
+ }
+ if (!ic) goto atend;
+ if (app)
+ e_order_prepend_relative(ic->ibar->apps, app, ic->app);
+ else if (fl)
+ e_order_files_prepend_relative(ic->ibar->apps, fl, ic->app);
}
else
{
- atend:
- if (inst->ibar->apps)
- {
- if (app)
- e_order_append(inst->ibar->apps, app);
- else if (fl)
- e_order_files_append(inst->ibar->apps, fl);
- }
+atend:
+ if (inst->ibar->apps)
+ {
+ if (app)
+ e_order_append(inst->ibar->apps, app);
+ else if (fl)
+ e_order_files_append(inst->ibar->apps, fl);
+ }
}
evas_object_del(inst->ibar->o_drop);
inst->ibar->o_drop = NULL;
if (!ibar_config)
{
- Config_Item *ci;
+ Config_Item *ci;
- ibar_config = E_NEW(Config, 1);
+ ibar_config = E_NEW(Config, 1);
- ci = E_NEW(Config_Item, 1);
- ci->id = eina_stringshare_add("ibar.1");
- ci->dir = eina_stringshare_add("default");
- ci->show_label = 1;
- ci->eap_label = 0;
- ibar_config->items = eina_list_append(ibar_config->items, ci);
+ ci = E_NEW(Config_Item, 1);
+ ci->id = eina_stringshare_add("ibar.1");
+ ci->dir = eina_stringshare_add("default");
+ ci->show_label = 1;
+ ci->eap_label = 0;
+ ibar_config->items = eina_list_append(ibar_config->items, ci);
}
-
+
ibar_config->module = m;
- ibar_config->handlers =
+ ibar_config->handlers =
eina_list_append(ibar_config->handlers,
- ecore_event_handler_add(E_EVENT_CONFIG_ICON_THEME,
+ ecore_event_handler_add(E_EVENT_CONFIG_ICON_THEME,
_ibar_cb_config_icons, NULL));
- ibar_config->handlers =
+ ibar_config->handlers =
eina_list_append(ibar_config->handlers,
ecore_event_handler_add(EFREET_EVENT_ICON_CACHE_UPDATE,
_ibar_cb_config_icons, NULL));
if (ibar_config->menu)
{
- e_menu_post_deactivate_callback_set(ibar_config->menu, NULL, NULL);
- e_object_del(E_OBJECT(ibar_config->menu));
- ibar_config->menu = NULL;
+ e_menu_post_deactivate_callback_set(ibar_config->menu, NULL, NULL);
+ e_object_del(E_OBJECT(ibar_config->menu));
+ ibar_config->menu = NULL;
}
EINA_LIST_FREE(ibar_config->items, ci)
{
- if (ci->id) eina_stringshare_del(ci->id);
- if (ci->dir) eina_stringshare_del(ci->dir);
- E_FREE(ci);
+ if (ci->id) eina_stringshare_del(ci->id);
+ if (ci->dir) eina_stringshare_del(ci->dir);
+ E_FREE(ci);
}
E_FREE(ibar_config);
ibar_config = NULL;
EINA_LIST_FOREACH(ibar_config->instances, l, inst)
{
- const Eina_List *l2;
- IBar_Icon *icon;
+ const Eina_List *l2;
+ IBar_Icon *icon;
- EINA_LIST_FOREACH(inst->ibar->icons, l2, icon)
- _ibar_icon_fill(icon);
+ EINA_LIST_FOREACH(inst->ibar->icons, l2, icon)
+ _ibar_icon_fill(icon);
}
return ECORE_CALLBACK_PASS_ON;
}
+