EAPI int
e_modapi_shutdown(E_Module *m)
{
   E_Music_Control_Module_Context *ctxt;
   EINA_SAFETY_ON_NULL_RETURN_VAL(music_control_mod, 0);
   ctxt = music_control_mod->data;

   E_FREE_FUNC(ctxt->meta_title, eina_stringshare_del);
   E_FREE_FUNC(ctxt->meta_album, eina_stringshare_del);
   E_FREE_FUNC(ctxt->meta_artist, eina_stringshare_del);
   E_FREE_FUNC(ctxt->meta_cover, eina_stringshare_del);

   free(ctxt->config);
   E_CONFIG_DD_FREE(ctxt->conf_edd);

   E_FREE_FUNC(desklock_handler, ecore_event_handler_del);

   media_player2_player_proxy_unref(ctxt->mpris2_player);
   mpris_media_player2_proxy_unref(ctxt->mrpis2);
   eldbus_connection_unref(ctxt->conn);
   eldbus_shutdown();

   e_gadcon_provider_unregister(&_gc_class);

   if (eina_list_count(ctxt->instances))
     ERR("Live instances.");

   free(ctxt);
   music_control_mod = NULL;

   return 1;
}
Exemple #2
0
int
wkb_ibus_init(void)
{
   if (wkb_ibus && wkb_ibus->refcount)
      goto end;

   if (!eldbus_init())
     {
        ERR("Error initializing Eldbus");
        goto eldbus_err;
     }

   if (!efreet_init())
     {
        ERR("Error initializing Efreet");
        goto efreet_err;
     }

   if (!wkb_ibus_config_eet_init())
     {
        ERR("Error initializing wkb_config_eet");
        goto eet_err;
     }

   if (!wkb_ibus && !(wkb_ibus = calloc(1, sizeof(*wkb_ibus))))
     {
        ERR("Error calloc");
        goto calloc_err;
     }

   WKB_IBUS_CONNECTED = ecore_event_type_new();
   WKB_IBUS_DISCONNECTED = ecore_event_type_new();
   WKB_IBUS_CONFIG_VALUE_CHANGED = ecore_event_type_new();
   WKB_THEME_CHANGED = ecore_event_type_new();

   wkb_ibus->add_handle = ecore_event_handler_add(ECORE_EXE_EVENT_ADD, _wkb_ibus_exe_add_cb, NULL);
   wkb_ibus->data_handle = ecore_event_handler_add(ECORE_EXE_EVENT_DATA, _wkb_ibus_exe_data_cb, NULL);

end:
   return ++wkb_ibus->refcount;

calloc_err:
   wkb_ibus_config_eet_shutdown();

eet_err:
   efreet_shutdown();

efreet_err:
   eldbus_shutdown();

eldbus_err:
   return 0;
}
Exemple #3
0
static void
_wkb_ibus_shutdown_finish(void)
{
   DBG("Finish");

   ecore_event_handler_del(wkb_ibus->add_handle);
   ecore_event_handler_del(wkb_ibus->data_handle);

   free(wkb_ibus);
   wkb_ibus = NULL;

   ecore_main_loop_quit();

   wkb_ibus_config_eet_shutdown();
   efreet_shutdown();
   eldbus_shutdown();
}