r14964 - gnucash/branches/swig-redo/src - More converting of the gnome-utils module from gwrap to swig.

Chris Shoemaker chris at cvs.gnucash.org
Mon Oct 9 19:57:45 EDT 2006


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

Modified:
   gnucash/branches/swig-redo/src/gnome-utils/dialog-options.c
   gnucash/branches/swig-redo/src/gnome-utils/dialog-options.h
   gnucash/branches/swig-redo/src/gnome-utils/gnc-html.h
   gnucash/branches/swig-redo/src/gnome-utils/gnc-main-window.c
   gnucash/branches/swig-redo/src/gnome-utils/gnc-main-window.h
   gnucash/branches/swig-redo/src/gnome-utils/gnc-plugin-menu-additions.c
   gnucash/branches/swig-redo/src/gnome-utils/gnome-utils.scm
   gnucash/branches/swig-redo/src/gnome/dialog-price-edit-db.c
   gnucash/branches/swig-redo/src/import-export/qif-import/druid-qif-import.c
   gnucash/branches/swig-redo/src/import-export/qif-import/qif-parse.scm
   gnucash/branches/swig-redo/src/report/report-gnome/dialog-column-view.c
   gnucash/branches/swig-redo/src/report/report-gnome/dialog-style-sheet.c
   gnucash/branches/swig-redo/src/report/report-gnome/report-gnome.i
   gnucash/branches/swig-redo/src/report/report-gnome/report-gnome.scm
   gnucash/branches/swig-redo/src/report/report-gnome/window-report.c
   gnucash/branches/swig-redo/src/scm/price-quotes.scm
Log:
More converting of the gnome-utils module from gwrap to swig.
  Rename gnc_build_options_dialog_contents() to
    gnc_options_dialog_build_contents() for consistency.
  Remove some undefined functions.
  Privatize a #define.
  Convert runtime code from gwrap to swig.
  Use '() instead of #f for the empty object.
  Remove some temporary swig<->gwrap typemaps that are no longer needed.



Modified: gnucash/branches/swig-redo/src/gnome/dialog-price-edit-db.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome/dialog-price-edit-db.c	2006-10-09 23:56:50 UTC (rev 14963)
+++ gnucash/branches/swig-redo/src/gnome/dialog-price-edit-db.c	2006-10-09 23:57:43 UTC (rev 14964)
@@ -45,7 +45,7 @@
 #include "gnc-ui-util.h"
 #include "guile-util.h"
 #include "engine-helpers.h"
-#include <g-wrap-wct.h>
+#include "swig-runtime.h"
 
 
 #define DIALOG_PRICE_DB_CM_CLASS "dialog-price-edit-db"
@@ -262,7 +262,7 @@
   PricesDialog *pdb_dialog = data;
   SCM quotes_func;
   SCM book_scm;
-  SCM scm_window, window_type;
+  SCM scm_window;
 
   ENTER(" ");
   quotes_func = scm_c_eval_string ("gnc:book-add-quotes");
@@ -277,8 +277,8 @@
     return;
   }
 
-  window_type = scm_c_eval_string("<gtk:Widget*>");
-  scm_window = gw_wcp_assimilate_ptr(pdb_dialog->dialog, window_type);
+  scm_window =  SWIG_NewPointerObj(pdb_dialog->dialog,
+                                   SWIG_TypeQuery("_p_GtkWidget"), 0);
 
   gnc_set_busy_cursor (NULL, TRUE);
   scm_call_2 (quotes_func, scm_window, book_scm);

Modified: gnucash/branches/swig-redo/src/gnome-utils/dialog-options.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/dialog-options.c	2006-10-09 23:56:50 UTC (rev 14963)
+++ gnucash/branches/swig-redo/src/gnome-utils/dialog-options.c	2006-10-09 23:57:43 UTC (rev 14964)
@@ -1211,7 +1211,7 @@
 
 
 /********************************************************************\
- * gnc_build_options_dialog_contents                                *
+ * gnc_options_dialog_build_contents                                *
  *   builds an options dialog given a property box and an options   *
  *   database                                                       *
  *                                                                  *
@@ -1220,7 +1220,7 @@
  * Return: nothing                                                  *
 \********************************************************************/
 void
