\section{mapbuf\-\_\-example.\-c}

\begin{DoxyCodeInclude}

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

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_enabled\_cb(\textcolor{keywordtype}{void} *data, Evas\_Object *obj, \textcolor{keywordtype}{void} *event\_info)
\{
   Evas\_Object *mb = data;
   elm_mapbuf_enabled_set(mb, elm_check_state_get(obj));
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_alpha\_cb(\textcolor{keywordtype}{void} *data, Evas\_Object *obj, \textcolor{keywordtype}{void} *event\_info)
\{
   Evas\_Object *mb = data;
   elm_mapbuf_alpha_set(mb, elm_check_state_get(obj));
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_smooth\_cb(\textcolor{keywordtype}{void} *data, Evas\_Object *obj, \textcolor{keywordtype}{void} *event\_info)
\{
   Evas\_Object *mb = data;
   elm_mapbuf_smooth_set(mb, elm_check_state_get(obj));
\}

EAPI\_MAIN \textcolor{keywordtype}{int}
elm\_main(\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char} **argv)
\{
   Evas\_Object *win, *bx, *hbx, *tg, *ck, *mb, *tb, *ic;
   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} i, j;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add(\textcolor{stringliteral}{"mapbuf"}, \textcolor{stringliteral}{"Mapbuf Example"});
   elm_win_autodel_set(win, EINA\_TRUE);

   bx = elm_box_add(win);
   evas\_object\_size\_hint\_weight\_set(bx, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   elm_win_resize_object_add(win, bx);
   evas\_object\_show(bx);

   mb = elm_mapbuf_add(win);
   evas\_object\_size\_hint\_weight\_set(mb, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   evas\_object\_size\_hint\_align\_set(mb, EVAS\_HINT\_FILL, EVAS\_HINT\_FILL);
   elm_box_pack_end(bx, mb);

   tb = elm_table_add(win);
   evas\_object\_size\_hint\_weight\_set(tb, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   evas\_object\_size\_hint\_align\_set(tb, EVAS\_HINT\_FILL, EVAS\_HINT\_FILL);
   evas\_object\_show(tb);

   \textcolor{keywordflow}{for} (i = 0; i < 8; i++)
     \{
        \textcolor{keywordflow}{for} (j = 0; j < 8; j++)
          \{
             ic = elm_icon_add(win);
             elm_icon_standard_set(ic, \textcolor{stringliteral}{"home"});
             elm_image_resizable_set(ic, EINA\_FALSE, EINA\_FALSE);
             evas\_object\_show(ic);
             elm_table_pack(tb, ic, i, j, 1, 1);
          \}
     \}

   elm\_object\_content\_set(mb, tb);
   evas\_object\_show(mb);

   hbx = elm_box_add(win);
   elm_box_horizontal_set(hbx, EINA\_TRUE);
   evas\_object\_size\_hint\_weight\_set(hbx, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   evas\_object\_size\_hint\_align\_set(hbx, EVAS\_HINT\_FILL, EVAS\_HINT\_FILL);
   elm_box_pack_end(bx, hbx);
   evas\_object\_show(hbx);

   tg = elm_check_add(win);
   elm_object_style_set(tg, \textcolor{stringliteral}{"toggle"});
   elm_object_part_text_set(tg, \textcolor{stringliteral}{"on"}, \textcolor{stringliteral}{"Enabled"});
   elm_object_part_text_set(tg, \textcolor{stringliteral}{"off"}, \textcolor{stringliteral}{"Disabled"});
   elm\_object\_text\_set(tg, \textcolor{stringliteral}{"Map"});
   evas\_object\_smart\_callback\_add(tg, \textcolor{stringliteral}{"changed"}, \_enabled\_cb, mb);
   elm_box_pack_end(hbx, tg);
   evas\_object\_show(tg);

   ck = elm_check_add(win);
   elm\_object\_text\_set(ck, \textcolor{stringliteral}{"Alpha"});
   elm_check_state_set(ck, EINA\_TRUE);
   evas\_object\_smart\_callback\_add(ck, \textcolor{stringliteral}{"changed"}, \_alpha\_cb, mb);
   elm_box_pack_end(hbx, ck);
   evas\_object\_show(ck);

   ck = elm_check_add(win);
   elm\_object\_text\_set(ck, \textcolor{stringliteral}{"Smooth"});
   elm_check_state_set(ck, EINA\_TRUE);
   evas\_object\_smart\_callback\_add(ck, \textcolor{stringliteral}{"changed"}, \_smooth\_cb, mb);
   elm_box_pack_end(hbx, ck);
   evas\_object\_show(ck);

   evas\_object\_resize(win, 240, 320);
   evas\_object\_show(win);

   elm_run();
   elm_shutdown();

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