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

gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-411-gc914c30)



The branch, master has been updated
       via  c914c30f8bbb72e5d0df635947055e642b972f0b (commit)
      from  87682d35b4238c7db9bbc3583a7db8313bb8577f (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 |    1 -
 gschem/src/o_basic.c       |   97 --------------------------------------------
 gschem/src/o_place.c       |   90 +++++++++++++++++++++++++++++++++++++++--
 3 files changed, 86 insertions(+), 102 deletions(-)


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

commit c914c30f8bbb72e5d0df635947055e642b972f0b
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Dec 20 08:00:36 2008 +0000

    gschem: Move o_drawbounding into its only caller, o_place_rubberplace_xor

:100644 100644 6e1a5a2... bf28467... M	gschem/include/prototype.h
:100644 100644 b8795ce... b78a18f... M	gschem/src/o_basic.c
:100644 100644 73f4f35... 174ff51... M	gschem/src/o_place.c

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

commit c914c30f8bbb72e5d0df635947055e642b972f0b
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Dec 20 08:00:36 2008 +0000

    gschem: Move o_drawbounding into its only caller, o_place_rubberplace_xor

diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index 6e1a5a2..bf28467 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -488,7 +488,6 @@ void o_draw_selected(GSCHEM_TOPLEVEL *w_current);
 void o_erase_selected(GSCHEM_TOPLEVEL *w_current);
 void o_erase_single(GSCHEM_TOPLEVEL *w_current, OBJECT *object);
 void o_erase_list(GSCHEM_TOPLEVEL *w_current, GList *list);
-void o_drawbounding(GSCHEM_TOPLEVEL *w_current, GList *o_glist, GdkColor *color, int drawing);
 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);
diff --git a/gschem/src/o_basic.c b/gschem/src/o_basic.c
index b8795ce..b78a18f 100644
--- a/gschem/src/o_basic.c
+++ b/gschem/src/o_basic.c
@@ -263,103 +263,6 @@ void o_erase_list(GSCHEM_TOPLEVEL *w_current, GList* list)
   }
 }
 
