\section{Box}
\label{group__Box}\index{Box@{Box}}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef struct \+\_\+\+Elm\+\_\+\+Box\+\_\+\+Transition \hyperlink{group__Box_ga9cd35aa22988c800aa981f25ada92ced}{Elm\+\_\+\+Box\+\_\+\+Transition}
\begin{DoxyCompactList}\small\item\em Opaque handler containing the parameters to perform an animated transition of the layout the box uses. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{group__Box_ga15194ef319ae722b03f608373f90fe1f}{elm\+\_\+box\+\_\+layout\+\_\+transition} (Evas\+\_\+\+Object $\ast$obj, Evas\+\_\+\+Object\+\_\+\+Box\+\_\+\+Data $\ast$priv, void $\ast$data)
\begin{DoxyCompactList}\small\item\em Special layout function that animates the transition from one layout to another. \end{DoxyCompactList}\item 
\hyperlink{group__Box_ga9cd35aa22988c800aa981f25ada92ced}{Elm\+\_\+\+Box\+\_\+\+Transition} $\ast$ \hyperlink{group__Box_ga4a70cd7719f20a6d60e4abdf57eeca4e}{elm\+\_\+box\+\_\+transition\+\_\+new} (const double duration, Evas\+\_\+\+Object\+\_\+\+Box\+\_\+\+Layout start\+\_\+layout, void $\ast$start\+\_\+layout\+\_\+data, Ecore\+\_\+\+Cb start\+\_\+layout\+\_\+free\+\_\+data, Evas\+\_\+\+Object\+\_\+\+Box\+\_\+\+Layout end\+\_\+layout, void $\ast$end\+\_\+layout\+\_\+data, Ecore\+\_\+\+Cb end\+\_\+layout\+\_\+free\+\_\+data, Ecore\+\_\+\+Cb transition\+\_\+end\+\_\+cb, void $\ast$transition\+\_\+end\+\_\+data)
\begin{DoxyCompactList}\small\item\em Create a new \hyperlink{group__Box_ga9cd35aa22988c800aa981f25ada92ced}{Elm\+\_\+\+Box\+\_\+\+Transition} to animate the switch of layouts. \end{DoxyCompactList}\item 
void \hyperlink{group__Box_gab7b726e4dbfb80da529431d198add95e}{elm\+\_\+box\+\_\+transition\+\_\+free} (void $\ast$data)
\begin{DoxyCompactList}\small\item\em Free a Elm\+\_\+\+Box\+\_\+\+Transition instance created with \hyperlink{group__Box_ga4a70cd7719f20a6d60e4abdf57eeca4e}{elm\+\_\+box\+\_\+transition\+\_\+new()}. \end{DoxyCompactList}\item 
Evas\+\_\+\+Object $\ast$ \hyperlink{group__Box_ga3d0998b60ada633bacfa8869a921cfd7}{elm\+\_\+box\+\_\+add} (Evas\+\_\+\+Object $\ast$parent)
\begin{DoxyCompactList}\small\item\em Add a new box to the parent. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
 
\begin{DoxyImageNoCaption}
  \mbox{\includegraphics[width=\textwidth,height=\textheight/2,keepaspectratio=true]{box_inheritance_tree}}
\end{DoxyImageNoCaption}


 
\begin{DoxyImageNoCaption}
  \mbox{\includegraphics[width=\textwidth]{img/widget/box/preview-00}}
\end{DoxyImageNoCaption}


 
\begin{DoxyImageNoCaption}
  \mbox{\includegraphics[width=\textwidth]{box}}
\end{DoxyImageNoCaption}


A box arranges objects in a linear fashion, governed by a layout function that defines the details of this arrangement.

By default, the box will use an internal function to set the layout to a single row, either vertical or horizontal. This layout is affected by a number of parameters, such as the homogeneous flag set by elm\+\_\+box\+\_\+homogeneous\+\_\+set(), the values given by elm\+\_\+box\+\_\+padding\+\_\+set() and elm\+\_\+box\+\_\+align\+\_\+set() and the hints set to each object in the box.

For this default layout, it\textquotesingle{}s possible to change the orientation with elm\+\_\+box\+\_\+horizontal\+\_\+set(). The box will start in the vertical orientation, placing its elements ordered from top to bottom. When horizontal is set, the order will go from left to right. If the box is set to be homogeneous, every object in it will be assigned the same space, that of the largest object. Padding can be used to set some spacing between the cell given to each object. The alignment of the box, set with elm\+\_\+box\+\_\+align\+\_\+set(), determines how the bounding box of all the elements will be placed within the space given to the box widget itself.

