[xiph-commits] r12667 - trunk/sushivision

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Tue Mar 6 14:59:31 PST 2007


Author: xiphmont
Date: 2007-03-06 14:59:27 -0800 (Tue, 06 Mar 2007)
New Revision: 12667

Modified:
   trunk/sushivision/dimension.c
   trunk/sushivision/dimension.h
   trunk/sushivision/internal.h
   trunk/sushivision/main.c
   trunk/sushivision/mapping.c
   trunk/sushivision/panel-1d.c
   trunk/sushivision/panel-2d.c
   trunk/sushivision/panel.c
   trunk/sushivision/plot.c
   trunk/sushivision/undo.c
Log:
Several minor undo fixes
Finish implementing save; untested as 'open' isn't implemented yet.



Modified: trunk/sushivision/dimension.c
===================================================================
--- trunk/sushivision/dimension.c	2007-03-06 14:11:53 UTC (rev 12666)
+++ trunk/sushivision/dimension.c	2007-03-06 22:59:27 UTC (rev 12667)
@@ -760,7 +760,7 @@
 
 }
 
-int save_dimension(sushiv_dimension_t *d, xmlNodePtr instance){  
+int _save_dimension(sushiv_dimension_t *d, xmlNodePtr instance){  
   if(!d) return 0;
   char buffer[80];
   int ret=0;
@@ -788,15 +788,16 @@
   case SUSHIV_DIM_CONTINUOUS:
   case SUSHIV_DIM_DISCRETE:
     snprintf(buffer,sizeof(buffer),"%.20g",d->bracket[0]);
-    xmlNewChild(dn, NULL, (xmlChar *) "low-bracket", (xmlChar *)buffer);
+    xmlNewProp(dn, (xmlChar *) "low-bracket", (xmlChar *)buffer);
     snprintf(buffer,sizeof(buffer),"%.20g",d->bracket[1]);
-    xmlNewChild(dn, NULL, (xmlChar *) "high-bracket", (xmlChar *)buffer);
+    xmlNewProp(dn, (xmlChar *) "high-bracket", (xmlChar *)buffer);
     
   case SUSHIV_DIM_PICKLIST:
     snprintf(buffer,sizeof(buffer),"%.20g",d->val);
-    xmlNewChild(dn, NULL, (xmlChar *) "value", (xmlChar *)buffer);
+    xmlNewProp(dn, (xmlChar *) "value", (xmlChar *)buffer);
     break;
   }
 
   return ret;
 }
+

Modified: trunk/sushivision/dimension.h
===================================================================
--- trunk/sushivision/dimension.h	2007-03-06 14:11:53 UTC (rev 12666)
+++ trunk/sushivision/dimension.h	2007-03-06 22:59:27 UTC (rev 12667)
@@ -72,4 +72,4 @@
 extern sushiv_dim_widget_t *_sushiv_new_dimension_widget(sushiv_dimension_list_t *dl,   
 							 void (*center_callback)(sushiv_dimension_list_t *),
 							 void (*bracket_callback)(sushiv_dimension_list_t *));
-extern int save_dimension(sushiv_dimension_t *d, xmlNodePtr instance);
+extern int _save_dimension(sushiv_dimension_t *d, xmlNodePtr instance);

