r14982 - gnucash/branches/swig-redo/src - Convert runtime code related to core engine types from gwrap to swig

Chris Shoemaker chris at cvs.gnucash.org
Mon Oct 9 20:12:08 EDT 2006


Author: chris
Date: 2006-10-09 20:12:06 -0400 (Mon, 09 Oct 2006)
New Revision: 14982
Trac: http://svn.gnucash.org/trac/changeset/14982

Modified:
   gnucash/branches/swig-redo/src/app-utils/app-utils.i
   gnucash/branches/swig-redo/src/app-utils/guile-util.c
   gnucash/branches/swig-redo/src/business/business-core/gncBusGuile.c
   gnucash/branches/swig-redo/src/business/business-gnome/dialog-invoice.c
   gnucash/branches/swig-redo/src/engine/glib-helpers.c
   gnucash/branches/swig-redo/src/engine/glib-helpers.h
   gnucash/branches/swig-redo/src/gnome-utils/dialog-options.c
   gnucash/branches/swig-redo/src/gnome/gnc-plugin-page-register.c
   gnucash/branches/swig-redo/src/import-export/qif-import/druid-qif-import.c
Log:
Convert runtime code related to core engine types from gwrap to swig
api.  Remove some temporary swig<->gwrap typemaps that aren't needed
anymore because more types have been swigified. Remove some unneeded
functions.



Modified: gnucash/branches/swig-redo/src/app-utils/app-utils.i
===================================================================
--- gnucash/branches/swig-redo/src/app-utils/app-utils.i	2006-10-10 00:11:32 UTC (rev 14981)
+++ gnucash/branches/swig-redo/src/app-utils/app-utils.i	2006-10-10 00:12:06 UTC (rev 14982)
@@ -12,10 +12,11 @@
 #include <gnc-session.h>
 #include <gnc-component-manager.h>
 
-#include <g-wrap-wct.h> //Temporary. Adds no link dep?!?
 #include "engine-helpers.h"
 %}
 
+//%import "engine.i"
+
 %typemap(in) GNCPrintAmountInfo "$1 = gnc_scm2printinfo($input);"
 %typemap(out) GNCPrintAmountInfo "$result = gnc_printinfo2scm($1);"
 
@@ -35,14 +36,6 @@
 
 %typemap(in) gnc_numeric "$1 = gnc_scm_to_numeric($input);"
 %typemap(out) gnc_numeric "$result = gnc_numeric_to_scm($1);"
-%typemap(in) Account * "$1 = (Account *)gw_wcp_get_ptr($input);"
-%typemap(out) Account * {
-  $result = gw_wcp_assimilate_ptr($1, scm_c_eval_string("<gnc:Account*>"));
-}
-%typemap(in) AccountGroup * "$1 = (AccountGroup *)gw_wcp_get_ptr($input);"
-%typemap(out) AccountGroup * {
-  $result = gw_wcp_assimilate_ptr($1, scm_c_eval_string("<gnc:AccountGroup*>"));
-}
 
 // End of temporary typemaps.
 

Modified: gnucash/branches/swig-redo/src/app-utils/guile-util.c
===================================================================
--- gnucash/branches/swig-redo/src/app-utils/guile-util.c	2006-10-10 00:11:32 UTC (rev 14981)
+++ gnucash/branches/swig-redo/src/app-utils/guile-util.c	2006-10-10 00:12:06 UTC (rev 14982)
@@ -23,7 +23,7 @@
 #include <glib.h>
 #include <glib/gi18n.h>
 #include <string.h>
-#include <g-wrap-wct.h>
+#include "swig-runtime.h"
 #include <libguile.h>
 
 #include "qof.h"
@@ -367,7 +367,7 @@
 SCM
 gnc_copy_split(Split *split, gboolean use_cut_semantics)
 {
-  static SCM split_type = SCM_UNDEFINED;
+  static swig_type_info *split_type = NULL;
   SCM func;
   SCM arg;
 
@@ -378,13 +378,10 @@
   if (!SCM_PROCEDUREP(func))
     return SCM_UNDEFINED;
 
-  if(split_type == SCM_UNDEFINED) {
-    split_type = scm_c_eval_string("<gnc:Split*>");
-    /* don't really need this - types are bound globally anyway. */
-    if(split_type != SCM_UNDEFINED) scm_gc_protect_object(split_type);
-  }
+  if (!split_type)
+      split_type = SWIG_TypeQuery("_p_Split");
 
-  arg = gw_wcp_assimilate_ptr(split, split_type);
+  arg = SWIG_NewPointerObj(split, split_type, 0);
 
   return scm_call_2(func, arg, SCM_BOOL(use_cut_semantics));
 }