The size hints of each object also affect how they are placed and sized within the box. evas\+\_\+object\+\_\+size\+\_\+hint\+\_\+min\+\_\+set() will give the minimum size the object can have, and the box will use it as the basis for all latter calculations. Elementary widgets set their own minimum size as needed, so there\textquotesingle{}s rarely any need to use it manually.

evas\+\_\+object\+\_\+size\+\_\+hint\+\_\+weight\+\_\+set(), when not in homogeneous mode, is used to tell whether the object will be allocated the minimum size it needs or if the space given to it should be expanded. It\textquotesingle{}s important to realize that expanding the size given to the object is not the same thing as resizing the object. It could very well end being a small widget floating in a much larger empty space. If not set, the weight for objects will normally be 0.\+0 for both axis, meaning the widget will not be expanded. To take as much space possible, set the weight to E\+V\+A\+S\+\_\+\+H\+I\+N\+T\+\_\+\+E\+X\+P\+A\+N\+D (defined to 1.\+0) for the desired axis to expand.

Besides how much space each object is allocated, it\textquotesingle{}s possible to control how the widget will be placed within that space using evas\+\_\+object\+\_\+size\+\_\+hint\+\_\+align\+\_\+set(). By default, this value will be 0.\+5 for both axis, meaning the object will be centered, but any value from 0.\+0 (left or top, for the {\ttfamily x} and {\ttfamily y} axis, respectively) to 1.\+0 (right or bottom) can be used. The special value E\+V\+A\+S\+\_\+\+H\+I\+N\+T\+\_\+\+F\+I\+L\+L, which is -\/1.\+0, means the object will be resized to fill the entire space it was allocated.

In addition, customized functions to define the layout can be set, which allow the application developer to organize the objects within the box in any number of ways.

The special \hyperlink{group__Box_ga15194ef319ae722b03f608373f90fe1f}{elm\+\_\+box\+\_\+layout\+\_\+transition()} function can be used to switch from one layout to another, animating the motion of the children of the box.

\begin{DoxyNote}{Note}
Objects should not be added to box objects using \+\_\+add() calls.
\end{DoxyNote}
Some examples on how to use boxes follow\+: \begin{DoxyItemize}
\item \hyperlink{box_example_01}{Box -\/ Basic A\+P\+I} \item \hyperlink{box_example_02}{Box -\/ Layout transitions} \end{DoxyItemize}


\subsection{Typedef Documentation}
\index{Box@{Box}!Elm\+\_\+\+Box\+\_\+\+Transition@{Elm\+\_\+\+Box\+\_\+\+Transition}}
\index{Elm\+\_\+\+Box\+\_\+\+Transition@{Elm\+\_\+\+Box\+\_\+\+Transition}!Box@{Box}}
\subsubsection[{Elm\+\_\+\+Box\+\_\+\+Transition}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Elm\+\_\+\+Box\+\_\+\+Transition}}\label{group__Box_ga9cd35aa22988c800aa981f25ada92ced}


Opaque handler containing the parameters to perform an animated transition of the layout the box uses. 

\begin{DoxySeeAlso}{See also}
\hyperlink{group__Box_ga4a70cd7719f20a6d60e4abdf57eeca4e}{elm\+\_\+box\+\_\+transition\+\_\+new()} 

elm\+\_\+box\+\_\+layout\+\_\+set() 

\hyperlink{group__Box_ga15194ef319ae722b03f608373f90fe1f}{elm\+\_\+box\+\_\+layout\+\_\+transition()} 
\end{DoxySeeAlso}


\subsection{Function Documentation}
\index{Box@{Box}!elm\+\_\+box\+\_\+add@{elm\+\_\+box\+\_\+add}}
\index{elm\+\_\+box\+\_\+add@{elm\+\_\+box\+\_\+add}!Box@{Box}}
\subsubsection[{elm\+\_\+box\+\_\+add(\+Evas\+\_\+\+Object $\ast$parent)}]{\setlength{\rightskip}{0pt plus 5cm}Evas\+\_\+\+Object$\ast$ elm\+\_\+box\+\_\+add (
\begin{DoxyParamCaption}
\item[{Evas\+\_\+\+Object $\ast$}]{parent}
\end{DoxyParamCaption}
)}\label{group__Box_ga3d0998b60ada633bacfa8869a921cfd7}


Add a new box to the parent. 

By default, the box will be in vertical mode and non-\/homogeneous.


