\hypertarget{flipselector_example_8c-example}{}\doxysection{flipselector\+\_\+example.\+c}

\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <Elementary.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *commands = \(\backslash\)}
\DoxyCodeLine{                              \textcolor{stringliteral}{"commands are:\(\backslash\)n"}}
\DoxyCodeLine{                              \textcolor{stringliteral}{"\(\backslash\)tn -\/ flip to next item\(\backslash\)n"}}
\DoxyCodeLine{                              \textcolor{stringliteral}{"\(\backslash\)tp -\/ flip to previous item\(\backslash\)n"}}
\DoxyCodeLine{                              \textcolor{stringliteral}{"\(\backslash\)tf -\/ print first item's label\(\backslash\)n"}}
\DoxyCodeLine{                              \textcolor{stringliteral}{"\(\backslash\)tl -\/ print last item's label\(\backslash\)n"}}
\DoxyCodeLine{                              \textcolor{stringliteral}{"\(\backslash\)ts -\/ print selected item's label\(\backslash\)n"}}
\DoxyCodeLine{                              \textcolor{stringliteral}{"\(\backslash\)th -\/ print help\(\backslash\)n"};}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{void} \textcolor{comment}{/* unselect the item shown in the flip selector */}}
\DoxyCodeLine{\_unsel\_cb(\textcolor{keywordtype}{void}        *data,}
\DoxyCodeLine{          \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{          \textcolor{keywordtype}{void}        *event\_info \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__General_ga13a0c231414b86e62f68afe3c6fb462b}{Elm\_Object\_Item}} *it;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *fp = data;}
\DoxyCodeLine{}
\DoxyCodeLine{   it = elm\_flipselector\_selected\_item\_get(fp);}
\DoxyCodeLine{   elm\_flipselector\_item\_selected\_set(it, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}});}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{void} \textcolor{comment}{/* delete the item shown in the flip selector */}}
\DoxyCodeLine{\_del\_cb(\textcolor{keywordtype}{void}        *data,}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{        \textcolor{keywordtype}{void}        *event\_info \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__General_ga13a0c231414b86e62f68afe3c6fb462b}{Elm\_Object\_Item}} *it;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *fp = data;}
\DoxyCodeLine{}
\DoxyCodeLine{   it = elm\_flipselector\_selected\_item\_get(fp);}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (it) \mbox{\hyperlink{group__Elm__General_gad1b5a0d41fa322b28000a290154ec3a4}{elm\_object\_item\_del}}(it);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{void} \textcolor{comment}{/* underflow callback */}}
\DoxyCodeLine{\_underflow\_cb(\textcolor{keywordtype}{void}        *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{              \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{              \textcolor{keywordtype}{void}        *event\_info \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"Underflow!\(\backslash\)n"});}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{void} \textcolor{comment}{/* overflow callback */}}
\DoxyCodeLine{\_overflow\_cb(\textcolor{keywordtype}{void}        *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{             \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{             \textcolor{keywordtype}{void}        *event\_info \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"Overflow!\(\backslash\)n"});}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_on\_keydown(\textcolor{keywordtype}{void}              *data,}
\DoxyCodeLine{            \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}       *\textcolor{keywordtype}{object} \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{            \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}       *src \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{            \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968}{Evas\_Callback\_Type}} type,}
\DoxyCodeLine{            \textcolor{keywordtype}{void}              *event\_info)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *fs = data;}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Evas__Event__Key__Down}{Evas\_Event\_Key\_Down}} *ev = event\_info;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (type != \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968a336b86bad4f145f84c155e4922335584}{EVAS\_CALLBACK\_KEY\_DOWN}}) \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}};}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a01909378c9e67734aa0e6ce2b603ad2c}{keyname}}, \textcolor{stringliteral}{"h"}) == 0) \textcolor{comment}{/* print help */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"\%s"}, commands);}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a01909378c9e67734aa0e6ce2b603ad2c}{keyname}}, \textcolor{stringliteral}{"n"}) == 0) \textcolor{comment}{/* flip to next item */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        elm\_flipselector\_flip\_next(fs);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Flipping to next item\(\backslash\)n"});}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a01909378c9e67734aa0e6ce2b603ad2c}{keyname}}, \textcolor{stringliteral}{"p"}) == 0) \textcolor{comment}{/* flip to previous item */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        elm\_flipselector\_flip\_prev(fs);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Flipping to previous item\(\backslash\)n"});}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a01909378c9e67734aa0e6ce2b603ad2c}{keyname}}, \textcolor{stringliteral}{"f"}) == 0) \textcolor{comment}{/* print first item's label */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Elm__General_ga13a0c231414b86e62f68afe3c6fb462b}{Elm\_Object\_Item}} *it;}
\DoxyCodeLine{}
\DoxyCodeLine{        it = elm\_flipselector\_first\_item\_get(fs);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Flip selector's first item is: \%s\(\backslash\)n"}, it ?}
\DoxyCodeLine{                elm\_object\_item\_text\_get(it) : \textcolor{stringliteral}{"none"});}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a01909378c9e67734aa0e6ce2b603ad2c}{keyname}}, \textcolor{stringliteral}{"l"}) == 0) \textcolor{comment}{/* print last item's label */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Elm__General_ga13a0c231414b86e62f68afe3c6fb462b}{Elm\_Object\_Item}} *it;}
\DoxyCodeLine{}
\DoxyCodeLine{        it = elm\_flipselector\_last\_item\_get(fs);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Flip selector's last item is: \%s\(\backslash\)n"}, it ?}
\DoxyCodeLine{                elm\_object\_item\_text\_get(it) : \textcolor{stringliteral}{"none"});}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a01909378c9e67734aa0e6ce2b603ad2c}{keyname}}, \textcolor{stringliteral}{"s"}) == 0) \textcolor{comment}{/* print selected item's label */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Elm__General_ga13a0c231414b86e62f68afe3c6fb462b}{Elm\_Object\_Item}} *it;}
\DoxyCodeLine{}
\DoxyCodeLine{        it = elm\_flipselector\_selected\_item\_get(fs);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Flip selector's selected item is: \%s\(\backslash\)n"}, it ?}
\DoxyCodeLine{                elm\_object\_item\_text\_get(it) : \textcolor{stringliteral}{"none"});}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else}}
\DoxyCodeLine{     \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}};}
\DoxyCodeLine{}
\DoxyCodeLine{   ev-\/>event\_flags |= \mbox{\hyperlink{Evas__Common_8h_a89ffbc5f4d2796994c8b07ef95ef3d1aa2370cbd360270536042b7cfd8c7fcd83}{EVAS\_EVENT\_FLAG\_ON\_HOLD}};}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}};}
\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{   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *win, *bx, *fp, *bt;}
\DoxyCodeLine{   \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *lbl[] =}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \textcolor{stringliteral}{"Elementary"},}
\DoxyCodeLine{        \textcolor{stringliteral}{"Evas"},}
\DoxyCodeLine{        \textcolor{stringliteral}{"Eina"},}
\DoxyCodeLine{        \textcolor{stringliteral}{"Edje"},}
\DoxyCodeLine{        \textcolor{stringliteral}{"Eet"},}
\DoxyCodeLine{        \textcolor{stringliteral}{"Ecore"},}
\DoxyCodeLine{        \textcolor{stringliteral}{"Efreet"},}
\DoxyCodeLine{        \textcolor{stringliteral}{"Eldbus"}}
\DoxyCodeLine{     \};}
\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_gac75d7752662fab73d6420706ce5be996}{elm\_win\_util\_standard\_add}}(\textcolor{stringliteral}{"flipselector"}, \textcolor{stringliteral}{"Flip Selector Example"});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Win_ga9a16a2f8c9fd5b6e9203ed9dcb53ea8b}{elm\_win\_autodel\_set}}(win, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{}
\DoxyCodeLine{   bx = \mbox{\hyperlink{group__Elm__Box_ga3d0998b60ada633bacfa8869a921cfd7}{elm\_box\_add}}(win);}
\DoxyCodeLine{   evas\_object\_size\_hint\_weight\_set(bx, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}}, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Win_ga505d6bd217e5ee01e82b548ec35986eb}{elm\_win\_resize\_object\_add}}(win, bx);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(bx);}
\DoxyCodeLine{}
\DoxyCodeLine{   fp = \mbox{\hyperlink{group__Elm__Flipselector_gaffabf9e37915526cbbe8ac2621eeee8a}{elm\_flipselector\_add}}(win);}
\DoxyCodeLine{   evas\_object\_size\_hint\_weight\_set(fp, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}}, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Smart__Object__Group_ga18a8b179f94d21b2b09e19db11741061}{evas\_object\_smart\_callback\_add}}(fp, \textcolor{stringliteral}{"underflowed"}, \_overflow\_cb, NULL);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Smart__Object__Group_ga18a8b179f94d21b2b09e19db11741061}{evas\_object\_smart\_callback\_add}}(fp, \textcolor{stringliteral}{"overflowed"}, \_underflow\_cb, NULL);}
\DoxyCodeLine{   \textcolor{keywordflow}{for} (i = 0; i < \textcolor{keyword}{sizeof}(lbl) / \textcolor{keyword}{sizeof}(lbl[0]); i++)}
\DoxyCodeLine{     elm\_flipselector\_item\_append(fp, lbl[i], NULL, NULL);}
\DoxyCodeLine{   elm\_box\_pack\_end(bx, fp);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(fp);}
\DoxyCodeLine{}
\DoxyCodeLine{   bt = \mbox{\hyperlink{group__Elm__Button_ga0021b9d86d822367035843ed18bc6ea9}{elm\_button\_add}}(win);}
\DoxyCodeLine{   elm\_object\_text\_set(bt, \textcolor{stringliteral}{"Unselect item"});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Smart__Object__Group_ga18a8b179f94d21b2b09e19db11741061}{evas\_object\_smart\_callback\_add}}(bt, \textcolor{stringliteral}{"clicked"}, \_unsel\_cb, fp);}
\DoxyCodeLine{   elm\_box\_pack\_end(bx, bt);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(bt);}
\DoxyCodeLine{}
\DoxyCodeLine{   bt = \mbox{\hyperlink{group__Elm__Button_ga0021b9d86d822367035843ed18bc6ea9}{elm\_button\_add}}(win);}
\DoxyCodeLine{   elm\_object\_text\_set(bt, \textcolor{stringliteral}{"Delete item"});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Smart__Object__Group_ga18a8b179f94d21b2b09e19db11741061}{evas\_object\_smart\_callback\_add}}(bt, \textcolor{stringliteral}{"clicked"}, \_del\_cb, fp);}
\DoxyCodeLine{   elm\_box\_pack\_end(bx, bt);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(bt);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__General_gae2d2f3ef544f5aa59a0d89fbb67584e5}{elm\_object\_event\_callback\_add}}(win, \_on\_keydown, fp);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(win);}
\DoxyCodeLine{}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"\%s"}, commands);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__General_gadf2553f83e6b0b9c7fbe054019a664a1}{elm\_run}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\}}
\DoxyCodeLine{\mbox{\hyperlink{group__Elm__General_ga50fe52d513f7e89c9c770afd76de7ad9}{ELM\_MAIN}}()}
\end{DoxyCodeInclude}
 