\section{Background}
\label{group__Bg}\index{Background@{Background}}


Background object, used for setting a solid color, image or Edje group as a background to a window or any container object.  


\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
Evas\+\_\+\+Object $\ast$ \hyperlink{group__Bg_gaeec8f79ac62ce0cf607cfe330008a63f}{elm\+\_\+bg\+\_\+add} (Evas\+\_\+\+Object $\ast$parent)
\begin{DoxyCompactList}\small\item\em Add a new background to the parent. \end{DoxyCompactList}\item 
void \hyperlink{group__Bg_ga9431af239574a212be6988d618be5ae8}{elm\+\_\+bg\+\_\+color\+\_\+set} (Evas\+\_\+\+Object $\ast$obj, int r, int g, int b)
\begin{DoxyCompactList}\small\item\em Set the color on a given background widget. \end{DoxyCompactList}\item 
void \hyperlink{group__Bg_ga7ebcf30b15b9610380101a26b240b711}{elm\+\_\+bg\+\_\+color\+\_\+get} (const Evas\+\_\+\+Object $\ast$obj, int $\ast$r, int $\ast$g, int $\ast$b)
\begin{DoxyCompactList}\small\item\em Get the color set on a given background widget. \end{DoxyCompactList}\item 
Eina\+\_\+\+Bool \hyperlink{group__Bg_ga0b11c11879de61126414adfbfe3e431c}{elm\+\_\+bg\+\_\+file\+\_\+set} (Eo $\ast$obj, const char $\ast$file, const char $\ast$group)
\begin{DoxyCompactList}\small\item\em Set the file (image or edje collection) to give life for the background. \end{DoxyCompactList}\item 
void \hyperlink{group__Bg_gafd923c1eb9d78db9f4b50fcfec7c74ae}{elm\+\_\+bg\+\_\+file\+\_\+get} (const Eo $\ast$obj, const char $\ast$$\ast$file, const char $\ast$$\ast$group)
\begin{DoxyCompactList}\small\item\em Get the file (image or edje collection) set on a given background widget. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Background object, used for setting a solid color, image or Edje group as a background to a window or any container object. 

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


 
\begin{DoxyImageNoCaption}
  \mbox{\includegraphics[width=\textwidth,height=\textheight/2,keepaspectratio=true]{img/widget/bg/preview-00}}
\end{DoxyImageNoCaption}


The bg (background) widget is used for setting (solid) background decorations to a window (unless it has transparency enabled) or to any container object. It works just like an image, but has some properties useful to a background, like setting it to tiled, centered, scaled or stretched.

This widget inherits from the \hyperlink{group__Layout}{Layout} one, so that all the functions acting on it also work for background objects.

