| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
#ifndef _ANDROID_GRAPHICS_FONT_UTILS_H_ |
| 18 |
#define _ANDROID_GRAPHICS_FONT_UTILS_H_ |
| 19 |
|
| 20 |
#include <jni.h> |
| 21 |
#include <memory> |
| 22 |
#include <utility> |
| 23 |
|
| 24 |
#include <minikin/Font.h> |
| 25 |
|
| 26 |
namespace minikin { |
| 27 |
class FontFamily; |
| 28 |
} |
| 29 |
|
| 30 |
namespace android { |
| 31 |
|
| 32 |
struct FontFamilyWrapper { |
| 33 |
explicit FontFamilyWrapper(std::shared_ptr<minikin::FontFamily>&& family) : family(family) {} |
| 34 |
std::shared_ptr<minikin::FontFamily> family; |
| 35 |
}; |
| 36 |
|
| 37 |
struct FontWrapper { |
| 38 |
explicit FontWrapper(std::shared_ptr<minikin::Font>&& font) : font(font) {} |
| 39 |
std::shared_ptr<minikin::Font> font; |
| 40 |
}; |
| 41 |
|
| 42 |
|
| 43 |
class ListHelper { |
| 44 |
public: |
| 45 |
ListHelper(JNIEnv* env, jobject list) : mEnv(env), mList(list) {} |
| 46 |
|
| 47 |
jint size() const; |
| 48 |
jobject get(jint index) const; |
| 49 |
|
| 50 |
private: |
| 51 |
JNIEnv* mEnv; |
| 52 |
jobject mList; |
| 53 |
}; |
| 54 |
|
| 55 |
|
| 56 |
class AxisHelper { |
| 57 |
public: |
| 58 |
AxisHelper(JNIEnv* env, jobject axis) : mEnv(env), mAxis(axis) {} |
| 59 |
|
| 60 |
jint getTag() const; |
| 61 |
jfloat getStyleValue() const; |
| 62 |
|
| 63 |
private: |
| 64 |
JNIEnv* mEnv; |
| 65 |
jobject mAxis; |
| 66 |
}; |
| 67 |
|
| 68 |
void init_FontUtils(JNIEnv* env); |
| 69 |
|
| 70 |
}; |
| 71 |
|
| 72 |
#endif |