Example #1
0
/**
 * @brief Shuts down Etk. It decrements the init-counter. If the counter reaches 0, it frees all the resources used by Etk
 * @return Returns the new value of the init-counter. If 0 is returned, it means that the resources has effectively
 * been freed.
 */
int etk_shutdown(void)
{
   if (_etk_main_init_count <= 0)
      return 0;

   _etk_main_init_count--;
   if (_etk_main_init_count == 0)
   {
      ecore_idle_enterer_del(_etk_main_idle_enterer);
      _etk_main_idle_enterer = NULL;

      /* Shutdown the subsystems of Etk */
      etk_object_shutdown();
      etk_type_shutdown();
      etk_signal_shutdown();

      etk_tooltips_shutdown();
      etk_event_shutdown();
      etk_engine_shutdown();
      etk_config_shutdown();
      etk_theme_shutdown();
      etk_argument_shutdown();

      /* Shutdown the EFL*/
      edje_shutdown();
      ecore_imf_shutdown();
      ecore_shutdown();
      evas_shutdown();
   }

   return _etk_main_init_count;
}
static Eina_Bool
_event_handler_cb(void *data, int type, void *event) // event callback
{
   struct context *ctxt = data;

   printf("EVENT: processing callback for the event received.\n");

   if (ctxt->count > 100)
     {
        ecore_idle_enterer_del(ctxt->enterer);
        ecore_idle_exiter_del(ctxt->exiter);
//        ecore_idler_del(ctxt->idler);
        eo_unref(ctxt->idler);

        ctxt->enterer = NULL;
        ctxt->exiter = NULL;
        ctxt->idler = NULL;

        if (ctxt->timer)
          {
             ecore_timer_del(ctxt->timer);
             ctxt->timer = NULL;
          }

        ecore_main_loop_quit();
     }

   return ECORE_CALLBACK_DONE; // same as EINA_FALSE
}
Example #3
0
void
_ecore_idle_enterer_call(void)
{
   if (!idle_enterer_current)
     {
        /* regular main loop, start from head */
        idle_enterer_current = idle_enterers;
     }
   else
     {
        /* recursive main loop, continue from where we were */
        idle_enterer_current =
          (Ecore_Idle_Enterer *)EINA_INLIST_GET(idle_enterer_current)->next;
     }

   while (idle_enterer_current)
     {
        Ecore_Idle_Enterer *ie = (Ecore_Idle_Enterer *)idle_enterer_current;
        if (!ie->delete_me)
          {
             ie->references++;
             if (!ie->func(ie->data))
               {
                  if (!ie->delete_me) ecore_idle_enterer_del(ie);
               }
             ie->references--;
          }
        if (idle_enterer_current) /* may have changed in recursive main loops */
          idle_enterer_current =
            (Ecore_Idle_Enterer *)EINA_INLIST_GET(idle_enterer_current)->next;
     }
   if (idle_enterers_delete_me)
     {
        Ecore_Idle_Enterer *l;
        int deleted_idler_enterers_in_use = 0;

        for (l = idle_enterers; l;)
          {
             Ecore_Idle_Enterer *ie = l;
             l = (Ecore_Idle_Enterer *) EINA_INLIST_GET(l)->next;
             if (ie->delete_me)
               {
                  if (ie->references)
                    {
                       deleted_idler_enterers_in_use++;
                       continue;
                    }

                  idle_enterers = (Ecore_Idle_Enterer *) eina_inlist_remove(EINA_INLIST_GET(idle_enterers), EINA_INLIST_GET(ie));
                  ECORE_MAGIC_SET(ie, ECORE_MAGIC_NONE);
                  free(ie);
               }
          }
        if (!deleted_idler_enterers_in_use)
          idle_enterers_delete_me = 0;
     }
}
Example #4
0
/**
 * @brief Cleanup internal data structures used by ewl.
 *
 * This should be called to cleanup internal EWL data structures, if using
 * ecore directly rather than using ewl_main().
 */
