mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
convert gncAddress to GObject initialization
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/branches/gobject-engine-dev-warlord@15816 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
49c4d834e3
commit
4271ca4e17
@ -50,6 +50,11 @@ struct _gncAddress
|
|||||||
char * email;
|
char * email;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct _gncAddressClass
|
||||||
|
{
|
||||||
|
QofInstanceClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
static QofLogModule log_module = GNC_MOD_BUSINESS;
|
static QofLogModule log_module = GNC_MOD_BUSINESS;
|
||||||
|
|
||||||
#define _GNC_MOD_NAME GNC_ADDRESS_MODULE_NAME
|
#define _GNC_MOD_NAME GNC_ADDRESS_MODULE_NAME
|
||||||
@ -62,6 +67,19 @@ void mark_address (GncAddress *address)
|
|||||||
qof_event_gen (address->parent, QOF_EVENT_MODIFY, NULL);
|
qof_event_gen (address->parent, QOF_EVENT_MODIFY, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* GObject Initialization */
|
||||||
|
QOF_GOBJECT_IMPL(gnc_address, GncAddress, QOF_TYPE_INSTANCE);
|
||||||
|
|
||||||
|
static void
|
||||||
|
gnc_address_init(GncAddress* addr)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gnc_address_finalize_real(GObject* addrp)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/* Create/Destroy functions */
|
/* Create/Destroy functions */
|
||||||
|
|
||||||
GncAddress *
|
GncAddress *
|
||||||
@ -71,8 +89,8 @@ gncAddressCreate (QofBook *book, QofInstance *prnt)
|
|||||||
|
|
||||||
if (!book) return NULL;
|
if (!book) return NULL;
|
||||||
|
|
||||||
addr = g_new0 (GncAddress, 1);
|
addr = g_object_new (GNC_TYPE_ADDRESS, NULL);
|
||||||
qof_instance_init(&addr->inst, GNC_ID_ADDRESS, book);
|
qof_instance_init_data(&addr->inst, GNC_ID_ADDRESS, book);
|
||||||
addr->book = book;
|
addr->book = book;
|
||||||
addr->dirty = FALSE;
|
addr->dirty = FALSE;
|
||||||
addr->parent = prnt;
|
addr->parent = prnt;
|
||||||
@ -118,7 +136,7 @@ gncCloneAddress (GncAddress *from, QofInstance *new_parent, QofBook *book)
|
|||||||
|
|
||||||
if (!book) return NULL;
|
if (!book) return NULL;
|
||||||
|
|
||||||
addr = g_new0 (GncAddress, 1);
|
addr = g_object_new (GNC_TYPE_ADDRESS, NULL);
|
||||||
addr->book = book;
|
addr->book = book;
|
||||||
addr->dirty = TRUE;
|
addr->dirty = TRUE;
|
||||||
addr->parent = new_parent;
|
addr->parent = new_parent;
|
||||||
@ -159,8 +177,8 @@ gncAddressFree (GncAddress *addr)
|
|||||||
CACHE_REMOVE (addr->fax);
|
CACHE_REMOVE (addr->fax);
|
||||||
CACHE_REMOVE (addr->email);
|
CACHE_REMOVE (addr->email);
|
||||||
|
|
||||||
qof_instance_release (&addr->inst);
|
/* qof_instance_release (&addr->inst); */
|
||||||
g_free (addr);
|
g_object_unref (addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -77,6 +77,21 @@ up to you to pass a suitable entity.
|
|||||||
@param char* email address
|
@param char* email address
|
||||||
*/
|
*/
|
||||||
typedef struct _gncAddress GncAddress;
|
typedef struct _gncAddress GncAddress;
|
||||||
|
typedef struct _gncAddressClass GncAddressClass;
|
||||||
|
|
||||||
|
/* --- type macros --- */
|
||||||
|
#define GNC_TYPE_ADDRESS (gnc_address_get_type ())
|
||||||
|
#define GNC_ADDRESS(o) \
|
||||||
|
(G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_ADDRESS, GncAddress))
|
||||||
|
#define GNC_ADDRESS_CLASS(k) \
|
||||||
|
(G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_ADDRESS, GncAddressClass))
|
||||||
|
#define GNC_IS_ADDRESS(o) \
|
||||||
|
(G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_ADDRESS))
|
||||||
|
#define GNC_IS_ADDRESS_CLASS(k) \
|
||||||
|
(G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_ADDRESS))
|
||||||
|
#define GNC_ADDRESS_GET_CLASS(o) \
|
||||||
|
(G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_ADDRESS, GncAddressClass))
|
||||||
|
GType gnc_address_get_type(void);
|
||||||
|
|
||||||
/** @name Create/Destroy functions
|
/** @name Create/Destroy functions
|
||||||
@{ */
|
@{ */
|
||||||
|
Loading…
Reference in New Issue
Block a user