\hypertarget{group__Ecore__Idle__Group}{}\doxysection{Ecore Idle functions}
\label{group__Ecore__Idle__Group}\index{Ecore Idle functions@{Ecore Idle functions}}


The idler functionality in Ecore allows for callbacks to be called when the program isn\textquotesingle{}t handling \mbox{\hyperlink{group__Ecore__Event__Group}{events}}, \mbox{\hyperlink{group__Ecore__Timer__Group}{timers}} or \mbox{\hyperlink{group__Ecore__FD__Handler__Group}{fd handlers}}.  


\doxysubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{group__Ecore__Idle__Group_gae4e7f2215a6e8cff3e2eab2582b5868e}\label{group__Ecore__Idle__Group_gae4e7f2215a6e8cff3e2eab2582b5868e}} 
typedef struct \+\_\+\+Ecore\+\_\+\+Factorized\+\_\+\+Idle \mbox{\hyperlink{group__Ecore__Idle__Group_gae4e7f2215a6e8cff3e2eab2582b5868e}{Ecore\+\_\+\+Idler}}
\begin{DoxyCompactList}\small\item\em A handle for idlers. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{group__Ecore__Idle__Group_gadc4e81cb020047be0f8f36db6d942ed3}\label{group__Ecore__Idle__Group_gadc4e81cb020047be0f8f36db6d942ed3}} 
typedef struct \+\_\+\+Ecore\+\_\+\+Factorized\+\_\+\+Idle \mbox{\hyperlink{group__Ecore__Idle__Group_gadc4e81cb020047be0f8f36db6d942ed3}{Ecore\+\_\+\+Idle\+\_\+\+Enterer}}
\begin{DoxyCompactList}\small\item\em A handle for idle enterers. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{group__Ecore__Idle__Group_gaa07d755d135454aa97625464aab4adf8}\label{group__Ecore__Idle__Group_gaa07d755d135454aa97625464aab4adf8}} 
typedef struct \+\_\+\+Ecore\+\_\+\+Factorized\+\_\+\+Idle \mbox{\hyperlink{group__Ecore__Idle__Group_gaa07d755d135454aa97625464aab4adf8}{Ecore\+\_\+\+Idle\+\_\+\+Exiter}}
\begin{DoxyCompactList}\small\item\em A handle for idle exiters. \end{DoxyCompactList}\end{DoxyCompactItemize}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__Ecore__Idle__Group_gae4e7f2215a6e8cff3e2eab2582b5868e}{Ecore\+\_\+\+Idler}} $\ast$ \mbox{\hyperlink{group__Ecore__Idle__Group_ga048ed35688c416f1f495912a900e9297}{ecore\+\_\+idler\+\_\+add}} (\mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga8a36ef1ac24bfa317a7826617264e530}{Ecore\+\_\+\+Task\+\_\+\+Cb}} func, const void $\ast$data)
\begin{DoxyCompactList}\small\item\em Adds an idler handler. \end{DoxyCompactList}\item 
void $\ast$ \mbox{\hyperlink{group__Ecore__Idle__Group_gaf7b5ec4cc0d26179c1b5e3ee907e5d58}{ecore\+\_\+idler\+\_\+del}} (\mbox{\hyperlink{group__Ecore__Idle__Group_gae4e7f2215a6e8cff3e2eab2582b5868e}{Ecore\+\_\+\+Idler}} $\ast$idler)
\begin{DoxyCompactList}\small\item\em Deletes an idler callback from the list to be executed. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Ecore__Idle__Group_gadc4e81cb020047be0f8f36db6d942ed3}{Ecore\+\_\+\+Idle\+\_\+\+Enterer}} $\ast$ \mbox{\hyperlink{group__Ecore__Idle__Group_ga0805b9840716bd08ae44956dba8de3e6}{ecore\+\_\+idle\+\_\+enterer\+\_\+add}} (\mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga8a36ef1ac24bfa317a7826617264e530}{Ecore\+\_\+\+Task\+\_\+\+Cb}} func, const void $\ast$data)
\begin{DoxyCompactList}\small\item\em Adds an idle enterer handler. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Ecore__Idle__Group_gadc4e81cb020047be0f8f36db6d942ed3}{Ecore\+\_\+\+Idle\+\_\+\+Enterer}} $\ast$ \mbox{\hyperlink{group__Ecore__Idle__Group_ga6aa00afaecb0a5a29add3bb92f534a0d}{ecore\+\_\+idle\+\_\+enterer\+\_\+before\+\_\+add}} (\mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga8a36ef1ac24bfa317a7826617264e530}{Ecore\+\_\+\+Task\+\_\+\+Cb}} func, const void $\ast$data)
\begin{DoxyCompactList}\small\item\em Adds an idle enterer handler at the start of the list so it gets called earlier than others. \end{DoxyCompactList}\item 
void $\ast$ \mbox{\hyperlink{group__Ecore__Idle__Group_ga7e1106729c49d0cd714ef58e0343470c}{ecore\+\_\+idle\+\_\+enterer\+\_\+del}} (\mbox{\hyperlink{group__Ecore__Idle__Group_gadc4e81cb020047be0f8f36db6d942ed3}{Ecore\+\_\+\+Idle\+\_\+\+Enterer}} $\ast$idle\+\_\+enterer)
\begin{DoxyCompactList}\small\item\em Deletes an idle enterer callback. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Ecore__Idle__Group_gaa07d755d135454aa97625464aab4adf8}{Ecore\+\_\+\+Idle\+\_\+\+Exiter}} $\ast$ \mbox{\hyperlink{group__Ecore__Idle__Group_ga4bbd02660dd2b36a2da262a9bda3dfb4}{ecore\+\_\+idle\+\_\+exiter\+\_\+add}} (\mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga8a36ef1ac24bfa317a7826617264e530}{Ecore\+\_\+\+Task\+\_\+\+Cb}} func, const void $\ast$data)
\begin{DoxyCompactList}\small\item\em Adds an idle exiter handler. \end{DoxyCompactList}\item 
void $\ast$ \mbox{\hyperlink{group__Ecore__Idle__Group_ga89b7d6e94230fcbc331258f7aedf6010}{ecore\+\_\+idle\+\_\+exiter\+\_\+del}} (\mbox{\hyperlink{group__Ecore__Idle__Group_gaa07d755d135454aa97625464aab4adf8}{Ecore\+\_\+\+Idle\+\_\+\+Exiter}} $\ast$idle\+\_\+exiter)
\begin{DoxyCompactList}\small\item\em Deletes an idle exiter handler from the list to be run on exiting idle state. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
The idler functionality in Ecore allows for callbacks to be called when the program isn\textquotesingle{}t handling \mbox{\hyperlink{group__Ecore__Event__Group}{events}}, \mbox{\hyperlink{group__Ecore__Timer__Group}{timers}} or \mbox{\hyperlink{group__Ecore__FD__Handler__Group}{fd handlers}}. 

