Start adding gobject-introspection support
This commit is contained in:
parent
9527fb200f
commit
c214cff55c
13
configure.ac
13
configure.ac
|
@ -74,12 +74,23 @@ fi
|
|||
dnl ==========================================================================
|
||||
|
||||
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, have_glib=true, have_glib=false)
|
||||
PKG_CHECK_MODULES(GTHREAD, gthread-2.0, , have_glib=false)
|
||||
if $have_glib; then
|
||||
AC_DEFINE(HAVE_GLIB, 1, [Have glib2 library])
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_GLIB, $have_glib)
|
||||
|
||||
PKG_CHECK_MODULES(GTHREAD, gthread-2.0, have_gthread=true, have_gthread=false)
|
||||
if $have_gthread; then
|
||||
AC_DEFINE(HAVE_GTHREAD, 1, [Have gthread2 library])
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_GTHREAD, $have_gthread)
|
||||
|
||||
PKG_CHECK_MODULES(GOBJECT, gobject-2.0, have_gobject=true, have_gobject=false)
|
||||
if $have_gobject; then
|
||||
AC_DEFINE(HAVE_GOBJECT, 1, [Have gobject2 library])
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_GOBJECT, $have_gobject)
|
||||
|
||||
dnl ==========================================================================
|
||||
|
||||
PKG_CHECK_MODULES(CAIRO, cairo >= 1.8.0, have_cairo=true, have_cairo=false)
|
||||
|
|
|
@ -83,45 +83,36 @@ endif
|
|||
if HAVE_GLIB
|
||||
HBCFLAGS += $(GLIB_CFLAGS)
|
||||
HBLIBS += $(GLIB_LIBS)
|
||||
HBSOURCES += \
|
||||
hb-glib.cc \
|
||||
$(NULL)
|
||||
HBHEADERS += \
|
||||
hb-glib.h \
|
||||
$(NULL)
|
||||
HBSOURCES += hb-glib.cc
|
||||
HBHEADERS += hb-glib.h
|
||||
endif
|
||||
|
||||
if HAVE_GOBJECT
|
||||
HBCFLAGS += $(GOBJECT_CFLAGS)
|
||||
HBLIBS += $(GOBJECT_LIBS)
|
||||
HBSOURCES += hb-gobject.cc
|
||||
HBHEADERS += hb-gobject.h
|
||||
endif
|
||||
|
||||
if HAVE_ICU
|
||||
HBCFLAGS += $(ICU_CFLAGS)
|
||||
HBLIBS += $(ICU_LIBS)
|
||||
HBSOURCES += \
|
||||
hb-icu.cc \
|
||||
$(NULL)
|
||||
HBHEADERS += \
|
||||
hb-icu.h \
|
||||
$(NULL)
|
||||
HBSOURCES += hb-icu.cc
|
||||
HBHEADERS += hb-icu.h
|
||||
endif
|
||||
|
||||
if HAVE_FREETYPE
|
||||
HBCFLAGS += $(FREETYPE_CFLAGS)
|
||||
HBLIBS += $(FREETYPE_LIBS)
|
||||
HBSOURCES += \
|
||||
hb-ft.cc \
|
||||
$(NULL)
|
||||
HBHEADERS += \
|
||||
hb-ft.h \
|
||||
$(NULL)
|
||||
HBSOURCES += hb-ft.cc
|
||||
HBHEADERS += hb-ft.h
|
||||
endif
|
||||
|
||||
if HAVE_UNISCRIBE
|
||||
HBCFLAGS += $(UNISCRIBE_CFLAGS)
|
||||
HBLIBS += $(UNISCRIBE_LIBS)
|
||||
HBSOURCES += \
|
||||
hb-uniscribe-shape.cc \
|
||||
$(NULL)
|
||||
HBHEADERS += \
|
||||
hb-uniscribe.h \
|
||||
$(NULL)
|
||||
HBSOURCES += hb-uniscribe-shape.cc
|
||||
HBHEADERS += hb-uniscribe.h
|
||||
endif
|
||||
|
||||
CXXLINK = $(LINK)
|
||||
|
@ -177,4 +168,8 @@ TESTS_ENVIRONMENT = \
|
|||
HBHEADERS="$(HBHEADERS)" \
|
||||
$(NULL)
|
||||
|
||||
scan:
|
||||
g-ir-scanner $(HBCFLAGS) $(HBHEADERS) -n hb --strip-prefix=hb --library libharfbuzz.la
|
||||
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
|
|
@ -306,6 +306,7 @@ hb_script_get_horizontal_direction (hb_script_t script);
|
|||
/* User data */
|
||||
|
||||
typedef struct _hb_user_data_key_t {
|
||||
/*< private >*/
|
||||
char unused;
|
||||
} hb_user_data_key_t;
|
||||
|
||||
|
|
|
@ -32,8 +32,6 @@
|
|||
|
||||
#include "hb-unicode-private.hh"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
|
||||
#if !GLIB_CHECK_VERSION(2,29,14)
|
||||
static const hb_script_t
|
||||
|
@ -349,4 +347,3 @@ hb_glib_get_unicode_funcs (void)
|
|||
return &_hb_glib_unicode_funcs;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
* Copyright © 2011 Google, Inc.
|
||||
*
|
||||
* This is part of HarfBuzz, a text shaping library.
|
||||
*
|
||||
* Permission is hereby granted, without written agreement and without
|
||||
* license or royalty fees, to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose, provided that the
|
||||
* above copyright notice and the following two paragraphs appear in
|
||||
* all copies of this software.
|
||||
*
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
|
||||
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
||||
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
|
||||
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
*
|
||||
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
|
||||
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
|
||||
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
|
||||
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
||||
*
|
||||
* Google Author(s): Behdad Esfahbod
|
||||
*/
|
||||
|
||||
#include "hb-private.hh"
|
||||
|
||||
/* g++ didn't like older gtype.h gcc-only code path. */
|
||||
#include <glib.h>
|
||||
#if !GLIB_CHECK_VERSION(2,29,16)
|
||||
#undef __GNUC__
|
||||
#undef __GNUC_MINOR__
|
||||
#define __GNUC__ 2
|
||||
#define __GNUC_MINOR__ 6
|
||||
#endif
|
||||
|
||||
#include "hb-gobject.h"
|
||||
|
||||
#define _HB_DEFINE_BOXED_TYPE(Name,underscore_name,copy_func,free_func) \
|
||||
GType \
|
||||
underscore_name##_get_type (void) \
|
||||
{ \
|
||||
static volatile gsize type = 0; \
|
||||
if (g_once_init_enter (&type)) { \
|
||||
GType t = g_boxed_type_register_static (g_intern_static_string (#Name), \
|
||||
(GBoxedCopyFunc) copy_func, \
|
||||
(GBoxedFreeFunc) free_func); \
|
||||
g_once_init_leave (&type, t); \
|
||||
} \
|
||||
return type; \
|
||||
}
|
||||
|
||||
#define HB_DEFINE_BOXED_TYPE(name) \
|
||||
_HB_DEFINE_BOXED_TYPE (hb_##name, hb_gobject_##name, hb_##name##_reference, hb_##name##_destroy);
|
||||
|
||||
HB_DEFINE_BOXED_TYPE (buffer)
|
||||
HB_DEFINE_BOXED_TYPE (blob)
|
||||
HB_DEFINE_BOXED_TYPE (face)
|
||||
HB_DEFINE_BOXED_TYPE (font)
|
||||
HB_DEFINE_BOXED_TYPE (font_funcs)
|
||||
HB_DEFINE_BOXED_TYPE (unicode_funcs)
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* Copyright © 2011 Google, Inc.
|
||||
*
|
||||
* This is part of HarfBuzz, a text shaping library.
|
||||
*
|
||||
* Permission is hereby granted, without written agreement and without
|
||||
* license or royalty fees, to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose, provided that the
|
||||
* above copyright notice and the following two paragraphs appear in
|
||||
* all copies of this software.
|
||||
*
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
|
||||
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
||||
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
|
||||
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
*
|
||||
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
|
||||
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
|
||||
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
|
||||
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
||||
*
|
||||
* Google Author(s): Behdad Esfahbod
|
||||
*/
|
||||
|
||||
#ifndef HB_GOBJECT_H
|
||||
#define HB_GOBJECT_H
|
||||
|
||||
#include "hb.h"
|
||||
#include <glib-object.h>
|
||||
|
||||
HB_BEGIN_DECLS
|
||||
|
||||
|
||||
/* Objects */
|
||||
|
||||
#define HB_GOBJECT_TYPE_BLOB hb_gobject_blob_get_type ()
|
||||
GType
|
||||
hb_gobject_blob_get_type (void);
|
||||
|
||||
#define HB_GOBJECT_TYPE_BUFFER hb_gobject_buffer_get_type ()
|
||||
GType
|
||||
hb_gobject_buffer_get_type (void);
|
||||
|
||||
#define HB_GOBJECT_TYPE_FACE hb_gobject_face_get_type ()
|
||||
GType
|
||||
hb_gobject_face_get_type (void);
|
||||
|
||||
#define HB_GOBJECT_TYPE_FONT hb_gobject_font_get_type ()
|
||||
GType
|
||||
hb_gobject_font_get_type (void);
|
||||
|
||||
#define HB_GOBJECT_TYPE_FONT_FUNCS hb_gobject_font_funcs_get_type ()
|
||||
GType
|
||||
hb_gobject_font_funcs_get_type (void);
|
||||
|
||||
#define HB_GOBJECT_TYPE_UNICODE_FUNCS hb_gobject_unicode_funcs_get_type ()
|
||||
GType
|
||||
hb_gobject_unicode_funcs_get_type (void);
|
||||
|
||||
|
||||
/* Enums */
|
||||
|
||||
|
||||
HB_END_DECLS
|
||||
|
||||
#endif /* HB_GOBJECT_H */
|
Loading…
Reference in New Issue