From fcbec57ab6bb7526db93548b8c0cd30e54a3e181 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Wed, 19 Oct 2016 19:16:52 +0800 Subject: Rename internal headers to follow pattern *-imp.h. --- source/fitz/bidi-imp.h | 77 +++++++++++++++++++++++++++++++++++++++++ source/fitz/bidi-impl.h | 79 ------------------------------------------- source/fitz/bidi-std.c | 2 +- source/fitz/bidi.c | 2 +- source/fitz/colorspace-imp.h | 16 +++++++++ source/fitz/colorspace-impl.h | 16 --------- source/fitz/colorspace.c | 2 +- source/fitz/font-imp.h | 44 ++++++++++++++++++++++++ source/fitz/font-impl.h | 50 --------------------------- source/fitz/font.c | 2 +- source/pdf/pdf-colorspace.c | 2 +- source/pdf/pdf-font.c | 2 +- source/pdf/pdf-type3.c | 2 +- 13 files changed, 144 insertions(+), 152 deletions(-) create mode 100644 source/fitz/bidi-imp.h delete mode 100644 source/fitz/bidi-impl.h create mode 100644 source/fitz/colorspace-imp.h delete mode 100644 source/fitz/colorspace-impl.h create mode 100644 source/fitz/font-imp.h delete mode 100644 source/fitz/font-impl.h (limited to 'source') diff --git a/source/fitz/bidi-imp.h b/source/fitz/bidi-imp.h new file mode 100644 index 00000000..cb0f8871 --- /dev/null +++ b/source/fitz/bidi-imp.h @@ -0,0 +1,77 @@ +/* For use with Bidi Reference Implementation + For more information see the associated file bidi-std.c + + Credits: + ------- + Written by: Asmus Freytag + Command line interface by: Rick McGowan + Verification (v24): Doug Felt + + Disclaimer and legal rights: + --------------------------- + Copyright (C) 1999-2009, ASMUS, Inc. All Rights Reserved. + Distributed under the Terms of Use in http://www.unicode.org/copyright.html. + + THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE + BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, + OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE SOFTWARE. +*/ + +/* Bidirectional Character Types + * as defined by the Unicode Bidirectional Algorithm Table 3-7. + * The list of bidirectional character types here is not grouped the + * same way as the table 3-7, since the numeric values for the types + * are chosen to keep the state and action tables compact. + */ +enum +{ + /* input types */ + /* ON MUST be zero, code relies on ON = N = 0 */ + BDI_ON = 0, /* Other Neutral */ + BDI_L, /* Left-to-right Letter */ + BDI_R, /* Right-to-left Letter */ + BDI_AN, /* Arabic Number */ + BDI_EN, /* European Number */ + BDI_AL, /* Arabic Letter (Right-to-left) */ + BDI_NSM, /* Non-spacing Mark */ + BDI_CS, /* Common Separator */ + BDI_ES, /* European Separator */ + BDI_ET, /* European Terminator (post/prefix e.g. $ and %) */ + + /* resolved types */ + BDI_BN, /* Boundary neutral (type of RLE etc after explicit levels)*/ + + /* input types, */ + BDI_S, /* Segment Separator (TAB) used only in L1 */ + BDI_WS, /* White space used only in L1 */ + BDI_B, /* Paragraph Separator (aka as PS) */ + + /* types for explicit controls */ + BDI_RLO, /* these are used only in X1-X9 */ + BDI_RLE, + BDI_LRO, + BDI_LRE, + BDI_PDF, + + /* resolved types, also resolved directions */ + BDI_N = BDI_ON /* alias, where ON, WS and S are treated the same */ +}; + +typedef int fz_bidi_level; /* Note: Max level is 125 */ +typedef uint8_t fz_bidi_chartype; + +enum +{ + BIDI_LEVEL_MAX = 125 /* Updated for 6.3.0 */ +}; + +void fz_bidi_resolve_neutrals(fz_bidi_level baselevel, fz_bidi_chartype *pcls, const fz_bidi_level *plevel, size_t cch); +void fz_bidi_resolve_implicit(const fz_bidi_chartype *pcls, fz_bidi_level *plevel, size_t cch); +void fz_bidi_resolve_weak(fz_context *ctx, fz_bidi_level baselevel, fz_bidi_chartype *pcls, fz_bidi_level *plevel, size_t cch); +void fz_bidi_resolve_whitespace(fz_bidi_level baselevel, const fz_bidi_chartype *pcls, fz_bidi_level *plevel, size_t cch); +size_t fz_bidi_resolve_explicit(fz_bidi_level level, fz_bidi_chartype dir, fz_bidi_chartype *pcls, fz_bidi_level *plevel, size_t cch, fz_bidi_level nNest); diff --git a/source/fitz/bidi-impl.h b/source/fitz/bidi-impl.h deleted file mode 100644 index 08749879..00000000 --- a/source/fitz/bidi-impl.h +++ /dev/null @@ -1,79 +0,0 @@ -/* For use with Bidi Reference Implementation - For more information see the associated file bidi-std.c - - Credits: - ------- - Written by: Asmus Freytag - Command line interface by: Rick McGowan - Verification (v24): Doug Felt - - Disclaimer and legal rights: - --------------------------- - Copyright (C) 1999-2009, ASMUS, Inc. All Rights Reserved. - Distributed under the Terms of Use in http://www.unicode.org/copyright.html. - - THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE - BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, - OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE SOFTWARE. -*/ - -#include "mupdf/fitz.h" - -/* Bidirectional Character Types - * as defined by the Unicode Bidirectional Algorithm Table 3-7. - * The list of bidirectional character types here is not grouped the - * same way as the table 3-7, since the numeric values for the types - * are chosen to keep the state and action tables compact. - */ -enum -{ - /* input types */ - /* ON MUST be zero, code relies on ON = N = 0 */ - BDI_ON = 0, /* Other Neutral */ - BDI_L, /* Left-to-right Letter */ - BDI_R, /* Right-to-left Letter */ - BDI_AN, /* Arabic Number */ - BDI_EN, /* European Number */ - BDI_AL, /* Arabic Letter (Right-to-left) */ - BDI_NSM, /* Non-spacing Mark */ - BDI_CS, /* Common Separator */ - BDI_ES, /* European Separator */ - BDI_ET, /* European Terminator (post/prefix e.g. $ and %) */ - - /* resolved types */ - BDI_BN, /* Boundary neutral (type of RLE etc after explicit levels)*/ - - /* input types, */ - BDI_S, /* Segment Separator (TAB) used only in L1 */ - BDI_WS, /* White space used only in L1 */ - BDI_B, /* Paragraph Separator (aka as PS) */ - - /* types for explicit controls */ - BDI_RLO, /* these are used only in X1-X9 */ - BDI_RLE, - BDI_LRO, - BDI_LRE, - BDI_PDF, - - /* resolved types, also resolved directions */ - BDI_N = BDI_ON /* alias, where ON, WS and S are treated the same */ -}; - -typedef int fz_bidi_level; /* Note: Max level is 125 */ -typedef uint8_t fz_bidi_chartype; - -enum -{ - BIDI_LEVEL_MAX = 125 /* Updated for 6.3.0 */ -}; - -void fz_bidi_resolve_neutrals(fz_bidi_level baselevel, fz_bidi_chartype *pcls, const fz_bidi_level *plevel, size_t cch); -void fz_bidi_resolve_implicit(const fz_bidi_chartype *pcls, fz_bidi_level *plevel, size_t cch); -void fz_bidi_resolve_weak(fz_context *ctx, fz_bidi_level baselevel, fz_bidi_chartype *pcls, fz_bidi_level *plevel, size_t cch); -void fz_bidi_resolve_whitespace(fz_bidi_level baselevel, const fz_bidi_chartype *pcls, fz_bidi_level *plevel, size_t cch); -size_t fz_bidi_resolve_explicit(fz_bidi_level level, fz_bidi_chartype dir, fz_bidi_chartype *pcls, fz_bidi_level *plevel, size_t cch, fz_bidi_level nNest); diff --git a/source/fitz/bidi-std.c b/source/fitz/bidi-std.c index 1f88bdee..792db71b 100644 --- a/source/fitz/bidi-std.c +++ b/source/fitz/bidi-std.c @@ -4,7 +4,7 @@ // Bidi include file #include "mupdf/fitz.h" -#include "bidi-impl.h" +#include "bidi-imp.h" #ifndef TRUE #define TRUE (1) diff --git a/source/fitz/bidi.c b/source/fitz/bidi.c index 6f011310..4436b615 100644 --- a/source/fitz/bidi.c +++ b/source/fitz/bidi.c @@ -35,7 +35,7 @@ */ #include "mupdf/fitz.h" -#include "bidi-impl.h" /* standard bidi code interface */ +#include "bidi-imp.h" /* standard bidi code interface */ /* * Macros... diff --git a/source/fitz/colorspace-imp.h b/source/fitz/colorspace-imp.h new file mode 100644 index 00000000..4d3f8825 --- /dev/null +++ b/source/fitz/colorspace-imp.h @@ -0,0 +1,16 @@ +#ifndef MUPDF_FITZ_COLORSPACE_IMP_H +#define MUPDF_FITZ_COLORSPACE_IMP_H + +struct fz_colorspace_s +{ + fz_storable storable; + size_t size; + char name[16]; + int n; + fz_colorspace_convert_fn *to_rgb; + fz_colorspace_convert_fn *from_rgb; + fz_colorspace_destruct_fn *free_data; + void *data; +}; + +#endif diff --git a/source/fitz/colorspace-impl.h b/source/fitz/colorspace-impl.h deleted file mode 100644 index 1ce2e167..00000000 --- a/source/fitz/colorspace-impl.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef MUPDF_FITZ_COLORSPACE_IMPL_H -#define MUPDF_FITZ_COLORSPACE_IMPL_H - -struct fz_colorspace_s -{ - fz_storable storable; - size_t size; - char name[16]; - int n; - fz_colorspace_convert_fn *to_rgb; - fz_colorspace_convert_fn *from_rgb; - fz_colorspace_destruct_fn *free_data; - void *data; -}; - -#endif diff --git a/source/fitz/colorspace.c b/source/fitz/colorspace.c index 0842c7f1..828054c0 100644 --- a/source/fitz/colorspace.c +++ b/source/fitz/colorspace.c @@ -1,6 +1,6 @@ #include "mupdf/fitz.h" -#include "colorspace-impl.h" +#include "colorspace-imp.h" #define SLOWCMYK diff --git a/source/fitz/font-imp.h b/source/fitz/font-imp.h new file mode 100644 index 00000000..59ae628e --- /dev/null +++ b/source/fitz/font-imp.h @@ -0,0 +1,44 @@ +#ifndef MUPDF_FITZ_FONT_IMP_H +#define MUPDF_FITZ_FONT_IMP_H + +struct fz_font_s +{ + int refs; + char name[32]; + fz_buffer *buffer; + + fz_font_flags_t flags; + + void *ft_face; /* has an FT_Face if used */ + fz_shaper_data_t shaper_data; + + fz_matrix t3matrix; + void *t3resources; + fz_buffer **t3procs; /* has 256 entries if used */ + struct fz_display_list_s **t3lists; /* has 256 entries if used */ + float *t3widths; /* has 256 entries if used */ + unsigned short *t3flags; /* has 256 entries if used */ + void *t3doc; /* a pdf_document for the callback */ + void (*t3run)(fz_context *ctx, void *doc, void *resources, fz_buffer *contents, struct fz_device_s *dev, const fz_matrix *ctm, void *gstate, int nestedDepth); + void (*t3freeres)(fz_context *ctx, void *doc, void *resources); + + fz_rect bbox; /* font bbox is used only for t3 fonts */ + + int glyph_count; + + /* per glyph bounding box cache */ + fz_rect *bbox_table; + + /* substitute metrics */ + int width_count; + short width_default; /* in 1000 units */ + short *width_table; /* in 1000 units */ + + /* cached glyph metrics */ + float *advance_cache; + + /* cached encoding lookup */ + uint16_t *encoding_cache[256]; +}; + +#endif diff --git a/source/fitz/font-impl.h b/source/fitz/font-impl.h deleted file mode 100644 index 231940ed..00000000 --- a/source/fitz/font-impl.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef MUPDF_FITZ_FONT_IMPL_H -#define MUPDF_FITZ_FONT_IMPL_H - -#include "mupdf/fitz/font.h" - -/* forward declaration for circular dependency */ -struct fz_device_s; -struct fz_display_list_s; - -struct fz_font_s -{ - int refs; - char name[32]; - fz_buffer *buffer; - - fz_font_flags_t flags; - - void *ft_face; /* has an FT_Face if used */ - fz_shaper_data_t shaper_data; - - fz_matrix t3matrix; - void *t3resources; - fz_buffer **t3procs; /* has 256 entries if used */ - struct fz_display_list_s **t3lists; /* has 256 entries if used */ - float *t3widths; /* has 256 entries if used */ - unsigned short *t3flags; /* has 256 entries if used */ - void *t3doc; /* a pdf_document for the callback */ - void (*t3run)(fz_context *ctx, void *doc, void *resources, fz_buffer *contents, struct fz_device_s *dev, const fz_matrix *ctm, void *gstate, int nestedDepth); - void (*t3freeres)(fz_context *ctx, void *doc, void *resources); - - fz_rect bbox; /* font bbox is used only for t3 fonts */ - - int glyph_count; - - /* per glyph bounding box cache */ - fz_rect *bbox_table; - - /* substitute metrics */ - int width_count; - short width_default; /* in 1000 units */ - short *width_table; /* in 1000 units */ - - /* cached glyph metrics */ - float *advance_cache; - - /* cached encoding lookup */ - uint16_t *encoding_cache[256]; -}; - -#endif diff --git a/source/fitz/font.c b/source/fitz/font.c index e3ae4d7d..92642ec0 100644 --- a/source/fitz/font.c +++ b/source/fitz/font.c @@ -1,6 +1,6 @@ #include "mupdf/fitz.h" -#include "font-impl.h" +#include "font-imp.h" #include #include "hb.h" diff --git a/source/pdf/pdf-colorspace.c b/source/pdf/pdf-colorspace.c index 05c54b31..a1fd8140 100644 --- a/source/pdf/pdf-colorspace.c +++ b/source/pdf/pdf-colorspace.c @@ -1,6 +1,6 @@ #include "mupdf/pdf.h" -#include "../fitz/colorspace-impl.h" +#include "../fitz/colorspace-imp.h" /* ICCBased */ diff --git a/source/pdf/pdf-font.c b/source/pdf/pdf-font.c index 133462d6..5b5c7735 100644 --- a/source/pdf/pdf-font.c +++ b/source/pdf/pdf-font.c @@ -1,6 +1,6 @@ #include "mupdf/pdf.h" -#include "../fitz/font-impl.h" +#include "../fitz/font-imp.h" #include #include FT_FREETYPE_H diff --git a/source/pdf/pdf-type3.c b/source/pdf/pdf-type3.c index 3992ebbc..ede5a5ee 100644 --- a/source/pdf/pdf-type3.c +++ b/source/pdf/pdf-type3.c @@ -1,6 +1,6 @@ #include "mupdf/pdf.h" -#include "../fitz/font-impl.h" +#include "../fitz/font-imp.h" static void pdf_run_glyph_func(fz_context *ctx, void *doc, void *rdb, fz_buffer *contents, fz_device *dev, const fz_matrix *ctm, void *gstate, int nested_depth) -- cgit v1.2.3