Diff of /trunk/src/icons.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 34 by harbaum, Wed Jul 29 19:24:15 2009 UTC revision 55 by harbaum, Thu Aug 13 12:01:52 2009 UTC
# Line 18  Line 18 
18   */   */
19    
20  #include "gpxview.h"  #include "gpxview.h"
21    #include <math.h>     // for isnan()
22    
23  struct icon_data {  struct icon_data {
24    GdkPixbuf **data;    GdkPixbuf **data;
# Line 30  struct icon_data { Line 31  struct icon_data {
31    { NULL, 9 },                 /* ICON_HEADING    */    { NULL, 9 },                 /* ICON_HEADING    */
32    { NULL, WPT_SYM_MAX+1 },     /* ICON_WPT        */    { NULL, WPT_SYM_MAX+1 },     /* ICON_WPT        */
33    { NULL, 1 },                 /* ICON_TB         */    { NULL, 1 },                 /* ICON_TB         */
34    { NULL, 8 },                 /* ICON_MISC       */    { NULL, 13 },                /* ICON_MISC       */
35    { NULL, 3 },                 /* ICON_FILE       */    { NULL, 3 },                 /* ICON_FILE       */
36    { NULL, -1 }    { NULL, -1 }
37  };  };
# Line 81  const char *tb_icon_name[] = { Line 82  const char *tb_icon_name[] = {
82  /* ICON_MISC         */  /* ICON_MISC         */
83  const char *misc_icon_name[] = {  const char *misc_icon_name[] = {
84    "maemo-mapper-out", "override", "locked", "unlocked", "found",    "maemo-mapper-out", "override", "locked", "unlocked", "found",
85    "maemo-mapper-in", "note", "delete"    "maemo-mapper-in", "note", "delete", "paypal",
86      "user", "zoomin", "zoomout", "info"
87  };  };
88    
89  /* ICON_FILE         */  /* ICON_FILE         */
# Line 210  GtkWidget *icon_get_widget(int type, int Line 212  GtkWidget *icon_get_widget(int type, int
212  }  }
213    
214  GdkPixbuf *icon_bearing(pos_t from, pos_t to) {  GdkPixbuf *icon_bearing(pos_t from, pos_t to) {
215    if(isnan(from.lat) && isnan(from.lon))    if(isnan(from.lat) || isnan(from.lon) ||
216         isnan(to.lat) || isnan(to.lon))
217      return icon_get(ICON_HEADING, 8);      return icon_get(ICON_HEADING, 8);
218    
219    int idx = (gpx_pos_get_bearing(from, to)+22.5)/45.0;    int idx = (gpx_pos_get_bearing(from, to)+22.5)/45.0;

Legend:
Removed from v.34  
changed lines
  Added in v.55