[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: gaf.git: branch: master updated (1.6.0-20091004-41-gcce79ff)



The branch, master has been updated
       via  cce79ff0e9cd2be1bdb9f9883317f5eadfa41c03 (commit)
       via  ce53e956128a330f7c13e1953cad937b27027323 (commit)
       via  3f30ab76bbf247e8151fd4bbfd43bb7703e0fb80 (commit)
      from  16090ce2eedc014d82e96fd340ec27f9ea6b186d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 gschem/include/gschem_struct.h   |    6 ++++++
 gschem/src/gschem.c              |    4 ++--
 gschem/src/gschem_toplevel.c     |    2 ++
 gschem/src/i_basic.c             |   15 +++++++--------
 gschem/src/i_callbacks.c         |   18 +++++++++---------
 gschem/src/i_vars.c              |    2 +-
 gschem/src/m_basic.c             |    6 +++---
 gschem/src/o_move.c              |    2 +-
 gschem/src/x_dialog.c            |    4 ++--
 gschem/src/x_grid.c              |   12 +++++-------
 libgeda/include/libgeda/struct.h |    9 ---------
 libgeda/src/g_smob.c             |    1 -
 libgeda/src/s_toplevel.c         |    3 ---
 13 files changed, 38 insertions(+), 46 deletions(-)


=================
 Commit Messages
=================

commit cce79ff0e9cd2be1bdb9f9883317f5eadfa41c03
Author: Peter Brett <ptbb2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    libgeda: Remove unused variable.

:100644 100644 84dfb5d... f7f09b8... M	libgeda/src/g_smob.c

commit ce53e956128a330f7c13e1953cad937b27027323
Author: Peter Brett <ptbb2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Move snap state tracking out of libgeda.
    
    Since snapping is only relevant to gschem, store snap state in the
    GSCHEM_TOPLEVEL structure.

:100644 100644 9d8bacb... fd9c0fa... M	gschem/include/gschem_struct.h
:100644 100644 4367d9f... 6d37781... M	gschem/src/gschem_toplevel.c
:100644 100644 0ae00b9... 1556b2a... M	gschem/src/i_basic.c
:100644 100644 bce47fc... 090feb8... M	gschem/src/i_callbacks.c
:100644 100644 f7a67e6... 6a91150... M	gschem/src/i_vars.c
:100644 100644 a92b246... 768f2b9... M	gschem/src/m_basic.c
:100644 100644 6d57f4a... fe300d6... M	gschem/src/o_move.c
:100644 100644 d1db73b... a4b9901... M	gschem/src/x_dialog.c
:100644 100644 2e705cf... 08a2f38... M	gschem/src/x_grid.c
:100644 100644 acac448... 8d47c52... M	libgeda/include/libgeda/struct.h
:100644 100644 490b001... 30ff1a8... M	libgeda/src/s_toplevel.c

commit 3f30ab76bbf247e8151fd4bbfd43bb7703e0fb80
Author: Peter Brett <ptbb2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    gschem: Fix some warnings about non-literal format strings.

:100644 100644 303a2e3... da45c07... M	gschem/src/gschem.c

=========
 Changes
=========

commit cce79ff0e9cd2be1bdb9f9883317f5eadfa41c03
Author: Peter Brett <ptbb2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    libgeda: Remove unused variable.

diff --git a/libgeda/src/g_smob.c b/libgeda/src/g_smob.c
index 84dfb5d..f7f09b8 100644
--- a/libgeda/src/g_smob.c
+++ b/libgeda/src/g_smob.c
@@ -853,7 +853,6 @@ SCM g_get_page_filename(SCM page_smob)
  */
 SCM g_set_page_filename(SCM page_smob, SCM scm_filename)
 {
-  SCM returned = SCM_EOL;
   PAGE *page;
   char *filename = NULL;
 

commit ce53e956128a330f7c13e1953cad937b27027323
Author: Peter Brett <ptbb2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Move snap state tracking out of libgeda.
    
    Since snapping is only relevant to gschem, store snap state in the
    GSCHEM_TOPLEVEL structure.

diff --git a/gschem/include/gschem_struct.h b/gschem/include/gschem_struct.h
index 9d8bacb..fd9c0fa 100644
--- a/gschem/include/gschem_struct.h
+++ b/gschem/include/gschem_struct.h
@@ -1,3 +1,6 @@
+/*! \brief different kind of snapping mechanisms used in TOPLEVEL */
+typedef enum {SNAP_OFF, SNAP_GRID, SNAP_RESNAP, SNAP_STATE_COUNT} SNAP_STATE;
+
 typedef struct st_gschem_toplevel GSCHEM_TOPLEVEL;
 
 struct st_gschem_toplevel {
@@ -176,6 +179,9 @@ struct st_gschem_toplevel {
   int bus_ripper_rotation;  /* sets if the the bus ripper is symmetric or not */
   int magneticnet_mode; /* enables/disables the magnetic net mode ON/OFF */
 
+  SNAP_STATE snap;                      /* Whether/how to snap to grid */
+  int snap_size;                        /* Snap grid parameter */
+
   /* sets the mininum number of pixels necessary for the grid to be */
   /* displayed */
   int dots_grid_fixed_threshold;
diff --git a/gschem/src/gschem_toplevel.c b/gschem/src/gschem_toplevel.c
index 4367d9f..6d37781 100644
--- a/gschem/src/gschem_toplevel.c
+++ b/gschem/src/gschem_toplevel.c
@@ -193,6 +193,8 @@ GSCHEM_TOPLEVEL *gschem_toplevel_new ()
   w_current->select_slack_pixels = 4;
   w_current->zoom_gain = 20;
   w_current->scrollpan_steps = 8;
+  w_current->snap = SNAP_GRID;
+  w_current->snap_size = 100;
 
   w_current->print_command = NULL;
 
diff --git a/gschem/src/i_basic.c b/gschem/src/i_basic.c
index 0ae00b9..1556b2a 100644
--- a/gschem/src/i_basic.c
+++ b/gschem/src/i_basic.c
@@ -167,9 +167,9 @@ void i_show_state(GSCHEM_TOPLEVEL *w_current, const char *message)
   if(toplevel->show_hidden_text)
     array[i--] = _("Show Hidden");
   
-  if(toplevel->snap == SNAP_OFF)
+  if(w_current->snap == SNAP_OFF)
     array[i--] = _("Snap Off");
-  else if (toplevel->snap == SNAP_RESNAP)
+  else if (w_current->snap == SNAP_RESNAP)
     array[i--] = _("Resnap Active");
   
   if(message && message[0])
@@ -535,7 +535,6 @@ void i_set_filename(GSCHEM_TOPLEVEL *w_current, const gchar *string)
  */
 void i_update_grid_info (GSCHEM_TOPLEVEL *w_current)
 {
-  TOPLEVEL *toplevel = w_current->toplevel;
   gchar *print_string=NULL;
   gchar *snap=NULL;
   gchar *grid=NULL;
@@ -543,19 +542,19 @@ void i_update_grid_info (GSCHEM_TOPLEVEL *w_current)
   if (!w_current->grid_label)
     return;
 
-  switch (toplevel->snap) {
+  switch (w_current->snap) {
   case SNAP_OFF:
     snap = g_strdup(_("OFF"));
     break;
   case SNAP_GRID:
-    snap = g_strdup_printf("%d", toplevel->snap_size);
+    snap = g_strdup_printf("%d", w_current->snap_size);
     break;
   case SNAP_RESNAP:
-    snap = g_strdup_printf("%dR", toplevel->snap_size);
+    snap = g_strdup_printf("%dR", w_current->snap_size);
     break;
   default:
-    g_critical("i_set_grid: toplevel->snap out of range: %d\n", 
-               toplevel->snap);
+    g_critical("i_set_grid: w_current->snap out of range: %d\n",
+               w_current->snap);
   }
 
   if (w_current->grid == GRID_NONE) {
diff --git a/gschem/src/i_callbacks.c b/gschem/src/i_callbacks.c
index bce47fc..090feb8 100644
--- a/gschem/src/i_callbacks.c
+++ b/gschem/src/i_callbacks.c
@@ -957,15 +957,15 @@ DEFINE_I_CALLBACK(edit_translate)
   i_update_middle_button(w_current,
                          i_callback_edit_translate, _("Translate"));
 
-  if (w_current->toplevel->snap == SNAP_OFF) {
+  if (w_current->snap == SNAP_OFF) {
     s_log_message(_("WARNING: Do not translate with snap off!\n"));
     s_log_message(_("WARNING: Turning snap on and continuing "
                   "with translate.\n"));
-    w_current->toplevel->snap = SNAP_GRID;
+    w_current->snap = SNAP_GRID;
     i_show_state(w_current, NULL); /* update status on screen */
   }
 
-  if (w_current->toplevel->snap_size != 100) {
+  if (w_current->snap_size != 100) {
     s_log_message(_("WARNING: Snap grid size is "
                   "not equal to 100!\n"));
     s_log_message(_("WARNING: If you are translating a symbol "
@@ -3354,7 +3354,7 @@ DEFINE_I_CALLBACK(options_scale_up_snap_size)
 
   exit_if_null(w_current);
 
-  w_current->toplevel->snap_size *= 2;
+  w_current->snap_size *= 2;
   w_current->toplevel->page_current->CHANGED=1;  /* maybe remove those two lines */
   o_undo_savestate(w_current, UNDO_ALL);
 
@@ -3373,8 +3373,8 @@ DEFINE_I_CALLBACK(options_scale_down_snap_size)
 
   exit_if_null(w_current);
 
-  if (w_current->toplevel->snap_size % 2 == 0)
-    w_current->toplevel->snap_size /= 2;
+  if (w_current->snap_size % 2 == 0)
+    w_current->snap_size /= 2;
   w_current->toplevel->page_current->CHANGED=1;  /* maybe remove those two lines */
   o_undo_savestate(w_current, UNDO_ALL);
 
@@ -3446,9 +3446,9 @@ DEFINE_I_CALLBACK(options_snap)
   GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
 
   /* toggle to the next snap state */
-  w_current->toplevel->snap = (w_current->toplevel->snap+1) % SNAP_STATE_COUNT;
+  w_current->snap = (w_current->snap+1) % SNAP_STATE_COUNT;
 
-  switch (w_current->toplevel->snap) {
+  switch (w_current->snap) {
   case SNAP_OFF:
     s_log_message(_("Snap OFF (CAUTION!)\n"));
     break;
@@ -3460,7 +3460,7 @@ DEFINE_I_CALLBACK(options_snap)
     break;
   default:
     g_critical("options_snap: toplevel->snap out of range: %d\n",
-               w_current->toplevel->snap);
+               w_current->snap);
   }
 
   i_show_state(w_current, NULL); /* update status on screen */
diff --git a/gschem/src/i_vars.c b/gschem/src/i_vars.c
index f7a67e6..6a91150 100644
--- a/gschem/src/i_vars.c
+++ b/gschem/src/i_vars.c
@@ -179,7 +179,7 @@ void i_vars_set(GSCHEM_TOPLEVEL *w_current)
   toplevel->object_clipping = default_object_clipping;
   w_current->embed_complex   = default_embed_complex;
   w_current->include_complex = default_include_complex;
-  toplevel->snap_size       = default_snap_size;
+  w_current->snap_size       = default_snap_size;
   w_current->log_window      = default_log_window;
   w_current->log_window_type = default_log_window_type;
 
diff --git a/gschem/src/m_basic.c b/gschem/src/m_basic.c
index a92b246..768f2b9 100644
--- a/gschem/src/m_basic.c
+++ b/gschem/src/m_basic.c
@@ -204,12 +204,12 @@ int snap_grid(GSCHEM_TOPLEVEL *w_current, int input)
   int p, m, n;
   int sign, value, snap_grid;
 
-  if (w_current->toplevel->snap == SNAP_OFF ||
-      w_current->toplevel->snap_size <= 0) {
+  if (w_current->snap == SNAP_OFF ||
+      w_current->snap_size <= 0) {
     return(input);
   }
 
-  snap_grid = w_current->toplevel->snap_size;
+  snap_grid = w_current->snap_size;
 
   /* this code was inspired from killustrator, it's much simpler than mine */
   sign = ( input < 0 ? -1 : 1 );
diff --git a/gschem/src/o_move.c b/gschem/src/o_move.c
index 6d57f4a..fe300d6 100644
--- a/gschem/src/o_move.c
+++ b/gschem/src/o_move.c
@@ -311,7 +311,7 @@ void o_move_motion (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
 
   /* realign the object if we are in resnap mode */
   if (selection != NULL
-      && toplevel->snap == SNAP_RESNAP) {
+      && w_current->snap == SNAP_RESNAP) {
 
     if (g_list_length(selection) > 1) {
       /* find an object that is not attached to any other object */
diff --git a/gschem/src/x_dialog.c b/gschem/src/x_dialog.c
index d1db73b..a4b9901 100644
--- a/gschem/src/x_dialog.c
+++ b/gschem/src/x_dialog.c
@@ -1970,7 +1970,7 @@ void snap_size_dialog_response(GtkWidget *w, gint response,
     spin_size = g_object_get_data(G_OBJECT(w_current->tswindow),"spin_size");
     size = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON(spin_size));
 
-    w_current->toplevel->snap_size = size;
+    w_current->snap_size = size;
     i_update_grid_info (w_current);
     o_invalidate_all (w_current);
     w_current->toplevel->page_current->CHANGED=1;  /* maybe remove those two lines */
@@ -2052,7 +2052,7 @@ void snap_size_dialog (GSCHEM_TOPLEVEL *w_current)
 
   /* always set the current gschem value to the dialog entry */
   spin_size = g_object_get_data(G_OBJECT(w_current->tswindow),"spin_size");
-  gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_size), w_current->toplevel->snap_size);
+  gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_size), w_current->snap_size);
   gtk_editable_select_region(GTK_EDITABLE(spin_size), 0, -1);
 }
 
diff --git a/gschem/src/x_grid.c b/gschem/src/x_grid.c
index 2e705cf..08a2f38 100644
--- a/gschem/src/x_grid.c
+++ b/gschem/src/x_grid.c
@@ -60,12 +60,12 @@ static int query_dots_grid_spacing (GSCHEM_TOPLEVEL *w_current)
                         DOTS_VARIABLE_MODE_SPACING) + 0.1;
 
     /* limit minimum grid spacing to grid to snap_size */
-    if (incr < toplevel->snap_size) {
-      incr = toplevel->snap_size;
+    if (incr < w_current->snap_size) {
+      incr = w_current->snap_size;
     }
   } else {
     /* Fixed size grid in world coorinates */
-    incr = toplevel->snap_size;
+    incr = w_current->snap_size;
     screen_incr = SCREENabs (w_current, incr);
     if (screen_incr < w_current->dots_grid_fixed_threshold) {
       /* No grid drawn if the on-screen spacing is less than the threshold */
@@ -226,10 +226,9 @@ static void draw_mesh (GSCHEM_TOPLEVEL *w_current, int color,
  */
 static int query_mesh_grid_spacing (GSCHEM_TOPLEVEL *w_current)
 {
-  TOPLEVEL *toplevel = w_current->toplevel;
   int incr, screen_incr;
 
-  incr = toplevel->snap_size;
+  incr = w_current->snap_size;
   screen_incr = SCREENabs (w_current, incr);
 
   /* We draw a fine grid if its on-screen spacing is large enough */
@@ -261,12 +260,11 @@ static int query_mesh_grid_spacing (GSCHEM_TOPLEVEL *w_current)
 static void draw_mesh_grid_region (GSCHEM_TOPLEVEL *w_current,
                                    int x, int y, int width, int height)
 {
-  TOPLEVEL *toplevel = w_current->toplevel;
   int x_start, y_start, x_end, y_end;
   int incr;
   int screen_incr;
 
-  incr = toplevel->snap_size;
+  incr = w_current->snap_size;
   screen_incr = SCREENabs (w_current, incr);
 
   SCREENtoWORLD (w_current, x - 1, y + height + 1, &x_start, &y_start);
diff --git a/libgeda/include/libgeda/struct.h b/libgeda/include/libgeda/struct.h
index acac448..8d47c52 100644
--- a/libgeda/include/libgeda/struct.h
+++ b/libgeda/include/libgeda/struct.h
@@ -426,9 +426,6 @@ struct st_page {
 
 };
 
-/*! \brief different kind of snapping mechanisms used in TOPLEVEL */
-typedef enum {SNAP_OFF, SNAP_GRID, SNAP_RESNAP, SNAP_STATE_COUNT} SNAP_STATE;
-
 /*! \brief Type of callback function for calculating text bounds */
 typedef int(*RenderedBoundsFunc)(void *, OBJECT *, int *, int *, int *, int *);
 
@@ -452,9 +449,6 @@ struct st_toplevel {
 
   int width, height;			/* height, width of window */
 
-  /*! \brief whether and how to snap to the current grid */
-  SNAP_STATE snap;
-
   int override_color;			/* used in doing selections */
 
   int last_ps_color;                    /* used in print code */
@@ -476,9 +470,6 @@ struct st_toplevel {
   int auto_save_interval;
   gint auto_save_timeout;
 
-  /* used by math funcs for the snapping */
-  int snap_size;		
-
   /* BLOCK SET IN GSCHEM, BUT USED IN LIBGEDA - NEEDS A RETHINK */
   int background_color;
   int override_net_color;
diff --git a/libgeda/src/s_toplevel.c b/libgeda/src/s_toplevel.c
index 490b001..30ff1a8 100644
--- a/libgeda/src/s_toplevel.c
+++ b/libgeda/src/s_toplevel.c
@@ -57,7 +57,6 @@ TOPLEVEL *s_toplevel_new (void)
 
   toplevel->width  = 1;
   toplevel->height = 1;
-  toplevel->snap = SNAP_GRID;
 
   toplevel->override_color = -1;
 
@@ -71,8 +70,6 @@ TOPLEVEL *s_toplevel_new (void)
 
   toplevel->major_changed_refdes = NULL;
 
-  toplevel->snap_size = 100;
-
   /* BLOCK SET IN GSCHEM, BUT USED IN LIBGEDA - NEEDS A RETHINK */
   toplevel->background_color   = 0;
   toplevel->override_net_color = -1;

commit 3f30ab76bbf247e8151fd4bbfd43bb7703e0fb80
Author: Peter Brett <ptbb2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    gschem: Fix some warnings about non-literal format strings.

diff --git a/gschem/src/gschem.c b/gschem/src/gschem.c
index 303a2e3..da45c07 100644
--- a/gschem/src/gschem.c
+++ b/gschem/src/gschem.c
@@ -216,9 +216,9 @@ void main_prog(void *closure, int argc, char *argv[])
     GtkWidget* error_diag =
       gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR,
                               GTK_BUTTONS_OK,
-                              message);
+                              "%s", message);
     gtk_dialog_run (GTK_DIALOG (error_diag));
-    g_error (message);
+    g_error ("%s", message);
   }
 
   /* Allocate w_current */




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs