Diff of /trunk/src/custom_type_renderer.c

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

revision 176 by harbaum, Wed Nov 11 20:21:55 2009 UTC revision 205 by harbaum, Mon Nov 23 20:12:22 2009 UTC
# Line 20  Line 20 
20  #include "gpxview.h"  #include "gpxview.h"
21  #include "custom_type_renderer.h"  #include "custom_type_renderer.h"
22    
23    #if defined(USE_MAEMO) && (MAEMO_VERSION_MAJOR >= 5)
24    #define CUSTOM_ICON_TYPE  ICON_CACHE_TYPE_1_5X
25    #else
26    #define CUSTOM_ICON_TYPE  ICON_CACHE_TYPE
27    #endif
28    
29  /* http://scentric.net/tutorial/sec-custom-cell-renderers.html */  /* http://scentric.net/tutorial/sec-custom-cell-renderers.html */
30  /* https://stage.maemo.org/svn/maemo/projects/haf/trunk/gtk+/gtk/gtkcellrendererpixbuf.c */  /* https://stage.maemo.org/svn/maemo/projects/haf/trunk/gtk+/gtk/gtkcellrendererpixbuf.c */
31  /* https://stage.maemo.org/svn/maemo/projects/haf/trunk/gtk+/gtk/gtkcellrenderertext.c */  /* https://stage.maemo.org/svn/maemo/projects/haf/trunk/gtk+/gtk/gtkcellrenderertext.c */
# Line 225  custom_cell_renderer_type_get_size (GtkC Line 231  custom_cell_renderer_type_get_size (GtkC
231     GtkWidget *widget, GdkRectangle *cell_area, gint *x_offset,     GtkWidget *widget, GdkRectangle *cell_area, gint *x_offset,
232     gint *y_offset, gint *width, gint *height) {     gint *y_offset, gint *width, gint *height) {
233    CustomCellRendererType *celltype = CUSTOM_CELL_RENDERER_TYPE (cell);    CustomCellRendererType *celltype = CUSTOM_CELL_RENDERER_TYPE (cell);
234  #if defined(USE_MAEMO) && (MAEMO_VERSION_MAJOR >= 5)    GdkPixbuf *pixbuf = icon_get(CUSTOM_ICON_TYPE, celltype->type>>8);
   GdkPixbuf *pixbuf = icon_get(ICON_CACHE_TYPE_1_5X, celltype->type>>8);  
 #else  
   GdkPixbuf *pixbuf = icon_get(ICON_CACHE_TYPE, celltype->type>>8);  
 #endif  
235    
236    if(!pixbuf) return;    if(!pixbuf) return;
237    
# Line 268  custom_cell_renderer_type_render (GtkCel Line 270  custom_cell_renderer_type_render (GtkCel
270                                        guint            flags)                                        guint            flags)
271  {  {
272    CustomCellRendererType *celltype = CUSTOM_CELL_RENDERER_TYPE (cell);    CustomCellRendererType *celltype = CUSTOM_CELL_RENDERER_TYPE (cell);
273  #if defined(USE_MAEMO) && (MAEMO_VERSION_MAJOR >= 5)    GdkPixbuf *pixbuf = icon_get(CUSTOM_ICON_TYPE, celltype->type>>8);
   GdkPixbuf *pixbuf = icon_get(ICON_CACHE_TYPE_1_5X, celltype->type>>8);  
 #else  
   GdkPixbuf *pixbuf = icon_get(ICON_CACHE_TYPE, celltype->type>>8);  
 #endif  
274    GdkRectangle all_rect;    GdkRectangle all_rect;
275    GdkRectangle draw_rect;    GdkRectangle draw_rect;
276    
# Line 299  custom_cell_renderer_type_render (GtkCel Line 297  custom_cell_renderer_type_render (GtkCel
297    gdk_cairo_rectangle(cr, &draw_rect);    gdk_cairo_rectangle(cr, &draw_rect);
298    cairo_fill(cr);    cairo_fill(cr);
299    
300    /* just a note, nothing else */    /* add "special" addon. the order of these test results in */
301      /* a priority */
302    GdkPixbuf *addon = NULL;    GdkPixbuf *addon = NULL;
303    if((celltype->type & 7) == 4)      // only note is set    if(celltype->type & 8)             // mine is set
304      addon = icon_get(ICON_MISC, 6);      addon = icon_get(CUSTOM_ICON_TYPE, 14);
305    if((celltype->type & 7) == 5)      // only note and override are set    else if(celltype->type & 2)        // solved is set
306      addon = icon_get(ICON_MISC, 1);      addon = icon_get(CUSTOM_ICON_TYPE, 12);
307    if(celltype->type & 2)             // solved is set    else if(celltype->type & 1)        // override is set
308      addon = icon_get(ICON_MISC, 4);      addon = icon_get(CUSTOM_ICON_TYPE, 11);
309      else if(celltype->type & 4)        // note is set
310        addon = icon_get(CUSTOM_ICON_TYPE, 13);
311    
312    /* if override (and not found) is set */    /* if override (and not found) is set */
313    if(addon) {    if(addon) {

Legend:
Removed from v.176  
changed lines
  Added in v.205