There are three types of idlers\+: Enterers, Idlers(proper) and Exiters. They are called, respectively, when the program is about to enter an idle state, when the program is in an idle state and when the program has just left an idle state and will begin processing \mbox{\hyperlink{group__Ecore__Event__Group}{events}}, \mbox{\hyperlink{group__Ecore__Timer__Group}{timers}} or \mbox{\hyperlink{group__Ecore__FD__Handler__Group}{fd handlers}}.

Enterer callbacks are good for updating your program\textquotesingle{}s state, if it has a state engine. Once all of the enterer handlers are called, the program will enter a \char`\"{}sleeping\char`\"{} state.

Idler callbacks are called when the main loop has called all enterer handlers. They are useful for interfaces that require polling and timers would be too slow to use.

Exiter callbacks are called when the main loop wakes up from an idle state.

If no idler callbacks are specified, then the process literally goes to sleep. Otherwise, the idler callbacks are called continuously while the loop is \char`\"{}idle\char`\"{}, using as much C\+PU as is available to the process.

\begin{DoxyNote}{Note}
Idle state doesn\textquotesingle{}t mean that the {\bfseries{program}} is idle, but that the {\bfseries{main loop}} is idle. It doesn\textquotesingle{}t have any timers, events, fd handlers or anything else to process (which in most {\itshape event driven} programs also means that the {\bfseries{program}} is idle too, but it\textquotesingle{}s not a rule). The program itself may be doing a lot of processing in the idler, or in another thread, for example.
\end{DoxyNote}
Example with functions that deal with idle state\+:

\begin{DoxyItemize}
\item \mbox{\hyperlink{ecore_idler_example_c}{ecore idle state -\/ Idlers, enterers and exiters}} \end{DoxyItemize}


