r14951 - gnucash/branches/swig-redo/src/business/business-core - Prepare the business code for swigification.

Chris Shoemaker chris at cvs.gnucash.org
Mon Oct 9 19:47:39 EDT 2006


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

Modified:
   gnucash/branches/swig-redo/src/business/business-core/gncBillTerm.h
   gnucash/branches/swig-redo/src/business/business-core/gncCustomer.h
   gnucash/branches/swig-redo/src/business/business-core/gncInvoice.c
   gnucash/branches/swig-redo/src/business/business-core/gncInvoice.h
   gnucash/branches/swig-redo/src/business/business-core/gncJob.h
   gnucash/branches/swig-redo/src/business/business-core/gncOrder.h
   gnucash/branches/swig-redo/src/business/business-core/gncOwner.h
Log:
Prepare the business code for swigification.
Remove some undefined functions.  Convert some macros to functions.
Regularize a structure name.  Conditionally #ifdef out some yucky macros
during swig-processing.



Modified: gnucash/branches/swig-redo/src/business/business-core/gncBillTerm.h
===================================================================
--- gnucash/branches/swig-redo/src/business/business-core/gncBillTerm.h	2006-10-09 23:46:02 UTC (rev 14950)
+++ gnucash/branches/swig-redo/src/business/business-core/gncBillTerm.h	2006-10-09 23:47:38 UTC (rev 14951)
@@ -59,17 +59,19 @@
  * ??? huh?
  * NOTE: This enum /depends/ on starting at value 1
  */
+#ifndef SWIG
 #define ENUM_TERMS_TYPE(_)  \
  _(GNC_TERM_TYPE_DAYS,=1) \
  _(GNC_TERM_TYPE_PROXIMO,)
 
 DEFINE_ENUM(GncBillTermType, ENUM_TERMS_TYPE)
-
-/*typedef enum {
+#else
+typedef enum {
   GNC_TERM_TYPE_DAYS = 1,
   GNC_TERM_TYPE_PROXIMO,
 } GncBillTermType;
-*/
+#endif
+
 /** @name Create/Destroy Functions 
  @{ */
 GncBillTerm * gncBillTermCreate (QofBook *book);
@@ -108,7 +110,6 @@
 
 GncBillTerm *gncBillTermLookupByName (QofBook *book, const char *name);
 GList * gncBillTermGetTerms (QofBook *book);
-KvpFrame* gncBillTermGetSlots (GncBillTerm *term);
 
 const char *gncBillTermGetName (GncBillTerm *term);
 const char *gncBillTermGetDescription (GncBillTerm *term);

Modified: gnucash/branches/swig-redo/src/business/business-core/gncCustomer.h
===================================================================
--- gnucash/branches/swig-redo/src/business/business-core/gncCustomer.h	2006-10-09 23:46:02 UTC (rev 14950)
+++ gnucash/branches/swig-redo/src/business/business-core/gncCustomer.h	2006-10-09 23:47:38 UTC (rev 14951)
@@ -120,7 +120,6 @@
 gboolean gncCustomerGetTaxTableOverride (GncCustomer *customer);
 GncTaxTable* gncCustomerGetTaxTable (GncCustomer *customer);
 
-KvpFrame *gncCustomerGetSlots (GncCustomer *customer);
 GList * gncCustomerGetJoblist (GncCustomer *customer, gboolean show_all);
 /** @} */
 

Modified: gnucash/branches/swig-redo/src/business/business-core/gncInvoice.c
===================================================================
--- gnucash/branches/swig-redo/src/business/business-core/gncInvoice.c	2006-10-09 23:46:02 UTC (rev 14950)
+++ gnucash/branches/swig-redo/src/business/business-core/gncInvoice.c	2006-10-09 23:47:38 UTC (rev 14951)
@@ -94,6 +94,11 @@
   qof_event_gen (&invoice->inst.entity, QOF_EVENT_MODIFY, NULL);
 }
 
+QofBook * gncInvoiceGetBook(GncInvoice *x)
+{
+    return qof_instance_get_book(QOF_INSTANCE(x));
+}
+
 /* ================================================================== */
 /* Create/Destroy Functions */
 

Modified: gnucash/branches/swig-redo/src/business/business-core/gncInvoice.h
===================================================================
--- gnucash/branches/swig-redo/src/business/business-core/gncInvoice.h	2006-10-09 23:46:02 UTC (rev 14950)
+++ gnucash/branches/swig-redo/src/business/business-core/gncInvoice.h	2006-10-09 23:47:38 UTC (rev 14951)
@@ -43,6 +43,7 @@
 #include "gncEntry.h"
 #include "gncOwner.h"
 #include "gnc-lot.h"
