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

gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-374-g7b66306)



The branch, master has been updated
       via  7b663063f659aac854f844bda40160f697f7c3ef (commit)
      from  3d5fce8f9e6a1172a285dd4a49943f2b05712ca4 (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 |    2 --
 gschem/src/i_basic.c       |    4 ----
 gschem/src/i_callbacks.c   |    1 +
 gschem/src/o_basic.c       |    8 ++++----
 gschem/src/o_complex.c     |   13 +------------
 gschem/src/o_move.c        |    1 +
 gschem/src/o_place.c       |    6 +++++-
 gschem/src/o_text.c        |   13 +------------
 gschem/src/x_compselect.c  |   26 +++++++++++---------------
 gschem/src/x_event.c       |   14 ++------------
 10 files changed, 26 insertions(+), 62 deletions(-)


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

commit 7b663063f659aac854f844bda40160f697f7c3ef
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Fri Dec 12 19:03:52 2008 +0000

    Use (rubber_visible == 0) to avoid "undrawing" invisible objects.
    
    For some operations, such as text and component placement, there is a
    gap between inserting components into the place buffer (at 0,0) and
    knowing where to draw them.
    
    This is presently handled with separate one-shot states used to special
    case the first mouse event recieved. These states are transitioned from
    as soon as the first drawing operation has been made. If we track the
    fact that no "undrawing" should take place, it's otherwise OK to use the
    same motion event handler for the first and subsequent motions.

:100644 100644 5f5965a... 532b317... M	gschem/include/prototype.h
:100644 100644 95648fc... 5bd9384... M	gschem/src/i_basic.c
:100644 100644 7861989... 9887871... M	gschem/src/i_callbacks.c
:100644 100644 7da72a8... 4a4fdcd... M	gschem/src/o_basic.c
:100644 100644 54199b3... 837270b... M	gschem/src/o_complex.c
:100644 100644 756ef30... bf7b56b... M	gschem/src/o_move.c
:100644 100644 3a5d010... d8ff369... M	gschem/src/o_place.c
:100644 100644 f101740... 64e65ae... M	gschem/src/o_text.c
:100644 100644 66ba6df... bbbbc88... M	gschem/src/x_compselect.c
:100644 100644 cf72273... f7ed9c9... M	gschem/src/x_event.c

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

commit 7b663063f659aac854f844bda40160f697f7c3ef
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Fri Dec 12 19:03:52 2008 +0000

    Use (rubber_visible == 0) to avoid "undrawing" invisible objects.
    
    For some operations, such as text and component placement, there is a
    gap between inserting components into the place buffer (at 0,0) and
    knowing where to draw them.
    
    This is presently handled with separate one-shot states used to special
    case the first mouse event recieved. These states are transitioned from
    as soon as the first drawing operation has been made. If we track the
    fact that no "undrawing" should take place, it's otherwise OK to use the
    same motion event handler for the first and subsequent motions.

diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index 5f5965a..532b317 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -550,7 +550,6 @@ void o_circle_erase_grips(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current);
 void o_complex_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current);
 void o_complex_draw_xor(GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *complex);
 void o_complex_prepare_place(GSCHEM_TOPLEVEL *w_current, const char *sym_name);
-void o_complex_start(GSCHEM_TOPLEVEL *w_current, int x, int y);
 void o_complex_place_changed_run_hook(GSCHEM_TOPLEVEL *w_current);
 void o_complex_end(GSCHEM_TOPLEVEL *w_current, int x, int y, int continue_placing);
 void o_complex_translate_all(GSCHEM_TOPLEVEL *w_current, int offset);
@@ -730,7 +729,6 @@ void o_text_draw_rectangle(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current);
 void o_text_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current);
 void o_text_draw_xor(GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_current);
 void o_text_prepare_place(GSCHEM_TOPLEVEL *w_current, char *text);
-void o_text_start(GSCHEM_TOPLEVEL *w_current, int x, int y);
 void o_text_edit(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current);
 void o_text_edit_end(GSCHEM_TOPLEVEL *w_current, char *string, int len, int text_size, int text_alignment);
 void o_text_change(GSCHEM_TOPLEVEL *w_current, OBJECT *object, char *string, int visibility, int show);
diff --git a/gschem/src/i_basic.c b/gschem/src/i_basic.c
index 95648fc..5bd9384 100644
--- a/gschem/src/i_basic.c
+++ b/gschem/src/i_basic.c
@@ -75,11 +75,9 @@ static const char *i_status_string(GSCHEM_TOPLEVEL *w_current)
     case SBOX:
     case GRIPS:
       return _("Select Mode");
-    case DRAWCOMP:
     case ENDCOMP:
       return _("Component Mode"); /*EK* new */
     case ENDTEXT:
-    case DRAWTEXT:
       return _("Text Mode"); /*EK* new */
     case STARTCOPY:
     case ENDCOPY:
@@ -311,7 +309,6 @@ void i_update_toolbar(GSCHEM_TOPLEVEL *w_current)
 				   w_current->toolbar_bus), TRUE);
       break;
       
-    case(DRAWCOMP): /*! \todo */
     case(DRAWLINE): /*! \todo */
     case(DRAWBOX): /*! \todo */
     case(DRAWPICTURE): /*! \todo */
@@ -334,7 +331,6 @@ void i_update_toolbar(GSCHEM_TOPLEVEL *w_current)
     case(ENDARC): /*! \todo */
     case(ENDPIN): /*! \todo */
     case(ENDCOMP): /*! \todo */
-    case(DRAWTEXT): /*! \todo */
     case(ENDTEXT): /*! \todo */
     case(ENDROTATEP): /*! \todo */
     case(ENDMIRROR): /*! \todo */
diff --git a/gschem/src/i_callbacks.c b/gschem/src/i_callbacks.c
index 7861989..9887871 100644
--- a/gschem/src/i_callbacks.c
+++ b/gschem/src/i_callbacks.c
@@ -3479,6 +3479,7 @@ DEFINE_I_CALLBACK(cancel)
 
     /* Undraw any XOR outline of the place list */
     o_place_rubberplace_xor(w_current, FALSE);
+    w_current->rubber_visible = 0;
 
     /* De-select the lists in the component selector */
     x_compselect_deselect (w_current);
diff --git a/gschem/src/o_basic.c b/gschem/src/o_basic.c
index 7da72a8..4a4fdcd 100644
--- a/gschem/src/o_basic.c
+++ b/gschem/src/o_basic.c
@@ -69,16 +69,18 @@ void o_redraw_all(GSCHEM_TOPLEVEL *w_current)
       case(ENDCOMP):
       case(ENDTEXT):
       case(ENDPASTE):
-        o_place_rubberplace_xor (w_current, TRUE);
+        /* Redraw the rubberband objects (if they were previously visible) */
+        if (w_current->rubber_visible)
+          o_place_rubberplace_xor (w_current, TRUE);
         break;
 
       case(STARTDRAWNET):
       case(DRAWNET):
       case(NETCONT):
         w_current->magnetic_visible=0;
+        w_current->rubber_visible = 0;
         break;
     }
-    w_current->rubber_visible=0;
   }
 }
 