\doxysubsection{Function Documentation}
\mbox{\Hypertarget{group__Ecore__Idle__Group_ga048ed35688c416f1f495912a900e9297}\label{group__Ecore__Idle__Group_ga048ed35688c416f1f495912a900e9297}} 
\index{Ecore Idle functions@{Ecore Idle functions}!ecore\_idler\_add@{ecore\_idler\_add}}
\index{ecore\_idler\_add@{ecore\_idler\_add}!Ecore Idle functions@{Ecore Idle functions}}
\doxysubsubsection{\texorpdfstring{ecore\_idler\_add()}{ecore\_idler\_add()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Ecore__Idle__Group_gae4e7f2215a6e8cff3e2eab2582b5868e}{Ecore\+\_\+\+Idler}}$\ast$ ecore\+\_\+idler\+\_\+add (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga8a36ef1ac24bfa317a7826617264e530}{Ecore\+\_\+\+Task\+\_\+\+Cb}}}]{func,  }\item[{const void $\ast$}]{data }\end{DoxyParamCaption})}



Adds an idler handler. 


\begin{DoxyParams}{Parameters}
{\em func} & The function to call when idling. \\
\hline
{\em data} & The data to be passed to this {\ttfamily func} call. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A idler handle if successfully added, {\ttfamily N\+U\+LL} otherwise.
\end{DoxyReturn}
Add an idler handle to the event loop, returning a handle on success and {\ttfamily N\+U\+LL} otherwise. The function {\ttfamily func} will be called repeatedly while no other events are ready to be processed, as long as it returns {\ttfamily 1} (or {\ttfamily E\+C\+O\+R\+E\+\_\+\+C\+A\+L\+L\+B\+A\+C\+K\+\_\+\+R\+E\+N\+EW}). A return of {\ttfamily 0} (or {\ttfamily E\+C\+O\+R\+E\+\_\+\+C\+A\+L\+L\+B\+A\+C\+K\+\_\+\+C\+A\+N\+C\+EL}) deletes the idler.

Idlers are useful for progressively processing data without blocking. \mbox{\Hypertarget{group__Ecore__Idle__Group_gaf7b5ec4cc0d26179c1b5e3ee907e5d58}\label{group__Ecore__Idle__Group_gaf7b5ec4cc0d26179c1b5e3ee907e5d58}} 
\index{Ecore Idle functions@{Ecore Idle functions}!ecore\_idler\_del@{ecore\_idler\_del}}
\index{ecore\_idler\_del@{ecore\_idler\_del}!Ecore Idle functions@{Ecore Idle functions}}
\doxysubsubsection{\texorpdfstring{ecore\_idler\_del()}{ecore\_idler\_del()}}
{\footnotesize\ttfamily void$\ast$ ecore\+\_\+idler\+\_\+del (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Ecore__Idle__Group_gae4e7f2215a6e8cff3e2eab2582b5868e}{Ecore\+\_\+\+Idler}} $\ast$}]{idler }\end{DoxyParamCaption})}



Deletes an idler callback from the list to be executed. 


\begin{DoxyParams}{Parameters}
{\em idler} & The handle of the idler callback to delete \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The data pointer passed to the idler callback on success, {\ttfamily N\+U\+LL} otherwise. 
\end{DoxyReturn}
\mbox{\Hypertarget{group__Ecore__Idle__Group_ga0805b9840716bd08ae44956dba8de3e6}\label{group__Ecore__Idle__Group_ga0805b9840716bd08ae44956dba8de3e6}} 
\index{Ecore Idle functions@{Ecore Idle functions}!ecore\_idle\_enterer\_add@{ecore\_idle\_enterer\_add}}
\index{ecore\_idle\_enterer\_add@{ecore\_idle\_enterer\_add}!Ecore Idle functions@{Ecore Idle functions}}
\doxysubsubsection{\texorpdfstring{ecore\_idle\_enterer\_add()}{ecore\_idle\_enterer\_add()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Ecore__Idle__Group_gadc4e81cb020047be0f8f36db6d942ed3}{Ecore\+\_\+\+Idle\+\_\+\+Enterer}}$\ast$ ecore\+\_\+idle\+\_\+enterer\+\_\+add (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga8a36ef1ac24bfa317a7826617264e530}{Ecore\+\_\+\+Task\+\_\+\+Cb}}}]{func,  }\item[{const void $\ast$}]{data }\end{DoxyParamCaption})}



Adds an idle enterer handler. 