\begin{DoxyParams}{Parameters}
{\em parent} & The parent object \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The new object or N\+U\+L\+L if it cannot be created 
\end{DoxyReturn}
\index{Box@{Box}!elm\+\_\+box\+\_\+layout\+\_\+transition@{elm\+\_\+box\+\_\+layout\+\_\+transition}}
\index{elm\+\_\+box\+\_\+layout\+\_\+transition@{elm\+\_\+box\+\_\+layout\+\_\+transition}!Box@{Box}}
\subsubsection[{elm\+\_\+box\+\_\+layout\+\_\+transition(\+Evas\+\_\+\+Object $\ast$obj, Evas\+\_\+\+Object\+\_\+\+Box\+\_\+\+Data $\ast$priv, void $\ast$data)}]{\setlength{\rightskip}{0pt plus 5cm}void elm\+\_\+box\+\_\+layout\+\_\+transition (
\begin{DoxyParamCaption}
\item[{Evas\+\_\+\+Object $\ast$}]{obj, }
\item[{Evas\+\_\+\+Object\+\_\+\+Box\+\_\+\+Data $\ast$}]{priv, }
\item[{void $\ast$}]{data}
\end{DoxyParamCaption}
)}\label{group__Box_ga15194ef319ae722b03f608373f90fe1f}


Special layout function that animates the transition from one layout to another. 

Normally, when switching the layout function for a box, this will be reflected immediately on screen on the next render, but it\textquotesingle{}s also possible to do this through an animated transition.

This is done by creating an \hyperlink{group__Box_ga9cd35aa22988c800aa981f25ada92ced}{Elm\+\_\+\+Box\+\_\+\+Transition} and setting the box layout to this function.

For example\+: 
\begin{DoxyCode}
1 Elm\_Box\_Transition *t = elm\_box\_transition\_new(1.0,
2                            evas\_object\_box\_layout\_vertical, // start
3                            NULL, // data for initial layout
4                            NULL, // free function for initial data
5                            evas\_object\_box\_layout\_horizontal, // end
6                            NULL, // data for final layout
7                            NULL, // free function for final data
8                            anim\_end, // will be called when animation ends
9                            NULL); // data for anim\_end function\(\backslash\)
10 elm\_box\_layout\_set(box, elm\_box\_layout\_transition, t,
11                    elm\_box\_transition\_free);
\end{DoxyCode}


\begin{DoxyNote}{Note}
This function can only be used with elm\+\_\+box\+\_\+layout\+\_\+set(). Calling it directly will not have the expected results.
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\hyperlink{group__Box_ga4a70cd7719f20a6d60e4abdf57eeca4e}{elm\+\_\+box\+\_\+transition\+\_\+new} 

\hyperlink{group__Box_gab7b726e4dbfb80da529431d198add95e}{elm\+\_\+box\+\_\+transition\+\_\+free} 

elm\+\_\+box\+\_\+layout\+\_\+set 
\end{DoxySeeAlso}
\index{Box@{Box}!elm\+\_\+box\+\_\+transition\+\_\+free@{elm\+\_\+box\+\_\+transition\+\_\+free}}
\index{elm\+\_\+box\+\_\+transition\+\_\+free@{elm\+\_\+box\+\_\+transition\+\_\+free}!Box@{Box}}
\subsubsection[{elm\+\_\+box\+\_\+transition\+\_\+free(void $\ast$data)}]{\setlength{\rightskip}{0pt plus 5cm}void elm\+\_\+box\+\_\+transition\+\_\+free (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{data}
\end{DoxyParamCaption}
)}\label{group__Box_gab7b726e4dbfb80da529431d198add95e}


Free a Elm\+\_\+\+Box\+\_\+\+Transition instance created with \hyperlink{group__Box_ga4a70cd7719f20a6d60e4abdf57eeca4e}{elm\+\_\+box\+\_\+transition\+\_\+new()}. 

This function is mostly useful as the {\ttfamily free\+\_\+data} parameter in elm\+\_\+box\+\_\+layout\+\_\+set() when \hyperlink{group__Box_ga15194ef319ae722b03f608373f90fe1f}{elm\+\_\+box\+\_\+layout\+\_\+transition()}.


\begin{DoxyParams}{Parameters}
{\em data} & The Elm\+\_\+\+Box\+\_\+\+Transition instance to be freed.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\hyperlink{group__Box_ga4a70cd7719f20a6d60e4abdf57eeca4e}{elm\+\_\+box\+\_\+transition\+\_\+new} 

