\hypertarget{toggle_using_filter_8edc-example}{}\doxysection{toggle\+\_\+using\+\_\+filter.\+edc}
This example shows how to toggle the state of a part using the \textquotesingle{}filter\textquotesingle{} param in edje programs.

This example shows how to toggle the state of a part using the \textquotesingle{}filter\textquotesingle{} param in edje programs


\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{collections\ \{}
\DoxyCodeLine{\ \ \ group\ \{\ name:\ "{}main"{};}
\DoxyCodeLine{\ \ \ \ \ \ parts\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ /*\ white\ background\ */}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ part\ \{\ name:\ "{}bg"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ type:\ RECT;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ description\ \{\ state:\ "{}default"{}\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ color:\ 255\ 255\ 255\ 255;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ /*\ title\ label\ */}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ part\ \{\ name:\ "{}title"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ type:\ TEXT;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ description\ \{\ state:\ "{}default"{}\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ color:\ 0\ 0\ 0\ 255;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ text\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ text:\ "{}Toggle\ using\ filter"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ font:\ "{}Sans"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ size:\ 12;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ align:\ 0.5\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ /*\ the\ rectangle,\ will\ toggle\ color\ on\ click\ */}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ part\ \{\ name:\ "{}rect"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ type:\ RECT;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ mouse\_events:\ 1;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ description\ \{\ state:\ "{}default"{}\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ color:\ 255\ 0\ 0\ 150;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ max:\ 150\ 150;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ align:\ 0.5\ 0.5;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ map\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ on:\ 1;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ perspective\_on:\ 1;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ smooth:\ 1;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ alpha:\ 1;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ description\ \{\ state:\ "{}blue"{}\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ inherit:\ "{}default"{}\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ color:\ 0\ 0\ 255\ 255;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ programs\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ /*\ on\ mouse\ click\ set\ the\ blue\ state,\ if\ we\ are\ in\ the\ default\ state\ */}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ program\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ signal:\ "{}mouse,down,1"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ source:\ "{}rect"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ filter:\ "{}rect"{}\ "{}default"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ action:\ STATE\_SET\ "{}blue"{}\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ transition:\ SINUSOIDAL\ 0.4;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ target:\ "{}rect"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ /*\ or\ back\ to\ the\ default\ state\ if\ we\ are\ in\ the\ blue\ state\ */}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ program\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ signal:\ "{}mouse,down,1"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ source:\ "{}rect"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ filter:\ "{}rect"{}\ "{}blue"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ action:\ STATE\_SET\ "{}default"{}\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ transition:\ SINUSOIDAL\ 0.4;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ target:\ "{}rect"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \}}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 