r14999 - gnucash/branches/swig-redo/src/app-utils - Remove the guile portions of gnucash's component manager.

Chris Shoemaker chris at cvs.gnucash.org
Tue Oct 10 20:00:48 EDT 2006


Author: chris
Date: 2006-10-10 20:00:47 -0400 (Tue, 10 Oct 2006)
New Revision: 14999
Trac: http://svn.gnucash.org/trac/changeset/14999

Modified:
   gnucash/branches/swig-redo/src/app-utils/gnc-component-manager.c
   gnucash/branches/swig-redo/src/app-utils/gnc-component-manager.h
   gnucash/branches/swig-redo/src/app-utils/gnc-ui-util.c
   gnucash/branches/swig-redo/src/app-utils/test/Makefile.am
Log:
Remove the guile portions of gnucash's component manager.


Modified: gnucash/branches/swig-redo/src/app-utils/gnc-component-manager.c
===================================================================
--- gnucash/branches/swig-redo/src/app-utils/gnc-component-manager.c	2006-10-10 23:59:29 UTC (rev 14998)
+++ gnucash/branches/swig-redo/src/app-utils/gnc-component-manager.c	2006-10-11 00:00:47 UTC (rev 14999)
@@ -51,9 +51,6 @@
   GNCComponentCloseHandler close_handler;
   gpointer user_data;
 
-  SCM refresh_handler_scm;
-  SCM close_handler_scm;
-
   ComponentEventInfo watch_info;
 
   char *component_class;
@@ -404,9 +401,6 @@
   /* found one, add the handler */
   ci = g_new0 (ComponentInfo, 1);
 
-  ci->refresh_handler_scm = SCM_BOOL_F;
-  ci->close_handler_scm = SCM_BOOL_F;
-
   ci->watch_info.event_masks = g_hash_table_new (g_str_hash, g_str_equal);
   ci->watch_info.entity_events = guid_hash_table_new ();
 
@@ -453,32 +447,6 @@
   return ci->component_id;
 }
 
-gint
-gnc_register_gui_component_scm (const char * component_class,
-                                SCM refresh_handler,
-                                SCM close_handler)
-{
-  ComponentInfo *ci;
-
-  /* sanity check */
-  if (!component_class)
-  {
-    PERR ("no class specified");
-    return NO_COMPONENT;
-  }
-
-  ci = gnc_register_gui_component_internal (component_class);
-  g_return_val_if_fail (ci, NO_COMPONENT);
-
-  ci->refresh_handler_scm = refresh_handler;
-  scm_gc_protect_object (refresh_handler);
-
-  ci->close_handler_scm = close_handler;
-  scm_gc_protect_object (close_handler);
-
-  return ci->component_id;
-}
-
 void
 gnc_gui_component_watch_entity (gint component_id,
                                 const GUID *entity,
@@ -579,14 +547,6 @@
   g_free (ci->component_class);
   ci->component_class = NULL;
 
-  if (ci->refresh_handler_scm != SCM_BOOL_F)
-    scm_gc_unprotect_object (ci->refresh_handler_scm);
-  ci->refresh_handler_scm = SCM_BOOL_F;
-
-  if (ci->close_handler_scm != SCM_BOOL_F)
-    scm_gc_unprotect_object (ci->close_handler_scm);
-  ci->close_handler_scm = SCM_BOOL_F;
-
   g_free (ci);
 
 #if CM_DEBUG
@@ -745,8 +705,7 @@
     if (!ci)
       continue;
 
-    if (!ci->refresh_handler &&
-        !SCM_PROCEDUREP (ci->refresh_handler_scm)) {
+    if (!ci->refresh_handler) {
 #if CM_DEBUG
       fprintf (stderr, "no handlers for %s:%d\n", ci->component_class, ci->component_id);
 #endif
@@ -760,11 +719,6 @@
 	fprintf (stderr, "calling %s:%d C handler\n", ci->component_class, ci->component_id);
 #endif
         ci->refresh_handler (NULL, ci->user_data);
-      } else {
-#if CM_DEBUG
-	fprintf (stderr, "calling %s:%d SCM handler\n", ci->component_class, ci->component_id);
-#endif
-        scm_call_0 (ci->refresh_handler_scm);
       }
     }
     else if (changes_match (&ci->watch_info, &changes_backup))
@@ -774,11 +728,6 @@
 	fprintf (stderr, "calling %s:%d C handler\n", ci->component_class, ci->component_id);
 #endif
         ci->refresh_handler (changes_backup.entity_events, ci->user_data);
-      } else {
-#if CM_DEBUG
-	fprintf (stderr, "calling %s:%d SCM handler\n", ci->component_class, ci->component_id);
-#endif
-        scm_call_0 (ci->refresh_handler_scm);
       }
     }
     else