-gnc_build_options_dialog_contents(GNCOptionWin *propertybox,
+gnc_options_dialog_build_contents(GNCOptionWin *propertybox,
                                   GNCOptionDB  *odb)
 {
   GNCOptionSection *section;

Modified: gnucash/branches/swig-redo/src/gnome-utils/dialog-options.h
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/dialog-options.h	2006-10-09 23:56:50 UTC (rev 14963)
+++ gnucash/branches/swig-redo/src/gnome-utils/dialog-options.h	2006-10-09 23:57:43 UTC (rev 14964)
@@ -56,7 +56,7 @@
 void gnc_options_dialog_set_global_help_cb(GNCOptionWinCallback thunk,
                                            gpointer cb_data);
 
-void gnc_build_options_dialog_contents(GNCOptionWin *win,
+void gnc_options_dialog_build_contents(GNCOptionWin *win,
                                        GNCOptionDB  *odb);
 
 /* Both apply_cb and close_cb should be scheme functions with 0 arguments.

Modified: gnucash/branches/swig-redo/src/gnome-utils/gnc-html.h
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/gnc-html.h	2006-10-09 23:56:50 UTC (rev 14963)
+++ gnucash/branches/swig-redo/src/gnome-utils/gnc-html.h	2006-10-09 23:57:43 UTC (rev 14964)
@@ -175,9 +175,6 @@
 void gnc_html_set_button_cb(gnc_html * html, GncHTMLButtonCB button_cb,
                             gpointer data);
 
-GtkWidget   * gnc_html_get_container_widget(gnc_html * html);
-GtkWidget   * gnc_html_get_html_widget(gnc_html * html); 
-
 /* Initialize the html subsystem */
 void gnc_html_initialize (void);
 

Modified: gnucash/branches/swig-redo/src/gnome-utils/gnc-main-window.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/gnc-main-window.c	2006-10-09 23:56:50 UTC (rev 14963)
+++ gnucash/branches/swig-redo/src/gnome-utils/gnc-main-window.c	2006-10-09 23:57:43 UTC (rev 14964)
@@ -85,6 +85,8 @@
 #define KEY_SHOW_CLOSE_BUTTON	"tab_close_buttons"
 #define KEY_TAB_POSITION	"tab_position"
 
+#define GNC_MAIN_WINDOW_NAME "GncMainWindow"
+
 /* Static Globals *******************************************************/
 
 /** The debugging module that this .o belongs to.  */

Modified: gnucash/branches/swig-redo/src/gnome-utils/gnc-main-window.h
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/gnc-main-window.h	2006-10-09 23:56:50 UTC (rev 14963)
+++ gnucash/branches/swig-redo/src/gnome-utils/gnc-main-window.h	2006-10-09 23:57:43 UTC (rev 14964)
@@ -39,8 +39,6 @@
 #include <gtk/gtk.h>
 #include "gnc-plugin-page.h"
 
-G_BEGIN_DECLS
-
 /* type macros */
 #define GNC_TYPE_MAIN_WINDOW            (gnc_main_window_get_type ())
 #define GNC_MAIN_WINDOW(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_MAIN_WINDOW, GncMainWindow))
@@ -49,8 +47,6 @@
 #define GNC_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_MAIN_WINDOW))
 #define GNC_MAIN_WINDOW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_MAIN_WINDOW, GncMainWindowClass))
 
-#define GNC_MAIN_WINDOW_NAME "GncMainWindow"
-
 #define PLUGIN_PAGE_IMMUTABLE    "page-immutable"
 
 /* typedefs & structures */
@@ -356,8 +352,6 @@
  *  this action. */
 void gnc_main_window_all_action_set_sensitive (const gchar *action_name, gboolean sensitive);
 
-G_END_DECLS
-
 #endif /* __GNC_MAIN_WINDOW_H */
 
 /** @} */

Modified: gnucash/branches/swig-redo/src/gnome-utils/gnc-plugin-menu-additions.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/gnc-plugin-menu-additions.c	2006-10-09 23:56:50 UTC (rev 14963)
+++ gnucash/branches/swig-redo/src/gnome-utils/gnc-plugin-menu-additions.c	2006-10-09 23:57:43 UTC (rev 14964)
@@ -37,7 +37,7 @@
 
 #include <gtk/gtk.h>
 #include <string.h>
-#include <g-wrap-wct.h>
+#include "swig-runtime.h"
 
 #include "guile-util.h"
 #include "gnc-engine.h"
@@ -184,21 +184,15 @@
 static SCM
 gnc_main_window_to_scm (GncMainWindow *window)
 {
-  static SCM main_window_type = SCM_UNDEFINED;
+  static swig_type_info * main_window_type = NULL;
 
   if (!window)
     return SCM_BOOL_F;
 
-  if (main_window_type == SCM_UNDEFINED)
-  {
-    main_window_type = scm_c_eval_string ("<gnc:MainWindow*>");
+  if (!main_window_type)
+    main_window_type = SWIG_TypeQuery("_p_GncMainWindow");
 
-    /* don't really need this - types are bound globally anyway. */
-    if (main_window_type != SCM_UNDEFINED)
-      scm_gc_protect_object (main_window_type);
-  }
-  
-  return gw_wcp_assimilate_ptr ((void *)window, main_window_type);
+  return SWIG_NewPointerObj(window, main_window_type, 0);
 }
 
 

Modified: gnucash/branches/swig-redo/src/gnome-utils/gnome-utils.scm
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/gnome-utils.scm	2006-10-09 23:56:50 UTC (rev 14963)
+++ gnucash/branches/swig-redo/src/gnome-utils/gnome-utils.scm	2006-10-09 23:57:43 UTC (rev 14964)
@@ -1,6 +1,5 @@
 (define-module (gnucash gnome-utils))
 
-(use-modules (g-wrapped gw-gnome-utils))
 (use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing.
 (use-modules (gnucash gnc-module))
 

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-09 23:56:50 UTC (rev 14963)
+++ gnucash/branches/swig-redo/src/import-export/qif-import/druid-qif-import.c	2006-10-09 23:57:43 UTC (rev 14964)
@@ -48,7 +48,8 @@
 #include "gnc-ui.h"
 #include "guile-mappings.h"
 
-#include <g-wrap-wct.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"
@@ -460,7 +461,6 @@
   SCM check_from_acct = scm_c_eval_string("qif-file:check-from-acct");
   SCM default_acct    = scm_c_eval_string("qif-file:path-to-accountname");
   SCM qif_file_parse_results  = scm_c_eval_string("qif-file:parse-fields-results");
-  SCM window_type     = scm_c_eval_string ("<gnc:UIWidget>");
   SCM date_formats;
   SCM scm_filename;
   SCM scm_qiffile;
@@ -471,7 +471,7 @@
 
   /* get the file name */ 
   path_to_load = gtk_entry_get_text(GTK_ENTRY(wind->filename_entry));
-  window = gw_wcp_assimilate_ptr(wind->window, window_type);
+  window = SWIG_NewPointerObj(wind->window, SWIG_TypeQuery("_p_GtkWidget"), 0);
 
   /* check a few error conditions before we get started */
   if(strlen(path_to_load) == 0) {
@@ -1205,7 +1205,6 @@
 
   SCM   qif_to_gnc      = scm_c_eval_string("qif-import:qif-to-gnc");
   SCM   find_duplicates = scm_c_eval_string("gnc:group-find-duplicates");
-  SCM   window_type     = scm_c_eval_string ("<gnc:UIWidget>");
   SCM   retval;
   SCM   current_xtn;
   SCM   window;
@@ -1260,7 +1259,7 @@
 
   /* call a scheme function to do the work.  The return value is an
    * account group containing all the new accounts and transactions */
-  window = gw_wcp_assimilate_ptr(wind->window, window_type);
+  window = SWIG_NewPointerObj(wind->window, SWIG_TypeQuery("_p_GtkWidget"), 0);
   retval = scm_apply(qif_to_gnc, 
 		     SCM_LIST7(wind->imported_files,
 			       wind->acct_map_info, 

Modified: gnucash/branches/swig-redo/src/import-export/qif-import/qif-parse.scm
===================================================================
--- gnucash/branches/swig-redo/src/import-export/qif-import/qif-parse.scm	2006-10-09 23:56:50 UTC (rev 14963)
+++ gnucash/branches/swig-redo/src/import-export/qif-import/qif-parse.scm	2006-10-09 23:57:43 UTC (rev 14964)
@@ -270,7 +270,7 @@
 ;          ((vest) 
 ;           'vest)
           (else
-           (gnc:warning-dialog #f
+           (gnc:warning-dialog '()
             (string-append
              (sprintf #f (_ "The file contains an unknown Action '%s'.")
                       read-value)

Modified: gnucash/branches/swig-redo/src/report/report-gnome/dialog-column-view.c
===================================================================
--- gnucash/branches/swig-redo/src/report/report-gnome/dialog-column-view.c	2006-10-09 23:56:50 UTC (rev 14963)
+++ gnucash/branches/swig-redo/src/report/report-gnome/dialog-column-view.c	2006-10-09 23:57:43 UTC (rev 14964)
@@ -324,7 +324,7 @@
     r->contents_list = SCM_EOL;
     r->odb       = gnc_option_db_new(r->options);
 
-    gnc_build_options_dialog_contents(r->optwin, r->odb);
+    gnc_options_dialog_build_contents(r->optwin, r->odb);
 
     gtk_notebook_append_page(GTK_NOTEBOOK(gnc_options_dialog_notebook
                                           (r->optwin)),

Modified: gnucash/branches/swig-redo/src/report/report-gnome/dialog-style-sheet.c
===================================================================
--- gnucash/branches/swig-redo/src/report/report-gnome/dialog-style-sheet.c	2006-10-09 23:56:50 UTC (rev 14963)
+++ gnucash/branches/swig-redo/src/report/report-gnome/dialog-style-sheet.c	2006-10-09 23:57:43 UTC (rev 14964)
@@ -147,7 +147,7 @@
     scm_gc_protect_object(ssinfo->stylesheet);
     g_object_ref(gnc_options_dialog_widget(ssinfo->odialog));
 
-    gnc_build_options_dialog_contents(ssinfo->odialog, 
+    gnc_options_dialog_build_contents(ssinfo->odialog,
                                       ssinfo->odb);
     gnc_options_dialog_set_apply_cb(ssinfo->odialog, 
                                     gnc_style_sheet_options_apply_cb,

Modified: gnucash/branches/swig-redo/src/report/report-gnome/report-gnome.i
===================================================================
--- gnucash/branches/swig-redo/src/report/report-gnome/report-gnome.i	2006-10-09 23:56:50 UTC (rev 14963)
+++ gnucash/branches/swig-redo/src/report/report-gnome/report-gnome.i	2006-10-09 23:57:43 UTC (rev 14964)
@@ -6,16 +6,8 @@
 #include <dialog-column-view.h>
 #include <gnc-plugin-page-report.h>
 #include <window-report.h>
-
-#include <g-wrap-wct.h> //Temporary. Adds no link dep?!?
 %}
 
-// Temporary SWIG<->G-wrap converters
-%typemap(in) GncMainWindow * "$1 = (GncMainWindow *)gw_wcp_get_ptr($input);"
-%typemap(out) GncMainWindow * {
-  $result = gw_wcp_assimilate_ptr($1, scm_c_eval_string("<gnc:MainWindow*>"));
-}
-// End of temporary typemaps.
 
 void gnc_report_raise_editor(SCM report);
 void gnc_main_window_open_report(int report_id, GncMainWindow *window);

Modified: gnucash/branches/swig-redo/src/report/report-gnome/report-gnome.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/report-gnome/report-gnome.scm	2006-10-09 23:56:50 UTC (rev 14963)
+++ gnucash/branches/swig-redo/src/report/report-gnome/report-gnome.scm	2006-10-09 23:57:43 UTC (rev 14964)
@@ -45,7 +45,7 @@
                        (gnc:report-options report)
                        report))
                 (gnc:report-set-editor-widget! report editor-widg))
-              (gnc:warning-dialog #f (_ "This report has no options.")))))))
+              (gnc:warning-dialog '() (_ "This report has no options.")))))))
 
 (define (gnc:add-report-template-menu-items)
   (define *template-items* '())

Modified: gnucash/branches/swig-redo/src/report/report-gnome/window-report.c
===================================================================
--- gnucash/branches/swig-redo/src/report/report-gnome/window-report.c	2006-10-09 23:56:50 UTC (rev 14963)
+++ gnucash/branches/swig-redo/src/report/report-gnome/window-report.c	2006-10-09 23:57:43 UTC (rev 14964)
@@ -174,7 +174,7 @@
     scm_gc_protect_object(prm->scm_options);
     scm_gc_protect_object(prm->cur_report);
     
-    gnc_build_options_dialog_contents(prm->win, prm->db);
+    gnc_options_dialog_build_contents(prm->win, prm->db);
     gnc_option_db_clean(prm->db);
 
     gnc_options_dialog_set_apply_cb(prm->win, 

Modified: gnucash/branches/swig-redo/src/scm/price-quotes.scm
===================================================================
--- gnucash/branches/swig-redo/src/scm/price-quotes.scm	2006-10-09 23:56:50 UTC (rev 14963)
+++ gnucash/branches/swig-redo/src/scm/price-quotes.scm	2006-10-09 23:57:43 UTC (rev 14964)
@@ -32,7 +32,6 @@
 (use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing.
 (use-modules (gnucash gnc-module))
 (use-modules (g-wrapped gw-core-utils))
-(use-modules (g-wrapped gw-gnome-utils))
 
 (gnc:module-load "gnucash/app-utils" 0)
 



More information about the gnucash-changes mailing list