Modified: trunk/sushivision/internal.h
===================================================================
--- trunk/sushivision/internal.h	2007-03-06 14:11:53 UTC (rev 12666)
+++ trunk/sushivision/internal.h	2007-03-06 22:59:27 UTC (rev 12667)
@@ -47,9 +47,7 @@
 // unused for a given panel.
 typedef struct sushiv_panel_undo {
   u_int32_t *mappings;
-
   double *scale_vals[3];
-  double *dim_vals[3];
   
   int x_d;
   int y_d;
@@ -119,6 +117,7 @@
   void (*request_compute)(sushiv_panel_t *p);
   void (*crosshair_action)(sushiv_panel_t *p);
   void (*print_action)(sushiv_panel_t *p, cairo_t *c, int w, int h);
+  int (*save_action)(sushiv_panel_t *p, xmlNodePtr pn);
 
   void (*undo_log)(sushiv_panel_undo_t *u, sushiv_panel_t *p);
   void (*undo_restore)(sushiv_panel_undo_t *u, sushiv_panel_t *p);
@@ -172,7 +171,7 @@
 extern void _sushiv_panel_update_menus(sushiv_panel_t *p);
 
 extern int save_main();
-extern int save_panel(sushiv_panel_t *p, xmlNodePtr instance);
+extern int _save_panel(sushiv_panel_t *p, xmlNodePtr instance);
 
 extern sig_atomic_t _sushiv_exiting;
 extern char *filebase;

Modified: trunk/sushivision/main.c
===================================================================
--- trunk/sushivision/main.c	2007-03-06 14:11:53 UTC (rev 12666)
+++ trunk/sushivision/main.c	2007-03-06 22:59:27 UTC (rev 12667)
@@ -306,7 +306,7 @@
   return 0;
 }
 
-int save_instance(sushiv_instance_t *s, xmlNodePtr root){
+static int save_instance(sushiv_instance_t *s, xmlNodePtr root){
   if(!s) return 0;
   char buffer[80];
   int i, ret=0;
@@ -320,13 +320,13 @@
   
   // dimension values are independent of panel
   for(i=0;i<s->dimensions;i++)
-    ret|=save_dimension(s->dimension_list[i], instance);
+    ret|=_save_dimension(s->dimension_list[i], instance);
   
   // objectives have no independent settings
 
   // panel settings (by panel)
   for(i=0;i<s->panels;i++)
-    ret|=save_panel(s->panel_list[i], instance);
+    ret|=_save_panel(s->panel_list[i], instance);
 
   return ret;
 }

Modified: trunk/sushivision/mapping.c
===================================================================
--- trunk/sushivision/mapping.c	2007-03-06 14:11:53 UTC (rev 12666)
+++ trunk/sushivision/mapping.c	2007-03-06 22:59:27 UTC (rev 12667)
@@ -422,15 +422,15 @@
 };
 
 static char *solidnames[]={
-  "<span foreground=\"black\">black</span>",
-  "<span foreground=\"red\">red</span>",
-  "<span foreground=\"green\">green</span>",
-  "<span foreground=\"blue\">blue</span>",
-  "<span foreground=\"yellow\">yellow</span>",
-  "<span foreground=\"cyan\">cyan</span>",
-  "<span foreground=\"purple\">purple</span>",
-  "<span foreground=\"gray\">gray</span>",
-  "<span foreground=\"white\">white</span>",
+  "black",
+  "red",
+  "green",
+  "blue",
+  "yellow",
+  "cyan",
+  "purple",
+  "gray",
+  "white",
   "inactive",
   0
 };
@@ -454,6 +454,7 @@
 }
 
 void solid_set_func(mapping *m, int funcnum){
+  m->mapnum = funcnum;
   m->mapfunc = mapsolid[funcnum];
   m->mixfunc = mixsolid[funcnum];
 }

Modified: trunk/sushivision/panel-1d.c
===================================================================
--- trunk/sushivision/panel-1d.c	2007-03-06 14:11:53 UTC (rev 12666)
+++ trunk/sushivision/panel-1d.c	2007-03-06 22:59:27 UTC (rev 12667)
@@ -422,7 +422,7 @@
 
     // add each active objective to the legend
     // choose the value under the crosshairs 
-    {
+    if(plot->cross_active){
       double val = (p1->flip?plot->sely:plot->selx);
       int bin = rint(scalespace_pixel(&p1->x_v, val));
 
@@ -1129,12 +1129,13 @@
       (p1->mappings[i].mapnum<<24) | 
       (p1->linetype[i]<<16) |
       (p1->pointtype[i]<<8);
-    u->scale_vals[2][0] = slider_get_value(p1->alpha_scale[i],0);
+    u->scale_vals[2][i] = slider_get_value(p1->alpha_scale[i],0);
   }
 
   u->x_d = p1->x_dnum;
   u->box[0] = p1->oldbox[0];
   u->box[1] = p1->oldbox[1];
+
   u->box_active = p->private->oldbox_active;
   
 }