@@ -827,14 +776,11 @@
     return;
   }
 
-  if (!ci->close_handler &&
-      !SCM_PROCEDUREP (ci->close_handler_scm))
+  if (!ci->close_handler)
     return;
 
   if (ci->close_handler)
     ci->close_handler (ci->user_data);
-  else
-    scm_call_0 (ci->close_handler_scm);
 }
 
 void

Modified: gnucash/branches/swig-redo/src/app-utils/gnc-component-manager.h
===================================================================
--- gnucash/branches/swig-redo/src/app-utils/gnc-component-manager.h	2006-10-10 23:59:29 UTC (rev 14998)
+++ gnucash/branches/swig-redo/src/app-utils/gnc-component-manager.h	2006-10-11 00:00:47 UTC (rev 14999)
@@ -21,8 +21,6 @@
 #define GNC_COMPONENT_MANAGER_H
 
 #include <glib.h>
-#include <libguile.h>
-#include "guile-mappings.h"
 
 #include "GNCId.h"
 #include "qof.h"
@@ -154,24 +152,6 @@
                                  GNCComponentCloseHandler close_handler,
                                  gpointer user_data);
 
-/* gnc_register_gui_component_scm
- *   Register a GUI component with the manager with scheme callbacks.
- *
- * component_class: same as gnc_register_gui_component
- * refresh_cb:      refresh handler, may be SCM_BOOL_F, indicating
- *                  no handler. the handler is invoked with no
- *                  arguments
- * close_cb:        close handler, may be SCM_BOOL_F, invoked
- *                  with no arguments
- *
- * Notes:           The same notes apply as in gnc_register_gui_component.
- *
- * Return:          id of component, or NO_COMPONENT if error
- */
-gint gnc_register_gui_component_scm (const char * component_class,
-                                     SCM refresh_handler,
-                                     SCM close_handler);
-
 /* gnc_gui_component_set_session
  *   Set the associated session of this component
  *

Modified: gnucash/branches/swig-redo/src/app-utils/gnc-ui-util.c
===================================================================
--- gnucash/branches/swig-redo/src/app-utils/gnc-ui-util.c	2006-10-10 23:59:29 UTC (rev 14998)
+++ gnucash/branches/swig-redo/src/app-utils/gnc-ui-util.c	2006-10-11 00:00:47 UTC (rev 14999)
@@ -24,6 +24,7 @@
 
 #include <glib.h>
 #include <glib/gi18n.h>
+#include <libguile.h>
 #include <ctype.h>
 #include <errno.h>
 #include <limits.h>

Modified: gnucash/branches/swig-redo/src/app-utils/test/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/app-utils/test/Makefile.am	2006-10-10 23:59:29 UTC (rev 14998)
+++ gnucash/branches/swig-redo/src/app-utils/test/Makefile.am	2006-10-11 00:00:47 UTC (rev 14999)
@@ -1,7 +1,6 @@
 TESTS = \
   test-link-module \
   test-load-module \
-  test-component-manager \
   test-exp-parser \
   test-scm-query-string \
   test-print-parse-amount
@@ -51,8 +50,7 @@
   test-print-queries
 
 EXTRA_DIST = \
-  test-load-module \
-  test-component-manager
+  test-load-module
 
 AM_CFLAGS = \
   -I${top_srcdir}/src \



More information about the gnucash-changes mailing list