\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 {\bfseries 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 {\bfseries 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 {\bfseries Ecore\+\_\+\+Idle\+\_\+\+Exiter}
\begin{DoxyCompactList}\small\item\em A handle for idle exiters. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__Ecore__Idle__Group_gae4e7f2215a6e8cff3e2eab2582b5868e}{Ecore\+\_\+\+Idler}} $\ast$ \mbox{\hyperlink{group__Ecore__Idle__Group_gaaf001b1f13fb633d0f486feec76e026b}{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_ga6f02967cd088281dd3e6877296cb5090}{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_ga2120fcb2f5a5a3ead1e2c11f5424e4b8}{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_ga84ac2302fc2e051013284981a69de056}{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_gabdce29c943a3f6092e6de3d57eec47bc}{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_gade5eb53697d4d4f62d18314f2ce0d42a}{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_ga32d53388d9eefe74a6f910d7c0e636f2}{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 CPU 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_gaaf001b1f13fb633d0f486feec76e026b}\label{group__Ecore__Idle__Group_gaaf001b1f13fb633d0f486feec76e026b}} 
\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 NULL} otherwise.
\end{DoxyReturn}
Add an idler handle to the event loop, returning a handle on success and {\ttfamily NULL} 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 ECORE\+\_\+\+CALLBACK\+\_\+\+RENEW}). A return of {\ttfamily 0} (or {\ttfamily ECORE\+\_\+\+CALLBACK\+\_\+\+CANCEL}) deletes the idler.

Idlers are useful for progressively processing data without blocking. \mbox{\Hypertarget{group__Ecore__Idle__Group_ga6f02967cd088281dd3e6877296cb5090}\label{group__Ecore__Idle__Group_ga6f02967cd088281dd3e6877296cb5090}} 
\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 NULL} otherwise. 
\end{DoxyReturn}


Referenced by \mbox{\hyperlink{group__Ethumb__Basics_ga5aa34b809d0cb87db73f509ad8c9003c}{ethumb\+\_\+free()}}.

\mbox{\Hypertarget{group__Ecore__Idle__Group_ga2120fcb2f5a5a3ead1e2c11f5424e4b8}\label{group__Ecore__Idle__Group_ga2120fcb2f5a5a3ead1e2c11f5424e4b8}} 
\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 NULL} 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 ECORE\+\_\+\+CALLBACK\+\_\+\+RENEW}). A return of {\ttfamily 0} (or {\ttfamily ECORE\+\_\+\+CALLBACK\+\_\+\+CANCEL}) deletes the idle enterer. 
\end{DoxyNote}


Referenced by \mbox{\hyperlink{group__Ecore__Evas__Group_ga32ddbb6457033ad435a177eb0c4fe235}{ecore\+\_\+evas\+\_\+init()}}, \mbox{\hyperlink{group__Ecore__Wl__Init__Group_gaf158fc255ed0fbbe4721475a87d86828}{ecore\+\_\+wl\+\_\+init()}}, \mbox{\hyperlink{group__Eldbus__Basic_gaf405114e35fec59c14cef2203e9debd5}{eldbus\+\_\+name\+\_\+owner\+\_\+changed\+\_\+callback\+\_\+add()}}, and \mbox{\hyperlink{group__Eldbus__Service_ga51cfeabdb75e0f0413bb398f12769f67}{eldbus\+\_\+service\+\_\+property\+\_\+changed()}}.

\mbox{\Hypertarget{group__Ecore__Idle__Group_ga84ac2302fc2e051013284981a69de056}\label{group__Ecore__Idle__Group_ga84ac2302fc2e051013284981a69de056}} 
\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 NULL} 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 ECORE\+\_\+\+CALLBACK\+\_\+\+RENEW}). A return of {\ttfamily 0} (or {\ttfamily ECORE\+\_\+\+CALLBACK\+\_\+\+CANCEL}) deletes the idle enterer. 
\end{DoxyNote}
\mbox{\Hypertarget{group__Ecore__Idle__Group_gabdce29c943a3f6092e6de3d57eec47bc}\label{group__Ecore__Idle__Group_gabdce29c943a3f6092e6de3d57eec47bc}} 
\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 NULL} otherwise. 
\end{DoxyReturn}


Referenced by \mbox{\hyperlink{group__Ecore__Evas__Group_gab8fa311077f749190c9b622f672b2214}{ecore\+\_\+evas\+\_\+shutdown()}}, \mbox{\hyperlink{group__Eldbus__Basic_gac3c3b6f6b54ed74cfd7cd9b0ab5cfde1}{eldbus\+\_\+name\+\_\+owner\+\_\+changed\+\_\+callback\+\_\+del()}}, and \mbox{\hyperlink{group__Eldbus__Service_ga9ebf1302c3be4a23011477b6a2f1ae65}{eldbus\+\_\+service\+\_\+object\+\_\+manager\+\_\+attach()}}.

\mbox{\Hypertarget{group__Ecore__Idle__Group_gade5eb53697d4d4f62d18314f2ce0d42a}\label{group__Ecore__Idle__Group_gade5eb53697d4d4f62d18314f2ce0d42a}} 
\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 NULL} 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 ECORE\+\_\+\+CALLBACK\+\_\+\+RENEW}). A return of {\ttfamily 0} (or {\ttfamily ECORE\+\_\+\+CALLBACK\+\_\+\+CANCEL}) deletes the idle exiter. 
\end{DoxyNote}


Referenced by \mbox{\hyperlink{group__Ecore__Evas__Group_ga32ddbb6457033ad435a177eb0c4fe235}{ecore\+\_\+evas\+\_\+init()}}.

\mbox{\Hypertarget{group__Ecore__Idle__Group_ga32d53388d9eefe74a6f910d7c0e636f2}\label{group__Ecore__Idle__Group_ga32d53388d9eefe74a6f910d7c0e636f2}} 
\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 NULL} otherwise. 
\end{DoxyReturn}


Referenced by \mbox{\hyperlink{group__Ecore__Evas__Group_gab8fa311077f749190c9b622f672b2214}{ecore\+\_\+evas\+\_\+shutdown()}}.

