Sebastian Dransfeld <sebastid@tango.flipp.net>
HandyAndE (Andrew Williams) <andy@handyande.co.uk>
CodeWarrior (Hisham Mardam Bey) <hisham@hisham.cc>
+dj2 (dan sinclair) <dj2@everburning.com>
}
e_menu_item_toggle_set(mi, e_module_enabled_get(mod));
}
+
+void
+e_module_dialog_show(char *title, char *body)
+{
+ E_Dialog *dia;
+
+ dia = e_dialog_new (e_container_current_get (e_manager_current_get ()));
+ if (!dia) return;
+
+ e_dialog_title_set (dia, title);
+ e_dialog_icon_set (dia, "enlightenment/e", 64);
+ e_dialog_text_set (dia, body);
+ e_dialog_button_add (dia, _("Ok"), NULL, NULL, NULL);
+ e_win_centered_set (dia->win, 1);
+ e_dialog_show (dia);
+}
+
+
+
EAPI E_Module *e_module_find(char *name);
EAPI Evas_List *e_module_list(void);
EAPI E_Menu *e_module_menu_new(void);
+EAPI void e_module_dialog_show(char *title, char *body);
#endif
#endif
/* check module api version */
if (m->api->version < E_MODULE_API_VERSION)
{
- E_Dialog *dia;
char buf[4096];
-
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return NULL;
-
- snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: Battery<br>"
+ snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: %s<br>"
"It requires a minimum module API version of: %i.<br>"
"The module API advertized by Enlightenment is: %i.<br>"),
- E_MODULE_API_VERSION, m->api->version);
-
- e_dialog_title_set(dia, "Enlightenment Battery Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, buf);
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ _("Battery"), E_MODULE_API_VERSION, m->api->version);
+
+ e_module_dialog_show(_("Enlightenment Battery Module"), buf);
return NULL;
}
/* actually init battery */
int
e_modapi_about(E_Module *m)
{
- E_Dialog *dia;
-
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return 0;
- e_dialog_title_set(dia, "Enlightenment Battery Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, _("A basic battery meter that uses either"
- "<hilight>ACPI</hilight> or <hilight>APM</hilight><br>"
- "on Linux to monitor your battery and AC power adaptor<br>"
- "status. This will work under Linux and FreeBSD and is only<br>"
- "as accurate as your BIOS or kernel drivers."));
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ e_module_dialog_show(_("Enlightenment Battery Module"),
+ _("A basic battery meter that uses either"
+ "<hilight>ACPI</hilight> or <hilight>APM</hilight><br>"
+ "on Linux to monitor your battery and AC power adaptor<br>"
+ "status. This will work under Linux and FreeBSD and is only<br>"
+ "as accurate as your BIOS or kernel drivers."));
return 1;
}
/* check module api version */
if (module->api->version < E_MODULE_API_VERSION)
{
- E_Dialog *dia;
char buf[4096];
-
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return NULL;
-
- snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: Clock<br>"
+ snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: %s<br>"
"It requires a minimum module API version of: %i.<br>"
"The module API advertized by Enlightenment is: %i.<br>"),
- E_MODULE_API_VERSION, module->api->version);
-
- e_dialog_title_set(dia, "Enlightenment Clock Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, buf);
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ _("Clock"), E_MODULE_API_VERSION, module->api->version);
+
+ e_module_dialog_show(_("Enlightenment Clock Module"), buf);
return NULL;
}
int
e_modapi_about(E_Module *module)
{
- E_Dialog *dia;
-
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return 0;
- e_dialog_title_set(dia, "Enlightenment Clock Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, _("A simple module to give E17 a clock."));
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ e_module_dialog_show(_("Enlightenment Clock Module"),
+ _("A simple module to give E17 a clock."));
return 1;
}
if (module->api->version < E_MODULE_API_VERSION)
{
- E_Dialog *dia;
char buf[4096];
-
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return NULL;
-
- snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: Cpufreq<br>"
+ snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: %s<br>"
"It requires a minimum module API version of: %i.<br>"
"The module API advertized by Enlightenment is: %i.<br>"),
- E_MODULE_API_VERSION, module->api->version);
+ _("Cpufreq"), E_MODULE_API_VERSION, module->api->version);
- e_dialog_title_set(dia, "Enlightenment Cpufreq Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, buf);
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ e_module_dialog_show(_("Enlightenment Cpufreq Module"), buf);
return NULL;
}
int
e_modapi_about(E_Module *module)
{
- E_Dialog *dia;
-
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return 0;
- e_dialog_title_set(dia, "CPU Frequency Controller Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, _("A simple module to control the frequency of the system CPU.<br>"
- "This is especially useful to save power on laptops."));
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ e_module_dialog_show(_("CPU Frequency Controller Module"),
+ _("A simple module to control the frequency of the system CPU.<br>"
+ "This is especially useful to save power on laptops."));
return 1;
}
if (m->api->version < E_MODULE_API_VERSION)
{
- E_Dialog *dia;
char buf[4096];
-
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return NULL;
-
- snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: Dropshadow<br>"
+ snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: %s<br>"
"It requires a minimum module API version of: %i.<br>"
"The module API advertized by Enlightenment is: %i.<br>"),
- E_MODULE_API_VERSION, m->api->version);
-
- e_dialog_title_set(dia, "Enlightenment Dropshadow Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, buf);
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ _("Dropshadow"), E_MODULE_API_VERSION, m->api->version);
+
+ e_module_dialog_show(_("Enlightenment Dropshadow Module"), buf);
return NULL;
}
ds = _ds_init(m);
int
e_modapi_about(E_Module *m)
{
- E_Dialog *dia;
-
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return 0;
- e_dialog_title_set(dia, "Enlightenment Dropshadow Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, _("This is the dropshadow module that allows dropshadows to be cast<br>"
- "on the desktop background - without special X-Server extensions<br>"
- "or hardware acceleration."));
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ e_module_dialog_show(_("Enlightenment Dropshadow Module"),
+ _("This is the dropshadow module that allows dropshadows to be cast<br>"
+ "on the desktop background - without special X-Server extensions<br>"
+ "or hardware acceleration."));
return 1;
}
/* check module api version */
if (m->api->version < E_MODULE_API_VERSION)
{
- E_Dialog *dia;
char buf[4096];
-
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return NULL;
-
- snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: IBar<br>"
+ snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: %s<br>"
"It requires a minimum module API version of: %i.<br>"
"The module API advertized by Enlightenment is: %i.<br>"),
- E_MODULE_API_VERSION, m->api->version);
-
- e_dialog_title_set(dia, "Enlightenment IBar Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, buf);
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ _("IBar"), E_MODULE_API_VERSION, m->api->version);
+
+ e_module_dialog_show(_("Enlightenment IBar Module"), buf);
return NULL;
}
/* actually init ibar */
int
e_modapi_about(E_Module *m)
{
- E_Dialog *dia;
-
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return 0;
- e_dialog_title_set(dia, "Enlightenment IBar Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, _("This is the IBar Application Launcher bar module for Enlightenment.<br>"
- "It is a first example module and is being used to flesh out several<br>"
- "interfaces in Enlightenment 0.17.0. It is under heavy development,<br>"
- "so expect it to <hilight>break often</hilight> and change as it improves."));
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ e_module_dialog_show(_("Enlightenment IBar Module"),
+ _("This is the IBar Application Launcher bar module for Enlightenment.<br>"
+ "It is a first example module and is being used to flesh out several<br>"
+ "interfaces in Enlightenment 0.17.0. It is under heavy development,<br>"
+ "so expect it to <hilight>break often</hilight> and change as it improves."));
return 1;
}
/* check module api version */
if (m->api->version < E_MODULE_API_VERSION)
{
- E_Dialog *dia;
char buf[4096];
-
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return NULL;
-
- snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: IBox<br>"
+ snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: %s<br>"
"It requires a minimum module API version of: %i.<br>"
"The module API advertized by Enlightenment is: %i.<br>"),
- E_MODULE_API_VERSION, m->api->version);
-
- e_dialog_title_set(dia, "Enlightenment IBox Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, buf);
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ _("IBox"), E_MODULE_API_VERSION, m->api->version);
+
+ e_module_dialog_show(_("Enlightenment IBox Module"), buf);
return NULL;
}
/* actually init ibox */
int
e_modapi_about(E_Module *m)
{
- E_Dialog *dia;
-
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return 0;
- e_dialog_title_set(dia, "Enlightenment IBox Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, _("This is the IBox Iconified Application module for Enlightenment.<br>"
- "It will hold minimized applications"));
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ e_module_dialog_show(_("Enlightenment IBox Module"),
+ _("This is the IBox Iconified Application module for Enlightenment.<br>"
+ "It will hold minimized applications"));
return 1;
}
/* check module api version */
if (module->api->version < E_MODULE_API_VERSION)
{
- E_Dialog *dia;
char buf[4096];
-
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return NULL;
-
- snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: Pager<br>"
+ snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: %s<br>"
"It requires a minimum module API version of: %i.<br>"
"The module API advertized by Enlightenment is: %i.<br>"),
- E_MODULE_API_VERSION, module->api->version);
-
- e_dialog_title_set(dia, "Enlightenment Pager Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, buf);
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ _("Pager"), E_MODULE_API_VERSION, module->api->version);
+
+ e_module_dialog_show(_("Enlightenment Pager Module"), buf);
return NULL;
}
/* actually init pager */
int
e_modapi_about(E_Module *module)
{
- E_Dialog *dia;
-
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return 0;
- e_dialog_title_set(dia, "Enlightenment Pager Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, _("A pager module to navigate virtual desktops."));
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ e_module_dialog_show(_("Enlightenment Pager Module"),
+ _("A pager module to navigate virtual desktops."));
return 1;
}
if (m->api->version < E_MODULE_API_VERSION)
{
- E_Dialog *dia;
char buf[4096];
-
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return NULL;
-
- snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: Randr<br>"
+ snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: %s<br>"
"It requires a minimum module API version of: %i.<br>"
"The module API advertized by Enlightenment is: %i.<br>"),
- E_MODULE_API_VERSION, m->api->version);
-
- e_dialog_title_set(dia, "Enlightenment Randr Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, buf);
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ _("RandR"), E_MODULE_API_VERSION, m->api->version);
+
+ e_module_dialog_show(_("Enlightenment Randr Module"), buf);
return NULL;
}
int
e_modapi_about(E_Module *m)
{
- E_Dialog *dia;
-
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return 0;
- e_dialog_title_set(dia, "Enlightenment Randr Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, _("Module to change screen resolution for E17"));
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ e_module_dialog_show(_("Enlightenment Randr Module"),
+ _("Module to change screen resolution for E17"));
return 1;
}
if (m->api->version < E_MODULE_API_VERSION)
{
- E_Dialog *dia;
char buf[4096];
-
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return NULL;
-
- snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: Start<br>"
+ snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: %s<br>"
"It requires a minimum module API version of: %i.<br>"
"The module API advertized by Enlightenment is: %i.<br>"),
- E_MODULE_API_VERSION, m->api->version);
+ _("Start"), E_MODULE_API_VERSION, m->api->version);
- e_dialog_title_set(dia, "Enlightenment Start Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, buf);
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ e_module_dialog_show(_("Enlightenment Start Module"), buf);
return NULL;
}
int
e_modapi_about(E_Module *m)
{
- E_Dialog *dia;
-
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return 0;
- e_dialog_title_set(dia, "Enlightenment Start Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, _("Experimental Button module for E17"));
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ e_module_dialog_show(_("Enlightenment Start Module"),
+ _("Experimental Button module for E17"));
return 1;
}
/* check module api version */
if (m->api->version < E_MODULE_API_VERSION)
{
- E_Dialog *dia;
char buf[4096];
-
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return NULL;
-
- snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: Temperature<br>"
+ snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: %s<br>"
"It requires a minimum module API version of: %i.<br>"
"The module API advertized by Enlightenment is: %i.<br>"),
- E_MODULE_API_VERSION, m->api->version);
-
- e_dialog_title_set(dia, "Enlightenment Temperature Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, buf);
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ _("Temperature"), E_MODULE_API_VERSION, m->api->version);
+
+ e_module_dialog_show(_("Enlightenment Temperature Module"), buf);
return NULL;
}
/* actually init temperature */
int
e_modapi_about(E_Module *m)
{
- E_Dialog *dia;
-
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return 0;
- e_dialog_title_set(dia, "Enlightenment Temperature Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, _("A module to measure the <hilight>ACPI Thermal sensor</hilight> on Linux.<br>"
- "It is especially useful for modern Laptops with high speed<br>"
- "CPUs that generate a lot of heat."));
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ e_module_dialog_show(_("Enlightenment Temperature Module"),
+ _("A module to measure the <hilight>ACPI Thermal sensor</hilight> on Linux.<br>"
+ "It is especially useful for modern Laptops with high speed<br>"
+ "CPUs that generate a lot of heat."));
return 1;
}
{
if (m->api->version < E_MODULE_API_VERSION)
{
- E_Dialog *dia;
char buf[4096];
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return NULL;
-
- snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: Test<br>"
+ snprintf(buf, sizeof(buf), _("Module API Error<br>Error initializing Module: %s<br>"
"It requires a minimum module API version of: %i.<br>"
"The module API advertized by Enlightenment is: %i.<br>"),
- E_MODULE_API_VERSION, m->api->version);
+ _("Test"), E_MODULE_API_VERSION, m->api->version);
- e_dialog_title_set(dia, "Enlightenment Test Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, buf);
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ e_module_dialog_show(_("Enlightenment Test Module"), buf);
return NULL;
}
{
int
e_modapi_about(E_Module *m)
{
- E_Dialog *dia;
-
- dia = e_dialog_new(e_container_current_get(e_manager_current_get()));
- if (!dia) return 0;
- e_dialog_title_set(dia, "Enlightenment Test Module");
- e_dialog_icon_set(dia, "enlightenment/e", 64);
- e_dialog_text_set(dia, _("This module is VERY simple and is only used to test the basic<br>"
- "interface of the Enlightenment 0.17.0 module system. Please<br>"
- "ignore this module unless you are working on the module system."));
- e_dialog_button_add(dia, _("Ok"), NULL, NULL, NULL);
- e_win_centered_set(dia->win, 1);
- e_dialog_show(dia);
+ e_module_dialog_show(_("Enlightenment Test Module"),
+ _("This module is VERY simple and is only used to test the basic<br>"
+ "interface of the Enlightenment 0.17.0 module system. Please<br>"
+ "ignore this module unless you are working on the module system."));
return 1;
}