@@ -469,7 +471,6 @@ int o_redraw_cleanstates(GSCHEM_TOPLEVEL *w_current)
 
   switch (w_current->event_state) {
     /* all states with something on the dc */
-    case(DRAWCOMP):
     case(ENDCOMP):
       /* De-select the lists in the component selector */
       x_compselect_deselect (w_current);
@@ -530,7 +531,6 @@ int o_redraw_cleanstates(GSCHEM_TOPLEVEL *w_current)
     case(DRAWARC):
     case(DRAWPICTURE):
     case(DRAWPIN):
-    case(DRAWTEXT):
     case(ENDMIRROR):
     case(ENDPICTURE):
     case(ENDROTATEP):
diff --git a/gschem/src/o_complex.c b/gschem/src/o_complex.c
index 54199b3..837270b 100644
--- a/gschem/src/o_complex.c
+++ b/gschem/src/o_complex.c
@@ -133,18 +133,7 @@ void o_complex_prepare_place(GSCHEM_TOPLEVEL *w_current, const char *sym_name)
   toplevel->DONT_REDRAW = redraw_state;
 
   w_current->inside_action = 1;
-  i_set_state(w_current, DRAWCOMP);
-}
-
-
-/*! \todo Finish function documentation!!!
-*  \brief
-*  \par Function Description
-*
-*/
-void o_complex_start(GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
-{
-  o_place_start (w_current, w_x, w_y);
+  i_set_state (w_current, ENDCOMP);
 }
 
 
diff --git a/gschem/src/o_move.c b/gschem/src/o_move.c
index 756ef30..bf7b56b 100644
--- a/gschem/src/o_move.c
+++ b/gschem/src/o_move.c
@@ -160,6 +160,7 @@ void o_move_end(GSCHEM_TOPLEVEL *w_current)
   diff_y = w_current->second_wy - w_current->first_wy;
 
   o_move_rubbermove_xor (w_current, FALSE);
+  w_current->rubber_visible = 0;
 
   if (w_current->netconn_rubberband) {
     o_move_end_rubberband(w_current, diff_x, diff_y,
diff --git a/gschem/src/o_place.c b/gschem/src/o_place.c
index 3a5d010..d8ff369 100644
--- a/gschem/src/o_place.c
+++ b/gschem/src/o_place.c
@@ -37,6 +37,7 @@ void o_place_start (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
   w_current->second_wy = w_y;
 
   o_place_rubberplace_xor (w_current, TRUE);
+  w_current->rubber_visible = 1;
 }
 
 /*! \todo Finish function documentation!!!
@@ -59,6 +60,7 @@ void o_place_end (GSCHEM_TOPLEVEL *w_current,
 
   /* erase old image */
   o_place_rubberplace_xor (w_current, FALSE);
+  w_current->rubber_visible = 0;
 
   /* Calc final object positions */
   w_current->second_wx = w_x;
@@ -127,10 +129,12 @@ void o_place_end (GSCHEM_TOPLEVEL *w_current,
  */
 void o_place_rubberplace (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
 {
-  o_place_rubberplace_xor (w_current, FALSE);
+  if (w_current->rubber_visible)
+    o_place_rubberplace_xor (w_current, FALSE);
   w_current->second_wx = w_x;
   w_current->second_wy = w_y;
   o_place_rubberplace_xor (w_current, TRUE);
+  w_current->rubber_visible = 1;
 }
 
 
diff --git a/gschem/src/o_text.c b/gschem/src/o_text.c
index f101740..64e65ae 100644
--- a/gschem/src/o_text.c
+++ b/gschem/src/o_text.c
@@ -297,18 +297,7 @@ void o_text_prepare_place(GSCHEM_TOPLEVEL *w_current, char *text)
                              VISIBLE, SHOW_NAME_VALUE));
 
   w_current->inside_action = 1;
-  i_set_state(w_current, DRAWTEXT);
-}
-
-
-/*! \todo Finish function documentation!!!
- *  \brief
-*  \par Function Description
-*
-*/
-void o_text_start (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
-{
-  o_place_start (w_current, w_x, w_y);
+  i_set_state (w_current, ENDTEXT);
 }
 
 
diff --git a/gschem/src/x_compselect.c b/gschem/src/x_compselect.c
index 66ba6df..bbbbc88 100644
--- a/gschem/src/x_compselect.c
+++ b/gschem/src/x_compselect.c
@@ -137,20 +137,17 @@ x_compselect_callback_response (GtkDialog *dialog,
               g_assert_not_reached ();
         }
 
-        switch (w_current->event_state) {
-          case ENDCOMP:
-            /* Undraw the component which was being placed */
+        if (w_current->event_state == ENDCOMP) {
+          /* Delete the component which was being placed */
+          if (w_current->rubber_visible)
             o_place_rubberplace_xor (w_current, FALSE);
-            /* Fall through */
-          case DRAWCOMP:
-            s_delete_object_glist (toplevel,
-                                   toplevel->page_current->place_list);
-            toplevel->page_current->place_list = NULL;
-            break;
-
-          default:
-            /* Cancel whatever other action is currently in progress */
-            o_redraw_cleanstates (w_current);
+          w_current->rubber_visible = 0;
+          s_delete_object_glist (toplevel,
+                                 toplevel->page_current->place_list);
+          toplevel->page_current->place_list = NULL;
+        } else {
+          /* Cancel whatever other action is currently in progress */
+          o_redraw_cleanstates (w_current);
         }
 
         if (symbol == NULL) {
@@ -182,8 +179,7 @@ x_compselect_callback_response (GtkDialog *dialog,
         gtk_widget_destroy (GTK_WIDGET (dialog));
         w_current->cswindow = NULL;
 
-        if (w_current->event_state == ENDCOMP ||
-            w_current->event_state == DRAWCOMP) {
+        if (w_current->event_state == ENDCOMP) {
 
           /* Cancel the place operation currently in progress */
           o_redraw_cleanstates (w_current);
diff --git a/gschem/src/x_event.c b/gschem/src/x_event.c
index cf72273..f7ed9c9 100644
--- a/gschem/src/x_event.c
+++ b/gschem/src/x_event.c
@@ -283,6 +283,7 @@ gint x_event_button_pressed(GtkWidget *widget, GdkEventButton *event,
           i_update_toolbar(w_current);
         } else {
           o_place_rubberplace_xor (w_current, TRUE);
+          w_current->rubber_visible = 1;
         }
         break;
 
@@ -573,6 +574,7 @@ gint x_event_button_released(GtkWidget *widget, GdkEventButton *event,
         w_current->inside_action = 1;
         /* Keep the state and the inside_action, as the copy has not finished. */
         o_place_rubberplace_xor (w_current, TRUE);
+        w_current->rubber_visible = 1;
         i_set_state(w_current, ENDMCOPY);
         i_update_toolbar(w_current);
         o_undo_savestate(w_current, UNDO_ALL);
@@ -860,18 +862,6 @@ gint x_event_motion(GtkWidget *widget, GdkEventMotion *event,
       o_pin_rubberpin(w_current, w_x, w_y);
     break;
 
-    case(DRAWCOMP):
-    o_complex_start(w_current, w_x, w_y);
-    w_current->event_state = ENDCOMP;
-    w_current->inside_action = 1;
-    break;
-
-    case(DRAWTEXT):
-    o_text_start(w_current, w_x, w_y);
-    w_current->event_state = ENDTEXT;
-    w_current->inside_action = 1;
-    break;
-
     case(COPY):
     case(MCOPY):
     case(ENDCOPY):




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