Default content parts of the bg widget that you can use for are\+: \begin{DoxyItemize}
\item {\ttfamily \char`\"{}overlay\char`\"{}} -\/ overlay of the bg\end{DoxyItemize}
Here is some sample code using it\+: \begin{DoxyItemize}
\item \hyperlink{bg_01_example_page}{elm\+\_\+bg -\/ Plain color background.} \item \hyperlink{bg_02_example_page}{elm\+\_\+bg -\/ Image background.} \item \hyperlink{bg_03_example_page}{elm\+\_\+bg -\/ Background properties.} \end{DoxyItemize}


\subsection{Function Documentation}
\index{Background@{Background}!elm\+\_\+bg\+\_\+add@{elm\+\_\+bg\+\_\+add}}
\index{elm\+\_\+bg\+\_\+add@{elm\+\_\+bg\+\_\+add}!Background@{Background}}
\subsubsection[{\texorpdfstring{elm\+\_\+bg\+\_\+add(\+Evas\+\_\+\+Object $\ast$parent)}{elm_bg_add(Evas_Object *parent)}}]{\setlength{\rightskip}{0pt plus 5cm}Evas\+\_\+\+Object$\ast$ elm\+\_\+bg\+\_\+add (
\begin{DoxyParamCaption}
\item[{Evas\+\_\+\+Object $\ast$}]{parent}
\end{DoxyParamCaption}
)}\label{group__Bg_gaeec8f79ac62ce0cf607cfe330008a63f}


Add a new background to the parent. 


\begin{DoxyParams}{Parameters}
{\em parent} & The parent object \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The new object or {\ttfamily N\+U\+LL} if it cannot be created 
\end{DoxyReturn}


References elm\+\_\+layout\+\_\+content\+\_\+set().



Referenced by elm\+\_\+quicklaunch\+\_\+seed(), elm\+\_\+win\+\_\+util\+\_\+dialog\+\_\+add(), and elm\+\_\+win\+\_\+util\+\_\+standard\+\_\+add().

\index{Background@{Background}!elm\+\_\+bg\+\_\+color\+\_\+get@{elm\+\_\+bg\+\_\+color\+\_\+get}}
\index{elm\+\_\+bg\+\_\+color\+\_\+get@{elm\+\_\+bg\+\_\+color\+\_\+get}!Background@{Background}}
\subsubsection[{\texorpdfstring{elm\+\_\+bg\+\_\+color\+\_\+get(const Evas\+\_\+\+Object $\ast$obj, int $\ast$r, int $\ast$g, int $\ast$b)}{elm_bg_color_get(const Evas_Object *obj, int *r, int *g, int *b)}}]{\setlength{\rightskip}{0pt plus 5cm}void elm\+\_\+bg\+\_\+color\+\_\+get (
\begin{DoxyParamCaption}
\item[{const Evas\+\_\+\+Object $\ast$}]{obj, }
\item[{int $\ast$}]{r, }
\item[{int $\ast$}]{g, }
\item[{int $\ast$}]{b}
\end{DoxyParamCaption}
)}\label{group__Bg_ga7ebcf30b15b9610380101a26b240b711}


Get the color set on a given background widget. 


\begin{DoxyParams}{Parameters}
{\em obj} & The background object handle \\
\hline
{\em r} & Where to store the red color component\textquotesingle{}s value \\
\hline
{\em g} & Where to store the green color component\textquotesingle{}s value \\
\hline
{\em b} & Where to store the blue color component\textquotesingle{}s value\\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
Use {\ttfamily N\+U\+LL} pointers on the file components you\textquotesingle{}re not interested in\+: they\textquotesingle{}ll be ignored by the function.
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\hyperlink{group__Bg_ga7ebcf30b15b9610380101a26b240b711}{elm\+\_\+bg\+\_\+color\+\_\+get()} for more details 
\end{DoxySeeAlso}
\index{Background@{Background}!elm\+\_\+bg\+\_\+color\+\_\+set@{elm\+\_\+bg\+\_\+color\+\_\+set}}
\index{elm\+\_\+bg\+\_\+color\+\_\+set@{elm\+\_\+bg\+\_\+color\+\_\+set}!Background@{Background}}
\subsubsection[{\texorpdfstring{elm\+\_\+bg\+\_\+color\+\_\+set(\+Evas\+\_\+\+Object $\ast$obj, int r, int g, int b)}{elm_bg_color_set(Evas_Object *obj, int r, int g, int b)}}]{\setlength{\rightskip}{0pt plus 5cm}void elm\+\_\+bg\+\_\+color\+\_\+set (
\begin{DoxyParamCaption}
\item[{Evas\+\_\+\+Object $\ast$}]{obj, }
\item[{int}]{r, }
\item[{int}]{g, }
\item[{int}]{b}
\end{DoxyParamCaption}
)}\label{group__Bg_ga9431af239574a212be6988d618be5ae8}


Set the color on a given background widget. 


\begin{DoxyParams}{Parameters}
{\em obj} & The background object handle \\
\hline
{\em r} & The red color component\textquotesingle{}s value \\
\hline
{\em g} & The green color component\textquotesingle{}s value \\
\hline
{\em b} & The blue color component\textquotesingle{}s value\\
\hline
\end{DoxyParams}
This sets the color used for the background rectangle, in R\+GB format. Each color component\textquotesingle{}s range is from 0 to 255.

\begin{DoxyNote}{Note}
You probably only want to use this function if you haven\textquotesingle{}t previously called \hyperlink{group__Bg_ga0b11c11879de61126414adfbfe3e431c}{elm\+\_\+bg\+\_\+file\+\_\+set()}, so that you just want a solid color background.

You can reset the color by setting {\ttfamily r}, {\ttfamily g}, {\ttfamily b} as -\/1, -\/1, -\/1.
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\hyperlink{group__Bg_ga7ebcf30b15b9610380101a26b240b711}{elm\+\_\+bg\+\_\+color\+\_\+get()} 
\end{DoxySeeAlso}


References elm\+\_\+layout\+\_\+content\+\_\+set().

\index{Background@{Background}!elm\+\_\+bg\+\_\+file\+\_\+get@{elm\+\_\+bg\+\_\+file\+\_\+get}}
\index{elm\+\_\+bg\+\_\+file\+\_\+get@{elm\+\_\+bg\+\_\+file\+\_\+get}!Background@{Background}}
\subsubsection[{\texorpdfstring{elm\+\_\+bg\+\_\+file\+\_\+get(const Eo $\ast$obj, const char $\ast$$\ast$file, const char $\ast$$\ast$group)}{elm_bg_file_get(const Eo *obj, const char **file, const char **group)}}]{\setlength{\rightskip}{0pt plus 5cm}void elm\+\_\+bg\+\_\+file\+\_\+get (
\begin{DoxyParamCaption}
\item[{const Eo $\ast$}]{obj, }
\item[{const char $\ast$$\ast$}]{file, }
\item[{const char $\ast$$\ast$}]{group}
\end{DoxyParamCaption}
)}\label{group__Bg_gafd923c1eb9d78db9f4b50fcfec7c74ae}


Get the file (image or edje collection) set on a given background widget. 

\begin{DoxyNote}{Note}
Use {\ttfamily N\+U\+LL} pointers on the file components you\textquotesingle{}re not interested in\+: they\textquotesingle{}ll be ignored by the function.
\end{DoxyNote}

\begin{DoxyParams}[1]{Parameters}
\mbox{\tt out}  & {\em file} & The file path \\
\hline
\mbox{\tt out}  & {\em group} & Optional key (group in Edje) within the file \\
\hline
\end{DoxyParams}
\index{Background@{Background}!elm\+\_\+bg\+\_\+file\+\_\+set@{elm\+\_\+bg\+\_\+file\+\_\+set}}
\index{elm\+\_\+bg\+\_\+file\+\_\+set@{elm\+\_\+bg\+\_\+file\+\_\+set}!Background@{Background}}
\subsubsection[{\texorpdfstring{elm\+\_\+bg\+\_\+file\+\_\+set(\+Eo $\ast$obj, const char $\ast$file, const char $\ast$group)}{elm_bg_file_set(Eo *obj, const char *file, const char *group)}}]{\setlength{\rightskip}{0pt plus 5cm}Eina\+\_\+\+Bool elm\+\_\+bg\+\_\+file\+\_\+set (
\begin{DoxyParamCaption}
\item[{Eo $\ast$}]{obj, }
\item[{const char $\ast$}]{file, }
\item[{const char $\ast$}]{group}
\end{DoxyParamCaption}
)}\label{group__Bg_ga0b11c11879de61126414adfbfe3e431c}


Set the file (image or edje collection) to give life for the background. 

\begin{DoxyReturn}{Returns}
{\ttfamily E\+I\+N\+A\+\_\+\+T\+R\+UE} on success, {\ttfamily E\+I\+N\+A\+\_\+\+F\+A\+L\+SE} otherwise
\end{DoxyReturn}
This sets the image file used in the background object. If the image comes from an Edje group, it will be stretched to completely fill the background object. If it comes from a traditional image file, it will by default be centered in this widget\textquotesingle{}s area (thus retaining its aspect), what could lead to some parts being not visible. You may change the mode of exhibition for a real image file with elm\+\_\+bg\+\_\+option\+\_\+set().

\begin{DoxyNote}{Note}
Once the image of {\ttfamily obj} is set, a previously set one will be deleted, even if {\ttfamily file} is {\ttfamily N\+U\+LL}.

This will only affect the contents of one of the background\textquotesingle{}s swallow spots, namely {\ttfamily \char`\"{}elm.\+swallow.\+background\char`\"{}}. If you want to achieve the {\ttfamily Layout\textquotesingle{}s} file setting behavior, you\textquotesingle{}ll have to call that method on this object.
\end{DoxyNote}

\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em file} & The file path \\
\hline
\mbox{\tt in}  & {\em group} & Optional key (group in Edje) within the file \\
\hline
\end{DoxyParams}
