Hello watchwolf, it looks like you broke elm.

---
elm_route.c: In function ‘_clear_route’:
elm_route.c:129:18: error: ‘EMAP_LON_MAX’ undeclared (first use in
this function)
elm_route.c:129:18: note: each undeclared identifier is reported only
once for each function it appears in
elm_route.c:130:18: error: ‘EMAP_LON_MIN’ undeclared (first use in
this function)
elm_route.c:131:18: error: ‘EMAP_LAT_MAX’ undeclared (first use in
this function)
elm_route.c:132:18: error: ‘EMAP_LAT_MIN’ undeclared (first use in
this function)
elm_route.c: In function ‘elm_route_add’:
elm_route.c:202:18: error: ‘EMAP_LON_MAX’ undeclared (first use in
this function)
elm_route.c:203:18: error: ‘EMAP_LON_MIN’ undeclared (first use in
this function)
elm_route.c:204:18: error: ‘EMAP_LAT_MAX’ undeclared (first use in
this function)
elm_route.c:205:18: error: ‘EMAP_LAT_MIN’ undeclared (first use in
this function)
---

EMAP_xxx are not defined even in latest PROTO/emap.
Can you check it?

Thanks.
Daniel Juyung Seo (SeoZ)


On Mon, Jun 27, 2011 at 2:36 AM, Enlightenment SVN
<[email protected]> wrote:
> Log:
> elm: add elm_route: widget to display a route on elm_map. Currently the 
> widget use lines, in the futur it will use edje
>
>
>
> Author:       watchwolf
> Date:         2011-06-26 10:36:18 -0700 (Sun, 26 Jun 2011)
> New Revision: 60703
> Trac:         http://trac.enlightenment.org/e/changeset/60703
>
> Added:
>  trunk/elementary/src/lib/elm_route.c
> Modified:
>  trunk/elementary/src/bin/test_map.c trunk/elementary/src/lib/Elementary.h.in 
> trunk/elementary/src/lib/Makefile.am trunk/elementary/src/lib/elm_map.c
>
> Modified: trunk/elementary/src/bin/test_map.c
> ===================================================================
> --- trunk/elementary/src/bin/test_map.c 2011-06-26 13:59:11 UTC (rev 60702)
> +++ trunk/elementary/src/bin/test_map.c 2011-06-26 17:36:18 UTC (rev 60703)
> @@ -28,7 +28,7 @@
>  static Elm_Map_Marker *route_from, *route_to;
>  static Elm_Map_Route *route;
>  static Elm_Map_Name *name;
> -static Elm_Map_Track *track;
> +static Evas_Object *track;
>  static const char **source_names = NULL;
>  static Evas_Coord old_x, old_y;
>  static Evas_Coord old_d;
> @@ -280,13 +280,13 @@
>  }
>
>  static void
> -map_show_seoul(void *data, Evas_Object *obj __UNUSED__, void *event_info 
> __UNUSED__)
> +map_show_urmatt(void *data, Evas_Object *obj __UNUSED__, void *event_info 
> __UNUSED__)
>  {
>    Eina_Bool b = elm_map_paused_get(data);
>    elm_map_paused_set(data, EINA_TRUE);
>    elm_map_zoom_mode_set(data, ELM_MAP_ZOOM_MODE_MANUAL);
> -   elm_map_geo_region_show(data, 126.977969, 37.566535);
> -   elm_map_zoom_set(data, 18);
> +   elm_map_geo_region_show(data,7.325201, 48.526813);
> +   elm_map_zoom_set(data, 12);
>    elm_map_paused_set(data, b);
>  }
>
> @@ -388,7 +388,7 @@
>  static void
>  map_track_remove(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void 
> *event_info __UNUSED__)
>  {
> -   elm_map_track_remove(track);
> +   elm_map_track_remove(data, track);
>  }
>
>  static void
> @@ -631,7 +631,7 @@
>         menu = elm_menu_add(obj);
>         item = elm_menu_item_add(menu, NULL, NULL, "Source", NULL, NULL);
>         _populate(data, item);
> -        elm_menu_item_add(menu, NULL, NULL, "Show Seoul", map_show_seoul, 
> data);
> +        elm_menu_item_add(menu, NULL, NULL, "Show Urmatt", map_show_urmatt, 
> data);
>         elm_menu_item_add(menu, NULL, NULL, "Bring Seoul", map_bring_seoul, 
> data);
>         elm_menu_item_add(menu, NULL, NULL, "Paused Set", map_paused_set, 
> data);
>         elm_menu_item_add(menu, NULL, NULL, "Paused Unset", map_paused_unset, 
> data);
>
> Modified: trunk/elementary/src/lib/Elementary.h.in
> ===================================================================
> --- trunk/elementary/src/lib/Elementary.h.in    2011-06-26 13:59:11 UTC (rev 
> 60702)
> +++ trunk/elementary/src/lib/Elementary.h.in    2011-06-26 17:36:18 UTC (rev 
> 60703)
> @@ -4173,12 +4173,9 @@
>    EAPI void                  elm_map_wheel_disabled_set(Evas_Object *obj, 
> Eina_Bool disabled) EINA_ARG_NONNULL(1);
>    EAPI Eina_Bool             elm_map_wheel_disabled_get(const Evas_Object 
> *obj) EINA_ARG_NONNULL(1);
>  #ifdef ELM_EMAP
> -   EAPI Elm_Map_Track        *elm_map_track_add(Evas_Object *obj, EMap_Route 
> *emap) EINA_ARG_NONNULL(1);
> -   EAPI EMap_Route              *elm_map_track_emap_get(Elm_Map_Track 
> *track) EINA_ARG_NONNULL(1);
> +   EAPI Evas_Object          *elm_map_track_add(Evas_Object *obj, EMap_Route 
> *emap) EINA_ARG_NONNULL(1);
>  #endif
> -   EAPI void                  elm_map_track_remove(Elm_Map_Track *track) 
> EINA_ARG_NONNULL(1);
> -   EAPI void                  elm_map_track_color_set(Elm_Map_Track *track, 
> int r, int g , int b, int a) EINA_ARG_NONNULL(1);
> -   EAPI void                  elm_map_track_color_get(const Elm_Map_Track 
> *track, int *r, int *g , int *b, int *a) EINA_ARG_NONNULL(1);
> +   EAPI void                  elm_map_track_remove(Evas_Object *obj, 
> Evas_Object *route) EINA_ARG_NONNULL(1);
>
>    /* smart callbacks called:
>     * "clicked" - when image clicked
> @@ -4197,6 +4194,17 @@
>     * "scroll,drag,stop" - dragging the contents around has stopped
>     */
>
> +   /* Route */
> +   EAPI Evas_Object *elm_route_add(Evas_Object *parent);
> +#ifdef ELM_EMAP
> +   EAPI Eina_Bool elm_route_emap_set(Evas_Object *obj, EMap_Route *emap);
> +#endif
> +   EAPI double elm_route_lon_min_get(Evas_Object *obj);
> +   EAPI double elm_route_lat_min_get(Evas_Object *obj);
> +   EAPI double elm_route_lon_max_get(Evas_Object *obj);
> +   EAPI double elm_route_lat_max_get(Evas_Object *obj);
> +
> +
>    /* panel */
>    typedef enum _Elm_Panel_Orient
>      {
>
> Modified: trunk/elementary/src/lib/Makefile.am
> ===================================================================
> --- trunk/elementary/src/lib/Makefile.am        2011-06-26 13:59:11 UTC (rev 
> 60702)
> +++ trunk/elementary/src/lib/Makefile.am        2011-06-26 17:36:18 UTC (rev 
> 60703)
> @@ -82,6 +82,7 @@
>  elm_main.c \
>  elm_mapbuf.c \
>  elm_map.c \
> +elm_route.c \
>  elm_menu.c \
>  elm_module.c \
>  elm_notify.c \
>
> Modified: trunk/elementary/src/lib/elm_map.c
> ===================================================================
> --- trunk/elementary/src/lib/elm_map.c  2011-06-26 13:59:11 UTC (rev 60702)
> +++ trunk/elementary/src/lib/elm_map.c  2011-06-26 17:36:18 UTC (rev 60703)
> @@ -287,28 +287,6 @@
>    Ecore_Event_Handler *handler;
>  };
>
> -struct _Elm_Map_Track
> -{
> -   Widget_Data *wd;
> -
> -#ifdef ELM_EMAP
> -   EMap_Route *emap;
> -#endif
> -
> -   int x, y;
> -
> -   Eina_List *nodes, *path;
> -
> -   struct {
> -      int r;
> -      int g;
> -      int b;
> -      int a;
> -   } color;
> -
> -   Eina_Bool inbound : 1;
> -};
> -
>  struct _Grid_Item
>  {
>    Widget_Data *wd;
> @@ -505,14 +483,6 @@
>    ZOOM_METHOD_LAST
>  } Zoom_Mode;
>
> -struct _Track_Dump
> -{
> -   Elm_Map_Track *track;
> -   int idx;
> -   double lon;
> -   double lat;
> -};
> -
>  enum _Track_Xml_Attribute
>  {
>    TRACK_XML_NONE,
> @@ -834,72 +804,35 @@
>  #ifdef ELM_EMAP
>    ELM_CHECK_WIDTYPE(obj, widtype);
>    Widget_Data *wd = elm_widget_data_get(obj);
> -   Eina_List *lr, *lp, *ln;
> -   EMap_Route_Node *n;
> -   Evas_Object *p;
> -   Elm_Map_Track *t;
> -   int nodes;
> -   int x, y, rx, ry;
> +   Eina_List *l;
> +   Evas_Object *route;
> +   int xmin, xmax, ymin, ymax;
>
>    if (!wd) return;
>    Evas_Coord size = pow(2.0, wd->zoom)*wd->tsize;
>
> -   EINA_LIST_FOREACH(wd->track, lr, t)
> +   EINA_LIST_FOREACH(wd->track, l, route)
>      {
> -        EINA_LIST_FOREACH(t->path, lp, p)
> -          {
> -             evas_object_polygon_points_clear(p);
> -          }
> +        elm_map_utils_convert_geo_into_coord(wd->obj, 
> elm_route_lon_min_get(route), elm_route_lat_max_get(route), size, &xmin, 
> &ymin);
> +        elm_map_utils_convert_geo_into_coord(wd->obj, 
> elm_route_lon_max_get(route), elm_route_lat_min_get(route), size, &xmax, 
> &ymax);
>
> -        evas_object_geometry_get(wd->rect, &rx, &ry, NULL, NULL);
> -        nodes = eina_list_count(emap_route_nodes_get(t->emap));
> +        if( !(xmin < px && xmax < px) && !(xmin > px+ow && xmax > px+ow))
> +        {
> +           if( !(ymin < py && ymax < py) && !(ymin > py+oh && ymax > py+oh))
> +           {
> +              //display the route
> +              evas_object_move(route, xmin - px + ox, ymin - py + oy);
> +              evas_object_resize(route, xmax - xmin, ymax - ymin);
>
> -        int i = 0;
> -        EINA_LIST_FOREACH(emap_route_nodes_get(t->emap), ln, n)
> -          {
> -             if (t->inbound)
> -               {
> -                  elm_map_utils_convert_geo_into_coord(wd->obj, 
> emap_route_node_lon_get(n), emap_route_node_lat_get(n), size, &x, &y);
> -                  if ((x >= px - ow) && (x <= (px + ow*2)) &&
> -                      (y >= py - oh) && (y <= (py + oh*2)))
> -                    {
> -                       x = x - px + rx;
> -                       y = y - py + ry;
> +              evas_object_raise(route);
> +              obj_rotate_zoom(obj, route);
> +              evas_object_show(route);
>
> -                       p = eina_list_nth(t->path, i);
> -                       if(!p)
> -                       {
> -                          p = 
> evas_object_line_add(evas_object_evas_get(t->wd->obj));
> -                          evas_object_smart_member_add(p, t->wd->pan_smart);
> -                          t->path = eina_list_append(t->path, p);
> -                       }
> -
> -                       evas_object_line_xy_set(p, t->x, t->y, x, y);
> -
> -                       evas_object_color_set(p, t->color.r, t->color.g, 
> t->color.b, t->color.a);
> -                       evas_object_raise(p);
> -                       obj_rotate_zoom(obj, p);
> -                       evas_object_show(p);
> -                       t->x = x;
> -                       t->y = y;
> -                    }
> -                  else t->inbound = EINA_FALSE;
> -               }
> -             else
> -               {
> -                  elm_map_utils_convert_geo_into_coord(wd->obj, 
> emap_route_node_lon_get(n), emap_route_node_lat_get(n), size, &x, &y);
> -                  if ((x >= px - ow) && (x <= (px + ow*2)) &&
> -                      (y >= py - oh) && (y <= (py + oh*2)))
> -                    {
> -                       t->x = x - px + rx;
> -                       t->y = y - py + ry;
> -                       t->inbound = EINA_TRUE;
> -                    }
> -                  else t->inbound = EINA_FALSE;
> -               }
> -             i++;
> -          }
> -          t->inbound = EINA_FALSE;
> +              continue;
> +           }
> +        }
> +        //the route is not display
> +        evas_object_hide(route);
>      }
>  #endif
>  }
> @@ -2111,7 +2044,7 @@
>    Ecore_Event_Handler *h;
>    Elm_Map_Route *r;
>    Elm_Map_Name *na;
> -   Elm_Map_Track *t;
> +   Evas_Object *route;
>
>    if (!wd) return;
>    EINA_LIST_FREE(wd->groups_clas, group_clas)
> @@ -2174,18 +2107,9 @@
>           }
>      }
>
> -   EINA_LIST_FOREACH(wd->track, l, t)
> +   EINA_LIST_FREE(wd->track, route)
>      {
> -        EINA_LIST_FREE(t->path, p)
> -          {
> -             evas_object_del(p);
> -          }
> -
> -        EINA_LIST_FREE(t->nodes, n)
> -          {
> -             if (n->pos.address) eina_stringshare_del(n->pos.address);
> -             free(n);
> -          }
> +        evas_object_del(route);
>      }
>
>    if (wd->map) evas_map_free(wd->map);
> @@ -3363,7 +3287,7 @@
>    Evas_Coord rx, ry, rw, rh;
>    Evas_Object *p;
>    Elm_Map_Route *r;
> -   Elm_Map_Track *t;
> +   Evas_Object *route;
>    int z = 0, zoom_changed = 0, started = 0;
>
>    if ((!wd) || (!wd->src) || (wd->zoom_animator)) return;
> @@ -3392,15 +3316,9 @@
>           }
>      }
>
> -   EINA_LIST_FOREACH(wd->track, l, t)
> +   EINA_LIST_FOREACH(wd->track, l, route)
>      {
> -        if (t)
> -          {
> -             EINA_LIST_FOREACH(t->path, l, p)
> -               {
> -                  evas_object_polygon_points_clear(p);
> -               }
> -          }
> +       evas_object_hide(route);
>      }
>
>    if (wd->mode != ELM_MAP_ZOOM_MODE_MANUAL)
> @@ -5264,40 +5182,25 @@
>  * @param obj The map object
>  * @param emap the emap object
>  *
> - * @return The Track object
> + * @return The Route object. This is a elm object of type Elm_Route
>  *
>  * @ingroup Map
>  */
> -EAPI Elm_Map_Track *
> +EAPI Evas_Object *
>  elm_map_track_add(Evas_Object *obj, EMap_Route *emap)
>  {
>    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
>    Widget_Data *wd = elm_widget_data_get(obj);
> -   FILE *f;
>
>    if (!wd) return EINA_FALSE;
>
> -   Elm_Map_Track *track = ELM_NEW(Elm_Map_Track);
> -   if (!track) return NULL;
> -   track->wd = wd;
> -   track->inbound = EINA_FALSE;
> -   track->color.r = 0;
> -   track->color.g = 0;
> -   track->color.b = 255;
> -   track->color.a = 255;
> -   track->emap = emap;
> +   Evas_Object *route = elm_route_add(obj);
> +   elm_route_emap_set(route, emap);
> +   wd->track = eina_list_append(wd->track, route);
>
> -   wd->track = eina_list_append(wd->track, track);
> -
> -   return track;
> +   return route;
>  }
>
> -
> -EMap_Route
> -*elm_map_track_emap_get(Elm_Map_Track *track)
> -{
> -   return track->emap;
> -}
>  #endif
>
>  /**
> @@ -5309,75 +5212,23 @@
>  */
>
>  EAPI void
> -elm_map_track_remove(Elm_Map_Track *track)
> +elm_map_track_remove(Evas_Object *obj, Evas_Object *route)
>  {
> -   EINA_SAFETY_ON_NULL_RETURN(track);
> +   ELM_CHECK_WIDTYPE(obj, widtype) ;
> +   Widget_Data *wd = elm_widget_data_get(obj);
>
> -   Path_Node *n;
> -   Evas_Object *p;
> +   if (!wd) return ;
>
> -   EINA_LIST_FREE(track->path, p)
> -     {
> -        evas_object_del(p);
> -     }
> -
> -   EINA_LIST_FREE(track->nodes, n)
> -     {
> -        if (n->pos.address) eina_stringshare_del(n->pos.address);
> -        free(n);
> -     }
> +   wd->track = eina_list_remove(wd->track, route);
> +   evas_object_del(route);
>  }
>
> -/**
> - * Set the option used for the background color
> - *
> - * @param track The track object
> - * @param r
> - * @param g
> - * @param b
> - * @param a
> - *
> - * This sets the color used for the track
> - *
> - * @ingroup Map
> - */
> -EAPI void
> -elm_map_track_color_set(Elm_Map_Track *track, int r, int g , int b, int a)
> -{
> -   EINA_SAFETY_ON_NULL_RETURN(track);
> -   track->color.r = r;
> -   track->color.g = g;
> -   track->color.b = b;
> -   track->color.a = a;
> -}
> -
> -/**
> - * Get the option used for the background color
> - *
> - * @param track The track object
> - * @param r
> - * @param g
> - * @param b
> - * @param a
> - *
> - * @ingroup Map
> - */
> -EAPI void
> -elm_map_track_color_get(const Elm_Map_Track *track, int *r, int *g , int *b, 
> int *a)
> -{
> -   EINA_SAFETY_ON_NULL_RETURN(track);
> -   if (r) *r = track->color.r;
> -   if (g) *g = track->color.g;
> -   if (b) *b = track->color.b;
> -   if (a) *a = track->color.a;
> -}
> -
>  static char *
>  _mapnik_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom)
>  {
>    char buf[PATH_MAX];
>    snprintf(buf, sizeof(buf), "http://tile.openstreetmap.org/%d/%d/%d.png";,
> -            zoom, x, y);
> +          zoom, x, y);
>    return strdup(buf);
>  }
>
>
>
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> _______________________________________________
> enlightenment-svn mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
>

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to