[libgda] gda-transaction-status: ported to G_DECLARE*



commit c7586d71e4f00be008f39404036140cc4975a52c
Author: Daniel Espinosa <esodan gmail com>
Date:   Wed Sep 19 09:02:57 2018 -0500

    gda-transaction-status: ported to G_DECLARE*

 libgda/gda-transaction-status.h | 53 +++++++++++++----------------------------
 1 file changed, 17 insertions(+), 36 deletions(-)
---
diff --git a/libgda/gda-transaction-status.h b/libgda/gda-transaction-status.h
index 0633cbe72..fbe4f4b1a 100644
--- a/libgda/gda-transaction-status.h
+++ b/libgda/gda-transaction-status.h
@@ -29,16 +29,7 @@
 
 G_BEGIN_DECLS
 
-#define GDA_TYPE_TRANSACTION_STATUS            (gda_transaction_status_get_type())
-#define GDA_TRANSACTION_STATUS(obj)            (G_TYPE_CHECK_INSTANCE_CAST (obj, 
GDA_TYPE_TRANSACTION_STATUS, GdaTransactionStatus))
-#define GDA_TRANSACTION_STATUS_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST (klass, GDA_TYPE_TRANSACTION_STATUS, 
GdaTransactionStatusClass))
-#define GDA_IS_TRANSACTION_STATUS(obj)         (G_TYPE_CHECK_INSTANCE_TYPE(obj, GDA_TYPE_TRANSACTION_STATUS))
-#define GDA_IS_TRANSACTION_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), 
GDA_TYPE_TRANSACTION_STATUS))
-#define GDA_TYPE_TRANSACTION_STATUS_EVENT      (gda_transaction_status_event_get_type())
 
-typedef struct _GdaTransactionStatus        GdaTransactionStatus;
-typedef struct _GdaTransactionStatusClass   GdaTransactionStatusClass;
-typedef struct _GdaTransactionStatusEvent   GdaTransactionStatusEvent;
 
 /**
  * GdaTransactionStatusEventType:
@@ -62,13 +53,28 @@ typedef enum {
        GDA_TRANSACTION_STATUS_STATE_FAILED
 } GdaTransactionStatusState;
 
+#define GDA_TYPE_TRANSACTION_STATUS            (gda_transaction_status_get_type())
+G_DECLARE_DERIVABLE_TYPE (GdaTransactionStatus, gda_transaction_status, GDA, TRANSACTION_STATUS, GObject)
+
+struct _GdaTransactionStatusClass {
+       GObjectClass             parent_class;
+
+       /*< private >*/
+       /* Padding for future expansion */
+       void (*_gda_reserved1) (void);
+       void (*_gda_reserved2) (void);
+       void (*_gda_reserved3) (void);
+       void (*_gda_reserved4) (void);
+};
+
+
 /**
  * GdaTransactionStatusEvent:
  * @trans: 
  * @type: 
  * @conn_event:
  */
-struct _GdaTransactionStatusEvent {
+typedef struct {
        GdaTransactionStatus         *trans;
        GdaTransactionStatusEventType type;
        union {
@@ -81,31 +87,7 @@ struct _GdaTransactionStatusEvent {
        /*< private >*/
        gpointer  _gda_reserved1;
        gpointer  _gda_reserved2;
-};
-
-/**
- * GdaTransactionStatus:
- * @name:
- * @isolation_level:
- * @state:
- * @events: (element-type Gda.TransactionStatusEvent):
- *
- */
-struct _GdaTransactionStatus {
-       GObject                    object;
-};
-
-struct _GdaTransactionStatusClass {
-       GObjectClass             parent_class;
-
-       /*< private >*/
-       /* Padding for future expansion */
-       void (*_gda_reserved1) (void);
-       void (*_gda_reserved2) (void);
-       void (*_gda_reserved3) (void);
-       void (*_gda_reserved4) (void);
-};
-
+} GdaTransactionStatusEvent;
 /**
  * SECTION:gda-transaction-status
  * @short_description: Keeps track of the transaction status of a connection
@@ -127,7 +109,6 @@ struct _GdaTransactionStatusClass {
  * #GdaTransactionStatus's attributes are directly accessible using the public members of the object.
  */
 
-GType                 gda_transaction_status_get_type (void) G_GNUC_CONST;
 GdaTransactionStatus *gda_transaction_status_new      (const gchar *name);
 void                    gda_transaction_status_set_isolation_level (GdaTransactionStatus *st, 
GdaTransactionIsolation il);
 GdaTransactionIsolation gda_transaction_status_get_isolation_level (GdaTransactionStatus *st);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]