diff options
author | raveit65 <[email protected]> | 2016-06-23 11:21:56 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2016-06-24 20:48:20 +0200 |
commit | fb38cc04440c424834984bdfe364b7d772af2dd4 (patch) | |
tree | 88e2d92ea118aee360a6187eedc542991b47891e /libdocument | |
parent | 34d6b91ff4cc64f151782beff6cd13b665d0d704 (diff) | |
download | atril-fb38cc04440c424834984bdfe364b7d772af2dd4.tar.bz2 atril-fb38cc04440c424834984bdfe364b7d772af2dd4.tar.xz |
libdocument: Use G_DEFINE_BOXED_TYPE instead of custom macro
taken from:
https://git.gnome.org/browse/evince/commit/?id=c839e45
Diffstat (limited to 'libdocument')
-rw-r--r-- | libdocument/ev-document.c | 6 | ||||
-rw-r--r-- | libdocument/ev-document.h | 19 |
2 files changed, 3 insertions, 22 deletions
diff --git a/libdocument/ev-document.c b/libdocument/ev-document.c index b2c5ab41..a929b3be 100644 --- a/libdocument/ev-document.c +++ b/libdocument/ev-document.c @@ -733,7 +733,7 @@ ev_document_find_page_by_label (EvDocument *document, } /* EvDocumentInfo */ -EV_DEFINE_BOXED_TYPE (EvDocumentInfo, ev_document_info, ev_document_info_copy, ev_document_info_free) +G_DEFINE_BOXED_TYPE (EvDocumentInfo, ev_document_info, ev_document_info_copy, ev_document_info_free) EvDocumentInfo * ev_document_info_copy (EvDocumentInfo *info) @@ -793,7 +793,7 @@ ev_document_info_free (EvDocumentInfo *info) } /* EvDocumentLicense */ -EV_DEFINE_BOXED_TYPE (EvDocumentLicense, ev_document_license, ev_document_license_copy, ev_document_license_free) +G_DEFINE_BOXED_TYPE (EvDocumentLicense, ev_document_license, ev_document_license_copy, ev_document_license_free) EvDocumentLicense * ev_document_license_new (void) @@ -853,7 +853,7 @@ ev_document_license_get_web_statement (EvDocumentLicense *license) } /* EvRectangle */ -EV_DEFINE_BOXED_TYPE (EvRectangle, ev_rectangle, ev_rectangle_copy, ev_rectangle_free) +G_DEFINE_BOXED_TYPE (EvRectangle, ev_rectangle, ev_rectangle_copy, ev_rectangle_free) EvRectangle * ev_rectangle_new (void) diff --git a/libdocument/ev-document.h b/libdocument/ev-document.h index 6496f5de..1089d79c 100644 --- a/libdocument/ev-document.h +++ b/libdocument/ev-document.h @@ -289,25 +289,6 @@ register_atril_backend (GTypeModule *module) \ #define EV_BACKEND_REGISTER(BackendName, backend_name) \ EV_BACKEND_REGISTER_WITH_CODE(BackendName, backend_name, ;) -/* - * A convenience macro for boxed type implementations, which defines a - * type_name_get_type() function registering the boxed type. - */ -#define EV_DEFINE_BOXED_TYPE(TypeName, type_name, copy_func, free_func) \ -GType \ -type_name##_get_type (void) \ -{ \ - static volatile gsize g_define_type_id__volatile = 0; \ - if (g_once_init_enter (&g_define_type_id__volatile)) { \ - GType g_define_type_id = \ - g_boxed_type_register_static (g_intern_static_string (#TypeName), \ - (GBoxedCopyFunc) copy_func, \ - (GBoxedFreeFunc) free_func); \ - g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); \ - } \ - return g_define_type_id__volatile; \ -} - G_END_DECLS #endif /* EV_DOCUMENT_H */ |