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

gEDA-cvs: CVS update: g_funcs.nw



  User: danmc   
  Date: 06/04/25 18:26:56

  Modified:    .        g_funcs.nw g_register.nw x_dialog.nw
  Log:
  - add gschem-log, gschem-msg, gschem-confirm scheme functions for logging
  
  to the log, displaying a message in a dialog box and executing a confirm
  
  dialog box from scheme.  
  
  
  
  - make the pcb mode take advantage of these new features.
  
  
  
  
  Revision  Changes    Path
  1.10      +69 -0     eda/geda/devel/gschem/noweb/g_funcs.nw
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: g_funcs.nw
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/gschem/noweb/g_funcs.nw,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- g_funcs.nw	24 Feb 2005 22:11:34 -0000	1.9
  +++ g_funcs.nw	25 Apr 2006 22:26:56 -0000	1.10
  @@ -1,4 +1,5 @@
   @c -*- mode: Noweb; noweb-doc-mode: texinfo-mode; noweb-code-mode: c-mode -*-
  +@c $Id: g_funcs.nw,v 1.10 2006/04/25 22:26:56 danmc Exp $
   
   @node File g_funcs.c,,,Top
   @chapter File @file{g_funcs.c}
  @@ -14,6 +15,9 @@
   <<g_funcs.c : g_funcs_print()>>
   <<g_funcs.c : g_funcs_image()>>
   <<g_funcs.c : g_funcs_exit()>>
  +<<g_funcs.c : g_funcs_log()>>
  +<<g_funcs.c : g_funcs_msg()>>
  +<<g_funcs.c : g_funcs_confirm()>>
   <<g_funcs.c : g_funcs_use_rc_values()>>
   <<g_funcs.c : g_funcs_key_name()>>
   <<g_funcs.c : g_funcs_key_value()>>
  @@ -138,6 +142,71 @@
   @ %def g_funcs_exit
   
   
  +@section Function @code{g_funcs_log()}
  +
  +@defun g_funcs_log message
  +@end defun
  +
  +<<g_funcs.c : g_funcs_log()>>=
  +SCM g_funcs_log(SCM msg)
  +{
  +
  +  SCM_ASSERT (SCM_NIMP (msg) && SCM_STRINGP (msg), msg,
  +              SCM_ARG1, "gschem-log");
  +
  +  s_log_message (SCM_STRING_CHARS (msg));
  +
  +  return SCM_BOOL_T;
  +}
  +
  +
  +@ %def g_funcs_log
  +
  +@section Function @code{g_funcs_msg()}
  +
  +@defun g_funcs_msg message
  +@end defun
  +
  +<<g_funcs.c : g_funcs_msg()>>=
  +SCM g_funcs_msg(SCM msg)
  +{
  +
  +  SCM_ASSERT (SCM_NIMP (msg) && SCM_STRINGP (msg), msg,
  +              SCM_ARG1, "gschem-msg");
  +
  +  generic_msg_dialog (SCM_STRING_CHARS (msg));
  +
  +  return SCM_BOOL_T;
  +}
  +
  +
  +@ %def g_funcs_msg
  +
  +@section Function @code{g_funcs_confirm()}
  +
  +@defun g_funcs_confirm message
  +@end defun
  +
  +<<g_funcs.c : g_funcs_confirm()>>=
  +SCM g_funcs_confirm(SCM msg)
  +{
  +  int r;
  +
  +  SCM_ASSERT (SCM_NIMP (msg) && SCM_STRINGP (msg), msg,
  +	      SCM_ARG1, "gschem-msg");
  +  
  +  r = generic_confirm_dialog (SCM_STRING_CHARS (msg));
  +
  +  if (r)
  +    return SCM_BOOL_T;
  +  else
  +    return SCM_BOOL_F;
  +}
  +
  +
  +@ %def g_funcs_confirm
  +
  +
   @section Function @code{g_funcs_use_rc_values()}
   
   @defun g_funcs_use_rc_values 
  
  
  
  1.31      +6 -0      eda/geda/devel/gschem/noweb/g_register.nw
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: g_register.nw
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/gschem/noweb/g_register.nw,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -b -r1.30 -r1.31
  --- g_register.nw	23 Apr 2006 03:48:27 -0000	1.30
  +++ g_register.nw	25 Apr 2006 22:26:56 -0000	1.31
  @@ -1,4 +1,7 @@
   @c -*- mode: Noweb; noweb-doc-mode: texinfo-mode; noweb-code-mode: c-mode -*-
  +@c 
  +@c $Id: g_register.nw,v 1.31 2006/04/25 22:26:56 danmc Exp $
  +@c
   
   @node File g_register.c,,,Top
   @chapter File @file{g_register.c}
  @@ -184,6 +187,9 @@
     { "gschem-key-done",           0, 0, 0, g_funcs_key_done },
     { "gschem-use-rc-values",      0, 0, 0, g_funcs_use_rc_values },
     { "gschem-exit",               0, 0, 0, g_funcs_exit },
  +  { "gschem-log",                1, 0, 0, g_funcs_log },
  +  { "gschem-msg",                1, 0, 0, g_funcs_msg },
  +  { "gschem-confirm",            1, 0, 0, g_funcs_confirm },
     /* keymapping callbacks */
     { "file-new-window",           0, 0, 0, g_keys_file_new_window },
     { "file-new",                  0, 0, 0, g_keys_file_new },
  
  
  
  1.40      +69 -0     eda/geda/devel/gschem/noweb/x_dialog.nw
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_dialog.nw
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/gschem/noweb/x_dialog.nw,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -b -r1.39 -r1.40
  --- x_dialog.nw	9 Apr 2006 08:59:53 -0000	1.39
  +++ x_dialog.nw	25 Apr 2006 22:26:56 -0000	1.40
  @@ -132,6 +132,14 @@
   <<x_dialog.c : x_dialog_raise_all()>>
   /*********** End of misc support functions for dialog boxes *******/
   
  +/***************** Start of generic message dialog box ********************/
  +<<x_dialog.c : generic_msg_dialog()>>
  +/***************** End of generic message dialog box *********************/
  +
  +/***************** Start of generic confirm dialog box ********************/
  +<<x_dialog.c : generic_confirm_dialog()>>
  +/***************** End of generic confirm dialog box *********************/
  +
   /*********** Start of generic text input dialog box *******/
   <<x_dialog.c : generic_text_input_ok()>>
   <<x_dialog.c : generic_text_input_dialog()>>
  @@ -4044,6 +4052,67 @@
   @ %def x_dialog_raise_all
   
   
  +@section Function @code{generic_msg_dialog()}
  +
  +@defun generic_msg_dialog const char *
  +@end defun
  +
  +<<x_dialog.c : generic_msg_dialog()>>=
  +void
  +generic_msg_dialog (const char *msg)
  +{
  +  GtkWidget *dialog;
  +  
  +  dialog = gtk_message_dialog_new (NULL,
  +
  +
  +                                   GTK_DIALOG_MODAL
  +                                   | GTK_DIALOG_DESTROY_WITH_PARENT,
  +                                   GTK_MESSAGE_INFO,
  +                                   GTK_BUTTONS_OK,
  +                                   msg);
  +
  +  gtk_dialog_run (GTK_DIALOG (dialog));
  +  gtk_widget_destroy (dialog);
  +
  +}
  +
  +
  +@ %def generic_msg_dialog
  +
  +@defun generic_confirm_dialog const char *
  +@end defun
  +
  +<<x_dialog.c : generic_confirm_dialog()>>=
  +int
  +generic_confirm_dialog (const char *msg)
  +{
  +  GtkWidget *dialog;
  +  gint r;
  +
  +  dialog = gtk_message_dialog_new (NULL,
  +
  +
  +                                   GTK_DIALOG_MODAL
  +                                   | GTK_DIALOG_DESTROY_WITH_PARENT,
  +                                   GTK_MESSAGE_INFO,
  +                                   GTK_BUTTONS_OK_CANCEL,
  +                                   msg);
  +
  +  r = gtk_dialog_run (GTK_DIALOG (dialog));
  +  gtk_widget_destroy (dialog);
  +
  +  if (r ==  GTK_RESPONSE_OK)
  +    return 1;
  +  else 
  +    return 0;
  +}
  +
  +
  +@ %def generic_confirm_dialog
  +
  +
  +
   @section Function @code{ generic_text_input_ok()}
   
   @defun generic_text_input_ok w_current