'<(skia_include_path)/c/xamarin/sk_x_shader.h',
'<(skia_include_path)/c/xamarin/sk_x_stream.h',
'<(skia_include_path)/c/xamarin/sk_x_typeface.h',
+ '<(skia_include_path)/c/xamarin/sk_x_string.h',
'<(skia_src_path)/c/xamarin/sk_x_types_priv.h',
'<(skia_src_path)/c/xamarin/sk_x_bitmap.cpp',
'<(skia_src_path)/c/xamarin/sk_x_imagedecoder.cpp',
'<(skia_src_path)/c/xamarin/sk_x_shader.cpp',
'<(skia_src_path)/c/xamarin/sk_x_stream.cpp',
'<(skia_src_path)/c/xamarin/sk_x_typeface.cpp',
+ '<(skia_src_path)/c/xamarin/sk_x_string.cpp',
'<(skia_include_path)/c/sk_canvas.h',
'<(skia_include_path)/c/sk_data.h',
--- /dev/null
+/*
+ * Copyright 2016 Xamarin Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
+// DO NOT USE -- FOR INTERNAL TESTING ONLY
+
+#ifndef sk_x_string_DEFINED
+#define sk_x_string_DEFINED
+
+#include "sk_types.h"
+#include "xamarin/sk_x_types.h"
+
+SK_C_PLUS_PLUS_BEGIN_GUARD
+
+/**
+ Returns a new empty sk_string_t. This call must be balanced with a call to
+ sk_string_destructor().
+*/
+SK_API sk_string_t* sk_string_new_empty();
+/**
+ Returns a new sk_string_t by copying the specified source string, encoded in UTF-8.
+ This call must be balanced with a call to sk_string_destructor().
+*/
+SK_API sk_string_t* sk_string_new_with_copy(const char* src, size_t length);
+
+/**
+ Deletes the string.
+*/
+SK_API void sk_string_destructor(const sk_string_t*);
+
+/**
+ Returns the number of bytes stored in the UTF 8 string. Note that this is the number of bytes, not characters.
+*/
+SK_API size_t sk_string_get_size(const sk_string_t*);
+/**
+ Returns the pointer to the string.
+ */
+SK_API const char* sk_string_get_c_str(const sk_string_t*);
+
+SK_C_PLUS_PLUS_END_GUARD
+
+#endif
SK_API sk_typeface_t* sk_typeface_create_from_stream(sk_stream_asset_t* stream, int index);
SK_API int sk_typeface_chars_to_glyphs(sk_typeface_t* typeface, const char *chars, sk_encoding_t encoding, uint16_t glyphs[], int glyphCount);
+SK_API void sk_typeface_get_family_name(sk_typeface_t* typeface, sk_string_t* family_name);
+
+SK_API int sk_typeface_count_tables(sk_typeface_t* typeface);
+SK_API int sk_typeface_get_table_tags(sk_typeface_t* typeface, sk_font_table_tag_t tags[]);
+SK_API size_t sk_typeface_get_table_size(sk_typeface_t* typeface, sk_font_table_tag_t tag);
+SK_API size_t sk_typeface_get_table_data(sk_typeface_t* typeface, sk_font_table_tag_t tag, size_t offset, size_t length, void* data);
+
SK_C_PLUS_PLUS_END_GUARD
#endif
#define FONTMETRICS_FLAGS_UNDERLINE_POSITION_IS_VALID (1U << 1)
/**
+ A lightweight managed string.
+*/
+typedef struct sk_string_t sk_string_t;
+/**
+
A sk_bitmap_t is an abstraction that specifies a raster bitmap.
*/
typedef struct sk_bitmap_t sk_bitmap_t;
Typeface objects are immutable, and so they can be shared between threads.
*/
typedef struct sk_typeface_t sk_typeface_t;
+typedef uint32_t sk_font_table_tag_t;
+
/**
Various stream types
*/
--- /dev/null
+/*
+ * Copyright 2016 Xamarin Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "SkString.h"
+
+#include "xamarin/sk_x_string.h"
+
+#include "../sk_types_priv.h"
+#include "sk_x_types_priv.h"
+
+sk_string_t* sk_string_new_empty() {
+ return ToString(new SkString());
+}
+
+sk_string_t* sk_string_new_with_copy(const char* src, size_t length) {
+ return ToString(new SkString(src, length));
+}
+
+void sk_string_destructor(const sk_string_t* cstring) {
+ delete AsString(cstring);
+}
+
+size_t sk_string_get_size(const sk_string_t* cstring) {
+ return AsString(cstring)->size();
+}
+
+const char* sk_string_get_c_str(const sk_string_t* cstring) {
+ return AsString(cstring)->c_str();
+}
{
return ((SkTypeface*) typeface)->countGlyphs();
}
+
+void sk_typeface_get_family_name(sk_typeface_t* typeface, sk_string_t* family_name)
+{
+ ((SkTypeface*)typeface)->getFamilyName(AsString(family_name));
+}
+
+int sk_typeface_count_tables(sk_typeface_t* typeface)
+{
+ return ((SkTypeface*)typeface)->countTables();
+}
+
+int sk_typeface_get_table_tags(sk_typeface_t* typeface, sk_font_table_tag_t tags[])
+{
+ return ((SkTypeface*)typeface)->getTableTags(tags);
+}
+
+size_t sk_typeface_get_table_size(sk_typeface_t* typeface, sk_font_table_tag_t tag)
+{
+ return ((SkTypeface*)typeface)->getTableSize(tag);
+}
+
+size_t sk_typeface_get_table_data(sk_typeface_t* typeface, sk_font_table_tag_t tag, size_t offset, size_t length, void* data)
+{
+ return ((SkTypeface*)typeface)->getTableData(tag, offset, length, data);
+}
#include "SkPictureRecorder.h"
#include "SkPoint3.h"
#include "SkStream.h"
+#include "SkString.h"
#include "../../include/effects/SkDisplacementMapEffect.h"
#include "../../include/effects/SkDropShadowImageFilter.h"
#include "../../include/effects/SkMatrixConvolutionImageFilter.h"
return reinterpret_cast<sk_fontmetrics_t*>(p);
}
+static inline SkString* AsString(const sk_string_t* cdata) {
+ return reinterpret_cast<SkString*>(const_cast<sk_string_t*>(cdata));
+}
+
+static inline sk_string_t* ToString(SkString* data) {
+ return reinterpret_cast<sk_string_t*>(data);
+}
+
+
#endif