[xiph-commits] r12246 - trunk/sushivision

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Wed Dec 27 20:29:28 PST 2006


Author: xiphmont
Date: 2006-12-27 20:29:26 -0800 (Wed, 27 Dec 2006)
New Revision: 12246

Modified:
   trunk/sushivision/gtksucks.c
   trunk/sushivision/gtksucks.h
   trunk/sushivision/internal.h
   trunk/sushivision/panel-2d.c
   trunk/sushivision/undo.c
Log:
Create a minor variant of combo_box_new_text that allows markup in text cells.



Modified: trunk/sushivision/gtksucks.c
===================================================================
--- trunk/sushivision/gtksucks.c	2006-12-28 00:27:00 UTC (rev 12245)
+++ trunk/sushivision/gtksucks.c	2006-12-28 04:29:26 UTC (rev 12246)
@@ -340,3 +340,24 @@
 
   gtk_label_set_label(GTK_LABEL(label),text);
 }
+
+/**********************************************************************/
+/* unlock text combo boxes to support markup as well as straight text */
+
+GtkWidget * gtk_combo_box_new_markup (void){
+  GtkWidget *combo_box;
+  GtkCellRenderer *cell;
+  GtkListStore *store;
+
+  store = gtk_list_store_new (1, G_TYPE_STRING);
+  combo_box = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store));
+  g_object_unref (store);
+
+  cell = gtk_cell_renderer_text_new ();
+  gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), cell, TRUE);
+  gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), cell,
+                                  "markup", 0,
+                                  NULL);
+
+  return combo_box;
+}

Modified: trunk/sushivision/gtksucks.h
===================================================================
--- trunk/sushivision/gtksucks.h	2006-12-28 00:27:00 UTC (rev 12245)
+++ trunk/sushivision/gtksucks.h	2006-12-28 04:29:26 UTC (rev 12246)
@@ -33,5 +33,6 @@
 				      void *callback_data);
 extern GtkWidget *gtk_menu_get_item(GtkMenu *m, int pos);
 extern void gtk_menu_alter_item_label(GtkMenu *m, int pos, char *text);
+extern GtkWidget * gtk_combo_box_new_markup (void);
 
 #endif

Modified: trunk/sushivision/internal.h
===================================================================
--- trunk/sushivision/internal.h	2006-12-28 00:27:00 UTC (rev 12245)
+++ trunk/sushivision/internal.h	2006-12-28 04:29:26 UTC (rev 12246)
@@ -41,6 +41,7 @@
 typedef struct sushiv_panel_undo {
   sushiv_panel_t *p;
   int *mappings;
+  int *submappings;
 
   double *scale_vals[3];
   double *obj_vals[3];

Modified: trunk/sushivision/panel-2d.c
===================================================================
--- trunk/sushivision/panel-2d.c	2006-12-28 00:27:00 UTC (rev 12245)
+++ trunk/sushivision/panel-2d.c	2006-12-28 04:29:26 UTC (rev 12246)
@@ -835,26 +835,13 @@
      checks. */
   u_int32_t render[w];
 
-  /* which dim is our x?  Our y? */
-  for(i=0;i<d;i++){
-    sushiv_dimension_t *dim = p->dimension_list[i].d;
-    if(dim == p2->x_d){
-      x_min = scalespace_value(&sx,0);
-      x_max = scalespace_value(&sx,w);
-      x_d = dim->number;
-      break;
-    }
-  }
+  x_min = scalespace_value(&sx,0);
+  x_max = scalespace_value(&sx,w);
+  x_d = p2->x_d->number;
 
-  for(i=0;i<d;i++){
-    sushiv_dimension_t *dim = p->dimension_list[i].d;
-    if(dim == p2->y_d){
-      y_min = scalespace_value(&sy,h);
-      y_max = scalespace_value(&sy,0);
-      y_d = dim->number;
-      break;
-    }
-  }
+  y_min = scalespace_value(&sy,h);
+  y_max = scalespace_value(&sy,0);
+  y_d = p2->y_d->number;
 
   // if the scale bound has changed, fast scale our background data to fill
   // the pane while new, more precise data renders.
@@ -1281,10 +1268,10 @@
     
     /* mapping pulldown */
     {
-      GtkWidget *menu=gtk_combo_box_new_text();
+      GtkWidget *menu=gtk_combo_box_new_markup();
       int j;
       for(j=0;j<num_mappings();j++)
-	gtk_combo_box_append_text (GTK_COMBO_BOX (menu), mapping_name(j));
+	gtk_combo_box_append_text (GTK_COMBO_BOX (menu), "<i>testing</i>");//mapping_name(j));
       gtk_combo_box_set_active(GTK_COMBO_BOX(menu),0);
       g_signal_connect (G_OBJECT (menu), "changed",
 			G_CALLBACK (mapchange_callback_2d), p->objective_list+i);

Modified: trunk/sushivision/undo.c
===================================================================
--- trunk/sushivision/undo.c	2006-12-28 00:27:00 UTC (rev 12245)
+++ trunk/sushivision/undo.c	2006-12-28 04:29:26 UTC (rev 12246)
@@ -68,9 +68,10 @@
 
   if(recomp_flag)
     p->private->request_compute(p);
-  else if(remap_flag)
+  else if(remap_flag){
     p->private->map_redraw(p);
-  else
+    p->private->legend_redraw(p);
+  }else
     plot_expose_request(PLOT(p->private->graph));
 }
 



More information about the commits mailing list