@@ -402,7 +399,7 @@
 gnc_copy_split_scm_onto_split(SCM split_scm, Split *split,
                               QofBook * book)
 {
-  static SCM split_type = SCM_UNDEFINED;
+  static swig_type_info *split_type = NULL;
   SCM result;
   SCM func;
   SCM arg;
@@ -427,13 +424,10 @@
   if (!SCM_PROCEDUREP(func))
     return;
 
-  if(split_type == SCM_UNDEFINED) {
-    split_type = scm_c_eval_string("<gnc:Split*>");
-    /* don't really need this - types are bound globally anyway. */
-    if(split_type != SCM_UNDEFINED) scm_gc_protect_object(split_type);
-  }
+  if (!split_type)
+      split_type = SWIG_TypeQuery("_p_Split");
 
-  arg = gw_wcp_assimilate_ptr(split, split_type);
+  arg = SWIG_NewPointerObj(split, split_type, 0);
 
   scm_call_3(func, split_scm, arg, gnc_book_to_scm (book));
 }
@@ -736,7 +730,7 @@
 SCM
 gnc_copy_trans(Transaction *trans, gboolean use_cut_semantics)
 {
-  static SCM trans_type = SCM_UNDEFINED;
+  static swig_type_info *trans_type = NULL;
   SCM func;
   SCM arg;
 
@@ -747,13 +741,10 @@
   if (!SCM_PROCEDUREP(func))
     return SCM_UNDEFINED;
 
-  if(trans_type == SCM_UNDEFINED) {
-    trans_type = scm_c_eval_string("<gnc:Transaction*>");
-    /* don't really need this - types are bound globally anyway. */
-    if(trans_type != SCM_UNDEFINED) scm_gc_protect_object(trans_type);
-  }
+  if (!trans_type)
+      trans_type = SWIG_TypeQuery("_p_Transaction");
 
-  arg = gw_wcp_assimilate_ptr(trans, trans_type);
+  arg = SWIG_NewPointerObj(trans, trans_type, 0);
 
   return scm_call_2(func, arg, SCM_BOOL(use_cut_semantics));
 }