\begin{DoxyParams}{Parameters}
{\em func} & The function to call when entering an idle state. \\
\hline
{\em data} & The data to be passed to the {\ttfamily func} call \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A handle to the idle enterer callback if successful. Otherwise, {\ttfamily N\+U\+LL} is returned. 
\end{DoxyReturn}
\begin{DoxyNote}{Note}
The function func will be called every time the main loop is entering idle state, as long as it returns {\ttfamily 1} (or {\ttfamily E\+C\+O\+R\+E\+\_\+\+C\+A\+L\+L\+B\+A\+C\+K\+\_\+\+R\+E\+N\+EW}). A return of {\ttfamily 0} (or {\ttfamily E\+C\+O\+R\+E\+\_\+\+C\+A\+L\+L\+B\+A\+C\+K\+\_\+\+C\+A\+N\+C\+EL}) deletes the idle enterer. 
\end{DoxyNote}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{ecore_idler_example_8c-example}{ecore\+\_\+idler\+\_\+example.\+c}}.\end{Desc}


Referenced by ecore\+\_\+evas\+\_\+init(), eldbus\+\_\+name\+\_\+owner\+\_\+changed\+\_\+callback\+\_\+add(), and eldbus\+\_\+service\+\_\+property\+\_\+changed().

\mbox{\Hypertarget{group__Ecore__Idle__Group_ga6aa00afaecb0a5a29add3bb92f534a0d}\label{group__Ecore__Idle__Group_ga6aa00afaecb0a5a29add3bb92f534a0d}} 
\index{Ecore Idle functions@{Ecore Idle functions}!ecore\_idle\_enterer\_before\_add@{ecore\_idle\_enterer\_before\_add}}
\index{ecore\_idle\_enterer\_before\_add@{ecore\_idle\_enterer\_before\_add}!Ecore Idle functions@{Ecore Idle functions}}
\doxysubsubsection{\texorpdfstring{ecore\_idle\_enterer\_before\_add()}{ecore\_idle\_enterer\_before\_add()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Ecore__Idle__Group_gadc4e81cb020047be0f8f36db6d942ed3}{Ecore\+\_\+\+Idle\+\_\+\+Enterer}}$\ast$ ecore\+\_\+idle\+\_\+enterer\+\_\+before\+\_\+add (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga8a36ef1ac24bfa317a7826617264e530}{Ecore\+\_\+\+Task\+\_\+\+Cb}}}]{func,  }\item[{const void $\ast$}]{data }\end{DoxyParamCaption})}



Adds an idle enterer handler at the start of the list so it gets called earlier than others. 


\begin{DoxyParams}{Parameters}
{\em func} & The function to call when entering an idle state. \\
\hline
{\em data} & The data to be passed to the {\ttfamily func} call \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A handle to the idle enterer callback if successful. Otherwise, {\ttfamily N\+U\+LL} is returned. 
\end{DoxyReturn}
\begin{DoxyNote}{Note}
The function func will be called every time the main loop is entering idle state, as long as it returns {\ttfamily 1} (or {\ttfamily E\+C\+O\+R\+E\+\_\+\+C\+A\+L\+L\+B\+A\+C\+K\+\_\+\+R\+E\+N\+EW}). A return of {\ttfamily 0} (or {\ttfamily E\+C\+O\+R\+E\+\_\+\+C\+A\+L\+L\+B\+A\+C\+K\+\_\+\+C\+A\+N\+C\+EL}) deletes the idle enterer. 
\end{DoxyNote}


References efl\+\_\+event\+\_\+callback\+\_\+array\+\_\+del(), and efl\+\_\+event\+\_\+callback\+\_\+array\+\_\+priority\+\_\+add().

\mbox{\Hypertarget{group__Ecore__Idle__Group_ga7e1106729c49d0cd714ef58e0343470c}\label{group__Ecore__Idle__Group_ga7e1106729c49d0cd714ef58e0343470c}} 
\index{Ecore Idle functions@{Ecore Idle functions}!ecore\_idle\_enterer\_del@{ecore\_idle\_enterer\_del}}
\index{ecore\_idle\_enterer\_del@{ecore\_idle\_enterer\_del}!Ecore Idle functions@{Ecore Idle functions}}
\doxysubsubsection{\texorpdfstring{ecore\_idle\_enterer\_del()}{ecore\_idle\_enterer\_del()}}
{\footnotesize\ttfamily void$\ast$ ecore\+\_\+idle\+\_\+enterer\+\_\+del (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Ecore__Idle__Group_gadc4e81cb020047be0f8f36db6d942ed3}{Ecore\+\_\+\+Idle\+\_\+\+Enterer}} $\ast$}]{idle\+\_\+enterer }\end{DoxyParamCaption})}



