\section{flip\-\_\-example\-\_\-01.\-c}

\begin{DoxyCodeInclude}
\textcolor{comment}{//Compile with:}
\textcolor{comment}{//gcc -o flip\_example\_01 flip\_example\_01.c -g `pkg-config --cflags --libs elementary`}

\textcolor{preprocessor}{#include <Elementary.h>}

\textcolor{keyword}{static} \textcolor{keywordtype}{void} \_change\_interaction(\textcolor{keywordtype}{void} *data, Evas\_Object *obj, \textcolor{keywordtype}{void} *event\_info);

EAPI\_MAIN \textcolor{keywordtype}{int}
elm\_main(\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char} **argv)
\{
   Evas\_Object *win, *rect, *rect2, *flip, *radio, *radio2, *radio3;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add(\textcolor{stringliteral}{"flip"}, \textcolor{stringliteral}{"Flip"});
   elm_win_autodel_set(win, EINA\_TRUE);

   rect = evas\_object\_rectangle\_add(evas\_object\_evas\_get(win));
   evas\_object\_resize(rect, 150, 150);
   evas\_object\_color\_set(rect, 0, 0, 255, 255);
   evas\_object\_show(rect);

   rect2 = evas\_object\_rectangle\_add(evas\_object\_evas\_get(win));
   evas\_object\_color\_set(rect2, 0, 255, 0, 255);
   evas\_object\_show(rect2);

   flip = elm_flip_add(win);
   elm_object_part_content_set(flip, \textcolor{stringliteral}{"front"}, rect);
   elm_object_part_content_set(flip, \textcolor{stringliteral}{"back"}, rect2);
   evas\_object\_resize(flip, 150, 150);
   evas\_object\_move(flip, 10, 10);
   evas\_object\_show(flip);

   elm_flip_interaction_set(flip, ELM\_FLIP\_INTERACTION\_PAGE);
   elm_flip_interaction_direction_enabled_set(flip, ELM\_FLIP\_DIRECTION\_UP, EINA\_TRUE);
   elm_flip_interaction_direction_enabled_set(flip, ELM\_FLIP\_DIRECTION\_DOWN, EINA\_TRUE);
   elm_flip_interaction_direction_enabled_set(flip, ELM\_FLIP\_DIRECTION\_LEFT, EINA\_TRUE);
   elm_flip_interaction_direction_enabled_set(flip, ELM\_FLIP\_DIRECTION\_RIGHT, EINA\_TRUE);
   elm_flip_interaction_direction_hitsize_set(flip, ELM\_FLIP\_DIRECTION\_UP, 1);
   elm_flip_interaction_direction_hitsize_set(flip, ELM\_FLIP\_DIRECTION\_DOWN, 1);
   elm_flip_interaction_direction_hitsize_set(flip, ELM\_FLIP\_DIRECTION\_LEFT, 1);
   elm_flip_interaction_direction_hitsize_set(flip, ELM\_FLIP\_DIRECTION\_RIGHT, 1);

   radio = elm_radio_add(win);
   elm\_object\_text\_set(radio, \textcolor{stringliteral}{"page"});
   elm_radio_value_set(radio, ELM\_FLIP\_INTERACTION\_PAGE);
   elm_radio_state_value_set(radio, ELM\_FLIP\_INTERACTION\_PAGE);
   evas\_object\_resize(radio, 55, 30);
   evas\_object\_move(radio, 10, 160);
   evas\_object\_show(radio);
   evas\_object\_smart\_callback\_add(radio, \textcolor{stringliteral}{"changed"}, \_change\_interaction, flip);

   radio2 = elm_radio_add(win);
   elm\_object\_text\_set(radio2, \textcolor{stringliteral}{"cube"});
   elm_radio_state_value_set(radio2, ELM\_FLIP\_INTERACTION\_CUBE);
   elm_radio_group_add(radio2, radio);
   evas\_object\_resize(radio2, 55, 30);
   evas\_object\_move(radio2, 75, 160);
   evas\_object\_show(radio2);
   evas\_object\_smart\_callback\_add(radio2, \textcolor{stringliteral}{"changed"}, \_change\_interaction, flip);

   radio3 = elm_radio_add(win);
   elm\_object\_text\_set(radio3, \textcolor{stringliteral}{"rotate"});
   elm_radio_state_value_set(radio3, ELM\_FLIP\_INTERACTION\_ROTATE);
   elm_radio_group_add(radio3, radio);
   evas\_object\_resize(radio3, 55, 30);
   evas\_object\_move(radio3, 140, 160);
   evas\_object\_show(radio3);
   evas\_object\_smart\_callback\_add(radio3, \textcolor{stringliteral}{"changed"}, \_change\_interaction, flip);

   evas\_object\_resize(win, 200, 200);
   evas\_object\_show(win);

   elm_run();
   elm_shutdown();

   \textcolor{keywordflow}{return} 0;
\}
ELM_MAIN()

static \textcolor{keywordtype}{void}
\_change\_interaction(\textcolor{keywordtype}{void} *data, Evas\_Object *obj, \textcolor{keywordtype}{void} *event\_info)
\{
   elm_flip_interaction_set(data, elm_radio_state_value_get(obj));
   elm_flip_go(data, ELM\_FLIP\_ROTATE\_XZ\_CENTER\_AXIS);
\}
\end{DoxyCodeInclude}
 