2010-01-04 04:27:15 -08:00
|
|
|
#include "e.h"
|
|
|
|
#include "e_mod_main.h"
|
|
|
|
#include "e_mod_config.h"
|
|
|
|
#include "e_mod_comp.h"
|
|
|
|
|
2010-08-19 14:19:24 -07:00
|
|
|
//static Ecore_Event_Handler *init_done_handler = NULL;
|
2010-02-10 06:13:29 -08:00
|
|
|
|
2010-03-08 06:50:00 -08:00
|
|
|
//static int
|
|
|
|
//_e_init_done(void *data, int type, void *event)
|
|
|
|
//{
|
|
|
|
// ecore_event_handler_del(init_done_handler);
|
|
|
|
// init_done_handler = NULL;
|
|
|
|
// if (!e_mod_comp_init())
|
|
|
|
// {
|
|
|
|
// // FIXME: handle if comp init fails
|
|
|
|
// }
|
|
|
|
// return 1;
|
|
|
|
//}
|
2010-02-10 06:13:29 -08:00
|
|
|
|
2010-01-04 04:27:15 -08:00
|
|
|
/* module private routines */
|
|
|
|
Mod *_comp_mod = NULL;
|
|
|
|
|
|
|
|
/* public module routines. all modules must have these */
|
2011-03-19 23:12:17 -07:00
|
|
|
EAPI E_Module_Api e_modapi =
|
2010-01-04 04:27:15 -08:00
|
|
|
{
|
|
|
|
E_MODULE_API_VERSION,
|
|
|
|
"Composite"
|
|
|
|
};
|
|
|
|
|
|
|
|
EAPI void *
|
|
|
|
e_modapi_init(E_Module *m)
|
|
|
|
{
|
|
|
|
Mod *mod;
|
|
|
|
char buf[4096];
|
2011-03-19 23:12:17 -07:00
|
|
|
|
2010-01-04 04:27:15 -08:00
|
|
|
mod = calloc(1, sizeof(Mod));
|
2010-05-22 09:21:17 -07:00
|
|
|
m->data = mod;
|
2011-03-19 23:12:17 -07:00
|
|
|
|
2010-01-04 04:27:15 -08:00
|
|
|
mod->module = m;
|
|
|
|
snprintf(buf, sizeof(buf), "%s/e-module-comp.edj", e_module_dir_get(m));
|
2011-03-19 23:12:17 -07:00
|
|
|
e_configure_registry_category_add("appearance", 10, _("Look"), NULL,
|
2010-10-17 10:33:44 -07:00
|
|
|
"preferences-look");
|
2011-03-19 23:12:17 -07:00
|
|
|
e_configure_registry_item_add("appearance/comp", 120, _("Composite"), NULL,
|
2010-08-19 14:19:24 -07:00
|
|
|
buf, e_int_config_comp_module);
|
|
|
|
|
2011-08-15 02:21:12 -07:00
|
|
|
e_mod_comp_cfdata_edd_init(&(mod->conf_edd),
|
|
|
|
&(mod->conf_match_edd));
|
2011-03-19 23:12:17 -07:00
|
|
|
|
2010-01-04 04:27:15 -08:00
|
|
|
mod->conf = e_config_domain_load("module.comp", mod->conf_edd);
|
2010-05-22 09:21:17 -07:00
|
|
|
if (!mod->conf) _e_mod_config_new(m);
|
2012-10-07 02:56:22 -07:00
|
|
|
|
|
|
|
/* force some config vals off */
|
|
|
|
mod->conf->lock_fps = 0;
|
|
|
|
mod->conf->indirect = 0;
|
2011-03-19 23:12:17 -07:00
|
|
|
|
2010-05-21 08:00:22 -07:00
|
|
|
if (!e_config->use_composite)
|
|
|
|
{
|
|
|
|
e_config->use_composite = 1;
|
|
|
|
e_config_save_queue();
|
|
|
|
}
|
2011-04-04 02:11:59 -07:00
|
|
|
|
|
|
|
/* XXX: disabled dropshadow module when comp is running */
|
|
|
|
{
|
|
|
|
E_Module *m2;
|
2012-11-26 02:37:52 -08:00
|
|
|
|
|
|
|
m2 = e_module_find("dropshadow");
|
|
|
|
if (m2 && m2->enabled)
|
2012-06-28 00:03:44 -07:00
|
|
|
{
|
2012-11-26 02:37:52 -08:00
|
|
|
e_util_dialog_internal(_("Composite"),
|
|
|
|
_("Dropshadow module is incompatible<br>"
|
|
|
|
"with compositing. Disabling the<br>"
|
|
|
|
"Dropshadow module."));
|
|
|
|
e_module_disable(m2);
|
2012-06-28 00:03:44 -07:00
|
|
|
}
|
2011-04-04 02:11:59 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* XXX: update old configs. add config versioning */
|
2011-03-15 14:35:08 -07:00
|
|
|
if (mod->conf->first_draw_delay == 0)
|
2011-08-15 02:21:12 -07:00
|
|
|
mod->conf->first_draw_delay = 0.20;
|
2011-03-19 23:12:17 -07:00
|
|
|
|
2010-01-04 04:27:15 -08:00
|
|
|
_comp_mod = mod;
|
|
|
|
|
2010-05-21 03:04:54 -07:00
|
|
|
if (!e_mod_comp_init())
|
|
|
|
{
|
|
|
|
// FIXME: handle if comp init fails
|
|
|
|
}
|
2010-03-24 01:08:46 -07:00
|
|
|
|
2010-09-24 06:39:46 -07:00
|
|
|
e_module_delayed_set(m, 0);
|
2010-03-24 01:08:46 -07:00
|
|
|
e_module_priority_set(m, -1000);
|
2010-01-04 04:27:15 -08:00
|
|
|
return mod;
|
|
|
|
}
|
|
|
|
|
2010-05-21 03:04:54 -07:00
|
|
|
void
|
|
|
|
_e_mod_config_new(E_Module *m)
|
|
|
|
{
|
|
|
|
Mod *mod = m->data;
|
2011-03-19 23:12:17 -07:00
|
|
|
|
2011-08-15 02:21:12 -07:00
|
|
|
mod->conf = e_mod_comp_cfdata_config_new();
|
2010-05-15 02:14:31 -07:00
|
|
|
}
|
|
|
|
|
2010-05-21 03:04:54 -07:00
|
|
|
void
|
|
|
|
_e_mod_config_free(E_Module *m)
|
|
|
|
{
|
|
|
|
Mod *mod = m->data;
|
2011-03-19 23:12:17 -07:00
|
|
|
|
2011-08-15 02:21:12 -07:00
|
|
|
e_mod_cfdata_config_free(mod->conf);
|
2010-05-21 03:04:54 -07:00
|
|
|
mod->conf = NULL;
|
|
|
|
}
|
|
|
|
|
2010-01-04 04:27:15 -08:00
|
|
|
EAPI int
|
|
|
|
e_modapi_shutdown(E_Module *m)
|
|
|
|
{
|
|
|
|
Mod *mod = m->data;
|
2011-03-19 23:12:17 -07:00
|
|
|
|
2010-01-04 04:27:15 -08:00
|
|
|
e_mod_comp_shutdown();
|
2011-03-19 23:12:17 -07:00
|
|
|
|
2010-01-04 04:27:15 -08:00
|
|
|
e_configure_registry_item_del("appearance/comp");
|
|
|
|
e_configure_registry_category_del("appearance");
|
2011-03-19 23:12:17 -07:00
|
|
|
|
|
|
|
if (mod->config_dialog)
|
2010-01-04 04:27:15 -08:00
|
|
|
{
|
|
|
|
e_object_del(E_OBJECT(mod->config_dialog));
|
|
|
|
mod->config_dialog = NULL;
|
|
|
|
}
|
2010-05-21 07:22:29 -07:00
|
|
|
_e_mod_config_free(m);
|
2011-03-19 23:12:17 -07:00
|
|
|
|
2010-05-15 02:14:31 -07:00
|
|
|
E_CONFIG_DD_FREE(mod->conf_match_edd);
|
2010-01-04 04:27:15 -08:00
|
|
|
E_CONFIG_DD_FREE(mod->conf_edd);
|
|
|
|
free(mod);
|
2011-03-19 23:12:17 -07:00
|
|
|
|
2010-05-21 02:34:58 -07:00
|
|
|
if (mod == _comp_mod) _comp_mod = NULL;
|
2011-03-19 23:12:17 -07:00
|
|
|
|
2010-01-04 04:27:15 -08:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI int
|
|
|
|
e_modapi_save(E_Module *m)
|
|
|
|
{
|
|
|
|
Mod *mod = m->data;
|
|
|
|
e_config_domain_save("module.comp", mod->conf_edd, mod->conf);
|
|
|
|
return 1;
|
|
|
|
}
|
2011-03-19 23:12:17 -07:00
|
|
|
|