int
ewl_shutdown(void)
{
        Ewl_Shutdown_Hook hook;
        void (*shutdown)(void);

        DENTER_FUNCTION(DLEVEL_STABLE);

        if (--ewl_init_count)
                DRETURN_INT(ewl_init_count, DLEVEL_STABLE);

        while ((hook = ecore_list_first_remove(shutdown_hooks)))
                hook();
        IF_FREE_LIST(shutdown_hooks);

        /*
         * Destroy all existing widgets.
         */
        if (ewl_embed_list)
        {
                Ewl_Widget *emb;

                while ((emb = ecore_list_first_remove(ewl_embed_list)))
                        ewl_widget_destroy(emb);

                while (ewl_garbage_collect_idler(NULL) > 0)
                        ;
                IF_FREE_LIST(ewl_embed_list);
        }

        if (idle_enterer)
        {
                ecore_idle_enterer_del(idle_enterer);
                idle_enterer = NULL;
        }

        /*
         * Free internal accounting lists.
         */
        IF_FREE_LIST(ewl_window_list);
        IF_FREE_LIST(reveal_list);
        IF_FREE_LIST(obscure_list);
        IF_FREE_LIST(configure_active);
        IF_FREE_LIST(configure_available);
        IF_FREE_LIST(realize_list);
        IF_FREE_LIST(destroy_list);
        IF_FREE_LIST(free_evas_list);
        IF_FREE_LIST(free_evas_object_list);
        IF_FREE_LIST(child_add_list);

        /* shutdown all the subsystems */
        while ((shutdown = ecore_list_first_remove(shutdown_queue)))
                shutdown();
        IF_FREE_LIST(shutdown_queue);

        DRETURN_INT(ewl_init_count, DLEVEL_STABLE);
}
Example #5
0
static void disable_idlers()
{
    if ( idle_enterer != NULL ){
        ecore_idle_enterer_del( idle_enterer );
        idle_enterer = NULL;
    }
    if ( idle_exiter != NULL ){
        ecore_idle_exiter_del( idle_exiter );
        idle_exiter = NULL;
    }
}
Example #6
0
EAPI void
e_popup_hide(E_Popup *pop)
{
   E_OBJECT_CHECK(pop);
   E_OBJECT_TYPE_CHECK(pop, E_POPUP_TYPE);
   if (!pop->visible) return;
   if (pop->idle_enterer) ecore_idle_enterer_del(pop->idle_enterer);
   pop->idle_enterer = NULL;
   pop->visible = 0;
   ecore_evas_hide(pop->ecore_evas);
   e_container_shape_hide(pop->shape);
}
Example #7
0
static void
_e_popup_free(E_Popup *pop)
{
   if (pop->idle_enterer) ecore_idle_enterer_del(pop->idle_enterer);
   pop->idle_enterer = NULL;
   E_FREE(pop->shape_rects);
   pop->shape_rects_num = 0;
   e_container_shape_hide(pop->shape);
   e_object_del(E_OBJECT(pop->shape));
   e_canvas_del(pop->ecore_evas);
   ecore_evas_free(pop->ecore_evas);
   e_object_unref(E_OBJECT(pop->zone));
   pop->zone->popups = eina_list_remove(pop->zone->popups, pop);
   _e_popup_list = eina_list_remove(_e_popup_list, pop);
   eina_hash_del(_e_popup_hash, e_util_winid_str_get(pop->evas_win), pop);
   if (pop->name) eina_stringshare_del(pop->name);
   free(pop);
}
Example #8
0
EAPI void
e_popup_show(E_Popup *pop)
{
   E_OBJECT_CHECK(pop);
   E_OBJECT_TYPE_CHECK(pop, E_POPUP_TYPE);
   if (pop->visible) return;
   pop->visible = 1;
   if ((pop->shaped) && (!e_config->use_composite))
     {
        ecore_evas_move(pop->ecore_evas,
                        pop->zone->container->manager->w,
                        pop->zone->container->manager->h);
        ecore_evas_show(pop->ecore_evas);
        if (pop->idle_enterer) ecore_idle_enterer_del(pop->idle_enterer);
        pop->idle_enterer = ecore_idle_enterer_add(_e_popup_idle_enterer, pop);
     }
   else
     {
        ecore_evas_show(pop->ecore_evas);
	if (!(pop->shaped && e_config->use_composite))
	  e_container_shape_show(pop->shape);
     }
}
EventManager::~EventManager()
{
    ecore_idle_enterer_del(idler);
    //clear queue
    eventsQueue = std::queue<CalaosEvent>();
}