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

gEDA-cvs: CVS update: g_rc.c



  User: pcjc2   
  Date: 07/03/26 15:13:13

  Modified:    .        Tag: noscreen g_rc.c g_register.c i_vars.c o_find.c
  Log:
  Added rc option (select-slack-pixels #) to control how near an object
  
  we have to be in order to select it by clicking. Default is 4 pixels.
  
  
  
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.42.2.2  +24 -0     eda/geda/gaf/gschem/src/g_rc.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: g_rc.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/g_rc.c,v
  retrieving revision 1.42.2.1
  retrieving revision 1.42.2.2
  diff -u -b -r1.42.2.1 -r1.42.2.2
  --- g_rc.c	11 Feb 2007 23:58:56 -0000	1.42.2.1
  +++ g_rc.c	26 Mar 2007 19:13:13 -0000	1.42.2.2
  @@ -1776,3 +1776,27 @@
     return SCM_BOOL_T;
   }
   #undef FUNC_NAME
  +
  +/*! \todo Finish function documentation!!!
  + *  \brief
  + *  \par Function Description
  + *
  + */
  +SCM g_rc_select_slack_pixels(SCM pixels)
  +{
  +  int val;
  +
  +  SCM_ASSERT (SCM_INUMP (pixels), pixels, SCM_ARG1, "select-slack-pixels");
  +  
  +  val = SCM_INUM (pixels);
  +
  +  if (val <= 0) {
  +    fprintf(stderr, _("Invalid number of pixels [%d] passed to select-slack-pixels\n"),
  +            val);
  +    val = 4; /* absolute default */
  +  }
  +
  +  default_select_slack_pixels = val;
  +
  +  return SCM_BOOL_T;
  +}
  
  
  
  1.49.2.4  +1 -0      eda/geda/gaf/gschem/src/g_register.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: g_register.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/g_register.c,v
  retrieving revision 1.49.2.3
  retrieving revision 1.49.2.4
  diff -u -b -r1.49.2.3 -r1.49.2.4
  --- g_register.c	24 Feb 2007 17:14:34 -0000	1.49.2.3
  +++ g_register.c	26 Mar 2007 19:13:13 -0000	1.49.2.4
  @@ -152,6 +152,7 @@
     { "mousepan-gain",             1, 0, 0, g_rc_mousepan_gain },
     { "keyboardpan-gain",          1, 0, 0, g_rc_keyboardpan_gain },
     { "print-command",             1, 0, 0, g_rc_print_command },
  +  { "select-slack-pixels",       1, 0, 0, g_rc_select_slack_pixels },
   
     /* backup functions */
     { "auto-save-interval",        1, 0, 0, g_rc_auto_save_interval },
  
  
  
  1.35.2.2  +3 -0      eda/geda/gaf/gschem/src/i_vars.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: i_vars.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/i_vars.c,v
  retrieving revision 1.35.2.1
  retrieving revision 1.35.2.2
  diff -u -b -r1.35.2.1 -r1.35.2.2
  --- i_vars.c	11 Feb 2007 23:58:56 -0000	1.35.2.1
  +++ i_vars.c	26 Mar 2007 19:13:13 -0000	1.35.2.2
  @@ -129,6 +129,7 @@
   int default_text_feedback = ONLY_WHEN_READABLE;
   int default_mousepan_gain = 5;
   int default_keyboardpan_gain = 20;
  +int default_select_slack_pixels = 4;
   
   /*! \todo Finish function documentation!!!
    *  \brief
  @@ -249,5 +250,7 @@
     w_current->mousepan_gain = default_mousepan_gain;
     w_current->keyboardpan_gain = default_keyboardpan_gain;
   
  +  w_current->mousepan_gain = default_select_slack_pixels;
  +
     w_current->auto_save_interval = default_auto_save_interval;
   }
  
  
  
  1.4.6.3   +10 -8     eda/geda/gaf/gschem/src/o_find.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_find.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_find.c,v
  retrieving revision 1.4.6.2
  retrieving revision 1.4.6.3
  diff -u -b -r1.4.6.2 -r1.4.6.3
  --- o_find.c	25 Feb 2007 13:41:24 -0000	1.4.6.2
  +++ o_find.c	26 Mar 2007 19:13:13 -0000	1.4.6.3
  @@ -40,9 +40,10 @@
   {
     OBJECT *o_current=NULL;
     gboolean object_found = FALSE;
  -  int w_x, w_y;
  +  int w_x, w_y, w_slack;
   
     SCREENtoWORLD( w_current, screen_x, screen_y, &w_x, &w_y );
  +  w_slack = WORLDabs( w_current, w_current->select_slack_pixels );
   
     if (w_current->page_current->object_lastplace == NULL) {
       o_current = w_current->page_current->object_head;
  @@ -52,8 +53,8 @@
   
     /* do first search */
     while (o_current != NULL) {
  -    if (inside_region(o_current->w_left, o_current->w_top,
  -                      o_current->w_right, o_current->w_bottom,
  +    if (inside_region(o_current->w_left - w_slack, o_current->w_top - w_slack,
  +                      o_current->w_right + w_slack, o_current->w_bottom + w_slack,
                         w_x, w_y)) {
         if (o_current->sel_func != NULL &&
   	  o_current->type != OBJ_HEAD &&
  @@ -84,8 +85,8 @@
     o_current = w_current->page_current->object_head;
     while (o_current != NULL && 
            o_current != w_current->page_current->object_lastplace) {
  -    if (inside_region(o_current->w_left, o_current->w_top,
  -                      o_current->w_right, o_current->w_bottom,
  +    if (inside_region(o_current->w_left - w_slack, o_current->w_top - w_slack,
  +                      o_current->w_right + w_slack, o_current->w_bottom + w_slack,
                         w_x, w_y)) {
         
         if (o_current->sel_func != NULL &&
  @@ -134,16 +135,17 @@
   {
     OBJECT *o_current=NULL;
     GList *s_current;
  -  int w_x, w_y;
  +  int w_x, w_y, w_slack;
   
     SCREENtoWORLD( w_current, screen_x, screen_y, &w_x, &w_y );
  +  w_slack = WORLDabs( w_current, w_current->select_slack_pixels );
   
     s_current = w_current->page_current->selection_list;
     /* do first search */
     while (s_current != NULL) {
       o_current = (OBJECT *) s_current->data;
  -    if (inside_region(o_current->w_left, o_current->w_top,
  -                      o_current->w_right, o_current->w_bottom,
  +    if (inside_region(o_current->w_left - w_slack, o_current->w_top - w_slack,
  +                      o_current->w_right + w_slack, o_current->w_bottom + w_slack,
                         w_x, w_y)) {
   
   #if DEBUG
  
  
  


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