\doxysection{prefs\+\_\+example\+\_\+03.\+c}
\hypertarget{prefs_example_03_8c-example}{}\label{prefs_example_03_8c-example}
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\textcolor{comment}{//Compile\ with:}}
\DoxyCodeLine{\textcolor{comment}{//gcc\ -\/o\ prefs\_example\_03\ prefs\_example\_03.c\ -\/g\ \`{}pkg-\/config\ -\/-\/cflags\ -\/-\/libs\ elementary`}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <Elementary.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#define\ WIDTH\ (500)}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define\ HEIGHT\ (700)}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define\ MSG\_ID\_VEL\ (1)}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_update\_animation(Evas\_Object\ *prefs,\ Evas\_Object\ *layout)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Eina__Value}{Eina\_Value}}\ value;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}\ animation;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ elm\_prefs\_item\_value\_get(prefs,\ \textcolor{stringliteral}{"{}main:config:options:animation"{}},\ \&value);}
\DoxyCodeLine{\ \ \ eina\_value\_get(\&value,\ \&animation);}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (animation)}
\DoxyCodeLine{\ \ \ \ \ \mbox{\hyperlink{group__Elm__Layout_gaa39b36a49850270dd692ce135b2979f3}{elm\_layout\_signal\_emit}}(layout,\ \textcolor{stringliteral}{"{}start"{}},\ \textcolor{stringliteral}{"{}animation"{}});}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\ \ \ \ \ \mbox{\hyperlink{group__Elm__Layout_gaa39b36a49850270dd692ce135b2979f3}{elm\_layout\_signal\_emit}}(layout,\ \textcolor{stringliteral}{"{}stop"{}},\ \textcolor{stringliteral}{"{}animation"{}});}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_update\_animation\_time(Evas\_Object\ *prefs,\ Evas\_Object\ *layout)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Eina__Value}{Eina\_Value}}\ value;}
\DoxyCodeLine{\ \ \ \textcolor{keywordtype}{float}\ animation\_time;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Edje__Message__Float}{Edje\_Message\_Float}}\ msg;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ elm\_prefs\_item\_value\_get(prefs,\ \textcolor{stringliteral}{"{}main:config:options:animation\_time"{}},\ \&value);}
\DoxyCodeLine{\ \ \ eina\_value\_get(\&value,\ \&animation\_time);}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (animation\_time\ <\ 0.01)\ animation\_time\ =\ 0.01;}
\DoxyCodeLine{\ \ \ msg.\mbox{\hyperlink{struct__Edje__Message__Float_a6f297371783ce318fa8d153b634a2b3e}{val}}\ =\ animation\_time;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Edje__Object__Communication__Interface__Message_gac89a6483d3197cbe6268c83b04e8b525}{edje\_object\_message\_send}}(\mbox{\hyperlink{group__Elm__Layout_ga1bdc387d277400861d72a3f6d43c5c03}{elm\_layout\_edje\_get}}(layout),\ \mbox{\hyperlink{group__Edje__Object__Communication__Interface__Message_ggad0763549d687c9cfc6df685ac077d967a137b317694c831ff5d34669e1f045f87}{EDJE\_MESSAGE\_FLOAT}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ MSG\_ID\_VEL,\ \&msg);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_update(Evas\_Object\ *prefs,\ Evas\_Object\ *layout)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \_update\_animation(prefs,\ layout);}
\DoxyCodeLine{\ \ \ \_update\_animation\_time(prefs,\ layout);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_page\_loaded\_cb(\textcolor{keywordtype}{void}\ *data,\ Evas\_Object\ *obj,\ \textcolor{keywordtype}{void}\ *event\_info\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ Evas\_Object\ *layout\ =\ data;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \_update(obj,\ layout);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_item\_changed\_cb(\textcolor{keywordtype}{void}\ *data,\ Evas\_Object\ *obj,\ \textcolor{keywordtype}{void}\ *event\_info)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *item\ =\ event\_info;}
\DoxyCodeLine{\ \ \ Evas\_Object\ *layout\ =\ data;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (!strcmp(item,\ \textcolor{stringliteral}{"{}main:config:options:animation\_time"{}}))}
\DoxyCodeLine{\ \ \ \ \ \_update\_animation\_time(obj,\ layout);}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp(item,\ \textcolor{stringliteral}{"{}main:config:options:animation"{}}))}
\DoxyCodeLine{\ \ \ \ \ \_update\_animation(obj,\ layout);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{EAPI\_MAIN\ \textcolor{keywordtype}{int}}
\DoxyCodeLine{elm\_main(\textcolor{keywordtype}{int}\ argc\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \textcolor{keywordtype}{char}\ **argv\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ Evas\_Object\ *win,\ *prefs,\ *layout;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Prefs_ga7e2cbea5a9696262669748533f578a53}{Elm\_Prefs\_Data}}\ *prefs\_data;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga7a05f37fd3a019da5e26c5fc91fcd937}{elm\_policy\_set}}(\mbox{\hyperlink{group__Elm__General_ggaa16f3378ecdbf660fa378402e3c5a0a9a02fadb6faada04b19d0fa42c11a8d32a}{ELM\_POLICY\_QUIT}},\ \mbox{\hyperlink{group__Elm__General_gga46af37e6ac2c406321060be827117196abbe0962d88ae12afe1a173da881f56cd}{ELM\_POLICY\_QUIT\_LAST\_WINDOW\_CLOSED}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ win\ =\ \mbox{\hyperlink{group__Elm__Win__Group_ga23d9d1ffa0a65a1a1dd482d570db1ba0}{elm\_win\_util\_standard\_add}}(\textcolor{stringliteral}{"{}Prefs"{}},\ \textcolor{stringliteral}{"{}Prefs\ Example\ 03"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Win__Group_ga9a16a2f8c9fd5b6e9203ed9dcb53ea8b}{elm\_win\_autodel\_set}}(win,\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ layout\ =\ \mbox{\hyperlink{group__Elm__Layout_ga5bcf7d68b0401cc7d557ef7d297baa3e}{elm\_layout\_add}}(win);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Layout_ga8d1105463d52787a7b0ca8d7402cd3ea}{elm\_layout\_file\_set}}(layout,\ \textcolor{stringliteral}{"{}prefs\_example\_03.edj"{}},\ \textcolor{stringliteral}{"{}prefs\_edje"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ prefs\ =\ \mbox{\hyperlink{group__Elm__Prefs_ga403f94943d89e57101f034ed381c5134}{elm\_prefs\_add}}(win);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga9379629ad8ad2860aa786d838a4a106a}{evas\_object\_size\_hint\_weight\_set}}(prefs,\ \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}},\ \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(prefs,\ WIDTH,\ HEIGHT);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(prefs);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Smart__Object__Group_gac12dd6655f488cc47ce6cf00eb7d12b2}{evas\_object\_smart\_callback\_add}}(prefs,\ \textcolor{stringliteral}{"{}page,loaded"{}},\ \_page\_loaded\_cb,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ layout);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Smart__Object__Group_gac12dd6655f488cc47ce6cf00eb7d12b2}{evas\_object\_smart\_callback\_add}}(prefs,\ \textcolor{stringliteral}{"{}item,changed"{}},\ \_item\_changed\_cb,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ layout);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ elm\_prefs\_autosave\_set(prefs,\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ prefs\_data\ =}
\DoxyCodeLine{\ \ \ \ \ \ \mbox{\hyperlink{group__Elm__Prefs_ga3f5a79c40a17ca1565503a30f810c463}{elm\_prefs\_data\_new}}(\textcolor{stringliteral}{"{}./prefs\_example\_03.cfg"{}},\ NULL,\ \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a763d29c19960a4e0d4eb7bc7bb512481}{EET\_FILE\_MODE\_READ\_WRITE}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ elm\_prefs\_file\_set(prefs,\ \textcolor{stringliteral}{"{}prefs\_example\_03.epb"{}},\ NULL);}
\DoxyCodeLine{\ \ \ elm\_prefs\_data\_set(prefs,\ prefs\_data);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ elm\_prefs\_item\_swallow(prefs,\ \textcolor{stringliteral}{"{}main:swal"{}},\ layout);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \_update\_animation\_time(prefs,\ layout);}
\DoxyCodeLine{\ \ \ \_update\_animation(prefs,\ layout);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(win,\ WIDTH,\ HEIGHT);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(win);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_gadf2553f83e6b0b9c7fbe054019a664a1}{elm\_run}}();}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Prefs_ga6a6905e5914a263a4e0195bae6c0b37d}{elm\_prefs\_data\_unref}}(prefs\_data);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\}}
\DoxyCodeLine{\mbox{\hyperlink{group__Elm__General_ga50fe52d513f7e89c9c770afd76de7ad9}{ELM\_MAIN}}()}

\end{DoxyCodeInclude}
 