+#include "qofbook.h"
 
 #define GNC_ID_INVOICE    "gncInvoice"
 #define GNC_IS_INVOICE(obj)  (QOF_CHECK_TYPE((obj), GNC_ID_INVOICE))
@@ -164,7 +165,6 @@
 #define gncInvoiceLookup(book,guid)    \
        QOF_BOOK_LOOKUP_ENTITY((book),(guid),GNC_ID_INVOICE, GncInvoice)
 
-gboolean gncInvoiceIsDirty (GncInvoice *invoice);
 void gncInvoiceBeginEdit (GncInvoice *invoice);
 void gncInvoiceCommitEdit (GncInvoice *invoice);
 int gncInvoiceCompare (GncInvoice *a, GncInvoice *b);
@@ -192,8 +192,9 @@
 #define INVOICE_FROM_LOT	"invoice-from-lot"
 #define INVOICE_FROM_TXN	"invoice-from-txn"
 
+QofBook *gncInvoiceGetBook(GncInvoice *x);
+
 /** deprecated functions */
-#define gncInvoiceGetBook(x) qof_instance_get_book(QOF_INSTANCE(x))
 #define gncInvoiceGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x))
 #define gncInvoiceRetGUID(x) (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null()))
 #define gncInvoiceLookupDirect(G,B) gncInvoiceLookup((B),&(G))

Modified: gnucash/branches/swig-redo/src/business/business-core/gncJob.h
===================================================================
--- gnucash/branches/swig-redo/src/business/business-core/gncJob.h	2006-10-09 23:46:02 UTC (rev 14950)
+++ gnucash/branches/swig-redo/src/business/business-core/gncJob.h	2006-10-09 23:47:38 UTC (rev 14951)
@@ -70,7 +70,6 @@
 
 /** @} */
 gboolean gncJobGetActive (GncJob *job);
-gboolean gncJobIsDirty (GncJob *job);
 
 /** Return a pointer to the instance gncJob that is identified
  *  by the guid, and is residing in the book. Returns NULL if the

Modified: gnucash/branches/swig-redo/src/business/business-core/gncOrder.h
===================================================================
--- gnucash/branches/swig-redo/src/business/business-core/gncOrder.h	2006-10-09 23:46:02 UTC (rev 14950)
+++ gnucash/branches/swig-redo/src/business/business-core/gncOrder.h	2006-10-09 23:47:38 UTC (rev 14951)
@@ -76,7 +76,6 @@
 /* Get the list Entries */
 GList * gncOrderGetEntries (GncOrder *order);
 
-gboolean gncOrderIsDirty (GncOrder *order);
 void gncOrderBeginEdit (GncOrder *order);
 void gncOrderCommitEdit (GncOrder *order);
 int gncOrderCompare (GncOrder *a, GncOrder *b);

Modified: gnucash/branches/swig-redo/src/business/business-core/gncOwner.h
===================================================================
--- gnucash/branches/swig-redo/src/business/business-core/gncOwner.h	2006-10-09 23:46:02 UTC (rev 14950)
+++ gnucash/branches/swig-redo/src/business/business-core/gncOwner.h	2006-10-09 23:47:38 UTC (rev 14951)
@@ -33,7 +33,7 @@
 #ifndef GNC_OWNER_H_
 #define GNC_OWNER_H_
 
-typedef struct gnc_owner_s GncOwner;
+typedef struct _gncOwner GncOwner;
 
 #define GNC_ID_OWNER   "gncOwner"
 
@@ -67,17 +67,13 @@
 /** set the owner from the entity. */
 void qofOwnerSetEntity (GncOwner *owner, QofEntity *ent);
 
-/** \brief Set the parent owner. */
-void qofOwnerSetEndOwner (GncOwner *owner, GncOwner *parent);
-GncOwner* qofOwnerCreate (QofBook *book);
-
 gboolean
 gncOwnerRegister(void);
 
 /** @} */
 
 /** \struct GncOwner */
-struct gnc_owner_s {
+struct _gncOwner {
   GncOwnerType     type;      /**< Customer, Job, Vendor, Employee or Undefined. */
   union {
     gpointer       undefined;



More information about the gnucash-changes mailing list