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

gEDA-cvs: branch: master updated (1.1.2.20070818-144-g20f61e1)



The branch, master has been updated
       via  20f61e1aaebcf565e5d7dcf111b1c07cd8483fd1 (commit)
       via  49bce50cbcfe83e7b53c4ffe76e4ca1edb333c38 (commit)
       via  ec2269ef825369b75ab932f5395a2f64dae72847 (commit)
       via  a02bc0b501b7acbdf419ad306b46ec6a9522b61c (commit)
      from  47240f890c2282d19a1822c280de4fac18a50e66 (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/lib/gschem-lightbg |    2 +-
 gschem/src/o_grips.c      |  192 ++++++++++++++++++++++-----------------------
 gschem/src/o_select.c     |    4 +-
 gschem/src/x_event.c      |    5 +-
 4 files changed, 100 insertions(+), 103 deletions(-)


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

commit 20f61e1aaebcf565e5d7dcf111b1c07cd8483fd1
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Dec 15 12:32:52 2007 +0000

    Fix test of object_changing in o_grips_motion() to a g_return_if_fail()
    
    This test isn't hit unless o_grips_motion() is called before the
    object_changing variable is set, and this would indicate a bug in
    libgeda or its client. This could currently cause a segfault if it
    were to happen, as the variable isn't initialised to NULL.
    
    Initialise object_changing to NULL, so any bug will always be caught.
    
    Tidy up indentation levels in o_grips_start() by returning early if we
    don't have any object to manipulate, rather than wrapping most of the
    funciton in an if (...) {...} test.

:100644 100644 0e4e01c... 8d9835a... M	gschem/src/o_grips.c

commit 49bce50cbcfe83e7b53c4ffe76e4ca1edb333c38
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Dec 15 11:37:51 2007 +0000

    Remove un-needed box size computation in o_select_box_start()

:100644 100644 422c31a... 6fe46a3... M	gschem/src/o_select.c

commit ec2269ef825369b75ab932f5395a2f64dae72847
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Dec 15 11:19:48 2007 +0000

    Fix stroke trail to be visible on light background color scheme

:100644 100644 6043cc4... 1f17a31... M	gschem/lib/gschem-lightbg

commit a02bc0b501b7acbdf419ad306b46ec6a9522b61c
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Dec 15 11:12:47 2007 +0000

    Erase stroke trails after an un-successful stroke recognition
    
    Previous behaviour was only to erase stroke trails after a
    successful match.

:100644 100644 5f35bd4... c0d1558... M	gschem/src/x_event.c

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

commit 20f61e1aaebcf565e5d7dcf111b1c07cd8483fd1
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Dec 15 12:32:52 2007 +0000

    Fix test of object_changing in o_grips_motion() to a g_return_if_fail()
    
    This test isn't hit unless o_grips_motion() is called before the
    object_changing variable is set, and this would indicate a bug in
    libgeda or its client. This could currently cause a segfault if it
    were to happen, as the variable isn't initialised to NULL.
    
    Initialise object_changing to NULL, so any bug will always be caught.
    
    Tidy up indentation levels in o_grips_start() by returning early if we
    don't have any object to manipulate, rather than wrapping most of the
    funciton in an if (...) {...} test.

diff --git a/gschem/src/o_grips.c b/gschem/src/o_grips.c
index 0e4e01c..8d9835a 100644
--- a/gschem/src/o_grips.c
+++ b/gschem/src/o_grips.c
@@ -52,7 +52,7 @@ static int whichone_changing = -1;
 /*! \brief
  *  This variable holds a pointer on the object under modification.
  */
-static OBJECT *object_changing;
+static OBJECT *object_changing = NULL;
 
 /*! \brief Check if point is inside grip.
  *  \par Function Description
@@ -493,96 +493,98 @@ int o_grips_start(GSCHEM_TOPLEVEL *w_current, int x, int y)
 
   /* search if there is a grip on a selected object at (x,y) */
   object = o_grips_search_world(w_current, w_x, w_y, &whichone);
-  if (object) {
-    whichone_changing = whichone;
-    object_changing = object;
-
-    /* there is one */
-    /* depending on its type, start the modification process */
-    switch(object->type) {
-      case(OBJ_ARC):
-        /* start the modification of a grip on an arc */
-        o_grips_start_arc(w_current, object, x, y, whichone);
-        return(TRUE);
-
-      case(OBJ_BOX):
-        /* start the modification of a grip on a box */
-        o_grips_start_box(w_current, object, x, y, whichone);
-        return(TRUE);
-
-      case(OBJ_PICTURE):
-        /* start the modification of a grip on a picture */
-        o_grips_start_picture(w_current, object, x, y, whichone);
-        return(TRUE);
-
-      case(OBJ_CIRCLE):
-        /* start the modification of a grip on a circle */
-        o_grips_start_circle(w_current, object, x, y, whichone);
-        return(TRUE);
-
-      case(OBJ_LINE):
-        /* start the modification of a grip on a line */
-        o_grips_start_line(w_current, object, x, y, whichone);
-        return(TRUE);
-
-      case(OBJ_NET):
-        w_current->last_drawb_mode = -1;
-        WORLDtoSCREEN( toplevel, object->line->x[whichone], object->line->y[whichone],
-                       &w_current->last_x, &w_current->last_y );
-        WORLDtoSCREEN( toplevel, object->line->x[!whichone], object->line->y[!whichone],
-                       &w_current->start_x, &w_current->start_y );
-
-        o_net_erase(w_current, object);
-        gdk_gc_set_foreground(w_current->xor_gc,
-                              x_get_darkcolor(w_current->select_color) );
-        gdk_draw_line(w_current->window, w_current->xor_gc,
-                      w_current->start_x, w_current->start_y,
-                      w_current->last_x, w_current->last_y);
-        o_line_erase_grips(w_current, object);
-
-        gdk_gc_set_foreground(w_current->gc,
-                              x_get_color(toplevel->background_color));
-        return(TRUE);
-
-      case(OBJ_PIN):
-        w_current->last_drawb_mode = -1;
-        WORLDtoSCREEN( toplevel, object->line->x[whichone], object->line->y[whichone],
-                       &w_current->last_x, &w_current->last_y );
-        WORLDtoSCREEN( toplevel, object->line->x[!whichone], object->line->y[!whichone],
-                       &w_current->start_x, &w_current->start_y );
-
-        o_pin_erase(w_current, object);
-        gdk_gc_set_foreground(w_current->xor_gc,
-                              x_get_darkcolor(w_current->select_color) );
-        gdk_draw_line(w_current->window, w_current->xor_gc,
-                      w_current->start_x, w_current->start_y,
-                      w_current->last_x, w_current->last_y);
-        o_line_erase_grips(w_current, object);
-        return(TRUE);
-
-      case(OBJ_BUS):
-        w_current->last_drawb_mode = -1;
-        WORLDtoSCREEN( toplevel, object->line->x[whichone], object->line->y[whichone],
-                       &w_current->last_x, &w_current->last_y );
-        WORLDtoSCREEN( toplevel, object->line->x[!whichone], object->line->y[!whichone],
-                       &w_current->start_x, &w_current->start_y );
-
-        o_bus_erase(w_current, object);
-        gdk_gc_set_foreground(w_current->xor_gc,
-                              x_get_darkcolor(w_current->select_color) );
-        gdk_draw_line(w_current->window, w_current->xor_gc,
-                      w_current->start_x, w_current->start_y,
-                      w_current->last_x, w_current->last_y);
-        o_line_erase_grips(w_current, object);
-
-        gdk_gc_set_foreground(w_current->gc,
-                              x_get_color(toplevel->background_color));
-        return(TRUE);
-
-      default:
-        /* object type unknown : error condition */
-        return(FALSE);
-    }
+
+  if (object == NULL)
+    return FALSE;
+
+  whichone_changing = whichone;
+  object_changing = object;
+
+  /* there is one */
+  /* depending on its type, start the modification process */
+  switch(object->type) {
+    case(OBJ_ARC):
+      /* start the modification of a grip on an arc */
+      o_grips_start_arc(w_current, object, x, y, whichone);
+      return(TRUE);
+
+    case(OBJ_BOX):
+      /* start the modification of a grip on a box */
+      o_grips_start_box(w_current, object, x, y, whichone);
+      return(TRUE);
+
+    case(OBJ_PICTURE):
+      /* start the modification of a grip on a picture */
+      o_grips_start_picture(w_current, object, x, y, whichone);
+      return(TRUE);
+
+    case(OBJ_CIRCLE):
+      /* start the modification of a grip on a circle */
+      o_grips_start_circle(w_current, object, x, y, whichone);
+      return(TRUE);
+
+    case(OBJ_LINE):
+      /* start the modification of a grip on a line */
+      o_grips_start_line(w_current, object, x, y, whichone);
+      return(TRUE);
+
+    case(OBJ_NET):
+      w_current->last_drawb_mode = -1;
+      WORLDtoSCREEN( toplevel, object->line->x[whichone], object->line->y[whichone],
+                     &w_current->last_x, &w_current->last_y );
+      WORLDtoSCREEN( toplevel, object->line->x[!whichone], object->line->y[!whichone],
+                     &w_current->start_x, &w_current->start_y );
+
+      o_net_erase(w_current, object);
+      gdk_gc_set_foreground(w_current->xor_gc,
+                            x_get_darkcolor(w_current->select_color) );
+      gdk_draw_line(w_current->window, w_current->xor_gc,
+                    w_current->start_x, w_current->start_y,
+                    w_current->last_x, w_current->last_y);
+      o_line_erase_grips(w_current, object);
+
+      gdk_gc_set_foreground(w_current->gc,
+                            x_get_color(toplevel->background_color));
+      return(TRUE);
+
+    case(OBJ_PIN):
+      w_current->last_drawb_mode = -1;
+      WORLDtoSCREEN( toplevel, object->line->x[whichone], object->line->y[whichone],
+                     &w_current->last_x, &w_current->last_y );
+      WORLDtoSCREEN( toplevel, object->line->x[!whichone], object->line->y[!whichone],
+                     &w_current->start_x, &w_current->start_y );
+
+      o_pin_erase(w_current, object);
+      gdk_gc_set_foreground(w_current->xor_gc,
+                            x_get_darkcolor(w_current->select_color) );
+      gdk_draw_line(w_current->window, w_current->xor_gc,
+                    w_current->start_x, w_current->start_y,
+                    w_current->last_x, w_current->last_y);
+      o_line_erase_grips(w_current, object);
+      return(TRUE);
+
+    case(OBJ_BUS):
+      w_current->last_drawb_mode = -1;
+      WORLDtoSCREEN( toplevel, object->line->x[whichone], object->line->y[whichone],
+                     &w_current->last_x, &w_current->last_y );
+      WORLDtoSCREEN( toplevel, object->line->x[!whichone], object->line->y[!whichone],
+                     &w_current->start_x, &w_current->start_y );
+
+      o_bus_erase(w_current, object);
+      gdk_gc_set_foreground(w_current->xor_gc,
+                            x_get_darkcolor(w_current->select_color) );
+      gdk_draw_line(w_current->window, w_current->xor_gc,
+                    w_current->start_x, w_current->start_y,
+                    w_current->last_x, w_current->last_y);
+      o_line_erase_grips(w_current, object);
+
+      gdk_gc_set_foreground(w_current->gc,
+                            x_get_color(toplevel->background_color));
+      return(TRUE);
+
+    default:
+      /* object type unknown : error condition */
+      return(FALSE);
   }
   return(FALSE);
 }
@@ -882,13 +884,7 @@ void o_grips_motion(GSCHEM_TOPLEVEL *w_current, int x, int y)
   TOPLEVEL *toplevel = w_current->toplevel;
 
   g_assert( w_current->inside_action != 0 );
-
-  /* no object changing */
-  if (object_changing == NULL) {
-    /* stop grip process */
-    o_redraw(w_current, toplevel->page_current->object_head, TRUE);
-    return;
-  }
+  g_return_if_fail( object_changing != NULL );
 
   switch(object_changing->type) {
     case(OBJ_ARC):

commit 49bce50cbcfe83e7b53c4ffe76e4ca1edb333c38
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Dec 15 11:37:51 2007 +0000

    Remove un-needed box size computation in o_select_box_start()

diff --git a/gschem/src/o_select.c b/gschem/src/o_select.c
index 422c31a..6fe46a3 100644
--- a/gschem/src/o_select.c
+++ b/gschem/src/o_select.c
@@ -250,8 +250,8 @@ void o_select_box_start(GSCHEM_TOPLEVEL *w_current, int x, int y)
   w_current->last_x = w_current->start_x; 
   w_current->last_y = w_current->start_y; 
 
-  box_width = abs(w_current->last_x - w_current->start_x);
-  box_height = abs(w_current->last_y - w_current->start_y);
+  box_width = 0;
+  box_height = 0;
 
   gdk_gc_set_foreground(w_current->xor_gc,
                         x_get_darkcolor(w_current->select_color));

commit ec2269ef825369b75ab932f5395a2f64dae72847
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Dec 15 11:19:48 2007 +0000

    Fix stroke trail to be visible on light background color scheme

diff --git a/gschem/lib/gschem-lightbg b/gschem/lib/gschem-lightbg
index 6043cc4..1f17a31 100644
--- a/gschem/lib/gschem-lightbg
+++ b/gschem/lib/gschem-lightbg
@@ -171,7 +171,7 @@
 ; Basically this color specifies what the mouse droppings color
 ; DO NOT change the value of the index (first number)
 ;
-(stroke-color 14 "grey90" "grey90" "null" -1 -1 -1)	     ; light background
+(stroke-color 14 "purple" "purple" "null" -1 -1 -1)	     ; light background
 
 ; lock-color index color_name outline_color ps_color_string 
 ;            int_red int_green int_blue 

commit a02bc0b501b7acbdf419ad306b46ec6a9522b61c
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Dec 15 11:12:47 2007 +0000

    Erase stroke trails after an un-successful stroke recognition
    
    Previous behaviour was only to erase stroke trails after a
    successful match.

diff --git a/gschem/src/x_event.c b/gschem/src/x_event.c
index 5f35bd4..c0d1558 100644
--- a/gschem/src/x_event.c
+++ b/gschem/src/x_event.c
@@ -882,7 +882,9 @@ gint x_event_button_released(GtkWidget *widget, GdkEventButton *event,
       if (stroke_info_mode) {
         printf ("Sequence=\"%s\"\n",sequence);
       }
-	
+
+      x_stroke_erase_all(w_current);
+
 				/* new way written by Stefan Petersen */ 
 				/* much better */
       if (x_stroke_search_execute(sequence)) {
@@ -890,7 +892,6 @@ gint x_event_button_released(GtkWidget *widget, GdkEventButton *event,
         if (stroke_info_mode) {
           printf("Sequence understood\n");
         }
-        x_stroke_erase_all(w_current);
       }
       break;
 #endif




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