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

gEDA-cvs: branch: master updated (1.1.2.20070818-90-gf71ae05)



The branch, master has been updated
       via  f71ae05abf00acdafa0d5626304ca6baa9851a53 (commit)
       via  21f35c531c68e6ceafa09548e0de6040e1b1ce52 (commit)
       via  14da6cd4ad1e318b53f0d3b745667842a442bf66 (commit)
       via  5f08590dee1f13d4b771880d46f317e49253ccff (commit)
      from  ce2255f2633c9bb14dcd3813e019a84d8acce3a3 (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/prototype.h |   11 +--
 gschem/src/a_zoom.c        |   13 +---
 gschem/src/o_arc.c         |    7 +--
 gschem/src/o_basic.c       |  120 +++++++++++++++++++++++----------
 gschem/src/o_box.c         |   11 +--
 gschem/src/o_bus.c         |   10 +--
 gschem/src/o_circle.c      |   10 +--
 gschem/src/o_complex.c     |  158 +++-----------------------------------------
 gschem/src/o_copy.c        |    3 +-
 gschem/src/o_grips.c       |    5 +-
 gschem/src/o_line.c        |   10 +--
 gschem/src/o_misc.c        |    2 +-
 gschem/src/o_net.c         |   12 +---
 gschem/src/o_picture.c     |   10 +--
 gschem/src/o_pin.c         |   10 +--
 gschem/src/o_text.c        |    2 +-
 gschem/src/x_compselect.c  |    6 +-
 gschem/src/x_dialog.c      |    2 +-
 gschem/src/x_event.c       |   10 ++--
 gschem/src/x_preview.c     |    9 +--
 20 files changed, 133 insertions(+), 288 deletions(-)


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

commit f71ae05abf00acdafa0d5626304ca6baa9851a53
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Tue Nov 6 23:11:41 2007 +0000

    Free gdk events obtained with gtk_event_get().
    
    gtk_event_put() copies an event given to it, so if we retrieve an event
    and re-push it into the event queue, we still need to free our copy.

:100644 100644 6ee6b64... 81d25de... M	gschem/src/a_zoom.c

commit 21f35c531c68e6ceafa09548e0de6040e1b1ce52
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Tue Nov 6 23:11:39 2007 +0000

    Refactor XOR drawing functions to avoid code duplication.

:100644 100644 7076350... 785cdf1... M	gschem/include/prototype.h
:100644 100644 54306c1... 88ee0a7... M	gschem/src/o_basic.c
:100644 100644 b8b08cd... 03edc9e... M	gschem/src/o_complex.c
:100644 100644 fe35882... fb000b6... M	gschem/src/o_copy.c
:100644 100644 4512867... 4f6a614... M	gschem/src/o_text.c
:100644 100644 3db1db0... 00fe0d7... M	gschem/src/x_compselect.c

commit 14da6cd4ad1e318b53f0d3b745667842a442bf66
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Tue Nov 6 23:09:38 2007 +0000

    Remove full screen redraw calls the rubberbanding and ..._end() functions.
    
    These calls aren't hit, as they were conditional on the inside_action flag
    being 0, which should not be the case when these functions are called.
    
    Temporarily add g_assert() statments to verify inside_action != 0 to prove
    these changes are appropriate. Assertions should be removed after testing.

:100644 100644 e54189f... 6ee6b64... M	gschem/src/a_zoom.c
:100644 100644 8d93658... 9d03941... M	gschem/src/o_arc.c
:100644 100644 d756534... ada62e1... M	gschem/src/o_box.c
:100644 100644 72e7a46... e4203ef... M	gschem/src/o_bus.c
:100644 100644 07cdc26... f094899... M	gschem/src/o_circle.c
:100644 100644 4926a26... 0e4e01c... M	gschem/src/o_grips.c
:100644 100644 3cda8e9... daf09ca... M	gschem/src/o_line.c
:100644 100644 220675c... a213222... M	gschem/src/o_net.c
:100644 100644 ccb8d2f... 1f70671... M	gschem/src/o_picture.c
:100644 100644 851d986... 44267bf... M	gschem/src/o_pin.c

commit 5f08590dee1f13d4b771880d46f317e49253ccff
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Fri Nov 2 18:27:56 2007 +0000

    Remove the o_redraw_all_fast() function, as its not any faster now.
    
    Historically, o_redraw_all_fast() may have been used for faster drawing
    in some cases, however the o_redraw_all() call is now equivelant, with
    the addition of redrawing any "place" trails should gschem be mid-action.

:100644 100644 c9d6d61... 7076350... M	gschem/include/prototype.h
:100644 100644 14b8fac... 54306c1... M	gschem/src/o_basic.c
:100644 100644 1d774d6... 54052ce... M	gschem/src/o_misc.c
:100644 100644 cee6206... 6cc236b... M	gschem/src/x_dialog.c
:100644 100644 2a9d071... 4cf1b39... M	gschem/src/x_event.c
:100644 100644 c6f7663... 086dd48... M	gschem/src/x_preview.c

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

commit f71ae05abf00acdafa0d5626304ca6baa9851a53
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Tue Nov 6 23:11:41 2007 +0000

    Free gdk events obtained with gtk_event_get().
    
    gtk_event_put() copies an event given to it, so if we retrieve an event
    and re-push it into the event queue, we still need to free our copy.

diff --git a/gschem/src/a_zoom.c b/gschem/src/a_zoom.c
index 6ee6b64..81d25de 100644
--- a/gschem/src/a_zoom.c
+++ b/gschem/src/a_zoom.c
@@ -147,6 +147,7 @@ void a_zoom(GSCHEM_TOPLEVEL *w_current, int dir, int selected_from, int pan_flag
   while( topEvent != NULL ) {
     if( topEvent->type != GDK_SCROLL ) {
       gdk_event_put( topEvent );
+      gdk_event_free( topEvent );
       break;
     }
     gdk_event_free( topEvent );

commit 21f35c531c68e6ceafa09548e0de6040e1b1ce52
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Tue Nov 6 23:11:39 2007 +0000

    Refactor XOR drawing functions to avoid code duplication.

diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index 7076350..785cdf1 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -480,6 +480,9 @@ void o_erase_list(GSCHEM_TOPLEVEL *w_current, GList *list);
 void o_drawbounding(GSCHEM_TOPLEVEL *w_current, GList *o_glist, GdkColor *color, int firsttime);
 int o_erase_rubber(GSCHEM_TOPLEVEL *w_current);
 int o_redraw_cleanstates(GSCHEM_TOPLEVEL *w_current);
+void o_draw_xor(GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *object);
+void o_list_draw_xor(GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *list);
+void o_glist_draw_xor(GSCHEM_TOPLEVEL *w_current, int dx, int dy, GList *list);
 /* o_box.c */
 void o_box_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current);
 void o_box_draw_solid(GdkDrawable *w, GdkGC *gc, GdkColor *color, GdkCapStyle cap, gint filled, gint x, gint y, gint width, gint height, gint line_width, gint length, gint space);
@@ -542,13 +545,6 @@ void o_complex_place_changed_run_hook(GSCHEM_TOPLEVEL *w_current);
 void o_complex_place_rotate(GSCHEM_TOPLEVEL *w_current);
 void o_complex_end(GSCHEM_TOPLEVEL *w_current, int screen_x, int screen_y);
 void o_complex_rubbercomplex(GSCHEM_TOPLEVEL *w_current);
-void o_complex_translate_display_single_object(GSCHEM_TOPLEVEL *w_current,
-					       int x1, int y1, 
-					       OBJECT *o_current);
-void o_complex_translate_display_object_glist(GSCHEM_TOPLEVEL *w_current,
-					      int x1, int y1, 
-					      GList *object_list);
-void o_complex_translate_display(GSCHEM_TOPLEVEL *w_current, int x1, int y1, OBJECT *complex);
 void o_complex_translate_all(GSCHEM_TOPLEVEL *w_current, int offset);
 void o_complex_rotate_world(TOPLEVEL *toplevel, int centerx, int centery, int angle, OBJECT *object);
 int o_complex_mirror_world(TOPLEVEL *toplevel, int centerx, int centery, OBJECT *object);
diff --git a/gschem/src/o_basic.c b/gschem/src/o_basic.c
index 54306c1..88ee0a7 100644
--- a/gschem/src/o_basic.c
+++ b/gschem/src/o_basic.c
@@ -307,7 +307,7 @@ void o_drawbounding(GSCHEM_TOPLEVEL *w_current, GList *o_glist,
 
     gdk_gc_set_foreground(w_current->bounding_xor_gc,
                           x_get_color(toplevel->background_color));
-    o_complex_translate_display_object_glist(w_current, diff_x, diff_y, o_glist);
+    o_glist_draw_xor(w_current, diff_x, diff_y, o_glist);
 
     gdk_gc_set_foreground(w_current->bounding_xor_gc, color);
 
@@ -344,8 +344,7 @@ void o_drawbounding(GSCHEM_TOPLEVEL *w_current, GList *o_glist,
                        rleft + diff_x, rtop + diff_y,
                        rright - rleft, rbottom - rtop);
 
-    o_complex_translate_display_object_glist(w_current,
-                                             diff_x, diff_y, o_glist);
+    o_glist_draw_xor(w_current, diff_x, diff_y, o_glist);
 
   }
 
@@ -364,8 +363,7 @@ void o_drawbounding(GSCHEM_TOPLEVEL *w_current, GList *o_glist,
     w_current->drawbounding_action_mode = CONSTRAINED;
 
     if (w_current->actionfeedback_mode == OUTLINE) {
-      o_complex_translate_display_object_glist(w_current,
-                                               diff_x, diff_y, o_glist);
+      o_glist_draw_xor(w_current, diff_x, diff_y, o_glist);
 
     } else {
       world_get_object_glist_bounds(toplevel, o_glist,
@@ -394,8 +392,7 @@ void o_drawbounding(GSCHEM_TOPLEVEL *w_current, GList *o_glist,
     diff_y = w_current->last_y - w_current->start_y;
 
     if (w_current->actionfeedback_mode == OUTLINE) {
-      o_complex_translate_display_object_glist(w_current,
-                                               diff_x, diff_y, o_glist);
+      o_glist_draw_xor(w_current, diff_x, diff_y, o_glist);
 
     } else {
       world_get_object_glist_bounds(toplevel, o_glist,
@@ -426,10 +423,8 @@ void o_drawbounding(GSCHEM_TOPLEVEL *w_current, GList *o_glist,
         w_current->drawbounding_action_mode = FREE;
         if (w_current->actionfeedback_mode == OUTLINE) {
           /* do it twice to get rid of old outline */
-          o_complex_translate_display_object_glist(w_current,
-                                                   diff_x, diff_y, o_glist);
-          o_complex_translate_display_object_glist(w_current,
-                                                   diff_x, diff_y, o_glist);
+          o_glist_draw_xor(w_current, diff_x, diff_y, o_glist);
+          o_glist_draw_xor(w_current, diff_x, diff_y, o_glist);
 
         } else {
           /*! \todo why are we doing this here...?
@@ -481,8 +476,7 @@ void o_drawbounding(GSCHEM_TOPLEVEL *w_current, GList *o_glist,
   /*! \todo have I mentioned how temp this is? Make this general
    * so that all lists can be moved ...
    */
-  o_complex_translate_display_object_glist(w_current,
-                                           diff_x, diff_y, o_glist);
+  o_glist_draw_xor(w_current, diff_x, diff_y, o_glist);
 }
 
 
@@ -550,6 +544,7 @@ int o_erase_rubber(GSCHEM_TOPLEVEL *w_current)
    return(TRUE);
 }
 
+
 /*! \todo Finish function documentation!!!
  *  \brief
  *  \par Function Description
@@ -651,3 +646,67 @@ int o_redraw_cleanstates(GSCHEM_TOPLEVEL *w_current)
 
   return FALSE;
 }
+
+
+/*! \todo Finish function documentation!!!
+ *  \brief
+ *  \par Function Description
+ *
+ */
+void o_draw_xor(GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *object)
+{
+  void (*func) (GSCHEM_TOPLEVEL *, int, int, OBJECT*) = NULL;
+
+  switch (object->type) {
+      case OBJ_HEAD:    /* Do nothing for head nodes */   break;
+      case OBJ_LINE:    func = o_line_draw_xor;           break;
+      case OBJ_NET:     func = o_net_draw_xor;            break;
+      case OBJ_BUS:     func = o_bus_draw_xor;            break;
+      case OBJ_BOX:     func = o_box_draw_xor;            break;
+      case OBJ_PICTURE: func = o_picture_draw_xor;        break;
+      case OBJ_CIRCLE:  func = o_circle_draw_xor;         break;
+      case OBJ_PLACEHOLDER:
+      case OBJ_COMPLEX: func = o_complex_draw_xor;        break;
+      case OBJ_TEXT:    func = o_text_draw_xor;           break;
+      case OBJ_PIN:     func = o_pin_draw_xor;            break;
+      case OBJ_ARC:     func = o_arc_draw_xor;            break;
+      default:
+        g_assert_not_reached ();
+  }
+
+  if (func != NULL) {
+    (*func) (w_current, dx, dy, object);
+  }
+}
+
+
+/*! \todo Finish function documentation!!!
+ *  \brief
+ *  \par Function Description
+ *
+ */
+void o_list_draw_xor(GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *list)
+{
+  OBJECT *o_current = list;
+
+  while(o_current != NULL) {
+    o_draw_xor(w_current, dx, dy, o_current);
+    o_current = o_current->next;
+  }
+}
+
+
+/*! \todo Finish function documentation!!!
+ *  \brief
+ *  \par Function Description
+ *
+ */
+void o_glist_draw_xor(GSCHEM_TOPLEVEL *w_current, int dx, int dy, GList *list)
+{
+  GList *iter = list;
+
+  while (iter != NULL) {
+    o_draw_xor(w_current, dx, dy, (OBJECT *)iter->data);
+    iter = g_list_next(iter);
+  }
+}
diff --git a/gschem/src/o_complex.c b/gschem/src/o_complex.c
index b8b08cd..03edc9e 100644
--- a/gschem/src/o_complex.c
+++ b/gschem/src/o_complex.c
@@ -69,56 +69,12 @@ void o_complex_erase(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
  *  \par Function Description
  *
  */
-void o_complex_draw_xor(GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *complex)
+void o_complex_draw_xor(GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *object)
 {
-  OBJECT *o_current = complex;
+  g_assert( (object->type == OBJ_COMPLEX ||
+             object->type == OBJ_PLACEHOLDER) );
 
-  while(o_current != NULL) {
-    switch(o_current->type) {
-      case(OBJ_LINE):
-        o_line_draw_xor(w_current, dx, dy, o_current);
-        break;
-
-      case(OBJ_NET):
-        o_net_draw_xor(w_current, dx, dy, o_current);
-        break;
-
-      case(OBJ_BUS):
-        o_bus_draw_xor(w_current, dx, dy, o_current);
-        break;
-
-      case(OBJ_BOX):
-        o_box_draw_xor(w_current, dx, dy, o_current);
-        break;
-
-      case(OBJ_PICTURE):
-        o_picture_draw_xor(w_current, dx, dy, o_current);
-        break;
-
-      case(OBJ_CIRCLE):
-        o_circle_draw_xor(w_current, dx, dy, o_current);
-        break;
-
-      case(OBJ_COMPLEX):
-      case(OBJ_PLACEHOLDER):
-        o_complex_draw_xor(w_current, dx, dy,
-                           o_current->complex->prim_objs);
-        break;
-
-      case(OBJ_TEXT):
-        o_text_draw_xor(w_current, dx, dy, o_current);
-        break;
-
-      case(OBJ_PIN):
-        o_pin_draw_xor(w_current, dx, dy, o_current);
-        break;
-
-      case(OBJ_ARC):
-        o_arc_draw_xor(w_current, dx, dy, o_current);
-        break;
-    }
-    o_current = o_current->next;
-  }
+  o_list_draw_xor( w_current, dx, dy, object->complex->prim_objs);
 }
 
 /*! \todo Finish function documentation!!!
@@ -317,10 +273,8 @@ void o_complex_end(GSCHEM_TOPLEVEL *w_current, int screen_x, int screen_y)
     if (w_current->actionfeedback_mode == OUTLINE) {
       /* erase outline */
       
-      o_complex_translate_display_object_glist(w_current,
-					       diff_x, diff_y,
-					       toplevel->page_current->
-					       complex_place_list); 
+      o_glist_draw_xor(w_current, diff_x, diff_y,
+                       toplevel->page_current->complex_place_list);
     } else {
       world_get_object_glist_bounds(toplevel,
 			      toplevel->page_current->
@@ -333,7 +287,7 @@ void o_complex_end(GSCHEM_TOPLEVEL *w_current, int screen_x, int screen_y)
       gdk_gc_set_foreground(
                             w_current->gc,
                             x_get_color(toplevel->background_color));
-      gdk_draw_rectangle(w_current->window, w_current->gc,
+      gdk_draw_rectangle(w_current->backingstore, w_current->gc,
                          FALSE,
                          rleft   + diff_x,
                          rtop    + diff_y,
@@ -400,9 +354,8 @@ void o_complex_end(GSCHEM_TOPLEVEL *w_current, int screen_x, int screen_y)
   /* check for nulls in all this hack */
   if (w_current->actionfeedback_mode == OUTLINE) {
     /* erase outline */
-    o_complex_translate_display_object_glist(w_current,
-					     diff_x, diff_y,
-					     toplevel->page_current->complex_place_list);
+    o_glist_draw_xor(w_current, diff_x, diff_y,
+                     toplevel->page_current->complex_place_list);
   } else {
     world_get_object_glist_bounds(toplevel,
                                   toplevel->page_current->complex_place_list,
@@ -415,7 +368,7 @@ void o_complex_end(GSCHEM_TOPLEVEL *w_current, int screen_x, int screen_y)
     gdk_gc_set_foreground(
                           w_current->gc,
                           x_get_color(toplevel->background_color));
-    gdk_draw_rectangle(w_current->window, w_current->gc, FALSE,
+    gdk_draw_rectangle(w_current->backingstore, w_current->gc, FALSE,
                        rleft   + diff_x,
                        rtop    + diff_y,
                        rright  - rleft,
@@ -463,97 +416,6 @@ void o_complex_rubbercomplex(GSCHEM_TOPLEVEL *w_current)
                  x_get_darkcolor(w_current->bb_color), FALSE);
 }
 
-/*! \todo Finish function documentation!!!
- *  \brief
- *  \par Function Description
- *
- */
-void
-o_complex_translate_display_single_object(GSCHEM_TOPLEVEL *w_current,
-					  int x1, int y1, OBJECT *o_current)
-{
-  if (o_current != NULL) {
-    switch(o_current->type) {
-      case(OBJ_LINE):
-        o_line_draw_xor(w_current, x1, y1, o_current);
-        break;
-
-      case(OBJ_NET):
-        o_net_draw_xor(w_current, x1, y1, o_current);
-        break;
-
-      case(OBJ_BUS):
-        o_bus_draw_xor(w_current, x1, y1, o_current);
-        break;
-
-      case(OBJ_BOX):
-        o_box_draw_xor(w_current, x1, y1, o_current);
-        break;
-
-      case(OBJ_PICTURE):
-        o_picture_draw_xor(w_current, x1, y1, o_current);
-        break;
-
-      case(OBJ_CIRCLE):
-        o_circle_draw_xor(w_current, x1, y1, o_current);
-        break;
-
-      case(OBJ_COMPLEX):
-      case(OBJ_PLACEHOLDER):
-        o_complex_draw_xor(w_current, x1, y1, 
-                           o_current->complex->prim_objs);
-        break;
-
-      case(OBJ_TEXT):
-        o_text_draw_xor(w_current, x1, y1, o_current);
-        break;
-
-      case(OBJ_PIN):
-        o_pin_draw_xor(w_current, x1, y1, o_current);
-        break;
-
-      case(OBJ_ARC):
-        o_arc_draw_xor(w_current, x1, y1, o_current);
-        break;
-    }
-  }
-}
-
-/*! \todo Finish function documentation!!!
- *  \brief
- *  \par Function Description
- *
- */
-void
-o_complex_translate_display_object_glist(GSCHEM_TOPLEVEL *w_current,
-			                 int x1, int y1, GList *object_list)
-{
-  GList *ptr = object_list;
-
-  while (ptr != NULL) {
-    o_complex_translate_display_single_object (w_current, x1, y1, 
-                                               (OBJECT *)ptr->data);
-    ptr = g_list_next(ptr);
-  }
-}
-
-
-/*! \todo Finish function documentation!!!
- *  \brief
- *  \par Function Description
- *
- */
-void
-o_complex_translate_display(GSCHEM_TOPLEVEL *w_current,
-			    int x1, int y1, OBJECT *complex)
-{
-  OBJECT *o_current = complex;
-
-  while (o_current != NULL) {
-    o_complex_translate_display_single_object (w_current, x1, y1, o_current);
-    o_current = o_current->next;
-  }
-}
 
 /*! \todo Finish function documentation!!!
  *  \brief
diff --git a/gschem/src/o_copy.c b/gschem/src/o_copy.c
index fe35882..fb000b6 100644
--- a/gschem/src/o_copy.c
+++ b/gschem/src/o_copy.c
@@ -236,8 +236,7 @@ void o_copy_end(GSCHEM_TOPLEVEL *w_current)
         complex_object = new_object;
 
         if (w_current->actionfeedback_mode == OUTLINE) {
-          o_complex_draw_xor(w_current, screen_diff_x, screen_diff_y,
-                             object->complex->prim_objs);
+          o_complex_draw_xor(w_current, screen_diff_x, screen_diff_y, object);
         }
 
         o_complex_translate_world(toplevel, diff_x, diff_y, new_object);
diff --git a/gschem/src/o_text.c b/gschem/src/o_text.c
index 4512867..4f6a614 100644
--- a/gschem/src/o_text.c
+++ b/gschem/src/o_text.c
@@ -288,7 +288,7 @@ void o_text_draw_xor(GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_curre
   if ((factor < w_current->text_display_zoomfactor) ||
       o_current->text->size >= 12 ||
       w_current->text_feedback == ALWAYS) {
-    o_complex_draw_xor(w_current, dx, dy, o_current->text->prim_objs);
+    o_list_draw_xor(w_current, dx, dy, o_current->text->prim_objs);
   } else {
     /* text is too small so go through and draw a line in
        it's place */
diff --git a/gschem/src/x_compselect.c b/gschem/src/x_compselect.c
index 3db1db0..00fe0d7 100644
--- a/gschem/src/x_compselect.c
+++ b/gschem/src/x_compselect.c
@@ -114,10 +114,8 @@ x_compselect_callback_response (GtkDialog *dialog,
         diff_x = w_current->last_x - w_current->start_x;
         diff_y = w_current->last_y - w_current->start_y;
 
-        o_complex_translate_display_object_glist(w_current,
-                                                 diff_x, diff_y,
-                                                 toplevel->page_current->
-                                                   complex_place_list);
+        o_glist_draw_xor(w_current, diff_x, diff_y,
+                         toplevel->page_current->complex_place_list);
 
         /* Free the complex place list and its contents */
         s_delete_object_glist(toplevel,

commit 14da6cd4ad1e318b53f0d3b745667842a442bf66
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Tue Nov 6 23:09:38 2007 +0000

    Remove full screen redraw calls the rubberbanding and ..._end() functions.
    
    These calls aren't hit, as they were conditional on the inside_action flag
    being 0, which should not be the case when these functions are called.
    
    Temporarily add g_assert() statments to verify inside_action != 0 to prove
    these changes are appropriate. Assertions should be removed after testing.

diff --git a/gschem/src/a_zoom.c b/gschem/src/a_zoom.c
index e54189f..6ee6b64 100644
--- a/gschem/src/a_zoom.c
+++ b/gschem/src/a_zoom.c
@@ -300,14 +300,10 @@ void a_zoom_box_start(GSCHEM_TOPLEVEL *w_current, int x, int y)
  */
 void a_zoom_box_end(GSCHEM_TOPLEVEL *w_current, int x, int y)
 {
-  TOPLEVEL *toplevel = w_current->toplevel;
   int box_width, box_height;
   int box_left, box_top;
 
-  if (w_current->inside_action == 0) {
-    o_redraw(w_current, toplevel->page_current->object_head, TRUE);
-    return;
-  }
+  g_assert( w_current->inside_action != 0 );
 
   box_width  = GET_BOX_WIDTH (w_current);
   box_height = GET_BOX_HEIGHT(w_current);
@@ -332,14 +328,10 @@ void a_zoom_box_end(GSCHEM_TOPLEVEL *w_current, int x, int y)
  */
 void a_zoom_box_rubberband(GSCHEM_TOPLEVEL *w_current, int x, int y)
 {
-  TOPLEVEL *toplevel = w_current->toplevel;
   int box_width, box_height;
   int box_left, box_top;
 
-  if (w_current->inside_action == 0) {
-    o_redraw(w_current, toplevel->page_current->object_head, TRUE);
-    return;
-  }
+  g_assert( w_current->inside_action != 0 );
 
   box_width  = GET_BOX_WIDTH (w_current);
   box_height = GET_BOX_HEIGHT(w_current);
diff --git a/gschem/src/o_arc.c b/gschem/src/o_arc.c
index 8d93658..9d03941 100644
--- a/gschem/src/o_arc.c
+++ b/gschem/src/o_arc.c
@@ -951,11 +951,8 @@ void o_arc_end1(GSCHEM_TOPLEVEL *w_current, int x, int y)
 {
   TOPLEVEL *toplevel = w_current->toplevel;
   int diff_x, diff_y;
-	
-  if (w_current->inside_action == 0) {
-    o_redraw(w_current, toplevel->page_current->object_head, TRUE);
-    return;
-  }
+
+  g_assert( w_current->inside_action != 0 );
 
   /* erases the previous temporary radius segment */
   o_arc_rubberarc_xor(w_current);
diff --git a/gschem/src/o_box.c b/gschem/src/o_box.c
index d756534..ada62e1 100644
--- a/gschem/src/o_box.c
+++ b/gschem/src/o_box.c
@@ -946,10 +946,7 @@ void o_box_end(GSCHEM_TOPLEVEL *w_current, int x, int y)
   int box_width, box_height;
   int box_left, box_top;
 
-  if (w_current->inside_action == 0) {
-    o_redraw(w_current, toplevel->page_current->object_head, TRUE);
-    return;
-  }
+  g_assert( w_current->inside_action != 0 );
 
   /* get the last coords of the pointer */
   w_current->last_x = fix_x(toplevel, x);
@@ -1023,10 +1020,8 @@ void o_box_end(GSCHEM_TOPLEVEL *w_current, int x, int y)
 void o_box_rubberbox(GSCHEM_TOPLEVEL *w_current, int x, int y)
 {
   TOPLEVEL *toplevel = w_current->toplevel;
-  if (w_current->inside_action == 0) {
-    o_redraw(w_current, toplevel->page_current->object_head, TRUE);
-    return;
-  }
+
+  g_assert( w_current->inside_action != 0 );
 
   /* erase the previous temporary box */
   o_box_rubberbox_xor(w_current);
diff --git a/gschem/src/o_bus.c b/gschem/src/o_bus.c
index 72e7a46..e4203ef 100644
--- a/gschem/src/o_bus.c
+++ b/gschem/src/o_bus.c
@@ -272,10 +272,7 @@ int o_bus_end(GSCHEM_TOPLEVEL *w_current, int x, int y)
   int size;
   GList *other_objects = NULL;
 
-  if (w_current->inside_action == 0) {
-    o_redraw(w_current, toplevel->page_current->object_head, TRUE);
-    return(FALSE);
-  }
+  g_assert( w_current->inside_action != 0 );
 
   if (toplevel->override_bus_color == -1) {
     color = w_current->bus_color;
@@ -379,10 +376,7 @@ void o_bus_rubberbus(GSCHEM_TOPLEVEL *w_current, int x, int y)
   int diff_x, diff_y;
   int size;
 
-  if (w_current->inside_action == 0) {
-    o_redraw(w_current, toplevel->page_current->object_head, TRUE);
-    return;
-  }
+  g_assert( w_current->inside_action != 0 );
 
   if (toplevel->bus_style == THICK ) {
     size = SCREENabs(toplevel, BUS_WIDTH);
diff --git a/gschem/src/o_circle.c b/gschem/src/o_circle.c
index 07cdc26..f094899 100644
--- a/gschem/src/o_circle.c
+++ b/gschem/src/o_circle.c
@@ -650,10 +650,7 @@ void o_circle_end(GSCHEM_TOPLEVEL *w_current, int x, int y)
   int fx, fy;
   int radius;
 
-  if (w_current->inside_action == 0) {
-    o_redraw(w_current, toplevel->page_current->object_head, TRUE);
-    return;
-  }
+  g_assert( w_current->inside_action != 0 );
 
   /* erase the temporary circle */
   o_circle_rubbercircle_xor(w_current);
@@ -734,10 +731,7 @@ void o_circle_rubbercircle(GSCHEM_TOPLEVEL *w_current, int x, int y)
   TOPLEVEL *toplevel = w_current->toplevel;
   int diff_x, diff_y;
 
-  if (w_current->inside_action == 0) {
-    o_redraw(w_current, toplevel->page_current->object_head, TRUE);
-    return;
-  }
+  g_assert( w_current->inside_action != 0 );
 
   /* erase the previous temporary circle */
   o_circle_rubbercircle_xor(w_current);
diff --git a/gschem/src/o_grips.c b/gschem/src/o_grips.c
index 4926a26..0e4e01c 100644
--- a/gschem/src/o_grips.c
+++ b/gschem/src/o_grips.c
@@ -881,10 +881,7 @@ void o_grips_motion(GSCHEM_TOPLEVEL *w_current, int x, int y)
 {
   TOPLEVEL *toplevel = w_current->toplevel;
 
-  if (w_current->inside_action == 0) {
-    o_redraw(w_current, toplevel->page_current->object_head, TRUE);
-    return;
-  }
+  g_assert( w_current->inside_action != 0 );
 
   /* no object changing */
   if (object_changing == NULL) {
diff --git a/gschem/src/o_line.c b/gschem/src/o_line.c
index 3cda8e9..daf09ca 100644
--- a/gschem/src/o_line.c
+++ b/gschem/src/o_line.c
@@ -847,10 +847,7 @@ void o_line_end(GSCHEM_TOPLEVEL *w_current, int x, int y)
   int x1, y1;
   int x2, y2;
 
-  if (w_current->inside_action == 0) {
-    o_redraw(w_current, toplevel->page_current->object_head, TRUE);
-    return;
-  }
+  g_assert( w_current->inside_action != 0 );
 
   /* Use last_x and _y from the last time you moved the mouse from the
      rubber function, so in otherwords... comment these out...
@@ -921,10 +918,7 @@ void o_line_rubberline(GSCHEM_TOPLEVEL *w_current, int x, int y)
   TOPLEVEL *toplevel = w_current->toplevel;
   int diff_x, diff_y;
 
-  if (w_current->inside_action == 0) {
-    o_redraw(w_current, toplevel->page_current->object_head, TRUE);
-    return;
-  }
+  g_assert( w_current->inside_action != 0 );
 
   /*
    * The current temporary line is described by the two points
diff --git a/gschem/src/o_net.c b/gschem/src/o_net.c
index 220675c..a213222 100644
--- a/gschem/src/o_net.c
+++ b/gschem/src/o_net.c
@@ -329,11 +329,8 @@ int o_net_end(GSCHEM_TOPLEVEL *w_current, int x, int y)
   /* OBJECT *o_current;*/
   GList *other_objects = NULL;
   OBJECT *new_net = NULL;
-  
-  if (w_current->inside_action == 0) {
-    o_redraw(w_current, toplevel->page_current->object_head, TRUE);
-    return(FALSE);
-  }
+
+  g_assert( w_current->inside_action != 0 );
 
   if (toplevel->override_net_color == -1) {
     color = w_current->net_color;
@@ -551,10 +548,7 @@ void o_net_rubbernet(GSCHEM_TOPLEVEL *w_current, int x, int y)
   int size;
   int ortho;
 
-  if (w_current->inside_action == 0) {
-    o_redraw(w_current, toplevel->page_current->object_head, TRUE);
-    return;
-  }
+  g_assert( w_current->inside_action != 0 );
 
   if (toplevel->net_style == THICK) {
     size = SCREENabs(toplevel, NET_WIDTH);
diff --git a/gschem/src/o_picture.c b/gschem/src/o_picture.c
index ccb8d2f..1f70671 100644
--- a/gschem/src/o_picture.c
+++ b/gschem/src/o_picture.c
@@ -97,10 +97,7 @@ void o_picture_end(GSCHEM_TOPLEVEL *w_current, int x, int y)
   int picture_width, picture_height;
   int picture_left, picture_top;
 
-  if (w_current->inside_action == 0) {
-    o_redraw(w_current, toplevel->page_current->object_head, TRUE);
-    return;
-  }
+  g_assert( w_current->inside_action != 0 );
 
   /* get the last coords of the pointer */
   w_current->last_x = fix_x(toplevel, x);
@@ -275,10 +272,7 @@ void o_picture_rubberbox(GSCHEM_TOPLEVEL *w_current, int x, int y)
 #if DEBUG
   printf("o_picture_rubberbox called\n");
 #endif
-  if (w_current->inside_action == 0) {
-    o_redraw(w_current, toplevel->page_current->object_head, TRUE);
-    return;
-  }
+  g_assert( w_current->inside_action != 0 );
 
   /* erase the previous temporary box */
   o_picture_rubberbox_xor(w_current);
diff --git a/gschem/src/o_pin.c b/gschem/src/o_pin.c
index 851d986..44267bf 100644
--- a/gschem/src/o_pin.c
+++ b/gschem/src/o_pin.c
@@ -220,10 +220,7 @@ void o_pin_end(GSCHEM_TOPLEVEL *w_current, int x, int y)
   GList *other_objects = NULL;
   OBJECT *o_current, *o_current_pin;
 
-  if (w_current->inside_action == 0) {
-    o_redraw(w_current, toplevel->page_current->object_head, TRUE);
-    return;
-  }
+  g_assert( w_current->inside_action != 0 );
 
   if (toplevel->override_pin_color == -1) {
     color = w_current->pin_color;
@@ -295,10 +292,7 @@ void o_pin_rubberpin(GSCHEM_TOPLEVEL *w_current, int x, int y)
   int size;
   int diff_x, diff_y;
 
-  if (w_current->inside_action == 0) {
-    o_redraw(w_current, toplevel->page_current->object_head, TRUE);
-    return;
-  }
+  g_assert( w_current->inside_action != 0 );
 
   size = SCREENabs(toplevel, PIN_WIDTH);
 

commit 5f08590dee1f13d4b771880d46f317e49253ccff
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Fri Nov 2 18:27:56 2007 +0000

    Remove the o_redraw_all_fast() function, as its not any faster now.
    
    Historically, o_redraw_all_fast() may have been used for faster drawing
    in some cases, however the o_redraw_all() call is now equivelant, with
    the addition of redrawing any "place" trails should gschem be mid-action.

diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index c9d6d61..7076350 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -470,7 +470,6 @@ void o_attrib_toggle_show_name_value(GSCHEM_TOPLEVEL *w_current, GList *list, in
 OBJECT *o_attrib_add_attrib(GSCHEM_TOPLEVEL *w_current, char *text_string, int visibility, int show_name_value, OBJECT *object);
 /* o_basic.c */
 void o_redraw_all(GSCHEM_TOPLEVEL *w_current);
-void o_redraw_all_fast(GSCHEM_TOPLEVEL *w_current);
 void o_redraw(GSCHEM_TOPLEVEL *w_current, OBJECT *object_list, gboolean draw_selected);
 void o_redraw_single(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current);
 void o_draw_list(GSCHEM_TOPLEVEL *w_current, GList *list);
diff --git a/gschem/src/o_basic.c b/gschem/src/o_basic.c
index 14b8fac..54306c1 100644
--- a/gschem/src/o_basic.c
+++ b/gschem/src/o_basic.c
@@ -48,7 +48,18 @@
 void o_redraw_all(GSCHEM_TOPLEVEL *w_current)
 {
   TOPLEVEL *toplevel = w_current->toplevel;
-  o_redraw_all_fast(w_current);
+  gboolean draw_selected = TRUE;
+
+  if (!toplevel->DONT_REDRAW) {
+    x_repaint_background(w_current);
+  }
+
+  draw_selected = !(w_current->inside_action &&
+                    ((w_current->event_state == MOVE) ||
+                     (w_current->event_state == ENDMOVE)));
+  o_redraw(w_current, toplevel->page_current->object_head, draw_selected);
+  o_cue_redraw_all(w_current,
+                   toplevel->page_current->object_head, draw_selected);
 
   if (w_current->inside_action) {
     switch(w_current->event_state) {
@@ -82,28 +93,6 @@ void o_redraw_all(GSCHEM_TOPLEVEL *w_current)
   }
 }
 
-/*! \todo Finish function documentation!!!
- *  \brief
- *  \par Function Description
- *
- */
-/* basically like above but doesn't do the o_conn_disconnect_update */
-void o_redraw_all_fast(GSCHEM_TOPLEVEL *w_current)
-{
-  TOPLEVEL *toplevel = w_current->toplevel;
-  gboolean draw_selected = TRUE;
-
-  if (!toplevel->DONT_REDRAW) {
-    x_repaint_background(w_current);
-  }
-
-  draw_selected = !(w_current->inside_action &&
-		    ((w_current->event_state == MOVE) ||
-		     (w_current->event_state == ENDMOVE)));
-  o_redraw(w_current, toplevel->page_current->object_head, draw_selected);
-  o_cue_redraw_all(w_current,
-		   toplevel->page_current->object_head, draw_selected);
-}
 
 /*! \todo Finish function documentation!!!
  *  \brief
diff --git a/gschem/src/o_misc.c b/gschem/src/o_misc.c
index 1d774d6..54052ce 100644
--- a/gschem/src/o_misc.c
+++ b/gschem/src/o_misc.c
@@ -800,7 +800,7 @@ void o_edit_show_hidden(GSCHEM_TOPLEVEL *w_current, OBJECT *o_list)
   i_show_state(w_current, NULL); /* update screen status */
 
   o_edit_show_hidden_lowlevel(w_current, o_list);
-  o_redraw_all_fast(w_current);
+  o_redraw_all(w_current);
 
   if (w_current->toplevel->show_hidden_text) {
     s_log_message(_("Hidden text is now visible\n"));
diff --git a/gschem/src/x_dialog.c b/gschem/src/x_dialog.c
index cee6206..6cc236b 100644
--- a/gschem/src/x_dialog.c
+++ b/gschem/src/x_dialog.c
@@ -2859,7 +2859,7 @@ void find_text_dialog_response(GtkWidget *w, gint response,
 						    (checkdescend)),
 		       !start_find);
     if (done) {
-      o_redraw_all_fast(w_current);
+      o_redraw_all(w_current);
       close = 1;
     }
     start_find = 0;
diff --git a/gschem/src/x_event.c b/gschem/src/x_event.c
index 2a9d071..4cf1b39 100644
--- a/gschem/src/x_event.c
+++ b/gschem/src/x_event.c
@@ -895,7 +895,7 @@ gint x_event_button_released(GtkWidget *widget, GdkEventButton *event,
       
       case(MID_MOUSEPAN_ENABLED):
       w_current->doing_pan=FALSE;
-      o_redraw_all_fast(w_current);
+      o_redraw_all(w_current);
       if (w_current->undo_panzoom) {
         o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY); 
       }
@@ -911,7 +911,7 @@ gint x_event_button_released(GtkWidget *widget, GdkEventButton *event,
   } else if (event->button == 3) {
     if (w_current->doing_pan) { /* just for ending a mouse pan */
       w_current->doing_pan=FALSE;
-      o_redraw_all_fast(w_current);
+      o_redraw_all(w_current);
 
       if (w_current->undo_panzoom) {
         o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY); 
@@ -1312,7 +1312,7 @@ x_event_configure (GtkWidget         *widget,
 
   if (!toplevel->DONT_REDRAW) {
     /* redraw the current page and update UI */
-    o_redraw_all_fast (w_current);
+    o_redraw_all (w_current);
     x_scrollbars_update (w_current);
   }
 
@@ -1392,7 +1392,7 @@ void x_event_hschanged (GtkAdjustment *adj, GSCHEM_TOPLEVEL *w_current)
     (current_left - new_left);
 
   if (!toplevel->DONT_REDRAW) {
-    o_redraw_all_fast(w_current);
+    o_redraw_all(w_current);
   }
 }
 
@@ -1434,7 +1434,7 @@ void x_event_vschanged (GtkAdjustment *adj, GSCHEM_TOPLEVEL *w_current)
 #endif
 
   if (!toplevel->DONT_REDRAW) {
-    o_redraw_all_fast(w_current);
+    o_redraw_all(w_current);
   }
 }
 
diff --git a/gschem/src/x_preview.c b/gschem/src/x_preview.c
index c6f7663..086dd48 100644
--- a/gschem/src/x_preview.c
+++ b/gschem/src/x_preview.c
@@ -172,7 +172,7 @@ preview_callback_button_press (GtkWidget *widget,
       case 1: /* left mouse button: zoom in */
         a_zoom (preview_w_current, ZOOM_IN, HOTKEY,
                 A_PAN_DONT_REDRAW);
-        o_redraw_all_fast (preview_w_current);
+        o_redraw_all (preview_w_current);
         break;
       case 2: /* middle mouse button: pan */
         a_pan (preview_w_current, mouse_x, mouse_y);
@@ -180,7 +180,7 @@ preview_callback_button_press (GtkWidget *widget,
       case 3: /* right mouse button: zoom out */
         a_zoom (preview_w_current, ZOOM_OUT, HOTKEY,
                 A_PAN_DONT_REDRAW);
-        o_redraw_all_fast (preview_w_current);
+        o_redraw_all (preview_w_current);
         break;
   }
   
@@ -366,10 +366,7 @@ preview_event_configure (GtkWidget         *widget,
   retval = x_event_configure (widget, event, preview_w_current);
   preview_w_current->toplevel->DONT_REDRAW = save_redraw;
   if (preview_page != NULL) {
-    a_zoom_extents(preview_w_current,
-                   preview_page->object_head,
-                   A_PAN_DONT_REDRAW);
-    o_redraw_all_fast(preview_w_current);
+    a_zoom_extents(preview_w_current, preview_page->object_head, 0);
   }
   return retval;
 }




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