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

gEDA-cvs: CVS update: a_zoom.nw



  User: werner  
  Date: 06/04/24 13:21:12

  Modified:    .        a_zoom.nw i_callbacks.nw o_basic.nw
  Log:
  transparent zoom for moving, placing, copying and modifying components.
  
  support for jumps between x_states
  
  
  
  
  Revision  Changes    Path
  1.11      +0 -1      eda/geda/devel/gschem/noweb/a_zoom.nw
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: a_zoom.nw
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/gschem/noweb/a_zoom.nw,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -b -r1.10 -r1.11
  --- a_zoom.nw	14 Apr 2006 11:49:27 -0000	1.10
  +++ a_zoom.nw	24 Apr 2006 17:21:12 -0000	1.11
  @@ -341,7 +341,6 @@
     XOR_DRAW_BOX(w_current, box_left, box_top, box_width, box_height);
   
     a_zoom_box(w_current, 0);
  -  o_redraw_all_fast(w_current);
     o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
   }
   
  
  
  
  1.49      +37 -5     eda/geda/devel/gschem/noweb/i_callbacks.nw
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: i_callbacks.nw
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/gschem/noweb/i_callbacks.nw,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -b -r1.48 -r1.49
  --- i_callbacks.nw	14 Apr 2006 11:49:27 -0000	1.48
  +++ i_callbacks.nw	24 Apr 2006 17:21:12 -0000	1.49
  @@ -962,6 +962,7 @@
   DEFINE_I_CALLBACK(edit_select)
   {
     TOPLEVEL *w_current = (TOPLEVEL *) data;
  +  o_redraw_cleanstates(w_current);	
   
     /* this is probably the only place this should be */
     i_set_state(w_current, SELECT);
  @@ -1037,6 +1038,7 @@
   
     i_update_middle_button(w_current, i_callback_edit_copy_hotkey, _("Copy"));
     if (o_select_return_first_object(w_current)) {
  +    o_redraw_cleanstates(w_current);	
       o_copy_start(w_current, mouse_x, mouse_y);
       w_current->event_state = ENDCOPY;
       w_current->inside_action = 1;
  @@ -1085,6 +1087,7 @@
   
     i_update_middle_button(w_current, i_callback_edit_move_hotkey, _("Move"));
     if (o_select_return_first_object(w_current)) {
  +    o_redraw_cleanstates(w_current);	
       o_move_start(w_current, mouse_x, mouse_y);
       w_current->event_state = ENDMOVE;
       w_current->inside_action = 1;
  @@ -1110,8 +1113,8 @@
     i_update_middle_button(w_current, i_callback_edit_delete, _("Delete"));
   
     if (o_select_return_first_object(w_current)) {
  +    o_redraw_cleanstates(w_current);	
       o_delete(w_current);
  -
       /* if you delete the objects you must go into select
        * mode after the delete */
       w_current->inside_action = 0;
  @@ -1250,6 +1253,7 @@
     SELECTION *s_current;
   
     exit_if_null(w_current);
  +  o_redraw_cleanstates(w_current);	
   
     if (w_current->page_current->selection2_head) {
       s_current = w_current->page_current->selection2_head->next;
  @@ -1300,6 +1304,7 @@
   
     exit_if_null(w_current);
   
  +  o_redraw_cleanstates(w_current);	
     object = o_select_return_first_object(w_current);
   
     if (object) {
  @@ -1435,6 +1440,7 @@
       }
     } else {
       /* nothing selected, go back to select state */
  +    o_redraw_cleanstates(w_current);	
       w_current->inside_action = 0;
       i_set_state(w_current, SELECT);
     }
  @@ -1475,6 +1481,7 @@
       }
     } else {
       /* nothing selected, go back to select state */
  +    o_redraw_cleanstates(w_current);	
       w_current->inside_action = 0;
       i_set_state(w_current, SELECT);
     }
  @@ -1515,6 +1522,7 @@
       }
     } else {
       /* nothing selected, go back to select state */
  +    o_redraw_cleanstates(w_current);	
       w_current->inside_action = 0;
       i_set_state(w_current, SELECT);
     }
  @@ -1845,6 +1853,7 @@
   
     exit_if_null(w_current);
   
  +  o_redraw_cleanstates(w_current);	
     w_current->inside_action = 0;
     i_allow_expose();
     i_set_state(w_current, ZOOMBOXSTART);
  @@ -1866,6 +1875,7 @@
   
     exit_if_null(w_current);
   
  +  o_redraw_cleanstates(w_current);	
     a_zoom_box_start(w_current, mouse_x, mouse_y);
   
     w_current->inside_action = 1;
  @@ -1974,6 +1984,7 @@
   
     exit_if_null(w_current);
   
  +  o_redraw_cleanstates(w_current);	
     w_current->inside_action = 0;
     i_set_state(w_current, STARTPAN);
   
  @@ -2747,6 +2758,7 @@
     i_update_middle_button(w_current, i_callback_buffer_paste1, _("Paste 1"));
     if (object_buffer[0] != NULL) {
       if (object_buffer[0]->next != NULL) {
  +      o_redraw_cleanstates(w_current);	
         w_current->buffer_number = 0;
         w_current->inside_action = 1;
         i_set_state(w_current, STARTPASTE);
  @@ -2775,6 +2787,7 @@
     i_update_middle_button(w_current, i_callback_buffer_paste2, _("Paste 2"));
     if (object_buffer[1] != NULL) {
       if (object_buffer[1]->next != NULL) {
  +      o_redraw_cleanstates(w_current);	
         w_current->buffer_number = 1;
         w_current->inside_action = 1;
         i_set_state(w_current, STARTPASTE);
  @@ -2803,6 +2816,7 @@
     i_update_middle_button(w_current, i_callback_buffer_paste3, _("Paste 3"));
     if (object_buffer[2] != NULL) {
       if (object_buffer[2]->next != NULL) {
  +      o_redraw_cleanstates(w_current);	
         w_current->buffer_number = 2;
         w_current->inside_action = 1;
         i_set_state(w_current, STARTPASTE);
  @@ -2831,6 +2845,7 @@
     i_update_middle_button(w_current, i_callback_buffer_paste4, _("Paste 4"));
     if (object_buffer[3] != NULL) {
       if (object_buffer[3]->next != NULL) {
  +      o_redraw_cleanstates(w_current);	
         w_current->buffer_number = 3;
         w_current->inside_action = 1;
         i_set_state(w_current, STARTPASTE);
  @@ -2859,6 +2874,7 @@
     i_update_middle_button(w_current, i_callback_buffer_paste5, _("Paste 5"));
     if (object_buffer[4] != NULL) {
       if (object_buffer[4]->next != NULL) {
  +      o_redraw_cleanstates(w_current);	
         w_current->buffer_number = 4;
         w_current->inside_action = 1;
         i_set_state(w_current, STARTPASTE);
  @@ -3124,6 +3140,7 @@
   
     exit_if_null(w_current);
   
  +  o_redraw_cleanstates(w_current);	
     o_erase_rubber(w_current);
   
     /* need to click */
  @@ -3151,6 +3168,7 @@
   
     exit_if_null(w_current);
    
  +  o_redraw_cleanstates(w_current);	
     o_erase_rubber(w_current);
   
     /* need to click */
  @@ -3204,6 +3222,7 @@
   
     exit_if_null(w_current);
   
  +  o_redraw_cleanstates(w_current);	
     o_erase_rubber(w_current);
   
     /* need to click */
  @@ -3232,6 +3251,7 @@
   
     exit_if_null(w_current);
   
  +  o_redraw_cleanstates(w_current);	
     o_erase_rubber(w_current);
   
     /* need to click */
  @@ -3285,6 +3305,7 @@
   
     exit_if_null(w_current);
     
  +  o_redraw_cleanstates(w_current);	
     o_erase_rubber(w_current);
   
     w_current->inside_action = 0;
  @@ -3331,6 +3352,7 @@
   
     exit_if_null(w_current);
   
  +  o_redraw_cleanstates(w_current);	
     o_erase_rubber(w_current);
   
     i_update_middle_button(w_current, i_callback_add_line, _("Line"));
  @@ -3355,6 +3377,7 @@
   
     exit_if_null(w_current);
   
  +  o_redraw_cleanstates(w_current);	
     o_erase_rubber(w_current);
   
     i_update_middle_button(w_current, i_callback_add_line_hotkey, _("Line"));
  @@ -3382,6 +3405,7 @@
   
     exit_if_null(w_current);
   
  +  o_redraw_cleanstates(w_current);	
     o_erase_rubber(w_current);
   
     i_update_middle_button(w_current, i_callback_add_box, _("Box"));
  @@ -3406,6 +3430,7 @@
   
     exit_if_null(w_current);
   
  +  o_redraw_cleanstates(w_current);	
     o_erase_rubber(w_current);
   
     i_update_middle_button(w_current, i_callback_add_box_hotkey, _("Box"));
  @@ -3432,6 +3457,7 @@
   
     exit_if_null(w_current);
   
  +  o_redraw_cleanstates(w_current);	
     o_erase_rubber(w_current);
   
     w_current->inside_action = 0;
  @@ -3476,6 +3502,7 @@
   
     exit_if_null(w_current);
   
  +  o_redraw_cleanstates(w_current);	
     o_erase_rubber(w_current);
   
     i_update_middle_button(w_current, i_callback_add_circle, _("Circle"));
  @@ -3500,6 +3527,7 @@
   
     exit_if_null(w_current);
   
  +  o_redraw_cleanstates(w_current);	
     o_erase_rubber(w_current);
   
     i_update_middle_button(w_current, i_callback_add_circle_hotkey,
  @@ -3528,6 +3556,7 @@
   
     exit_if_null(w_current);
     
  +  o_redraw_cleanstates(w_current);	
     o_erase_rubber(w_current);
   
     i_update_middle_button(w_current, i_callback_add_arc, _("Arc"));
  @@ -3552,6 +3581,7 @@
   
     exit_if_null(w_current);
   
  +  o_redraw_cleanstates(w_current);	
     o_erase_rubber(w_current);
   
     i_update_middle_button(w_current, i_callback_add_arc_hotkey, _("Arc"));
  @@ -3579,6 +3609,7 @@
   
     exit_if_null(w_current);
   
  +  o_redraw_cleanstates(w_current);	
     o_erase_rubber(w_current);
   
     i_update_middle_button(w_current, i_callback_add_pin, _("Pin"));
  @@ -3603,6 +3634,7 @@
   
     exit_if_null(w_current);
   
  +  o_redraw_cleanstates(w_current);	
     o_erase_rubber(w_current);
   
     i_update_middle_button(w_current, i_callback_add_pin_hotkey, _("Pin"));
  
  
  
  1.15      +109 -1    eda/geda/devel/gschem/noweb/o_basic.nw
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_basic.nw
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/gschem/noweb/o_basic.nw,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -b -r1.14 -r1.15
  --- o_basic.nw	24 Apr 2006 03:06:56 -0000	1.14
  +++ o_basic.nw	24 Apr 2006 17:21:12 -0000	1.15
  @@ -27,6 +27,7 @@
   <<o_basic.c : o_drawbounding()>>
   <<o_basic.c : o_erasebounding()>>
   <<o_basic.c : o_erase_rubber()>>
  +<<o_basic.c : o_redraw_cleanstates()>>
   
   @
   
  @@ -100,7 +101,6 @@
     struct timeval tv2;
   #endif
   
  -
     if (!w_current->DONT_REDRAW) {
       x_repaint_background(w_current);
     }
  @@ -112,6 +112,7 @@
     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);
  @@ -125,6 +126,7 @@
   
     if (w_current->inside_action) {
       switch(w_current->event_state) {
  +      case(MOVE):
         case(ENDMOVE):
   	o_erase_selected(w_current);	
   	/* continue */
  @@ -153,6 +155,9 @@
                          NULL,
                          x_get_darkcolor(w_current->bb_color), FALSE);
           break;
  +      case (GRIPS):
  +	o_erase_selected(w_current);	
  +	break;
       }
     }
   }
  @@ -829,3 +834,106 @@
   
   
   @ %def o_erase_rubber
  +
  +
  +@section Function @code{o_redraw_cleanstates()}
  +
  +@defun o_redraw_cleanstates w_current
  +@end defun
  +
  +<<o_basic.c : o_redraw_cleanstates()>>=
  +/* This function is neccesary to make jumps between event_states.
  +   If we are inside an drawing action that created something on the dc, 
  +   e.g. if we are drawing a box and then jump to line drawing without 
  +   leaving the box drawing mode, there will remain some rubberbands on the
  +   screen. 
  +   Usually a intermediate select state would clean (redraw) the screen.
  +*/
  +int
  +o_redraw_cleanstates(TOPLEVEL *w_current)
  +{
  +  /* returns FALSE if the function was'nt nessecary */
  +  if (w_current->inside_action == 0) {
  +    return FALSE;
  +  }
  +
  +  switch (w_current->event_state) {
  +    /* all states with something on the dc */
  +    case(COPY): 
  +    case(DRAWBUS): 
  +    case(DRAWNET):   
  +    case(ENDARC): 
  +    case(ENDATTRIB):
  +    case(ENDBOX): 
  +    case(ENDCIRCLE): 
  +    case(ENDCOMP): 
  +    case(ENDCOPY): 
  +    case(ENDLINE): 
  +    case(ENDMOVE): 
  +    case(ENDPASTE): 
  +    case(ENDPIN): 
  +    case(ENDTEXT): 
  +    case(GRIPS): 
  +    case(MOVE): 
  +    case(NETCONT): 
  +    case(ZOOMBOXEND): 
  +      /* reset all rubberband variables and touch the select state */
  +      w_current->start_x = w_current->second_x = w_current->last_x = -1;
  +      w_current->start_y = w_current->second_y = w_current->last_y = -1;
  +      w_current->loc_x = w_current->loc_y = w_current->distance = -1;
  +      i_set_state(w_current, SELECT);
  +
  +      /* from i_callback_cancel() */
  +      o_redraw_all(w_current);
  +      /* it is possible to cancel in the middle of a complex place
  +       * so lets be sure to clean up the complex_place_head
  +       * structure and also clean up the attrib_place_head.
  +       * remember these don't remove the head structure */
  +      o_list_delete_rest(w_current,
  +			 w_current->page_current->complex_place_head);
  +      o_list_delete_rest(w_current,
  +			 w_current->page_current->attrib_place_head);
  + 
  +      /* also free internal current_attribute */
  +      o_attrib_free_current(w_current);     
  +      w_current->inside_action = 0;
  +      return TRUE;
  +
  +    /* all remaining states without dc changes */
  +    case(NONE): 
  +    case(SELECT): 
  +    case(DRAWLINE): 
  +    case(DRAWBOX): 
  +    case(DRAWCIRCLE): 
  +    case(ZOOM):
  +    case(PAN): 
  +    case(BUSCONT): 
  +    case(DRAWARC): 
  +    case(DRAWATTRIB): 
  +    case(DRAWCOMP):
  +    case(DRAWPICTURE): 
  +    case(DRAWPIN): 
  +    case(DRAWTEXT): 
  +    case(ENDMIRROR): 
  +    case(ENDPICTURE):
  +    case(ENDROTATEP): 
  +    case(ENDROUTENET): 
  +    case(MOUSEPAN): 
  +    case(SBOX): 
  +    case(STARTCOPY): 
  +    case(STARTDRAWBUS): 
  +    case(STARTDRAWNET): 
  +    case(STARTMOVE): 
  +    case(STARTPAN): 
  +    case(STARTPASTE): 
  +    case(STARTROUTENET): 
  +    case(STARTSELECT): 
  +    case(TEXTENTRY): 
  +    case(ZOOMBOXSTART): 
  +      return FALSE;
  +  }
  +
  +  return FALSE;
  +}
  +
  +@