r14967 - gnucash/branches/swig-redo/src/app-utils - Convert runtime code from gwrap to swig api.

Chris Shoemaker chris at cvs.gnucash.org
Mon Oct 9 19:59:41 EDT 2006


Author: chris
Date: 2006-10-09 19:59:40 -0400 (Mon, 09 Oct 2006)
New Revision: 14967
Trac: http://svn.gnucash.org/trac/changeset/14967

Modified:
   gnucash/branches/swig-redo/src/app-utils/app-utils.scm
   gnucash/branches/swig-redo/src/app-utils/option-util.c
   gnucash/branches/swig-redo/src/app-utils/option-util.h
Log:
Convert runtime code from gwrap to swig api.
Also, publicize gnc_option_db_register_option() and load the swig module
instead of the gwrap module from guile.



Modified: gnucash/branches/swig-redo/src/app-utils/app-utils.scm
===================================================================
--- gnucash/branches/swig-redo/src/app-utils/app-utils.scm	2006-10-09 23:59:11 UTC (rev 14966)
+++ gnucash/branches/swig-redo/src/app-utils/app-utils.scm	2006-10-09 23:59:40 UTC (rev 14967)
@@ -1,6 +1,6 @@
 
 (define-module (gnucash app-utils))
-(use-modules (g-wrapped gw-app-utils))
+(use-modules (sw_app_utils))
 (use-modules (srfi srfi-1))
 (use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing.
 (use-modules (gnucash gnc-module))
@@ -225,13 +225,8 @@
 (export gnc:reldate-initialize)
 
 ;; hooks 
-(re-export gnc:hook-define)
 (export gnc:hook-run-danglers)		;; from hooks.scm
 (re-export gnc:hook-add-dangler)
-(re-export gnc:hook-remove-dangler)
-(re-export gnc:*book-opened-hook*)
-(re-export gnc:*new-book-hook*)
-(re-export gnc:*book-closed-hook*)
 (re-export gnc:*report-hook*)
 
 ;; simple-obj

Modified: gnucash/branches/swig-redo/src/app-utils/option-util.c
===================================================================
--- gnucash/branches/swig-redo/src/app-utils/option-util.c	2006-10-09 23:59:11 UTC (rev 14966)
+++ gnucash/branches/swig-redo/src/app-utils/option-util.c	2006-10-09 23:59:40 UTC (rev 14967)
@@ -35,6 +35,7 @@
 #include "guile-mappings.h"
 
 #include <g-wrap-wct.h>
+#include "swig-runtime.h"
 
 /* TODO: 
 
@@ -444,7 +445,6 @@
                                        const char *name)
 {
   static SCM void_type = SCM_UNDEFINED;
-  static SCM callback_type = SCM_UNDEFINED;
 
   SCM register_proc;
   SCM arg;
@@ -466,12 +466,6 @@
     /* don't really need this - types are bound globally anyway. */
     if(void_type != SCM_UNDEFINED) scm_gc_protect_object(void_type);
   }
-  if(callback_type == SCM_UNDEFINED) {
-    callback_type = scm_c_eval_string("<gnc:OptionChangeCallback>");
-    /* don't really need this - types are bound globally anyway. */
-    if(callback_type != SCM_UNDEFINED)
-      scm_gc_protect_object(callback_type);
-  }
 
   /* Now build the args list for apply */
   args = SCM_EOL;
@@ -484,7 +478,8 @@
   args = scm_cons(arg, args);
 
   /* next the callback */
-  arg = gw_wcp_assimilate_ptr(callback, callback_type);
+  arg = SWIG_NewPointerObj(
+      callback, SWIG_TypeQuery("GNCOptionChangeCallback"), 0);
   args = scm_cons(arg, args);
 
   /* next the name */
@@ -1451,7 +1446,7 @@
  * Returns: nothing                                                 *
 \********************************************************************/
 void
-gncp_option_db_register_option(GNCOptionDBHandle handle, SCM guile_option)
+gnc_option_db_register_option(GNCOptionDBHandle handle, SCM guile_option)
 {
   GNCOptionDB *odb;
   GNCOption *option;
@@ -2816,3 +2811,4 @@
 
   return value;
 }
+

Modified: gnucash/branches/swig-redo/src/app-utils/option-util.h
===================================================================
--- gnucash/branches/swig-redo/src/app-utils/option-util.h	2006-10-09 23:59:11 UTC (rev 14966)
+++ gnucash/branches/swig-redo/src/app-utils/option-util.h	2006-10-09 23:59:40 UTC (rev 14967)
@@ -260,10 +260,10 @@
 				    gboolean years, const char *custom);
 
 
+void gnc_option_db_register_option(GNCOptionDBHandle handle,
+                                   SCM guile_option);
+
 /* private */
-void gncp_option_db_register_option(GNCOptionDBHandle handle,
-                                    SCM guile_option);
-
 void gncp_option_invoke_callback(GNCOptionChangeCallback callback,
                                  gpointer data);
 



More information about the gnucash-changes mailing list