\hyperlink{group__Box_ga15194ef319ae722b03f608373f90fe1f}{elm\+\_\+box\+\_\+layout\+\_\+transition} 
\end{DoxySeeAlso}
\index{Box@{Box}!elm\+\_\+box\+\_\+transition\+\_\+new@{elm\+\_\+box\+\_\+transition\+\_\+new}}
\index{elm\+\_\+box\+\_\+transition\+\_\+new@{elm\+\_\+box\+\_\+transition\+\_\+new}!Box@{Box}}
\subsubsection[{elm\+\_\+box\+\_\+transition\+\_\+new(const double duration, Evas\+\_\+\+Object\+\_\+\+Box\+\_\+\+Layout start\+\_\+layout, void $\ast$start\+\_\+layout\+\_\+data, Ecore\+\_\+\+Cb start\+\_\+layout\+\_\+free\+\_\+data, Evas\+\_\+\+Object\+\_\+\+Box\+\_\+\+Layout end\+\_\+layout, void $\ast$end\+\_\+layout\+\_\+data, Ecore\+\_\+\+Cb end\+\_\+layout\+\_\+free\+\_\+data, Ecore\+\_\+\+Cb transition\+\_\+end\+\_\+cb, void $\ast$transition\+\_\+end\+\_\+data)}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Elm\+\_\+\+Box\+\_\+\+Transition}$\ast$ elm\+\_\+box\+\_\+transition\+\_\+new (
\begin{DoxyParamCaption}
\item[{const double}]{duration, }
\item[{Evas\+\_\+\+Object\+\_\+\+Box\+\_\+\+Layout}]{start\+\_\+layout, }
\item[{void $\ast$}]{start\+\_\+layout\+\_\+data, }
\item[{Ecore\+\_\+\+Cb}]{start\+\_\+layout\+\_\+free\+\_\+data, }
\item[{Evas\+\_\+\+Object\+\_\+\+Box\+\_\+\+Layout}]{end\+\_\+layout, }
\item[{void $\ast$}]{end\+\_\+layout\+\_\+data, }
\item[{Ecore\+\_\+\+Cb}]{end\+\_\+layout\+\_\+free\+\_\+data, }
\item[{Ecore\+\_\+\+Cb}]{transition\+\_\+end\+\_\+cb, }
\item[{void $\ast$}]{transition\+\_\+end\+\_\+data}
\end{DoxyParamCaption}
)}\label{group__Box_ga4a70cd7719f20a6d60e4abdf57eeca4e}


Create a new \hyperlink{group__Box_ga9cd35aa22988c800aa981f25ada92ced}{Elm\+\_\+\+Box\+\_\+\+Transition} to animate the switch of layouts. 

If you want to animate the change from one layout to another, you need to set the layout function of the box to \hyperlink{group__Box_ga15194ef319ae722b03f608373f90fe1f}{elm\+\_\+box\+\_\+layout\+\_\+transition()}, passing as user data to it an instance of \hyperlink{group__Box_ga9cd35aa22988c800aa981f25ada92ced}{Elm\+\_\+\+Box\+\_\+\+Transition} with the necessary information to perform this animation. The free function to set for the layout is \hyperlink{group__Box_gab7b726e4dbfb80da529431d198add95e}{elm\+\_\+box\+\_\+transition\+\_\+free()}.

The parameters to create an \hyperlink{group__Box_ga9cd35aa22988c800aa981f25ada92ced}{Elm\+\_\+\+Box\+\_\+\+Transition} sum up to how long will it be, in seconds, a layout function to describe the initial point, another for the final position of the children and one function to be called when the whole animation ends. This last function is useful to set the definitive layout for the box, usually the same as the end layout for the animation, but could be used to start another transition.


\begin{DoxyParams}{Parameters}
{\em duration} & The duration of the transition in seconds \\
\hline
{\em start\+\_\+layout} & The layout function that will be used to start the animation \\
\hline
{\em start\+\_\+layout\+\_\+data} & The data to be passed the {\ttfamily start\+\_\+layout} function \\
\hline
{\em start\+\_\+layout\+\_\+free\+\_\+data} & Function to free {\ttfamily start\+\_\+layout\+\_\+data} \\
\hline
{\em end\+\_\+layout} & The layout function that will be used to end the animation \\
\hline
{\em end\+\_\+layout\+\_\+data} & Data param passed to {\ttfamily end\+\_\+layout} \\
\hline
{\em end\+\_\+layout\+\_\+free\+\_\+data} & The data to be passed the {\ttfamily end\+\_\+layout} function \\
\hline
{\em end\+\_\+layout\+\_\+free\+\_\+data} & Function to free {\ttfamily end\+\_\+layout\+\_\+data} \\
\hline
{\em transition\+\_\+end\+\_\+cb} & Callback function called when animation ends \\
\hline
{\em transition\+\_\+end\+\_\+data} & Data to be passed to {\ttfamily transition\+\_\+end\+\_\+cb} \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
An instance of \hyperlink{group__Box_ga9cd35aa22988c800aa981f25ada92ced}{Elm\+\_\+\+Box\+\_\+\+Transition}
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{group__Box_ga4a70cd7719f20a6d60e4abdf57eeca4e}{elm\+\_\+box\+\_\+transition\+\_\+new} 

\hyperlink{group__Box_ga15194ef319ae722b03f608373f90fe1f}{elm\+\_\+box\+\_\+layout\+\_\+transition} 
\end{DoxySeeAlso}