@@ -1142,7 +1143,6 @@
 static void panel1d_undo_restore(sushiv_panel_undo_t *u, sushiv_panel_t *p){
   sushiv_panel1d_t *p1 = p->subtype->p1;
   Plot *plot = PLOT(p->private->graph);
-  sushiv_panel_t *link = (p1->link_x?p1->link_x:p1->link_y);
 
   int i;
   
@@ -1161,16 +1161,8 @@
   if(p1->dim_xb && u->x_d<p->dimensions && p1->dim_xb[u->x_d])
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(p1->dim_xb[u->x_d]),TRUE);
 
-  /* make sure x_d is set before updating the x_d sliders! */
   update_x_sel(p);
 
-  if(link){
-    /* doesn't matter which widget belonging to the dimension is the one that gets set */
-    _sushiv_dimension_set_value(p1->x_d->private->widget_list[0],0,u->dim_vals[0][p->dimensions]);
-    _sushiv_dimension_set_value(p1->x_d->private->widget_list[0],1,u->dim_vals[1][p->dimensions]);
-    _sushiv_dimension_set_value(p1->x_d->private->widget_list[0],2,u->dim_vals[2][p->dimensions]);
-  }
-
   if(u->box_active){
     p1->oldbox[0] = u->box[0];
     p1->oldbox[1] = u->box[1];
@@ -1184,6 +1176,7 @@
 
 void _sushiv_realize_panel1d(sushiv_panel_t *p){
   sushiv_panel1d_t *p1 = p->subtype->p1;
+  char buffer[160];
   int i;
   _sushiv_undo_suspend(p->sushi);
 
@@ -1235,7 +1228,6 @@
   /* may be vertical to the left of the plot or along the bottom if the plot is flipped */
   {
     GtkWidget **sl = calloc(2,sizeof(*sl));
-
     int lo = p1->range_scale->val_list[0];
     int hi = p1->range_scale->val_list[p1->range_scale->vals-1];
 
@@ -1293,8 +1285,14 @@
       {
 	GtkWidget *menu=gtk_combo_box_new_markup();
 	int j;
-	for(j=0;j<num_solids();j++)
-	  gtk_combo_box_append_text (GTK_COMBO_BOX (menu), solid_name(j));
+	for(j=0;j<num_solids();j++){
+	  if(strcmp(solid_name(j),"inactive"))
+	    snprintf(buffer,sizeof(buffer),"<span foreground=\"%s\">%s</span>",solid_name(j),solid_name(j));
+	  else
+	    snprintf(buffer,sizeof(buffer),"%s",solid_name(j));
+	  
+	  gtk_combo_box_append_text (GTK_COMBO_BOX (menu), buffer);
+	}
 	gtk_combo_box_set_active(GTK_COMBO_BOX(menu),0);
 	g_signal_connect (G_OBJECT (menu), "changed",
 			  G_CALLBACK (mapchange_callback_1d), p->objective_list+i);
@@ -1408,6 +1406,73 @@
   _sushiv_undo_resume(p->sushi);
 }
 
+
+static int _save_panel1d(sushiv_panel_t *p, xmlNodePtr pn){  
+  sushiv_panel1d_t *p1 = p->subtype->p1;
+  char buffer[80];
+  int ret=0,i;
+
+  xmlNodePtr n;
+
+  xmlNewProp(pn, (xmlChar *)"type", (xmlChar *)"1d");
+
+  // box
+  xmlNodePtr boxn = xmlNewChild(pn, NULL, (xmlChar *) "box", NULL);
+  if(p->private->oldbox_active){
+    xmlNewProp(boxn, (xmlChar *)"active",(xmlChar *)"yes");
+    snprintf(buffer,sizeof(buffer),"%.20g",p1->oldbox[0]);
+    xmlNewProp(boxn, (xmlChar *)"x1", (xmlChar *)buffer);
+    snprintf(buffer,sizeof(buffer),"%.20g",p1->oldbox[1]);
+    xmlNewProp(boxn, (xmlChar *)"x2", (xmlChar *)buffer);
+  }else
+    xmlNewProp(boxn, (xmlChar *)"active",(xmlChar *)"no");
+
+  // objective map settings
+  for(i=0;i<p->objectives;i++){
+    sushiv_objective_t *o = p->objective_list[i].o;
+
+    xmlNodePtr on = xmlNewChild(pn, NULL, (xmlChar *) "objective", NULL);
+    snprintf(buffer,sizeof(buffer),"%d",i);
+    xmlNewProp(on, (xmlChar *)"position", (xmlChar *)buffer);
+    snprintf(buffer,sizeof(buffer),"%d",o->number);
+    xmlNewProp(on, (xmlChar *)"number", (xmlChar *)buffer);
+    xmlNewProp(on, (xmlChar *)"name", (xmlChar *)o->name);
+    xmlNewProp(on, (xmlChar *)"type", (xmlChar *)o->output_types);
+    
+    // right now Y is the only type; the below is Y-specific
+    // solid map 
+    n = xmlNewChild(on, NULL, (xmlChar *) "mapping", NULL);
+    xmlNewProp(n, (xmlChar *)"type", (xmlChar *)solid_name(p1->mappings[i].mapnum));    
+
+    // line type 
+    n = xmlNewChild(on, NULL, (xmlChar *) "line", NULL);
+    xmlNewProp(n, (xmlChar *)"type", (xmlChar *)line_name[p1->linetype[i]]);    
+
+    // point type
+    n = xmlNewChild(on, NULL, (xmlChar *) "point", NULL);
+    xmlNewProp(n, (xmlChar *)"type", (xmlChar *)point_name[p1->pointtype[i]]);    
+
+    // alpha slider
+    n = xmlNewChild(on, NULL, (xmlChar *) "transparency", NULL);
+    snprintf(buffer,sizeof(buffer),"%.20g",slider_get_value(p1->alpha_scale[i],0));
+    xmlNewProp(n, (xmlChar *)"alpha", (xmlChar *)buffer);
+  }
+
+  // y scale
+  n = xmlNewChild(pn, NULL, (xmlChar *) "range", NULL);
+  snprintf(buffer,sizeof(buffer),"%.20g",slider_get_value(p1->range_slider,0));
+  xmlNewProp(n, (xmlChar *)"low-bracket", (xmlChar *)buffer);
+  snprintf(buffer,sizeof(buffer),"%.20g",slider_get_value(p1->range_slider,1));
+  xmlNewProp(n, (xmlChar *)"high-bracket", (xmlChar *)buffer);
+
+  // x/y dim selection
+  n = xmlNewChild(pn, NULL, (xmlChar *) "selected-x", NULL);
+  snprintf(buffer,sizeof(buffer),"%d",p1->x_dnum);
+  xmlNewProp(n, (xmlChar *)"pos", (xmlChar *)buffer);
+
+  return ret;
+}
+
 int sushiv_new_panel_1d(sushiv_instance_t *s,
 			int number,
 			const char *name,
@@ -1440,6 +1505,7 @@
   p->private->request_compute = _mark_recompute_1d;
   p->private->crosshair_action = crosshair_callback;
   p->private->print_action = sushiv_panel1d_print;
+  p->private->save_action = _save_panel1d;
 
   p->private->undo_log = panel1d_undo_log;
   p->private->undo_restore = panel1d_undo_restore;
@@ -1482,4 +1548,3 @@
 
   return 0;
 }
-

Modified: trunk/sushivision/panel-2d.c
===================================================================
--- trunk/sushivision/panel-2d.c	2007-03-06 14:11:53 UTC (rev 12666)
+++ trunk/sushivision/panel-2d.c	2007-03-06 22:59:27 UTC (rev 12667)
@@ -1837,6 +1837,65 @@
   _sushiv_undo_resume(p->sushi);
 }
 
+static int _save_panel2d(sushiv_panel_t *p, xmlNodePtr pn){  
+  sushiv_panel2d_t *p2 = p->subtype->p2;
+  char buffer[80];
+  int ret=0,i;
+
+  xmlNodePtr n;
+
+  xmlNewProp(pn, (xmlChar *)"type", (xmlChar *)"2d");
+
+  // box
+  xmlNodePtr boxn = xmlNewChild(pn, NULL, (xmlChar *) "box", NULL);
+  if(p->private->oldbox_active){
+    xmlNewProp(boxn, (xmlChar *)"active",(xmlChar *)"yes");
+    snprintf(buffer,sizeof(buffer),"%.20g",p2->oldbox[0]);
+    xmlNewProp(boxn, (xmlChar *)"x1", (xmlChar *)buffer);
+    snprintf(buffer,sizeof(buffer),"%.20g",p2->oldbox[1]);
+    xmlNewProp(boxn, (xmlChar *)"x2", (xmlChar *)buffer);
+    snprintf(buffer,sizeof(buffer),"%.20g",p2->oldbox[2]);
+    xmlNewProp(boxn, (xmlChar *)"y1", (xmlChar *)buffer);
+    snprintf(buffer,sizeof(buffer),"%.20g",p2->oldbox[3]);
+    xmlNewProp(boxn, (xmlChar *)"y2", (xmlChar *)buffer);
+  }else
+    xmlNewProp(boxn, (xmlChar *)"active",(xmlChar *)"no");
+
+  // objective map settings
+  for(i=0;i<p->objectives;i++){
+    sushiv_objective_t *o = p->objective_list[i].o;
+
+    xmlNodePtr on = xmlNewChild(pn, NULL, (xmlChar *) "objective", NULL);
+    snprintf(buffer,sizeof(buffer),"%d",i);
+    xmlNewProp(on, (xmlChar *)"position", (xmlChar *)buffer);
+    snprintf(buffer,sizeof(buffer),"%d",o->number);
+    xmlNewProp(on, (xmlChar *)"number", (xmlChar *)buffer);
+    xmlNewProp(on, (xmlChar *)"name", (xmlChar *)o->name);
+    xmlNewProp(on, (xmlChar *)"type", (xmlChar *)o->output_types);
+    
+    // right now Y is the only type; the below is Y-specific
+    n = xmlNewChild(on, NULL, (xmlChar *) "mapping", NULL);
+    xmlNewProp(n, (xmlChar *)"type", (xmlChar *)mapping_name(p2->mappings[i].mapnum));
+    n = xmlNewChild(on, NULL, (xmlChar *) "y-scale", NULL);
+    snprintf(buffer,sizeof(buffer),"%.20g",slider_get_value(p2->range_scales[i],0));
+    xmlNewProp(n, (xmlChar *)"low-bracket", (xmlChar *)buffer);
+    snprintf(buffer,sizeof(buffer),"%.20g",slider_get_value(p2->range_scales[i],1));
+    xmlNewProp(n, (xmlChar *)"alpha", (xmlChar *)buffer);
+    snprintf(buffer,sizeof(buffer),"%.20g",slider_get_value(p2->range_scales[i],2));
+    xmlNewProp(n, (xmlChar *)"high-bracket", (xmlChar *)buffer);
+  }
+
+  // x/y dim selection
+  n = xmlNewChild(pn, NULL, (xmlChar *) "selected-x", NULL);
+  snprintf(buffer,sizeof(buffer),"%d",p2->x_dnum);
+  xmlNewProp(n, (xmlChar *)"pos", (xmlChar *)buffer);
+  n = xmlNewChild(pn, NULL, (xmlChar *) "selected-y", NULL);
+  snprintf(buffer,sizeof(buffer),"%d",p2->y_dnum);
+  xmlNewProp(n, (xmlChar *)"pos", (xmlChar *)buffer);
+
+  return ret;
+}
+
 int sushiv_new_panel_2d(sushiv_instance_t *s,
 			int number,
 			const char *name, 
@@ -1879,6 +1938,7 @@
   p->private->print_action = sushiv_panel2d_print;
   p->private->undo_log = panel2d_undo_log;
   p->private->undo_restore = panel2d_undo_restore;
+  p->private->save_action = _save_panel2d;
 
   /* set up helper data structures for rendering */
 
@@ -1960,4 +2020,3 @@
 
   return 0;
 }
-

Modified: trunk/sushivision/panel.c
===================================================================
--- trunk/sushivision/panel.c	2007-03-06 14:11:53 UTC (rev 12666)
+++ trunk/sushivision/panel.c	2007-03-06 22:59:27 UTC (rev 12667)
@@ -685,6 +685,13 @@
   case GDK_M:
     cycleB_res(p);
     return TRUE;
+
+  case GDK_s:
+    do_save(p);
+    return TRUE;
+  case GDK_o:
+    do_load(p);
+    return TRUE;
     
    case GDK_Escape:
      wrap_escape(p);
@@ -982,15 +989,17 @@
 
   // panel-subtype-specific restore
   p->private->undo_restore(u,p);
+
   _sushiv_panel_dirty_legend(p); 
 }
 
-int save_panel(sushiv_panel_t *p, xmlNodePtr instance){  
+int _save_panel(sushiv_panel_t *p, xmlNodePtr instance){  
   if(!p) return 0;
   char buffer[80];
   int ret=0;
 
   xmlNodePtr pn = xmlNewChild(instance, NULL, (xmlChar *) "panel", NULL);
+  xmlNodePtr n;
 
   snprintf(buffer,sizeof(buffer),"%d",p->number);
   xmlNewProp(pn, (xmlChar *)"number", (xmlChar *)buffer);
@@ -1001,22 +1010,81 @@
   // we're only saving settings independent of subtype
 
   // background
+  n = xmlNewChild(pn, NULL, (xmlChar *) "background", NULL);
   switch(p->private->bg_type){
   case 0:
-    xmlNewChild(pn, NULL, (xmlChar *) "background", (xmlChar *) "white");
+    xmlNewProp(n, (xmlChar *)"color", (xmlChar *)"white");
     break;
   case 1:
-    xmlNewChild(pn, NULL, (xmlChar *) "background", (xmlChar *) "black");
+    xmlNewProp(n, (xmlChar *)"color", (xmlChar *)"black");
     break;
   case 2:
-    xmlNewChild(pn, NULL, (xmlChar *) "background", (xmlChar *) "checked");
+    xmlNewProp(n, (xmlChar *)"color", (xmlChar *)"checked");
     break;
   }
 
-  // box
-  xmlNodePtr boxn = xmlNewChild(pn, NULL, (xmlChar *) "box", NULL);
-  snprintf(buffer,sizeof(buffer),"%d",p->private->oldbox_active);
-  xmlNewProp(boxn, (xmlChar *)"active", (xmlChar *)buffer);
+  // grid
+  n = xmlNewChild(pn, NULL, (xmlChar *) "grid", NULL);
+  switch(PLOT(p->private->graph)->grid_mode){
+  case PLOT_GRID_LIGHT:
+    xmlNewProp(n, (xmlChar *)"mode", (xmlChar *)"normal");
+    xmlNewProp(n, (xmlChar *)"color", (xmlChar *)"light");
+    break;
+  case PLOT_GRID_NORMAL:
+    xmlNewProp(n, (xmlChar *)"mode", (xmlChar *)"normal");
+    xmlNewProp(n, (xmlChar *)"color", (xmlChar *)"mid");
+    break;
+  case PLOT_GRID_DARK:
+    xmlNewProp(n, (xmlChar *)"mode", (xmlChar *)"normal");
+    xmlNewProp(n, (xmlChar *)"color", (xmlChar *)"dark");
+    break;
+  case PLOT_GRID_TICS:
+    xmlNewProp(n, (xmlChar *)"mode", (xmlChar *)"tics");
+    break;
+  default:
+    xmlNewProp(n, (xmlChar *)"mode", (xmlChar *)"none");
+    break;
+  }
 
+  // crosshairs
+  xmlNodePtr boxn = xmlNewChild(pn, NULL, (xmlChar *) "crosshairs", NULL);
+  xmlNewProp(boxn, (xmlChar *)"active", 
+	     (xmlChar *) (PLOT(p->private->graph)->cross_active ? "yes" : "no"));
+    
+  // legend
+  n = xmlNewChild(pn, NULL, (xmlChar *) "legend", NULL);
+  switch(PLOT(p->private->graph)->legend_active){
+  case 0: //inactive
+    xmlNewProp(n, (xmlChar *)"mode", (xmlChar *)"none");
+    break;
+  case 1: //shadowed
+    xmlNewProp(n, (xmlChar *)"mode", (xmlChar *)"shadowed");
+    break;
+  case 2: //boxed
+    xmlNewProp(n, (xmlChar *)"mode", (xmlChar *)"boxed");
+    break;
+  }
+
+  // text
+  n = xmlNewChild(pn, NULL, (xmlChar *) "text", NULL);
+  switch(PLOT(p->private->graph)->bg_inv){
+  case 0:
+    xmlNewProp(n, (xmlChar *)"color", (xmlChar *)"white");
+    break;
+  default:
+    xmlNewProp(n, (xmlChar *)"color", (xmlChar *)"black");
+    break;
+  }
+
+  // resample
+  n = xmlNewChild(pn, NULL, (xmlChar *) "sampling", NULL);
+  snprintf(buffer,sizeof(buffer),"%d:%d",
+	   p->private->oversample_n, p->private->oversample_d);
+  xmlNewProp(n, (xmlChar *)"ratio", (xmlChar *)buffer);
+
+  // subtype 
+  if(p->private->save_action)
+    ret |= p->private->save_action(p, pn);
+
   return ret;
 }

Modified: trunk/sushivision/plot.c
===================================================================
--- trunk/sushivision/plot.c	2007-03-06 14:11:53 UTC (rev 12666)
+++ trunk/sushivision/plot.c	2007-03-06 22:59:27 UTC (rev 12667)
@@ -819,10 +819,11 @@
     p->selx = scalespace_value(&p->x,event->x);
     p->sely = scalespace_value(&p->y,event->y);
     plot_snap_crosshairs(p);
-    p->cross_active=1;
 
     if(p->crosshairs_callback)
       p->crosshairs_callback(p->cross_data);
+
+    p->cross_active=1;
     plot_expose_request(p);
   }
 

Modified: trunk/sushivision/undo.c
===================================================================
--- trunk/sushivision/undo.c	2007-03-06 14:11:53 UTC (rev 12666)
+++ trunk/sushivision/undo.c	2007-03-06 22:59:27 UTC (rev 12667)
@@ -109,11 +109,8 @@
   int i;
   sushiv_instance_undo_t *u = s->private->undo_stack[s->private->undo_level];
 
-  // panels
-  for(i=0;i<s->panels;i++)
-    _sushiv_panel_undo_restore(s->panel_list[i],u->panels+i);
-
   // dims 
+  // need to happen first as setting dims can have side effect (like activating crosshairs)
   for(i=0;i<s->dimensions;i++){
     sushiv_dimension_t *d = s->dimension_list[i];
     if(d){
@@ -122,6 +119,14 @@
       sushiv_dimension_set_value(s, d->number, 2, u->dim_vals[2][i]);
     }
   }
+
+  // panels
+  for(i=0;i<s->panels;i++){
+    sushiv_panel_t *p = s->panel_list[i];
+    if(p)
+      _sushiv_panel_undo_restore(s->panel_list[i],u->panels+i);
+  }
+
 }
 
 void _sushiv_undo_push(sushiv_instance_t *s){
@@ -164,3 +169,6 @@
   _sushiv_undo_resume(s);
   update_all_menus(s);
 }
+
+
+// load piggybacks off the undo infrastructure



More information about the commits mailing list