From 712d33389f3305dc7c437484f117cf279e301871 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Mon, 11 Apr 2005 21:50:36 +0000 Subject: [PATCH] ibox isnt used/etc. so for now lets remove it. SVN revision: 14145 --- src/modules/Makefile.am | 1 - src/modules/battery/e_mod_main.c | 68 +- src/modules/clock/e_mod_main.c | 21 +- src/modules/dropshadow/e_mod_main.c | 50 +- src/modules/ibar/e_mod_main.c | 50 +- src/modules/ibox/.cvsignore | 6 - src/modules/ibox/Makefile.am | 26 - src/modules/ibox/e_mod_main.c | 1927 -------------------------- src/modules/ibox/e_mod_main.h | 86 -- src/modules/ibox/module_icon.png | Bin 734 -> 0 bytes src/modules/pager/e_mod_main.c | 16 +- src/modules/temperature/e_mod_main.c | 74 +- src/modules/test/e_mod_main.c | 28 +- 13 files changed, 154 insertions(+), 2199 deletions(-) delete mode 100644 src/modules/ibox/.cvsignore delete mode 100644 src/modules/ibox/Makefile.am delete mode 100644 src/modules/ibox/e_mod_main.c delete mode 100644 src/modules/ibox/e_mod_main.h delete mode 100644 src/modules/ibox/module_icon.png diff --git a/src/modules/Makefile.am b/src/modules/Makefile.am index 12977d93e..047fa7463 100644 --- a/src/modules/Makefile.am +++ b/src/modules/Makefile.am @@ -2,7 +2,6 @@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = \ test \ ibar \ -ibox \ dropshadow \ clock \ pager \ diff --git a/src/modules/battery/e_mod_main.c b/src/modules/battery/e_mod_main.c index 69e1d5932..8aa480d70 100644 --- a/src/modules/battery/e_mod_main.c +++ b/src/modules/battery/e_mod_main.c @@ -42,11 +42,11 @@ init(E_Module *m) /* check module api version */ if (m->api->version < E_MODULE_API_VERSION) { - e_error_dialog_show("Module API Error", - "Error initializing Module: Battery\n" - "It requires a minimum module API version of: %i.\n" - "The module API advertized by Enlightenment is: %i.\n" - "Aborting module.", + e_error_dialog_show(_("Module API Error"), + _("Error initializing Module: Battery\n" + "It requires a minimum module API version of: %i.\n" + "The module API advertized by Enlightenment is: %i.\n" + "Aborting module."), E_MODULE_API_VERSION, m->api->version); return NULL; @@ -86,7 +86,7 @@ info(E_Module *m) { char buf[4096]; - m->label = strdup("Battery"); + m->label = strdup(_("Battery")); snprintf(buf, sizeof(buf), "%s/module_icon.png", e_module_dir_get(m)); m->icon_file = strdup(buf); return 1; @@ -95,11 +95,11 @@ info(E_Module *m) int about(E_Module *m) { - e_error_dialog_show("Enlightenment Battery Module", - "A basic battery meter that uses either ACPI or APM\n" - "on Linux to monitor your battery and AC power adaptor\n" - "status. This will only work under Linux and is only\n" - "as accurate as your BIOS or kernel drivers."); + e_error_dialog_show(_("Enlightenment Battery Module"), + _("A basic battery meter that uses either ACPI or APM\n" + "on Linux to monitor your battery and AC power adaptor\n" + "status. This will only work under Linux and is only\n" + "as accurate as your BIOS or kernel drivers.")); return 1; } @@ -187,11 +187,11 @@ _battery_new() /* Add main menu to face menu */ mi = e_menu_item_new(ef->menu); - e_menu_item_label_set(mi, "Set Poll Time"); + e_menu_item_label_set(mi, _("Set Poll Time")); e_menu_item_submenu_set(mi, e->config_menu_poll); mi = e_menu_item_new(ef->menu); - e_menu_item_label_set(mi, "Set Alarm"); + e_menu_item_label_set(mi, _("Set Alarm")); e_menu_item_submenu_set(mi, e->config_menu_alarm); mi = e_menu_item_new(e->config_menu); @@ -415,7 +415,7 @@ _battery_config_menu_new(Battery *e) e_menu_item_callback_set(mi, _battery_menu_alarm_50, e); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "1 hour"); + e_menu_item_label_set(mi, _("1 hour")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->alarm == 60) e_menu_item_toggle_set(mi, 1); @@ -427,35 +427,35 @@ _battery_config_menu_new(Battery *e) mn = e_menu_new(); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Check Fast (1 sec)"); + e_menu_item_label_set(mi, _("Check Fast (1 sec)")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->poll_time == 1.0) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _battery_menu_fast, e); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Check Medium (5 sec)"); + e_menu_item_label_set(mi, _("Check Medium (5 sec)")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->poll_time == 5.0) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _battery_menu_medium, e); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Check Normal (10 sec)"); + e_menu_item_label_set(mi, _("Check Normal (10 sec)")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->poll_time == 10.0) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _battery_menu_normal, e); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Check Slow (30 sec)"); + e_menu_item_label_set(mi, _("Check Slow (30 sec)")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->poll_time == 30.0) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _battery_menu_slow, e); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Check Very Slow (60 sec)"); + e_menu_item_label_set(mi, _("Check Very Slow (60 sec)")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->poll_time == 60.0) e_menu_item_toggle_set(mi, 1); @@ -466,11 +466,11 @@ _battery_config_menu_new(Battery *e) mn = e_menu_new(); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Set Poll Time"); + e_menu_item_label_set(mi, _("Set Poll Time")); e_menu_item_submenu_set(mi, e->config_menu_poll); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Set Alarm"); + e_menu_item_label_set(mi, _("Set Alarm")); e_menu_item_submenu_set(mi, e->config_menu_alarm); e->config_menu = mn; @@ -552,7 +552,7 @@ _battery_face_menu_new(Battery_Face *face) /* Enabled */ /* mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Enabled"); + e_menu_item_label_set(mi, _("Enabled")); e_menu_item_check_set(mi, 1); if (face->conf->enabled) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _battery_face_cb_menu_enabled, face); @@ -560,7 +560,7 @@ _battery_face_menu_new(Battery_Face *face) /* Edit */ mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Edit Mode"); + e_menu_item_label_set(mi, _("Edit Mode")); e_menu_item_callback_set(mi, _battery_face_cb_menu_edit, face); } @@ -685,9 +685,9 @@ _battery_cb_check(void *data) { if (!ef->alarm_triggered) { - e_error_dialog_show("Battery Running Low", - "Your battery is running low.\n" - "You may wish to switch to an AC source."); + e_error_dialog_show(_("Battery Running Low"), + _("Your battery is running low.\n" + "You may wish to switch to an AC source.")); } edje_object_signal_emit(face->bat_object, "pulse", ""); } @@ -747,7 +747,7 @@ _battery_cb_check(void *data) if (ef->battery_prev_battery != -2) edje_object_signal_emit(face->bat_object, "unknown", ""); - edje_object_part_text_set(face->bat_object, "reading", "NO INFO"); + edje_object_part_text_set(face->bat_object, "reading", _("NO INFO")); edje_object_part_text_set(face->bat_object, "time", "--:--"); _battery_face_level_set(face, (double)(rand() & 0xff) / 255.0); } @@ -879,7 +879,7 @@ _battery_linux_acpi_check(Battery *ef) { stat->has_battery = 0; stat->state = BATTERY_STATE_NONE; - stat->reading = strdup("NO BAT"); + stat->reading = strdup(_("NO BAT")); stat->time = strdup("--:--"); stat->level = 1.0; } @@ -903,7 +903,7 @@ _battery_linux_acpi_check(Battery *ef) } if (level_unknown) { - stat->reading = strdup("BAD DRIVER"); + stat->reading = strdup(_("BAD DRIVER")); stat->time = strdup("--:--"); stat->level = 0.0; } @@ -927,7 +927,7 @@ _battery_linux_acpi_check(Battery *ef) { stat->has_battery = 1; stat->state = BATTERY_STATE_NONE; - stat->reading = strdup("FULL"); + stat->reading = strdup(_("FULL")); stat->time = strdup("--:--"); stat->level = 1.0; } @@ -987,19 +987,19 @@ _battery_linux_apm_check(Battery *ef) switch (bat_stat) { case 0: - stat->reading = strdup("High"); + stat->reading = strdup(_("High")); stat->level = 1.0; break; case 1: - stat->reading = strdup("Low"); + stat->reading = strdup(_("Low")); stat->level = 0.5; break; case 2: - stat->reading = strdup("Danger"); + stat->reading = strdup(_("Danger")); stat->level = 0.25; break; case 3: - stat->reading = strdup("Charging"); + stat->reading = strdup(_("Charging")); stat->level = 1.0; break; } diff --git a/src/modules/clock/e_mod_main.c b/src/modules/clock/e_mod_main.c index 0e611f664..8d80dbcbe 100644 --- a/src/modules/clock/e_mod_main.c +++ b/src/modules/clock/e_mod_main.c @@ -37,11 +37,11 @@ init(E_Module *module) /* check module api version */ if (module->api->version < E_MODULE_API_VERSION) { - e_error_dialog_show("Module API Error", - "Error initializing Module: Clock\n" - "It requires a minimum module API version of: %i.\n" - "The module API advertized by Enlightenment is: %i.\n" - "Aborting module.", + e_error_dialog_show(_("Module API Error"), + _("Error initializing Module: Clock\n" + "It requires a minimum module API version of: %i.\n" + "The module API advertized by Enlightenment is: %i.\n" + "Aborting module."), E_MODULE_API_VERSION, module->api->version); return NULL; @@ -83,7 +83,7 @@ info(E_Module *module) { char buf[4096]; - module->label = strdup("Clock"); + module->label = strdup(_("Clock")); snprintf(buf, sizeof(buf), "%s/module_icon.png", e_module_dir_get(module)); module->icon_file = strdup(buf); return 1; @@ -92,8 +92,8 @@ info(E_Module *module) int about(E_Module *module) { - e_error_dialog_show("Enlightenment Clock Module", - "A simple module to give E17 a clock."); + e_error_dialog_show(_("Enlightenment Clock Module"), + _("A simple module to give E17 a clock.")); return 1; } @@ -300,7 +300,7 @@ _clock_face_menu_new(Clock_Face *face) /* Enabled */ /* mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Enabled"); + e_menu_item_label_set(mi, _("Enabled")); e_menu_item_check_set(mi, 1); if (face->conf->enabled) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _clock_face_cb_menu_enabled, face); @@ -308,7 +308,7 @@ _clock_face_menu_new(Clock_Face *face) /* Edit */ mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Edit Mode"); + e_menu_item_label_set(mi, _("Edit Mode")); e_menu_item_callback_set(mi, _clock_face_cb_menu_edit, face); } @@ -384,3 +384,4 @@ _clock_face_cb_menu_edit(void *data, E_Menu *m, E_Menu_Item *mi) face = data; e_gadman_mode_set(face->gmc->gadman, E_GADMAN_MODE_EDIT); } + diff --git a/src/modules/dropshadow/e_mod_main.c b/src/modules/dropshadow/e_mod_main.c index d773ccfe8..9aad0afde 100644 --- a/src/modules/dropshadow/e_mod_main.c +++ b/src/modules/dropshadow/e_mod_main.c @@ -74,11 +74,11 @@ init(E_Module *m) if (m->api->version < E_MODULE_API_VERSION) { - e_error_dialog_show("Module API Error", - "Error initializing Module: Dropshadow\n" - "It requires a minimum module API version of: %i.\n" - "The module API advertized by Enlightenment is: %i.\n" - "Aborting module.", + e_error_dialog_show(_("Module API Error"), + _("Error initializing Module: Dropshadow\n" + "It requires a minimum module API version of: %i.\n" + "The module API advertized by Enlightenment is: %i.\n" + "Aborting module."), E_MODULE_API_VERSION, m->api->version); return NULL; @@ -122,7 +122,7 @@ info(E_Module *m) { char buf[4096]; - m->label = strdup("Dropshadow"); + m->label = strdup(_("Dropshadow")); snprintf(buf, sizeof(buf), "%s/module_icon.png", e_module_dir_get(m)); m->icon_file = strdup(buf); return 1; @@ -131,10 +131,10 @@ info(E_Module *m) int about(E_Module *m) { - e_error_dialog_show("Enlightenment Dropshadow Module", - "This is the dropshadow module that allows dropshadows to be cast\n" - "on the desktop background - without special X-Server extensions\n" - "or hardware acceleration."); + e_error_dialog_show(_("Enlightenment Dropshadow Module"), + _("This is the dropshadow module that allows dropshadows to be cast\n" + "on the desktop background - without special X-Server extensions\n" + "or hardware acceleration.")); return 1; } @@ -236,7 +236,7 @@ _ds_config_menu_new(Dropshadow *ds) mn = e_menu_new(); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Very Fuzzy"); + e_menu_item_label_set(mi, _("Very Fuzzy")); snprintf(buf, sizeof(buf), "%s/menu_icon_very_fuzzy.png", e_module_dir_get(ds->module)); e_menu_item_icon_file_set(mi, buf); e_menu_item_radio_set(mi, 1); @@ -245,7 +245,7 @@ _ds_config_menu_new(Dropshadow *ds) e_menu_item_callback_set(mi, _ds_menu_very_fuzzy, ds); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Fuzzy"); + e_menu_item_label_set(mi, _("Fuzzy")); snprintf(buf, sizeof(buf), "%s/menu_icon_fuzzy.png", e_module_dir_get(ds->module)); e_menu_item_icon_file_set(mi, buf); e_menu_item_radio_set(mi, 1); @@ -254,7 +254,7 @@ _ds_config_menu_new(Dropshadow *ds) e_menu_item_callback_set(mi, _ds_menu_fuzzy, ds); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Medium"); + e_menu_item_label_set(mi, _("Medium")); snprintf(buf, sizeof(buf), "%s/menu_icon_medium.png", e_module_dir_get(ds->module)); e_menu_item_icon_file_set(mi, buf); e_menu_item_radio_set(mi, 1); @@ -263,7 +263,7 @@ _ds_config_menu_new(Dropshadow *ds) e_menu_item_callback_set(mi, _ds_menu_medium, ds); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Sharp"); + e_menu_item_label_set(mi, _("Sharp")); snprintf(buf, sizeof(buf), "%s/menu_icon_sharp.png", e_module_dir_get(ds->module)); e_menu_item_icon_file_set(mi, buf); e_menu_item_radio_set(mi, 1); @@ -272,7 +272,7 @@ _ds_config_menu_new(Dropshadow *ds) e_menu_item_callback_set(mi, _ds_menu_sharp, ds); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Very Sharp"); + e_menu_item_label_set(mi, _("Very Sharp")); snprintf(buf, sizeof(buf), "%s/menu_icon_very_sharp.png", e_module_dir_get(ds->module)); e_menu_item_icon_file_set(mi, buf); e_menu_item_radio_set(mi, 1); @@ -284,7 +284,7 @@ _ds_config_menu_new(Dropshadow *ds) e_menu_item_separator_set(mi, 1); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Very Dark"); + e_menu_item_label_set(mi, _("Very Dark")); snprintf(buf, sizeof(buf), "%s/menu_icon_very_dark.png", e_module_dir_get(ds->module)); e_menu_item_icon_file_set(mi, buf); e_menu_item_radio_set(mi, 1); @@ -293,7 +293,7 @@ _ds_config_menu_new(Dropshadow *ds) e_menu_item_callback_set(mi, _ds_menu_very_dark, ds); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Dark"); + e_menu_item_label_set(mi, _("Dark")); snprintf(buf, sizeof(buf), "%s/menu_icon_dark.png", e_module_dir_get(ds->module)); e_menu_item_icon_file_set(mi, buf); e_menu_item_radio_set(mi, 1); @@ -302,7 +302,7 @@ _ds_config_menu_new(Dropshadow *ds) e_menu_item_callback_set(mi, _ds_menu_dark, ds); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Light"); + e_menu_item_label_set(mi, _("Light")); snprintf(buf, sizeof(buf), "%s/menu_icon_light.png", e_module_dir_get(ds->module)); e_menu_item_icon_file_set(mi, buf); e_menu_item_radio_set(mi, 1); @@ -311,7 +311,7 @@ _ds_config_menu_new(Dropshadow *ds) e_menu_item_callback_set(mi, _ds_menu_light, ds); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Very Light"); + e_menu_item_label_set(mi, _("Very Light")); snprintf(buf, sizeof(buf), "%s/menu_icon_very_light.png", e_module_dir_get(ds->module)); e_menu_item_icon_file_set(mi, buf); e_menu_item_radio_set(mi, 1); @@ -323,7 +323,7 @@ _ds_config_menu_new(Dropshadow *ds) e_menu_item_separator_set(mi, 1); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Very Far"); + e_menu_item_label_set(mi, _("Very Far")); snprintf(buf, sizeof(buf), "%s/menu_icon_very_far.png", e_module_dir_get(ds->module)); e_menu_item_icon_file_set(mi, buf); e_menu_item_radio_set(mi, 1); @@ -332,7 +332,7 @@ _ds_config_menu_new(Dropshadow *ds) e_menu_item_callback_set(mi, _ds_menu_very_far, ds); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Far"); + e_menu_item_label_set(mi, _("Far")); snprintf(buf, sizeof(buf), "%s/menu_icon_very_far.png", e_module_dir_get(ds->module)); e_menu_item_icon_file_set(mi, buf); e_menu_item_radio_set(mi, 1); @@ -341,7 +341,7 @@ _ds_config_menu_new(Dropshadow *ds) e_menu_item_callback_set(mi, _ds_menu_far, ds); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Close"); + e_menu_item_label_set(mi, _("Close")); snprintf(buf, sizeof(buf), "%s/menu_icon_far.png", e_module_dir_get(ds->module)); e_menu_item_icon_file_set(mi, buf); e_menu_item_radio_set(mi, 1); @@ -350,7 +350,7 @@ _ds_config_menu_new(Dropshadow *ds) e_menu_item_callback_set(mi, _ds_menu_close, ds); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Very Close"); + e_menu_item_label_set(mi, _("Very Close")); snprintf(buf, sizeof(buf), "%s/menu_icon_close.png", e_module_dir_get(ds->module)); e_menu_item_icon_file_set(mi, buf); e_menu_item_radio_set(mi, 1); @@ -359,7 +359,7 @@ _ds_config_menu_new(Dropshadow *ds) e_menu_item_callback_set(mi, _ds_menu_very_close, ds); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Extremely Close"); + e_menu_item_label_set(mi, _("Extremely Close")); snprintf(buf, sizeof(buf), "%s/menu_icon_underneath.png", e_module_dir_get(ds->module)); e_menu_item_icon_file_set(mi, buf); e_menu_item_radio_set(mi, 1); @@ -368,7 +368,7 @@ _ds_config_menu_new(Dropshadow *ds) e_menu_item_callback_set(mi, _ds_menu_extremely_close, ds); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Immediately Underneath"); + e_menu_item_label_set(mi, _("Immediately Underneath")); snprintf(buf, sizeof(buf), "%s/menu_icon_underneath.png", e_module_dir_get(ds->module)); e_menu_item_icon_file_set(mi, buf); e_menu_item_radio_set(mi, 1); diff --git a/src/modules/ibar/e_mod_main.c b/src/modules/ibar/e_mod_main.c index c82f7dfc4..883e10b92 100644 --- a/src/modules/ibar/e_mod_main.c +++ b/src/modules/ibar/e_mod_main.c @@ -102,11 +102,11 @@ init(E_Module *m) /* check module api version */ if (m->api->version < E_MODULE_API_VERSION) { - e_error_dialog_show("Module API Error", - "Error initializing Module: IBar\n" - "It requires a minimum module API version of: %i.\n" - "The module API advertized by Enlightenment is: %i.\n" - "Aborting module.", + e_error_dialog_show(_("Module API Error"), + _("Error initializing Module: IBar\n" + "It requires a minimum module API version of: %i.\n" + "The module API advertized by Enlightenment is: %i.\n" + "Aborting module."), E_MODULE_API_VERSION, m->api->version); return NULL; @@ -146,7 +146,7 @@ info(E_Module *m) { char buf[4096]; - m->label = strdup("IBar"); + m->label = strdup(_("IBar")); snprintf(buf, sizeof(buf), "%s/module_icon.png", e_module_dir_get(m)); m->icon_file = strdup(buf); return 1; @@ -155,11 +155,11 @@ info(E_Module *m) int about(E_Module *m) { - e_error_dialog_show("Enlightenment IBar Module", - "This is the IBar Application Launcher bar module for Enlightenment.\n" - "It is a first example module and is being used to flesh out several\n" - "Interfaces in Enlightenment 0.17.0. It is under heavy development,\n" - "so expect it to break often and change as it improves."); + e_error_dialog_show(_("Enlightenment IBar Module"), + _("This is the IBar Application Launcher bar module for Enlightenment.\n" + "It is a first example module and is being used to flesh out several\n" + "Interfaces in Enlightenment 0.17.0. It is under heavy development,\n" + "so expect it to break often and change as it improves.")); return 1; } @@ -714,7 +714,7 @@ _ibar_config_menu_new(IBar *ib) ib->config_menu_options = mn; mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Auto fit icons"); + e_menu_item_label_set(mi, _("Auto fit icons")); e_menu_item_check_set(mi, 1); 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); @@ -723,77 +723,77 @@ _ibar_config_menu_new(IBar *ib) ib->config_menu_size = mn; mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Microscopic"); + e_menu_item_label_set(mi, _("Microscopic")); 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); e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_microscopic, ib); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Tiny"); + e_menu_item_label_set(mi, _("Tiny")); 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); e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_tiny, ib); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Very Small"); + e_menu_item_label_set(mi, _("Very Small")); 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); e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_very_small, ib); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Small"); + e_menu_item_label_set(mi, _("Small")); 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); e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_small, ib); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Medium"); + e_menu_item_label_set(mi, _("Medium")); 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); e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_medium, ib); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Large"); + e_menu_item_label_set(mi, _("Large")); 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); e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_large, ib); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Very Large"); + e_menu_item_label_set(mi, _("Very Large")); 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); e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_very_large, ib); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Exteremely Large"); + e_menu_item_label_set(mi, _("Exteremely Large")); 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); e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_extremely_large, ib); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Huge"); + e_menu_item_label_set(mi, _("Huge")); 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); e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_huge, ib); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Enormous"); + e_menu_item_label_set(mi, _("Enormous")); 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); e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_enormous, ib); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Gigantic"); + e_menu_item_label_set(mi, _("Gigantic")); 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); @@ -801,11 +801,11 @@ _ibar_config_menu_new(IBar *ib) /* Submenus */ mi = e_menu_item_new(ib->config_menu); - e_menu_item_label_set(mi, "Options"); + e_menu_item_label_set(mi, _("Options")); e_menu_item_submenu_set(mi, ib->config_menu_options); mi = e_menu_item_new(ib->config_menu); - e_menu_item_label_set(mi, "Size"); + e_menu_item_label_set(mi, _("Size")); e_menu_item_submenu_set(mi, ib->config_menu_size); } diff --git a/src/modules/ibox/.cvsignore b/src/modules/ibox/.cvsignore deleted file mode 100644 index 60ebc832f..000000000 --- a/src/modules/ibox/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -*.lo -module.la diff --git a/src/modules/ibox/Makefile.am b/src/modules/ibox/Makefile.am deleted file mode 100644 index 0668505ac..000000000 --- a/src/modules/ibox/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -MAINTAINERCLEANFILES = Makefile.in -MODULE = ibox - -# data files for the module -filesdir = $(libdir)/enlightenment/modules/$(MODULE) -files_DATA = \ -module_icon.png - -EXTRA_DIST = $(files_DATA) - -# the module .so file -INCLUDES = -I. \ - -I$(top_srcdir) \ - -I$(includedir) \ - -I$(top_srcdir)$(MODULE) \ - -I$(top_srcdir)/src/bin \ - -I$(top_srcdir)/src/lib \ - -I$(top_srcdir)/src/modules \ - @e_cflags@ -pkgdir = $(libdir)/enlightenment/modules/$(MODULE)/$(MODULE_ARCH) -pkg_LTLIBRARIES = module.la -module_la_SOURCES = e_mod_main.c \ - e_mod_main.h -module_la_LIBADD = @e_libs@ @dlopen_libs@ -module_la_LDFLAGS = -module -avoid-version -module_la_DEPENDENCIES = $(top_builddir)/config.h diff --git a/src/modules/ibox/e_mod_main.c b/src/modules/ibox/e_mod_main.c deleted file mode 100644 index 1d8ef3596..000000000 --- a/src/modules/ibox/e_mod_main.c +++ /dev/null @@ -1,1927 +0,0 @@ -#include "e.h" -#include "e_mod_main.h" - -/* TODO List: - * - * * 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 - * * save and load config - * - * BONUS Features (maybe do this later): - * - * * allow ibox icons to be dragged around to re-order/delete - * - */ - -/* const strings */ -static const char *_ibox_main_orientation[] = -{"bottom", "top", "left", "right"}; - -/* module private routines */ -static IBox *_ibox_init(E_Module *m); -static void _ibox_shutdown(IBox *ib); -static void _ibox_app_change(void *data, E_App *a, E_App_Change ch); -static E_Menu *_ibox_config_menu_new(IBox *ib); -static void _ibox_config_menu_del(IBox *ib, E_Menu *m); -static void _ibox_cb_width_fixed(void *data, E_Menu *m, E_Menu_Item *mi); -static void _ibox_cb_width_auto(void *data, E_Menu *m, E_Menu_Item *mi); -static void _ibox_cb_width_fill(void *data, E_Menu *m, E_Menu_Item *mi); -static void _ibox_box_iconsize_change(IBox_Box *ibb); -static IBox_Icon *_ibox_box_icon_find(IBox_Box *ibb, E_App *a); -static void _ibox_box_icon_del(IBox_Icon *ic); -static IBox_Icon *_ibox_box_icon_new(IBox_Box *ibb, E_App *a, E_Border *bd); -static void _ibox_box_icon_resize(IBox_Icon *ic); -static void _ibox_box_icon_reorder_before(IBox_Icon *ic, IBox_Icon *before); -static void _ibox_box_icon_reorder_after(IBox_Icon *ic, IBox_Icon *after); -static void _ibox_box_frame_resize(IBox_Box *ibb); -static void _ibox_box_init(IBox_Box *ibb); -static void _ibox_box_free(IBox_Box *ibb); -static void _ibox_motion_handle(IBox_Box *ibb, Evas_Coord mx, Evas_Coord my); -static void _ibox_timer_handle(IBox_Box *ibb); -static void _ibox_box_reconfigure(IBox_Box *ibb); -static void _ibox_box_follower_reset(IBox_Box *ibb); -static void _ibox_box_convert_move_resize_to_config(IBox_Box *ibb); -static void _ibox_box_edge_change(IBox_Box *ibb, int edge); -static void _ibox_cb_intercept_icon_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y); -static void _ibox_cb_intercept_icon_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h); -static void _ibox_cb_intercept_box_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y); -static void _ibox_cb_intercept_box_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h); -static void _ibox_cb_icon_in(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibox_cb_icon_out(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibox_cb_icon_down(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibox_cb_icon_up(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibox_cb_box_in(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibox_cb_box_out(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibox_cb_box_down(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibox_cb_box_up(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibox_cb_box_move(void *data, Evas *e, Evas_Object *obj, void *event_info); -static int _ibox_cb_box_timer(void *data); -static int _ibox_cb_box_animator(void *data); -static void _ibox_cb_box_move_start(void *data, Evas_Object *obj, const char *emission, const char *source); -static void _ibox_cb_box_move_stop(void *data, Evas_Object *obj, const char *emission, const char *source); -static void _ibox_cb_box_resize1_start(void *data, Evas_Object *obj, const char *emission, const char *source); -static void _ibox_cb_box_resize1_stop(void *data, Evas_Object *obj, const char *emission, const char *source); -static void _ibox_cb_box_resize2_start(void *data, Evas_Object *obj, const char *emission, const char *source); -static void _ibox_cb_box_resize2_stop(void *data, Evas_Object *obj, const char *emission, const char *source); -static void _ibox_cb_box_move_go(void *data, Evas_Object *obj, const char *emission, const char *source); -static int _ibox_cb_event_container_resize(void *data, int type, void *event); - -static int _ibox_cb_event_border_iconify(void *data, int type, void *event); -static int _ibox_cb_event_border_uniconify(void *data, int type, void *event); - -/* public module routines. all modules must have these */ -void * -init(E_Module *m) -{ - IBox *ib; - - e_error_dialog_show("IBox Disabled", - "The IBox module is diabled for now during\n" - "the mini freeze period. Come back later.\n"); - return NULL; - /* check module api version */ - if (m->api->version < E_MODULE_API_VERSION) - { - e_error_dialog_show("Module API Error", - "Error initializing Module: IBox\n" - "It requires a minimum module API version of: %i.\n" - "The module API advertized by Enlightenment is: %i.\n" - "Aborting module.", - E_MODULE_API_VERSION, - m->api->version); - return NULL; - } - /* actually init ibox */ - ib = _ibox_init(m); - m->config_menu = _ibox_config_menu_new(ib); - return ib; -} - -int -shutdown(E_Module *m) -{ - IBox *ib; - - ib = m->data; - if (ib) - { - if (m->config_menu) - { - _ibox_config_menu_del(ib, m->config_menu); - m->config_menu = NULL; - } - _ibox_shutdown(ib); - } - return 1; -} - -int -save(E_Module *m) -{ - IBox *ib; - - ib = m->data; - e_config_domain_save("module.ibox", ib->conf_edd, ib->conf); - return 1; -} - -int -info(E_Module *m) -{ - char buf[4096]; - - m->label = strdup("IBox"); - snprintf(buf, sizeof(buf), "%s/module_icon.png", e_module_dir_get(m)); - m->icon_file = strdup(buf); - return 1; -} - -int -about(E_Module *m) -{ - e_error_dialog_show("Enlightenment IBox Module", - "This is the IBox iconbar module for Enlightenment.\n"); - return 1; -} - -/* module private routines */ -static IBox * -_ibox_init(E_Module *m) -{ - IBox *ib; - char buf[4096]; - Evas_List *managers, *l, *l2; - - ib = calloc(1, sizeof(IBox)); - if (!ib) return NULL; - - ib->conf_edd = E_CONFIG_DD_NEW("Ibox_Config", Config); -#undef T -#undef D -#define T Config -#define D ib->conf_edd - E_CONFIG_VAL(D, T, follow_speed, DOUBLE); - E_CONFIG_VAL(D, T, autoscroll_speed, DOUBLE); - E_CONFIG_VAL(D, T, width, INT); - E_CONFIG_VAL(D, T, iconsize, INT); - E_CONFIG_VAL(D, T, edge, INT); - E_CONFIG_VAL(D, T, anchor, DOUBLE); - E_CONFIG_VAL(D, T, handle, DOUBLE); - E_CONFIG_VAL(D, T, autohide, UCHAR); - - ib->conf = e_config_domain_load("module.ibox", ib->conf_edd); - if (!ib->conf) - { - ib->conf = E_NEW(Config, 1); - ib->conf->follow_speed = 9; - ib->conf->autoscroll_speed = 0.95; - ib->conf->width = 400; - ib->conf->iconsize = 32; - ib->conf->edge = EDGE_BOTTOM; - ib->conf->anchor = 0.5; - ib->conf->handle = 0.5; - ib->conf->autohide = 0; - } - 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->width, -1, 4000); - E_CONFIG_LIMIT(ib->conf->iconsize, 2, 400); - E_CONFIG_LIMIT(ib->conf->edge, EDGE_BOTTOM, EDGE_RIGHT); - E_CONFIG_LIMIT(ib->conf->anchor, 0.0, 1.0); - E_CONFIG_LIMIT(ib->conf->handle, 0.0, 1.0); - E_CONFIG_LIMIT(ib->conf->autohide, 0, 1); - - e_app_change_callback_add(_ibox_app_change, ib); - - managers = e_manager_list(); - for (l = managers; l; l = l->next) - { - E_Manager *man; - - man = l->data; - for (l2 = man->containers; l2; l2 = l2->next) - { - E_Container *con; - IBox_Box *ibb; - - con = l2->data; - ibb = calloc(1, sizeof(IBox_Box)); - if (ibb) - { - ibb->ibox = ib; - ibb->con = con; - ibb->evas = con->bg_evas; - ib->boxs = evas_list_append(ib->boxs, ibb); - _ibox_box_init(ibb); - } - } - } - - ecore_event_handler_add(E_EVENT_BORDER_HIDE, - _ibox_cb_event_border_iconify, ib); - ecore_event_handler_add(E_EVENT_BORDER_SHOW, - _ibox_cb_event_border_uniconify, ib); - - return ib; -} - -static void -_ibox_shutdown(IBox *ib) -{ - free(ib->conf); - E_CONFIG_DD_FREE(ib->conf_edd); - e_app_change_callback_del(_ibox_app_change, ib); - while (ib->boxs) - { - IBox_Box *ibb; - - ibb = ib->boxs->data; - ib->boxs = evas_list_remove_list(ib->boxs, ib->boxs); - _ibox_box_free(ibb); - } - free(ib); -} - -static void -_ibox_app_change(void *data, E_App *a, E_App_Change ch) -{ - IBox *ib; - Evas_List *l, *ll; - - ib = data; -} - -/* FIXME: none of these work runtime... only on restart */ -static void -_ibox_cb_iconsize_microscopic(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBox *ib; - Evas_List *l; - - ib = data; - ib->conf->iconsize = 8; - for (l = ib->boxs; l; l = l->next) - { - IBox_Box *ibb; - - ibb = l->data; - _ibox_box_iconsize_change(ibb); - _ibox_box_edge_change(ibb, ib->conf->edge); - } - e_config_save_queue(); -} - -static void -_ibox_cb_iconsize_tiny(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBox *ib; - Evas_List *l; - - ib = data; - ib->conf->iconsize = 12; - for (l = ib->boxs; l; l = l->next) - { - IBox_Box *ibb; - - ibb = l->data; - _ibox_box_iconsize_change(ibb); - _ibox_box_edge_change(ibb, ib->conf->edge); - } - e_config_save_queue(); -} - -static void -_ibox_cb_iconsize_very_small(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBox *ib; - Evas_List *l; - - ib = data; - ib->conf->iconsize = 16; - for (l = ib->boxs; l; l = l->next) - { - IBox_Box *ibb; - - ibb = l->data; - _ibox_box_iconsize_change(ibb); - _ibox_box_edge_change(ibb, ib->conf->edge); - } - e_config_save_queue(); -} - -static void -_ibox_cb_iconsize_small(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBox *ib; - Evas_List *l; - - ib = data; - ib->conf->iconsize = 24; - for (l = ib->boxs; l; l = l->next) - { - IBox_Box *ibb; - - ibb = l->data; - _ibox_box_iconsize_change(ibb); - _ibox_box_edge_change(ibb, ib->conf->edge); - } - e_config_save_queue(); -} - -static void -_ibox_cb_iconsize_medium(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBox *ib; - Evas_List *l; - - ib = data; - ib->conf->iconsize = 32; - for (l = ib->boxs; l; l = l->next) - { - IBox_Box *ibb; - - ibb = l->data; - _ibox_box_iconsize_change(ibb); - _ibox_box_edge_change(ibb, ib->conf->edge); - } - e_config_save_queue(); -} - -static void -_ibox_cb_iconsize_large(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBox *ib; - Evas_List *l; - - ib = data; - ib->conf->iconsize = 40; - for (l = ib->boxs; l; l = l->next) - { - IBox_Box *ibb; - - ibb = l->data; - _ibox_box_iconsize_change(ibb); - _ibox_box_edge_change(ibb, ib->conf->edge); - } - e_config_save_queue(); -} - -static void -_ibox_cb_iconsize_very_large(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBox *ib; - Evas_List *l; - - ib = data; - ib->conf->iconsize = 48; - for (l = ib->boxs; l; l = l->next) - { - IBox_Box *ibb; - - ibb = l->data; - _ibox_box_iconsize_change(ibb); - _ibox_box_edge_change(ibb, ib->conf->edge); - } - e_config_save_queue(); -} - -static void -_ibox_cb_iconsize_extremely_large(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBox *ib; - Evas_List *l; - - ib = data; - ib->conf->iconsize = 56; - for (l = ib->boxs; l; l = l->next) - { - IBox_Box *ibb; - - ibb = l->data; - _ibox_box_iconsize_change(ibb); - _ibox_box_edge_change(ibb, ib->conf->edge); - } - e_config_save_queue(); -} - -static void -_ibox_cb_iconsize_huge(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBox *ib; - Evas_List *l; - - ib = data; - ib->conf->iconsize = 64; - for (l = ib->boxs; l; l = l->next) - { - IBox_Box *ibb; - - ibb = l->data; - _ibox_box_iconsize_change(ibb); - _ibox_box_edge_change(ibb, ib->conf->edge); - } - e_config_save_queue(); -} - -static void -_ibox_cb_iconsize_enormous(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBox *ib; - Evas_List *l; - - ib = data; - ib->conf->iconsize = 96; - for (l = ib->boxs; l; l = l->next) - { - IBox_Box *ibb; - - ibb = l->data; - _ibox_box_iconsize_change(ibb); - _ibox_box_edge_change(ibb, ib->conf->edge); - } - e_config_save_queue(); -} - -static void -_ibox_cb_iconsize_gigantic(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBox *ib; - Evas_List *l; - - ib = data; - ib->conf->iconsize = 128; - for (l = ib->boxs; l; l = l->next) - { - IBox_Box *ibb; - - ibb = l->data; - _ibox_box_iconsize_change(ibb); - _ibox_box_edge_change(ibb, ib->conf->edge); - } - e_config_save_queue(); -} - -static E_Menu * -_ibox_config_menu_new(IBox *ib) -{ - E_Menu *mn; - E_Menu_Item *mi; - - /* FIXME: hook callbacks to each menu item */ - mn = e_menu_new(); - - mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Fixed width"); - e_menu_item_radio_set(mi, 1); - e_menu_item_radio_group_set(mi, 1); - if (ib->conf->width > 0) e_menu_item_toggle_set(mi, 1); - e_menu_item_callback_set(mi, _ibox_cb_width_fixed, ib); - - mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Auto fit icons"); - e_menu_item_radio_set(mi, 1); - e_menu_item_radio_group_set(mi, 1); - if (ib->conf->width < 0) e_menu_item_toggle_set(mi, 1); - e_menu_item_callback_set(mi, _ibox_cb_width_auto, ib); - - mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Fill edge"); - e_menu_item_radio_set(mi, 1); - e_menu_item_radio_group_set(mi, 1); - if (ib->conf->width == 0) e_menu_item_toggle_set(mi, 1); - e_menu_item_callback_set(mi, _ibox_cb_width_fill, ib); - - mi = e_menu_item_new(mn); - e_menu_item_separator_set(mi, 1); - - mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Microscopic"); - 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); - e_menu_item_callback_set(mi, _ibox_cb_iconsize_microscopic, ib); - - mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Tiny"); - 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); - e_menu_item_callback_set(mi, _ibox_cb_iconsize_tiny, ib); - - mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Very Small"); - 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); - e_menu_item_callback_set(mi, _ibox_cb_iconsize_very_small, ib); - - mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Small"); - 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); - e_menu_item_callback_set(mi, _ibox_cb_iconsize_small, ib); - - mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Medium"); - 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); - e_menu_item_callback_set(mi, _ibox_cb_iconsize_medium, ib); - - mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Large"); - 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); - e_menu_item_callback_set(mi, _ibox_cb_iconsize_large, ib); - - mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Very Large"); - 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); - e_menu_item_callback_set(mi, _ibox_cb_iconsize_very_large, ib); - - mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Exteremely Large"); - 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); - e_menu_item_callback_set(mi, _ibox_cb_iconsize_extremely_large, ib); - - mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Huge"); - 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); - e_menu_item_callback_set(mi, _ibox_cb_iconsize_huge, ib); - - mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Enormous"); - 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); - e_menu_item_callback_set(mi, _ibox_cb_iconsize_enormous, ib); - - mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Gigantic"); - 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); - e_menu_item_callback_set(mi, _ibox_cb_iconsize_gigantic, ib); - -/* - mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Auto hide"); - e_menu_item_check_set(mi, 1); - if (ib->conf->autohide == 0) e_menu_item_toggle_set(mi, 1); - - mi = e_menu_item_new(mn); - e_menu_item_separator_set(mi, 1); - - mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "More Options..."); -*/ - ib->config_menu = mn; - - return mn; -} - -static void -_ibox_config_menu_del(IBox *ib, E_Menu *m) -{ - e_object_del(E_OBJECT(m)); -} - -static void -_ibox_cb_width_fixed(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBox *ib; - - ib = data; - if (ib->conf->width <= 0) - { - Evas_List *l; - - ib->conf->width = 400; - for (l = ib->boxs; l; l = l->next) - { - IBox_Box *ibb; - - ibb = l->data; - _ibox_box_edge_change(ibb, ib->conf->edge); - } - } - e_config_save_queue(); -} - -static void -_ibox_cb_width_auto(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBox *ib; - - ib = data; - if (ib->conf->width >= 0) - { - Evas_List *l; - - ib->conf->width = -1; - for (l = ib->boxs; l; l = l->next) - { - IBox_Box *ibb; - - ibb = l->data; - _ibox_box_edge_change(ibb, ib->conf->edge); - } - } - e_config_save_queue(); -} - -static void -_ibox_cb_width_fill(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBox *ib; - - ib = data; - if (ib->conf->width != 0) - { - Evas_List *l; - - ib->conf->width = 0; - ib->conf->anchor = 0.5; - ib->conf->handle = 0.5; - for (l = ib->boxs; l; l = l->next) - { - IBox_Box *ibb; - - ibb = l->data; - _ibox_box_edge_change(ibb, ib->conf->edge); - } - } - e_config_save_queue(); -} - -static void -_ibox_box_iconsize_change(IBox_Box *ibb) -{ - Evas_List *l; - - _ibox_box_frame_resize(ibb); - - for (l = ibb->icons; l; l = l->next) - { - IBox_Icon *ic; - - ic = l->data; - _ibox_box_icon_resize(ic); - } - _ibox_box_convert_move_resize_to_config(ibb); -} - -static IBox_Icon * -_ibox_box_icon_find(IBox_Box *ibb, E_App *a) -{ - Evas_List *l; - - for (l = ibb->icons; l; l = l->next) - { - IBox_Icon *ic; - - ic = l->data; - if (ic->app == a) return ic; - } - return NULL; -} - -static void -_ibox_box_icon_del(IBox_Icon *ic) -{ - 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); - 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)); - e_object_unref(E_OBJECT(ic->border)); - free(ic); -} - -static IBox_Icon * -_ibox_box_icon_new(IBox_Box *ibb, E_App *a, E_Border *bd) -{ - IBox_Icon *ic; - char *str; - Evas_Object *o; - Evas_Coord bw, bh; - - ic = calloc(1, sizeof(IBox_Icon)); - if (!ic) return NULL; - ic->ibb = ibb; - ic->app = a; - e_object_ref(E_OBJECT(a)); - ic->border = bd; - e_object_ref(E_OBJECT(bd)); - 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); - evas_object_clip_set(o, evas_object_clip_get(ibb->base_object)); - evas_object_color_set(o, 0, 0, 0, 0); - evas_object_repeat_events_set(o, 1); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, _ibox_cb_icon_in, ic); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT, _ibox_cb_icon_out, ic); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _ibox_cb_icon_down, ic); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _ibox_cb_icon_up, ic); - evas_object_show(o); - - o = edje_object_add(ibb->evas); - ic->bg_object = o; - evas_object_intercept_move_callback_add(o, _ibox_cb_intercept_icon_move, ic); - evas_object_intercept_resize_callback_add(o, _ibox_cb_intercept_icon_resize, ic); - edje_object_file_set(o, - /* FIXME: "default.edj" needs to come from conf */ - e_path_find(path_themes, "default.edj"), - "modules/ibar/icon"); - edje_object_signal_emit(o, "set_orientation", _ibox_main_orientation[ibb->ibox->conf->edge]); - edje_object_message_signal_process(o); - evas_object_show(o); - - o = edje_object_add(ibb->evas); - ic->icon_object = o; - edje_object_file_set(o, ic->app->path, "icon"); - edje_extern_object_min_size_set(o, ibb->ibox->conf->iconsize, ibb->ibox->conf->iconsize); - edje_object_part_swallow(ic->bg_object, "item", o); - edje_object_size_min_calc(ic->bg_object, &bw, &bh); - evas_object_pass_events_set(o, 1); - evas_object_show(o); - - o = edje_object_add(ibb->evas); - ic->overlay_object = o; - evas_object_intercept_move_callback_add(o, _ibox_cb_intercept_icon_move, ic); - evas_object_intercept_resize_callback_add(o, _ibox_cb_intercept_icon_resize, ic); - edje_object_file_set(o, - /* FIXME: "default.edj" needs to come from conf */ - e_path_find(path_themes, "default.edj"), - "modules/ibar/icon_overlay"); - edje_object_signal_emit(o, "set_orientation", _ibox_main_orientation[ibb->ibox->conf->edge]); - edje_object_message_signal_process(o); - 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); - evas_object_show(o); - - evas_object_raise(ic->event_object); - - e_box_pack_end(ibb->base_object, ic->bg_object); - 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 */ - ); - - str = (char *)edje_object_data_get(ic->icon_object, "raise_on_hilight"); - if (str) - { - if (atoi(str) == 1) ic->raise_on_hilight = 1; - } - - edje_object_signal_emit(ic->bg_object, "passive", ""); - edje_object_signal_emit(ic->overlay_object, "passive", ""); - return ic; -} - -static void -_ibox_box_icon_resize(IBox_Icon *ic) -{ - Evas_Object *o; - Evas_Coord bw, bh; - - e_box_freeze(ic->ibb->base_object); - o = ic->icon_object; - edje_extern_object_min_size_set(o, ic->ibb->ibox->conf->iconsize, ic->ibb->ibox->conf->iconsize); - - evas_object_resize(o, ic->ibb->ibox->conf->iconsize, ic->ibb->ibox->conf->iconsize); - - edje_object_part_swallow(ic->bg_object, "item", o); - 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->base_object); -} - -static void -_ibox_box_icon_reorder_before(IBox_Icon *ic, IBox_Icon *before) -{ - Evas_Coord bw, bh; - - e_box_freeze(ic->ibb->base_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->base_object, ic->bg_object, before->bg_object); - } - else - { - ic->ibb->icons = evas_list_prepend(ic->ibb->icons, ic); - e_box_pack_start(ic->ibb->base_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->base_object); -} - -static void -_ibox_box_icon_reorder_after(IBox_Icon *ic, IBox_Icon *after) -{ - Evas_Coord bw, bh; - - e_box_freeze(ic->ibb->base_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->base_object, ic->bg_object, after->bg_object); - } - else - { - ic->ibb->icons = evas_list_append(ic->ibb->icons, ic); - e_box_pack_end(ic->ibb->base_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->base_object); -} - -static void -_ibox_box_frame_resize(IBox_Box *ibb) -{ - Evas_Coord ww, hh, bw, bh; - Evas_Object *o; - - evas_event_freeze(ibb->evas); - e_box_freeze(ibb->base_object); - - evas_output_viewport_get(ibb->evas, NULL, NULL, &ww, &hh); - o = ibb->box_object; - if (ibb->ibox->conf->width < 0) - { - if ((ibb->ibox->conf->edge == EDGE_BOTTOM) || - (ibb->ibox->conf->edge == EDGE_TOP)) - e_box_orientation_set(ibb->base_object, 1); - else if ((ibb->ibox->conf->edge == EDGE_LEFT) || - (ibb->ibox->conf->edge == EDGE_RIGHT)) - e_box_orientation_set(ibb->base_object, 0); - - e_box_min_size_get(ibb->base_object, &bw, &bh); - edje_extern_object_min_size_set(ibb->base_object, bw, bh); - edje_object_part_swallow(o, "items", ibb->base_object); - edje_object_size_min_calc(o, &bw, &bh); - if ((ibb->ibox->conf->edge == EDGE_BOTTOM) || - (ibb->ibox->conf->edge == EDGE_TOP)) - { - if (bw > ww) bw = ww; - } - else if ((ibb->ibox->conf->edge == EDGE_LEFT) || - (ibb->ibox->conf->edge == EDGE_RIGHT)) - { - if (bh > hh) bh = hh; - } - } - else if (ibb->ibox->conf->width == 0) - { - if ((ibb->ibox->conf->edge == EDGE_BOTTOM) || - (ibb->ibox->conf->edge == EDGE_TOP)) - { - e_box_orientation_set(ibb->base_object, 1); - e_box_min_size_get(ibb->base_object, &bw, &bh); - edje_extern_object_min_size_set(ibb->base_object, ww, bh); - } - else if ((ibb->ibox->conf->edge == EDGE_LEFT) || - (ibb->ibox->conf->edge == EDGE_RIGHT)) - { - e_box_orientation_set(ibb->base_object, 0); - e_box_min_size_get(ibb->base_object, &bw, &bh); - edje_extern_object_min_size_set(ibb->base_object, bw, hh); - } - - edje_object_part_swallow(o, "items", ibb->base_object); - edje_object_size_min_calc(o, &bw, &bh); - } - else - { - if ((ibb->ibox->conf->edge == EDGE_BOTTOM) || - (ibb->ibox->conf->edge == EDGE_TOP)) - { - e_box_orientation_set(ibb->base_object, 1); - e_box_min_size_get(ibb->base_object, &bw, &bh); - edje_extern_object_min_size_set(ibb->base_object, ibb->ibox->conf->width, bh); - edje_object_part_swallow(o, "items", ibb->base_object); - edje_object_size_min_calc(o, &bw, &bh); - edje_extern_object_min_size_set(ibb->base_object, 0, 0); - edje_object_part_swallow(o, "items", ibb->base_object); - } - else if ((ibb->ibox->conf->edge == EDGE_LEFT) || - (ibb->ibox->conf->edge == EDGE_RIGHT)) - { - e_box_orientation_set(ibb->base_object, 0); - e_box_min_size_get(ibb->base_object, &bw, &bh); - edje_extern_object_min_size_set(ibb->base_object, bw, ibb->ibox->conf->width); - edje_object_part_swallow(o, "items", ibb->base_object); - edje_object_size_min_calc(o, &bw, &bh); - edje_extern_object_min_size_set(ibb->base_object, 0, 0); - edje_object_part_swallow(o, "items", ibb->base_object); - } - if ((ibb->ibox->conf->edge == EDGE_BOTTOM) || - (ibb->ibox->conf->edge == EDGE_TOP)) - { - if (bw > ww) bw = bw; - } - else if ((ibb->ibox->conf->edge == EDGE_LEFT) || - (ibb->ibox->conf->edge == EDGE_RIGHT)) - { - if (bh > hh) bh = hh; - } - } - - if ((ibb->ibox->conf->edge == EDGE_BOTTOM) || - (ibb->ibox->conf->edge == EDGE_TOP)) - ibb->maxsize = bh; - else if ((ibb->ibox->conf->edge == EDGE_LEFT) || - (ibb->ibox->conf->edge == EDGE_RIGHT)) - ibb->maxsize = bw; - - ibb->w = bw; - ibb->h = bh; - if (ibb->ibox->conf->edge == EDGE_BOTTOM) - { - ibb->x = (ww * ibb->ibox->conf->anchor) - (bw * ibb->ibox->conf->handle); - ibb->y = hh - bh; - } - else if (ibb->ibox->conf->edge == EDGE_TOP) - { - ibb->x = (ww * ibb->ibox->conf->anchor) - (bw * ibb->ibox->conf->handle); - ibb->y = 0; - } - else if (ibb->ibox->conf->edge == EDGE_LEFT) - { - ibb->y = (hh * ibb->ibox->conf->anchor) - (bh * ibb->ibox->conf->handle); - ibb->x = 0; - } - else if (ibb->ibox->conf->edge == EDGE_RIGHT) - { - ibb->y = (hh * ibb->ibox->conf->anchor) - (bh * ibb->ibox->conf->handle); - ibb->x = ww - bw; - } - - _ibox_box_reconfigure(ibb); - - e_box_thaw(ibb->base_object); - - _ibox_box_follower_reset(ibb); - _ibox_timer_handle(ibb); - - evas_event_thaw(ibb->evas); -} - -static void -_ibox_box_init(IBox_Box *ibb) -{ - Evas_List *l; - Evas_Coord bw, bh; - Evas_Object *o; - - ibb->ev_handler_container_resize = - ecore_event_handler_add(E_EVENT_CONTAINER_RESIZE, - _ibox_cb_event_container_resize, - ibb); - evas_event_freeze(ibb->evas); - o = edje_object_add(ibb->evas); - ibb->box_object = o; - edje_object_file_set(o, - /* FIXME: "default.edj" needs to come from conf */ - e_path_find(path_themes, "default.edj"), - "modules/ibar/main"); - edje_object_signal_emit(o, "set_orientation", _ibox_main_orientation[ibb->ibox->conf->edge]); - edje_object_message_signal_process(o); - edje_object_signal_callback_add(o, "move_start", "", _ibox_cb_box_move_start, ibb); - edje_object_signal_callback_add(o, "move_stop", "", _ibox_cb_box_move_stop, ibb); - edje_object_signal_callback_add(o, "resize1_start", "", _ibox_cb_box_resize1_start, ibb); - edje_object_signal_callback_add(o, "resize1_stop", "", _ibox_cb_box_resize1_stop, ibb); - edje_object_signal_callback_add(o, "resize2_start", "", _ibox_cb_box_resize2_start, ibb); - edje_object_signal_callback_add(o, "resize2_stop", "", _ibox_cb_box_resize2_stop, ibb); - edje_object_signal_callback_add(o, "mouse,move", "*", _ibox_cb_box_move_go, ibb); - evas_object_show(o); - - o = edje_object_add(ibb->evas); - ibb->overlay_object = o; - evas_object_layer_set(o, 1); - edje_object_file_set(o, - /* FIXME: "default.edj" needs to come from conf */ - e_path_find(path_themes, "default.edj"), - "modules/ibar/follower"); - edje_object_signal_emit(o, "set_orientation", _ibox_main_orientation[ibb->ibox->conf->edge]); - edje_object_message_signal_process(o); - evas_object_show(o); - - o = evas_object_rectangle_add(ibb->evas); - ibb->event_object = o; - evas_object_layer_set(o, 2); - evas_object_repeat_events_set(o, 1); - evas_object_color_set(o, 0, 0, 0, 0); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, _ibox_cb_box_in, ibb); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT, _ibox_cb_box_out, ibb); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _ibox_cb_box_down, ibb); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _ibox_cb_box_up, ibb); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_MOVE, _ibox_cb_box_move, ibb); - evas_object_show(o); - - o = e_box_add(ibb->evas); - ibb->base_object = o; - evas_object_intercept_move_callback_add(o, _ibox_cb_intercept_box_move, ibb); - evas_object_intercept_resize_callback_add(o, _ibox_cb_intercept_box_resize, ibb); - e_box_freeze(o); - edje_object_part_swallow(ibb->box_object, "items", o); - evas_object_show(o); - - edje_object_size_min_calc(ibb->box_object, &bw, &bh); - if ((ibb->ibox->conf->edge == EDGE_BOTTOM) || - (ibb->ibox->conf->edge == EDGE_TOP)) - ibb->minsize = bh; - else if ((ibb->ibox->conf->edge == EDGE_BOTTOM) || - (ibb->ibox->conf->edge == EDGE_TOP)) - ibb->minsize = bw; - - /* FIXME search for iconified apps */ -/* - if (ibb->ibox->apps) - { - for (l = ibb->ibox->apps->subapps; l; l = l->next) - { - E_App *a; - IBox_Icon *ic; - - a = l->data; - ic = _ibox_box_icon_new(ibb, a); - } - } -*/ - ibb->align_req = 0.5; - ibb->align = 0.5; - e_box_align_set(ibb->base_object, 0.5, 0.5); - - _ibox_box_frame_resize(ibb); - - e_box_thaw(ibb->base_object); - - _ibox_box_follower_reset(ibb); - _ibox_timer_handle(ibb); - - evas_event_thaw(ibb->evas); - -// edje_object_signal_emit(ibb->box_object, "passive", ""); -// edje_object_signal_emit(ibb->overlay_object, "passive", ""); -} - -static void -_ibox_box_free(IBox_Box *ibb) -{ - ecore_event_handler_del(ibb->ev_handler_container_resize); - while (ibb->icons) - { - IBox_Icon *ic; - - ic = ibb->icons->data; - _ibox_box_icon_del(ic); - } - if (ibb->timer) ecore_timer_del(ibb->timer); - if (ibb->animator) ecore_animator_del(ibb->animator); - evas_object_del(ibb->box_object); - evas_object_del(ibb->overlay_object); - evas_object_del(ibb->base_object); - evas_object_del(ibb->event_object); - free(ibb); -} - -static void -_ibox_motion_handle(IBox_Box *ibb, Evas_Coord mx, Evas_Coord my) -{ - Evas_Coord x, y, w, h; - double relx, rely; - - evas_object_geometry_get(ibb->base_object, &x, &y, &w, &h); - 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; - if ((ibb->ibox->conf->edge == EDGE_BOTTOM) || - (ibb->ibox->conf->edge == EDGE_TOP)) - { - ibb->align_req = 1.0 - relx; - ibb->follow_req = relx; - } - else if ((ibb->ibox->conf->edge == EDGE_LEFT) || - (ibb->ibox->conf->edge == EDGE_RIGHT)) - { - ibb->align_req = 1.0 - rely; - ibb->follow_req = rely; - } -} - -static void -_ibox_timer_handle(IBox_Box *ibb) -{ - if (!ibb->timer) - ibb->timer = ecore_timer_add(0.01, _ibox_cb_box_timer, ibb); - if (!ibb->animator) - ibb->animator = ecore_animator_add(_ibox_cb_box_animator, ibb); -} - -static void -_ibox_box_reconfigure(IBox_Box *ibb) -{ - evas_object_move(ibb->box_object, ibb->x, ibb->y); - evas_object_resize(ibb->box_object, ibb->w, ibb->h); - _ibox_timer_handle(ibb); -} - -static void -_ibox_box_follower_reset(IBox_Box *ibb) -{ - Evas_Coord ww, hh, bx, by, bw, bh, d1, d2, mw, mh; - - evas_output_viewport_get(ibb->evas, NULL, NULL, &ww, &hh); - evas_object_geometry_get(ibb->base_object, &bx, &by, &bw, &bh); - edje_object_size_min_get(ibb->overlay_object, &mw, &mh); - if ((ibb->ibox->conf->edge == EDGE_BOTTOM) || - (ibb->ibox->conf->edge == EDGE_TOP)) - { - 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); - } - } - else if ((ibb->ibox->conf->edge == EDGE_LEFT) || - (ibb->ibox->conf->edge == EDGE_RIGHT)) - { - 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 -_ibox_box_convert_move_resize_to_config(IBox_Box *ibb) -{ - Evas_Coord bx, by, bw, bh, bbx, bby, bbw, bbh, ww, hh; - - evas_output_viewport_get(ibb->evas, NULL, NULL, &ww, &hh); - evas_object_geometry_get(ibb->base_object, &bx, &by, &bw, &bh); - evas_object_geometry_get(ibb->box_object, &bbx, &bby, &bbw, &bbh); - - if ((ibb->ibox->conf->edge == EDGE_BOTTOM) || - (ibb->ibox->conf->edge == EDGE_TOP)) - { - double a = 0.5; - - if (ibb->ibox->conf->width < 0) /* auto size to fit */ - { - if ((ww - ibb->w) != 0) - a = (double)ibb->x / (double)(ww - ibb->w); - else - a = 0.5; - } - else if (ibb->ibox->conf->width == 0) /* full width */ - { - } - else - { - ibb->ibox->conf->width = ibb->w - (bbw - bw); - if ((ww - ibb->w) != 0) - a = (double)ibb->x / (double)(ww - ibb->w); - else - a = 0.5; - } - ibb->ibox->conf->anchor = a; - ibb->ibox->conf->handle = a; - } - else if ((ibb->ibox->conf->edge == EDGE_LEFT) || - (ibb->ibox->conf->edge == EDGE_RIGHT)) - { - double a = 0.5; - - if (ibb->ibox->conf->width < 0) /* auto size to fit */ - { - if ((hh - ibb->h) != 0) - a = (double)ibb->y / (double)(hh - ibb->h); - else - a = 0.5; - } - else if (ibb->ibox->conf->width == 0) /* full width */ - { - } - else - { - ibb->ibox->conf->width = ibb->h - (bbh - bh); - if ((hh - ibb->h) != 0) - a = (double)ibb->y / (double)(hh - ibb->h); - else - a = 0.5; - } - ibb->ibox->conf->anchor = a; - ibb->ibox->conf->handle = a; - } - e_config_save_queue(); -} - -static void -_ibox_box_edge_change(IBox_Box *ibb, int edge) -{ - Evas_List *l; - Evas_Coord ww, hh, bw, bh; - Evas_Object *o; - - ibb->ibox->conf->edge = edge; - - evas_event_freeze(ibb->evas); - o = ibb->box_object; - edje_object_signal_emit(o, "set_orientation", _ibox_main_orientation[ibb->ibox->conf->edge]); - edje_object_message_signal_process(o); - - o = ibb->overlay_object; - edje_object_signal_emit(o, "set_orientation", _ibox_main_orientation[ibb->ibox->conf->edge]); - edje_object_message_signal_process(o); - - e_box_freeze(ibb->base_object); - - edje_object_size_min_calc(ibb->box_object, &bw, &bh); - if ((ibb->ibox->conf->edge == EDGE_BOTTOM) || - (ibb->ibox->conf->edge == EDGE_TOP)) - ibb->minsize = bh; - else if ((ibb->ibox->conf->edge == EDGE_BOTTOM) || - (ibb->ibox->conf->edge == EDGE_TOP)) - ibb->minsize = bw; - - for (l = ibb->icons; l; l = l->next) - { - IBox_Icon *ic; - - ic = l->data; - o = ic->bg_object; - edje_object_signal_emit(o, "set_orientation", _ibox_main_orientation[ibb->ibox->conf->edge]); - edje_object_message_signal_process(o); - edje_object_size_min_calc(ic->bg_object, &bw, &bh); - - o = ic->overlay_object; - edje_object_signal_emit(o, "set_orientation", _ibox_main_orientation[ibb->ibox->conf->edge]); - edje_object_message_signal_process(o); - - 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 */ - ); - } - evas_output_viewport_get(ibb->evas, NULL, NULL, &ww, &hh); - - ibb->align_req = 0.5; - ibb->align = 0.5; - e_box_align_set(ibb->base_object, 0.5, 0.5); - - _ibox_box_frame_resize(ibb); - - e_box_thaw(ibb->base_object); - - _ibox_box_follower_reset(ibb); - _ibox_timer_handle(ibb); - - evas_event_thaw(ibb->evas); -} - -static void -_ibox_cb_intercept_icon_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y) -{ - IBox_Icon *ic; - - 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 -_ibox_cb_intercept_icon_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h) -{ - IBox_Icon *ic; - - 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 -_ibox_cb_intercept_box_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y) -{ - IBox_Box *ibb; - - ibb = data; - evas_object_move(o, x, y); - evas_object_move(ibb->event_object, x, y); -} - -static void -_ibox_cb_intercept_box_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h) -{ - IBox_Box *ibb; - - ibb = data; - - evas_object_resize(o, w, h); - evas_object_resize(ibb->event_object, w, h); -} - -static void -_ibox_cb_icon_in(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - Evas_Event_Mouse_In *ev; - IBox_Icon *ic; - - 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", ""); - edje_object_signal_emit(ic->ibb->overlay_object, "active", ""); -} - -static void -_ibox_cb_icon_out(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - Evas_Event_Mouse_Out *ev; - IBox_Icon *ic; - - ev = event_info; - ic = data; - edje_object_signal_emit(ic->bg_object, "passive", ""); - edje_object_signal_emit(ic->overlay_object, "passive", ""); - edje_object_signal_emit(ic->ibb->overlay_object, "passive", ""); -} - -static void -_ibox_cb_icon_down(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - Evas_Event_Mouse_Down *ev; - IBox_Icon *ic; - - ev = event_info; - ic = data; - if (ev->button == 1) - { - edje_object_signal_emit(ic->bg_object, "start", ""); - edje_object_signal_emit(ic->overlay_object, "start", ""); - edje_object_signal_emit(ic->ibb->overlay_object, "start", ""); - e_border_uniconify(ic->border); - } -} - -static void -_ibox_cb_icon_up(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - Evas_Event_Mouse_Up *ev; - IBox_Icon *ic; - - ev = event_info; - ic = data; - if (ev->button == 1) - { - edje_object_signal_emit(ic->bg_object, "start_end", ""); - edje_object_signal_emit(ic->overlay_object, "start_end", ""); - edje_object_signal_emit(ic->ibb->overlay_object, "start_end", ""); - } -} - -static void -_ibox_cb_box_in(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - Evas_Event_Mouse_In *ev; - IBox_Box *ibb; - - ev = event_info; - ibb = data; - edje_object_signal_emit(ibb->overlay_object, "active", ""); - _ibox_motion_handle(ibb, ev->canvas.x, ev->canvas.y); - _ibox_timer_handle(ibb); -} - -static void -_ibox_cb_box_out(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - Evas_Event_Mouse_Out *ev; - IBox_Box *ibb; - - ev = event_info; - ibb = data; - edje_object_signal_emit(ibb->overlay_object, "passive", ""); - _ibox_box_follower_reset(ibb); - _ibox_timer_handle(ibb); -} - -static void -_ibox_cb_box_down(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - Evas_Event_Mouse_Down *ev; - IBox_Box *ibb; - - ev = event_info; - ibb = data; - if (ev->button == 3) - { - e_menu_activate_mouse(ibb->ibox->config_menu, e_zone_current_get(ibb->con), - ev->output.x, ev->output.y, 1, 1, - E_MENU_POP_DIRECTION_DOWN); - e_util_container_fake_mouse_up_all_later(ibb->con); - } -} - -static void -_ibox_cb_box_up(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - Evas_Event_Mouse_Up *ev; - IBox_Box *ibb; - - ev = event_info; - ibb = data; -} - -static void -_ibox_cb_box_move(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - Evas_Event_Mouse_Move *ev; - IBox_Box *ibb; - - ev = event_info; - ibb = data; - _ibox_motion_handle(ibb, ev->cur.canvas.x, ev->cur.canvas.y); - _ibox_timer_handle(ibb); -} - -static int -_ibox_cb_box_timer(void *data) -{ - IBox_Box *ibb; - double dif, dif2; - double v; - - ibb = data; - v = ibb->ibox->conf->autoscroll_speed; - ibb->align = (ibb->align_req * (1.0 - v)) + (ibb->align * v); - v = ibb->ibox->conf->follow_speed; - 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 -_ibox_cb_box_animator(void *data) -{ - IBox_Box *ibb; - Evas_Coord x, y, w, h, mw, mh; - - ibb = data; - - if ((ibb->ibox->conf->edge == EDGE_BOTTOM) || - (ibb->ibox->conf->edge == EDGE_TOP)) - { - e_box_align_set(ibb->base_object, ibb->align, 0.5); - - evas_object_geometry_get(ibb->base_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); - } - else if ((ibb->ibox->conf->edge == EDGE_LEFT) || - (ibb->ibox->conf->edge == EDGE_RIGHT)) - { - e_box_align_set(ibb->base_object, 0.5, ibb->align); - - evas_object_geometry_get(ibb->base_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)); - } - if (ibb->timer) return 1; - ibb->animator = NULL; - return 0; -} - -static void -_ibox_cb_box_move_start(void *data, Evas_Object *obj, const char *emission, const char *source) -{ - IBox_Box *ibb; - - ibb = data; - if (ibb->ibox->conf->width == 0) return; - ibb->move = 1; - evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &ibb->start_x, &ibb->start_y); - ibb->start_bx = ibb->x; - ibb->start_by = ibb->y; - ibb->start_bw = ibb->w; - ibb->start_bh = ibb->h; -} - -static void -_ibox_cb_box_move_stop(void *data, Evas_Object *obj, const char *emission, const char *source) -{ - IBox_Box *ibb; - - ibb = data; - if (ibb->move) - { - _ibox_box_convert_move_resize_to_config(ibb); - ibb->move = 0; - } -} - -static void -_ibox_cb_box_resize1_start(void *data, Evas_Object *obj, const char *emission, const char *source) -{ - IBox_Box *ibb; - - ibb = data; - if (ibb->ibox->conf->width <= 0) return; - ibb->resize1 = 1; - evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &ibb->start_x, &ibb->start_y); - ibb->start_bx = ibb->x; - ibb->start_by = ibb->y; - ibb->start_bw = ibb->w; - ibb->start_bh = ibb->h; -} - -static void -_ibox_cb_box_resize1_stop(void *data, Evas_Object *obj, const char *emission, const char *source) -{ - IBox_Box *ibb; - - ibb = data; - if (ibb->resize1) - { - _ibox_box_convert_move_resize_to_config(ibb); - ibb->resize1 = 0; - } -} - -static void -_ibox_cb_box_resize2_start(void *data, Evas_Object *obj, const char *emission, const char *source) -{ - IBox_Box *ibb; - - ibb = data; - if (ibb->ibox->conf->width <= 0) return; - ibb->resize2 = 1; - evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &ibb->start_x, &ibb->start_y); - ibb->start_bx = ibb->x; - ibb->start_by = ibb->y; - ibb->start_bw = ibb->w; - ibb->start_bh = ibb->h; -} - -static void -_ibox_cb_box_resize2_stop(void *data, Evas_Object *obj, const char *emission, const char *source) -{ - IBox_Box *ibb; - - ibb = data; - if (ibb->resize2) - { - _ibox_box_convert_move_resize_to_config(ibb); - ibb->resize2 = 0; - } -} - -static void -_ibox_cb_box_move_go(void *data, Evas_Object *obj, const char *emission, const char *source) -{ - IBox_Box *ibb; - - ibb = data; - if (ibb->move) - { - Evas_Coord x, y, bx, by, bw, bh, ww, hh; - int edge; - double xr, yr; - int edge_done; - - edge_done = 0; - do_pos: - evas_output_viewport_get(ibb->evas, NULL, NULL, &ww, &hh); - evas_object_geometry_get(ibb->box_object, &bx, &by, &bw, &bh); - evas_pointer_canvas_xy_get(ibb->evas, &x, &y); - if ((ibb->ibox->conf->edge == EDGE_BOTTOM) || - (ibb->ibox->conf->edge == EDGE_TOP)) - { - Evas_Coord d; - - d = x - ibb->start_x; - ibb->x = ibb->start_bx + d; - if (ibb->x < 0) ibb->x = 0; - else if ((ibb->x + ibb->w) > ww) ibb->x = ww - ibb->w; - } - else if ((ibb->ibox->conf->edge == EDGE_LEFT) || - (ibb->ibox->conf->edge == EDGE_RIGHT)) - { - Evas_Coord d; - - d = y - ibb->start_y; - ibb->y = ibb->start_by + d; - if (ibb->y < 0) ibb->y = 0; - else if ((ibb->y + ibb->h) > hh) ibb->y = hh - ibb->h; - } - - if (!edge_done) - { - edge = ibb->ibox->conf->edge; - xr = (double)x / (double)ww; - yr = (double)y / (double)hh; - if ((xr + yr) <= 1.0) /* top or left */ - { - if (((1.0 - yr) + xr) <= 1.0) edge = EDGE_LEFT; - else edge = EDGE_TOP; - } - else /* bottom or right */ - { - if (((1.0 - yr) + xr) <= 1.0) edge = EDGE_BOTTOM; - else edge = EDGE_RIGHT; - } - if (edge != ibb->ibox->conf->edge) - { - _ibox_box_edge_change(ibb, edge); - edge_done = 1; - goto do_pos; - } - } - _ibox_box_reconfigure(ibb); - _ibox_box_follower_reset(ibb); - _ibox_timer_handle(ibb); - return; - } - else if (ibb->resize1) - { - Evas_Coord x, y, bx, by, bw, bh, bbx, bby, bbw, bbh, ww, hh; - - evas_output_viewport_get(ibb->evas, NULL, NULL, &ww, &hh); - evas_object_geometry_get(ibb->base_object, &bx, &by, &bw, &bh); - evas_object_geometry_get(ibb->box_object, &bbx, &bby, &bbw, &bbh); - evas_pointer_canvas_xy_get(ibb->evas, &x, &y); - if ((ibb->ibox->conf->edge == EDGE_BOTTOM) || - (ibb->ibox->conf->edge == EDGE_TOP)) - { - Evas_Coord d; - - d = x - ibb->start_x; - ibb->x = ibb->start_bx + d; - ibb->w = ibb->start_bw - d; - if (ibb->w < (bbw - bw + ibb->ibox->conf->iconsize)) - { - ibb->x += ibb->w - (bbw - bw + ibb->ibox->conf->iconsize); - ibb->w = bbw - bw + ibb->ibox->conf->iconsize; - } - else if (ibb->w > ww) - { - ibb->x += (ibb->w - ww); - ibb->w = ww; - } - if (ibb->x < 0) - { - ibb->w += ibb->x; - ibb->x = 0; - } - else if ((ibb->x + ibb->w) > ww) - { - ibb->x = ww - ibb->w; - } - } - else if ((ibb->ibox->conf->edge == EDGE_LEFT) || - (ibb->ibox->conf->edge == EDGE_RIGHT)) - { - Evas_Coord d; - - d = y - ibb->start_y; - ibb->y = ibb->start_by + d; - ibb->h = ibb->start_bh - d; - if (ibb->h < (bbh - bh + ibb->ibox->conf->iconsize)) - { - ibb->y += ibb->h - (bbh - bh + ibb->ibox->conf->iconsize); - ibb->h = bbh - bh + ibb->ibox->conf->iconsize; - } - else if (ibb->h > hh) - { - ibb->y += (ibb->h - hh); - ibb->h = hh; - } - if (ibb->y < 0) - { - ibb->h += ibb->y; - ibb->y = 0; - } - else if ((ibb->y + ibb->h) > hh) - { - ibb->y = hh - ibb->h; - } - } - _ibox_box_reconfigure(ibb); - _ibox_box_follower_reset(ibb); - _ibox_timer_handle(ibb); - return; - } - else if (ibb->resize2) - { - Evas_Coord x, y, bx, by, bw, bh, bbx, bby, bbw, bbh, ww, hh; - - evas_output_viewport_get(ibb->evas, NULL, NULL, &ww, &hh); - evas_object_geometry_get(ibb->base_object, &bx, &by, &bw, &bh); - evas_object_geometry_get(ibb->box_object, &bbx, &bby, &bbw, &bbh); - evas_pointer_canvas_xy_get(ibb->evas, &x, &y); - if ((ibb->ibox->conf->edge == EDGE_BOTTOM) || - (ibb->ibox->conf->edge == EDGE_TOP)) - { - Evas_Coord d; - - d = x - ibb->start_x; - ibb->w = ibb->start_bw + d; - if (ibb->w < (bbw - bw + ibb->ibox->conf->iconsize)) - { - ibb->w = bbw - bw + ibb->ibox->conf->iconsize; - } - else if (ibb->w > ww) - { - ibb->w = ww; - } - if ((ibb->x + ibb->w) > ww) - { - ibb->w = ww - ibb->x; - } - } - else if ((ibb->ibox->conf->edge == EDGE_LEFT) || - (ibb->ibox->conf->edge == EDGE_RIGHT)) - { - Evas_Coord d; - - d = y - ibb->start_y; - ibb->h = ibb->start_bh + d; - if (ibb->h < (bbh - bh + ibb->ibox->conf->iconsize)) - { - ibb->h = bbh - bh + ibb->ibox->conf->iconsize; - } - else if (ibb->h > hh) - { - ibb->h = hh; - } - if ((ibb->y + ibb->h) > hh) - { - ibb->h = hh - ibb->y; - } - } - _ibox_box_reconfigure(ibb); - _ibox_box_follower_reset(ibb); - _ibox_timer_handle(ibb); - return; - } -} - -static int -_ibox_cb_event_container_resize(void *data, int type, void *event) -{ - IBox_Box *ibb; - - ibb = data; - _ibox_box_frame_resize(ibb); - return 1; -} - -static int -_ibox_cb_event_border_iconify(void *data, int type, void *event) -{ - IBox *ib; - IBox_Box *ibb; - E_App *app; - E_Event_Border_Hide *e; - - e = event; - ib = data; - ibb = ib->boxs->data; - app = e_app_window_name_class_find(e->border->client.icccm.name, - e->border->client.icccm.class); - if (app) - { - _ibox_box_icon_new(ibb, app, e->border); - _ibox_box_convert_move_resize_to_config(ibb); - _ibox_box_frame_resize(ibb); - } - else - printf("FIXME WE HAVE NO ICON TO DISPLAY\n"); - return 1; -} - -static int -_ibox_cb_event_border_uniconify(void *data, int type, void *event) -{ - IBox *ib; - IBox_Box *ibb; - E_Event_Border_Show *e; - Evas_List *icons; - IBox_Icon *icon; - - ib = data; - ibb = ib->boxs->data; - e = event; - - icons = ((IBox_Box *)ib->boxs->data)->icons; - while (icons) - { - icon = icons->data; - if (icon->border == e->border) - { - _ibox_box_icon_del(icon); - _ibox_box_convert_move_resize_to_config(ibb); - _ibox_box_frame_resize(ibb); - break; - } - icons = icons->next; - } - return 1; -} - diff --git a/src/modules/ibox/e_mod_main.h b/src/modules/ibox/e_mod_main.h deleted file mode 100644 index 88b0f0f51..000000000 --- a/src/modules/ibox/e_mod_main.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef E_MOD_MAIN_H -#define E_MOD_MAIN_H - -typedef struct _Config Config; -typedef struct _IBox IBox; -typedef struct _IBox_Box IBox_Box; -typedef struct _IBox_Icon IBox_Icon; - -struct _Config -{ - double follow_speed; - double autoscroll_speed; - int width; - int iconsize; - int edge; - double anchor; - double handle; - char autohide; -}; - -struct _IBox -{ - Evas_List *boxs; - E_Menu *config_menu; - - E_Config_DD *conf_edd; - Config *conf; -}; - -struct _IBox_Box -{ - IBox *ibox; - E_Container *con; - Evas *evas; - - Evas_Object *box_object; - Evas_Object *overlay_object; - Evas_Object *base_object; - Evas_Object *event_object; - - Evas_List *icons; - - Evas_Coord minsize, maxsize; - - double align, align_req; - double follow, follow_req; - Ecore_Timer *timer; - Ecore_Animator *animator; - - Evas_Coord x, y, w, h; - - unsigned char move : 1; - unsigned char resize1 : 1; - unsigned char resize2 : 1; - Evas_Coord start_x, start_y; - Evas_Coord start_bx, start_by, start_bw, start_bh; - - Ecore_Event_Handler *ev_handler_container_resize; -}; - -struct _IBox_Icon -{ - IBox_Box *ibb; - E_App *app; - Evas_Object *bg_object; - Evas_Object *overlay_object; - Evas_Object *icon_object; - Evas_Object *event_object; - Evas_List *extra_icons; - E_Border *border; - - unsigned char raise_on_hilight : 1; -}; - -#define EDGE_BOTTOM 0 -#define EDGE_TOP 1 -#define EDGE_LEFT 2 -#define EDGE_RIGHT 3 - -EAPI void *init (E_Module *m); -EAPI int shutdown (E_Module *m); -EAPI int save (E_Module *m); -EAPI int info (E_Module *m); -EAPI int about (E_Module *m); - -#endif diff --git a/src/modules/ibox/module_icon.png b/src/modules/ibox/module_icon.png deleted file mode 100644 index f81e8aa347616537aac01f72bdc1b5c02df9f893..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 734 zcmV<40wMj0P)IbhtOOC;K&(a58nY53#2Aelc9&shKeIbC zckemJVt10+#1t#o<-lR?y)f@H=e%<+oX2^b$EjFZSs@HV%nUOFI9i{TNs_R$v%})z z;z_ybQ{pFI22e9Z1m_%a9MkLdI6OS0+v(71wFrWM{h#}6eAuA$q?DJO86zw#EF5qA zFR2{c%y^)u^HU=mbizD$}&Gxy${W!05aSRYe z5yk7D!LP&MD`)^f>QYQ?)S}_nXO)NuX`0e*w`sTAM2*JTF28y8lt&L+5PyWE0p0-+ z)C1HMGegx-%_8k~@B1DYsAVP( zd#^GCIp>I?h)Six>gsA0Xo50&18%D<>h5_&e_t^lBueB z@69=9Ns?HtRh(I+YL$b70~(Epxw$!jI}-x@ zu?N-y_X1>-IF9k&{dL_C9mBZ``= zyi^6Kb(Drd3+pMclE{=Wb+$fZ$LQzvH|@IX4@U-bXu4}$Z*{AyQh Q3IG5A07*qoM6N<$g62m-JOBUy diff --git a/src/modules/pager/e_mod_main.c b/src/modules/pager/e_mod_main.c index e8be30f7a..701f179c2 100644 --- a/src/modules/pager/e_mod_main.c +++ b/src/modules/pager/e_mod_main.c @@ -76,11 +76,11 @@ init(E_Module *module) /* check module api version */ if (module->api->version < E_MODULE_API_VERSION) { - e_error_dialog_show("Module API Error", - "Error initializing Module: Pager\n" - "It requires a minimum module API version of: %i.\n" - "The module API advertized by Enlightenment is: %i.\n" - "Aborting module.", + e_error_dialog_show(_("Module API Error"), + _("Error initializing Module: Pager\n" + "It requires a minimum module API version of: %i.\n" + "The module API advertized by Enlightenment is: %i.\n" + "Aborting module."), E_MODULE_API_VERSION, module->api->version); return NULL; @@ -123,7 +123,7 @@ info(E_Module *module) { char buf[4096]; - module->label = strdup("Pager"); + module->label = strdup(_("Pager")); snprintf(buf, sizeof(buf), "%s/module_icon.png", e_module_dir_get(module)); module->icon_file = strdup(buf); return 1; @@ -132,8 +132,8 @@ info(E_Module *module) int about(E_Module *module) { - e_error_dialog_show("Enlightenment Pager Module", - "A pager module to navigate virtual desktops."); + e_error_dialog_show(_("Enlightenment Pager Module"), + _("A pager module to navigate virtual desktops.")); return 1; } diff --git a/src/modules/temperature/e_mod_main.c b/src/modules/temperature/e_mod_main.c index b8e612c35..6c3072710 100644 --- a/src/modules/temperature/e_mod_main.c +++ b/src/modules/temperature/e_mod_main.c @@ -40,11 +40,11 @@ init(E_Module *m) /* check module api version */ if (m->api->version < E_MODULE_API_VERSION) { - e_error_dialog_show("Module API Error", - "Error initializing Module: Temperature\n" - "It requires a minimum module API version of: %i.\n" - "The module API advertized by Enlightenment is: %i.\n" - "Aborting module.", + e_error_dialog_show(_("Module API Error"), + _("Error initializing Module: Temperature\n" + "It requires a minimum module API version of: %i.\n" + "The module API advertized by Enlightenment is: %i.\n" + "Aborting module."), E_MODULE_API_VERSION, m->api->version); return NULL; @@ -84,7 +84,7 @@ info(E_Module *m) { char buf[4096]; - m->label = strdup("Temperature"); + m->label = strdup(_("Temperature")); snprintf(buf, sizeof(buf), "%s/module_icon.png", e_module_dir_get(m)); m->icon_file = strdup(buf); return 1; @@ -93,10 +93,10 @@ info(E_Module *m) int about(E_Module *m) { - e_error_dialog_show("Enlightenment Temperature Module", - "A module to measure the ACPI Thermal sensor on Linux.\n" - "It is especially useful for modern Laptops with high speed\n" - "CPUs that generate a lot of heat."); + e_error_dialog_show(_("Enlightenment Temperature Module"), + _("A module to measure the ACPI Thermal sensor on Linux.\n" + "It is especially useful for modern Laptops with high speed\n" + "CPUs that generate a lot of heat.")); return 1; } @@ -181,15 +181,15 @@ _temperature_new() /* Add main menu to face menu */ mi = e_menu_item_new(ef->menu); - e_menu_item_label_set(mi, "Check Interval"); + e_menu_item_label_set(mi, _("Check Interval")); e_menu_item_submenu_set(mi, e->config_menu_poll); mi = e_menu_item_new(ef->menu); - e_menu_item_label_set(mi, "Low Temperature"); + e_menu_item_label_set(mi, _("Low Temperature")); e_menu_item_submenu_set(mi, e->config_menu_low); mi = e_menu_item_new(ef->menu); - e_menu_item_label_set(mi, "High Temperature"); + e_menu_item_label_set(mi, _("High Temperature")); e_menu_item_submenu_set(mi, e->config_menu_high); mi = e_menu_item_new(e->config_menu); @@ -457,35 +457,35 @@ _temperature_config_menu_new(Temperature *e) mn = e_menu_new(); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Fast (1 sec)"); + e_menu_item_label_set(mi, _("Fast (1 sec)")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->poll_time == 1.0) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _temperature_menu_fast, e); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Medium (5 sec)"); + e_menu_item_label_set(mi, _("Medium (5 sec)")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->poll_time == 5.0) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _temperature_menu_medium, e); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Normal (10 sec)"); + e_menu_item_label_set(mi, _("Normal (10 sec)")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->poll_time == 10.0) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _temperature_menu_normal, e); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Slow (30 sec)"); + e_menu_item_label_set(mi, _("Slow (30 sec)")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->poll_time == 30.0) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _temperature_menu_slow, e); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Very Slow (60 sec)"); + e_menu_item_label_set(mi, _("Very Slow (60 sec)")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->poll_time == 60.0) e_menu_item_toggle_set(mi, 1); @@ -497,35 +497,35 @@ _temperature_config_menu_new(Temperature *e) mn = e_menu_new(); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "10°C"); + e_menu_item_label_set(mi, _("10°C")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->low == 10) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _temperature_menu_low_10, e); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "20°C"); + e_menu_item_label_set(mi, _("20°C")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->low == 20) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _temperature_menu_low_20, e); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "30°C"); + e_menu_item_label_set(mi, _("30°C")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->low == 30) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _temperature_menu_low_30, e); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "40°C"); + e_menu_item_label_set(mi, _("40°C")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->low == 40) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _temperature_menu_low_40, e); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "50°C"); + e_menu_item_label_set(mi, _("50°C")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->low == 50) e_menu_item_toggle_set(mi, 1); @@ -537,63 +537,63 @@ _temperature_config_menu_new(Temperature *e) mn = e_menu_new(); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "20°C"); + e_menu_item_label_set(mi, _("20°C")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->high == 20) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _temperature_menu_high_20, e); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "30°C"); + e_menu_item_label_set(mi, _("30°C")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->high == 30) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _temperature_menu_high_30, e); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "40°C"); + e_menu_item_label_set(mi, _("40°C")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->high == 40) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _temperature_menu_high_40, e); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "50°C"); + e_menu_item_label_set(mi, _("50°C")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->high == 50) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _temperature_menu_high_50, e); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "60°C"); + e_menu_item_label_set(mi, _("60°C")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->high == 60) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _temperature_menu_high_60, e); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "70°C"); + e_menu_item_label_set(mi, _("70°C")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->high == 70) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _temperature_menu_high_70, e); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "80°C"); + e_menu_item_label_set(mi, _("80°C")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->high == 80) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _temperature_menu_high_80, e); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "90°C"); + e_menu_item_label_set(mi, _("90°C")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->high == 90) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _temperature_menu_high_90, e); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "100°C"); + e_menu_item_label_set(mi, _("100°C")); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (e->conf->high == 100) e_menu_item_toggle_set(mi, 1); @@ -605,15 +605,15 @@ _temperature_config_menu_new(Temperature *e) mn = e_menu_new(); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Check Interval"); + e_menu_item_label_set(mi, _("Check Interval")); e_menu_item_submenu_set(mi, e->config_menu_poll); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Low Temperature"); + e_menu_item_label_set(mi, _("Low Temperature")); e_menu_item_submenu_set(mi, e->config_menu_low); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "High Temperature"); + e_menu_item_label_set(mi, _("High Temperature")); e_menu_item_submenu_set(mi, e->config_menu_high); e->config_menu = mn; @@ -713,14 +713,14 @@ _temperature_face_menu_new(Temperature_Face *face) /* Enabled */ /* mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Enabled"); + e_menu_item_label_set(mi, _("Enabled")); e_menu_item_check_set(mi, 1); if (face->conf->enabled) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _temperature_face_cb_menu_enabled, face); */ /* Edit */ mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Edit Mode"); + e_menu_item_label_set(mi, _("Edit Mode")); e_menu_item_callback_set(mi, _temperature_face_cb_menu_edit, face); } diff --git a/src/modules/test/e_mod_main.c b/src/modules/test/e_mod_main.c index b84d654ec..e7786bee7 100644 --- a/src/modules/test/e_mod_main.c +++ b/src/modules/test/e_mod_main.c @@ -6,11 +6,11 @@ init(E_Module *m) { if (m->api->version < E_MODULE_API_VERSION) { - e_error_dialog_show("Module API Error", - "Error initializing Module: test\n" - "It requires a minimum module API version of: %i.\n" - "The module API advertized by Enlightenment is: %i.\n" - "Aborting module.", + e_error_dialog_show(_("Module API Error"), + _("Error initializing Module: test\n" + "It requires a minimum module API version of: %i.\n" + "The module API advertized by Enlightenment is: %i.\n" + "Aborting module."), E_MODULE_API_VERSION, m->api->version); return NULL; @@ -21,15 +21,15 @@ init(E_Module *m) mn = e_menu_new(); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Module Config Menu Item 1"); + e_menu_item_label_set(mi, _("Module Config Menu Item 1")); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Module Config Menu Item 2"); + e_menu_item_label_set(mi, _("Module Config Menu Item 2")); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Module Config Menu Item 3"); + e_menu_item_label_set(mi, _("Module Config Menu Item 3")); mi = e_menu_item_new(mn); e_menu_item_separator_set(mi, 1); mi = e_menu_item_new(mn); - e_menu_item_label_set(mi, "Something Else"); + e_menu_item_label_set(mi, _("Something Else")); m->config_menu = mn; } return init; /* bogus pointer - just to say we worked */ @@ -56,16 +56,16 @@ save(E_Module *m) int info(E_Module *m) { - m->label = strdup("Test!!!"); + m->label = strdup(_("Test!!!")); return 1; } int about(E_Module *m) { - e_error_dialog_show("Enlightenment Test Module", - "This module is VERY simple and is only used to test the basic\n" - "interface of the Enlightenment 0.17.0 module system. Please\n" - "Ignore this module unless you are working on the module system."); + e_error_dialog_show(_("Enlightenment Test Module"), + _("This module is VERY simple and is only used to test the basic\n" + "interface of the Enlightenment 0.17.0 module system. Please\n" + "Ignore this module unless you are working on the module system.")); return 1; }