@@ -798,7 +789,7 @@
                                             gboolean do_commit,
                                             QofBook *book)
 {
-  static SCM trans_type = SCM_UNDEFINED;
+  static swig_type_info *trans_type = NULL;
   SCM result;
   SCM func;
   SCM arg;
@@ -823,13 +814,10 @@
   if (!SCM_PROCEDUREP(func))
     return;
 
-  if(trans_type == SCM_UNDEFINED) {
-    trans_type = scm_c_eval_string("<gnc:Transaction*>");
-    /* don't really need this - types are bound globally anyway. */
-    if(trans_type != SCM_UNDEFINED) scm_gc_protect_object(trans_type);
-  }
+  if (!trans_type)
+      trans_type = SWIG_TypeQuery("_p_Transaction");
 
-  arg = gw_wcp_assimilate_ptr(trans, trans_type);
+  arg = SWIG_NewPointerObj(trans, trans_type, 0);
 
   if ((guid_1 == NULL) || (guid_2 == NULL))
   {

Modified: gnucash/branches/swig-redo/src/business/business-core/gncBusGuile.c
===================================================================
--- gnucash/branches/swig-redo/src/business/business-core/gncBusGuile.c	2006-10-10 00:11:32 UTC (rev 14981)
+++ gnucash/branches/swig-redo/src/business/business-core/gncBusGuile.c	2006-10-10 00:12:06 UTC (rev 14982)
@@ -25,28 +25,26 @@
 
 #include "gncBusGuile.h"
 #include "engine-helpers.h"
-#include <g-wrap-wct.h>
+#include "swig-runtime.h"
+#define FUNC_NAME __FUNCTION__
 
-static SCM
+static swig_type_info *
 get_acct_type ()
 {
-  static SCM account_type = SCM_UNDEFINED;
+  static swig_type_info * account_type = NULL;
 
-  if(account_type == SCM_UNDEFINED) {
-    account_type = scm_c_eval_string("<gnc:Account*>");
-    /* don't really need this - types are bound globally anyway. */
-    if(account_type != SCM_UNDEFINED) scm_gc_protect_object(account_type);
-  }
+  if (!account_type)
+      account_type = SWIG_TypeQuery("_p_Account");
 
   return account_type;
 }
 
 int gnc_account_value_pointer_p (SCM arg)
 {
-  SCM account_type = get_acct_type();
+  swig_type_info * account_type = get_acct_type();
 
   return (SCM_CONSP (arg) &&
-	  gw_wcp_is_of_type_p(account_type, SCM_CAR (arg)) &&
+	  SWIG_IsPointerOfType(SCM_CAR (arg), account_type) &&
 	  gnc_numeric_p (SCM_CDR (arg)));
 }
 
@@ -55,15 +53,15 @@
   GncAccountValue *res;
   Account *acc = NULL;
   gnc_numeric value;
-  SCM account_type = get_acct_type();
+  swig_type_info * account_type = get_acct_type();
   SCM val;
 
   /* Get the account */
   val = SCM_CAR (valuearg);
-  if (!gw_wcp_is_of_type_p (account_type, val))
+  if (!SWIG_IsPointerOfType (val, account_type))
     return NULL;
 
-  acc = gw_wcp_get_ptr (val);
+  acc = SWIG_MustGetPtr(val, account_type, 1, 0);
 
   /* Get the value */
   val = SCM_CDR (valuearg);
@@ -78,7 +76,7 @@
 
 SCM gnc_account_value_ptr_to_scm (GncAccountValue *av)
 {
-  SCM account_type = get_acct_type();
+  swig_type_info * account_type = get_acct_type();
   gnc_commodity * com;
   gnc_numeric val;
 
@@ -88,6 +86,6 @@
   val = gnc_numeric_convert (av->value, gnc_commodity_get_fraction (com),
 			     GNC_RND_ROUND);
 
-  return scm_cons (gw_wcp_assimilate_ptr (av->account, account_type),
+  return scm_cons (SWIG_NewPointerObj(av->account, account_type, 0),
 		   gnc_numeric_to_scm (val));
 }

Modified: gnucash/branches/swig-redo/src/business/business-gnome/dialog-invoice.c
===================================================================
--- gnucash/branches/swig-redo/src/business/business-gnome/dialog-invoice.c	2006-10-10 00:11:32 UTC (rev 14981)
+++ gnucash/branches/swig-redo/src/business/business-gnome/dialog-invoice.c	2006-10-10 00:12:06 UTC (rev 14982)
@@ -27,8 +27,8 @@
 
 #include <gnome.h>
 #include <glib/gi18n.h>
-#include <g-wrap-wct.h>  // still needed for g-wrapped types
 #include <libguile.h>
+#include "swig-runtime.h"
 
 #include "gncObject.h"
 #include "QueryCore.h"
@@ -555,8 +555,6 @@
   }
 }
 
-#include "swig-runtime.h"
-
 void
 gnc_invoice_window_printCB (GtkWidget *widget, gpointer data)
 {
@@ -736,7 +734,6 @@
 void gnc_business_call_owner_report (GncOwner *owner, Account *acc)
 {
   int id;
-  SCM qtype;
   SCM args;
   SCM func;
   SCM arg;
@@ -749,10 +746,10 @@
   g_return_if_fail (SCM_PROCEDUREP (func));
 
   if (acc) {
-    qtype = scm_c_eval_string("<gnc:Account*>");
-    g_return_if_fail (qtype != SCM_UNDEFINED);
+    swig_type_info * qtype = SWIG_TypeQuery("_p_Account");
+    g_return_if_fail (qtype);
 
-    arg = gw_wcp_assimilate_ptr (acc, qtype);
+    arg = SWIG_NewPointerObj(acc, qtype, 0);
     g_return_if_fail (arg != SCM_UNDEFINED);
     args = scm_cons (arg, args);
   } else {

Modified: gnucash/branches/swig-redo/src/engine/glib-helpers.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/glib-helpers.c	2006-10-10 00:11:32 UTC (rev 14981)
+++ gnucash/branches/swig-redo/src/engine/glib-helpers.c	2006-10-10 00:12:06 UTC (rev 14982)
@@ -1,6 +1,7 @@
 /********************************************************************\
- * gnc-helpers.c -- gnucash g-wrap helper functions                 *
+ * gnc-helpers.c -- gnucash glib helper functions                   *
  * Copyright (C) 2000 Linas Vepstas                                 *
+ * Copyright (C) 2006 Chris Shoemaker <c.shoemaker at cox.net>         *
  *                                                                  *
  * This program is free software; you can redistribute it and/or    *
  * modify it under the terms of the GNU General Public License as   *
@@ -27,31 +28,30 @@
 #include <glib.h>
 #include <libguile.h>
 #include "guile-mappings.h"
-
-#include <g-wrap-wct.h>
-
+#include "swig-runtime.h"
 #include "glib-helpers.h"
 
 
 /* These will eventually go into (g-wrapped glib). */
 
 static SCM
-glist_to_scm_list_helper(GList *glist, SCM wct)
+glist_to_scm_list_helper(GList *glist, swig_type_info *wct)
 {
   SCM list = SCM_EOL;
   GList *node;
 
   for (node = glist; node; node = node->next)
-    list = scm_cons (gw_wcp_assimilate_ptr(node->data, wct), list);
+      list = scm_cons(SWIG_NewPointerObj(node->data, wct, 0), list);
 
   return scm_reverse (list);
 }
 
 SCM
-gnc_glist_to_scm_list(GList *glist, SCM wct)
+gnc_glist_to_scm_list(GList *glist, gchar *wct)
 {
-  SCM_ASSERT(gw_wct_p(wct), wct, SCM_ARG1, "gnc_glist_to_scm_list");
-  return(glist_to_scm_list_helper(glist, wct));
+    swig_type_info *stype = SWIG_TypeQuery(wct);
+    g_return_val_if_fail(stype, SCM_UNDEFINED);
+    return glist_to_scm_list_helper(glist, stype);
 }
 
 GList*
@@ -59,7 +59,8 @@
 {
   GList *result = NULL;
   SCM scm_item;
-  
+
+  SWIG_GetModule(NULL); /* Work-around for SWIG bug. */
   SCM_ASSERT(SCM_LISTP(rest), rest, SCM_ARG1, "gnc_scm_list_to_glist");
 
   while(!SCM_NULLP(rest))
@@ -76,11 +77,11 @@
     }
     else
     {
-      if (!gw_wcp_p(scm_item))
+      if (!SWIG_IsPointer(scm_item))
         scm_misc_error("gnc_scm_list_to_glist",
-                       "Item in list not a gw:wcp.", scm_item);
+                       "Item in list not a wcp.", scm_item);
       
-      item = gw_wcp_get_ptr(scm_item);
+      item = (void *)SWIG_PointerAddress(scm_item);
       result = g_list_prepend(result, item);
     }
   }
@@ -88,38 +89,6 @@
   return g_list_reverse(result);
 }
 
-static SCM
-glist_map_helper(GList *glist, SCM wct, SCM thunk)
-{
-  SCM list = SCM_EOL;
-  GList *node;
-
-  for (node = glist; node; node = node->next)
-    list = scm_cons (scm_call_1(thunk, gw_wcp_assimilate_ptr(node->data, wct)),
-		     list);
-
-  return scm_reverse (list);
-}
-
-SCM
-gnc_glist_scm_map(SCM wct, SCM thunk, GList* glist)
-{
-  SCM_ASSERT(gw_wct_p(wct), wct, SCM_ARG1, "gnc_glist_map");
-  SCM_ASSERT(SCM_PROCEDUREP(thunk), thunk, SCM_ARG2, "gnc_glist_scm_map");  
-  return(glist_map_helper(glist, wct, thunk));
-}
-
-void
-gnc_glist_scm_for_each(SCM wct, SCM thunk, GList *glist)
-{
-  GList *lp;
-  SCM_ASSERT(gw_wct_p(wct), wct, SCM_ARG1, "gnc_glist_map");
-  SCM_ASSERT(SCM_PROCEDUREP(thunk), thunk, SCM_ARG2, "gnc_glist_scm_for_each");  
-  for(lp = glist; lp; lp = lp->next) {
-    scm_call_1(thunk, gw_wcp_assimilate_ptr(lp->data, wct));
-  }
-}
-
 /********************************************************************
  * gnc_glist_string_to_scm
  * i.e. (glist-of (<gw:mchars> calee-owned) callee-owned)

Modified: gnucash/branches/swig-redo/src/engine/glib-helpers.h
===================================================================
--- gnucash/branches/swig-redo/src/engine/glib-helpers.h	2006-10-10 00:11:32 UTC (rev 14981)
+++ gnucash/branches/swig-redo/src/engine/glib-helpers.h	2006-10-10 00:12:06 UTC (rev 14982)
@@ -27,12 +27,9 @@
 #include <glib.h>
 #include <libguile.h>
 
-SCM gnc_glist_to_scm_list(GList *glist, SCM wct);
+SCM gnc_glist_to_scm_list(GList *glist, gchar *wct);
 GList* gnc_scm_list_to_glist(SCM wcp_list);
 
-SCM gnc_glist_scm_map(SCM wct, SCM thunk, GList *glist);
-void gnc_glist_scm_for_each(SCM wct, SCM thunk, GList *glist);
-
 SCM     gnc_glist_string_to_scm(GList * list);
 GList * gnc_scm_to_glist_string(SCM list);
 int     gnc_glist_string_p(SCM list);

Modified: gnucash/branches/swig-redo/src/gnome/gnc-plugin-page-register.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome/gnc-plugin-page-register.c	2006-10-10 00:11:32 UTC (rev 14981)
+++ gnucash/branches/swig-redo/src/gnome/gnc-plugin-page-register.c	2006-10-10 00:12:06 UTC (rev 14982)
@@ -39,7 +39,7 @@
 #ifndef HAVE_GLIB26
 #include "gkeyfile.h"
 #endif
-#include <g-wrap-wct.h>
+#include "swig-runtime.h"
 
 #include "gnc-plugin-page-register.h"
 #include "gnc-plugin-register.h"
@@ -1725,7 +1725,7 @@
   SplitRegister *reg = gnc_ledger_display_get_split_register (ledger);
   Account *account;
   char *str;
-  SCM qtype;
+  swig_type_info * qtype;
   SCM args;
   SCM func;
   SCM arg;
@@ -1758,19 +1758,19 @@
     g_return_val_if_fail (query != NULL, -1);
   }
 
-  qtype = scm_c_eval_string("<gnc:Query*>");
-  g_return_val_if_fail (qtype != SCM_UNDEFINED, -1);
+  qtype = SWIG_TypeQuery ("_p__QofQuery");
+  g_return_val_if_fail (qtype, -1);
 
-  arg = gw_wcp_assimilate_ptr (query, qtype);
+  arg = SWIG_NewPointerObj (query, qtype, 0);
   args = scm_cons (arg, args);
   g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
 
 
   if (split)
   {
-    qtype = scm_c_eval_string("<gnc:Split*>");
-    g_return_val_if_fail (qtype != SCM_UNDEFINED, -1);
-    arg = gw_wcp_assimilate_ptr (split, qtype);
+    qtype = SWIG_TypeQuery ("_p_Split");
+    g_return_val_if_fail (qtype, -1);
+    arg = SWIG_NewPointerObj (split, qtype, 0);
   }
   else
   {
@@ -1780,11 +1780,11 @@
   g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
 
 
-  qtype = scm_c_eval_string("<gnc:Account*>");
-  g_return_val_if_fail (qtype != SCM_UNDEFINED, -1);
+  qtype = SWIG_TypeQuery ("_p_Account");
+  g_return_val_if_fail (qtype, -1);
 
   account = gnc_ledger_display_leader (ledger);
-  arg = gw_wcp_assimilate_ptr (account, qtype);
+  arg = SWIG_NewPointerObj (account, qtype, 0);
   args = scm_cons (arg, args);
   g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
 

Modified: gnucash/branches/swig-redo/src/gnome-utils/dialog-options.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/dialog-options.c	2006-10-10 00:11:32 UTC (rev 14981)
+++ gnucash/branches/swig-redo/src/gnome-utils/dialog-options.c	2006-10-10 00:12:06 UTC (rev 14982)
@@ -31,7 +31,7 @@
 #endif
 #include <gdk/gdk.h>
 #include <glib/gi18n.h>
-#include <g-wrap-wct.h>
+#include "swig-runtime.h"
 
 #include "gnc-tree-model-budget.h" //FIXME?
 #include "gnc-budget.h"
@@ -56,6 +56,7 @@
 #include "gnc-date-format.h"
 #include "misc-gnome-utils.h"
 
+#define FUNC_NAME __FUNCTION__
 /* TODO: clean up "register-stocks" junk
  */
 
@@ -2367,11 +2368,11 @@
   Account *acc = NULL;
 
   if (value != SCM_BOOL_F) {
-    if (!gw_wcp_p(value))
-      scm_misc_error("gnc_option_set_ui_value_account_sel",
-		     "Option Value not a gw:wcp.", value);
+    if (!SWIG_IsPointer(value))
+        scm_misc_error("gnc_option_set_ui_value_account_sel",
+                       "Option Value not a wcp.", value);
       
-    acc = gw_wcp_get_ptr(value);
+    acc = SWIG_MustGetPtr(value, SWIG_TypeQuery("_p_Account"), 4, 0);
   }
 	
   gnc_account_sel_set_account (GNC_ACCOUNT_SEL(widget), acc);
@@ -2522,11 +2523,11 @@
     GtkTreeIter iter;
 
     if (value != SCM_BOOL_F) {
-        if (!gw_wcp_p(value))
+        if (!SWIG_IsPointer(value))
             scm_misc_error("gnc_option_set_ui_value_budget",
-                           "Option Value not a gw:wcp.", value);
+                           "Option Value not a wcp.", value);
 
-        bgt = gw_wcp_get_ptr(value);
+        bgt = SWIG_MustGetPtr(value, SWIG_TypeQuery("GncBudget *"), 4, 0);
         cb = GTK_COMBO_BOX(widget);
         tm = gtk_combo_box_get_model(cb);
         if (gnc_tree_model_budget_get_iter_for_budget(tm, &iter, bgt))
@@ -2758,7 +2759,7 @@
   list = gnc_tree_view_account_get_selected_accounts (tree);
 
   /* handover list */
-  result = gnc_glist_to_scm_list(list, scm_c_eval_string("<gnc:Account*>"));
+  result = gnc_glist_to_scm_list(list, "_p_Account");
   g_list_free(list);
   return result;
 }
