\hypertarget{group__Evas__Output__Method}{}\section{Render Engine Functions}
\label{group__Evas__Output__Method}\index{Render Engine Functions@{Render Engine Functions}}


Functions that are used to set the render engine for a given function, and then get that engine working.  


\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{group__Evas__Output__Method_ga9f9871fdcc40ce1062d6565308020eb8}{evas\+\_\+render\+\_\+method\+\_\+lookup} (const char $\ast$name)
\begin{DoxyCompactList}\small\item\em Look up a numeric ID from a string name of a rendering engine. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__List__Group_ga3295e1210efea1fb0fd6acbf3cbc1f29}{Eina\+\_\+\+List} $\ast$ \hyperlink{group__Evas__Output__Method_gad7deab8facaa4be521fbdec6dd19e122}{evas\+\_\+render\+\_\+method\+\_\+list} (void)
\begin{DoxyCompactList}\small\item\em List all the rendering engines compiled into the copy of the Evas library. \end{DoxyCompactList}\item 
void \hyperlink{group__Evas__Output__Method_ga5bcc5a2165647f855c389bd58e77f608}{evas\+\_\+render\+\_\+method\+\_\+list\+\_\+free} (\hyperlink{group__Eina__List__Group_ga3295e1210efea1fb0fd6acbf3cbc1f29}{Eina\+\_\+\+List} $\ast$list)
\begin{DoxyCompactList}\small\item\em This function should be called to free a list of engine names. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Functions that are used to set the render engine for a given function, and then get that engine working. 

The following code snippet shows how they can be used to initialise an evas that uses the X11 software engine\+: 
\begin{DoxyCode}
\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas} *evas;
Evas\_Engine\_Info\_Software\_X11 *einfo;
\textcolor{keyword}{extern} Display *display;
\textcolor{keyword}{extern} Window win;

\hyperlink{group__Evas__Main__Group_ga65b3f060b6dd9e488afd0b8cbe101869}{evas\_init}();