Deletes an idle enterer callback. 


\begin{DoxyParams}{Parameters}
{\em idle\+\_\+enterer} & The idle enterer to delete \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The data pointer passed to the idler enterer callback on success. {\ttfamily N\+U\+LL} otherwise. 
\end{DoxyReturn}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{ecore_idler_example_8c-example}{ecore\+\_\+idler\+\_\+example.\+c}}.\end{Desc}


Referenced by eldbus\+\_\+name\+\_\+owner\+\_\+changed\+\_\+callback\+\_\+del(), and eldbus\+\_\+service\+\_\+object\+\_\+manager\+\_\+attach().

\mbox{\Hypertarget{group__Ecore__Idle__Group_ga4bbd02660dd2b36a2da262a9bda3dfb4}\label{group__Ecore__Idle__Group_ga4bbd02660dd2b36a2da262a9bda3dfb4}} 
\index{Ecore Idle functions@{Ecore Idle functions}!ecore\_idle\_exiter\_add@{ecore\_idle\_exiter\_add}}
\index{ecore\_idle\_exiter\_add@{ecore\_idle\_exiter\_add}!Ecore Idle functions@{Ecore Idle functions}}
\doxysubsubsection{\texorpdfstring{ecore\_idle\_exiter\_add()}{ecore\_idle\_exiter\_add()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Ecore__Idle__Group_gaa07d755d135454aa97625464aab4adf8}{Ecore\+\_\+\+Idle\+\_\+\+Exiter}}$\ast$ ecore\+\_\+idle\+\_\+exiter\+\_\+add (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga8a36ef1ac24bfa317a7826617264e530}{Ecore\+\_\+\+Task\+\_\+\+Cb}}}]{func,  }\item[{const void $\ast$}]{data }\end{DoxyParamCaption})}



Adds an idle exiter handler. 


\begin{DoxyParams}{Parameters}
{\em func} & The function to call when exiting an idle state. \\
\hline
{\em data} & The data to be passed to the {\ttfamily func} call. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A handle to the idle exiter callback on success. {\ttfamily N\+U\+LL} otherwise. 
\end{DoxyReturn}
\begin{DoxyNote}{Note}
The function func will be called every time the main loop is exiting idle state, as long as it returns {\ttfamily 1} (or {\ttfamily E\+C\+O\+R\+E\+\_\+\+C\+A\+L\+L\+B\+A\+C\+K\+\_\+\+R\+E\+N\+EW}). A return of {\ttfamily 0} (or {\ttfamily E\+C\+O\+R\+E\+\_\+\+C\+A\+L\+L\+B\+A\+C\+K\+\_\+\+C\+A\+N\+C\+EL}) deletes the idle exiter. 
\end{DoxyNote}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{ecore_idler_example_8c-example}{ecore\+\_\+idler\+\_\+example.\+c}}.\end{Desc}


Referenced by ecore\+\_\+evas\+\_\+init().

\mbox{\Hypertarget{group__Ecore__Idle__Group_ga89b7d6e94230fcbc331258f7aedf6010}\label{group__Ecore__Idle__Group_ga89b7d6e94230fcbc331258f7aedf6010}} 
\index{Ecore Idle functions@{Ecore Idle functions}!ecore\_idle\_exiter\_del@{ecore\_idle\_exiter\_del}}
\index{ecore\_idle\_exiter\_del@{ecore\_idle\_exiter\_del}!Ecore Idle functions@{Ecore Idle functions}}
\doxysubsubsection{\texorpdfstring{ecore\_idle\_exiter\_del()}{ecore\_idle\_exiter\_del()}}
{\footnotesize\ttfamily void$\ast$ ecore\+\_\+idle\+\_\+exiter\+\_\+del (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Ecore__Idle__Group_gaa07d755d135454aa97625464aab4adf8}{Ecore\+\_\+\+Idle\+\_\+\+Exiter}} $\ast$}]{idle\+\_\+exiter }\end{DoxyParamCaption})}



Deletes an idle exiter handler from the list to be run on exiting idle state. 


\begin{DoxyParams}{Parameters}
{\em idle\+\_\+exiter} & The idle exiter to delete \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The data pointer that was being being passed to the handler if successful. {\ttfamily N\+U\+LL} otherwise. 
\end{DoxyReturn}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{ecore_idler_example_8c-example}{ecore\+\_\+idler\+\_\+example.\+c}}.\end{Desc}