-/*! \brief XOR draw a bounding box or outline for OBJECT placement
- *
- *  \par Function Description
- *  This function XOR draws either the OBJECTS in the passed GList,
- *  or a rectangle around their bounding box, depending upon the
- *  currently selected w_current->actionfeedback_mode. This takes the
- *  value BOUNDINGBOX or OUTLINE.
- *
- * The function applies manhatten mode constraints to the coordinates
- * before drawing if the CONTROL key is recording as being pressed in
- * the w_current structure.
- *
- * The "drawing" parameter is used to indicate if this drawing should
- * immediately use the selected feedback mode and positioning constraints.
- *
- * With drawing=TRUE, the selected conditions are used immediately,
- * otherwise the conditions from the last drawing operation are used,
- * saving the new state for next time.
- *
- * o_drawbounding() should be called with drawing=TRUE when starting a
- * rubberbanding operation and when otherwise refreshing the rubberbanded
- * outline (e.g. after a screen redraw). For any undraw operation, should
- * be called with drawing=FALSE, ensuring that the undraw XOR matches the
- * mode and constraints of the corresponding "draw" operation.
- *
- * If any mode / constraint changes are made between a undraw, redraw XOR
- * pair, the latter (draw) operation must be called with drawing=TRUE. If
- * no mode / constraint changes were made between the pair, it is not
- * harmful to call the draw operation with "drawing=FALSE".
- *
- *  \param [in] w_current   GSCHEM_TOPLEVEL which we're drawing for.
- *  \param [in] o_glst      GList of objects to XOR draw.
- *  \param [in] color       GdkColor used for drawing in BOUNDINGBOX mode.
- *  \param [in] drawing     Set to FALSE for undraw operations to ensure
- *                            matching conditions to a previous draw operation.
- */
-void o_drawbounding(GSCHEM_TOPLEVEL *w_current, GList *o_glist,
-                    GdkColor *color, int drawing)
-{
-  TOPLEVEL *toplevel = w_current->toplevel;
-  int diff_x, diff_y;
-  int left, top, bottom, right;
-  int s_left, s_top, s_bottom, s_right;
-
-  g_return_if_fail (o_glist != NULL);
-
-  /* If drawing is true, then don't worry about the previous drawing
-   * method and movement constraints, use with the current settings */
-  if (drawing) {
-    w_current->last_drawb_mode = w_current->actionfeedback_mode;
-    w_current->drawbounding_action_mode = (w_current->CONTROLKEY)
-                                            ? CONSTRAINED : FREE;
-  }
-
-  /* Calculate delta of X-Y positions from buffer's origin */
-  diff_x = w_current->second_wx - w_current->first_wx;
-  diff_y = w_current->second_wy - w_current->first_wy;
-
-  /* Adjust the coordinates according to the movement constraints */
-  if (w_current->drawbounding_action_mode == CONSTRAINED ) {
-    if (abs(diff_x) >= abs(diff_y)) {
-      w_current->second_wy = w_current->first_wy;
-      diff_y = 0;
-    } else {
-      w_current->second_wx = w_current->first_wx;
-      diff_x = 0;
-    }
-  }
-
-  /* Find the bounds of the drawing to be done */
-  world_get_object_glist_bounds(toplevel, o_glist,
-                                &left, &top, &right, &bottom);
-  WORLDtoSCREEN(toplevel, left + diff_x, top + diff_y, &s_left, &s_top);
-  WORLDtoSCREEN(toplevel, right + diff_x, bottom + diff_y, &s_right, &s_bottom);
-
-  /* XOR draw with the appropriate mode */
-  if (w_current->last_drawb_mode == BOUNDINGBOX) {
-    gdk_gc_set_foreground(w_current->bounding_xor_gc, color);
-    gdk_draw_rectangle (w_current->drawable,
-                        w_current->bounding_xor_gc, FALSE,
-                        s_left, s_bottom,
-                        s_right - s_left, s_top - s_bottom);
-  } else {
-    o_glist_draw_xor (w_current, diff_x, diff_y, o_glist);
-  }
-
-  /* Invalidate the screen buffer where we drew */
-  o_invalidate_rect(w_current, s_left, s_top,
-                               s_right, s_bottom);
-
-  /* Save movement constraints and drawing method for any
-   * corresponding undraw operation. */
-  w_current->last_drawb_mode = w_current->actionfeedback_mode;
-  w_current->drawbounding_action_mode = (w_current->CONTROLKEY)
-                                          ? CONSTRAINED : FREE;
-}
-
 
 /*! \todo Finish function documentation!!!
  *  \brief
diff --git a/gschem/src/o_place.c b/gschem/src/o_place.c
index 73f4f35..174ff51 100644
--- a/gschem/src/o_place.c
+++ b/gschem/src/o_place.c
@@ -138,15 +138,97 @@ void o_place_motion (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
 }
 
 
-/*! \todo Finish function documentation!!!
- *  \brief
+/*! \brief XOR draw a bounding box or outline for OBJECT placement
+ *
  *  \par Function Description
+ *  This function XOR draws either the OBJECTS in the place list
+ *  or a rectangle around their bounding box, depending upon the
+ *  currently selected w_current->actionfeedback_mode. This takes the
+ *  value BOUNDINGBOX or OUTLINE.
+ *
+ * The function applies manhatten mode constraints to the coordinates
+ * before drawing if the CONTROL key is recording as being pressed in
+ * the w_current structure.
+ *
+ * The "drawing" parameter is used to indicate if this drawing should
+ * immediately use the selected feedback mode and positioning constraints.
+ *
+ * With drawing=TRUE, the selected conditions are used immediately,
+ * otherwise the conditions from the last drawing operation are used,
+ * saving the new state for next time.
+ *
+ * This function should be called with drawing=TRUE when starting a
+ * rubberbanding operation and when otherwise refreshing the rubberbanded
+ * outline (e.g. after a screen redraw). For any undraw operation, should
+ * be called with drawing=FALSE, ensuring that the undraw XOR matches the
+ * mode and constraints of the corresponding "draw" operation.
+ *
+ * If any mode / constraint changes are made between a undraw, redraw XOR
+ * pair, the latter (draw) operation must be called with drawing=TRUE. If
+ * no mode / constraint changes were made between the pair, it is not
+ * harmful to call the draw operation with "drawing=FALSE".
  *
+ *  \param [in] w_current   GSCHEM_TOPLEVEL which we're drawing for.
+ *  \param [in] drawing     Set to FALSE for undraw operations to ensure
+ *                            matching conditions to a previous draw operation.
  */
 void o_place_rubberplace_xor (GSCHEM_TOPLEVEL *w_current, int drawing)
 {
-  o_drawbounding(w_current, w_current->toplevel->page_current->place_list,
-                 x_get_darkcolor (w_current->bb_color), drawing);
+  TOPLEVEL *toplevel = w_current->toplevel;
+  int diff_x, diff_y;
+  int left, top, bottom, right;
+  int s_left, s_top, s_bottom, s_right;
+
+  g_return_if_fail (toplevel->page_current->place_list != NULL);
+
+  /* If drawing is true, then don't worry about the previous drawing
+   * method and movement constraints, use with the current settings */
+  if (drawing) {
+    w_current->last_drawb_mode = w_current->actionfeedback_mode;
+    w_current->drawbounding_action_mode = (w_current->CONTROLKEY)
+                                            ? CONSTRAINED : FREE;
+  }
+
+  /* Calculate delta of X-Y positions from buffer's origin */
+  diff_x = w_current->second_wx - w_current->first_wx;
+  diff_y = w_current->second_wy - w_current->first_wy;
+
+  /* Adjust the coordinates according to the movement constraints */
+  if (w_current->drawbounding_action_mode == CONSTRAINED ) {
+    if (abs(diff_x) >= abs(diff_y)) {
+      w_current->second_wy = w_current->first_wy;
+      diff_y = 0;
+    } else {
+      w_current->second_wx = w_current->first_wx;
+      diff_x = 0;
+    }
+  }
+
+  /* XOR draw with the appropriate mode */
+  if (w_current->last_drawb_mode == BOUNDINGBOX) {
+
+    /* Find the bounds of the drawing to be done */
+    world_get_object_glist_bounds (toplevel,
+                                   toplevel->page_current->place_list,
+                                   &left, &top, &right, &bottom);
+    WORLDtoSCREEN(toplevel, left + diff_x, top + diff_y, &s_left, &s_top);
+    WORLDtoSCREEN(toplevel, right + diff_x, bottom + diff_y, &s_right, &s_bottom);
+
+    gdk_gc_set_foreground(w_current->bounding_xor_gc, x_get_darkcolor (w_current->bb_color));
+    gdk_draw_rectangle (w_current->drawable,
+                        w_current->bounding_xor_gc, FALSE,
+                        s_left, s_bottom,
+                        s_right - s_left, s_top - s_bottom);
+  } else {
+    o_glist_draw_xor (w_current, diff_x, diff_y,
+                      toplevel->page_current->place_list);
+  }
+
+  /* Save movement constraints and drawing method for any
+   * corresponding undraw operation. */
+  w_current->last_drawb_mode = w_current->actionfeedback_mode;
+  w_current->drawbounding_action_mode = (w_current->CONTROLKEY)
+                                          ? CONSTRAINED : FREE;
 }
 
 




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