@@ -2775,7 +2776,7 @@
   if (!acc)
     return SCM_BOOL_F;
 
-  return gw_wcp_assimilate_ptr(acc, scm_c_eval_string("<gnc:Account*>"));
+  return SWIG_NewPointerObj(acc, SWIG_TypeQuery("_p_Account"), 0);
 }
 
 static SCM
@@ -2795,7 +2796,7 @@
     if (!bgt)
         return SCM_BOOL_F;
 
-    return gw_wcp_assimilate_ptr(bgt, scm_c_eval_string("<gnc:Budget*>"));
+    return SWIG_NewPointerObj(bgt, SWIG_TypeQuery("_p_gnc_budget_private"), 0);
 }
 
 static SCM
@@ -2999,7 +3000,7 @@
 
 void gnc_options_ui_initialize (void)
 {
-
+  SWIG_GetModule(NULL); /* Work-around for SWIG bug. */
   //  gnc_options_register_stocks ();
   g_return_if_fail (optionTable == NULL);
   optionTable = g_hash_table_new (g_str_hash, g_str_equal);

Modified: gnucash/branches/swig-redo/src/import-export/qif-import/druid-qif-import.c
===================================================================
--- gnucash/branches/swig-redo/src/import-export/qif-import/druid-qif-import.c	2006-10-10 00:11:32 UTC (rev 14981)
+++ gnucash/branches/swig-redo/src/import-export/qif-import/druid-qif-import.c	2006-10-10 00:12:06 UTC (rev 14982)
@@ -49,7 +49,6 @@
 #include "guile-mappings.h"
 
 #include "swig-runtime.h"
-#include "g-wrap-wct.h" // still needed
 
 #define DRUID_QIF_IMPORT_CM_CLASS "druid-qif-import"
 #define GCONF_SECTION "dialogs/import/qif"
@@ -1313,8 +1312,10 @@
 
     while(!SCM_NULLP(retval)) {
       current_xtn = SCM_CAAR(retval);
-      gnc_xtn     = (Transaction *)gw_wcp_get_ptr(current_xtn);
-
+      #define FUNC_NAME "xaccTransCountSplits"
+      gnc_xtn     = SWIG_MustGetPtr(current_xtn,
+                                    SWIG_TypeQuery("_p_Transaction"), 1, 0);
+      #undef FUNC_NAME
       if(xaccTransCountSplits(gnc_xtn) > 2) {
         amount_str = _("(split)"); 
       }
@@ -1761,7 +1762,10 @@
 
     while(!SCM_NULLP(possible_matches)) {
       current_xtn = SCM_CAR(possible_matches);
-      gnc_xtn     = (Transaction *)gw_wcp_get_ptr(SCM_CAR(current_xtn));
+      #define FUNC_NAME "make_qif_druid_page"
+      gnc_xtn     = SWIG_MustGetPtr(SCM_CAR(current_xtn),
+                                    SWIG_TypeQuery("_p_Transaction"), 1, 0);
+      #undef FUNC_NAME
       selected    = SCM_CDR(current_xtn);
       
       if(xaccTransCountSplits(gnc_xtn) > 2) {



More information about the gnucash-changes mailing list