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

gEDA-cvs: CVS update: a_zoom.c



  User: cnieves 
  Date: 06/10/21 09:56:26

  Modified:    .        a_zoom.c o_arc.c o_basic.c o_box.c o_buffer.c
                        o_bus.c o_circle.c o_complex.c o_cue.c o_grips.c
                        o_line.c o_net.c o_picture.c o_pin.c o_select.c
                        o_text.c
  Log:
  Added a new parameter to o_redraw and o_cue_redraw_all, 
  
  to choose wether to draw the selected objects or not.
  
  Make o_redraw call o_redraw_all_fast, since they shared code.
  
  
  
  
  Revision  Changes    Path
  1.23      +2 -2      eda/geda/gaf/gschem/src/a_zoom.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: a_zoom.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/a_zoom.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -b -r1.22 -r1.23
  --- a_zoom.c	14 Jul 2006 02:23:54 -0000	1.22
  +++ a_zoom.c	21 Oct 2006 13:56:23 -0000	1.23
  @@ -277,7 +277,7 @@
     int box_left, box_top;
   
     if (w_current->inside_action == 0) {
  -    o_redraw(w_current, w_current->page_current->object_head);
  +    o_redraw(w_current, w_current->page_current->object_head, TRUE);
       return;
     }
   
  @@ -305,7 +305,7 @@
     int box_left, box_top;
   
     if (w_current->inside_action == 0) {
  -    o_redraw(w_current, w_current->page_current->object_head);
  +    o_redraw(w_current, w_current->page_current->object_head, TRUE);
       return;
     }
   
  
  
  
  1.25      +1 -1      eda/geda/gaf/gschem/src/o_arc.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_arc.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_arc.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -b -r1.24 -r1.25
  --- o_arc.c	21 Oct 2006 13:32:54 -0000	1.24
  +++ o_arc.c	21 Oct 2006 13:56:23 -0000	1.25
  @@ -950,7 +950,7 @@
     int diff_x, diff_y;
   	
     if (w_current->inside_action == 0) {
  -    o_redraw(w_current, w_current->page_current->object_head);
  +    o_redraw(w_current, w_current->page_current->object_head, TRUE);
       return;
     }
   
  
  
  
  1.21      +21 -34    eda/geda/gaf/gschem/src/o_basic.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_basic.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_basic.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -b -r1.20 -r1.21
  --- o_basic.c	6 Aug 2006 16:45:29 -0000	1.20
  +++ o_basic.c	21 Oct 2006 13:56:23 -0000	1.21
  @@ -51,33 +51,7 @@
    */
   void o_redraw_all(TOPLEVEL *w_current)
   {
  -#if 0
  -  struct timeval tv1;
  -  struct timeval tv2;
  -#endif
  -
  -  if (!w_current->DONT_REDRAW) {
  -    x_repaint_background(w_current);
  -  }
  -
  -#if 0
  -  gettimeofday(&tv1, NULL);
  -#endif
  -
  -  o_recalc(w_current, w_current->page_current->object_head);
  -
  -  if (!w_current->DONT_REDRAW) {
  -    o_redraw(w_current, w_current->page_current->complex_place_head->next);
  -    o_redraw(w_current, w_current->page_current->object_head);
  -    o_cue_redraw_all(w_current,
  -                     w_current->page_current->object_head);
  -  }
  -
  -#if 0
  -  gettimeofday(&tv2, NULL);
  -  printf("secs: %d\n", tv2.tv_sec - tv1.tv_sec);
  -  printf("usecs: %d\n\n", tv2.tv_usec - tv1.tv_usec);
  -#endif
  +  o_redraw_all_fast(w_current);
   
     if (w_current->inside_action) {
       switch(w_current->event_state) {
  @@ -126,17 +100,22 @@
   /* basically like above but doesn't do the o_conn_disconnect_update */
   void o_redraw_all_fast(TOPLEVEL *w_current)
   {
  +  gboolean draw_selected = TRUE;
  +
     if (!w_current->DONT_REDRAW) {
       x_repaint_background(w_current);
     }
   
     o_recalc(w_current, w_current->page_current->object_head);
  +  /* Uncomment this when using the complex_place_list for moving and copying */
  +  /*  o_recalc_glist(w_current, w_current->page_current->complex_place_list); */
   
  -  if (!w_current->DONT_REDRAW) {
  -    o_redraw(w_current, w_current->page_current->object_head);
  +  draw_selected = !(w_current->inside_action &&
  +		    ((w_current->event_state == MOVE) ||
  +		     (w_current->event_state == ENDMOVE)));
  +  o_redraw(w_current, w_current->page_current->object_head, draw_selected);
       o_cue_redraw_all(w_current,
  -                     w_current->page_current->object_head);
  -  }
  +		   w_current->page_current->object_head, draw_selected);
   }
   
   /*! \todo Finish function documentation!!!
  @@ -144,13 +123,20 @@
    *  \par Function Description
    *
    */
  -void o_redraw(TOPLEVEL *w_current, OBJECT *object_list)
  +void o_redraw(TOPLEVEL *w_current, OBJECT *object_list, gboolean draw_selected)
   {
     OBJECT *o_current = object_list;
  +  int redraw_state = w_current->DONT_REDRAW;
   
     while (o_current != NULL) {
       if ((o_current->draw_func != NULL) &&
           (o_current->type != OBJ_HEAD)) {
  +      if (o_current->selected && !draw_selected) {
  +	w_current->DONT_REDRAW = 1 || redraw_state;
  +      }
  +      else {
  +	w_current->DONT_REDRAW = 0 || redraw_state;
  +      }
         w_current->inside_redraw = 1;
         (*o_current->draw_func)(w_current, o_current);
         w_current->inside_redraw = 0;
  @@ -158,6 +144,7 @@
   
       o_current = o_current->next;
     }
  +  w_current->DONT_REDRAW = redraw_state;
   }
   
   /*! \todo Finish function documentation!!!
  
  
  
  1.23      +2 -2      eda/geda/gaf/gschem/src/o_box.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_box.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_box.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -b -r1.22 -r1.23
  --- o_box.c	21 Oct 2006 13:32:54 -0000	1.22
  +++ o_box.c	21 Oct 2006 13:56:24 -0000	1.23
  @@ -947,7 +947,7 @@
     int box_left, box_top;
   
     if (w_current->inside_action == 0) {
  -    o_redraw(w_current, w_current->page_current->object_head);
  +    o_redraw(w_current, w_current->page_current->object_head, TRUE);
       return;
     }
   
  @@ -1023,7 +1023,7 @@
   void o_box_rubberbox(TOPLEVEL *w_current, int x, int y)
   {
     if (w_current->inside_action == 0) {
  -    o_redraw(w_current, w_current->page_current->object_head);
  +    o_redraw(w_current, w_current->page_current->object_head, TRUE);
       return;
     }
   
  
  
  
  1.8       +2 -2      eda/geda/gaf/gschem/src/o_buffer.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_buffer.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_buffer.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -b -r1.7 -r1.8
  --- o_buffer.c	14 Jul 2006 02:23:54 -0000	1.7
  +++ o_buffer.c	21 Oct 2006 13:56:24 -0000	1.8
  @@ -222,7 +222,7 @@
       o_current = o_current->next;
     }
   
  -  o_cue_redraw_all(w_current, o_saved->next);
  +  o_cue_redraw_all(w_current, o_saved->next, TRUE);
     o_cue_undraw_list(w_current, connected_objects);
     o_cue_draw_list(w_current, connected_objects);
     g_list_free(connected_objects);
  @@ -237,7 +237,7 @@
                                                                        temp_list);
   
     w_current->page_current->CHANGED = 1;
  -  o_redraw(w_current, o_saved->next); /* only redraw new objects */
  +  o_redraw(w_current, o_saved->next, TRUE); /* only redraw new objects */
     o_undo_savestate(w_current, UNDO_ALL);
     i_update_menus(w_current);
   }
  
  
  
  1.21      +2 -2      eda/geda/gaf/gschem/src/o_bus.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_bus.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_bus.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -b -r1.20 -r1.21
  --- o_bus.c	21 Oct 2006 13:32:54 -0000	1.20
  +++ o_bus.c	21 Oct 2006 13:56:24 -0000	1.21
  @@ -362,7 +362,7 @@
     GList *other_objects = NULL;
   
     if (w_current->inside_action == 0) {
  -    o_redraw(w_current, w_current->page_current->object_head);
  +    o_redraw(w_current, w_current->page_current->object_head, TRUE);
       return(FALSE);
     }
   
  @@ -496,7 +496,7 @@
     int size;
   
     if (w_current->inside_action == 0) {
  -    o_redraw(w_current, w_current->page_current->object_head);
  +    o_redraw(w_current, w_current->page_current->object_head, TRUE);
       return;
     }
   
  
  
  
  1.21      +2 -2      eda/geda/gaf/gschem/src/o_circle.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_circle.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_circle.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -b -r1.20 -r1.21
  --- o_circle.c	21 Oct 2006 13:32:54 -0000	1.20
  +++ o_circle.c	21 Oct 2006 13:56:24 -0000	1.21
  @@ -643,7 +643,7 @@
     int radius;
   
     if (w_current->inside_action == 0) {
  -    o_redraw(w_current, w_current->page_current->object_head);
  +    o_redraw(w_current, w_current->page_current->object_head, TRUE);
       return;
     }
   
  @@ -726,7 +726,7 @@
     int diff_x, diff_y;
   
     if (w_current->inside_action == 0) {
  -    o_redraw(w_current, w_current->page_current->object_head);
  +    o_redraw(w_current, w_current->page_current->object_head, TRUE);
       return;
     }
   
  
  
  
  1.28      +2 -2      eda/geda/gaf/gschem/src/o_complex.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_complex.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_complex.c,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -b -r1.27 -r1.28
  --- o_complex.c	15 Jul 2006 18:51:41 -0000	1.27
  +++ o_complex.c	21 Oct 2006 13:56:25 -0000	1.28
  @@ -43,7 +43,7 @@
     int left, right, top, bottom;
   
     if (!w_current->DONT_REDRAW) {
  -    o_redraw(w_current, o_current->complex->prim_objs);
  +    o_redraw(w_current, o_current->complex->prim_objs, TRUE);
     }
   
     get_complex_bounds(w_current, o_current->complex->prim_objs,
  @@ -323,7 +323,7 @@
                            rbottom - rtop);
       }
   
  -    o_redraw(w_current, o_start);
  +    o_redraw(w_current, o_start, TRUE);
       w_current->page_current->CHANGED = 1;
       o_undo_savestate(w_current, UNDO_ALL);
       i_update_menus(w_current);
  
  
  
  1.6       +17 -2     eda/geda/gaf/gschem/src/o_cue.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_cue.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_cue.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- o_cue.c	21 Oct 2006 13:32:54 -0000	1.5
  +++ o_cue.c	21 Oct 2006 13:56:25 -0000	1.6
  @@ -35,9 +35,10 @@
    *  \par Function Description
    *
    */
  -void o_cue_redraw_all(TOPLEVEL *w_current, OBJECT *head)
  +void o_cue_redraw_all(TOPLEVEL *w_current, OBJECT *head, gboolean draw_selected)
   {
     OBJECT *o_current;
  +  int redraw_state = w_current->DONT_REDRAW;
   
     o_current = head;
     while(o_current != NULL) {
  @@ -45,18 +46,32 @@
         case(OBJ_NET):
         case(OBJ_BUS):
         case(OBJ_PIN):
  +	if (o_current->selected && !draw_selected) {
  +	  w_current->DONT_REDRAW = 1 || redraw_state;
  +	}
  +	else {
  +	  w_current->DONT_REDRAW = 0 || redraw_state;
  +	}
           o_cue_draw_single(w_current, o_current);
           break;
   
         case(OBJ_COMPLEX):
         case(OBJ_PLACEHOLDER):
  -        o_cue_redraw_all(w_current, o_current->complex->prim_objs);
  +	if (o_current->selected && !draw_selected) {
  +	  w_current->DONT_REDRAW = 1 || redraw_state;
  +	}
  +	else {
  +	  w_current->DONT_REDRAW = 0 || redraw_state;
  +	}
  +        o_cue_redraw_all(w_current, o_current->complex->prim_objs, 
  +			 draw_selected);
   	break;
   
       }
       
       o_current = o_current->next;
     }
  +  w_current->DONT_REDRAW = redraw_state;
   }
   
   /*! \todo Finish function documentation!!!
  
  
  
  1.12      +2 -2      eda/geda/gaf/gschem/src/o_grips.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_grips.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_grips.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- o_grips.c	21 Oct 2006 13:32:54 -0000	1.11
  +++ o_grips.c	21 Oct 2006 13:56:25 -0000	1.12
  @@ -953,14 +953,14 @@
   {
   	
     if (w_current->inside_action == 0) {
  -    o_redraw(w_current, w_current->page_current->object_head);
  +    o_redraw(w_current, w_current->page_current->object_head, TRUE);
       return;
     }
   
     /* no object changing */
     if (object_changing == NULL) {
       /* stop grip process */
  -    o_redraw(w_current, w_current->page_current->object_head);
  +    o_redraw(w_current, w_current->page_current->object_head, TRUE);
       return;
     }
   	
  
  
  
  1.22      +2 -2      eda/geda/gaf/gschem/src/o_line.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_line.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_line.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -b -r1.21 -r1.22
  --- o_line.c	21 Oct 2006 13:32:54 -0000	1.21
  +++ o_line.c	21 Oct 2006 13:56:25 -0000	1.22
  @@ -843,7 +843,7 @@
     int x2, y2;
   
     if (w_current->inside_action == 0) {
  -    o_redraw(w_current, w_current->page_current->object_head);
  +    o_redraw(w_current, w_current->page_current->object_head, TRUE);
       return;
     }
   
  @@ -916,7 +916,7 @@
     int diff_x, diff_y;
   
     if (w_current->inside_action == 0) {
  -    o_redraw(w_current, w_current->page_current->object_head);
  +    o_redraw(w_current, w_current->page_current->object_head, TRUE);
       return;
     }
   
  
  
  
  1.29      +2 -2      eda/geda/gaf/gschem/src/o_net.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_net.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_net.c,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -b -r1.28 -r1.29
  --- o_net.c	21 Oct 2006 13:32:54 -0000	1.28
  +++ o_net.c	21 Oct 2006 13:56:26 -0000	1.29
  @@ -418,7 +418,7 @@
     OBJECT *new_net = NULL;
     
     if (w_current->inside_action == 0) {
  -    o_redraw(w_current, w_current->page_current->object_head);
  +    o_redraw(w_current, w_current->page_current->object_head, TRUE);
       return(FALSE);
     }
   
  @@ -657,7 +657,7 @@
     int ortho;
   
     if (w_current->inside_action == 0) {
  -    o_redraw(w_current, w_current->page_current->object_head);
  +    o_redraw(w_current, w_current->page_current->object_head, TRUE);
       return;
     }
   
  
  
  
  1.6       +2 -2      eda/geda/gaf/gschem/src/o_picture.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_picture.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_picture.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- o_picture.c	21 Oct 2006 13:32:54 -0000	1.5
  +++ o_picture.c	21 Oct 2006 13:56:26 -0000	1.6
  @@ -94,7 +94,7 @@
     int picture_left, picture_top;
   
     if (w_current->inside_action == 0) {
  -    o_redraw(w_current, w_current->page_current->object_head);
  +    o_redraw(w_current, w_current->page_current->object_head, TRUE);
       return;
     }
   
  @@ -320,7 +320,7 @@
     printf("o_picture_rubberbox called\n");
   #endif
     if (w_current->inside_action == 0) {
  -    o_redraw(w_current, w_current->page_current->object_head);
  +    o_redraw(w_current, w_current->page_current->object_head, TRUE);
       return;
     }
   
  
  
  
  1.24      +2 -2      eda/geda/gaf/gschem/src/o_pin.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_pin.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_pin.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -b -r1.23 -r1.24
  --- o_pin.c	21 Oct 2006 13:32:54 -0000	1.23
  +++ o_pin.c	21 Oct 2006 13:56:26 -0000	1.24
  @@ -214,7 +214,7 @@
     OBJECT *o_current, *o_current_pin;
   
     if (w_current->inside_action == 0) {
  -    o_redraw(w_current, w_current->page_current->object_head);
  +    o_redraw(w_current, w_current->page_current->object_head, TRUE);
       return;
     }
   
  @@ -288,7 +288,7 @@
     int diff_x, diff_y;
   
     if (w_current->inside_action == 0) {
  -    o_redraw(w_current, w_current->page_current->object_head);
  +    o_redraw(w_current, w_current->page_current->object_head, TRUE);
       return;
     }
   
  
  
  
  1.5       +2 -2      eda/geda/gaf/gschem/src/o_select.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_select.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_select.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- o_select.c	14 Jul 2006 02:23:55 -0000	1.4
  +++ o_select.c	21 Oct 2006 13:56:26 -0000	1.5
  @@ -285,7 +285,7 @@
   
   #if 0
     if (w_current->inside_action == 0) {
  -    o_redraw(w_current, w_current->page_current->object_head);
  +    o_redraw(w_current, w_current->page_current->object_head, TRUE);
       return;
     }
   #endif
  @@ -327,7 +327,7 @@
   
   #if 0
     if (w_current->inside_action == 0) {
  -    o_redraw(w_current, w_current->page_current->object_head);
  +    o_redraw(w_current, w_current->page_current->object_head, TRUE);
       return;
     }
   #endif
  
  
  
  1.21      +1 -1      eda/geda/gaf/gschem/src/o_text.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_text.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_text.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -b -r1.20 -r1.21
  --- o_text.c	21 Oct 2006 13:32:54 -0000	1.20
  +++ o_text.c	21 Oct 2006 13:56:26 -0000	1.21
  @@ -66,7 +66,7 @@
       o_text_recreate(w_current, o_current);
     }
     
  -  o_redraw(w_current, o_current->text->prim_objs);
  +  o_redraw(w_current, o_current->text->prim_objs, TRUE);
   
     get_complex_bounds(w_current, o_current->text->prim_objs,
                        &left, &top, &right, &bottom);
  
  
  


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