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

gEDA-cvs: CVS update: g_keys.c



  User: ahvezda 
  Date: 06/09/08 22:56:42

  Modified:    .        g_keys.c x_event.c x_window.c
  Log:
  Applied another patch for Bug#1553544: "New pages inadvertantly created when adding nets in gschem" from Peter Clifton (much better and cleaner)
  
  
  
  
  Revision  Changes    Path
  1.4       +9 -6      eda/geda/gaf/gschem/src/g_keys.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: g_keys.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/g_keys.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- g_keys.c	6 Aug 2006 19:23:19 -0000	1.3
  +++ g_keys.c	9 Sep 2006 02:56:42 -0000	1.4
  @@ -57,26 +57,27 @@
    *
    */
   /* for now this only supports single chars, not shift/alt/ctrl etc... */
  -void g_keys_execute(int state, int keyval)
  +int g_keys_execute(int state, int keyval)
   {
     char *guile_string = NULL;
     char *modifier = NULL;
  +  SCM scm_retval;
   
     if (keyval == 0) {
  -    return;
  +    return 0;
     }
   
     /* don't pass the raw modifier key presses to the guile code */
     if (strstr(gdk_keyval_name(keyval), "Alt")) {
  -    return;
  +    return 0;
     }
   
     if (strstr(gdk_keyval_name(keyval), "Shift")) {
  -    return;
  +    return 0;
     }
   
     if (strstr(gdk_keyval_name(keyval), "Control")) {
  -    return;
  +    return 0;
     }
   
     if (state & GDK_SHIFT_MASK) {
  @@ -95,7 +96,7 @@
   #if DEBUG 
     printf("_%s_\n", guile_string);
   #endif
  -  scm_c_eval_string (guile_string);
  +  scm_retval = scm_c_eval_string (guile_string);
     g_free(guile_string);
     g_free(modifier);
   
  @@ -103,6 +104,8 @@
     gh_eval_str("(display (reverse last-command-sequence))");
     printf("\n");
   #endif
  +
  +  return (SCM_FALSEP (scm_retval)) ? 0 : 1;
   }
   
   /*! \brief
  
  
  
  1.39      +7 -3      eda/geda/gaf/gschem/src/x_event.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_event.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_event.c,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -b -r1.38 -r1.39
  --- x_event.c	6 Aug 2006 16:45:29 -0000	1.38
  +++ x_event.c	9 Sep 2006 02:56:42 -0000	1.39
  @@ -1512,9 +1512,13 @@
    *  \par Function Description
    *
    */
  -gint x_event_key_press (GtkWidget *widget, GdkEventKey *event,
  +gboolean x_event_key_press (GtkWidget *widget, GdkEventKey *event,
   			TOPLEVEL *w_current)
   {
  +  int retval;
  +  
  +  retval = FALSE;
  +  
     exit_if_null(w_current);
     global_window_current = w_current;
   
  @@ -1524,10 +1528,10 @@
   #if DEBUG
       printf("x_event_key_pressed: Pressed key %i.\n", event->keyval);
   #endif
  -    g_keys_execute(event->state, event->keyval);
  +    retval = g_keys_execute(event->state, event->keyval) ? TRUE : FALSE;
     }
   
  -  return(0);
  +  return retval;
   }
   
   
  
  
  
  1.40      +1 -1      eda/geda/gaf/gschem/src/x_window.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_window.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_window.c,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -b -r1.39 -r1.40
  --- x_window.c	7 Sep 2006 01:40:24 -0000	1.39
  +++ x_window.c	9 Sep 2006 02:56:42 -0000	1.40
  @@ -359,11 +359,11 @@
       { "button_release_event", G_CALLBACK(x_event_button_released) },
       { "motion_notify_event",  G_CALLBACK(x_event_motion)          },
       { "configure_event",      G_CALLBACK(x_event_configure)       },
  +    { "key_press_event",      G_CALLBACK(x_event_key_press)       },
       { NULL,                   NULL                                } };
     struct event_reg_t main_window_events[] = {
       { "enter_notify_event",   G_CALLBACK(x_event_enter)           },
       { "scroll_event",         G_CALLBACK(x_event_scroll)          },
  -    { "key_press_event",      G_CALLBACK(x_event_key_press)       },
       { NULL,                   NULL                                } };
     struct event_reg_t *tmp;
   
  
  
  


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