tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

GraphiteStructsForRLBox.h (3895B)


      1 // -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
      2 // vim: set ts=2 et sw=2 tw=80:
      3 // This Source Code is subject to the terms of the Mozilla Public License
      4 // version 2.0 (the "License"). You can obtain a copy of the License at
      5 // http://mozilla.org/MPL/2.0/.
      6 
      7 #ifndef GraphiteStructsForRLBox_h__
      8 #define GraphiteStructsForRLBox_h__
      9 
     10 #if defined(__clang__)
     11 #  pragma clang diagnostic push
     12 #  pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
     13 #elif defined(__GNUC__) || defined(__GNUG__)
     14 // Can't turn off the variadic macro warning emitted from -pedantic
     15 #  pragma GCC system_header
     16 #elif defined(_MSC_VER)
     17 // Doesn't seem to emit the warning
     18 #else
     19 // Don't know the compiler... just let it go through
     20 #endif
     21 
     22 // Note that the two size fields below are actually size_t in the headers
     23 // However RLBox currently does not handle these correctly. See Bug 1722127.
     24 // Use a workaround of unsiged int instead of size_t.
     25 #define sandbox_fields_reflection_graphite_class_gr_font_ops(f, g, ...)                       \
     26  f(unsigned int, size, FIELD_NORMAL, ##__VA_ARGS__) g()                                            \
     27  f(float (*)(const void*, unsigned short), glyph_advance_x, FIELD_NORMAL, ##__VA_ARGS__) g() \
     28  f(float (*)(const void*, unsigned short), glyph_advance_y, FIELD_NORMAL, ##__VA_ARGS__) g()
     29 
     30 #define sandbox_fields_reflection_graphite_class_gr_face_ops(f, g, ...)                              \
     31  f(unsigned int, size, FIELD_NORMAL, ##__VA_ARGS__) g()                                                   \
     32  f(const void* (*)(const void*, unsigned int, unsigned int*), get_table, FIELD_NORMAL, ##__VA_ARGS__) g() \
     33  f(void (*)(const void*, const void*), release_table, FIELD_NORMAL, ##__VA_ARGS__) g()
     34 
     35 #define sandbox_fields_reflection_graphite_class_gr_glyph_to_char_cluster(f, g, ...) \
     36  f(unsigned int, baseChar, FIELD_NORMAL, ##__VA_ARGS__) g()                               \
     37  f(unsigned int, baseGlyph, FIELD_NORMAL, ##__VA_ARGS__) g()                              \
     38  f(unsigned int, nChars, FIELD_NORMAL, ##__VA_ARGS__) g()                                 \
     39  f(unsigned int, nGlyphs, FIELD_NORMAL, ##__VA_ARGS__) g()
     40 
     41 #define sandbox_fields_reflection_graphite_class_gr_glyph_to_char_association(f, g, ...) \
     42  f(gr_glyph_to_char_cluster*, clusters, FIELD_NORMAL, ##__VA_ARGS__) g()           \
     43  f(unsigned short*, gids, FIELD_NORMAL, ##__VA_ARGS__) g()                               \
     44  f(float*, xLocs, FIELD_NORMAL, ##__VA_ARGS__) g()                                       \
     45  f(float*, yLocs, FIELD_NORMAL, ##__VA_ARGS__) g()                                       \
     46  f(unsigned int, cIndex, FIELD_NORMAL, ##__VA_ARGS__) g()
     47 
     48 #define sandbox_fields_reflection_graphite_class_gr_faceinfo(f, g, ...)                    \
     49  f(short, extra_ascent, FIELD_NORMAL, ##__VA_ARGS__) g()                                  \
     50  f(short, extra_descent, FIELD_NORMAL, ##__VA_ARGS__) g()                                 \
     51  f(short, upem, FIELD_NORMAL, ##__VA_ARGS__) g()                                          \
     52  f(gr_faceinfo::gr_space_contextuals, space_contextuals, FIELD_NORMAL, ##__VA_ARGS__) g() \
     53  f(unsigned int, has_bidi_pass, FIELD_NORMAL, ##__VA_ARGS__) g()
     54  // Remaining bitfields skipped, as bitfields are not fully supported
     55 
     56 #define sandbox_fields_reflection_graphite_allClasses(f, ...)                  \
     57  f(gr_font_ops, graphite, ##__VA_ARGS__)                                      \
     58  f(gr_face_ops, graphite, ##__VA_ARGS__)                                      \
     59  f(gr_glyph_to_char_cluster, graphite, ##__VA_ARGS__)                         \
     60  f(gr_glyph_to_char_association, graphite, ##__VA_ARGS__)                     \
     61  f(gr_faceinfo, graphite, ##__VA_ARGS__)
     62 
     63 #if defined(__clang__)
     64 #  pragma clang diagnostic pop
     65 #elif defined(__GNUC__) || defined(__GNUG__)
     66 #elif defined(_MSC_VER)
     67 #else
     68 #endif
     69 
     70 #endif