summaryrefslogtreecommitdiff
path: root/src/lib/ecore/efl_loop_consumer.c
blob: f984909e1adabb255a03b87bc8d5f64e7fe2bd88 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include <Ecore.h>

#include "ecore_private.h"

typedef struct _Efl_Loop_Consumer_Data Efl_Loop_Consumer_Data;
struct _Efl_Loop_Consumer_Data
{
};

static Efl_Loop *
_efl_loop_consumer_loop_get(Eo *obj, Efl_Loop_Consumer_Data *pd EINA_UNUSED)
{
   Efl_Loop *loop = efl_provider_find(obj, EFL_LOOP_CLASS);
   if (!loop && eina_main_loop_is())
     {
        loop = ecore_main_loop_get();
        ERR("Failed to get the loop on object %p from the main thread! "
            "Returning the main loop: %p", obj, loop);
     }
   return loop;
}

static void
_efl_loop_consumer_efl_object_parent_set(Eo *obj, Efl_Loop_Consumer_Data *pd EINA_UNUSED, Efl_Object *parent)
{
   if (parent != NULL && efl_provider_find(parent, EFL_LOOP_CLASS) == NULL)
     {
        ERR("parent=%p is not a provider of EFL_LOOP_CLASS!", parent);
        return;
     }

   efl_parent_set(efl_super(obj, EFL_LOOP_CONSUMER_CLASS), parent);
}

#include "efl_loop_consumer.eo.c"