evas = \hyperlink{group__Evas__Canvas_ga67e8eb17d2a676bfdfb8794fc5f72bc0}{evas\_new}();
\hyperlink{group__Evas__Canvas_ga17f2ac9f3bef135cd825774c33762ef2}{evas\_output\_method\_set}(evas, \hyperlink{group__Evas__Output__Method_ga9f9871fdcc40ce1062d6565308020eb8}{evas\_render\_method\_lookup}(\textcolor{stringliteral}{"
      software\_x11"}));
\hyperlink{group__Evas__Canvas_ga681f2af7d325735af201e18f56f6ef61}{evas\_output\_size\_set}(evas, 640, 480);
\hyperlink{group__Evas__Canvas_ga0a14db31aa30b701688caf67a4649239}{evas\_output\_viewport\_set}(evas, 0, 0, 640, 480);
einfo = (Evas\_Engine\_Info\_Software\_X11 *)\hyperlink{group__Evas__Canvas_ga33a6cd095bc7499dbfcb39ad253607b1}{evas\_engine\_info\_get}(evas);
einfo->info.display = display;
einfo->info.visual = DefaultVisual(display, DefaultScreen(display));
einfo->info.colormap = DefaultColormap(display, DefaultScreen(display));
einfo->info.drawable = win;
einfo->info.depth = DefaultDepth(display, DefaultScreen(display));
\hyperlink{group__Evas__Canvas_ga7244385cf5bad0591ab82e4437c4694b}{evas\_engine\_info\_set}(evas, (\hyperlink{struct__Evas__Engine__Info}{Evas\_Engine\_Info} *)einfo);
\end{DoxyCode}
 

\subsection{Function Documentation}
\mbox{\Hypertarget{group__Evas__Output__Method_ga9f9871fdcc40ce1062d6565308020eb8}\label{group__Evas__Output__Method_ga9f9871fdcc40ce1062d6565308020eb8}} 
\index{Render Engine Functions@{Render Engine Functions}!evas\+\_\+render\+\_\+method\+\_\+lookup@{evas\+\_\+render\+\_\+method\+\_\+lookup}}
\index{evas\+\_\+render\+\_\+method\+\_\+lookup@{evas\+\_\+render\+\_\+method\+\_\+lookup}!Render Engine Functions@{Render Engine Functions}}
\subsubsection{\texorpdfstring{evas\+\_\+render\+\_\+method\+\_\+lookup()}{evas\_render\_method\_lookup()}}
{\footnotesize\ttfamily int evas\+\_\+render\+\_\+method\+\_\+lookup (\begin{DoxyParamCaption}\item[{const char $\ast$}]{name }\end{DoxyParamCaption})}



Look up a numeric ID from a string name of a rendering engine. 


\begin{DoxyParams}{Parameters}
{\em name} & the name string of an engine \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A numeric (opaque) ID for the rendering engine
\end{DoxyReturn}
This function looks up a numeric return value for the named engine in the string {\ttfamily name}. This is a normal C string, N\+UL byte terminated. The name is case sensitive. If the rendering engine is available, a numeric ID for that engine is returned that is not 0. If the engine is not available, 0 is returned, indicating an invalid engine.

The programmer should N\+E\+V\+ER rely on the numeric ID of an engine unless it is returned by this function. Programs should N\+OT be written accessing render method ID\textquotesingle{}s directly, without first obtaining it from this function.

\begin{DoxyAttention}{Attention}
it is mandatory that one calls \hyperlink{group__Evas__Main__Group_ga65b3f060b6dd9e488afd0b8cbe101869}{evas\+\_\+init()} before looking up the render method.
\end{DoxyAttention}
Example\+: 
\begin{DoxyCode}
\textcolor{keywordtype}{int} engine\_id;
\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas} *evas;

\hyperlink{group__Evas__Main__Group_ga65b3f060b6dd9e488afd0b8cbe101869}{evas\_init}();

evas = \hyperlink{group__Evas__Canvas_ga67e8eb17d2a676bfdfb8794fc5f72bc0}{evas\_new}();
\textcolor{keywordflow}{if} (!evas)
  \{
    fprintf(stderr, \textcolor{stringliteral}{"ERROR: Canvas creation failed. Fatal error.\(\backslash\)n"});
    exit(-1);
  \}
engine\_id = \hyperlink{group__Evas__Output__Method_ga9f9871fdcc40ce1062d6565308020eb8}{evas\_render\_method\_lookup}(\textcolor{stringliteral}{"software\_x11"});
\textcolor{keywordflow}{if} (!engine\_id)
  \{
    fprintf(stderr, \textcolor{stringliteral}{"ERROR: Requested rendering engine is absent.\(\backslash\)n"});
    exit(-1);
  \}
\hyperlink{group__Evas__Canvas_ga17f2ac9f3bef135cd825774c33762ef2}{evas\_output\_method\_set}(evas, engine\_id);
\end{DoxyCode}
 

Referenced by ecore\+\_\+evas\+\_\+ews\+\_\+new().

\mbox{\Hypertarget{group__Evas__Output__Method_gad7deab8facaa4be521fbdec6dd19e122}\label{group__Evas__Output__Method_gad7deab8facaa4be521fbdec6dd19e122}} 
\index{Render Engine Functions@{Render Engine Functions}!evas\+\_\+render\+\_\+method\+\_\+list@{evas\+\_\+render\+\_\+method\+\_\+list}}
\index{evas\+\_\+render\+\_\+method\+\_\+list@{evas\+\_\+render\+\_\+method\+\_\+list}!Render Engine Functions@{Render Engine Functions}}
\subsubsection{\texorpdfstring{evas\+\_\+render\+\_\+method\+\_\+list()}{evas\_render\_method\_list()}}
{\footnotesize\ttfamily \hyperlink{group__Eina__List__Group_ga3295e1210efea1fb0fd6acbf3cbc1f29}{Eina\+\_\+\+List}$\ast$ evas\+\_\+render\+\_\+method\+\_\+list (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



List all the rendering engines compiled into the copy of the Evas library. 

\begin{DoxyReturn}{Returns}
A linked list whose data members are C strings of engine names
\end{DoxyReturn}
Calling this will return a handle (pointer) to an Evas linked list. Each node in the linked list will have the data pointer be a (char $\ast$) pointer to the name string of the rendering engine available. The strings should never be modified, neither should the list be modified. This list should be cleaned up as soon as the program no longer needs it using \hyperlink{group__Evas__Output__Method_ga5bcc5a2165647f855c389bd58e77f608}{evas\+\_\+render\+\_\+method\+\_\+list\+\_\+free()}. If no engines are available from Evas, {\ttfamily N\+U\+LL} will be returned.

Example\+: 
\begin{DoxyCode}
\hyperlink{struct__Eina__List}{Eina\_List} *engine\_list, *l;
\textcolor{keywordtype}{char} *engine\_name;

engine\_list = \hyperlink{group__Evas__Output__Method_gad7deab8facaa4be521fbdec6dd19e122}{evas\_render\_method\_list}();
\textcolor{keywordflow}{if} (!engine\_list)
  \{
    fprintf(stderr, \textcolor{stringliteral}{"ERROR: Evas supports no engines! Exit.\(\backslash\)n"});
    exit(-1);
  \}
printf(\textcolor{stringliteral}{"Available Evas Engines:\(\backslash\)n"});
\hyperlink{group__Eina__List__Group_gad02f746a08ee0b12b7ed66d4bc0d71d8}{EINA\_LIST\_FOREACH}(engine\_list, l, engine\_name)
  printf(\textcolor{stringliteral}{"%s\(\backslash\)n"}, engine\_name);
\hyperlink{group__Evas__Output__Method_ga5bcc5a2165647f855c389bd58e77f608}{evas\_render\_method\_list\_free}(engine\_list);
\end{DoxyCode}
 \mbox{\Hypertarget{group__Evas__Output__Method_ga5bcc5a2165647f855c389bd58e77f608}\label{group__Evas__Output__Method_ga5bcc5a2165647f855c389bd58e77f608}} 
\index{Render Engine Functions@{Render Engine Functions}!evas\+\_\+render\+\_\+method\+\_\+list\+\_\+free@{evas\+\_\+render\+\_\+method\+\_\+list\+\_\+free}}
\index{evas\+\_\+render\+\_\+method\+\_\+list\+\_\+free@{evas\+\_\+render\+\_\+method\+\_\+list\+\_\+free}!Render Engine Functions@{Render Engine Functions}}
\subsubsection{\texorpdfstring{evas\+\_\+render\+\_\+method\+\_\+list\+\_\+free()}{evas\_render\_method\_list\_free()}}
{\footnotesize\ttfamily void evas\+\_\+render\+\_\+method\+\_\+list\+\_\+free (\begin{DoxyParamCaption}\item[{\hyperlink{group__Eina__List__Group_ga3295e1210efea1fb0fd6acbf3cbc1f29}{Eina\+\_\+\+List} $\ast$}]{list }\end{DoxyParamCaption})}



This function should be called to free a list of engine names. 


\begin{DoxyParams}{Parameters}
{\em list} & The Eina\+\_\+\+List base pointer for the engine list to be freed\\
\hline
\end{DoxyParams}
When this function is called it will free the engine list passed in as {\ttfamily list}. The list should only be a list of engines generated by calling \hyperlink{group__Evas__Output__Method_gad7deab8facaa4be521fbdec6dd19e122}{evas\+\_\+render\+\_\+method\+\_\+list()}. If {\ttfamily list} is N\+U\+LL, nothing will happen.

Example\+: 
\begin{DoxyCode}
\hyperlink{struct__Eina__List}{Eina\_List} *engine\_list, *l;
\textcolor{keywordtype}{char} *engine\_name;

engine\_list = \hyperlink{group__Evas__Output__Method_gad7deab8facaa4be521fbdec6dd19e122}{evas\_render\_method\_list}();
\textcolor{keywordflow}{if} (!engine\_list)
  \{
    fprintf(stderr, \textcolor{stringliteral}{"ERROR: Evas supports no engines! Exit.\(\backslash\)n"});
    exit(-1);
  \}
printf(\textcolor{stringliteral}{"Available Evas Engines:\(\backslash\)n"});
\hyperlink{group__Eina__List__Group_gad02f746a08ee0b12b7ed66d4bc0d71d8}{EINA\_LIST\_FOREACH}(engine\_list, l, engine\_name)
  printf(\textcolor{stringliteral}{"%s\(\backslash\)n"}, engine\_name);
\hyperlink{group__Evas__Output__Method_ga5bcc5a2165647f855c389bd58e77f608}{evas\_render\_method\_list\_free}(engine\_list);
\end{DoxyCode}
 

References E\+I\+N\+A\+\_\+\+L\+I\+S\+T\+\_\+\+F\+R\+EE, and eina\+\_\+stringshare\+\_\+del().

